How to apply an 9x9 average filter to image with some boundary options?
12 views (last 30 days)
Show older comments
Hi! I know how to apply an average filter, but how to apply it with a certain boundary options?
For example: boundary option: X=0 or periodic?
Thank you in advance! I'm trying to learn Matlab by myself and this could be very useful for me!
0 Comments
Answers (2)
Image Analyst
on 19 Oct 2015
You can use imfilter() or conv2():
out = conv2(double(grayImage), ones(9)/81, 'same');
This assumes zeros outside the image. I can't think of any reason why you'd need a periodic situation.
Walter Roberson
on 19 Oct 2015
1 Comment
Image Analyst
on 19 Oct 2015
Too bad it doesn't have a "mask-shrinking" option. I think that would be more like what people would want rather than symmetric.
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!