align_image_stack with any exposure but move/drag

128 views
Skip to first unread message

mh00h

unread,
Aug 1, 2017, 3:44:21 AM8/1/17
to hugin and other free panoramic software
I have a big tree that I want a panorama of. The frame is tall and skinny, and a good candidate for HDR.
I separated the images out by shutter speed and stitched each individually. This being a vertical pano, the results require me to move/drag in the GUI and re-stitch because "straighten" feature corrupts the view.

Next step: exposure fusion for the three panos.

run align_image_stack against the three and I get a problem: the perspective of each of the three pano's is off because I had used the move/drag feature.
16 bit images aren't cropped to the same size.
Drop down to 8 bit and use imagemagick to crop... nope, still doesn't work. Moving/dragging had caused the images to be too different to align. Plus exif data now missing.

Images are big so running cmd's on another machine. Tried shrinking the images down to work with in Hugin's GUI but the results are the same- very poor alignment just without the cli errors.

Any tips?


Greg 'groggy' Lehey

unread,
Aug 1, 2017, 3:53:35 AM8/1/17
to hugi...@googlegroups.com
On Tuesday, 1 August 2017 at 0:09:45 -0700, mh00h wrote:
> I have a big tree that I want a panorama of. The frame is tall and skinny,
> and a good candidate for HDR.
> I separated the images out by shutter speed and stitched each individually.
> This being a vertical pano, the results require me to move/drag in the GUI
> and re-stitch because "straighten" feature corrupts the view.

Thre are two steps, of course: stitch the panoramas and merge the
images. You're doing in that sequence. I do this regularly in the
opposite sequence: first merge the individual views into HDR images,
and then stitch them. This gives the advantage that you can use the
individual views independently of the panorama, and it should also
solve your problem.

Greg
--
Sent from my desktop computer.
Finger groo...@gmail.com for PGP public key.
See complete headers for address and phone numbers.
This message is digitally signed. If your Microsoft mail program
reports problems, please read http://lemis.com/broken-MUA
signature.asc

dkloi

unread,
Aug 1, 2017, 8:40:06 AM8/1/17
to hugin and other free panoramic software
I'd import all the images into a single project. Image align stack each set of exposure. Stitch together one image from each exposure stack into a panorama (e.g. the middle exposures). Thus the others in the stack will also be aligned. Then I would export each exposure separately (light, mid, and dark), finally enfusing them. This is my usual procedure for doing exposure fused panos, e.g. https://www.360cities.net/image/glasgow-nelson-mandela-place

mh00h

unread,
Aug 1, 2017, 2:39:16 PM8/1/17
to hugin and other free panoramic software
I agree that your method seems like the most reasonable approach. Unfortunately, I cannot revisit that spot and need to make the other direction work for these images. I feel a bit misled by hugin documentation suggesting that the any-arrangement direction would work: http://hugin.sourceforge.net/docs/manual/Hugin_Stitcher_tab.html. Exposure fusions via any-arrangement is much easier to take panos with, even when using a special tripod head. You don't have to fiddle with camera settings which costs in time while the light is good.
Message has been deleted
Message has been deleted

mh00h

unread,
Aug 1, 2017, 3:02:48 PM8/1/17
to hugin and other free panoramic software
Here is my workflow:


 
Image align stack each set of exposure.
Images are big 16-bit tiffs need to be done from the command line on a machine with more ram than mine. I think I'm doing as you instructed?

Stitch together one image from each exposure stack into a panorama (e.g. the middle exposures). Thus the others in the stack will also be aligned. 
It sounds like you're proposing something different to the highlighted part of my workflow which could solve my problem but I'm not following you quite yet! Can you explain in more detail?

360.net...
Beautiful! You're getting solid alignment. It is far better aligned than what I'm seeing.

T. Modes

unread,
Aug 1, 2017, 5:01:30 PM8/1/17
to hugin and other free panoramic software


Am Dienstag, 1. August 2017 14:40:06 UTC+2 schrieb dkloi:
Then I would export each exposure separately (light, mid, and dark), finally enfusing them.

This is what fused from any arrangement does. So no need to do it manually.


Am Dienstag, 1. August 2017 20:39:16 UTC+2 schrieb mh00h:
 I feel a bit misled by hugin documentation suggesting that the any-arrangement direction would work: http://hugin.sourceforge.net/docs/manual/Hugin_Stitcher_tab.html.
