Optimization of Inverse Snyder Polyhedral Projection Erika Harrison eharris@ucalgary.ca Ali...

Preview:

Citation preview

Optimization of Inverse Snyder Polyhedral Projection

Erika Harrisoneharris@ucalgary.ca

Ali Mahdavi-Amiriamahdavi@ucalgary.ca

Faramarz Samavatisamavati@ucalgary.ca

Dept. of Computer Science

University of Calgary

Calgary, Canada

October 5, 2011

2

Inverse Snyder Optimization

• What is Snyder?

• Inversion Issues

• Optimizations:– Operation Reduction– Iteration Reduction– Iteration Elimination

• Results

• Summary (NASA, 2000)

3

What is Snyder?

• Projecting Spherical Earth to Planar Map

4

What is Snyder?

• Projecting Spherical Earth to Planar Map

F-1(p)

F(p)

(Google Maps, 2010 – Mercator Projection)(NASA, 2000)

5

What is Snyder?

• Projecting Spherical Earth to Planar Map

Mercator Projection

6

What is Snyder?

• Projecting Spherical Earth to Planar Map

• Preserve Area

7

What is Snyder?

• Projecting Spherical Earth to Planar Map

• Preserve Area

(NASA, 2000-2006)

Mollweide

8

What is Snyder?

• Projecting Spherical Earth to Planar Map

• Preserve Area

Mollweide

Lambert Azimuthal Equal-Area

(NASA, 2000-2006)

9

What is Snyder?

• Projecting Spherical Earth to Planar Map

• Preserve Area

MollweideWerner

Lambert Azimuthal Equal-Area

(NASA, 2000-2006)

10

What is Snyder?

P-1

P

• Projecting Spherical Earth to Planar Map

• Preserve Area

11

What is Snyder?

• Projecting Spherical Earth to Planar Map

• Preserve Area

(Snyder, 1992)

12

What is Snyder?

• Projecting Spherical Earth to Planar Map

• Preserve Area

PYXIS Innovation

• Industrial applications in virtual worlds

Truncated Icosahedron:• Angular Deformation: < 3.75o

• Scale Variation: < 3.3%

Icosahedron:• Angular Deformation: < 17.27o

• Scale Variation: < 16.3%

13

What is Snyder?

• Projecting Spherical Earth to Planar Map

• Preserve Area

• Industrial applications in virtual worlds

Truncated Icosahedron:• Angular Deformation: < 3.75o

• Scale Variation: < 3.3%

Icosahedron:• Angular Deformation: < 17.27o

• Scale Variation: < 16.3%

Snyder’s Icosahedron Face

14

Constructing the Projection

• Identify Symmetric Region

15

Constructing the Projection

A’

B’

C’

G g

16

A’

B’

C’

G g

Constructing the Projection

A’

B’

C’

G gD’

AzH

17

A’

B’

C’

G g

A

B

C

Constructing the Projection

A’

B’

C’

G gD’

AzD

Az’H

g

18

• Find planar azimuth: Az’

• Position P’ based on d’ from q

• Unwrap azimuth

A’

B’

C’

G g

A

B

C

Constructing the Projection

A’

B’

C’

G gD’

AzD

Az’H

g

19

• Find planar azimuth: Az’

• Position P’ based on d’ from q

• Unwrap azimuth

A’

B’

C’

G g

A

B

C

Constructing the Projection

A’

B’

C’

G gD’

AzD

Az’H

g

20

• Find planar azimuth: Az’

• Position P’ based on d’ from q

• Unwrap azimuth

A’

B’

C’

G g

A

B

C

Constructing the Projection

A’

B’

C’

G gD’

AzD

Az’H

g

linear

non-linear, trigonometric functions

21

• Find planar azimuth: Az’

• Position P’ based on d’ from q

• Unwrap azimuth

A’

B’

C’

G g

A

B

C

Constructing the Projection

A’

B’

C’

G gD’

AzD

Az’H

g

22

• Find planar azimuth: Az’

• Position P’ based on d’ from q

