############### Example Optimizer Script for Merging Images using Panorama Tools ######### # # # Only lines starting with 'p', 'v', 'i', and 'c' are read. # The script must contain: # one 'p'- line describing the output image # one 'i'-line for every input image # one 'v'- line listing the variables to be optimized # one 'c'-line for each control point listing the coordinates of that point # # # Script syntax: # ============== # # 'p'-line options # ---------------- # w1000 specify width in pixels # h600 specify height in pixels (default: width/2) # f0 specify projection format, always use 0-rectilinear for mosaics even if # your lens is different #v360 specify horizontal field of view of panorama (use a dummy value for mosaics, # which reflects the ratio of total image width / scanned image width) #nPICT specify Output file format, for mosaics one of: # PICT pict-file on macs, bmp-file on win (default) # PSD_mask Photoshop file, one image per layer # + masks for stitching # PSD_nomask Photoshop file, one image per layer, # no stitching masks ## #-buf This option should be set if you use either of the PSD formats p f0 w3000 h3000 v0.66 nPSD_mask -buf # # 'i'-line options # ---------------- # f0 specify projection format, always use 0-rectilinear for mosaics even if # your lens is different # w1000 specify width in pixels # h600 specify height in pixels #v82 specify horizontal field of view of image (use a dummy value for mosaics, # which reflects the ratio of total image width / scanned image width) #y0 yaw angle (always 0 for mosaics) #p0 pitch angle (always 0 for mosaics) #r0 roll angle (always 0 for mosaics) #d1072 shift image 1072 pixels to the lift #e803 shift image 803 pixels up #u10 specify width of feather for stitching. default:10 #m20 ignore a frame 20 pixels wide. default: 0 #s0 specify placement of seam between buffer and image: # 0-middle of overlap('blend' ,default) # 1- at edge of image ('paste'). #k1 attempt colour/brightness correction when merging # image and buffer, one of 0- no correction(default); # 1-change image; 2-change buffer; 3-change both # this feature does not work very well! # # Parameters in different images can be linked using '=' # followed by the image number starting with 0. # Example 'v=0' sets horizontal field of view as in # image number 0. This feature works for the variables # v,a,b,and c. # i w1296 h1944 f0 r0 p0 y0 v.242 d1072 e803 i w1296 h1944 f0 r0 p0 y0 v.242 d1072 e-803 i w1296 h1944 f0 r0 p0 y0 v.242 d0 e803 i w1296 h1944 f0 r0 p0 y0 v.242 d0 e-803 i w1296 h1944 f0 r0 p0 y0 v.242 d-1072 e803 i w1296 h1944 f0 r0 p0 y0 v.242 d-1072 e-803 # 'v'-line options # ---------------- # # The images are numbered starting with 0 # One image has to stay fixed which becomes the anchor # for all others, in this case image No 0. # # v1 optimize field of view in image 1. For mosaics # this optimizes magnification # r1 optimize roll (rotation) in image 1 # d1 optimize horizontal displacement in image 1 # e1 optimize vertical displacement in image 1 v v1 r1 d1 e1 v2 r2 d2 e2 v3 r3 d3 e3 r4 v4 d4 e4 v5 r5 d5 e5 # 'c'-line options # ---------------- # # n1 Image No 1 is first image in pair # N0 Image No 0 is second image in pair # x267 horizontal pixel coordinate of control point in first image # X227 horizontal pixel coordinate of control point in second image # y267 vertical pixel coordinate of control point in first image # Y267 vertical pixel coordinate of control point in first image c n1 N0 x267 y383 X227 Y1905 c n1 N0 x1226 y307 X1187 Y1804 c n2 N0 x214 y230 X1096 Y156 c n2 N0 x265 y1682 X1135 Y1610 c n2 N3 x265 y1683 X285 Y75 c n2 N3 x945 y1734 X962 Y132 c n2 N4 x1141 y234 X222 Y241 c n2 N4 x1056 y1710 X155 Y1718 c n4 N5 x155 y1718 X222 Y50 c n4 N5 x980 y1685 X1039 Y56 c n3 N1 x285 y74 X1178 Y110 c n3 N1 x137 y795 X1016 Y828 c n3 N5 x1073 y107 X222 Y49 c n3 N5 x976 y590 X109 Y529 c n3 N5 x1007 y1514 X110 Y1453 * # ==================================================================== # Output generated by Panorama Tools # Warning: Number of Control Points is smaller than Number of Variables to fit. 6936 function evalutations # the relative error between x and the solution is at most tol # Panorama description p f0 w3000 h3000 v0.66 n"PSD_mask" # Parameters for Each Input Image: # (*) - optimized (p) - preset # Image No 0: # Yaw: 0 deg (p) Pitch: 0 deg (p) # Roll: 0 deg (p) HFov: 0.242 deg (p) # Polynomial Coefficients: a 0.000000 (p); b 0.000000 (p); c 0.000000 (p) # Horizontal Shift: 1072.000000 (p) Vertical Shift: 803.000000 (p) # Command for Panorama Creation: o f0 r0 p0 y0 v0.242 d1072.000000 e803.000000 # Image No 1: # Yaw: 0 deg (p) Pitch: 0 deg (p) # Roll: -1.32634 deg (*) HFov: 0.243008 deg (*) # Polynomial Coefficients: a 0.000000 (p); b 0.000000 (p); c 0.000000 (p) # Horizontal Shift: 1109.107759 (*) Vertical Shift: -682.927669 (*) # Command for Panorama Creation: o f0 r-1.32634 p0 y0 v0.243008 d1109.107759 e-682.927669 # Image No 2: # Yaw: 0 deg (p) Pitch: 0 deg (p) # Roll: 0.388868 deg (*) HFov: 0.242064 deg (*) # Polynomial Coefficients: a 0.000000 (p); b 0.000000 (p); c 0.000000 (p) # Horizontal Shift: 201.792799 (*) Vertical Shift: 871.734797 (*) # Command for Panorama Creation: o f0 r0.388868 p0 y0 v0.242064 d201.792799 e871.734797 # Image No 3: # Yaw: 0 deg (p) Pitch: 0 deg (p) # Roll: -0.0127069 deg (*) HFov: 0.243374 deg (*) # Polynomial Coefficients: a 0.000000 (p); b 0.000000 (p); c 0.000000 (p) # Horizontal Shift: 217.875614 (*) Vertical Shift: -732.333368 (*) # Command for Panorama Creation: o f0 r-0.0127069 p0 y0 v0.243374 d217.875614 e-732.333368 # Image No 4: # Yaw: 0 deg (p) Pitch: 0 deg (p) # Roll: 1.02377 deg (*) HFov: 0.241724 deg (*) # Polynomial Coefficients: a 0.000000 (p); b 0.000000 (p); c 0.000000 (p) # Horizontal Shift: -698.836764 (*) Vertical Shift: 883.341153 (*) # Command for Panorama Creation: o f0 r1.02377 p0 y0 v0.241724 d-698.836764 e883.341153 # Image No 5: # Yaw: 0 deg (p) Pitch: 0 deg (p) # Roll: -1.81243 deg (*) HFov: 0.243596 deg (*) # Polynomial Coefficients: a 0.000000 (p); b 0.000000 (p); c 0.000000 (p) # Horizontal Shift: -637.964493 (*) Vertical Shift: -796.717337 (*) # Command for Panorama Creation: o f0 r-1.81243 p0 y0 v0.243596 d-637.964493 e-796.717337 # ==================================================================== # Control Points: Distance between desired and fitted Position (in Pixels) # Control Point No 0: 1.10076 # Control Point No 1: 1.1513 # Control Point No 2: 0.969595 # Control Point No 3: 1.16828 # Control Point No 4: 0.690191 # Control Point No 5: 0.899269 # Control Point No 6: 1.02299 # Control Point No 7: 1.19077 # Control Point No 8: 1.22432 # Control Point No 9: 1.28422 # Control Point No 10: 1.11597 # Control Point No 11: 1.26317 # Control Point No 12: 0.883598 # Control Point No 13: 0.346526 # Control Point No 14: 1.03079