how to remove padarray from image?
4 次查看(过去 30 天)
显示 更早的评论
adding padarray makes the image from 256x256 image to 258x258. how to make image back to 256x256 ?
1 个评论
回答(2 个)
Jos (10584)
2016-2-8
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
0 个评论
Image Analyst
2016-2-8
Simply don't call it. Why did you call it if you don't want what it does?
2 个评论
Image Analyst
2016-2-8
Like Jos says, you can just extract the central part with indexing:
out = yourArray(2:end-1, 2:end-1);
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing and Computer Vision 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!