Difference between revisions of "Hugin executor"

From PanoTools.org Wiki
Jump to navigation Jump to search
(Fixes errors, moved descriptions to better place, added some more information)
Line 1: Line 1:
'''hugin_executor''' is a tool for command line stitching or for running the assistant from the command line. It generates a set of commands, which ''may'' be dependent on a .pto, and subsequently runs the commands.
+
'''hugin_executor''' is a tool for command line stitching or for running the assistant from the command line. It generates a set of commands and subsequently runs the commands.
  
 
It will be available in Hugin 2015.0 and later. (Hugin versions up to 2014.0 use [[pto2mk]] for command line stitching.)
 
It will be available in Hugin 2015.0 and later. (Hugin versions up to 2014.0 use [[pto2mk]] for command line stitching.)
 
hugin_executor is useful when you want to run hugin from the command line. By using the assistant, one genereates their pano from the beginning of the process (e.g. make a .pto, generate control points). By using the stitching option, it is akin to clicking "Stitch!" from the "Stitcher" tab in the Hugin UI. This stitching approach expects a pto to have been curated up to this point in the Hugin workflow. As a practical example: the stitching approach allows one to use the CLI for most steps while still having the ability to inspect control points in the Hugin UI before a final stitch, a common intermediate point during the stitching process.
 
 
One might be interested in using hugin_executor over writing steps individually because it extracts settings and flags that were set from the Hugin UI.
 
  
 
== Command line stitching ==
 
== Command line stitching ==
Line 13: Line 9:
 
     hugin_executor --stitching --prefix=prefix project.pto
 
     hugin_executor --stitching --prefix=prefix project.pto
  
It will use the settings in the project file and also in [[Hugin_Preferences|Hugins preferences dialog]] (e.g. exiftool settings).
+
It will use the settings in the project file and also in [[Hugin_Preferences|Hugins preferences dialog]] (e.g. exiftool settings). It is the same as using "Stitch!" from the [[Hugin_Stitcher_tab|stitcher tab]].
  
 
When no prefix is specified it will use the output prefix found in Hugins preferences dialog. The default value for the output prefix is the filename (inclusive path) of the project file.
 
When no prefix is specified it will use the output prefix found in Hugins preferences dialog. The default value for the output prefix is the filename (inclusive path) of the project file.
Line 25: Line 21:
 
     hugin_executor --assistant project.pto
 
     hugin_executor --assistant project.pto
  
This will run different other command line tools (like [[cpfind]], [[linefind]], [[autooptimiser]]) on the project. The project file will be overwritten with the extended project file (e. g. with control point and optimized).
+
This will run different other command line tools (like [[cpfind]], [[linefind]], [[autooptimiser]]) on the project and determine so the settings needed for the following stitching step. It expects a pto file with information about the images, the lenses and the stacks in this project. This pto file can e.g. be created with [[pto_gen]].
 +
 
 +
The project file will be overwritten with the extended project file (e. g. with control point and optimized).
 +
 
 
The settings of the assistant can be changed in [[Hugin_Preferences|Hugins preferences dialog]].
 
The settings of the assistant can be changed in [[Hugin_Preferences|Hugins preferences dialog]].
  

Revision as of 13:44, 16 April 2017

hugin_executor is a tool for command line stitching or for running the assistant from the command line. It generates a set of commands and subsequently runs the commands.

It will be available in Hugin 2015.0 and later. (Hugin versions up to 2014.0 use pto2mk for command line stitching.)

Command line stitching

To stitch a project file from the command line use

   hugin_executor --stitching --prefix=prefix project.pto

It will use the settings in the project file and also in Hugins preferences dialog (e.g. exiftool settings). It is the same as using "Stitch!" from the stitcher tab.

When no prefix is specified it will use the output prefix found in Hugins preferences dialog. The default value for the output prefix is the filename (inclusive path) of the project file.

When adding the switch --user-defined-output=executor_file the default stitching is disabled and the steps defined in the executor_file are used instead (see user defined output sequence for more details).

Command line assistant

The assistant can run on the command line with

   hugin_executor --assistant project.pto

This will run different other command line tools (like cpfind, linefind, autooptimiser) on the project and determine so the settings needed for the following stitching step. It expects a pto file with information about the images, the lenses and the stacks in this project. This pto file can e.g. be created with pto_gen.

The project file will be overwritten with the extended project file (e. g. with control point and optimized).

The settings of the assistant can be changed in Hugins preferences dialog.

Advanced options

  • --threads=NUM: Many of the individual tools are using as much threads as possible, e.g. on a 4 core processor it will use 4 threads. This behavior can be changed by setting the environment variable OMP_NUM_THREADS or set the switch --threads to reduce the CPU load.
  • --dry-run: By default hugin_executor executes all commands in sequence. For special scripting purposes you may need the individual commands. For this use case call hugin_executor with --dry-run switch. This will print all commands to the console, from where you can use them in your own scripts.