diff --git a/apps/traincascade/boost.cpp b/apps/traincascade/boost.cpp index c1a451672a..f74de597d3 100644 --- a/apps/traincascade/boost.cpp +++ b/apps/traincascade/boost.cpp @@ -942,7 +942,7 @@ void CvCascadeBoostTree::write( FileStorage &fs, const Mat& featureMap ) int maxCatCount = ((CvCascadeBoostTrainData*)data)->featureEvaluator->getMaxCatCount(); int subsetN = (maxCatCount + 31)/32; queue internalNodesQueue; - int size = (int)pow( 2.f, (float)ensemble->get_params().max_depth); + int size = (int)std::pow( 2, ensemble->get_params().max_depth); std::vector leafVals(size); int leafValIdx = 0; int internalNodeIdx = 1; diff --git a/apps/traincascade/cascadeclassifier.cpp b/apps/traincascade/cascadeclassifier.cpp index 6540c30e3a..07ee53d7c7 100644 --- a/apps/traincascade/cascadeclassifier.cpp +++ b/apps/traincascade/cascadeclassifier.cpp @@ -198,7 +198,7 @@ bool CvCascadeClassifier::train( const string _cascadeDirName, else if ( startNumStages == 1) cout << endl << "Stage 0 is loaded" << endl; - double requiredLeafFARate = pow( (double) stageParams->maxFalseAlarm, (double) numStages ) / + double requiredLeafFARate = std::pow( stageParams->maxFalseAlarm, numStages ) / (double)stageParams->max_depth; double tempLeafFARate; diff --git a/doc/tutorials/calib3d/real_time_pose/real_time_pose.markdown b/doc/tutorials/calib3d/real_time_pose/real_time_pose.markdown index ba5827a49c..5a5e8e3e2a 100644 --- a/doc/tutorials/calib3d/real_time_pose/real_time_pose.markdown +++ b/doc/tutorials/calib3d/real_time_pose/real_time_pose.markdown @@ -631,9 +631,9 @@ Here is explained in detail the code for the real time application: KF.transitionMatrix.at(3,6) = dt; KF.transitionMatrix.at(4,7) = dt; KF.transitionMatrix.at(5,8) = dt; - KF.transitionMatrix.at(0,6) = 0.5*pow(dt,2); - KF.transitionMatrix.at(1,7) = 0.5*pow(dt,2); - KF.transitionMatrix.at(2,8) = 0.5*pow(dt,2); + KF.transitionMatrix.at(0,6) = 0.5*std::pow(dt,2); + KF.transitionMatrix.at(1,7) = 0.5*std::pow(dt,2); + KF.transitionMatrix.at(2,8) = 0.5*std::pow(dt,2); // orientation KF.transitionMatrix.at(9,12) = dt; @@ -642,9 +642,9 @@ Here is explained in detail the code for the real time application: KF.transitionMatrix.at(12,15) = dt; KF.transitionMatrix.at(13,16) = dt; KF.transitionMatrix.at(14,17) = dt; - KF.transitionMatrix.at(9,15) = 0.5*pow(dt,2); - KF.transitionMatrix.at(10,16) = 0.5*pow(dt,2); - KF.transitionMatrix.at(11,17) = 0.5*pow(dt,2); + KF.transitionMatrix.at(9,15) = 0.5*std::pow(dt,2); + KF.transitionMatrix.at(10,16) = 0.5*std::pow(dt,2); + KF.transitionMatrix.at(11,17) = 0.5*std::pow(dt,2); /* MEASUREMENT MODEL */ diff --git a/modules/calib3d/src/chessboard.cpp b/modules/calib3d/src/chessboard.cpp index 5855c3f255..03ed778d7c 100644 --- a/modules/calib3d/src/chessboard.cpp +++ b/modules/calib3d/src/chessboard.cpp @@ -725,7 +725,7 @@ void FastX::detectImpl(const cv::Mat& _gray_image, // calc images // for each angle step int scale_id = scale-parameters.min_scale; - int scale_size = int(pow(2.0,scale+1+super_res)); + int scale_size = int(std::pow(2,scale+1+super_res)); int scale_size2 = int((scale_size/7)*2+1); std::vector images; images.resize(2*num); diff --git a/modules/calib3d/src/dls.h b/modules/calib3d/src/dls.h index a3382498c9..1655930282 100644 --- a/modules/calib3d/src/dls.h +++ b/modules/calib3d/src/dls.h @@ -162,7 +162,7 @@ private: int n1 = nn - 1; int low = 0; int high = nn - 1; - double eps = std::pow(2.0, -52.0); + double eps = std::pow(2, -52); double exshift = 0.0; double p = 0, q = 0, r = 0, s = 0, z = 0, t, w, x, y; diff --git a/modules/calib3d/src/rho.cpp b/modules/calib3d/src/rho.cpp index 6edb3b8272..e1990021f5 100644 --- a/modules/calib3d/src/rho.cpp +++ b/modules/calib3d/src/rho.cpp @@ -1744,7 +1744,7 @@ static inline unsigned sacCalcIterBound(double confidence, * \[ k = \frac{\log{(1-confidence)}}{\log{(1-inlierRate**sampleSize)}} \] */ - double atLeastOneOutlierProbability = 1.-pow(inlierRate, (double)sampleSize); + double atLeastOneOutlierProbability = 1.-std::pow(inlierRate, (double)sampleSize); /** * There are two special cases: When argument to log() is 0 and when it is 1. diff --git a/modules/calib3d/src/triangulate.cpp b/modules/calib3d/src/triangulate.cpp index 671659c84b..851ca5d7be 100644 --- a/modules/calib3d/src/triangulate.cpp +++ b/modules/calib3d/src/triangulate.cpp @@ -319,9 +319,9 @@ icvCorrectMatches(CvMat *F_, CvMat *points1_, CvMat *points2_, CvMat *new_points x1 = tmp31_2->data.db[0]; y1 = tmp31_2->data.db[1]; - tmp31->data.db[0] = f2*pow(c*t_min+d,2); + tmp31->data.db[0] = f2*std::pow(c*t_min+d,2); tmp31->data.db[1] = -(a*t_min+b)*(c*t_min+d); - tmp31->data.db[2] = f2*f2*pow(c*t_min+d,2) + pow(a*t_min+b,2); + tmp31->data.db[2] = f2*f2*std::pow(c*t_min+d,2) + std::pow(a*t_min+b,2); tmp31->data.db[0] /= tmp31->data.db[2]; tmp31->data.db[1] /= tmp31->data.db[2]; tmp31->data.db[2] /= tmp31->data.db[2]; diff --git a/modules/calib3d/src/undistort.dispatch.cpp b/modules/calib3d/src/undistort.dispatch.cpp index 0d08c4d781..c56d1d7e7b 100644 --- a/modules/calib3d/src/undistort.dispatch.cpp +++ b/modules/calib3d/src/undistort.dispatch.cpp @@ -516,7 +516,7 @@ static void cvUndistortPointsInternal( const CvMat* _src, CvMat* _dst, const CvM double x_proj = xd*fx + cx; double y_proj = yd*fy + cy; - error = sqrt( pow(x_proj - u, 2) + pow(y_proj - v, 2) ); + error = sqrt( std::pow(x_proj - u, 2) + std::pow(y_proj - v, 2) ); } if (error > prevError) { alpha *= .5; diff --git a/modules/calib3d/src/upnp.cpp b/modules/calib3d/src/upnp.cpp index 24db8f1142..c00afc6b75 100644 --- a/modules/calib3d/src/upnp.cpp +++ b/modules/calib3d/src/upnp.cpp @@ -411,18 +411,18 @@ Mat upnp::compute_constraint_distance_2param_6eq_2unk_f_unk(const Mat& M1) double m[13]; for (int i = 1; i < 13; ++i) m[i] = *M1.ptr(i-1); - double t1 = pow( m[4], 2 ); - double t4 = pow( m[1], 2 ); - double t5 = pow( m[5], 2 ); - double t8 = pow( m[2], 2 ); - double t10 = pow( m[6], 2 ); - double t13 = pow( m[3], 2 ); - double t15 = pow( m[7], 2 ); - double t18 = pow( m[8], 2 ); - double t22 = pow( m[9], 2 ); - double t26 = pow( m[10], 2 ); - double t29 = pow( m[11], 2 ); - double t33 = pow( m[12], 2 ); + double t1 = std::pow( m[4], 2 ); + double t4 = std::pow( m[1], 2 ); + double t5 = std::pow( m[5], 2 ); + double t8 = std::pow( m[2], 2 ); + double t10 = std::pow( m[6], 2 ); + double t13 = std::pow( m[3], 2 ); + double t15 = std::pow( m[7], 2 ); + double t18 = std::pow( m[8], 2 ); + double t22 = std::pow( m[9], 2 ); + double t26 = std::pow( m[10], 2 ); + double t29 = std::pow( m[11], 2 ); + double t33 = std::pow( m[12], 2 ); *P.ptr(0,0) = t1 - 2 * m[4] * m[1] + t4 + t5 - 2 * m[5] * m[2] + t8; *P.ptr(0,1) = t10 - 2 * m[6] * m[3] + t13; @@ -451,42 +451,42 @@ Mat upnp::compute_constraint_distance_3param_6eq_6unk_f_unk(const Mat& M1, const m[2][i] = *M2.ptr(i-1); } - double t1 = pow( m[1][4], 2 ); - double t2 = pow( m[1][1], 2 ); - double t7 = pow( m[1][5], 2 ); - double t8 = pow( m[1][2], 2 ); + double t1 = std::pow( m[1][4], 2 ); + double t2 = std::pow( m[1][1], 2 ); + double t7 = std::pow( m[1][5], 2 ); + double t8 = std::pow( m[1][2], 2 ); double t11 = m[1][1] * m[2][1]; double t12 = m[1][5] * m[2][5]; double t15 = m[1][2] * m[2][2]; double t16 = m[1][4] * m[2][4]; - double t19 = pow( m[2][4], 2 ); - double t22 = pow( m[2][2], 2 ); - double t23 = pow( m[2][1], 2 ); - double t24 = pow( m[2][5], 2 ); - double t28 = pow( m[1][6], 2 ); - double t29 = pow( m[1][3], 2 ); - double t34 = pow( m[1][3], 2 ); + double t19 = std::pow( m[2][4], 2 ); + double t22 = std::pow( m[2][2], 2 ); + double t23 = std::pow( m[2][1], 2 ); + double t24 = std::pow( m[2][5], 2 ); + double t28 = std::pow( m[1][6], 2 ); + double t29 = std::pow( m[1][3], 2 ); + double t34 = std::pow( m[1][3], 2 ); double t36 = m[1][6] * m[2][6]; - double t40 = pow( m[2][6], 2 ); - double t41 = pow( m[2][3], 2 ); - double t47 = pow( m[1][7], 2 ); - double t48 = pow( m[1][8], 2 ); + double t40 = std::pow( m[2][6], 2 ); + double t41 = std::pow( m[2][3], 2 ); + double t47 = std::pow( m[1][7], 2 ); + double t48 = std::pow( m[1][8], 2 ); double t52 = m[1][7] * m[2][7]; double t55 = m[1][8] * m[2][8]; - double t59 = pow( m[2][8], 2 ); - double t62 = pow( m[2][7], 2 ); - double t64 = pow( m[1][9], 2 ); + double t59 = std::pow( m[2][8], 2 ); + double t62 = std::pow( m[2][7], 2 ); + double t64 = std::pow( m[1][9], 2 ); double t68 = m[1][9] * m[2][9]; - double t74 = pow( m[2][9], 2 ); - double t78 = pow( m[1][10], 2 ); - double t79 = pow( m[1][11], 2 ); + double t74 = std::pow( m[2][9], 2 ); + double t78 = std::pow( m[1][10], 2 ); + double t79 = std::pow( m[1][11], 2 ); double t84 = m[1][10] * m[2][10]; double t87 = m[1][11] * m[2][11]; - double t90 = pow( m[2][10], 2 ); - double t95 = pow( m[2][11], 2 ); - double t99 = pow( m[1][12], 2 ); + double t90 = std::pow( m[2][10], 2 ); + double t95 = std::pow( m[2][11], 2 ); + double t99 = std::pow( m[1][12], 2 ); double t101 = m[1][12] * m[2][12]; - double t105 = pow( m[2][12], 2 ); + double t105 = std::pow( m[2][12], 2 ); *P.ptr(0,0) = t1 + t2 - 2 * m[1][4] * m[1][1] - 2 * m[1][5] * m[1][2] + t7 + t8; *P.ptr(0,1) = -2 * m[2][4] * m[1][1] + 2 * t11 + 2 * t12 - 2 * m[1][4] * m[2][1] - 2 * m[2][5] * m[1][2] + 2 * t15 + 2 * t16 - 2 * m[1][5] * m[2][2]; diff --git a/modules/calib3d/src/usac/degeneracy.cpp b/modules/calib3d/src/usac/degeneracy.cpp index bf5ec2b110..590c8aaf9b 100644 --- a/modules/calib3d/src/usac/degeneracy.cpp +++ b/modules/calib3d/src/usac/degeneracy.cpp @@ -435,7 +435,7 @@ public: const int num_f_inliers_of_h_outliers = getNonPlanarSupport(Mat(F), num_models_used_so_far >= MAX_MODELS_TO_TEST, non_planar_support); if (non_planar_support < num_f_inliers_of_h_outliers) { non_planar_support = num_f_inliers_of_h_outliers; - const double predicted_iters = log_conf / log(1 - pow(static_cast + const double predicted_iters = log_conf / log(1 - std::pow(static_cast (getNonPlanarSupport(Mat(F), non_planar_pts, num_non_planar_pts)) / num_non_planar_pts, 2)); if (use_preemptive && ! std::isinf(predicted_iters) && predicted_iters < max_iters) max_iters = static_cast(predicted_iters); diff --git a/modules/calib3d/src/usac/local_optimization.cpp b/modules/calib3d/src/usac/local_optimization.cpp index 8c3703940f..c1ba11f10c 100644 --- a/modules/calib3d/src/usac/local_optimization.cpp +++ b/modules/calib3d/src/usac/local_optimization.cpp @@ -454,7 +454,7 @@ public: DoF = DoF_; C = C_; max_sigma = max_sigma_; squared_sigma_max_2 = max_sigma * max_sigma * 2.0; - one_over_sigma = C * pow(2.0, (DoF - 1.0) * 0.5) / max_sigma; + one_over_sigma = C * std::pow(2, (DoF - 1.0) * 0.5) / max_sigma; max_sigma_sqr = squared_sigma_max_2 * 0.5; rescale_err = scale_of_stored_gammas / squared_sigma_max_2; } @@ -464,7 +464,7 @@ public: int getInliersWeights (const std::vector &errors, std::vector &inliers, std::vector &weights, double thr_sqr) const override { const auto _max_sigma = thr_sqr; const auto _squared_sigma_max_2 = _max_sigma * _max_sigma * 2.0; - const auto _one_over_sigma = C * pow(2.0, (DoF - 1.0) * 0.5) / _max_sigma; + const auto _one_over_sigma = C * std::pow(2, (DoF - 1.0) * 0.5) / _max_sigma; const auto _max_sigma_sqr = _squared_sigma_max_2 * 0.5; const auto _rescale_err = scale_of_stored_gammas / _squared_sigma_max_2; return getInliersWeights(errors, inliers, weights, _one_over_sigma, _rescale_err, _max_sigma_sqr); diff --git a/modules/calib3d/src/usac/quality.cpp b/modules/calib3d/src/usac/quality.cpp index 9a72f754f5..9935eada56 100644 --- a/modules/calib3d/src/usac/quality.cpp +++ b/modules/calib3d/src/usac/quality.cpp @@ -197,7 +197,7 @@ public: const auto maximum_sigma_2 = (float) (maximum_sigma * maximum_sigma); maximum_sigma_2_per_2 = maximum_sigma_2 / 2.f; const auto maximum_sigma_2_times_2 = maximum_sigma_2 * 2.f; - two_ad_dof_plus_one_per_maximum_sigma = pow(2.0, (DoF + 1.0)*.5)/maximum_sigma; + two_ad_dof_plus_one_per_maximum_sigma = std::pow(2, (DoF + 1.0)*.5)/maximum_sigma; rescale_err = gamma_generator->getScaleOfGammaCompleteValues() / maximum_sigma_2_times_2; stored_incomplete_gamma_number_min1 = static_cast(gamma_generator->getTableSize()-1); diff --git a/modules/calib3d/src/usac/ransac_solvers.cpp b/modules/calib3d/src/usac/ransac_solvers.cpp index 494bbc1517..468a9be64a 100644 --- a/modules/calib3d/src/usac/ransac_solvers.cpp +++ b/modules/calib3d/src/usac/ransac_solvers.cpp @@ -1014,14 +1014,14 @@ public: _quality->getInliers(best_model, temp_inliers)); // quick test on lambda from all inliers (= upper bound of independent inliers) // if model with independent inliers is not random for Poisson with all inliers then it is not random using independent inliers too - if (pow(Utils::getPoissonCDF(lambda_non_random_all_inliers, non_random_inls_best_model), num_total_tested_models) < 0.9999) { + if (std::pow(Utils::getPoissonCDF(lambda_non_random_all_inliers, non_random_inls_best_model), num_total_tested_models) < 0.9999) { std::vector inliers_list(models_for_random_test.size()); for (int m = 0; m < (int)models_for_random_test.size(); m++) inliers_list[m] = getIndependentInliers(models_for_random_test[m], samples_for_random_test[m], temp_inliers, _quality->getInliers(models_for_random_test[m], temp_inliers)); int min_non_rand_inliers; const double lambda = getLambda(inliers_list, 1.644, points_size, sample_size, true, min_non_rand_inliers); - const double cdf_lambda = Utils::getPoissonCDF(lambda, non_random_inls_best_model), cdf_N = pow(cdf_lambda, num_total_tested_models); + const double cdf_lambda = Utils::getPoissonCDF(lambda, non_random_inls_best_model), cdf_N = std::pow(cdf_lambda, num_total_tested_models); model_conf = cdf_N < 0.9999 ? ModelConfidence ::RANDOM : ModelConfidence ::NON_RANDOM; } else model_conf = ModelConfidence ::NON_RANDOM; } diff --git a/modules/calib3d/src/usac/termination.cpp b/modules/calib3d/src/usac/termination.cpp index 26a9e331ed..58c6356b54 100644 --- a/modules/calib3d/src/usac/termination.cpp +++ b/modules/calib3d/src/usac/termination.cpp @@ -42,7 +42,7 @@ public: } static int getMaxIterations (int inlier_number, int sample_size, int points_size, double conf) { - const double pred_iters = log(1 - conf) / log(1 - pow(static_cast(inlier_number)/points_size, sample_size)); + const double pred_iters = log(1 - conf) / log(1 - std::pow(static_cast(inlier_number)/points_size, sample_size)); if (std::isinf(pred_iters)) return INT_MAX; return (int) pred_iters + 1; @@ -322,7 +322,7 @@ public: continue; // add 1 to termination length since num_inliers_under_termination_len is updated - const double new_max_samples = log_conf/log(1-pow(static_cast(num_inliers_under_termination_len) + const double new_max_samples = log_conf/log(1-std::pow(static_cast(num_inliers_under_termination_len) / (termination_len+1), sample_size)); if (! std::isinf(new_max_samples) && predicted_iterations > new_max_samples) { diff --git a/modules/calib3d/test/test_undistort_points.cpp b/modules/calib3d/test/test_undistort_points.cpp index faed9b5dcf..c02b4ef003 100644 --- a/modules/calib3d/test/test_undistort_points.cpp +++ b/modules/calib3d/test/test_undistort_points.cpp @@ -194,7 +194,7 @@ TEST_F(UndistortPointsTest, stop_criteria) projectPoints(pt_undist_vec_homogeneous, -rVec, Mat::zeros(3,1,CV_64F), cameraMatrix, distCoeffs, pt_redistorted_vec); - const double obtainedError = sqrt( pow(pt_distorted.x - pt_redistorted_vec[0].x, 2) + pow(pt_distorted.y - pt_redistorted_vec[0].y, 2) ); + const double obtainedError = sqrt( std::pow(pt_distorted.x - pt_redistorted_vec[0].x, 2) + std::pow(pt_distorted.y - pt_redistorted_vec[0].y, 2) ); ASSERT_LE(obtainedError, maxError); } diff --git a/modules/calib3d/test/test_usac.cpp b/modules/calib3d/test/test_usac.cpp index 90dcb76ffc..94b2877549 100644 --- a/modules/calib3d/test/test_usac.cpp +++ b/modules/calib3d/test/test_usac.cpp @@ -182,8 +182,8 @@ static double getError (TestSolver test_case, int pt_idx, const cv::Mat &pts1, c cv::Mat l2 = model * pt1; cv::Mat l1 = model.t() * pt2; // Sampson error - return fabs(pt2.dot(l2)) / sqrt(pow(l1.at(0), 2) + pow(l1.at(1), 2) + - pow(l2.at(0), 2) + pow(l2.at(1), 2)); + return fabs(pt2.dot(l2)) / sqrt(std::pow(l1.at(0), 2) + std::pow(l1.at(1), 2) + + std::pow(l2.at(0), 2) + std::pow(l2.at(1), 2)); } else if (test_case == TestSolver::PnP) { // PnP, reprojection error cv::Mat img_pt = model * pt2; img_pt /= img_pt.at(2); @@ -233,7 +233,7 @@ TEST(usac_Homography, accuracy) { pts_size, TestSolver ::Homogr, inl_ratio/*inl ratio*/, 0.1 /*noise std*/, gt_inliers); // compute max_iters with standard upper bound rule for RANSAC with 1.5x tolerance const double conf = 0.99, thr = 2., max_iters = 1.3 * log(1 - conf) / - log(1 - pow(inl_ratio, 4 /* sample size */)); + log(1 - std::pow(inl_ratio, 4 /* sample size */)); for (auto flag : flags) { cv::Mat mask, H = cv::findHomography(pts1, pts2,flag, thr, mask, int(max_iters), conf); @@ -257,7 +257,7 @@ TEST(usac_Fundamental, accuracy) { for (auto flag : flags) { const int sample_size = flag == USAC_FM_8PTS ? 8 : 7; const double max_iters = 1.25 * log(1 - conf) / - log(1 - pow(inl_ratio, sample_size)); + log(1 - std::pow(inl_ratio, sample_size)); cv::Mat mask, F = cv::findFundamentalMat(pts1, pts2,flag, thr, conf, int(max_iters), mask); checkInliersMask(TestSolver::Fundam, inl_size, thr, pts1, pts2, F, mask); @@ -374,7 +374,7 @@ TEST(usac_P3P, accuracy) { int inl_size = generatePoints(rng, img_pts, obj_pts, K1, K2, false /*two calib*/, pts_size, TestSolver ::PnP, inl_ratio, 0.15 /*noise std*/, gt_inliers); const double conf = 0.99, thr = 2., max_iters = 1.3 * log(1 - conf) / - log(1 - pow(inl_ratio, 3 /* sample size */)); + log(1 - std::pow(inl_ratio, 3 /* sample size */)); for (auto flag : flags) { std::vector inliers; @@ -402,7 +402,7 @@ TEST (usac_Affine2D, accuracy) { int inl_size = generatePoints(rng, pts1, pts2, K1, K2, false /*two calib*/, pts_size, TestSolver ::Affine, inl_ratio, 0.15 /*noise std*/, gt_inliers); const double conf = 0.99, thr = 2., max_iters = 1.3 * log(1 - conf) / - log(1 - pow(inl_ratio, 3 /* sample size */)); + log(1 - std::pow(inl_ratio, 3 /* sample size */)); for (auto flag : flags) { cv::Mat mask, A = cv::estimateAffine2D(pts1, pts2, mask, flag, thr, (size_t)max_iters, conf, 0); cv::vconcat(A, cv::Mat(cv::Matx13d(0,0,1)), A); @@ -493,7 +493,7 @@ TEST(usac_solvePnPRansac, regression_21105) { generatePoints(rng, img_pts, obj_pts, K1, K2, false /*two calib*/, pts_size, TestSolver ::PnP, inl_ratio, 0.15 /*noise std*/, gt_inliers); const double conf = 0.99, thr = 2., max_iters = 1.3 * log(1 - conf) / - log(1 - pow(inl_ratio, 3 /* sample size */)); + log(1 - std::pow(inl_ratio, 3 /* sample size */)); const int flag = USAC_DEFAULT; std::vector inliers; cv::Matx31d rvec, tvec; diff --git a/modules/core/src/mathfuncs.cpp b/modules/core/src/mathfuncs.cpp index 7108f2e81d..71ff383eb4 100644 --- a/modules/core/src/mathfuncs.cpp +++ b/modules/core/src/mathfuncs.cpp @@ -1675,16 +1675,8 @@ int cv::solveCubic( InputArray _coeffs, OutputArray _roots ) } else if( d == 0 ) { - if(R >= 0) - { - x0 = -2*pow(R, 1./3) - a1/3; - x1 = pow(R, 1./3) - a1/3; - } - else - { - x0 = 2*pow(-R, 1./3) - a1/3; - x1 = -pow(-R, 1./3) - a1/3; - } + x0 = -2*std::cbrt(R) - a1/3; + x1 = std::cbrt(R) - a1/3; x2 = 0; n = x0 == x1 ? 1 : 2; x1 = x0 == x1 ? 0 : x1; @@ -1693,7 +1685,7 @@ int cv::solveCubic( InputArray _coeffs, OutputArray _roots ) { double e; d = sqrt(-d); - e = pow(d + fabs(R), 1./3); + e = std::cbrt(d + fabs(R)); if( R > 0 ) e = -e; x0 = (e + Q / e) - a1 * (1./3); @@ -1808,15 +1800,14 @@ double cv::solvePoly( InputArray _coeffs0, OutputArray _roots0, int maxIters ) if( num_same_root % 2 != 0){ Mat cube_coefs(4, 1, CV_64FC1); Mat cube_roots(3, 1, CV_64FC2); - cube_coefs.at(3) = -(pow(old_num_re, 3)); - cube_coefs.at(2) = -(15*pow(old_num_re, 2) + 27*pow(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; solveCubic(cube_coefs, cube_roots); - if(cube_roots.at(0) >= 0) num.re = pow(cube_roots.at(0), 1./3); - else num.re = -pow(-cube_roots.at(0), 1./3); - num.im = sqrt(pow(num.re, 2) / 3 - old_num_re / (3*num.re)); + num.re = std::cbrt(cube_roots.at(0)); + num.im = sqrt(std::pow(num.re, 2) / 3 - old_num_re / (3*num.re)); } } roots[i] = p - num; diff --git a/modules/core/test/test_countnonzero.cpp b/modules/core/test/test_countnonzero.cpp index 41eaceb189..4641896130 100644 --- a/modules/core/test/test_countnonzero.cpp +++ b/modules/core/test/test_countnonzero.cpp @@ -265,7 +265,7 @@ TEST_P (CountNonZeroND, ndim) data = 0; EXPECT_EQ(0, cv::countNonZero(data)); data = Scalar::all(1); - int expected = static_cast(pow(static_cast(ONE_SIZE), dims)); + int expected = static_cast(std::pow(static_cast(ONE_SIZE), dims)); EXPECT_EQ(expected, cv::countNonZero(data)); } diff --git a/modules/core/test/test_eigen.cpp b/modules/core/test/test_eigen.cpp index ca402d5ec0..5a21ee5b13 100644 --- a/modules/core/test/test_eigen.cpp +++ b/modules/core/test/test_eigen.cpp @@ -367,7 +367,7 @@ bool Core_EigenTest::check_full(int type) for (int i = 0; i < ntests; ++i) { - int src_size = (int)(std::pow(2.0, (rng.uniform(0, MAX_DEGREE) + 1.))); + int src_size = (int)(std::pow(2, (rng.uniform(0, MAX_DEGREE) + 1.))); cv::Mat src(src_size, src_size, type); diff --git a/modules/core/test/test_math.cpp b/modules/core/test/test_math.cpp index c7c5dceb31..5c3df87ddb 100644 --- a/modules/core/test/test_math.cpp +++ b/modules/core/test/test_math.cpp @@ -146,7 +146,7 @@ void Core_PowTest::get_minmax_bounds( int /*i*/, int /*j*/, int type, Scalar& lo if( power > 0 ) { double mval = cvtest::getMaxVal(type); - double u1 = pow(mval,1./power)*2; + double u1 = std::pow(mval,1./power)*2; u = MIN(u,u1); } @@ -322,7 +322,7 @@ void Core_PowTest::prepare_to_validation( int /*test_case_idx*/ ) for( j = 0; j < ncols; j++ ) { double val = ((float*)a_data)[j]; - val = pow( fabs(val), power ); + val = std::pow( fabs(val), power ); ((float*)b_data)[j] = (float)val; } else @@ -340,7 +340,7 @@ void Core_PowTest::prepare_to_validation( int /*test_case_idx*/ ) for( j = 0; j < ncols; j++ ) { double val = ((double*)a_data)[j]; - val = pow( fabs(val), power ); + val = std::pow( fabs(val), power ); ((double*)b_data)[j] = (double)val; } else @@ -2394,7 +2394,7 @@ void Core_SolvePolyTest::run( int ) for (int j = 0; j < n; ++j) { s += fabs(r[j].real()) + fabs(r[j].imag()); - div += sqrt(pow(r[j].real() - ar[j].real(), 2) + pow(r[j].imag() - ar[j].imag(), 2)); + div += sqrt(std::pow(r[j].real() - ar[j].real(), 2) + std::pow(r[j].imag() - ar[j].imag(), 2)); } div /= s; pass = pass && div < err_eps; diff --git a/modules/dnn/src/layers/elementwise_layers.cpp b/modules/dnn/src/layers/elementwise_layers.cpp index e7644aeb92..e38d7688e9 100644 --- a/modules/dnn/src/layers/elementwise_layers.cpp +++ b/modules/dnn/src/layers/elementwise_layers.cpp @@ -2619,7 +2619,7 @@ struct PowerFunctor : public BaseFunctor for( int i = 0; i < len; i++ ) { float x = srcptr[i]; - dstptr[i] = pow(a*x + b, p); + dstptr[i] = std::pow(a*x + b, p); } } } @@ -2674,7 +2674,7 @@ struct PowerFunctor : public BaseFunctor } if (power != 1.0f) { - topExpr = pow(topExpr, power); + topExpr = std::pow(topExpr, power); } top(x, y, c, n) = topExpr; } diff --git a/modules/dnn/src/layers/lrn_layer.cpp b/modules/dnn/src/layers/lrn_layer.cpp index 4863be2e3d..6859d73e59 100644 --- a/modules/dnn/src/layers/lrn_layer.cpp +++ b/modules/dnn/src/layers/lrn_layer.cpp @@ -396,7 +396,7 @@ public: base = alphaSize * sum(padded_sq(x + r.x, y + r.y, c, n)); } base += static_cast(bias); - top(x, y, c, n) = inputBuffer(x, y, c, n) / pow(base, beta); + top(x, y, c, n) = inputBuffer(x, y, c, n) / std::pow(base, beta); return Ptr(new HalideBackendNode({ padded_sq, top })); #endif // HAVE_HALIDE return Ptr(); diff --git a/modules/dnn/src/layers/normalize_bbox_layer.cpp b/modules/dnn/src/layers/normalize_bbox_layer.cpp index d2324b2a94..89a6ea053e 100644 --- a/modules/dnn/src/layers/normalize_bbox_layer.cpp +++ b/modules/dnn/src/layers/normalize_bbox_layer.cpp @@ -147,7 +147,7 @@ public: { // add eps to avoid overflow float absSum = sum(buffer)[0] + epsilon; - float norm = pow(absSum, 1.0f / pnorm); + float norm = std::pow(absSum, 1.0f / pnorm); multiply(src, 1.0f / norm, dst); } else @@ -229,7 +229,7 @@ public: { // add eps to avoid overflow float absSum = sum(buffer)[0] + epsilon; - float norm = pow(absSum, 1.0f / pnorm); + float norm = std::pow(absSum, 1.0f / pnorm); multiply(src, 1.0f / norm, dst); } else diff --git a/modules/dnn/src/opencl/activations.cl b/modules/dnn/src/opencl/activations.cl index bbd03b2ea1..22823620a5 100644 --- a/modules/dnn/src/opencl/activations.cl +++ b/modules/dnn/src/opencl/activations.cl @@ -141,7 +141,7 @@ __kernel void PowForward(const int n, __global const T* in, __global T* out, { int index = get_global_id(0); if (index < n) - out[index] = pow(shift + scale * in[index], power); + out[index] = std::pow(shift + scale * in[index], power); } __kernel void ELUForward(const int n, __global const T* in, __global T* out, diff --git a/modules/dnn/src/opencl/conv_layer_spatial.cl b/modules/dnn/src/opencl/conv_layer_spatial.cl index 0ac074b26b..1b0b2d6ba2 100644 --- a/modules/dnn/src/opencl/conv_layer_spatial.cl +++ b/modules/dnn/src/opencl/conv_layer_spatial.cl @@ -55,7 +55,7 @@ #define ACTIVATION_RELU_FUNCTION(x, c) ((Dtype)(x) > 0 ? (Dtype)(x) : ((Dtype)(x) * (negative_slope[c]))) #define FUSED_ARG __global const KERNEL_ARG_DTYPE* negative_slope, #elif defined(FUSED_CONV_POWER) -#define ACTIVATION_RELU_FUNCTION(x, c) pow(x, (Dtype)power) +#define ACTIVATION_RELU_FUNCTION(x, c) std::pow(x, (Dtype)power) #define FUSED_ARG KERNEL_ARG_DTYPE power, #elif defined(FUSED_CONV_TANH) #define ACTIVATION_RELU_FUNCTION(x, c) tanh(x) diff --git a/modules/dnn/src/opencl/lrn.cl b/modules/dnn/src/opencl/lrn.cl index 2ff03f0edf..52ba8a9166 100644 --- a/modules/dnn/src/opencl/lrn.cl +++ b/modules/dnn/src/opencl/lrn.cl @@ -28,7 +28,7 @@ __kernel void LRNComputeOutput(const int nthreads, __global T* in, __global T* s int index = get_global_id(0); int tmp = get_global_size(0); for(index; index < nthreads; index += tmp) - out[index] = in[index] * pow(scale[index], negative_beta); + out[index] = in[index] * std::pow(scale[index], negative_beta); } __kernel void LRNFillScale(const int nthreads, __global T* in, const int num, const int channels, const int height, const int width, const int size, const T alpha_over_size, const T k, __global T* scale) { diff --git a/modules/dnn/test/test_common.impl.hpp b/modules/dnn/test/test_common.impl.hpp index a12f2fe5b4..104ddec7ee 100644 --- a/modules/dnn/test/test_common.impl.hpp +++ b/modules/dnn/test/test_common.impl.hpp @@ -508,7 +508,7 @@ size_t DNNTestLayer::getTopMemoryUsageMB() #ifdef _WIN32 PROCESS_MEMORY_COUNTERS proc; GetProcessMemoryInfo(GetCurrentProcess(), &proc, sizeof(proc)); - return proc.PeakWorkingSetSize / pow(1024, 2); // bytes to megabytes + return proc.PeakWorkingSetSize / std::pow(1024, 2); // bytes to megabytes #else std::ifstream status("/proc/self/status"); std::string line, title; diff --git a/modules/features2d/src/brisk.cpp b/modules/features2d/src/brisk.cpp index a324f44718..46fbef388d 100644 --- a/modules/features2d/src/brisk.cpp +++ b/modules/features2d/src/brisk.cpp @@ -446,7 +446,7 @@ BRISK_Impl::generateKernel(const std::vector &radiusList, const float sigma_scale = 1.3f; for (unsigned int scale = 0; scale < scales_; ++scale) { - scaleList_[scale] = (float) std::pow((double) 2.0, (double) (scale * lb_scale_step)); + scaleList_[scale] = (float) std::pow(2, scale * lb_scale_step); sizeList_[scale] = 0; BriskPatternPoint *patternIteratorOuter = patternPoints_ + (scale * n_rot_ * points_); // generate the pattern points look-up diff --git a/modules/features2d/src/kaze/AKAZEFeatures.cpp b/modules/features2d/src/kaze/AKAZEFeatures.cpp index 0c0332030d..e91bb5e349 100644 --- a/modules/features2d/src/kaze/AKAZEFeatures.cpp +++ b/modules/features2d/src/kaze/AKAZEFeatures.cpp @@ -73,7 +73,7 @@ void AKAZEFeatures::Allocate_Memory_Evolution(void) { for (int j = 0; j < options_.nsublevels; j++) { MEvolution step; step.size = Size(level_width, level_height); - step.esigma = options_.soffset*pow(2.f, (float)(j) / (float)(options_.nsublevels) + i); + step.esigma = (float)(options_.soffset*std::pow(2, (float)(j) / (float)(options_.nsublevels) + i)); step.sigma_size = cvRound(step.esigma * options_.derivative_factor / power); // In fact sigma_size only depends on j step.etime = 0.5f * (step.esigma * step.esigma); step.octave = i; diff --git a/modules/features2d/src/kaze/KAZEFeatures.cpp b/modules/features2d/src/kaze/KAZEFeatures.cpp index 7bd0ba6dcd..72327e8683 100644 --- a/modules/features2d/src/kaze/KAZEFeatures.cpp +++ b/modules/features2d/src/kaze/KAZEFeatures.cpp @@ -66,7 +66,7 @@ void KAZEFeatures::Allocate_Memory_Evolution(void) { aux.Lt = Mat::zeros(options_.img_height, options_.img_width, CV_32F); aux.Lsmooth = Mat::zeros(options_.img_height, options_.img_width, CV_32F); aux.Ldet = Mat::zeros(options_.img_height, options_.img_width, CV_32F); - aux.esigma = options_.soffset*pow((float)2.0f, (float)(j) / (float)(options_.nsublevels)+i); + aux.esigma = (float)(options_.soffset*std::pow(2, (float)(j) / (float)(options_.nsublevels)+i)); aux.etime = 0.5f*(aux.esigma*aux.esigma); aux.sigma_size = cvRound(aux.esigma); aux.octave = i; @@ -472,7 +472,7 @@ void KAZEFeatures::Do_Subpixel_Refinement(std::vector &kpts) { dsc = kpts_[i].octave + (kpts_[i].angle + *(dst.ptr(2))) / ((float)(options_.nsublevels)); // In OpenCV the size of a keypoint is the diameter!! - kpts_[i].size = 2.0f*options_.soffset*pow((float)2.0f, dsc); + kpts_[i].size = (float)(2*options_.soffset*std::pow(2, dsc)); kpts_[i].angle = 0.0; } // Set the points to be deleted after the for loop diff --git a/modules/features2d/src/sift.dispatch.cpp b/modules/features2d/src/sift.dispatch.cpp index d5c1171e9f..92d85ca86e 100644 --- a/modules/features2d/src/sift.dispatch.cpp +++ b/modules/features2d/src/sift.dispatch.cpp @@ -231,10 +231,10 @@ void SIFT_Impl::buildGaussianPyramid( const Mat& base, std::vector& pyr, in // precompute Gaussian sigmas using the following formula: // \sigma_{total}^2 = \sigma_{i}^2 + \sigma_{i-1}^2 sig[0] = sigma; - double k = std::pow( 2., 1. / nOctaveLayers ); + double k = std::pow( 2, 1. / nOctaveLayers ); for( int i = 1; i < nOctaveLayers + 3; i++ ) { - double sig_prev = std::pow(k, (double)(i-1))*sigma; + double sig_prev = (double)std::pow(k, i-1)*sigma; double sig_total = sig_prev*k; sig[i] = std::sqrt(sig_total*sig_total - sig_prev*sig_prev); } diff --git a/modules/flann/include/opencv2/flann/dist.h b/modules/flann/include/opencv2/flann/dist.h index b0c0ec820f..7d36bc80ae 100644 --- a/modules/flann/include/opencv2/flann/dist.h +++ b/modules/flann/include/opencv2/flann/dist.h @@ -397,7 +397,7 @@ struct MinkowskiDistance diff1 = (ResultType)abs(a[1] - b[1]); diff2 = (ResultType)abs(a[2] - b[2]); diff3 = (ResultType)abs(a[3] - b[3]); - result += pow(diff0,order) + pow(diff1,order) + pow(diff2,order) + pow(diff3,order); + result += std::pow(diff0,order) + std::pow(diff1,order) + std::pow(diff2,order) + std::pow(diff3,order); a += 4; b += 4; @@ -408,7 +408,7 @@ struct MinkowskiDistance /* Process last 0-3 pixels. Not needed for standard vector lengths. */ while (a < last) { diff0 = (ResultType)abs(*a++ - *b++); - result += pow(diff0,order); + result += std::pow(diff0,order); } return result; } @@ -419,7 +419,7 @@ struct MinkowskiDistance template inline ResultType accum_dist(const U& a, const V& b, int) const { - return pow(static_cast(abs(a-b)),order); + return std::pow(static_cast(abs(a-b)),order); } }; diff --git a/modules/gapi/src/3rdparty/vasot/src/components/ot/mtt/rgb_histogram.cpp b/modules/gapi/src/3rdparty/vasot/src/components/ot/mtt/rgb_histogram.cpp index bd121fbf49..497894b5b6 100644 --- a/modules/gapi/src/3rdparty/vasot/src/components/ot/mtt/rgb_histogram.cpp +++ b/modules/gapi/src/3rdparty/vasot/src/components/ot/mtt/rgb_histogram.cpp @@ -11,7 +11,7 @@ namespace ot { RgbHistogram::RgbHistogram(int32_t rgb_bin_size) : rgb_bin_size_(rgb_bin_size), rgb_num_bins_(256 / rgb_bin_size), - rgb_hist_size_(static_cast(pow(rgb_num_bins_, 3))) { + rgb_hist_size_(static_cast(std::pow(rgb_num_bins_, 3))) { } RgbHistogram::~RgbHistogram(void) { diff --git a/modules/imgproc/src/corner.cpp b/modules/imgproc/src/corner.cpp index 1d6ee1ac04..da0373d1bf 100644 --- a/modules/imgproc/src/corner.cpp +++ b/modules/imgproc/src/corner.cpp @@ -598,7 +598,7 @@ static bool ipp_cornerHarris( Mat &src, Mat &dst, int blockSize, int ksize, doub scale *= 2.0; if (depth == CV_8U) scale *= 255.0; - scale = std::pow(scale, -4.0); + scale = std::pow(scale, -4); if (ippiHarrisCornerGetBufferSize(roisize, masksize, blockSize, datatype, cn, &bufsize) >= 0) { diff --git a/modules/imgproc/src/lsd.cpp b/modules/imgproc/src/lsd.cpp index 3e424a42b9..1694bfbefb 100644 --- a/modules/imgproc/src/lsd.cpp +++ b/modules/imgproc/src/lsd.cpp @@ -138,7 +138,7 @@ inline double get_limit(cv::Point2d p, int row, double slope) { inline double log_gamma_windschitl(const double& x) { return 0.918938533204673 + (x-0.5)*log(x) - x - + 0.5*x*log(x*sinh(1/x) + 1/(810.0*pow(x, 6.0))); + + 0.5*x*log(x*sinh(1/x) + 1/(810.0*std::pow(x, 6))); } /** @@ -156,7 +156,7 @@ inline double log_gamma_lanczos(const double& x) for(int n = 0; n < 7; ++n) { a -= log(x + double(n)); - b += q[n] * pow(x, double(n)); + b += q[n] * std::pow(x, n); } return a + log(b); } @@ -1037,7 +1037,7 @@ double LineSegmentDetectorImpl::nfa(const int& n, const int& k, const double& p) bin_tail += term; if(bin_term < 1) { - double err = term * ((1 - pow(mult_term, double(n-i+1))) / (1 - mult_term) - 1); + double err = term * ((1 - std::pow(mult_term, double(n-i+1))) / (1 - mult_term) - 1); if(err < tolerance * fabs(-log10(bin_tail) - LOG_NT) * bin_tail) break; } diff --git a/modules/imgproc/test/test_drawing.cpp b/modules/imgproc/test/test_drawing.cpp index da984058e3..e7b8f60de1 100644 --- a/modules/imgproc/test/test_drawing.cpp +++ b/modules/imgproc/test/test_drawing.cpp @@ -554,9 +554,9 @@ TEST(Drawing, _914) line(img, Point(-5, 20), Point(260, 20), Scalar(0), 2, 4); line(img, Point(10, 0), Point(10, 255), Scalar(0), 2, 4); - double x0 = 0.0/pow(2.0, -2.0); - double x1 = 255.0/pow(2.0, -2.0); - double y = 30.5/pow(2.0, -2.0); + double x0 = 0.0/std::pow(2, -2); + double x1 = 255.0/std::pow(2, -2); + double y = 30.5/std::pow(2, -2); line(img, Point(int(x0), int(y)), Point(int(x1), int(y)), Scalar(0), 2, 4, 2); diff --git a/modules/imgproc/test/test_histograms.cpp b/modules/imgproc/test/test_histograms.cpp index f31bb34bed..7edab4e8ac 100644 --- a/modules/imgproc/test/test_histograms.cpp +++ b/modules/imgproc/test/test_histograms.cpp @@ -142,7 +142,7 @@ void CV_BaseHistTest::get_hist_params( int /*test_case_idx*/ ) cdims = cvtest::randInt(rng) % max_cdims + 1; hist_size = exp(cvtest::randReal(rng)*max_log_size*CV_LOG2); - max_dim_size = cvRound(pow(hist_size,1./cdims)); + max_dim_size = cvRound(std::pow(hist_size,1./cdims)); total_size = 1; uniform = cvtest::randInt(rng) % 2; hist_type = cvtest::randInt(rng) % 2 ? CV_HIST_SPARSE : CV_HIST_ARRAY; @@ -208,7 +208,7 @@ float** CV_BaseHistTest::get_hist_ranges( int /*test_case_idx*/ ) for( j = 0; j < 10; j++ ) { q = 1. + (j+1)*0.1; - if( (pow(q,(double)n)-1)/(q-1.) >= _high-_low ) + if( (std::pow(q,n)-1)/(q-1.) >= _high-_low ) break; } @@ -220,7 +220,7 @@ float** CV_BaseHistTest::get_hist_ranges( int /*test_case_idx*/ ) else { q = 1 + j*0.1; - delta = cvFloor((_high-_low)*(q-1)/(pow(q,(double)n) - 1)); + delta = cvFloor((_high-_low)*(q-1)/(std::pow(q,n) - 1)); delta = MAX(delta, 1.); } val = _low; diff --git a/modules/ml/src/ann_mlp.cpp b/modules/ml/src/ann_mlp.cpp index f4e00aaac7..719bc819c8 100644 --- a/modules/ml/src/ann_mlp.cpp +++ b/modules/ml/src/ann_mlp.cpp @@ -276,7 +276,7 @@ public: { int n1 = layer_sizes[i-1]; int n2 = layer_sizes[i]; - double val = 0, G = n2 > 2 ? 0.7*pow((double)n1,1./(n2-1)) : 1.; + double val = 0, G = n2 > 2 ? 0.7*std::pow(n1,1./(n2-1)) : 1.; double* w = weights[i].ptr(); // initialize weights using Nguyen-Widrow algorithm diff --git a/modules/photo/src/contrast_preserve.cpp b/modules/photo/src/contrast_preserve.cpp index d9b183964e..332159345f 100644 --- a/modules/photo/src/contrast_preserve.cpp +++ b/modules/photo/src/contrast_preserve.cpp @@ -102,7 +102,7 @@ void cv::decolor(InputArray _src, OutputArray _dst, OutputArray _color_boost) vector temp2(EXPsum.size()); vector wei1(polyGrad.size()); - while(sqrt(pow(E-pre_E,2)) > tol) + while(std::abs(E-pre_E) > tol) { iterCount +=1; pre_E = E; diff --git a/modules/photo/src/contrast_preserve.hpp b/modules/photo/src/contrast_preserve.hpp index 3fb98e2093..d0a19488d4 100644 --- a/modules/photo/src/contrast_preserve.hpp +++ b/modules/photo/src/contrast_preserve.hpp @@ -91,7 +91,7 @@ double Decolor::energyCalcu(const vector &Cg, const vector < vector &Cg) const Cg.resize(ImL.size()); for(size_t i=0;i > &polyGrad, for(int i = 0;i(i,j)=static_cast( - pow(rgb_channel[2].at(i,j),r)*pow(rgb_channel[1].at(i,j),g)* - pow(rgb_channel[0].at(i,j),b)); + std::pow(rgb_channel[2].at(i,j),r)*std::pow(rgb_channel[1].at(i,j),g)* + std::pow(rgb_channel[0].at(i,j),b)); vector curGrad; gradvector(curIm,curGrad); add_to_vector_poly(polyGrad,curGrad,idx1); @@ -366,8 +366,8 @@ void Decolor::grayImContruct(vector &wei, const Mat &img, Mat &Gray) co for(int i = 0;i(i,j)=static_cast(Gray.at(i,j) + - static_cast(wei[kk])*pow(rgb_channel[2].at(i,j),r)*pow(rgb_channel[1].at(i,j),g)* - pow(rgb_channel[0].at(i,j),b)); + static_cast(wei[kk])*std::pow(rgb_channel[2].at(i,j),r)*std::pow(rgb_channel[1].at(i,j),g)* + std::pow(rgb_channel[0].at(i,j),b)); kk=kk+1; } diff --git a/modules/photo/src/npr.hpp b/modules/photo/src/npr.hpp index 2ff1985aca..6e4bb7355a 100644 --- a/modules/photo/src/npr.hpp +++ b/modules/photo/src/npr.hpp @@ -184,7 +184,7 @@ void Domain_Filter::compute_Rfilter(Mat &output, Mat &hz, float sigma_h) for(int i=0;i(i,j) = pow(a,hz.at(i,j)); + V.at(i,j) = std::pow(a,hz.at(i,j)); for(int i=0; i(mean(gray_img)[0]); diff --git a/modules/stitching/src/autocalib.cpp b/modules/stitching/src/autocalib.cpp index 772eb7e7e9..40319b3423 100644 --- a/modules/stitching/src/autocalib.cpp +++ b/modules/stitching/src/autocalib.cpp @@ -156,7 +156,7 @@ bool calibrateRotatingCamera(const std::vector &Hs, Mat &K) for (int i = 0; i < m; ++i) { CV_Assert(Hs[i].size() == Size(3, 3) && Hs[i].type() == CV_64F); - Hs_[i] = Hs[i] / std::pow(determinant(Hs[i]), 1./3.); + Hs_[i] = Hs[i] / std::cbrt(determinant(Hs[i])); } const int idx_map[3][3] = {{0, 1, 2}, {1, 3, 4}, {2, 4, 5}}; diff --git a/modules/video/src/ecc.cpp b/modules/video/src/ecc.cpp index 87b3c53365..a8cd1735b3 100644 --- a/modules/video/src/ecc.cpp +++ b/modules/video/src/ecc.cpp @@ -217,7 +217,7 @@ static void project_onto_jacobian_ECC(const Mat& src1, const Mat& src2, Mat& dst Mat mat; for (int i = 0; i < dst.rows; i++) { mat = Mat(src1.colRange(i * w, (i + 1) * w)); - dstPtr[i * (dst.rows + 1)] = (float)pow(norm(mat), 2); // diagonal elements + dstPtr[i * (dst.rows + 1)] = (float)std::pow(norm(mat), 2); // diagonal elements for (int j = i + 1; j < dst.cols; j++) { // j starts from i+1 dstPtr[i * dst.cols + j] = (float)mat.dot(src2.colRange(j * w, (j + 1) * w)); diff --git a/modules/video/src/tracking/detail/tracking_online_mil.cpp b/modules/video/src/tracking/detail/tracking_online_mil.cpp index b1d74916f7..ebfb31098f 100644 --- a/modules/video/src/tracking/detail/tracking_online_mil.cpp +++ b/modules/video/src/tracking/detail/tracking_online_mil.cpp @@ -286,8 +286,8 @@ void ClfOnlineStump::update(const Mat& posx, const Mat& negx, const Mat_& _q = (_mu1 - _mu0) / 2; _s = sign(_mu1 - _mu0); - _log_n0 = std::log(float(1.0f / pow(_sig0, 0.5f))); - _log_n1 = std::log(float(1.0f / pow(_sig1, 0.5f))); + _log_n0 = std::log(float(1.0f / std::pow(_sig0, 0.5f))); + _log_n1 = std::log(float(1.0f / std::pow(_sig1, 0.5f))); //_e1 = -1.0f/(2.0f*_sig1+1e-99f); //_e0 = -1.0f/(2.0f*_sig0+1e-99f); _e1 = -1.0f / (2.0f * _sig1 + std::numeric_limits::min()); @@ -314,8 +314,8 @@ void ClfOnlineStump::update(const Mat& posx, const Mat& negx, const Mat_& _q = (_mu1 - _mu0) / 2; _s = sign(_mu1 - _mu0); - _log_n0 = std::log(float(1.0f / pow(_sig0, 0.5f))); - _log_n1 = std::log(float(1.0f / pow(_sig1, 0.5f))); + _log_n0 = std::log(float(1.0f / std::pow(_sig0, 0.5f))); + _log_n1 = std::log(float(1.0f / std::pow(_sig1, 0.5f))); //_e1 = -1.0f/(2.0f*_sig1+1e-99f); //_e0 = -1.0f/(2.0f*_sig0+1e-99f); _e1 = -1.0f / (2.0f * _sig1 + std::numeric_limits::min()); diff --git a/modules/videoio/src/cap_aravis.cpp b/modules/videoio/src/cap_aravis.cpp index b5be51b30c..a2e53da921 100644 --- a/modules/videoio/src/cap_aravis.cpp +++ b/modules/videoio/src/cap_aravis.cpp @@ -383,7 +383,7 @@ void CvCaptureCAM_Aravis::autoExposureControl(const Mat & image) midGrey = brightness; double maxe = 1e6 / fps; - double ne = CLIP( ( exposure * d ) / ( dmid * pow(sqrt(2), -2 * exposureCompensation) ), exposureMin, maxe); + double ne = CLIP( ( exposure * d ) / ( dmid * std::pow(sqrt(2), -2 * exposureCompensation) ), exposureMin, maxe); // if change of value requires intervention if(std::fabs(d-dmid) > 5) { diff --git a/modules/videoio/src/cap_mfx_writer.cpp b/modules/videoio/src/cap_mfx_writer.cpp index 51157e9ba1..3006c396bd 100644 --- a/modules/videoio/src/cap_mfx_writer.cpp +++ b/modules/videoio/src/cap_mfx_writer.cpp @@ -21,11 +21,11 @@ static float estimateBitrate(int codecId, size_t pixelNum, float fps) } else if (codecId == MFX_CODEC_AVC) { - bitrate = (mp * 140 + 19) * pow(fps, 0.60f); + bitrate = (mp * 140 + 19) * std::pow(fps, 0.60f); } else if (codecId == MFX_CODEC_HEVC) { - bitrate = (mp * 63 + 45) * pow(fps, 0.60f); + bitrate = (mp * 63 + 45) * std::pow(fps, 0.60f); } else {