pcl::visualization::ImageViewer Class Reference
Module visualization

ImageViewer is a class for 2D image visualization. More...

`#include <pcl/visualization/image_viewer.h>`

Inheritance diagram for pcl::visualization::ImageViewer:

## Classes

struct | ExitCallback
struct | ExitMainLoopTimerCallback

## Public Types

typedef boost::shared_ptr< ImageViewer > | Ptr

## Public Member Functions

| ImageViewer (const std::string &window_title="")
| Constructor. More...
virtual | ~ImageViewer ()
| Destructor. More...
void | showMonoImage (const unsigned char *data, unsigned width, unsigned height, const std::string &layer_id="mono_image", double opacity=1.0)
| Show a monochrome 2D image on screen. More...
void | addMonoImage (const unsigned char *data, unsigned width, unsigned height, const std::string &layer_id="mono_image", double opacity=1.0)
| Add a monochrome 2D image layer, but do not render it (use spin/spinOnce to update). More...
void | showMonoImage (const pcl::PointCloud< pcl::Intensity >::ConstPtr &cloud, const std::string &layer_id="mono_image", double opacity=1.0)
| Show a monochrome 2D image on screen. More...
void | addMonoImage (const pcl::PointCloud< pcl::Intensity >::ConstPtr &cloud, const std::string &layer_id="mono_image", double opacity=1.0)
| Add a monochrome 2D image layer, but do not render it (use spin/spinOnce to update). More...
void | showMonoImage (const pcl::PointCloud< pcl::Intensity > &cloud, const std::string &layer_id="mono_image", double opacity=1.0)
| Show a monochrome 2D image on screen. More...
void | addMonoImage (const pcl::PointCloud< pcl::Intensity > &cloud, const std::string &layer_id="mono_image", double opacity=1.0)
| Add a monochrome 2D image layer, but do not render it (use spin/spinOnce to update). More...
void | showMonoImage (const pcl::PointCloud< pcl::Intensity8u >::ConstPtr &cloud, const std::string &layer_id="mono_image", double opacity=1.0)
| Show a monochrome 2D image on screen. More...
void | addMonoImage (const pcl::PointCloud< pcl::Intensity8u >::ConstPtr &cloud, const std::string &layer_id="mono_image", double opacity=1.0)
| Add a monochrome 2D image layer, but do not render it (use spin/spinOnce to update). More...
void | showMonoImage (const pcl::PointCloud< pcl::Intensity8u > &cloud, const std::string &layer_id="mono_image", double opacity=1.0)
| Show a monochrome 2D image on screen. More...
void | addMonoImage (const pcl::PointCloud< pcl::Intensity8u > &cloud, const std::string &layer_id="mono_image", double opacity=1.0)
| Add a monochrome 2D image layer, but do not render it (use spin/spinOnce to update). More...
void | showRGBImage (const unsigned char *data, unsigned width, unsigned height, const std::string &layer_id="rgb_image", double opacity=1.0)
| Show a 2D RGB image on screen. More...
void | addRGBImage (const unsigned char *data, unsigned width, unsigned height, const std::string &layer_id="rgb_image", double opacity=1.0)
| Add an RGB 2D image layer, but do not render it (use spin/spinOnce to update). More...
template<typename T >
void | showRGBImage (const typename pcl::PointCloud< T >::ConstPtr &cloud, const std::string &layer_id="rgb_image", double opacity=1.0)
| Show a 2D image on screen, obtained from the RGB channel of a point cloud. More...
template<typename T >
void | addRGBImage (const typename pcl::PointCloud< T >::ConstPtr &cloud, const std::string &layer_id="rgb_image", double opacity=1.0)
| Add an RGB 2D image layer, but do not render it (use spin/spinOnce to update). More...
template<typename T >
void | showRGBImage (const pcl::PointCloud< T > &cloud, const std::string &layer_id="rgb_image", double opacity=1.0)
| Show a 2D image on screen, obtained from the RGB channel of a point cloud. More...
template<typename T >
void | addRGBImage (const pcl::PointCloud< T > &cloud, const std::string &layer_id="rgb_image", double opacity=1.0)
| Add an RGB 2D image layer, but do not render it (use spin/spinOnce to update). More...
void | showFloatImage (const float *data, unsigned int width, unsigned int height, float min_value=std::numeric_limits< float >::min(), float max_value=std::numeric_limits< float >::max(), bool grayscale=false, const std::string &layer_id="float_image", double opacity=1.0)
| Show a 2D image (float) on screen. More...
void | addFloatImage (const float *data, unsigned int width, unsigned int height, float min_value=std::numeric_limits< float >::min(), float max_value=std::numeric_limits< float >::max(), bool grayscale=false, const std::string &layer_id="float_image", double opacity=1.0)
| Add a float 2D image layer, but do not render it (use spin/spinOnce to update). More...
void | showShortImage (const unsigned short *short_image, unsigned int width, unsigned int height, unsigned short min_value=std::numeric_limits< unsigned short >::min(), unsigned short max_value=std::numeric_limits< unsigned short >::max(), bool grayscale=false, const std::string &layer_id="short_image", double opacity=1.0)
| Show a 2D image (unsigned short) on screen. More...
void | addShortImage (const unsigned short *short_image, unsigned int width, unsigned int height, unsigned short min_value=std::numeric_limits< unsigned short >::min(), unsigned short max_value=std::numeric_limits< unsigned short >::max(), bool grayscale=false, const std::string &layer_id="short_image", double opacity=1.0)
| Add a short 2D image layer, but do not render it (use spin/spinOnce to update). More...
void | showAngleImage (const float *data, unsigned width, unsigned height, const std::string &layer_id="angle_image", double opacity=1.0)
| Show a 2D image on screen representing angle data. More...
void | addAngleImage (const float *data, unsigned width, unsigned height, const std::string &layer_id="angle_image", double opacity=1.0)
| Add an angle 2D image layer, but do not render it (use spin/spinOnce to update). More...
void | showHalfAngleImage (const float *data, unsigned width, unsigned height, const std::string &layer_id="half_angle_image", double opacity=1.0)
| Show a 2D image on screen representing half angle data. More...
void | addHalfAngleImage (const float *data, unsigned width, unsigned height, const std::string &layer_id="half_angle_image", double opacity=1.0)
| Add a half angle 2D image layer, but do not render it (use spin/spinOnce to update). More...
void | markPoint (size_t u, size_t v, Vector3ub fg_color, Vector3ub bg_color=red_color, double radius=3.0, const std::string &layer_id="points", double opacity=1.0)
| Sets the pixel at coordinates(u,v) to color while setting the neighborhood to another. More...
void | markPoints (const std::vector< int > &uv, Vector3ub fg_color, Vector3ub bg_color=red_color, double size=3.0, const std::string &layer_id="markers", double opacity=1.0)
| Sets the pixel at coordinates(u,v) to color while setting the neighborhood to another. More...
void | markPoints (const std::vector< float > &uv, Vector3ub fg_color, Vector3ub bg_color=red_color, double size=3.0, const std::string &layer_id="markers", double opacity=1.0)
| Sets the pixel at coordinates(u,v) to color while setting the neighborhood to another (float coordinates version). More...
void | setWindowTitle (const std::string &name)
| Set the window title name. More...
void | spin ()
| Spin method. More...
void | spinOnce (int time=1, bool force_redraw=true)
| Spin once method. More...
boost::signals2::connection | registerKeyboardCallback (void(*callback)(const pcl::visualization::KeyboardEvent &, void *), void *cookie=NULL)
| Register a callback function for keyboard events. More...
template<typename T >
boost::signals2::connection | registerKeyboardCallback (void(T::*callback)(const pcl::visualization::KeyboardEvent &, void *), T &instance, void *cookie=NULL)
| Register a callback function for keyboard events. More...
boost::signals2::connection | registerKeyboardCallback (boost::function< void(const pcl::visualization::KeyboardEvent &)> cb)
| Register a callback boost::function for keyboard events. More...
boost::signals2::connection | registerMouseCallback (void(*callback)(const pcl::visualization::MouseEvent &, void *), void *cookie=NULL)
| Register a callback boost::function for mouse events. More...
template<typename T >
boost::signals2::connection | registerMouseCallback (void(T::*callback)(const pcl::visualization::MouseEvent &, void *), T &instance, void *cookie=NULL)
| Register a callback function for mouse events. More...
boost::signals2::connection | registerMouseCallback (boost::function< void(const pcl::visualization::MouseEvent &)> cb)
| Register a callback function for mouse events. More...
void | setPosition (int x, int y)
| Set the position in screen coordinates. More...
void | setSize (int xw, int yw)
| Set the window size in screen coordinates. More...
int * | getSize ()
| Return the window size in pixels. More...
bool | wasStopped () const
| Returns true when the user tried to close the window. More...
void | close ()
| Stop the interaction and close the visualizaton window. More...
bool | addCircle (unsigned int x, unsigned int y, double radius, const std::string &layer_id="circles", double opacity=1.0)
| Add a circle shape from a point and a radius. More...
bool | addCircle (unsigned int x, unsigned int y, double radius, double r, double g, double b, const std::string &layer_id="circles", double opacity=1.0)
| Add a circle shape from a point and a radius. More...
bool | addRectangle (const pcl::PointXY &min_pt, const pcl::PointXY &max_pt, const std::string &layer_id="rectangles", double opacity=1.0)
| Add a 2D box and color its edges with a given color. More...
bool | addRectangle (const pcl::PointXY &min_pt, const pcl::PointXY &max_pt, double r, double g, double b, const std::string &layer_id="rectangles", double opacity=1.0)
| Add a 2D box and color its edges with a given color. More...
bool | addRectangle (unsigned int x_min, unsigned int x_max, unsigned int y_min, unsigned int y_max, const std::string &layer_id="rectangles", double opacity=1.0)
| Add a 2D box and color its edges with a given color. More...
bool | addRectangle (unsigned int x_min, unsigned int x_max, unsigned int y_min, unsigned int y_max, double r, double g, double b, const std::string &layer_id="rectangles", double opacity=1.0)
| Add a 2D box and color its edges with a given color. More...
template<typename T >
bool | addRectangle (const typename pcl::PointCloud< T >::ConstPtr &image, const T &min_pt, const T &max_pt, const std::string &layer_id="rectangles", double opacity=1.0)
| Add a 2D box and color its edges with a given color. More...
template<typename T >
bool | addRectangle (const typename pcl::PointCloud< T >::ConstPtr &image, const T &min_pt, const T &max_pt, double r, double g, double b, const std::string &layer_id="rectangles", double opacity=1.0)
| Add a 2D box and color its edges with a given color. More...
template<typename T >
bool | addRectangle (const typename pcl::PointCloud< T >::ConstPtr &image, const pcl::PointCloud< T > &mask, double r, double g, double b, const std::string &layer_id="rectangles", double opacity=1.0)
| Add a 2D box that contains a given image mask and color its edges. More...
template<typename T >
bool | addRectangle (const typename pcl::PointCloud< T >::ConstPtr &image, const pcl::PointCloud< T > &mask, const std::string &layer_id="image_mask", double opacity=1.0)
| Add a 2D box that contains a given image mask and color its edges in red. More...
bool | addFilledRectangle (unsigned int x_min, unsigned int x_max, unsigned int y_min, unsigned int y_max, const std::string &layer_id="boxes", double opacity=0.5)
| Add a 2D box and fill it in with a given color. More...
bool | addFilledRectangle (unsigned int x_min, unsigned int x_max, unsigned int y_min, unsigned int y_max, double r, double g, double b, const std::string &layer_id="boxes", double opacity=0.5)
| Add a 2D box and fill it in with a given color. More...
bool | addLine (unsigned int x_min, unsigned int y_min, unsigned int x_max, unsigned int y_max, double r, double g, double b, const std::string &layer_id="line", double opacity=1.0)
| Add a 2D line with a given color. More...
bool | addLine (unsigned int x_min, unsigned int y_min, unsigned int x_max, unsigned int y_max, const std::string &layer_id="line", double opacity=1.0)
| Add a 2D line with a given color. More...
bool | addText (unsigned int x, unsigned int y, const std::string &text, double r, double g, double b, const std::string &layer_id="line", double opacity=1.0)
| Add a 2D text with a given color. More...
bool | addText (unsigned int x, unsigned int y, const std::string &text, const std::string &layer_id="line", double opacity=1.0)
| Add a 2D text with a given color. More...
template<typename T >
bool | addMask (const typename pcl::PointCloud< T >::ConstPtr &image, const pcl::PointCloud< T > &mask, double r, double g, double b, const std::string &layer_id="image_mask", double opacity=0.5)
| Add a generic 2D mask to an image. More...
template<typename T >
bool | addMask (const typename pcl::PointCloud< T >::ConstPtr &image, const pcl::PointCloud< T > &mask, const std::string &layer_id="image_mask", double opacity=0.5)
| Add a generic 2D mask to an image (colored in red) More...
template<typename T >
bool | addPlanarPolygon (const typename pcl::PointCloud< T >::ConstPtr &image, const pcl::PlanarPolygon< T > &polygon, double r, double g, double b, const std::string &layer_id="planar_polygon", double opacity=1.0)
| Add a generic 2D planar polygon to an image. More...
template<typename T >
bool | addPlanarPolygon (const typename pcl::PointCloud< T >::ConstPtr &image, const pcl::PlanarPolygon< T > &polygon, const std::string &layer_id="planar_polygon", double opacity=1.0)
| Add a generic 2D planar polygon to an image. More...
bool | addLayer (const std::string &layer_id, int width, int height, double opacity=0.5)
| Add a new 2D rendering layer to the viewer. More...
void | removeLayer (const std::string &layer_id)
| Remove a 2D layer given by its ID. More...
template<typename PointT >
bool | showCorrespondences (const pcl::PointCloud< PointT > &source_img, const pcl::PointCloud< PointT > &target_img, const pcl::Correspondences &correspondences, int nth=1, const std::string &layer_id="correspondences")
| Add the specified correspondences to the display. More...

