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!