Click here to Skip to main content
15,907,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to capture 2 images from my webcam(at the different times) and compare those two images.

If there will any changes i want to trigger some message. In this case i captured images(using opencv) but i couldn't find a way to compare these images using opencv.

plzz help me.. give me a sample code for this....
Posted
Updated 25-Oct-11 20:55pm
v2

1 solution

Have you tried google?
Turned up a few questions on Stack Overflow[^], and another answer[^].

Try these and come back when you have tried yourself if you are still having trouble.
 
Share this answer
 
Comments
Prabath Manjula 26-Oct-11 4:15am    
I already tried 1000 times.... i used those websites. but there were no any method(i couldn't find) to compare(not using pixel)two images.

because i want to identify, is there a object or not.
if you have a URL plzz give me..
enhzflep 26-Oct-11 23:11pm    
I'm eager to discover what I'm missing here... :scratches-head:
Surely, an image is simply a collection of pixels? In order to compare two images how, pray tell, would one compare them without comparing the pixels? You wanna look at dimensions? Useless! I can give you two 16x16 images that are entirely dissimilar. Histograms? They rely on the pixels. Avg brightness? Nope, pixels once more.
You can't compare two printed photgraphs without looking at the images - similarily, you can't compare two electronic images without checking the pixels..

I would suggest you read the article here on CP for a Realtime Webcam Sudoku Solver (http://www.codeproject.com/KB/game/WebcamSudokuSolver.aspx)

A method is discussed there for recognising digits (0-9) in an image - this is an exercise in comparing parts of the image to reference images of the ten digits.
Andrew Brock 27-Oct-11 10:59am    
The OPs question was to compare 2 images with OpenCV. I took this to mean he wants to see if something in the image has changed, doesn't matter weather it is him sitting in front of the computer or his cat, something has changed and the computer should respond.

Only with the reply did the OP specify that he wanted to determine if an object was present (as opposed to say the sun going down or light turning off).

For this I would recommend a neural network, however this is a rather large task, and he would be better, like you suggested, to base it off someone else's work, with credit of course.

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