Point Cloud Library (PCL)  1.9.1-dev
List of all members | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
pcl::DisparityMapConverter< PointT > Class Template Reference

Compute point cloud from the disparity map. More...

#include <pcl/stereo/disparity_map_converter.h>

Public Member Functions

 DisparityMapConverter ()
 DisparityMapConverter constructor. More...
 
virtual ~DisparityMapConverter ()
 Empty destructor. More...
 
void setImageCenterX (const float center_x)
 Set x-coordinate of the image center. More...
 
float getImageCenterX () const
 Get x-coordinate of the image center. More...
 
void setImageCenterY (const float center_y)
 Set y-coordinate of the image center. More...
 
float getImageCenterY () const
 Get y-coordinate of the image center. More...
 
void setFocalLength (const float focal_length)
 Set focal length. More...
 
float getFocalLength () const
 Get focal length. More...
 
void setBaseline (const float baseline)
 Set baseline. More...
 
float getBaseline () const
 Get baseline. More...
 
void setDisparityThresholdMin (const float disparity_threshold_min)
 Set min disparity threshold. More...
 
float getDisparityThresholdMin () const
 Get min disparity threshold. More...
 
void setDisparityThresholdMax (const float disparity_threshold_max)
 Set max disparity threshold. More...
 
float getDisparityThresholdMax () const
 Get max disparity threshold. More...
 
void setImage (const pcl::PointCloud< pcl::RGB >::ConstPtr &image)
 Set an image, that will be used for coloring of the output cloud. More...
 
pcl::PointCloud< RGB >::Ptr getImage ()
 Get the image, that is used for coloring of the output cloud. More...
 
bool loadDisparityMap (const std::string &file_name)
 Load the disparity map. More...
 
bool loadDisparityMap (const std::string &file_name, const size_t width, const size_t height)
 Load the disparity map and initialize it's size. More...
 
void setDisparityMap (const std::vector< float > &disparity_map)
 Set the disparity map. More...
 
void setDisparityMap (const std::vector< float > &disparity_map, const size_t width, const size_t height)
 Set the disparity map and initialize it's size. More...
 
std::vector< float > getDisparityMap ()
 Get the disparity map. More...
 
virtual void compute (PointCloud &out_cloud)
 Compute the output cloud. More...
 

Protected Types

typedef pcl::PointCloud< PointTPointCloud
 

Protected Member Functions

PointXYZ translateCoordinates (size_t row, size_t column, float disparity) const
 Translate point from image coordinates and disparity to 3D-coordinates. More...
 

Protected Attributes

float center_x_
 X-coordinate of the image center. More...
 
float center_y_
 Y-coordinate of the image center. More...
 
float focal_length_
 Focal length. More...
 
float baseline_
 Baseline. More...
 
bool is_color_
 Is color image is set. More...
 
pcl::PointCloud< pcl::RGB >::ConstPtr image_
 Color image of the scene. More...
 
std::vector< float > disparity_map_
 Vector for the disparity map. More...
 
size_t disparity_map_width_
 X-size of the disparity map. More...
 
size_t disparity_map_height_
 Y-size of the disparity map. More...
 
float disparity_threshold_min_
 Thresholds of the disparity. More...
 
float disparity_threshold_max_
 

Detailed Description

template<typename PointT>
class pcl::DisparityMapConverter< PointT >

Compute point cloud from the disparity map.

Example of usage:

// Fill left image cloud.
dmc.setBaseline (0.8387445f);
dmc.setFocalLength (368.534700f);
dmc.setImageCenterX (318.112200f);
dmc.setImageCenterY (224.334900f);
// Left view of the scene.
dmc.setImage (left_image);
// Disparity map of the scene.
dmc.loadDisparityMap ("disparity_map.txt", 640, 480);
dmc.compute(*cloud);
Author
Timur Ibadov (ibado.nosp@m.v.ti.nosp@m.mur@g.nosp@m.mail.nosp@m..com)

Definition at line 77 of file disparity_map_converter.h.

Member Typedef Documentation

template<typename PointT>
typedef pcl::PointCloud<PointT> pcl::DisparityMapConverter< PointT >::PointCloud
protected

Definition at line 80 of file disparity_map_converter.h.

Constructor & Destructor Documentation

template<typename PointT >
pcl::DisparityMapConverter< PointT >::DisparityMapConverter ( )

DisparityMapConverter constructor.

Definition at line 49 of file disparity_map_converter.hpp.

template<typename PointT >
pcl::DisparityMapConverter< PointT >::~DisparityMapConverter ( )
virtual

Empty destructor.

Definition at line 63 of file disparity_map_converter.hpp.

