From c2217938bf42c0a95e3c57bcc6427e9f74049119 Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Tue, 12 Apr 2022 15:04:15 +0300 Subject: [PATCH] adding a half baked image input mode for issue https://github.com/FORTH-ModelBasedTracker/MocapNET/issues/78 --- .../MocapNET2LiveWebcamDemo/livedemo.cpp | 27 ++++++++++++++----- .../parseCommandlineOptions.hpp | 2 ++ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/MocapNET2/MocapNET2LiveWebcamDemo/livedemo.cpp b/src/MocapNET2/MocapNET2LiveWebcamDemo/livedemo.cpp index 57ec0ff..1dba274 100644 --- a/src/MocapNET2/MocapNET2LiveWebcamDemo/livedemo.cpp +++ b/src/MocapNET2/MocapNET2LiveWebcamDemo/livedemo.cpp @@ -78,18 +78,30 @@ int main(int argc, char *argv[]) std::cerr<<"Trying to open source ("<> frame; } - Mat frame; - Mat frameCentered; - int itIsTheFirstFrame=1; - cap >> frame; - //We will accept the input resolution and force it //on visualization.. options.width = frame.size().width; @@ -164,8 +176,9 @@ int main(int argc, char *argv[]) { options.loopStartTime = GetTickCountMicrosecondsMN(); - if (itIsTheFirstFrame) { itIsTheFirstFrame=0; } else - { cap >> frame; } + if (options.inputIsSingleImage) { /*Do nothing*/ } else + if (itIsTheFirstFrame) { itIsTheFirstFrame=0; } else + { cap >> frame; } //If we are running in a low-end computer and need to keep in sync with a live video feed we can frame-skip if (options.frameSkip) diff --git a/src/MocapNET2/MocapNETLib2/applicationLogic/parseCommandlineOptions.hpp b/src/MocapNET2/MocapNETLib2/applicationLogic/parseCommandlineOptions.hpp index 022ba7a..c724bd6 100644 --- a/src/MocapNET2/MocapNETLib2/applicationLogic/parseCommandlineOptions.hpp +++ b/src/MocapNET2/MocapNETLib2/applicationLogic/parseCommandlineOptions.hpp @@ -15,6 +15,8 @@ struct MocapNET2Options const char * webcamSource; const char * path; char * datasetPath; + unsigned int inputIsSingleImage; + unsigned int isJSONFile; unsigned int isCSVFile; unsigned int jointEstimatorUsed;