# a video in which I have to get the exact motion of a moving object and calculate the coordinates of that object before and after the movement.

12 views (last 30 days)
Haniye R on 29 Mar 2022
Commented: Haniye R on 2 Apr 2022
Hello . I have a video in which I have to get the exact motion of a moving object and obtain the coordinates of that object before and after the movement. Can you help me??

William Rose on 29 Mar 2022
@Haniye R, if the object is a well defined point in image 1 and image 2, then you can compute the motion in pixel coordinates:
PixelMotion=[px2-px1,py2-py1]
where px1,py1; px2,py2 are the pixel coordinates in images 1 and 2.
If you need motion in physical units such as meters, and if you only have one camera, then you need to make some assumptions and calibrate the image. For example, you assume the object is moving in a plane perpendicular to the camera view axis, and you orient the camera so that this is approximately true. You place a meterstick in the scene at that distance, to calibrate the image. Better yet, two perpendicular meter sticks. Then you can compute how many x pixels equals 1 meter (nx) and how many y pixels equals 1 meter (ny). Use those conversion factors to convert PixelMotion to MeterMotion:
MeterMotion=[(px2-px1)/nx,(py2-py1)/ny]
For motion in 3D, you need at least two, and preferably more, cameras. Calibration is complicated, to put it mildly.
William Rose on 1 Apr 2022
@Haniye R, you're welcome.

yanqi liu on 2 Apr 2022
yes，sir，may be use image background and frame diff，such as then，we can diff background from video，and get Haniye R on 2 Apr 2022
How can I extract moving object information?