9 #ifndef mrpt_CStereoRectifyMap_H
10 #define mrpt_CStereoRectifyMap_H
76 inline bool isSet()
const {
return !m_dat_mapx_left.empty(); }
90 setFromCamParams(params);
130 m_interpolation_method = interp;
150 void setRectifyMaps(
const std::vector<int16_t> &left_x,
const std::vector<uint16_t> &left_y,
151 const std::vector<int16_t> &right_x,
const std::vector<uint16_t> &right_y );
155 std::vector<int16_t> &right_x, std::vector<uint16_t> &right_y );
183 const bool use_internal_mem_cache =
true )
const;
196 const bool use_internal_mem_cache =
true )
const;
201 const void* in_left_image,
202 const void* in_right_image,
203 void* out_left_image,
204 void* out_right_image)
const;
Observation class for either a pair of left+right or left+disparity images from a stereo camera.
void getStereoCameraParams(mrpt::utils::TStereoCamera &out_params) const
Populates a TStereoCamera structure with the parameters in leftCamera, rightCamera and rightCameraPos...
A class used to store a 3D pose as a translation (x,y,z) and a quaternion (qr,qx,qy,...
A class for storing images as grayscale or RGB bitmaps.
Structure to hold the parameters of a pinhole camera model.
Structure to hold the parameters of a pinhole stereo camera model.
Use this class to rectify stereo images if the same distortion maps are reused over and over again.
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.
const mrpt::utils::TStereoCamera & getRectifiedImageParams() const
After computing the rectification maps, this method retrieves the calibration parameters of the recti...
void rectify(mrpt::obs::CObservationStereoImages &stereo_image_observation, const bool use_internal_mem_cache=true) const
Overloaded version for in-place rectification of image pairs stored in a mrpt::obs::CObservationStere...
bool isEnabledResizeOutput() const
Returns whether resizing is enabled (default=false)
const mrpt::utils::TStereoCamera & getCameraParams() const
Returns the camera parameters which were used to generate the distortion map, as passed by the user t...
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...
bool m_enable_both_centers_coincide
const mrpt::poses::CPose3DQuat & getLeftCameraRot() const
After computing the rectification maps, get the rotation applied to the left/right camera so their vi...
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.
const mrpt::utils::TCamera & getRectifiedLeftImageParams() const
Just like getRectifiedImageParams() but for the left camera only.
const mrpt::utils::TCamera & getRectifiedRightImageParams() const
Just like getRectifiedImageParams() but for the right camera only.
void internal_invalidate()
std::vector< int16_t > m_dat_mapx_left
void enableBothCentersCoincide(bool enable=true)
If enabled (default=false), the principal points in both output images will coincide.
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's "IplImage*", which must be passed as "void*" to ...
const mrpt::poses::CPose3DQuat & getRightCameraRot() const
See getLeftCameraRot()
mrpt::utils::TImageSize m_resize_output_value
mrpt::utils::TInterpolationMethod getInterpolationMethod() const
Get the currently selected interpolation method.
CStereoRectifyMap()
Default ctor.
std::vector< uint16_t > m_dat_mapy_left
void setInterpolationMethod(const mrpt::utils::TInterpolationMethod interp)
Change remap interpolation method (default=Lineal).
void rectify(mrpt::utils::CImage &left_image, mrpt::utils::CImage &right_image, const bool use_internal_mem_cache=true) const
Overloaded version for in-place rectification: replace input images with their rectified versions If ...
void setFromCamParams(const mrpt::utils::TStereoCamera ¶ms)
Prepares the mapping from the intrinsic, distortion and relative pose parameters of a stereo camera.
mrpt::utils::TInterpolationMethod m_interpolation_method
mrpt::poses::CPose3DQuat m_rot_left
mrpt::utils::TStereoCamera m_camera_params
A copy of the data provided by the user.
void setFromCamParams(const mrpt::obs::CObservationStereoImages &stereo_obs)
A wrapper to setFromCamParams() which takes the parameters from an stereo observation object.
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.
mrpt::utils::TStereoCamera m_rectified_image_params
Resulting images params.
bool isSet() const
Returns true if setFromCamParams() has been already called, false otherwise.
double getAlpha() const
Return the alpha parameter.
mrpt::utils::TImageSize getResizeOutputSize() const
Only when isEnabledResizeOutput() returns true, this gets the target size.
bool isEnabledBothCentersCoincide() const
void setAlpha(double alpha)
Sets the alpha parameter which controls the zoom in/out of the rectified images, such that:
mrpt::utils::CImage m_cache1
TInterpolationMethod
Interpolation methods for images.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
A pair (x,y) of pixel coordinates (integer resolution).