Go to the documentation of this file.
32 if (argc == 1 || ((argc - 1) & 1) != 0)
35 << argv[0] <<
"left_image1 right_image1 [L2 R2] [L3 R3] [...]\n";
55 const size_t nPairs = (argc >> 1);
56 for (
size_t i = 0; i < nPairs; i++)
58 const string sImgL = argv[1 + 2 * i + 0];
59 const string sImgR = argv[1 + 2 * i + 1];
63 calib_imgs.resize(calib_imgs.size() + 1);
70 if (!stereo_dat.right.img_original.loadFromFile(sImgR))
81 calib_imgs, calib_params, calib_result);
85 std::cout <<
"Calibration returned an error status.\n";
100 win.get3DSceneAndLock();
101 view1 = scene->getViewport(
"main");
102 view2 = scene->createViewport(
"right");
105 view1->setViewportPosition(0, 0, 0.5, 1.0);
106 view2->setViewportPosition(0.5, 0, 0.5, 1.0);
108 win.unlockAccess3DScene();
111 for (
size_t i = 0; i < nPairs; i++)
113 win.get3DSceneAndLock();
116 calib_imgs[i].left.img_rectified);
118 calib_imgs[i].right.img_rectified);
122 "Detected corners: %u / %u",
123 static_cast<unsigned int>(i + 1),
124 static_cast<unsigned int>(nPairs)));
126 win.unlockAccess3DScene();
140 int main(
int argc,
char** argv)
146 catch (std::exception& e)
148 std::cout <<
"MRPT exception caught: " << e.what() << std::endl;
153 printf(
"Untyped exception!!");
A versatile "profiler" that logs the time spent within each pair of calls to enter(X)-leave(X),...
unsigned int check_size_y
bool checkerBoardStereoCalibration(TCalibrationStereoImageList &images, const TStereoCalibParams ¶ms, TStereoCalibResults &out_results)
Optimize the calibration parameters of a stereo camera or a RGB+D (Kinect) camera.
Classes for computer vision, detectors, features, etc.
Input parameters for mrpt::vision::checkerBoardStereoCalibration.
Data associated to each stereo image in the calibration process mrpt::vision::checkerBoardCameraCalib...
double check_squares_length_X_meters
The size of each square in the checkerboard, in meters, in the "X" & Y" axes.
#define THROW_EXCEPTION_FMT(_FORMAT_STRING,...)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
mrpt::img::CImage img_original
This image will be automatically loaded from the file name passed to checkerBoardCameraCalibration.
unsigned int check_size_x
The number of squares in the checkerboard in the "X" & "Y" direction.
mrpt::gui::CDisplayWindow3D::Ptr win
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
Output results for mrpt::vision::checkerBoardStereoCalibration.
Classes for creating GUI windows for 2D and 3D visualization.
int TestStereoCalibrate(int argc, char **argv)
std::vector< TImageStereoCalibData > TCalibrationStereoImageList
A list of images, used in checkerBoardStereoCalibration.
void setExternalStorage(const std::string &fileName) noexcept
By using this method the image is marked as referenced to an external file, which will be loaded only...
double check_squares_length_Y_meters
std::shared_ptr< COpenGLScene > Ptr
bool loadFromFile(const std::string &fileName, int isColor=-1)
Load image from a file, whose format is determined from the extension (internally uses OpenCV).
#define ASSERT_FILE_EXISTS_(FIL)
The namespace for 3D scene representation and rendering.
std::shared_ptr< COpenGLViewport > Ptr
A graphical user interface (GUI) for efficiently rendering 3D scenes in real-time.
This namespace provides a OS-independent interface to many useful functions: filenames manipulation,...
bool optimize_k1
Select which distortion parameters (of both left/right cameras) will be optimzed: k1,...
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |