Search code examples
image-processingtrackingmotion-detection

How to determine the movement using only two frames


I'm learning the moving object detection using a sequence of frames.

This is an example of two frames. I need to select moved object in the right frame.

I can subtract one frame from another. In the selected area the result would be none zero => that was a movement in that area. But if u look at the right frame, u could see a background selected as well.

Can I somehow separate the car from the background?

enter image description here

i guess the method, when we collecting the background pixels, and than subtract the image from the background is useless on a two frames, right?


Solution

  • You are right that the method does not work very well with only two frames. The method you describe works best when you have one image with only background, which you can then use to compare with new images to look for movement.

    It is possible to calculate the movement of the object with only two frames, but then you probably need more advanced methods, such as optical flow or image registration algorithms.