mirror of https://github.com/davisking/dlib.git
Update webcam_face_pose_ex.cpp (#702)
Test on a given video like this cv::VideoCapture cap("Sample.avi") may be broken when the video frames are not enough before the main window is closed by the user.
This commit is contained in:
parent
6081fea5fa
commit
373ca59369
|
@ -60,7 +60,10 @@ int main()
|
||||||
{
|
{
|
||||||
// Grab a frame
|
// Grab a frame
|
||||||
cv::Mat temp;
|
cv::Mat temp;
|
||||||
cap >> temp;
|
if (!cap.read(temp))
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
// Turn OpenCV's Mat into something dlib can deal with. Note that this just
|
// Turn OpenCV's Mat into something dlib can deal with. Note that this just
|
||||||
// wraps the Mat object, it doesn't copy anything. So cimg is only valid as
|
// wraps the Mat object, it doesn't copy anything. So cimg is only valid as
|
||||||
// long as temp is valid. Also don't do anything to temp that would cause it
|
// long as temp is valid. Also don't do anything to temp that would cause it
|
||||||
|
|
Loading…
Reference in New Issue