|
Webcam Tracker
V1.0
Using openCV and an Arduino Uno
|
Child-classe, implements OpenCV's contour finding. More...
#include <Contour.h>
Public Member Functions | |
| Contour (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... | |
| 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 | |
| std::vector< std::vector< cv::Point > > | contours |
| vector containing all contour points | |
| std::vector< std::vector< cv::Point > > | polylines |
| vector containing all polyline points | |
| const cv::Scalar | green { 0,255,0 } |
| color green | |
| const cv::Scalar | red { 0,0,255 } |
| color red | |
| const int | accuracyMax = 20 |
| maximum value of the accuracy trackbar | |
| const int | areaMax = 50 |
| maximum value of the area trackbar | |
| int | accuracy |
| current value of the accuracy trackbar | |
| int | area |
| area value of the accuracy trackbar | |
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 contour finding.
With area filtering and size sorting
| Contour::Contour | ( | const cv::String | name | ) |
Constructor.
| name | (screen)name of mask action |
|
virtual |
sets the output of the action
Sets the action, in this case: finding all contours of the input matrix. And appying a area filter, bigger than the trackbar value multiplied by 10 contour color is green. Smaller countours are painted red. If there are no contours big enough, the vector is cleared.
| data | pointer to the input data, should be a OpenCV matrix |
Implements PipeLineAction.
|
virtual |
gets the output of the action
Reimplemented from PipeLineAction.
|
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.