Commit 204e98e1 authored by olivierpascal's avatar olivierpascal

Bugfix #1143

parent da29f712
......@@ -245,8 +245,12 @@ static void gradientHist(const cv::Mat &src, cv::Mat &magnitude, cv::Mat &histog
for (int j = 0; j < phase.cols; ++j)
{
int index = cvRound((j/pSize + pPhase[j])*nBins);
index = std::max(0, std::min(index, pHistSize));
int angle = cvRound(pPhase[j]*nBins);
if(angle >= nBins)
{
angle = 0;
}
const int index = (j/pSize)*nBins + angle;
pHist[index] += pMagn[j] / CV_SQR(pSize);
}
}
......
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