-
Notifications
You must be signed in to change notification settings - Fork 0
/
GripPipeline.hpp
42 lines (35 loc) · 1.28 KB
/
GripPipeline.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#pragma once
#include "vision/VisionPipeline.h"
#include <opencv2/objdetect/objdetect.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/features2d.hpp>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <map>
#include <vector>
#include <string>
#include <math.h>
namespace grip {
/**
* GripPipeline class
* An OpenCV pipeline generated by GRIP
*/
class GripPipeline : public frc::VisionPipeline {
private:
cv::Mat rgbThresholdOutput;
std::vector<std::vector<cv::Point> > findContoursOutput;
std::vector<std::vector<cv::Point> > filterContoursOutput;
void rgbThreshold(cv::Mat &, double [], double [], double [], cv::Mat &);
void findContours(cv::Mat &, const bool , std::vector<std::vector<cv::Point> > &);
void filterContours(std::vector<std::vector<cv::Point> > &, double , double , double , double , double , double , double [], double , double , double , double , std::vector<std::vector<cv::Point> > &);
public:
GripPipeline();
void Process(cv::Mat& source0) override;
cv::Mat* GetRgbThresholdOutput();
std::vector<std::vector<cv::Point> >* GetFindContoursOutput();
std::vector<std::vector<cv::Point> >* GetFilterContoursOutput();
};
} // end namespace grip