OCR
OCR (Optical Character Recognition) operator properties for Script Engine. Reads printed text and numbers from the video using PaddleOCR models on the GPU and reports the result as a read-only value (also readable over the HTTP API and from scripts). The scan can be limited to a rectangular region ("scan area") so it only looks where the text is, which also keeps it fast. The image passes through unchanged unless the scan-area outline or the recognized-text overlay is turned on. A common use is reading a burned-in frame counter to confirm two synchronized inputs are frame-aligned.
| Property | Type | Access | Description |
|---|---|---|---|
ScanMode |
OcrScanMode |
get/set |
How the scan region is read. Single line (fast) treats the whole (cropped) region as one line and runs only the recognition model — the fastest option and the right choice for a tightly-cropped number or word such as a burned-in frame counter. Detect text regions first locates every text box inside the region, then recognizes each — use it for arbitrary multi-word or multi-line text. [default=SingleLine]. |
ExecutionMode |
OcrExecutionMode |
get/set |
Whether recognition runs off the render thread (Asynchronous, default) or blocks the render tick until the current frame's result is ready (Synchronous). Synchronous makes the reported text match the on-screen frame — so two genlocked OCR operators report the same frame number — at the cost of render-thread time (recognition latency per scanned frame, which may exceed the frame budget). [default=Asynchronous]. |
MinConfidence |
int |
get/set |
Minimum recognition confidence (0–100). Results below this are ignored and the previous text is kept. Raise it to suppress flicker on hard-to-read frames. [min=0, max=100, default=40]. |
ScanIntervalFrames |
int |
get/set |
Run OCR only every Nth frame to save GPU time; the last result is held in between. 0 or 1 scans every frame. Increase for lighter load when the text changes slowly. [min=0, max=600, default=1]. |
ModelSourceUrl |
Uri |
get/set |
Path to the recognition ONNX model. Leave at the default to use the bundled PaddleOCR model in Media/Models. The character dictionary (ocr_keys.txt) and — for Detect mode — the detection model (ocr_det.onnx) are found alongside it. Changing this reloads the OCR engine. |
DisplayScanArea |
bool |
get/set |
Draw the scan-area outline on the output. Handy while positioning the area; turn off for production. [default=false]. |
CropAreaLeft |
int |
get/set |
Scan-area inset from the left edge, in pixels. Together with the other three insets this defines the region that is scanned. [min=0, max=4096, default=0]. |
CropAreaRight |
int |
get/set |
Scan-area inset from the right edge, in pixels. [min=0, max=4096, default=0]. |
CropAreaTop |
int |
get/set |
Scan-area inset from the top edge, in pixels. [min=0, max=4096, default=0]. |
CropAreaBottom |
int |
get/set |
Scan-area inset from the bottom edge, in pixels. [min=0, max=4096, default=0]. |
ResetCropAreaCommand |
Command |
get |
Reset all scan-area insets so the full frame is scanned. |
DrawRecognizedTextOverlay |
bool |
get/set |
Burn the recognized text onto the output image (top-left of the scan area). Off by default — the operator normally passes the image through untouched and only reports the text. [default=false]. |
RecognizedText |
string |
get |
The most recently recognized text (read-only). Two OCR operators reading two synchronized inputs' burned-in frame counters report the same value when the inputs are aligned. |
RecognizedConfidence |
string |
get |
Confidence of the most recent recognition, as a percentage string (read-only). |
RecognizedTextJson |
string |
get |
The most recent recognition as JSON (text, confidence, and per-box coordinates), read-only. Convenient for scripts and autotests. [default=empty]. |
ScriptCallbackFunction |
string |
get/set |
Name of a Script Engine function to call whenever a new recognition is produced. The function receives the result JSON. Leave empty to disable. [default=empty]. |
ComputeTime |
string |
get |
Time the last OCR inference took, in milliseconds (read-only, diagnostics). |
ComponentLog |
ComponentLog |
get |
In-panel activity log: model loading, worker readiness (GPU/CPU), the first recognition, and any errors. Diagnostic mini-log — it is not written to the Composer file log. |
Inherits from: AbstractOperator, AbstractAudioMetering, NamedModel.
See also: OCR in Operators — user-facing introduction, screenshots, and section summaries.