I was just trying out the new panorama feature built in to iOS6 (available on the iPhone 4S and 5). The resulting panoramas look great, but one thing that I miss compared with Photosynth is the ability to view the result as a true “surround” experience. I was curious if I could work out the geometry of the iOS panoramas so that they could be uploaded to http://photosynth.net, and then be available to view anywhere–on the web or in the Photosynth App.
The quick answer is yes. You need to get the Photosynth Export Plug-in for Photoshop. When you run the plug-in, select “Cylindrical (Horizontal)” from the “Projection” menu, and determine the “Field of View” of your panorama by taking the width of the image and dividing it by the magic number 53.5.
Here are two panoramas that I uploaded using this technique: Seattle 12th Street Bridge and Seattle Yesler Bridge. If any readers try this out, please send us a link to the result via the comments or on Twitter.
That’s it. But, if you want to know where 53.5 comes from, continue reading.
The figure below shows the iPhone sweeping out a panorama. I’m assuming that iOS reads the pixels from the camera and “projects” them onto a cylinder in order to form the panorama. The cylinder is represented as the blue path in the figure. The length of this path is equivalent to the width in pixels of the panorama that was captured.
What the plug-in needs is the field of view (FOV) in degrees. From geometry we know that
width = FOV * radius
What is the radius in this case? It is simply the focal length of the camera. Searching the web, we find that the 4S has a focal length of 4.28mm. Now we have a problem of units; we know the focal length in millimeters and the width in pixels. To convert between these units we can find out that the 4S sensor size is 3.42mm wide or 2448 pixels wide. Now we have our conversion; the radius in pixels is
radius = (2448/3.42) *4.28 = 3064 pixels
FOV = (width / 3064) * (180/p) = width/53.5
I haven’t yet found the sensor size and focal length of the iPhone 5, so 53.5 may not be the right number for that phone. Post a comment if you know. I also think that a very similar calculation could be done for the Sony cameras with the sweep panorama feature.