cv.getRectSubPix - MATLAB File Help
cv.getRectSubPix

Retrieves a pixel rectangle from an image with sub-pixel accuracy

dst = cv.getRectSubPix(src, patchSize, center)
dst = cv.getRectSubPix(..., 'OptionName',optionValue, ...)

Input

Output

Options

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. Also the image should be a single channel or three channel image. While the center of the rectangle must be inside the image, parts of the rectangle may be outside. In this case, the pixel values outside of the image are extrapolated.

See also