Align images/timelapse sequenses. Hugin to the rescue?

1,395 views
Skip to first unread message

Jørgen

unread,
Feb 14, 2016, 8:26:51 AM2/14/16
to hugin and other free panoramic software

Hi, I hope someone can help me with this. I’m getting very frustrated about my failure to solve this. I’m using Windows 8.1 and Hugin 2014.0.0.5da69bc383dd. I have very little experience with command line, but maybe this is not possible only through GUI.


I want to align a bunch of photos for a timelapse movie. I’ve been visiting the same spot over 70 times the last 10 months and have captured a small timelapse sequense every visit (60 images every visit, which is about 2 sec video).


The framing for each sequense is almost identical, but not good enough to get a perfect overlap when playing the sequenses from start to end. Every 2 seconds the framing will shift a little bit.


If I understand correctly Hugin should be able to export multilayer tiffs. But can it also work with multilayer tiffs? If this is possible, than this is what I want to do:

  1. Create a multilayer tiff in Photoshop for each sequense. Each tiff will contain 60 images.
  2. Open the first image from the first sequense (and set this as anchor), and all the multilayer tiffs from the other sequenses.
  3. Manually create 5-6 controll points on the anchor and on the multilayer tiffs.
  4. Optimize with Positions (y,p,r).
  5. Export the multilayer tiffs.

My idea is that all the layers in the multilayer tiffs has been aligned the same way. Now I can open the multilayer tiffs in photoshop and export the layers to individual files again. I’m able to open a multilayer tiff in Hugin, but after export it is a single layer tiff. If I’m able to export this as a multilayer tiff, will all the layers within this tiff have been aligned?


It seems to me that the aligning is much better when creating control points manually, compared to creating control points automatically with Align image stack. I did a test with 5 sequenses (60 images x5, so 300 images in the Photos tab). Hugin found a lot of good control points on each image, but after Optimize with Positions (y,p,r) and export, the result was not as good as the manual process. The shift in framing between sequenses was better than originally, but still too big.


I need some kind of automatic process for this, or make the process described above to work, because I can’t set 5-6 control points manually for 4000+ images :)


This is what I tried first, but it fails:


1a) Load the first image from each sequense and set one of the images as anchor.

1b) Manually set 5-6 control points on the anchor image and each of the other images.

1c) Align the images. Now all the images are aligned to the anchor image, and all images are now very nicely aligned. These images will be anchor images for step 2 described below. I could stop at this point and make this the timelapse, but then it will be a very short timelapse with only 1 image for each day..


2a) Load a sequense (59 images + the aligned image from step 1) into Hugin. The aligned image from step 1 is set to anchor.

2b) Automatically create control points with Align image stack. All 59 images should be aligned to the anchor.

2c) Repeat step 2a and 2b for all other sequenses.


The problem is that the anchor image is also modified, making the whole process useless. When the anchor image also is modified, I still end up with sequenses with slightly different framing.


Maybe there is a much easier way to do this? I’ve tried auto aligning with photoshop, but it fails way too often.


I would greatly appreciate any help. I’m pretty sure Hugin is powerful enough to solve this problem, but apparently I’m not smart enough to figure out how :)

Cheers
Jørgen

T. Modes

unread,
Feb 16, 2016, 12:21:30 PM2/16/16
to hugin and other free panoramic software

Am Sonntag, 14. Februar 2016 14:26:51 UTC+1 schrieb Jørgen:

If I understand correctly Hugin should be able to export multilayer tiffs. But can it also work with multilayer tiffs?


Hugin can only export multilayer tiffs, But it does not read all layers.
 

If this is possible, than this is what I want to do:

  1. Create a multilayer tiff in Photoshop for each sequense. Each tiff will contain 60 images.

Now I can open the multilayer tiffs in photoshop and export the layers to individual files again.


Why creating a multilayer file and the end split they again? You will only working with very big images. Keep the images as single files.

Maybe the following  works (untested)
1.) Create a pto file with all first images of all sequences.
2.) Let cpfind --linear create the cp or alternatively do it by hand
3.) Then create for each sequence a new file and use align_image_stack for each sequence.
4.) Then load the first pto file again and merge all single sequences with this pto file.
5.) Optimize position
6.) Output remapped images (maybe switch off "cropped output")

Thomas

Alister Ling

unread,
Feb 17, 2016, 1:20:41 AM2/17/16
to hugin and other free panoramic software
Wow, nice coincidence. I too am having issues, but with a 270 frame time lapse - I can't figure out the correct workflow. Worked beautifully for 5 frames, but got unexpected results for all 270. I let (2013.0.0.0d404a7088e6)  run all night after having clicked Hugin's CPfind. It found some 117 000 control points (or was it more?). At that point I saved the .pto as recommended. I then chose low dynamic range, clicked on positions and view (y,p,r,v) then calculate. It whirred away, created a window with "strategy # 1" but after 3 hours, created a second window with "strategy # 2" and with both running simultaneously, ground my machine down to a pause... calling up task manager took almost 2 minutes. 

