summaryrefslogtreecommitdiffstats
path: root/SD-VBS/benchmarks/stitch/src/matlab/harris.m
diff options
context:
space:
mode:
Diffstat (limited to 'SD-VBS/benchmarks/stitch/src/matlab/harris.m')
-rwxr-xr-xSD-VBS/benchmarks/stitch/src/matlab/harris.m37
1 files changed, 0 insertions, 37 deletions
diff --git a/SD-VBS/benchmarks/stitch/src/matlab/harris.m b/SD-VBS/benchmarks/stitch/src/matlab/harris.m
deleted file mode 100755
index 423330e..0000000
--- a/SD-VBS/benchmarks/stitch/src/matlab/harris.m
+++ /dev/null
@@ -1,37 +0,0 @@
1
2% Sample code for detecting Harris corners, following
3% Brown et al, CVPR 2005
4% by Alyosha Efros, so probably buggy...
5
6function [x,y,v] = harris(im, dataDir);
7
8g1 = [1,4,6,4,1; 4,16,24,16,4;6,24,36,24,6;4,16,24,16,4;1,4,6,4,1]/256;
9g2 = [1,2,1;2,4,2;1,2,1]/16;
10
11img1 = conv2(im,g1,'same'); % blur image with sigma_d
12
13Ix = conv2(img1,[-0.5 0 0.5],'same'); % take x derivative
14Iy = conv2(img1,[-0.5;0;0.5],'same'); % take y derivative
15
16% Compute elements of the Harris matrix H
17%%% we can use blur instead of the summing window
18Ix2 = conv2(Ix.*Ix,g2,'same');
19Iy2 = conv2(Iy.*Iy,g2,'same');
20IxIy = conv2(Ix.*Iy,g2,'same');
21
22R = (Ix2.*Iy2 - IxIy.*IxIy) ... % det(H)
23 ./ (Ix2 + Iy2 + eps); % trace(H) + epsilon
24
25% don't want corners close to image border
26[rows, cols] = size(im);
27
28% non-maxima supression within 3x3 windows
29nonmax = inline('max(x)');
30Rmax = colfilt(R,[3 3],'sliding',nonmax); % find neighbrhood max
31Rnm = R.*(R == Rmax); % supress non-max
32
33% extract all interest points
34[y,x,v] = find(Rnm);
35
36
37