Webcam Tracker  V1.0
Using openCV and an Arduino Uno
Public Member Functions | Protected Attributes | List of all members

Base-class for all OpenCV pipeline actions. More...

#include <PipeLineAction.h>

Inheritance diagram for PipeLineAction:

Public Member Functions

 PipeLineAction ()
 Default constructor.
 
 PipeLineAction (const cv::String name)
 Constructor. More...
 
virtual void setAction (void *data)=0
 sets the output of the action More...
 
virtual void * getAction ()
 gets the output of the action More...
 
virtual void showWindow ()=0
 shows the action to the user More...
 
void hideWindow ()
 hides the action to the user More...
 
cv::String getName ()
 gets the pipeline action name More...
 

Protected Attributes

cv::Mat img
 Matrix which holds the image of the action.
 
bool show
 Show action flag.
 
cv::String name
 (screen)name of the pipeline action
 

Detailed Description

Base-class for all OpenCV pipeline actions.

openCV include files c++ include files

Constructor & Destructor Documentation

◆ PipeLineAction()

PipeLineAction::PipeLineAction ( const cv::String  name)

Constructor.

Parameters
name(screen)name of the pipeline action
19 {
20  img = cv::Mat::zeros(cv::Size(1, 1), CV_8SC3);
21  show = false;
22  this->name = name;
23 }
cv::Mat img
Matrix which holds the image of the action.
Definition: PipeLineAction.h:25
cv::String name
(screen)name of the pipeline action
Definition: PipeLineAction.h:27
bool show
Show action flag.
Definition: PipeLineAction.h:26

Member Function Documentation

◆ setAction()

virtual void PipeLineAction::setAction ( void *  data)
pure virtual

sets the output of the action

The parameter type is kept open, this provides the possibility to change the order of the pipeline and the type of parameter which is inserted. Special precautions have been taken to check if the parameter type is suitable for the action.

Parameters
datapointer to the input data

Implemented in Moment, Mask, ConvertColorSpace, Contour, and Blur.

◆ getAction()

void * PipeLineAction::getAction ( )
virtual

gets the output of the action

The return type is kept open, this provides the possibility to have different outputs bassed on the implementation in the iherited class

Returns
data: pointer to the image matrix

Reimplemented in Moment, and Contour.

26 {
27  return &img;
28 }

◆ showWindow()

virtual void PipeLineAction::showWindow ( )
pure virtual

shows the action to the user

uses cv::imshow(). The name of the window is the name of the pipeline action. it is possible to add trackbars to the implentations.

Implemented in Moment, Mask, ConvertColorSpace, Contour, and Blur.

◆ hideWindow()

void PipeLineAction::hideWindow ( )

hides the action to the user

destroys the OpenCV window based on the pipeline action name.

31 {
32  if (show) {
33  cv::destroyWindow(name);
34  show = false;
35  }
36 }

◆ getName()

cv::String PipeLineAction::getName ( )

gets the pipeline action name

Returns
name: (screen)name of the pipeline action.
39 {
40  return name;
41 }