## Protected Member Functions

void | render ()
| Trigger a render call. More...
void | convertIntensityCloudToUChar (const pcl::PointCloud< pcl::Intensity > &cloud, boost::shared_array< unsigned char > data)
| Convert the Intensity information in a PointCloud<Intensity> to an unsigned char array. More...
void | convertIntensityCloud8uToUChar (const pcl::PointCloud< pcl::Intensity8u > &cloud, boost::shared_array< unsigned char > data)
| Convert the Intensity8u information in a PointCloud<Intensity8u> to an unsigned char array. More...
template<typename T >
void | convertRGBCloudToUChar (const pcl::PointCloud< T > &cloud, boost::shared_array< unsigned char > &data)
| Convert the RGB information in a PointCloud<T> to an unsigned char array. More...
void | resetStoppedFlag ()
| Set the stopped flag back to false. More...
void | emitMouseEvent (unsigned long event_id)
| Fire up a mouse event with a specified event ID. More...
void | emitKeyboardEvent (unsigned long event_id)
| Fire up a keyboard event with a specified event ID. More...

## Static Protected Member Functions

static void | MouseCallback (vtkObject *, unsigned long eid, void *clientdata, void *calldata)
static void | KeyboardCallback (vtkObject *, unsigned long eid, void *clientdata, void *calldata)

## Detailed Description

ImageViewer is a class for 2D image visualization.

Features include:

- add and remove different layers with different opacity (transparency) values
- add 2D geometric shapes (circles, boxes, etc) in separate layers
- display RGB, monochrome, float, angle images

