Hello,
I would like to use panotools to stitch a photo-mosaic in batch mode. The information that I use is from here:
First I create a batch file that automated the process for a 5x5 mosaic:
@ECHO OFF @SET IMAGES=T??.tif @SET PREFIX=Test @SET HUGIN=c:\Program Files (x86)\Hugin\bin @"%HUGIN%\pto_gen.exe" --projection=0 --fov=5 -o project.pto %IMAGES% @"%HUGIN%\pto_lensstack.exe" -o project1.pto --new-lens i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11,i12,i13,i14,i15,i16,i17,i18,i19,i20,i21,i22,i23,i24 project.pto @"%HUGIN%\cpfind.exe" --multirow --fullscale -o project2.pto project1.pto @"%HUGIN%\cpclean.exe" -o project3.pto project2.pto @"%HUGIN%\pto_var.exe" -o setoptim.pto --opt TrX,TrY project3.pto @"%HUGIN%\autooptimiser.exe" -n -o autoptim.pto setoptim.pto @"%HUGIN%\pano_modify.exe" --projection=0 --fov=AUTO --canvas=AUTO --crop=AUTO -o autoptim2.pto autoptim.pto @"%HUGIN%\hugin_executor.exe" --stitching --prefix=%Prefix% autoptim2.pto
Then I have written a simple tool that makes test images:
The random pixels cause that each pixel is a very good comparison candidate for finding Control Points. The marker and the frame facilitate the interpretation of the stitching result.
I expected that panotools can stitch these tiles together only with errors in sub pixel dimension. But the error is significantly larger. After much trial and error I found a solution for this particular case. Based on the test images, I found out that pano_modify.exe caused the error. This program calculates the p line in autoptim2.pto:
p f0 w6857 h6857 v129 E0 R0 S2928,6857,2928,6857 n"TIFF_m c:LZW r:CROP"
I can correct this manually:
Open autoptim2.pto in hugin
On Sticher Tab, Change Field of View, Horizontal and Vertical from 129 to 130.
Press the “Calculate optimal size” Button.
Press the “Fit crop to images” Button
The result is:
p f0 w7014 h7014 v130 E0 R0 S3007,7007,3007,7007 n"TIFF_m c:LZW r:CROP"
Now my questions:
How can I automatically calculate the correct Field of View? Or even better: Is there a way, to bypass the unnecessary Field of View parameter, so that the intermediate images are not scaled.?
How can I avoid that w and h are unnecessarily large? Better as
Why does the command line parameter " --dry-run "for hugin_executor not work? See http://wiki.panotools.org/Hugin_executor. Are the individual commands documented somewhere else?
If someone wants to try the test, here is my test image generator tool:
http://www.file-upload.net/download-11778244/I2T.zip.html
Viruscheck: https://www.virustotal.com/
To create the test images: Press „Random“ Button, Press „Draw Marker“ Button, Enter the target directory in the box to the left of the "Save" button. Press the „Save“ Button.
Thanks in advance
Bernd Derer
Hello,
I would like to use panotools to stitch a photo-mosaic in batch mode. The information that I use is from here: