Hi everyone
my input is tiff multipage document file and i want to find the text boundary of specific word or line in the file.
I don't know if Gdpicture supports this feature.
Thank you for your help.
Le
find text boundaries in image
Re: find text boundaries in image
Hi,
This feature can be implemented by the mean of the character recognition engine embed in GdPicture.NET. Please have a look at the OCR sample: GdPicture.NET 11\Samples\WinForm\C#\OCR
This sample application draws small red rectangles around the characters:
The implementation of the requested feature is quite easy:
- find the index of the first character of the word you are looking for in the text retrieved by the OCR (see variable sOCR in the sample)
- get the position of every character of the word by the mean of OCRTesseractGetCharTop, OCRTesseractGetCharLeft, OCRTesseractGetCharBottom and OCRTesseractGetCharRight, start with the index of the first character and loop for all of the characters of the word.
This can easily be adapted to a line.
Regards,
David
This feature can be implemented by the mean of the character recognition engine embed in GdPicture.NET. Please have a look at the OCR sample: GdPicture.NET 11\Samples\WinForm\C#\OCR
This sample application draws small red rectangles around the characters:
Code: Select all
for (ncpt = 1; ncpt <= oGdPictureImaging.OCRTesseractGetCharCount(); ncpt++)
{
if (oGdPictureImaging.DrawRectangle(m_ImageID, oGdPictureImaging.OCRTesseractGetCharLeft(ncpt) + LeftArea, oGdPictureImaging.OCRTesseractGetCharTop(ncpt) + TopArea, oGdPictureImaging.OCRTesseractGetCharRight(ncpt) - oGdPictureImaging.OCRTesseractGetCharLeft(ncpt), oGdPictureImaging.OCRTesseractGetCharBottom(ncpt) - oGdPictureImaging.OCRTesseractGetCharTop(ncpt), 1, Color.Red, false) != GdPictureStatus.OK)
MessageBox.Show("Cannot Draw Rectangle.");
}
- find the index of the first character of the word you are looking for in the text retrieved by the OCR (see variable sOCR in the sample)
- get the position of every character of the word by the mean of OCRTesseractGetCharTop, OCRTesseractGetCharLeft, OCRTesseractGetCharBottom and OCRTesseractGetCharRight, start with the index of the first character and loop for all of the characters of the word.
This can easily be adapted to a line.
Regards,
David
Who is online
Users browsing this forum: No registered users and 1 guest