The Beautiful Future
estimate 3D to 3D similarity trasform 본문
참고
블로그 : http://nghiaho.com/?page_id=671
논문 : Estimating 3-D rigid body transformations: a comparison of four major algorithms
논문은 안 읽어 봄..
Covariance matrix를 SVD해서 s,R,t을 찾는 방법.(프로그램 분석)
1. A와 B의 무게중심을 각각 구한다.
2. 무게중심을 제거하면서 Cov(A,A) = Caa를 구한다.
3. 각각의 무게중심을 제거하면서 A와 B의 공분산 Cov(A,B) = Cab 를 구한다.
4. SVD( Cab) = UWVt
5. R = VUt = (UVt)t 이다.
6. s = trace(Cbb)/trace(Caa) 인데 Cbb = VWVt = VUtUWVt 이므로 Cbb = RCab 이다. Cbb를 쉽게 구할 수 있는 장점이 있다.
7. t = (B - RA)/n 이다.
블로그 내용을 정리해보면
우선 아래 논문을 참고했다고 한다.
‘A Method for Registration of 3-D Shapes’, by Besl and McKay, 1992.
R과 T만 계산을 하는데 R안에 스케일이 들어가 있을 거라 믿는다.
Where R, t are the transforms applied to A to align it with B, as best as possible.
1. Find the centroids of both A and B
2. Bring both dataset to the origin then find the optimal rotation R
3. Find translation t
Finding the centroids
Here, are points in data A and B respectively.
We will use these values in the next step.
Finding the optimal rotation
There are a few ways of finding optimal rotations between points.
The easiest way I found is using Singular Value Decomposition(SVD),
because it's a function that is widely available in many programming languages.
SVD is like this powerful magical wand in linear algebra for solving all sorts of
numeriacl problems, but tragically wasn't taught when I was at univ.
if E is a square matrix then U,S and V are the same size as well.
We're only interested in square matrices for this problem so I won't go into
detail about rectangular ones.
To find the optimal rotation, we first re-center both A and B so that
both centroids are at the origin, like shown below.
This removes the translation component, leaving on the rotation to deal with.
The next step involves accumulating a matrix, called H, and using SVD to find
the rotation as follows:
H is the familiar covariance matrix.
At this point you may be thinking, "what the, that easy?!", and indeed you would be right.
One thing to be careful is that you calculate H correctly.
It should end up being 3x3 matrix, not a 1x1 matrix.
Pay close attention to the transpose symbol.
Finding T
---------------------------------------------------------------------------------------------------
'수학' 카테고리의 다른 글
estimate 3D to 2D similarity transform (0) | 2016.09.22 |
---|---|
matlab symbolic constraint optimization problem (0) | 2016.09.21 |
Ridge Regression (0) | 2016.08.11 |
Incremental Least Square Method (0) | 2016.01.11 |
Positive Definite Matrix (0) | 2016.01.08 |