<< NL_V_MRA NL_V: Vision NL_V_MoravecFilter >>

NARVAL >> NL_V: Vision > NL_V_Moravec

NL_V_Moravec

Perform the Moravec corner detection algorithm on an image.

Calling Sequence

[C] = NL_V_Moravec(I,W)

Arguments

I :

Binary matrix.

W :

Kernel width.

C :

Corner matrix.

Description

NL_V_Moravec performs the Moravec corner detection algorithm on the binary image I (WIKIPEDIA). The kernel size W is an input parameter. This is one of the earliest corner detection algorithms and defines a corner to be a point with low self-similarity. The algorithm tests each pixel in the image to see if a corner is present, by considering how similar a patch centered on the pixel is to nearby, largely overlapping patches. The similarity is measured by taking the sum of squared differences (SSD) between the two patches. A lower number indicates more similarity. If the pixel is in a region of uniform intensity, then the nearby patches will look similar. If the pixel is on an edge, then nearby patches in a direction perpendicular to the edge will look quite different, but nearby patches in a direction parallel to the edge will result only in a small change. If the pixel is on a feature with variation in all directions, then none of the nearby patches will look similar. The corner strength is defined as the smallest SSD between the patch and its neighbors (horizontal, vertical and on the two diagonals). If this number is locally maximal, then a feature of interest is present. As pointed out by Moravec, one of the main problems with this operator is that it is not isotropic: if an edge is present that is not in the direction of the neighbours, then it will not be detected as an interest point.

Examples

dt=getdate();
seed=dt(10);
rand('seed',seed);//initialization of the random values generator
no=4;//quantity of obstacles (rectangle)
L=1000;//squared area side
hm=100;//minimal height
hM=250;//maximal height
wm=100;//minimal width
wM=250;//maximal width
Al=[0 %pi/2 %pi -%pi/2];//available angles for obstacles
[Xs,Ys,X,Y,H,W,A]=NL_V_RectanglesCorners(no,L,hm,hM,wm,wM);//generation of obstacles
[P]=NL_V_PotentialRectangles(X,Y,H,W,A,L);//generation of obstacle matrix
z=10;//zoom factor
o=2;// 1=mean, 2=max, 3=min, 4=median
Pz=NL_V_MRA(P,z,o);//scale modification
[Pzx,Pzy]=size(Pz);//image size
w1=1;//window index
w2=2;//window index
scf(w1);
clf(w1);
grayplot(1:Pzx,1:Pzy,Pz);//graph visualization
xset("colormap",graycolormap(128));
scf(w2);
clf(w2);
[PEz]=NL_V_Erosion(Pz);//contour performance
Cont=Pz-PEz;//contour 1
[Contx,Conty]=size(Cont);//image size
grayplot(1:Contx,1:Conty,Cont);//graph visualization
xset("colormap",graycolormap(128));
w3=3;//window index
scf(w3);
clf(w3);
wm=3;//kernel width
[cornerz]=NL_V_Moravec(Pz,wm)//application of NL_V_Moravec
[cornerzx,cornerzy]=size(cornerz);//image size
grayplot(1:cornerzx,1:cornerzy,cornerz);//graph visualization
xset("colormap",graycolormap(128));

Report an issue
<< NL_V_MRA NL_V: Vision NL_V_MoravecFilter >>