![]() |
Companion
1.0.0
Companion is an object recognition framework written with OpenCV.
|
#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) |
Stream worker class to produce and consume images from a streaming source.
| 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.
| buffer | Buffer size to store images. Default is one image. |
| colorFormat | Color format of the returned image. |
| 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.
| processing | Processing algorithm. |
| errorCallback | Error callback handler. |
| successCallback | Callback handler to return results. |
| void Companion::Thread::StreamWorker::Produce | ( | PTR_STREAM | stream, |
| int | skipFrame, | ||
| std::function< ERROR_CALLBACK > | errorCallback | ||
| ) |
Produce stream data and store to the queue.
| stream | Stream source to obtain images from. |
| skipFrame | Skipping frame rate if set. |
| errorCallback | Error callback handler. |
1.8.15