Hi.,
What are the Predefined Image Magick Methods Use to Improve Scan Image Quality.
Scan Image Preprocessing to OCR
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Scan Image Preprocessing to OCR
Define or provide an example of the contents of the scan? Is it black text on a plan background or is the background busy or contain images?
Please, always provide your IM version and platform when asking questions, since syntax may differ. Also provide your exact command line and if possible your images.
See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at http://www.imagemagick.org/discourse-se ... f=1&t=9620
For novices, see
http://www.imagemagick.org/discourse-se ... f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
https://github.com/ImageMagick/usage-markdown
If on Unix-like system, see my script textcleaner at my link below. Or use ImageMagick -lat function.
Please, always provide your IM version and platform when asking questions, since syntax may differ. Also provide your exact command line and if possible your images.
See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at http://www.imagemagick.org/discourse-se ... f=1&t=9620
For novices, see
http://www.imagemagick.org/discourse-se ... f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
https://github.com/ImageMagick/usage-markdown
If on Unix-like system, see my script textcleaner at my link below. Or use ImageMagick -lat function.
Re: Scan Image Preprocessing to OCR
Thanks for your valuable Reply.
1. I am Used This Type of Image Below Link.
https://static1.squarespace.com/static/ ... ormat=500w
https://static1.squarespace.com/static/ ... ormat=500w
3. Text Cleaner i used FredsImageMagickScripts.TextCleaner.1.0.6436.32248
2. Magick.NET-Q16-AnyCPU 7.4.5 This Version Used in C#
4. I am Used This Code
MagickImage MagickImag = new MagickImage(Image);
TextCleanerScript objCleaner = new TextCleanerScript();
objCleaner.BackgroundColor = Color.White;
objCleaner.Unrotate = true;
objCleaner.Trim = true;
objCleaner.MakeGray = true;
objCleaner.SmoothingThreshold = (Percentage)50;
objCleaner.Enhance = TextCleanerEnhance.Normalize;
objCleaner.FilterOffset = (Percentage)5;
objCleaner.FilterSize = 15;
objCleaner.Sharpen = 1.0f;
IMagickImage img = objCleaner.Execute(MagickImag);
img.Deskew((Percentage)50);
img.Despeckle();
img.Write(AppDomain.CurrentDomain.BaseDirectory + "Images\\Output.jpeg");
I did't Get good Output Please Let Me Know What are The Predefined Process used to Improve Quality.
Thank You,
1. I am Used This Type of Image Below Link.
https://static1.squarespace.com/static/ ... ormat=500w
https://static1.squarespace.com/static/ ... ormat=500w
3. Text Cleaner i used FredsImageMagickScripts.TextCleaner.1.0.6436.32248
2. Magick.NET-Q16-AnyCPU 7.4.5 This Version Used in C#
4. I am Used This Code
MagickImage MagickImag = new MagickImage(Image);
TextCleanerScript objCleaner = new TextCleanerScript();
objCleaner.BackgroundColor = Color.White;
objCleaner.Unrotate = true;
objCleaner.Trim = true;
objCleaner.MakeGray = true;
objCleaner.SmoothingThreshold = (Percentage)50;
objCleaner.Enhance = TextCleanerEnhance.Normalize;
objCleaner.FilterOffset = (Percentage)5;
objCleaner.FilterSize = 15;
objCleaner.Sharpen = 1.0f;
IMagickImage img = objCleaner.Execute(MagickImag);
img.Deskew((Percentage)50);
img.Despeckle();
img.Write(AppDomain.CurrentDomain.BaseDirectory + "Images\\Output.jpeg");
I did't Get good Output Please Let Me Know What are The Predefined Process used to Improve Quality.
Thank You,
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Scan Image Preprocessing to OCR
My textcleaner script will not help those kinds of images. My textcleaner will not work on Windows except via Magick.NET. See https://github.com/dlemstra/FredsImageMagickScripts.NET
I do not know how to improve those images. You could try some morphology close, but it might remove the dots, but make your text worse.
I do not know how to improve those images. You could try some morphology close, but it might remove the dots, but make your text worse.
Re: Scan Image Preprocessing to OCR
Thanks for Your Reply.
Can you Know how to Remove vertical lines in Images.
Can you Know how to Remove vertical lines in Images.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Scan Image Preprocessing to OCR
Please supply an example image. Often, you can use -morphology with a custom linear kernel to remove lines.