2015-12-22 00:06:15 -0600 | commented question | Trouble extracting number in Sudoku grid Thank you for pointing out the website. I am basing my work on what has been posted in the link. I thought that instead of blindly copy pasting the code there, I can try my own approaches so that the learning process would be better. |
2015-12-20 08:04:07 -0600 | commented question | Trouble extracting number in Sudoku grid I have added the code |
2015-12-20 07:48:20 -0600 | received badge | ● Editor (source) |
2015-12-20 05:45:33 -0600 | asked a question | Trouble extracting number in Sudoku grid I am trying to build a Sudoku grabber using OpenCV. I have so far been able to get the boundary of the puzzle and apply a perspective transform to get a bird's eye view. In the next step, I am having trouble detecting the numbers in the individual boxes. Note: I do not get a perfect square after the perspective transformation. I have some convexity defects at the top. I am not overly worried about that. In each individual box, I am trying to extract the number using cv2.findContours and filtering out the number based on aspect ratio and area. The problem I face during this step is that the contours are so disjoint, I am certain they are going to wrongly recognized by the OCR system which is the next step. I have attached the image after the perspective transform and also the contours which I have obtained in a few cases. Edit: 1) I have added the relevant code 2) I have not described the aspect ratio and area code. I wanted to see why there was a single contour for some numbers and multiple contours for some others. figure_1.png figure_1_actual.png figure_2.png figure_2_actual.png figure_3.png figure_3_actual.png |