Rella Rella - 6 months ago 33
C Question

How to create openCV image of certain (R, G, B) color and get that color name?

I need to create an image filled with some (R,G,B) color. And get that color name like some (R,G,B) = black or red and so on. Can we do such thing with openCV, and how to do it?


opencv doesn't create images with a color, easiest way is either a fill or just draw a filled rectangle with the chosen color.


There isn't (AFAIK) a function to return the color name, easiest way is to get a list of colors from somewhere and check the RGB values against the pixel. If you need a closest rather than exact match (rememebr there aren't names for all 244bit colors!) look at HSV color space