How to remove boundary from binarized image

asked 2019-04-20 10:13:13 -0600

soroush gravatar image

updated 2020-10-05 12:52:12 -0600

Following images are results of a binarization algorithm on an image containing licence plate number in the middle and some noise on boundaries. I am developing an algorithm to remove those black areas, so that image becomes something like second example. (Second one is cropped manually before binarization)

So far I tried to remove black lines (horizontal and vertical) base on 1) how many black pixels they have, 2) how black pixel rate drops moving downward starting from top, or upward starting from down.

Nothing works for all images. Any suggestions?

Binarized Image

Manually cropped:

image description

edit retag flag offensive close merge delete

Comments

Look at Opencv's contour finding. You should be able to isolate just the digits by finding all the contours and filtering them by aspect ratio and area.

Chris gravatar imageChris ( 2019-04-20 15:45:29 -0600 )edit