Detect Shape Feature of Region

You are currently viewing the documentation for the latest version (2.1.2). To access a different version, click the "Switch version" button located in the upper-right corner of the page.

■ If you are not sure which version of the product you are currently using, please feel free to contact Mech-Mind Technical Support.

Function

This Step detects the bounding and inscribed rectangles of the non-zero pixel region of the mask.

Usage Scenario

This Step is a general Step for mask processing. It has no fixed usage scenarios.

Input and Output

input and output

Parameter Description

Region Feature Type

Description: This parameter is used to select the detection method you want to use.

Value list: AlignedCircumscribedRect, AlignedInscribedRect, LargestInscribedRect, and SmallestCircumscribedRect

The following table introduces the values, with sack masks used as examples to illustrate the calculation results.

Detection Method Description Illustration

AlignedCircumscribedRect

Calculate the bounding rectangle of the input mask, which can align as closely as possible with the edge of the mask.

parameter example 1

AlignedInscribedRect

Calculate the inscribed rectangle of the input mask, which can align as closely as possible with the edge of the mask.

parameter example 2

LargestInscribedRect

Calculate the maximum inscribed rectangle of the input mask.

parameter example 3

SmallestCircumscribedRect

Calculate the minimum bounding rectangle of the input masks.

parameter example 4

Default value: AlignedCircumscribedRect

The following sections introduce the parameters for each region feature type.

AlignedCircumscribedRect

When the region feature type is selected, the following parameters should be adjusted.

Align Search Radius

Description: This parameter is used to determine whether the mask coincides with the bounding rectangle. When the distance from a contour point to the bounding rectangle contour point is smaller than this radius, the contour point is considered coincident with the bounding rectangle contour point.

Default value: 3 px

Tuning recommendation: It is recommended to use the default value.

Fill Region Feature

Description: This parameter is used to select whether to fill the bounding rectangle. If selected, the bounding rectangle will be filled.

Default setting: Unselected.

AlignedInscribedRect

When the region feature type is selected, the following parameters should be adjusted.

Align Search Radius

Description: This parameter is used to determine whether the mask coincides with the inscribed rectangle. When the distance from a contour point to the inscribed rectangle contour point is smaller than this radius, the contour point is considered coincident with the inscribed rectangle contour point.

Default value: 3 px

Tuning recommendation: It is recommended to use the default value.

Translation Step

Description: The translation Step of the rectangle center when calculating the inscribed rectangle. The smaller the value, the longer the calculation time and the higher the calculation accuracy of the inscribed rectangle.

Default value: 10 px

Fill Region Feature

Description: This parameter is used to select whether to fill the inscribed rectangle. If selected, the inscribed rectangle will be filled.

Default setting: Unselected.

LargestInscribedRect

When the region feature type is selected, the following parameters should be adjusted.

Rotation Step (0 to 360)

Description: The rotation Step along the long axis of the rectangle when calculating the maximum inscribed rectangle. The smaller the value, the longer the calculation time and the higher the calculation accuracy of the maximum inscribed rectangle.

Translation Step

Description: The translation Step of the rectangle center when calculating the maximum inscribed rectangle. The smaller the value, the longer the calculation time and the higher the calculation accuracy of the maximum inscribed rectangle.

Default value: 10 px

Fill Region Feature

Description: This parameter is used to determine whether to fill the maximum inscribed rectangle. If selected, the maximum inscribed rectangle will be filled.

Default setting: Unselected.

SmallestCircumscribedRect

When the region feature type is selected, the following parameters should be adjusted.

Fill Region Feature

Description: This parameter is used to determine whether to fill the minimum bounding rectangle. If selected, the minimum bounding rectangle will be filled.

Default setting: Unselected.

Is this page helpful?

You can give a feedback in any of the following ways:

We Value Your Privacy

We use cookies to provide you with the best possible experience on our website. By continuing to use the site, you acknowledge that you agree to the use of cookies. If you decline, a single cookie will be used to ensure you're not tracked or remembered when you visit this website.