Panorama
Transformation 1.0

Designed and developed by

Liang Wan, Tien-Tsin Wong, Chi-Sing Leung,
Chi-Wing Fu, and Tze-Yiu Ho

Introduction

Cubemap is a de facto standard for representing the 360-degree surrounding environment (a spherical function) in many graphics applications. However, it does not evenly sample the environment. Different texels may span different solid angles, in other words, different importances or weights. We  explore novel parameterizations of sphere that can sample the environment more evenly. During the past few years, we have investigated and developed four spherical maps with equal or near-equal solid angle property. The source code here demonstrates the implementation of isocube, unicube, rhombic dodecahedron and healpix spheircal maps. Meanwhile, we provide a prototype software  that converts the environment map among four spherical maps and other popular sphere maps, including cubemap, longitude-latitude map, mirror-ball, mirror-ball closeup, and light probe. If you are interested, you can download the code below. The code is completely free of charge (both commercial and academic). Please refer to the file LICENSE.TXT for copyright issues.

Instructions for Usage

  • Method 1: Use the mapping functions

    Each spherical map is provided with two functions. Suppose a pixel in a given spherical map is represented by the local coordinates (facenum, ix, iy). The function "xxx_pix2ang" maps the pixel from local coodinates of the 2D spherical map to spherical coordinates (theta, phi). The other function "xxx_ang2pix" maps one pixel from spherical coordinates to local coordinates of the 2D spherical map. The followings shows the two functions for "rhombic dodecahedron map":

    void rd_pix2ang(long nside, int facenum, double ix, double iy, double *theta, double *phi);

    void rd_ang2pix(long nside, double theta, double phi, int *facenum, double *ix, double *iy);
     

  • Method 2: Use the executable
    To compile the source code, you need Visual Studio .NET 2003. The usage of the executable is as follows:
Usage:  
  panotransform.exe /it [ppm/pfm/tga]
                    /if [c/cv/u/uv/i/iv/h/rd/p/b/m/r]
                    /ot [ppm/pfm/tga]
                    /of [c/cv/u/uv/i/iv/h/rd/p]
                    /s size OR /w width /h height
                    /i image1 [/x xrot1 /y yrot1 /z zrot1 /a weight1]
                    /i image2 [/x xrot2 /y yrot2 /z zrot2 /a weight2]
                    ...
Parameters:
  #I/O options:
    /it : input file format  [ppm/pfm/tga]
    /ot : output file format [ppm/pfm/tga]
    /if : input panorama map
    /of : output panorama map
  #
panorama maps
    c   : six-separate-face cubemap
    cv  : vertical cross cubemap
    u   : six-separate-face unicube map
    uv  : vertical cross unicube map
    i   : six-separate-face isocube map
    iv  : vertical cross isocube map
    h   : fish-view healpix map
    rd  : fish-view rhomibic dodecahedron map
    p   : longitude-latitude map
    b   : mirror ball
    m   : mirror ball close-up
    r   : light probe
  #resolution setting of target image
    /s sets face resolution, used with c/cv/u/uv/i/iv/h
    /w and /h set width and height, used with p
  #rotation settings (optional)
    /x xrot  rotates the source panorama around x axis by xrot degrees.
    /y yrot  rotates the source panorama around y axis by yrot degrees.
    /z zrot  rotates the source panorama around z axis by zrot degrees.
    There is a pre-defined ordering of applying rotations, z -> y -> x

  #multiple source images (optional)
    /i sets one source image
    /a weight  is the weighting factor to blend multiple source images.

If the input map is MirrorBall, Mirror-Ball-Closeup, or LightProbe, we need to specify rotation settings /x 180 + /z 90.
  • References:
    T
    his software is based on the algorithms published in multiple papers.
  1. If you use the healpix spherical mapping, please reference to the following papers:

    [1] Liang Wan, Tien-Tsin Wong, and Chi-Sing Leung, Spherical Q2tree for Sampling Dynamic Environment Sequences, in Proc. of Eurographics Symposium on Rendering 2005 (EGSR'05), Konstanz, Germany, June 2005, pp. 21-30.
    [2] K.M. Górski, E. Hivon, A.J. Banday, B.D. Wandelt, F.K. Hansen, M. Reinecke, and M. Bartelmann, HEALPix: A Framework for High-resolution Discretization and Fast Analysis of Data Distributed on the Sphere, Ap. J., 622, 759-771, 2005.

    The HEALPix mapping was proposed in [2]. It was first introduced to the graphics community in  [1]. The file healpix.c included here is a slight modification of the files, ang2pix_nest.c and pix2ang_nest.c in the package HEALPix_1.22, available from http://omega.jpl.nasa.gov/healpixSoftwareGetHealpix.shtml.

     

  2. If you use the isocube spherical mapping, please reference to the following paper:

    [3] Liang Wan, Tien-Tsin Wong, and Chi-Sing Leung, Isocube: Exploiting the Cubemap Hardware, IEEE Transactions on Visualization and Computer Graphics, Vol. 13, No. 4, pp. 720-731, 2007.
     

  3. If you use the rhombic dodecahedron mapping, please reference to the following paper:

    [4] Chi-Wing Fu, Liang Wan, Tien-Tsin Wong, and Chi-Sing Leung, The Rhombic Dodecahedron Map: An Efficient Scheme for Encoding Panoramic Video, IEEE Transactions on Multimedia, Vol. 11, No. 4, pp. 634-644, June 2009.
     

  4. If you use the unicube spherical mapping, please reference to the following paper:

    [5] Tze-Yiu Ho, Liang Wan, Ping-Man Lam, Chi-Sing Leung, and Tien-Tsin Wong, Unicube for Dynamic Environment Mapping, IEEE Transactions on Visualization and Computer Graphics, to appear.

 

Examples

Input: vertical cross cubemap

Output: six-separate-face cubemap

"cubemap_cross.ppm"

panotransform /it ppm /if cv /ot ppm /of c /s 160 /i cubemap


    xp           zp            xn      

zn           yp            yn

     

Output: vertical cross unicube map

Output: six-separate-face unicube map

panotransform /it ppm /if cv /ot ppm /of uv /s 160 /i cubemap panotransform /it ppm /if cv /ot ppm /of u /s 160 /i cubemap


xp           zp            xn

zn           yp            yn

     

Output: vertical cross isocube map

Output: six-separate-face isocube map

panotransform /it ppm /if cv /ot ppm /of iv /s 160 /i cubemap panotransform /it ppm /if cv /ot ppm /of i /s 160 /i cubemap

xp           zp            xn 

zn           yp            yn
     

Output: fish-view healpix map

Output: fish-view RD-map

panotransform /it ppm /if cv /ot ppm /of h /s 114 /i cubemap panotransform /it /ppm /if cv /ot ppm /of rd /s 114 /i cubemap

     

Input: mirror ball

Output: longitude-latitude map

"example_ball.ppm"

panotransform /it ppm /if b /ot ppm /of p /w 554 /h 277 /i example_ball /x 180 /z 90

     

Input: mirror ball close-up

Output: longitude-latitude map

"example_ball_closeup.ppm"

panotransform /it ppm /if m /ot ppm /of p /w 554 /h 277 /i example_ball_closeup /x 180 /z 90

     

Input: light probe

Output: longitude-latitude map

"example_probe.ppm"

panotransform /it ppm /if r /ot ppm /of p /w 554 /h 277 /i example_probe /x 180 /z 90

 

 

Contact Person:

Tien-Tsin Wong (ttwong@cse.cuhk.edu.hk)

The Chinese University of Hong Kong