Site Sponsors
Results 1 to 3 of 3

Thread: Rubik Cube Detection

  1. #1

    Rubik Cube Detection

    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

    Any guidelines would be appreciated.

  2. #2
    Administrator Bob's Avatar
    Join Date
    Oct 2007
    Prescott, Arizona
    Post Thanks / Like

    Re: Rubik Cube Detection

    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?
    Last edited by Bob; 27th September 2010 at 05:45.

  3. #3

    Re: Rubik Cube Detection

    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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts