Computer Graphics & Geometry

Dynamic Distortion Correction with Viewpoint Motionnd Non-Static Attitude of Projector

Sergei I. Vyatkin
Institute of Automation and Electrometry SB RAS, Novosibirsk, 630090 Russia
Computer Arts Lab, University of Aizu, Aizu-Wakamatsu, 965-8580 Japan
sivser@mail.ru

Sergei E. Chizhick
Institute of Automation and Electrometry SB RAS, Novosibirsk, 630090 Russia
cse@albatros.iae.nsk.su

Carl W. Vilbrandt
Computer Arts Lab, University of Aizu, Aizu-Wakamatsu, 965-8580 Japan
vilb@u-aizu.ac.jp


Contents Abstract

Many military simulator applications, visual systems for virtual planetariums and future movies will require the generated image to be free of distortion regardless of where in some allowable volume the observer's eyepoint lies. Under distortion is understood nonlinear garbling an expressing, visible watcher, a non-flat caused by presence projection surface (projection dome), optical system characteristics and electronic blocks of projector. The dome usually is a twenty foot diameter sphere and is coated with a high-gain sheeting. An image drawn on the projection plane (the frame buffer) is scanned out on the surface of the dome. The resulting image is then reprojected onto the viewplane. Distortion is introduced by the lens, the non-planar dome, and possibly the projector's electronics and CRT as well.

Our approach is oriented on tasks that require extreme computational capabilities. It is a promising one for future development taking into consideration dramatically improving technology.

Additional Keywords: spherical perspective, dynamic distortion correction, non-linear image mapping, dome.

Introduction The surrounding space of a watcher is spherical [1]. So the most natural display of a surrounding ambience is a spherical perspective. A scene on the sphere can be built by means of the algorithm of ray tracing, but it is very slow. In building a wide angle image on the sphere, it is necessary to use adaptive visual algorithms for synthesis of spherical expression [2]. Primitives as they are now used by graphic accelerators are represented by flat triangles, boundary representation (B-rep), which are limited by straight lines and are not suitable for non-linear image mapping (NLIM) onto the dome [3]. There is a solution of the given problem very important for image transfer directly into the eye of the observer by laser. In the future, personal laser projection devices can change a personal computer display. Since the distortion mapping is in general different for each eyepoint, some means of locating the eyepoint is necessary. A head-tracking device fitted to the pilot's helmet is the usual solution. A more difficult problem lies in determining what the distortion mapping looks like from each viewpoint and inverse mapping.

Let us define a distortion function D(x,y) that maps a point on the projection plane to a point on the viewplane. Correcting the distortion due to D requires us to find the inverse distortion function D¯¹(x,y) and applying it to the original undistorted image (D(D¯¹(x,y))=(x,y) for an inverse mapping). If the viewpoint is dynamic, D is in general different for every viewpoint. The systems that provide distortion correction assume only a static viewpoint. When the pilot's eye is located at the design viewpoint, the image will be free of distortion. As the eye is moved further and further away, the image becomes progressively more distorted [4].

In this paper two approaches for dynamic distortion correction are considered. These approaches correct an image not only for a dynamic viewpoint but also for a dynamic projector. Both approaches are based on the representation of a polygon edge in the projector plane by a curve (see section 2), which is a projection of the spatial curve of the intersection of the dome with the plane containing the polygon edge and the origin of the viewer coordinates (edge plane). This representation makes it possible to use rather simple rasterizing algorithms based on quaternary subdivision (see section 3).

In the first approach, every polygon edge is described by a pair of equations:

Ax2 + 2Bxy + Cy2 + 2Dx + 2Ey + F = 0, (1)

ax + by + c = 0. (2)

The coefficients A,...F, a,.c of both equations are computed during the geometry transformations. The second equation defines the intersection of the projector plane with the plane containing the projector coordinates origin, and the intersection is parallel to the edge plane (see section 3.1).

In the second approach (see section 3.2), a polygon edge is treated as some curve described by a parametric equation of the type:

Ax + By + C + Dt(x, y) = 0, (3)

where A,B,C,D are edge coefficients obtained from the geometry transformations, and t(x, y) is a parameter depending non-linearly on x,y (see section 5). This parameter is used for computation texture coordinates, linear interpolation intensity (see section 4).

2. Using curves of second degree

This approache is based on the representation of a polygon edge in the projector plane by a curve. There are a restrictions of the method:

