Is it possible to compare a real time video with an image?

asked 2020-04-20 16:52:04 -0600

pablo22 gravatar image

Hi, I'm starting a project where I have a cam in real time and an image, and I want to do something (by the moment with a print() is enough) when I display the reference image at the webcam. Is there any function to do this? Or any tip?

PS: I'm using Python3 and OpenCV 4.2.0

Thanks to all!

edit retag flag offensive close merge delete

Comments

what does "compare" mean to you, exactly ? do you want to find duplicates ? do you want to find the same object in the images ? please be more concise !

berak gravatar imageberak ( 2020-04-21 04:14:20 -0600 )edit
1

@berak To me "compare" in this case means to find differences between the reference image and the video of the camera or to find that the reference image and the video that is watching the cam is the same. Obviusly the cam would be always in the same place, with the same light conditions and same background of the reference image. Could I do this with absdiff for example or absdiff only works with images and not with video?

Thanks

pablo22 gravatar imagepablo22 ( 2020-04-21 05:11:03 -0600 )edit
1

When you have researched OpenCV, you should have noticed that video, for OpenCV, is nothing more than lots of still images that you read one by one from a source.

mvuori gravatar imagemvuori ( 2020-04-21 09:59:45 -0600 )edit
1

@mvuori So I should grab frame per frame and compare the last grabbed frame to the reference image? That's what I understand. Do you know any good tutorials? Thanks

pablo22 gravatar imagepablo22 ( 2020-04-21 10:17:34 -0600 )edit