%{
设置好条纹的宽度和条纹的间隔,建立一个
遮罩层,等间隔的对原图进行等间距的遮罩。
%}
clear,clc;
[filename,pathname] = uigetfile('*.jpg;*.bmp','选择图片','E:\pictures\For_Project\Matlab');
imgaepath = strcat(pathname,filename);
image = imread(imgaepath);
Image=double(image)/255;
size_info=size(Image);
height=size_info(1);
width=size_info(2);
Map=zeros(height, width);
for row_i=1:height
Map(row_i, :)=1-row_i/height;
end
imshow(Map);
H_shade=10;
Interval=5;
Num=height/(H_shade+Interval);
Num=floor(Num);
mask=ones(height, width);
for j=1:Num+1
if(j<=Num)
begin_1=1+(j-1)*(H_shade+Interval);
mask(begin_1:begin_1+H_shade-1,:)=0;
else
begin_1=1+Num*(H_shade+Interval);
mask(begin_1:height, :)=0;
end
end
figure(2), imshow(mask);
for kk=1:3
Image(:,:,kk)=Image(:,:,kk).*(1-mask)+Map.*mask;
end
figure(3), imshow(Image);
figure(1),imshow((image));
%{
设置好条纹的宽度和条纹的间隔,建立一个
遮罩层,等间隔的对原图进行等间距的遮罩。
%}
clear,clc;
[filename,pathname] = uigetfile('*.jpg;*.bmp','选择图片','E:\pictures\For_Project\Matlab');
imgaepath = strcat(pathname,filename);
image = imread(imgaepath);
figure,imshow(image);
Image = image;
Image=double(Image);
Image_new=Image;
Image_new(:,:,1)=0.393*Image(:,:,1)+0.769*Image(:,:,2)+0.189*Image(:,:,3);
Image_new(:,:,2)=0.349*Image(:,:,1)+0.686*Image(:,:,2)+0.168*Image(:,:,3);
Image_new(:,:,3)=0.272*Image(:,:,1)+0.534*Image(:,:,2)+0.131*Image(:,:,3);
figure,imshow(Image_new/255);