acldvppAdjustSharpness
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
√ |
|
√ |
|
☓ |
|
☓ |
|
☓ |
Description
Description: adjusts the sharpness of an input image.
Prototype
Each operator has two-phase API calls. First, acldvppAdjustSharpnessGetWorkspaceSize is called to calculate the required workspace size based on the computation process. Then, acldvppAdjustSharpness is called to perform computation. The two-phase APIs are as follows:
- First-phase API:
1acldvppStatus acldvppAdjustSharpnessGetWorkspaceSize(const aclTensor *self, float factor, aclTensor *out, uint64_t *workspaceSize, aclOpExecutor **executor)
- Second-phase API:
1acldvppStatus acldvppAdjustSharpness(void *workspace, uint64_t workspaceSize, aclOpExecutor *executor, aclrtStream stream)
acldvppAdjustSharpnessGetWorkspaceSize
- Parameters:
- self: input tensor of the operator. Call aclCreateTensor to create data of the aclTensor type (stored on the device). The data type of the input tensor can be UINT8 or FLOAT, and the format can be NCHW or NHWC. Discontinuous tensors are not supported, in addition, N can be 1 or empty, and C can be 1 or 3 (1 indicates the input GRAY image, and 3 indicates the input RGB image).
When the data type of a tensor is FLOAT, the data value must be within the range of [0, 1].
- factor: sharpness adjustment factor. The value must be a non-negative number. For example, if the value is 0, a blurred image is obtained; if the value is 1, the original image is obtained; if the value is 2, the sharpness of the image is adjusted to twice the original value.
- out: operator output tensor. Call aclCreateTensor to create data of the aclTensor type (stored on the device). The data type of the output tensor can be UINT8 or FLOAT, and the format can be NCHW or NHWC. Discontinuous tensors are not supported, in addition, N can only be 1 or empty, and C can be 1 or 3 (1 indicates a GRAY image, and 3 indicates an RGB image). The values of dataType, Format, and Shape must be the same as those of self.
- workspaceSize: size of the workspace to be allocated on the device.
- executor: operator executor, containing the operator computation process.
- self: input tensor of the operator. Call aclCreateTensor to create data of the aclTensor type (stored on the device). The data type of the input tensor can be UINT8 or FLOAT, and the format can be NCHW or NHWC. Discontinuous tensors are not supported, in addition, N can be 1 or empty, and C can be 1 or 3 (1 indicates the input GRAY image, and 3 indicates the input RGB image).
- Returns:
The status code acldvppStatus is returned. For details, see acldvpp Return Codes.
acldvppAdjustSharpness
- Parameters:
- workspace: The aclrtMalloc API needs to be called to allocate the device memory. The memory size is workspaceSize. The memory address output by the aclrtMalloc API is passed here.
- workspaceSize: The value must be the same as that obtained by calling acldvppAdjustSharpnessGetWorkspaceSize.
- executor: op executor, which contains the operator computation process and is the same as the executor of the acldvppAdjustSharpnessGetWorkspaceSize API.
- stream: stream for executing the task. You can reuse the created stream to save resources or call aclrtCreateStream to create a stream, and then pass the stream as an input parameter.
- Returns
The status code acldvppStatus is returned. For details, see acldvpp Return Codes.
Constraints
- The supported image resolution ranges from 6 x 4 to 4096 x 8192.