# BoundingRectangle

Determines a bounding rectangle around a specified (indexed) blob A blob is a group of pixels on the image that form a distinct pattern, typically used to represent objects, features, or areas of interest in object detection and segmentation tasks.. The function Functions are tools that are available in Spreadsheet for processing and analyzing acquisitions or other results. You can add functions to your Spreadsheet job to create tool chains and produce results for specific applications. finds a rectangle that encloses all points of a blob based on the given function inputs.

Inputs

Parameter | Description
--- | ---
Blobs | Must reference a spreadsheet cell that contains a valid Blobs data structure returned by the DetectBlobs, FindBlobs, or SortBlobs function.
Index | Zero-based index of the blob in the blob structure.
Alignment | Alignment for bounding rectangle.
0 = Blob Coordinate Frame (default) | Specifies that the rectangle be at the same angle as the blob angle. Note: The angle of the blob can be returned by the GetAngle function.
1 = Image Coordinate Frame | Specifies the rectangle that best fits the blob at an angle of 0°.
2 = User Coordinate Frame | Specifies the rectangle that best fits the blob at the angle used by the Angle parameter.
Theta | Specifies the desired angle (-360 to 360) at which to find the bounding rectangle.
Padding | Specifies the amount of amount of space, in pixels, between the blob and the rectangle.
Width | Specifies the amount of amount of space, in pixels, (0 to ((image width/ 2) – 1)) between the left and right side of the blob and the rectangle.
Height | Specifies the amount of amount of space, in pixels, (0 to ((image height / 2) – 1)) between the top and bottom of the blob and the rectangle.
Show | Specifies the display mode for BoundingRectangle graphical overlays on top of the image.
0 = hide all (default) | All graphics are hidden, except when the cell containing the BoundingRectangle function is highlighted in the spreadsheet.
1 = result graphics only | The bounding rectangle region will be displayed at all times.

Outputs

Returns | A Region data structure that defines the best bounding rectangle from the indexed blob, or #ERR if any of the input parameters are invalid.
Results | When the function is initially inserted into a cell, the following Structures Vision Data Access functions are automatically inserted into the spreadsheet to create the result table:
Label | Function | Description
X | GetX(Region) | The X offset of the origin of the region, in image coordinates.
Y | GetY(Region) | The Y offset of the origin of the region, in image coordinates.
Width | GetWidth(Region) | The dimension along the X axis of the region.
Height | GetHeight(Region) | The dimension along the Y axis of the region.
Angle | GetAngle(Region) | The orientation, in image coordinates.