Point Cloud Library (PCL)  1.14.1-dev
Classes | Files | Functions
Module visualization

Detailed Description

Overview

The pcl_visualization library was built for the purpose of being able to quickly prototype and visualize the results of algorithms operating on 3D point cloud data. Similar to OpenCV's highgui routines for displaying 2D images and for drawing basic 2D shapes on screen, the library offers:

The package makes use of the VTK library for 3D rendering for range image and 2D operations.

For implementing your own visualizers, take a look at the tests and examples accompanying the library.

Requirements

Classes

class  pcl::visualization::CloudViewer
 Simple point cloud visualization class. More...
 
class  pcl::visualization::FloatImageUtils
 Provide some general functionalities regarding 2d float arrays, e.g., for visualization purposes More...
 
class  pcl::visualization::PCLHistogramVisualizer
 PCL histogram visualizer main class. More...
 
class  pcl::visualization::ImageViewerInteractorStyle
 An image viewer interactor style, tailored for ImageViewer. More...
 
class  pcl::visualization::ImageViewer
 ImageViewer is a class for 2D image visualization. More...
 
class  pcl::visualization::PCLVisualizerInteractorStyle
 PCLVisualizerInteractorStyle defines an unique, custom VTK based interactory style for PCL Visualizer applications. More...
 
struct  pcl::visualization::Figure2D
 Abstract class for storing figure information. More...
 
class  pcl::visualization::PCLPainter2D
 PCL Painter2D main class. More...
 
class  pcl::visualization::PCLPlotter
 PCL Plotter main class. More...
 
class  pcl::visualization::PCLVisualizer
 PCL Visualizer main class. More...
 
class  pcl::visualization::PointCloudColorHandler< PointT >
 Base Handler class for PointCloud colors. More...
 
class  pcl::visualization::PointCloudColorHandlerRandom< PointT >
 Handler for random PointCloud colors (i.e., R, G, B will be randomly chosen) More...
 
class  pcl::visualization::PointCloudColorHandlerCustom< PointT >
 Handler for predefined user colors. More...
 
class  pcl::visualization::PointCloudColorHandlerRGBField< PointT >
 RGB handler class for colors. More...
 
class  pcl::visualization::PointCloudColorHandlerHSVField< PointT >
 HSV handler class for colors. More...
 
class  pcl::visualization::PointCloudColorHandlerGenericField< PointT >
 Generic field handler class for colors. More...
 
class  pcl::visualization::PointCloudColorHandlerRGBAField< PointT >
 RGBA handler class for colors. More...
 
class  pcl::visualization::PointCloudColorHandlerLabelField< PointT >
 Label field handler class for colors. More...
 
class  pcl::visualization::PointCloudColorHandler< pcl::PCLPointCloud2 >
 Base Handler class for PointCloud colors. More...
 
class  pcl::visualization::PointCloudColorHandlerRandom< pcl::PCLPointCloud2 >
 Handler for random PointCloud colors (i.e., R, G, B will be randomly chosen) More...
 
class  pcl::visualization::PointCloudColorHandlerCustom< pcl::PCLPointCloud2 >
 Handler for predefined user colors. More...
 
class  pcl::visualization::PointCloudColorHandlerRGBField< pcl::PCLPointCloud2 >
 RGB handler class for colors. More...
 
class  pcl::visualization::PointCloudColorHandlerHSVField< pcl::PCLPointCloud2 >
 HSV handler class for colors. More...
 
class  pcl::visualization::PointCloudColorHandlerGenericField< pcl::PCLPointCloud2 >
 Generic field handler class for colors. More...
 
class  pcl::visualization::PointCloudColorHandlerRGBAField< pcl::PCLPointCloud2 >
 RGBA handler class for colors. More...
 
class  pcl::visualization::PointCloudColorHandlerLabelField< pcl::PCLPointCloud2 >
 Label field handler class for colors. More...
 
class  pcl::visualization::PointCloudGeometryHandler< PointT >
 Base handler class for PointCloud geometry. More...
 
class  pcl::visualization::PointCloudGeometryHandlerXYZ< PointT >
 XYZ handler class for PointCloud geometry. More...
 
class  pcl::visualization::PointCloudGeometryHandlerSurfaceNormal< PointT >
 Surface normal handler class for PointCloud geometry. More...
 
