mxpi_warpperspective

Function

Perspective transformation plugin, which is used in the scenario where the detection box is a rectangle with a certain angle after inference and needs to be rotated to be a regular rectangle. The output is the cropped image information of each detection box. The cropped image is obtained through perspective transformation.

This plugin contains a static port (must be connected) and a dynamic port (not created if not connected).

Synchronous/Asynchronous (Status)

Synchronous

Constraints

None

Plugin Base Class (Factory)

mxpi_warpperspective

Input/Output

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

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

Port Format (Caps)

Static input: {"metadata/object","metadata/texts"}

Static output: {"image/yuv","image/rgb"}

Property

For details, see Table 1.

Table 1 mxpi_warpperspective plugin properties

Property Name

Description

Mandatory or Not

Modifiable or Not

dataSource

Index of the coordinate data of the text box. The default value is the key of the metadata mounted to the output port of the upstream plugin.

No

Yes

debugMode

If this parameter is set to true, the image after affine transformation is saved to the local drive. The image path is warpPerspectiveImage/image{index}.jpg in the current program path, in which the index starts from 0.

No

Yes

oriImageDataSource

Index of the image data to be rotated. This property is valid when a dynamic port is created. If no dynamic port is available, the image data is obtained from the buffer corresponding to the static port (port 0).

No

Yes

When debugMode is set to true, the output data of the plugin is saved to files on the drive, resulting in additional files. You need to manage those files and delete them if necessary. Do not use this function when processing private or sensitive data.