Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

edge detection issue on Text detection in images

I am trying to implement Epshtein's paper(Detecting text in natural scenes with stroke width transform(2010)) on text detection in natural images. First step is edge detection.

I am getting some extra edges inside my text. How should I remove those?

Original image:

enter image description here My edge detection: enter image description here

In the example, you can see extra edges in the text 'WHY HURRY'

I have tried these steps in Matlab:

% contrast enhancement
I_adjust = imadjust(I);

% dilation & erosion
se = strel(ones(3,3));
I_dilate = imdilate(I_adjust, se);
I_final = imerode(I_dilate, se);

% gaussian smoothing
h_mask = fspecial('gaussian');
I_final = imfilter(I_final,h_mask);
figure; imshow(I_final);

BW_canny = edge(I_final,'canny');
figure; imshow(BW_canny);

Problem #2:

As per belisarius's suggestion, I found that mean-shift filter works quite well for text region segmentation. Now I am facing another problem in the implementation of Stroke Width transform(look at Epshtein's paper).

Stroke Width works well with chars like 'H''Y' even for 'S' because the corresponding edges are usually at constant distance if we proceed in the direction of gradient.

Problem comes in chars like 'W'. For one portion of left edge of 1st upstroke we get the right edge of 2nd upstoke as its correspoding edge. Whereas for another portion, we get right edge of 1st upstroke. This introduces significant variance in the stroke width of the region of 'W' leading to terming this as non-text region according to paper.

Can anyone suggest any solution?

like image 552
Kaushik Acharya Avatar asked Oct 15 '11 07:10

Kaushik Acharya


People also ask

How we detect the edge in the image?

Edge Detection Operators are of two types: Gradient – based operator which computes first-order derivations in a digital image like, Sobel operator, Prewitt operator, Robert operator. Gaussian – based operator which computes second-order derivations in a digital image like, Canny edge detector, Laplacian of Gaussian.

Which algorithm is used to detect the text in images?

A simple histogram-based algorithm is proposed to automatically find the threshold value for each text region, making the text cleaning process more efficient.

Which is the best method for edge detection?

Canny Operator; Canny edge detection algorithm (Canny, 1986) known as optimal edge detection algorithm and the most commonly used edge detection algorithm in practice.

Which filters are used for edge detection in an image?

The Canny filter is a multi-stage edge detector. It uses a filter based on the derivative of a Gaussian in order to compute the intensity of the gradients. The Gaussian reduces the effect of noise present in the image.


1 Answers

Use a Mean Shift Filter before the Edge Detection. Example in Mathematica:

i = Import["http://img839.imageshack.us/img839/28/whyhurry.jpg"];
iM = MeanShiftFilter[i, 2, .15, MaxIterations -> 10]
EdgeDetect[iM]

Outputs:

enter image description hereenter image description here

like image 191
Dr. belisarius Avatar answered Sep 18 '22 11:09

Dr. belisarius