Detailed description

Václav Procházka

SMInterface

Detailed description

SMInterface allows to share timestamped images (IplImage) and data (vector< float>) through shared memory. It creates (or opens) its own shared memory segment. Named data- and image-queues can be created inside the shared memory and data and images can be pushed into these queues (and read from them). SMInterface can register and also deregister certain queues and only the momentarily requested ones can be computed and updated in order to minimize computation.

Each image queue contains at least single image at all times and older images which are not used by any process are deallocated. The data queues have specific length and behave as circular buffers. The queues can contain multiple values with the same timestamp.

SMInterface is distributed under BUT OPEN SOURCE LICENCE - you can get it here:
http://sourceforge.net/projects/sminterface/files/License.pdf/download

Brief usage guide

  • Start working:
    1. TSMObject SM();
    2. registerQueue( const string queue);
    3. registerQueue( const string queue2);
  • Push Image:
    1. IplImage * img = createIplImage( CvSize size, int depth, int channels);
    2. void pushImage( const string queue, img, long long timestamp);
  • Get newest image:
    1. getNewest( const string queue, long long &timestamp, IplImage *&img);
    2. work with the image
    3. returnImage( img);
  • Get multiple images with the newest timestamp (the same timestamp):
    1. long long ts = getNewestTimestamp( );
    2. bool success = requestTimestamp( ts);
    3. void getImage( const string queue, long long timestamp, IplImage *& img);
    4. work with img
    5. void getImage( const string queue, long long timestamp, IplImage *& img2);
    6. work with img and img2
    7. ...
    8. returnTimestamp( long long ts);
  • Push data:
    • bool worked = push( const std::string, std::vector< float> data, long long timestamp);
  • Get data for timestamp:
    • std::vector< std::vector< float> > get( const std::string, long long timestamp);
  • Get newest data:
    • std::vector< std::vector< float> > getNewest( const std::string, long long &timestamp);
  • Get data newer than:
    • std::multi_map< std::vector< float> > getNewer( const std::string, long long timestamp);

Related

Home: Home

MongoDB Logo MongoDB