Simple usage example:

pcl::visualization::ImageViewer iv;
iv.addCircle (10, 10, 5, 1.0, 0.0, 0.0, "circles", 1.0); // add a red, fully opaque circle with radius 5 pixels at (10,10) in layer "circles"
iv.addFilledRectangle (10, 20, 10, 20, 0.0, 1.0, 0.0, "boxes", 0.5); // add a green, 50% transparent box at (10,10->20,20) in layer "boxes"
iv.addRGBImage<pcl::PointXYZRGBA> (cloud); // add a RGB image from a point cloud dataset in an "rgb_image" default layer
iv.spin (); // press 'q' to exit
iv.removeLayer ("circles"); // remove layer "circles"
iv.spin (); // press 'q' to exit

Author
  Radu B. Rusu, Suat Gedikli

Definition at line 118 of file image_viewer.h.

## Member Typedef Documentation

typedef boost::shared_ptr<ImageViewer> pcl::visualization::ImageViewer::Ptr

Definition at line 121 of file image_viewer.h.

## Constructor & Destructor Documentation

pcl::visualization::ImageViewer::ImageViewer | ( | const std::string & | window_title = `""` | ) |

Constructor.

Parameters

  [in] | window_title | the title of the window

virtual pcl::visualization::ImageViewer::~ImageViewer | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

void pcl::visualization::ImageViewer::addAngleImage | ( | const float * | data,
|  | unsigned | width,
|  | unsigned | height,
|  | const std::string & | layer_id = `"angle_image"`,
|  | double | opacity = `1.0`
| ) |  |

Add an angle 2D image layer, but do not render it (use spin/spinOnce to update).

Parameters

  [in] | data | the input data representing the image
  [in] | width | the width of the image
  [in] | height | the height of the image
  [in] | layer_id | the name of the layer (default: "image")
  [in] | opacity | the opacity of the layer (default: 1.0)

bool pcl::visualization::ImageViewer::addCircle | ( | unsigned int | x,
|  | unsigned int | y,
|  | double | radius,
|  | const std::string & | layer_id = `"circles"`,
|  | double | opacity = `1.0`
| ) |  |

Add a circle shape from a point and a radius.

Parameters

  [in] | x | the x coordinate of the circle center
  [in] | y | the y coordinate of the circle center
  [in] | radius | the radius of the circle
  [in] | layer_id | the 2D layer ID where we want the extra information to be drawn.
  [in] | opacity | the opacity of the layer: 0 for invisible, 1 for opaque. (default: 1.0)

bool pcl::visualization::ImageViewer::addCircle | ( | unsigned int | x,
|  | unsigned int | y,
|  | double | radius,
|  | double | r,
|  | double | g,
|  | double | b,
|  | const std::string & | layer_id = `"circles"`,
|  | double | opacity = `1.0`
| ) |  |

Add a circle shape from a point and a radius.

Parameters

  [in] | x | the x coordinate of the circle center
  [in] | y | the y coordinate of the circle center
  [in] | radius | the radius of the circle
  [in] | r | the red channel of the color that the sphere should be rendered with (0.0 -> 1.0)
  [in] | g | the green channel of the color that the sphere should be rendered with (0.0 -> 1.0)
  [in] | b | the blue channel of the color that the sphere should be rendered with (0.0 -> 1.0)
  [in] | layer_id | the 2D layer ID where we want the extra information to be drawn.
  [in] | opacity | the opacity of the layer: 0 for invisible, 1 for opaque. (default: 1.0)

bool pcl::visualization::ImageViewer::addFilledRectangle | ( | unsigned int | x_min,
|  | unsigned int | x_max,
|  | unsigned int | y_min,
|  | unsigned int | y_max,
|  | const std::string & | layer_id = `"boxes"`,
|  | double | opacity = `0.5`
| ) |  |

Add a 2D box and fill it in with a given color.

Parameters

  [in] | x_min | the X min coordinate
  [in] | x_max | the X max coordinate
  [in] | y_min | the Y min coordinate
  [in] | y_max | the Y max coordinate
  [in] | layer_id | the 2D layer ID where we want the extra information to be drawn.
  [in] | opacity | the opacity of the layer: 0 for invisible, 1 for opaque. (default: 0.5)

bool pcl::visualization::ImageViewer::addFilledRectangle | ( | unsigned int | x_min,
|  | unsigned int | x_max,
|  | unsigned int | y_min,
|  | unsigned int | y_max,
|  | double | r,
|  | double | g,
|  | double | b,
|  | const std::string & | layer_id = `"boxes"`,
|  | double | opacity = `0.5`
| ) |  |

Add a 2D box and fill it in with a given color.

Parameters

  [in] | x_min | the X min coordinate
  [in] | x_max | the X max coordinate
  [in] | y_min | the Y min coordinate
  [in] | y_max | the Y max coordinate
  [in] | r | the red channel of the color that the box should be rendered with (0.0 -> 1.0)
  [in] | g | the green channel of the color that the box should be rendered with (0.0 -> 1.0)
  [in] | b | the blue channel of the color that the box should be rendered with (0.0 -> 1.0)
  [in] | layer_id | the 2D layer ID where we want the extra information to be drawn.
  [in] | opacity | the opacity of the layer: 0 for invisible, 1 for opaque. (default: 0.5)

void pcl::visualization::ImageViewer::addFloatImage | ( | const float * | data,
|  | unsigned int | width,
|  | unsigned int | height,
|  | float | min_value = `std::numeric_limits< float >::min()`,
|  | float | max_value = `std::numeric_limits< float >::max()`,
|  | bool | grayscale = `false`,
|  | const std::string & | layer_id = `"float_image"`,
|  | double | opacity = `1.0`
| ) |  |

Add a float 2D image layer, but do not render it (use spin/spinOnce to update).

Parameters

  [in] | data | the input data representing the image in float format
  [in] | width | the width of the image
  [in] | height | the height of the image
  [in] | min_value | filter all values in the image to be larger than this minimum value
  [in] | max_value | filter all values in the image to be smaller than this maximum value
  [in] | grayscale | show data as grayscale (true) or not (false). Default: false
  [in] | layer_id | the name of the layer (default: "image")
  [in] | opacity | the opacity of the layer (default: 1.0)

void pcl::visualization::ImageViewer::addHalfAngleImage | ( | const float * | data,
|  | unsigned | width,
|  | unsigned | height,
|  | const std::string & | layer_id = `"half_angle_image"`,
|  | double | opacity = `1.0`
| ) |  |

Add a half angle 2D image layer, but do not render it (use spin/spinOnce to update).

Parameters

  [in] | data | the input data representing the image
  [in] | width | the width of the image
  [in] | height | the height of the image
  [in] | layer_id | the name of the layer (default: "image")
  [in] | opacity | the opacity of the layer (default: 1.0)

bool pcl::visualization::ImageViewer::addLayer | ( | const std::string & | layer_id,
|  | int | width,
|  | int | height,
|  | double | opacity = `0.5`
| ) |  |

Add a new 2D rendering layer to the viewer.

Parameters

  [in] | layer_id | the name of the layer
  [in] | width | the width of the layer
  [in] | height | the height of the layer
  [in] | opacity | the opacity of the layer: 0 for invisible, 1 for opaque. (default: 0.5)

bool pcl::visualization::ImageViewer::addLine | ( | unsigned int | x_min,
|  | unsigned int | y_min,
|  | unsigned int | x_max,
|  | unsigned int | y_max,
|  | double | r,
|  | double | g,
|  | double | b,
|  | const std::string & | layer_id = `"line"`,
|  | double | opacity = `1.0`
| ) |  |

Add a 2D line with a given color.

