Skip to content

Commit

Permalink
resubmitting same frame by keeping a copy for FORTH-ModelBasedTracker#78
Browse files Browse the repository at this point in the history
  • Loading branch information
AmmarkoV committed Apr 12, 2022
1 parent c221793 commit 1705a89
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Binary file added dataset/test.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 6 additions & 5 deletions src/MocapNET2/MocapNET2LiveWebcamDemo/livedemo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ int main(int argc, char *argv[])
VideoCapture cap(options.webcamSource); // open the default camera

int itIsTheFirstFrame=1;
Mat singleImageFrame;
Mat frame;
Mat frameCentered;

Expand All @@ -88,10 +89,10 @@ int main(int argc, char *argv[])
)
{
std::cerr<<"Source seems to be a single image ("<<options.webcamSource<<") \n";
options.frameLimit = 10; //let it warmup for a few frames..
options.frameLimit = 20; //let it warmup for a few frames..
options.inputIsSingleImage = 1;
options.doOutputFiltering = 0; //There is no motion to filter so skip this
frame=imread(options.webcamSource);
singleImageFrame=imread(options.webcamSource);
} else
if (strstr(options.webcamSource,"/dev/video")!=0)
{
Expand Down Expand Up @@ -176,9 +177,9 @@ int main(int argc, char *argv[])
{
options.loopStartTime = GetTickCountMicrosecondsMN();

if (options.inputIsSingleImage) { /*Do nothing*/ } else
if (itIsTheFirstFrame) { itIsTheFirstFrame=0; } else
{ cap >> frame; }
if (options.inputIsSingleImage) { singleImageFrame.copyTo(frame); } 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)
Expand Down

0 comments on commit 1705a89

Please sign in to comment.