Align image stack - fixing one photo

Skip to first unread message

Krzysztof Lorek

unread,
Feb 10, 2014, 5:31:38 PM2/10/14
to hugi...@googlegroups.com
Hi,

I'd like to do the following: I've got several photos of the same view, taken at different conditions - day, night, fog, sunset, etc. I edited one of them, straightened the horizon in Gimp, corrected the distortions etc. Now I'd like to align the other pictures to this first one - so that they are framed in the exact same way, and when we watch them - the buildings stay the same, only the weather changes.

I've tried using align image stack option, but whatever I do, the first photo also gets changed in some way. There must be some way of having it fixed, I just don't understand all these options. Could you give me a hint?

And it's important to have them all fitted to the 1st picture, because I want to keep on taking more photos, and having them aligned to the rest.

Thanks,
Chris

Greg 'groggy' Lehey

unread,
Feb 10, 2014, 8:48:14 PM2/10/14
to hugi...@googlegroups.com
On Monday, 10 February 2014 at 14:31:38 -0800, Krzysztof Lorek wrote:
>
> I'd like to do the following: I've got several photos of the same view,
> taken at different conditions - day, night, fog, sunset, etc. I edited one
> of them, straightened the horizon in Gimp, corrected the distortions etc.
> Now I'd like to align the other pictures to this first one - so that they
> are framed in the exact same way, and when we watch them - the buildings
> stay the same, only the weather changes.
>
> I've tried using align image stack option, but whatever I do, the first
> photo also gets changed in some way. There must be some way of having it
> fixed, I just don't understand all these options. Could you give me a hint?

You might like to take a look at
http://www.lemis.com/grog/photography/aligning-with-Hugin.php
As it says, it's a work in progress, or at least in need of progress.
I can't recall whether it changes the first image, but I think not.
I'd be interested in feedback one way or the other.

Greg
--
Sent from my desktop computer.
Finger gr...@FreeBSD.org for PGP public key.
See complete headers for address and phone numbers.
This message is digitally signed. If your Microsoft MUA reports
problems, please read http://tinyurl.com/broken-mua

Krzysztof Lorek

unread,
Feb 11, 2014, 5:04:11 AM2/11/14
to hugi...@googlegroups.com
Thanks Greg, this was really helpful - and it gave me hope that the thing is actually doable :)

So in my case - I had to add points manually, but that's fine. Then I did what you were saying - with cylindrical equidistant projection, and clicking "calculate optimal size". The photos matched not too bad - but they were both barrell distorted - I guess that's how it's called. With rectilinear projection they don't get distorted - but both get scaled and there doesn't seem to be a way of stopping it... And in this case the match is much worse, I don't understand why. I tried "anchor the position of the first image" in the images tab, but the first image got edited anyway.

Sorry if the names of the options aren't exact - I'm translating them from my language.

Chris

Carlos Eduardo G. Carvalho (Cartola)

unread,
Feb 11, 2014, 8:21:37 AM2/11/14
to hugi...@googlegroups.com

You probably need to say that the first image uses a different lens and don't optimize it, just optimize the other lens.

Carlos E G C (Cartola) via celular
http://cartola.org/360
http://www.panoforum.com.br/

--
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/9bf2b057-5f80-4b1d-9e9c-d014194c722e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Krzysztof Lorek

unread,
Feb 11, 2014, 4:19:39 PM2/11/14
to hugi...@googlegroups.com
Thanks Carlos,

I now changed the lens of the first image to 1000. In order not to optimize it, I just uncheck all the boxes in the optimizer tab, referring to the 1st picture, correct?

I just did it and the matching is much better.

...

Ok I've just done the whole thing again as above - but this time I didn't touch the panorama preview at all - previously I was clicking "fit the picture into canvas" all the time, because it was so tiny in the preview - apparently this was screwing it up - now it worked perfectly!

Thank you everyone! :)

Chris

Daniel Reetz

unread,
Feb 11, 2014, 11:18:51 PM2/11/14
to hugi...@googlegroups.com
Chris, it would be awesome if you could write up a little tutorial with an example. I have tried a few times to do what you just did, and never found the existing tutorials to be quite explicit enough.


--
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.

For more options, visit https://groups.google.com/groups/opt_out.



--
Daniel Reetz

 

Carlos Eduardo G. Carvalho (Cartola)

unread,
Feb 12, 2014, 6:33:21 AM2/12/14
to hugi...@googlegroups.com
Hi, I've sent some steps to align images some time ago to this list (I guess). I've saved the message to make a tutorial some day, which didn't happen yet. Follows the steps, that were made to hugin 2012.0.0

  • In an empty hugin project I loaded the images in the Wizard tab using the "Load images..." button
  • At the "Images" tab I have selected all the images and clicked the "Create control points" buttom, which gave me 210 control points in all images
  • At the "Control Points" tab I added only one vertical line in only one image, just to guarantee that the result wouldn't rotate crazily - not sure if it is a necessary step
  • At the "Camera and Lens" tab I selected each image separately, starting on the second, and clicked the "New Lens" buttom. This is important, cause you have moved the camera between shots, so we will have a better result if hugin can be free to set different lens parameters and distortions for each individual image
  • At the "Optimizer" tab I did:
    • Positions (y, p, r)
    • Positions, View and Barrel (y, p, r, v, b)
    • After the last one I went to the "Fast preview Panorama" window, selected the "Move/Drag" tab and clicked "Fit"
    • Back at the main window I clicked the "Show control points" buttom (second from right to left in the same line as the "save" button) and in the opened window I:
      • ordered the control points by distance and erased those with more than 90 pixels
      • closed the "show control points" window
    • Back to the main window, at the "Optimizer" tab, I did the "Everithing without translation" optimization
  • Again went to the "Fast preview Panorama" window and selected the "Crop" tab
  • Did a crop to guarantee no hole in the final image. Checked by passing the mouse over each image number to highlight it's area
  • Back to main window, at the "Stitcher" tab, clicket the "Calculate optimal size" button
  • Unchecked the "Exposure corrected, low dynamic range" at "Panorama Outputs"
  • Checked the "Exposure corrected, low dynamic range" at the "Remapped Images"
  • Clicked the "Stitch" button and selected a name to save the results, and voilá...
