MATLAB File Help: cv.getRectSubPix | Index |
Retrieves a pixel rectangle from an image with sub-pixel accuracy
dst = cv.getRectSubPix(src, patchSize, center)
dst = cv.getRectSubPix(..., 'OptionName',optionValue, ...)
[w,h]
.[x,y]
must be inside
the image.PatchSize
, the same number
of channels as src
, and the specified type in PatchType
.src
. Supports either uint8
or single
.The function cv.getRectSubPix extracts pixels from src
:
dst(x,y) = src(x + center(1) - (size(dst,2)-1)*0.5,
y + center(2) - (size(dst,1)-1)*0.5)
where the values of the pixels at non-integer coordinates are retrieved using bilinear interpolation. Every channel of multi-channel images is processed independently. While the center of the rectangle must be inside the image, parts of the rectangle may be outside. In this case, the replication border mode is used to extrapolate the pixel values outside of the image.