GdPictureImaging.OCRTesseractGetOrientation Issues
-
- Posts: 3
- Joined: Tue Jul 28, 2009 10:52 am
GdPictureImaging.OCRTesseractGetOrientation Issues
Hi,
When calling GdPictureImaging.OCRTesseractGetOrientation I am getting inaccurate results.
Attached is an example MultiPage TIFF that does not rotate correctly. It does not rotate at all - the function come back with RotateNoneFlipNone. I can reproduce similar behavior with other text documents like that one too. In some cases it flips the document 270 rather that 90, resulting in the document being landscape, but upside down. I can dig out an example of that if need be too.
Also, when do you think we will be getting support for PDFs in the GdPictureImaging library like we do in GdViewer? I'm using GDPicture in a windows service, and so I can't use a user control (drag and drop error, etc).
Cheers,
Tom
When calling GdPictureImaging.OCRTesseractGetOrientation I am getting inaccurate results.
Attached is an example MultiPage TIFF that does not rotate correctly. It does not rotate at all - the function come back with RotateNoneFlipNone. I can reproduce similar behavior with other text documents like that one too. In some cases it flips the document 270 rather that 90, resulting in the document being landscape, but upside down. I can dig out an example of that if need be too.
Also, when do you think we will be getting support for PDFs in the GdPictureImaging library like we do in GdViewer? I'm using GDPicture in a windows service, and so I can't use a user control (drag and drop error, etc).
Cheers,
Tom
Re: GdPictureImaging.OCRTesseractGetOrientation Issues
Hi Tom,
No problem for me:
Rotation is 270° which is OK.
Kind regards,
Loïc
No problem for me:
Code: Select all
Dim Rotation As RotateFlipType = oGdPictureImaging.OCRTesseractGetOrientationImageID, TesseractDictionary.TesseractDictionaryEnglish, "C:\Program Files\GdPicture.NET\Redist\OCR\")
Kind regards,
Loïc
-
- Posts: 3
- Joined: Tue Jul 28, 2009 10:52 am
Re: GdPictureImaging.OCRTesseractGetOrientation Issues
Hi Loïc,
Wouldn't 270 degrees clockwise end up with the document upside down? That is the behavior I'm getting on this one now as well.
After taking the section of code out of my large project and into a standalone app (as I assume you did), I still cannot get it to work...
Code in question with the above Example.tif in .NET 3.5:
I use this to process multiple exported TIFF's from a main process simultaneously depending on the number of processors on the machine. The above is almost a copy and paste. (On a side note - is it correct that the GDImaging OCR component cannot be used from multiple threads? I got MsgBox's popping up everywhere when I tried... Hence the spin off processes that isolate everything.)
Hope that helps.
Cheers,
Tom
Wouldn't 270 degrees clockwise end up with the document upside down? That is the behavior I'm getting on this one now as well.
After taking the section of code out of my large project and into a standalone app (as I assume you did), I still cannot get it to work...
Code in question with the above Example.tif in .NET 3.5:
Code: Select all
Sub Main()
Dim GDImaging As New GdPicture.GdPictureImaging
GDImaging.SetLicenseNumber("")
GDImaging.SetLicenseNumberOCRTesseract("")
GDImaging.OCRTesseractSetPassCount(1)
GDImaging.TiffOpenMultiPageForWrite(False)
Dim TIFFID As Integer = GDImaging.TiffCreateMultiPageFromFile("C:\Example.tif")
Dim PageCount As Integer = GDImaging.TiffGetPageCount(TIFFID)
Dim PDFID = GDImaging.PdfOCRStart("C:\Example.pdf", True, "", "", "", "", "")
For i As Integer = 1 To PageCount
GDImaging.TiffSelectPage(TIFFID, i)
Dim ImageID As Integer = GDImaging.CreateClonedGdPictureImageI(TIFFID)
GDImaging.Rotate(ImageID, GDImaging.OCRTesseractGetOrientation(ImageID, TesseractDictionary.TesseractDictionaryEnglish, "C:\Program Files\GdPicture.NET\Redist\OCR\"))
Console.Write(GDImaging.PdfAddGdPictureImageToPdfOCR(PDFID, ImageID, TesseractDictionary.TesseractDictionaryEnglish, "C:\Program Files\GdPicture.NET\Redist\OCR\", ""))
GDImaging.ReleaseGdPictureImage(ImageID)
Next
GDImaging.PdfOCRStop(PDFID)
GDImaging.ReleaseGdPictureImage(TIFFID)
End Sub
Hope that helps.
Cheers,
Tom
Re: GdPictureImaging.OCRTesseractGetOrientation Issues
Hi TOM,
Here you have a problem:
If the document have a rotation of 270° you should rotate it to 90° to get it in the correct orientation. Therefore, for 90° oriented documents you should apply a rotation of 270°
Kind regards,
Loïc
Here you have a problem:
Code: Select all
GDImaging.Rotate(ImageID, GDImaging.OCRTesseractGetOrientation(ImageID, TesseractDictionary.TesseractDictionaryEnglish, "C:\Program Files\GdPicture.NET\Redist\OCR\"))
Kind regards,
Loïc
-
- Posts: 3
- Joined: Tue Jul 28, 2009 10:52 am
Re: GdPictureImaging.OCRTesseractGetOrientation Issues
Hi,
Now it all makes sense!
Do you think a GDPictureImaging.FixOrientation(ImageID, TesseractDictionary.TesseractDictionaryEnglish, "C:\Program Files\GdPicture.NET\Redist\OCR\") added for a future release to make it clearer?
Thanks for helping me out on this one.
Cheers,
Tom
Now it all makes sense!
Do you think a GDPictureImaging.FixOrientation(ImageID, TesseractDictionary.TesseractDictionaryEnglish, "C:\Program Files\GdPicture.NET\Redist\OCR\") added for a future release to make it clearer?
Thanks for helping me out on this one.
Cheers,
Tom
Who is online
Users browsing this forum: No registered users and 0 guests