Remove Overlapped Polygons

Function

Filter out invalid polygons that overlap or are outside the masks.

Sample Scenario

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 inputted image corresponds to one mask image), CorrespondingMasks (all the inputted images corresponds to one mask image)
Instruction: To change the way the mask is used. The user can choose to apply one mask to all polygons, or apply a different mask to each polygon.

Inspection Criteria

Reached Out Ratio Min Threshold
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. Calculate the ratio of the area of the shifted mask beyond the highest layer of the mask to the area of the mask itself, 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.
Reached Out Ratio Max Threshold
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. Calculate the ratio of the area of the shifted mask beyond the highest layer of the mask to the area of the mask itself, 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.

Output Strategy

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

Figure1 Position Restraint