Main MRPT website > C++ reference for MRPT 1.9.9
CStereoRectifyMap.cpp
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 #include "vision-precomp.h" // Precompiled headers
12 
13 // Universal include for all versions of OpenCV
14 #include <mrpt/otherlibs/do_opencv_includes.h>
15 
16 using namespace mrpt;
17 using namespace mrpt::poses;
18 using namespace mrpt::vision;
19 using namespace mrpt::utils;
20 using namespace mrpt::math;
21 
22 // Ctor: Leave all vectors empty
23 CStereoRectifyMap::CStereoRectifyMap()
24  : m_alpha(-1),
25  m_resize_output(false),
26  m_enable_both_centers_coincide(false),
27  m_resize_output_value(0, 0),
28  m_interpolation_method(mrpt::utils::IMG_INTERP_LINEAR)
29 {
30 }
31 
33 {
35  .clear(); // don't do a "strong clear" since memory is likely
36  m_dat_mapx_right.clear(); // to be reasigned soon.
37  m_dat_mapy_left.clear();
38  m_dat_mapy_right.clear();
39 }
40 
42 {
43  m_alpha = alpha;
44 
45  this->internal_invalidate();
46 }
47 
49  bool enable, unsigned int target_width, unsigned int target_height)
50 {
51  m_resize_output = enable;
52  m_resize_output_value.x = target_width;
53  m_resize_output_value.y = target_height;
54 
55  this->internal_invalidate();
56 }
57 
59 {
61 
62  this->internal_invalidate();
63 }
64 
65 /** Prepares the mapping from the distortion parameters of a camera.
66  * Must be called before invoking \a undistort().
67  */
70 {
72 #if MRPT_HAS_OPENCV && MRPT_OPENCV_VERSION_NUM >= 0x200
73  const mrpt::utils::TCamera& cam1 = params.leftCamera;
74  const mrpt::utils::TCamera& cam2 = params.rightCamera;
75 
76  ASSERT_(cam1.ncols == cam2.ncols && cam1.nrows == cam2.nrows)
77 
78  const uint32_t ncols = cam1.ncols;
79  const uint32_t nrows = cam1.nrows;
80 
81  const cv::Size trg_size =
83  ? cv::Size(
85  m_resize_output_value.y) // User requested image scaling
86  : cv::Size(); // Default=don't scale
87 
88  const uint32_t ncols_out =
90  const uint32_t nrows_out =
92 
93  // save a copy for future reference
95 
96  // Create OpenCV's wrappers for output maps:
97  m_dat_mapx_left.resize(2 * nrows_out * ncols_out);
98  m_dat_mapy_left.resize(nrows_out * ncols_out);
99 
100  m_dat_mapx_right.resize(2 * nrows_out * ncols_out);
101  m_dat_mapy_right.resize(nrows_out * ncols_out);
102 
103  CvMat mapx_left =
104  cvMat(nrows_out, ncols_out, CV_16SC2, &m_dat_mapx_left[0]);
105  CvMat mapy_left =
106  cvMat(nrows_out, ncols_out, CV_16UC1, &m_dat_mapy_left[0]);
107  CvMat mapx_right =
108  cvMat(nrows_out, ncols_out, CV_16SC2, &m_dat_mapx_right[0]);
109  CvMat mapy_right =
110  cvMat(nrows_out, ncols_out, CV_16UC1, &m_dat_mapy_right[0]);
111 
112  cv::Mat _mapx_left = cv::cvarrToMat(&mapx_left, false);
113  cv::Mat _mapy_left = cv::cvarrToMat(&mapy_left, false);
114  cv::Mat _mapx_right = cv::cvarrToMat(&mapx_right, false);
115  cv::Mat _mapy_right = cv::cvarrToMat(&mapy_right, false);
116 
117  // right camera pose: Rotation
118  CMatrixDouble44 hMatrix;
119  // NOTE!: OpenCV seems to expect the INVERSE of the pose we keep, so invert
120  // it:
121  params.rightCameraPose.getInverseHomogeneousMatrix(hMatrix);
122 
123  double m1[3][3];
124  for (unsigned int i = 0; i < 3; ++i)
125  for (unsigned int j = 0; j < 3; ++j) m1[i][j] = hMatrix(i, j);
126 
127  // right camera pose: translation
128  double rcTrans[3] = {hMatrix(0, 3), hMatrix(1, 3), hMatrix(2, 3)};
129 
130  double ipl[3][3], ipr[3][3], dpl[5], dpr[5];
131  for (unsigned int i = 0; i < 3; ++i)
132  for (unsigned int j = 0; j < 3; ++j)
133  {
134  ipl[i][j] = cam1.intrinsicParams(i, j);
135  ipr[i][j] = cam2.intrinsicParams(i, j);
136  }
137 
138  for (unsigned int i = 0; i < 5; ++i)
139  {
140  dpl[i] = cam1.dist[i];
141  dpr[i] = cam2.dist[i];
142  }
143 
144  const cv::Mat R(3, 3, CV_64F, &m1);
145  const cv::Mat T(3, 1, CV_64F, &rcTrans);
146 
147  const cv::Mat K1(3, 3, CV_64F, ipl);
148  const cv::Mat K2(3, 3, CV_64F, ipr);
149  const cv::Mat D1(1, 5, CV_64F, dpl);
150  const cv::Mat D2(1, 5, CV_64F, dpr);
151 
152  double _R1[3][3], _R2[3][3], _P1[3][4], _P2[3][4], _Q[4][4];
153  cv::Mat R1(3, 3, CV_64F, _R1);
154  cv::Mat R2(3, 3, CV_64F, _R2);
155  cv::Mat P1(3, 4, CV_64F, _P1);
156  cv::Mat P2(3, 4, CV_64F, _P2);
157  cv::Mat Q(4, 4, CV_64F, _Q);
158 
159  const cv::Size img_size(ncols, nrows);
160  const cv::Size real_trg_size =
161  m_resize_output ? trg_size
162  : img_size; // Note: trg_size is Size() by default
163 
164 /*
165 OpenCV 2.0:
166 CV_EXPORTS void stereoRectify( const Mat& cameraMatrix1, const Mat& distCoeffs1,
167  const Mat& cameraMatrix2, const Mat& distCoeffs2,
168  Size imageSize, const Mat& R, const Mat& T,
169  Mat& R1, Mat& R2, Mat& P1, Mat& P2, Mat& Q,
170  int flags=CALIB_ZERO_DISPARITY );
171 
172 OpenCV 2.1-2.2:
173 CV_EXPORTS_W void stereoRectify( const Mat& cameraMatrix1, const Mat&
174 distCoeffs1,
175  const Mat& cameraMatrix2, const Mat&
176 distCoeffs2,
177  Size imageSize, const Mat& R, const Mat& T,
178  CV_OUT Mat& R1, CV_OUT Mat& R2,
179  CV_OUT Mat& P1, CV_OUT Mat& P2, CV_OUT Mat& Q,
180  double alpha, Size newImageSize=Size(),
181  CV_OUT Rect* validPixROI1=0, CV_OUT Rect*
182 validPixROI2=0,
183  int flags=CALIB_ZERO_DISPARITY );
184 
185 OpenCV 2.3:
186 CV_EXPORTS void stereoRectify( InputArray cameraMatrix1, InputArray distCoeffs1,
187  InputArray cameraMatrix2, InputArray distCoeffs2,
188  Size imageSize, InputArray R, InputArray T,
189  OutputArray R1, OutputArray R2,
190  OutputArray P1, OutputArray P2,
191  OutputArray Q, int flags=CALIB_ZERO_DISPARITY,
192  double alpha=-1, Size newImageSize=Size(),
193  CV_OUT Rect* validPixROI1=0, CV_OUT Rect*
194 validPixROI2=0 );
195 */
196 #if MRPT_OPENCV_VERSION_NUM < 0x210
197  // OpenCV 2.0.X
198  cv::stereoRectify(
199  K1, D1, K2, D2, img_size, R, T, R1, R2, P1, P2, Q,
200  m_enable_both_centers_coincide ? cv::CALIB_ZERO_DISPARITY : 0);
201 #elif MRPT_OPENCV_VERSION_NUM < 0x230
202  // OpenCV 2.1.X - 2.2.X
203  cv::stereoRectify(
204  K1, D1, K2, D2, img_size, R, T, R1, R2, P1, P2, Q, m_alpha,
205  trg_size, // Size() by default=no resize
206  nullptr, nullptr, // Out ROIs
207  m_enable_both_centers_coincide ? cv::CALIB_ZERO_DISPARITY : 0);
208 #else
209  // OpenCV 2.3+ has this signature:
210  cv::stereoRectify(
211  K1, D1, K2, D2, img_size, R, T, R1, R2, P1, P2, Q,
212  m_enable_both_centers_coincide ? cv::CALIB_ZERO_DISPARITY : 0, m_alpha,
213  trg_size // Size() by default=no resize
214  );
215 // Rest of arguments -> default
216 #endif
217 
218  cv::initUndistortRectifyMap(
219  K1, D1, R1, P1, real_trg_size, CV_16SC2, _mapx_left, _mapy_left);
220  cv::initUndistortRectifyMap(
221  K2, D2, R2, P2, real_trg_size, CV_16SC2, _mapx_right, _mapy_right);
222 
223  // Populate the parameter matrices of the output rectified images:
224  for (unsigned int i = 0; i < 3; ++i)
225  for (unsigned int j = 0; j < 3; ++j)
226  {
228  _P1[i][j];
230  _P2[i][j];
231  }
232  // They have no distortion:
235 
236  // Target image size:
237  m_rectified_image_params.leftCamera.ncols = real_trg_size.width;
238  m_rectified_image_params.leftCamera.nrows = real_trg_size.height;
239 
240  m_rectified_image_params.rightCamera.ncols = real_trg_size.width;
241  m_rectified_image_params.rightCamera.nrows = real_trg_size.height;
242 
243  // Rest of params don't change:
245  params.leftCamera.focalLengthMeters;
247  params.rightCamera.focalLengthMeters;
248 
249  // R1: Rotation of left camera after rectification:
250  // R2: idem for right cam:
251  const Eigen::Map<Eigen::Matrix3d> R1e(R1.ptr<double>());
252  const Eigen::Map<Eigen::Matrix3d> R2e(R2.ptr<double>());
253 
254  CPose3D RR1, RR2;
255  RR1.setRotationMatrix(R1e);
256  RR2.setRotationMatrix(R2e);
257  m_rot_left = CPose3DQuat(RR1);
258  m_rot_right = CPose3DQuat(RR2);
259 
261 
262 #else
263  THROW_EXCEPTION("MRPT built without OpenCV >=2.0.0!")
264 #endif
265  MRPT_END
266 }
267 
269  const mrpt::utils::CImage& in_left_image,
270  const mrpt::utils::CImage& in_right_image,
271  mrpt::utils::CImage& out_left_image,
272  mrpt::utils::CImage& out_right_image) const
273 {
274  MRPT_START
275 
276 #if MRPT_HAS_OPENCV && MRPT_OPENCV_VERSION_NUM >= 0x200
279 
280  const CvSize trg_size =
283  : cvSize(ncols, nrows);
284 
285  out_left_image.resize(
286  trg_size.width, trg_size.height, in_left_image.isColor() ? 3 : 1,
287  in_left_image.isOriginTopLeft());
288  out_right_image.resize(
289  trg_size.width, trg_size.height, in_left_image.isColor() ? 3 : 1,
290  in_left_image.isOriginTopLeft());
291 
292  const IplImage* in_left = in_left_image.getAs<IplImage>();
293  const IplImage* in_right = in_right_image.getAs<IplImage>();
294 
295  IplImage* out_left = out_left_image.getAs<IplImage>();
296  IplImage* out_right = out_right_image.getAs<IplImage>();
297 
298  this->rectify_IPL(in_left, in_right, out_left, out_right);
299 
300 #endif
301  MRPT_END
302 }
303 
304 // In place:
306  mrpt::utils::CImage& left_image, mrpt::utils::CImage& right_image,
307  const bool use_internal_mem_cache) const
308 {
309  MRPT_START
310 
311 #if MRPT_HAS_OPENCV && MRPT_OPENCV_VERSION_NUM >= 0x200
314 
315  const CvSize trg_size =
318  : cvSize(ncols, nrows);
319 
320  const IplImage* in_left = left_image.getAs<IplImage>();
321  const IplImage* in_right = right_image.getAs<IplImage>();
322 
323  IplImage *out_left_image, *out_right_image;
324  if (use_internal_mem_cache)
325  {
327  trg_size.width, trg_size.height, left_image.isColor() ? 3 : 1,
328  left_image.isOriginTopLeft());
330  trg_size.width, trg_size.height, right_image.isColor() ? 3 : 1,
331  right_image.isOriginTopLeft());
332 
333  out_left_image = m_cache1.getAs<IplImage>();
334  out_right_image = m_cache2.getAs<IplImage>();
335  }
336  else
337  {
338  out_left_image =
339  cvCreateImage(trg_size, in_left->depth, in_left->nChannels);
340  out_right_image =
341  cvCreateImage(trg_size, in_right->depth, in_right->nChannels);
342  }
343 
344  this->rectify_IPL(in_left, in_right, out_left_image, out_right_image);
345 
346  if (use_internal_mem_cache)
347  {
348  // Copy the data: we have avoided one allocation & one deallocation
349  // (If the sizes match, these calls have no effects)
350  left_image.resize(
351  trg_size.width, trg_size.height, left_image.isColor() ? 3 : 1,
352  left_image.isOriginTopLeft());
353  right_image.resize(
354  trg_size.width, trg_size.height, right_image.isColor() ? 3 : 1,
355  right_image.isOriginTopLeft());
356 
357  cvCopy(out_left_image, left_image.getAs<IplImage>());
358  cvCopy(out_right_image, right_image.getAs<IplImage>());
359  }
360  else
361  {
362  // Move the internal pointers: but we deallocate the old contents and
363  // needed to allocate this one
364  left_image.setFromIplImage(out_left_image);
365  right_image.setFromIplImage(out_right_image);
366  }
367 
368 #endif
369  MRPT_END
370 }
371 
372 /** Overloaded version for in-place rectification of image pairs stored in a
373  * mrpt::obs::CObservationStereoImages.
374  * Upon return, the new camera intrinsic parameters will be already stored in
375  * the observation object.
376  */
378  mrpt::obs::CObservationStereoImages& stereo_image_observation,
379  const bool use_internal_mem_cache) const
380 {
381  MRPT_START
382  ASSERT_(stereo_image_observation.hasImageRight)
383 
384  // Rectify images:
385  this->rectify(
386  stereo_image_observation.imageLeft, stereo_image_observation.imageRight,
387  use_internal_mem_cache);
388 
389  // Copy output image parameters:
390  stereo_image_observation.setStereoCameraParams(
392 
393  // Correct poses:
394  stereo_image_observation.cameraPose += m_rot_left;
395 
396  const double d = stereo_image_observation.rightCameraPose.m_coords.norm();
397  // the translation is now pure in the +X direction:
398  stereo_image_observation.rightCameraPose =
400 
401  MRPT_END
402 }
403 
404 /** Just like rectify() but directly works with OpenCV's "IplImage*", which must
405  * be passed as "void*" to avoid header dependencies */
407  const void* srcImg_left, const void* srcImg_right, void* outImg_left,
408  void* outImg_right) const
409 {
410  MRPT_START
411  ASSERT_(srcImg_left != outImg_left && srcImg_right != outImg_right)
412 
413  if (!isSet())
415  "Error: setFromCamParams() must be called prior to rectify().")
416 
417 #if MRPT_HAS_OPENCV && MRPT_OPENCV_VERSION_NUM >= 0x200
420 
421  const uint32_t ncols_out =
423  const uint32_t nrows_out =
425 
426  const CvMat mapx_left = cvMat(
427  nrows_out, ncols_out, CV_16SC2,
428  const_cast<int16_t*>(&m_dat_mapx_left[0]));
429  const CvMat mapy_left = cvMat(
430  nrows_out, ncols_out, CV_16UC1,
431  const_cast<uint16_t*>(&m_dat_mapy_left[0]));
432  const CvMat mapx_right = cvMat(
433  nrows_out, ncols_out, CV_16SC2,
434  const_cast<int16_t*>(&m_dat_mapx_right[0]));
435  const CvMat mapy_right = cvMat(
436  nrows_out, ncols_out, CV_16UC1,
437  const_cast<uint16_t*>(&m_dat_mapy_right[0]));
438 
439  const cv::Mat mapx1 = cv::cvarrToMat(&mapx_left);
440  const cv::Mat mapy1 = cv::cvarrToMat(&mapy_left);
441  const cv::Mat mapx2 = cv::cvarrToMat(&mapx_right);
442  const cv::Mat mapy2 = cv::cvarrToMat(&mapy_right);
443 
444  const cv::Mat src1 = cv::cvarrToMat(srcImg_left);
445  const cv::Mat src2 = cv::cvarrToMat(srcImg_right);
446  cv::Mat dst1 = cv::cvarrToMat(outImg_left);
447  cv::Mat dst2 = cv::cvarrToMat(outImg_right);
448 
449  cv::remap(
450  src1, dst1, mapx1, mapy1, static_cast<int>(m_interpolation_method),
451  cv::BORDER_CONSTANT, cvScalarAll(0));
452  cv::remap(
453  src2, dst2, mapx2, mapy2, static_cast<int>(m_interpolation_method),
454  cv::BORDER_CONSTANT, cvScalarAll(0));
455 #endif
456  MRPT_END
457 }
458 
460  const
461 {
462  if (!isSet())
463  THROW_EXCEPTION("Error: setFromCamParams() must be called before.")
465 }
466 
468  const
469 {
470  if (!isSet())
471  THROW_EXCEPTION("Error: setFromCamParams() must be called before.")
473 }
474 
476  const
477 {
478  if (!isSet())
479  THROW_EXCEPTION("Error: setFromCamParams() must be called before.")
481 }
482 
484  const std::vector<int16_t>& left_x, const std::vector<uint16_t>& left_y,
485  const std::vector<int16_t>& right_x, const std::vector<uint16_t>& right_y)
486 {
487  m_dat_mapx_left.resize(left_x.size());
488  m_dat_mapy_left.resize(left_y.size());
489  m_dat_mapx_right.resize(right_x.size());
490  m_dat_mapy_right.resize(right_y.size());
491 
492  std::copy(left_x.begin(), left_x.end(), m_dat_mapx_left.begin());
493  std::copy(left_y.begin(), left_y.end(), m_dat_mapy_left.begin());
494  std::copy(right_x.begin(), right_x.end(), m_dat_mapx_right.begin());
495  std::copy(right_y.begin(), right_y.end(), m_dat_mapy_right.begin());
496 }
497 
499  std::vector<int16_t>& left_x, std::vector<uint16_t>& left_y,
500  std::vector<int16_t>& right_x, std::vector<uint16_t>& right_y)
501 {
502  left_x.swap(m_dat_mapx_left);
503  left_y.swap(m_dat_mapy_left);
504  right_x.swap(m_dat_mapx_right);
505  right_y.swap(m_dat_mapy_right);
506 }
bool hasImageRight
Whether imageRight actually contains data (Default upon construction: true)
GLclampf GLclampf GLclampf alpha
Definition: glext.h:3525
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
const mrpt::utils::TCamera & getRectifiedRightImageParams() const
Just like getRectifiedImageParams() but for the right camera only.
mrpt::utils::CImage imageLeft
Image from the left camera (this image will be ALWAYS present)
double focalLengthMeters
The focal length of the camera, in meters (can be used among &#39;intrinsicParams&#39; to determine the pixel...
Definition: TCamera.h:63
const mrpt::utils::TCamera & getRectifiedLeftImageParams() const
Just like getRectifiedImageParams() but for the left camera only.
A class for storing images as grayscale or RGB bitmaps.
Definition: CImage.h:118
const mrpt::utils::TStereoCamera & getRectifiedImageParams() const
After computing the rectification maps, this method retrieves the calibration parameters of the recti...
#define THROW_EXCEPTION(msg)
void resize(unsigned int width, unsigned int height, TImageChannels nChannels, bool originTopLeft)
Changes the size of the image, erasing previous contents (does NOT scale its current content...
Definition: CImage.h:249
void setRectifyMaps(const std::vector< int16_t > &left_x, const std::vector< uint16_t > &left_y, const std::vector< int16_t > &right_x, const std::vector< uint16_t > &right_y)
Direct input access to rectify maps.
void rectify(const mrpt::utils::CImage &in_left_image, const mrpt::utils::CImage &in_right_image, mrpt::utils::CImage &out_left_image, mrpt::utils::CImage &out_right_image) const
Rectify the input image pair and save the result in a different output images - setFromCamParams() mu...
mrpt::utils::TStereoCamera m_rectified_image_params
Resulting images params.
mrpt::utils::TStereoCamera m_camera_params
A copy of the data provided by the user.
const T * getAs() const
Returns a pointer to a const T* containing the image - the idea is to call like "img.getAs<IplImage>()" so we can avoid here including OpenCV&#39;s headers.
Definition: CImage.h:587
void setRotationMatrix(const mrpt::math::CMatrixDouble33 &ROT)
Sets the 3x3 rotation matrix.
Definition: CPose3D.h:249
Structure to hold the parameters of a pinhole stereo camera model.
Definition: TStereoCamera.h:25
mrpt::utils::TInterpolationMethod m_interpolation_method
bool isSet() const
Returns true if setFromCamParams() has been already called, false otherwise.
mrpt::poses::CPose3DQuat cameraPose
The pose of the LEFT camera, relative to the robot.
mrpt::utils::TImageSize m_resize_output_value
A numeric matrix of compile-time fixed size.
This base provides a set of functions for maths stuff.
Definition: CArrayNumeric.h:19
#define MRPT_END
void rectify_IPL(const void *in_left_image, const void *in_right_image, void *out_left_image, void *out_right_image) const
Just like rectify() but directly works with OpenCV&#39;s "IplImage*", which must be passed as "void*" to ...
void setFromCamParams(const mrpt::utils::TStereoCamera &params)
Prepares the mapping from the intrinsic, distortion and relative pose parameters of a stereo camera...
void setAlpha(double alpha)
Sets the alpha parameter which controls the zoom in/out of the rectified images, such that: ...
Observation class for either a pair of left+right or left+disparity images from a stereo camera...
uint32_t ncols
Camera resolution.
Definition: TCamera.h:54
Classes for computer vision, detectors, features, etc.
void setFromIplImage(void *iplImage)
Reads the image from a OpenCV IplImage object (WITHOUT making a copy).
Definition: CImage.cpp:368
A class used to store a 3D pose as a translation (x,y,z) and a quaternion (qr,qx,qy,qz).
Definition: CPose3DQuat.h:48
void enableBothCentersCoincide(bool enable=true)
If enabled (default=false), the principal points in both output images will coincide.
std::vector< int16_t > m_dat_mapx_left
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
Definition: CPoint.h:17
mrpt::utils::CImage imageRight
Image from the right camera, only contains a valid image if hasImageRight == true.
mrpt::math::CMatrixDouble33 intrinsicParams
Matrix of intrinsic parameters (containing the focal length and principal point coordinates) ...
Definition: TCamera.h:57
mrpt::math::CArrayDouble< 3 > m_coords
The translation vector [x,y,z].
Definition: CPose3DQuat.h:54
void setStereoCameraParams(const mrpt::utils::TStereoCamera &in_params)
Sets leftCamera, rightCamera and rightCameraPose from a TStereoCamera structure.
mrpt::poses::CPose3DQuat m_rot_left
The rotation applied to the left/right camera so their virtual image plane is the same after rectific...
#define MRPT_START
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
mrpt::math::CArrayDouble< 5 > dist
[k1 k2 t1 t2 k3] -> k_i: parameters of radial distortion, t_i: parameters of tangential distortion (d...
Definition: TCamera.h:60
const float R
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:88
TCamera leftCamera
Intrinsic and distortion parameters of the left and right cameras.
Definition: TStereoCamera.h:30
mrpt::poses::CPose3DQuat rightCameraPose
The pose of the right camera, relative to the left one: Note that using the conventional reference co...
uint32_t nrows
Definition: TCamera.h:54
bool isOriginTopLeft() const
Returns true if the coordinates origin is top-left, or false if it is bottom-left.
Definition: CImage.cpp:939
#define ASSERT_(f)
bool isColor() const
Returns true if the image is RGB, false if it is grayscale.
Definition: CImage.cpp:911
std::vector< int16_t > m_dat_mapx_right
A quaternion, which can represent a 3D rotation as pair , with a real part "r" and a 3D vector ...
Definition: CQuaternion.h:46
std::vector< uint16_t > m_dat_mapy_left
mrpt::utils::CImage m_cache1
Memory caches for in-place rectification speed-up.
void enableResizeOutput(bool enable, unsigned int target_width=0, unsigned int target_height=0)
If enabled, the computed maps will rectify images to a size different than their original size...
unsigned __int32 uint32_t
Definition: rptypes.h:47
GLenum const GLfloat * params
Definition: glext.h:3534
mrpt::poses::CPose3DQuat m_rot_right
std::vector< uint16_t > m_dat_mapy_right
mrpt::poses::CPose3DQuat rightCameraPose
Pose of the right camera with respect to the coordinate origin of the left camera.
Definition: TStereoCamera.h:33
Structure to hold the parameters of a pinhole camera model.
Definition: TCamera.h:32
void setRectifyMapsFast(std::vector< int16_t > &left_x, std::vector< uint16_t > &left_y, std::vector< int16_t > &right_x, std::vector< uint16_t > &right_y)
Direct input access to rectify maps.



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019