[ptx] autopano and multiple rows

Kevin kevin at bluelavalamp.net
Mon Jan 5 00:29:49 GMT 2004


	I found a way to use autopan and create mosaics with it.  I'm sure a perl
script could be written up to automate this, but I can only hack at perl
with a very dull butter knife. 

	I had a 2 row X 3 column mosaic that I tested this with, here's the steps
to do it.

1. Use autopano to create a project file for each row (i.e. row1.pto,
row2.pto, etc).

2. Open up all the project files in a text editor.  You are going to copy
all the lines after '# image lines' and '# control points' to the first
project file.  However, here's where the work comes in, most of the lines
need to be modified.  The first line under '# image lines' of every project
file that you copy in needs to be modified, normally it'll look like this:

i w3072 h2048 f0 a0 b-0.01 c0 d0 e0 ....

	change it so that the variables 'a', 'b', and 'c' are set to zero:

i w3072 h2048 f0 a=0 b=0 c=0 d0 e0


	All of the '# control points' lines that are copied in need to be
modified, normally they will look like this:

c n0 N1 x2841 y1684 X376.083 Y1666.16 t0
c n0 N1 x2498 y1706 X30.2404 Y1693.13 t0
c n0 N1 x2576 y836 X117.763 Y817.889 t0
c n0 N1 x2719 y627 X261.317 Y610.364 t0
c n1 N2 x2517 y1734 X628.797 Y1714.53 t0
c n1 N2 x2428 y828 X545.919 Y809.125 t0
c n1 N2 x2748 y1708 X857.356 Y1685.8 t0
c n1 N2 x2688 y881 X803.974 Y864.169 t0


	The 'n0', 'n1', 'N1', 'N2' and any other 'n' or 'N's you have map back to
what image file these control points refer too.  So in my case I have rows
that have three images.  The first row is numbers 0, 1, and 2, so the
second row is 3, 4, and 5.  So if the lines above were for the second row
they would be changed to:

c n3 N4 x2841 y1684 X376.083 Y1666.16 t0
c n3 N4 x2498 y1706 X30.2404 Y1693.13 t0
c n3 N4 x2576 y836 X117.763 Y817.889 t0
c n3 N4 x2719 y627 X261.317 Y610.364 t0
c n4 N5 x2517 y1734 X628.797 Y1714.53 t0
c n4 N5 x2428 y828 X545.919 Y809.125 t0
c n4 N5 x2748 y1708 X857.356 Y1685.8 t0
c n4 N5 x2688 y881 X803.974 Y864.169 t0


	If I had a third row these images would be numbered 6, 7, and 8.  So the
control points I copied into the first row project file would be changed to
n6, n7, N7, and N8.


	Save out the main project file that you copied all these into and load it
up in hugin.  Now all you need to do is add control points between the two
rows and stitch it all together.  


	A lot of this could be automated with a script.  Ideally a script would
take as input the number of images in a row and a list of image filenames. 
It would then run autopano for each row and merge the project files
together.  Then all you'd need to do is load up the main project in hugin
and add the row control points.

	Kevin


More information about the ptX mailing list