data handling with two independent variables and the bezier filter

14
P. Venkataraman Mechanical Engineering P. Venkataraman Rochester Institute of Technology DETC2009 – 86330 Data Handling with Two Independent Variables and the Bezier Filter 29 th CIE, San Diego, California DATA HANDLING WITH TWO INDEPENDENT VARIABLES AND THE BEZIER FILTER P. Venkataraman

Upload: irma

Post on 11-Jan-2016

27 views

Category:

Documents


0 download

DESCRIPTION

DATA HANDLING WITH TWO INDEPENDENT VARIABLES AND THE BEZIER FILTER. P. Venkataraman. What is a Bezier Function ?. A Bezier function is a Bezier curve that behaves like a function. The Bezier curve is defined using a parameter Instead of y=f(x); - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: DATA HANDLING WITH TWO INDEPENDENT VARIABLES AND THE BEZIER FILTER

P. Venkataraman

Mechanical Engineering

P. Venkataraman Rochester Institute of Technology

DETC2009 – 86330 Data Handling with Two Independent Variables and the Bezier Filter

29th CIE, San Diego, California

DATA HANDLING WITH TWO INDEPENDENT VARIABLES

ANDTHE BEZIER FILTER

P. Venkataraman

Page 2: DATA HANDLING WITH TWO INDEPENDENT VARIABLES AND THE BEZIER FILTER

P. Venkataraman

Mechanical Engineering

P. Venkataraman Rochester Institute of Technology

DETC2009 – 86330 Data Handling with Two Independent Variables and the Bezier Filter

29th CIE, San Diego, California

2What is a Bezier Function ?

0 1 2 3 4 50

0.5

1

1.5

2

2.5

3

3.5

4

x: independent variable

y: d

ep

end

en

t va

ria

ble

s

[a1,b1][a1,b1]

[a2,b2]

[a3,b3]

[a4,b4]

[a5,b5]

Convex hullBezier VerticesBezier Curve: order 4

,0

( ) ( ) ( ) , 0 1

n

i n ii

Bx p y p J p p

1, ( ) ( )i n in i

nJ p p p

i

p : parameter

Bernstein basis

Number of vertices: 5

Order of the function : 4

A Bezier function is a Bezier curve that behaves like a function

The Bezier curve is defined using a parameter

Instead of y=f(x);

both x and y depend on the same parameter value; x = x(p) and y = y(p)

Page 3: DATA HANDLING WITH TWO INDEPENDENT VARIABLES AND THE BEZIER FILTER

P. Venkataraman

Mechanical Engineering

P. Venkataraman Rochester Institute of Technology

DETC2009 – 86330 Data Handling with Two Independent Variables and the Bezier Filter

29th CIE, San Diego, California

3Matrix Description of Bezier Function (2D)

0 1 2 3 4 50

0.5

1

1.5

2

2.5

3

3.5

4

x: independent variable

y: d

ep

end

en

t va

ria

ble

s

[a1,b1][a1,b1]

[a2,b2]

[a3,b3]

[a4,b4]

[a5,b5]

Convex hullBezier VerticesBezier Curve: order 4

[ ( ) ( )] [ ][ ][ ]x p y p P N B

4 3 2[ ] [ 1];

1 -4 6 -4 1 0 0

-4 12 -12 4 0 1 3

[ ] 6 -12 6 0 0 [ ] 2 1

-4 4 0 0 0 3 2

1 0 0 0 0 5

P p p p p

N B

0

This allows the use of Array Processing for shorter computer time

Page 4: DATA HANDLING WITH TWO INDEPENDENT VARIABLES AND THE BEZIER FILTER

P. Venkataraman

Mechanical Engineering

P. Venkataraman Rochester Institute of Technology

DETC2009 – 86330 Data Handling with Two Independent Variables and the Bezier Filter

29th CIE, San Diego, California

4

For a selected order of the Bezier function (n) Given a set of (m) vector data ya,i , or [Y], find the coefficient matrix, [B] so that the corresponding data set yb,i , [YB ] produces the least sum of the squared error

2

, ,

m

a i b ii

E y y

T T

B B A AE Y Y Y Y Y P NB Y P NB

0E

B

1[ ] [ ] [ ]T TA A AB P P P Y

Minimize

FOC:

The Best Bezier Function to fit the Data

Once the coefficient matrix is known, all other information can be generated using array processing

For the filter, the best order is chosen on minimum absolute error

Page 5: DATA HANDLING WITH TWO INDEPENDENT VARIABLES AND THE BEZIER FILTER

P. Venkataraman

Mechanical Engineering

P. Venkataraman Rochester Institute of Technology

DETC2009 – 86330 Data Handling with Two Independent Variables and the Bezier Filter

29th CIE, San Diego, California

5Two Dimensional Example

0 50 100 150 200 2501.2

1.25

1.3

1.35

1.4

1.45x 10

4

Ori

