问题
Currently working on one academic project regarding color detection in android. I am trying to detect color using android cameras that would during live preview or after the picture is taken.
I am looking for something like this image. This is ColorGrab android application screenshot. Basically I wanted to identify every color as a particular one color. Lets take a example for that, suppose application detected #FF6CBB but this color is actually similar to pink but I want to mark this color as RED in my list. So Basically I want to convert all colors in basic 8 to 10 colors. So any color code which should be fall in particular range and that range should represent only one color.
In this image color code is not actually hex code of Red but we can make this detected color code in Red Color category.
Overall my program goal should be identify any color code of the color wheel as a one color among of particular 10 colors. How and which way I can compute this thing, Shall I use shortest euclidean distance between two colors?
Can anybody please tell me algorithm or way to compute this thing.
image 1
example of color distribution
回答1:
k-nearest neighbors (k=1 in your case) with euclidean distance might work in your case, because you only have 3 dimensions (this method suffer from the curse of dimensionality )
You can also expirement with different distance measures such as Hamming distance
来源:https://stackoverflow.com/questions/30497816/identify-colors-using-android-camera