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