Image denoising techniques to improve the performance on optical character recognition.
Trang 1VietNam National University University of engineering and technology
Project exam AWARDS “STUDENT RESEARCH”
Hanoi - 3-2012
Trang 2Abstract 4
List of pictures: 5
List of Graph 6
1 The importance of the optical characters recognition 7
II Problems and knowledge bases 7
III The research about algorithms 9
a The algorithm denoise by filter 9
i Median filter 9
ii Average filter 11
i Global threshold 14
ii The local adaptive threshold 16
iii The global threshold using the Otsu’s method 17
iv The local adaptive threshold using the Sauvola’s method [3] 19
4.1 Build Module Image denoising 21
4.2 Build the automaticaly test data 22
4.3 The result of experiment 22
4.4 Conclusion 23
Picture 12: 26
V Reference 27
[1] Ben Weiss Shell & Slate Software Corp Fast Median and Bilateral Filtering 27
[2] V.R.Vijaykumar, P.T.Vanathi, P.Kanagasabapathy Fast and Efficient Algorithm to RemoveGaussian Noise in Digital Images 27
Trang 3[3] Faisal Shafait Daniel Ke ys ers T homas M Breuel Efficient Implementation of Local Adaptive Thresholding Techniques Using Integral Images 27 [4] NUCHAREE PREMCHAISWADI SUKANYA YIMGNAGM WICHIAN PREMCHAISWADI A Scheme for Salt and Pepper noise Reduction and Its Application for OCR Systems 27 [5] T Kasar, J Kumar and A G Ramakrishnan Font and Background Color Independent Text Binarization 27 [6] Julinda Gllavata, Ralph Ewerth and Bernd Freisleben FINDING TEXT IN IMAGES VIA LOCAL THRESHOLDING 27 [7] Graham Leedham, Chen Yan, Kalyan Takru, Joie Hadi Nata Tan and Li Mian Comparison of Some Thresholding Algorithms for Text/Background Segmentation in Difficult Document Images 27
Trang 4This report will show you our research about the image denoising algorithms for alltypes of document images to receive a better image for the optical character Weresearch in two main ways: the filter and the binarization algorithms Our target is
to build an image denoising module that has three features.The first one, it canperform all sizes of image The second one, it denoises all colors of character orbackground And the last one is the denoising without depending on any parameters
to run We evaluated the module rely on the set of vary test cases and we get betterresults for the first steps
Trang 5List of pictures:
Picture 1: The matrix describing the histogram value of the image pixels
Picture 2 (a)Random color noise image (10%) (b) Denoised Image with windowsize = 5x5
Picture 3: (a) Ran color noise image (10%) (b) Denoised Image with window size =3x3
Picture 4: The matrix describing the value of the image points
Picture 5: The experiment using Average filter algorithm
Picture 6: Experiment using the global threshold algorithm
Picture 7: Experiment using the global threshold algorithm
Picture 8: [a] The noised image [b]The image after changing into gray [c] The imageafter being used local adaptive threshold algorithm thanks to Otsu’s method [d] Theimage after being used the median filter method choosing c as the input image
Picture 9: Experiment using the Otsu threshold algorithm
Picture 10: Experiment the local adaptive threshold using Sauvola’smethod,Window size = 3
Picture 11: experiment the local adaptive threshold using Sauvola’s method Windowsize = 5
Picture 12: experiment the local adaptive threshold using Sauvola’s method Windowsize = 5
Trang 6List of Graph
Graph 1: Experiment using the filter for all test sets
Graph 2: Experiment using the binary threshold algorithms for all test set
Trang 7I Introduction.
1 The importance of the optical characters recognition.
The system of optical characters recognition is the system which
by scanning, photographing, recording image documents) into text files sothat computers can totally encrypt.The purpose of this system is to change
documents in order to save or make a public property in the internet; classifycharacters and change it into the input of other systems such as: machinetranslation, text-to-speech and text mining…( Attending to universal life).These systems brought about the remarkable effects; threfore manyprojects’ve developed for a long time and got many great achievements
The research and improvement systems which raise productivity andspeed stated above had got good results Thanks to improving image inputpreprocessing , reducing the noise without losing the information of theimages,module image preprocessing bettered the results of the recognitionprocess
2 There are 3 principal parts in our research:
- The knowledge base: this part will show us the role of input images
images along with handling the image noise; concepts togetherwith classifying the noises in the documentary images processing
- The research content: researching the algorithms about reducing
- The conclusion: Realizing implement of algorithms was researched
comparison algorithms
II Problems and knowledge bases
The image preprocessing for the optical characters recognition isextremely important It considerably influences on the results of therecognition, specially, with highly pratical application,the quality of input images
Trang 8isn’t usually good.The results of the noise reduction will help the systemdetermine character areas, separate characters along with choosing their
image documents which we got, will be highly efected by external factors such
dust in the surface of the documents…Thanks to the association of the factors, we
we can apply many algorithms to solve the noise reduction problems Each ofthem will treat special and obvious noise
created by gathering image points having different values in colour The colour ofeach image point is created by the mixture of 3 colours: Red, green, blue (RGB).Therefore, the image processing is the change in the colour values at every imagepoint The noise reduction system will automatically count up parameter values
of the image and output threshold values as well as the automatical noisereduction
The conception of the noise image:
The noise image is the phenomenon which the random image points
of the images are effected by outside factors Therefore, they’ll creat imagepoints having unusual colours, intensities These images made thecharacteristic of their inside objects change
The noise classification in the documentary images
1 Salt and pepper noise
The random pixel appearance of the images has unusual colours.The noise image pixel is scattered and irregular The usual size of thenoise is little
2 The noise in the contrary light and the light indensity
The contrary noise, the increasing or decreasing light intensity isthe phenomenon which the outside light directly effect on the lens ofcamera or the surface of the object taken photograph This noise willinfluence on the image pixels, make the inside objects of the image intodim For that reason, we can’t discriminate colors between the objectsand the background
Trang 93 The wave image noise
This is the phenomenon which the image is taken photographfrom the image sources having low scanning frequency This noiseleads to the different colors of ripples in the image
4 The random color of the charaters and the background image
This is the phenomenon that there is a particoloured difference
in an image Besides, the background also contains the diversity of thecolor gram, which causes the color noise when we want to changecharacter images into monochromatic
Some algorithms were used to reduce the documentary image noise
Methods to reduce the noise by filter
1 Median filter
2 Gaussian filter
3 Average filter
4 Kfill filterMethods to reduce the noise by binarization algorithms
5 The global threshold
6 The local Adaptive threshold
7 The threshold binarization algorithms use Otsu method
8 The threshold binarization algorithms use Sauvola’s method
III The research about algorithms
a The algorithm denoise by filter
Trang 10the value of centre image points Different sizes of the scanningwindow will create different speeds of the algorithms
121
124
134
120
11512
2
119
120
117
11912
0
126
124
118
12012
4
123
119
121
12212
3
122
117
120
119
Picture 1 The matrix describing the histogram value of the imagepixels
For example, an image with the histogram value of the imagepixel as above, if the size of the scanning window is 3*3, the value ofthe scanning window is:
119
120 117 126 124 118 123 119 121
by the value of the image pixel being the middle position of the example
Pseudocode:
OutputImage[image width][image height]
windowColor[image width][image height]
beginX := (window filter width / 2) rounded down beginY := (window filter height / 2) rounded down
Trang 11for x from beginX to image width - beginX for y from beginY to image height - beginY allocate windowColor[window filter width][window filter height]
for fx from 0 to window width for fy from 0 to window height windowColor[fx][fy] := inputImage[x + fx -beginX][y + fy - beginY]
sort all entries in windowColor[][]
OutputImage[x][y] := windowColor[windowfilter width / 2][window filter height / 2]
The characteristic of the algorithm:
- This algorithm usually makes their images dimmer;therefore, it is suitable for image preprocessing to recognizecharacters
Sample :
Picture 2.(a) Random color noise image (10%) (b) DenoisedImage with window size = 5x5
Trang 12
Picture 3 (a) Ran color noise image (10%) (b) Denoised Imagewith window size = 3x3
ii Average filter
The basis idea of the algorithm: Using the centre value ofthe arround its position instead of the value of each image point.The speed of the algorithm and the choosen value will changedepend on the size of the matrix window
This algorithm uses a scanning window which has fixedsize Then, it will accompany this window through in turn everypixel of the image At each of that pixel, if that average value’ssuitable with a threshold value θ which is the standard deviationthe algorithm will caculate the average value of all neighborspixel as well as imputing the value to the centre pixel thanks tothe intensity values of the arround image pixels
Trang 13For example, a picture with the image points as above; ifthe size of the scanning window is 3*3, comperation thresholdvalue θ = 3 y, the value of the scanning window is:
119
120 117 126 124 118 123 119 12
1
The average value Av = (119+120+117+126+124+118+123+119+121)/9=120Since the value |image color - Av|>0, the value of the imagepoint’ll be 120, instead of the first value of the exam
OutputImage[image width][image height]
windowColor =0 beginX := (window filter width / 2) rounded down beginY := (window filter height / 2) rounded down for x from beginX to image width - beginX
for y from beginY to image height - beginY allocate windowColor[window filter width][window filter height]
for (fx from 0 to window width){
for (fy from 0 to window height){
windowColor += inputImage[x + fx beginX][y + fy - beginY]
}}
{
OutputImage[x][y] = inputImage[x][y]}else{
}Experiment :
Trang 14Picture 5 The experiment using Average filter algorithm.
iii Gaussian filter [2]
The basis of the algorithm: With each of the image pixel havingthe value of the intensity of the image pixel Oij, the equivalent valuewith the noise image is: Xij= Oij+Gij Each of the noise value G is drawn
by zero-mean Gaussian distribution Many Gaussian noise reductionalgorithms demand standard deviation and consider it as a measure ofthe eliminating image pixel by setting thresholds
Pseudocode The mask is
The formula for the estimation of Gaussian noise standard
The noise image is taken as X
Trang 15The noise standard deviation (SD) is found out usingImmaekaer’s fast method
Absolute difference AD = |Sij – Xij|
If the absolute difference AD < (SF*SD) (where SF is thesmoothing factor and SD is the standa rd deviation), storethe corresponding pixels in a one dimensional array asDA(x)
If the number of elements in the DA(x) is at least (2*W) -1(where W is chosen to be 3 for a 3 x 3 window) then themean of DA(x) is calculated and replaced it at the centerpixel X(i,j) of the window.SD = 20, SF =2
With the size of scanning window is 3x3 then W = 3
b The research noise reduction algorithms by the threshold methds.
i Global threshold
The basis of the algorithm: Using the only threshold with all ofthe image pixel of the image, which causes bad consequences fordistinguishing characters and the background On the other hand, thealgorithm can not recognize characters if the objects or characters ofthe colour images have more light colour than that of the ordinarydocument
Counting up this value threshold can be based on some formulas
Step 1:Initial the initial threshold T for all pixels(regularly,
T is the average value of histogram image)
Trang 16Step 2: Using threshold T to separate the image to twodomain object: D1 involve all pixels that have intensity >
T and D2 involve all pixel that have intensity ≤ T
Calculate the average intensity value of all pixel in D1
Calculate the new threshold T:
T = 1 + 2 / 2μ μRepeat step 2 to get better threshold
The peculiarities of the algorithm:
With the images having 2 obvious colour objects, this algorithmhas a quite good result With the images having many colour objects, ithas some wrong results
The caculation threshold consists of some repeats in the second
every objects
The algrithm has difficulties with the execution time, it takes toomuch time to calculate the global threshold
Some experiments:
Trang 17Picture 6: Experiment using the global thresholdalgorithm.
Picture 7: Experiment using the globe threshold algorithm
ii The local adaptive threshold
The basis of the algorithm: This algorithm is a relationalgorithm with the global threshold algorithm This algorithmdevides the image into many fixed little parts.Then, it will help uscalculate the threshold value of every part instead of calculatingthe threshold value of all image pixels Each of these threshold will
Trang 18be applied repectively with their little part and when totalling, wewill have a binaried big image.
The characteristics of the algorithm:
- Having good results for image noise by the small areas or image
is noised by the light with multi directions and intensities
- The result of this algorithm is better than that of the globalthreshold algorithm
iii The global threshold using the Otsu’s method
The basis of the algorithm: it is one of the oldest and themost used binarization techniques in image processing Assuming
a bi-modal distribution within the gray scale histograms of theimage, it aims automatically at selecting an optimal threshold T to
within (T) of two modes, or
between (T )
The details of the algorithm: After the statistic about thegreyscale detail of the input document, we will have a chart
the objects of the image The documentary image has 2 top Thefirst top will express characters, the other will express thebackground
The best threshold is the threshold that the differencebetween two areas of the historam graph is maximum The value
σ b2 is defined :