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

Child-classe, converts from BGR to HSV color space. More...

#include <ConvertColorSpace.h>

Inheritance diagram for ConvertColorSpace:

Public Member Functions

 ConvertColorSpace (const cv::String name)
 Constructor. More...
 
void setAction (void *data)
 sets the output of the action More...
 
void showWindow ()
 shows the action to the user More...
 
- Public Member Functions inherited from PipeLineAction
 PipeLineAction ()
 Default constructor.
 
 PipeLineAction (const cv::String name)
 Constructor. More...
 
virtual void * getAction ()
 gets the output of the action More...
 
void hideWindow ()
 hides the action to the user More...
 
cv::String getName ()
 gets the pipeline action name More...
 

Additional Inherited Members

- Protected Attributes inherited from PipeLineAction
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

Child-classe, converts from BGR to HSV color space.

Constructor & Destructor Documentation

◆ ConvertColorSpace()

ConvertColorSpace::ConvertColorSpace ( const cv::String  name)

Constructor.

Parameters
name(screen)name of ConvertColorSpace action
cv::String name
(screen)name of the pipeline action
Definition: PipeLineAction.h:27
PipeLineAction()
Default constructor.
Definition: PipeLineAction.cpp:11

Member Function Documentation

◆ setAction()

void ConvertColorSpace::setAction ( void *  data)
virtual

sets the output of the action

in this case: converting from BGR to HSV colorspace.

Parameters
datapointer to the input data, should be a OpenCV matrix

Implements PipeLineAction.

17 {
18  Mat* d = static_cast<Mat*>(data);
19  cvtColor(*d, img, COLOR_BGR2HSV);
20 }
cv::Mat img
Matrix which holds the image of the action.
Definition: PipeLineAction.h:25

◆ showWindow()

void ConvertColorSpace::showWindow ( )
virtual

shows the action to the user

uses cv::imshow(). The name of the window is the name of the pipeline action.

Implements PipeLineAction.

23 {
24  if (!show) {
25  namedWindow(name);
26  show = true;
27  }
28  imshow(name, img);
29 }
bool show
Show action flag.
Definition: PipeLineAction.h:26