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

  • 大小: 2KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-29
  • 語言: Matlab
  • 標簽:

資源簡介

幾個小程序,對圖像做一些簡單處理,有數字圖像處理課程的或相關初學者可以了解一下。MATLAB的.m文件,可直接運行。

資源截圖

代碼片段和文件信息

clc;clear?all;
I=imread(‘C:\Users\Administrator\Desktop\4.jpg‘);
figure(‘name‘‘頻率域濾波增強及圖像的二值分析‘);
%%?part1?圖像的膨脹與腐蝕
subplot(231)imshow(I)
title(‘原圖像‘)

se=strel(‘disk‘1);????????????????????????????%生成圓形結構元素
I1=imdilate(Ise);?????????????????????????????%用生成的結構元素對圖像進行膨脹
subplot(232);
imshow(I1);
title(‘膨脹后圖像‘);
se=strel(‘disk‘1);????????????????????????????%生成圓形結構元素
I2=imerode(Ise);??????????????????????????????%用生成的結構元素對圖像進行腐蝕
subplot(233);
imshow(I2);
title(‘腐蝕后圖像‘);
%%?part2?噪聲圖像的頻率濾波
I=rgb2gray(I);
I3=imnoise(I‘gaussian‘0.02);
subplot(234)imshow(I3)
title(‘加入高斯噪聲后‘)

f=double(I3);
g=fft2(f);
g=fftshift(g);?????????????????????????????????%把圖像從空間域轉換到頻率域
[N1N2]=size(g);?????
d0=50;
n1=fix(N1/2);
n2=fix(N2/2);??????????????????????????????????%取整(不四舍五入)

n=3;???????????????????????????????????????????%3階butterworth濾波器
for?i=1:N1
????for?j=1:N2
????????d=sqrt((i-n1)^2+(j-n2)^2);
????????h=1/(1+0.414*(d/d0)^(2*n));????????????%計算傳遞函數
????????result(ij)=h*g(ij);
??end
end
result=ifftshift(result);
X2=ifft2(result);
X3=uint8(real(X2));
subplot(235)imshow(X3)
title(‘butterworth低通濾波‘)


for?i=1:N1
????for?j=1:N2
????????d=sqrt((i-n1)^2+(j-n2)^2);
????????if?d<=0????????????????????????????????%高斯高通濾波
????????????h=0;
????????else
???????????h=1;
????????end
????????result(ij)=h*g(ij);
????end
end
result=ifftshift(result);
X2=ifft2(result);
X3=uint8(real(X2));
subplot(236)imshow(X3)
title(‘高斯高通濾波‘)

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????1652??2017-04-13?16:18??frequencyfilter.m
?????文件????????2290??2017-04-13?16:18??spatialfilter.m
?????文件????????1324??2017-04-13?16:18??spatialtransform.m

評論

共有 條評論