class  pcl::visualization::PointCloudGeometryHandlerCustom< PointT >
 Custom handler class for PointCloud geometry. More...
 
class  pcl::visualization::PointCloudGeometryHandler< pcl::PCLPointCloud2 >
 Base handler class for PointCloud geometry. More...
 
class  pcl::visualization::PointCloudGeometryHandlerXYZ< pcl::PCLPointCloud2 >
 XYZ handler class for PointCloud geometry. More...
 
class  pcl::visualization::PointCloudGeometryHandlerSurfaceNormal< pcl::PCLPointCloud2 >
 Surface normal handler class for PointCloud geometry. More...
 
class  pcl::visualization::PointCloudGeometryHandlerCustom< pcl::PCLPointCloud2 >
 Custom handler class for PointCloud geometry. More...
 
class  pcl::visualization::RangeImageVisualizer
 Range image visualizer class. More...
 
class  pcl::RegistrationVisualizer< PointSource, PointTarget, Scalar >
 RegistrationVisualizer represents the base class for rendering the intermediate positions occupied by the source point cloud during it's registration to the target point cloud. More...
 
class  pcl::visualization::PCLSimpleBufferVisualizer
 PCL simple buffer visualizer main class. More...
 

Files

file  shapes.h
 Define methods or creating 3D shapes from parametric models.
 

Functions

PCL_EXPORTS void pcl::visualization::getCorrespondingPointCloud (vtkPolyData *src, const pcl::PointCloud< pcl::PointXYZ > &tgt, pcl::Indices &indices)
 Obtain a list of corresponding indices, for a set of vtk points, from a pcl::PointCloud. More...
 
PCL_EXPORTS bool pcl::visualization::savePointData (vtkPolyData *data, const std::string &out_file, const CloudActorMapPtr &actors)
 Saves the vtk-formatted Point Cloud data into a set of files, based on whether the data comes from previously loaded PCD files. More...
 
template<typename PointT >
vtkSmartPointer< vtkDataSet > pcl::visualization::createPolygon (const typename pcl::PointCloud< PointT >::ConstPtr &cloud)
 Create a 3d poly line from a set of points. More...
 
template<typename PointT >
vtkSmartPointer< vtkDataSet > pcl::visualization::createPolygon (const pcl::PlanarPolygon< PointT > &planar_polygon)
 Create a 3d poly line from a set of points on the boundary of a planar region. More...
 
PCL_EXPORTS vtkSmartPointer< vtkDataSet > pcl::visualization::createLine (const Eigen::Vector4f &pt1, const Eigen::Vector4f &pt2)
 Create a line shape from two points. More...
 
PCL_EXPORTS vtkSmartPointer< vtkDataSet > pcl::visualization::createSphere (const Eigen::Vector4f &center, double radius, int res=10)
 Create a sphere shape from a point and a radius. More...
 
PCL_EXPORTS vtkSmartPointer< vtkDataSet > pcl::visualization::createCylinder (const pcl::ModelCoefficients &coefficients, int numsides=30)
 Create a cylinder shape from a set of model coefficients. More...
 
PCL_EXPORTS vtkSmartPointer< vtkDataSet > pcl::visualization::createSphere (const pcl::ModelCoefficients &coefficients, int res=10)
 Create a sphere shape from a set of model coefficients. More...
 
PCL_EXPORTS vtkSmartPointer< vtkDataSet > pcl::visualization::createLine (const pcl::ModelCoefficients &coefficients)
 Create a line shape from a set of model coefficients. More...
 
PCL_EXPORTS vtkSmartPointer< vtkDataSet > pcl::visualization::createPlane (const pcl::ModelCoefficients &coefficients)
 Create a planar shape from a set of model coefficients. More...
 
PCL_EXPORTS vtkSmartPointer< vtkDataSet > pcl::visualization::createPlane (const pcl::ModelCoefficients &coefficients, double x, double y, double z)
 Create a planar shape from a set of model coefficients. More...
 
PCL_EXPORTS vtkSmartPointer< vtkDataSet > pcl::visualization::create2DCircle (const pcl::ModelCoefficients &coefficients, double z=0.0)
 Create a 2d circle shape from a set of model coefficients. More...
 
PCL_EXPORTS vtkSmartPointer< vtkDataSet > pcl::visualization::createCone (const pcl::ModelCoefficients &coefficients)
 Create a cone shape from a set of model coefficients. More...
 