Parameters

  [in] | x_min | the X min coordinate
  [in] | y_min | the Y min coordinate
  [in] | x_max | the X max coordinate
  [in] | y_max | the Y max coordinate
  [in] | r | the red channel of the color that the line should be rendered with (0.0 -> 1.0)
  [in] | g | the green channel of the color that the line should be rendered with (0.0 -> 1.0)
  [in] | b | the blue channel of the color that the line should be rendered with (0.0 -> 1.0)
  [in] | layer_id | the 2D layer ID where we want the extra information to be drawn.
  [in] | opacity | the opacity of the layer: 0 for invisible, 1 for opaque. (default: 1.0)

bool pcl::visualization::ImageViewer::addLine | ( | unsigned int | x_min,
|  | unsigned int | y_min,
|  | unsigned int | x_max,
|  | unsigned int | y_max,
|  | const std::string & | layer_id = `"line"`,
|  | double | opacity = `1.0`
| ) |  |

Add a 2D line with a given color.

Parameters

  [in] | x_min | the X min coordinate
  [in] | y_min | the Y min coordinate
  [in] | x_max | the X max coordinate
  [in] | y_max | the Y max coordinate
  [in] | layer_id | the 2D layer ID where we want the extra information to be drawn.
  [in] | opacity | the opacity of the layer: 0 for invisible, 1 for opaque. (default: 1.0)

template<typename T >

bool pcl::visualization::ImageViewer::addMask | ( | const typename pcl::PointCloud< T >::ConstPtr & | image,
|  | const pcl::PointCloud< T > & | mask,
|  | double | r,
|  | double | g,
|  | double | b,
|  | const std::string & | layer_id = `"image_mask"`,
|  | double | opacity = `0.5`
| ) |  |

Add a generic 2D mask to an image.

Parameters

  [in] | image | the organized point cloud dataset containing the image data
  [in] | mask | the point data representing the mask that we want to draw
  [in] | r | the red channel of the color that the mask should be rendered with
  [in] | g | the green channel of the color that the mask should be rendered with
  [in] | b | the blue channel of the color that the mask should be rendered with
  [in] | layer_id | the 2D layer ID where we want the extra information to be drawn.
  [in] | opacity | the opacity of the layer: 0 for invisible, 1 for opaque. (default: 0.5)

Definition at line 97 of file image_viewer.hpp.

References getSize(), pcl::PointCloud< PointT >::height, pcl::PointCloud< PointT >::isOrganized(), pcl::search::OrganizedNeighbor< PointT >::projectPoint(), pcl::search::OrganizedNeighbor< PointT >::setInputCloud(), pcl::PointCloud< PointT >::size(), pcl::PointXY::x, and pcl::PointXY::y.

Referenced by addMask().

template<typename T >

bool pcl::visualization::ImageViewer::addMask | ( | const typename pcl::PointCloud< T >::ConstPtr & | image,
|  | const pcl::PointCloud< T > & | mask,
|  | const std::string & | layer_id = `"image_mask"`,
|  | double | opacity = `0.5`
| ) |  |

Add a generic 2D mask to an image (colored in red)

Parameters

  [in] | image | the organized point cloud dataset containing the image data
  [in] | mask | the point data representing the mask that we want to draw
  [in] | layer_id | the 2D layer ID where we want the extra information to be drawn.
  [in] | opacity | the opacity of the layer: 0 for invisible, 1 for opaque. (default: 0.5)

Definition at line 145 of file image_viewer.hpp.

References addMask().

void pcl::visualization::ImageViewer::addMonoImage | ( | const unsigned char * | data,
|  | unsigned | width,
|  | unsigned | height,
|  | const std::string & | layer_id = `"mono_image"`,
|  | double | opacity = `1.0`
| ) |  |

Add a monochrome 2D image layer, but do not render it (use spin/spinOnce to update).

Parameters

  [in] | data | the input data representing the image
  [in] | width | the width of the image
  [in] | height | the height of the image
  [in] | layer_id | the name of the layer (default: "image")
  [in] | opacity | the opacity of the layer (default: 1.0)

void pcl::visualization::ImageViewer::addMonoImage | ( | const pcl::PointCloud< pcl::Intensity >::ConstPtr & | cloud,
|  | const std::string & | layer_id = `"mono_image"`,
|  | double | opacity = `1.0`
| ) |  |

inline

Add a monochrome 2D image layer, but do not render it (use spin/spinOnce to update).

Parameters

  [in] | cloud | the input data representing the grayscale point cloud
  [in] | layer_id | the name of the layer (default: "image")
  [in] | opacity | the opacity of the layer (default: 1.0)

Definition at line 182 of file image_viewer.h.

void pcl::visualization::ImageViewer::addMonoImage | ( | const pcl::PointCloud< pcl::Intensity > & | cloud,
|  | const std::string & | layer_id = `"mono_image"`,
|  | double | opacity = `1.0`
| ) |  |

Add a monochrome 2D image layer, but do not render it (use spin/spinOnce to update).

Parameters

  [in] | cloud | the input data representing the RGB point cloud
  [in] | layer_id | the name of the layer (default: "image")
  [in] | opacity | the opacity of the layer (default: 1.0)

void pcl::visualization::ImageViewer::addMonoImage | ( | const pcl::PointCloud< pcl::Intensity8u >::ConstPtr & | cloud,
|  | const std::string & | layer_id = `"mono_image"`,
|  | double | opacity = `1.0`
| ) |  |

inline

Add a monochrome 2D image layer, but do not render it (use spin/spinOnce to update).

Parameters

  [in] | cloud | the input data representing the grayscale point cloud
  [in] | layer_id | the name of the layer (default: "image")
  [in] | opacity | the opacity of the layer (default: 1.0)

Definition at line 224 of file image_viewer.h.

void pcl::visualization::ImageViewer::addMonoImage | ( | const pcl::PointCloud< pcl::Intensity8u > & | cloud,
|  | const std::string & | layer_id = `"mono_image"`,
|  | double | opacity = `1.0`
| ) |  |

Add a monochrome 2D image layer, but do not render it (use spin/spinOnce to update).

Parameters

  [in] | cloud | the input data representing the RGB point cloud
  [in] | layer_id | the name of the layer (default: "image")
  [in] | opacity | the opacity of the layer (default: 1.0)

template<typename T >

bool pcl::visualization::ImageViewer::addPlanarPolygon | ( | const typename pcl::PointCloud< T >::ConstPtr & | image,
|  | const pcl::PlanarPolygon< T > & | polygon,
|  | double | r,
|  | double | g,
|  | double | b,
|  | const std::string & | layer_id = `"planar_polygon"`,
|  | double | opacity = `1.0`
| ) |  |

Add a generic 2D planar polygon to an image.

Parameters

  [in] | image | the organized point cloud dataset containing the image data
  [in] | polygon | the point data representing the polygon that we want to draw. A line will be drawn from each point to the next in the dataset.
  [in] | r | the red channel of the color that the polygon should be rendered with
  [in] | g | the green channel of the color that the polygon should be rendered with
  [in] | b | the blue channel of the color that the polygon should be rendered with
  [in] | layer_id | the 2D layer ID where we want the extra information to be drawn.
  [in] | opacity | the opacity of the layer: 0 for invisible, 1 for opaque. (default: 1.0)

Definition at line 155 of file image_viewer.hpp.

References pcl::PlanarPolygon< PointT >::getContour(), getSize(), pcl::PointCloud< PointT >::height, pcl::PointCloud< PointT >::isOrganized(), pcl::search::OrganizedNeighbor< PointT >::projectPoint(), pcl::search::OrganizedNeighbor< PointT >::setInputCloud(), pcl::PointCloud< PointT >::size(), pcl::PointXY::x, and pcl::PointXY::y.

Referenced by addPlanarPolygon().

template<typename T >

bool pcl::visualization::ImageViewer::addPlanarPolygon | ( | const typename pcl::PointCloud< T >::ConstPtr & | image,
|  | const pcl::PlanarPolygon< T > & | polygon,
|  | const std::string & | layer_id = `"planar_polygon"`,
|  | double | opacity = `1.0`
| ) |  |

