Remove Overlapped Polygons

Function

This Step filters out invalid polygons that overlap or are outside the masks.

Usage Scenario

This Step is fixedly used with the Steps Remove Polygons outside Mask and Calc Poses and Dimensions of Rectangles to filter out polygons that do not reflect the contours of real objects.

Input and Output

../../../../../_images/90_remove_overlapped_polygns.png

Parameters

Mask Settings

Usage of Input Masks
Default Value: SingleMask
List of Values: SingleMask (one mask applies to all polygons), CorrespondingMasks (One mask applies to one polygon)
Instruction: To change the way the mask is used. You can choose to apply one mask to all polygons or apply different masks to each polygon accordingly.

Inspection Criteria

Min Out-Of-Bound Area Ratio (0-1.0)
Default Value: 0.45
Instruction: The mask of the box is translated by one-half of the length and one-half of the width along the positive and negative directions of the long and short axes. The ratio of the area of the shifted mask beyond the highest layer of the mask to the area of the mask itself will be calculated, and if it is greater than the threshold, the box is considered to be on the boundary of the highest layer. Generally speaking, if the rectangular box mask is located at the corners of the highest layer mask, as long as the mask is shifted by one-half of the length or width in the direction of removing the highest layer mask, the ratio should be 0.5, so the minimum threshold default value is 0.45 . When the value is increased, generally speaking, it exceeds 0.5, and all polygons will be filtered out. This Step will give priority to the mask of the box at the corner point, so the carton mask area at the border needs to be determined first.
Min Out-Of-Bound Area Ratio (0-1.0)
Default Value: 0.6
Instruction: The mask of the box is translated by one-half length and one-half width along the positive and negative directions of the long and short axes. The ratio of the area of the shifted mask beyond the highest layer of the mask to the area of the mask itself will be calculated, and if it is less than the threshold, the box is considered to be on the boundary of the highest layer. Generally speaking, if the rectangular box mask is located at the corners of the highest layer mask, as long as the mask is shifted by one-half of the length or width in the direction of removing the highest layer mask, the ratio should be 0.5 , so the default maximum threshold is 0.6. This Step will give priority to the mask of the box at the corner point, so the carton mask area at the border needs to be determined first.
Max Overlap Ratio (0-1.0)
Default Value: 0.2
Instruction: If the overlap ratio of two polygons exceeds the threshold. one of the polygons should be filtered out.

Output Strategy

Position Restraint
Default Value: AtCorners
List of Values: AtCorners, None
Instruction: As shown below, the left side is the output image under the default setting, and the right side is the output image when the parameter is set to None.
../../../../../_images/position_limit.png