Companion  1.0.0
Companion is an object recognition framework written with OpenCV.
Public Member Functions | List of all members
Companion::Thread::StreamWorker Class Reference

#include <StreamWorker.h>

Public Member Functions

 StreamWorker (int buffer=1, ColorFormat colorFormat=ColorFormat::BGR)
 
void Produce (PTR_STREAM stream, int skipFrame, std::function< ERROR_CALLBACK > errorCallback)
 
void Consume (PTR_IMAGE_PROCESSING processing, std::function< ERROR_CALLBACK > errorCallback, std::function< SUCCESS_CALLBACK > successCallback)
 

Detailed Description

Stream worker class to produce and consume images from a streaming source.

Author
Andreas Sekulski, Dimitri Kotlovsky

Constructor & Destructor Documentation

◆ StreamWorker()

Companion::Thread::StreamWorker::StreamWorker ( int  buffer = 1,
ColorFormat  colorFormat = ColorFormat::BGR 
)

Create a stream worker to obtain images from a stream and store to a queue.

Parameters
bufferBuffer size to store images. Default is one image.
colorFormatColor format of the returned image.

Member Function Documentation

◆ Consume()

void Companion::Thread::StreamWorker::Consume ( PTR_IMAGE_PROCESSING  processing,
std::function< ERROR_CALLBACK errorCallback,
std::function< SUCCESS_CALLBACK successCallback 
)

Consume stream data from stored queue and process it.

Parameters
processingProcessing algorithm.
errorCallbackError callback handler.
successCallbackCallback handler to return results.

◆ Produce()

void Companion::Thread::StreamWorker::Produce ( PTR_STREAM  stream,
int  skipFrame,
std::function< ERROR_CALLBACK errorCallback 
)

Produce stream data and store to the queue.

Parameters
streamStream source to obtain images from.
skipFrameSkipping frame rate if set.
errorCallbackError callback handler.

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