crop (cv.Rect) - MATLAB File Help
cv.Rect.crop

Extract region-of-interest from image

roi = cv.Rect.crop(img, r)
img = cv.Rect.crop(img, r, roi)

Input

Output

In the first variant, the function gets ROI region from image, i.e: roi = img(r(2)+1:r(2)+r(4), r(1)+1:r(1)+r(3), :).

In the second variant, the function sets ROI region inside image, i.e: img(r(2)+1:r(2)+r(4), r(1)+1:r(1)+r(3), :) = roi

See also
Method Details
Access public
Sealed false
Static true