Basic OCR
Demonstrates OCR (Optical Character Recognition) service. It subscribes to image topics from the ROS system and publishes OCR recognition results.
Pipeline Architecture
The OCR service consists of three ROS nodes:
| Node | Description |
|---|---|
OCR_SERVER | Receives client requests, forks OCR nodes |
OCR_ROSNODE | Subscribes to image topics, performs OCR and publishes results |
OCR_CLIENT | Sends OCR requests to server and retrieves results |
Prerequisites
- QIR SDK installed
- A test image prepared, e.g.
~/test.jpg
Run
Execute in three separate terminals:
Terminal 1 — Start the OCR server:
radxa@airbox$
source /opt/ros/jazzy/setup.bash
ros2 run ocr_service ocr_server
Terminal 2 — Publish a test image:
radxa@airbox$
source /opt/ros/jazzy/setup.bash
ros2 run ocr_service ocr_testnode --topic test --picture ~/test.jpg
Terminal 3 — Send an OCR request:
radxa@airbox$
source /opt/ros/jazzy/setup.bash
ros2 run ocr_service ocr_client test
Expected Output
Terminal 1 prints the OCR recognition result, e.g.:
[INFO] [Ocr_client_async]: Result of ocr_request: for test True response test_response
Stop
Press Ctrl + C in each terminal to stop.