Add a generic 2D planar polygon to an image.

Parameters

  [in] | image | the organized point cloud dataset containing the image data
  [in] | polygon | the point data representing the polygon that we want to draw. A line will be drawn from each point to the next in the dataset.
  [in] | layer_id | the 2D layer ID where we want the extra information to be drawn.
  [in] | opacity | the opacity of the layer: 0 for invisible, 1 for opaque. (default: 1.0)

Definition at line 207 of file image_viewer.hpp.

References addPlanarPolygon().

bool pcl::visualization::ImageViewer::addRectangle | ( | const pcl::PointXY & | min_pt,
|  | const pcl::PointXY & | max_pt,
|  | const std::string & | layer_id = `"rectangles"`,
|  | double | opacity = `1.0`
| ) |  |

Add a 2D box and color its edges with a given color.

Parameters

  [in] | min_pt | the X,Y min coordinate
  [in] | max_pt | the X,Y max coordinate
  [in] | layer_id | the 2D layer ID where we want the extra information to be drawn.
  [in] | opacity | the opacity of the layer: 0 for invisible, 1 for opaque. (default: 1.0)

Referenced by addRectangle().

bool pcl::visualization::ImageViewer::addRectangle | ( | const pcl::PointXY & | min_pt,
|  | const pcl::PointXY & | max_pt,
|  | double | r,
|  | double | g,
|  | double | b,
|  | const std::string & | layer_id = `"rectangles"`,
|  | double | opacity = `1.0`
| ) |  |

Add a 2D box and color its edges with a given color.

Parameters

  [in] | min_pt | the X,Y min coordinate
  [in] | max_pt | the X,Y max coordinate
  [in] | r | the red channel of the color that the box should be rendered with (0.0 -> 1.0)
  [in] | g | the green channel of the color that the box should be rendered with (0.0 -> 1.0)
  [in] | b | the blue channel of the color that the box should be rendered with (0.0 -> 1.0)
  [in] | layer_id | the 2D layer ID where we want the extra information to be drawn.
  [in] | opacity | the opacity of the layer: 0 for invisible, 1 for opaque. (default: 1.0)

bool pcl::visualization::ImageViewer::addRectangle | ( | unsigned int | x_min,
|  | unsigned int | x_max,
|  | unsigned int | y_min,
|  | unsigned int | y_max,
|  | const std::string & | layer_id = `"rectangles"`,
|  | double | opacity = `1.0`
| ) |  |

Add a 2D box and color its edges with a given color.

Parameters

  [in] | x_min | the X min coordinate
  [in] | x_max | the X max coordinate
  [in] | y_min | the Y min coordinate
  [in] | y_max | the Y max coordinate
  [in] | layer_id | the 2D layer ID where we want the extra information to be drawn.
  [in] | opacity | the opacity of the layer: 0 for invisible, 1 for opaque. (default: 1.0)

bool pcl::visualization::ImageViewer::addRectangle | ( | unsigned int | x_min,
|  | unsigned int | x_max,
|  | unsigned int | y_min,
|  | unsigned int | y_max,
|  | double | r,
|  | double | g,
|  | double | b,
|  | const std::string & | layer_id = `"rectangles"`,
|  | double | opacity = `1.0`
| ) |  |

Add a 2D box and color its edges with a given color.

Parameters

  [in] | x_min | the X min coordinate
  [in] | x_max | the X max coordinate
  [in] | y_min | the Y min coordinate
  [in] | y_max | the Y max coordinate
  [in] | r | the red channel of the color that the box should be rendered with (0.0 -> 1.0)
  [in] | g | the green channel of the color that the box should be rendered with (0.0 -> 1.0)
  [in] | b | the blue channel of the color that the box should be rendered with (0.0 -> 1.0)
  [in] | layer_id | the 2D layer ID where we want the extra information to be drawn.
  [in] | opacity | the opacity of the layer: 0 for invisible, 1 for opaque. (default: 1.0)

template<typename T >

bool pcl::visualization::ImageViewer::addRectangle | ( | const typename pcl::PointCloud< T >::ConstPtr & | image,
|  | const T & | min_pt,
|  | const T & | max_pt,
|  | const std::string & | layer_id = `"rectangles"`,
|  | double | opacity = `1.0`
| ) |  |

Add a 2D box and color its edges with a given color.

Parameters

  [in] | image | the organized point cloud dataset containing the image data
  [in] | min_pt | the X,Y min coordinate
  [in] | max_pt | the X,Y max coordinate
  [in] | layer_id | the 2D layer ID where we want the extra information to be drawn.
  [in] | opacity | the opacity of the layer: 0 for invisible, 1 for opaque. (default: 1.0)

Definition at line 289 of file image_viewer.hpp.

template<typename T >

bool pcl::visualization::ImageViewer::addRectangle | ( | const typename pcl::PointCloud< T >::ConstPtr & | image,
|  | const T & | min_pt,
|  | const T & | max_pt,
|  | double | r,
|  | double | g,
|  | double | b,
|  | const std::string & | layer_id = `"rectangles"`,
|  | double | opacity = `1.0`
| ) |  |

Add a 2D box and color its edges with a given color.

Parameters

  [in] | image | the organized point cloud dataset containing the image data
  [in] | min_pt | the X,Y min coordinate
  [in] | max_pt | the X,Y max coordinate
  [in] | r | the red channel of the color that the box should be rendered with (0.0 -> 1.0)
  [in] | g | the green channel of the color that the box should be rendered with (0.0 -> 1.0)
  [in] | b | the blue channel of the color that the box should be rendered with (0.0 -> 1.0)
  [in] | layer_id | the 2D layer ID where we want the extra information to be drawn.
  [in] | opacity | the opacity of the layer: 0 for invisible, 1 for opaque. (default: 1.0)

Definition at line 217 of file image_viewer.hpp.

References getSize(), pcl::PointCloud< PointT >::height, pcl::PointCloud< PointT >::isOrganized(), pcl::search::OrganizedNeighbor< PointT >::projectPoint(), pcl::search::OrganizedNeighbor< PointT >::setInputCloud(), pcl::PointXY::x, and pcl::PointXY::y.

template<typename T >

bool pcl::visualization::ImageViewer::addRectangle | ( | const typename pcl::PointCloud< T >::ConstPtr & | image,
|  | const pcl::PointCloud< T > & | mask,
|  | double | r,
|  | double | g,
|  | double | b,
|  | const std::string & | layer_id = `"rectangles"`,
|  | double | opacity = `1.0`
| ) |  |

Add a 2D box that contains a given image mask and color its edges.

Parameters

  [in] | image | the organized point cloud dataset containing the image data
  [in] | mask | the point data representing the mask that we want to draw
  [in] | r | the red channel of the color that the mask should be rendered with
  [in] | g | the green channel of the color that the mask should be rendered with
  [in] | b | the blue channel of the color that the mask should be rendered with
  [in] | layer_id | the 2D layer ID where we want the extra information to be drawn.
  [in] | opacity | the opacity of the layer: 0 for invisible, 1 for opaque. (default: 1.0)

Definition at line 300 of file image_viewer.hpp.

References getSize(), pcl::PointCloud< PointT >::height, pcl::PointCloud< PointT >::isOrganized(), pcl::PointCloud< PointT >::points, pcl::search::OrganizedNeighbor< PointT >::projectPoint(), pcl::search::OrganizedNeighbor< PointT >::setInputCloud(), pcl::PointXY::x, and pcl::PointXY::y.

template<typename T >

bool pcl::visualization::ImageViewer::addRectangle | ( | const typename pcl::PointCloud< T >::ConstPtr & | image,
|  | const pcl::PointCloud< T > & | mask,
|  | const std::string & | layer_id = `"image_mask"`,
|  | double | opacity = `1.0`
| ) |  |

