ICvBasepublic interface ITxtImageSuperResolution extends ICvBase
Text image super-resolution can magnify the image that contains text by a factor of 3 and enhance the definition of the text in the image.
This interface provides two process modes. The MODE_IN mode indicates that the SDK directly invokes
the TISR 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 TISR 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 text image super-resolution on an image and returns the result code.
|
void |
setVisionConfiguration(TxtImageSuperResolutionConfiguration configuration) |
Sets the text image super-resolution parameter.
|
getAvailability, loadPlugin, prepare, releaseint doSuperResolution(VisionImage image, ImageResult result, VisionCallback<ImageResult> visionCallback)
image - Indicates an input image.result - Indicates the image after text image super-resolution 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(TxtImageSuperResolutionConfiguration configuration)
This method can be used to configure the process invoking mode.
configuration - Indicates the text image super-resolution parameter,
TxtImageSuperResolutionConfiguration.