Sorry, but this is not helpful - for nobody. What does not work? What are you doing - what does you expect to happen - and what does happen? (Or have the help to be written better?)

mh00h

unread,
Aug 1, 2017, 5:48:59 PM8/1/17
to hugin and other free panoramic software
Sorry, but this is not helpful - for nobody.
I agree with you. I'm wondering if "exposure fused from stacks" is the preferred way to capture and could eliminate potential roadblocks downstream in the workflow? If so, a note in the documentation might be helpful? Your thoughts?


What does not work?
Two things:
    - vertical panorama not getting placed in the canvas well
        I found these suggestions helpful:
            - rotate 90 degrees before stitching
            - move/drag
    - move/drag causes panos 1, 2, and 3 to not align well in align_image_stack
        At what step would Hugin account for such discrepancy caused by different move/drag on the three different panos?

what does you expect to happen
I expect to see a final output with fused images lined up. But I do not.

Give me a few hours and I can supply some example files.

mh00h

unread,
Aug 2, 2017, 4:04:11 AM8/2/17
to hugin and other free panoramic software
Link to example images for stitching, separated by shutter speed into different directories: https://drive.google.com/open?id=0Bw9V6rSPDjXYWFgyMEZmRUpHVmM
Each group has been stitched into a pano. I'm stuck at making an exposure fusion of the results from a linux command line. Non-expensive GUI operations permissible.

$20 bug bounty offered by paypal, forwardable to charity of your choice (Hugin donation page is down).

bugbear

unread,
Aug 2, 2017, 5:02:16 AM8/2/17
to hugi...@googlegroups.com
'dkloi' via hugin and other free panoramic software wrote:
> I'd import all the images into a single project. Image align stack each set of exposure. Stitch together one image from each exposure stack into a panorama (e.g. the middle exposures). Thus the others in the stack will also be aligned. Then I would export each exposure separately (light, mid, and dark), finally enfusing them. This is my usual procedure for doing exposure fused panos, e.g. https://www.360cities.net/image/glasgow-nelson-mandela-place

Interesting - I do the exact opposite, due to performance limitations on my box. The FIRST
thing I do (using a small perl script) is identify each bracketed set and enfuse them
from the command line.

From then on, it's just (from Hugin's POV) a simple pano.

This gives a minimum RAM usage - initial enfuse is small, and final stitch
is smaller.

If you do it stitch-then-fuse, the final enfuse is very RAM hungry; it's effectively
ALL the source images handled simultaneously.

In theory, the low-RAM method could lead to edge effects, since the enfuse is being
done without global knowledge, but in practice, decent amounts
of overlap (needed for good alignment and stitching in any case)
render this problem vanishingly small.

BugBear

dkloi

unread,
Aug 2, 2017, 9:07:54 AM8/2/17
to hugin and other free panoramic software
A bit more explicitly:
1) Import all images into a single Hugin project. I export from Lightroom 16 bit TIFFs that have been colour temperature matched, defringed, noise-reduced, minimally sharpened, black and white pointed adjusted, and sometimes a little bit of highlight recovery plus exposure adjustment to get the histogram looking "nice", not too much clipping at either end, at least for the middle exposures.
2) After setting up lenses, cropping, and masks, I would align each exposure stack, e.g. First align the images taken at position 1 and at -3EV 0EV +3EV with each other. Then align images taken at position 2 and at -3EV 0EV +3EV, etc. This produces control points that should make sure all the different exposures line up.
3) Now I would then generate control points between images taken at the same exposure, e.g. align all the 0EV images, and then optimise to produce a panorama. The other exposure images will now also be aligned by proxy since they were aligned with the 0EV images in the previous step.
4) Photometric optimization. Sometimes have to tweak this (due to the adjustments made in Lightroom).
5) At this stage you have several options as to how to do the final enblend and enfuse. You can enfuse the exposure stacks (or enfuse them prior to alignment as has been suggested by others), and then stitch the fused images. Personally I do it the other way around (it suits my workflow and when I only partially bracket part of a scene), I stitch each exposure plane separately (pano 1, pano 2, pano 3 as in your flow diagram), then enfuse these panos. Since they were already aligned at the very start, there are no registration problems.

The main difference from what you are doing at the moment (as indicated in your diagram) is that the alignment across exposures occurs prior to the stitching. I would guess that trying to align after separately stitching each exposure plane doesn't work due to the fact that the alignment procedure assumes a lens/image model that does not reflect all the degrees of freedom introduced by stitching the different exposures separately.

