Jump to: navigation, search

Panorama is a panorama auto-stitching Activity with an upload to Flickr button. The vision is to allow children around the world to share their surroundings with each other.

This Activity will freeze and maybe also freeze Sugar after saving or uploading a panorama. You may not want to use it until this is fixed.

Features and Description

Panorama Stitching

The current process for stiching a panorama involves rotating the top half of the XO, and pressing the spacebar to capture each image. The previous image taken is displayed on screen at an offset to give a suggested alignment to the user. A preview of the panorama is shown at the bottom of the screen.

Panorama Upload

The activity currently has an upload to Flickr button. The images show up instantly on a Flickr account.


Created by Donald Cober and Nirav Patel in 24 hours during Yahoo's University Hack Day at CMU, where it won the Hack for Good award. The activity is based on an earlier work by Ben Schwartz.


There is a project hosting application out for it, so the source will be available in a repository soon. Until then, feel free to hack at the .xo posted. Any and all help is appreciated.

Todo and Known Bugs

Improve image quality

The activity currently captures as RGB444 and stores the images as 16 bit SDL Surfaces, largely for performance reasons. However, image quality is far more important than speed of the live preview for our purposes. It may be useful to move to YUYV capture and storing as 24 bit Surfaces. This has the side benefit of being able to use pygame.surfarray.pixels3d instead of pygame.surfarray.array3d for much less RAM usage during stitching.

Improve stitching accuracy

Since it was a 24 hour hack, the stitching algorithm wasn't given much thought. It currently moves a 100px wide slice of the right image one pixel at a time across the left image, going from 100 pixels in to half way through the image. At each step, it subtracts one 100px of array from the other 100 px of array, squares that resulting array, and stores the sum of that. When it is done moving through the image, it finds the lowest sum and assumes that is the best stitch. This is commenly called a Sum of Squared Differences, or SSD. It may be better to look at more than a 100 px slice, or at least not the 100px closest to the edge, since the edge tends to be darker.

Shorten stitching time

It currently takes a few seconds per image in the panorama. The wait time isn't painfully long, and the progress is shown to keep the user entertained, but quicker would be better. Pyramidizing the stitch may be useful to shorten the time.

Fix FATAL PyGTK/OLPCGames interaction

The Activity currently has a bug that causes it to freeze after the user hits ok on the Save or Upload dialog box. The save or upload is performed successfully, but the dialog box does not close, and prevents the user from accessing the Activity or quitting it. It may be necessary to drop the PyGTK box entirely and hack together a text input function for Pygame.

Secure Image Uploading

The activity currently uploads all panoramas to a personal Flickr account. This is less than ideal for obvious reasons. Brian Jordan has suggested a setup in which an intermediary server is uploaded to, which then uploads to Flickr. This would keep authentication tokens for Flickr hidden.


Here is an example exhibiting basically all of the current flaws in the activity. It was taken during the demo of the activity to the Hack Day judges. Notice that there is severe color noise, hugely visible borders from auto exposure, and a completely wrong stitch. These are all points that are being focused on for the first real release.

Test stitch.jpg

This is the current user interface of the activity. The large image on the top right is the current live stream from the webcam. The half picture to the left of it is the previous picture taken, to give the user an idea of how to align the next shot. The small panorama below them is a preview of what the final product might look it using a fixed offset between pictures. It is updated as the user takes pictures. The bottom panorama is the stitched result after the user is done taking pictures and clicks on the Stitch button.


Related Links

Car Games

lcd tv


Activity Summary

Icon: Sugar icon::Image:Activity-panorama.svg
Genre: Activity genre::Drawing, Media Creation
Activity group: ,|x|Activity group::x}}
Short description: Short description::An auto-stitching panorama activity that uploads to Flickr.
Maintainers: ,|x|Contact person::x}}
Repository URL:
Available languages: ,|x|Available languages::x}}
Available languages (codes): ,|x|Language code::x}}
Pootle URL:
Related projects: Related projects,|x|Related projects::x}}
Contributors: ,|x|Team member::x}}
URL from which to download the latest .xo bundle Activity bundle::
Last tested version number: Activity version::1
The releases with which this version of the activity has been tested. ,|x|Software release::x}}
Development status: Devel status::2. Pre-Alpha
Ready for testing (development has progressed to the point where testers should try it out): ,|x|Ready for testing::x}}
smoke tested :
test plan available :
test plan executed :
developer response to testing :