Bests,


T. Modes

unread,
Feb 12, 2014, 11:36:18 AM2/12/14
to hugi...@googlegroups.com
Hi,


Am Mittwoch, 12. Februar 2014 12:33:21 UTC+1 schrieb Cartola:
  • At the "Optimizer" tab I did:
    • Positions (y, p, r)
    • Positions, View and Barrel (y, p, r, v, b)
    • After the last one I went to the "Fast preview Panorama" window, selected the "Move/Drag" tab and clicked "Fit"
    • Back at the main window I clicked the "Show control points" buttom (second from right to left in the same line as the "save" button) and in the opened window I:
      • ordered the control points by distance and erased those with more than 90 pixels
      • closed the "show control points" window
    • Back to the main window, at the "Optimizer" tab, I did the "Everithing without translation" optimization

be careful with this strategy. It may work, but there is a big risk that this go haywire. For a single stacks don't optimize view and barrel. You need at least to fix v and b for the first image. The same applies for "Everything". For a single stack optimize only Positions.

But why so complicated? Hugin ships with align_image_stack which is specialized for this task and do everything automatic. Just call:
align_image_stack -a aligned image1.jpg image2.jpg …

Thomas

Krzysztof Lorek

unread,
Feb 12, 2014, 3:04:03 PM2/12/14
to hugi...@googlegroups.com
I guess my joy was premature. My Hugin now refuses to produce any output whatsoever - regardless of what sticher I choose. I was choosing PTBatcherGUI and at some point is stopped working. Then today I tried doing the same thing with Hugin_stitch_project, and I managed to produce one pair photos using the method that I described above, and the output was 2 tiny tiny photos randomly rotated, on a black background, so this method isn't really repetitive... Then I tried again and Hugin_stitch_project stopped working either.

If I'm successful with this at some point, I'll definitely make a tutorial, but ... right now I'm far from understanding how to use this program.

Carlos Eduardo G. Carvalho (Cartola)

unread,
Feb 13, 2014, 6:50:44 AM2/13/14
to hugi...@googlegroups.com

2014-02-12 14:36 GMT-02:00 T. Modes <Thomas...@gmx.de>:
But why so complicated? Hugin ships with align_image_stack which is specialized for this task and do everything automatic. Just call:
align_image_stack -a aligned image1.jpg image2.jpg …

Surely this is a strong argument, but some people just don't know how to use the command line... :/

Have you tried this Krzysztof Lorek?

David W. Jones

unread,
Feb 13, 2014, 1:55:34 PM2/13/14
to hugi...@googlegroups.com
On 02/13/2014 01:50 AM, Carlos Eduardo G. Carvalho (Cartola) wrote:

> 2014-02-12 14:36 GMT-02:00 T. Modes:
>
> But why so complicated? Hugin ships with align_image_stack which is
> specialized for this task and do everything automatic. Just call:
> align_image_stack -a aligned image1.jpg image2.jpg …
>
>
> Surely this is a strong argument, but some people just don't know how to
> use the command line... :/

Align image stack is an option on the alignment dropdown in Hugin, so no
need to use command line.

> Have you tried this Krzysztof Lorek?
>
> Bests,
>
> Carlos E G Carvalho (Cartola)
> http://cartola.org/360
> http://www.panoforum.com.br/

--
David W. Jones
gnome...@gmail.com
wandering the landscape of god
http://dancingtreefrog.com

T. Modes

unread,
Feb 13, 2014, 2:17:18 PM2/13/14
to hugi...@googlegroups.com


Am Donnerstag, 13. Februar 2014 19:55:34 UTC+1 schrieb GnomeNomad:
Align image stack is an option on the alignment dropdown in Hugin, so no
need to use command line.

Sorry, but this is not what I meant. In this case align_image_stack is only used as control point generator and you have still to optimize the project and set all output parameters by hand.
When running align_image_stack from the command line (with -a switch) you can automate the whole process and you will get directly the aligned images with further hazzle.

David W. Jones

unread,
Feb 13, 2014, 2:45:51 PM2/13/14
to hugi...@googlegroups.com
Ah, wasn't aware of that. Then it sounds like the command line's your
only option. If you go into Hugin 2013 Preferences, on the Control Point
Detectors tab, you can edit the Align image stack option and add the
"-a" option to it. There are other options already there, I don't know
what impact adding it might have.

Or you can create a new CP Detector entry and give it the -a option and
test things out until you find a combo that works.
Reply all
Reply to author
Forward
0 new messages