Batch stitching multiple panoramas

1,514 views
Skip to first unread message

Wla

unread,
Aug 23, 2011, 4:35:21 AM8/23/11
to hugin and other free panoramic software
I would like to make several (thousands) panorama pictures based on 1
set of parameters.
What is the best way to do this with Hugin? I can’t get a grip on the
batch stitcher or it’s workflow.

I have also used PTgui pro and the batch builder, this works perfect
(the process) and I would like to know if this is also possible in
Hugin?

Img1A.jpg - Img1B.jpg - Img1C.jpg - Img1D.jpg ----> pano1.jpg
(these parameters should be the “template” for the other pano’s).

Img2A.jpg – Img2B.jpg – Img2C.jpg – Img2D.jpg ----> pano2.jpg
Img3A.jpg – Img3B.jpg – Img3C.jpg – Img3D.jpg ----> pano3.jpg
ImgXA.jpg - ImgXB.jpg - ImgXC.jpg - ImgXD.jpg ----> panoX.jpg
Img8991A.jpg - Img8991B.jpg - Img8991C.jpg - Img8991D.jpg ---->
pano8991.jpg

I’m making 360 (full frame fish eye | FL: 17 mm) panoramas.
If this batching can be done without a GUI on a Windows machine that
would be great to! Otherwise tutorials, examples or demo’s would be
appreciated.

btw: I’m aware of the following page http://hugin.sourceforge.net/docs/manual/Hugin_Batch_Processor.html
, it doesn’t help me any further so please no references to this page
without extra remarks.

Bruno Postle

unread,
Aug 24, 2011, 7:57:51 PM8/24/11
to hugin and other free panoramic software
On Tue 23-Aug-2011 at 01:35 -0700, Wla wrote:
>I would like to make several (thousands) panorama pictures based on 1
>set of parameters.
>What is the best way to do this with Hugin? I can’t get a grip on the
>batch stitcher or it’s workflow.

The Batch Processor is simply a queue manager, you can send projects
to the queue from Hugin and they will be stitched in sequence.

>Img1A.jpg - Img1B.jpg - Img1C.jpg - Img1D.jpg ----> pano1.jpg
>(these parameters should be the “template” for the other pano’s).
>
>Img2A.jpg – Img2B.jpg – Img2C.jpg – Img2D.jpg ----> pano2.jpg

In the GUI you can use File -> Apply Template in the menu to reuse
an existing .pto project with a different set of photos.

>I’m making 360 (full frame fish eye | FL: 17 mm) panoramas.
>If this batching can be done without a GUI on a Windows machine that
>would be great to! Otherwise tutorials, examples or demo’s would be
>appreciated.

The Hugin process can be managed on the command-line with 'make', if
you have a .pto project to stitch, then you can follow the
commmand-line instructions here:

http://wiki.panotools.org/Panorama_scripting_in_a_nutshell#Makefile_stitching_system

The .pto files are just text, so to stitch a large number of
identical panoramas you can either: script filename substitution and
generate a unique .pto file for each panorama, or give all your
photos the same filenames and reuse the same .pto file.

--
Bruno

Bruno Postle

unread,
May 14, 2013, 4:45:12 PM5/14/13
to Hugin ptx
On Tue 14-May-2013 at 13:07 -0700, White Rabbit wrote:
>On Monday, December 3, 2012 5:11:17 AM UTC-8, mph070770 wrote:
>>> I'm picking up an old thread here but Wla's problem is similar to my
>>> problem and I wonder if you can help.
>>
>> I want to create a video panorama and I'm using 2 cameras to try out my
>> process. I have recorded the videos and split them into individual frames -
>> left0001.jpg / right0001.jpg and so on up to about
>> left0300.jpg/right0300/jpg. From the command line I rename each pair
>> left.jpg and right.jpg and run a batch script (the source_project.pto was
>> initially created in Hugin based upon the first 2 images
>> left0001.jpg/right0001.jpg renamed left.jpg/right.jpg and I manually
>> deleted the control points). I've tried numerous different approaches but
>> either the image cropping is different for each pair of stitched images (so
>> I can't rebuild the images into a video file again) or the control
>> points/stitching doesn't blend properly. I'm trying to find out exactly
>> what steps Hugin takes so that I can copy them on the command line. My
>> current settings are:
>>
>> copy source_project.pto project.pto
>>
>> cpfind.exe -o project.pto project.pto
>> cpclean.exe -o project.pto project.pto
>> linefind.exe -o project.pto project.pto
>> pto2mk -o project.pto.mk -p project project.pto
>> make -f project.pto.mk all clean

These are instructions for aligning and stitching a pair of photos
on the command-line, but for stitching a video stream you only need
to align one pair of photos in the Hugin GUI and use this .pto
project as a template to stitch all the others.

Once you have a .pto project as a template, you can use it to
process any other pair of similar images like so:

nona -o temp template.pto left0123.jpg right0123.jpg

This creates two remapped images, called temp0001.tif and
temp0002.tif. You can join them together with enblend:

enblend --no-optimize -o 0123.jpg temp0001.tif temp0002.tif

The result is a single joined frame called 0123.jpg

Hope this helps, note that the same process should work for more
than two cameras.

--
Bruno

Arthur Wait

unread,
Sep 15, 2013, 11:08:31 PM9/15/13
to hugi...@googlegroups.com
I've used Bruno's approach and it works very well--but I'm wondering if there's a way to speed this up?

Right now, I'm using a shell script to invoke nona and enblend, as Bruno suggests, in a loop for each set of frames from my video cameras. But it's pretty slow, as I spin up and release a new nona and enblend process for every frame.

Is there a way to do this more efficiently?

Thanks!

Art

Monkey

unread,
Sep 16, 2013, 4:35:02 AM9/16/13
to hugi...@googlegroups.com
If there was a way to export nona's pixel mappings, someone (possibly me) could write an Avisynth (Windows, but runs under Wine) video filter to do the heavy lifting. If it's all rectilinear and doesn't involve any of the fancier stuff, you might be able to do it with a <a href="http://forum.doom9.org/archive/index.php/t-165978.html">quad transform</a> filter, if you can figure out (manually or otherwise) where the corners of the images end up.

A pixel mapping import/export would also be useful for Erik's problem <a href="https://groups.google.com/forum/#!topic/hugin-ptx/E8MhOKlhvk0">here</a>.

Bruno Postle

unread,
Sep 16, 2013, 5:15:01 AM9/16/13
to hugi...@googlegroups.com
There is a command-line tool that ships with Hugin called pano_trafo, if you give it a .pto file you can query coordinates (both forwards and backwards).

Panotools::Script has a function to use this as a service, but the way this is done in perl isn't likely to work on Windows.

--
Bruno

Monkey

unread,
Sep 16, 2013, 8:15:22 AM9/16/13
to hugi...@googlegroups.com, bruno...@googlemail.com
Thanks Bruno (and Pablo, who wrote it!), that has a lot of promise.

Jim Watters

unread,
Sep 16, 2013, 11:52:40 AM9/16/13
to hugi...@googlegroups.com
If you have a CUDA graphics card you can try VideoStitch
Depending on graphics card and output size can run at real time.
http://www.video-stitch.com/
It uses Hugin file for templates and aligning images.
The trial version will produce non watermarked output up to 1000 pixels wide. or watermarked over 1000 pixels wide. If you have lots of images to process the purchase price may well be worth it.

Jim
--

-- 
Jim Watters
http://photocreations.ca
Reply all
Reply to author
Forward
0 new messages