PCL_EXPORTS vtkSmartPointer< vtkDataSet > pcl::visualization::createCube (const pcl::ModelCoefficients &coefficients)
 Create a cube shape from a set of model coefficients. More...
 
PCL_EXPORTS vtkSmartPointer< vtkDataSet > pcl::visualization::createCube (const Eigen::Vector3f &translation, const Eigen::Quaternionf &rotation, double width, double height, double depth)
 Create a cube shape from a set of model coefficients. More...
 
PCL_EXPORTS vtkSmartPointer< vtkDataSet > pcl::visualization::createEllipsoid (const Eigen::Isometry3d &transform, double radius_x, double radius_y, double radius_z)
 Create an ellipsoid shape from the given parameters. More...
 

Function Documentation

◆ create2DCircle()

PCL_EXPORTS vtkSmartPointer<vtkDataSet> pcl::visualization::create2DCircle ( const pcl::ModelCoefficients coefficients,
double  z = 0.0 
)

#include <pcl/visualization/common/shapes.h>

Create a 2d circle shape from a set of model coefficients.

Parameters
[in]coefficientsthe model coefficients (x, y, radius)
[in]z(optional) specify a z value (default: 0)
// The following are given (or computed using sample consensus techniques -- see SampleConsensusModelCircle2D)
// float x, y, radius;
circle_coeff.values.resize (3); // We need 3 values
circle_coeff.values[0] = x;
circle_coeff.values[1] = y;
circle_coeff.values[2] = radius;
PCL_EXPORTS vtkSmartPointer< vtkDataSet > create2DCircle(const pcl::ModelCoefficients &coefficients, double z=0.0)
Create a 2d circle shape from a set of model coefficients.
std::vector< float > values

◆ createCone()

PCL_EXPORTS vtkSmartPointer<vtkDataSet> pcl::visualization::createCone ( const pcl::ModelCoefficients coefficients)

#include <pcl/visualization/common/shapes.h>

Create a cone shape from a set of model coefficients.

Parameters
[in]coefficientsthe cone coefficients (cone_apex, axis_direction, angle)
// The following are given (or computed using sample consensus techniques -- see SampleConsensusModelCone)
// Eigen::Vector3f cone_apex, axis_direction;
// float angle;
// Note: The height of the cone is set using the magnitude of the axis_direction vector.
cone_coeff.values.resize (7); // We need 7 values
cone_coeff.values[0] = cone_apex.x ();
cone_coeff.values[1] = cone_apex.y ();
cone_coeff.values[2] = cone_apex.z ();
cone_coeff.values[3] = axis_direction.x ();
cone_coeff.values[4] = axis_direction.y ();
cone_coeff.values[5] = axis_direction.z ();
cone_coeff.values[6] = angle (); // degrees
PCL_EXPORTS vtkSmartPointer< vtkDataSet > createCone(const pcl::ModelCoefficients &coefficients)
Create a cone shape from a set of model coefficients.

◆ createCube() [1/2]

PCL_EXPORTS vtkSmartPointer<vtkDataSet> pcl::visualization::createCube ( const Eigen::Vector3f &  translation,
const Eigen::Quaternionf &  rotation,
double  width,
double  height,
double  depth 
)

#include <pcl/visualization/common/shapes.h>

Create a cube shape from a set of model coefficients.

Parameters
[in]translationa translation to apply to the cube from 0,0,0
[in]rotationa quaternion-based rotation to apply to the cube
[in]widththe cube's width
[in]heightthe cube's height
[in]depththe cube's depth

◆ createCube() [2/2]

PCL_EXPORTS vtkSmartPointer<vtkDataSet> pcl::visualization::createCube ( const pcl::ModelCoefficients coefficients)

#include <pcl/visualization/common/shapes.h>

Create a cube shape from a set of model coefficients.

Parameters
[in]coefficientsthe cube coefficients (Tx, Ty, Tz, Qx, Qy, Qz, Qw, width, height, depth)

◆ createCylinder()

PCL_EXPORTS vtkSmartPointer<vtkDataSet> pcl::visualization::createCylinder ( const pcl::ModelCoefficients coefficients,
int  numsides = 30 
)

#include <pcl/visualization/common/shapes.h>

