# Panorama

# 1 Hugin

# 1.1 CLI

How to make a panorama from a folder of images using Hugin’s command line user interface:

pto_gen *.JPG
hugin_executor --assistant *.pto
hugin_executor --stitching *.pto

Output in *.tif.

Results will be bad if there’s more than one image group detected, in that case partition the images into separate folders and retry.

# 2 Multiblend

An alternative to enblend (the default stitch/blend tool used by Hugin).

See what commands Hugin would use to stitch:

hugin_executor --stitching --dry-run *.pto

Then use multiblend instead of enblend, something like:

nona -v -z LZW -r ldr -m TIFF_m -o nona input.pto
multiblend -o output.tif nona*.tif
rm nona*.tif

# 3 pano_modify

e.g. to set projection to uncropped equirectangular:

pano_modify --projection 2 --fov 360x180 --canvas 4096x2048 --crop "0,100,0,100%" -o output.pto input.pto

# 4 ffmpeg

# 4.1 v360

The v360 ffmpeg filter can convert between projections, for still images too. Field of view is best set using d_fov (diagonal) (Using horizontal/vertical may give distorted images.) Orientation is set in degrees, with -180<=yaw<=180, -90<=pitch<=90, -180<=roll<=180

To flatten a part of a spherical panorama:

ffmpeg -i equirectangular.tif -vf "v360=input=equirect:output=rectilinear:d_fov=$FOV:w=$W:h=$H:yaw=$Y:pitch=$P:roll=$R" rectilinear.tif

Ignore the warnings about the output not being an image sequence, for inputs with 1 frame.