Text Detection Activity
Overview
The Text Detection activity identifies and extracts words from image files using optical character recognition (OCR) technology. It processes the image content and returns the results in a structured JSON format, including the full extracted string, individual words, and their corresponding bounding boxes.
Parameter Table
| Field | Description | Requirement |
|---|---|---|
| Api key | Google Cloud Vision API Key | Required |
| Image path/url | Google Cloud Storage URL of the image | Required |
| Base64 | Base64 encoded string of the image file | Required |
| Response variable name | Variable name to store the HTTP response | Required |
Action Types & Examples
Detected Text
- Format:
string - Example Result:
"This is a sample text detected from the image."
Word-Level Details
- Format:
array of objects - Example Result:
[{"word": "This", "boundingBox": {"x": 10, "y": 20, "width": 30, "height": 10}}, {"word": "is", "boundingBox": {"x": 45, "y": 20, "width": 15, "height": 10}}]
Implementation Examples
Field Setup - Api key: bb3c53c6-8515-4e34-97c8-8281de60972d - Image path/url: gs://cloud-samples-data/vision/ocr/sampleimage.jpg - Base64: /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUF……………./58x/8BX+R/9k= - Response variable name: getResponse
Technical Notes
The Text Detection activity leverages Google Cloud Vision API for its OCR capabilities. For successful execution, you must provide either the
Image path/urlor theBase64field; providing both is not necessary, but at least one is required. For more detailed information and documentation regarding Google Cloud Vision text detection features, refer to the official Google Cloud Vision documentation.