Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SPR_Implementation
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王鑫(21软)
SPR_Implementation
Commits
b464acd9
Commit
b464acd9
authored
May 16, 2022
by
王鑫(21软)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
4453d9a7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
solvesvd.m
solvesvd.m
+25
-0
No files found.
solvesvd.m
0 → 100644
View file @
b464acd9
%function: svd solve yo find T and R between point set B and it nearest neighbour set
% - Params:
% - B:initial point clouds [n,3]
% - NN: target nearest neighbour point clouds [n,3]
% - Return:
% - T:solve optimal translation matrix [1,3]
% - R:solve optimal rotation matrix [3,3]
function
[
T
,
R
]
=
solvesvd
(
B
,
NN
)
num
=
length
(
B
);
%1.Seeking centroid
cen_B
=
sum
(
B
)/
num
;
cen_NN
=
sum
(
NN
)/
num
;
%2.Decentralization:Set centroids as reference origin for both clusters
B2
=
B
-
repmat
(
cen_B
,
num
,
1
);
NN2
=
NN
-
repmat
(
cen_NN
,
num
,
1
);
%3.svd decompose:[U,S,V] = svd(A) ==> A = U*S*V'
H
=
B2
'*
NN2
;
[
U
,
~
,
V
]
=
svd
(
H
);
R
=
V
*
diag
([
1
1
sign
(
det
(
V
*
U
'))])*U'
;
T
=
cen_NN
' - R*cen_B'
;
T
=
T
'
;
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment