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


 
for i=2:5 
 
% texref=imread('..\data\web\chessRGB.jpg'); 
% dmref=imread('..\data\web\\chessDM.jpg'); 
 
% texref=imread('..\data\wedding\color\027.bmp'); 
% dmref=imread('..\data\wedding\depth\027_DM.png'); 
 
% texref=imread(['..\..\data\hb\color\',num2str(i,'%02d'),'.png']); 
% dmref=imread(['..\..\data\hb\depth\',num2str(i,'%02d'),'.png']); 
 
% texref=imread(['..\data\gb\color\',num2str(i,'%03d'),'.png']); 
% dmref=imread(['..\data\gb\depth\',num2str(i,'%03d'),'.png']); 
 
% texref=imread('..\data\breakdancer\color-cam3-f000.bmp'); 
% dmref=imread('..\data\breakdancer\depth-cam3-f000.bmp'); 
 
texref=imread(['..\..\data\88\color\',num2str(i,'%03d'),'.jpg']); 
dmref=imread(['..\..\data\88\depth\',num2str(i,'%03d'),'.bmp']); 
 
%========================================================= 
 
% H = fspecial('gaussian',[50,50],4) ; 
% dmref = imfilter(dmref,H,'replicate'); 
%  
% imwrite(texref,'..\result\texref.bmp'); 
% imwrite(dmref,'..\result\dmref.bmp'); 
 
%========================================================= 
 
% hdmap=hd(dmref); 
% imwrite(hdmap,'..\result\hdmap.bmp'); 
 
%========================================================= 
 
warping=warp(texref,dmref); 
 
imwrite(warping.tex_warped_left,'..\result\texwarpL.bmp'); 
imwrite(warping.tex_warped_right,'..\result\texwarpR.bmp'); 
imwrite(warping.dm_warped_left,'..\result\dmwarpL.bmp'); 
imwrite(warping.dm_warped_right,'..\result\dmwarpR.bmp'); 
imwrite(warping.crack_map_left,'..\result\crackL.bmp'); 
imwrite(warping.crack_map_right,'..\result\crackR.bmp'); 
 
%========================================================= 
 
crack_filling=crack_fill('left',texref,dmref,... 
    warping.tex_warped_left,warping.dm_warped_left,... 
    warping.crack_map_left,warping.dp_warped_left); 
 
imwrite(crack_filling.tex_filled,'..\result\texfillL.bmp'); 
imwrite(crack_filling.dm_filled,'..\result\dmfillL.bmp'); 
imwrite(crack_filling.crack_filled,'..\result\crackfillL.bmp'); 
 
inpainting=inpaint( crack_filling.tex_filled,... 
                    crack_filling.dm_filled,... 
                    crack_filling.crack_filled); 
 
imwrite(inpainting,['..\result\inpaintL_',num2str(i,'%03d'),'.jpg']); 
 
%--------------------------------------------------------- 
 
crack_filling=crack_fill('right',texref,dmref,... 
    warping.tex_warped_right,warping.dm_warped_right,... 
    warping.crack_map_right, warping.dp_warped_right); 
 
imwrite(crack_filling.tex_filled,'..\result\texfillR.bmp'); 
imwrite(crack_filling.dm_filled,'..\result\dmfillR.bmp'); 
imwrite(crack_filling.crack_filled,'..\result\crackfillR.bmp'); 
 
inpainting=inpaint( crack_filling.tex_filled,... 
                    crack_filling.dm_filled,... 
                    crack_filling.crack_filled); 
 
imwrite(inpainting,['..\result\inpaintR_',num2str(i,'%03d'),'.jpg']); 
 
%========================================================= 
 
end