Skip to content

vlt.image.selectsubimage

  SELECTSUBIMAGE - select a rectangle from an image, padding out-of-bounds pixels

  [IM_SUB] = SELECTSUBIMAGE(IM, TOP, LEFT, BOTTOM, RIGHT, [PAD])

  Inputs: IM a YxX image
          TOP the top pixel location in Y direction to select. The first index
             in the image starts at 1. TOP can be negative, and out-of-bounds
             values will be filled with PAD.
          LEFT the left pixel location to select in X. The first pixel is 1. 
             LEFT can be less than 1, and out-of-bounds values will be filled
             with PAD.
          BOTTOM the bottom pixel location in Y. Can exceed the number of Y
             pixels, and out-of-bounds values will be filled with PAD.
          RIGHT the right-ost pixel to select in X. Can exceed the number of X
             pixels, and out-of-bounds values will be filled with PAD.
          PAD the padding value; if not provided, it will be NaN

  OUTPUT: IM_SUB, the selected portion of the image.