Optical Character Recognition Example
HUSKYLENS 2 Optical Character Recognition detects text blocks in view, labels them with IDs, and streams their position and size data to Mind+ and UNIHIKER K10, like a smart camera that reads signs. It can count all detected text areas, check if any text exists, target the block nearest the crosshair, and distinguish learned versus unlearned characters by ID, while blocks let users query, filter, and retrieve specific text regions or learned text counts for interactive projects.
1.Optical Char Recognition Blocks
Before You Start:
1.1 Optical Char Recognition - Output Relevant Data
Under the Optical Char Recognition function, HUSKYLENS 2 can recognize and frame the areas where text blocks appear in its field of view, and display the recognized text on the screen. The following example program can be used to count the total number of recognizable text blocks in the frame and acquire data for the text block closest to the crosshair. Readable data includes: the text block's ID, Name, Content, center X and Y coordinates, and the text block's Width and Height.
Example Program:
Click to upload the program to the device in Mind+, and wait for the upload to complete.
Point the HUSKYLENS 2 camera at any optical character and observe the results displayed on the UNIHIKER K10 screen.
Output Result: As shown below, the default output ID for unlearned text blocks is 0.
You can aim it at a learned text block. For detailed instructions on how to learn optical characters, refer to: Optical Character Recognition.
Output Result: As shown below, the output ID for a learned text block matches the ID displayed on the HUSKYLENS 2 screen.
Note: Under the Optical Char Recognition function, HUSKYLENS 2 can detect and frame all areas where text blocks appear in the frame, but it only recognizes the content of the single text block area where the crosshair is located and displays the text content at the top left of the frame.
1.2 Optical Char Recognition Blocks Description
| block | Description |
|---|---|
|
Used to acquire char recognition data once under HUSKYLENS 2 Optical Char Recognition. |
|
Determine whether any text is detected in the current screen. |
|
Get data of the text block nearest to the crosshair, including ID, name, center X/Y coordinates, width, and height. |
|
Get the total number of detected text areas on screen. |
|
When multiple text blocks are detected, get related data of a specified text block. |
|
Get the number of text blocks with a specified ID. |
|
Get data of a specific text block by its ID. |
|
When multiple identical text blocks appear, get related data of one specified text block. |
|
Determine whether a text block with a specified ID exists in the screen. |
|
Get the number of text areas that have been learned by HuskyLens 2, regardless of whether they appear in the current frame. |
Was this article helpful?