Adx2 + Bdy2 + Cdz2 + Ddxy + Edyz + Fdxz + Gdx + Hdy + Idz + Kd = 0; (4)

Note.

An equation of a curve of the second order (1) determines the line of a polygon on the projector's plane if the origin of the system coordinates does not belong to the plane of edge.

The linear equation (2) is used:

Geometric transformations for computation of quotients of equations (1),(2):

  1. Vector transformation to the observer's system coordinate:
  2. Vv = T (Vo + R), (5)

    where Vo is the vector of the vertex in the object space; T is a suitable rotation matrix; R is a suitable vector describing a shift;

    Vv is the vector of the vertex in the observer's system coordinate.

  3. Computation of equations of the plane of edges.

  4. Fig.1
    An equation of the plane of edges in the observer’s system coordinate:

    Nv*(x, y, z) = 0, (6)

    where Nv is the vector of the normal, Nv = [Vvi, Vvi+1]; Vvi is the vector of the vertex i; Vvi+1 is the vector of the vertex i+1.

  5. Transformation of equations of the planes of edges to the projector's system coordinates.
  6. An equation of the plane of edge in the projector's system coordinate:

    Np * (x, y, z) + Dp = 0, (7)

    where Np is the vector of normal, Np = Nv * Tr; Dp is the non-normalized distance up to the plane into direction Np, Dp = Np * Tm; Tr is a suitable rotation matrix; Tm is a suitable vector describing a shift.

  7. Computation of quotients of equations (1), (2).
Apx + Bpy + Cpz + Dp = 0. (8)

Then a quotients of equation (2) are:

a = Ap, b = Bp, c = Cp. (9)


Fig.2
Let the point on the projector's plane be described by vector V=(x, y, 1). If we extend V up to the intersection with the plane of edge (Fig.2), we obtain a new vector Vp=(p(x, y)*x, p(x, y)*y, p(x, y)),

where p(x, y) a parameter:

p(x, y) = Dp / (Ap*x+Bp*y+Cp). (10)

Substituting of coordinates of vector Vp into (4) with (10), gives us quotients of equation (1):

A = Dp2Ad + DpApGd + Ap2Kd; (11)

B = Dp2Dd + DpApHd + DpBpGd + 2ApBpKd;

C = Dp2Bd + DpBpHd + Bp2Kd;

D = Dp2Fd + DpApId + DpCpGd + 2ApCpKd;

E = Dp2Ed + DpApId + DpCpHd + 2BpCpKd;

F = Dp2Cd + DpCpId + Cp2Kd.

For determination of the point position of the plane of the projector relative to the line of edge of a polygon, let us write the next conditions:

Sign[Q(x, y)] = 1 is the point on the plane of edge, determined by vector Vp (Q(x, y): equation (1)), located inside dome;

Sign[Dp] = 1 is the projector is in half a space with polygon (if Dp=0 Sign[Dp] = 0);

Sign[ax+by+c] = 1 is the point on the plane of projector, determined by vector V, located in the area of minus values of equation (2).

The result of analysis of the combinations of conditions is shown in the table:

Sign

[ax+by+c]

Sign

[Dp]

Sign

[Q(x,y)]

Position of test point

0

0

0

Outside polygon

0

0

1

On the polygon side

0

1

*

On the polygon side

1

0

*

Outside polygon

1

1

0

On the polygon side

1

1

1

Outside polygon

3. Synthesis of virtual environment with image-plane recursive subdivision

We used the quaternary searching tree (quadtree) algorithm [5], [6], [7] which performs an efficient search for picture elements - pixels which participate in image generation. At the first step of recursion, the initial window (screen) is divided into four smaller subwindows (cells) in the screen plane. Using results of the intersection test, we perform division of cells that fall within the polygon completely or, probably, partially, and the external cells are eliminated from processing. For a test for intersection of cells with edges of polygons, see below. If the intersection is determined, then the cell is subject to the next recursion level. Cells that do not intersect with the polygon are not subject to further immersion to recursion; this corresponds to elimination from consideration of square screen spaces which the polygon surface is not mapped to (Fig.3).

Fig.3
The viewing window is subdivided until reaching the maximal set level of recursion. The technique has an advantage in that it allows us to discard large parts of empty space at an early stage. The quadtree technique allows us to determine effectively and quickly cells of different levels belonging to surfaces, and discard space regions outside the objects. Analyzing mutual disposition of i-level cell Qi and polygon, we can meet the following situations (Fig.4):


