Not getting correct character top & left

Discussions about machine vision support in GdPicture.
Post Reply
kpejr
Posts: 10
Joined: Fri Aug 19, 2011 9:46 pm

Not getting correct character top & left

Post by kpejr » Thu Feb 09, 2012 4:28 pm

See the attached project, I am calling oGdPictureImaging.OCRTesseractGetCharTop & oGdPictureImaging.OCRTesseractGetCharLeft and the red box that gets put on the image is way lower and to the left of were the character is.
Attachments
RedactTaxLiens.zip
(481.55 KiB) Downloaded 419 times

kpejr
Posts: 10
Joined: Fri Aug 19, 2011 9:46 pm

Re: Not getting correct character top & left

Post by kpejr » Fri Feb 17, 2012 10:25 pm

Figured it out, you have to use oGdPictureImaging.OCRTesseractGetCharCode instead of looking at the return string to get the characters.

for (Int32 iCount = 0; iCount < oGdPictureImaging.OCRTesseractGetCharCount(); iCount++) //loop each line -NC KE 8/3/2011
{
if (oGdPictureImaging.OCRTesseractGetCharCode (iCount) == 73 &&
oGdPictureImaging.OCRTesseractGetCharCode (iCount + 1) == 100 &&
oGdPictureImaging.OCRTesseractGetCharCode (iCount+2) == 101 &&
oGdPictureImaging.OCRTesseractGetCharCode (iCount+3) == 110)
{
Int32 iTop = oGdPictureImaging.OCRTesseractGetCharTop(iCount);
Int32 iLeft = oGdPictureImaging.OCRTesseractGetCharLeft(iCount);

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest