ImageViewer is a class for 2D image visualization. More...
#include <image_viewer.h>
Classes | |
struct | ExitCallback |
struct | ExitMainLoopTimerCallback |
struct | Layer |
Internal structure describing a layer. More... | |
struct | LayerComparator |
Public Member Functions | |
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). | |
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. | |
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. | |
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. | |
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. | |
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). | |
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). | |
bool | addLayer (const std::string &layer_id, int width, int height, double opacity=0.5) |
Add a new 2D rendering layer to the viewer. | |
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. | |
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. | |
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. | |
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) | |
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). | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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). | |
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). | |
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). | |
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). | |
ImageViewer (const std::string &window_title="") | |
Constructor. | |
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. | |
boost::signals2::connection | registerKeyboardCallback (void(*callback)(const pcl::visualization::KeyboardEvent &, void *), void *cookie=NULL) |
Register a callback function for keyboard events. | |
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. | |
boost::signals2::connection | registerKeyboardCallback (boost::function< void(const pcl::visualization::KeyboardEvent &)> cb) |
Register a callback boost::function for keyboard events. | |
boost::signals2::connection | registerMouseCallback (void(*callback)(const pcl::visualization::MouseEvent &, void *), void *cookie=NULL) |
Register a callback boost::function for mouse events. | |
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. | |
boost::signals2::connection | registerMouseCallback (boost::function< void(const pcl::visualization::MouseEvent &)> cb) |
Register a callback function for mouse events. | |
void | removeLayer (const std::string &layer_id) |
Remove a 2D layer given by its ID. | |
void | setPosition (int x, int y) |
Set the position in screen coordinates. | |
void | setSize (int xw, int yw) |
Set the window size in screen coordinates. | |
void | setWindowTitle (const std::string &name) |
Set the window title name. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
void | spin () |
Spin method. Calls the interactor and runs an internal loop. | |
void | spinOnce (int time=1, bool force_redraw=true) |
Spin once method. Calls the interactor and updates the screen once. | |
bool | wasStopped () const |
Returns true when the user tried to close the window. | |
virtual | ~ImageViewer () |
Destructor. | |
Protected Member Functions | |
void | emitKeyboardEvent (unsigned long event_id) |
Fire up a keyboard event with a specified event ID. | |
void | emitMouseEvent (unsigned long event_id) |
Fire up a mouse event with a specified event ID. | |
void | resetStoppedFlag () |
Set the stopped flag back to false. | |
Static Protected Member Functions | |
static void | KeyboardCallback (vtkObject *, unsigned long eid, void *clientdata, void *calldata) |
static void | MouseCallback (vtkObject *, unsigned long eid, void *clientdata, void *calldata) |
Private Types | |
typedef std::vector< Layer > | LayerMap |
Private Member Functions | |
LayerMap::iterator | createLayer (const std::string &layer_id, int width, int height, double opacity=0.5, bool fill_box=true) |
Add a new 2D rendering layer to the viewer. | |
Private Attributes | |
vtkSmartPointer< vtkImageBlend > | blend_ |
Internal blender used to overlay 2D geometry over the image. | |
boost::shared_array< unsigned char > | data_ |
The data array representing the image. Used internally. | |
size_t | data_size_ |
The data array (representing the image) size. Used internally. | |
vtkSmartPointer< ExitCallback > | exit_callback_ |
vtkSmartPointer < ExitMainLoopTimerCallback > | exit_main_loop_timer_callback_ |
Callback object enabling us to leave the main loop, when a timer fires. | |
vtkSmartPointer< vtkImageViewer > | image_viewer_ |
The ImageViewer widget. | |
vtkSmartPointer < vtkRenderWindowInteractor > | interactor_ |
vtkSmartPointer < vtkCallbackCommand > | keyboard_command_ |
boost::signals2::signal< void(const pcl::visualization::KeyboardEvent &)> | keyboard_signal_ |
LayerMap | layer_map_ |
Internal list with different 2D layers shapes. | |
vtkSmartPointer < vtkCallbackCommand > | mouse_command_ |
boost::signals2::signal< void(const pcl::visualization::MouseEvent &)> | mouse_signal_ |
bool | stopped_ |
Set to false if the interaction loop is running. | |
int | timer_id_ |
Global timer ID. Used in destructor only. |
ImageViewer is a class for 2D image visualization.
Features include:
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
Definition at line 80 of file image_viewer.h.
typedef std::vector<Layer> pcl::visualization::ImageViewer::LayerMap [private] |
Definition at line 733 of file image_viewer.h.
pcl::visualization::ImageViewer::ImageViewer | ( | const std::string & | window_title = "" | ) |
Constructor.
[in] | window_title | the title of the window |
Definition at line 46 of file image_viewer.cpp.
pcl::visualization::ImageViewer::~ImageViewer | ( | ) | [virtual] |
Destructor.
Definition at line 92 of file image_viewer.cpp.
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).
[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) |
Definition at line 263 of file image_viewer.cpp.
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.
[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) |
Definition at line 604 of file image_viewer.cpp.
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.
[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) |
Definition at line 582 of file image_viewer.cpp.
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.
[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) |
Definition at line 644 of file image_viewer.cpp.
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.
[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) |
Definition at line 622 of file image_viewer.cpp.
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).
[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) |
Definition at line 239 of file image_viewer.cpp.
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).
[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) |
Definition at line 284 of file image_viewer.cpp.
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.
[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) |
Definition at line 526 of file image_viewer.cpp.
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.
[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) |
Definition at line 775 of file image_viewer.cpp.
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.
[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) |
Definition at line 755 of file image_viewer.cpp.
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.
[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 98 of file image_viewer.hpp.
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)
[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 135 of file image_viewer.hpp.
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).
[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) |
Definition at line 169 of file image_viewer.cpp.
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.
[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 171 of file image_viewer.hpp.
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.
[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 217 of file image_viewer.hpp.
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.
[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 732 of file image_viewer.cpp.
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.
[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 709 of file image_viewer.cpp.
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.
[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) |
Definition at line 686 of file image_viewer.cpp.
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.
[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) |
Definition at line 663 of file image_viewer.cpp.
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.
[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 330 of file image_viewer.hpp.
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.
[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 261 of file image_viewer.hpp.
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.
[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 397 of file image_viewer.hpp.
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.
[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 448 of file image_viewer.hpp.
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).
[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) |
Definition at line 99 of file image_viewer.cpp.
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).
[in] | data | 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 153 of file image_viewer.h.
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).
[in] | data | 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) |
Convert from BGR to RGB
Definition at line 72 of file image_viewer.hpp.
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).
[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) |
Definition at line 305 of file image_viewer.cpp.
pcl::visualization::ImageViewer::LayerMap::iterator pcl::visualization::ImageViewer::createLayer | ( | const std::string & | layer_id, |
int | width, | ||
int | height, | ||
double | opacity = 0.5 , |
||
bool | fill_box = true |
||
) | [private] |
Add a new 2D rendering layer to the viewer.
[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) |
[in] | fill_box | set to true to fill in the image with one black box before starting |
Definition at line 497 of file image_viewer.cpp.
void pcl::visualization::ImageViewer::emitKeyboardEvent | ( | unsigned long | event_id | ) | [protected] |
Fire up a keyboard event with a specified event ID.
int] | event_id the id of the event |
Definition at line 473 of file image_viewer.cpp.
void pcl::visualization::ImageViewer::emitMouseEvent | ( | unsigned long | event_id | ) | [protected] |
Fire up a mouse event with a specified event ID.
int] | event_id the id of the event |
Definition at line 396 of file image_viewer.cpp.
void pcl::visualization::ImageViewer::KeyboardCallback | ( | vtkObject * | , |
unsigned long | eid, | ||
void * | clientdata, | ||
void * | calldata | ||
) | [static, protected] |
Definition at line 489 of file image_viewer.cpp.
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.
[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) |
Definition at line 796 of file image_viewer.cpp.
void pcl::visualization::ImageViewer::MouseCallback | ( | vtkObject * | , |
unsigned long | eid, | ||
void * | clientdata, | ||
void * | calldata | ||
) | [static, protected] |
Definition at line 481 of file image_viewer.cpp.
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.
[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 |
Definition at line 325 of file image_viewer.h.
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.
[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 |
Definition at line 338 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.
[in] | cb | the boost function that will be registered as a callback for a keyboard event |
Definition at line 381 of file image_viewer.cpp.
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.
[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 |
Definition at line 357 of file image_viewer.h.
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.
[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 |
Definition at line 370 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.
[in] | cb | the boost function that will be registered as a callback for a mouse event |
Definition at line 360 of file image_viewer.cpp.
void pcl::visualization::ImageViewer::removeLayer | ( | const std::string & | layer_id | ) |
Remove a 2D layer given by its ID.
[in] | layer_id | the name of the layer |
Definition at line 556 of file image_viewer.cpp.
void pcl::visualization::ImageViewer::resetStoppedFlag | ( | ) | [inline, protected] |
Set the stopped flag back to false.
Definition at line 661 of file image_viewer.h.
void pcl::visualization::ImageViewer::setPosition | ( | int | x, |
int | y | ||
) | [inline] |
Set the position in screen coordinates.
[in] | x | where to move the window to (X) |
[in] | y | where to move the window to (Y) |
Definition at line 388 of file image_viewer.h.
void pcl::visualization::ImageViewer::setSize | ( | int | xw, |
int | yw | ||
) | [inline] |
Set the window size in screen coordinates.
[in] | xw | window size in horizontal (pixels) |
[in] | yw | window size in vertical (pixels) |
Definition at line 398 of file image_viewer.h.
void pcl::visualization::ImageViewer::setWindowTitle | ( | const std::string & | name | ) | [inline] |
Set the window title name.
[in] | name | the window title |
Definition at line 302 of file image_viewer.h.
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.
[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) |
Definition at line 274 of file image_viewer.cpp.
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.
[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) |
Definition at line 252 of file image_viewer.cpp.
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.
[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) |
Definition at line 295 of file image_viewer.cpp.
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.
[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) |
Definition at line 229 of file image_viewer.cpp.
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.
[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) |
Definition at line 159 of file image_viewer.cpp.
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.
[in] | data | 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 141 of file image_viewer.h.
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.
[in] | data | 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) |
Convert from BGR to RGB
Definition at line 46 of file image_viewer.hpp.
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.
[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) |
Definition at line 318 of file image_viewer.cpp.
Spin method. Calls the interactor and runs an internal loop.
Definition at line 329 of file image_viewer.cpp.
void pcl::visualization::ImageViewer::spinOnce | ( | int | time = 1 , |
bool | force_redraw = true |
||
) |
Spin once method. Calls the interactor and updates the screen once.
[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. |
Definition at line 340 of file image_viewer.cpp.
bool pcl::visualization::ImageViewer::wasStopped | ( | ) | const [inline] |
Returns true when the user tried to close the window.
Definition at line 405 of file image_viewer.h.
vtkSmartPointer<vtkImageBlend> pcl::visualization::ImageViewer::blend_ [private] |
Internal blender used to overlay 2D geometry over the image.
Definition at line 772 of file image_viewer.h.
boost::shared_array<unsigned char> pcl::visualization::ImageViewer::data_ [private] |
The data array representing the image. Used internally.
Definition at line 760 of file image_viewer.h.
size_t pcl::visualization::ImageViewer::data_size_ [private] |
The data array (representing the image) size. Used internally.
Definition at line 763 of file image_viewer.h.
vtkSmartPointer<ExitCallback> pcl::visualization::ImageViewer::exit_callback_ [private] |
Definition at line 754 of file image_viewer.h.
vtkSmartPointer<ExitMainLoopTimerCallback> pcl::visualization::ImageViewer::exit_main_loop_timer_callback_ [private] |
Callback object enabling us to leave the main loop, when a timer fires.
Definition at line 753 of file image_viewer.h.
vtkSmartPointer<vtkImageViewer> pcl::visualization::ImageViewer::image_viewer_ [private] |
The ImageViewer widget.
Definition at line 757 of file image_viewer.h.
vtkSmartPointer<vtkRenderWindowInteractor> pcl::visualization::ImageViewer::interactor_ [private] |
Definition at line 748 of file image_viewer.h.
vtkSmartPointer<vtkCallbackCommand> pcl::visualization::ImageViewer::keyboard_command_ [private] |
Definition at line 750 of file image_viewer.h.
boost::signals2::signal<void (const pcl::visualization::KeyboardEvent&)> pcl::visualization::ImageViewer::keyboard_signal_ [private] |
Definition at line 746 of file image_viewer.h.
Internal list with different 2D layers shapes.
Definition at line 775 of file image_viewer.h.
vtkSmartPointer<vtkCallbackCommand> pcl::visualization::ImageViewer::mouse_command_ [private] |
Definition at line 749 of file image_viewer.h.
boost::signals2::signal<void (const pcl::visualization::MouseEvent&)> pcl::visualization::ImageViewer::mouse_signal_ [private] |
Definition at line 745 of file image_viewer.h.
bool pcl::visualization::ImageViewer::stopped_ [private] |
Set to false if the interaction loop is running.
Definition at line 766 of file image_viewer.h.
int pcl::visualization::ImageViewer::timer_id_ [private] |
Global timer ID. Used in destructor only.
Definition at line 769 of file image_viewer.h.