Image Processing Reference
In-Depth Information
%Invariant R-Table
function T=RTableInv(entries,inputimage)
%image size
[rows,columns]=size(inputimage);
%edges
[M,Ang]=Edges(inputimage);
M=MaxSupr(M,Ang);
alfa=pi/4;
D=pi/entries;
s=0; %number of entries in the table
t=0;
F=zeros(entries,1); %number of entries in the row
%compute reference point
xr=0; yr=0; p=0;
for x=1:columns
for y=1:rows
if(M(y,x)~=0)
xr=xr+x;
yr=yr+y;
p=p+1;
end
end
end
xr=round(xr/p);
yr=round(yr/p);
%for each edge point
for x=1:columns
for y=1:rows
if(M(y,x)~=0)
%search for the second point
x1=-1; y1=-1;
phi=Ang(y,x);
m=tan(phi-alfa);
if(m>-1 & m<1)
for i=3:columns
c=x+i;
j=round(m*(c-x)+y);
if(j>0 & j<rows & c>0 & c<columns & M(j,c)~=0)
x1=c; y1=j;
i=columns;
end
c=x-i;
j=round(m*(c-x)+y);
if(j>0 & j<rows & c>0 & c<columns & M(j,c)~=0)
x1=c; y1=j;
i=columns;
end
end
Search WWH ::




Custom Search