-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspots.h
More file actions
49 lines (42 loc) · 1.06 KB
/
spots.h
File metadata and controls
49 lines (42 loc) · 1.06 KB
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
#pragma once
#pragma warning(push, 0)
#pragma warning(pop)
#pragma warning(disable: 4251)
#ifndef DllCoreExport
#ifdef DK_CORE_DLL_EXPORT
#define DllCoreExport Q_DECL_EXPORT
#elif DK_DLL_IMPORT
#define DllCoreExport Q_DECL_IMPORT
#else
#define DllCoreExport Q_DECL_IMPORT
#endif
#endif
#include <QImage>
#include "DKImgHoleResults.h"
#include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/imgproc/imgproc_c.h"
namespace nmc {
class DllCoreExport DKImgPretreatment {
public:
enum PRE_MODE {
AUTO_MODE = 0,
TIFF_MODE,
};
DKImgPretreatment(QImage orig,int mode = PRE_MODE::AUTO_MODE);
DKImgHoleResults* getResult();
private:
void covGrayImg();
void getMinMaxGrayValue(int& minGrayValue, int& maxGrayValue);
void binarization(int T);
int getIterationHresholdValue(int minGrayValue, int maxGrayValue);
void goToOpenCv();
void filterContours(std::vector<std::vector<cv::Point>> contours);
int getXYColor(int x, int y, int r0);
int getBinarizationT();
void adaptiveThereshold();
private:
DKImgHoleResults* mResult;
int mMode;
};
}