how to create a sliding window?

1 visualización (últimos 30 días)
Andrea Finocchiaro
Andrea Finocchiaro el 19 de Oct. de 2015
Comentada: Walter Roberson el 25 de Dic. de 2018
Hi guys, I would like to know ho to create a sliding window in a matrix. Thank you very much.

Respuestas (1)

Image Analyst
Image Analyst el 19 de Oct. de 2015
You can use conv2() or imfilter(). For example:
windowWidth = 11;
kernel = ones(windowWidth, windowWidth) / windowWidth ^ 2;
smoothedImage = conv2(double(grayImage), kernel, 'same');
  2 comentarios
Le Dung
Le Dung el 25 de Dic. de 2018
Undefined function or variable 'grayImage'.
Walter Roberson
Walter Roberson el 25 de Dic. de 2018
Replace grayImage with the variable that stores your gray-scale image (not RGB)

Iniciar sesión para comentar.

Categorías

Más información sobre Import, Export, and Conversion en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by