36 #ifndef _DISTORTION_CORRECTION_H_
37 #define _DISTORTION_CORRECTION_H_
45 #include <opencv2/imgproc/imgproc.hpp>
46 #include <opencv2/highgui/highgui.hpp>
47 #include <opencv2/core/core.hpp>
49 #include <mit_darpa_logs_player/camtrans.h>
68 K.at<
double>(0,0) =
intrinsic.at<
double>(0,0);
69 K.at<
double>(0,1) =
intrinsic.at<
double>(0,1);
70 K.at<
double>(0,2) =
intrinsic.at<
double>(0,2);
72 K.at<
double>(1,0) =
intrinsic.at<
double>(1,0);
73 K.at<
double>(1,1) =
intrinsic.at<
double>(1,1);
74 K.at<
double>(1,2) =
intrinsic.at<
double>(1,2);
76 K.at<
double>(2,0) =
intrinsic.at<
double>(2,0);
77 K.at<
double>(2,1) =
intrinsic.at<
double>(2,1);
78 K.at<
double>(2,2) =
intrinsic.at<
double>(2,2);
80 cv::undistort(*distorted, *corrected, K,
distortion);
90 double orientation_quat[4];
99 position, orientation_quat,
106 mapx.create(240,376,CV_32FC1);
109 mapy.create(240,376,CV_32FC1);
111 for (
double x=0; x<240; x++)
112 for (
double y=0; y<376; y++)
116 camtrans_distort_pixel(cam, y,x,&oy, &ox);
118 mapx.at<
float>(x,y) = oy;
119 mapy.at<
float>(x,y) = ox;
122 cv::remap(*distorted, *corrected, mapx, mapy,CV_INTER_LINEAR);
CGAL::Exact_predicates_inexact_constructions_kernel K
~class_distortion_correction(void)
Defines a class where the parameters of a camera are stored.
struct class_camera_parameters::@0 spherical_distortion_params
int correct_image_distortion(const cv::Mat *distorted, cv::Mat *corrected)
int correct_spherical_image_distortion(const cv::Mat *distorted, cv::Mat *corrected)
class_distortion_correction(void)