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


 
function crackfill=connect(crack) 
 
for y=2:size(crack,1)-2  
    for x=2:size(crack,2)-2 
        if(crack(y,x)) 
 
            %left 
            i=1; 
            while(i<=x-1) 
                if(crack(y,x-i))                     
                    i=i+1; 
                else 
                    if(crack(y,x-i-1)) 
                        crack(y,x-i)=true; 
                        break; 
                    end 
                end 
            end 
 
             
        end 
    end 
end