3 #include <visp3/core/vpCameraParameters.h>
4 #include <visp3/core/vpConfig.h>
5 #include <visp3/core/vpImageConvert.h>
6 #include <visp3/io/vpImageIo.h>
8 #if defined(VISP_HAVE_OPENCV) && defined(HAVE_OPENCV_CALIB3D) && defined(HAVE_OPENCV_IMGPROC)
9 #include <opencv2/calib3d/calib3d.hpp>
10 #include <opencv2/core/core.hpp>
11 #include <opencv2/imgproc/imgproc.hpp>
15 #ifdef ENABLE_VISP_NAMESPACE
29 cv::Mat K = (cv::Mat_<double>(3, 3) << cam.get_px(), 0, cam.get_u0(), 0, cam.get_py(), cam.get_v0(), 0, 0, 1);
30 cv::Mat D = (cv::Mat_<double>(4, 1) << cam.get_kud(), 0, 0, 0);
44 cv::Mat imageUndistorted;
45 cv::undistort(image, imageUndistorted, K, D);
61 std::cout <<
"This tutorial required OpenCV imgproc module" << std::endl;
Generic class defining intrinsic camera parameters.
static void convert(const vpImage< unsigned char > &src, vpImage< vpRGBa > &dest)
static void read(vpImage< unsigned char > &I, const std::string &filename, int backend=IO_DEFAULT_BACKEND)
static void write(const vpImage< unsigned char > &I, const std::string &filename, int backend=IO_DEFAULT_BACKEND)