淘先锋技术网

首页 1 2 3 4 5 6 7

%提取图像破损区域,采用直接赋值法

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);

转载于:https://www.cnblogs.com/ggYYa/p/4127802.html