500 likes | 3.13k Views
Saturday Graduates Workshop @ Institute of Systems Engineering, Nanjing. Moravec Corner Detector. Presented by Shicai Yang Dec. 19 th , 2009. Institute of Systems Engineering, Southeast University, Nanjing 211189. Moravec Corner Detector. Hans Moravec (CMU), 1977, 5 th IJCAI
E N D
Saturday Graduates Workshop @ Institute of Systems Engineering, Nanjing Moravec Corner Detector Presented by Shicai Yang Dec. 19th, 2009 Institute of Systems Engineering, Southeast University, Nanjing 211189
Moravec Corner Detector • Hans Moravec (CMU), 1977, 5th IJCAI • One of the earliest corner detection algorithms • defines a corner to be a point with low self-similarity. • tests each pixel in the image to see if a corner is present • the similarity is measured by taking the sum of squared differences (SSD) between the two patches. • A lower number indicates more similarity. on an edge: perpendicular parallel In a region with variation in all directions Institute of Systems Engineering, Southeast University, Nanjing
Steps • Consider interest points as points where there is a large intensity variation in every direction • Measure the intensity variation • placing a small square window centered at P • shifting this window by one pixel in each of the eight principle directions • taking the SSD of corresponding pixels in these two windows as the intensity variation • Pixels which exceed a threshold(locally maximal) are then chosen Institute of Systems Engineering, Southeast University, Nanjing
25 overlapping windows A typical interest operator window, and the four sums calculated over it (PI,J are the pixel brightness). The interest measure of the window is the minimum of the four sums. Institute of Systems Engineering, Southeast University, Nanjing
Moravec corner detector • Four shifts: (u,v) = (1,0), (1,1), (0,1), (-1, 1) • Look for local maxima in min{E} intensity shifted intensity windows function Institute of Systems Engineering, Southeast University, Nanjing
3×3 window Institute of Systems Engineering, Southeast University, Nanjing
Examples Origin Image (6x7) Corner points Local Maxima of each pixel Institute of Systems Engineering, Southeast University, Nanjing
12x12 origin image corner points Institute of Systems Engineering, Southeast University, Nanjing
Matlab Implementation clc; clear; close all; tic; img = imread('3.bmp'); % img = rgb2gray(img); img = Norma(double(img)); % or: im2double T = 0.01; corner = moravecCorner(img, T); figure, imshow(img, []); hold on for m = 1 : size(corner, 1) plot(corner(m, 2), corner(m, 1), '-r.'); end t=toc; disp([‘Time cost is',num2str(t),‘s.']) N=3; I=imread('4.bmp'); I=im2double(I); hh = ones(1,N); % Moravec horizontal (1xN) window dd = eye(N); uh = (1/N)*imfilter(I, hh); % mean of horizontal Isq = I .^ 2; u2h = (1/N)*imfilter(Isq, hh); % mean of squares varh = u2h - uh.^2; % variance of horizontal % Similarly, calculate varv ud = (1/N)*imfilter(I, dd); % mean of d u2d = (1/N)*imfilter(Isq, dd); % mean of squares vard = u2d - ud.^2; % variance of d % Similarly, calculate vara imshow(varh); figure,imshow(varv); figure,imshow(vard); figure,imshow(vara); % then calculate min var{h,v,d,a} function out = moravecCorner(im, thresh) I = zeros(size(im, 1), size(im, 2), 4); for m = 2 : size(im, 1) - 1 for n = 2 : size(im, 2) - 1 [I(m, n, 1),I(m, n, 2),I(m, n, 3),I(m, n, 4)] = calculateALL(im, m, n); end end minI = abs(min(I, [], 3)); I1 = ordfilt2(minI, 11 * 11, ones(11, 11)); temp = zeros(size(I, 1), size(I, 2)); I1 = (I1 == minI)&(minI > thresh); [r, c] = find(I1); out = [r, c]; Institute of Systems Engineering, Southeast University, Nanjing
T=0.001 T=0.05 T=0.01 Institute of Systems Engineering, Southeast University, Nanjing
Institute of Systems Engineering, Southeast University, Nanjing
Problems of Moravec detector • Noisy response due to a binary window function • Only a set of shifts at every 45 degree is considered • Only minimum of E is taken into account Institute of Systems Engineering, Southeast University, Nanjing