From f461d0cb7a5ff7b9a7d6cc16baa2e8fd324187d2 Mon Sep 17 00:00:00 2001 From: Viet Dinh Date: Tue, 3 Nov 2015 15:37:25 -0500 Subject: [PATCH] fix compile errors some functions were not found in namespace std --- modules/core/src/mathfuncs.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/core/src/mathfuncs.cpp b/modules/core/src/mathfuncs.cpp index cc2ce6d8f..08649780b 100644 --- a/modules/core/src/mathfuncs.cpp +++ b/modules/core/src/mathfuncs.cpp @@ -2546,14 +2546,14 @@ double cv::solvePoly( InputArray _coeffs0, OutputArray _roots0, int maxIters ) if( num_same_root % 2 != 0){ Mat cube_coefs(4, 1, CV_32FC1); Mat cube_roots(3, 1, CV_32FC2); - cube_coefs.at(3) = -(std::powf(old_num_re, 3)); - cube_coefs.at(2) = -(15*std::powf(old_num_re, 2) + 27*std::powf(old_num_im, 2)); + cube_coefs.at(3) = -(std::pow(old_num_re, 3)); + cube_coefs.at(2) = -(15*std::pow(old_num_re, 2) + 27*std::pow(old_num_im, 2)); cube_coefs.at(1) = -48*old_num_re; cube_coefs.at(0) = 64; cv::solveCubic(cube_coefs, cube_roots); - num.re = std::cbrt(cube_roots.at(0)); - num.im = std::sqrtf(std::powf(num.re, 2) / 3 - old_num_re / (3*num.re)); + num.re = cv::cubeRoot(cube_roots.at(0)); + num.im = std::sqrt(std::pow(num.re, 2) / 3 - old_num_re / (3*num.re)); } }