Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Altitude Data in SRT files causes issues #1698

Open
drewtu2 opened this issue Sep 13, 2023 · 2 comments
Open

Missing Altitude Data in SRT files causes issues #1698

drewtu2 opened this issue Sep 13, 2023 · 2 comments

Comments

@drewtu2
Copy link

drewtu2 commented Sep 13, 2023

How did you install ODM? (Docker, installer, natively, ...)?

Docker running on MacOS

What is the problem?

Currently the video processing code makes the assumption that all srt files will contain exactly the latitude/longitude/altitude keys.
https://github.com/OpenDroneMap/ODM/blob/master/opendm/video/srtparser.py#L56
Whenever there is an invalid altitude key, we end up erroring out in the underlying call to self.ll_to_utm.TransformPoint(lat, lon,alt) and all further dataset processing stops. In some versions of the srt files produced by newer dji drones, we have [rel_alt: xxx abs_alt: xxx] fields as opposed to a fixed altitude key. See attached for an example.

What should be the expected behavior? If this is a feature request, please describe in detail the changes you think should be made to the code, citing files and lines where changes should be made, if possible.

There are a few ways this should be addressed.

  1. We definitely be checking for values before calling out to self.ll_to_utm.TransformPoint. We already do so for lat/lon, but we're not doing so for alt. That's likely the easiest short term fix.
  2. We should wrap the calls to get_gps in a try-catch to prevent erroring out causing a cascading failure which prevents other datasets from being processed.

How can we reproduce this? What steps did you do to trigger the problem? If this is an issue with processing a dataset, YOU MUST include a copy of your dataset AND task output log, uploaded on Google Drive or Dropbox (otherwise we cannot reproduce this).

I've included a srt file attached here which contains the non altitude srt altitude keys. DJI_0664.SRT.zip
I've also uploaded a video and corresponding srt to google drive.

Otherwise, this should be easily reproducible from any SRT data that does not contain altitude information.

If I get the time I'll try submitting a fix for this myself since it's pretty small. Opening the issue for visibility and discussion if there's a different way this should be handled.

@DouglasWJ
Copy link

For Anyone finding this issue, a temporary fix until this is patched, use this regex on your SRT file to replace the [rel_alt: xxx abs_alt: xxx] values with just a regular [altitude: xxx] value: "(rel_alt:.* abs_alt:)" replace with: "altitude:"

@luzpaz
Copy link
Contributor

luzpaz commented Dec 9, 2023

Is there a fix in the works ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants