Viewing Angle

Embed Size (px)

Citation preview

  • 8/3/2019 Viewing Angle

    1/3

    Inferring depth cues from a changing viewing angleSarah Constantin

    December 13, 2011

    We consider the problem of two skew lines in 3-d space. Using orthographic projectionfrom some viewing angle gives a 2d projection of the scene, in which the two lines appear tointersect. The goal is to determine, from the rates of change in the location of the apparentintersection point as the viewing angle varies, the actual depth difference between the twolines.

    1 Formulating the Problem

    We write the two lines as(axt + cx, ayt + cy, azt + cz)

    (bxt + dx, byt + dy, bzt + dz)

    In our case, we are concerned with two skew lines at different depths, which we canrewrite as

    A = (axt + cx, ayt + cy, 0)

    andB = (bxt + dx, byt + dy, dz)

    We want to deduce dz.The viewing angle is a matrix derived from the Euler angles x, y, z:

    V =

    1 0 00 cos(x) sin(x)0 sin(x) cos(x)

    cos(y) 0 sin(y)0 1 0

    sin(y) 0 cos(y)

    cos(z) sin(z) 0sin(z) cos(z) 0

    0 0 1

    For any given (x, y, z), the corresponding viewing matrix V(x, y, z) applied to thepair of lines gives a two-dimensional image in which the lines appear to cross. Call the

    point of apparent intersection P(A, B, V). We attempt to solve for dz, the distance betweenthe lines (the depth difference) in terms of the derivatives of the point of intersection withrespect to the viewing angle:

    xP(A,B,V) and so on.

    1

  • 8/3/2019 Viewing Angle

    2/3

    First we solve for the location of the apparent intersection, given V and the coefficientsof A and B; we want to know the value of t.

    V(axt + cx, ayt + cy, 0) = V(bxt + dx, byt + dy, dz)

    t =V(dx cx, dy cy, dz)

    V(ax bx, ay by, 0)

    This gives us

    t =cos(z)cos(y)(dx cx) cos(y)sin(x)(dy cy) + sin()dz

    cos(z)cos(y)(ax bx) cos(x) sin(x)(ay by)

    Now we computedV(P)

    dx,dV(P)

    dy,dV(P)

    dz,

    Each of these is a pair of expressions, in fact: (

    dV(P)

    dx x,

    dV(P)

    dx y), for instance.Computing this explicitly, in the case of differentiation with respect to x, we get that

    the first coordinate is

    cos(x) cos(y)ax(dy cy)

    cos(y)cos(z)(ax bx) cos x(ay by)sin x

    ax(cos2 x(ay by) + (ay by)sin

    2 x)(cos y cos z(dx cx) cosy sin x(dy cy) + dz sin y)

    (cos y cos z(ax bx) cos x sin x(ay by))2

    Denote = cos y cos z(dx cx) cos y sin x(dy cy) + dz sin y

    and = cos y cos z(ax bx) cos x sin x(ay by)

    So the first coordinate is

    ax[cos x cos y(dy cy)

    (ay by)(1 2cos

    2 x)/2]

    Since were solving for dz, and the only component of this expression containing dz is ,we have to solve for . Denote by Dx the (scalar) expression

    cos x cos y(dy cy)

    (ay by)(1 2cos

    2 x)/2

    which is the first component of the derivative divided by ax, or equivalently the second

    component divided by ay. Likewise,

    Dz = cos y sin z(dx cx)

    + cos y sin z(ax bx)/

    2

    2

  • 8/3/2019 Viewing Angle

    3/3

    = Dx2

    (ay by)(1 2cos2 x)

    cos x cos y(dy cy)

    (ay by)(1 2cos2 x)

    dz = 1/ sin y cos y cos z(dx cx) cos y sin x(dy cy)

    = 1/ sin y(Dx2

    (ay by)(1 2cos2 x)+ cos

    x cos y(dy cy)(ay by)(1 2cos2 x)

    )cos y cos z(dxcx)cos y sin x(d

    3