Get the color of an object

asked 2016-08-11 22:23:15 -0600

Cheqrd gravatar image

Hello,

I am trying to extract the dominant color of an object for color analysis but It seems like I don't get the true color using Core.mean() [RGB] in OpenCV3. Do we have a way to get the dominant color or the actual color of an object?

Here's my sample image.

image description

and Here's the result after Core.Mean();

image description

Hope someone will guid me. TIA

edit retag flag offensive close merge delete

Comments

1

Core.mean() returns a Scalar, not an image, so i wonder , how you got that weird result.

berak gravatar imageberak ( 2016-08-11 23:59:38 -0600 )edit

I got it form getting the Scalar.val from the function. And that's what I got in return. and then I put it into the largest area of the image which I got from using K-Means Color clustering.

Cheqrd gravatar imageCheqrd ( 2016-08-12 00:11:22 -0600 )edit

maybe it gets better, if we can see your code ?

berak gravatar imageberak ( 2016-08-12 08:54:51 -0600 )edit