what i can do to solve this problem
显示 更早的评论
IMG = imread('X_Ray_Chest_Side.png');
origin=rgb2gray(IMG);
[M,N] = size(IMG);
figure,
imshow(origin);
title('origin image');
E=ones(5,5);
E_lpf=(1/25)*E;
f_padded=double(padarray(origin,[2 2]));
g_padded=(zeros(M+4,N+4));
for i=3:M+2
for j=3:N+2
T=f_padded(i-2:i+2,j-2:j+2);
conv_T=T.*E_lpf;
g_padded(i,j)=sum(sum(conv_T));
end
end
EEE=g_padded(2:M+1,2:N+1);
figure
imshow(uint8(EEE))
W_2=[4 8 16 32 16 8 4;8 16 32 64 32 16 8;16 32 64 128 64 32 16;32 64 128 256 128 64 32;16 32 64 128 64 32 16;8 16 32 64 32 16 8;4 8 16 32 16 8 4];
W_Gaus=(1/1936)*W_2;
g2=(zeros(m+4,n+4));
for q1=3:(m-2)
for p1=3:(n-2)
origin=add(q1-2:q1+2,p1-2:p1+2);
org=double(origin);
res=W_Gaus .*org;
g2(q1,p1)=sum(sum(res));
end
end
g2=g2(3:m+2,3:n+2);
imshow(uint8(g2));
title(' gaussian filter ');
W_composite=[0 -1 0;-1 5 -1;0 -1 0];
f2=double(add2);
g3=(zeros(m+6,n+6));
for i=1:m-3
for j=1:n-3
temp3=f2(i:i+2,j:j+2);
conv_temp3=temp3.*W_composite;
g3(i,j)=sum(sum(conv_temp3));
end
end
g3=g3(4:m+3,4:n+3);
imshow(uint8(g3));
title('Composite laplacian filter');
3 个评论
Walter Roberson
2019-11-24
What problem?
You have presented a bunch of undocumented code (and no copy of the input image). We must assume that the purpose of the code is to do exactly whatever it is that the code does, and that therefore the code is perfect.
Rony ali
2019-11-24
Rony ali
2019-11-24
采纳的回答
更多回答(1 个)
Rony ali
2019-11-25
0 个投票
类别
在 帮助中心 和 File Exchange 中查找有关 Downloads 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
