[ptx] Re: Hugin stitching not working

Carl von Einem einem at gmx.de
Thu Jul 7 19:20:25 BST 2005


Hi Sean,

reading those files was a hard task as a Mac user, believe me! In the 
early days of the panotools that was the only way: learn to read and 
write the script files for PTOptimizer and PTStitcher manually. Today it 
sometimes helps when you can interpret them... :-)

A good starting point for tutorials is the wiki at panotools.info

The new .pto looks weird: nice Control Point Distances, but strange 
results for at least y (yaw). I see you had a preset yaw of -7.39216 for 
the second picture (No. 1) before optimization.

Can you try to reset all your values to 0 again and than do a new 
optimization? Choose all control points to be used for optimization, and 
then step by step
- only optimize yaw of one picture
- new optimization for pitch and roll of both pictures

Have another look at my values for your images, you may also cheat and 
use those as starting points (insert those values in hugins tab for the 
image parameters):

image "045.jpg"
yaw: 0
roll: -1.36353
pitch: 8.94349

image "046.jpg"
yaw 22.2485
roll 0.42884
pitch 10.4035

Note: it's always easier for beginners to stitch a full cylindrical 
pano, set enough control points (up to 7 per image pair are enough), 
never forget the last image pair (last image and image0), anchor yaw of 
one image, optimize y p r for the rest and fov. A wavy horizon can 
easily be prevented by setting t1 control points as I described earlier. 
BTW a wavy horizon can also be corrected in a second run.

happy stitching,
Carl

