From cedd7683979f724f9adaf4ae96ea5efe56145b3f Mon Sep 17 00:00:00 2001 From: Daniel Angelov Date: Sun, 21 Jul 2013 01:54:27 +0300 Subject: [PATCH] Fixed the M_PI to CV_PI --- modules/imgproc/src/lsd.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/imgproc/src/lsd.cpp b/modules/imgproc/src/lsd.cpp index 8b653a2..8fcec59 100644 --- a/modules/imgproc/src/lsd.cpp +++ b/modules/imgproc/src/lsd.cpp @@ -93,8 +93,8 @@ inline double dist(const double x1, const double y1, inline double angle_diff_signed(const double& a, const double& b) { double diff = a - b; - while(diff <= -M_PI) diff += M_2__PI; - while(diff > M_PI) diff -= M_2__PI; + while(diff <= -CV_PI) diff += M_2__PI; + while(diff > CV_PI) diff -= M_2__PI; return diff; } @@ -448,7 +448,7 @@ void LineSegmentDetectorImpl::flsd(std::vector& lines, std::vector& nfas) { // Angle tolerance - const double prec = M_PI * ANG_TH / 180; + const double prec = CV_PI * ANG_TH / 180; const double p = ANG_TH / 180; const double rho = QUANT / sin(prec); // gradient magnitude threshold @@ -785,7 +785,7 @@ double LineSegmentDetectorImpl::get_theta(const std::vector& reg, c theta *= DEG_TO_RADS; // Correct angle by 180 deg if necessary - if(angle_diff(theta, reg_angle) > prec) { theta += M_PI; } + if(angle_diff(theta, reg_angle) > prec) { theta += CV_PI; } return theta; } @@ -892,7 +892,7 @@ double LineSegmentDetectorImpl::rect_improve(rect& rec) const for(int n = 0; n < 5; ++n) { r.p /= 2; - r.prec = r.p * M_PI; + r.prec = r.p * CV_PI; double log_nfa_new = rect_nfa(r); if(log_nfa_new > log_nfa) { @@ -968,7 +968,7 @@ double LineSegmentDetectorImpl::rect_improve(rect& rec) const if((r.width - delta) >= 0.5) { r.p /= 2; - r.prec = r.p * M_PI; + r.prec = r.p * CV_PI; double log_nfa_new = rect_nfa(r); if(log_nfa_new > log_nfa) { -- 2.7.4