T. Modes

unread,
Aug 2, 2017, 11:14:37 AM8/2/17
to hugin and other free panoramic software


Am Mittwoch, 2. August 2017 15:07:54 UTC+2 schrieb dkloi:
2) After setting up lenses, cropping, and masks, I would align each exposure stack, e.g. First align the images taken at position 1 and at -3EV 0EV +3EV with each other. Then align images taken at position 2 and at -3EV 0EV +3EV, etc. This produces control points that should make sure all the different exposures line up.
3) Now I would then generate control points between images taken at the same exposure, e.g. align all the 0EV images, and then optimise to produce a panorama. The other exposure images will now also be aligned by proxy since they were aligned with the 0EV images in the previous step.

This (step 2+3) is what cpfind --multirow does when the stacks are assigned before (not sure if Hugin recognizes the stacks).

T. Modes

unread,
Aug 2, 2017, 11:21:08 AM8/2/17
to hugin and other free panoramic software


Am Dienstag, 1. August 2017 23:48:59 UTC+2 schrieb mh00h:
Two things:
    - vertical panorama not getting placed in the canvas well
This is a know issue https://bugs.launchpad.net/hugin/+bug/679282
(But this code is old and I have not found a solution for this problem yet.)
 
 
    - move/drag causes panos 1, 2, and 3 to not align well in align_image_stack
        At what step would Hugin account for such discrepancy caused by different move/drag on the three different panos?
When you manually move the pano you change the projections of the single panos. So each pano has a slightly different projection (depending on the selection projection and how much the position varies.) But align_image_stack can't correct these effects and the final pano can not line up fully. (Depending on the selected project it may possible to handle this when doing the alignment in Hugin GUI.)
Message has been deleted

mh00h

unread,
Aug 6, 2017, 1:58:12 PM8/6/17
to hugin and other free panoramic software

I'm still having problems getting this to stitch.

The main suggestion that I hear from dkloi is to run align_image_stack at the beginning of the workflow regardless of       whether I plan to do exposure fusion from stacks OR exposure fusion from any arrangement. Does this not defeat the purpose  of exposure fusion from any arrangement? Here is what I mean:

Given: Images were shot like this.




What is being proposed: make stacks, even though images were not taken as stacks per flow diagram above. Like this, repeated for all the "stacks":



Then I have two options:

a) exposure fusion from any arrangement (as if moving from ais images, DOWN)
b) exposure fused from stacks (as if moving from ais images to RIGHT)





The problem with this approach is that align_image_stack cannot identify control points for the image DSC_8625.tif which match with the rest of the "stack" (DSC_8632.tif, DSC_8633.tif, DSC_8625.tif). I had originally intended this fusion to happen via any arrangement. I didn't think that individual images had to be ligned up.


I've tried playing with the parameters of align_image_stack but it's not able to make control points DSC_8625.tif no matter what I use. E.g.


    align_image_stack -v -d -i -x -y -z -C --use-given-order -g 40 -a ais ../DSC_8633.tif ........


I suspect that DSC_8625.tif does not lign up because the image is translated too much.


T. Modes, have I interpret the exposure fused from any arrangement workflow wrong? How would this problem be dealt with?

dkloi

unread,
Aug 7, 2017, 1:03:19 PM8/7/17
to hugin and other free panoramic software
I had a look at the files you uploaded. Here's a PTO that has them all aligned.

I added the images into a fresh Hugin project. Did not assign stacks. I ran Hugin's CPFind on each exposure set (same position, different exposures). I then ran CPFind on the middle exposures. Optimized position, got rid of outliers, optimized again. You can now export each exposure plane (same exposures, different positions) separately and enfuse.

I had the same trouble with align_image_stack with DSC_8625.tif. I thought it was because the images aren't very sharp but even with downsized images align_image_stack was failing to find suitable control points. It may be as you suspect, it's too translated with respect to the other two images.

PS You may want to capture a greater range of exposures, not just +/-1EV.
DSC_8625 - DSC_8636_A.pto

mh00h

unread,
Aug 8, 2017, 2:19:47 AM8/8/17
to hugin and other free panoramic software
Thank you everybody in this thread for your patience and your help as I learn to do this on my own. I learned a lot from all of you.
dkloi, I PM'd you to make good on my promise.
Reply all
Reply to author
Forward
0 new messages