Image Processing Reference
In-Depth Information
%R-Table
function T=RTable(entries,inputimage)
%image size
[rows,columns]=size(inputimage);
%edges
[M,Ang]=Edges(inputimage);
M=MaxSupr(M,Ang);
%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);
%accumulator
D=pi/entries;
s=0; %number of entries in the table
t=[];
F=zeros(entries,1); %number of entries in the row
%for each edge point
for x=1:columns
for y=1:rows
if(M(y,x)~=0)
phi=Ang(y,x);
i=round((phi+(pi/2))/D);
if(i==0) i=1; end;
V=F(i)+1;
if(V>s)
s=s+1;
T(:,:,s)=zeros(entries,2);
end;
T(i,1,V)=x-xr;
T(i,2,V)=y-yr;
F(i)=F(I)+1;
end %if
end %y
end %x
Code 5.10
Implementation of the construction of the R-table
Search WWH ::




Custom Search