How can I put margins in an image?

前端 未结 4 1010
余生分开走
余生分开走 2020-12-11 22:39

I have a binary image of 18x18 pixels and I want to put margins around this image with the purpose of obtaining an image 20x20 pixels.

The image is binary and

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-11 22:59

    The padarray function from the image processing toolbox can be used for this purpose:

    B=padarray(A,[1,1])
    

提交回复
热议问题