Thursday, April 30, 2015

Integral Image Algorithm

function [II] = IntegIm(A)
A=double(A);
s=double(zeros(size(A,1)+1,size(A,2)+1));
II=double(zeros(size(A,1)+1,size(A,2)+1));
for  m = 2:size(A,1)+1
    for n = 2:size(A,2)+1
   
          s(m,n)=double(s(m,n-1) + A(m-1,n-1));
   
    end
   
end
for m = 2:size(s,1)
    for n = 2:size(s,2)
     II(m,n)=double(II(m-1,n)+s(m,n));
    end
end


end

No comments:

Post a Comment