Replace objects text of OcrObject

Questions, comments and suggestions concerning VintaSoft Imaging .NET SDK.

Moderator: Alex

Post Reply
BenjaminA
Posts: 11
Joined: Wed Jul 24, 2019 3:33 pm

Replace objects text of OcrObject

Post by BenjaminA »

Problem description:
Some times when we run OCR we don't get a very good interpretation. For example "xxxx@xxx.se" became "xxxx(@xxx.se" or "i" became "|"

Solution
There is OcrResultsEditor.RemoveObjects that are used to remove.
We need to be able also to replace objects text. For example replace all words that contains (@ to @.
How can we achieve this?
Alex
Site Admin
Posts: 2305
Joined: Thu Jul 10, 2008 2:21 pm

Re: Replace objects text of OcrObject

Post by Alex »

Hello Benjamin,

Please read how to obtain and edit the OCR results here:
https://www.vintasoft.com/docs/vsimagin ... sults.html

and let me know if you will have any question or problem.

Best regards, Alexander
BenjaminA
Posts: 11
Joined: Wed Jul 24, 2019 3:33 pm

Re: Replace objects text of OcrObject

Post by BenjaminA »

I couldn't find the solution in the documentation and therefore I write this for those who read this in the future.

In order to replace text you must use SetObjectText and cast OcrObject to OcrTextObject .

ocrResultsEditor.SetObjectText((OcrTextObject)ocrObject, "newText");
Alex
Site Admin
Posts: 2305
Joined: Thu Jul 10, 2008 2:21 pm

Re: Replace objects text of OcrObject

Post by Alex »

BenjaminA wrote: Mon Sep 02, 2019 1:46 pm I couldn't find the solution in the documentation and therefore I write this for those who read this in the future.

In order to replace text you must use SetObjectText and cast OcrObject to OcrTextObject .

ocrResultsEditor.SetObjectText((OcrTextObject)ocrObject, "newText");

Please see how to filter OCR results here:
https://www.vintasoft.com/docs/vsimagin ... ditor.html

Best regards, Alexander
Post Reply