Windows Live Photo Gallery Stitching and HD View 

Window Live Photo Gallery (WLPG) is an application from Microsoft that allows you to easily manage, share and touch-up your photos.  WLPG is a free download.  More information on it is available here: http://get.live.com/photogallery/overview.  The November 2007 release of WLPG has photo stitching capabilities built in.  In any photo stitching application a re-projection of the input images must be done in order for the wide field of view result to be rendered into a single flat image.  One popular re-projection is the equirectangular projection, described in more detail here: http://en.wikipedia.org/wiki/Plate_carrée_projection.

Depending on the source content, WLPG will automatically choose between one of several re-projections: rectilinear, cylindrical, equirectangular, transverse cylindrical and transverse equirectangular.  In addition WLPG automatically determines the up direction for the output.  When viewing these stitched results in an interactive viewer, like HD View, ideally the distortion caused by the projection would automatically be removed by the viewing software.  To this end WLPG adds metadata to the stitched images that records what projection was used and what the up direction is.

In the recent version 2.2 update of the Keyhole Markup Language (KML), the concept of a PhotoOverlay was added.  Several of the PhotoOverlay tags correspond with the metadata stored in the WLPG stitched images.  Using the specification defined here it is possible to translate the metadata to a KML2.2 PhotoOverlay representation, allowing these stitched images to be precisely placed in a KML viewer like Google Earth. 

WLPG 2007 stores the stitcher metadata in two different places.  The first is a custom EXIF tag, the second is in the XMP block.  Note this metadata is only stored when JPEG output is selected. 

Custom EXIF tag

Tag Id: 0x4748

Tag Contents: byte array with 28 bytes of data and the following layout

Property

Layout

Type

Description

Version

bytes: 0-3

unsigned int

The version of this tag, should be 1

Camera Motion

bytes: 4-7

unsigned int

one of the following:

 

2 - uniform scale, translate & rotate

3 - affine

4 - 3D rotation

5 - arbitrary perspective

Projection Surface

bytes: 8-11

unsigned int

one of the following:

0 - rectilinear also known as pure perspective

1 - cylindrical

2 - spherical

257 - transverse cylindrical

258 - transverse spherical

field of view left

bytes: 12-15

float

note: all of the following entries are specified in radians.

angle of the left side of the view volume, should be between 0 and 2*pi (or 0 and pi for transverse)

field of view right

bytes: 16-19

float

angle of the right side of the view volume, should be between 0 and 2*pi and be greater the left

field of view top

bytes: 20-23

float

angle of the top of the view volume, should be between 0 and pi (or 0 and 2*pi for transverse)

filed of view bottom

bytes: 24-27

float

angle of the bottom of the view volume, should be between 0 and pi and be greater than top

 

The "Camera Motion" field above defines how the WLPG stitcher decided that the source images were taken.  The field of view tags will only be valid if the motion was 3D rotation.  Otherwise the projection surface will always be listed as '0' and field of view should be ignored.   

Translation of EXIF tag to KML and HD View XML

EXIF Property

KML2.2

HD View XML

Projection Surface

<surface>

0 - rectangle

1 - cylinder

2 - sphere

257 - not in KML

258 - not in KML

<projection>

 

0 - perspective

1 - cylindrical

2 - spherical

257 - cylindricalTransverse

258 - sphericalTransverse

field of view left

<ViewVolume><leftFov>

note that a conversion from radians to degrees is necessary and that leftFov/rightFov are between -180 and 180 instead of 0 - 2*pi

<thetaMin>

note that a conversion from radians to degrees is necessary

field of view right

<ViewVolume><rightFov>

<thetaMax>

field of view top

<ViewVolume><topFov>

note that a conversion from radians to degrees is necessary and that topFov/bottomFov are between -90 and 90 instead of 0 - pi

<phiMin>

note that a conversion from radians to degrees is necessary

filed of view bottom

<ViewVolume><bottomFov>

<phiMax>