Más información sobre las funciones de reconocimiento de caracteres
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
El reconocimiento óptico de caracteres (OCR) es una de las tres APIs previamente entrenadas de Vertex AI en Google Distributed Cloud (GDC) con aislamiento físico. El servicio de OCR detecta texto en varios tipos de archivos, como imágenes, archivos de documentos y texto escrito a mano.
El OCR ofrece los siguientes métodos disponibles en Distributed Cloud para reconocer texto:
Detecta texto en un lote de archivos PDF o TIFF en un bucket de almacenamiento para solicitudes sin conexión.
Obtén más información sobre los idiomas compatibles que detecta la función de reconocimiento de texto.
Funciones de reconocimiento óptico de caracteres
La API de OCR puede detectar y extraer texto de las imágenes. Las siguientes dos funciones de anotación admiten el reconocimiento óptico de caracteres:
TEXT_DETECTION detecta y extrae el texto de cualquier imagen. Por ejemplo, una fotografía que contenga una señal de tránsito. El servicio de OCR devuelve un archivo JSON con la cadena extraída, las palabras individuales y sus cuadros de límite.
Figura 1. Fotografía de una señal de ruta en la que la API de OCR detecta palabras y sus cuadros de límite.
DOCUMENT_TEXT_DETECTION también extrae el texto de una imagen, pero el servicio optimiza la respuesta para textos y documentos densos. Por ejemplo, una imagen escaneada de texto escrito a máquina puede contener varios párrafos y encabezados. El servicio de OCR devuelve un archivo JSON con información de la página, el bloque, el párrafo, la palabra y la división.
Figura 2. Imagen escaneada de texto escrito a máquina en la que la API de OCR detecta información como palabras, páginas y párrafos.
Texto escrito a mano
La figura 3 es una imagen de texto escrito a mano. La API de OCR detecta y extrae texto de estas imágenes. Para obtener una lista de las secuencias de comandos de escritura a mano que admiten el reconocimiento de escritura a mano, consulta Secuencias de comandos de escritura a mano.
Figura 3. Imagen de escritura a mano en la que la API de OCR detecta texto.
Límites del reconocimiento óptico de caracteres
Los métodos de API BatchAnnotateImages y BatchAnnotateFiles solo admiten una solicitud por llamada por lotes.
En la siguiente tabla, se indican los límites actuales del servicio de OCR en Distributed Cloud.
Límite de archivos para el OCR
Valor
Cantidad máxima de páginas
Cinco
Tamaño máximo de archivo
20 MB
Tamaño máximo de la imagen
20 millones de píxeles (largo x ancho)
Los archivos enviados a la API de OCR que superan la cantidad máxima de páginas o el tamaño máximo de archivo devuelven un error. Los archivos enviados que superan el tamaño máximo de imagen se reducen a 20 millones de píxeles.
Tipos de archivos admitidos para el OCR
La API previamente entrenada de OCR detecta y transcribe texto de los siguientes tipos de archivos:
PDF
TIFF
JPG
PNG
Debes almacenar los archivos de forma local en tu entorno de Distributed Cloud. No puedes acceder a los archivos alojados en Cloud Storage ni a los archivos disponibles públicamente para la detección de texto.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 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."]]