LEADTOOLS Support
Imaging
Imaging SDK Examples
How To: Accessing the Processing Image used by OCR
#1
Posted
:
Friday, August 18, 2017 3:26:30 PM(UTC)
Groups: Registered, Tech Support, Administrators
Posts: 163
Was thanked: 9 time(s) in 9 post(s)
When recognizing images for OCR, LEADTOOLS does not use the original image as supplied, but instead makes some modifications to it in memory. This involves reducing the color space down to black and white and making the resolution uniform. Accessing this image can be useful in the event that image recognition is not as expected to determine what additional preprocessing may need to be performed prior to passin the image to the OCR engine.
Any IOcrPage object can have its underlying RasterImage object accessed via the GetRasterImage() method.
https://www.leadtools.com/help/leadtools/v19m/dh/fo/iocrpage-getrasterimage(ocrpagetype).htmlThe method accepts an enumeration which can be one of three values: Current, Processing, and Original.
Current -- An internal copy of the original image used to create the page.
Processing -- This is the processing image which is uniform in resolution and always black and white. Examining this image can assist in determining if additional preprocessing is necessary in development.
Original -- This is a reference to the original image in memory. This and Current are visually identical.
More information on this enumeration is available in our documentation.
https://www.leadtools.com/help/leadtools/v19m/dh/fo/ocrpagetype.htmlHere's a quick code snippet on how the processing image can be accessed from an existing IOcrPage called ocrPage in memory.
Code:
RasterImage processingImage = ocrPage.GetRasterImage(OcrPageType.Processing);
Here's an example of an input image and processing image above and below.
Nick Crook
Developer Support Engineer
LEAD Technologies, Inc.
LEADTOOLS Support
Imaging
Imaging SDK Examples
How To: Accessing the Processing Image used by OCR
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.