Tag: android vision

使用android vision Text OCR构建名片阅读器

我正在使用谷歌的Android移动视觉OCR文本构建一个Android应用程序,用于输入名片作为手机中的联系人。 到目前为止,我能够识别任何拉丁语生成的文本,并且能够在代码块上应用正则表达式 我所做的是我为五个变量名称,电子邮件,compnayname,网站,adrs,phnno创建了一个Contacts bean类。在正在生成的实时数据上应用正则表达式之后,我将过滤结果并将它们保存在bean类型的对象中class并将该对象传递给activity并提取存储在该对象中的数据并将其显示在我的文本视图中。 OCR图形类检测方法>>> List textComponents = text.getComponents(); for(final Text currentText : textComponents) { float left = translateX(currentText.getBoundingBox().left); float bottom = translateY(currentText.getBoundingBox().bottom); canvas.drawText(currentText.getValue(), left, bottom, sTextPaint); if (currentText != null && currentText.getValue() != null) { //stringList.add(currentText.getValue()); Log.e(“OCrGraphic”, “Text detected! ” + currentText.getValue()); if (isCompany== false && currentText.getValue().matches(“.[AZ].[^@$#/-!]+”)) { Log.e(“currentTextcompanyName”, currentText.getValue()); companyName = “”; companyName […]