7*7 average
2 次查看(过去 30 天)
显示 更早的评论
How can we find average of matrix, considering a 7 by 7 matrix in an image????
1 个评论
Guillaume
2019-1-29
You'll have to be clearer about what you want. Providing an example of input and desired output really helps. What does considering a 7 by 7 matrix in an image mean?
回答(1 个)
Matt J
2019-1-29
编辑:Matt J
2019-1-29
If you want a 7x7 sliding window, you would use convolution
out=conv2(yourImage,ones(7)/49,'valid');
If instead you want to decompose your image into non-overlapping 7x7 tiles, then I would recommend sepblockfun (Download).
out=sepblockfun(yourImage,[7,7],'mean');
4 个评论
Guillaume
2019-1-30
As Matt wrote, "If you want a 7x7 sliding window, you would use convolution" and he gave you the code.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Read, Write, and Modify Image 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!