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 std::size_t width, const std::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 std::size_t width, const std::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

using | PointCloud = pcl::PointCloud< PointT >

## Protected Member Functions

PointXYZ | translateCoordinates (std::size_t row, std::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...
std::size_t | disparity_map_width_
| X-size of the disparity map. More...
std::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:

pcl::PointCloud<pcl::PointXYZI>::Ptr cloud (new
pcl::PointCloud<pcl::PointXYZI>);
pcl::PointCloud<pcl::RGB>::Ptr left_image (new
pcl::PointCloud<pcl::RGB>);
// Fill left image cloud.
pcl::DisparityMapConverter<pcl::PointXYZI> dmc;
dmc.setBaseline (0.8387445f);
dmc.setFocalLength (368.534700f);
dmc.setImageCenterX (318.112200f);
dmc.setImageCenterY (224.334900f);
dmc.setDisparityThresholdMin(15.0f);
// Left view of the scene.
dmc.setImage (left_image);
// Disparity map of the scene.
dmc.loadDisparityMap ("disparity_map.txt", 640, 480);
dmc.compute(*cloud);
pcl::DisparityMapConverter
Compute point cloud from the disparity map.
Definition: disparity_map_converter.h:77
pcl::DisparityMapConverter::setImage
void setImage(const pcl::PointCloud< pcl::RGB >::ConstPtr &image)
Set an image, that will be used for coloring of the output cloud.
Definition: disparity_map_converter.hpp:153
pcl::DisparityMapConverter::compute
virtual void compute(PointCloud &out_cloud)
Compute the output cloud.
Definition: disparity_map_converter.hpp:247
pcl::DisparityMapConverter::loadDisparityMap
bool loadDisparityMap(const std::string &file_name)
Load the disparity map.
Definition: disparity_map_converter.hpp:176
pcl::DisparityMapConverter::setImageCenterX
void setImageCenterX(const float center_x)
Set x-coordinate of the image center.
Definition: disparity_map_converter.hpp:67
pcl::DisparityMapConverter::setDisparityThresholdMin
void setDisparityThresholdMin(const float disparity_threshold_min)
Set min disparity threshold.
Definition: disparity_map_converter.hpp:123
pcl::DisparityMapConverter::setBaseline
void setBaseline(const float baseline)
Set baseline.
Definition: disparity_map_converter.hpp:109
pcl::DisparityMapConverter::setFocalLength
void setFocalLength(const float focal_length)
Set focal length.
Definition: disparity_map_converter.hpp:95
pcl::DisparityMapConverter::setImageCenterY
void setImageCenterY(const float center_y)
Set y-coordinate of the image center.
Definition: disparity_map_converter.hpp:81
pcl::PointCloud< pcl::PointXYZI >
pcl::PointCloud::Ptr
shared_ptr< PointCloud< PointT > > Ptr
Definition: point_cloud.h:413

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

## PointCloud

template<typename PointT >

using pcl::DisparityMapConverter< PointT >::PointCloud = pcl::PointCloud<PointT>

protected

Definition at line 79 of file disparity_map_converter.h.

## Constructor & Destructor Documentation

## DisparityMapConverter()

template<typename PointT >

pcl::DisparityMapConverter< PointT >::DisparityMapConverter

DisparityMapConverter constructor.

Definition at line 49 of file disparity_map_converter.hpp.

## ~DisparityMapConverter()

template<typename PointT >

pcl::DisparityMapConverter< PointT >::~DisparityMapConverter

virtual

Empty destructor.

Definition at line 62 of file disparity_map_converter.hpp.

## Member Function Documentation

## compute()

template<typename PointT >

void pcl::DisparityMapConverter< PointT >::compute | ( | PointCloud & | out_cloud | ) |

virtual

Compute the output cloud.

Parameters

  [out] | out_cloud | the variable to return the resulting cloud.

Definition at line 247 of file disparity_map_converter.hpp.

References pcl::PointCloud< PointT >::clear(), pcl::PointCloud< PointT >::height, pcl::PointCloud< PointT >::resize(), pcl::common::IntensityFieldAccessor< PointT >::set(), and pcl::PointCloud< PointT >::width.

## getBaseline()

template<typename PointT >

float pcl::DisparityMapConverter< PointT >::getBaseline

inline

Get baseline.

Returns
  the baseline.

Definition at line 116 of file disparity_map_converter.hpp.

## getDisparityMap()

template<typename PointT >

std::vector< float > pcl::DisparityMapConverter< PointT >::getDisparityMap

Get the disparity map.

Returns
  the disparity map.

Definition at line 240 of file disparity_map_converter.hpp.

## getDisparityThresholdMax()

template<typename PointT >

float pcl::DisparityMapConverter< PointT >::getDisparityThresholdMax

inline

Get max disparity threshold.

Returns
  max disparity threshold.

Definition at line 146 of file disparity_map_converter.hpp.

## getDisparityThresholdMin()

template<typename PointT >

float pcl::DisparityMapConverter< PointT >::getDisparityThresholdMin

inline

Get min disparity threshold.

Returns
  min disparity threshold.

Definition at line 131 of file disparity_map_converter.hpp.

## getFocalLength()

template<typename PointT >

float pcl::DisparityMapConverter< PointT >::getFocalLength

inline

Get focal length.

Returns
  the focal length.

Definition at line 102 of file disparity_map_converter.hpp.

## getImage()

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 167 of file disparity_map_converter.hpp.

## getImageCenterX()

template<typename PointT >

float pcl::DisparityMapConverter< PointT >::getImageCenterX

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.

## getImageCenterY()

template<typename PointT >

float pcl::DisparityMapConverter< PointT >::getImageCenterY

inline

Get y-coordinate of the image center.

Returns
  y-coordinate of the image center.

Definition at line 88 of file disparity_map_converter.hpp.

## loadDisparityMap() [1/2]

template<typename PointT >

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

Load the disparity map.

Parameters

  [in] | file_name | the name of the disparity map file.

Returns
  "true" if the disparity map was successfully loaded; "false" otherwise

Definition at line 176 of file disparity_map_converter.hpp.

## loadDisparityMap() [2/2]

template<typename PointT >

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

Load the disparity map and initialize it's size.

Parameters

  [in] | file_name | the name of the disparity map file.
  [in] | width | width of the disparity map.
  [in] | height | height of the disparity map.

Returns
  "true" if the disparity map was successfully loaded; "false" otherwise

Definition at line 205 of file disparity_map_converter.hpp.

## setBaseline()

template<typename PointT >

void pcl::DisparityMapConverter< PointT >::setBaseline | ( | const float | baseline | ) |

inline

Set baseline.

Parameters

  [in] | baseline | baseline.

Definition at line 109 of file disparity_map_converter.hpp.

## setDisparityMap() [1/2]

template<typename PointT >

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

Set the disparity map.

Parameters

  [in] | disparity_map | the disparity map.

Definition at line 219 of file disparity_map_converter.hpp.

## setDisparityMap() [2/2]

template<typename PointT >

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

Set the disparity map and initialize it's size.

Parameters

  [in] | disparity_map | the disparity map.
  [in] | width | width of the disparity map.
  [in] | height | height of the disparity map.

Returns
  "true" if the disparity map was successfully loaded; "false" otherwise

Definition at line 227 of file disparity_map_converter.hpp.

## setDisparityThresholdMax()

template<typename PointT >

void pcl::DisparityMapConverter< PointT >::setDisparityThresholdMax | ( | const float | disparity_threshold_max | ) |

inline

Set max disparity threshold.

Parameters

  [in] | disparity_threshold_max | max disparity threshold.

Definition at line 138 of file disparity_map_converter.hpp.

## setDisparityThresholdMin()

template<typename PointT >

void pcl::DisparityMapConverter< PointT >::setDisparityThresholdMin | ( | const float | disparity_threshold_min | ) |

inline

Set min disparity threshold.

Parameters

  [in] | disparity_threshold_min | min disparity threshold.

Definition at line 123 of file disparity_map_converter.hpp.

## setFocalLength()

template<typename PointT >

void pcl::DisparityMapConverter< PointT >::setFocalLength | ( | const float | focal_length | ) |

inline

Set focal length.

Parameters

  [in] | focal_length | the focal length.

Definition at line 95 of file disparity_map_converter.hpp.

## setImage()

template<typename PointT >

void pcl::DisparityMapConverter< PointT >::setImage | ( | const pcl::PointCloud< pcl::RGB >::ConstPtr & | image | ) |

Set an image, that will be used for coloring of the output cloud.

Parameters

  [in] | image | the image.

Definition at line 153 of file disparity_map_converter.hpp.

## setImageCenterX()

template<typename PointT >

void pcl::DisparityMapConverter< PointT >::setImageCenterX | ( | const float | center_x | ) |

inline

Set x-coordinate of the image center.

Parameters

  [in] | center_x | x-coordinate of the image center.

Definition at line 67 of file disparity_map_converter.hpp.

## setImageCenterY()

template<typename PointT >

void pcl::DisparityMapConverter< PointT >::setImageCenterY | ( | const float | center_y | ) |

inline

Set y-coordinate of the image center.

Parameters

  [in] | center_y | y-coordinate of the image center.

Definition at line 81 of file disparity_map_converter.hpp.

## translateCoordinates()

template<typename PointT >

pcl::PointXYZ pcl::DisparityMapConverter< PointT >::translateCoordinates | ( | std::size_t | row,
|  | std::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 304 of file disparity_map_converter.hpp.

## Member Data Documentation

## baseline_

template<typename PointT >

float pcl::DisparityMapConverter< PointT >::baseline_

protected

Baseline.

Definition at line 237 of file disparity_map_converter.h.

## center_x_

template<typename PointT >

float pcl::DisparityMapConverter< PointT >::center_x_

protected

X-coordinate of the image center.

Definition at line 231 of file disparity_map_converter.h.

## center_y_

template<typename PointT >

float pcl::DisparityMapConverter< PointT >::center_y_

protected

Y-coordinate of the image center.

Definition at line 233 of file disparity_map_converter.h.

## disparity_map_

template<typename PointT >

std::vector<float> pcl::DisparityMapConverter< PointT >::disparity_map_

protected

Vector for the disparity map.

Definition at line 245 of file disparity_map_converter.h.

## disparity_map_height_

template<typename PointT >

std::size_t pcl::DisparityMapConverter< PointT >::disparity_map_height_

protected

Y-size of the disparity map.

Definition at line 249 of file disparity_map_converter.h.

## disparity_map_width_

template<typename PointT >

std::size_t pcl::DisparityMapConverter< PointT >::disparity_map_width_

protected

X-size of the disparity map.

Definition at line 247 of file disparity_map_converter.h.

## disparity_threshold_max_

template<typename PointT >

float pcl::DisparityMapConverter< PointT >::disparity_threshold_max_

protected

Definition at line 253 of file disparity_map_converter.h.

## disparity_threshold_min_

template<typename PointT >

float pcl::DisparityMapConverter< PointT >::disparity_threshold_min_

protected

Thresholds of the disparity.

Definition at line 252 of file disparity_map_converter.h.

## focal_length_

template<typename PointT >

float pcl::DisparityMapConverter< PointT >::focal_length_

protected

Focal length.

Definition at line 235 of file disparity_map_converter.h.

## image_

template<typename PointT >

pcl::PointCloud<pcl::RGB>::ConstPtr pcl::DisparityMapConverter< PointT >::image_

protected

Color image of the scene.

Definition at line 242 of file disparity_map_converter.h.

## is_color_

template<typename PointT >

bool pcl::DisparityMapConverter< PointT >::is_color_

protected

Is color image is set.

Definition at line 240 of file disparity_map_converter.h.

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

- pcl/stereo/disparity_map_converter.h
- pcl/stereo/impl/disparity_map_converter.hpp