10 #include <gtest/gtest.h> 11 #include <mrpt/config.h> 13 #include <test_mrpt_common.h> 18 TEST(Vision, DISABLED_checkerBoardStereoCalibration)
29 mrpt::UNITTEST_BASEDIR +
"/share/mrpt/datasets/stereo-calib/"s;
36 if (!
images[i].left.img_original.loadFromFile(fil))
38 GTEST_FAIL() <<
"Error loading: " << fil;
42 if (!
images[i].right.img_original.loadFromFile(fil))
44 GTEST_FAIL() <<
"Error loading: " << fil;
73 for (
unsigned int i = 0; i <
NUM_IMGS; i++)
78 for (
unsigned int i = 0; i <
images.size(); i++)
80 images[i].left.img_checkboard.saveToFile(
82 images[i].right.img_checkboard.saveToFile(
92 TEST(Vision, checkerBoardStereoCalibration_empty)
94 TEST(Vision, DISABLED_checkerBoardStereoCalibration_empty)
EXPECT_LT(out.final_rmse, 3.0)
bool optimize_k1
Select which distortion parameters (of both left/right cameras) will be optimzed: k1...
double final_rmse
Final reprojection square Root Mean Square Error (in pixels).
EXPECT_TRUE(mrpt::system::fileExists(ini_fil))
EXPECT_GT(out.final_iters, 10UL)
mrpt::vision::TCalibrationStereoImageList images
std::string std::string format(std::string_view fmt, ARGS &&... args)
std::vector< bool > image_pair_was_used
true if a checkerboard was correctly detected in both left/right images.
unsigned int check_size_y
mrpt::vision::TStereoCalibParams params
size_t final_iters
Final number of optimization iterations executed.
double check_squares_length_X_meters
The size of each square in the checkerboard, in meters, in the "X" & Y" axes.
mrpt::img::TStereoCamera cam_params
Recovered parameters of the stereo camera.
TEST(ICP_SLAM_App, MapFromRawlog_PointMap)
Input parameters for mrpt::vision::checkerBoardStereoCalibration.
double x
Translation in x,y,z.
std::string dumpAsText() const
Dumps all the parameters as a multi-line string, with the same format than saveToConfigFile.
double qr
Unit quaternion part, qr,qx,qy,qz.
void asString(std::string &s) const
Returns a human-readable textual representation of the object (eg: "[x y z yaw pitch roll]"...
unsigned int check_size_x
The number of squares in the checkerboard in the "X" & "Y" direction.
bool checkerBoardStereoCalibration(TCalibrationStereoImageList &images, const TStereoCalibParams ¶ms, TStereoCalibResults &out_results)
Optimize the calibration parameters of a stereo camera or a RGB+D (Kinect) camera.
const unsigned int NUM_IMGS
mrpt::vision::TStereoCalibResults out
EXPECT_EQ(out.image_pair_was_used.size(), NUM_IMGS)
mrpt::poses::CPose3D right2left_camera_pose
The pose of the left camera as seen from the right camera.
mrpt::math::TPose3DQuat rightCameraPose
Pose of the right camera with respect to the coordinate origin of the left camera.
double check_squares_length_Y_meters
bool verbose
Show progress messages to std::cout console (default=true)
EXPECT_NEAR(out.cam_params.rightCameraPose.x, 0.1194, 0.005)
Output results for mrpt::vision::checkerBoardStereoCalibration.
std::vector< TImageStereoCalibData > TCalibrationStereoImageList
A list of images, used in checkerBoardStereoCalibration.