From 952f9dbe629e8e9f310c70c78ed46d484439c1c9 Mon Sep 17 00:00:00 2001 From: Dikay900 Date: Wed, 1 Apr 2015 20:22:27 +0200 Subject: [PATCH] initialize tiltedOffset variable at correct location do not use this variable if it is not an tilted feature --- modules/objdetect/src/cascadedetect.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/objdetect/src/cascadedetect.cpp b/modules/objdetect/src/cascadedetect.cpp index 46a1d60f2..bc1fedc80 100644 --- a/modules/objdetect/src/cascadedetect.cpp +++ b/modules/objdetect/src/cascadedetect.cpp @@ -618,8 +618,7 @@ Ptr HaarEvaluator::clone() const void HaarEvaluator::computeChannels(int scaleIdx, InputArray img) { const ScaleData& s = scaleData->at(scaleIdx); - tofs = (int)sbufSize.area(); - sqofs = hasTiltedFeatures ? tofs*2 : tofs; + sqofs = hasTiltedFeatures ? sbufSize.area() * 2 : sbufSize.area(); if (img.isUMat()) { @@ -660,6 +659,9 @@ void HaarEvaluator::computeChannels(int scaleIdx, InputArray img) void HaarEvaluator::computeOptFeatures() { + if (hasTiltedFeatures) + tofs = sbufSize.area(); + int sstep = sbufSize.width; CV_SUM_OFS( nofs[0], nofs[1], nofs[2], nofs[3], 0, normrect, sstep );