0
$\begingroup$

Rosanswers logo

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
</pre>
<pre>[ 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.
</pre>
<pre>
$ 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
</pre>
<pre>data: 4321136100317
---
data: 7611166100317
---
data: 7225226100317
---
data: 8639213100317
---
data: 8342113100317
</pre>
When I'm using zbarcam application and reading the same barcode I get
<pre>
$ 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


Originally posted by wojtas on ROS Answers with karma: 36 on 2017-06-03

Post score: 1


Original comments

Comment by ahendrix on 2017-06-04:
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.

Comment by ahendrix on 2017-06-04:
The image_saver and image_publisher nodes will probably be helpful.

Comment by wojtas on 2017-06-05:
Thank you ahendrix.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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 :(.


Originally posted by wojtas with karma: 36 on 2017-06-05

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.