www.pudn.com > src.rar > hd.m, change:2010-07-20,size:443b


 
function hdmap=hd(dmref) 
 
hdmap=boolean(zeros(size(dmref,1),size(dmref,2))); 
 
threshold=80; 
 
for y=2:size(dmref,1)-1  
    for x=2:size(dmref,2)-1 
         
        sum=0; 
         
        for i=-1:1 
            for j=-1:1 
                sum=sum+ dmref(y+j, x+i); 
            end 
        end 
         
        sum=sum-9*dmref(y, x); 
         
        if(sum>threshold) 
            hdmap(y,x)=true; 
        end 
    end 
end