OpenCV  4.9.0
Open Source Computer Vision
Public Member Functions | List of all members
cv::ovis::WindowScene Class Referenceabstract

#include <opencv2/ovis.hpp>

Public Member Functions

virtual ~WindowScene ()
 
virtual Rect2d createCameraEntity (const String &name, InputArray K, const Size &imsize, float zFar, InputArray tvec=noArray(), InputArray rot=noArray(), const Scalar &color=Scalar::all(1))=0
 
virtual void createEntity (const String &name, const String &meshname, InputArray tvec=noArray(), InputArray rot=noArray())=0
 
virtual void createLightEntity (const String &name, InputArray tvec=noArray(), InputArray rot=noArray(), const Scalar &diffuseColor=Scalar::all(1), const Scalar &specularColor=Scalar::all(1))=0
 
virtual void fixCameraYawAxis (bool useFixed, InputArray up=noArray())=0
 
virtual void getCameraPose (OutputArray R=noArray(), OutputArray tvec=noArray(), bool invert=false)=0
 
virtual void getCompositorTexture (const String &compname, const String &texname, OutputArray out, int mrtIndex=0)=0
 
virtual void getDepth (OutputArray depth)=0
 
virtual void getEntityAnimations (const String &name, std::vector< String > &out)=0
 
virtual void getEntityPose (const String &name, OutputArray R=noArray(), OutputArray tvec=noArray(), bool invert=false)=0
 
virtual void getEntityProperty (const String &name, int prop, OutputArray value)=0
 
virtual void getScreenshot (OutputArray frame)=0
 
virtual void playEntityAnimation (const String &name, const String &animname, bool loop=true)=0
 
virtual void removeEntity (const String &name)=0
 
virtual void setBackground (InputArray image)=0
 
virtual void setBackground (const Scalar &color)=0
 
virtual void setCameraIntrinsics (InputArray K, const Size &imsize, float zNear=-1, float zFar=-1)=0
 
virtual void setCameraLookAt (const String &target, InputArray offset=noArray())=0
 
virtual void setCameraPose (InputArray tvec=noArray(), InputArray rot=noArray(), bool invert=false)=0
 
virtual void setCompositors (const std::vector< String > &names)=0
 
virtual void setEntityLookAt (const String &origin, const String &target, InputArray offset=noArray())=0
 
virtual void setEntityPose (const String &name, InputArray tvec=noArray(), InputArray rot=noArray(), bool invert=false)=0
 
virtual void setEntityProperty (const String &name, int prop, const String &value, int subEntityIdx=-1)=0
 
virtual void setEntityProperty (const String &name, int prop, const Scalar &value)=0
 
virtual void stopEntityAnimation (const String &name, const String &animname)=0
 
virtual void update ()=0
 
virtual void updateEntityPose (const String &name, InputArray tvec=noArray(), InputArray rot=noArray())=0
 

Detailed Description

A 3D viewport and the associated scene

Constructor & Destructor Documentation

◆ ~WindowScene()

virtual cv::ovis::WindowScene::~WindowScene ( )
virtual

Member Function Documentation

◆ createCameraEntity()

virtual Rect2d cv::ovis::WindowScene::createCameraEntity ( const String name,
InputArray  K,
const Size imsize,
float  zFar,
InputArray  tvec = noArray(),
InputArray  rot = noArray(),
const Scalar color = Scalar::all(1) 
)
pure virtual

convenience method to visualize a camera position

Parameters
nameentity name
Kintrinsic matrix
imsizeimage size
zFarfar plane in camera coordinates
tvectranslation
rotRodrigues vector or 3x3 rotation matrix
colorline color
Returns
the extents of the Frustum at far plane, where the top left corner denotes the principal point offset

◆ createEntity()

virtual void cv::ovis::WindowScene::createEntity ( const String name,
const String meshname,
InputArray  tvec = noArray(),
InputArray  rot = noArray() 
)
pure virtual

place an entity of a mesh in the scene

the mesh needs to be created beforehand. Either programmatically by e.g. createPointCloudMesh or by placing the respective file in a resource location.

Parameters
nameentity name
meshnamemesh name
tvectranslation
rotRodrigues vector or 3x3 rotation matrix
See also
addResourceLocation

◆ createLightEntity()

virtual void cv::ovis::WindowScene::createLightEntity ( const String name,
InputArray  tvec = noArray(),
InputArray  rot = noArray(),
const Scalar diffuseColor = Scalar::all(1),
const Scalar specularColor = Scalar::all(1) 
)
pure virtual

creates a point light in the scene

Parameters
nameentity name
tvectranslation
rotRodrigues vector or 3x3 rotation matrix
diffuseColor
specularColor

◆ fixCameraYawAxis()

virtual void cv::ovis::WindowScene::fixCameraYawAxis ( bool  useFixed,
InputArray  up = noArray() 
)
pure virtual

convenience method to force the "up" axis to stay fixed

works with both programmatic changes and SCENE_INTERACTIVE

Parameters
useFixedwhether to enforce the fixed yaw axis
upthe axis to be fixed

◆ getCameraPose()

virtual void cv::ovis::WindowScene::getCameraPose ( OutputArray  R = noArray(),
OutputArray  tvec = noArray(),
bool  invert = false 
)
pure virtual

Retrieves the current camera pose

Parameters
R3x3 rotation matrix
tvectranslation vector
invertreturn the inverted pose

◆ getCompositorTexture()

virtual void cv::ovis::WindowScene::getCompositorTexture ( const String compname,
const String texname,
OutputArray  out,
int  mrtIndex = 0 
)
pure virtual

read back the texture of an active compositor

