Skip to content

Commit 622b91c

Browse files
Update namespace
1 parent d51a230 commit 622b91c

17 files changed

+48
-47
lines changed

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,15 @@ make
3535
```
3636

3737
4. 接口和使用方法
38-
代码中引用头文件`#include "ellipse_detection/detect.h"`,接口说明
38+
代码中引用头文件`#include "ellipse_detection/detect.h"`,然后引入namespace zgh。
39+
接口说明
3940
```
4041
bool detectEllipse(const uint8_t *image, int height, int width,
4142
std::vector<std::shared_ptr<Ellipse> > &ells,
4243
int polarity = 0, double line_width = 2.0);
4344
```
4445
- 输入:
45-
- image 图像原始数据,按照"BRG"排列
46+
- image 图像原始数据,灰度图
4647
- height 图像高度
4748
- width 图像宽度
4849
- polarity 表示椭圆极,默认为 0。

include/compute.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
*Copyright: Copyright (c) 2019
33
*Created on 2019-5-21
4-
*Author:zhengaohong@minieye.cc
4+
*Author:zhengaohong@zgheye.cc
55
*Version 1.0.1
66
*/
77

@@ -11,7 +11,7 @@
1111

1212
#include "types.hpp"
1313

14-
namespace MINI {
14+
namespace zgh {
1515

1616
bool calculateGradient(const uint8_t *image, int row, int col, double *angles);
1717

@@ -29,6 +29,6 @@ bool gaussianSampler(const uint8_t *ori_data, int ori_row, int ori_col,
2929

3030
std::shared_ptr<Ellipse> fitEllipse(const std::vector<Pixel> &points);
3131

32-
} // namespace MINI
32+
} // namespace zgh
3333

3434
#endif // _INCLUDE_COMPUTE_H_

include/cvcannyapi.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
*Copyright: Copyright (c) 2019
33
*Created on 2019-5-27
4-
*Author:zhengaohong@minieye.cc
4+
*Author:zhengaohong@zgheye.cc
55
*Version 1.0.1
66
*/
77

@@ -10,11 +10,11 @@
1010
#define _INCLUDE_CVCANNYAPI_H_
1111
#include <stdint.h>
1212

13-
namespace MINI {
13+
namespace zgh {
1414

1515
bool calculateGradient3(const uint8_t *image, int row, int col, double * angles);
1616

17-
} // namespace MINI
17+
} // namespace zgh
1818

1919

2020
#endif // _INCLUDE_CVCANNYAPI_H_

include/defines.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
*Copyright: Copyright (c) 2019
33
*Created on 2019-5-21
4-
*Author:zhengaohong@minieye.cc
4+
*Author:zhengaohong@zgheye.cc
55
*Version 1.0.1
66
*/
77

@@ -11,7 +11,7 @@
1111

1212
#include <cmath>
1313

14-
namespace MINI {
14+
namespace zgh {
1515

1616
#ifndef M_LN10
1717
#define M_LN10 2.30258509299404568402 // ln10
@@ -58,6 +58,6 @@ const double MIN_ELLIPSE_THRESHOLD_LENGTH = 2.0;
5858

5959
const double REGION_LIMITATION_DIS_TOLERACE = -3.0 * MIN_ELLIPSE_THRESHOLD_LENGTH;
6060

61-
} // namespace MINI
61+
} // namespace zgh
6262

6363
#endif // _INCLUDE_DEFINES_H_

include/detect.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
*Copyright: Copyright (c) 2019
33
*Created on 2019-5-22
4-
*Author:zhengaohong@minieye.cc
4+
*Author:zhengaohong@zgheye.cc
55
*Version 1.0.1
66
*/
77

@@ -11,7 +11,7 @@
1111
#include "types.hpp"
1212

1313

14-
namespace MINI {
14+
namespace zgh {
1515

1616
bool lineSegmentDetection(const double *image, int row, int col,
1717
std::vector<std::shared_ptr<Lined> > &lines);
@@ -37,7 +37,7 @@ bool detectEllipse(const uint8_t *image, int row, int col,
3737
int polarity = 0, double width = 2.0);
3838

3939
}
40-
//namespace MINI
40+
//namespace zgh
4141

4242

4343
#endif // _INCLUDE_DETECT_H_

include/types.hpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
*Copyright: Copyright (c) 2019
33
*Created on 2019-5-21
4-
*Author:zhengaohong@minieye.cc
4+
*Author:zhengaohong@zgheye.cc
55
*Version 1.0.1
66
*/
77

@@ -20,7 +20,7 @@
2020
#include "defines.h"
2121
#include "unitily.h"
2222

23-
namespace MINI {
23+
namespace zgh {
2424

2525

2626
template <typename T>
@@ -229,10 +229,10 @@ class FuncTimerDecorator {
229229
};
230230

231231

232-
} // namespace MINI
232+
} // namespace zgh
233233

234234

235-
namespace MINI {
235+
namespace zgh {
236236

237237
/*--------------------------------------------------------------*/
238238

@@ -587,7 +587,7 @@ inline Ellipse::Ellipse(double a, double b, double c, double d, double e, double
587587
double Av = -d * sint + e * cost;
588588
double Auu = a * cos_squared + c * sin_squared + b * cos_sin;
589589
double Avv = a * sin_squared + c * cos_squared - b * cos_sin;
590-
if (MINI::equal(0.0, Auu) || MINI::equal(0.0, Avv)) {
590+
if (zgh::equal(0.0, Auu) || zgh::equal(0.0, Avv)) {
591591
this->a = this->b = this->phi = 0;
592592
} else {
593593
double tuCentre = -Au / (2.0 * Auu);
@@ -1011,7 +1011,7 @@ std::ostream& operator << (std::ostream& out, const Point_<T>&& pt) {
10111011
return out;
10121012
}
10131013

1014-
} // namespace MINI
1014+
} // namespace zgh
10151015

10161016

10171017

include/unitily.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
/*
22
*Copyright: Copyright (c) 2019
33
*Created on 2019-5-21
4-
*Author:zhengaohong@minieye.cc
4+
*Author:zhengaohong@zgheye.cc
55
*Version 1.0.1
66
*/
77

88

99
#ifndef _INCLUDE_UNITILT_H_
1010
#define _INCLUDE_UNITILT_H_
1111

12-
namespace MINI {
12+
namespace zgh {
1313

1414
bool equal(int x, int y);
1515

@@ -39,7 +39,7 @@ double log_gamma_lanczos(double x);
3939

4040
double nfa(int n, int k, double p, double logNT);
4141

42-
} // namespace MINI
42+
} // namespace zgh
4343

4444

4545
#endif // _INCLUDE_UNITILT_H_

src/compute.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
*Copyright: Copyright (c) 2019
33
*Created on 2019-5-21
4-
*Author:zhengaohong@minieye.cc
4+
*Author:zhengaohong@zgheye.cc
55
*Version 1.0.1
66
*/
77

@@ -12,7 +12,7 @@
1212
#include "defines.h"
1313

1414

15-
namespace MINI {
15+
namespace zgh {
1616

1717
bool calculateGradient(const uint8_t *image, int row, int col, double *angles) {
1818
double *mod = new double[row * col];
@@ -524,4 +524,4 @@ bool gaussianSampler(const uint8_t *ori_data, int ori_row, int ori_col,
524524
}
525525

526526

527-
} // MINI
527+
} // zgh

src/cvcannyapi.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
*Copyright: Copyright (c) 2019
33
*Created on 2019-6-27
4-
*Author:zhengaohong@minieye.cc
4+
*Author:zhengaohong@zgheye.cc
55
*Version 1.0.1
66
*/
77

@@ -13,7 +13,7 @@
1313
#include "cvcannyapi.h"
1414
#include "defines.h"
1515

16-
namespace MINI {
16+
namespace zgh {
1717

1818
using namespace cv;
1919

@@ -345,4 +345,4 @@ bool calculateGradient3(const uint8_t* data, int row, int col, double* angles) {
345345
return true;
346346
}
347347

348-
} // namespace MINI
348+
} // namespace zgh

src/detect.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
*Copyright: Copyright (c) 2019
33
*Created on 2019-5-21
4-
*Author:zhengaohong@minieye.cc
4+
*Author:zhengaohong@zgheye.cc
55
*Version 1.0.1
66
*/
77

@@ -21,7 +21,7 @@
2121
#include "cvcannyapi.h"
2222

2323

24-
namespace MINI {
24+
namespace zgh {
2525

2626
bool lsdgroups(const double *image, int row, int col, double scale, std::vector<std::shared_ptr<Arc> >& arcs) {
2727
std::vector<std::shared_ptr<Lined> > lines;
@@ -819,4 +819,4 @@ bool detectEllipse(const uint8_t *image, int row, int col,
819819
return true;
820820
}
821821

822-
} // namespace MINI
822+
} // namespace zgh

src/lsd.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
*Copyright: Copyright (c) 2019
33
*Created on 2019-5-24
4-
*Author:zhengaohong@minieye.cc
4+
*Author:zhengaohong@zgheye.cc
55
*Version 1.0.1
66
*/
77

@@ -11,7 +11,7 @@
1111
#include "detect.h"
1212
#include "unitily.h"
1313

14-
namespace MINI {
14+
namespace zgh {
1515

1616

1717
static bool ll_angle(const double *data, double *angles, double *mod, std::vector<Pixel> &sort_points,
@@ -531,4 +531,4 @@ bool lineSegmentDetection(const double *image, int row, int col, std::vector<std
531531
return true;
532532
}
533533

534-
} // namespace MINI
534+
} // namespace zgh

src/unitily.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
*Copyright: Copyright (c) 2019
33
*Created on 2019-5-21
4-
*Author:zhengaohong@minieye.cc
4+
*Author:zhengaohong@zgheye.cc
55
*Version 1.0.1
66
*/
77

@@ -10,7 +10,7 @@
1010
#include "unitily.h"
1111
#include "defines.h"
1212

13-
namespace MINI {
13+
namespace zgh {
1414

1515

1616
bool equal(int x, int y) {
@@ -222,4 +222,4 @@ double nfa(int n, int k, double p, double logNT) {
222222
return nfavalue;
223223
}
224224

225-
} // namespace MINI
225+
} // namespace zgh

test/testdetect.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
*Copyright: Copyright (c) 2019
33
*Created on 2019-6-31
4-
*Author:zhengaohong@minieye.cc
4+
*Author:zhengaohong@zgheye.cc
55
*Version 1.0.1
66
*/
77

@@ -16,7 +16,7 @@
1616
#include "ellipse_detection/detect.h"
1717

1818
using namespace std;
19-
using namespace MINI;
19+
using namespace zgh;
2020

2121
int main(int argc, char* argv[]) {
2222
if (argc <= 1) {

test/testgroup.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
*Copyright: Copyright (c) 2019
33
*Created on 2019-6-20
4-
*Author:zhengaohong@minieye.cc
4+
*Author:zhengaohong@zgheye.cc
55
*Version 1.0.1
66
*/
77

@@ -16,7 +16,7 @@
1616

1717
using namespace std;
1818
using namespace cv;
19-
using namespace MINI;
19+
using namespace zgh;
2020

2121

2222

test/testinital.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
*Copyright: Copyright (c) 2019
33
*Created on 2019-6-24
4-
*Author:zhengaohong@minieye.cc
4+
*Author:zhengaohong@zgheye.cc
55
*Version 1.0.1
66
*/
77

@@ -17,7 +17,7 @@
1717

1818
using namespace std;
1919
using namespace cv;
20-
using namespace MINI;
20+
using namespace zgh;
2121

2222

2323
int main(int argc, char* argv[]) {

test/testlsd.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
*Copyright: Copyright (c) 2019
33
*Created on 2019-5-21
4-
*Author:zhengaohong@minieye.cc
4+
*Author:zhengaohong@zgheye.cc
55
*Version 1.0.1
66
*/
77

@@ -17,7 +17,7 @@
1717

1818
using namespace std;
1919
using namespace cv;
20-
using namespace MINI;
20+
using namespace zgh;
2121

2222

2323

0 commit comments

Comments
 (0)