Contents
timestamp
fprintf(1,'Started on %s\n', datestr(now));
Started on 20-Mar-2010 05:44:31
load ease case
load('im1_harris.mat'); pts1=pts;
load('im2_harris.mat'); pts2=pts;
im1=im2double(rgb2gray(imread('img1.png')));
im2=im2double(rgb2gray(imread('img2.png')));
find tentative correspondences method mutually closest descriptions
matchpar.threshold=inf;
matchpar.method='mutual';
fprintf('Find correspondences using mutually nearest matching...\n');
tic
corr=match(pts1, pts2, matchpar);
t=toc;
fprintf('Found %d tentative correspondences in %.3f sec.\n', size(corr,2), t);
u=corr2u(pts1, pts2, corr);
Find correspondences using mutually nearest matching...
Found 375 tentative correspondences in 0.356 sec.
run RANSAC to find consistent matches
tic; [H inl]=ransac_h(u, 5, 0.99); t=toc;
fprintf('Found %d inliers %.2f percent of tentative correspondences in %.3f sec.\n', sum(inl), 100*sum(inl)/size(corr,2), t);
tic; [H inl]=ransac_h(u, 5, 0.99); t=toc;
fprintf('Found %d inliers %.2f percent of tentative correspondences in %.3f sec.\n', sum(inl), 100*sum(inl)/size(corr,2), t);
tic; [H inl]=ransac_h(u, 5, 0.99); t=toc;
fprintf('Found %d inliers %.2f percent of tentative correspondences in %.3f sec.\n', sum(inl), 100*sum(inl)/size(corr,2), t);
H=H./H(3,3)
Found 219 inliers 58.40 percent of tentative correspondences in 0.022 sec.
Found 214 inliers 57.07 percent of tentative correspondences in 0.020 sec.
Found 221 inliers 58.93 percent of tentative correspondences in 0.024 sec.
H =
0.8890 0.3032 -39.8502
-0.1698 0.9249 152.3989
0.0002 -0.0000 1.0000
load hard case
load('im1_mser.mat'); pts1=pts;
load('im2_mser.mat'); pts2=pts;
im1=im2double(rgb2gray(imread('img1.png')));
im2=im2double(rgb2gray(imread('img5.png')));
find tentative correspondences method stable closest descriptions
matchpar.threshold=inf;
matchpar.method='stable';
fprintf('\nFind correspondences using weak stable matching...\n');
tic
corr=match(pts1, pts2, matchpar);
t=toc;
fprintf('Found %d tentative correspondences in %.3f sec.\n', size(corr,2), t);
u=corr2u(pts1, pts2, corr);
Find correspondences using weak stable matching...
Found 576 tentative correspondences in 2.719 sec.
run RANSAC to find consistent matches
tic; [H inl]=ransac_h(u, 5, 0.99); t=toc;
fprintf('Found %d inliers %.2f percent of tentative correspondences in %.3f sec.\n', sum(inl), 100*sum(inl)/size(corr,2), t);
tic; [H inl]=ransac_h(u, 5, 0.99); t=toc;
fprintf('Found %d inliers %.2f percent of tentative correspondences in %.3f sec.\n', sum(inl), 100*sum(inl)/size(corr,2), t);
tic; [H inl]=ransac_h(u, 5, 0.99); t=toc;
fprintf('Found %d inliers %.2f percent of tentative correspondences in %.3f sec.\n', sum(inl), 100*sum(inl)/size(corr,2), t);
H=H./H(3,3)
showcorrs(im1,im2,u, inl);
Found 96 inliers 16.67 percent of tentative correspondences in 2.947 sec.
Found 97 inliers 16.84 percent of tentative correspondences in 2.825 sec.
Found 96 inliers 16.67 percent of tentative correspondences in 2.951 sec.
H =
0.5906 0.0415 224.1902
0.2004 1.1093 -13.9631
0.0004 -0.0001 1.0000
find tentative correspondences method stable closest descriptions
matchpar.threshold=inf;
matchpar.method='sclosest';
fprintf('\nFind correspondences using second closest matching...\n');
tic
corr=match(pts1, pts2, matchpar);
t=toc;
fprintf('Found %d tentative correspondences in %.3f sec.\n', size(corr,2), t);
u=corr2u(pts1, pts2, corr);
Find correspondences using second closest matching...
Found 121 tentative correspondences in 0.205 sec.
run RANSAC to find consistent matches
tic; [H inl]=ransac_h(u, 5, 0.99); t=toc;
fprintf('Found %d inliers %.2f percent of tentative correspondences in %.3f sec.\n', sum(inl), 100*sum(inl)/size(corr,2), t);
tic; [H inl]=ransac_h(u, 5, 0.99); t=toc;
fprintf('Found %d inliers %.2f percent of tentative correspondences in %.3f sec.\n', sum(inl), 100*sum(inl)/size(corr,2), t);
tic; [H inl]=ransac_h(u, 5, 0.99); t=toc;
fprintf('Found %d inliers %.2f percent of tentative correspondences in %.3f sec.\n', sum(inl), 100*sum(inl)/size(corr,2), t);
H=H./H(3,3)
showcorrs(im1,im2,u, inl);
Found 75 inliers 61.98 percent of tentative correspondences in 0.013 sec.
Found 76 inliers 62.81 percent of tentative correspondences in 0.012 sec.
Found 79 inliers 65.29 percent of tentative correspondences in 0.010 sec.
H =
0.6079 0.0345 221.4213
0.2147 1.0790 -11.3780
0.0005 -0.0001 1.0000
distance of inliers, can differ depending on best found H
dist=sqrt(hdist(H,u(:,inl)))
dist =
Columns 1 through 7
2.3342 2.0684 3.0328 1.7427 0.5082 0.9415 1.5506
Columns 8 through 14
1.8344 1.6365 0.8292 1.0287 2.7536 2.7348 3.6963
Columns 15 through 21
2.1536 2.4859 0.6876 2.1758 1.8044 3.6707 2.7603
...
load non planar case
load('im1f_mser.mat'); pts1=pts;
load('im2f_mser.mat'); pts2=pts;
im1=im2double(rgb2gray(imread('washA.png')));
im2=im2double(rgb2gray(imread('washB.png')));
find tentative correspondences method stable closest descriptions
matchpar.threshold=inf;
matchpar.method='sclosest';
fprintf('\nFind correspondences using second closest matching...\n');
tic
corr=match(pts1, pts2, matchpar);
t=toc;
fprintf('Found %d tentative correspondences in %.3f sec.\n', size(corr,2), t);
u=corr2u(pts1, pts2, corr);
Find correspondences using second closest matching...
Found 40 tentative correspondences in 0.034 sec.
run RANSAC to find consistent matches
tic; [F inl]=ransac_f(u, 5, 0.99); t=toc;
fprintf('Found %d inliers %.2f percent of tentative correspondences in %.3f sec.\n', sum(inl), 100*sum(inl)/size(corr,2), t);
tic; [F inl]=ransac_f(u, 5, 0.99); t=toc;
fprintf('Found %d inliers %.2f percent of tentative correspondences in %.3f sec.\n', sum(inl), 100*sum(inl)/size(corr,2), t);
tic; [F inl]=ransac_f(u, 5, 0.99); t=toc;
fprintf('Found %d inliers %.2f percent of tentative correspondences in %.3f sec.\n', sum(inl), 100*sum(inl)/size(corr,2), t);
showcorrs(im1,im2, u, inl);
Found 26 inliers 65.00 percent of tentative correspondences in 0.060 sec.
Found 25 inliers 62.50 percent of tentative correspondences in 0.079 sec.
Found 25 inliers 62.50 percent of tentative correspondences in 0.079 sec.