【计算机视觉】KCF算法

时间:2022-03-06 01:06:31

code

opencv3.3.1-contrib  ---- TrackerKCF.cpp

opencv如何更新目标区域的过程:

      // calculate filter response
if(params.split_coeff)
calcResponse(alphaf,alphaf_den,kf,response, spec, spec2);
else
calcResponse(alphaf,kf,response, spec); // extract the maximum response
minMaxLoc( response, &minVal, &maxVal, &minLoc, &maxLoc );
if (maxVal < params.detect_thresh)
{
return false;
}
roi.x+=(maxLoc.x-roi.width/+);
roi.y+=(maxLoc.y-roi.height/+); // update the bounding box
boundingBox.x=(resizeImage?roi.x*:roi.x)+(resizeImage?roi.width*:roi.width)/;
boundingBox.y=(resizeImage?roi.y*:roi.y)+(resizeImage?roi.height*:roi.height)/;
boundingBox.width = (resizeImage?roi.width*:roi.width)/;
boundingBox.height = (resizeImage?roi.height*:roi.height)/;

参考

1. KCFcpp;

2. opencv_contrib;

3. 作者Homepage;