Golan Levin announces Open-Source Panoramic Video
Interactive designer and technologist Golan Levin announces his series of free code and tools created in openFrameworks and Processing, for unwarping the panoramic videos produced by the popular Sony Bloggie solid-state camera.
The inexpensive Bloggie ($160-190), in many ways similar to the Flip, is a perfectly decent little pocket camera with one exceptionally notable feature: it allows for the creation of 360-degree panoramic digital video, at relatively high resolution, at a consumer price-point. Here’s an example:
Obviously, this “donut vision” (annular) video needs to be transformed into something more useful, such as a long panoramic strip — a process variously called unwarping, dewarping, inverse warping, remapping, reprojection, rectilinearization, or simply distortion correction. Although Sony released unwarping software for Microsoft Windows, they — inexplicably — didn’t release Bloggie unwarping software for Mac OSX. Well, that’s problematic. Perhaps because panoramic imaging is considered a “niche” market, commercial tools for panoramic unwarping can be quite pricey. And although Christophe Maillot has lately released ThreeSixZero, a free OSX tool for viewing Bloggie panoramas, his project is not open-source and doesn’t export converted panoramic video! That’s the motivation for the releases presented here. Fortunately, the mathematics for polar-to-cartesian geometry conversion are relatively straightforward. Behold, a 360-degree panoramic video, remapped to a rectilinear perspective with our BloggieUnwarper software:
Projects and Source Code
Below are links to BloggieUnwarper, my open-source code projects for unwarping the panoramic videos produced by the Sony Bloggie. These projects are created in openFrameworks (a C++ library for creative coding) and Processing (a Java-based programming environment for people who want to create images, animations, and interactions). Both OpenFrameworks and Processing are free, open-source, cross-platform toolkits, optimized for visual computing, which take most of the headache out of creating graphically-oriented software. Both programming environments work across multiple operating systems (Mac, Windows, and Linux), and multiple compilers (e.g., openFrameworks compiles in XCode, Visual Studio, Code::Blocks, and more). If you’re interested in interactive art or computational design, these environments are a great way to start making projects fast.
Here’s a screenshot of the openFrameworks BloggieUnwarper software, showing the original (annular) video at upper left; the reprojected panoramic strip at the bottom; and (in the upper right) a view of the panorama from within a texture-mapped 3D cylinder:
Complete source code can be found here:
* BloggieStillUnwarp.zip (for Processing; 1.3Mb download) — This is a single-page Processing sketch which performs inverse warping on a single panoramic still image stored in the sketch’s data folder. The program supports both nearest-neighbor and bicubic interpolation, and can save out the unwarped panorama to disk. To get started, download the Processing environment here; unzip this project into your “Sketchbook” folder (in “Documents”); open the sketch in the Processing development environment, and press play.
* BloggieVideoUnwarp.zip (for Processing; 20.2Mb download) – This is a single-page Processing sketch which unwarps a Quicktime video stored in the sketch’s data folder, and exports an unwarped version of the video — either as a new Quicktime movie, or as a folder full of still images. Parameters for the unwarping (such as the optic center) are loaded from a settings file. The audio from the original file is (regrettably) not maintained; see my notes below about audio. (Please note that the bulk of this download is a 20Mb demonstration video.)
* BloggieUnwarpOF.zip (for OSX & openFrameworks, 52.7Mb download) — This is a complete openFrameworks project for viewing, projecting, dewarping, and exporting panoramic videos shot with a catadioptric reflector like the Sony Bloggie’s. This project is built for Mac OSX 10.6.3, using XCode, and openFrameworks v.0.061, which is available here; be sure to download the FAT version. The project makes use of the ofxOpenCv and ofxXmlSettings addons which are included in the download. To avoid compilation errors, install the project at the same hierarchical directory level as the various “example” apps which come with the FAT download. There is some additional information about getting OF set up on Snow Leopard here. This project is available two ways:
o as a project on Github or
o download BloggieUnwarp for OSX here (52.7MB) as a zip file.
Visit Flong, Golan’s Blog.