フィルターのクリア

7*7 average

2 ビュー (過去 30 日間)
viswanath reddy
viswanath reddy 2019 年 1 月 29 日
コメント済み: Guillaume 2019 年 1 月 30 日
How can we find average of matrix, considering a 7 by 7 matrix in an image????
  1 件のコメント
Guillaume
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?
Doesn't the mean function or the mean2 (requires image processing toolbox) function work for what you want? They work on any size matrix, including 7x7 ones.

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

回答 (1 件)

Matt J
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 件のコメント
Matt J
Matt J 2019 年 1 月 30 日
OK. But your question has already been answered (so please Accept-click).
Guillaume
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 ExchangeRead, Write, and Modify Image についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by