Package org.robwork.sdurw_simulation
Class GLFrameGrabber25D
- java.lang.Object
-
- org.robwork.sdurw_simulation.FrameGrabber25D
-
- org.robwork.sdurw_simulation.GLFrameGrabber25D
-
public class GLFrameGrabber25D extends FrameGrabber25D
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 Summary
Constructors Constructor Description GLFrameGrabber25D(int width, int height, double fov)
constructorGLFrameGrabber25D(int width, int height, double fov, double mindepth)
constructorGLFrameGrabber25D(int width, int height, double fov, double mindepth, double maxdepth)
constructorGLFrameGrabber25D(long cPtr, boolean cMemoryOwn)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete()
static long
getCPtr(GLFrameGrabber25D obj)
double
getFieldOfViewY()
Returns the field of view measured around the y-axis.double
getMaxDepth()
maximum depth that this framegrabber can handledouble
getMinDepth()
minimum depth that this framegrabber can handlevoid
grab(FramePtr frame, State state)
this function grabs a image from the specialized source and
copies it to the FrameGrabber25D image.boolean
init(SWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneViewer_t drawer)
initialize the grabber with a scene viewer.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.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.
-
-
-
Constructor Detail
-
GLFrameGrabber25D
public GLFrameGrabber25D(long cPtr, boolean cMemoryOwn)
-
GLFrameGrabber25D
public GLFrameGrabber25D(int width, int height, double fov, double mindepth, double maxdepth)
constructor- Parameters:
width
- [in] width of imageheight
- [in] height of imagefov
- [in] the vertical field of view angle in degreemindepth
- [in] the minimum depth of camera.maxdepth
- [in] the maximum depth of camera.
-
GLFrameGrabber25D
public GLFrameGrabber25D(int width, int height, double fov, double mindepth)
constructor- Parameters:
width
- [in] width of imageheight
- [in] height of imagefov
- [in] the vertical field of view angle in degreemindepth
- [in] the minimum depth of camera.
-
GLFrameGrabber25D
public GLFrameGrabber25D(int width, int height, double fov)
constructor- Parameters:
width
- [in] width of imageheight
- [in] height of imagefov
- [in] the vertical field of view angle in degree
-
-
Method Detail
-
getCPtr
public static long getCPtr(GLFrameGrabber25D obj)
-
delete
public void delete()
- Overrides:
delete
in classFrameGrabber25D
-
init
public boolean init(SWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneViewer_t 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
public 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
public 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
-
grab
public void grab(FramePtr frame, State state)
Description copied from class:FrameGrabber25D
this function grabs a image from the specialized source and
copies it to the FrameGrabber25D image.- Overrides:
grab
in classFrameGrabber25D
-
getMaxDepth
public double getMaxDepth()
Description copied from class:FrameGrabber25D
maximum depth that this framegrabber can handle- Overrides:
getMaxDepth
in classFrameGrabber25D
- Returns:
- maximum depth in meter
-
getMinDepth
public double getMinDepth()
Description copied from class:FrameGrabber25D
minimum depth that this framegrabber can handle- Overrides:
getMinDepth
in classFrameGrabber25D
- Returns:
- minimum depth in meter
-
getFieldOfViewY
public double getFieldOfViewY()
Description copied from class:FrameGrabber25D
Returns the field of view measured around the y-axis.- Overrides:
getFieldOfViewY
in classFrameGrabber25D
- Returns:
- Field of view measured around y-axis in radians
-
-