Webcam Tracker  V1.0
Using openCV and an Arduino Uno
Moment.h
Go to the documentation of this file.
1 
8 #pragma once
9 
10 #include "PipeLineAction.h"
11 
15 class Moment : public PipeLineAction {
16 private:
17  cv::Moments m;
18  cv::Point center;
19  int areaMax;
20  int area;
21 
22 public:
25  Moment(const cv::String name);
26 
31  void setAction(void* data);
32 
35  void* getAction();
36 
39  cv::Point* getCenterOfMass();
40 
44  void showWindow();
45 };
header file of the PipeLineAction base-class
Child-classe, implements OpenCV's center of mass finding.
Definition: Moment.h:15
Moment(const cv::String name)
Constructor.
Definition: Moment.cpp:13
cv::Moments m
struct containing spatial moment
Definition: Moment.h:17
cv::Point * getCenterOfMass()
gets the output of the action
Definition: Moment.cpp:38
void showWindow()
shows the action to the user
Definition: Moment.cpp:43
int area
current value of the trackbar, used as area filter
Definition: Moment.h:20
void setAction(void *data)
sets the output of the action
Definition: Moment.cpp:21
cv::Point center
vector containing all contour points
Definition: Moment.h:18
int areaMax
highest value of the trackbar
Definition: Moment.h:19
void * getAction()
gets the output of the action
Definition: Moment.cpp:33
Base-class for all OpenCV pipeline actions.
Definition: PipeLineAction.h:23
cv::String name
(screen)name of the pipeline action
Definition: PipeLineAction.h:27