PclViewer

class PclViewer(self: visp._visp.gui.PclViewer, title: str, width: int = 640, height: int = 480, posU: int = 720, posV: int = 560, outFolder: str = std::string(), ignoreThreshold: float = 0.95)

Bases: pybind11_object

This class enables real time plotting of 3D point clouds. It relies on the PCL library. To see how to install PCL library, please refer to the soft_tool_pcl section. You can either plot in a non-blocking threaded manner or in a blocking manner. The point clouds can be displayed using their original colors, or using uniform colors to match a legend. Additionally, it is possible to use confidence weights to hide points that are not trusted. These weights can result from a robust estimation using for instance the vpRobust class.

Warning

If you face some runtime errors with the following class, please refer to the pcl_viewer_known_issues section to see if it is a known problem.

Note

See tutorial-pcl-viewer

Construct a new vpPclViewer object.

Parameters:
title

The title of the window of the viewer.

width

The width of the window of the viewer.

height

The height of the window of the viewer.

posU

The position on the horizontal axis of the screen of the window of the viewer.

posV

The position on the vertical axis of the screen of the window of the viewer.

outFolder

If different from the empty string, the point clouds will be saved in this folder.

ignoreThreshold

A point for which the weight is below this threshold will be displayed in black.

Methods

__init__

Construct a new vpPclViewer object.

addSurface

Overloaded function.

display

Blocking-mode display of the viewer.

launchThread

Start the drawing thread that permits to have a non-blocking display.

refresh

Refresh the display.

setIgnoreThreshold

Set the threshold below which a point must be displayed in black.

setNameWindow

Set the name of the PCL viewer window.

setOutFolder

Set the path to the output folder.

stopThread

Stop the drawing thread that permits to have a non-blocking display.

updateSurface

Overloaded function.

Inherited Methods

Operators

__doc__

__init__

Construct a new vpPclViewer object.

__module__

Attributes

__annotations__

__init__(self: visp._visp.gui.PclViewer, title: str, width: int = 640, height: int = 480, posU: int = 720, posV: int = 560, outFolder: str = std::string(), ignoreThreshold: float = 0.95)

Construct a new vpPclViewer object.

Parameters:
title

The title of the window of the viewer.

width

The width of the window of the viewer.

height

The height of the window of the viewer.

posU

The position on the horizontal axis of the screen of the window of the viewer.

posV

The position on the vertical axis of the screen of the window of the viewer.

outFolder

If different from the empty string, the point clouds will be saved in this folder.

ignoreThreshold

A point for which the weight is below this threshold will be displayed in black.

addSurface(*args, **kwargs)

Overloaded function.

  1. addSurface(self: visp._visp.gui.PclViewer, surface: pcl::PointCloud<pcl::PointXYZRGB>, name: str = , v_color: list[int] = []) -> int

Add a surface to the list of point clouds known by the viewer.

Parameters:
surface

The surface that must be knwon to be displayed by the PCL viewer.

name

The name of the surface that will be displayed in the legend. If empty, it will be automatically generated.

v_color

A vector containing the 3 RGB values.

Returns:

unsigned int The ID by which is known the point cloud by the viewer.

  1. addSurface(self: visp._visp.gui.PclViewer, surface: pcl::PointCloud<pcl::PointXYZRGB>, weights: visp._visp.core.ColVector, name: str = , v_color: list[int] = []) -> int

Add a surface to the list of point clouds known by the viewer. The points whose weights are below the ** vpPclViewer::s_ignoreThresh ** wil be displayed in black.

Parameters:
surface

The surface that must be knwon to be displayed by the PCL viewer.

weights

The confidence weights of each points. Must be between 0 and 1.

name

The name of the surface that will be displayed in the legend. If empty, it will be automatically generated.

v_color

A vector containing the 3 RGB values.

Returns:

unsigned int The ID by which is known the point cloud by the viewer.

display(self) None

Blocking-mode display of the viewer.

launchThread(self) None

Start the drawing thread that permits to have a non-blocking display.

refresh(self, timeout: int = 100, waitForDrawing: bool = true) None

Refresh the display.

Parameters:
timeout: int = 100

Duration allowed for the drawing.

waitForDrawing: bool = true

If true, will wait until the drawing is done. Otherwise, might return without doing nothing.

setIgnoreThreshold(self, thresh: float) None

Set the threshold below which a point must be displayed in black.

Parameters:
thresh: float

The threshold below which a point must be displayed in black.

setNameWindow(self, nameWindow: str) None

Set the name of the PCL viewer window.

Parameters:
nameWindow: str

The name of the PCL viewer window.

setOutFolder(self, outputFolder: str) None

Set the path to the output folder. If different from the empty string, the point clouds will be saved in this folder.

Parameters:
outputFolder: str

The path towards to the output folder, or empty if the point clouds must not be saved.

stopThread(self) None

Stop the drawing thread that permits to have a non-blocking display.

updateSurface(*args, **kwargs)

Overloaded function.

  1. updateSurface(self: visp._visp.gui.PclViewer, surface: pcl::PointCloud<pcl::PointXYZRGB>, id: int, hasToKeepColor: bool = false) -> None

Update the surface known by id by the viewer.

Parameters:
surface

The updated surface.

id

The ID of the surface that must be updated.

hasToKeepColor

If true, will be displayed in its original color. Otherwise, will be displayed in its default color.

  1. updateSurface(self: visp._visp.gui.PclViewer, surface: pcl::PointCloud<pcl::PointXYZRGB>, id: int, weights: visp._visp.core.ColVector, hasToKeepColor: bool = false) -> None

Update the surface known by id by the viewer.

Parameters:
surface

The updated surface.

id

The ID of the surface that must be updated.

weights

The confidence weights of each points.

hasToKeepColor

If true, will be displayed in its original color. Otherwise, will be displayed in its default color.