Parameters
compnamename of the compositor
texnamename of the texture inside the compositor
mrtIndexif texture is a MRT, specifies the attachment
outthe texture contents

◆ getDepth()

virtual void cv::ovis::WindowScene::getDepth ( OutputArray  depth)
pure virtual

get the depth for the current frame.

return the per pixel distance to the camera in world units

◆ getEntityAnimations()

virtual void cv::ovis::WindowScene::getEntityAnimations ( const String name,
std::vector< String > &  out 
)
pure virtual

get a list of available entity animations

Parameters
nameentity name
outthe animation names

◆ getEntityPose()

virtual void cv::ovis::WindowScene::getEntityPose ( const String name,
OutputArray  R = noArray(),
OutputArray  tvec = noArray(),
bool  invert = false 
)
pure virtual

Retrieves the current pose of an entity

Parameters
nameentity name
R3x3 rotation matrix
tvectranslation vector
invertreturn the inverted pose

◆ getEntityProperty()

virtual void cv::ovis::WindowScene::getEntityProperty ( const String name,
int  prop,
OutputArray  value 
)
pure virtual

get the property of an entity

Parameters
nameentity name
propEntityProperty
valuethe value

◆ getScreenshot()

virtual void cv::ovis::WindowScene::getScreenshot ( OutputArray  frame)
pure virtual

read back the image generated by the last call to waitKey

◆ playEntityAnimation()

virtual void cv::ovis::WindowScene::playEntityAnimation ( const String name,
const String animname,
bool  loop = true 
)
pure virtual

play entity animation

Parameters
nameentity name
animnameanimation name
loopenable or disable animation loop
See also
getEntityAnimations

◆ removeEntity()

virtual void cv::ovis::WindowScene::removeEntity ( const String name)
pure virtual

remove an entity from the scene

Parameters
nameentity name

◆ setBackground() [1/2]

virtual void cv::ovis::WindowScene::setBackground ( InputArray  image)
pure virtual

set window background to custom image/ color

Parameters
image

◆ setBackground() [2/2]

virtual void cv::ovis::WindowScene::setBackground ( const Scalar color)
pure virtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ setCameraIntrinsics()

virtual void cv::ovis::WindowScene::setCameraIntrinsics ( InputArray  K,
const Size imsize,
float  zNear = -1,
float  zFar = -1 
)
pure virtual

set intrinsics of the camera

Parameters
Kintrinsic matrix or noArray(). If noArray() is specified, imsize is ignored and zNear/ zFar can be set separately.
imsizeimage size
zNearnear clip distance or -1 to keep the current
zFarfar clip distance or -1 to keep the current

◆ setCameraLookAt()

virtual void cv::ovis::WindowScene::setCameraLookAt ( const String target,
InputArray  offset = noArray() 
)
pure virtual

convenience method to orient the camera to a specific entity

Parameters
targetentity name
offsetoffset from entity centre

◆ setCameraPose()

virtual void cv::ovis::WindowScene::setCameraPose ( InputArray  tvec = noArray(),
InputArray  rot = noArray(),
bool  invert = false 
)
pure virtual

Sets the current camera pose

Parameters
tvectranslation
rotRodrigues vector or 3x3 rotation matrix
invertuse the inverse of the given pose

◆ setCompositors()

virtual void cv::ovis::WindowScene::setCompositors ( const std::vector< String > &  names)
pure virtual

enable an ordered chain of full-screen post processing effects

this way you can add distortion or SSAO effects. The effects themselves must be defined inside Ogre .compositor scripts.

Parameters
namescompositor names that will be applied in order of appearance
See also
addResourceLocation

◆ setEntityLookAt()

virtual void cv::ovis::WindowScene::setEntityLookAt ( const String origin,
const String target,
InputArray  offset = noArray() 
)
pure virtual

convenience method to orient an entity to a specific entity. If target is an empty string the entity looks at the given offset point

Parameters
originentity to make look at
targetname of target entity
offsetoffset from entity centre

◆ setEntityPose()

virtual void cv::ovis::WindowScene::setEntityPose ( const String name,
InputArray  tvec = noArray(),
InputArray  rot = noArray(),
bool  invert = false 
)
pure virtual

set entity pose in the world coordinate space.

Parameters
nameenitity name
tvectranslation
rotRodrigues vector or 3x3 rotation matrix
invertuse the inverse of the given pose

◆ setEntityProperty() [1/2]

virtual void cv::ovis::WindowScene::setEntityProperty ( const String name,
int  prop,
const String value,
int  subEntityIdx = -1 
)
pure virtual

set the property of an entity to the given value

Parameters
nameentity name
propEntityProperty
valuethe value
subEntityIdxindex of the sub-entity (default: all)

◆ setEntityProperty() [2/2]

virtual void cv::ovis::WindowScene::setEntityProperty ( const String name,
int  prop,
const Scalar value 
)
pure virtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ stopEntityAnimation()

virtual void cv::ovis::WindowScene::stopEntityAnimation ( const String name,
const String animname 
)
pure virtual

stop entity animation

Parameters
nameenitity name
animnameanimation name

◆ update()

virtual void cv::ovis::WindowScene::update ( )
pure virtual

render this window, but do not swap buffers. Automatically called by ovis::waitKey

◆ updateEntityPose()

virtual void cv::ovis::WindowScene::updateEntityPose ( const String name,
InputArray  tvec = noArray(),
InputArray  rot = noArray() 
)
pure virtual

update entity pose by transformation in the parent coordinate space. (pre-rotation)

Parameters
nameentity name
tvectranslation
rotRodrigues vector or 3x3 rotation matrix

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