forked from StaRainJ/mTopKRP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDemo.m
64 lines (54 loc) · 1.4 KB
/
Demo.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
%% This is a demo for removing outliers Using mTopKRP.
% Edit by: Xingyu Jiang
% Date: 04/12/2018
%%
clear;
close all;
initialization; %run it only at the first time
addpath('data');
%% Inpute Data
tt= 62 ;
Ia = imread([num2str(tt),'_l.jpg']);
Ib = imread([num2str(tt),'_r.jpg']);
load('Top62.mat');
%% data align
[Ia,Ib] = imageAlign(Ia,Ib);
[numx1,numx2] = size(X);
Num=numx1;
if numx1<numx2
X=X';Y=Y';
Num=numx2;
end
Xt = X';Yt = Y';
tic
%%
% idxRepeat=removeRepeat(Num,X,Y,CorrectIndex); %% ÌÞ³ýÖظ´Æ¥Åä
idxUnique=1:Num;
%% Parameters Setting
tic
tau1 = 0.80; numNeigh1 = 15;
tau2 = 0.35; numNeigh2 = 15;
tau3 = 0.35; numNeigh3 = 15;
% tau4 = 0.35; numNeigh4 = 10;
conf=[];
conf.iteration = 3;
conf.scale = 3;
conf.interval = 2;
conf.Num = Num;
%% iteration1
Idx = GetCorectIdx(Xt,Yt,numNeigh1,tau1, conf,idxUnique);
%% iteration2
if conf.iteration>=2
Idx = GetCorectIdx(Xt,Yt,numNeigh2,tau2, conf,Idx);
end
%% iteration3
if conf.iteration>=3
Idx = GetCorectIdx(Xt,Yt,numNeigh3,tau3, conf,Idx);
end
%% Measurement
toc
ind = Idx;
[pr,re,f_1] = evaluate(ind,CorrectIndex,Num)
%% PLOT results
[FP,FN] = plot_matches(Ia, Ib, X, Y, ind, CorrectIndex);
plot_4c(Ia, Ib, X, Y, ind, CorrectIndex);