OpenCV  3.2.0-dev
Open Source Computer Vision
cv::viz::WCameraPosition Class Reference

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

#include "widgets.hpp"

Inheritance diagram for cv::viz::WCameraPosition:
Collaboration diagram for cv::viz::WCameraPosition:

Public Member Functions

 WCameraPosition (double scale=1.0)
 Creates camera coordinate frame at the origin. More...
 
 WCameraPosition (const Matx33d &K, double scale=1.0, const Color &color=Color::white())
 Display the viewing frustum. More...
 
 WCameraPosition (const Vec2d &fov, double scale=1.0, const Color &color=Color::white())
 Display the viewing frustum. More...
 
 WCameraPosition (const Matx33d &K, InputArray image, double scale=1.0, const Color &color=Color::white())
 Display image on the far plane of the viewing frustum. More...
 
 WCameraPosition (const Vec2d &fov, InputArray image, double scale=1.0, const Color &color=Color::white())
 Display image on the far plane of the viewing frustum. More...
 
void applyTransform (const Affine3d &transform)
 Transforms internal widget data (i.e. More...
 
template<typename _W >
_W cast ()
 Casts a widget to another. More...
 
template<>
Widget2D cast ()
 Utility exports. More...
 
template<>
Widget3D cast ()
 
template<>
WLine cast ()
 
template<>
WPlane cast ()
 
template<>
WSphere cast ()
 
template<>
WCylinder cast ()
 
template<>
WArrow cast ()
 
template<>
WCircle cast ()
 
template<>
WCone cast ()
 
template<>
WCube cast ()
 
template<>
WCoordinateSystem cast ()
 
template<>
WPolyLine cast ()
 
template<>
WGrid cast ()
 
template<>
WText3D cast ()
 
template<>
WText cast ()
 
template<>
WImageOverlay cast ()
 
template<>
WImage3D cast ()
 
template<>
WCameraPosition cast ()
 
template<>
WTrajectory cast ()
 
template<>
WTrajectoryFrustums cast ()
 
template<>
WTrajectorySpheres cast ()
 
template<>
WCloud cast ()
 
template<>
WPaintedCloud cast ()
 
template<>
WCloudCollection cast ()
 
template<>
WCloudNormals cast ()
 
template<>
WMesh cast ()
 
template<>
WWidgetMerger cast ()
 
Affine3d getPose () const
 Returns the current pose of the widget. More...
 
double getRenderingProperty (int property) const
 Returns rendering property of the widget. More...
 
void setColor (const Color &color)
 Sets the color of the widget. More...
 
void setPose (const Affine3d &pose)
 Sets pose of the widget. More...
 
void setRenderingProperty (int property, double value)
 Sets rendering property of the widget. More...
 
void updatePose (const Affine3d &pose)
 Updates pose of the widget by pre-multiplying its current pose. More...
 

Static Public Member Functions

static Widget fromPlyFile (const String &file_name)
 Creates a widget from ply file. More...
 

Detailed Description

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

:

Constructor & Destructor Documentation

cv::viz::WCameraPosition::WCameraPosition ( double  scale = 1.0)

Creates camera coordinate frame at the origin.

cpw1.png
Camera coordinate frame
cv::viz::WCameraPosition::WCameraPosition ( const Matx33d K,
double  scale = 1.0,
const Color color = Color::white() 
)

Display the viewing frustum.

Parameters
KIntrinsic matrix of the camera.
scaleScale of the frustum.
colorColor of the frustum.

Creates viewing frustum of the camera based on its intrinsic matrix K.

cpw2.png
Camera viewing frustum
cv::viz::WCameraPosition::WCameraPosition ( const Vec2d fov,
double  scale = 1.0,
const Color color = Color::white() 
)

Display the viewing frustum.

Parameters
fovField of view of the camera (horizontal, vertical).
scaleScale of the frustum.
colorColor of the frustum.

Creates viewing frustum of the camera based on its field of view fov.

cpw2.png
Camera viewing frustum
cv::viz::WCameraPosition::WCameraPosition ( const Matx33d K,
InputArray  image,
double  scale = 1.0,
const Color color = Color::white() 
)

Display image on the far plane of the viewing frustum.

Parameters
KIntrinsic matrix of the camera.
imageBGR or Gray-Scale image that is going to be displayed on the far plane of the frustum.
scaleScale of the frustum and image.
colorColor of the frustum.

Creates viewing frustum of the camera based on its intrinsic matrix K, and displays image on the far end plane.

cpw3.png
Camera viewing frustum with image
cv::viz::WCameraPosition::WCameraPosition ( const Vec2d fov,
InputArray  image,
double  scale = 1.0,
const Color color = Color::white() 
)

Display image on the far plane of the viewing frustum.

Parameters
fovField of view of the camera (horizontal, vertical).
imageBGR or Gray-Scale image that is going to be displayed on the far plane of the frustum.
scaleScale of the frustum and image.
colorColor of the frustum.

Creates viewing frustum of the camera based on its intrinsic matrix K, and displays image on the far end plane.

cpw3.png
Camera viewing frustum with image

Member Function Documentation

void cv::viz::Widget3D::applyTransform ( const Affine3d transform)
inherited

Transforms internal widget data (i.e.

points, normals) using the given transform.

Parameters
transformSpecified transformation to apply.
template<typename _W >
_W cv::viz::Widget::cast ( )
inherited

Casts a widget to another.

// Create a sphere widget
viz::WSphere sw(Point3f(0.0f,0.0f,0.0f), 0.5f);
// Cast sphere widget to cloud widget
viz::WCloud cw = sw.cast<viz::WCloud>();
Note
3D Widgets can only be cast to 3D Widgets. 2D Widgets can only be cast to 2D Widgets.
template<>
Widget3D cv::viz::Widget::cast ( )
inherited
template<>
WLine cv::viz::Widget::cast ( )
inherited
template<>
WPlane cv::viz::Widget::cast ( )
inherited
template<>
WSphere cv::viz::Widget::cast ( )
inherited
template<>
WCylinder cv::viz::Widget::cast ( )
inherited
template<>
WArrow cv::viz::Widget::cast ( )
inherited
template<>
WCircle cv::viz::Widget::cast ( )
inherited
template<>
WCone cv::viz::Widget::cast ( )
inherited
template<>
WCube cv::viz::Widget::cast ( )
inherited
template<>
WCoordinateSystem cv::viz::Widget::cast ( )
inherited
template<>
WPolyLine cv::viz::Widget::cast ( )
inherited
template<>
WGrid cv::viz::Widget::cast ( )
inherited
template<>
WText3D cv::viz::Widget::cast ( )
inherited
template<>
WText cv::viz::Widget::cast ( )
inherited
template<>
WImageOverlay cv::viz::Widget::cast ( )
inherited
template<>
WImage3D cv::viz::Widget::cast ( )
inherited
template<>
WCameraPosition cv::viz::Widget::cast ( )
inherited
template<>
WTrajectory cv::viz::Widget::cast ( )
inherited
template<>
WTrajectoryFrustums cv::viz::Widget::cast ( )
inherited
template<>
WTrajectorySpheres cv::viz::Widget::cast ( )
inherited
template<>
WCloud cv::viz::Widget::cast ( )
inherited
template<>
WPaintedCloud cv::viz::Widget::cast ( )
inherited
template<>
WCloudCollection cv::viz::Widget::cast ( )
inherited
template<>
WCloudNormals cv::viz::Widget::cast ( )
inherited
template<>
WMesh cv::viz::Widget::cast ( )
inherited
template<>
WWidgetMerger cv::viz::Widget::cast ( )
inherited
static Widget cv::viz::Widget::fromPlyFile ( const String file_name)
staticinherited

Creates a widget from ply file.

Parameters
file_namePly file name.
Affine3d cv::viz::Widget3D::getPose ( ) const
inherited

Returns the current pose of the widget.

double cv::viz::Widget::getRenderingProperty ( int  property) const
inherited

Returns rendering property of the widget.

Parameters
propertyProperty.

Rendering property** can be one of the following:

  • POINT_SIZE
  • OPACITY
  • LINE_WIDTH
  • FONT_SIZE
  • AMBIENT
  • REPRESENTATION**: Expected values are : - REPRESENTATION_POINTS
  • REPRESENTATION_WIREFRAME
  • REPRESENTATION_SURFACE
  • IMMEDIATE_RENDERING**: : - Turn on immediate rendering by setting the value to 1.
  • Turn off immediate rendering by setting the value to 0.
  • SHADING**: Expected values are : - SHADING_FLAT
  • SHADING_GOURAUD
  • SHADING_PHONG
void cv::viz::Widget3D::setColor ( const Color color)
inherited

Sets the color of the widget.

Parameters
colorcolor of type Color
void cv::viz::Widget3D::setPose ( const Affine3d pose)
inherited

Sets pose of the widget.

Parameters
poseThe new pose of the widget.
void cv::viz::Widget::setRenderingProperty ( int  property,
double  value 
)
inherited

Sets rendering property of the widget.

Parameters
propertyProperty that will be modified.
valueThe new value of the property.

Rendering property** can be one of the following:

  • POINT_SIZE
  • OPACITY
  • LINE_WIDTH
  • FONT_SIZE
  • REPRESENTATION**: Expected values are
  • REPRESENTATION_POINTS
  • REPRESENTATION_WIREFRAME
  • REPRESENTATION_SURFACE
  • IMMEDIATE_RENDERING**:
  • Turn on immediate rendering by setting the value to 1.
  • Turn off immediate rendering by setting the value to 0.
  • SHADING**: Expected values are
  • SHADING_FLAT
  • SHADING_GOURAUD
  • SHADING_PHONG
void cv::viz::Widget3D::updatePose ( const Affine3d pose)
inherited

Updates pose of the widget by pre-multiplying its current pose.

Parameters
poseThe pose that the current pose of the widget will be pre-multiplied by.

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