mirror of
https://gitcode.com/gh_mirrors/ope/OpenFace.git
synced 2025-12-30 04:52:29 +00:00
Not calling waitKey if no output is shown.
This commit is contained in:
@@ -7,7 +7,7 @@ branches:
|
||||
only:
|
||||
- master
|
||||
- develop
|
||||
- feature/travis_fixes
|
||||
- feature/no-ui-fix
|
||||
compiler:
|
||||
- gcc
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
return cv::waitKey(1);
|
||||
|
||||
// Only perform waitKey if something was shown
|
||||
char result = '\0';
|
||||
if (ovservation_shown)
|
||||
{
|
||||
result = cv::waitKey(1);
|
||||
}
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
cv::Mat Visualizer::GetVisImage()
|
||||
|
||||
Reference in New Issue
Block a user