face: fix NaN's in bif.cpp

pull/803/head
berak 9 years ago
parent 62ed66cbf6
commit fa27fe2ba2
  1. 4
      modules/face/src/bif.cpp

@ -201,8 +201,8 @@ void BIFImpl::computeUnit(int unit_idx, const cv::Mat &img,
int x1 = std::min(resp.cols, xc + Whalf);
int area = (y1-y0) * (x1-x0);
float mean = sum.at<float>(y1,x1) - sum.at<float>(y1,x0)
- sum.at<float>(y0,x1) + sum.at<float>(y0,x0);
double mean = sum.at<double>(y1,x1) - sum.at<double>(y1,x0)
- sum.at<double>(y0,x1) + sum.at<double>(y0,x0);
mean /= area;
double sd = sumsq.at<double>(y1,x1) - sumsq.at<double>(y1,x0)

Loading…
Cancel
Save