Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Monday, April 5, 2021 5:03:20 AM(UTC)
username77

Groups: Registered
Posts: 40

Thanks: 5 times

Hi,

I was trying to read a file with OcrEditDemo which uses OcrWord and I see that the coordinates of captured words are different from coordinates captured using LEADDocument DocumentPageText


Here is my code that I tried to use

LoadDocumentOptions options = new LoadDocumentOptions();
options.UseCache = false;
using (LEADDocument document = DocumentFactory.LoadFromFile("C:\\Users\\Public\\Documents\\LEADTOOLS Images\\ocr1.tif", options))
{
_documentZoneWords = new List<List<DocumentWord>>();
document.Text.OcrEngine = _ocrEngine;
document.Text.TextExtractionMode = DocumentTextExtractionMode.Auto; //try to read as svg before ocr

DocumentPageText pageText = document.Pages[0].GetText();
if (pageText != null)
{
pageText.BuildWords();


foreach (DocumentWord wd in pageText.Words)
{

List<DocumentWord> words = new List<DocumentWord>();
words.Add(wd);
_documentZoneWords.Add(words);
}


}


}




Bounds values captured in _documentZoneWords array are different from Bounds values captured using OcrEditDemo sample that are on _ocrZoneWords array

example of first word: "LEAD"
DocumentWord Bounds = {727.2;746.4;540;208,8}
OcrWord Bounds = {307;313;216;62}




Why are the values different?
Is there any way to convert Bounds of DocumentWord to Bounds of OcrWord to get same values?


Thanks in advance





 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Wednesday, April 7, 2021 4:13:59 PM(UTC)

Nick  
Nick

Groups: Registered, Tech Support, Administrators
Posts: 161

Was thanked: 9 time(s) in 9 post(s)

I have reached out to you via email.
Nick Crook
Developer Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
#3 Posted : Thursday, April 8, 2021 3:51:19 PM(UTC)
username77

Groups: Registered
Posts: 40

Thanks: 5 times

can be solved using this:

LeadRect lr = document.Pages[0].RectToPixels(wd.Bounds);


 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.060 seconds.