You are on page 1of 7

The Research on Cylindrical Panoramic Projection

and Real-Time Rotation Using GPU

Xiaoni Liu, Yinan Lu, Ying Ding, and Jingtao Fan*

Abstract. Cylindrical projection is one of the most common projection methods


used in photographic virtual reality. In this paper, we study and realize cylindrical
panoramic projection and real-time rotation using GPU (Graphics Processing
Unit), which adopts CUDA technology. These algorithms mainly include
cylindrical projection based on the horizontal plane image, the image real-time
rotation, the tangent plane projection and pixel interpolation using GPU.
Experiment results show that the high quality and faster computing speed of real-
time processing are obtained.

Keywords: Computer Applications, virtual reality, panorama, cylindrical


projection, GPU.

1 Introduction
Large-scale virtual simulation technology is widely used in radio and television
studio, technology exposition show, industrial process control and simulation
command exercises of public transportation system. With the progress of modern
graphics hardware acceleration technology, the high-speed development of GPU
has improved the speed and quality of computer graphics processing and
promoted the rapid development of the applications field, which is related to of
computer graphics. In particular, the Nvidia company launched CUDA (Compute

Xiaoni Liu Yinan Lu


College of Computer Science and Technology
Jilin University
e-mail: liuxiaoni179@gmail.com
Xiaoni Liu
Jilin branch of China Unicom
Ying Ding Jingtao Fan
College of Computer Science and Technology
Changchun University of Science and Technology
Changchun, China

Z. Qian et al. (Eds.): Recent Advances in CSIE 2011, LNEE 126, pp. 105111.
springerlink.com Springer-Verlag Berlin Heidelberg 2012
106 X. Liu et al.

Unified Device Architecture) technology in 2007, achieving the C language


compiler development environment of GPU for the first time[1]. GPU computing
with CUDA technology, through hundreds of chip processor cores simultaneously
communicate and cooperate, for more than 100 times the speed of traditional
methods to solve complex computing problems. CUDA hasnt to map to the
graphics API, it can make management and parallel data computation GPU,
breaking the limitations of dealing with the data on the GPU in the traditional
way, this make GPU core can be shared data simultaneously. Show in Fig1.

Fig. 1 Parallel execution through cache in CUDA

The paper is structured as follows. In Section II and III, the related principle
and the implementation are presented respectively. Section IV shows the
experimental results. The conclusion is drawn at the end of the paper.

2 The Related Principle


Shown in Fig2, cylindrical projection based on panorama and real-time rotation
technology process is divided into three parts:
Get image. At the same point of view O , the generation of cylindrical
projection image is to use four right angles to each others digital cameras to
take digital photos of four horizontal plane panoramas, based on the size of
initial field of view (units of angle and the value is not zero), making the use of
projection equation (1) do cylindrical projection[2].
Cylindrical panoramic projection and real-time rotation. At first,
initializing the size of field of view and according to cylindrical projection
algorithm based on horizontal plane images to transfer the four horizontal plane
images to cylindrical projection, moreover, making the use of image mosaic[3]
for four cylindrical projection images to do a mosaic, so as to format a panorama
of cylindrical image. Second, accordingly the input panoramic images direction
of rotation, the angle of rotation (units of angle value) and the image real-time
rotation algorithm based on image capture to achieve the effect of the real-time
rotation of panoramic image. At last, using image split method put the whole
cylindrical panorama into four equal parts, whats more, getting four horizontal
plane projection images based on the algorithm of the tangent plane projection.
This part needs an operation of continuous space to achieve with CPU.
The Research on Cylindrical Panoramic Projection 107

Get image

Cylindrical projection
based on the horizontal plane

Method of image mosaic

Image real-time rotation


based on image capture

Method of image separation

The tangent plane projection

Pixel interpolation
Output image

Fig. 2 Process of this algorithm

Pixel interpolation. Because after the space transformation, the coordinate


of a point may fall to non-integer one, so, in each horizontal plane region
respectively, using Trilinear Interpolation to find the point color value based on
the offset of cylindrical integer coordinate points corresponding to the horizontal
plane actual center, so as to output an ideal image. Considering the
characteristics of GPU and CPU, this part needs the operation of image vertex,
for example, the image space transformation, to achieve with GPU[4-6]which has
a parallel processing capability.

3 Realization of Algorithm

3.1 Algorithm of Cylindrical Projection Based on Horizontal


Plane Image
Fig3(a) means the projection relationship between horizontal plane ABCD and
cylindrical image ABC D . Fig3(b) is a local enlarged figure of Fig3(a); the
point P is the projection point of P in the cylindrical surface. The point O is the
view point where the place of digital cameras.
108 X. Liu et al.

(a) projection relationship (b) local enlarged figure

Fig. 3 The projection relationship between cylindrical image and horizontal plane image

Let the size of initial field of view is , the radius r of cylindrical surface can
be obtained, the relationship between coordinate ( x, y ) on the cylinder and
coordinate ( x, y ) on the horizontal plane is shown as equation (1), it collectively
known as the projection formula.
x
= arctg r
(1)
x = r
y = y cos

3.2 Image Real-Time Rotation Algorithm Based on Image


