how to remove padarray from image?
조회 수: 12 (최근 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!