Create a cylinder shape from a set of model coefficients.

Parameters
[in]coefficientsthe model coefficients (point_on_axis, axis_direction, radius)
[in]numsides(optional) the number of sides used for rendering the cylinder
// The following are given (or computed using sample consensus techniques -- see SampleConsensusModelCylinder)
// Eigen::Vector3f pt_on_axis, axis_direction;
// float radius;
pcl::ModelCoefficients cylinder_coeff;
cylinder_coeff.values.resize (7); // We need 7 values
cylinder_coeff.values[0] = pt_on_axis.x ();
cylinder_coeff.values[1] = pt_on_axis.y ();
cylinder_coeff.values[2] = pt_on_axis.z ();
cylinder_coeff.values[3] = axis_direction.x ();
cylinder_coeff.values[4] = axis_direction.y ();
cylinder_coeff.values[5] = axis_direction.z ();
cylinder_coeff.values[6] = radius;
PCL_EXPORTS vtkSmartPointer< vtkDataSet > createCylinder(const pcl::ModelCoefficients &coefficients, int numsides=30)
Create a cylinder shape from a set of model coefficients.

◆ createEllipsoid()

PCL_EXPORTS vtkSmartPointer<vtkDataSet> pcl::visualization::createEllipsoid ( const Eigen::Isometry3d &  transform,
double  radius_x,
double  radius_y,
double  radius_z 
)

#include <pcl/visualization/common/shapes.h>

Create an ellipsoid shape from the given parameters.

Parameters
[in]transforma transformation to apply to the ellipsoid from 0,0,0
[in]radius_xthe ellipsoid's radius along its local x-axis
[in]radius_ythe ellipsoid's radius along its local y-axis
[in]radius_zthe ellipsoid's radius along its local z-axis

◆ createLine() [1/2]

PCL_EXPORTS vtkSmartPointer<vtkDataSet> pcl::visualization::createLine ( const Eigen::Vector4f &  pt1,
const Eigen::Vector4f &  pt2 
)

#include <pcl/visualization/common/shapes.h>

Create a line shape from two points.

Parameters
[in]pt1the first point on the line
[in]pt2the end point on the line

Referenced by pcl::visualization::PCLVisualizer::addLine().

◆ createLine() [2/2]

PCL_EXPORTS vtkSmartPointer<vtkDataSet> pcl::visualization::createLine ( const pcl::ModelCoefficients coefficients)

#include <pcl/visualization/common/shapes.h>

Create a line shape from a set of model coefficients.

Parameters
[in]coefficientsthe model coefficients (point_on_line, line_direction)
// The following are given (or computed using sample consensus techniques -- see SampleConsensusModelLine)
// Eigen::Vector3f point_on_line, line_direction;
line_coeff.values.resize (6); // We need 6 values
line_coeff.values[0] = point_on_line.x ();
line_coeff.values[1] = point_on_line.y ();
line_coeff.values[2] = point_on_line.z ();
line_coeff.values[3] = line_direction.x ();
line_coeff.values[4] = line_direction.y ();
line_coeff.values[5] = line_direction.z ();
PCL_EXPORTS vtkSmartPointer< vtkDataSet > createLine(const Eigen::Vector4f &pt1, const Eigen::Vector4f &pt2)
Create a line shape from two points.

◆ createPlane() [1/2]

PCL_EXPORTS vtkSmartPointer<vtkDataSet> pcl::visualization::createPlane ( const pcl::ModelCoefficients coefficients)

#include <pcl/visualization/common/shapes.h>

Create a planar shape from a set of model coefficients.

Parameters
[in]coefficientsthe model coefficients (a, b, c, d with ax+by+cz+d=0)
// The following are given (or computed using sample consensus techniques -- see SampleConsensusModelPlane)
// Eigen::Vector4f plane_parameters;
plane_coeff.values.resize (4); // We need 4 values
plane_coeff.values[0] = plane_parameters.x ();
plane_coeff.values[1] = plane_parameters.y ();
plane_coeff.values[2] = plane_parameters.z ();
plane_coeff.values[3] = plane_parameters.w ();
PCL_EXPORTS vtkSmartPointer< vtkDataSet > createPlane(const pcl::ModelCoefficients &coefficients)
Create a planar shape from a set of model coefficients.

◆ createPlane() [2/2]

