Numerical Details on Roundshot and matching CG Stereoscopic Panoramic CreationWritten by Paul BourkeFebruary 2006 The following gives the mathematics needed to calculate various attributes of stereoscopic panoramic images, both synthetic and from the Roundshot camera. It is written with the idea that one is creating CG panoramics to be composited with real photographic stereoscopic panoramic pairs. The numbered steps below are in the order the author used to define the camera and stitching parameters for the CG panoramic generation, there are undoubtedly other ways to approach this. The figures included here are largely intended to illustrate the symbols used within the equations, for example, in figure 1 "W" is the panoramic width in pixels, "H" the height. O_{v} is the vertical field of view in degrees or radians. 1. Determining vertical field of view from Roundshot camera Assumes no vertical lens distortion, eg: pinhole perspective camera. If there is a significant lens effect such that matching to the CG is problematic then I propose correcting the Roundshot panos rather than adding lens distortion to the CG frames.
Figure 1 Vertical field of view (O_{v}) is given by
Maths image (3x3 tiled display, iVEC@UWA. 2. Choosing CG pano strip width
Figure 2 The horizontal field of view 0_{h} of each strip would ideally be continuous, Where this is not possible a finite horizontal width in degrees is chosen. This needs to be an integer divisor of 360 degrees (if a perfect seam is to be achieved at the 0 and 360 wrap around angle). The horizontal field of view matches the rotational increment of the camera for neighbouring strips to align, see figure 3. If the strip width is too wide then close/large objects will have kinks at the boundary between strips. Even if this is not obvious in a still image it may be noticeable in an animation. The strip width is also related to the final panoramic width, wider panoramic images will require narrower strip. 5 degree strips would be an absolute maximum, I suspect smaller will be required. 1 degree seemed to be satisfactory for the test scenes I constructed. Fortunately negative parallax stereo constraints place limits on how close objects may approach the camera, this may kick in before the artifacts due to finite O_{h} arise (?). 3. Calculating CG pano strip width in pixels Given the horizontal field of view in degrees for a strip, the width (w) of the strip in pixels is given by
There are two constraints, O_{h} (in degrees) must be an integer divisor of 360, and w must be an integer if greater than 1 or the inverse must be an integer if less than 1. This means that the possible CG stereo pano widths are limited to certain discrete values, see examples later. 4. Calculating CG pano strip height in pixels Given O_{v} from the Roundshot pano, and the chosen O_{h} and pixel width for the strip then the vertical length of the strip in pixels is given by
This is just the standard relationship between the horizontal and vertical field of view for a perspective projection with a particular aspect ratio. Note that while the Roundshot panoramic image and the CG panoramic image will be different file sizes, the aspect ratio will be identical. 5. Given a stereo pano pair using parallel cameras, calculate the horizontal shift required to achieve a particular zero parallax distance.
Figure 3
The angle O to rotate one of the panos by in order to achieve zero parallax
at a certain distance from the cameras is Where e is the camera separation and f_{o} is the desired zero parallax distance. The shift in pixels D is then
Note that since e / (2 f_{o}) is generally quite small, this can be simplified (sine is nearly linear for small values) in most cases to
Note that this need not necessarily be applied to the images, it could be an option suppled to the playback software. Example 1 1. If the Roundshot panoramic is 8000 pixels wide (W) and 1500 pixels tall (H). O_{v} = 61 degrees. 2. Choose the strip width to be O_{h} to be 5 degrees. 3. Some possible pixels widths (w) for the strip and the corresponding panoramic width (W) are shown below.
4. If 60 pixel wide strip is chosen the panoramic height (H) = 809 pixels. 5. If the camera separation is 9cm (0.09m) and a zero parallax distance of 1m is chosen, then the offset in pixels is D = 62 pixels. Example 2 1. Again let the Roundshot panoramic is 8000 pixels wide (W) and 1500 pixels tall (H). O_{v} = 61 degrees. 2. Choose the strip width to be O_{h} to be 1 degree. 3. Some possible pixels widths (w) for the strip and the corresponding panoramic width (W) are shown below.
4. If 10 pixel wide strip is chosen the panoramic height (H) = 675 pixels. 5. If the camera separation is 9cm (0.09m) and a zero parallax distance of 1m is chosen, then the offset in pixels is D = 52 pixels. Example 3 1. Again let the Roundshot panoramic is 8000 pixels wide (W) and 1500 pixels tall (H). O_{v} = 61 degrees. 2. Choose the strip width to be O_{h} to be 1/2 degree. 3. Some possible pixels widths (w) for the strip and the corresponding panoramic width (W) are shown below.
4. If 10 pixel wide strip is chosen the panoramic height (H) = 1350 pixels. 5. If the camera separation is 9cm (0.09m) and a zero parallax distance of 1m is chosen, then the offset in pixels is D = 103 pixels.
