computational methods for on-line shape inspection/optipro_web.pdf · optipro computational methods...

32
OPTIPRO Computational Methods for On-Line Shape Inspection September 18, 2009 Per Bergström Department of Mathematics, Luleå University of Technology

Upload: others

Post on 13-Jul-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Computational Methods for On-Line Shape Inspection/optipro_web.pdf · OPTIPRO Computational Methods for On-Line Shape Inspection September 18, 2009 Per Bergström Department of Mathematics,

OPTIPRO

Computational Methods forOn-Line Shape Inspection

September 18, 2009

Per Bergström

Department of Mathematics,Luleå University of Technology

Page 2: Computational Methods for On-Line Shape Inspection/optipro_web.pdf · OPTIPRO Computational Methods for On-Line Shape Inspection September 18, 2009 Per Bergström Department of Mathematics,

OPTIPRO

Project Management

Svensk Verktygsteknik (Swedish tool & die technology)

Page 3: Computational Methods for On-Line Shape Inspection/optipro_web.pdf · OPTIPRO Computational Methods for On-Line Shape Inspection September 18, 2009 Per Bergström Department of Mathematics,

OPTIPRO

Licentiate Thesis in Scientific Computing

Computational Methods forOn-Line Shape Inspection

ISSN: 1402-1757ISBN 978-91-86233-09-9

http://pure.ltu.se/ws/fbspretrieve/2505373

Page 4: Computational Methods for On-Line Shape Inspection/optipro_web.pdf · OPTIPRO Computational Methods for On-Line Shape Inspection September 18, 2009 Per Bergström Department of Mathematics,

OPTIPRO

Abstract

Computer vision problem

Industrial production line

Aimed for on-line shape inspection

Page 5: Computational Methods for On-Line Shape Inspection/optipro_web.pdf · OPTIPRO Computational Methods for On-Line Shape Inspection September 18, 2009 Per Bergström Department of Mathematics,

OPTIPRO

1

Introduction

Measurement of the shape of the surface

Transformation of the measured surface

Fitting the surface of the CAD object

Comparison with the CAD object

Measured surface is inspected

– Typeset by FoilTEX – 1

Page 6: Computational Methods for On-Line Shape Inspection/optipro_web.pdf · OPTIPRO Computational Methods for On-Line Shape Inspection September 18, 2009 Per Bergström Department of Mathematics,

OPTIPRO

2

The Shape Measurement Method

Projected fringes

Optical non-touching measurement method

One projector, two cameras

– Typeset by FoilTEX – 2

Page 7: Computational Methods for On-Line Shape Inspection/optipro_web.pdf · OPTIPRO Computational Methods for On-Line Shape Inspection September 18, 2009 Per Bergström Department of Mathematics,

OPTIPRO

3

The Shape Measurement Method

– Typeset by FoilTEX – 3

Page 8: Computational Methods for On-Line Shape Inspection/optipro_web.pdf · OPTIPRO Computational Methods for On-Line Shape Inspection September 18, 2009 Per Bergström Department of Mathematics,

OPTIPRO

4

The Shape Measurement Method

The measurement results in a huge number of data pointsrepresenting the measured surface.

Notation of data points: P = pkk=0,...,NP−1, NP ∼ 105

The background will be measured

Troubles around sharp edges

– Typeset by FoilTEX – 4

Page 9: Computational Methods for On-Line Shape Inspection/optipro_web.pdf · OPTIPRO Computational Methods for On-Line Shape Inspection September 18, 2009 Per Bergström Department of Mathematics,

OPTIPRO

5

About Surfaces in CAD

Example of NURBS surface with bidirectional control net.

– Typeset by FoilTEX – 5

Page 10: Computational Methods for On-Line Shape Inspection/optipro_web.pdf · OPTIPRO Computational Methods for On-Line Shape Inspection September 18, 2009 Per Bergström Department of Mathematics,

OPTIPRO

6

About Surfaces in CAD

Trimmed NURBS Surfaces

Concept of trimming

Arbitrarily shaped domainDomain is a connected spaceBounded by an outer curve and possible inner curve(s)

– Typeset by FoilTEX – 6

Page 11: Computational Methods for On-Line Shape Inspection/optipro_web.pdf · OPTIPRO Computational Methods for On-Line Shape Inspection September 18, 2009 Per Bergström Department of Mathematics,

OPTIPRO

7

Transformation of the Measured Surface

CAD surface: model points, set of points X

measured surface: data points, set of pointsP = pkk=0,...,NP−1

– Typeset by FoilTEX – 7

Page 12: Computational Methods for On-Line Shape Inspection/optipro_web.pdf · OPTIPRO Computational Methods for On-Line Shape Inspection September 18, 2009 Per Bergström Department of Mathematics,

