Ask Your Question
0

how to display a webcam video on win32 window

asked 2012-07-12 05:52:39 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >50 is welcome to improve it.

Hi, There i need to show cam capture video on win32 windows application. is there any way to show video on win32 windows application.

Thanks, Yogendra

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
3

answered 2012-07-12 06:08:50 -0600

Daniil Osokin gravatar image

Hi! You can use VideoCapture class for that. Here the sample:

VideoCapture cap(0); // open the default camera
if(!cap.isOpened()) // check if we succeeded
    return -1;
namedWindow("video",1);
for(;;)
{
    Mat frame;
    cap >> frame; // get a new frame from camera
    imshow("video", frame);
    if(waitKey(30) >= 0) break;
}

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

Stats

Asked: 2012-07-12 05:52:39 -0600

Seen: 1,675 times

Last updated: Jul 13 '12