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

Revision history [back]

Just as a note: I hardcoded the calibration parameters I obtained from the ROS calibration tool and was successful. So either SVS parameters are not directly compatible (in terms of units) with OpenCV parameters, or I made some mistake in parameter passing.

click to hide/show revision 2
additional details about the actual problem

Just as a note: I hardcoded the calibration parameters I obtained from the ROS calibration tool and was successful. So either SVS parameters are not directly compatible (in terms of units) with OpenCV parameters, or I made some mistake in parameter passing.

EDIT: Both things were actually happening:

  • OpenCV assumes units in meters and SVS in millimeters, so I had to multiply P[3] (essentially the baseline) by 0.001

  • I made a stupid mistake in an accessor function for the projection matrix

Wrong Version

inline void left_P(boost::array<double,12>& P)
{
        for(int ii = 0; ii < 3; ii++)
            for(int jj = 0; jj < 4; jj++)
                P[3*ii+jj] = left_P_[ii][jj];
}

Correct Version

inline void left_P(boost::array<double,12>& P)
{
        for(int ii = 0; ii < 3; ii++)
            for(int jj = 0; jj < 4; jj++)
                P[4*ii+jj] = left_P_[ii][jj];
}