Page 1 of 1

Different Results from 6.8.9-9 vs 6.9.9-40

Posted: 2018-04-21T01:10:59-07:00
by terr
I am trying to do a convert on an image of a document so that it cleans up the noise and lets the text standout for OCR. I am running ImageMagick version 6.9.9-40 locally and get good results. When I run the same call in a Google Function which uses version 6.8.9-9 I get a totally different result. I am not sure if this is due to the version or something else.

How much of a difference is there when running this command on these two versions?

convert bill.jpg -colorspace gray -lat 60x60-2% -define connected-components:mean-color=true -define connected-components:area-threshold=12 -connected-components 4 -depth 2 -compress Group4 bill-mod.jpg

Thanks.

Re: Different Results from 6.8.9-9 vs 6.9.9-40

Posted: 2018-04-21T09:50:21-07:00
by fmw42
Please post your bill.jpg image to some free hosting service and put the URL here so we can test your command.

Note that -connected-components was only officially available as of 6.8.9.10. So you are one version short. It may have been there in the previous version but unfinished or buggy.

Re: Different Results from 6.8.9-9 vs 6.9.9-40

Posted: 2018-04-21T12:29:22-07:00
by terr
That was exactly it. I removed all reference to connected-components and even though the image has more noise it still is very good to prepare it for OCR.

Thank you!

Re: Different Results from 6.8.9-9 vs 6.9.9-40

Posted: 2018-04-21T12:54:23-07:00
by fmw42
You can try cleaning small noise spots using -morphology. If you post an example input, perhaps we can suggest another command.