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

Adding TIFFTAG_* to .tif outputs #1797

Merged
merged 6 commits into from
Sep 5, 2024
Merged

Conversation

stephenwinn16
Copy link
Contributor

Following up on #1793, I've added steps to the orthophoto and DSM/DTM generation to be able to include TIFFTAG information. In the current commit, I've hardcoded a datetime for testing purposes. I would like this to be replaced by a mean capture time based on the input image metadata (such as the "Capture Start" and "Capture End" that appear e.g. in the PDF report). Would anyone be able to point me to a good place to pull them from during the processing pipeline?

Additionally, is the ODM version stored somewhere during the processing pipeline? Or should it always be read from the VERSION file as in run.py?

@pierotofy
Copy link
Member

Thanks @stephenwinn16, note we should probably set the tags in/around https://github.com/OpenDroneMap/ODM/blob/master/stages/odm_postprocess.py#L38 similarly to how we set GCPs metadata.

You could find the precomputed start/end dates in odm_report/stats.json, but you have to be careful, because if a report is not generated (when --skip-report is used) the file might not be there. If not, you'll have to recompute from utc_time https://github.com/OpenDroneMap/ODM/blob/master/opendm/photo.py#L130 as a fallback.

Yes version is stored in VERSION. I would just re-read it, or create a function to read it and then optionally memoize it.

@stephenwinn16 stephenwinn16 changed the title Adding TIFFTAG_*DATETIME to .tif outputs Adding TIFFTAG_* to .tif outputs Aug 22, 2024
Reverted previous changes and moved all steps into the ODMPostProcess step.
@stephenwinn16
Copy link
Contributor Author

Thanks @pierotofy for the comments. I've moved the lines into the odm_postprocess step and read the time information either from the odm_report/shots.geojson file or the images.json file depending on what exists.

Do you see any other useful information to include with the TIFFTAG fields?

@stephenwinn16 stephenwinn16 marked this pull request as ready for review September 5, 2024 08:43
@pierotofy
Copy link
Member

Thanks @stephenwinn16, I've made some changes to simplify the logic and avoid reading files from disk, I realized we already had a function to read the ODM version and that it was probably faster to read the UTC time from the photos object which is already in memory, I'll run some more tests and merge this shortly. 🙏

@pierotofy pierotofy merged commit 2242d17 into OpenDroneMap:master Sep 5, 2024
1 of 2 checks passed
@stephenwinn16
Copy link
Contributor Author

Great, more efficient and much cleaner, thank you @pierotofy !

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

Successfully merging this pull request may close these issues.

2 participants