Commit 246ea8f3 authored by alessiodore's avatar alessiodore Committed by Alexander Alekhin

Merge pull request #641 from alessiodore:kcfFix

* Fix kcfTracker when called from Python bindings. The variable boundingBox in updateImpl when called from Python is initialized with 0s and it needs to be updated with the tracker state.

* Fix to return the bbox correctly in the first frame in Python
parent b3c36791
......@@ -336,12 +336,14 @@ namespace cv{
minMaxLoc( response, &minVal, &maxVal, &minLoc, &maxLoc );
roi.x+=(maxLoc.x-roi.width/2+1);
roi.y+=(maxLoc.y-roi.height/2+1);
// update the bounding box
boundingBox.x=(resizeImage?roi.x*2:roi.x)+boundingBox.width/2;
boundingBox.y=(resizeImage?roi.y*2:roi.y)+boundingBox.height/2;
}
// update the bounding box
boundingBox.x=(resizeImage?roi.x*2:roi.x)+(resizeImage?roi.width*2:roi.width)/4;
boundingBox.y=(resizeImage?roi.y*2:roi.y)+(resizeImage?roi.height*2:roi.height)/4;
boundingBox.width = (resizeImage?roi.width*2:roi.width)/2;
boundingBox.height = (resizeImage?roi.height*2:roi.height)/2;
// extract the patch for learning purpose
// get non compressed descriptors
for(unsigned i=0;i<descriptors_npca.size()-extractor_npca.size();i++){
......
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