Add a 2D box that contains a given image mask and color its edges in red.

Parameters

  [in] | image | the organized point cloud dataset containing the image data
  [in] | mask | the point data representing the mask that we want to draw
  [in] | layer_id | the 2D layer ID where we want the extra information to be drawn.
  [in] | opacity | the opacity of the layer: 0 for invisible, 1 for opaque. (default: 1.0)

Definition at line 354 of file image_viewer.hpp.

References addRectangle().

void pcl::visualization::ImageViewer::addRGBImage | ( | const unsigned char * | data,
|  | unsigned | width,
|  | unsigned | height,
|  | const std::string & | layer_id = `"rgb_image"`,
|  | double | opacity = `1.0`
| ) |  |

Add an RGB 2D image layer, but do not render it (use spin/spinOnce to update).

Parameters

  [in] | data | the input data representing the image
  [in] | width | the width of the image
  [in] | height | the height of the image
  [in] | layer_id | the name of the layer (default: "image")
  [in] | opacity | the opacity of the layer (default: 1.0)

Referenced by addRGBImage().

template<typename T >

void pcl::visualization::ImageViewer::addRGBImage | ( | const typename pcl::PointCloud< T >::ConstPtr & | cloud,
|  | const std::string & | layer_id = `"rgb_image"`,
|  | double | opacity = `1.0`
| ) |  |

inline

Add an RGB 2D image layer, but do not render it (use spin/spinOnce to update).

Parameters

  [in] | cloud | the input data representing the RGB point cloud
  [in] | layer_id | the name of the layer (default: "image")
  [in] | opacity | the opacity of the layer (default: 1.0)

Definition at line 288 of file image_viewer.h.

References pcl::visualization::red_color().

template<typename T >

void pcl::visualization::ImageViewer::addRGBImage | ( | const pcl::PointCloud< T > & | cloud,
|  | const std::string & | layer_id = `"rgb_image"`,
|  | double | opacity = `1.0`
| ) |  |

Add an RGB 2D image layer, but do not render it (use spin/spinOnce to update).

Parameters

  [in] | cloud | the input data representing the RGB point cloud
  [in] | layer_id | the name of the layer (default: "image")
  [in] | opacity | the opacity of the layer (default: 1.0)

Definition at line 70 of file image_viewer.hpp.

References addRGBImage(), convertRGBCloudToUChar(), pcl::PointCloud< PointT >::height, and pcl::PointCloud< PointT >::width.

void pcl::visualization::ImageViewer::addShortImage | ( | const unsigned short * | short_image,
|  | unsigned int | width,
|  | unsigned int | height,
|  | unsigned short | min_value = `std::numeric_limits< unsigned short >::min()`,
|  | unsigned short | max_value = `std::numeric_limits< unsigned short >::max()`,
|  | bool | grayscale = `false`,
|  | const std::string & | layer_id = `"short_image"`,
|  | double | opacity = `1.0`
| ) |  |

Add a short 2D image layer, but do not render it (use spin/spinOnce to update).

Parameters

  [in] | short_image | the input data representing the image in unsigned short format
  [in] | width | the width of the image
  [in] | height | the height of the image
  [in] | min_value | filter all values in the image to be larger than this minimum value
  [in] | max_value | filter all values in the image to be smaller than this maximum value
  [in] | grayscale | show data as grayscale (true) or not (false). Default: false
  [in] | layer_id | the name of the layer (default: "image")
  [in] | opacity | the opacity of the layer (default: 1.0)

bool pcl::visualization::ImageViewer::addText | ( | unsigned int | x,
|  | unsigned int | y,
|  | const std::string & | text,
|  | double | r,
|  | double | g,
|  | double | b,
|  | const std::string & | layer_id = `"line"`,
|  | double | opacity = `1.0`
| ) |  |

Add a 2D text with a given color.

Parameters

  [in] | x | the X coordinate
  [in] | y | the Y coordinate
  [in] | text | the text string to be displayed
  [in] | r | the red channel of the color that the line should be rendered with (0.0 -> 1.0)
  [in] | g | the green channel of the color that the line should be rendered with (0.0 -> 1.0)
  [in] | b | the blue channel of the color that the line should be rendered with (0.0 -> 1.0)
  [in] | layer_id | the 2D layer ID where we want the extra information to be drawn.
  [in] | opacity | the opacity of the layer: 0 for invisible, 1 for opaque. (default: 1.0)

bool pcl::visualization::ImageViewer::addText | ( | unsigned int | x,
|  | unsigned int | y,
|  | const std::string & | text,
|  | const std::string & | layer_id = `"line"`,
|  | double | opacity = `1.0`
| ) |  |

Add a 2D text with a given color.

Parameters

  [in] | x | the X coordinate
  [in] | y | the Y coordinate
  [in] | text | the text string to be displayed
  [in] | layer_id | the 2D layer ID where we want the extra information to be drawn.
  [in] | opacity | the opacity of the layer: 0 for invisible, 1 for opaque. (default: 1.0)

void pcl::visualization::ImageViewer::close | ( |  | ) |

inline

Stop the interaction and close the visualizaton window.

Definition at line 563 of file image_viewer.h.

void pcl::visualization::ImageViewer::convertIntensityCloud8uToUChar | ( | const pcl::PointCloud< pcl::Intensity8u > & | cloud,
|  | boost::shared_array< unsigned char > | data
| ) |  |

protected

Convert the Intensity8u information in a PointCloud<Intensity8u> to an unsigned char array.

Parameters

  [in] | cloud | the input cloud containing the grayscale intensity information
  [out] | data | a boost shared array of unsigned char type

Note
  The method assumes that the data array has already been allocated and contains enough space to copy all the data from cloud!

void pcl::visualization::ImageViewer::convertIntensityCloudToUChar | ( | const pcl::PointCloud< pcl::Intensity > & | cloud,
|  | boost::shared_array< unsigned char > | data
| ) |  |

protected

Convert the Intensity information in a PointCloud<Intensity> to an unsigned char array.

Parameters

  [in] | cloud | the input cloud containing the grayscale intensity information
  [out] | data | a boost shared array of unsigned char type

Note
  The method assumes that the data array has already been allocated and contains enough space to copy all the data from cloud!

template<typename T >

void pcl::visualization::ImageViewer::convertRGBCloudToUChar | ( | const pcl::PointCloud< T > & | cloud,
|  | boost::shared_array< unsigned char > & | data
| ) |  |

protected

Convert the RGB information in a PointCloud<T> to an unsigned char array.

Parameters

  [in] | cloud | the input cloud containing the RGB information
  [out] | data | a boost shared array of unsigned char type

Note
  The method assumes that the data array has already been allocated and contains enough space to copy all the data from cloud!

Definition at line 55 of file image_viewer.hpp.

References pcl::PointCloud< PointT >::points.

Referenced by addRGBImage().

void pcl::visualization::ImageViewer::emitKeyboardEvent | ( | unsigned long | event_id | ) |

protected

Fire up a keyboard event with a specified event ID.

Parameters

  [in] | event_id | the id of the event

void pcl::visualization::ImageViewer::emitMouseEvent | ( | unsigned long | event_id | ) |

protected

Fire up a mouse event with a specified event ID.

Parameters

  [in] | event_id | the id of the event

int* pcl::visualization::ImageViewer::getSize | ( |  | ) |

Return the window size in pixels.

Referenced by addMask(), addPlanarPolygon(), addRectangle(), and showCorrespondences().

static void pcl::visualization::ImageViewer::KeyboardCallback | ( | vtkObject * | ,
|  | unsigned long | eid,
|  | void * | clientdata,
|  | void * | calldata
| ) |  |

static protected