gin

al D

ata,

Fit

ted

Dat

a

points

Closing DJIA between Aug and Dec 2007

0 50 100 150 200 2501.2

1.25

1.3

1.35

1.4

1.45x 10

4

Ori

gin

al D

ata,

Fit

ted

Dat

a

points

DJIA - Adjust Close 17 Sep - Dec 18

A Bezier function over all the data

Order of function = 20

Mean original data = 13172.432

Mean Bezier data = 13172.423

Avg. Error = 98.34

Maximum Data = 14164.53

Std. Dev (original) = 530.19

Std. Dev. (Bezier) = 514.68

Page 6: DATA HANDLING WITH TWO INDEPENDENT VARIABLES AND THE BEZIER FILTER

P. Venkataraman

Mechanical Engineering

P. Venkataraman Rochester Institute of Technology

DETC2009 – 86330 Data Handling with Two Independent Variables and the Bezier Filter

29th CIE, San Diego, California

6Bezier Function in 3D

A 3D Bezier function will be a surface in 2D. Bezier surface can be described as a vector-valued function of two parameters r and s

[ ( , ) ( , ) ( , )]; 0 , 1x r s y r s u r s r s

, ,

, , ,0 0

( ) (1 ) ; 0 1; ( ) (1 ) ; 0 1

[ ( , ) ( , ) ( , )] ( , ) ( ) ( )

i m i j n j

m i n j

m n

i j m i n ji j

m nJ r r r r K s s s s

i j

x r s y r s u r s Q r s B J r K s

2 2

4 3 2

3 4 4

3 2 3

3 2 2 3 2

( , ) -1 3 3

( , ) - 4 8 - 6 8

( , ) (-1 48 - 78 12 )

(4 -112 180 - 24 )

(-6 60 - 90 ) (-8 12 8)

0 1 0 1

x r s r r r

y r s s s s s

u r s r r r s

r r r s

r r s r r s

r s

Page 7: DATA HANDLING WITH TWO INDEPENDENT VARIABLES AND THE BEZIER FILTER

P. Venkataraman

Mechanical Engineering

P. Venkataraman Rochester Institute of Technology

DETC2009 – 86330 Data Handling with Two Independent Variables and the Bezier Filter

29th CIE, San Diego, California

7Matrix Form of Bezier Function in 3D

[ ( , ) ( , ) ( , )]; 0 , 1x r s y r s u r s r s

[ ( , ) ( , ) ( , )] ( , )T

x r s y r s u r s Q r s R M B N S

4 3 21[ ] [ ... ] 1TTn nS s s s s s s s

1 3 2 1[ ...1] 1m mR r r r r r

1 0

1 2

1 0

0

11 1 ... 1

0 0 1 1

11 1 ... 0

0 1 1 2

[ ] . . . 0

11 1 ... 0

0 1 1 0

1 0 ... 00 0

m m

m m

m m m m m m m

m m m m

m m m m

m m

M

m m m m

m m

[ ]M

-1 3 -3 1

3 -6 3 0

-3 3 0 0

1 0 0 0

[ ]N

1 -4 6 -4 1

-4 12 -12 4 0

6 -12 6 0 0

-4 4 0 0 0

1 0 0 0 0

[ ]B

[0 0 0] [0 2 2] [0 3 3] [0 5 4] [0 6 5]

[1 0 0] [1 2 2] [1 3 3] [1 5 2] [1 6 1]

[3 0 0] [3 2 3] [3 3 0] [3 5 3] [3 6 5]

[5 0 0] [5 2 3] [5 3 0] [5 5 3] [5 6 5]

Page 8: DATA HANDLING WITH TWO INDEPENDENT VARIABLES AND THE BEZIER FILTER

P. Venkataraman

Mechanical Engineering

P. Venkataraman Rochester Institute of Technology

DETC2009 – 86330 Data Handling with Two Independent Variables and the Bezier Filter

29th CIE, San Diego, California

8

Minimize

FOC:

Bezier Filter for 3D Data

Once the coefficient matrix is known, all other information can be generated using array processing

For the filter, the best order is chosen on minimum absolute error

Given a set of array data [U], assuming an order for each dimension (m, n),

find the Bezier function coefficient matrix, [BU] so that the corresponding approximate data [UB] generates the least value for the sum of the squared error over the data array

2B

i j

E U U TTB A U A A U AU R M B N S F B G

0U

E

B

1T TU A A A A AB G IF F G IF U[ ] [ ] [ ]

Page 9: DATA HANDLING WITH TWO INDEPENDENT VARIABLES AND THE BEZIER FILTER

P. Venkataraman

Mechanical Engineering

P. Venkataraman Rochester Institute of Technology

DETC2009 – 86330 Data Handling with Two Independent Variables and the Bezier Filter

29th CIE, San Diego, California

93 Dimensional Bezier Function – Smooth Datay

x

Original Data

5 10 15 20 25 30 35 40 45 50

5

10

15

20

25

30

35

40

45

50

-6

-4

-2

0

2

4

6

Original Data about 2600 points based on MATLAB Peaks function

3D View of the Data

010

2030

4050

60

0

10

20

30

40

50

60-8

-6

-4

-2

0

2

4

6

8

10

x

Original Data

y

Ori

gin

al

-6

-4

-2

0

2

4

6

8

y

x

m =12, n =15 ,Least Sum of Absolute Error :179.8217

5 10 15 20 25 30 35 40 45 50

5

10

15

20

25

30

35

40

45

50

-6

-4

-2

0

2

4

6

Using the Bezier Filter

010

2030

4050

60

0

10

20

30

40

50

60-8

-6

-4

-2

0

2

4

6

8

x

Bezier Data

y

Bez

ier

-6

-4

-2

0

2

4

6 Contour Plot

3D Plot

original Bezier

mean 0.317 0.312

std. dev. 1.116 1.086

maximum 8.042 7.360

minimum -6.521 -6.405

average error: 6.91e-02

Page 10: DATA HANDLING WITH TWO INDEPENDENT VARIABLES AND THE BEZIER FILTER

P. Venkataraman

Mechanical Engineering

P. Venkataraman Rochester Institute of Technology

DETC2009 – 86330 Data Handling with Two Independent Variables and the Bezier Filter

29th CIE, San Diego, California

103 Dimensional Bezier Function – Rough Data

Same peaks function but randomly perturbed on both sides

y

x

Original Data

5 10 15 20 25 30 35 40 45 50

5

10

15

20

25

30

35

40

45

50

-6

-4

-2

0

2

4

6

Less dominant peaks diffused3D plot

010

2030

4050

60

0

10

20

30

40

50

60-8

-6

-4

-2

0

2

4

6

8

10

x

Original Data

y

Ori

gin

al

-6

-4

-2

0

2

4

6

8 Bezier FilterContour plot

y

x

m =12, n =12 ,Least Sum of Absolute Error :1702.726

5 10 15 20 25 30 35 40 45 50

5

10

15

20

25

30

35

40

45

50

-6

-4

-2

0

2

4

6

3D plot

010

2030

4050

60

0

10

20

30

40

50

60-8

-6

-4

-2

0

2

4

6

8

x

Bezier Data

y

Bez

ier

-6

-4

-2

0

2

4

6

average error: 6.54e-01

original Bezier

mean 0.322 0.325

std. dev. 0.859 1.035

maximum 8.253 7.481

minimum -7.651 -6.565

Page 11: DATA HANDLING WITH TWO INDEPENDENT VARIABLES AND THE BEZIER FILTER

P. Venkataraman

Mechanical Engineering

P. Venkataraman Rochester Institute of Technology

DETC2009 – 86330 Data Handling with Two Independent Variables and the Bezier Filter

29th CIE, San Diego, California

11

Bezier filter is easy to incorporate and can work for regular, unpredictable data, and images

The Bezier functions have excellent blending and smoothing properties

High order but well behaved polynomial functions can be useful in capturing the data content and underlying behavior

The mean of the Bezier data is the same as the mean of the original data

Bezier functions naturally decouples the independent and the dependent variables

Conclusions

A single continuous function is used to capture all data (whole field representation)

Gradient and derivative information of the data are easy to obtain

Page 12: DATA HANDLING WITH TWO INDEPENDENT VARIABLES AND THE BEZIER FILTER

P. Venkataraman

Mechanical Engineering

P. Venkataraman Rochester Institute of Technology

DETC2009 – 86330 Data Handling with Two Independent Variables and the Bezier Filter

29th CIE, San Diego, California

12Current Investigations

Using Bezier functions to solve inverse problems in ODE and PDE

Using Bezier functions in irregular domains

Using Bezier functions in image filtering

Page 13: DATA HANDLING WITH TWO INDEPENDENT VARIABLES AND THE BEZIER FILTER

P. Venkataraman

Mechanical Engineering

P. Venkataraman Rochester Institute of Technology

DETC2009 – 86330 Data Handling with Two Independent Variables and the Bezier Filter

29th CIE, San Diego, California

13Bezier Function in Four Quadrants

Original Image 671 KB

200 400 600 800 1000 1200

100

200

300

400

500

600

700

800

900

Four quads

Bezier function representation

200 400 600 800 1000 1200

100

200

300

400

500

600

700

800

900

Function order 20 x 20

Coefficient storage = 4*11 KB (3 color streams) = 44 KB

Page 14: DATA HANDLING WITH TWO INDEPENDENT VARIABLES AND THE BEZIER FILTER

P. Venkataraman

Mechanical Engineering

P. Venkataraman Rochester Institute of Technology

DETC2009 – 86330 Data Handling with Two Independent Variables and the Bezier Filter

29th CIE, San Diego, California

14

Questions ?