PreprocessedImages.BinarizedImage

Not sure what cause the PreprocessedImages.BinarizedImage resulting “null” when I am using the sample code in the document.

Hi Jason,

Thank you for your inquiry.

Please provide us more details about the issue that you are facing. We need a sample project and the sample file to reproduce the issue.

Actually, there are two problems. I attached the image. My code:


var targetFile = @“d:\a1.tif”;
var ocr = new OcrEngine {};
ocr.Image = ImageStream.FromFile(@“d:\a1.jpg”);

//Create CorrectionFilters collection
var filters = new CorrectionFilters();
filters.Add(new MedianFilter(5)); //Initialize Median filter
filters.Add(new GaussBlurFilter()); //Create Gaussian Blur filter
filters.Add(new RemoveNoiseFilter()); //Create Noise Removal filter
ocr.Config.CorrectionFilters = filters;
if (ocr.Process())
{
ocr.PreprocessedImages.BinarizedImage.Save(targetFile, ImageFormat.Tiff);
}

Problem #1:
ocr.Process() line above will throw exception if I have RemoveNoiseFilter() line. Comment that line out will make ocr.Process() work. Why RemoveNoiceFilter doesn’t work?

Problem #2:
After commenting out RemoveNoiceFilter, ocr.PreprocessdImages.BinarizedImage returned is “null”. Therefore, “.Save” method will throw exception. Why null?

Additional Question:
I actually don’t need to OCR an image. All I need are those filters to clean up then binarize the image to CCIT4 “.tif” file. The document are taken by phone camera in color. I need to convert it into B&W with best possible result. I was looking at Aspose Imaging for similar features, but couldn’t find any. So I start to try out OCR. Any advise?
Hi Jason,

Thank you for writing us back.

Please note that we are working this. We will update soon about the progress.
Hi Jason,

Thank you for your patience.

This is to update you that we are able to notice the same issue described by you in your post. The issue has been logged into our issue tracking system with ID OCR-34314. Our product team will further look into it. We will update you accordingly.

Furthermore we have also logged a feature request into our system to support correction filters in Aspose.Imaging API. IMAGING-35192 is the request ID for future reference.

Feel free to contact us in case of any query or comments.

Hi Jason,

This is to update you that we have investigated the ocr.Process() throw exception issue. It was found that the exception is thrown because SavePreprocessedImages flag was not set. SavePreprocessedImages flag must be set to TRUE to enable preprocessed images. The line of code that sets the flag is missing in your program. Please use the following line of code in your program and try again.

ocr.Config.SavePreprocessedImages = true;

However an appropriate exception message has been incorporated in case SavePreprocessedImages flag is missing. This enhancement is available in the release Aspose.OCR for .Net 3.4.0.

The issues you have found earlier (filed as OCR-34314) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

The issues you have found earlier (filed as IMAGING-35192) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for JasperReports 18.3 update.