Ask Your Question

Improve image preprocessing

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

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

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


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 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

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

shreya gravatar image

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

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


here is a link to the input image

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

read this paper and try applying the method described i think it will solve your problem :

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

Question Tools

1 follower


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

Seen: 517 times

Last updated: Jan 04 '17