From 9133a482770bf79c2d67f3ebaa814e2c31af3015 Mon Sep 17 00:00:00 2001 From: Stéphane Lenclud Date: Sat, 13 Apr 2019 14:42:59 +0200 Subject: Easy Tracker: Disabling debug output --- tracker-easy/tracker-easy.cpp | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'tracker-easy') diff --git a/tracker-easy/tracker-easy.cpp b/tracker-easy/tracker-easy.cpp index 5fe93b0e..f0ff4bb7 100644 --- a/tracker-easy/tracker-easy.cpp +++ b/tracker-easy/tracker-easy.cpp @@ -26,6 +26,11 @@ using namespace options; +// Disable debug +#define dbgout if (true) {} else std::cout +// Enable debug +//#define dbgout if (false) {} else std::cout + namespace EasyTracker { @@ -122,6 +127,7 @@ namespace EasyTracker if (new_frame) { //TODO: We should not assume channel size of 1 byte + // Though in practice since cv::findContours needs CV_8U we would still need to convert our frame from 16 bits to 8 bits. iMatFrame = cv::Mat(iFrame.height, iFrame.width, CV_MAKETYPE(CV_8U, iFrame.channels), iFrame.data, iFrame.stride); @@ -216,8 +222,8 @@ namespace EasyTracker trackedPoints.push_back(cv::Point2f(iPoints[leftPointIndex][0], iPoints[leftPointIndex][1])); trackedPoints.push_back(cv::Point2f(iPoints[topPointIndex][0], iPoints[topPointIndex][1])); - std::cout << "Object: " << objectPoints << "\n"; - std::cout << "Points: " << trackedPoints << "\n"; + dbgout << "Object: " << objectPoints << "\n"; + dbgout << "Points: " << trackedPoints << "\n"; // Create our camera matrix @@ -255,16 +261,16 @@ namespace EasyTracker if (solutionCount > 0) { - std::cout << "Solution count: " << solutionCount << "\n"; + dbgout << "Solution count: " << solutionCount << "\n"; int minPitch = std::numeric_limits::max(); // Find the solution we want for (int i = 0; i < solutionCount; i++) { - std::cout << "Translation:\n"; - std::cout << iTranslations.at(i); - std::cout << "\n"; - std::cout << "Rotation:\n"; - //std::cout << rvecs.at(i); + dbgout << "Translation:\n"; + dbgout << iTranslations.at(i); + dbgout << "\n"; + dbgout << "Rotation:\n"; + //dbgout << rvecs.at(i); cv::Mat rotationCameraMatrix; cv::Rodrigues(iRotations[i], rotationCameraMatrix); cv::Vec3d angles; @@ -280,11 +286,11 @@ namespace EasyTracker } //cv::Vec3f angles=EulerAngles(quaternion); - std::cout << angles; - std::cout << "\n"; + dbgout << angles; + dbgout << "\n"; } - std::cout << "\n"; + dbgout << "\n"; } -- cgit v1.2.3