Click here to Skip to main content
15,899,825 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I work on image comparison through webcam. I want to compare webcam live image with my default stored image.First of all I take my images of different position when I sit on my computer after that I want to compare that images with my live webcam position or images.
For Example :
I took some images before I start this application and store it in data base.Suppose I sit in front of my computer my application is on and continuous observe me through webcam after some time suppose I turn my face left or right or hands up and this type of image not found in data base then I my application give some popup message or error message.

I did very r&d on this but still stacked so if any one know how to do this please Help me.
Posted
Updated 8-Jan-14 5:57am
v2

Bit by bit comparsion makes no sense at all. Even less when they come from a webcam, or such image source. You can do some sort of comparison based on some metrics for example: http://docs.opencv.org/doc/tutorials/highgui/video-input-psnr-ssim/video-input-psnr-ssim.html#videoinputpsnrmssim[^] (use emgucv for .net, it is a port of opencv). But it won't reveal much.
You probably need some feature extraction (like movement detection or more semantic features like face detection with Haar cascade), but you have not given any information about your final goal, so this is much all I can tell...
 
Share this answer
 
v2
Comments
jaideepsinh 7-Jan-14 23:58pm    
Thanks for your response.
I just want to compare images which we I took earlier before I start this application and store in data base. The whole image not just face. Suppose I sit in front of my computer my application is on and continuous observe me through webcam after some time suppose I turn my face left or right or hands up and this type of image not found in data base then I my application give some popup message or error message.
Zoltán Zörgő 8-Jan-14 13:55pm    
Ok. First of all, there are tools made for this, like Kinect. See for example http://zugiduino.wordpress.com/2013/01/07/kinect-motion-detection/, but there are more fancy things you can do with it. But Kinect is not a webcam, and has a powerful engine you can rely on.

If you want to do something like that with just a webcam, you can not avoid to reduce the image to some features. You can take two paths:
a) feature detection
b) image reduction.

a) You could use Haar cascade (with emgucv for example) to train and detect specific movements, to find the the face, arm, or hand. You can use it for gestures too. Than you can store their position and compare later with a new position set.

b) You can use morphological and other classic image transformations to erase background, eliminate irrelevant information like colors, or your t-shirt patterns, and have a few pixel x few pixel matrix that you can save and compare later with a similar matrix.

But this is far from being concrete, since it takes lot of research and trials to get something working in this topic. And everything depends on how much time you want to spend on this.
jaideepsinh 9-Jan-14 2:39am    
Thank you very much.
Your suggestion and idea to do this is good and i start working by that way. But not getting any code or anything related to that so do you have any sample code or material related to that please tell me.
And thanks again it helps me lot.
Zoltán Zörgő 9-Jan-14 4:08am    
Well, look for code on the net. There are many OpenCV samples out there, just search. They can be easily trascoded to EmguCV.
Hi,Zoltán Zörgő,i am a datamatrix barcode generator tester.Recently i want to compare barcode image using webcam and then read the datamatrix.But I'm a newbie in the DirectShow world, and I just studied the simple "playcap" sample provided by Microsoft SDK Samples. With this little program I've been able to have a window with my webcam stream. How can I take two shots from my webcam and compare them (even without saving them on the hard disk) to find which pixels are different? I easily did this job using Win32API capture windows, but it was very slow, and I need it to be fast. Thank you in advance, it is very important for my project.
 
Share this answer
 
Comments
CHill60 9-Mar-15 5:45am    
If you have a question of your own then use the "Ask a Question" link.
If you want to respond to someone's post then use the "Have a Question or Comment" link next to it (otherwise they will not see your response)
If you want to respond to someone's comment then use the "Reply" link

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900