Mostrar comentarios más antiguos
How can we find average of matrix, considering a 7 by 7 matrix in an image????
1 comentario
Guillaume
el 29 de En. de 2019
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?
Respuestas (1)
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 comentarios
Walter Roberson
el 29 de En. de 2019
filter2 can be used instead of conv2. There are some differences in internal optimization in some cases. conv2 flips the mask compared to filter2 .
viswanath reddy
el 30 de En. de 2019
Matt J
el 30 de En. de 2019
OK. But your question has already been answered (so please Accept-click).
Guillaume
el 30 de En. de 2019
As Matt wrote, "If you want a 7x7 sliding window, you would use convolution" and he gave you the code.
Categorías
Más información sobre Geometric Transformation and Image Registration en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
