急!!!matlab數字圖像處理
1 close all;
clear all;
clc;
x=zeros(100,100);
x(1:50,1:50)=1;
x(51:100,51:100)=1;
figure;
imshow(x);
y=repmat(x,5,5);
figure;
imshow(y);%%方塊圖
Y=fft2(y);
plot(abs(Y));
2 M=imread('dl011.jpg')
P2=imnoise(M,'salt & pepper',0.02) %加入椒鹽噪聲
h=medfilt2(P2) %對椒鹽躁聲中值濾波
3 M=imread('dl011.jpg') %%灰度圖像
imhist(M);%%顯示直方圖
N=histeq(M);%%直方圖均衡
4 M=imread('dl011.jpg');
P2=imnoise(M,'salt & pepper',0.02) %加入椒鹽噪聲
h=medfilt2(P2) %對椒鹽躁聲中值濾波
l=[1 1 1 %對高斯躁聲算術均值濾波
1 1 1
1 1 1];
l=l/9;
k=conv2(P2,l)
5 I = imread('circuit.tif');
BW1 = edge(I,'prewitt');
BW2 = edge(I,'canny');