Python PyOCR Builder 종류, layout 종류

공유하기

  • Add this entry to Hatena Bookmark
  • 0

PyOCR에서 설정하는 OCR Engine modes의 종류, Builder 객체 종류 , layout 종류에 대해 정리했습니다.

OCR Engine modes(-oem)

0 - Legacy engine only.
1 - Neural nets LSTM engine only.
2 - Legacy + LSTM engines.
3 - Default, based on what is available.

Builder 객체 종류

builder객체설명
TextBuilder문자열을 인식
WordBoxBuilder단어 단위로 문자 인식(이미지 내 문자 좌표 정보 포함)
LineBoxBuilder행 단위로 문자 인식(이미지 내 문자 좌표 정보 포함)
DigitBuilder숫자,기호를 인식
DigitLineBoxBuilder숫자,기호를 인식

layout 종류

다음의 Page segmentation modes(-psm)는 builder 객체의 tesseract_layout 옵션으로 설정합니다.

코드영어 설명한글 설명
0 Orientation and script detection (OSD) only.방향 및 스크립트 탐지 (OSD) 만.
1Automatic page segmentation with OSD.OSD를 사용한 자동 페이지 분할.
2Automatic page segmentation, but no OSD, or OCR자동 페이지 분할, OSD가 아님 또는 OCR
3Fully automatic page segmentation, but no OSD. (Default)완전 자동 페이지 분할, OSD가 아님. (기본)
4Assume a single column of text of variable sizes.다양한 크기의 텍스트 열 하나를 가정합니다.
5Assume a single uniform block of vertically aligned text.세로로 정렬 된 텍스트의 단일 균일 블록을 가정합니다.
6Assume a single uniform block of text.단일 텍스트 블록을 가정합니다.
7Treat the image as a single text line.이미지를 단일 텍스트 줄로 처리합니다.
8Treat the image as a single word.이미지를 한 단어로 취급합니다.
9Treat the image as a single word in a circle.이미지를 원 안의 한 단어로 취급합니다.
10Treat the image as a single character.이미지를 단일 문자로 취급합니다.
11Sparse text. Find as much text as possible in no particular order.Sparse텍스트. 특별한 주문 없이 가능한 한 많은 텍스트를 찾습니다.
12Sparse text with OSD.OSD가있는 Sparse텍스트.
13Raw line. Treat the image as a single text line, bypassing hacks that are Tesseract-specific.Raw라인.이미지를 단일 텍스트 라인으로 처리하여 Tesseract 특정 해킹을 무시합니다.