help with OCR application - Matlab

2019-07-16 13:52发布

问题:

I'm really need your help, I'm desperate.

I'm trying to build an OCR application and I'm facing some problems that I can't solve alone. for now I'm cutting the plate form the image and doing some filtering to reduce the noise. for example, this is the plate after cutting it from the image and after filtering:

now because that the plate is in angle and because that there is still noise (like above the numbers 9 and 3), the identification process(using corr2) is giving me the wrong numbers.

eg:

as you see the only problem is in the numbers 9 and 3(at the left side) where the noise is disturbing.

I thought to stretch the image so that each number will fit all the square (without the black lines at the top), but I can't find any method to do this that it will work for every image.

EDIT: this is the results from the corr2 function, I marked in red the results of the numbers 9 and 3.

please give me an idea or working solution...

any help will be greatly appreciated.

回答1:

You may pre-process the image you posted in a previous question:

with something like: (code in Mathematica)

Dilation[
   DeleteSmallComponents[
        Pruning[
            Thinning@
                Binarize[
                   ColorSeparate[
                      ColorNegate@yourColorImage, "HSB"][[3]], 
                .92], 
        10], 
   30],
3]

Result:

Now your OCR should pass without much trouble, like this one:

Edit

A step by step procedure posted in your other question