I have an image of a dice. I want to count the number of dots. I first tried just separating it using the color of the dots and reading the number of connected paths. But it is failing since the photo contains a tilted image of the side face also. So I tried Hough circles.
circles = cv2.HoughCircles(detected_edges, cv2.cv.CV_HOUGH_GRADIENT, 1, 10, circles, 105, 10, 10, 15)
This is the code I tried. But it is not detecting the correct circles. When I looked the diameter of the dots, it was around 12-15 pixels and the minimum distance between the pixels were 14-16 pixels. I am not sure about setting the param1
and param2
values. As I saw in the documentation, I used 105 since it worked for Canny
method. Can somone help me in resolving this?