stereo
Public Member Functions | List of all members
stereo::DenseStereo Class Reference

#include <densestereo.h>

Public Member Functions

 DenseStereo ()
 
virtual ~DenseStereo ()
 
void setStereoCalibration (const frame_helper::StereoCalibration &stereoCal, const int imgWidth, const int imgHeight)
 
void setLibElasConfiguration (const libElasConfiguration &libElasParam)
 
void setGaussianKernel (int size)
 
void processFramePair (const cv::Mat &left_frame, const cv::Mat &right_frame, cv::Mat &left_output_frame, cv::Mat &right_output_frame, bool isRectified=false)
 
void getDistanceImages (cv::Mat &left_disp_image, cv::Mat &right_disp_image)
 
void getDistanceImages (const cv::Mat &left_frame, const cv::Mat &right_frame, cv::Mat &left_output_frame, cv::Mat &right_output_frame, bool isRectified=false)
 
void getDistanceImages (const cv::Mat &left_frame, const cv::Mat &right_frame, base::samples::DistanceImage &left_output_frame, base::samples::DistanceImage &right_output_frame, bool isRectified=false)
 
cv::Mat createDistanceImage (frame_helper::CameraCalibrationCv const &calib, base::samples::DistanceImage &dist_image)
 
cv::Mat createLeftDistanceImage (base::samples::DistanceImage &dist_image)
 
cv::Mat createRightDistanceImage (base::samples::DistanceImage &dist_image)
 

Detailed Description

This class performs dense stereo calculation and is mainly a wrapper to libelas. After construction, the setStereoCalibration method needs to be called with a valid calibration. Configuration itself has sane defaults, but can be changed any time. process_FramePair produces a disparity image, which by itself isn't all that usefull (function will probably be made private soon). getDistanceImage is more likely what you want to call, which produces images where the actual distance is encoded as a float. Use the createDistanceImage method beforehand to get the cv::Mat to pass as a parameter to getDistanceImage to get the base::samples::DistanceImage type filled from this class.

Constructor & Destructor Documentation

stereo::DenseStereo::DenseStereo ( )
stereo::DenseStereo::~DenseStereo ( )
virtual

Member Function Documentation

cv::Mat stereo::DenseStereo::createDistanceImage ( frame_helper::CameraCalibrationCv const &  calib,
base::samples::DistanceImage &  dist_image 
)

prepare a distance image from the provided camera calibration the resulting cv::Mat shares the same data buffer as the dist_image and can be used as input to getDistanceImages

Parameters
calib- the calibration for the camera to use
dist_image- the dist_image which will be filled with the calib data and image size
Returns
cv::Mat which shares a data buffer with dist_image
cv::Mat stereo::DenseStereo::createLeftDistanceImage ( base::samples::DistanceImage &  dist_image)
inline

convenience method which doesn't require a calibration object but uses the camera calibration for the left camera

cv::Mat stereo::DenseStereo::createRightDistanceImage ( base::samples::DistanceImage &  dist_image)
inline

convenience method which doesn't require a calibration object but uses the camera calibration for the right camera

void stereo::DenseStereo::getDistanceImages ( cv::Mat &  left_disp_image,
cv::Mat &  right_disp_image 
)

perform conversion from disparity to distance image

void stereo::DenseStereo::getDistanceImages ( const cv::Mat &  left_frame,
const cv::Mat &  right_frame,
cv::Mat &  left_output_frame,
cv::Mat &  right_output_frame,
bool  isRectified = false 
)

computes the disparity images and calculates the distance images from them

Parameters
left_frameleft input frame
right_frameright input frame
left_output_frameleft distance image
right_output_frameright distance image
isRectifiedtells the function if the input images are already rectified
void stereo::DenseStereo::getDistanceImages ( const cv::Mat &  left_frame,
const cv::Mat &  right_frame,
base::samples::DistanceImage &  left_output_frame,
base::samples::DistanceImage &  right_output_frame,
bool  isRectified = false 
)

convenience method that takes base::samples::DistanceImages as the result objects

Parameters
left_frameleft input frame
right_frameright input frame
left_output_frameleft distance image
right_output_frameright distance image
isRectifiedtells the function if the input images are already rectified
void stereo::DenseStereo::processFramePair ( const cv::Mat &  left_frame,
const cv::Mat &  right_frame,
cv::Mat &  left_output_frame,
cv::Mat &  right_output_frame,
bool  isRectified = false 
)

computes disparities of input frame pair left_frame, right_frame

Parameters
left_frameleft input frame
right_frameright input frame
left_output_frameleft output frame
right_output_frameright output frame
isRectifiedtells the function if the input images are already rectified
void stereo::DenseStereo::setGaussianKernel ( int  size)
inline

if set to greater than 0, the images will be preprocessed with a gaussian blur filter with a kernel of the given size. Should be an odd number.

void stereo::DenseStereo::setLibElasConfiguration ( const libElasConfiguration libElasParam)

configures libElas

Parameters
libElasParamlibElas configuration
void stereo::DenseStereo::setStereoCalibration ( const frame_helper::StereoCalibration &  stereoCal,
const int  imgWidth,
const int  imgHeight 
)

sets calibration parameters for stereo camera setup

Parameters
stereoCamCalstereo camera calibration data

The documentation for this class was generated from the following files: