mxpi_opencvosd

Before using the mxpi_opencvosd plugin, you need to use the OSD-related model files. Execute the operators/opencvosd/generate_osd_om.sh script in the installation directory of MindX SDK to generate the required model files.

  • Ensure that the ATC-related environment variables of the current user are correctly set and the ATC tool can be used properly.
  • Ensure that the user has the write permission on the ASCEND_OPP_PATH directory. The default path of the ASCEND_OPP_PATH directory for the root user is /usr/local/Ascend/ascend-toolkit/latest/opp.

Function

Calls basic On-screen Display (OSD) functions to draw basic units, such as frames, words, lines, and circles, on images.

Synchronous/Asynchronous (Status)

Synchronous

Constraints

  • The osd parameter in MxpiOsdInstancesList must comply with the restrictions of the OpenCV port.
  • The lengths of MxpiVisionList and MxpiOsdInstancesList in each input buffer must be the same.

Plugin Base Class (Factory)

mxpi_opencvosd

Input/Output

Input: buffer (data type: MxpiBuffer), metadata (data type: MxpiVisionList), and metadata (data type: MxOsdInstancesList)

Output: buffer (data type: MxpiBuffer) and metadata (data type: MxpiVisionList)

Port Format (Caps)

Static dual-input: {"image/yuv"},{"metadata/osd"}

Static output: {"image/yuv"}

Property

For details, see Table 1.

Table 1 mxpi_opencvosd plugin properties

Property Name

Description

Mandatory or Not

Modifiable or Not

dataSourceImage

Buffer index name of input port 0. The default value is the key of the metadata mounted to the output port 0 of the upstream plugin.

No

Yes

dataSourceOsd

Buffer index name of input port 1. The default value is the key of the metadata mounted to the output port 1 of the upstream plugin.

No

Yes

Example

Call the basic OSD function buffer (MxpiOsdInstancesList) to draw basic units, such as frames, words, lines, and circles, on the input image (MxpiVsionList) and output the buffer to the downstream plugin.

Pipeline sample:

"mxpi_opencvosd0":{
    "props":{
  "dataSourceImage":"mxpi_channelimagesstitcher0_0",
  "dataSourceOsd":"mxpi_channelosdcoordsconverter0"
    },
    "factory":"mxpi_opencvosd",
    "next":"queue10"
},