Main MRPT website > C++ reference for MRPT 1.5.6
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 
23 // Ctor: Leave all vectors empty
24 CStereoRectifyMap::CStereoRectifyMap() :
25  m_alpha(-1),
26  m_resize_output(false),
27  m_enable_both_centers_coincide(false),
28  m_resize_output_value(0,0),
29  m_interpolation_method(mrpt::utils::IMG_INTERP_LINEAR)
30 {
31 }
32 
34 {
35  m_dat_mapx_left.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 
48 void CStereoRectifyMap::enableResizeOutput(bool enable, unsigned int target_width, unsigned int target_height)
49 {
50  m_resize_output = enable;
51  m_resize_output_value.x = target_width;
52  m_resize_output_value.y = target_height;
53 
54  this->internal_invalidate();
55 }
56 
58 {
60 
61  this->internal_invalidate();
62 }
63 
64 
65 
66 /** Prepares the mapping from the distortion parameters of a camera.
67  * Must be called before invoking \a undistort().
68  */
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 = m_resize_output ?
82  cv::Size(m_resize_output_value.x,m_resize_output_value.y) // User requested image scaling
83  :
84  cv::Size(); // Default=don't scale
85 
86  const uint32_t ncols_out = m_resize_output ? m_resize_output_value.x : ncols;
87  const uint32_t nrows_out = m_resize_output ? m_resize_output_value.y : nrows;
88 
89  // save a copy for future reference
91 
92  // Create OpenCV's wrappers for output maps:
93  m_dat_mapx_left.resize(2*nrows_out*ncols_out);
94  m_dat_mapy_left.resize(nrows_out*ncols_out);
95 
96  m_dat_mapx_right.resize(2*nrows_out*ncols_out);
97  m_dat_mapy_right.resize(nrows_out*ncols_out);
98 
99  CvMat mapx_left = cvMat(nrows_out,ncols_out, CV_16SC2, &m_dat_mapx_left[0] );
100  CvMat mapy_left = cvMat(nrows_out,ncols_out, CV_16UC1, &m_dat_mapy_left[0] );
101  CvMat mapx_right = cvMat(nrows_out,ncols_out, CV_16SC2, &m_dat_mapx_right[0] );
102  CvMat mapy_right = cvMat(nrows_out,ncols_out, CV_16UC1, &m_dat_mapy_right[0] );
103 
104  cv::Mat _mapx_left = cv::cvarrToMat(&mapx_left,false);
105  cv::Mat _mapy_left = cv::cvarrToMat(&mapy_left,false);
106  cv::Mat _mapx_right = cv::cvarrToMat(&mapx_right,false);
107  cv::Mat _mapy_right = cv::cvarrToMat(&mapy_right,false);
108 
109 
110  // right camera pose: Rotation
111  CMatrixDouble44 hMatrix;
112  // NOTE!: OpenCV seems to expect the INVERSE of the pose we keep, so invert it:
113  params.rightCameraPose.getInverseHomogeneousMatrix( hMatrix );
114 
115  double m1[3][3];
116  for(unsigned int i = 0; i < 3; ++i)
117  for(unsigned int j = 0; j < 3; ++j)
118  m1[i][j] = hMatrix(i,j);
119 
120  // right camera pose: translation
121  double rcTrans[3] = { hMatrix(0,3), hMatrix(1,3), hMatrix(2,3) };
122 
123  double ipl[3][3], ipr[3][3], dpl[5], dpr[5];
124  for( unsigned int i = 0; i < 3; ++i )
125  for( unsigned int j = 0; j < 3; ++j )
126  {
127  ipl[i][j] = cam1.intrinsicParams(i,j);
128  ipr[i][j] = cam2.intrinsicParams(i,j);
129  }
130 
131  for( unsigned int i = 0; i < 5; ++i )
132  {
133  dpl[i] = cam1.dist[i];
134  dpr[i] = cam2.dist[i];
135  }
136 
137  const cv::Mat R( 3, 3, CV_64F, &m1 );
138  const cv::Mat T( 3, 1, CV_64F, &rcTrans );
139 
140  const cv::Mat K1(3,3,CV_64F,ipl);
141  const cv::Mat K2(3,3,CV_64F,ipr);
142  const cv::Mat D1(1,5,CV_64F,dpl);
143  const cv::Mat D2(1,5,CV_64F,dpr);
144 
145  double _R1[3][3], _R2[3][3], _P1[3][4], _P2[3][4], _Q[4][4];
146  cv::Mat R1(3,3,CV_64F,_R1);
147  cv::Mat R2(3,3,CV_64F,_R2);
148  cv::Mat P1(3,4,CV_64F,_P1);
149  cv::Mat P2(3,4,CV_64F,_P2);
150  cv::Mat Q(4,4,CV_64F,_Q);
151 
152  const cv::Size img_size(ncols,nrows);
153  const cv::Size real_trg_size = m_resize_output ? trg_size : img_size; // Note: trg_size is Size() by default
154 
155  /*
156  OpenCV 2.0:
157  CV_EXPORTS void stereoRectify( const Mat& cameraMatrix1, const Mat& distCoeffs1,
158  const Mat& cameraMatrix2, const Mat& distCoeffs2,
159  Size imageSize, const Mat& R, const Mat& T,
160  Mat& R1, Mat& R2, Mat& P1, Mat& P2, Mat& Q,
161  int flags=CALIB_ZERO_DISPARITY );
162 
163  OpenCV 2.1-2.2:
164  CV_EXPORTS_W void stereoRectify( const Mat& cameraMatrix1, const Mat& distCoeffs1,
165  const Mat& cameraMatrix2, const Mat& distCoeffs2,
166  Size imageSize, const Mat& R, const Mat& T,
167  CV_OUT Mat& R1, CV_OUT Mat& R2,
168  CV_OUT Mat& P1, CV_OUT Mat& P2, CV_OUT Mat& Q,
169  double alpha, Size newImageSize=Size(),
170  CV_OUT Rect* validPixROI1=0, CV_OUT Rect* validPixROI2=0,
171  int flags=CALIB_ZERO_DISPARITY );
172 
173  OpenCV 2.3:
174  CV_EXPORTS void stereoRectify( InputArray cameraMatrix1, InputArray distCoeffs1,
175  InputArray cameraMatrix2, InputArray distCoeffs2,
176  Size imageSize, InputArray R, InputArray T,
177  OutputArray R1, OutputArray R2,
178  OutputArray P1, OutputArray P2,
179  OutputArray Q, int flags=CALIB_ZERO_DISPARITY,
180  double alpha=-1, Size newImageSize=Size(),
181  CV_OUT Rect* validPixROI1=0, CV_OUT Rect* validPixROI2=0 );
182  */
183 #if MRPT_OPENCV_VERSION_NUM<0x210
184  // OpenCV 2.0.X
185  cv::stereoRectify(
186  K1, D1,
187  K2, D2,
188  img_size,
189  R, T,
190  R1, R2, P1, P2, Q,
191  m_enable_both_centers_coincide ? cv::CALIB_ZERO_DISPARITY : 0
192  );
193 #elif MRPT_OPENCV_VERSION_NUM<0x230
194  // OpenCV 2.1.X - 2.2.X
195  cv::stereoRectify(
196  K1, D1,
197  K2, D2,
198  img_size,
199  R, T,
200  R1, R2, P1, P2, Q,
201  m_alpha,
202  trg_size, // Size() by default=no resize
203  NULL,NULL, // Out ROIs
204  m_enable_both_centers_coincide ? cv::CALIB_ZERO_DISPARITY : 0
205  );
206 #else
207  // OpenCV 2.3+ has this signature:
208  cv::stereoRectify(
209  K1, D1,
210  K2, D2,
211  img_size,
212  R, T,
213  R1, R2, P1, P2, Q,
214  m_enable_both_centers_coincide ? cv::CALIB_ZERO_DISPARITY : 0,
215  m_alpha,
216  trg_size // Size() by default=no resize
217  );
218  // Rest of arguments -> default
219 #endif
220 
221  cv::initUndistortRectifyMap( K1, D1, R1, P1, real_trg_size, CV_16SC2, _mapx_left, _mapy_left );
222  cv::initUndistortRectifyMap( K2, D2, R2, P2, real_trg_size, CV_16SC2, _mapx_right, _mapy_right );
223 
224  // Populate the parameter matrices of the output rectified images:
225  for( unsigned int i = 0; i < 3; ++i )
226  for( unsigned int j = 0; j < 3; ++j )
227  {
230  }
231  // They have no distortion:
234 
235  // Target image size:
236  m_rectified_image_params.leftCamera.ncols = real_trg_size.width;
237  m_rectified_image_params.leftCamera.nrows = real_trg_size.height;
238 
239  m_rectified_image_params.rightCamera.ncols = real_trg_size.width;
240  m_rectified_image_params.rightCamera.nrows = real_trg_size.height;
241 
242  // Rest of params don't change:
243  m_rectified_image_params.leftCamera.focalLengthMeters = params.leftCamera.focalLengthMeters;
244  m_rectified_image_params.rightCamera.focalLengthMeters = params.rightCamera.focalLengthMeters;
245 
246  // R1: Rotation of left camera after rectification:
247  // R2: idem for right cam:
248  const Eigen::Map<Eigen::Matrix3d> R1e( R1.ptr<double>() );
249  const Eigen::Map<Eigen::Matrix3d> R2e( R2.ptr<double>() );
250 
251  CPose3D RR1, RR2;
252  RR1.setRotationMatrix(R1e);
253  RR2.setRotationMatrix(R2e);
254  m_rot_left = CPose3DQuat(RR1);
255  m_rot_right = CPose3DQuat(RR2);
256 
258 
259 #else
260  THROW_EXCEPTION("MRPT built without OpenCV >=2.0.0!")
261  #endif
262  MRPT_END
263 }
264 
266  const mrpt::utils::CImage &in_left_image,
267  const mrpt::utils::CImage &in_right_image,
268  mrpt::utils::CImage &out_left_image,
269  mrpt::utils::CImage &out_right_image
270  ) const
271 {
272  MRPT_START
273 
274 #if MRPT_HAS_OPENCV && MRPT_OPENCV_VERSION_NUM>=0x200
277 
278  const CvSize trg_size = m_resize_output ?
280  :
281  cvSize(ncols,nrows);
282 
283  out_left_image.resize( trg_size.width, trg_size.height, in_left_image.isColor() ? 3:1, in_left_image.isOriginTopLeft() );
284  out_right_image.resize( trg_size.width, trg_size.height, in_left_image.isColor() ? 3:1, in_left_image.isOriginTopLeft() );
285 
286  const IplImage * in_left = in_left_image.getAs<IplImage>();
287  const IplImage * in_right = in_right_image.getAs<IplImage>();
288 
289  IplImage * out_left = out_left_image.getAs<IplImage>();
290  IplImage * out_right = out_right_image.getAs<IplImage>();
291 
292  this->rectify_IPL(in_left, in_right, out_left, out_right);
293 
294 #endif
295  MRPT_END
296 }
297 
298 // In place:
300  mrpt::utils::CImage &left_image,
301  mrpt::utils::CImage &right_image,
302  const bool use_internal_mem_cache) const
303 {
304  MRPT_START
305 
306 #if MRPT_HAS_OPENCV && MRPT_OPENCV_VERSION_NUM>=0x200
309 
310  const CvSize trg_size = m_resize_output ?
312  :
313  cvSize(ncols,nrows);
314 
315  const IplImage * in_left = left_image.getAs<IplImage>();
316  const IplImage * in_right = right_image.getAs<IplImage>();
317 
318  IplImage * out_left_image, *out_right_image;
319  if (use_internal_mem_cache)
320  {
321  m_cache1.resize( trg_size.width, trg_size.height, left_image.isColor() ? 3:1, left_image.isOriginTopLeft() );
322  m_cache2.resize( trg_size.width, trg_size.height, right_image.isColor() ? 3:1, right_image.isOriginTopLeft() );
323 
324  out_left_image = m_cache1.getAs<IplImage>();
325  out_right_image = m_cache2.getAs<IplImage>();
326  }
327  else
328  {
329  out_left_image = cvCreateImage( trg_size, in_left->depth, in_left->nChannels );
330  out_right_image = cvCreateImage( trg_size, in_right->depth, in_right->nChannels );
331  }
332 
333  this->rectify_IPL(
334  in_left, in_right,
335  out_left_image, out_right_image);
336 
337  if (use_internal_mem_cache)
338  {
339  // Copy the data: we have avoided one allocation & one deallocation
340  // (If the sizes match, these calls have no effects)
341  left_image.resize( trg_size.width, trg_size.height, left_image.isColor() ? 3:1, left_image.isOriginTopLeft() );
342  right_image.resize( trg_size.width, trg_size.height, right_image.isColor() ? 3:1, right_image.isOriginTopLeft() );
343 
344  cvCopy(out_left_image, left_image.getAs<IplImage>());
345  cvCopy(out_right_image, right_image.getAs<IplImage>());
346  }
347  else
348  {
349  // Move the internal pointers: but we deallocate the old contents and needed to allocate this one
350  left_image.setFromIplImage(out_left_image);
351  right_image.setFromIplImage(out_right_image);
352  }
353 
354 #endif
355  MRPT_END
356 }
357 
358 /** Overloaded version for in-place rectification of image pairs stored in a mrpt::obs::CObservationStereoImages.
359  * Upon return, the new camera intrinsic parameters will be already stored in the observation object.
360  */
362  mrpt::obs::CObservationStereoImages & stereo_image_observation,
363  const bool use_internal_mem_cache) const
364 {
365  MRPT_START
366  ASSERT_(stereo_image_observation.hasImageRight)
367 
368  // Rectify images:
369  this->rectify( stereo_image_observation.imageLeft, stereo_image_observation.imageRight, use_internal_mem_cache );
370 
371  // Copy output image parameters:
372  stereo_image_observation.setStereoCameraParams( this->m_rectified_image_params );
373 
374  // Correct poses:
375  stereo_image_observation.cameraPose += m_rot_left;
376 
377  const double d = stereo_image_observation.rightCameraPose.m_coords.norm();
378  // the translation is now pure in the +X direction:
379  stereo_image_observation.rightCameraPose = CPose3DQuat(d,.0,.0, mrpt::math::CQuaternionDouble() );
380 
381  MRPT_END
382 }
383 
384 
385 /** Just like rectify() but directly works with OpenCV's "IplImage*", which must be passed as "void*" to avoid header dependencies */
387  const void* srcImg_left,
388  const void* srcImg_right,
389  void* outImg_left,
390  void* outImg_right) const
391 {
392  MRPT_START
393  ASSERT_(srcImg_left!=outImg_left && srcImg_right!=outImg_right)
394 
395  if (!isSet()) THROW_EXCEPTION("Error: setFromCamParams() must be called prior to rectify().")
396 
397 #if MRPT_HAS_OPENCV && MRPT_OPENCV_VERSION_NUM>=0x200
400 
401  const uint32_t ncols_out = m_resize_output ? m_resize_output_value.x : ncols;
402  const uint32_t nrows_out = m_resize_output ? m_resize_output_value.y : nrows;
403 
404  const CvMat mapx_left = cvMat(nrows_out,ncols_out, CV_16SC2, const_cast<int16_t*>(&m_dat_mapx_left[0]) );
405  const CvMat mapy_left = cvMat(nrows_out,ncols_out, CV_16UC1, const_cast<uint16_t*>(&m_dat_mapy_left[0]) );
406  const CvMat mapx_right = cvMat(nrows_out,ncols_out, CV_16SC2, const_cast<int16_t*>(&m_dat_mapx_right[0]) );
407  const CvMat mapy_right = cvMat(nrows_out,ncols_out, CV_16UC1, const_cast<uint16_t*>(&m_dat_mapy_right[0]) );
408 
409  const cv::Mat mapx1 = cv::cvarrToMat(&mapx_left);
410  const cv::Mat mapy1 = cv::cvarrToMat(&mapy_left);
411  const cv::Mat mapx2 = cv::cvarrToMat(&mapx_right);
412  const cv::Mat mapy2 = cv::cvarrToMat(&mapy_right);
413 
414  const cv::Mat src1 = cv::cvarrToMat(srcImg_left);
415  const cv::Mat src2 = cv::cvarrToMat(srcImg_right);
416  cv::Mat dst1 = cv::cvarrToMat(outImg_left);
417  cv::Mat dst2 = cv::cvarrToMat(outImg_right);
418 
419  cv::remap( src1, dst1, mapx1, mapy1,static_cast<int>(m_interpolation_method),cv::BORDER_CONSTANT, cvScalarAll(0) );
420  cv::remap( src2, dst2, mapx2, mapy2,static_cast<int>(m_interpolation_method),cv::BORDER_CONSTANT, cvScalarAll(0) );
421 #endif
422  MRPT_END
423 }
424 
425 
426 
427 
429 {
430  if (!isSet()) THROW_EXCEPTION("Error: setFromCamParams() must be called before.")
432 }
433 
435 {
436  if (!isSet()) THROW_EXCEPTION("Error: setFromCamParams() must be called before.")
438 }
439 
441 {
442  if (!isSet()) THROW_EXCEPTION("Error: setFromCamParams() must be called before.")
444 }
445 
447  const std::vector<int16_t> &left_x, const std::vector<uint16_t> &left_y,
448  const std::vector<int16_t> &right_x, const std::vector<uint16_t> &right_y )
449 {
450  m_dat_mapx_left.resize( left_x.size() );
451  m_dat_mapy_left.resize( left_y.size() );
452  m_dat_mapx_right.resize( right_x.size() );
453  m_dat_mapy_right.resize( right_y.size() );
454 
455  std::copy( left_x.begin(), left_x.end(), m_dat_mapx_left.begin() );
456  std::copy( left_y.begin(), left_y.end(), m_dat_mapy_left.begin() );
457  std::copy( right_x.begin(), right_x.end(), m_dat_mapx_right.begin() );
458  std::copy( right_y.begin(), right_y.end(), m_dat_mapy_right.begin() );
459 }
460 
462  std::vector<int16_t> & left_x, std::vector<uint16_t> & left_y,
463  std::vector<int16_t> & right_x, std::vector<uint16_t> & right_y )
464 {
465  left_x.swap( m_dat_mapx_left );
466  left_y.swap( m_dat_mapy_left );
467  right_x.swap( m_dat_mapx_right );
468  right_y.swap( m_dat_mapy_right );
469 }
bool hasImageRight
Whether imageRight actually contains data (Default upon construction: true)
GLclampf GLclampf GLclampf alpha
Definition: glext.h:3510
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
Definition: zip.h:16
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:56
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:101
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:209
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:517
void setRotationMatrix(const mrpt::math::CMatrixDouble33 &ROT)
Sets the 3x3 rotation matrix.
Definition: CPose3D.h:181
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 ...
TCamera rightCamera
Intrinsic and distortion parameters of the left and right cameras.
Definition: TStereoCamera.h:29
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
Definition: TCamera.h:53
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:365
A class used to store a 3D pose as a translation (x,y,z) and a quaternion (qr,qx,qy,qz).
Definition: CPose3DQuat.h:41
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::utils::CImage m_cache2
Memory caches for in-place rectification speed-up.
mrpt::math::CMatrixDouble33 intrinsicParams
Matrix of intrinsic parameters (containing the focal length and principal point coordinates) ...
Definition: TCamera.h:54
mrpt::math::CArrayDouble< 3 > m_coords
The translation vector [x,y,z].
Definition: CPose3DQuat.h:47
void setStereoCameraParams(const mrpt::utils::TStereoCamera &in_params)
Sets leftCamera, rightCamera and rightCameraPose from a TStereoCamera structure.
mrpt::poses::CPose3DQuat m_rot_left
#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:55
const float R
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:72
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
Camera resolution.
Definition: TCamera.h:53
bool isOriginTopLeft() const
Returns true if the coordinates origin is top-left, or false if it is bottom-left.
Definition: CImage.cpp:927
#define ASSERT_(f)
bool isColor() const
Returns true if the image is RGB, false if it is grayscale.
Definition: CImage.cpp:898
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:43
std::vector< uint16_t > m_dat_mapy_left
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:49
GLenum const GLfloat * params
Definition: glext.h:3514
mrpt::poses::CPose3DQuat m_rot_right
The rotation applied to the left/right camera so their virtual image plane is the same after rectific...
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:30
Structure to hold the parameters of a pinhole camera model.
Definition: TCamera.h:31
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.5.6 Git: 4c65e8431 Tue Apr 24 08:18:17 2018 +0200 at lun oct 28 01:35:26 CET 2019