Skip to main content

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:

NodeDescription
OCR_SERVERReceives client requests, forks OCR nodes
OCR_ROSNODESubscribes to image topics, performs OCR and publishes results
OCR_CLIENTSends OCR requests to server and retrieves results

Prerequisites​

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.

    You need to be logged into GitHub to post a comment. If you are already logged in, please ignore this message.

    Radxa-docs © 2026 by Radxa Computer (Shenzhen) Co.,Ltd. is licensed under CC BY 4.0