• Unwrap azimuth

A’

B’

C’

G g

A

B

C

Constructing the Projection

A’

B’

C’

G gD’

AzD

Az’H

g

non-linear with

inverse trig. funcs

23

• Find planar azimuth: Az’

• Position P’ based on d’ from q

• Unwrap azimuth

A’

B’

C’

G g

A

B

C

Constructing the Projection

A’

B’

C’

G gD’

AzD

Az’H

g

non-linear with

inverse trig. funcs

q d’

24

• Find planar azimuth: Az’

• Position P’ based on d’ from q

• Unwrap azimuth

A’

B’

C’

G g

A

B

C

Constructing the Projection

A’

B’

C’

G gD’

AzD

Az’H

g

non-linear with

inverse trig. funcs

q d’

25

A

B

C

Inverse Projection

g

26

A

B

C

DAz’

d’

g

A

B

C

g

Inverse Projection

27

A’

B’

C’

G g

A

B

C

D’Az

DAz’q d’

Hg

A

B

C

g

Inverse Projection

28

Inversion Issues

A’

B’

C’

G g

A

B

C

D’Az

DAz’q d’

Hg

A

B

C

g

• Find spherical azimuth: Az

29

Inversion Issues

A’

B’

C’

G g

A

B

C

D’Az

DAz’q d’

Hg

A

B

C

g

• Find spherical azimuth: Azlinear

non-linear, trigonometric functions

30

Inversion Issues

A’

B’

C’

G g

A

B

C

D’Az

DAz’q d’

Hg

A

B

C

g

• Find spherical azimuth: Azlinear

non-linear, trigonometric functions

non-linear, inverse trig. functions

31

non-linear, trigonometric functions

Inversion Issues

A’

B’

C’

G g

A

B

C

D’Az

DAz’q d’

Hg

A

B

C

g

• Find spherical azimuth: Azlinear

non-linear, inverse trig. functions

Use IterativeMethod to Solve

For Az

32

Inversion Issues

• Frequently called!

(PYXIS, 2011)

33

Optimizations

1. Operation Reduction

A

B

C

G g

A’

B’

C’

DAz

D’Az’

q

d’

H P

P’

34

Optimizations

1. Operation Reduction

2. Iteration ReductionA

B

C

G g

A’

B’

C’

DAz

D’Az’

q

d’

H P

P’

35

Optimizations

1. Operation Reduction

2. Iteration Reduction

3. Iteration Avoidance

A

B

C

G g

A’

B’

C’

DAz

D’Az’

q

d’

H P

P’

36

Operation Reduction

• Reduce repetitive calls– 2π, H– cos and sin calls

• Pre-computation of values

• Trigonometric calls (eg. sincos)

37

Operation Reduction

• Reduce repetitive calls– 2π, H– cos and sin calls

• Pre-computation of values

• Trigonometric calls (eg. sincos)

• Nominal speed up

• Note: No look-up table for cos and sin (would increase error)

38

Iteration Reduction

A’

B’

C’

G g

A

B

C

D’Az

DAz’q d’

Hg

A

B

C

g

linear

non-linear, trigonometric functions

non-linear, inverse trig. functions

• Recall finding spherical azimuth: Az

39

Iteration Reduction

A’

B’

C’

G g

A

B

C

D’Az

DAz’q d’

Hg

A

B

C

g

linear

non-linear, trigonometric functions

non-linear, inverse trig. functions

• Recall finding spherical azimuth: Az

40

Iteration Reduction

A’

B’

C’

G g

A

B

C

D’Az

DAz’q d’

Hg

A

B

C

g

linear

non-linear, trigonometric functions

non-linear, inverse trig. functions

• Recall finding spherical azimuth: Az

41

Iteration ReductionNewton Raphson: Iterative Solution Finding

42

Iteration ReductionNewton Raphson: Iterative Solution Finding

• Idea: Consider treating the iterative solution as a one-dimensional function

43

Iteration Reduction

• Idea: Consider treating the iterative solution as a one-dimensional function

