Rella Rella - 1 year ago 68
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?

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download