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
3dcb82e7
Commit
3dcb82e7
authored
May 16, 2022
by
王鑫(21软)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
4e0a71a1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
main.m
main.m
+36
-0
No files found.
main.m
0 → 100644
View file @
3dcb82e7
%Program entry script
close
all
;
clear
;
clc
;
%1.Import and replace 3-D point clouds: model_clouds is the geometric model, original_clouds is sensor measurements
model_clouds
=
dlmread
(
'santan_B.txt'
);
initial_clouds
=
dlmread
(
'santan_A.txt'
);
initial_clouds
(:,
3
)
=
initial_clouds
(:,
3
)
-
1000
;
%2.Randomly generated test sparse point cloud
%id = randi([1,length(model_clouds)],1,30);
%original_clouds = model_clouds(1:30,:);
%original_clouds = model_clouds(id,:);
%3.Randomly rotate and move point cloud original_clouds to obtain the test data to be registered
%[initial_clouds, r_true, t_true] = randtrans(original_clouds);
%r_true = r_true';
%t_true = -t_true;
%r_true
%t_true
%4.SPR solve
%R_ans and T_ans are the resultant rotation and translation to register initial_clouds to model_clouds
[
R_res
,
T_res
,
res_clouds
]
=
SPR
(
initial_clouds
,
model_clouds
);
%output R,T
R_res
T_res
%5. Visualize
figure
scatter3
(
model_clouds
(:,
1
),
model_clouds
(:,
2
),
model_clouds
(:,
3
),
'.r'
)
hold
on
scatter3
(
initial_clouds
(:,
1
),
initial_clouds
(:,
2
),
initial_clouds
(:,
3
),
'b'
,
'fill'
)
scatter3
(
res_clouds
(:,
1
),
res_clouds
(:,
2
),
res_clouds
(:,
3
),
'k'
,
'fill'
)
axis
equal
\ No newline at end of file
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