Capture
The algorithm described is the case of rotation based on the cylinder vertical
axis[7]. In general, the rotation of cylindrical panoramic images can be divided
into left rotation and right rotation, the rotation angle is any angle value of zero to
360 degree, here, selecting the image which rotates to the left and the rotation
angle is , to show the principle of the image real-time rotation algorithm based
on image capture.
Fig4(a) is the relationship between cylindrical panoramic image and cylindrical
projection image before rotates to left. In the projection mosaic horizontal plane
image, the projection N M of the cylindrical surface is N M , with the rotation
of cylindrical panoramic image to the left at angle, fig4(b) shows the situation
after the image rotation, the projection N M of the cylindrical surface deflects a
certain arc length l , which can be calculated by equation (2), meanwhile,
N M pans right arc at the same distance, that is, capturing a rectangle of this
arc length from left of the projection mosaic horizontal plane image splices to the
right of the image, the Shaded rectangle shown in Fig4. Namely, the achievement
effects of cylindrical panoramic image to the left.
(2)
N P = l = 2 r
360
The Research on Cylindrical Panoramic Projection 109

(a)before (b)after

Fig. 4 The cylindrical image rotates to left

3.3 Algorithm of Pixel Interpolation


In the image projection, after a space coordinate transformation, the place of pixel
coordinates may not be an integer one, so it needs to use the gray interpolation
method to estimate the pixel value. Interpolation method affects the smoothness of
images, the optimization of search space and the time of overall computation. In
the processing of image pixel interpolation, as it needs do a real-time processing
for continuously collected images, that is, it means to repeat coordinate
transformation and grayscale image interpolation at hundreds or even thousands of
times. Therefore, it hope interpolation calculation is simple and fast, however,
usually at the expense of accuracy to some extent, so when choosing interpolation
method, it requires to do a trade-off between computational complexity and image
smoothness. Common used interpolation methods are Nearest Neighbor (NN) and
Bilinear Interpolation method (BLI), etc. These methods are usually able to meet
the speed requirements; however, they have shortages of the nature of low-pass
filter, the loss of high frequency components and the fuzziness of image contour.
To get a more accurate interpolation results, this algorithm adopt Trilinear
Interpolation method[8] (TRI), it not only considers the effect of the four
neighborhoods of the point, but also needs to consider the effect of the gray value
of sixteen indirect neighborhoods of this point. But this method has a large
calculation, so it is seldom used. This paper uses GPU which has an advantage of
a large number of calculations to realize this algorithm, accomplished both high
speed and accurate results.
For the value of sample, using the interpolation function
S ( x ) = sin( x ) x to interpolate, can accurately restore the original function
and get the value of any point among the sampling ones, the cubic polynomial
approximation[8] of this function is:

2 3
1 2 x + x , ( 0 x < 1)
2 3
S ( x ) = 4 * 8 x + 5 x x , (0 x < 2) (3)
0, ( x 2)

110 X. Liu et al.

4 Simulation Results and Analysis


In order to verify the feasibility and efficiency of this algorithm, using NVIDIA
CUDA1.1 on the ordinary single-chip microcomputer to realize the algorithm of
curved panoramic projection and real-time rotation using GPU. Experiments using
Intel (R) Xeon (R) CPU with a strong CPU features and caliper of NVIDIA
Quadro FX 570, compared with the computational speed of Trilinear Interpolation
method between running on CPU and GPU.
In 1920 * 1080 pixel images, there is a small amount of error at every
execution time of programs, so it gets the average of times which operating ten
times, keeping three decimal places after the decimal point. The time of running
Trilinear Interpolation method of this algorithm is about 0.284ms, however,
running traditional algorithm is about 5076.196ms, greatly increased the
computational speed.

Fig. 5 The simulation results of cylindrical projection

Fig. 6 The simulation results of rotating the image 60 degrees to the left based on the image
capture

The experimental results show that this algorithm can compute the large
amount of data concurrently, and the effect is obvious. Since the growth of
computing speed, the problem of complexity that contains lots of data and the
computational process has been solved, this also makes parts of the classical
algorithm (such as trilinear interpolation method) a broader range of applications.

5 Conclusion
Cylindrical panoramic projection and real-time rotation using GPU are
implemented. Trilinear interpolation method is used to deal with pixel
interpolation problem. The experimental results show that the computing speed
using GPU can be significantly increased, and it is also a good foundation for the
The Research on Cylindrical Panoramic Projection 111

integrated technology and application of the following large-scale orthogonal


multi-screen special films project.

Acknowledgment. This article by the funding of Technology Development Plan key


Projects of Jilin Province (20075010) and National Science and Technology Support Plan
Key Project (2009BAE69B00).The Corresponding author is Yinan Lu.

References
1. NVIDIA CUDA (EB/OL), September 23 (2008),
http://developer.nvidia.com/object/cuda.html
2. Feng, J.-B., Su, Z.-X., Liu, X.-P.: A Similar-Curve Based Automatic Mosaic Algorithm
of Panoramic Image. Chinese Journal of Computers 26(11), 16041608 (2003) (in
Chinese)
3. Shum, H.Y., Szeliski, R.: Construction of panoramic image mosaics with global and
local alignment. International Journal of Computer Vision, 101130 (2000)
4. Owens, J.: Streaming architectures and technology trends. In: International Conference
on Computer Graphics and Interactive Techniques, New York (2005)
5. Nickolls, J., Buck, I.: NVIDIA CUDA software and GPU parallel computing
architecture. In: Proceedings of the 6th International Symposium on Memory
Management, pp. 103104 (2007)
6. Stone, S.S., Yi, H., Hwu, W.W., et al.: How GPUs can improve the quality of magnetic
resonance imaging (EB/OL), May 08 (2008)
7. Brown, M., Lowe, D.G.: Automatic panoramic image stitching using invariant features.
International Journal of Computer Vision 74(1), 5973 (2007)
8. Huo, H.-T.: Digital Image Processing, pp. 4345. Mechanical Industry Press, Beijing
(2004) (in Chinese)

You might also like