The principle and realization of Harris angle point detection

Source: Internet
Author: User

First, the principle

Second, the realization

Close All;clear all;i=imread ('test.tif'); [ Posx,posy]='g*');
function [posx,posy]=Harris (I)%Harris Corner Point detection%I: Input Image%PosX: Corner point x Coordinate%PosY: Corner point y coordinate i=Double(I); [M,n]=size (I); HX=[-1,0,1;-1,0,1;-1,0,1];ix=imfilter (I,HX,'Replicate','same');%x-directional differential image iy=imfilter (I,HX','Replicate','Same');%y directional differential Imageix2=ix.^2; Iy2=iy.^2; Ixy=ix.*iy;h=fspecial ('Gaussian',3,2); Ix2=imfilter (Ix2,h,'Replicate','same');%Gaussian filter Iy2=imfilter (Iy2,h,'Replicate','same'); Ixy=imfilter (Ixy,h,'Replicate','same'); R=zeros (m,n); K=0.04;% Recommended Value (0.04--0.06) forI=1: M forj=1: N R (i,j)= (Ix2 (i,j) *iy2 (i,j)-ixy (i,j) *ixy (i,j))-k* ((Ix2 (i,j) +iy2 (i,j)) ^2);%Angular Point response value Endendt=0.1*max (R (:));%threshold to control the number of corner points returned result=zeros (m,n);% non-maximal value suppression (3*3 local maximum points greater than the threshold T in Windows are considered to be corner points) forI=2: M-1     forj=2: N-1tmp=r (I-1: i+1, J-1: j+1); TMP (2,2)=0; if(R (I,J) >t&&r (i,j) >Max (tmp (:))) result (I,J)=1; End Endend[posy,posx]=find (result);

Results:

The principle and realization of Harris angle point detection

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.