How to return the dimension of image if I had already add padding before ?

W = ones(3);
padded = padarray(W,[1, 1],'symmetric','both');
ASK : dimension = 3x3
after padding = 5x5
can you help me, how to return the dimension back to 3x3

 Respuesta aceptada

Thorsten
Thorsten el 15 de Dic. de 2014
Editada: Thorsten el 15 de Dic. de 2014
W = W(2:end-1, 2:end-1);

3 comentarios

W = W(2:end-1, 2:end-1);
W = 3
sorry but its not dimension 3x3
Sorry. It should read:
W = ones(3);
padded = padarray(W,[1, 1],'symmetric','both');
X = padded(2:end-1, 2:end-1);
size(X)
ans =
3 3
Thank u Thorsten. its work

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Simulink en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 15 de Dic. de 2014

Comentada:

el 15 de Dic. de 2014

Community Treasure Hunt

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

Start Hunting!

Translated by