Main Content
Rectangle
Spatial extents of 2-D rectangular region
Description
A Rectangle
object stores the spatial extents of a 2-D
rectangular region.
Creation
You can create a Rectangle
object in these ways.
centerCropWindow2d
— Create aRectangle
of a specified size whose position is centered on an image of different size.randomWindow2d
— Create aRectangle
whose position is selected randomly from within an image of different size. You can specify the size of the rectangle or a range of valid aspect ratios and relative areas of the rectangle.Running the command
creates ar = images.spatialref.Rectangle(XLimits,YLimits)
Rectangle
object and sets theXLimits
andYLimits
properties.
Properties
Examples
Version History
Introduced in R2019b
See Also
Cuboid
| centerCropWindow2d
| randomWindow2d
| imcrop
Topics
- Augment Images for Deep Learning Workflows (Deep Learning Toolbox)