Sean Davis wrote:
> Hi Carl,
> 
> I don't really know much about reading the scripts below, as I am just using 
> hugin.  I am very new to this.  I added the optimization and control points 
> you show below to test.pto manually, and then ran "PTOptimizer test.pto".  
> The test.pto is attached to this email.
> 
> It appears as though there is something wrong with hugin.  I dont understand 
> what is going on.  I still get the left picture on the right, and vice versa.  
> I don't know if I have PTStitcher installed correctly. ...Does PTStitcher 
> create the preview panorama for hugin?
> 
> Thanks,
> Sean
> 
> 
> 
> On Thursday 07 July 2005 07:18, Carl von Einem wrote:
> 
>>Sean,
>>
>>it's not the stitching thats wrong, you already messed up the
>>optimization by only optimizing one picture:
>>
>># specify variables that should be optimized
>>v p1 r1 y1
>>v
>>
>>better do something like:
>>v y0 p0 r0 p1 r1
>>
>>now you optimize the yaw of one picture (one should stay fix as an
>>anchor image), pitch and roll of both images.
>>I added several t1 control points (two points in one picture indicating
>>a vertical line in the "doors":
>>
>># Control points:
>>c n0 N0 x400 y362 X381 Y775 t1
>># Control Point No 0: 2.43714
>>c n0 N0 x612 y326 X609 Y768 t1
>># Control Point No 1: 0.533513
>>c n0 N0 x868 y285 X889 Y867 t1
>># Control Point No 2: 4.32838
>>c n1 N1 x535 y864 X532 Y323 t1
>># Control Point No 3: 2.93463
>>
>>and that optimized comfortably to
>>
>>#-imgfile 960 1280 0 "045.jpg"
>>o f0 y0 r-1.36353 p8.94349 v=0 a=0 b=0 c=0 d=0 e=0 g=0 t=0
>>#-imgfile 960 1280 0 "046.jpg"
>>o f0 y22.2485 r0.42884 p10.4035 v=0 a=0 b=0 c=0 d=0 e=0 g=0 t=0
>>
>>compare my y/p/r with your values:
>>y20.1366 n"045.jpg"
>>p-0.132258 r2.0 y-7.39216 n"046.jpg"
>>
>>and I didn't even optimize for v or a/b/c yet.
>>
>>Carl
>>
>>btw tested with PTMac (cheating with BBEdit, my text editor) since I
>>have no working installation of hugin yet. You see all the frontends
>>work happily together :-)
>>
>>
>>>Subject:
>>>[ptx]
>>>From:
>>>Sean Davis <seand at colorado.edu>
>>>Date:
>>>Wed, 6 Jul 2005 12:49:46 -0600
>>>To:
>>>ptx at email-lists.org
>>>
>>>Hi
>>>
>>>I just installed hugin from CVS, and am trying to follow the 'stitching
>>>two photos together' hugin tutorial described at
>>>http://hugin.sourceforge.net/tutorials/two-photos/en.shtml
>>>
>>>However, when I do this, the final image I get is completely wrong!  The
>>>right image is on the left, and it appears as though the program ignored
>>>all the points I set.
>>>
>>>I believe I have set and optimized the weight points properly.  I have
>>>posted the two images (045.jpg and 046.jpg), the final image (test.jpg),
>>>and the project file (test.pto) at my website
>>>http://paos.colorado.edu/~seand/hugin/
>>>
>>>Does anyone have a clue whats wrong here?
>>>
>>>Thanks,
>>>Sean
>>>
>>>
>>>------------------------------------------------------------------------
>>>
>>># PTOptimizer script, written by hugin
>>>
>>>p f0 w1024 h695 v64  n"JPEG q90"
>>>m g1 i0 f0
>>>
>>># image lines
>>>i w960 h1280 f0 a0.010963 b-0.069501 c0.076921 d0 e0 g0 p0 r0 t0 v35.1243 y20.1366  u10 n"045.jpg"
>>>i w960 h1280 f0 a=0 b=0 c=0 d=0 e=0 g0 p-0.132258 r2.06674 t0 v=0 y-7.39216  u10 n"046.jpg"
>>>
>>>
>>># specify variables that should be optimized
>>>v y0 p0 r0 p1 r1
>>>
>>># control points
>>>c n0 N1 x678.756 y408.511 X137.965 Y436.209 t0
>>>c n0 N1 x611.718 y326.809 X73.4006 Y347.14 t0
>>>c n0 N1 x613.813 y802.357 X56.1374 Y834.003 t0
>>>c n0 N1 x936.432 y680.851 X378.911 Y715.212 t0
>>>c n0 N1 x638.953 y1168.97 X75.2187 Y1215.27 t0
>>>c n0 N1 x618.003 y898.723 X58.7266 Y934.56 t0
>>># Control points:
>>>c n0 N0 x400 y362 X381 Y775 t1
>>># Control Point No 0: 2.43714
>>>c n0 N0 x612 y326 X609 Y768 t1
>>># Control Point No 1: 0.533513
>>>c n0 N0 x868 y285 X889 Y867 t1
>>># Control Point No 2: 4.32838
>>>c n1 N1 x535 y864 X532 Y323 t1
>>># Control Point No 3: 2.93463
>>>
>>>#hugin_options r0 e1
>>>
>>>
>>>*
>>>
>>># ====================================================================
>>># Output  generated by Panorama Tools
>>>
>>># 47 function evaluations
>>># the relative error in the sum of squares is at most tol
>>># final rms error 2.22767 units
>>>
>>># Panorama description
>>># p f0 w1024 h695 v64 n"JPEG q90"
>>>
>>># Parameters for Each Input Image:
>>># (*) - optimized         (p) - preset 
>>>
>>># Image No 0:
>>># Yaw:	-28.2306 deg (*)	Pitch:	11.2989 deg (*) 
>>># Roll:	-1.63376 deg (*)	HFov:	35.1243 deg (p)
>>># Polynomial Coefficients: a   0.010963 (p); b   -0.069501 (p); c   0.076921 (p)
>>># Horizontal Shift: 0.000000 (p)   Vertical Shift:  0.000000 (p)
>>># Command for Panorama Creation: 
>>>o f0 r-1.63376 p11.2989 y-28.2306 v35.1243 a0.010963 b-0.069501 c0.076921 g0.000000 t0.000000 d0.000000 e0.000000 u10 -buf 
>>>
>>># Image No 1:
>>># Yaw:	-7.39216 deg (p)	Pitch:	12.7825 deg (*) 
>>># Roll:	0.376689 deg (*)	HFov:	35.1243 deg (p)
>>># Polynomial Coefficients: a   0.010963 (p); b   -0.069501 (p); c   0.076921 (p)
>>># Horizontal Shift: 0.000000 (*)   Vertical Shift:  0.000000 (*)
>>># Command for Panorama Creation: 
>>>o f0 r0.376689 p12.7825 y-7.39216 v35.1243 a0.010963 b-0.069501 c0.076921 g0.000000 t0.000000 d0.000000 e0.000000 u10 +buf 
>>>
>>>
>>># ==========================================================================
>>># Control Points: Distance between desired and fitted Position (in "Pixels")
>>>
>>># Control Point No 0:  0.492422
>>># Control Point No 1:  0.981999
>>># Control Point No 2:  1.31506
>>># Control Point No 3:  2.35256
>>># Control Point No 4:  3.98939
>>># Control Point No 5:  1.59445
>>># Control Point No 6:  2.03087
>>># Control Point No 7:  1.6669
>>># Control Point No 8:  2.88529
>>># Control Point No 9:  2.73293
>>>C i0  x202.572 y29.01 X202.313 Y28.9119
>>>C i1  x202.053 y28.8138 X202.313 Y28.9119
>>>C i0  x163.386 y264.246 X163.76 Y263.716
>>>C i1  x164.134 y263.187 X163.76 Y263.716
>>>C i0  x349.311 y202.859 X348.771 Y201.876
>>>C i1  x348.231 y200.893 X348.771 Y201.876
>>>C i0  x181.514 y468.568 X181.511 Y470.528
>>>C i1  x181.507 y472.487 X181.511 Y470.528
>>>C i0  x166.43 y319.236 X167.268 Y319.287
>>>C i1  x168.105 y319.338 X167.268 Y319.287



More information about the ptx mailing list