lagadic / vision_visp

ViSP stack for ROS
http://wiki.ros.org/vision_visp
GNU General Public License v2.0
181 stars 90 forks source link

visp_auto_tracker does not output pose data and unable to track properly #39

Closed alyychan closed 7 years ago

alyychan commented 10 years ago

visp_auto_tracker was working perfectly fine for me until today...when I did 'sudo apt-get upgrade' and ran visp_auto_tracker, I got the message below repeatedly as the webcam tracked the QR code.

*** Parsing XML for Mb Edge Tracker **** ecm : mask : size : 5 ecm : mask : nb_mask : 180 ecm : range : tracking : 10 ecm : contrast : threshold 5000 ecm : contrast : mu1 0.5 ecm : contrast : mu2 0.5 sample : sample_step : 4 sample : n_total_sample : 250 klt : Mask Border : 0 klt : Max Features : 10000 klt : Windows Size : 5 klt : Quality : 0.01 klt : Min Distance : 20 klt : Harris Parameter : 0.01 klt : Block Size : 3 klt : Pyramid Levels : 3 face : Angle Appear : 75 face : Angle Disappear : 75 camera : u0 : 325.03 (default) camera : v0 : 219.983 (default) camera : px : 523.553 (default) camera : py : 520.561 (default) (L0) !! /tmp/buildd/ros-hydro-visp-2.9.0-4precise-20140617-1429/src/camera/vpCameraParameters.cpp: get_K(#403) : getting K matrix in the case of projection with distortion has no sense Tracking failed getting K matrix in the case of projection with distortion has no sense Tracking done in 33.239 ms

When I check "rostopic echo /visp_auto_tracker/object_position", I saw that I was no longer getting any pose data from the webcam. The tracking markers that were supposed to show up on the debug display window were no longer there as well. I noticed there were only 8 markers at the corners of the QR code labelled: mi1, mi2, mi3, mi4, mo1, mo2, mo3, mo4.

fspindle commented 10 years ago

@alyychan Thanks for your feedback. I was able to reproduce the error. I have fixed the issue by reverting commit https://github.com/lagadic/vision_visp/commit/c35f2d5cc043be0c7efe4ce8251f32cb375cfb1f

For the moment, the only work arround for you is to build vision_visp from source. I will generate a new version of the ros packages this afternoon. I don't know when they will be available from the official ros repo. It can take few days.

@ricsp According to http://docs.ros.org/api/sensor_msgs/html/msg/CameraInfo.html in cam_info.P[] we have the parameters after rectification. In that case it has no sense to add distortion parameters. If you need the parameters with distortion (ie before rectification), we should use the following code:

const double& px = cam_info.K[0 * 3 + 0];
const double& py = cam_info.K[1 * 3 + 1];
const double& u0 = cam_info.K[0 * 3 + 2];
const double& v0 = cam_info.K[1 * 3 + 2];
cam.initPersProjWithDistortion(px, py, u0, v0, -cam_info.D[0], cam_info.D[0]);

In that case we should find a way to introduce this new functionality without breaking the existing behaviour. May be by introducing a flag, that by default get the parameters without distortion after rectification. We have to discuss about that after our vacations.

Fabien