Widget#

Detailed Description#

In this section, the widget framework is explained. Widgets represent 2D or 3D objects, varying from simple ones such as lines to complex ones such as point clouds and meshes.

Widgets are implicitly shared. Therefore, one can add a widget to the scene, and modify the widget without re-adding the widget.

// Create a cloud widget
viz::WCloud cw(cloud, viz::Color::red());
// Display it in a window
myWindow.showWidget("CloudWidget1", cw);
// Modify it, and it will be modified in the window.
cw.setColor(viz::Color::yellow());

Classes#

Name

Description

class cv::viz::WArrow

This 3D Widget defines an arrow. View details

class cv::viz::WCameraPosition

This 3D Widget represents camera position in a scene by its axes or viewing frustum. : View details

class cv::viz::WCircle

This 3D Widget defines a circle. View details

class cv::viz::WCloud

Clouds. View details

class cv::viz::WCloudCollection

This 3D Widget defines a collection of clouds. : View details

class cv::viz::WCloudNormals

This 3D Widget represents normals of a point cloud. : View details

class cv::viz::WCone

This 3D Widget defines a cone. : View details

class cv::viz::WCoordinateSystem

Compound widgets. View details

class cv::viz::WCube

This 3D Widget defines a cube. View details

class cv::viz::WCylinder

This 3D Widget defines a cylinder. : View details

class cv::viz::WGrid

This 3D Widget defines a grid. : View details

class cv::viz::Widget

Base class of all widgets. Widget is implicitly shared. View details

class cv::viz::Widget2D

Base class of all 2D widgets. View details

class cv::viz::Widget3D

Base class of all 3D widgets. View details

struct cv::viz::WidgetAccessor

This class is for users who want to develop their own widgets using VTK library API. : View details

class cv::viz::WImage3D

This 3D Widget represents an image in 3D space. : View details

class cv::viz::WImageOverlay

This 2D Widget represents an image overlay. : View details

class cv::viz::WLine

Simple widgets. View details

class cv::viz::WMesh

Constructs a WMesh. View details

class cv::viz::WPaintedCloud

View details

class cv::viz::WPlane

This 3D Widget defines a finite plane. View details

class cv::viz::WPolyLine

This 3D Widget defines a poly line. : View details

class cv::viz::WSphere

This 3D Widget defines a sphere. : View details

class cv::viz::WText

Text and image widgets. View details

class cv::viz::WText3D

This 3D Widget represents 3D text. The text always faces the camera. View details

class cv::viz::WTrajectory

Trajectories. View details

class cv::viz::WTrajectoryFrustums

This 3D Widget represents a trajectory. : View details

class cv::viz::WTrajectorySpheres

This 3D Widget represents a trajectory using spheres and lines. View details

class cv::viz::WWidgetMerger

This class allows to merge several widgets to single one. View details

Enumerations#

Widget rendering properties. View details

View details

View details

Functions#

Return

Name

Description

Widget2D

cv::cast()

Utility exports.

Enumeration Type Documentation#

RenderingProperties#

enum cv::viz::RenderingProperties

#include <opencv2/viz/widgets.hpp>

Widget rendering properties.

Enumerator:

POINT_SIZE
Python: cv.viz.POINT_SIZE

OPACITY
Python: cv.viz.OPACITY

LINE_WIDTH
Python: cv.viz.LINE_WIDTH

FONT_SIZE
Python: cv.viz.FONT_SIZE

REPRESENTATION
Python: cv.viz.REPRESENTATION

IMMEDIATE_RENDERING
Python: cv.viz.IMMEDIATE_RENDERING

SHADING
Python: cv.viz.SHADING

AMBIENT
Python: cv.viz.AMBIENT

LIGHTING
Python: cv.viz.LIGHTING

RepresentationValues#

enum cv::viz::RepresentationValues

#include <opencv2/viz/widgets.hpp>

Enumerator:

REPRESENTATION_POINTS
Python: cv.viz.REPRESENTATION_POINTS

REPRESENTATION_WIREFRAME
Python: cv.viz.REPRESENTATION_WIREFRAME

REPRESENTATION_SURFACE
Python: cv.viz.REPRESENTATION_SURFACE

ShadingValues#

enum cv::viz::ShadingValues

#include <opencv2/viz/widgets.hpp>

Enumerator:

SHADING_FLAT
Python: cv.viz.SHADING_FLAT

SHADING_GOURAUD
Python: cv.viz.SHADING_GOURAUD

SHADING_PHONG
Python: cv.viz.SHADING_PHONG