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

Notification

Icon
Error

Post a reply
From:
Message:

Maximum number of characters in each post is: 32767
Bold Italic Underline   Highlight Quote Choose Language for Syntax Highlighting Insert Image Insert an existing Attachment or upload a new File... Create Link   Unordered List Ordered List   Left Justify Center Justify Right Justify   Outdent Indent   More BBCode Tags
Font Color Font Size
Security Image:
Enter The Letters From The Security Image:
  Preview Post Cancel

Last 10 Posts (In reverse order)
Paul Rayman Posted: Tuesday, April 5, 2016 10:20:53 PM(UTC)
 
There is a another way to determine the page orientation.
The following code works perfect for me.
Please make sure that you have the osd.traindata data file in your output tessdata folder.

Code:

var api = OcrApi.Create();

api.Init();
api.PageSegmentationMode = Patagames.Ocr.Enums.PageSegMode.PSM_AUTO_OSD;
api.SetImage(bmp);
api.Recognize();

var iterator = api.AnalyseLayout();
var orientation = iterator.Orientations;
switch(iterator.Orientations)
{
	case Patagames.Ocr.Enums.Orientation.ORIENTATION_PAGE_DOWN:
		//the image is rotated to 180 
		break;
	case Patagames.Ocr.Enums.Orientation.ORIENTATION_PAGE_LEFT:
		//the image is rotated to 270 clockwise
		break;
	case Patagames.Ocr.Enums.Orientation.ORIENTATION_PAGE_RIGHT:
		//the image is rotated to 90 clockwise
		break;
	case Patagames.Ocr.Enums.Orientation.ORIENTATION_PAGE_UP:
		//the image is rotated to 0
		break;
}
Guest Posted: Tuesday, April 5, 2016 6:47:30 AM(UTC)
 
well ... you can try to recognize the image four times at different angles, and choose the one of them where the most good result. To evaluate the result you can use the TextConfidences property.
Stefan Posted: Monday, April 4, 2016 9:23:07 AM(UTC)
 
Hey,
I am currently searching for an alternative for our current rasterizing SDK and found Pdfium. I was wondering, if there is an automated way to detect the rotation of a pdf file?
Lets say I have a document that is scanned upide down and sent to Pdfium as PDF file. Is it possible to detect the rotation of the content?

EDIT:
Is it possible to output a deskewed and correctly oriented version of the page, maybe in combination with your tesseract SDK? I know that tesseract has OSD, so can you tell the renderer to rotate the output pdf accordingly?