1
$\begingroup$

I am working on an arabic OCR for printed scanned documents ... Some of the scanned documents may written with font size of height 8 which is quite small ... I want to resize the height to 60 pixels but some artifacts may occur due to nature of arabic characters .. some characters may overlap .I had used local thresholding methods after resizing but the results are still not acceptable ... any ideas ?

This is an example image:

Image 1

This is the same example after resizing and applying local adaptive thresholding using 50 as a window size:

Image 2

As you can see there are some discontinuities in some characters like this one :

Image 3

Is there is any method to resize the image while preserving textual shape ?

My approach to fix characters discontinuities :

  • Threshold original image before resizing using local adaptive threshold using window size of 16 (this will solve characters discontinuities but the holes in the characters are filled) call it smallbw.

  • Resize smallbw using imresize(smallbw, [nh nw], 'nearest') and fill the holes in characters using imfill

  • Resize the original image to height 60 pixels using imresize(originalIm, [nh nw], 'nearest') call it largebw

  • Fill holes in largebw using imfill and call it bwfill

  • Extract holes from largebw by bwholes = bwfill - largebw

  • Finally, subtract bwholes from smallbw to get this

Image 4

you can see here that the discontinuity found in the character @Image 3 has been solved ... but there is another problem raised here some characters may overlap as shown here

Image 5

This is the best results I could achieve so far ... are there any other ideas that may solve these issues ?? and if you think this issue has no solution how would I resolve it rather than using resizing? what about using 12 font size text instead of 8?

Useful links : Local adaptive threshold method used

Operating system : windows 7

Programming environment : Matlab 2013a - Image Processing toolbox

$\endgroup$
  • $\begingroup$ Cross-post on stackoverflow $\endgroup$ – mbschenkel Feb 28 '15 at 12:15
  • $\begingroup$ @mbschenkel I know that sir .. I did this because they advised me to post it here on dsp.stackexchange $\endgroup$ – Ibrahim Amer Feb 28 '15 at 22:08
  • $\begingroup$ I know that from the comments there. The official policy is to have a moderator migrate your question to a different site or to delete it and re-ask. But as long as it exists on both sites, a user comming across it on one, might not be aware of it on the other and potentially misses out on a good answer. That's why I put a link here and there. $\endgroup$ – mbschenkel Mar 1 '15 at 20:33
1
$\begingroup$

I think you could specify a higher DPI for higher 'resolution' (which effectively changes the pixel number of your image) in loading the data.

Resizing the data will usually cause small changes to your data that are usually irreversible (unless you know exactly the correct parameters for resizing).

$\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.