mxpi_imagecrop
Function |
|
||||
|---|---|---|---|---|---|
Synchronous/Asynchronous (Status) |
Synchronous |
||||
Constraints |
|
||||
Plugin Base Class (Factory) |
mxpi_imagecrop |
||||
Input/Output |
|
||||
Port Format (Caps) |
|
||||
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 this property 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 |
Value for color padding. Enter the R, G, and B values in sequence. By default, the value is empty and color padding is not performed. The default background color of DVPP is used. |
No |
Yes |
paddingType |
Padding mode:
|
No |
Yes |
cvProcessor |
Processing method:
|
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 for cropping. It is of the string type and the range is [1, 8192]. Multiple bounding boxes are supported. |
No |
Yes |
cropPointx1 |
x1 coordinate for cropping. It is of the string type and the range is [1, 8192]. Multiple bounding boxes are supported. |
No |
Yes |
cropPointy0 |
y0 coordinate for cropping. It is of the string type and the range is [1, 8192]. Multiple bounding boxes are supported. |
No |
Yes |
cropPointy1 |
y1 coordinate for cropping. It is of the string type and the range is [1, 8192]. Multiple bounding boxes are supported. |
No |
Yes |
handleMethod |
Reserved property. Use cvProcessor. Processing method:
|
No |
Yes |
cropType |
Reserved property. Use autoDetectFrame. Cropping mode. The default value is cropCoordinate, indicating that the image is cropped based on the coordinates. |
No |
Yes |
Example for customizing image cropping:
- For a single coordinate box is input, set (x0, y0) to (1, 1) and (x1, y1) to (100, 100).
1 2 3 4 5 6 7 8 9 10 11
"mxpi_imagecrop0": { "props" : { "autoDetectFrame" : "0", "cropPointx0" : "1", "cropPointy0" : "1", "cropPointx1" : "100", "cropPointy1" : "100" }, "factory": "mxpi_imagecrop", "next": "xxxxxxxx" },
- For more than one coordinate box, set the coordinates of the first bounding box to (1, 1) (100, 100) and that of the second bounding box to (100, 100) (200, 200).
1 2 3 4 5 6 7 8 9 10 11
"mxpi_imagecrop0": { "props" : { "autoDetectFrame" : "0", "cropPointx0" : "1, 100", "cropPointy0" : "1, 100", "cropPointx1" : "100, 200", "cropPointy1" : "100, 200" }, "factory": "mxpi_imagecrop", "next": "xxxxxxxx" },