The GetDPI Photography Forum

Great to see you here. Join our insightful photographic forum today and start tapping into a huge wealth of photographic knowledge. Completing our simple registration process will allow you to gain access to exclusive content, add your own topics and posts, share your work and connect with other members through your own private inbox! And don’t forget to say hi!

Rubik Cube Detection

A

amirian

Guest
Hi to All
This is my first post here.
I'm writing an image processing code on mobile phones to detect a 3D 3*3*3 rubik's cube in the input image. The image is in YUV420SP color space and contains a view of 3 faces of the cube as follows. These are my problems:
1) In order to detect each cube color, I want to partition the image pixels to: 1)White 2)Yellow 3)Black 4)Blue 5)Red 6)Green 7)Orange and 8)Other
1.1- Which color space best meets my requirements?
1.2- How to convert it from and to YUV420SP?
1.3- What partitioning thresholds should I apply to image colors in the selected color space

2) I want to extract the coordinates of each 3 viewable faces in order to find each cube color. I found it best operable to apply straight line detection, find the lines intersections and use the 6 outer intersections making a hexagonal as the 3d cube corners. How should I implement this special issue to run fast? The image may contain more straight lines in the background. Please help me also with the line detection algorithm. I have programming skills and want to write in java.


Uploaded with ImageShack.us

Any guidelines would be appreciated.
 

Bob

Administrator
Staff member
I am not sure I can help you much, but there are issues involving color space and line detection all over the place LOL
First I am assuming that you are using a video codec to obtain that image due to the color space you are using.
A difficulty I think you may have is color detection reliability with a warm illuminant which will reduce the yellow-orange contrast significantly. I am most worried about reliable differentiation between white yellow and orange.
I think that you can count on at least one white square. and under most illuminants it would have the least difference between r g abd b, if so, that might be useful in color adjusting the rest by simple yellow-blue bias.
Perhaps background separation might be best performed by hexagon detection and using that hexagon to limit the detection area.
Colorspace conversion in java is notoriously inefficient so it might be best to avoid it completely if possible.
Perhaps a simple rgb separation of the hexagon enclosed area might be best then looking for channel differences maxima?
-bob
 
Last edited:
A

amirian

Guest
Thanks for you reply. Your idea helps me sure in the issue. But please explain me about 2 instances you mentioned as I don't have image processing experience enough: 1- hexagon detection (how to) 2- channel differences maxima
Thanks
 
Top