OPTIPRO

8

Transformation of the Measured Surface

Rotation matrix R ∈ Ω,

Ω = R ∈ R3×3|RTR = I3,det (R) = +1

Translation vector T ∈ R3×1

– Typeset by FoilTEX – 8

Page 13: Computational Methods for On-Line Shape Inspection/optipro_web.pdf · OPTIPRO Computational Methods for On-Line Shape Inspection September 18, 2009 Per Bergström Department of Mathematics,

OPTIPRO

9

Transformation of the Measured Surface

Surface matching problem

minR∈Ω,T

NP−1∑k=0

(d(Rpk + T, X)

)2(1)

where d(p, X) = minx∈X‖x− p‖2

– Typeset by FoilTEX – 9

Page 14: Computational Methods for On-Line Shape Inspection/optipro_web.pdf · OPTIPRO Computational Methods for On-Line Shape Inspection September 18, 2009 Per Bergström Department of Mathematics,

OPTIPRO

10

Transformation of the Measured Surface

Problem (1) is solved using the ICP algorithm

ICP (iterative closest point) algorithm

Require: X,PR = I3, T = 0repeat

yk = C(Rpk + T, X), k = 0, . . . , NP − 1

[R,T] = arg minR∈Ω,T

NP−1∑k=0‖Rpk + T− yk‖2

2

until convergencereturn R , T

– Typeset by FoilTEX – 10

Page 15: Computational Methods for On-Line Shape Inspection/optipro_web.pdf · OPTIPRO Computational Methods for On-Line Shape Inspection September 18, 2009 Per Bergström Department of Mathematics,

OPTIPRO

11

Examples of Shape Inspection

p point on measured surface

p = Rp + T

p corresponding point on CAD object

x point on CAD object

x = R−1(x−T)

x corresponding point on measured surface

– Typeset by FoilTEX – 11

Page 16: Computational Methods for On-Line Shape Inspection/optipro_web.pdf · OPTIPRO Computational Methods for On-Line Shape Inspection September 18, 2009 Per Bergström Department of Mathematics,

OPTIPRO

12

Examples of Shape Inspection

Distance Measurement

Distance between two fix-points

– Typeset by FoilTEX – 12

Page 17: Computational Methods for On-Line Shape Inspection/optipro_web.pdf · OPTIPRO Computational Methods for On-Line Shape Inspection September 18, 2009 Per Bergström Department of Mathematics,

OPTIPRO

13

Examples of Shape Inspection

– Typeset by FoilTEX – 13

Page 18: Computational Methods for On-Line Shape Inspection/optipro_web.pdf · OPTIPRO Computational Methods for On-Line Shape Inspection September 18, 2009 Per Bergström Department of Mathematics,

OPTIPRO

14

Examples of Shape Inspection

x1 and x2 points on CAD object

Measured distance d between the points

d =∥∥R−1

2 (x2 −T2)−R−11 (x1 −T1)

∥∥2

– Typeset by FoilTEX – 14

Page 19: Computational Methods for On-Line Shape Inspection/optipro_web.pdf · OPTIPRO Computational Methods for On-Line Shape Inspection September 18, 2009 Per Bergström Department of Mathematics,

OPTIPRO

15

Using Best Fit: Finding Corners

Computer vision problem

The computer does not understand the shape

A minimization problem must be solved

– Typeset by FoilTEX – 15

Page 20: Computational Methods for On-Line Shape Inspection/optipro_web.pdf · OPTIPRO Computational Methods for On-Line Shape Inspection September 18, 2009 Per Bergström Department of Mathematics,

OPTIPRO

16

Using Best Fit: Finding Corners

– Typeset by FoilTEX – 16

Page 21: Computational Methods for On-Line Shape Inspection/optipro_web.pdf · OPTIPRO Computational Methods for On-Line Shape Inspection September 18, 2009 Per Bergström Department of Mathematics,

OPTIPRO

17

Using Best Fit: Finding Corners

– Typeset by FoilTEX – 17

Page 22: Computational Methods for On-Line Shape Inspection/optipro_web.pdf · OPTIPRO Computational Methods for On-Line Shape Inspection September 18, 2009 Per Bergström Department of Mathematics,

OPTIPRO

18

Using Best Fit: Finding Corners

– Typeset by FoilTEX – 18

Page 23: Computational Methods for On-Line Shape Inspection/optipro_web.pdf · OPTIPRO Computational Methods for On-Line Shape Inspection September 18, 2009 Per Bergström Department of Mathematics,

OPTIPRO

19

Brief Introduction of Robust Estimation

Decrease influence of strogly deviating data points

