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

Image Processing Tutorial #1 does not deal with metadata in Pictures #4

Closed
maykef opened this issue Apr 12, 2018 · 4 comments
Closed

Comments

@maykef
Copy link

maykef commented Apr 12, 2018

Hi,

The last line in your code does not save images as TIFFS, nor preserves metadata.
The consequence is that uploading these images to Pix4D or Agisoft is useless, since all the metadata is lost and, therefore, no mosaic of the band can be created by the programs.

Please advise on using a specific library that preserves Metadata, or a method to copy and paste metadata in last images.

@poynting
Copy link
Contributor

Hi @maykef, if your intent is to process with Agisoft or Pix4D you have a couple of options:

  1. Use the original files. Both of those software packages support RedEdge and implement the radiometric corrections internally. You don't need to pre-process the files.
  2. Use this tutorial as a reference and add your own code to save the files out to tiff using other libraries, then write the required metadata into the output files using exiftool. This can be challenging as most python image libraries don't properly support multi-page tiffs. You'll have to then determine which metadata is required for processing by your chosen software.

I'm closing this because the requested functionality is out of the scope of the tutorial.

We'll also be updating the tutorials soon and will provide extended functionality, including an example on saving data out to tiff files using gdal. We don't currently have writing of metadata out implemented, but we'd love to consider a pull request if someone wants to add that. I would just suggest waiting until the next update to do any work toward that end.

@maykef
Copy link
Author

maykef commented Apr 13, 2018

Understood Justin,

Thanks for this.

@dud3r
Copy link

dud3r commented Apr 17, 2018

Use the original files. Both of those software packages support RedEdge and implement the radiometric corrections internally. You don't need to pre-process the files.

I guess for Photoscan this is only true if you perform the whole "Calibrate Reflectance" process.
What I mean is that you either get Reflectance values if you use Incident Light Sensor/Reflectance panels or Digital Numbers if you don't. From my experience there's no way to get only Radiance mosaics in Agisoft Photoscan.
Would anybody know if the images are corrected for vignetting and row gradient, if the images are just processed normally (without "Calibrate Reflectance"). Maybe this question would be better addressed in the Agisoft forums? :-)

@dud3r
Copy link

dud3r commented Apr 20, 2018

Ok, one last comment on keeping metadata in the images. I haven't had any luck with Python libraries (pyexiftool, py3exiv2). But running exiftool from the command line has given me success. Photoscan does recognize my radiance calibrated images as MicaSense multispectral bands. The important thing is to copy the XMP tags blockwise (-xmp). If you just use exiftool the normal way and try to copy all tags from one file to another (-all) they will get "translated" or rearranged internally somehow. So the final command for transfering all metadata from MicaSense raw images to altered images would be:

exiftool -tagsfromfile IMG_0000_1.tif -xmp IMG_0000_1_RAD.tif
exiftool -tagsfromfile IMG_0000_2.tif -xmp IMG_0000_2_RAD.tif

... and so on.
Cheers.

Sources:
Exiftool FAQ
MicaSense Thread

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

No branches or pull requests

3 participants