ICvBasepublic interface IImageSuperResolution extends ICvBase
For a 1x scale factor, SISR uses intelligent methods to suppress the compression noise of a given image to make it clearer. For a 3x scale factor, SISR uses intelligent methods to magnify a given image by a factor of 3 to enhance its resolution, and identifies and suppresses the compression noise to obtain clearer details and textures than traditional magnification.
This interface performs super-resolution on an input image, generates an output image, and returns the result code of super-resolution processing.
This interface provides two process modes. The MODE_IN mode indicates that the SDK directly invokes
the SISR function in the caller process. The MODE_OUT mode indicates that the SDK functions as a client
to send a calling request to the HUAWEI HiAI Engine, which performs SISR and returns the result to the caller.
This interface also provides two block modes. In synchronous mode, the calling is blocked in the
doSuperResolution method until the super-resolution processing is complete. In asynchronous mode, the
doSuperResolution method is returned immediately, and the super-resolution processing result is returned
to the caller in callback mode.
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
int |
doSuperResolution(VisionImage image,
ImageResult result,
VisionCallback<ImageResult> visionCallback) |
Performs SISR on an image and returns the result code.
|
void |
setVisionConfiguration(SisrConfiguration config) |
Sets the SISR parameter.
|
getAvailability, loadPlugin, prepare, releaseint doSuperResolution(VisionImage image, ImageResult result, VisionCallback<ImageResult> visionCallback)
image - Indicates an input image.result - Indicates the image after SISR in synchronous mode.visionCallback - Indicates the callback class to use.
doSuperResolution is called synchronously, and the image after
super-resolution is output from the result parameter.doSuperResolution is called asynchronously, and the result
parameter should be null. When the asynchronous call is successful, the image after super-resolution can be
obtained from onResult, or an error code is passed from onError.HwHiAIResultCode.AIRESULT_SUCCESS if the synchronous call is successful;
returns an error code otherwise.
Returns HwHiAIResultCode.AIRESULT_ASYNC_MODE if the asynchronous call is successful;
returns an error code if any input parameter is invalid.
For more information, see HwHiAIResultCode.
void setVisionConfiguration(SisrConfiguration config)
If this method is not called or the input parameter SisrConfiguration is set to null,
the default super-resolution scale factor 1x is used.
config - Indicates the SISR parameter, SisrConfiguration.