17
2006
Panorama notes: Zoom control
I'm learning how to create QTVR panoramas using PTMac. I'll be posting my notes here as I figure things out in case anyone else ends up with the same questions as me.
Today's lesson: controlling the zoom feature.

If we use the default settings (Figure 1, right), we can zoom *way* in on our panorama until the viewing area is filled with unrecognizable giant blocks of color. Ideally (in my opinion), users should be able to zoom in until they see the actual-size image: one pixel in the QTVR equals one pixel in the source, or raw, image. A comparison is shown in Figure 2, below.
The left image is a partial screen grab of what it looks like when we zoom in all the way using the default setting. In the middle is a partial screen grab of the source image viewed at 100% in Photoshop. On the right is a partial screen grab of what it looks like when we zoom in all the way on the QTVR using adjusted settings. (Note: the image is crappy to begin with because the photos were accidentally taken out of focus.)

To control how much we can zoom in and out, we adjust the minimum and maximum FOV (field of view), which is given in angular degrees (360 degrees in a full circle). For now we're only worried about the minimum FOV. Decreasing the FOV is effectively zooming in. Think of your digital camera. When your camera is zoomed all the way out, you can see more of the scene: Your field of view is greater. When you zoom in, you decrease your field of you by narrowing in on the subject you're photographing.
First, we have to figure out how large our flattened source image is. In this case, my image is 3,200 pixels wide.
If we divide that by 360, that will tell us the angular resolution in pixels per degree. 3200 / 360 = 8.888.
Next we need to know the pixel width of the shortest side of our viewing window. In our case, the viewing window is 500 pixels wide and 300 pixels tall, so we'll use 300.
Divide 300 by 8.888 to get the desired minumum FOV: ~33 degrees in our example. Now we can only zoom in until we are viewing the image at actual size (Figure 2c).

I read the first three paragraphs and realized I am stupid.
Posted by Kyle on February 26, 2006