barcode_detection
Detects and decodes the barcodes, e.g. EAN-13 (cv::barcode::BarcodeDetector).
opencv_apps |
3.0.0 and later |
|---|---|
ROS |
ROS One, jazzy, kilted, lyrical and later |
OpenCV |
OpenCV 4.8 or later, or the barcode module of opencv_contrib |
Group |
Codes and markers, the nodes of which publish |
Usage
# ROS 2
ros2 launch opencv_apps barcode_detection.launch.xml image:=/camera/image_raw debug_view:=false
# ROS 1
roslaunch opencv_apps barcode_detection.launch image:=/camera/image_raw debug_view:=false
Try it with the demo video
Download the input video of the demo above, publish it as image with image_publisher, and run the node on it, in the terminals:
wget https://raw.githubusercontent.com/ros-perception/opencv_apps/indigo/test/codes.mp4
# terminal 1: publish the video as image in a loop
ros2 run image_publisher image_publisher_node codes.mp4 --ros-args -p publish_rate:=10.0 -r image_raw:=image
# terminal 2: run the node
ros2 launch opencv_apps barcode_detection.launch.xml image:=image
# terminal 3: view the result
ros2 run rqt_image_view rqt_image_view /barcode_detection/image
In ROS 1:
# terminal 1
rosrun image_publisher image_publisher codes.mp4 _publish_rate:=10 __name:=camera
# terminal 2
roslaunch opencv_apps barcode_detection.launch image:=camera/image_raw
See Credits of the demo videos for the license of the video.
Subscribed topics
Topic |
Type |
|---|---|
|
|
Published topics
Topic |
Type |
|---|---|
|
|
|
|
Parameters
See also the common parameters.
Name |
Type |
Default (range) |
Changed at run time |
Description |
|---|---|---|---|---|
|
int |
3 |
no, restart the node |
Specify queue_size of input image subscribers |
Source
src/nodelet/barcode_detection_nodelet.cpp, launch/barcode_detection.launch.xml