trek-view / gopro2gsv

Processes .jpg images and .mp4/.360 videos shot on GoPro MAX or Fusion cameras and uploads to Google Street View.
Apache License 2.0
4 stars 0 forks source link

Add logic to remove outliers #25

Open himynamesdave opened 1 year ago

himynamesdave commented 1 year ago

In some cases, GPS data is erroneous. e.g. the distance or speed between two consecutive points by time is clearly to fast (e.g. 10000 km/h speed)

There are many ways to get rid of outlying points like this:

https://gis.stackexchange.com/questions/19683/what-algorithm-should-i-use-to-remove-outliers-in-trace-data

User should be able to set an outlier "speed" in all modes

--outlier_speed_meters_sec

Default if not passed is 40 meters / second (144 km/h).

When user passes this flag, they can enter any whole number

When a destination photo has a speed greater than the specified outlier speed it will be removed (and logged) from the input photos considered to produce a video (similar logic to when photos in input have no GPS: https://github.com/trek-view/gopro2gsv#validation).

Is dependant on change #26 as this will mean videos are now first processed to images, at which point, outliers can be removed.

fqrious commented 1 year ago

How is speed calculated?

himynamesdave commented 1 year ago

@fqrious here is an explanation (and implementation)

https://github.com/trek-view/gopro2frames/blob/main/docs/LOGIC.md#gps_speed_meters_second_next

Essentially you use the gps points between consecutive photos to calculate distance and time which will give you speed

himynamesdave commented 1 year ago

Yes, it is described here

https://github.com/trek-view/gopro2frames/blob/main/docs/LOGIC.md#gps_distance_meters_next

you can see the implementation here:

https://github.com/trek-view/gopro2frames/blob/2ac8b1632b49e4db508134da6a291286c90a5287/gfmmain.py#L266

himynamesdave commented 1 year ago

closing, will raise individual tickets to cover

himynamesdave commented 1 year ago

This needs more thought. Reopening, can tackle later