フィルターのクリア

Why the imfilter give different result with textbook?

2 ビュー (過去 30 日間)
Yode
Yode 2017 年 7 月 23 日
コメント済み: Walter Roberson 2017 年 7 月 23 日
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)
This is original picture.Maybe I have missed something.

採用された回答

Image Analyst
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 件のコメント
Yode
Yode 2017 年 7 月 23 日
Oh god,the book fool me.Thank very very very very much...
Walter Roberson
Walter Roberson 2017 年 7 月 23 日
Also notice that they used imshow(gd, []) but you used imshow(gd) without the []

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!