Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,105
Thanks: 7 times Was thanked: 130 time(s) in 127 post(s)
|
QuestionHey, I was wondering, if there is an automated way to detect the rotation of a scanned page? AnswerPlease 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:
break;
case Patagames.Ocr.Enums.Orientation.ORIENTATION_PAGE_LEFT:
break;
case Patagames.Ocr.Enums.Orientation.ORIENTATION_PAGE_RIGHT:
break;
case Patagames.Ocr.Enums.Orientation.ORIENTATION_PAGE_UP:
break;
}
|
|
|
|
Forum Jump
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.
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close