+static cv::Point wrapAroundFreq(cv::Point pt, cv::Mat &resp_map)
+{
+ if (pt.y > resp_map.rows / 2) // wrap around to negative half-space of vertical axis
+ pt.y = pt.y - resp_map.rows;
+ if (pt.x > resp_map.cols / 2) // same for horizontal axis
+ pt.x = pt.x - resp_map.cols;
+ return pt;
+}
+