Loading...
Searching...
No Matches
pcl::io::PointCloudImageExtractor< PointT > Class Template Referenceabstract
Module io

Base Image Extractor class for organized point clouds. More...

`#include <pcl/io/point_cloud_image_extractors.h>`

Inheritance diagram for pcl::io::PointCloudImageExtractor< PointT >:

## Public Types

using | PointCloud = pcl::PointCloud<PointT>
using | Ptr = shared_ptr<PointCloudImageExtractor<PointT> >
using | ConstPtr = shared_ptr<const PointCloudImageExtractor<PointT> >

## Public Member Functions

| PointCloudImageExtractor ()=default
| Constructor.
virtual | ~PointCloudImageExtractor ()=default
| Destructor.
bool | extract (const PointCloud &cloud, pcl::PCLImage &image) const
| Obtain the image from the given cloud.
void | setPaintNaNsWithBlack (bool flag)
| Set a flag that controls if image pixels corresponding to NaN (infinite) points should be painted black.

## Protected Member Functions

virtual bool | extractImpl (const PointCloud &cloud, pcl::PCLImage &image) const =0
| Implementation of the extract() function, has to be implemented in deriving classes.

## Protected Attributes

bool | paint_nans_with_black_ {false}
| A flag that controls if image pixels corresponding to NaN (infinite) points should be painted black.

## Detailed Description

template<typename PointT>
class pcl::io::PointCloudImageExtractor< PointT >

Base Image Extractor class for organized point clouds.

This is an abstract class that declares an interface for image extraction from organized point clouds. The family of its subclasses provide functionality to extract images from particular fields.

The following piece of code demonstrates typical usage of a PointCloudImageExtractor subclass. Here the data are extracted from the "label" field and are saved as a PNG image file.

// Source point cloud (needs to be filled with data of course)
pcl::PointCloud<pcl::PointXYZLabel> cloud;
// Target image
pcl::PCLImage image;
// Create PointCloudImageExtractor subclass that can handle "label" field
pcl::io::PointCloudImageExtractorFromLabelField<pcl::XYZLabel> pcie;
// Set it up if not happy with the defaults
pcie.setColorMode(pcie.COLORS_RGB_RANDOM);
// Try to extract an image
bool success = pcie.extract(cloud, image);
// Save to file if succeeded
if (success)
pcl::io::saveImage ("filename.png", image);
pcl::PointCloud
PointCloud represents the base class in PCL for storing collections of 3D points.
Definition point_cloud.h:174
pcl::io::PointCloudImageExtractorFromLabelField
Image Extractor which uses the data present in the "label" field to produce either monochrome or RGB ...
Definition point_cloud_image_extractors.h:258
pcl::io::PointCloudImageExtractorFromLabelField::COLORS_RGB_RANDOM
@ COLORS_RGB_RANDOM
Randomly generated RGB colors.
Definition point_cloud_image_extractors.h:272
pcl::io::PointCloudImageExtractorFromLabelField::setColorMode
void setColorMode(const ColorMode color_mode)
Set color mapping mode.
Definition point_cloud_image_extractors.h:289
pcl::io::PointCloudImageExtractor::extract
bool extract(const PointCloud &cloud, pcl::PCLImage &image) const
Obtain the image from the given cloud.
Definition point_cloud_image_extractors.hpp:51
pcl::PCLImage
Definition PCLImage.h:13

Author
  Sergey Alexandrov

Definition at line 78 of file point_cloud_image_extractors.h.

## Member Typedef Documentation

## ConstPtr

template<typename PointT>

using pcl::io::PointCloudImageExtractor< PointT >::ConstPtr = shared_ptr<const PointCloudImageExtractor<PointT> >

Definition at line 84 of file point_cloud_image_extractors.h.

## PointCloud

template<typename PointT>

using pcl::io::PointCloudImageExtractor< PointT >::PointCloud = pcl::PointCloud<PointT>

Definition at line 81 of file point_cloud_image_extractors.h.

## Ptr

template<typename PointT>

using pcl::io::PointCloudImageExtractor< PointT >::Ptr = shared_ptr<PointCloudImageExtractor<PointT> >

Definition at line 83 of file point_cloud_image_extractors.h.

## Constructor & Destructor Documentation

## PointCloudImageExtractor()

template<typename PointT>

pcl::io::PointCloudImageExtractor< PointT >::PointCloudImageExtractor | ( |  | ) |

default

Constructor.

## ~PointCloudImageExtractor()

template<typename PointT>

virtual pcl::io::PointCloudImageExtractor< PointT >::~PointCloudImageExtractor | ( |  | ) |

virtual default

Destructor.

## Member Function Documentation

## extract()

template<typename PointT>

bool pcl::io::PointCloudImageExtractor< PointT >::extract | ( | const PointCloud & | cloud,
|  | pcl::PCLImage & | image ) const

Obtain the image from the given cloud.

Parameters

  [in] | cloud | organized point cloud to extract image from
  [out] | image | the output image

Returns
  true if the operation was successful, false otherwise

Definition at line 51 of file point_cloud_image_extractors.hpp.

References pcl::PCLImage::data, pcl::PCLImage::encoding, extractImpl(), pcl::PointCloud< PointT >::height, pcl::isFinite(), pcl::PointCloud< PointT >::isOrganized(), paint_nans_with_black_, pcl::PointCloud< PointT >::size(), and pcl::PointCloud< PointT >::width.

## extractImpl()

template<typename PointT>

virtual bool pcl::io::PointCloudImageExtractor< PointT >::extractImpl | ( | const PointCloud & | cloud,
|  | pcl::PCLImage & | image ) const

protected pure virtual

Implementation of the extract() function, has to be implemented in deriving classes.

Implemented in pcl::io::PointCloudImageExtractorFromLabelField< PointT >, pcl::io::PointCloudImageExtractorFromNormalField< PointT >, pcl::io::PointCloudImageExtractorFromRGBField< PointT >, and pcl::io::PointCloudImageExtractorWithScaling< PointT >.

Referenced by extract().

## setPaintNaNsWithBlack()

template<typename PointT>

void pcl::io::PointCloudImageExtractor< PointT >::setPaintNaNsWithBlack | ( | bool | flag | ) |

inline

Set a flag that controls if image pixels corresponding to NaN (infinite) points should be painted black.

Definition at line 104 of file point_cloud_image_extractors.h.

References paint_nans_with_black_.

## Member Data Documentation

## paint_nans_with_black_

template<typename PointT>

bool pcl::io::PointCloudImageExtractor< PointT >::paint_nans_with_black_ {false}

protected

A flag that controls if image pixels corresponding to NaN (infinite) points should be painted black.

Definition at line 119 of file point_cloud_image_extractors.h.

Referenced by extract(), pcl::io::PointCloudImageExtractorFromLabelField< PointT >::extractImpl(), and setPaintNaNsWithBlack().

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

- pcl/io/point_cloud_image_extractors.h
- pcl/io/impl/point_cloud_image_extractors.hpp