HUAWEI HiAI能力开放平台
HUAWEI HiAI是面向智能终端的AI能力开放平台,基于 “芯、端、云”三层开放架构,即芯片能力开放、应用能力开放、服务能力开放,构筑全面开放的智慧生态,让开发者能够快速地利用华为强大的AI处理能力,为用户提供更好的智慧应用体验。
立即接入HUAWEI HiAI Engine
应用能力开放,构筑全连接服务和全场景应用,
轻松将多种AI能力和APP结合,让APP更加智能强大。
丰富的AI能力,开箱即用,打造极致体验的数
字世界入口。
文档检测请求参数:
DocRefine docRefine = new DocRefine(this);
Frame frame = new Frame();
frame.setBitmap(bitmap);
JSONObject obj2 = docRefine.docDetect(frame, null);
文档校正请求参数:
ds = docRefine.convertResult(obj2);
newbmp = docRefine.docRefine(frame, ds, null);
文档检测返回结果:
{"resultCode":0,"doc":"{\"bottom_left\":
{\"x\":4,\"y\":426},\"bottom_right\":
{\"x\":588,\"y\":592},\"top_left\":
{\"x\":227,\"y\":26},\"top_right\":{\"x\":586,\"y\":218}}"}
文档校正返回结果:
校正后的图片
ImageSuperResolution superResolution = new ImageSuperResolution(mContext);
Frame frame = new Frame();
frame.setBitmap(bitmap);
ImageResult result = superResolution.doSuperResolution(frame, null);
Bitmap resultBitmap = result.getBitmap();
TextDetector textDetector = new TextDetector(this);
Frame frame = new Frame();
frame.setBitmap(bitmap);
JSONObject jsonResult = textDetector.detect(frame,null);
{
"resultCode": 0,
"common_text": "{\"blocks\":
[{\"boundingBox\":{\"height\":
33,\"left\":592,\"top\":857,\"width\":140},
\"cornerPoints\":[{\"x\":592,\"y\":857},
{\"x\":732,\"y\":857},{\"x\":592,\"y\":890},
{\"x\":732,\"y\":890}],
\"probability\":0.77,\"value\":\"返程日期\"},
{\"boundingBox\":
{\"height\":33,\"left\":650,\"top\":924,\"width\":141},
\"cornerPoints\":[{\"x\":650,\"y\":924},
{\"x\":791,\"y\":924},{\"x\":650,
\"y\":957},{\"x\":791,\"y\":957}],
\"probability\":0.75,\"value\":\"添加返程\"},
{\"boundingBox\":
{\"height\":45,\"left\":430,\"top\":1938,\"width\":232},
\"cornerPoints\":
[{\"x\":430,\"y\":1938},{\"x\":662,\"y\":1938},
{\"x\":430,\"y\":1983},{\"x\":662,\"y\":1983}],
\"probability\":0.7,\"value\":\"国 我的订单\"},
{\"boundingBox\":
{\"height\":46,\"left\":757,\"top\":2077,\"width\":46},
\"cornerPoints\":
[{\"x\":757,\"y\":2077},{\"x\":803,\"y\":2077},
{\"x\":757,\"y\":2123},{\"x\":803,\"y\":2123}],
\"probability\":0.72,\"value\":\"口\"}],
\"cornerPoints\":[{\"x\":430,\"y\":857},
{\"x\":803,\"y\":857},{\"x\":430,\"y\":2123},
{\"x\":803,\"y\":2123}],\"probability\":0.735,
\"textRect\":{\"height\":1266,\"left\":430,
\"top\":857,\"width\":373},\"value\":
\"返程日期\\n添加返程\\n国 我的订单\\n口\"}"
}
AsrRecognizer asrRecognizer = AsrRecognizer.createAsrRecognizer(this);
asrRecognizer.init(initIntent, mMyAsrListener);
asrRecognizer.startListening(intent);
JSONObject result = new JSONObject(json);
JSONArray items = result.getJSONArray("result");
BarcodeDetector detector = new BarcodeDetector(getApplicationContext());
Frame frame = new Frame();
frame.setBitmap(bitmap);
JSONObject jsonObject = detector.detect(frame,null);
{"resultCode":0,"barcode":"[{\"contentTypes\":[11],
\"iSBN\":{\"isbn\":\"9787540746445\"}}]"}