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口\"}"
}
Access preparation
API description
Yes. In detect() method engine startup is in default. The engine will not start up again if started, please use with confidence.
The screenshot OCR currently supports both Chinese and English. The snapshot OCR supports Chinese, English, German, French, Italian, Spanish, and Portuguese. In the near future, the snapshot OCR will be made available in Japanese, Korean, and Russian. For details about future dates of availability, please refer to related development documents.