OCR API는 이미지에서 텍스트를 감지하고 추출할 수 있습니다. 다음 두 가지 주석 기능은 광학 문자 인식을 지원합니다.
TEXT_DETECTION은 임의의 이미지에서 텍스트를 감지하고 추출합니다. 예를 들어 간판이나 표지판이 찍힌 사진을 들 수 있습니다. OCR 서비스는 추출된 문자열, 개별 단어, 해당 경계 상자가 포함된 JSON 파일을 반환합니다.
그림 1. OCR API가 단어와 해당 경계 상자를 감지하는 도로 표지판 사진
DOCUMENT_TEXT_DETECTION도 이미지에서 텍스트를 추출하지만, 서비스는 밀집된 텍스트와 문서에 맞게 응답을 최적화합니다. 예를 들어 입력된 텍스트를 스캔한 이미지에는 여러 단락과 제목이 포함될 수 있습니다. OCR 서비스는 페이지, 블록, 단락, 단어, 줄바꿈 정보가 포함된 JSON 파일을 반환합니다.
그림 2. OCR API가 단어, 페이지, 단락과 같은 정보를 감지하는 입력된 텍스트의 스캔된 이미지
손글씨 텍스트
그림 3은 손으로 쓴 텍스트의 이미지입니다. OCR API는 이러한 이미지에서 텍스트를 감지하고 추출합니다. 필기 인식을 지원하는 필기 스크립트 목록은 필기 스크립트를 참고하세요.
그림 3. OCR API가 텍스트를 감지하는 필기 이미지
광학 문자 인식 한도
BatchAnnotateImages 및 BatchAnnotateFiles API 메서드는 일괄 호출당 단일 요청만 지원합니다.
다음 표에는 Distributed Cloud의 OCR 서비스의 현재 한도가 나와 있습니다.
OCR 파일 한도
값
최대 페이지 수
5개
최대 파일 크기
20MB
최대 이미지 크기
2천만 픽셀 (길이 x 너비)
OCR API에 제출된 파일이 최대 페이지 수 또는 최대 파일 크기를 초과하면 오류가 반환됩니다. 최대 이미지 크기를 초과하는 제출된 파일은 2,000만 픽셀로 축소됩니다.
OCR에 지원되는 파일 형식
OCR 사전 학습된 API는 다음 파일 형식의 텍스트를 감지하고 전사합니다.
PDF
TIFF
JPG
PNG
Distributed Cloud 환경에 파일을 로컬로 저장해야 합니다. Cloud Storage에 호스팅된 파일이나 공개적으로 사용 가능한 파일에 액세스하여 텍스트를 감지할 수는 없습니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[[["\u003cp\u003eOptical Character Recognition (OCR) is a pre-trained Vertex AI API on Google Distributed Cloud (GDC) air-gapped that can detect text in images, document files, and handwritten text.\u003c/p\u003e\n"],["\u003cp\u003eThe OCR service offers three methods: \u003ccode\u003eBatchAnnotateImages\u003c/code\u003e for detecting text from JPEG or PNG images, \u003ccode\u003eBatchAnnotateFiles\u003c/code\u003e for PDF or TIFF files in inline requests, and \u003ccode\u003eAsyncBatchAnnotateFiles\u003c/code\u003e for offline text detection from PDF or TIFF files in storage buckets.\u003c/p\u003e\n"],["\u003cp\u003eThe OCR API supports two main features: \u003ccode\u003eTEXT_DETECTION\u003c/code\u003e to extract text from any image and \u003ccode\u003eDOCUMENT_TEXT_DETECTION\u003c/code\u003e optimized for dense text and documents.\u003c/p\u003e\n"],["\u003cp\u003eThe OCR API also supports handwritten text detection and extraction, with specific supported handwriting scripts available for recognition.\u003c/p\u003e\n"],["\u003cp\u003eOCR has limitations such as a maximum of five pages, a 20 MB file size limit, and a maximum image size of 20 million pixels, and it supports file types like PDF, TIFF, JPG, and PNG, stored locally in the Distributed Cloud environment.\u003c/p\u003e\n"]]],[],null,["# Learn about character recognition features\n\nOptical Character Recognition (OCR) is one of the three Vertex AI\npre-trained APIs on Google Distributed Cloud (GDC) air-gapped. The OCR\nservice detects text in [various file types](#supported-file-types), such as\nimages, document files, and handwritten text.\n\nOCR offers the following methods available in\nDistributed Cloud to recognize text:\n\n| **Note:** The `BatchAnnotateImages` and `BatchAnnotateFiles` API methods only support a single request per batch call.\n\nLearn more about the [supported languages](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/vertex-ai-ocr-supported-langs)\ndetected by the text recognition feature.\n\nOptical character recognition features\n--------------------------------------\n\nThe OCR API can detect and extract text from images. The\nfollowing two annotation features support optical character recognition:\n\n- `TEXT_DETECTION` detects and extracts text from any image. For example, a\n photograph might contain a street or traffic sign. The OCR\n service returns a JSON file with the extracted string, individual words, and\n their bounding boxes.\n\n **Figure 1.** Road sign photograph where the OCR API detects\n words and their bounding boxes.\n- `DOCUMENT_TEXT_DETECTION` also extracts text from an image, but the service\n optimizes the response for dense text and documents. For example, a scanned\n image of typed text might contain several paragraphs and headings. The\n OCR service returns a JSON file with page, block, paragraph,\n word, and break information.\n\n **Figure 2.** Scanned image of typed text where the OCR API detects information such as words, pages, and paragraphs.\n\nHandwritten text\n----------------\n\nFigure 3 is an image of handwritten text. The OCR API detects and\nextracts text from these images. For a list of handwriting scripts that\nsupport handwriting recognition, see\n[Handwriting scripts](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/vertex-ai-ocr-supported-langs#handwriting-scripts).\n\n**Figure 3.** Handwriting image where the OCR API detects text.\n\nOptical character recognition limits\n------------------------------------\n\nThe `BatchAnnotateImages` and `BatchAnnotateFiles` API methods only support a\nsingle request per batch call.\n\nThe following table lists the current limits of the OCR service\nin Distributed Cloud.\n\nSubmitted files for the OCR API that exceed the maximum number of\npages or the maximum file size return an error. Submitted files that exceed the\nmaximum image size are downsized to 20 million pixels.\n\nSupported file types for OCR\n----------------------------\n\nThe OCR pre-trained API detects and transcribes\ntext from the following file types:\n\n- PDF\n- TIFF\n- JPG\n- PNG\n\nYou must store the files locally in your Distributed Cloud environment. You\ncan't access files hosted in Cloud Storage or publicly available files for\ntext detection."]]