color detection of an image in opencv using c++
I have an image with a black background and some color. How do I print the color of the image in the console. I basically want to first convert the image to hsv and then by setting the boundary values and if my image is within the given range, it should return a value to another variable. If it is true then using if loops it should be able to print the color of the image in the console. How do I go about it? I am new to opencv and if possible please help me with the code.