By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,952 Members | 1,073 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,952 IT Pros & Developers. It's quick & easy.

Image comparison, from image capture device

P: n/a
Hi
I am trying to find some code, or reference docs, to assist in helping
capture images from an image capture device (ie. webcam etc etc).

I want to be able to compare successive images coming from the device, and
be able to detect if the image has changed from the previous one. I have
found some Java code which does something similar to what I want to do, but
I am unsure which classes in the .Net framework are equivalents or of use in
this.

If anyone can help, it would be most appreciated.

Thanks
Paul
Nov 16 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Paul,

There's nothing directly built in to .Net for capturing images, but you can
use the DirectX API to do so. There's no need to sweat, though -- try the
DirectX.Capture library for capturing images. I found it pretty easy to use:
http://www.thecodeproject.com/cs/med...ctxcapture.asp

Now, as far as comparing successive images... that's practically a whole
science! Quick and dirty, you could do per-pixel or region comparisons of
successive images with threshold values. I would probably write those
functions in unmanaged C++ and compile a DLL that you could then reference
from .Net, since it's processor-intensive and will run faster than managed
code.

Keep in mind that many webcam drivers auto-adjust the image for lighting
conditions, so the image brightness or saturation may change automatically
and trick your program into thinking something has moved when it hasn't.
Some cameras (I have a Logitech cam) let you turn all that auto-adjustment
stuff off if you don't want it.

-Adrian

"Paul Aspinall" <pa**@aspy.co.uk> wrote in message
news:Rq******************@fe3.news.blueyonder.co.u k...
Hi
I am trying to find some code, or reference docs, to assist in helping
capture images from an image capture device (ie. webcam etc etc).

I want to be able to compare successive images coming from the device, and
be able to detect if the image has changed from the previous one. I have
found some Java code which does something similar to what I want to do,
but I am unsure which classes in the .Net framework are equivalents or of
use in this.

If anyone can help, it would be most appreciated.

Thanks
Paul

Nov 16 '05 #2

P: n/a
Hi Paul,

I believe there is a way to do this in managed code using Windows Messaging
without having to resort to Directx or COM.
http://www.webtropy.com/articles/art7.asp?Webcam

Difference image and motion detection algorithms, using pattern recognition
as is found in security and QA apps, are usually in the realm of DSP. I
would say the easiest way would be to do a Fast Fourier Transform on the
images and then calulate some vector difference. You can use the Exocortex
engine:
http://www.exocortex.org/dsp/

ok,
aq

"Paul Aspinall" <pa**@aspy.co.uk> wrote in message
news:Rq******************@fe3.news.blueyonder.co.u k...
Hi
I am trying to find some code, or reference docs, to assist in helping
capture images from an image capture device (ie. webcam etc etc).

I want to be able to compare successive images coming from the device, and
be able to detect if the image has changed from the previous one. I have
found some Java code which does something similar to what I want to do, but I am unsure which classes in the .Net framework are equivalents or of use in this.

If anyone can help, it would be most appreciated.

Thanks
Paul

Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.