Class GLFrameGrabber


  • public class GLFrameGrabber
    extends FrameGrabber
    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 Detail

      • GLFrameGrabber

        public GLFrameGrabber​(long cPtr,
                              boolean cMemoryOwn)
      • GLFrameGrabber

        public GLFrameGrabber​(int width,
                              int height,
                              double fov,
                              double near,
                              double far)
        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.
      • GLFrameGrabber

        public GLFrameGrabber​(int width,
                              int height,
                              double fov,
                              double near)
        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.
      • GLFrameGrabber

        public GLFrameGrabber​(int width,
                              int height,
                              double fov)
        constructor
        Parameters:
        width - [in] width of image
        height - [in] height of image
        fov - [in] the vertical field of view angle in degree

    • Method Detail

      • resize

        public void resize​(int width,
                           int height)
        Description copied from class: FrameGrabber
        resizes the image that this frameGrabber use. The colorcode will
        default to the one that FrameGrabber was initialized with.
        Overrides:
        resize in class FrameGrabber
        Parameters:
        width - [in] width of image
        height - [in] height of image
      • resize

        public void resize​(int width,
                           int height,
                           Image.ColorCode colorCode)
        Description copied from class: FrameGrabber
        resizes the image that this frameGrabber use.
        Overrides:
        resize in class FrameGrabber
        Parameters:
        width - [in] width of image.
        height - [in] height of image.
        colorCode - [in] Color encoding of the image.
      • 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).
      • grab

        public void grab​(FramePtr frame,
                         State state)
        Description copied from class: FrameGrabber
        this function grabs a image from the specialized source and
        copies it to the FrameGrabber image.
        Overrides:
        grab in class FrameGrabber