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.
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. It also acts as a sort of alias for conglomerating commands.
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).
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. 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.
- --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.