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 Vision SDK to generate the required model files. Multiple mxpi_opencvosd instances can be created for a single pipeline.
- Ensure that the ATC-related environment variables of the current user are correctly set and the ATC tool can work properly.
- Ensure that the user has the write permission on the ASCEND_OPP_PATH directory. The default path of the ASCEND_OPP_PATH directory is /usr/local/Ascend/cann/opp for the root user and $HOME/Ascend/cann/opp for a common user.
|
Function |
Calls basic OSD functions to draw basic units, such as frames, words, lines, and circles, on images. |
|---|---|
|
Synchronous/Asynchronous (Status) |
Synchronous |
|
Constraints |
|
|
Plugin Base Class (Factory) |
mxpi_opencvosd |
|
Input/Output |
|
|
Port Format (Caps) |
|
|
Property |
For details, see Table 1. |
|
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 corresponding 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 corresponding 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 (MxpiVisionList) 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"
},