BoundingRectangle

Determines a bounding rectangle around a specified (indexed) blob. The function finds a rectangle that encloses all points of a blob based on the given function inputs.

BoundingRectangle Inputs

Syntax: BoundingRectangle(Blobs,Index,Alignment,Angle,Padding.High,Padding.Wide,Show)

Parameter Description

Blobs

This argument must reference a spreadsheet cell that contains a valid Blobs data structure returned by the ExtractBlobs, FindBlobs, or SortBlobs function.

Index

Specifies the Index of the Blob within Blobs structure.

Alignment

Specifies the alignment of the found rectangle. For example:

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.

Angle

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.

High

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.

Wide

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.

Show

Specifies the display mode for BoundingRectangle graphical overlays on top of the image.

0 = hide all (default)

All graphics will be 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.

BoundingRectangle 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, a result table is created in the spreadsheet.

BoundingRectangle Vision Data Access Functions

The following Vision Data Access functions are automatically inserted into the spreadsheet to create the result table. For more information, see Structures.

Row

GetRow(Region)

The row offset of the region's origin, in image coordinates.

Col

GetCol(Region)

The column offset of the region's origin, in image coordinates.

High

GetHigh(Region)

The dimension along the region's x-axis.

Wide

GetWide(Region)

The dimension along the region's y-axis.

Angle

GetAngle(Region)

The orientation, in image coordinates.