文件名称:Harris角点检测代码
文件大小:2KB
文件格式:M
更新时间:2016-12-03 05:10:59
Harris
Harris角点检测代码, function [ posr2, posc2 ] = harris(image,Thrshold ) %HARRIS Summary of this function goes here I = double(image); %% For each pixel(x,y) in the image calculate the autocorrelation matrix M %% M= [Ix2(i,j) Ixy(i,j);Ixy(i,j) Iy2(i,j)]; fx = [-1 0 1; -1 0 1; -1 0 1]; % The Mask fy = fx'; Ix = conv2(I,fx,'same'); Iy = conv2(I,fy,'same'); Ix2 = Ix.^2; Iy2 = Iy.^2; Ixy = Ix.*Iy; % figure; imshow(uint8(Ixy)); h= fspecial('gaussian',[3 3],2); % generate gaussian lowpass filter Ix2 = conv2(Ix2,h,'same'); Iy2 = conv2(Iy2,h,'same'); Ixy = conv2(Ixy,h,'same'); % figure; imshow(uint8(Ixy));