void pcl::visualization::ImageViewer::markPoint | ( | size_t | u,
|  | size_t | v,
|  | Vector3ub | fg_color,
|  | Vector3ub | bg_color = `red_color`,
|  | double | radius = `3.0`,
|  | const std::string & | layer_id = `"points"`,
|  | double | opacity = `1.0`
| ) |  |

Sets the pixel at coordinates(u,v) to color while setting the neighborhood to another.

Parameters

  [in] | u | the u/x coordinate of the pixel
  [in] | v | the v/y coordinate of the pixel
  [in] | fg_color | the pixel color
  [in] | bg_color | the neighborhood color
  [in] | radius | the circle radius around the pixel
  [in] | layer_id | the name of the layer (default: "points")
  [in] | opacity | the opacity of the layer (default: 1.0)

void pcl::visualization::ImageViewer::markPoints | ( | const std::vector< int > & | uv,
|  | Vector3ub | fg_color,
|  | Vector3ub | bg_color = `red_color`,
|  | double | size = `3.0`,
|  | const std::string & | layer_id = `"markers"`,
|  | double | opacity = `1.0`
| ) |  |

Sets the pixel at coordinates(u,v) to color while setting the neighborhood to another.

Parameters

  [in] | uv | the u/x, v/y coordinate of the pixels to be marked
  [in] | fg_color | the pixel color
  [in] | bg_color | the neighborhood color
  [in] | size | edge of the square surrounding each pixel
  [in] | layer_id | the name of the layer (default: "markers")
  [in] | opacity | the opacity of the layer (default: 1.0)

void pcl::visualization::ImageViewer::markPoints | ( | const std::vector< float > & | uv,
|  | Vector3ub | fg_color,
|  | Vector3ub | bg_color = `red_color`,
|  | double | size = `3.0`,
|  | const std::string & | layer_id = `"markers"`,
|  | double | opacity = `1.0`
| ) |  |

Sets the pixel at coordinates(u,v) to color while setting the neighborhood to another (float coordinates version).

Parameters

  [in] | uv | the u/x, v/y coordinate of the pixels to be marked
  [in] | fg_color | the pixel color
  [in] | bg_color | the neighborhood color
  [in] | size | edge of the square surrounding each pixel
  [in] | layer_id | the name of the layer (default: "markers")
  [in] | opacity | the opacity of the layer (default: 1.0)

static void pcl::visualization::ImageViewer::MouseCallback | ( | vtkObject * | ,
|  | unsigned long | eid,
|  | void * | clientdata,
|  | void * | calldata
| ) |  |

static protected

boost::signals2::connection pcl::visualization::ImageViewer::registerKeyboardCallback | ( | void(*)(const pcl::visualization::KeyboardEvent &, void *) | callback,
|  | void * | cookie = `NULL`
| ) |  |

inline

Register a callback function for keyboard events.

Parameters

  [in] | callback | the function that will be registered as a callback for a keyboard event
  [in] | cookie | user data that is passed to the callback

Returns
  a connection object that allows to disconnect the callback function.

Definition at line 481 of file image_viewer.h.

template<typename T >

boost::signals2::connection pcl::visualization::ImageViewer::registerKeyboardCallback | ( | void(T::*)(const pcl::visualization::KeyboardEvent &, void *) | callback,
|  | T & | instance,
|  | void * | cookie = `NULL`
| ) |  |

inline

Register a callback function for keyboard events.

Parameters

  [in] | callback | the member function that will be registered as a callback for a keyboard event
  [in] | instance | instance to the class that implements the callback function
  [in] | cookie | user data that is passed to the callback

Returns
  a connection object that allows to disconnect the callback function.

Definition at line 494 of file image_viewer.h.

boost::signals2::connection pcl::visualization::ImageViewer::registerKeyboardCallback | ( | boost::function< void(const pcl::visualization::KeyboardEvent &)> | cb | ) |

Register a callback boost::function for keyboard events.

Parameters

  [in] | cb | the boost function that will be registered as a callback for a keyboard event

Returns
  a connection object that allows to disconnect the callback function.

boost::signals2::connection pcl::visualization::ImageViewer::registerMouseCallback | ( | void(*)(const pcl::visualization::MouseEvent &, void *) | callback,
|  | void * | cookie = `NULL`
| ) |  |

inline

Register a callback boost::function for mouse events.

Parameters

  [in] | callback | the function that will be registered as a callback for a mouse event
  [in] | cookie | user data that is passed to the callback

Returns
  a connection object that allows to disconnect the callback function.

Definition at line 513 of file image_viewer.h.

template<typename T >

boost::signals2::connection pcl::visualization::ImageViewer::registerMouseCallback | ( | void(T::*)(const pcl::visualization::MouseEvent &, void *) | callback,
|  | T & | instance,
|  | void * | cookie = `NULL`
| ) |  |

inline

Register a callback function for mouse events.

Parameters

  [in] | callback | the member function that will be registered as a callback for a mouse event
  [in] | instance | instance to the class that implements the callback function
  [in] | cookie | user data that is passed to the callback

Returns
  a connection object that allows to disconnect the callback function.

Definition at line 526 of file image_viewer.h.

boost::signals2::connection pcl::visualization::ImageViewer::registerMouseCallback | ( | boost::function< void(const pcl::visualization::MouseEvent &)> | cb | ) |

Register a callback function for mouse events.

Parameters

  [in] | cb | the boost function that will be registered as a callback for a mouse event

Returns
  a connection object that allows to disconnect the callback function.

void pcl::visualization::ImageViewer::removeLayer | ( | const std::string & | layer_id | ) |

Remove a 2D layer given by its ID.

Parameters

  [in] | layer_id | the name of the layer

void pcl::visualization::ImageViewer::render | ( |  | ) |

protected

Trigger a render call.

Referenced by showRGBImage().

void pcl::visualization::ImageViewer::resetStoppedFlag | ( |  | ) |

inline protected

Set the stopped flag back to false.

Definition at line 902 of file image_viewer.h.

void pcl::visualization::ImageViewer::setPosition | ( | int | x,
|  | int | y
| ) |  |

Set the position in screen coordinates.

Parameters

  [in] | x | where to move the window to (X)
  [in] | y | where to move the window to (Y)

void pcl::visualization::ImageViewer::setSize | ( | int | xw,
|  | int | yw
| ) |  |

Set the window size in screen coordinates.

Parameters

  [in] | xw | window size in horizontal (pixels)
  [in] | yw | window size in vertical (pixels)

Referenced by showCorrespondences().

void pcl::visualization::ImageViewer::setWindowTitle | ( | const std::string & | name | ) |

Set the window title name.

Parameters

  [in] | name | the window title

void pcl::visualization::ImageViewer::showAngleImage | ( | const float * | data,
|  | unsigned | width,
|  | unsigned | height,
|  | const std::string & | layer_id = `"angle_image"`,
|  | double | opacity = `1.0`
| ) |  |

Show a 2D image on screen representing angle data.

Parameters

  [in] | data | the input data representing the image
  [in] | width | the width of the image
  [in] | height | the height of the image
  [in] | layer_id | the name of the layer (default: "image")
  [in] | opacity | the opacity of the layer (default: 1.0)

template<typename PointT >

bool pcl::visualization::ImageViewer::showCorrespondences | ( | const pcl::PointCloud< PointT > & | source_img,
|  | const pcl::PointCloud< PointT > & | target_img,
|  | const pcl::Correspondences & | correspondences,
|  | int | nth = `1`,
|  | const std::string & | layer_id = `"correspondences"`
| ) |  |

Add the specified correspondences to the display.

Parameters

  [in] | source_img | The source RGB image
  [in] | target_img | The target RGB image
  [in] | correspondences | The list of correspondences to display.
  [in] | nth | display only the Nth correspondence (e.g., skip the rest)
  [in] | layer_id | the layer id (default: "correspondences")

Definition at line 364 of file image_viewer.hpp.

