For this reason PTools can find the missing parameters and uses a concept that many other stitching programs use: corresponding features (or controlpoints). From the overlapping area of two images the user places corresponding controlpoints on the locations of distinctive features in both images showing the same 'object'. PTools requires to be given the coordinates of these locations in its own variety of script.
E.g. a line c n0 N1 x374 y554 X58 Y560 in a Ptools stitcher script means that a control point with coordinates (374,554) in image number 0 has coordinates (58,560) in image number 1. Given this information PTools can derive pitch/roll/yaw and even the degree of barrel/pincussion distortion in the lens. You just need to ask PTools using a v-line - this is a script line where you tell PTools what unknown variables - yaw, fov etc you want it to solve for.
You give the program the control point information in c-lines There are currently three ways to generate a c-line:
This is how to get PTools to scan your images for contol points: Create a text file with a text editor but leave it blank. Save it in your working directory as control.txt. Open the first image which has been marked with the control point markers (it has to be an single layer image - flattened), then select Filter - Panorama Tools - Adjust. In the Create Panorama dialogue select Read Control Points and Use Script. Press Browse and select the file control.txt in your working directory. Back in Create Panorama Press Ok. Within a second PTools has scanned the image for control point locations and added the following lines to your control.txt:
c n0 N-1 x374 y554 X0 Y0 c n0 N-1 x363 y483 X0 Y0 c n0 N-1 x363 y334 X0 Y0 c n0 N-1 x372 y230 X0 Y0 c n0 N-1 x369 y113 X0 Y0But leave control.txt closed and open the second image. Again select Filter - Panorama Tools - Adjust. Since PTools remebered the previous settings just click Ok. control.txt now looks like this:
c n0 N1 x374 y554 X58 Y560 c n0 N1 x363 y483 X44 Y488 c n0 N1 x363 y334 X43 Y335 c n0 N1 x372 y230 X54 Y230 c n0 N1 x369 y113 X54 Y109Now you are done with reading the control point locations. Now you will run the Optimizer to find out e.g. the pitch, roll and yaw. Add the following lines to control.txt.
p w600 h300 v60 i w480 h640 f0 v42 r0 p0 y0 i w480 h640 f0 v42 r0 p0 y30The lines beginning with i means you want to tell PTools some information about your pictures, which you more or less know. Image width/heigth is 480/640 (w480 h640). The source images are rectilinear (f0). The HFOV is 42 degrees (v42). The roll/pitch/yaw is 0/0/0 in the first and 0/0/30 degrees as far as you know. Adapt the lines to your image properties.
Because you want to know about the roll/pitch/yaw that happened to your camera before taking the second image (which is image number 1 for PTools) you add the line
v r1 y1 p1Now save control.txt and close it, then select Filter - Panorama Tools - Adjust. In the dialogue Create Panorama select Run Optimizer and Use Script. Press Browse and select the file control.txt in your working directory. Back in dialog Create Panorama click Ok. Among other lines PTools adds the following to your text file:
# (*) - optimized (p) - preset # Image No 0: # Yaw: 0 deg (p) Pitch: 0 deg (p) # Roll: 0 deg (p) HFov: 42 deg (p) o f0 r0 p0 y0 v42 -buf # Image No 1: # Yaw: 28.0078 deg (*) Pitch: 0.114398 deg (*) # Roll: 0.841227 deg (*) HFov: 42 deg (p) o f0 r0.841227 p0.114398 y28.0078 v42 +bufThis would be the information you need to know to fill in the fields for the parameters in the dialog Create Panorama Options. You might repeat the process of placing control points, let them be scanned by PTools, ask for parameters and then fill in the dialog Create Panorama Options. Quite roundabout you might say. But there is a better way.
p v360 f2 w600 o f0 r0.873 p0.174 y0.735 v90 -buf o f0 r0.564 p0.623 y90.992 v90 +buf -buf o f0 r0.651 p0.524 y180.194 v90 +buf -buf o f0 r0.663 p0.552 y270.362 v90 +buf -buf o f0 r-89.02 p90.91 y0.112 v90 +buf -buf o f0 r90.154 p-90.38 y0.834 v90 +bufThe first line means a 600 pixels wide spherical panoramic image is desired. Save the text file as script.txt and close your text editor. So after you have created a script you can stitch your panorama thus: After you have created a script, there are currently two ways to stitch your source images to one single panoramic image:
Note that QuickTime 3 or higher has to be installed on your computer. The image width should be divisible by 24, so scale it carefully before sharpening your image. Then the panoramic image must be rotated 90 degrees counterclockwise from its normal orientation, so that the image is taller than it is wide. Start VRMakePano and select Test - Make Pano Movie. When the Open dialog appears select your panoramic image and click OK - an open dialog appears again, where you can select a mask for hot spots, but click Cancel this time. A Save as dialog appears twice, where you enter the name of the tile file (this is just a temporary file which is deleted afterwards) and your final QTVR movie file. As far as I know VRMakePano can only create full 360 degree QTVR movies. If the HFOV of your pano is less than 360 this will look somewhat strange since the pano is wrapped around anyway. But QTVR supports panos with any HFOV (less or equal to 360). Let me know if you know a solution for this problem.
How do I get my Live Picture ZoomIt file?
The Live Picture ZoomIt technologie displays cylindrical and even spherical panos. It is more easy to handle since you do not need to convert your panoramic image. Your image is simply embeded in an ivr-file looking something like this:
#VRML V2.0 utf8
orientation 0 1 0 0
vFov -1.6 1.6
pitchRange -1.6 1.6
If you have an cylindrical pano set the type to "CYLINDER". You then need to reduce the vFov and pitchRange to +/- .5 or less.
ivr-files can be viewed with Live Pictures free ZoomIt viewer, which can be downloaded at the Live Picture website. Since it is Java based it is platform independend. You can embed ivr-panos using the applet- and param tag. A native code plug-in Version is available for Macintosh and Windows.
As mentioned before the PTStitcher can create the ivr-file for you. Basically you just need to modify the p-line correspondingly. Consult the PTStitcher documentation.
|<< Introduction||Comments welcome: Sascha Kerschhofer||Reference >>|