machinevisiontoolbox.Image.roi
- Image.roi(bbox=None)
Extract region of interest
- Parameters:
bbox (array_like(4)) – region as [umin, umax, vmin, vmax]
- Returns:
region of interest, optional bounding box
- Return type:
Image
, list
Return the specified region of the image. If
bbox
is None the image is displayed using Matplotlib and the user can interactively select the region, returning the image region and the bounding box[umin, umax, vmin, vmax]
.Example:
>>> from machinevisiontoolbox import Image >>> img = Image.Read('monalisa.png') >>> smile = img.roi([265, 342, 264, 286])