<< NARVAL_IP_SpaceZoom NARVAL NARVAL_IP_Zoom >>

NARVAL >> NARVAL > NARVAL_IP_VisGraph

NARVAL_IP_VisGraph

Perform the visibility graph of a set of obstacles.

Calling Sequence

[g] = NARVAL_IP_VisGraph(xs,ys,ns,Pz)

Parameters

xs :

x-coordinate of corners.

ys :

y-coordinate of corners.

ns :

quantity of corners per object

Pz :

obstacles matrix.

g :

visibility graph.

Description

NARVAL_IP_VisGraph performs the visibility graph g of the set of obstacles defined by the presence matrix Pz (1:obstacle, 0:empty) (WIKIPEDIA). Corners coordinates are stored in [xs,ys]. ns provides the number of corners for each obstacle.

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]=NARVAL_IP_RectObstacles(no,L,hm,hM,wm,wM);//generation of obstacles
[P]=NARVAL_IP_PotentialRot(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=NARVAL_IP_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]=NARVAL_IP_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);
[Dim]=NARVAL_IP_DistanceMap(Pz,Cont);//creation of the distance map
[Dimx,Dimy]=size(Dim);//image size
grayplot(1:Dimx,1:Dimy,Dim);//graph visualization
xset("colormap",graycolormap(128));
HL1=[0 -1 0;-1 4 -1;0 -1 0];//kernel 1
HL2=[-1 -1 -1;-1 8 -1;-1 -1 -1];//kernel 2
[Dim1]=NARVAL_IP_Conv2(Dim,HL2);
[Dim1x,Dim1y]=size(Dim1);//image size
w4=4;
scf(w4);
clf(w4);
grayplot(1:Dim1x,1:Dim1y,Dim1);//graph visualization
xset("colormap",graycolormap(128));
wm=3;//kernel size
[cornerz]=NARVAL_IP_Moravec(Pz,wm);//corner detection
T=(max(cornerz)+min(cornerz))/2;//threshold
[cornerT]=NARVAL_IP_MoravecT(cornerz,T);//remove false detection
[cornerTx,cornerTy]=size(cornerT);//image size
w5=5;//window index
scf(w5);
clf(w5);
grayplot(1:L/z,1:L/z,cornerT);//graph visualization
xset("colormap",graycolormap(128));
[x,y,direction,n]=NARVAL_IP_ObstCorners(Cont);//Corners detection
lc=2;parameters
DT=3;
Tcorel=1;
Tgrad=1;
[xs,ys,ns]=NARVAL_IP_ObstCornersDet(x,y,direction,n,lc,Tcorel,Tgrad,DT);//remove false detections
mO=100000;
[U]=NARVAL_IP_PotentialPath(Pz,mO);//performance of the potential field
[lpz,cpz]=size(Pz)
x=2;//origine
y=2;
xg=lpz-1;//destination: first diagonal
yg=cpz-1;
[px,py]=NARVAL_IP_PotentialPathP(x,y,xg,yg,U);//application of NARVAL_IP_PotentialPathP
PPl=Pz;
for kk=1:length(px)
PPl(px(kk),py(kk))=2;
end
w6=6;//window index
scf(w6);
clf(w6);
grayplot(1:lpz,1:lpz,PPl);//graph visualization
xset("colormap",graycolormap(128));
w7=7;//window index
scf(w7);
clf(w7);
[lC,cC]=size(Cont);//image size
Imcont=zeros(lC,cC);
for k=1:length(xs)
Imcont(xs(k),ys(k))=1;
end
grayplot(1:L/z,1:L/z,Imcont);//graph visualization
xset("colormap",graycolormap(128));
[g]=NARVAL_IP_VisGraph(xs,ys,ns,Pz);//application of NARVAL_IP_VisGraph 
w8=8;//window index
g.node_x=g.node_x*z;
g.node_y=g.node_y*z;
NARVAL_G_ShowGraph(g,w8);//graph visualization

Authors

Foued Melakessou

Contact

Dr. Foued Melakessou

Research Associate

Interdisciplinary Centre for Security, Reliability and Trust

Room F106

University of Luxembourg

6, rue Coudenhove Kalergi

L-1359 Luxembourg-Kirchberg

E-mail: foued.melakessou@uni.lu

Tel: (+352) 46 66 44 5346

Home Page


<< NARVAL_IP_SpaceZoom NARVAL NARVAL_IP_Zoom >>