OCR to text sample

Hello,
I have a .png file that we are testing to extract text out of image. I have tried the sample codes but results are not accurate. However, when i try the online photo to text, it gives me accurate result: https://products.aspose.app/ocr/photo-ocr. Is there any sample code for this?

@nanda21

The online App uses Aspose.OCR Cloud API. In case you are interested in using the Cloud API, you can please create a post in respective forum. If you want to use on-premise API, please share your sample image with us. We will investigate to get correct results and share our feedback with you.

@asad.ali , we are using the on-premise API. The image am i sharing contains profanity words, apologies for that. We want to pull the text and use it in our software to detect profanity while sending out email. I have attached the image. please let me know if you want any other details
Curse Test.png (3.4 KB)

@nanda21

We are checking it and will get back to you shortly.

@asad.ali , thank you, I will be waiting for your findings

@nanda21

Please try to use the below code snippet and see if you obtain correct output:

OcrInput ocrInput = new OcrInput(InputType.SingleImage);
ocrInput.Add(imgPath);

RecognitionSettings set = new RecognitionSettings
{
    DetectAreasMode = DetectAreasMode.PHOTO
};
var result = api.Recognize(ocrInput, set);