#1
Posted
:
Thursday, October 13, 2016 6:43:25 AM(UTC)
Groups: Registered
Posts: 1
#2
Posted
:
Thursday, October 13, 2016 3:07:34 PM(UTC)
Groups: Manager, Tech Support, Administrators
Posts: 218
Was thanked: 12 time(s) in 12 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.htmlYou 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.htmlIf 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.
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.