Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Thursday, October 13, 2016 6:48:25 AM(UTC)
Jonh0158

Groups: Registered
Posts: 1


How to make ocr recognize this images?


image3.pngimage1.pngimage2.png
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Thursday, October 13, 2016 3:12:34 PM(UTC)

Hadi  
Hadi

Groups: Manager, Tech Support, Administrators
Posts: 197

Was thanked: 9 time(s) in 9 post(s)

Jonh,

In order to get accurate results from the OCR engine you will need to follow some generic OCR guidelines:

  • Use a high resolution image (if needed) 300 DPI is minimum
  • Make sure there is no shadows or bends in the image
  • If there is any skew, you will need to fix the image in code prior to ocr
  • Use a dictionary to help get good results
  • Adjust the text size (12 pt font is ideal)
  • Binarize the image and use image processing algorithms to remove noise


Regarding your 3 images in particular, they are all very small images, 100x40 pixels and on top of that, they all have a strike-through going through the characters. In one or the other scenario (small image or strike-through) there are some image processing functions that can help increase the accuracy of the OCR engine, but with both a small image and a strike-through, these images are not readable.

If you had a good quality image with strike-through, then the OCR engine can detect that font style and read the character anyways. You can even see what font-style was used in the OCrCharacter.FontStyle property as seen here:
https://www.leadtools.co...rcharacterfontstyle.html

You can also use the LineRemove command from the Leadtools.Imageprocessing.Core namespace to attempt to remove the lines through the characters:
https://www.leadtools.co...e.lineremovecommand.html

If you just had small images that weren't quite 300 DPI you can use a combination of image processing commands to increase the size and resample the image data to produce a decent quality larger image. Here is some code that shows how to do this:

Code:
                  double newWidth = (image.Width / (double)image.XResolution) * 300;
                  double newHeight = (image.Height / (double)image.YResolution) * 300;
                  SizeCommand sizeCommand = new SizeCommand((int)newWidth, (int)newHeight, RasterSizeFlags.Resample);
                  sizeCommand.Run(image);

                  image.XResolution = 300;
                  image.YResolution = 300;

                  AutoBinarizeCommand autoBin = new AutoBinarizeCommand();
                  autoBin.Run(image);

                  ColorResolutionCommand colorRes = new ColorResolutionCommand();
                  colorRes.BitsPerPixel = 1;
                  colorRes.PaletteFlags = ColorResolutionCommandPaletteFlags.Fixed;
                  colorRes.Run(image);
Hadi Chami
Developer Support Manager
LEAD Technologies, Inc.

LEAD Logo
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2019, Yet Another Forum.NET
This page was generated in 0.119 seconds.