Partial Panoramas and Flat Images

PTViewers rendering algorithm is designed for 360° x 180° degree full spherical panoramas. Limiting the vertical field of view to values below 180° is straightforward: Reducing the height of the panoramic image to aspect ratios below 1:2 automatically adjusts the vertical tilt range. Alternatively, tilt limits can be set via parameters tiltmin and tiltmax.

Reducing the horizontal pan-range is only possible using the corresponding parameter tags panmin and panmax. Therefore, a partial panorama with pan-range smaller than 360° has to be extended to 360° by adding some kind of frame. This procedure was described in earlier versions of this document. With the new ROI and Zoom features available since version 1.8.2, there are simpler methods which are described below.

Partial Panoramas with Large Field of View (>100°)

In this case it is best to supply the partial panorama as region-of-interest image (ROI) into an empty background. The pixel-size (pwidth) of the background has to be calculated from the width of the partial panorama  and its field-of-view fov:

pwidth = width * 360 / fov

The height parameter (pheight) has to be set to the height of the ROI-image. The ROI-image has to be supplied in equirectangular projection.

This is a step-by-step explanation for an example, which uses an image in typical swing-lens format as created by cameras like the Noblex 135: negative format is 66mm x 24mm, field of view 135°, and it delivers cylindrical panoramic projection (old QTVR format). The original image might look like the following example:

This image has to be remapped to equirectangular projection. Use the Remap-Option of the Panorama Tools plug-in for the conversion with the following settings:
From: QTVR-Panorama
To: PSphere
HFOV: 135
VFOF: 0 (set internally)
The final image is slightly narrower, so you have to set the preferences of PanoTools to option (b) and (c). The result image is almost identical:

It has dimensions 660 x 226 pixels. The pwidth parameter tag is calculated as shown above and yields 1760, the height pheight is taken from the image 226. Then we have to calculate the point where to insert the partial panorama into the 360° background.  The y-coordinate is just 0, and the x-coordinate is calculated using the formula

x = (pwidth/2) - (Imagewidth/2) = 1760/2 - 660/2 = 550

This is the final HTML-code for displaying the partial panorama:

<applet name="ptviewer" archive=ptviewer.jar  code=ptviewer.class width=320 height=200>
<param name=pwidth    value=1760 >
<param name=pheight   value=226 >
<param name=roi0      value="i'partial_equ.jpg' x550 y0" >
<param name=panmin    value=-67 >
<param name=panmax    value=67 >
Click here to view this example.

This method internally uses a 360° background panorama with 1760 pixels width. For high resolution images with narrow field of view, this background becomes very large and PTViewer might fail due to memory shortage. As an example, if the partial panorama has 60° field of view, and is 2000 pixels wide, the background panorama has 12000pixels width, which is more than most computers can handle. In this case, the PTZoom extension is more suitable, see below.

Partial Panoramas with Small Field of View (<100°)

The PTZoom extension displays any rectilinear image in front of a background panorama, which is completely independent in size. If no background panorama is specified (no file, pwidth and pheight parameters), then PTZoom can be used as viewer for rectilinear images. Since this format is very inefficient for large field of views, this is most useful for angles smaller than 100°. The image has to be provided in rectilinear projection which is  what any standard lens delivers.

<applet name="ptviewer" archive=ptviewer.jar  code=ptviewer.class width=320 height=200>
<param name=applet0  value="{code= ptzoom.class} 
<param name=inits    value="ptviewer:startApplet(0)">
<param name=panmin   value=-28 >
<param name=panmax   value= 28 >
<param name=tiltmin  value=-18 >
<param name=tiltmax  value= 18 >
This code also uses the progress tag to load the partial panorama displaying the standard PTViewer download feedback (progress message or progress bar). To view this example, click here.

Flat Images

Flat images like maps are similar to rectilinear images with small field of view. Mathematically, they are obtained by letting the fov-parameter go to zero, practically any small value (~5°) works. The following example shows how to display a flat image by faking small field of view values.

The example image was scanned from a 24mmx36mm negative, and I simply chose the image lengths in cm. Pan and tiltlimits are then set to half of these values. Don't forget to adjust the minimum field of view which otherwise defaults to 10°.

<applet name="ptviewer" archive=ptviewer.jar  code=ptviewer.class width=320 height=200>
<param name=applet0  value="{code= ptzoom.class} 
<param name=inits    value="ptviewer:startApplet(0)">
<param name=fovmin   value= 0.1 >
<param name=panmin   value=-1.2 >
<param name=panmax   value= 1.2 >
<param name=tiltmin  value=-1.8 >
<param name=tiltmax  value= 1.8 >
This example can  be viewed here.

The previous PTFlat extension is not supported any more, since using PTZoom has several advantages: Hotspots can be used (at least the simple quadratic types), and the pan limits work correctly.

Copyright © 2001 Helmut Dersch