Webcam for C#.NET project
Hi,
during the last 2 years I worked on several projects which involved the analysing of webcam-images. (face detection, motion tracking, object recognition, ...) We did this both in C#.NET and MatLab.
The software part always works out pretty well. But as soon as we want to connect a webcam to it, we always have problems.
1) Resolution too low
2) Speed is too low
3) WIA (Windows Image Acquisition) not supported by the webcam
Because starting from july I will be dropped in a commercial project which involves a webcam, I decided to buy a new webcam.
Buying a webcam is pretty easy if you only want to use it for home use. But when you want to use it in software development that's harder.
I wonder, does anybody know a website where webcams are compared based on their specifications which apply for software development?
Or is there anybody who can tell me, definitly don't buy this, or do buy that?
Thank you in advance !
Greetings
Re: Webcam for C#.NET project
Some more details maybe:
What we really need:
We should be able to process at least 4 very high resolution images per second.
Processing means ...
1) capturing them
2) getting them into C#.NET in the form of an instance of the Bitmap-class
3) doing some small calculations on them
4fps sounds pretty easy at first maybe, because watching webcam can easely reach speeds of 20 frames/second. But, that's a total different story! Because if you only WATCH a webcam, then the images are send directly to the video-card (using DirectShow for example). In that case you can not edit the images or do calculations on them. (Unless you use a filter, such as VMR9, but that's a lot slower again.) When you really want to process images in C#.NET, then you want a Bitmap-instance of every frame. That's a lot slower.
About the resolution...
It should be sharp enough to recognize an object of 0.5 inch at a distance of 1m. Maybe the following image gives a good idea of what it should be capable of. Note how the intersection of the lines at the other side of the board are pretty small and blury. (the ones I added in mspaint are not important, please ignore those.) The webcam should be able to do the job at least as good as this image. http://i11.tinypic.com/687v2wz.jpg
Re: Webcam for C#.NET project
1) If you use a regular NTSC or SECAM camera, you can use a frame-grabber and actually grab the frame rate - 30fps, in the case of NTSC. After that it's a matter of the CPU speed and how fast the software can work. (I doubt that it takes 1/30 second to move a couple of megs of video information from one area of RAM [the frame-grabber] to another [wherever you want it for processing]).
2) You might try searching around Tom's Hardware for specs and reviews.
Re: Webcam for C#.NET project
Thank you for your comments. Your thoughts about the speed set me to thinking again about the technology... I did some experimenting and came to the conclusion that I made some wrong assumptions.
Quote:
Originally Posted by myself
...Unless you use a filter, such as VMR9, but that's a lot slower again...
I was wrong, VMR9 turns out to do the trick VERY fast after all! :) I assumed it was slow because in the past I used VMR9 to do simular operations on video-files (not webcam). There it turned out very slow. But now that I used it on a live (webcam) stream it's really really really fast !
The reason it was so slow on the files must have been a matter of the positioning (jumping to a certain frame can be slow).
So, I'm just going to cary on with my old junk (Creative Video Blaster 5 webcam) for a bit longer. :)
Strange though, that the WIA performs rather slow compared to Direct Show.
Re: Webcam for C#.NET project
For all those who like to use the Webcam class which I made.
Webcam.cs
You can read how to use it, why it was written, how I came to the idea, etc... Inside the header of my file. Please don't remove my valuable header ;-). That's the only condition I have. :) ... and I'm sure you will love this.
Oh BTW, it's written in .NET2 about 2/3 years ago.
Enjoy.