RobWorkProject  23.9.11-
Public Types | Public Member Functions | List of all members
GLFrameGrabber25D Class Reference

An implementation of the FrameGrabber interface. The GLFrameGrabber25D grabs images from a OpenGL scene using a simple pinhole camera model. More...

#include <GLFrameGrabber25D.hpp>

Inherits FrameGrabber25D.

Public Types

typedef rw::core::Ptr< GLFrameGrabber25DPtr
 Smart pointer type for GLFrameGrabber25D.
 
- Public Types inherited from FrameGrabber25D
typedef rw::core::Ptr< FrameGrabber25DPtr
 Smart pointer type for FrameGrabber25D.
 

Public Member Functions

 GLFrameGrabber25D (int width, int height, double fov, double mindepth=0.1, double maxdepth=10.0)
 constructor More...
 
virtual ~GLFrameGrabber25D ()
 destructor
 
bool init (rw::core::Ptr< rw::graphics::SceneViewer > drawer)
 initialize the grabber with a scene viewer. This registers the grabber as a camera in the scene and enables rendering. More...
 
void setMaxDepth (double depth)
 set the maximum depth that is percieved by this frame grabber. If min and max depth are too far apart the resolution of the depth perception will become bad. Hence keep the range realistic. More...
 
void setMinDepth (double depth)
 set the minimum depth that is percieved by this frame grabber. If min and max depth are too far apart the resolution of the depth perception will become bad. Hence keep the range realistic. More...
 
void grab (rw::core::Ptr< rw::kinematics::Frame > frame, const rw::kinematics::State &state)
 this function grabs a image from the specialized source and copies it to the FrameGrabber image. More...
 
double getMaxDepth ()
 maximum depth that this framegrabber can handle More...
 
double getMinDepth ()
 minimum depth that this framegrabber can handle More...
 
virtual double getFieldOfViewY ()
 Returns the field of view measured around the y-axis. More...
 
- Public Member Functions inherited from FrameGrabber25D
 FrameGrabber25D (size_t width, size_t height)
 constructor More...
 
virtual ~FrameGrabber25D ()
 destructor
 
size_t getWidth () const
 returns the width of the image More...
 
size_t getHeight () const
 returns the height of the image More...
 
void resize (size_t width, size_t height)
 resizes the image that this frameGrabber use. The colorcode will default to the one that FrameGrabber25D was initialized with. More...
 
virtual rw::geometry::PointCloudgetImage ()
 returns the image More...
 

Additional Inherited Members

- Protected Attributes inherited from FrameGrabber25D
rw::geometry::PointCloud_img
 The image.
 
size_t _width
 Width of the image.
 
size_t _height
 Height of the image.
 

Detailed Description

An implementation of the FrameGrabber interface. The GLFrameGrabber25D grabs images from a OpenGL scene using a simple pinhole camera model.

a framethe opengl rendering to take pictures of the scene.

The most basic parameter of a camera is its Field of view. This can be used as an initial camera model. Field of view can be calculated from the focal length and the size of the CCD typically (1/2, 1/3, 1/4) inch. If a more realistic camera model is required the perspective transform of a specific camera can be added

Constructor & Destructor Documentation

◆ GLFrameGrabber25D()

GLFrameGrabber25D ( int  width,
int  height,
double  fov,
double  mindepth = 0.1,
double  maxdepth = 10.0 
)

constructor

Parameters
width[in] width of image
height[in] height of image
fov[in] the vertical field of view angle in degree
mindepth[in] the minimum depth of camera.
maxdepth[in] the maximum depth of camera.

Member Function Documentation

◆ getFieldOfViewY()

virtual double getFieldOfViewY ( )
virtual

Returns the field of view measured around the y-axis.

Returns
Field of view measured around y-axis in radians

Implements FrameGrabber25D.

◆ getMaxDepth()

double getMaxDepth ( )
inlinevirtual

maximum depth that this framegrabber can handle

Returns
maximum depth in meter

Implements FrameGrabber25D.

◆ getMinDepth()

double getMinDepth ( )
inlinevirtual

minimum depth that this framegrabber can handle

Returns
minimum depth in meter

Implements FrameGrabber25D.

◆ grab()

void grab ( rw::core::Ptr< rw::kinematics::Frame frame,
const rw::kinematics::State state 
)
virtual

this function grabs a image from the specialized source and copies it to the FrameGrabber image.

Implements FrameGrabber25D.

◆ init()

bool init ( rw::core::Ptr< rw::graphics::SceneViewer drawer)

initialize the grabber with a scene viewer. This registers the grabber as a camera in the scene and enables rendering.

Parameters
drawer[in] the scene viewer
Returns
true if initialization succeeded, false otherwise (depends on the capabilities of the SceneViewer).

◆ setMaxDepth()

void setMaxDepth ( double  depth)

set the maximum depth that is percieved by this frame grabber. If min and max depth are too far apart the resolution of the depth perception will become bad. Hence keep the range realistic.

Parameters
depth[in] max depth

◆ setMinDepth()

void setMinDepth ( double  depth)

set the minimum depth that is percieved by this frame grabber. If min and max depth are too far apart the resolution of the depth perception will become bad. Hence keep the range realistic.

Parameters
depth[in] min depth

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