44

Iteration Reduction

PolynomialSum of Squares of

ResidualsVariance ofResiduals

Degree 1 1.19E+00 2.02E-04

Degree 2 9.72E-01 1.66E-04

Degree 3 2.30E-04 3.92E-08

Degree 4 2.06E-04 3.51E-08

Degree 5 2.51E-05 4.28E-09

Degree 6 2.20E-05 3.75E-09

Degree 7 9.06E-07 1.55E-10

Polynomial Approximating Azimuthal Shift

45

Iteration Reduction

• Use polynomial for improved initial estimate of Newton-Raphson

46

Iteration Elimination

• Idea: Skip the iteration entirely, using this approximating function!

• Note: Will need to evaluate error

47

Results

Need to:

• Determine Runtime Improvements

• Contrast Original with Iteration Reduction especially regarding iteration drop

• Establish Error for Elimination Approach

48

Results: Runtime Improvements

• Approach: – Profile inverse Snyder method using gprof– Ran 100 times, against four (4) quality levels

• Quality:

Quality 10 - Flat & Projected

49

Results: Runtime Improvements

Profiling Time

0

0.02

0.04

0.06

0.08

0.1

0.12

25 50 75 100

Quality

Ave

rag

e T

ime

(s)

Original

Reduction

Elimination

50

Results: Iteration Reduction

• Original vs ReducedAverage Iterations

0

0.5

1

1.5

2

2.5

3

3.5

4

25 50 75 100

Quality

Ave

rag

e It

erat

ion

s

Original

Reduction

51

• Original vs Reduced

• Recall: Skip has no iterations

Results: Iteration Reduction

Average Iterations

0

0.5

1

1.5

2

2.5

3

3.5

4

25 50 75 100

Quality

Ave

rag

e It

erat

ion

s

Original

Reduction

52

Results: Iteration ReductionQuality 10 Quality 30 Quality 60 Quality 100

Original

- 4 iterations - 3 Iterations - 2 Iterations - 0 or 1 Iterations

53

Results: Iteration Reduction

Original

Reduced

Quality 10 Quality 30 Quality 60 Quality 100

- 4 iterations - 3 Iterations - 2 Iterations - 0 or 1 Iterations

54

Results: Iteration Reduction

Original Reduced

- 4 iterations - 3 Iterations - 2 Iterations - 0 or 1 Iterations

55

Results: Error Check• Original vs Eliminated Approach

QualityAvg. Dist.

ErrorMax Dist.

ErrorAvg. AreaError (%)

Max AreaError (%)

25 9.38e-05 6.19e-04 1.98e-05 1.60e-02

50 9.44e-05 6.19e-04 9.22e-06 2.20e-02

75 9.46e-05 6.19e-04 3.33e-06 3.50e-02

100 9.49e-05 6.19e-04 1.76e-06 5.07e-02

56

Results: Error Check• Original vs Eliminated Approach

QualityAvg. Dist.

ErrorMax Dist.

ErrorAvg. AreaError (%)

Max AreaError (%)

25 9.38e-05 6.19e-04 1.98e-05 1.60e-02

50 9.44e-05 6.19e-04 9.22e-06 2.20e-02

75 9.46e-05 6.19e-04 3.33e-06 3.50e-02

100 9.49e-05 6.19e-04 1.76e-06 5.07e-02

On the Earth:Average Distance Error: 5.90mAverage Areal Error: 714 m2

57

Results: Error CheckDistance Error Areal Error (Percent)

Displacement in: - No error- Increase- Decrease

- X- Y- Z

- Uniform- None

58

Summary

• Definite Improvement– 45% time reduction when skipping iteration– 25% iteration reduction

• Nominal Error on Elimination Approach– 8.5 x 10-6% (714 m2) average areal change– 5.9 m distance error– Useful at coarse resolutions

59

Conclusion

Result: Determined an effective association of planar data to a spherical world

60

Questions?

Result: Determined an effective association of planar data to a spherical world

Recommended