]> rtime.felk.cvut.cz Git - hercules2020/kcf.git/commitdiff
Update KCF_Tracker::max_response
authorMichal Sojka <michal.sojka@cvut.cz>
Sun, 23 Sep 2018 12:41:46 +0000 (14:41 +0200)
committerMichal Sojka <michal.sojka@cvut.cz>
Sun, 23 Sep 2018 12:41:46 +0000 (14:41 +0200)
This will be needed by Hercules partner PITOM.

src/kcf.cpp
src/kcf.h

index 82f1715acefb516593ca78fe0096d9c0c1a905c7..ace1cf9b58bc59d371d428dd26da9e49cbeb9754 100644 (file)
@@ -311,7 +311,7 @@ void KCF_Tracker::resizeImgs(cv::Mat &input_rgb, cv::Mat &input_gray)
     }
 }
 
-void KCF_Tracker::findMaxReponse(uint &max_idx, cv::Point2f &new_location) const
+double KCF_Tracker::findMaxReponse(uint &max_idx, cv::Point2f &new_location) const
 {
     double max = -1.;
 #ifndef BIG_BATCH
@@ -349,6 +349,7 @@ void KCF_Tracker::findMaxReponse(uint &max_idx, cv::Point2f &new_location) const
         new_location = max_response_pt;
     }
     DEBUG_PRINT(new_location);
+    return max;
 }
 
 void KCF_Tracker::track(cv::Mat &img)
@@ -383,7 +384,7 @@ void KCF_Tracker::track(cv::Mat &img)
 
     cv::Point2f new_location;
     uint max_idx;
-    findMaxReponse(max_idx, new_location);
+    max_response = findMaxReponse(max_idx, new_location);
 
     p_pose.cx += p_current_scale * p_cell_size * double(new_location.x);
     p_pose.cy += p_current_scale * p_cell_size * double(new_location.y);
index a12400e9a841dfde8d14a6170844e9d35e25358d..1ca5cf126f997490e72ca6b5fc3c3cc068ae6c41 100644 (file)
--- a/src/kcf.h
+++ b/src/kcf.h
@@ -158,7 +158,7 @@ private:
     double sub_grid_scale(uint index);
     void resizeImgs(cv::Mat &input_rgb, cv::Mat &input_gray);
     void train(cv::Mat input_rgb, cv::Mat input_gray, double interp_factor);
-    void findMaxReponse(uint &max_idx, cv::Point2f &new_location) const;
+    double findMaxReponse(uint &max_idx, cv::Point2f &new_location) const;
 };
 
 #endif //KCF_HEADER_6565467831231