Member Function Documentation

template<typename PointT >
void pcl::DisparityMapConverter< PointT >::compute ( PointCloud out_cloud)
virtual
template<typename PointT >
float pcl::DisparityMapConverter< PointT >::getBaseline ( ) const
inline

Get baseline.

Returns
the baseline.

Definition at line 110 of file disparity_map_converter.hpp.

References pcl::DisparityMapConverter< PointT >::baseline_.

template<typename PointT >
std::vector< float > pcl::DisparityMapConverter< PointT >::getDisparityMap ( )

Get the disparity map.

Returns
the disparity map.

Definition at line 225 of file disparity_map_converter.hpp.

References pcl::DisparityMapConverter< PointT >::disparity_map_.

template<typename PointT >
float pcl::DisparityMapConverter< PointT >::getDisparityThresholdMax ( ) const
inline

Get max disparity threshold.

Returns
max disparity threshold.

Definition at line 136 of file disparity_map_converter.hpp.

References pcl::DisparityMapConverter< PointT >::disparity_threshold_max_.

template<typename PointT >
float pcl::DisparityMapConverter< PointT >::getDisparityThresholdMin ( ) const
inline

Get min disparity threshold.

Returns
min disparity threshold.

Definition at line 123 of file disparity_map_converter.hpp.

References pcl::DisparityMapConverter< PointT >::disparity_threshold_min_.

template<typename PointT >
float pcl::DisparityMapConverter< PointT >::getFocalLength ( ) const
inline

Get focal length.

Returns
the focal length.

Definition at line 98 of file disparity_map_converter.hpp.

References pcl::DisparityMapConverter< PointT >::focal_length_.

template<typename PointT >
pcl::PointCloud< pcl::RGB >::Ptr pcl::DisparityMapConverter< PointT >::getImage ( )

Get the image, that is used for coloring of the output cloud.

Returns
the image.

Definition at line 155 of file disparity_map_converter.hpp.

References pcl::DisparityMapConverter< PointT >::image_.

template<typename PointT >
float pcl::DisparityMapConverter< PointT >::getImageCenterX ( ) const
inline

Get x-coordinate of the image center.

Returns
x-coordinate of the image center.

Definition at line 74 of file disparity_map_converter.hpp.

References pcl::DisparityMapConverter< PointT >::center_x_.

template<typename PointT >
float pcl::DisparityMapConverter< PointT >::getImageCenterY ( ) const
inline

Get y-coordinate of the image center.

Returns
y-coordinate of the image center.

Definition at line 86 of file disparity_map_converter.hpp.

References pcl::DisparityMapConverter< PointT >::center_y_.

template<typename PointT >
bool pcl::DisparityMapConverter< PointT >::loadDisparityMap ( const std::string &  file_name)

Load the disparity map.

Parameters
[in]file_namethe name of the disparity map file.
Returns
"true" if the disparity map was successfully loaded; "false" otherwise

Definition at line 163 of file disparity_map_converter.hpp.

References pcl::DisparityMapConverter< PointT >::disparity_map_, pcl::DisparityMapConverter< PointT >::disparity_map_height_, and pcl::DisparityMapConverter< PointT >::disparity_map_width_.

Referenced by pcl::DisparityMapConverter< PointT >::loadDisparityMap().

template<typename PointT >
bool pcl::DisparityMapConverter< PointT >::loadDisparityMap ( const std::string &  file_name,
const size_t  width,
const size_t  height 
)

Load the disparity map and initialize it's size.

Parameters
[in]file_namethe name of the disparity map file.
[in]widthwidth of the disparity map.
[in]heightheight of the disparity map.
Returns
"true" if the disparity map was successfully loaded; "false" otherwise

Definition at line 195 of file disparity_map_converter.hpp.

References pcl::DisparityMapConverter< PointT >::disparity_map_height_, pcl::DisparityMapConverter< PointT >::disparity_map_width_, and pcl::DisparityMapConverter< PointT >::loadDisparityMap().

template<typename PointT >
void pcl::DisparityMapConverter< PointT >::setBaseline ( const float  baseline)
inline

Set baseline.

Parameters
[in]baselinebaseline.

Definition at line 104 of file disparity_map_converter.hpp.

References pcl::DisparityMapConverter< PointT >::baseline_.

template<typename PointT >
void pcl::DisparityMapConverter< PointT >::setDisparityMap ( const std::vector< float > &  disparity_map)

Set the disparity map.

Parameters
[in]disparity_mapthe disparity map.

Definition at line 207 of file disparity_map_converter.hpp.

References pcl::DisparityMapConverter< PointT >::disparity_map_.