Now, I realize that it is doing a lot of aligning, and I am good about letting it run all night, but it didn't seem to be going anywhere.  Is this the proper workflow? The interface says I am using some 5000 control points per image! I saw a thread from several years ago (Pushing align_image_stack to the limit) that talked about a perl wrapper to call align_image_stack looping through a pair of images with the initial one as anchor. Sounds good, I can code, but no idea what to provide the command line scripts. Should I, or can I, force the use of say only 20 points per image? 

Your input is appreciated!

By the way, why do I want to align? My problem is that it was windy and I was shooting at 113mm, so got too much camera shifting frame to frame. Obviously weighting the tripod is thing to do next time, but it would be nice to salvage the sequence. 
Regards,
Alister. 

T. Modes

unread,
Feb 17, 2016, 11:33:58 AM2/17/16
to hugin and other free panoramic software


Am Mittwoch, 17. Februar 2016 07:20:41 UTC+1 schrieb Alister Ling:
Worked beautifully for 5 frames, but got unexpected results for all 270. I let (2013.0.0.0d404a7088e6)  run all night after having clicked Hugin's CPfind. It found some 117 000 control points (or was it more?).

That are many cp. This will slow down all things. I would recommend for this use case  to use "cpfind --linear" or align_image_stack as control point detector.
Cpfind by default will try to connect *all* image pairs. But in this case this strategy will create too many cp and will slow down the optimizer.

Thomas

Alister Ling

unread,
Feb 18, 2016, 12:52:24 AM2/18/16
to hugin and other free panoramic software
Thank you Thomas, and please forgive my semi-beginner questions. The way you use "cpfind --linear" and align_image_stack indicates you are unsgin those on the command line and not in Hugin. I have run out of time tonight to follow up but will try and locate instructions on the command-line methods. I appreciate your pointing me in the right direction.
Regards,
Alister.

Terry Duell

unread,
Feb 18, 2016, 1:13:44 AM2/18/16
to hugi...@googlegroups.com
Hello Alister,

On Thu, 18 Feb 2016 16:44:40 +1100, Alister Ling <dawns...@gmail.com>
wrote:

> Thank you Thomas, and please forgive my semi-beginner questions. The way
> you use "cpfind --linear" and align_image_stack indicates you are unsgin
> those on the command line and not in Hugin. I have run out of time
> tonight
> to follow up but will try and locate instructions on the command-line
> methods. I appreciate your pointing me in the right direction.

You can use these commands from within hugin, by going to Preferences and
setting align_image_stack as your default control point detector, or
setting a new local version of cpfind with the "--linear" switch.

Cheers,
--
Regards,
Terry Duell

Alister Ling

unread,
Mar 4, 2016, 2:10:50 AM3/4/16
to hugin and other free panoramic software
Hi again Terry,  I tried cpfind with --linear, but I am still having the same problem of finding 721 457 control points. I have attached a screen image showing my parameters. The type was still "all images at once" but the other choices did not look helpful. 

Regards,
Alister.
P.S. Sorry for the recent absence, I had to leave home for a week and concentrate on other issues.
Hugin_CPlinear.jpg

Alister Ling

unread,
Mar 4, 2016, 2:10:50 AM3/4/16
to hugin and other free panoramic software
Hi again. This time I used align_image_stack.exe on a smaller group of 20 images.The arguments were:
-f %v -v -c 8 -p %o %i ; I added  the -c 8 because it is supposed to force the number of control points to 8, but it still found 118 or more control points per image. Once again the type was "All images at once". 

Perplexed,
Alister.

On Wednesday, February 17, 2016 at 11:13:44 PM UTC-7, Tduell wrote:

Terry Duell

unread,
Mar 4, 2016, 5:11:24 PM3/4/16
to hugi...@googlegroups.com
On Fri, 04 Mar 2016 11:59:58 +1100, Alister Ling <dawns...@gmail.com>
wrote:

> Hi again Terry, I tried cpfind with --linear, but I am still having the
> same problem of finding 721 457 control points. I have attached a screen
> image showing my parameters. The type was still "all images at once" but
> the other choices did not look helpful.

It looks like it should be "cpfind --linearmatch"
Run "cpfind -h" to get the full story of the cpfind options.

Alister Ling

unread,
Mar 5, 2016, 12:39:03 PM3/5/16
to hugin and other free panoramic software
Hey Terry, thank you for the continuing help. I am almost there, still some things to work out...
Everything ran in a reasonable time: only 30-40 control points per image and the optimizer, crop, and sticher/export ran fluidly.
BUT, there is still a considerable amount of rotation/shift from one image to the next. I suspect it is that I used the wrong optimize approach:"positions (incremental starting from anchor)". I will try Positions and View today, and try a mask because the control points may have found trees blowing in the wind.

I was wondering if there was a way for me to define the control points in frame 0, then force the control point creator to find only those in the 200+ subsequent frames. 

As a thank you, I will create a tutorial showing the steps. This technique will also be useful for those who have no choice but to shoot from a bridge that bounces as buses and trucks cross.

Regards,
Alister.

Alister Ling

unread,
May 11, 2020, 12:50:06 AM5/11/20
to hugin and other free panoramic software
SOLVED:  nona-deshake

This is an old thread, but in case someone comes down this path, the link redirects onto another thread with the solution.
Alister.

Reply all
Reply to author
Forward
0 new messages