JeVois  1.0
JeVois Smart Embedded Machine Vision Toolkit
jevois::InputFrame Class Reference

#include <jevois/Core/Module.H>

Exception-safe wrapper around a raw camera input frame.

This wrapper operates much like std:future in standard C++11. Users can get the next image captured by the camera by calling get(), which may block if the capture is not complete yet, or may throw if the capture fails for some reason (e.g., the camera is not streaming). The image size and pixel type are as defined by the current VideoMapping, camera section. In addition, a done() function is provided which users may use as soon as they are finished with the pixel data in the image obtained via get(), to allow the camera driver to setup the underlying memory buffer again for capture. If done() has not been called by the time the InputFrame is destroyed, it will be called automatically, if get() had been called. It may in some cases improve your frame rate to call done() manually as early as possible instead of letting the InputFrame destructor do it.

InputFrame implements a zero-copy, zero-wait access to input video frames, that is:

  1. the pixel data of the image you obtain via get() is directly the memory-mapped pixel buffer that the silicon hardware on the JeVois chip uses via direct-memory-access (DMA) to stream the pixel data from the camera chip to processor memory;
  2. as soon as an image is captured by the camera hardware, get() unblocks and returns it (as opposed to having a fixed, regular interval at which images may be available). Camera has several image buffers, allowing one to be captured while another is being handed over for processing via get(). These buffers are recycled, i.e., once done() is called, the underlying buffer is sent back to the camera hardware for future capture.

Definition at line 54 of file Module.H.

Public Member Functions

 InputFrame (InputFrame &&other)=default
 Move constructor. More...
 
RawImage const & get (bool casync=false) const
 Get the next captured camera image. More...
 
void done () const
 Indicate that user processing is done with the image previously obtained via get() More...
 
 ~InputFrame ()
 Destructor, returns the buffers to the driver as needed. More...
 

Friends

class Engine
 

Constructor & Destructor Documentation

jevois::InputFrame::InputFrame ( InputFrame &&  other)
default

Move constructor.

jevois::InputFrame::~InputFrame ( )

Destructor, returns the buffers to the driver as needed.

Definition at line 30 of file Module.C.

Member Function Documentation

void jevois::InputFrame::done ( ) const

Indicate that user processing is done with the image previously obtained via get()

You should call this as soon after get() as possible, once you are finished with the RawImage data so that it can be recycled and sent back to the camera driver for video capture.

Definition at line 52 of file Module.C.

jevois::RawImage const & jevois::InputFrame::get ( bool  casync = false) const

Get the next captured camera image.

Throws if we the camera is not streaming or blocks until an image is available (has been captured).

Definition at line 43 of file Module.C.

References jevois::RawImage::buf.

Friends And Related Function Documentation

friend class Engine
friend

Definition at line 77 of file Module.H.


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