Ask Your Question
0

Any parameters required to capture video from Webcam in Real Time Pose Estimation example

asked 2016-04-21 01:09:39 -0600

Harsha123 gravatar image

Hi,

I am running the given example of Real time pose estimation in OpenCV 3.0 when I am running the example with a pre-recorded video, the example is running correctly.But when I am trying to capture a video from webcam getting an error as "Could not open the camera device". Does this example need any parameters for starting video recording with webcam. Can anyone please help in resolving this issue.

Thanks in Advance

Thanks & Regards

K Harsha Vardhan

edit retag flag offensive close merge delete

Comments

which example is it ?

berak gravatar imageberak ( 2016-04-21 01:20:55 -0600 )edit

real_time_pose_estimation

Harsha123 gravatar imageHarsha123 ( 2016-04-21 04:11:51 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-04-21 05:32:19 -0600

berak gravatar image

you could change line 160,

VideoCapture cap;                     // instantiate VideoCapture
cap.open(video_read_path);            // open a recorded video

to:

VideoCapture cap;                     // instantiate VideoCapture
if (video_read_path == "0")
    cap.open(0);                      // webcam
else
    cap.open(video_read_path);        // video from file
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-04-21 01:09:39 -0600

Seen: 258 times

Last updated: Apr 21 '16