Public Member Functions | Public Attributes

RL_StereoProcessor Class Reference

Stereo processor for computing the depthmap. More...

#include <RL_StereoProcessor.h>

List of all members.

Public Member Functions

 RL_StereoProcessor (int width, int height)
 Constructor.
IplImage * ComputeDepthMap (IplImage *left, IplImage *right, bool rectified=false)
 ComputeDepthMap: Computes the depth map using opencv block matching correspondance finder and saves the results in internal variable depthMap. It uses the internal stereo parameters which can be set by SetStereoCalibParams.
bool ReadCameraParamsFromFile (unsigned id1, unsigned id2, const char *path)
 ReadCameraParamsFromFile: Reads the calibration parameters including left and right cameras intrinsic and stereo extrinsic parameters.
void SetStereoParams (RL_StereoParams params)
 SetStereoCalibParams: Sets the stereo paramaters.
void SetStereoCalibParams (RL_StereoParams params)
 SetStereoCalibParams: Sets the calibration paramaters and updated the internal rectification map.
void UpdateRectifyMaps ()
 UpdateRectifyMaps: Updates the rectification maps from the calibration parameters. (For internal use)
IplImage * RectifyLeft (IplImage *)
 RectifyLeft: Rectifies a gray input image using the internal left rectification map previously initialized and saves the result in internal image rectLeftImage.
IplImage * RectifyRight (IplImage *)
 RectifyRight: Rectifies a gray input image using the internal right rectification map previously initialized and saves the result in internal image rectRightImage.
void ConvertToColorDepth (IplImage *outRGB)
 ConvertToColorDepth: converts the internal depth map which is computed and available in depthMap to a color map from red(high disparities) to purple(low disparities) and outputs the result color image in outRGB.

Public Attributes

bool parametersSet
RL_StereoParams stereoParams
CvStereoBMState * cvBMState
IplImage * rectLeftImage
IplImage * rectRightImage
IplImage * depthMap
CvMat * leftMapX
CvMat * leftMapY
CvMat * rightMapX
CvMat * rightMapY

Detailed Description

Stereo processor for computing the depthmap.


Constructor & Destructor Documentation

RL_StereoProcessor::RL_StereoProcessor ( int  width,
int  height 
)

Constructor.

Parameters:
intwidth - stereo width
intheight - stereo height

Member Function Documentation

IplImage * RL_StereoProcessor::ComputeDepthMap ( IplImage *  left,
IplImage *  right,
bool  rectified = false 
)

ComputeDepthMap: Computes the depth map using opencv block matching correspondance finder and saves the results in internal variable depthMap. It uses the internal stereo parameters which can be set by SetStereoCalibParams.

Parameters:
IplImage*left - left stereo image. It should be grayscale image with the same size of this object.
IplImage*right - left stereo image. It should be grayscale image with the same size of this object.
boolrectified - If true means the input images are already rectifies otherwise rectifies the images using the internal calibration parameters.
Returns:
IplImage* returns pointer to the internal variable depthMap where the results are saved.
void RL_StereoProcessor::ConvertToColorDepth ( IplImage *  outRGB )

ConvertToColorDepth: converts the internal depth map which is computed and available in depthMap to a color map from red(high disparities) to purple(low disparities) and outputs the result color image in outRGB.

Parameters:
IplImage*outRGB - Placeholder for result color image. It shoudl be a 3 channel with depth IPL_DEPTH_8U, and with the same size of depthMap data.
bool RL_StereoProcessor::ReadCameraParamsFromFile ( unsigned  id1,
unsigned  id2,
const char *  path 
)

ReadCameraParamsFromFile: Reads the calibration parameters including left and right cameras intrinsic and stereo extrinsic parameters.

Parameters:
unsignedid1 - serial number of the left camera.
unsignedid2 - serial number of the right camera.
constchar* path - path of config xml files.
Returns:
bool returns true if successful, false otherwise.
IplImage * RL_StereoProcessor::RectifyLeft ( IplImage *  image )

RectifyLeft: Rectifies a gray input image using the internal left rectification map previously initialized and saves the result in internal image rectLeftImage.

Parameters:
IplImage*image - input left image to be rectified.
Returns:
IplImage* returns internal rectLeftImage where the rectified image is saved.
IplImage * RL_StereoProcessor::RectifyRight ( IplImage *  image )

RectifyRight: Rectifies a gray input image using the internal right rectification map previously initialized and saves the result in internal image rectRightImage.

Parameters:
IplImage*image - input right image to be rectified.
Returns:
IplImage* returns internal rectRightImage where the rectified image is saved.
void RL_StereoProcessor::SetStereoCalibParams ( RL_StereoParams  params )

SetStereoCalibParams: Sets the calibration paramaters and updated the internal rectification map.

Parameters:
RL_StereoParamsparams - calibration parameters.
void RL_StereoProcessor::SetStereoParams ( RL_StereoParams  params )

SetStereoCalibParams: Sets the stereo paramaters.

Parameters:
RL_StereoParamsparams - stereo parameters.

The documentation for this class was generated from the following files:
 All Classes Functions Variables