template<typename PointT >
void pcl::DisparityMapConverter< PointT >::setDisparityMap ( const std::vector< float > &  disparity_map,
const size_t  width,
const size_t  height 
)

Set the disparity map and initialize it's size.

Parameters
[in]disparity_mapthe disparity map.
[in]widthwidth of the disparity map.
[in]heightheight of the disparity map.
Returns
"true" if the disparity map was successfully loaded; "false" otherwise

Definition at line 214 of file disparity_map_converter.hpp.

References pcl::DisparityMapConverter< PointT >::disparity_map_, pcl::DisparityMapConverter< PointT >::disparity_map_height_, and pcl::DisparityMapConverter< PointT >::disparity_map_width_.

template<typename PointT >
void pcl::DisparityMapConverter< PointT >::setDisparityThresholdMax ( const float  disparity_threshold_max)
inline

Set max disparity threshold.

Parameters
[in]disparity_threshold_maxmax disparity threshold.

Definition at line 129 of file disparity_map_converter.hpp.

References pcl::DisparityMapConverter< PointT >::disparity_threshold_max_.

template<typename PointT >
void pcl::DisparityMapConverter< PointT >::setDisparityThresholdMin ( const float  disparity_threshold_min)
inline

Set min disparity threshold.

Parameters
[in]disparity_threshold_minmin disparity threshold.

Definition at line 116 of file disparity_map_converter.hpp.

References pcl::DisparityMapConverter< PointT >::disparity_threshold_min_.

template<typename PointT >
void pcl::DisparityMapConverter< PointT >::setFocalLength ( const float  focal_length)
inline

Set focal length.

Parameters
[in]focal_lengththe focal length.

Definition at line 92 of file disparity_map_converter.hpp.

References pcl::DisparityMapConverter< PointT >::focal_length_.

template<typename PointT >
void pcl::DisparityMapConverter< PointT >::setImage ( const pcl::PointCloud< pcl::RGB >::ConstPtr &  image)
template<typename PointT >
void pcl::DisparityMapConverter< PointT >::setImageCenterX ( const float  center_x)
inline

Set x-coordinate of the image center.

Parameters
[in]center_xx-coordinate of the image center.

Definition at line 68 of file disparity_map_converter.hpp.

References pcl::DisparityMapConverter< PointT >::center_x_.

template<typename PointT >
void pcl::DisparityMapConverter< PointT >::setImageCenterY ( const float  center_y)
inline

Set y-coordinate of the image center.

Parameters
[in]center_yy-coordinate of the image center.

Definition at line 80 of file disparity_map_converter.hpp.

References pcl::DisparityMapConverter< PointT >::center_y_.

template<typename PointT >
pcl::PointXYZ pcl::DisparityMapConverter< PointT >::translateCoordinates ( size_t  row,
size_t  column,
float  disparity 
) const
protected

Translate point from image coordinates and disparity to 3D-coordinates.

Parameters
[in]row
[in]column
[in]disparity
Returns
the 3D point, that corresponds to the input parametres and the camera calibration.

Definition at line 290 of file disparity_map_converter.hpp.

References pcl::DisparityMapConverter< PointT >::baseline_, pcl::DisparityMapConverter< PointT >::center_x_, pcl::DisparityMapConverter< PointT >::center_y_, and pcl::DisparityMapConverter< PointT >::focal_length_.

Referenced by pcl::DisparityMapConverter< PointT >::compute().

Member Data Documentation

template<typename PointT>
float pcl::DisparityMapConverter< PointT >::baseline_
protected
template<typename PointT>
float pcl::DisparityMapConverter< PointT >::center_x_
protected
template<typename PointT>
float pcl::DisparityMapConverter< PointT >::center_y_
protected
template<typename PointT>
std::vector<float> pcl::DisparityMapConverter< PointT >::disparity_map_
protected
template<typename PointT>
size_t pcl::DisparityMapConverter< PointT >::disparity_map_height_
protected
template<typename PointT>
size_t pcl::DisparityMapConverter< PointT >::disparity_map_width_
protected
template<typename PointT>
float pcl::DisparityMapConverter< PointT >::disparity_threshold_max_
protected
template<typename PointT>
float pcl::DisparityMapConverter< PointT >::disparity_threshold_min_
protected
template<typename PointT>
float pcl::DisparityMapConverter< PointT >::focal_length_
protected
template<typename PointT>
pcl::PointCloud<pcl::RGB>::ConstPtr pcl::DisparityMapConverter< PointT >::image_
protected
template<typename PointT>
bool pcl::DisparityMapConverter< PointT >::is_color_
protected

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