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

% desc:       
%   I classify pixels which don't have value to two category, 
%   one is "crack", which one pixel wide and caused by sample. 
%   Another is "hole", caused by disocclusion, may be grouped 
%   in large area. 
%   The crack was caused by sampling, so we can do inverse 
%   warping to retrieve the value. (implement in this .m file) 
%   The hole was cause by disocclusion, there has no information 
%   at that area. Inverse warping can't retrieve a value which 
%   not exist, so we do inpainting to inpaint these area. 
%   (implement in inpaint.m) 
function result=crack_fill(view,texref,dmref,texwarp,dmwarp,crack,dpwarp) 
% do median filter to warped depth map (3x3) 
for y=2:size(dmwarp,1)-1  
    for x=2:size(dmwarp,2)-1 
        if(crack(y,x) && m(y,x)~=dmwarp(y,x)) 
            % the crack lack of texture, depth and disparity, 
            % so I suppose the crack was one pixel width 
            % and the left and right pixels weren't cracks, 
            % then I get the disparity of this crack from it's 
            % neighbor. 
            % Disparity : disparity of this crack (warped view coord)  
            if(strcmp('left',view) && x-Disparity < size(texref,2) && x-Disparity>=1) 
                texwarp(y,x,:)=texref(y,x- Disparity,:); 
                dmwarp(y,x)=dmref(y,x- Disparity); 
            elseif(strcmp('right',view) && x+Disparity < size(texref,2) && x+Disparity>=1) 
                texwarp(y,x,:)=texref(y,x+ Disparity,:); 
                dmwarp(y,x)=dmref(y,x+ Disparity); 
result=struct(  'tex_filled',texwarp,...