How do I pad an image after translating it ?
조회 수: 1 (최근 30일)
이전 댓글 표시
How do I pad the 'borders' of the image after translation by copying the nearest pixel values ? Like in this tutorial http://www.mathworks.com/help/images/translate-an-image.html, the image was translated but the boundaries are not black. I would like the border to be 'replicated' so that the new image does not have black borders.
댓글 수: 0
답변 (1개)
Walter Roberson
2016년 6월 22일
http://www.mathworks.com/help/images/ref/padarray.html with 'replicate' option.
댓글 수: 2
Walter Roberson
2016년 6월 23일
padarray with replicate, then throw away the part you do not need.
You would use that order instead of throwing away and then padding, because of the possibility that you might have translated completely out of the frame, which would leave an empty matrix if you threw away before padding.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!