Skip to content

Commit

Permalink
Not calling waitKey if no output is shown.
Browse files Browse the repository at this point in the history
  • Loading branch information
TadasBaltrusaitis committed Aug 20, 2018
1 parent b058d54 commit 0bfc425
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ branches:
only:
- master
- develop
- feature/travis_fixes
- feature/no-ui-fix
compiler:
- gcc

Expand Down
16 changes: 15 additions & 1 deletion lib/local/Utilities/src/Visualizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,23 +418,37 @@ void Visualizer::SetFps(double fps)

char Visualizer::ShowObservation()
{
bool ovservation_shown = false;

if (vis_align && !aligned_face_image.empty())
{
cv::imshow("sim_warp", aligned_face_image);
ovservation_shown = true;
}
if (vis_hog && !hog_image.empty())
{
cv::imshow("hog", hog_image);
ovservation_shown = true;
}
if (vis_aus && !action_units_image.empty())
{
cv::imshow("action units", action_units_image);
ovservation_shown = true;
}
if (vis_track)
{
cv::imshow("tracking result", captured_image);
ovservation_shown = true;
}

// Only perform waitKey if something was shown
char result = '\0';
if (ovservation_shown)
{
result = cv::waitKey(1);
}
return cv::waitKey(1);
return result;

}

cv::Mat Visualizer::GetVisImage()
Expand Down

0 comments on commit 0bfc425

Please sign in to comment.