Download presentation

Presentation is loading. Please wait.

Published byJadyn Salters Modified over 2 years ago

1
Surface normals and principal component analysis (PCA) 3DM slides by Marc van Kreveld 1

2
Normal of a surface Defined at points on the surface: normal of the tangent plane to the surface at that point Well-defined and unique inside the facets of any polyhedron At edges and vertices, the tangent plane is not unique or not defined (convex/reflex edge) normal is undefined 2

3
Normal of a surface On a smooth surface without a boundary, the normal is unique and well-defined everywhere (smooth simply means that the derivatives of the surface exist everywhere) On a smooth surface with boundary, the normal is not defined on the boundary 3

4
Normal of a surface 4

5
The normal at edges or vertices is often defined in some convenient way: some average of normals of incident triangles 5

6
Normal of a surface No matter what choice we make at a vertex, a piecewise linear surface will not have a continuously changing normal visible after computing illumination 6

7
Curvature The rate of change of the normal is the curvature higher curvature lower curvature infinite curvature zero curvature 7

8
Curvature A circle is a shape that has constant curvature everywhere The same is true for a line, whose curvature is zero everywhere 8

9
Curvature Curvature can be positive or negative Intuitively, the magnitude of the curvature is the curvature of the circle that looks most like the curve, close to the point of interest negative curvature positive curvature 9

10
Curvature For a 3D surface, there are curvatures in all directions in the tangent plane 10

11
Curvature negative positive inside 11

12
Properties at a point A point on a smooth surface has various properties: – location – normal (first derivative) – two/many curvatures (second derivative) 12

13
Normal of a point in a point set? Can we estimate the normal for each point in a scanned point cloud? This would help reconstruction (recall RANSAC) 13

14
Normal of a point in a point set Main idea of various different methods, to estimate the normal of a point q in a point cloud: – collect some nearest neighbors of q, for instance 12 – fit a plane for q and its 12 neighbors – use the normal of this plane as the estimated normal for q 14

15
Normal estimation at a point Risk: the 12 nearest neighbors of q are not nicely spread in all directions on the plane the computed normal could even be perpendicular to the real normal! 15

16
Normal estimation at a point Also: the quality of normals of points near edges of the scanned shape is often not so good We want a way of knowing how good the estimated normal seems to be 16

17
Principal component analysis General technique for data analysis Uses the statistical concept of correlation Uses the linear algebra concept of eigenvectors Can be used for normal estimation and tells something about the quality (clearness) of the normal 17

18
Correlation Degree of correspondence/changing together of two variables measured from objects – in a population of people, length and weight are correlated – in decathlon, performance on 100 meters and long jump are correlated (so are shot put and discus throw) Pearson’s correlation coefficient 18

19
Covariance, correlation For two variables x and y, their covariance is defined as (x,y)= E[ (x – E[x]) (y – E[y]) ] = E[xy] – E[x] E[y] E[x] is the expected value of x, also the mean x Note that the variance 2 (x) = (x,x), the covariance of x with itself, where (x) is the standard deviation Correlation x,y = (x,y) / ( (x) (y)) 19

20
Data matrix 20

21
Covariance matrix 21

22
Principal component analysis PCA is a linear transformation (3 x 3 in our example) that makes new base vectors such that – the first base vector has a direction that realizes the largest possible variance (when projected onto a line) – the second base vector is orthogonal to the first and realizes the largest possible variance among those vectors – the third base vector is orthogonal to the first and second base vector and … – … and so on … Hence, PCA is an orthogonal linear transformation 22

23
Principal component analysis In 2D, after finding the first base vector, the second one is immediately determined because of the requirement of orthogonality 23

24
Principal component analysis In 3D, after the first base vector is found, the data is projected onto a plane with this base vector as its normal, and we find the second base vector in this plane as the direction with largest variance in that plane (this “removes” the variance explained by the first base vector) 24

25
Principal component analysis After the first two base vectors are found, the data is projected onto a line orthogonal to the first two base vectors and the third base vector is found on this line it is simply given by the cross product of the first two base vectors 25

26
Principal component analysis The subsequent variances we find are decreasing in value and give an “importance” to the base vectors The mind-process explains why principal component analysis can be used for dimension reduction: maybe all the variance in, say, 10 measurement types can be explained using 4 or 3 (new) dimensions 26

27
Principal component analysis In actual computation, all base vectors are found at once using linear algebra techniques 27

28
Eigenvectors of a matrix 28

29
Eigenvectors of a matrix 29

30
Eigenvectors of a matrix Blue vectors: (1,1) Pink vectors: (1, –1) and (–1, 1) Red vectors are not eigenvectors (they change direction) 30

