From 0cd76f899b234af77cf0cd57bfab45b43dee2bb0 Mon Sep 17 00:00:00 2001 From: Davis King Date: Wed, 18 May 2016 22:22:56 -0400 Subject: [PATCH] Added an error message if a camera isn't available. --- examples/webcam_face_pose_ex.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/webcam_face_pose_ex.cpp b/examples/webcam_face_pose_ex.cpp index 81887384b..dbbf83047 100644 --- a/examples/webcam_face_pose_ex.cpp +++ b/examples/webcam_face_pose_ex.cpp @@ -42,6 +42,12 @@ int main() try { cv::VideoCapture cap(0); + if (!cap.isOpened()) + { + cerr << "Unable to connect to camera" << endl; + return 1; + } + image_window win; // Load face detection and pose estimation models.