From 686e28eeeed829da8e479c4343e10600a45bba23 Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Thu, 29 Jul 2010 13:06:34 +0000 Subject: [PATCH] fixed roi handling in HOGDescriptor::computeGradient (ticket #295). --- modules/objdetect/src/hog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/objdetect/src/hog.cpp b/modules/objdetect/src/hog.cpp index 9b6c30f89..43911c50d 100644 --- a/modules/objdetect/src/hog.cpp +++ b/modules/objdetect/src/hog.cpp @@ -200,10 +200,10 @@ void HOGDescriptor::computeGradient(const Mat& img, Mat& grad, Mat& qangle, for( x = -1; x < gradsize.width + 1; x++ ) xmap[x] = borderInterpolate(x - paddingTL.width + roiofs.x, - wholeSize.width, borderType); + wholeSize.width, borderType) - roiofs.x; for( y = -1; y < gradsize.height + 1; y++ ) ymap[y] = borderInterpolate(y - paddingTL.height + roiofs.y, - wholeSize.height, borderType); + wholeSize.height, borderType) - roiofs.y; // x- & y- derivatives for the whole row int width = gradsize.width;