1

I am trying to use opencv's simple blob detector to determine the colors on the face of a Rubik's cube. I have been using this fantastic resource so far and it has proved to be very helpful and descriptive. After a fair bit of tweaking, I have been successful in making good filters for each color. I look at the x and y position of each color blob, and since the cubies have an even spacing, do a quick rounding division to determine which row and column they belong in, with groups of two being split and belonging in two different rows/columns respectively.

This is more of a curiosity question than anything else. To my eye, it looks like the centroids are being calculated incorrectly... shouldn't the drawn circle be more centered in each blob? Yet both seem to be sticking out arbitrarily to one side.

Below, I have the original image of the cube, and two of the color filters, the top for green, and the bottom for blue.

original image seeminglu inaccurate centroids

As you can see, the green and blue blobs are positioned correctly, and should be far enough away from each other to be classified into separate rows, but the centroids visually seem to be skewed from the centers of the blobs (green centroid should be more to the right, and blue more to the left). Is there something that I am not picking up on here? Is this just a quirk of the system?

  • You need to post your code! I'm going to guess that you need to invert your binary images. I'm assuming from your pics that you're looking at the centers of the *white* space in your images, which is why it skews out of the black space. – alkasm Apr 02 '18 at 16:54

0 Answers0