Skip to main content

<Rectangle>

Category: Control tag

The Rectangle tag is used to add a rectangle (Bounding Box) to an image without selecting a label. This can be useful when you have only one label to assign to a rectangle.

Use with the following data types: image. Annotation results store the left top corner of the bounding box, read more about it and rotation in the templates gallery.

Attributes​

AttributeTypeRequiredDefaultDescription
namestringyes—Name of the element
toNamestringyes—Name of the image to label
opacityfloatno0.6Opacity of rectangle
fillColorstringno—Rectangle fill color in hexadecimal
strokeColorstringno#f48a42Stroke color in hexadecimal
strokeWidthnumberno1Width of the stroke
canRotatetrue,falsenotrueWhether to show or hide rotation control. Note that the anchor point in the results is different than the anchor point used when rotating with the rotation tool. For more information, see the templates gallery.
smarttrue,falseno—Show smart tool for interactive pre-annotations
smartOnlytrue,falseno—Only show smart tool for interactive pre-annotations
snappixel,nonenononeSnap rectangle to image pixels

Examples​

Basic labeling configuration for adding rectangular bounding box regions to an image​

<View>
<Rectangle name="rect-1" toName="img-1" />
<Image name="img-1" value="$img" />
</View>