how to remove padarray from image?

adding padarray makes the image from 256x256 image to 258x258. how to make image back to 256x256 ?

Respuestas (2)

Jos (10584)
Jos (10584) el 8 de Feb. de 2016
A = magic(4)
n = 2
B = padarray(A,[n n]) % pad
A2 = B(n+1:end-n,n+1:end-n) % unpad
or directly:
A2 = A
Image Analyst
Image Analyst el 8 de Feb. de 2016

0 votos

Simply don't call it. Why did you call it if you don't want what it does?

2 comentarios

kashika sharma
kashika sharma el 8 de Feb. de 2016
i an new to matlab. just learning how things work.
Like Jos says, you can just extract the central part with indexing:
out = yourArray(2:end-1, 2:end-1);

Iniciar sesión para comentar.

Categorías

Más información sobre Image Processing and Computer Vision en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 8 de Feb. de 2016

Comentada:

el 8 de Feb. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by