Error in Perform-OCR-on-image-file after cahnging image to a png

I downloaded the Perform-OCR-on-image-file and changed the file to a screenshot.png. When running it, I get the following errors and it breaks on the  PerformOCR line:

Warning: Parameter not found: enable_new_segsearch

Warning: Parameter not found: save_raw_choices

libpng error: Read Error

Error in pixReadStreamPng: internal png error

Error in pixReadStream: png: no pix returned

Error in pixRead: pix not read

I've been away for coding for a time and am unsure of where to look. Google did not give me much. Any help is greatly appreciated. I am trying to prepare this for implementation in a MA


11 Replies

KS Karmegam Seerangan Syncfusion Team April 5, 2024 10:52 AM UTC

Hi Brian,

Thank you for reaching out to Syncfusion support.

We are unable to reproduce the reported issue on our end. We suspect the reported issue may occur for the particular document. However, we have attached the sample for your reference.

Warning: Parameter not found: enable_new_segsearch

 

We can resolve this warning message by using the latest tessdata files. You can get it from the GitHub link.

https://github.com/tesseract-ocr/tessdata

 

However, we have attached the tessdata in the below sample.

Please find the below sample,

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Perform-OCR-on-image-file468345945

 

Kindly try the sample and let us know the result. If you are facing issues, we kindly request you to share the modified sample, and input documents to replicate the same issue on our end. This information will be more helpful for us to analyze and provide you with a prompt solution.

Regards,

Karmegam




BS Brian Senecal replied to Karmegam Seerangan April 10, 2024 05:47 AM UTC

I am using a straight screenshot from a Samsung Galaxy A14 for the image file.



KS Karmegam Seerangan Syncfusion Team April 10, 2024 05:04 PM UTC

We have verified the reported problem with the mobile screenshot and determined that it is functioning correctly. We captured a screenshot using an OPPO A5s and transferred the image to our local machine since we do not have the specific device mentioned. We used the sample provided earlier. However, we have included the complete sample for your convenience.

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Perform-OCR-on-image-file527791917

Kindly try the sample and let us know the result. If you are still facing the issue, as we requested earlier, please share the modified sample, input documents, and environment details (such as OS platform, bit version, and RAM size) to replicate the same issue on our end. This information will be more helpful for us to analyze and provide you with a prompt solution.



BS Brian Senecal April 19, 2024 01:23 PM UTC

It must be something with the file I was using. Honestly, here is a sample of what I am trying to read. This is a screenshot from a Samsung A15.


Attachment: Screenshot_66c2303c.zip


KS Karmegam Seerangan Syncfusion Team April 22, 2024 01:53 PM UTC

We have checked the reported issue on our end. It ran properly without any warnings or exceptions. However, the provided image does not return any text. Internally, we are using the Tesseract engine to recognize text from images or scanned documents. We have checked the image directly in the Google Tesseract engine and it does not return any results in the Tesseract engine itself. So we are unable to get the recognized text from the attached image document.



BS Brian Senecal April 29, 2024 04:21 AM UTC

OK, So I have been playing with this, and it appears the reason it isn't finding anything is because of the busyness of the image. I thought I read somewhere when I was investigating your tools that there was a way to specify a section of the image for the OCR?



KS Karmegam Seerangan Syncfusion Team April 29, 2024 11:23 AM UTC

Thank you for getting back to us.

 

We have support to extract the text from a particular region of an image by configuring the page region in the OCR Processor settings. This allows us to perform OCR specifically for that particular region of the image.

 

Please find the UG link below.

How to extract the text from specific coordinates of the PDF document? | Syncfusion

Perform OCR on PDF and image files | Syncfusion

Kindly try the provided solution and get back to us if you need further assistance.




BS Brian Senecal April 30, 2024 11:21 AM UTC

OK, I moved my test app to an MAUI app as that is its intended final destination. As soon as I did that I got a null reference error when I tried to actually process the OCR. Is there something additional that needs to be done to use this in MAUI?


Attachment: OCRCroppedImageMAUI_2a8e736e.zip


JT Jeyalakshmi Thangamarippandian Syncfusion Team May 1, 2024 12:53 PM UTC

Currently, we are analyzing this, and we will provide you with further details by May 2nd, 2024. Also, we kindly request you to share the image file with us to replicate the issue on our end. This will help us analyze further and provide you with a prompt solution.



SG Sivaram Gunabalan Syncfusion Team May 2, 2024 12:25 PM UTC

We were able to reproduce the reported issue on our end with provided details. We will validate the issue and update further details on May 6th, 2024. 



KS Karmegam Seerangan Syncfusion Team May 6, 2024 09:05 AM UTC

Upon further analysis, the Syncfusion .NET Optical Character Recognition (OCR) library extracts text from scanned PDFs and images. It uses the Tesseract OCR engine. The Syncfusion OCR library does not work on mobile platforms with the Tesseract engine, so starting from version 20.3.0.47, we added support to use any external OCR service, such as Azure Cognitive Services OCR, with our existing OCR library to process OCR in mobile platforms.

 

Please refer to the documentation to use the ExternalOCREngine in the Maui application.

https://www.syncfusion.com/blogs/post/ocr-in-net-maui-building-an-image-processing-application.aspx



Loader.
Up arrow icon