Reputation: 41
I have a dataset which is tracking a moving object. For each frame of the video (around 2,000 per video), it has an x pixel and a y pixel value (1920 x 1080p). I want to:
a) create a new column (xy) which has a spatial correlate of where that pixel is on the grid (each pixel/value on the grid should have its own unique coordinate) b) create a speed of travel (aka the distance travelled between two frames), using something like the lag function.
I am unsure how best to create the xy column, as the data is a video, and does not relate to actual spatial data like real world coordinates.
Example of the data:
Frame | X | Y |
---|---|---|
1 | 5 | 1 |
2 | 3 | 4 |
I tried converting the coords using st_point and sf_as_sf but neither really work as they are more in line with real life coords.
Upvotes: 0
Views: 69