15 #error "This header is C++-only." 20 #include <opencv2/opencv.hpp> 41 : base(calib), image_size_pixels(calib.image_size_pixels),
42 image_size_pixels_cv(calib.image_size_pixels.w,
43 calib.image_size_pixels.h),
44 intrinsics_mat(3, 3, &calib.intrinsics[0][0]),
46 distortion_fisheye_mat(4, 1, &calib.distortion_fisheye[0]),
47 use_fisheye(calib.use_fisheye)
56 return intrinsics_mat.size() == cv::Size(3, 3) &&
57 (
double *)intrinsics_mat.data ==
60 distortion_mat.size() ==
62 (
double *)distortion_mat.data == &(base.
distortion[0]) &&
64 distortion_fisheye_mat.size() == cv::Size(1, 4) &&
65 (
double *)distortion_fisheye_mat.data ==
98 camera_translation_mat(3, 1, &stereo->camera_translation[0]),
99 camera_rotation_mat(3, 3, &stereo->camera_rotation[0][0]),
100 camera_essential_mat(3, 3, &stereo->camera_essential[0][0]),
101 camera_fundamental_mat(3, 3, &stereo->camera_fundamental[0][0])
105 t_stereo_camera_calibration_reference(&temp, stereo);
118 t_stereo_camera_calibration_reference(&tmp, NULL);
123 t_stereo_camera_calibration_reference(&base, NULL);
129 return camera_translation_mat.size() == cv::Size(1, 3) &&
130 (
double *)camera_translation_mat.data ==
133 camera_rotation_mat.size() == cv::Size(3, 3) &&
134 (
double *)camera_rotation_mat.data ==
137 camera_essential_mat.size() == cv::Size(3, 3) &&
138 (
double *)camera_essential_mat.data ==
141 camera_fundamental_mat.size() == cv::Size(3, 3) &&
142 (
double *)camera_fundamental_mat.data ==
175 cv::InputArray rectify_transform_optional = cv::noArray(),
176 cv::Mat new_camera_matrix_optional = cv::Mat());
187 cv::Mat rotation_mat = {};
188 cv::Mat projection_mat = {};
201 cv::Mat disparity_to_depth_mat = {};
234 const cv::Matx33d &intrinsics,
235 const cv::Matx<double, 5, 1> &distortion);
249 const cv::Matx33d &intrinsics,
250 const cv::Matx<double, 5, 1> &distortion,
251 const cv::Matx33d &rectification,
252 const cv::Matx33d &new_camera_matrix);
268 const cv::Matx33d &intrinsics,
269 const cv::Matx<double, 5, 1> &distortion,
270 const cv::Matx33d &rectification,
271 const cv::Matx<double, 3, 4> &new_projection_matrix);
284 const cv::Mat &intrinsics,
285 const cv::Mat &distortion);
296 getNormalizedImageCoords(cv::Point2f origCoords)
const;
305 getNormalizedVector(cv::Point2f origCoords)
const;
308 cv::Mat_<float> cacheX_;
309 cv::Mat_<float> cacheY_;
struct t_camera_calibration view[2]
Calibration of individual views/sensor.
Definition: t_tracking.h:117
~StereoCameraCalibrationWrapper()
Definition: t_calibration_opencv.hpp:121
xrt_size & image_size_pixels
Definition: t_calibration_opencv.hpp:33
Essential stereo calibration data wrapped for C++.
Definition: t_calibration_opencv.hpp:77
double distortion[XRT_DISTORTION_MAX_DIM]
Rectilinear distortion coefficients: k1, k2, p1, p2[, k3[, k4, k5, k6[, s1, s2, s3, s4]].
Definition: t_tracking.h:99
Rectification maps as well as transforms for a stereo camera.
Definition: t_calibration_opencv.hpp:196
Essential calibration data for a single camera, or single lens/sensor of a stereo camera...
Definition: t_tracking.h:89
CameraCalibrationWrapper(t_camera_calibration &calib)
Definition: t_calibration_opencv.hpp:40
RemapPair rectify
Definition: t_calibration_opencv.hpp:186
cv::Mat_< double > distortion_mat
Definition: t_calibration_opencv.hpp:36
static t_stereo_camera_calibration * allocData()
Definition: t_calibration_opencv.hpp:88
double camera_rotation[3][3]
Rotation matrix from first to second in the stereo pair.
Definition: t_tracking.h:122
void t_stereo_camera_calibration_alloc(struct t_stereo_camera_calibration **out_c)
Allocates a new stereo calibration data, unreferences the old calib.
Definition: t_data_utils.c:17
double camera_translation[3]
Translation from first to second in the stereo pair.
Definition: t_tracking.h:120
StereoCameraCalibrationWrapper(t_stereo_camera_calibration *stereo)
Definition: t_calibration_opencv.hpp:95
RemapPair calibration_get_undistort_map(t_camera_calibration &calib, cv::InputArray rectify_transform_optional=cv::noArray(), cv::Mat new_camera_matrix_optional=cv::Mat())
Prepare undistortion/normalization remap structures for a rectilinear or fisheye image.
Definition: t_file.cpp:36
double distortion_fisheye[4]
Fisheye camera distortion coefficients.
Definition: t_tracking.h:102
Provides cached, precomputed access to normalized image coordinates from original, distorted ones.
Definition: t_calibration_opencv.hpp:220
Stereo camera calibration data to be given to trackers.
Definition: t_tracking.h:111
Essential calibration data wrapped for C++.
Definition: t_calibration_opencv.hpp:30
Image size.
Definition: xrt_defines.h:218
cv::Mat remap_y
Definition: t_calibration_opencv.hpp:159
#define XRT_DISTORTION_MAX_DIM
Maximum size of rectilinear distortion coefficient array.
Definition: t_tracking.h:83
t_camera_calibration & base
Definition: t_calibration_opencv.hpp:32
double camera_fundamental[3][3]
Fundamental matrix.
Definition: t_tracking.h:127
double intrinsics[3][3]
Camera intrinsics matrix.
Definition: t_tracking.h:95
bool & use_fisheye
Definition: t_calibration_opencv.hpp:38
t_stereo_camera_calibration * base
Definition: t_calibration_opencv.hpp:79
cv::Mat_< double > intrinsics_mat
Definition: t_calibration_opencv.hpp:35
const cv::Size image_size_pixels_cv
Definition: t_calibration_opencv.hpp:34
cv::Mat_< double > camera_translation_mat
Definition: t_calibration_opencv.hpp:81
Rectification, rotation, projection data for a single view in a stereo pair.
Definition: t_calibration_opencv.hpp:184
cv::Mat remap_x
Definition: t_calibration_opencv.hpp:158
cv::Mat_< double > camera_fundamental_mat
Definition: t_calibration_opencv.hpp:84
cv::Mat_< double > camera_rotation_mat
Definition: t_calibration_opencv.hpp:82
double camera_essential[3][3]
Essential matrix.
Definition: t_tracking.h:125
cv::Mat_< double > camera_essential_mat
Definition: t_calibration_opencv.hpp:83
An x,y pair of matrices for the remap() function.
Definition: t_calibration_opencv.hpp:156
StereoCameraCalibrationWrapper()
Definition: t_calibration_opencv.hpp:110
bool isDataStorageValid() const noexcept
Definition: t_calibration_opencv.hpp:127
cv::Mat_< double > distortion_fisheye_mat
Definition: t_calibration_opencv.hpp:37
bool isDataStorageValid() const noexcept
Try to verify nothing was reallocated.
Definition: t_calibration_opencv.hpp:54