6
$\begingroup$

I'm writing an app that recognizes Sudoku puzzles from a camera input. I'd like to remove camera blur from the images to improve recognition. Here is an example image:

enter image description here

Since I'm processing a continuous camera feed, I'm concerned about speed, since slow algorithms will degrade my frame rate. On the other hand, the technique doesn't have to be super-accurate, since I will be thresholding/binarizing the image afterwards. The deblurring algorithm I use only needs to be accurate enough so that the digits will be clear after thresholding. Here is what the image currently looks like after a segmented Otsu threshold (the threshold level is selected independently for each 3x3 grid of cells):

enter image description here

I'm looking to write an implementation that's compatible with OpenCV data structures. This means that an off-the-shelf Matlab solution isn't an option. However, I found the Matlab documentation on image deblurring to be quite helpful in understanding the general principles, as well as this site. The Matlab functions are all computationally-intensive in any case, and I wasn't able to pick an estimated point-spread function (PSR) that gave good results.

What are your suggestions for a fast deblurring algorithm that allows features to be distinguished easily by a subsequent threshold?

$\endgroup$
  • 3
    $\begingroup$ Are you sure deblurring is necessary? A neural network-based OCR should be able to recognise those blurred digits just fine. $\endgroup$ – finnw May 10 '13 at 18:52
  • $\begingroup$ I'm using a Support Vector Machine, using Histograms of Oriented Gradients as feature vectors. The recognition accuracy is low, even if the SVM is trained on blurry digits like these. $\endgroup$ – 1'' May 10 '13 at 19:23
  • $\begingroup$ You don't need to deblur, and I don't think you need to do continuous processing either. I assume you want to do some kind of augmented reality thing - take one good frame, process it in the background, then when it is done, overlay information adjusting the projection by just tracking the lines. $\endgroup$ – geometrikal May 11 '13 at 12:24
  • $\begingroup$ @geometrikal I only continuously process until I find a single valid (solvable) frame, but often I can't even do that, even if my hand is as still as possible. $\endgroup$ – 1'' May 11 '13 at 14:39
  • 2
    $\begingroup$ Some inspiration (solving sudoku using matlab and a webcam): mathworks.com.au/videos/… mathworks.com.au/matlabcentral/fileexchange/… $\endgroup$ – geometrikal May 13 '13 at 3:17
1
$\begingroup$

You only need to find and report positions of nine specific symbols. You can do this by computing correlations (done quickly by multiplying in Fourier space) with samples of the nine digits snipped from a typical puzzle image, blurred as it is. All blurred '9' will look the same, and likewise all other digits. I'm assuming puzzle images are taken with the same camera the same way.

It might work better working on high-pass filtered versions of the input puzzle image and image snips, by subtracting from each a more-blurred copy.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.