N pics, one non-interactive run, sane defaults

86 views
Skip to first unread message

Thomas Güttler

unread,
Sep 22, 2015, 7:38:06 AM9/22/15
to hugin and other free panoramic software
Hi,

is there a way to get the following?

I give hugin a directory containing N images. All N images should be created
to one panorama. The directory does not contain other images.

hugin runs (for some minutes) and creates the panorama in a file called panorama.jpg.

I mean the run should be **non-interactive**. Hugin should choose sane
defaults.

If I am not happy with the defaults, I can still call hugin by hand.

Regards,
  Thomas Güttler


Carl von Einem

unread,
Sep 22, 2015, 7:56:38 AM9/22/15
to hugi...@googlegroups.com
Whatever you think "sane" is.

Hugin comes with a batch processor, see
<http://wiki.panotools.org/PTBatcherGUI>

Thomas Güttler wrote on 22.09.15 12:01:

Thomas Güttler

unread,
Sep 22, 2015, 1:22:04 PM9/22/15
to hugin and other free panoramic software, ca...@einem.net


Am Dienstag, 22. September 2015 13:56:38 UTC+2 schrieb zarl:
Whatever you think "sane" is.


Sane is for me democracy: Take 100 average users. If 20 want default value A, 40 want default value B, 30 want C, 10 are unsure,
then the sane default is value B.




 
Hugin comes with a batch processor, see
<http://wiki.panotools.org/PTBatcherGUI>


Thank you.

Unfortunately you could not find a way to get my use case solved with this tool

The tool seems to be build for running several pto project files at once.

I don't have a pto file. I just have one directory with N pictures and the result should be one panorama.jpg.

Maybe I was blind, but I read your above link twice.

Regards,
  Thomas Güttler

PS: somehow the subject of my thread looks strange. It startswith "Re: [hugin-ptx]". I posted via google groups.

 

T. Modes

unread,
Sep 22, 2015, 1:28:27 PM9/22/15
to hugin and other free panoramic software


Am Dienstag, 22. September 2015 19:22:04 UTC+2 schrieb Thomas Güttler:


I don't have a pto file. I just have one directory with N pictures and the result should be one panorama.jpg.

Maybe I was blind, but I read your above link twice.

Terry Duell

unread,
Sep 22, 2015, 6:06:36 PM9/22/15
to hugi...@googlegroups.com
On Tue, 22 Sep 2015 21:56:33 +1000, Carl von Einem <ca...@einem.net> wrote:

> Whatever you think "sane" is.
>
> Hugin comes with a batch processor, see
> <http://wiki.panotools.org/PTBatcherGUI>
>

or you could write a script to process all the images in the dir.

Cheers,
--
Regards,
Terry Duell

Thomas Güttler

unread,
Sep 24, 2015, 8:46:19 AM9/24/15
to hugin and other free panoramic software
Thank you T. Modes for the links.

My script now looks like this:

{{{
#!/bin/bash
# Usage: panorama.sh dir_containing_images_to_stitch
set -x

cd $1

pto_gen -o project.pto *.jpg *.JPG
cpfind -o project.pto --multirow --celeste project.pto
cpclean -o project.pto project.pto
linefind -o project.pto project.pto
autooptimiser -a -m -l -s -o project.pto project.pto
pano_modify --canvas=AUTO --crop=AUTO -o project.pto project.pto
}}}

A project.pto gets created.

Now the stitching needs to be done.

If I call this now:

PTBatcherGUI project.pto output_prefix

the GUI with the batch-jobs opens. But it does not start automatically.

How to start the processing via script?

Thomas Güttler

unread,
Sep 24, 2015, 12:01:13 PM9/24/15
to hugin and other free panoramic software
I found the option to start stitching ...

Here is the script.

Any suggestions for improvements?


