align_image_stack & EXIF data

72 views
Skip to first unread message

John Aldridge

unread,
Apr 20, 2020, 4:47:16 AM4/20/20
to hugin and other free panoramic software
Hello,

I'm using align_image_stack with the -a option to align a set of images I've taken over a period of months. This is working well, but loses all the EXIF data from the original images -- the loss of the date and time of the exposure is the one which is causing me a little grief. It would also be nice to preserve the basic exposure parameters: aperture, shutter speed, and ISO.

Is there a way to preserve this data in the aligned images?

Cheers,
John

Harry van der Wolf

unread,
Apr 20, 2020, 9:48:31 AM4/20/20
to hugi...@googlegroups.com
If you have exiftool on your pc, and I assume you have, you should/could do the following.

align_image_stack -a ais_ Picture1.jpg Picture2.jpg Picture3.jpg

Giving you ais_0000.tif, ais_0001.tif and ais_0002.tif

Then do:
exiftool -overwrite_original -tagsfromfile Picture1.jpg -exif:all -makernotes:all ais_0000.tif
or
exiftool -overwrite_original -tagsfromfile Picture1.jpg -all:all -makernotes:all ais_0000.tif

-all:all might least to errors. Note also that some exif tags might be written as xmp tags.

And for all. You can automate this in a script.

Op ma 20 apr. 2020 om 10:47 schreef John Aldridge <j.p.s.a...@gmail.com>:
--
A list of frequently asked questions is available at: http://wiki.panotools.org/Hugin_FAQ
---
You received this message because you are subscribed to the Google Groups "hugin and other free panoramic software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hugin-ptx+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hugin-ptx/76ac7f37-33b9-43cf-a709-a4593379f759%40googlegroups.com.

Harry van der Wolf

unread,
Apr 20, 2020, 9:52:09 AM4/20/20
to hugi...@googlegroups.com
Aargh. One too fast copy&paste
The second line should be:
or
exiftool -overwrite_original -tagsfromfile Picture1.jpg -all:all ais_0000.tif

There are many more options possible but this will save all your camera data.
Note that if you have an (older) reflex/system camera and the lens is not "electronically connected", you will not have lens data in your original image and neither in your AIS updated tif

Op ma 20 apr. 2020 om 15:48 schreef Harry van der Wolf <hvd...@gmail.com>:

John Aldridge

unread,
Apr 20, 2020, 1:20:51 PM4/20/20
to hugin and other free panoramic software
OK... I can cope with that. It'll be a bit messy working out (from the script) which source image corresponds to which processed one, but I'm sure I can sort out a way of doing it.

Thanks!

Harry van der Wolf

unread,
Apr 20, 2020, 1:48:38 PM4/20/20
to hugi...@googlegroups.com
If you are using a shell script or python script you would probably loop through the source images and use a counter starting at 0, as the created tiffs are starting as 0000.
And add the images to an array
=======
#!/bin/bash

img_array=()
counter=0
for x in "${@}"
do
    img_array+=( "${x}" )
    counter+=1
done

align_image_stack -a ais_ "${@}"

for ((i=0;i<=${counter};i++));
do 
    exiftool -overwrite_original -tagsfromfile  ${img_array[$i]} -all:all ais_000$i}.tif
done


=======

(Completely untested !)  

Op ma 20 apr. 2020 om 19:20 schreef John Aldridge <j.p.s.a...@gmail.com>:
OK... I can cope with that. It'll be a bit messy working out (from the script) which source image corresponds to which processed one, but I'm sure I can sort out a way of doing it.

Thanks!

--
A list of frequently asked questions is available at: http://wiki.panotools.org/Hugin_FAQ
---
You received this message because you are subscribed to the Google Groups "hugin and other free panoramic software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hugin-ptx+...@googlegroups.com.

T. Modes

unread,
Apr 20, 2020, 2:04:09 PM4/20/20
to hugin and other free panoramic software


Am Montag, 20. April 2020 19:20:51 UTC+2 schrieb John Aldridge:
OK... I can cope with that. It'll be a bit messy working out (from the script) which source image corresponds to which processed one, but I'm sure I can sort out a way of doing it.

This is a use case for an user defined output: see https://groups.google.com/d/msg/hugin-ptx/_tTVrEm7HzE/B06t7Lz7EgAJ for the executor file

This would require to first create a pto file
align_image_stack -p project.pto images…
and then output the file with hugin_executor (with the executor file from the link above, incl. copying some metadata to output)
hugin_executor --stitching --user-defined-output=align_exiftool.executor --prefix=ais project.pto

Thomas

John Aldridge

unread,
Apr 21, 2020, 3:49:23 AM4/21/20
to hugin and other free panoramic software
Ah, thank you. I'll give that a whirl!

John
Reply all
Reply to author
Forward
0 new messages