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

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

#include <GLFrameGrabber.hpp>

Inherits FrameGrabber.

Public Types

typedef rw::core::Ptr< GLFrameGrabberPtr
 Smart pointer type for GLFrameGrabber.
 
- Public Types inherited from FrameGrabber
typedef rw::core::Ptr< FrameGrabberPtr
 Smart pointer type for FrameGrabber.
 

Public Member Functions

 GLFrameGrabber (int width, int height, double fov, double near=0.1, double far=10.0)
 constructor More...
 
virtual ~GLFrameGrabber ()
 destructor
 
void resize (int width, int height)
 resizes the image that this frameGrabber use. The colorcode will default to the one that FrameGrabber was initialized with. More...
 
void resize (int width, int height, rw::sensor::Image::ColorCode colorCode)
 resizes the image that this frameGrabber use. More...
 
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...
 
virtual 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...
 
- Public Member Functions inherited from FrameGrabber
 FrameGrabber (int width, int height, rw::sensor::Image::ColorCode encoding)
 constructor More...
 
virtual ~FrameGrabber ()
 destructor
 
int getWidth ()
 returns the width of the image More...
 
int getHeight ()
 returns the height of the image More...
 
virtual rw::sensor::ImagegetImage ()
 returns the image More...
 

Additional Inherited Members

- Protected Attributes inherited from FrameGrabber
rw::sensor::Image_img
 The image.
 
rw::sensor::Image::ColorCode _colorCode
 Colorcode of the image.
 

Detailed Description

An implementation of the FrameGrabber interface. The GLFrameGrabber 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

◆ GLFrameGrabber()

GLFrameGrabber ( int  width,
int  height,
double  fov,
double  near = 0.1,
double  far = 10.0 
)

constructor

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

Member Function Documentation

◆ grab()

virtual 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 FrameGrabber.

◆ 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).

◆ resize() [1/2]

void resize ( int  width,
int  height 
)
virtual

resizes the image that this frameGrabber use. The colorcode will default to the one that FrameGrabber was initialized with.

Parameters
width[in] width of image
height[in] height of image

Reimplemented from FrameGrabber.

◆ resize() [2/2]

void resize ( int  width,
int  height,
rw::sensor::Image::ColorCode  colorCode 
)
virtual

resizes the image that this frameGrabber use.

Parameters
width[in] width of image.
height[in] height of image.
colorCode[in] Color encoding of the image.

Reimplemented from FrameGrabber.


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