0

Suppose I have gray-scale photographic pictures of texts sheets. Each sheet of paper is exactly white and text is exactly black.

Unfortunately, the light is not uniform, also perspective shading occurs, also sheets of papers may be curved. Of course, there are some small hi freq noise on an image.

I AM SURE that there should be nearly IDEAL solution to separate text and background in this situation.

So what is it? :)

I don't believe it is impossible or even hard to turn such gray-scale images into nearly perfect black and white pictures. I cant prove this but I judge on my own perception: I need no any intelligence to recognize such pictures by an eye. They can be in any language even unfamiliar, but I will SEE what is written exactly.

So, how to teach computer to do the same?

UPDATE

Consider original image

enter image description here

Any global thresolding will cause artefacts (1) and nonuniform text representation (2)

enter image description here

I need some thresolding, which looks for local statistics.

Suzan Cioc
  • 29,281
  • 63
  • 213
  • 385
  • you would remove noise, noise are usually loose contents, you would fade them with surrounded color, well you need to set black completely colors that less than from range (127,127,127), and do it as white from higher range, just do it and see the output, would you provide a sample image? –  Jun 29 '13 at 14:33
  • 1
    See my answer [here](http://stackoverflow.com/questions/17089366/threshold-to-amplify-black-lines/17091265#17091265). – beaker Jun 29 '13 at 15:48

1 Answers1

1

Switch to adaptive thresholding.

Here you will find some introduction - http://homepages.inf.ed.ac.uk/rbf/HIPR2/adpthrsh.htm

Adaptive thresholding is designed to deal with exactly this kind of problems.

jnovacho
  • 2,825
  • 6
  • 27
  • 44
  • I regard thresolding as final part of processing. Before thresolding, the image should be processed reversible. – Suzan Cioc Jun 30 '13 at 10:38
  • Then I don't really understand what are you trying to achieve. Any algorith which changes image to black and white only is not reversible. Also if you want BW image, why additional preprocessing, when you can get the desired result in one step? Tu further improve the result, you can apply morphological operation to resulting BW image. Those operations will further increase the quality of result. – jnovacho Jun 30 '13 at 10:51