Text detector (Vision API)
Text detector detects and extracts text from images. It uses optical character recognition (OCR) for an image to recognize text and convert it to machine coded text.Text detector detects and extracts text from images. It uses optical character recognition (OCR) on an image to recognize text and convert it to machine-coded text.
TEXT_DETECTION
detects and extracts text from an image. For example, a photograph might contain a street sign or traffic sign. The JSON includes the entire extracted string, as well as individual words, and their bounding boxes.
textAnnotations
, as well as the structural hierarchy for the OCR detected text (fullTextAnnotation
).Hierarchy of extracted text structure:
Languages supported: Works with currently supported, mapped, and experimental languages.
To detect text from scanned documents, try the Document AI OCR processor.
If you are looking for a video text detection model, try the Video Text Detection.
Image
Text detector is part of the Cloud Vision API, which can be enabled in the console.
You can use the Vision API to perform feature detection on a local image file.
For REST requests, send the contents of the image file as a base64 encoded string in the body of your request. For sample codes in other programming languages or for detecting text on a remote image, refer to the Text detector documentation.
Below is a Python code sample to detect text in a local image. Before trying this sample, follow the Python setup instructions in the Vision quickstart using client libraries.
Resource ID | Release date | Release stage | Description |
---|---|---|---|
builtin/weekly | 2024-04-01 | General Availability | Cutting-edge OCR model, refreshed weekly |
builtin/stable | 2022-05-20 | GA | OCR model stable version |
Google Cloud Console has failed to load JavaScript sources from www.gstatic.com.
Possible reasons are: