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

#include <Configuration.h>

Public Member Functions

 Configuration ()
 
virtual ~Configuration ()=default
 
void Run ()
 
void Stop ()
 
PTR_STREAM Source () const
 
void Source (PTR_STREAM source)
 
PTR_IMAGE_PROCESSING Processing () const
 
void Processing (PTR_IMAGE_PROCESSING processing)
 
int SkipFrame () const
 
void SkipFrame (int skipFrame)
 
int ImageBuffer () const
 
void ImageBuffer (int imageBuffer)
 
void ResultCallback (std::function< SUCCESS_CALLBACK > callback, Companion::ColorFormat colorFormat=Companion::ColorFormat::BGR)
 
const std::function< SUCCESS_CALLBACK > & ResultCallback () const
 
void ErrorCallback (std::function< ERROR_CALLBACK > callback)
 
const std::function< ERROR_CALLBACK > & ErrorCallback () const
 

Detailed Description

Companion configuration class to setup an computer vision usage like feature matching.

Author
Andreas Sekulski, Dimitri Kotlovsky

Constructor & Destructor Documentation

◆ Configuration()

Companion::Configuration::Configuration ( )

Constructor to create an companion helper class to start image processing setup.

◆ ~Configuration()

virtual Companion::Configuration::~Configuration ( )
virtualdefault

Default destructor.

Member Function Documentation

◆ ErrorCallback() [1/2]

void Companion::Configuration::ErrorCallback ( std::function< ERROR_CALLBACK callback)

Set an error callback handler.

Parameters
callbackError handler to set.

◆ ErrorCallback() [2/2]

const std::function< ERROR_CALLBACK > & Companion::Configuration::ErrorCallback ( ) const

Get error callback if exists.

Exceptions
Companion::Error::CodeCompanion error code if callback is not set.
Returns
Error callback if set.

◆ ImageBuffer() [1/2]

int Companion::Configuration::ImageBuffer ( ) const

Get image buffer store rate.

Returns
Image buffer frame rate default 5 images are stored to buffer.

◆ ImageBuffer() [2/2]

void Companion::Configuration::ImageBuffer ( int  imageBuffer)

Set image buffer size to store.

Parameters
imageBufferNumber of images who should be stored. If imageBuffer <= 0 buffer will be set to 5 images.

◆ Processing() [1/2]

PTR_IMAGE_PROCESSING Companion::Configuration::Processing ( ) const

Get current processing algorithm which should be used.

Exceptions
Companion::Error::CodeCompanion error code if image processing is not set.
Returns
Image processing algorithm which should be used.

◆ Processing() [2/2]

void Companion::Configuration::Processing ( PTR_IMAGE_PROCESSING  processing)

Set image processing algorithm, for example object detection or recognition.

Parameters
processingImage processing algorithm to use.

◆ ResultCallback() [1/2]

void Companion::Configuration::ResultCallback ( std::function< SUCCESS_CALLBACK callback,
Companion::ColorFormat  colorFormat = Companion::ColorFormat::BGR 
)

Set a result callback handler. The source image will be converted to the given format.

Parameters
callbackFunction pointer which contains result event handler.
colorFormatColor format of the returned image.

◆ ResultCallback() [2/2]

const std::function< SUCCESS_CALLBACK > & Companion::Configuration::ResultCallback ( ) const

Get an callback handler if set.

Exceptions
Companion::Error::CodeCompanion error code if callback is not set.
Returns
An callback handler if set.

◆ Run()

void Companion::Configuration::Run ( )

Execute companion configuration.

Exceptions
errorCompanion::Error::Code error code if an invalid configuration is set.

◆ SkipFrame() [1/2]

int Companion::Configuration::SkipFrame ( ) const

Get skip frame rate.

Returns
Skip frame rate, how many frames should be skipped.

◆ SkipFrame() [2/2]

void Companion::Configuration::SkipFrame ( int  skipFrame)

Set skip frame rate.

Parameters
skipFrameNumber of frames which should be skipped after image processing should be used.

◆ Source() [1/2]

PTR_STREAM Companion::Configuration::Source ( ) const

Obtain streaming source pointer if set.

Exceptions
Companion::Error::CodeCompanion error code if video source is not set.
Returns
Streaming source to obtain images.

◆ Source() [2/2]

void Companion::Configuration::Source ( PTR_STREAM  source)

Set streaming source to companion.

Parameters
sourceVideo source to set like an camera or video.

◆ Stop()

void Companion::Configuration::Stop ( )

Stop current running stream worker if it's executes.


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