-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathImgLib.h
74 lines (63 loc) · 1.66 KB
/
ImgLib.h
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef ImgLib_h
#define ImgLib_h
#include "stdlib.h"
#include "opencv.hpp"
#include <QThread>
#include <QObject>
#include <QDebug>
#include <QString>
#include <QTreeWidget>
#include <QFrame>
#include "FileLib.h"
#include <Dense>
using namespace cv;
using namespace std;
typedef enum {
CV_OTSU,
CV_THRESHOLD,
}SEGMENTTYPEENUM;
typedef struct
{
Point3d CirquePoint; ////圆心
double Roundness; ///圆度
int CirqueRadius; ////半径
}CirquePointtypedef;
class ImgMainProcess : public QObject
{
Q_OBJECT
public:
explicit ImgMainProcess(string str = "Camera_000", int threshold_t = 200, double round = 0.1);
private:
long long FrameCount;
long long DealFrameCount;
int Segthreshold; ////分割阈值
int CirqueCountLimitMin;
int CirqueCountLimitMax;
double RoundnessLimit;
double ResizeMatK;
double ExternSizeK;
bool CalRunning;
cv::Mat CopyMainImg; ////本类使用的独立缓存
cv::Mat * OriMainImg; ////原始缓存
SEGMENTTYPEENUM SegmentType; ///////分割方法
std::vector<CirquePointtypedef> CirquePointTree;
private:
bool FindCirqueFromContour(cv::Point3d &p, std::vector<std::vector<cv::Point>> contours,
int index, double roundlimit, double& roundness, double& rave);
void ImgProcessCacheInit(cv::Mat *);
void ImgSegmentProcess();
void ImgFindContoursProcess();
public:
cv::Mat * RGBShowImg; ///显示彩图缓存
std::string CameraDeviceStr;
public:
void release();
void CloseCal();
void OpenCal();
public slots:
void ImgProcessThread(cv::Mat *);
signals:
void SendCirquePoint(std::vector<CirquePointtypedef> *);
void SendShowRGBImg(cv::Mat *);
};
#endif