1

I am currently trying to make an application in Android that will detect this colors.

Left circle with RGB Values of (167,103,103). Middle Circle: (163,98,94). Right Circle: (134,62,66)

What I've done is convert the image into HSV then use

Core.inRange(HSV, new Scalar(0,0,0),new Scalar(0,0,0),ColorDetection ); 

How can i detect left circle, middle circle and the right circle and eventually all of them? What values should i put inside Scalar()?

DaFois
  • 2,197
  • 8
  • 26
  • 43
  • Possible duplicate: https://stackoverflow.com/questions/50449602/wrong-hsv-conversion-from-rgb/50463711#50463711 Also, [this link](http://shervinemami.info/colorConversion.html) might be helpful – Rick M. Nov 08 '18 at 12:13
  • oh, so I need to convert the RGB Values to HSV Values. i found this link [link](http://colorizer.org/) Can I use this for checking. Also I've found out that `Core.inRange` has a lower bound and upper bound. (i don't know what to call it sorry just started) so in the "upper bound" should i put the HSV values of the right circle? – John Benedict Ramos Nov 08 '18 at 12:52
  • Yes, if you are using the `inRange` function on HSV image, you should use HSV values. Also, the link provides RGB and HSV conversion values but not in the opencv range. The opencv range is different as you can see in the link I attached above – Rick M. Nov 08 '18 at 13:19
  • Thanks! The left circle is now detecting! – John Benedict Ramos Nov 08 '18 at 13:51
  • Possible duplicate of [How to define a threshold value to detect only green colour objects in an image :Opencv](https://stackoverflow.com/questions/47483951/how-to-define-a-threshold-value-to-detect-only-green-colour-objects-in-an-image) – Kinght 金 Nov 09 '18 at 00:41

0 Answers0