ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Preparing image for OCR

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
EricNat Posted - Oct 05 2011 : 11:25:18
Prior to 4.0, I did the following to prepare an image for OCR (passing the TIFF image into another library) --

OCRImage->Proc->Resample(OCRImage->Bitmap->Width*2,-1,rfLanczos3);
OCRImage->Proc->ConvertToGray();
OCRImage->IO->Params->TIFF_Compression=ioTIFF_UNCOMPRESSED;
OCRImage->IO->SaveToFileTIFF(TIFPath);

This worked fine to upscale the image by 2x, convert it to gray, and save it as an uncompressed TIFF. But after upgrading to 4.01, the image that gets saved is corrupt. If I change rfLanczos3 to rfNone, it works. What am I doing wrong here? It will let me save it as another format.

Also, do you think Lanczos3 is the best algorithm to use for upscaling an image that contains text to be OCR'd?

Thanks for your help.

2   L A T E S T    R E P L I E S    (Newest First)
EricNat Posted - Oct 05 2011 : 14:37:16
Thanks! That did the trick. I appreciate the help.
fab Posted - Oct 05 2011 : 13:52:01
You should also set BitsPerSample and SamplesPerPixel. For example, if you want an 8 bit gray scale image you should write:

OCRImage->IO->Params->TIFF_Compression = ioTIFF_UNCOMPRESSED;
OCRImage->IO->Params->BitsPerSample = 8;
OCRImage->IO->Params->SamplesPerPixel = 1;


quote:
Also, do you think Lanczos3 is the best algorithm to use for upscaling an image that contains text to be OCR'd?


In my opinion (and in my knowledge developing also IEVision, our future OCR plugin) upscaling as step for an OCR doesn't enhance quality of results. It is just a interpolation, it doesn't add information to the image. It is best to acquire the once high-resolution image to upscale it later.