From afa9e9338959a1f41119fa86fb7deb01d9e983a1 Mon Sep 17 00:00:00 2001 From: Auron-X Date: Mon, 16 Mar 2015 16:39:27 +0900 Subject: [PATCH] Bug fix #1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The bug appears on the initialization step, if the initial bounding box width was larger than height. The problem was in function calculating a binary code for ensemble classifiers. In this function “measurement” values were used in wrong order (h1,w1,h2,w2; instead of: w1,w2,h1,h2), generating a access violation error on “patch” data access by the reason that width>height and pointer to data is calculated linearly data.step*height+width --- modules/tracking/src/tld_utils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/tracking/src/tld_utils.cpp b/modules/tracking/src/tld_utils.cpp index df9c9b7097..c5c85bd32c 100644 --- a/modules/tracking/src/tld_utils.cpp +++ b/modules/tracking/src/tld_utils.cpp @@ -359,8 +359,8 @@ int TLDEnsembleClassifier::code(const uchar* data, int rowstep) const for( int i = 0; i < (int)measurements.size(); i++ ) { position = position << 1; - if( *(data + rowstep * measurements[i].val[0] + measurements[i].val[1]) < - *(data + rowstep * measurements[i].val[2] + measurements[i].val[3]) ) + if( *(data + rowstep * measurements[i].val[2] + measurements[i].val[0]) < + *(data + rowstep * measurements[i].val[3] + measurements[i].val[1]) ) { position++; }