{{{
#!/bin/bash
# Usage: panorama.sh dir_containing_images_to_stitch
set -x

cd $1
basename=$(basename $PWD)
pto_gen -o ${basename}.pto *.jpg *.JPG
cpfind -o ${basename}.pto --multirow --celeste ${basename}.pto
cpclean -o ${basename}.pto ${basename}.pto
linefind -o ${basename}.pto ${basename}.pto
autooptimiser -a -m -l -s -o ${basename}.pto ${basename}.pto
pano_modify --canvas=AUTO --crop=AUTO -o ${basename}.pto ${basename}.pto
PTBatcherGUI ${basename}.pto $basename --batch
notify-send "Created panorama $basename"

Terry Duell

unread,
Sep 24, 2015, 6:42:14 PM9/24/15
to hugi...@googlegroups.com
Hello Thomas,

On Fri, 25 Sep 2015 02:01:13 +1000, Thomas Güttler
<guet...@thomas-guettler.de> wrote:

> I found the option to start stitching ...
>
> Here is the script.
>
> Any suggestions for improvements?

You could call hugin_executor.
An example script is attached, modify as appropriate, and see if this
approach helps.
run-scan.sh

Thomas Güttler

unread,
Sep 27, 2015, 6:42:35 AM9/27/15
to hugin and other free panoramic software
Hi,

hugin_executor is not installed on my laptop. I use ubuntu 14.04.

I uploaded my script here:

https://github.com/guettli/panorama

It takes a directory containing jpg-files and outputs a file called
panorama.jpg.

All in batch, not interactive.

Feedback welcome.

  Thomas

Terry Duell

unread,
Sep 27, 2015, 8:21:22 PM9/27/15
to hugi...@googlegroups.com
Hello thomas,

On Sun, 27 Sep 2015 20:42:35 +1000, Thomas Güttler
<guet...@thomas-guettler.de> wrote:

> Hi,
>
> hugin_executor is not installed on my laptop. I use ubuntu 14.04.

Sorry, I assumed you were running Hugin-2015.0.0.
To use the makefile stitching system ( pre hugin-2015.0.0) simply replace
calls to hugin-executor with...

pto2mk -o project.mk -p $Prefix project.pto
make -j 2 -f project.mk all

>
> I uploaded my script here:
>
> https://github.com/guettli/panorama
>
> It takes a directory containing jpg-files and outputs a file called
> panorama.jpg.
>
> All in batch, not interactive.
>

My understanding of python code isn't the best.
What are the advantages of your python script over using using Hugin's
command line tools in a shell script or a batch file?

David W. Jones

unread,
Sep 27, 2015, 11:49:06 PM9/27/15
to hugi...@googlegroups.com
On 09/27/2015 02:20 PM, Terry Duell wrote:
> Hello thomas,
>
> On Sun, 27 Sep 2015 20:42:35 +1000, Thomas Güttler
> <guet...@thomas-guettler.de> wrote:
>
>> Hi,
>>
>> hugin_executor is not installed on my laptop. I use ubuntu 14.04.
>
> Sorry, I assumed you were running Hugin-2015.0.0.
> To use the makefile stitching system ( pre hugin-2015.0.0) simply
> replace calls to hugin-executor with...
>
> pto2mk -o project.mk -p $Prefix project.pto
> make -j 2 -f project.mk all

I booted my Ubuntu 14.04 partition and checked. It offers only Hugin 2013.

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

Stefan Peter

unread,
Sep 28, 2015, 2:29:02 AM9/28/15
to hugi...@googlegroups.com
Hi David

Am 28.09.2015 um 05:48 schrieb David W. Jones:
>
> I booted my Ubuntu 14.04 partition and checked. It offers only Hugin 2013.
>

You can download hugin 2015.0 for all active Ubuntu versions from
https://launchpad.net/~hugin/+archive/ubuntu/hugin-builds

If you feel brave, you can even use
https://launchpad.net/~hugin/+archive/ubuntu/nightly
for the current development version.

With kind regards

Stefan Peter

Thomas Güttler

unread,
Sep 28, 2015, 2:52:32 PM9/28/15
to hugin and other free panoramic software
Hi Tduell,

I use the shell daily, but only for interactive usage.

I stopped scripting with the shell some years ago. I don't like the shell for scripting
since:

 - The shell does not know the concept of exceptions or stacktraces.
 - The shell goes to the next line if something is wrong. I want the programm to stop, not to proceed.
 - The shell has major problems handling filenames which contain special characters.

does this answer your question? Feel free to ask more details :-)

David W. Jones

unread,
Sep 28, 2015, 3:08:18 PM9/28/15
to hugi...@googlegroups.com
Thanks, I only mentioned what version Ubuntu 14 offers because that's
what the OP mentioned he was using. My Ubuntu partition is mostly there
because the manufacturer put it there and my laptop's webcam only
appears to work under Ubuntu. Everything else I use on my laptop is
Debian Sid.

Terry Duell

unread,
Sep 29, 2015, 1:08:48 AM9/29/15
to hugi...@googlegroups.com
Hello Thomas,

On Tue, 29 Sep 2015 04:52:32 +1000, Thomas Güttler
<guet...@thomas-guettler.de> wrote:

> Hi Tduell,
>
> I use the shell daily, but only for interactive usage.
>
> I stopped scripting with the shell some years ago. I don't like the shell
> for scripting
> since:
>
> - The shell does not know the concept of exceptions or stacktraces.
> - The shell goes to the next line if something is wrong. I want the
> programm to stop, not to proceed.
> - The shell has major problems handling filenames which contain special
> characters.
>
> does this answer your question? Feel free to ask more details :-)

Sure, Tah.

bugbear

unread,
Sep 29, 2015, 5:25:41 AM9/29/15
to hugi...@googlegroups.com
Thomas Güttler wrote:
> Hi Tduell,
>
> I use the shell daily, but only for interactive usage.
>
> I stopped scripting with the shell some years ago. I don't like the shell for scripting
> since:
>
> - The shell does not know the concept of exceptions or stacktraces.
It knows about exit statuses (see next)

> - The shell goes to the next line if something is wrong. I want the programm to stop, not to proceed.
Use the -e flag.

-e Exit immediately if a pipeline (which may consist of a single simple command), a list, or a com‐
pound command (see SHELL GRAMMAR above), exits with a non-zero status.

> - The shell has major problems handling filenames which contain special characters.
Use quotes.

> does this answer your question? Feel free to ask more details :-)

BugBear

Reply all
Reply to author
Forward
0 new messages