91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

該代碼實現了圖像的濾波處理,這段代碼給出了三種濾波矩陣,包括圖像平滑(低通濾波器)、圖像邊緣提取(高通濾波器)等。用戶下載后可以根據自己需要修改濾波矩陣和參數值,以便實現特殊的功能。為了形象的說明濾波效果,代碼執行后可以看到濾波前后濾波后的對比圖像。

資源截圖

代碼片段和文件信息

clc;
clear?all;
close?all;

FLAG=input(‘\nWhich?filter?do?you?prefer?\n1??1/9*[111;111;111]\n2??1/24*[1-21;-212-2;1-21]\n3??1/24*[-1-2-1;-212-2;-1-2-1]\n(Please?input?1?or?2?or?3)\n‘);

%%%%%%%%%%%%%%%%%%%%%%%
%%%??Image?Reading??%%%
%%%%%%%%%%%%%%%%%%%%%%%
%F?indicate?filter?matrixchange?F?can?get?varaious?filtered?images
if?FLAG==1
????F=1/9*[111;111;111];
end
if?FLAG==2
????F=1/24*[1-21;-212-2;1-21];
end
if?FLAG==3
????F=1/24*[-1-2-1;-212-2;-1-2-1];
end
I0=imread(‘yourimage.jpg‘);
I=rgb2gray(I0);?%Convert?rgb?image?I0?to?8-bit?grayscale?image?and?I?indicate?the?gray?image
J0=double(I);
J=J0;?%J?indicate?filtered?image

%%%%%%%%%%%%%%%%%%%%%%%
%%%?Prearrangement??%%%
%%%%%%%%%%%%%%%%%%%%%%%
[IheightIwidth]=size(I);?%Size?of?the?gray?image
[FheightFwidth]=size(F);?%Size?of?the?filter?matrix
remheight=mod(Fheight2);
remwidth=mod(Fwidth2);
if?remheight==0
????Fhalfheight=(Fheight/2)-1;?%i.e.?if?Fheight=4?then?Fhalfheight=1
????Fheight_mark=Iheight-Fhalfheight-1;?%This?is?the?maximun?of?m?if?the?filter?center?is?(mn)
????Hfilter_mark=Fhalfheight+1;?%This?is?the?maximun?increment?of?m?when?implementing?the?filtering?
else
????Fhalfheight=(Fheight-1)/2;?%i.e.?if?Fheight=3?then?Fhalfheight=1
????Fheight_mark=Iheight-Fhalfheight;?%This?is?the?maximun?of?m?if?the?filter?center?is?(mn)
????Hfilter_mark=Fhalfheight;?%This?is?the?maximun?increment?of?m?when?implementing?the?filtering?
end
if?remwidt

評論

共有 條評論