示例#1
0
 void updateContours() {
     contours.setMinAreaRadius(minAreaRadius);
     contours.setSortBySize(true);
     contours.findContours(dilated);
     int n = contours.size();
     if(n > 0) {
         cv::Rect all = contours.getBoundingRect(0);
         for(int i = 1; i < n; i++) {
             all |= contours.getBoundingRect(i);
         }
         bodyCenter.interpolate(toOf(all).getCenter(), bodyCenterSmoothing);
     }
 }