Commit cdddcc82 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

fixed contrib code to match the HAL

parent 292b8fa6
...@@ -212,7 +212,7 @@ void calcMotionGradient( InputArray _mhi, OutputArray _mask, ...@@ -212,7 +212,7 @@ void calcMotionGradient( InputArray _mhi, OutputArray _mask,
float* orient_row = orient.ptr<float>(y); float* orient_row = orient.ptr<float>(y);
uchar* mask_row = mask.ptr<uchar>(y); uchar* mask_row = mask.ptr<uchar>(y);
fastAtan2(dY_max_row, dX_min_row, orient_row, size.width, true); hal::fastAtan2(dY_max_row, dX_min_row, orient_row, size.width, true);
// make orientation zero where the gradient is very small // make orientation zero where the gradient is very small
for( x = 0; x < size.width; x++ ) for( x = 0; x < size.width; x++ )
......
...@@ -81,7 +81,7 @@ convertDepthToFloat(const cv::Mat& depth, const cv::Mat& mask, float scale, cv:: ...@@ -81,7 +81,7 @@ convertDepthToFloat(const cv::Mat& depth, const cv::Mat& mask, float scale, cv::
v_mat((int)n_points, 0) = (float)v; v_mat((int)n_points, 0) = (float)v;
T depth_i = depth.at<T>(v, u); T depth_i = depth.at<T>(v, u);
if (cvIsNaN(depth_i) || (depth_i == std::numeric_limits<T>::min()) || (depth_i == std::numeric_limits<T>::max())) if (cvIsNaN((float)depth_i) || (depth_i == std::numeric_limits<T>::min()) || (depth_i == std::numeric_limits<T>::max()))
z_mat((int)n_points, 0) = std::numeric_limits<float>::quiet_NaN(); z_mat((int)n_points, 0) = std::numeric_limits<float>::quiet_NaN();
else else
z_mat((int)n_points, 0) = depth_i * scale; z_mat((int)n_points, 0) = depth_i * scale;
...@@ -111,7 +111,7 @@ convertDepthToFloat(const cv::Mat& depth, float scale, const cv::Mat &uv_mat, cv ...@@ -111,7 +111,7 @@ convertDepthToFloat(const cv::Mat& depth, float scale, const cv::Mat &uv_mat, cv
{ {
T depth_i = depth.at < T > ((int)(*uv_iter)[1], (int)(*uv_iter)[0]); T depth_i = depth.at < T > ((int)(*uv_iter)[1], (int)(*uv_iter)[0]);
if (cvIsNaN(depth_i) || (depth_i == std::numeric_limits < T > ::min()) if (cvIsNaN((float)depth_i) || (depth_i == std::numeric_limits < T > ::min())
|| (depth_i == std::numeric_limits < T > ::max())) || (depth_i == std::numeric_limits < T > ::max()))
*z_mat_iter = std::numeric_limits<float>::quiet_NaN(); *z_mat_iter = std::numeric_limits<float>::quiet_NaN();
else else
......
...@@ -337,9 +337,9 @@ static float calcOrientationHist( const Mat& img, Point pt, int radius, ...@@ -337,9 +337,9 @@ static float calcOrientationHist( const Mat& img, Point pt, int radius,
len = k; len = k;
// compute gradient values, orientations and the weights over the pixel neighborhood // compute gradient values, orientations and the weights over the pixel neighborhood
exp(W, W, len); hal::exp(W, W, len);
fastAtan2(Y, X, Ori, len, true); hal::fastAtan2(Y, X, Ori, len, true);
magnitude(X, Y, Mag, len); hal::magnitude(X, Y, Mag, len);
for( k = 0; k < len; k++ ) for( k = 0; k < len; k++ )
{ {
...@@ -620,9 +620,9 @@ static void calcSIFTDescriptor( const Mat& img, Point2f ptf, float ori, float sc ...@@ -620,9 +620,9 @@ static void calcSIFTDescriptor( const Mat& img, Point2f ptf, float ori, float sc
} }
len = k; len = k;
fastAtan2(Y, X, Ori, len, true); hal::fastAtan2(Y, X, Ori, len, true);
magnitude(X, Y, Mag, len); hal::magnitude(X, Y, Mag, len);
exp(W, W, len); hal::exp(W, W, len);
for( k = 0; k < len; k++ ) for( k = 0; k < len; k++ )
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment