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!
