I'm looking forward to developing a Rubik's Cube solver (just for fun). For this, the user would take a picture of the cube in a way that three sides of it are visible, like in this picture:
cubeA.jpg:
It can be safely assumed that the cube is covering most of the picture. Now, what I would like to do is detect the exact orientation of the cube. That is, I am interesting in detecting these seven points:
cubeB.jpg:
From this, I would be able to split each of the three faces into 3x3 grid and detect the colors (for which I have already written the code and which works quite well).
Now, I have made a few attempts to solve this problem using corner detection and contour extraction in OpenCV. None of them have been satisfactory, however. Another way of looking at this problem would be to recognize each of the 27 little, so-called “facelets”, and detect the orientation using those. But I'm not sure if that's the right approach either.
How would you go about solving this problem using OpenCV?