References pcl::visualization::getRandomColors(), getSize(), pcl::PointCloud< PointT >::height, setSize(), and pcl::PointCloud< PointT >::width.

void pcl::visualization::ImageViewer::showFloatImage | ( | const float * | data,
|  | unsigned int | width,
|  | unsigned int | height,
|  | float | min_value = `std::numeric_limits< float >::min()`,
|  | float | max_value = `std::numeric_limits< float >::max()`,
|  | bool | grayscale = `false`,
|  | const std::string & | layer_id = `"float_image"`,
|  | double | opacity = `1.0`
| ) |  |

Show a 2D image (float) on screen.

Parameters

  [in] | data | the input data representing the image in float format
  [in] | width | the width of the image
  [in] | height | the height of the image
  [in] | min_value | filter all values in the image to be larger than this minimum value
  [in] | max_value | filter all values in the image to be smaller than this maximum value
  [in] | grayscale | show data as grayscale (true) or not (false). Default: false
  [in] | layer_id | the name of the layer (default: "image")
  [in] | opacity | the opacity of the layer (default: 1.0)

void pcl::visualization::ImageViewer::showHalfAngleImage | ( | const float * | data,
|  | unsigned | width,
|  | unsigned | height,
|  | const std::string & | layer_id = `"half_angle_image"`,
|  | double | opacity = `1.0`
| ) |  |

Show a 2D image on screen representing half angle data.

Parameters

  [in] | data | the input data representing the image
  [in] | width | the width of the image
  [in] | height | the height of the image
  [in] | layer_id | the name of the layer (default: "image")
  [in] | opacity | the opacity of the layer (default: 1.0)

void pcl::visualization::ImageViewer::showMonoImage | ( | const unsigned char * | data,
|  | unsigned | width,
|  | unsigned | height,
|  | const std::string & | layer_id = `"mono_image"`,
|  | double | opacity = `1.0`
| ) |  |

Show a monochrome 2D image on screen.

Parameters

  [in] | data | the input data representing the image
  [in] | width | the width of the image
  [in] | height | the height of the image
  [in] | layer_id | the name of the layer (default: "image")
  [in] | opacity | the opacity of the layer (default: 1.0)

void pcl::visualization::ImageViewer::showMonoImage | ( | const pcl::PointCloud< pcl::Intensity >::ConstPtr & | cloud,
|  | const std::string & | layer_id = `"mono_image"`,
|  | double | opacity = `1.0`
| ) |  |

inline

Show a monochrome 2D image on screen.

Parameters

  [in] | cloud | the input data representing the grayscale point cloud
  [in] | layer_id | the name of the layer (default: "image")
  [in] | opacity | the opacity of the layer (default: 1.0)

Definition at line 170 of file image_viewer.h.

void pcl::visualization::ImageViewer::showMonoImage | ( | const pcl::PointCloud< pcl::Intensity > & | cloud,
|  | const std::string & | layer_id = `"mono_image"`,
|  | double | opacity = `1.0`
| ) |  |

Show a monochrome 2D image on screen.

Parameters

  [in] | cloud | the input data representing the grayscale point cloud
  [in] | layer_id | the name of the layer (default: "image")
  [in] | opacity | the opacity of the layer (default: 1.0)

void pcl::visualization::ImageViewer::showMonoImage | ( | const pcl::PointCloud< pcl::Intensity8u >::ConstPtr & | cloud,
|  | const std::string & | layer_id = `"mono_image"`,
|  | double | opacity = `1.0`
| ) |  |

inline

Show a monochrome 2D image on screen.

Parameters

  [in] | cloud | the input data representing the grayscale point cloud
  [in] | layer_id | the name of the layer (default: "image")
  [in] | opacity | the opacity of the layer (default: 1.0)

Definition at line 212 of file image_viewer.h.

void pcl::visualization::ImageViewer::showMonoImage | ( | const pcl::PointCloud< pcl::Intensity8u > & | cloud,
|  | const std::string & | layer_id = `"mono_image"`,
|  | double | opacity = `1.0`
| ) |  |

Show a monochrome 2D image on screen.

Parameters

  [in] | cloud | the input data representing the grayscale point cloud
  [in] | layer_id | the name of the layer (default: "image")
  [in] | opacity | the opacity of the layer (default: 1.0)

void pcl::visualization::ImageViewer::showRGBImage | ( | const unsigned char * | data,
|  | unsigned | width,
|  | unsigned | height,
|  | const std::string & | layer_id = `"rgb_image"`,
|  | double | opacity = `1.0`
| ) |  |

Show a 2D RGB image on screen.

Parameters

  [in] | data | the input data representing the image
  [in] | width | the width of the image
  [in] | height | the height of the image
  [in] | layer_id | the name of the layer (default: "image")
  [in] | opacity | the opacity of the layer (default: 1.0)

template<typename T >

void pcl::visualization::ImageViewer::showRGBImage | ( | const typename pcl::PointCloud< T >::ConstPtr & | cloud,
|  | const std::string & | layer_id = `"rgb_image"`,
|  | double | opacity = `1.0`
| ) |  |

inline

Show a 2D image on screen, obtained from the RGB channel of a point cloud.

Parameters

  [in] | cloud | the input data representing the RGB point cloud
  [in] | layer_id | the name of the layer (default: "image")
  [in] | opacity | the opacity of the layer (default: 1.0)

Definition at line 276 of file image_viewer.h.

template<typename T >

void pcl::visualization::ImageViewer::showRGBImage | ( | const pcl::PointCloud< T > & | cloud,
|  | const std::string & | layer_id = `"rgb_image"`,
|  | double | opacity = `1.0`
| ) |  |

Show a 2D image on screen, obtained from the RGB channel of a point cloud.

Parameters

  [in] | cloud | the input data representing the RGB point cloud
  [in] | layer_id | the name of the layer (default: "image")
  [in] | opacity | the opacity of the layer (default: 1.0)

Definition at line 87 of file image_viewer.hpp.

References render().

void pcl::visualization::ImageViewer::showShortImage | ( | const unsigned short * | short_image,
|  | unsigned int | width,
|  | unsigned int | height,
|  | unsigned short | min_value = `std::numeric_limits< unsigned short >::min()`,
|  | unsigned short | max_value = `std::numeric_limits< unsigned short >::max()`,
|  | bool | grayscale = `false`,
|  | const std::string & | layer_id = `"short_image"`,
|  | double | opacity = `1.0`
| ) |  |

Show a 2D image (unsigned short) on screen.

Parameters

  [in] | short_image | the input data representing the image in unsigned short format
  [in] | width | the width of the image
  [in] | height | the height of the image
  [in] | min_value | filter all values in the image to be larger than this minimum value
  [in] | max_value | filter all values in the image to be smaller than this maximum value
  [in] | grayscale | show data as grayscale (true) or not (false). Default: false
  [in] | layer_id | the name of the layer (default: "image")
  [in] | opacity | the opacity of the layer (default: 1.0)

void pcl::visualization::ImageViewer::spin | ( |  | ) |

Spin method.

Calls the interactor and runs an internal loop.

void pcl::visualization::ImageViewer::spinOnce | ( | int | time = `1`,
|  | bool | force_redraw = `true`
| ) |  |

Spin once method.

Calls the interactor and updates the screen once.

Parameters

  [in] | time | - How long (in ms) should the visualization loop be allowed to run.
  [in] | force_redraw | - if false it might return without doing anything if the interactor's framerate does not require a redraw yet.

bool pcl::visualization::ImageViewer::wasStopped | ( |  | ) | const

inline

Returns true when the user tried to close the window.

Definition at line 559 of file image_viewer.h.

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

- /build/pcl-6_P28C/pcl-1.7.2/visualization/include/pcl/visualization/image_viewer.h
- /build/pcl-6_P28C/pcl-1.7.2/visualization/include/pcl/visualization/impl/image_viewer.hpp