PCL_EXPORTS vtkSmartPointer<vtkDataSet> pcl::visualization::createPlane ( const pcl::ModelCoefficients coefficients,
double  x,
double  y,
double  z 
)

#include <pcl/visualization/common/shapes.h>

Create a planar shape from a set of model coefficients.

Parameters
[in]coefficientsthe model coefficients (a, b, c, d with ax+by+cz+d=0)
[in]x,y,zprojection of this point on the plane is used to get the center of the plane.

◆ createPolygon() [1/2]

template<typename PointT >
vtkSmartPointer< vtkDataSet > pcl::visualization::createPolygon ( const pcl::PlanarPolygon< PointT > &  planar_polygon)
inline

#include <pcl/visualization/common/impl/shapes.hpp>

Create a 3d poly line from a set of points on the boundary of a planar region.

Parameters
[in]planar_polygonthe set of points used to create the 3d polyline

Definition at line 82 of file shapes.hpp.

References pcl::visualization::allocVtkUnstructuredGrid(), and pcl::PlanarPolygon< PointT >::getContour().

◆ createPolygon() [2/2]

template<typename PointT >
vtkSmartPointer< vtkDataSet > pcl::visualization::createPolygon ( const typename pcl::PointCloud< PointT >::ConstPtr &  cloud)
inline

#include <pcl/visualization/common/impl/shapes.hpp>

Create a 3d poly line from a set of points.

Parameters
[in]cloudthe set of points used to create the 3d polyline

Definition at line 54 of file shapes.hpp.

References pcl::visualization::allocVtkUnstructuredGrid(), pcl::PointCloud< PointT >::points, and pcl::PointCloud< PointT >::size().

◆ createSphere() [1/2]

PCL_EXPORTS vtkSmartPointer<vtkDataSet> pcl::visualization::createSphere ( const Eigen::Vector4f &  center,
double  radius,
int  res = 10 
)

#include <pcl/visualization/common/shapes.h>

Create a sphere shape from a point and a radius.

Parameters
[in]centerthe center of the sphere (as an Eigen Vector4f, with only the first 3 coordinates used)
[in]radiusthe radius of the sphere
[in]res(optional) the resolution used for rendering the model

◆ createSphere() [2/2]

PCL_EXPORTS vtkSmartPointer<vtkDataSet> pcl::visualization::createSphere ( const pcl::ModelCoefficients coefficients,
int  res = 10 
)

#include <pcl/visualization/common/shapes.h>

Create a sphere shape from a set of model coefficients.

Parameters
[in]coefficientsthe model coefficients (sphere center, radius)
[in]res(optional) the resolution used for rendering the model
// The following are given (or computed using sample consensus techniques -- see SampleConsensusModelSphere)
// Eigen::Vector3f sphere_center;
// float radius;
sphere_coeff.values.resize (4); // We need 4 values
sphere_coeff.values[0] = sphere_center.x ();
sphere_coeff.values[1] = sphere_center.y ();
sphere_coeff.values[2] = sphere_center.z ();
sphere_coeff.values[3] = radius;
PCL_EXPORTS vtkSmartPointer< vtkDataSet > createSphere(const Eigen::Vector4f &center, double radius, int res=10)
Create a sphere shape from a point and a radius.

◆ getCorrespondingPointCloud()

PCL_EXPORTS void pcl::visualization::getCorrespondingPointCloud ( vtkPolyData *  src,
const pcl::PointCloud< pcl::PointXYZ > &  tgt,
pcl::Indices indices 
)

#include <pcl/visualization/common/io.h>

Obtain a list of corresponding indices, for a set of vtk points, from a pcl::PointCloud.

Parameters
srcthe set of vtk points
tgtthe target pcl::PointCloud that we need to obtain indices from
indicesthe resultant list of indices

◆ savePointData()

PCL_EXPORTS bool pcl::visualization::savePointData ( vtkPolyData *  data,
const std::string &  out_file,
const CloudActorMapPtr actors 
)

#include <pcl/visualization/common/io.h>

Saves the vtk-formatted Point Cloud data into a set of files, based on whether the data comes from previously loaded PCD files.

The PCD files are matched using the a list of names for the actors on screen.

Parameters
datathe vtk data
out_filethe output file (extra indices will be appended to it)
actorsthe list of actors present on screen