Panotools::Script - Panorama Tools scripting
Read, manipulate and write Panorama Tools script files.
Panorama Tools script files are used by several tools, including PTStitcher, PTOptimizer, autooptimiser, nona and PTmender.
There are GUI tools to help create them: hugin, PTGui, PTAssembler, autopano-sift and PTMac.
my $p = new Panotools::Script;
$p->Read ('/path/to/script.txt');
$p->Write ('/path/to/script.txt');
File paths in a Panorama Tools script file are generally relative to the directory containing the script. Modify this or otherwise prefix the filenames by supplying an optional second argument:
$p->Write ('/path/to/script.txt', '../path/to/prefix/tofiles');
Clone a script object
$clone = $p->Clone;
Preview a project (requires ImageMagick)
$p->Preview;
Access various sections of the scriptfile:
$p->Mode; # a L<Panotools::Script::Line::Mode> object $p->Panorama; # a L<Panotools::Script::Line::Panorama> object $p->Variable; # a L<Panotools::Script::Line::Variable> object
$p->Image; # an array of L<Panotools::Script::Line::Image> objects $p->Output; # an array of L<Panotools::Script::Line::Output> objects $p->Control; # an array of L<Panotools::Script::Line::Control> objects $p->ControlMorph; # an array of L<Panotools::Script::Line::ControlMorph> objects
Optimise image parameters in a project:
$p->Optimise;
Rotate transform all the images in a project, angles in degrees:
$p->Transform ($roll, $pitch, $yaw);
'o' output lines are generated by PTOptimizer and contain stitching parameters for each input image. 'i' image lines provide parameters for optimisation as well as stitching.
Update the 'image' lines based on 'output' lines and vice-versa like so:
$p->Output2Image; $p->Image2Output;
Stitch a project:
$p->Stitch ('/path/to/output.jpg');
To install Panotools::Script, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Panotools::Script
CPAN shell
perl -MCPAN -e shell install Panotools::Script
For more information on module installation, please visit the detailed CPAN module installation guide.