Why do I see an all white image when I use IMFILTER?
이전 댓글 표시
i have chessboard image and i'm apply ones(31) filter for this image by using imfilter but the result is white image . can you help me to solve this error
this code used
%%%%%%%%%%%%%%%%%
g = imread('ch2.jpg');
h= rgb2gray(g);
w=ones(31);
gd=imfilter(h,w);
imshow(gd,[]) ;
댓글 수: 1
Image Analyst
2013년 10월 19일
You forgot to attach your image ch2.jpg. Please attach it using the paperclip icon.
답변 (2개)
I am unsure what you are trying to achieve. If you are using w=ones(31) as averaging filter. Then change your code as below
g = imread('ch2.jpg');
h= rgb2gray(g);
w=fspecial('average',31);
gd=imfilter(h,w);
imshow(gd) ;
Image Analyst
2013년 10월 19일
Cast h to double and it will work:
h = double(rgb2gray(g));
댓글 수: 1
Image Analyst
2013년 10월 22일
Please mark as Accepted if it worked for you. Thanks.
카테고리
도움말 센터 및 File Exchange에서 Image Filtering에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!