enhanceClarityForImage(params: Object)

Requires:
AIKit≥1.4.1@ray-js/ray≥1.7.37
Platforms:
iOSAndroid
import { ai } from '@ray-js/ray';

const { enhanceClarityForImage } = ai;

// Promise usage
try {
  const res = await enhanceClarityForImage({ ...params });
  console.log(res);
} catch (err) {
  console.log(err.errorMsg);
}

Description

Image clarity enhancement processing

Parameters

PropertyTypeRequiredDefaultDescriptionAIKit Since
trace_idstringYes-Link IDv2.1.0
device_idstringYes-Device IDv2.1.0
scene_typestringYes-Business typev2.1.0
devIdstringYes-Device IDv2.0.1
inputImagePathstringYes-Image input path-
outputImagePathstringYes-Image output path-
enhanceOutputResolution1 | 2 | 3No1Desired output image resolution Default maximum output is 1080p; if lower than 1080p, the output follows the input size-
enhanceType1 | 2 | 3 | 4 | 5 | 6 | 7 | 8No1Image enhancement type-
complete() => voidNo-Completion callback (executed on both success and failure)-
success(params: Object) => voidNo-Callback on successful API call-
fail(params: Object) => voidNo-Failure callback-
success callback parameters
PropertyTypeDescription
outputImagePathstringImage URL
enhanceSuccessbooleanWhether processing succeeded
enhanceFaileReasonstringFailure reason
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Valid Values

enhanceOutputResolution
ValueDescriptionAIKit Since
1Native size-
2640-
3720-
enhanceType
ValueDescriptionAIKit Since
1No action, default-
2Noise reduction-
3Low-light enhancement-
4Super-resolution-
5Noise reduction + low-light enhancement-
6Noise reduction + super-resolution-
7Low-light enhancement + super-resolution-
8Noise reduction + low-light enhancement + super-resolution-

Examples

import { ai } from '@ray-js/ray'

ai.enhanceClarityForImage({
  trace_id: "xx",
  device_id: "xx",
  scene_type: "xx",
  devId: "xx",
  inputImagePath: "xx",
  outputImagePath: "xx",
  enhanceOutputResolution: 1,
  enhanceType: 1,
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});