Skip to content

Commit cedd768

Browse files
committed
Fixed the M_PI to CV_PI
1 parent 965b375 commit cedd768

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

modules/imgproc/src/lsd.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ inline double dist(const double x1, const double y1,
9393
inline double angle_diff_signed(const double& a, const double& b)
9494
{
9595
double diff = a - b;
96-
while(diff <= -M_PI) diff += M_2__PI;
97-
while(diff > M_PI) diff -= M_2__PI;
96+
while(diff <= -CV_PI) diff += M_2__PI;
97+
while(diff > CV_PI) diff -= M_2__PI;
9898
return diff;
9999
}
100100

@@ -448,7 +448,7 @@ void LineSegmentDetectorImpl::flsd(std::vector<Vec4i>& lines,
448448
std::vector<double>& nfas)
449449
{
450450
// Angle tolerance
451-
const double prec = M_PI * ANG_TH / 180;
451+
const double prec = CV_PI * ANG_TH / 180;
452452
const double p = ANG_TH / 180;
453453
const double rho = QUANT / sin(prec); // gradient magnitude threshold
454454

@@ -785,7 +785,7 @@ double LineSegmentDetectorImpl::get_theta(const std::vector<RegionPoint>& reg, c
785785
theta *= DEG_TO_RADS;
786786

787787
// Correct angle by 180 deg if necessary
788-
if(angle_diff(theta, reg_angle) > prec) { theta += M_PI; }
788+
if(angle_diff(theta, reg_angle) > prec) { theta += CV_PI; }
789789

790790
return theta;
791791
}
@@ -892,7 +892,7 @@ double LineSegmentDetectorImpl::rect_improve(rect& rec) const
892892
for(int n = 0; n < 5; ++n)
893893
{
894894
r.p /= 2;
895-
r.prec = r.p * M_PI;
895+
r.prec = r.p * CV_PI;
896896
double log_nfa_new = rect_nfa(r);
897897
if(log_nfa_new > log_nfa)
898898
{
@@ -968,7 +968,7 @@ double LineSegmentDetectorImpl::rect_improve(rect& rec) const
968968
if((r.width - delta) >= 0.5)
969969
{
970970
r.p /= 2;
971-
r.prec = r.p * M_PI;
971+
r.prec = r.p * CV_PI;
972972
double log_nfa_new = rect_nfa(r);
973973
if(log_nfa_new > log_nfa)
974974
{

0 commit comments

Comments
 (0)