开发者

Webcam Video Capture using Visual C++ 6.0

开发者 https://www.devze.com 2023-03-25 12:51 出处:网络
I am trying to create an application to capture a snapshot using a webcam. I have been able to accomplish this using WIA, but this solution becomes unstable when ran on W开发者_StackOverflowindows 7

I am trying to create an application to capture a snapshot using a webcam.

I have been able to accomplish this using WIA, but this solution becomes unstable when ran on W开发者_StackOverflowindows 7 with a camera that has a resolution of more than 1.3 megapixels. We are coding for a tablet computer that has a built in webcam with 2.0 megapixels.

I am not opposed to using direct show, but I would like to stay away from .net.

I have searched high and low for a solution and I can not get the directshow examples from the windows platform sdk or directx 9.0 to even compile on Visual Studio 6.0. I have also had no luck OpenCV.

Is there anyone that could point me in the direction of a tutorial that might get me started down the right path?

Thanks


The simplest way is videoinput lib that wraps directshow, it's the same lib used by openCV.

If that isn't good enough then the AMCAP sample in the multimedia/directshow dir of the Microsoft SDK shows how to run a camera in directshow

ps. as Hans said you should update the compiler,VC++6 is little old. There is a free version of their latest vs2010.


I found this tutorial excellent and it is so simple. I found it worked on XP and win7 with an old webcam and a new one.

I used the second example which is a semi-directshow one, but bypasses most of directshow. You do need to add error handling though.

http://www.codeproject.com/KB/audio-video/VideoImageGrabber.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号