Fig.4
Identification of "inner" cells on each step of the subdivision can be used for multilevel masking.

3.1 Rasterization of polygons defined by second order curves

Firstly let us write an equation of straight line (2): ax + by + c = 0.

      3.1.1 Transformation of coefficients of a straight line to local coordinates of Qi cell during subdivision of cell Qi-1

      The transformation can be perfomed by modification of one term [7]:

      C(i) = C(i-1) ± a ± b, (12)

      3.1.2 Determination of Qi cell position of a straight line

      If the inequality

      ½ a½ +½ b½³½ C(i)½ , (13)

      is valid, then cell Qi is intersected [7].

      If the condition is ½ a½ +½ b½<½ C(i)½ ,then

      if C(i) < 0 then Qi does not belong to the polygon, (14)

      if C(i) > 0 then Qi is in the same halfspace with the polygon.

      Let us write an equation of tangent line (1):

      (ax+by+d)x + (bx+cy+e)y + (dx+ey+f) = 0, (15)

      where a = A, b = 0.5B, d = 0.5D,

      c = C, e = 0.5E, f = F;

      3.1.3 Transformation of coefficients of a second order curve to local coordinates of Qi cell during subdivision of cell Qi-1

      The transformation can be perfomed by modification of three terms (15):

      D(i) = 2D(i-1) ± a ± b,

      E(i) = 2E(i-1) ± b ± c,

      F(i) = 2f' ± D(i) ± E(i),

      f' = 2F(i-1) ± D(i-1) ± E(i-1), (16)

      Notation:

      D(i)..F(i) is the coefficients of current level of subdivision (D(0) = d, E(0) = e, F(0) = f);

      D(i-1)..F(i-1) is the coefficients of previous level of subdivision;

      a..c is the coefficients of original equation;

      f' is the some temporary value.

      3.1.4 Determination of Qi cell position of a second order curve If the inequality

      (½ a½ +½ c½ )/2 +½ b½ +½ D(i)½ +½ E(i)½³½ F(i)/2½ , (17)

      is valid, then the cell Qi is intersected.

      If the condition is not valid, then

      if F(i) < 0 then Qi does not belong to the polygon, (14)

      if F(i) ³ 0 then Qi is in the same halfspace with the polygon.

      Note: Introducing filter aperture, the condition can be rewritten as

      (½ a½ +½ b½ )*Ea(i)³½ C(i)½ ,

      ((½ a½ +½ c½ )/2+½ b½ )*Ea2(i)+(½ D(i)½ +½ E(i)½ )*

      Ea(i)³½ F(i)/2½ , (18)

      where Ea(i) defines the value of aperture for i-level of subdivision. It is sensible to assign Ea(0)=Ea(1)=...=Ea(i)=2, then

      ½ a½ +½ b½³½ C(i)½ /2,

      ½ a½ +½ c½ +2*½ b½ +½ D(i)½ +½ E(i)½³½ F(i)/4½ .

Note the main advantages of the prescribed rasterizing algorithm:

Note: When the field-of-view is greater than 180 degrees, the Z-buffer can't resolve the depth of the polygons that necessarily intersect the z = 0 plane. The R-buffer solves this problem by calculating the true range from the eye point to the points on the two objects to be resolved.

3.2 Rasterization of polygons defined by parametric equation

Let us repeat the computations of steps 1-3 from item 2, then we can write an equation of the plane of edge in projector system coordinate (7):

Apx + Bpy + Cpz + Dp = 0. (19)

Let any point in the plane of the projector be described by vector V=(x, y, 1). If we extend V up to intersection with dome (Fig.5), we obtain a new vector Vd=(x/t(x, y), y/t(x, y), 1/t(x, y)), where t(x, y) – any parameter (see item 5). Substitution of coordinates of vector Vd into (19), gives us an equation (3):

Ax + By + C + Dt(x, y) = 0,

where A=Ap, B=Bp, C=Cp, D=Dp.


Fig.5
We introduce an equation of "strip" (i.e., set of parallel straight boundaries which characterize curvature of the polygon edge relative to a certain set of projection plane points). This equation allows us to determine the position of a cell of i-level of subdivision Qi relatively to a polygon edge.

Ax + By + C(i) + D(i)t(i, j) ± D(i)Et(i) = 0, (20)

Notations:

A,B is the coefficients for x,y from original equation.

C(i) is a free ter m of linear part of i-level equation.

D(i) is the coefficient for non-linear part of i-level equation.

