Ask Your Question
0

Is there any way to thin out the characters after Otsu thresholding?

asked 2019-04-24 08:50:10 -0600

wdesert gravatar image

updated 2019-04-24 09:24:00 -0600

Hi

I am trying to segment all the characters (see the image below) and there is one issue I still can't solve. THRESH_OTSU works the best with the only exception that it merges some characters.

When I tried to use adaptive thresholding, there was no problem with character merging but I was unable to control the parameters so that it could work for most images.

I know that some combinations of erosion and dilation might work in such cases. Trouble is, even though the characters get thinner as a result of erosion, the areas between the characters only increase. Probably, I am misusing/misunderstanding erosion.

Thanks in advanced for any suggestions.

image description

image description Here's the source image.

image description Unlike the more classical case of car number plates, the font is often black on a light background. This is why I have to count the number of contours or rects returned by minAreaRect to invert the image in such cases.

edit retag flag offensive close merge delete

Comments

could you add the original images

sturkmen gravatar imagesturkmen ( 2019-04-24 09:12:09 -0600 )edit

@sturkmen, sure. Added two sources images

wdesert gravatar imagewdesert ( 2019-04-24 09:24:08 -0600 )edit

have you tried segmenting with kmeans clustering? adjusting the number of clusters might give you the segmentation you want

blooper98 gravatar imageblooper98 ( 2019-04-24 12:18:30 -0600 )edit

You can skeletonize the image, to thin it out: http://felix.abecassis.me/2011/09/ope...

sjhalayka gravatar imagesjhalayka ( 2019-04-24 20:56:08 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2019-04-24 14:16:53 -0600

Would template matching be an option for you? When I set up a template around the first zero, and searched in the remainder of the image, the 2nd zero was found with a high matching score.

image description

edit flag offensive delete link more

Comments

I haven't tried template matching. Do I understand correctly, I can use a set of letters and digits and templates and search for them?

I guess that it will not work well for skewed images

wdesert gravatar imagewdesert ( 2019-04-24 22:08:38 -0600 )edit

Yes, template matching is sensitive to scale and rotation. But if your digits are upright and consistent scale, template matching works well.

Chris gravatar imageChris ( 2019-04-25 07:32:53 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2019-04-24 08:50:10 -0600

Seen: 249 times

Last updated: Apr 24 '19