Search code examples
pythonopencvvideo-processing

Find movement distance between two frames -- python


I have a short video of a moving object. for some reason I need to estimate the object's movement distance between two specific frames. It is not necessary to be exact. Does anyone know how I can do this in python and opencv or any image processing library? Thanks


Solution

  • I don't know in opencv, there is for sure something similar but you can easily do it with scikit-image module. I do it on a regular basis to align frames.

    See this example here:

    https://scikit-image.org/docs/dev/auto_examples/transform/plot_register_translation.html#sphx-glr-auto-examples-transform-plot-register-translation-py

    EDIT: I found something very similar in opencv here

    https://docs.opencv.org/4.2.0/db/d61/group__reg.html