mxpi_imagecrop
Function |
|
|---|---|
Synchronous/Asynchronous (Status) |
Synchronous |
Constraints |
|
Plugin Base Class (Factory) |
mxpi_imagecrop |
Input/Output |
Input: buffer (data type: MxpiBuffer) and metadata (data type: MxpiObjectList) Output: buffer (data type: MxpiBuffer) and metadata (data type: MxpiVisionList) |
Port Format (Caps) |
Static input: {"metadata/object"}; dynamic input: {"image/yuv","image/rgb"} Static output: {"image/yuv","image/rgb"} |
Property |
For details, see Table 1. |
Property Name |
Description |
Mandatory or Not |
Modifiable or Not |
|---|---|---|---|
deviceId |
Ascend device ID, which is specified by the deviceId property in the stream_config field. You do not need to set the ID. |
No |
Yes |
parentName |
Index of the input data (generally the name of the upstream element). The function is the same as that of dataSource. You are advised to use dataSource because it will be deleted in later versions. |
Do not use it. |
Yes |
dataSource |
Index of the input data (generally the name of the upstream element). The default value is the key value of the output port of the upstream plugin. |
Recommended |
Yes |
dataSourceImage |
Image data source for cropping. Generally, the data source is the name of an upstream element. |
No |
Yes |
leftExpandRatio |
Expanding ratio of in the left direction. The default value is 0, and the value range is [0, 1]. |
No |
Yes |
rightExpandRatio |
Expanding ratio of in the right direction. The default value is 0, and the value range is [0, 1]. |
No |
Yes |
upExpandRatio |
Expanding ratio of in the up direction. The default value is 0, and the value range is [0, 1]. |
No |
Yes |
downExpandRatio |
Expanding ratio of in the down direction. The default value is 0, and the value range is [0, 1]. |
No |
Yes |
resizeHeight |
Height of the resized image in Resizer_Stretch and Resizer_KeepAspectRatio_Fit resizing modes. The default value is the height of the cropped image, that is, the height without resizing. |
No |
Yes |
resizeWidth |
Width of the resized image in Resizer_Stretch and Resizer_KeepAspectRatio_Fit resizing modes. The default value is the width of the cropped image, that is, the width without resizing. |
No |
Yes |
maxDimension |
Maximum length of the resized image in Fast R-CNN resizing mode |
No |
Yes |
minDimension |
Minimum length of the resized image in Fast R-CNN resizing mode |
No |
Yes |
resizeType |
Resizing mode
|
No |
Yes |
RGBValue |
Padding color value. Enter the R, G, and B values in sequence. By default, the padding color is not set, and the default background color of DVPP is used. |
No |
Yes |
paddingType |
Padding mode. The options are as follows:
|
No |
Yes |
cvProcessor |
Processing mode. For details about the differences, see Before You Start.
|
No |
Yes |
autoDetectFrame |
By default, the cropped coordinate box is set by the output of the upstream plugin (generally the inference plugin or block-dividing plugin). If you want to customize the cropped coordinate box, disable this attribute. The value can be 0 or 1 (default). When the value is 0, the coordinate box needs to be provided. The coordinate box consists of two coordinates: (x0, y0) and (x1, y1). |
No |
Yes |
cropPointx0 |
x0 coordinate of the cropped image. It is of the string type and the range is [1,8192]. Multiple object frames are supported. |
No |
Yes |
cropPointx1 |
x1 coordinate of the cropped image. It is of the string type and the range is [1,8192]. Multiple object frames are supported. |
No |
Yes |
cropPointy0 |
y0 coordinate of the cropped image. It is of the string type and the range is [1,8192]. Multiple object frames are supported. |
No |
Yes |
cropPointy1 |
y1 coordinate of the cropped image. It is of the string type and the range is [1,8192]. Multiple object frames are supported. |
No |
Yes |
cropHeight |
Height of the cropped image. The value range is [1,8192]. If the plugin does not receive the specified valid cropping range, the default value 0 is used, and an error is reported. (It is deprecated. Do not use it.) |
No |
Yes |
cropWidth |
Width of the cropped image. The value range is [1,8192]. If the plugin does not receive the specified valid cropping range, the default value 0 is used, and an error is reported. (It is deprecated. Do not use it.) |
No |
Yes |
handleMethod |
Reserved attribute. Use cvProcessor. Processing method:
|
No |
Yes |
cropType |
Reserved attribute. Use autoDetectFrame. Cropping mode. The default value is cropCoordinate, indicating that the image is cropped based on the coordinates. |
No |
Yes |
Custom cutout example:
- When a single coordinate box is input, set (x0, y0) to (1,1) and (x1, y1) to (100,100).
"mxpi_imagecrop0": { "props" : { "autoDetectFrame" : "0", "cropPointx0" : "1", "cropPointy0" : "1", "cropPointx1" : "100", "cropPointy1" : "100" }, "factory": "mxpi_imagecrop", "next": "xxxxxxxx" }, - When multiple coordinate boxes are input, set the coordinates of the first object frame to (1,1) (100,100) and that of the second object frame to (100,100) (200,200).
"mxpi_imagecrop0": { "props" : { "autoDetectFrame" : "0", "cropPointx0" : "1, 100", "cropPointy0" : "1, 100", "cropPointx1" : "100, 200", "cropPointy1" : "100, 200" }, "factory": "mxpi_imagecrop", "next": "xxxxxxxx" },