Apply methods from robust statistics tothe surface fitting problem

– Typeset by FoilTEX – 19

Page 24: Computational Methods for On-Line Shape Inspection/optipro_web.pdf · OPTIPRO Computational Methods for On-Line Shape Inspection September 18, 2009 Per Bergström Department of Mathematics,

OPTIPRO

20

Brief Introduction of Robust Estimation

x

y

Example of linear regression by minimizing a sum ofsquared residuals.

– Typeset by FoilTEX – 20

Page 25: Computational Methods for On-Line Shape Inspection/optipro_web.pdf · OPTIPRO Computational Methods for On-Line Shape Inspection September 18, 2009 Per Bergström Department of Mathematics,

OPTIPRO

21

Brief Introduction of Robust Estimation

−15 −10 −5 0 5 10 150

5

10

15

20

25

30

r

ρ

HuberTukeys Biweight

Huber (k > 0) Tukey’s Bi-weight (k > 0)

ρ(r) =

r2/2, |r| ≤ kk|r| − k2/2, |r| > k

ρ(r) =

(k2/6)[1− 1− (r/k)23], |r| ≤ kk2/6, |r| > k

Two examples of ρ-functions. Huber is convex,while Biweight is not.

– Typeset by FoilTEX – 21

Page 26: Computational Methods for On-Line Shape Inspection/optipro_web.pdf · OPTIPRO Computational Methods for On-Line Shape Inspection September 18, 2009 Per Bergström Department of Mathematics,

OPTIPRO

22

Brief Introduction of Robust Estimation

x

y

Regression examples: Linear robust regression using theHuber ρ-function, solid line.

Linear least squares regression, dotted line.

– Typeset by FoilTEX – 22

Page 27: Computational Methods for On-Line Shape Inspection/optipro_web.pdf · OPTIPRO Computational Methods for On-Line Shape Inspection September 18, 2009 Per Bergström Department of Mathematics,

OPTIPRO

23

Robust Problem Formulation

Instead of solving

minR∈Ω,T

NP−1∑k=0

(d(Rpk + T, X)

)2

the problem

minR∈Ω,T

NP−1∑k=0

ρ(d(Rpk + T, X)/σ

)(2)

is solved

– Typeset by FoilTEX – 23

Page 28: Computational Methods for On-Line Shape Inspection/optipro_web.pdf · OPTIPRO Computational Methods for On-Line Shape Inspection September 18, 2009 Per Bergström Department of Mathematics,

OPTIPRO

24

IRLS

IRLS (iteratively re-weighted least squares) method

weight function

w(r) =

ddrρ(r)r

if r 6= 0

d2

dr2ρ(r) if r = 0

– Typeset by FoilTEX – 24

Page 29: Computational Methods for On-Line Shape Inspection/optipro_web.pdf · OPTIPRO Computational Methods for On-Line Shape Inspection September 18, 2009 Per Bergström Department of Mathematics,

OPTIPRO

25

The ICP Algorithm with IRLS

Require: X,P,Rinit,Tinit

R = Rinit, T = Tinit

repeatpi = Rpi + T, i = 0, . . . , NP − 1yi = C(pi, X), i = 0, . . . , NP − 1ri = ‖pi − yi‖2 /σ, i = 0, . . . , NP − 1

[R,T] = arg minR∈Ω,T

NP−1∑i=0

wi(ri) ‖Rqi + T− yi‖22

until convergencereturn R , T

– Typeset by FoilTEX – 25

Page 30: Computational Methods for On-Line Shape Inspection/optipro_web.pdf · OPTIPRO Computational Methods for On-Line Shape Inspection September 18, 2009 Per Bergström Department of Mathematics,

OPTIPRO

26

Robust Estimators

−15 −10 −5 0 5 10 150

5

10

15

20

25

30

r

ρ

Least−SquareHuberFairTukeys BiweightHampel

– Typeset by FoilTEX – 26

Page 31: Computational Methods for On-Line Shape Inspection/optipro_web.pdf · OPTIPRO Computational Methods for On-Line Shape Inspection September 18, 2009 Per Bergström Department of Mathematics,

OPTIPRO

27

Robust Estimators

−15 −10 −5 0 5 10 150

0.2

0.4

0.6

0.8

1

r

w

Least−SquareHuberFairTukeys BiweightHampel

– Typeset by FoilTEX – 27

Page 32: Computational Methods for On-Line Shape Inspection/optipro_web.pdf · OPTIPRO Computational Methods for On-Line Shape Inspection September 18, 2009 Per Bergström Department of Mathematics,

OPTIPRO

28

End of Presentation

Questions?

– Typeset by FoilTEX – 28