Why the imfilter give different result with textbook?
조회 수: 2 (최근 30일)
이전 댓글 표시
As the textbook say,this code ( gd=imfilter(f,w)) will give a result with blurry edge like follow

But actually I will get a result :
w=ones(31);
gd=imfilter(f,w);
imshow(gd)

댓글 수: 0
채택된 답변
Image Analyst
2017년 7월 23일
Because you did not divide by 31^2 the image gets clipped to 256 instead of having much, much greater values. If you want to see it blurred, either convert to double (but the blurred image will be in a much brighter intensity range than the original), or divide your kernel by 31^2:
windowWidth = 31;
w = ones(windowWidth) / windowWidth ^ 2;
gd = imfilter(grayImage, w);
댓글 수: 2
Walter Roberson
2017년 7월 23일
Also notice that they used imshow(gd, []) but you used imshow(gd) without the []
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Signal Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!