Hello,

I would like to use panotools to stitch a photo-mosaic in batch mode. The 
information that I use is from here:
*http://wiki.panotools.org/Stitching_a_photo-mosaic* 
<http://wiki.panotools.org/Stitching_a_photo-mosaic>
*http://hugin.sourceforge.net/tutorials/scans/en.shtml* 
<http://hugin.sourceforge.net/tutorials/scans/en.shtml>
*http://hugin.sourceforge.net/tutorials/Mosaic-mode/en.shtml* 
<http://hugin.sourceforge.net/tutorials/Mosaic-mode/en.shtml>
(and so on)

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:

   - generates a 4000x4000 image with random pixels
   - draw cross marker every 20 pixel
   - draw  a one pixel wide frame
   - Save the resulting image
   - Cut 5x5 tiles, with 1000x1000 Pixel (250 pixel overlapped) and save 
   this to image T00.tif..T24.tif.
   
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"
 With these settings, hugin produces a sub pixel accurate image. Of course, 
that is not really a useful solution for me, because my batch file must 
provide a correct output image for any set of input images.

Now my questions:

   1. 
   
   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.?
   2. 
   
   How can I avoid that w and h are unnecessarily large? Better as
    p f0 w7014 h7014 v130  E0 R0 S3007,7007,3007,7007 n"TIFF_m c:LZW r:CROP"
   would be
   p f0 w4000 h4000 v130  E0 R0 S0,0,3999,3999 n"TIFF_m c:LZW r:CROP"
   Expressed differently: How can I shift the projection to a minimum 
   canvas? Or is the canvas size only a virtual size which is not 
   physically created?
   3. 
   
   Why does the command line parameter " --dry-run "for hugin_executor not 
   work? See  *http://wiki.panotools.org/Hugin_executor* 
   <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* 
<http://www.file-upload.net/download-11778244/I2T.zip.html>

Viruscheck: *https://www.virustotal.com/* <https://www.virustotal.com/> 
SHA256: ca729b9ba382d63a831a416fed2389647433476f1424b7616591a8abc2297e1d
File name: I2T.exe
  

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

-- 
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
--- 
You received this message because you are subscribed to the Google Groups 
"hugin and other free panoramic software" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/hugin-ptx/44fb9543-2b24-4c53-9573-08af84f4ab02%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to