Categories

Versions

Add Region (Image Processing)

Synopsis

Adds a region to an image.

Description

This operator adds a region to an image. A region (sometimes known as a subimage or mask) is a defined area of an image, rectangular or circular, that is added to the Image IOObject by this operator. It is technically not “drawn” on the image, but rather exists as a separate metadata-like object whose boundaries are rendered on top of the image when viewed.

Regions (also known as a subimage) can be used as a bounding boxes (e.g. as the result of an object detection model inference), masks, or in a variety of other applications.

A region must be defined by its shape dimensions (top left x and y coordinates, width, and height for a rectangle; center x and y coordinates and radius for a circle). In addition, you can add additional information about the region: class id: an integer often used when doing bounding box object detection; description: a string describing the class id. confidence: a real value between 0 and 1 describing the confidence value of a bounding box inference.

Input

  • img

    The image object the region should be added to

Output

  • img

    The image with the added region

  • ori

    The original image.

Parameters

  • shape Defines the shape of the region to add.
  • center x The x coordinate of the center of the circle to add. Only available if shape is set to circle.
  • center y The y coordinate of the center of the circle to add. Only available if shape is set to circle.
  • radius The radius of the circle to add. Only available if shape is set to circle.
  • top left x The x coordinate of the top left point of the rectangle to add. Only available if shape is set to rectangle.
  • top left y The y coordinate of the top left point of the rectangle to add. Only available if shape is set to rectangle.
  • width The width of the rectangle to add. Only available if shape is set to rectangle.
  • height The height of the rectangle to add. Only available if shape is set to rectangle.
  • class id Class id of the region added. This can be seen as a type.
  • description Free text description of the region to add.
  • confidence Confidence of the region to add.
  • line color Color of the line of the region. This is only a visual parameter used in rendering.
  • line thickness Thickness of the line of the region. This is only a visual parameter used in rendering.

Tutorial Processes