Sudoku Area Detection in Image

I would like to ask another question related to How to remove bulge defects in Sudoku Square?

I implemented Sudoku Solver in OpenCV-Python and it works very well. But at this time I made an assumption that would simplify my problem.

Assumed: Sudoku boundary(square) is the biggest blob in the input image

For instance:

enter image description here

The red block is the detected square. You can see that it covers the main part of the image.

Problem:

The problem is nothing but an assumption. If sudoku square has another square around it, method fails. Or if the image has another bigger blob than the sudoku square, again method fails.

For example, take an image . (I don’t want to load the original image here, it is quite large, also I want to load the result anyway)

I tried several of the following methods to find the sudoku square in this image:

1) Find the biggest blob

Then I got a red area. Method Failed .

enter image description here

(Image reduced from original image to reduce size)

2) Find only square regions

You can see that there are many candidates, especially KING CROSSWORD , which is similar to Sudoku. Method again fails

In short, this image has everything, to fail me.

Question:

How to detect a sudoku square in an image, especially in the test image i gave? Is there any better algorithm for this?

UPDATE: After reading some answers and comments, I think I should give an update. Take a look at the image below:

enter image description here

This image has a sudoku question and a previous sudoku answer. Both are the same. I think subblock searching or OCR testing will not work here.

+6
source share
1 answer

Why not check every big square / blob? Only those who have 1) 9X9 subqueries 2) Numbers in some subqueries 3) Without darkened subqueries are sudoku.

+5
source

Source: https://habr.com/ru/post/914610/


All Articles