# Deblurring algorithm to precede thresholding - speed over accuracy

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:

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):

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?

• Are you sure deblurring is necessary? A neural network-based OCR should be able to recognise those blurred digits just fine. Commented May 10, 2013 at 18:52
• 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.
– 1''
Commented May 10, 2013 at 19:23
• 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. Commented May 11, 2013 at 12:24
• @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.
– 1''
Commented May 11, 2013 at 14:39
• Some inspiration (solving sudoku using matlab and a webcam): mathworks.com.au/videos/… mathworks.com.au/matlabcentral/fileexchange/… Commented May 13, 2013 at 3:17