Answer the question
In order to leave comments, you need to log in
How to detect motion in python moving camera?
Good day, there is a task to find moving objects in the video stream that comes from a moving camera.
For a static camera, you can use a simple function from opencv, but what about dynamic observation?
Answer the question
In order to leave comments, you need to log in
In general, there is no solution, since it is difficult to distinguish the movement of an object from the parallax effect, and relying on coordinates will also be problematic.
You can experiment with optical flow to try to understand which direction the camera has moved, and try to either counter-shift the frame before using mean of gaussians, or filter out objects that have a self-shift value that is too close to the found camera movement (with a minus sign). ). The first really works only when shooting from the hands of a standing person, i.e. when the displacements are relatively small. If you need to catch movement when the camera is also moving in the same direction, there is very little chance.
One way or another, you will probably have to implement one or another background subtraction algorithm yourself in order to be able to intervene in its work to compensate for movement.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question