t(i,j) is the average value of t(x,y) for cell with number j of i-level of subdivision ( Look-up-table ).

Et(i) is a value characterizing spread of parameter t(x,y) inside an i-level cell (the same value assigned for all cells of a subdivision level).

Note that Et(i) value decreases when passing from i-level to i+1 -level (i.e., to "smaller" level). Finally, this provides the required rasterizing accuracy.

    3.2.1 Transformation of coefficients to local coordinates of Qi cell during subdivision of cell Qi-1

    Transformation to local coordinates of Qi results in modification of coefficients:

    C(i) = 2C(i-1) ± A ± B, D(i) = 2D(i-1), (21)

    Notations: C(i),D(i) is the coefficients of current level of subdivision ( C(0) = C, D(0) = D );

    C(i-1),D(i-1) is the coefficients of previous level of subdivision.

    3.2.2 Determination of Qi cell position

    Position of Qi relatively to an edge is defined by inequalities:

    ½ A½ +½ B½>½ C(i) + D(i)t(i, j) + D(i)Et(i)½ ,

    ½ A½ +½ B½>½ C(i) + D(i)t(i, j) - D(i)Et(i)½ . (22)

    And by sign of expressions: (C(i) + D(i)t(i, j) + D(i)Et(i)), (C(i) + D(i)t(i, j) - D(i)Et(i)).

    Comparing the second approach to the first one, note its advantages:

    Disadvantages of this approach:

4. Texturing

Consider geometric transformations of parameters of a polygon as only one example in texture coordinate. In the object system, coordinates assigned are:

1) An equation of plane of polygon:

Nzo*(x, y, z) + Dzo = 0, where Nzo - vector of normal;

Dzo - it is the distance up to the plane into direction Nzo.

2) An equation of plane of zero values of texture coordinate:

Nuo*(x, y, z) + Duo = 0, where Nuo- vector of normal;

Duo- it is the distance up to the plane into direction Nuo.

An equations 1) and 2) in the observer’s system coordinates are:

Nzv*(x, y, z) + Dzv = 0, (23)

Nuv*(x, y, z) + Duv = 0,

Nzv = Nzo*Tr; Nuv = Nuo*Tr;

Dzv = Nzo*Tm + Dzo; Duv = Nuo*Tm + Duo;

Tr is a suitable rotation matrix; Tm is a suitable vector describing a shift.

An equations (26) can be written as:

Azvx+Bzvy+Czvz+Dxv=0, Auvx+Buvy+Cuvz+Duv=0.

Let us introduce new quotients:

Azt = Azv / |Dzv|; Bzt = Bzv / |Dzv|; Czt = Czv / |Dzv|; Aut = Auv + DuvAzt;

But = Buv + DuvBzt; Cut = Cuv + DuvCzt;

Then we obtain the expression for computation of texture coordinate on the observer's plane:

U=(Autx+Buty+Cut) / (Aztx+Bzty+Czt). (24)

Similar for intensity:

I=(Aitx+Bity+Cit) / (Aztx+Bzty+Czt). (25)

Let us find numerator and denominator of fractional-linear function (27) with coordinates x, y on the projector's plane:

U=(Aux+Buy+Cu+Dut(x, y))/

(Azx+Bzy+Cz+Dzt(x, y)); (26)

Az, Bz, Cz is the components of the vector Nz; Au, Bu, Cu is the components of the vector Nu;

t(x, y) is the parameter of a non-linear function x, y (see section 5);

Nz = Nzt*Mr; Dz = Nzt*Vm; Nu = Nut*Mr;

Du = Nut*Vm, (27)

Mr is a suitable rotation matrix; Vm is a suitable vector describing a shift;

Nzt is the vector (Azt, Bzt, Czt); Nut is the vector (Aut, But, Cut).

The final formula for intensity computation is:

I=(Aix+Biy+Ci+Dit(x, y)) /

(Azx+Bzy+Cz+Dzt(x, y)); (28)

The Geometry Processor must compute for each parameter of polygon (texture coordinate, interpolation function of intensity) four quotients (Au.. Du...) plus four quotients of coordinate z (Az.. Dz).

5. Computation of t(X,Y)

If the dome is approximated with a second order surface, then t(X,Y) is reverse to the positive root of quadratic equation:

at2 + bt + c = 0; (29)

1/t = (-b± (b2-4ac)1/2) / 2a;

a = Adx2 + Bdy2 + Cd + Ddxy + Edy + Fdx;

