-
Notifications
You must be signed in to change notification settings - Fork 2
/
InscribedRectFinder.h
50 lines (35 loc) · 1.07 KB
/
InscribedRectFinder.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
#pragma once
#include <opencv2/opencv.hpp>
class InscribedRectFinder
{
public:
InscribedRectFinder() {}
~InscribedRectFinder() {}
/* Find Rectangle */
cv::Rect findRectangle(const cv::Mat &binary) const;
/* Use Aspect Ratio */
bool useAspectRatio() const { return mUseAspectRatio; }
/* Set Use Aspect Ratio */
void setUseAspectRatio(bool b) { mUseAspectRatio = b; }
/* Aspect Ratio */
double aspectRatio() const { return mAspectRatio; }
/* Set Aspect Ratio */
void setAspectRatio(double aspect) { mAspectRatio = aspect; }
/* Min Area */
int minArea() const { return mMinArea; }
/* Set Min Area */
void setMinArea(int area) { mMinArea = area; }
/* Max Area */
int maxArea() const { return mMaxArea; }
/* Set Max Area */
void setMaxArea(int area) { mMaxArea = area; }
private:
/* Use Aspect Ratio */
bool mUseAspectRatio = false;
/* Aspect Ratio */
double mAspectRatio = 1.0;
/* Min Area Size */
int mMinArea = 10 * 10;
/* Max Area Sizs */
int mMaxArea = 10000 * 10000;
};