Ask Your Question

I have an image which has black and another color. How do I check if it is within range and print the color?

asked 2016-11-03 09:18:19 -0500

Prototype gravatar image

updated 2016-11-05 11:18:11 -0500

I basically want to convert the image to hsv and then place boundaries. If it is within the given boundary it should print the color. For example if it is within the hsv region of red which I define, It should return a boolean value like 1 or 0 to another variable and using "if loops", I should be able to check and print it. How do I go about it and if possible please help me with the code. Thanks in advance.

Sample image : image description

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2016-11-03 11:03:42 -0500

Tetragramm gravatar image

Check out the tutorials. They're very useful. For example, THIS one is about the inRange function.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2016-11-03 09:18:19 -0500

Seen: 148 times

Last updated: Nov 05 '16