b = Gdx + Hdy + Id;

c = Kd.

Here x, y are coordinates of a projection plane point, and Ad,..,Kd are coefficients of the second order surface (4).

Computations (29) are too difficult. For a dynamic projector and 2k´ 2k resolution, it is required to compute at least 256k accurate values of t(x, y) per frame if we assume that all other t(X,Y) could be achieved through bilinear interpolation. Thus, we suggest another method to determine t(X,Y) which requires far less number of operations.

Draw horizontal lines L(0),...L(i) in the projection plane (Fig.6).

Fig. 6
Each line contains set of node points S(i,0),...S(i,j), where the parameter t(x, y) should be determined - t(i, 0)..t(i, j). Construct a plane P(i) which contains the projector coordinates origin and given line L(i). Equation for intersection line Ld(i) of the plane P(i) with the dome is the following:

A(i)x2+B(i)xy+C(i)y2+D(i)x+E(i)y+F(i) = 0, (30)

where

A(i) = AdR02+BdR32+CdR62+DdR0R3+EdR3R6+FdR0R6;

B(i)=2AdR0R1+2BdR3R4+2CdR6R7+Dd(R0R4+R1R3)+

Ed(R3R7+R4R6)+Fd(R0R7+R1R6);

C(i) = AdR12+BdR42+CdR72+DdR1R4+EdR4R7+FdR1R7;

D(i) = GdR0+HdR3+IdR6;

E(i) = GdR1+HdR4+IdR7;

F(i) = Kd;

Notations:

Ad..Kd is the coefficients of the equation dome which is posed in the projection coordinates.

R0..R7 is a set of the coefficients for matrix to rotate the projector coordinate system (unique for every line L(0)...L(i)).

Therefore, a straight line Ls(i, j) is set in the plane P(i). This straight line goes through the projector coordinate origin and through the point S(i,j). The task is to determine Y is the coordinate Y(i,j) of the intersection of the straight line Ls(i, j) with the second order curve Ld(i) and to compute t(i,j) by formula:

t(i, j) = (Y(i, j)cos(a (i)))-1, (31)

where a (i) is an angle between the plane P(i) and the plane which contains x and z axis of the projector coordinate system. To determine Y(i,j) we shall use a method of step-by-step approximation.

6. Conclusions

To perform correction for changing eyepoint in a spherical dome, extra computations in the Geometry Processor and Video Processor are required. The Geometry Processor must transform from (X,Y) to (U,V) coordinates and the Video Processor does the reverse. There are two sources of nonlinearity in the transformation: one is the non-linear projection lens and the other is the spherical (nonplanar) dome. For the projection lens both Processors must use a look-up table with bilinear interpolation. In the case of the Video Processor, the distortion correction for the spherical dome can be built into this look up table as well. But in the case of the Geometry Processor, this cannot be done because the exact distortion from the dome depends on the eyepoint in the dome, which is dynamic. Correction for the spherical dome distortion in the Geometry Processor requires increased overall computational complexity. Thus, we suggest a new method to determine t(X,Y) which requires far less number of operations. Figure 7 shows distortion simulation (view from space through optic device).

References

  1. A. M. Kovalev On central projections of three-dimensional space // Autometry. 1996. N6. P. 4.
  2. A. M. Kovalev On number of elements of expressing of into view watcher // Autometry. 1997. N3. P. 30.
  3. Lizabeth K. Coe “Project to improve performance of the NASA/AMES ACAB Visual Pipeline”. Presented at the IMAGE V Conference, Phoenix, Arizona, 19-22 June 1990.
  4. A.M. Kovalev “Virtual Reality in Spherical Perspective” // Graphicon’98 Proceedings, S. Klimenko et al. (Eds). Moscow 1998.
  5. A.E. Asmus, A.I. Bogomyakov, S.I. Vyatkin et al. Video-Processor of Computer System Visualization “Albatross” // Autometry - N 6. 1994.
  6. S.I. Vyatkin, B.S. Dolgovesov, A.F. Rozhkov et al. Algorithms of Visualization for Real-Time Visual Systems // Graphicon’95 Proceedings, S. Klimenko et al. (Eds). St-Petersburg 1995.
  7. S.I. Vyatkin, B.S. Dolgovesov, B.S. Mazurok et al. An Effective Rasterization Method for Real-Time Computer System Visualization // Autometry - N 5. 1993.

Computer Graphics & Geometry