31
Eigenvectors of a matrix If v is an eigenvector, then any vector parallel to v is also an eigenvector (with the same eigenvalue!) If the eigenvalue is –1 (negative in general), then the eigenvector will be reversed in direction by the matrix Only square matrices have eigenvectors and values 31

32
Eigenvectors, a 2D example 32

33
Eigenvectors, a 2D example 33

34
Questions 34

35
Principal component analysis Recall: PCA is an orthogonal linear transformation The new base vectors are the eigenvectors of the covariance matrix! The eigenvalues are the variances of the data points when projected onto a line with the direction of the eigenvector Geometrically, PCA is a rotation around the multi- dimensional mean (point) so that the base vectors align with the principal components (which is why the data matrix must be mean centered) 35

36
PCA example 36

37
PCA example 37

38
PCA example 38

39
PCA example The data points and the mean-centered data points 39

40
PCA example The first principal component (purple): (1, 0.29) Orthogonal projection onto the orange line (direction of first eigenvector) yields the largest possible variance 40

41
PCA example Enlarged, and the non-squared distances shown 41

42
PCA example The second principal component (green): (–0.29, 1) Orthogonal projection onto the dark blue line (direction of second eigenvector) yields the remaining variance 42

43
PCA example The fact that the first eigenvalue is much larger than the second means that there is a direction that explains most of the variance of the data a line exists that fits well with the data When both eigenvalues are equally large, the data is spread equally in all directions 43

44
PCA, eigenvectors and eigenvalues In the pictures, identify the eigenvectors and state how different the eigenvalues appear to be 44

45
PCA observations in 3D If the first eigenvalue is large and the other two are small, then the data points lie approximately on a line – through the 3D mean – with orientation parallel to the first eigenvector If the first two eigenvalues are large and the third eigenvalue is small, then the points lie approximately on a plane – through the 3D mean – with orientation spanned by the first two eigenvectors / with normal parallel to the third eigenvector 45

46
PCA and local normal estimation Recall that we wanted to estimate the normal at every point in a point cloud Recall that we decided to use the 12 nearest neighbors for any point q, and find a fitting plane for q and its 12 nearest neighbors q Assume we have the 3D coordinates of these points measured in meters 46

47
PCA and local normal estimation 47

48
PCA and local normal estimation 48

49
PCA and local normal estimation 49

50
PCA and local normal estimation 50

51
PCA and local normal estimation 51

52
PCA and local normal estimation When the density goes up and/or the accuracy goes down, we may need to use more than 12 nearest neighbors to observe a considerable difference in eigenvalues for points on a plane, and estimate the normal correctly 52

53
PCA and local normal estimation Example 3: Assume – the surface is a perfect plane (no curvature) – scanning is by LiDAR, with dense lines – density is 100 pt/m 2 – accuracy is 0.03 m We will find one large eigenvalue and two small ones q 53

54
PCA and local normal estimation Example 4: Assume – point q lies in a tree (leaf or thin branch) – scanning is uniform – density is 100 pt/m 2 – accuracy is 0.03 m We will find three eigenvalues that don’t differ too much (but it is rather unpredictable) 54

55
Another way for normal estimation Compute the Voronoi diagram of the points and choose the direction from each point to the furthest Voronoi vertex bounding its cell For unbounded cells, take the middle direction of the unbounded rays Need to resolve inside/outside Works in any dimension 55

56
Curvature estimation Recall: a curvature at point p exists for any direction in the tangent plane of p “The” curvature at p is the maximum occurring curvature Basic approach: fit a suitable ball or quadratic surface with p on its boundary that locally is a good fit for the point set. Then compute the curvature of the ball or surface at p 56

57
Curvature estimation Or: choose many directions in the tangent plane and fit a circle tangent to p in the plane normal to the tangent plane and a chosen direction Choose the circle with smallest radius over all directions 57

58
Summary Eigenvectors and eigenvalues are a central concept in linear algebra and generally useful Local normal estimation can be done by principal component analysis on the 12 nearest neighbors, which essentially comes down to eigenvector and eigenvalue computation of 3x3 matrices There are other methods for local normal estimation, but these are generally less reliable and may not indicate how “good” the normal is 58

59
Questions 1.Perform principal component analysis on the following four data points: (1, 3), (2, 2), (4, 2), (5, 5) [mean-center first!] 2.Estimate the normal from 5 points in 3D, namely: (0,1,1), (4,2,0), (8,5,1), (-6,-2,1), (-6,-6,-3) How clear do you think the estimated normal is? 3.Can the estimated normal always be obtained as the third eigenvector? If not, what can you do? 4.Suppose the density and accuracy suggest that you need the 100 nearest neighbors to get a good normal estimate, but you don’t want to manipulate large matrices (3 x 100) for every point, what can you do? 59

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google