From 5df8a8cc2869b0eab009841a684b6ee0d4ca390e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 28 Dec 2013 05:48:10 +0100 Subject: simplify ewma logic --- ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ftnoir_tracker_aruco') diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp index 077bb0d9..c24c233f 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp @@ -242,14 +242,14 @@ void Tracker::run() color_.copyTo(color); cv::cvtColor(color, grayscale, cv::COLOR_BGR2GRAY); - if (first_run) - { - first_run = false; - for (int i = 0; i < N_hyst; i++) - lasts[i] = grayscale; - } if (N_hyst > 0) { + if (first_run) + { + first_run = false; + for (int i = 0; i < N_hyst; i++) + lasts[i] = grayscale; + } cv::Mat hyst(grayscale.rows, grayscale.cols, CV_32F); hyst.setTo(0); for (int i = 0; i < N_hyst-1; i++) -- cgit v1.2.3