👻 Check our latest review to choose the best laptop for Machine Learning engineers and Deep learning tasks!
I was doing a fun project: Solving a Sudoku from an input image using OpenCV (as in Google goggles etc). And I have completed the task, but at the end I found a little problem for which I came here.
I did the programming using Python API of OpenCV 2.3.1.
Below is what I did :
- Read the image
- Find the contours
- Select the one with maximum area, ( and also somewhat equivalent to square).
Find the corner points.
e.g. given below:
(Notice here that the green line correctly coincides with the true boundary of the Sudoku, so the Sudoku can be correctly warped. Check next image)
warp the image to a perfect square
eg image:
Perform OCR ( for which I used the method I have given in Simple Digit Recognition OCR in OpenCV-Python )
And the method worked well.
Problem:
Check out this image.
Performing the step 4 on this image gives the result below:
The red line drawn is the original contour which is the true outline of sudoku boundary.
The green line drawn is approximated contour which will be the outline of warped image.
Which of course, there is difference between green line and red line at the top edge of sudoku. So while warping, I am not getting the original boundary of the Sudoku.
My Question :
How can I warp the image on the correct boundary of the Sudoku, i.e. the red line OR how can I remove the difference between red line and green line? Is there any method for this in OpenCV?
👻 Read also: what is the best laptop for engineering students?
We hope this article has helped you to resolve the problem. Apart from How to remove convexity defects in a Sudoku square?, check other COM PHP module-related topics.
Want to excel in Python? See our review of the best Python online courses 2023. If you are interested in Data Science, check also how to learn programming in R.
By the way, this material is also available in other languages:
- Italiano How to remove convexity defects in a Sudoku square?
- Deutsch How to remove convexity defects in a Sudoku square?
- Français How to remove convexity defects in a Sudoku square?
- Español How to remove convexity defects in a Sudoku square?
- Türk How to remove convexity defects in a Sudoku square?
- Русский How to remove convexity defects in a Sudoku square?
- Português How to remove convexity defects in a Sudoku square?
- Polski How to remove convexity defects in a Sudoku square?
- Nederlandse How to remove convexity defects in a Sudoku square?
- 中文 How to remove convexity defects in a Sudoku square?
- 한국어 How to remove convexity defects in a Sudoku square?
- 日本語 How to remove convexity defects in a Sudoku square?
- हिन्दी How to remove convexity defects in a Sudoku square?
San Francisco | 2023-01-30
Maybe there are another answers? What How to remove convexity defects in a Sudoku square? exactly means?. Will get back tomorrow with feedback
Rome | 2023-01-30
Thanks for explaining! I was stuck with How to remove convexity defects in a Sudoku square? for some hours, finally got it done 🤗. I just hope that will not emerge anymore
Boston | 2023-01-30
Maybe there are another answers? What How to remove convexity defects in a Sudoku square? exactly means?. Will get back tomorrow with feedback