Viz Arc User Guide

Version 2.0 | Published July 03, 2024 ©

OCR

The OCR (Optical Character Recognition) widget enables to recognize any characters or numbers from a video source and store them in the DataMap.

images/download/attachments/130577270/ARC_OCR_basketball_test_celtics.png

To Add an OCR Widget

Go to the main script (or any template script), right click on the UI editor and select Widgets > OCR.

images/download/attachments/140817156/new_widget.png

Resize and position the widget. Start the script.

images/download/attachments/140817156/widget.png

You can add multiple widgets.

images/download/attachments/140817156/image-2023-10-26_14-11-48.png

Sources

Select a Source in the drop down menu. The widget supports two types of sources:

  • SMURF: Read from a shared data stream identified by given key. This needs both the key and the synckey to work.

  • NDI: Each NDI stream found is listed in the drop down.

images/download/attachments/140817156/sources.png

Warp

Herdly the camera is not perpendicular to the target (ex. scoreboard), so the image needs to be warped. This step helps the OCR algorithm and improves the results.

Wrap the quad around the target grabbing the red circles.

images/download/attachments/140817156/warp.png

Zoom the image with the mouse wheel, helping to wrap the target more precisely.

images/download/attachments/140817156/zoom.png

The OCR algorithm works with black and white images; to see the actual image used, you can click on the Show Key button next to the Warped expander.

images/download/attachments/140817156/BW.png

Global Settings

images/download/attachments/140817156/global_cfg.png

  • Invert BW: The OCR algorithm works best with black chars on white background, if the result of binarization is inverted you can click on this checkbox to fix it.

  • Equalize Histogram: Enhances the contrast and helps to be less sensible to light changes.

  • Global Threshold multiplier: If there is a light change that leads the algorithm to mixed results, it is possible to use this slider to change all the threshold values of the OCR Rois.

  • Shared Memory prefix: This string is prepend to the OCR Roi name and the result is used as a key in the share memory datamap.

  • Whitelists: It is possible to suggest the allowed chars to improve the results, it doesn't support regular expressions but has some keywords:

    • [a-z] all lowercase letters.

    • [A-Z] all uppercase letters.

    • [0-9] all digits.

    • [a-zA-Z] all letters.

    • [a-zA-Z0-9] all letters and digits.

ROI (Region Of Interest)

images/download/attachments/140817156/draw_roi.png

Add a New ROI OCR

  • Click and drag the left mouse button in the Warped View to begin drawing the rectangle from its first corner.

  • While holding the left mouse button, drag to the required size.

  • Releasing the left mouse button.

It is possible to adjust the size of the ROI by grabbing the top left corner or the bottom right.

Properties

  • ID: The ID is used as part of the DataMap key if the name field is empty.

  • Name: Second part of the DataMap key (the first is the prefix see Config paragraph above).

  • Value: Result of the OCR algorithm that is sent to the DataMap.

  • Settings Button: See below.

  • Remove Button: To remove the ROI.

ROI Settings

images/download/attachments/140817156/ROI_cfg.png

  • Type:

    • Simple: Normal OCR algorithms.

    • Dots: Count the dots in the ROI.

  • Language: Language selection to improve the results (even better if used in conjunction with the whitelist)

  • Binary threshold: The OCR algorithm works on black and white images, therefore a threshold must be applied. In the Warped option, if you click on the ShowKey button you'll see a grayscale image where the pixel value range is between 0 and 255, so every pixel below the threshold will be white and black if above.

  • Erode: The bright areas of the image get thinner, whereas the dark zones gets bigger.

  • Dilate: The dark areas of the image get thinner, whereas the bright zones gets bigger.

Example

This is how a "fully configured" widget appears.

images/download/attachments/140817156/full_widget.png

This is the relative DataMap:

images/download/attachments/140817156/image-2023-10-26_11-49-51.png

Templates and DataMap

Thanks to the DataMap it is possilbe to link the results of the OCR to any template object as show below:

images/download/attachments/130577270/ARC_OCR_basketball_test_celtics.png

This an example on how to link a template object to an ROI result:

images/download/attachments/140817156/image-2023-10-26_17-12-48.png

Tracking

When the tracking is enabled, the algorith tries to follow the "target". Even if the camera moves, it continues to operate without the intervention of the user.

The quad changes color to confirm the tracking has started. While tracking is not possible to move/grab the control corners.

images/download/attachments/140817156/tracking.png

images/download/attachments/140817156/tracking_post.png