i am new to matlab can anyone please explain this lines
조회 수: 6 (최근 30일)
이전 댓글 표시
filename=uigetfile('.jpg');
I=imread(filename);
I=imresize(I,[256 256]);
figure,imshow(I);
title('input image')
%----imnoise
I_n=I;
J=zeros(size(I_n));
for iclr=1:3
I_n = I(:,:,iclr);
[m n]=size(I_n);
BH=imhist(I_n);
[v p1]=max(BH);
pn=find(BH~=v);
[v p2]=max(BH(pn));
s_p=[p1-1 p2-1];
I_sp=zeros([m n]);
sp1=find(I_n==s_p(1));
I_sp(sp1)=1;
sp2=find(I_n==s_p(2));
I_sp(sp2)=1;
J(:,:,iclr)=I_n;
for i=2:m-1
for j=2:n-1
b_3=I_n(i-1:i+1,j-1:j+1);
if I_sp(i,j)==1
J(i,j,iclr)=median(double(b_3(:)));
end
end
end
end
%-----filtered image
figure,imshow(uint8(J));
댓글 수: 0
채택된 답변
vijay sai
2014년 1월 26일
i think the program u have given is a incomplete one.. it's also erroneous...it's trying to plot histograms for individual image plans r,g,b,...when I tried finishing the program and debug it...the loop is never ending ...giving the full program ..someone may be helpful to you..
댓글 수: 1
Azzi Abdelmalek
2014년 1월 26일
Kalpana commented
hi vijay sai i submitted the full code can u pls help me now
추가 답변 (1개)
Azzi Abdelmalek
2014년 1월 26일
편집: Azzi Abdelmalek
2014년 1월 26일
If you are new with Matlab, the best thing to do is to read the getting started with Matlab. You can also learn what each function do by typing
help imhist
help size
and so on
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!