Ask Your Question
0

Improve image preprocessing

asked 2017-01-04 05:15:34 -0600

updated 2017-01-04 05:49:39 -0600

I am trying to make image processing algorithm before proceeding to an OCR procedure.

Since the OCR fails. I needed to make a preprocessing in order to get better accuracy.

I am providing sample code used here and also the input and result image.

Mat image = imread("address2.jpg");

Mat gray_image;
cvtColor(image, gray_image, CV_BGR2GRAY);

Mat bluredImage;
GaussianBlur(gray_image, bluredImage, Size(1, 1), 0);

Mat threshImage;
threshold(bluredImage, threshImage, 0, 255, THRESH_OTSU);

imwrite("result.jpg", asd);

And here is input image

image description

and the result image here

image description

If you look close the dotted area is the problem.

Could you give me advise how to optimize the image processing? What kinds of procedures are needed to improve the OCR output?

edit retag flag offensive close merge delete

Comments

GaussianBlur + OTSU thresholding will only get you so far... OTSU is a global method, while you are looking for a local segmentation method...

StevenPuttemans gravatar imageStevenPuttemans ( 2017-01-05 02:59:00 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
2

answered 2017-01-04 09:28:22 -0600

shreya gravatar image

updated 2017-01-04 09:29:25 -0600

you should search for stroke width transform for text detection and try to segment characters by that method and then use ocr. can you provide a link to theinput image

edit flag offensive delete link more

Comments

here is a link to the input image

bystro gravatar imagebystro ( 2017-01-04 10:20:21 -0600 )edit

read this paper and try applying the method described i think it will solve your problem :http://cmp.felk.cvut.cz/~cernyad2/TextCaptchaPdf/Detecting%20Text%20in%20Natural%20Scenes%20with%20Stroke%20Width%20Transform.pdf

shreya gravatar imageshreya ( 2017-01-05 01:22:53 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-01-04 05:15:34 -0600

Seen: 1,119 times

Last updated: Jan 04 '17