Attempted to access pad_org(1,343); index out of bounds because size(pad_org)=[544,342].
이전 댓글 표시
original_im=imread('Picture1.tif');
figure,imshow(original_im);
pad_org=padarray(original_im,[1 1],'both');
figure(3);imshow(pad_org)
for i=1:size(pad_org,1)-2
for j=1:size(pad_org,2)-2
window=zeros(25,1); %%Matrix to store the value of 5 by 5 window
win_inc=1;%%initial value of window matrix
for k=1:size(window,1)/5
for l=1:size(window,1)/5
window(win_inc)=pad_org(i+k-1,j+l-1);
win_inc=win_inc+1;
end
end
median=sort(window); %%arranging the window by ascending order
new_image(i,j)=median(13);%%13 is the median value of 5 by 5 window
end
end
new_image=uint8(new_image);
figure(4);imshow(new_image);title('Image After Median Filtering')
I am getting an error as
Attempted to access pad_org(1,343); index out of bounds because size(pad_org)=[544,342].
Error in medianfilter_withoutbuiltin (line 54) window(win_inc)=pad_org(i+k-1,j+l-1);
I am unable sort out this error.
Please help me.
Thanks
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!