-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathBatchMatch.m
44 lines (35 loc) · 1.27 KB
/
BatchMatch.m
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
32
33
34
35
36
37
38
39
40
41
42
43
44
function [ Matchings ] = BatchMatch( Shapes, ind )
% BatchMatch Gets a list of loaded segmented shapes and calculated the
% matchings between all pairs of shapes using MatchShapes().
%
% Shapes = collection of shapes
% ind = the indices in the collection to compare (optional)
%
%%% If you use this code, please cite the following paper:
%
% SHED: Shape Edit Distance for Fine-grained Shape Similarity
% Yanir Kleiman, Oliver van Kaick, Olga Sorkine-Hornung, Daniel Cohen-Or
% SIGGRAPH ASIA 2015
%
%%% Copyright (c) 2015 Yanir Kleiman <yanirk@gmail.com>
if (nargin < 2)
% Default index list is whole collection:
ind = 1:length(Shapes);
end;
n = length(ind);
Matchings = cell(n);
ticID = tic;
for i=1:n
for j=i:n
% Find matching between shapes i and j:
curr_matching = MatchShapes(Shapes{ind(i)}, Shapes{ind(j)});
Matchings{i, j} = curr_matching;
Matchings{j, i} = curr_matching';
display(['Computed Matching(' num2str(i) ', ' num2str(j) ')']);
% Uncomment this to show a figure for each matching:
% ShowMatchingOneFigure(Shapes{ind(i)}, Shapes{ind(j)}, Matchings{i, j});
end;
end;
t = toc(ticID);
display(['Computed all matchings in ' num2str(t) ' seconds.']);
end