I am trying to develop an application which will detect the color of the face once an image is provided. I was able to find out the face detection algorithm from OpenCV and integrate it. However I could not find any example or interface by which I can detect the color of the face.
I have the logic which I am presenting. Please let me know if there is anything available for this or do I need to write the separate function for this?
Logic: in the given image area, find the color detail which is repeated mostly in the given. I have gone through the histogram and not sure how it will be of help.
Any help will be greatly appreciated.
The histogram represents the amount of pixels of a given color which are in the image.
For example, lets say you have this 3×3 image:
3 4 3
1 1 1
2 2 1
The histogram would be:
count: 4 2 2 1
color: 1 2 3 4
from this you would have that the color which is found most is the color 1. It probably also would make sense to sum up very similar color.
For example use count(2) = sum(hist(1), hist(2), hist(3)); (being hist the number of pixels in that color)