Commit dd55064f authored by Maksim Shabunin's avatar Maksim Shabunin

Merge pull request #837 from savuor:fix/bif_nan_sqrt

parents f3ca1a2f 8b252a82
......@@ -207,7 +207,7 @@ void BIFImpl::computeUnit(int unit_idx, const cv::Mat &img,
double sd = sumsq.at<double>(y1,x1) - sumsq.at<double>(y1,x0)
- sumsq.at<double>(y0,x1) + sumsq.at<double>(y0,x0);
sd = sqrt(sd / area - mean * mean);
sd = sqrt(std::max(0.0, sd / area - mean * mean));
dst.at<float>(pos) = static_cast<float>(sd);
}
......
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