From c66bfdcf54e496c0ad506a8b9ebad22f37882946 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Thu, 13 Sep 2018 19:11:04 +0200 Subject: [PATCH] Use fixed format for output numbers --- main_vot.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main_vot.cpp b/main_vot.cpp index 4a8c99e..38aa35d 100644 --- a/main_vot.cpp +++ b/main_vot.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include "kcf.h" #include "vot.hpp" @@ -141,11 +142,14 @@ int main(int argc, char *argv[]) cv::Rect bb_rect; double avg_time = 0., sum_accuracy = 0.; int frames = 0; + + std::cout << std::fixed << std::setprecision(2); + while (vot_io.getNextImage(image) == 1){ double time_profile_counter = cv::getCPUTickCount(); tracker.track(image); time_profile_counter = cv::getCPUTickCount() - time_profile_counter; - std::cout << " -> speed : " << time_profile_counter/((double)cvGetTickFrequency()*1000) << "ms. per frame, " + std::cout << " -> speed : " << time_profile_counter/((double)cvGetTickFrequency()*1000) << "ms per frame, " "response : " << tracker.getFilterResponse(); avg_time += time_profile_counter/((double)cvGetTickFrequency()*1000); frames++; @@ -197,7 +201,7 @@ int main(int argc, char *argv[]) // cv::imwrite(ss.c_str(), image, compression_params); } - std::cout << "Average processing speed: " << avg_time/frames << "ms (" << 1./(avg_time/frames)*1000 << " fps)"; + std::cout << "Average processing speed: " << avg_time / frames << "ms (" << 1. / (avg_time / frames) * 1000 << " fps)"; if (groundtruth_stream.is_open()) { std::cout << "; Average accuracy: " << sum_accuracy/frames << std::endl; groundtruth_stream.close(); -- 2.39.2