Hellow there~ I'm working to make app. This app need feature that detect Rubik's cube color(Realtime). I'm using OpenCV to implement the feature. I try to set up ROI and I detect color in ROI. I know how to detect specific color. I used inRange function on hsv channel image. It's good working. But now I don't know how to check color on specific region. Forexample, rubik's cube color array (00)Red/(01)Blue/(02)Blue (10)Green/(11)White/(12)Orange (20)Yellow/(21)Blue/(22)White. I want to know (0,0)'s color. It's red. I use inRange function like this inRange((0,0)_image, lower_color, upper_color, color_mask). Now how to check (0,0)_image's color what is? How to know that is red? Thank you for your attention. Please let me know.
Asked
Active
Viewed 630 times
1 Answers
0
You should convert your image into HSV color space, where H stands for hue
-- that's the color. Hue 0 is red, 0.3 is about green, 0.7 is like blue, you'll figure it out quite easily.

lenik
- 23,228
- 4
- 34
- 43
-
I know that. But I don't know what is color? It mean "How do I determine which color categories the pixels fall into?" – D Why Sep 21 '19 at 03:11
-
@DWhy you may use something like a pixel clustering approach, that will put all your pixels into a several bins, please, check this post about finding the dominant colors of an image: https://stackoverflow.com/questions/43111029/how-to-find-the-average-colour-of-an-image-in-python-with-opencv – lenik Sep 21 '19 at 04:05