presented by shicai yang dec. 19 th, 2009 moravec corner detector saturday graduates workshop @...

12
Presented by Shicai Yang Dec. 19 th , 2009 Moravec Corner Detector Saturday Graduates Workshop @ Institute of Systems Engineering, Nanjing Institute of Systems Engineering, Southeast University, Nanjing 211189

Post on 19-Dec-2015

216 views

Category:

Documents


15 download

TRANSCRIPT

Page 1: Presented by Shicai Yang Dec. 19 th, 2009 Moravec Corner Detector Saturday Graduates Workshop @ Institute of Systems Engineering, Nanjing Institute of

Presented by Shicai Yang

Dec. 19th, 2009

Moravec Corner Detector

Saturday Graduates Workshop @ Institute of Systems Engineering, Nanjing

Institute of Systems Engineering, Southeast University, Nanjing 211189

Page 2: Presented by Shicai Yang Dec. 19 th, 2009 Moravec Corner Detector Saturday Graduates Workshop @ Institute of Systems Engineering, Nanjing Institute of

Moravec Corner Detector

23/4/18Institute of Systems Engineering, Southeast University, Nanjing2

Hans Moravec (CMU), 1977, 5th IJCAIOne 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 presentthe similarity is measured by taking the sum of squared

differences (SSD) between the two patches. A lower number indicates more similarity.

In a region

on an edge:perpendicularparallel with variation in

all directions

Page 3: Presented by Shicai Yang Dec. 19 th, 2009 Moravec Corner Detector Saturday Graduates Workshop @ Institute of Systems Engineering, Nanjing Institute of

Steps

23/4/18Institute of Systems Engineering, Southeast University, Nanjing3

Consider interest points as points where there is a large intensity variation in every direction

Measure the intensity variationplacing a small square window centered at Pshifting this window by one pixel in each of the eight

principle directionstaking the SSD of corresponding pixels in these two

windows as the intensity variation Pixels which exceed a threshold(locally maximal)

are then chosen

Page 4: Presented by Shicai Yang Dec. 19 th, 2009 Moravec Corner Detector Saturday Graduates Workshop @ Institute of Systems Engineering, Nanjing Institute of

23/4/18Institute of Systems Engineering, Southeast University, Nanjing4

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.

25 overlapping windows

Page 5: Presented by Shicai Yang Dec. 19 th, 2009 Moravec Corner Detector Saturday Graduates Workshop @ Institute of Systems Engineering, Nanjing Institute of

Moravec corner detector

23/4/18Institute of Systems Engineering, Southeast University, Nanjing5

Four shifts: (u,v) = (1,0), (1,1), (0,1), (-1, 1)Look for local maxima in min{E}

2

,( , ) ( , )[ ( , ) ( , )]

x yE u v w x y I x u y v I x y

windows function shifted intensity intensity

Page 6: Presented by Shicai Yang Dec. 19 th, 2009 Moravec Corner Detector Saturday Graduates Workshop @ Institute of Systems Engineering, Nanjing Institute of

3×3 window

23/4/18Institute of Systems Engineering, Southeast University, Nanjing6

Page 7: Presented by Shicai Yang Dec. 19 th, 2009 Moravec Corner Detector Saturday Graduates Workshop @ Institute of Systems Engineering, Nanjing Institute of

Examples

23/4/18Institute of Systems Engineering, Southeast University, Nanjing7

Origin Image (6x7)

Local Maxima of each pixel

Corner points

Page 8: Presented by Shicai Yang Dec. 19 th, 2009 Moravec Corner Detector Saturday Graduates Workshop @ Institute of Systems Engineering, Nanjing Institute of

23/4/18Institute of Systems Engineering, Southeast University, Nanjing8

2 4 6 8 10 12

2

4

6

8

10

12

0

5

10

15

0

5

10

150

0.5

1

1.5

2

12x12 origin image corner points

Page 9: Presented by Shicai Yang Dec. 19 th, 2009 Moravec Corner Detector Saturday Graduates Workshop @ Institute of Systems Engineering, Nanjing Institute of

Matlab Implementation

23/4/18Institute of Systems Engineering, Southeast University, Nanjing9

N=3; I=imread('4.bmp'); I=im2double(I);hh = ones(1,N); % Moravec horizontal (1xN) windowdd = 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}

clc; clear; close all; tic;img = imread('3.bmp'); % img = rgb2gray(img);img = Norma(double(img)); % or: im2doubleT = 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.');endt=toc; disp([‘Time cost is',num2str(t),‘s.'])

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); endendminI = 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];

Page 10: Presented by Shicai Yang Dec. 19 th, 2009 Moravec Corner Detector Saturday Graduates Workshop @ Institute of Systems Engineering, Nanjing Institute of

23/4/18Institute of Systems Engineering, Southeast University, Nanjing10T=0.001 T=0.05 T=0.01

Page 11: Presented by Shicai Yang Dec. 19 th, 2009 Moravec Corner Detector Saturday Graduates Workshop @ Institute of Systems Engineering, Nanjing Institute of

23/4/18Institute of Systems Engineering, Southeast University, Nanjing11

Page 12: Presented by Shicai Yang Dec. 19 th, 2009 Moravec Corner Detector Saturday Graduates Workshop @ Institute of Systems Engineering, Nanjing Institute of

Problems of Moravec detector

23/4/18Institute of Systems Engineering, Southeast University, Nanjing12

Noisy response due to a binary window functionOnly a set of shifts at every 45 degree is consideredOnly minimum of E is taken into account