%提取图像破损区域,采用直接赋值法
X=imread('lena256.bmp');
figure(1);
imshow(X);
mask = imread('mask256.bmp');
figure(2);
imshow(mask);
[row,col]=size(X);
for i=1:row
for j=1:col
if mask(i,j)==0
X(i,j)=0;
end
end
end
figure(3);
imshow(X);