Skip to content

Resize Polygons

Overview

Scales a list of polygons from their center point. This node is useful for enlarging or shrinking detection areas, such as expanding a face detection region to include more background.

Use Resize Polygons when:

  • You need to increase the area of detected polygons for better cropping.
  • You want to shrink polygons to focus on the core region of interest.

💡 Tip

Setting a factor above 100% enlarges the polygon, while setting it below 100% shrinks it.

Inputs

NameTypeDescription
polygonslist[polygon]The list of polygons to be scaled.

Outputs

NameTypeDescription
scaled_polygonslist[polygon]The resulting list of resized polygons.

Parameters

ParameterDefaultValid valuesUnitTunable
Horizontal scale10051000%
Vertical scale10051000%

Horizontal scale

The scaling factor applied to the horizontal dimension of each polygon. Values greater than 100% enlarge the polygon, values below 100% shrink it. The polygon is resized from its center.

Vertical scale

The scaling factor applied to the vertical dimension of each polygon. Values greater than 100% enlarge the polygon, values below 100% shrink it. The polygon is resized from its center.

Example

Enlarge detection regions

A model detects objects but the bounding boxes are too tight. Scaling both factors to 160% provides more context.

Configuration:

  • Horizontal scale: 160
  • Vertical scale: 160

Result: Each polygon in the list is 60% larger than the original.

Polygon scaled from center — original (dashed gray) and result (green) with 160% horizontal and vertical scale
A polygon scaled to 160% from its center. The original outline is shown dashed in gray.

Reference: