티스토리 뷰

Research (연구 관련)

Procrustes Analysis

홍돌 2019. 4. 13. 20:25

첫 공부 블로그 글.

Procrustes analysis가 이해가 안가서 찾아보다가 정리도 할 겸 적어본다. 굳이 블로그를 새로 파지 않고, 일단 꾸준히 이런 류의 글을 적어보자. 그다음에 나중에 분리하자. 어제 엄청 뒤질땐 좋은 자료가 안나오다가 오늘 위키피디아 보니까 단번에 이해가 갔다.


본론.

어제 친구할 때 말할 땐, Procrustes analysis가  '세모'를 '네모'로 align하는 것 같다고 했는데 그건 틀린 말이고,
모양이 비슷한 '세모'들을 align한다는게 맞는 표현이다.
각각의 대상이 가지는 Shape에는 translational, rotational, uniform scaling이라는 component가 있는데, 만약에 어제처럼 2개의 대상을 비교하고 싶으면 위의 3개를 제거하고 난 Euclidean distance ( = Procrustes distance)를 비교하면 된다. 만약에 둘이 Shape이 같다면 그게 0이되고.
 Procrustes analysis is a form of statistical shape analysis used to analyse the distribution of a set of shapes 
-> 참고로 Procrustes analysis의 공식적인 의미는 Shape 집합의 분포를 분석하는 방법 중 하나이다. 
https://en.wikipedia.org/wiki/Procrustes_analysis

 

Procrustes analysis - Wikipedia

Procrustes superimposition. The figure shows the three transformation steps of an ordinary Procrustes fit for two configurations of landmarks. (a) Scaling of both configurations to the same size; (b) Transposition to the same position of the center of grav

en.wikipedia.org

어떻게 하는 지 구체적인 방법은 

구체적인 PA 방법

좀 더 주목한 것은 SVD를 대체 왜쓰냐였는데, 알고보니

# Integral 코드에서 쓰이는 Procrustes analysis
def rigid_transform_3D(A, B):
    centroid_A = np.mean(A, axis = 0)
    centroid_B = np.mean(B, axis = 0)
    H = np.dot(np.transpose(A - centroid_A), B - centroid_B)
    U, s, V = np.linalg.svd(H)
    R = np.dot(np.transpose(V), np.transpose(U))
    if np.linalg.det(R) < 0:
        V[2] = -V[2]
        R = np.dot(np.transpose(V), np.transpose(U))
    t = -np.dot(R, np.transpose(centroid_A)) + np.transpose(centroid_B)
    return R, t

def rigid_align(A, B):
    R, t = rigid_transform_3D(A, B)
    A2 = np.transpose(np.dot(R, np.transpose(A))) + t
    return A2

3차원에서 Rotation Component를 Remove 하는 과정이었다.
Orthogonal Procrustes problem이라고, 
R이라는 A,B라는 Matrix를 가장 비슷하게 Mapping하는 Orthogonal matrix를 찾는 것이다. 
3차원 PA에서는 곧 Rotation Matrix를 찾는 것이고, 구체적인 방법론은 아래와 같다.


부가적인 그림과 참고한 슬라이드.

 

cse586ShapeAndPCA.pdf
5.07MB

'Research (연구 관련)' 카테고리의 다른 글

2D 이미지와 퓨리에 변환  (1) 2019.04.23
리눅스 make subdirectories  (0) 2019.04.22
리눅스 scp, find  (0) 2019.04.19
Bilateral Filter / Guidance Filter  (0) 2019.04.18
Affine Transform (아핀 변환)  (0) 2019.04.18
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/03   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
글 보관함