# Hugin Batch Processor

Batch Processor is a component of hugin that provides functionality to stitch multiple projects in a batch queue. Its goal is to make stitching of multiple projects faster. The process of stitching multiple projects is simplified using a queue of projects. User can add/edit/delete projects in the queue. The Batch Processor can also queue the creation of the final project. In this case it runs the same steps as in the Hugin Assistant tab.

Hugin Batch Processor consists of a list of projects. Projects in the list are ordered in sequential order. By default, the list is reinstated every time you open the application. What is more, entire queue of projects can be saved and reopened later using buttons Clear Batch, Open Batch, Save Batch.

There are 2 interfaces to the queue: PTBatcher provides a command line interface and PTBatcherGUI provides a graphical user interface.

# Installation on Mac OS X

At least on Mac OS X you have to download and install the BatchProcessor separately. You will find it at the Sourceforge page[*] inside the folder for the latest version, e.g. ptbatchergui-mac-2011.0.0.dmg[*]. Just copy the app into the same folder as hugin and run it.

# Usage

Just create several project files (do everything and just skip the export step), load them in the batch processor and start the process. This way you can run several large projects unattended. The output file name will be the same as the name of the corresponding project file (xyz.pto -> xyz.tif) and is saved in the same folder.

At least on Mac OS X there are some minor issues to pay attention to (This should be fixed in 2011.1, rev. 43043d2742e4):

- You should only add the project files you want to process by using the "add project" (see below) or the menu "File - Add Project". Be aware that you will not be able to delete or deactivate a single project from the list - you will have to clean up the whole list using the menu "File - Clean List".
  If you want to process all projects inside a folder, just use the "folder search" (see below).
- Some older entries in PTBatcherGUI's list view (those with status "File missing") may not be removable by clicking the 'minus' symbol or the "Remove complete" button.
  To remove those just close PTBatcherGui, open it again and immediately select one of the missing pto files and start deleting them using the 'minus' symbol. As an alternative, use the button "Remove completed" on the right side which will remove all completed projects in one go.

Apart from this, all works fine.

# Flag options

Batch process is also influenced by the following check boxes:

- parallel execution: Execute stitching of projects in the list parallel rather than in sequential order. Check this only if you are certain your computer is up for the task of stitching multiple projects at the same time.
- overwrite always: Always(for each project) overwrite output filename if it exists. Otherwise, you will get a dialog box whether you want to overwrite files or not.
- Shutdown when done: Turn off computer when batch process ends.
- Remove finished projects: If checked successful finished projects will be automatic removed from the queue. Otherwise the items remains in the queue and the user is responsible for the queue management.
- Automatic stitch after assistant: If checked successful detected projects (projects in the assistant queue) will be added the stitching queue and will therefore automatically stitched.

# Functions

## Queue management

The management of the queue can done by the appropriate menu items or by the corresponding toolbar buttons.

- Add project files to queue
- Remove project file from queue (you need to select the project file in the list)
- The complete queue list can be saved and loaded from disc (The current active list is automatically saved at the end. You don't need to save it explicitly.)
- The complete list can be cleared.

## Item management

The single items in the queue can be modified by the buttons on the right side of the window

- Remove complete will remove all items form the queue which were successfully finished.
- Change prefix will change the output prefix. This is only possible if the item is in the stitching queue. It does not work for items in the assistant queue.
- Reset project/Reset all resets the status of the selected project/all projects to default value. This allows to execute the stitching again.
- Edit with Hugin opens the selected in Hugin to modify it.
- The order of the items can be change with Move project up and Move project down
- You can also add an arbitrary command to the queue with Add application.

## Executing queue

The queue can be started, paused/resumed and stopped with the toolbar buttons. You can also skip one project.

## Automation

PTBatcherGUI provides some more features for automation. This can be accessed by File->Search directory for.

### Existing project files

With File->Search directory for...->Projects you can search recursively in the given folder for (existing) project files and appends them to (stitching) queue.

### New project files

First select a folder in which should be searched. After pressing start is searches for image files in the folder (and optionally its sub folders). It uses the information stored in the EXIF data to decide which images could belong to a panorama. This works only in one folder level, it does not match images in different folders. (It uses camera maker, camera model, focal length, image size and date/time for this decision.)

After the search has finished it shows a list of the found panoramas. With Send selected panoramas to queue the project files are created and send to the assistant queue. You can deselect individual panoramas from this processing step by untick the panorama.

The project files are named with the selected name scheme

- PanoramaXX.pto: This will generate project files: panorama0.pto, panorama1.pto,...
- First file - last file.pto: The project files will by named by the first and last image of the panorama.
- Foldername.pto: In this case the project file is named like the containing folder.

Existing project files will not be overwritten, instead it appends an increasing number.

If the images are shoot with auto bracketing it tries to generate the appropriate stacks. In this case check that you default control point generator setting is one which works with stacks (check Preferences in Hugin and control point detector parameters). If you shoot from a tripod then you can select also Create links. This will link the positions of all images of one stack. If you deselect this option, it will create the stacks but will not link the positions of the images (e.g. when shooting free hand).

# Command line switches

## PTBatcherGUI

To add a project to the (stitching) queue use

       PTBatcherGUI project.pto output_prefix

on Mac OS X use

       open PTBatcherGui.app --args project.pto output_prefix

You can also add several projects

       PTBatcherGUI project1.pto prefix1 project2.pto prefix2

on Mac OS X use

       open PTBatcherGui.app --args project1.pto prefix1 project2.pto prefix2

The prefix is optionally. If you don't provide a prefix, the filename (without extension) of the project file is used as prefix.

You can also add a project to the assistant queue.

       PTBatcherGUI --assistant project.pto

and on Mac OS X

       open PTBatcherGui.app --args --assistant project.pto

Some of the above described options can be accessed also by command line switches:

- `/h, --help` show this help message
- `/b, --batch` run batch immediately
- `/p, --parallel` run batch projects in parallel
- `/d, --delete` delete *.pto files after stitching
- `/o, --overwrite` overwrite previous files without asking
- `/s, --shutdown` shutdown computer after batch is complete
- `/v, --verbose` show verbose output when processing projects

Please keep in mind that only one instance of PTBatcherGUI can run at one time. Starting PTBatcherGUI a second time with command line switches will influence the already running instance and not start a second instance with own options.

## PTBatcher

PTBatcher provides a very similar interface compared to the GUI version. It works with the same list that is used by the GUI version. Attention: Only the short names of the switches are recognized.

- `-a file` add project to queue. Unless -o option is present, the default prefix is appointed.
- `-o` output prefix (together with -a option)
- `-l` list all projects in batch queue
- `-c` clear all projects from batch queue
- `-x id` remove project with specified id
- `-r` reset all projects to waiting status
- `-b` start batch process
- `-p` use parallel processing (together with -b option)
- `-d` delete .pto files when complete (together with -b option)
- `-s` shutdown computer when complete (together with -b option)
- `-v` verbose mode
- `-h` print this

Retrieved from "http://wiki.panotools.org/Hugin_Batch_Processor"