mxpi_roigenerator

If there are too many blocks, the input data may be too large and the memory cannot be allocated.

Function

Allows users to enter the number, size, and other parameters (e.g. overlap) of image blocks to automatically generate ROIs.

Synchronous/Asynchronous (Status)

Asynchronous

Constraints

A maximum of 256 blocks are supported.

Plugin Base Class (Factory)

mxpi_roigenerator

Input/Output

  • Input: decoded image and buffer (data type: MxpiBuffer)
  • Output:
    • Port 1: image block area, metadata (data type: MxpiObjectList)
    • Port 2 (optional): ROI for image merging, metadata (data type: MxpiObjectList). This port is connected to the image merging plugin (mxpi_semanticsegstitcher).

Port Format (Caps)

  • Static input: {"metadata/yuv"}
  • Static output: {"metadata/object"}
  • Dynamic output: {"metadata/object/roi-info"}

Property

For details, see Table mxpi_roigenerator plugin properties.

Table 1 mxpi_roigenerator plugin properties

Property Name

Description

Mandatory or Not

Modifiable or Not

splitType

Sets block division mode. The options are Size_Block (default), Num_Block, and Custom.
  • Size_Block: splits images based on the block size.
  • Num_Block: splits images by setting the number of blocks.
  • Custom: customizes the block and merging range.

No

Yes

blockHeight

Sets the height of the image block, which is used when splitType is set to Size_Block. The value range is [32, 8192], and the default value is 512.

No

Yes

blockWidth

Sets the width of the image block, which is used when splitType is set to Size_Block. The value range is [32, 8192], and the default value is 512.

No

Yes

chessboardHeight

Sets the number of blocks on the Y axis, which is used when splitType is set to Num_Block. The value range is [1, 256], and the default value is 1.

No

Yes

chessboardWidth

Sets the number of blocks on the X axis, which is used when splitType is set to Num_Block. The value range is [1, 256], and the default value is 1.

No

Yes

overlapHeight

Sets the overlapping region on the Y axis. The value range is [0, 8192], and the default value is 0.

No

Yes

overlapWidth

Sets the overlapping region on the X axis. The value range is [0, 8192], and the default value is 0.

No

Yes

cropRoi

Customizes the coordinate box of blocks (x0, y0, x1, y1), which is used when splitType is set to Custom. Coordinate boxes are separated by a vertical bar (|). Example: 0,0,512,512|512,0,1024,512.

No

Yes

mergeRoi

Customizes the merging range of each block with absolute coordinates, which is used when splitType is set to Custom. The value must correspond to cropRoi. Example: 20,20,400,400|530,20,800,400.

No

Yes

Figure 1 Parameter diagram