ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

zbar_ros, cv_camera - dirty reads of barcodes

asked 2017-06-03 16:14:52 -0500

wojtas gravatar image

Hello everybody. I'm trying to read barcodes using cv_camera and zbar_ros. Below you can read what I am doing.

$ rosrun cv_camera cv_camera_node /cv_camera/image_raw:=image
[ INFO] [1496521778.337223498]: using default calibration URL
[ INFO] [1496521778.337350789]: camera calibration URL: file:///home/wojtas/.ros/camera_info/camera.yaml
[ INFO] [1496521778.337442923]: Unable to open camera calibration file [/home/wojtas/.ros/camera_info/camera.yaml]
[ WARN] [1496521778.337476985]: Camera calibration file /home/wojtas/.ros/camera_info/camera.yaml not found.
$ rosrun zbar_ros barcode_reader_node 
[ INFO] [1496521948.392267314]: Initializing nodelet with 4 worker threads.

After trying reading barcode from my bottle of beer :) I get

$ rostopic echo /barcode
data: 4321136100317
---
data: 7611166100317
---
data: 7225226100317
---
data: 8639213100317
---
data: 8342113100317

When I'm using zbarcam application and reading the same barcode I get

$ zbarcam
EAN-13:5900699100317
EAN-13:5900699100317
EAN-13:5900699100317

So I'm very confused. Why barcodes from /barcode topic are different from original barcode? Any ideas?

Additional info:

$ roscore 
...
ros_comm version 1.12.7

SUMMARY
========
PARAMETERS
 * /rosdistro: kinetic
 * /rosversion: 1.12.7

$ rostopic list
/barcode
/camera_info
/image
/image/compressed
/image/compressed/parameter_descriptions
/image/compressed/parameter_updates
/image/compressedDepth
/image/compressedDepth/parameter_descriptions
/image/compressedDepth/parameter_updates
/image/theora
/image/theora/parameter_descriptions
/image/theora/parameter_updates
/rosout
/rosout_agg

edit retag flag offensive close merge delete

Comments

I don't anything about zbar, but my first debugging step would be to try to capture an image through ROS as a PNG and then run both the ROS and non-ROS versions of zbar on it; to figure out if the difference is on the image capture side or in the zbar_ros node.

ahendrix gravatar image ahendrix  ( 2017-06-04 14:07:33 -0500 )edit

The image_saver and image_publisher nodes will probably be helpful.

ahendrix gravatar image ahendrix  ( 2017-06-04 14:11:26 -0500 )edit

Thank you ahendrix.

wojtas gravatar image wojtas  ( 2017-06-05 12:27:55 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-06-05 12:27:19 -0500

wojtas gravatar image

Dirty reads aren't connected neither with zbar_ros nor with cv_camera. I've played with zbarcam little longer and it showed me that dirty reads happens.

So I think the "problem" is connected with zbar library. This library is not as reliable as I thought :(.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-06-03 16:14:52 -0500

Seen: 439 times

Last updated: Jun 05 '17