Webcam Tracker  V1.0
Using openCV and an Arduino Uno
Mask.h
Go to the documentation of this file.
1 
8 #pragma once
9 
10 #include "PipeLineAction.h"
11 
16 {
17  int lowH,
18  lowS,
19  lowV,
23 };
24 
28 class Mask : public PipeLineAction {
29 private:
30 
31  const int maxValueH = 180;
32  const int maxValue = 255;
33  const int maxValuePixel = 10;
34 
35  int lowH;
36  int lowS;
37  int lowV;
38 
39  int highH;
40  int highS;
41  int highV;
42 
43  int pixelSize;
44 
45 public:
48  Mask(const cv::String name);
49 
53  Mask(const cv::String name, HSV_MASK_VALUES hsv);
54 
58  void setAction(void* data);
59 
66  void showWindow();
67 
68 private:
72  static void onLowHTreshTrackbar(int, void* data);
73 
77  static void onHighHTreshTrackbar(int, void* data);
78 
82  static void onLowSTreshTrackbar(int, void* data);
83 
87  static void onHighSTreshTrackbar(int, void* data);
88 
92  static void onLowVTreshTrackbar(int, void* data);
93 
97  static void onHighVTreshTrackbar(int, void* data);
98 };
header file of the PipeLineAction base-class
Child-classe, applies a mask to the input matrix.
Definition: Mask.h:28
static void onHighHTreshTrackbar(int, void *data)
Handles the change trackbar event for the high hue trackbar.
Definition: Mask.cpp:68
Mask(const cv::String name)
Constructor.
Definition: Mask.cpp:14
const int maxValuePixel
maximum value of the associated trackbar
Definition: Mask.h:33
static void onHighVTreshTrackbar(int, void *data)
Handles the change trackbar event for the high value trackbar.
Definition: Mask.cpp:96
void showWindow()
shows the action to the user
Definition: Mask.cpp:45
static void onLowVTreshTrackbar(int, void *data)
Handles the change trackbar event for the low value trackbar.
Definition: Mask.cpp:89
int lowH
current value of the low hue trackbar
Definition: Mask.h:35
int pixelSize
current value of the erode and dilate size, based on the pixelsize trackbar position
Definition: Mask.h:43
static void onLowHTreshTrackbar(int, void *data)
Handles the change trackbar event for the low hue trackbar.
Definition: Mask.cpp:61
const int maxValue
maximum value of the saturation and value trackbars
Definition: Mask.h:32
int highS
current value of the high saturation trackbar
Definition: Mask.h:40
int highH
current value of the high hue trackbar
Definition: Mask.h:39
int lowV
current value of the low value trackbar
Definition: Mask.h:37
static void onHighSTreshTrackbar(int, void *data)
Handles the change trackbar event for the high saturation trackbar.
Definition: Mask.cpp:82
int lowS
current value of the low saturation trackbar
Definition: Mask.h:36
int highV
current value of the high value trackbar
Definition: Mask.h:41
const int maxValueH
maximum value of the hue trackbar
Definition: Mask.h:31
static void onLowSTreshTrackbar(int, void *data)
Handles the change trackbar event for the low saturation trackbar.
Definition: Mask.cpp:75
void setAction(void *data)
sets the output of the action
Definition: Mask.cpp:34
Base-class for all OpenCV pipeline actions.
Definition: PipeLineAction.h:23
cv::String name
(screen)name of the pipeline action
Definition: PipeLineAction.h:27
Struct to easily add predifined maks values.
Definition: Mask.h:16
int lowV
low Value value
Definition: Mask.h:19
int highH
high Hue value
Definition: Mask.h:20
int highS
high Saturation value
Definition: Mask.h:21
int lowH
low Hue value
Definition: Mask.h:17
int highV
high Value value
Definition: Mask.h:22
int lowS
low Saturation value
Definition: Mask.h:18