|
Webcam Tracker
V1.0
Using openCV and an Arduino Uno
|
Child-classe, implements OpenCV's center of mass finding. More...
#include <Moment.h>
Public Member Functions | |
| Moment (const cv::String name) | |
| Constructor. More... | |
| void | setAction (void *data) |
| sets the output of the action More... | |
| void * | getAction () |
| gets the output of the action More... | |
| cv::Point * | getCenterOfMass () |
| gets 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... | |
| void | hideWindow () |
| hides the action to the user More... | |
| cv::String | getName () |
| gets the pipeline action name More... | |
Private Attributes | |
| cv::Moments | m |
| struct containing spatial moment | |
| cv::Point | center |
| vector containing all contour points | |
| int | areaMax |
| highest value of the trackbar | |
| int | area |
| current value of the trackbar, used as area filter | |
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 | |
Child-classe, implements OpenCV's center of mass finding.
| Moment::Moment | ( | const cv::String | name | ) |
Constructor.
| name | (screen)name of mask action |
|
virtual |
sets the output of the action
in this case: finding the center of mass at the first index of the vector. If the input vector is empty the center is placed out of sight.
| data | pointer to the input data, should be a vector with points |
Implements PipeLineAction.
|
virtual |
gets the output of the action
Reimplemented from PipeLineAction.
| Point * Moment::getCenterOfMass | ( | ) |
gets the output of the action
|
virtual |
shows the action to the user
uses cv::imshow(). The name of the window is the name of the pipeline action. Trackbar is added to set the size of the approximation accuracy
Implements PipeLineAction.