OCR
Perform OCR on objects in an ROI, or on a ROI in the frame.
Overview
The OCR node allows for performing OCR (Optical Character Recognition) on objects within a Region of Interest (ROI), or on a ROI within the frame. This functionality is crucial for applications requiring text recognition and extraction from video feeds.
Properties
| Property | Description | Type | Default | Required |
|---|---|---|---|---|
| roi_labels | Regions of interest labels | hidden | Yes | |
| rois | Regions of interest. Type: polygon. Default: null. Conditional on roi_labels. | polygon | null | Yes |
| processing_mode | Processing mode. Options: ROIs, at an Interval (rois_interval), ROIs, upon a Trigger (rois_trigger), Objects in an ROI (objects). | enum | rois_interval | Yes |
| trigger | Queue ROI for OCR when this condition evaluates to true. Conditional on processing_mode being rois_trigger. | trigger-condition | null | Yes |
| objects_to_process | Object types to process. ex. car,person,car.red. Conditional on processing_mode being objects. | model-label | null | Yes |
| min_obj_size_pixels | Min. width and height of an object. Conditional on processing_mode being objects. | number | 64 | Yes |
| obj_lookup_size_change_threshold | Object size ratio change threshold. Slider min: 0.1, max: 2.0, step: 0.2. Conditional on processing_mode being objects. | slider | 0.1 | Yes |
| max_lookups_per_obj | Max. OCR attempts per object. Conditional on processing_mode being objects. | number | 5 | Yes |
| group_ocr_results | Group OCR texts? | bool | false | No |
| ocr_match_pattern | OCR match pattern. Only retain OCR results that match this Regular Expression pattern. Leave blank to keep unfiltered results. | string | null | No |
| min_confidence | OCR confidence threshold. Slider min: 0, max: 1, step: 0.05. | slider | 0.7 | Yes |
| additional_orientations | Comma separated string with additional orientations to consider for OCR. Valid orientation values: 90, 180, 270. This is useful for recognizing text that is rotated at 90, 180, or 270 degrees. | enum-multi | null | No |
| ocr_interval | OCR lookups interval in seconds. | number | 1 | No |
| display_roi | Display ROI on video? | bool | true | No |
| display_objinfo | Display OCR info on video? Options: Disabled, Bottom left, Bottom right, Top left, Top right. | enum | bottom_left | No |
| debug | Log debugging information? | bool | false | No |
Output Metadata
| Metadata Property | Description |
|---|---|
| nodes.[node_id].rois.[roi_id].label_changed_delta | Indicates if there has been a change in the label of the ROI. |
| nodes.[node_id].rois.[roi_id].label_available | Indicates if a label is available for the ROI. |
| nodes.[node_id].recognized_obj_count | The count of recognized objects. |
| nodes.[node_id].recognized_obj_delta | The change in the count of recognized objects. |
| nodes.[node_id].label_changed_obj_delta | The change in the count of objects with changed labels. |
| nodes.[node_id].unrecognized_obj_count | The count of unrecognized objects. |
| nodes.[node_id].unrecognized_obj_delta | The change in the count of unrecognized objects. |
{
"nodes": {
"[node_id]": {
"rois": {
"[roi_id]": {
"label_changed_delta": true,
"label_available": true
}
},
"recognized_obj_count": 5,
"recognized_obj_delta": 1,
"label_changed_obj_delta": 2,
"unrecognized_obj_count": 0,
"unrecognized_obj_delta": 0
}
}
}Example Usage
An example of how to use the OCR node in a video processing pipeline:
<VideoProcessingPipeline>
<OCR
roi_labels="['license_plate']"
rois="[{ x: 10, y: 20, width: 100, height: 50 }]"
processing_mode="objects"
trigger="motion_detected"
objects_to_process="['car']"
min_obj_size_pixels={64}
obj_lookup_size_change_threshold={0.3}
max_lookups_per_obj={3}
group_ocr_results={true}
ocr_match_pattern="\d{3}-\d{2}"
min_confidence={0.85}
ocr_interval={5}
display_roi={true}
display_objinfo="bottom_left"
debug={false}
/>
</VideoProcessingPipeline>Updated 11 days ago
