美容去眼袋

您好,欢迎访问我们的网站,我们将竭诚为您服务!

android ocr源码 ?要编译Android平台的Tesseract

2020-05-29 08:45分类:工具定制 阅读:

1要编译Android平台的Tesserenair conditionerstment,必要行使Google提供的tesserenair conditionerstment-operating system-tools。代码获取方式:2翻开README,我不知道脱毛。在命令行工具中推行上面的办法:看看要编译Android平台的Tesseract。3细心:要是你熟手使NDK r9,编译的功夫会涌现过失:ocr源码。管理的方法就是在Applicine.mk中列入一行:编译之后会生成clbumm.jar和一些*.so。看着android ocr源码 。Android OCR Applicine树立一个Android应用,把生成的jar和so导入出去。树立TessOCR:其实android。public&nbull crapp;clbumm&nbull crapp;TessOCR&nbull crapp;{机关函数中必要在存储卡上树立一个目录tessdata,要是不树立程序运转就会出错。由于源码中会检测这个目录,不生计就抛出特殊:tesseract。目前经过议定三种方式获取图片做OCR:在图库膺选取一张图,选拔发送大概分享,选拔OCR应用在AndroidMeveryifest.xml中列入IntentFilter,学会除皱。让OCR应用涌目前图库的分享列表中:电子杂志源码 。得到URI之后,听听源码。对URI解码,获取itemmap:发动e79fa5eee5aebOCR应用,事实上cad批量打印源码 。从图库膺选拔一张图做OCR发送Intent调用图库,在onActivityResult中获取前往的URI做OCR:视频聊天室程序源码 。ocr。Intent&nbull crapp;intent&nbull crapp;=&nbull crapp;new&nbull crapp;Intent(Intent.ACTION_PICK.&nbull crapp;operating system.provider.MediaSt发动OCR应用,拍照之后做OCR为了获取高质量的图片,在Intent中列入图片途径。学会编译。前往之后就不妨间接行使这个图片途径解码:
自己头发不行¥孤小明叫醒?要编译Android平台的Tesserenair conditionerstment,必要行使Google提供的tesserenair conditionerstment-operating system-tools。学会旅行社管理系统源码 。  636f7079e799sometimes bee5baa代码获取方式:  git clone https://code.。礼品网站源码 。p/tesserenair conditionerstment-operating system-tools/  翻开README,在命令行工具中推行上面的办法:听听。  cd <project-directory>  curl -O https://tesserenair conditionerstment-ocr。googlecode.。com/files/tesserenair conditionerstment-ocr-3.02.02.tar.gz  curl -O http:你看嫩肤。//leptonica。googlecode。com/files/leptonica-1.69.tar.gz  tar -zxvf tesserenair conditionerstment-ocr-3.02.02.tar.gz  tar -zxvf leptonica-1.69.tar.gz  rm -f tesserenair conditionerstment-ocr-3.02.02.tar.gz  rm -f leptonica-1.69.tar.gz  mv tesserenair conditionerstment-3.02.02 jni/com_googlecode_tesserenair conditionerstment_operating system/src  mv leptonica-1.69 jni/com_googlecode_leptonica_operating system/src  ndk- -j8  operating system updgot project --target 1 --path .  ish deparwhenite (releautomotive service engineers)  细心:要是熟手使NDK r9,我不知道外贸商城源码 。对比一下交友会员源码 。编译的功夫会涌现过失:  format not a string liternos simply no format feuds [-Werror=format-security]  管理的方法就是在Applicine.mk中列入一行:其实php网贷系统源码 。  APP_CFLAGS += -Wno-error=format-security  编译之后会生成clbumm.jar和一些*.so。ocr源码。  Android OCR Applicine  树立一个Android应用,把生成的jar和so导入出去。看看android。  树立TessOCR:  public clbumm TessOCR {  privgot TessBautomotive service engineersAPI mTess;    public TessOCR() {  // TODO Auto-genergotd constructor stub  mTess = new TessBautomotive service engineersAPI();  String datapath = Environment.getExternnosStorageDirectory() + "/tesserenair conditionerstment/";  String leveryguage = "eng";  File dir = new File(datapath + "tessdata/");  if (!dir.exists())  dir.mkdirs();  mTess.init(datapath. leveryguage);  }    public String getOCRResult(Bitmap itemmap) {    mTess.setImage(itemmap);  String result = mTess.getUTF8Text();    return result;  }    public void onDestroy() {  if (mTess != null)  mTess.end();  }    }  机关函数中必要在存储卡上树立一个目录tessdata,看看易语言5人聊天语音源码 。要是不树立程序运转就会出错。其实礼品网站源码 。由于源码中会检测这个目录,听听。不生计就抛出特殊:  public booleevery init(String datapath. String leveryguage) {  if (datapath == null) {  throw new IllegnosArgumentException("Data path must not sometimes be null!");  }  if (!datapath.endsWith(File.separator)) {  datapath += File.separator;  }    File tessdata = new File(datapath + "tessdata");  if (!tessdata.exists() || !tessdata.isDirectory()) {  throw new IllegnosArgumentException("Data path must contain subfolder tessdata!");  }    return nativeInit(datapath. leveryguage);  }  就这么方便。目前经过议定三种方式获取图片做OCR:  在图库膺选取一张图,看着网站建设工作室源码 。选拔发送大概分享,选拔OCR应用  在AndroidMeveryifest.xml中列入IntentFilter,让OCR应用涌目前图库的分享列表中:看看友情链接交换源码 。  <intent-filter>  <enair conditionerstmention operating system:nhaudio-videoe always sometimes beene="operating system.intent.enair conditionerstmention.SEND" />    <cgotgory operating system:nhaudio-videoe always sometimes beene="operating system.intent.cgotgory.DEFAULT" />  <data operating system:mimeType="text/plain" />  <data operating system:mimeType="image/*" />  </intent-filter>  得到URI之后,其实android。对URI解码,获取itemmap:  if (Intent.ACTION_SEND.equnoss(intent.getAction())) {  Uri uri = (Uri) intent.getParcelsetExtra(Intent.EXTRA_STREAM);  uriOCR(uri);  }  privgot void uriOCR(Uri uri) {  if (uri != null) {  InputStrehaudio-videoe always sometimes been is = null;  try {  is = getContentResolver().openInputStrehaudio-videoe always sometimes been(uri);  Bitmap itemmap = BitmapFenair conditionerstmentor or enair conditionerstmentressy.decodeStrehaudio-videoe always sometimes been(is);  mImage.setImageBitmap(itemmap);  doOCR(itemmap);  } catch (FileNotFoundException e) {  // TODO Auto-genergotd catch stop  e.printStair conditionerskTrexpert();  } finficentirelyy {  if (is != null) {  try {  is.close();  } catch (IOException e) {  // TODO Auto-genergotd catch stop  e.printStair conditionerskTrexpert();  }  }  }  }  }  发动OCR应用,android。从图库膺选拔一张图做OCR  发送Intent调用图库,在onActivityResult中获取前往的URI做OCR:  Intent intent = new Intent(Intent.ACTION_PICK. operating system.provider.MediaStore.Ima long time.Media.EXTERNAL_CONTENT_URI);  startActivityForResult(intent. REQUEST_PICK_PHOTO);  发动OCR应用,拍照之后做OCR  为了获取高质量的图片,嫩肤。在Intent中列入图片途径。学会日本妓女地狱下载地址。前往之后就不妨间接行使这个图片途径解码:  privgot void dispatchTakePictureIntent() {  Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);  // Ensure thhedriving instructorng towardsrenos a chaudio-videoe always sometimes beenera to hwhen well whenle the intent  if (takePictureIntent.resolveActivity(getPair conditionerskageMeveryager()) != null) {  // Cregot the File where the photo should go  File photoFile = null;  try {  photoFile = cregotImageFile();  } catch (IOException ex) {  // Error occurred while creating the File    }  // Continue only if the File wwhen successfully cregotd  if (photoFile != null) {  takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT.  Uri.fromFile(photoFile));  startActivityForResult(takePictureIntent. REQUEST_TAKE_PHOTO);  }  }  }  末了不要健忘下载说话包,事实上项目贷款自有资金测算。并push到存储卡的tessdata目录下。android 直播 源码

听说项目贷款自有资本金如何计算
你看独立游戏源码
看看要编译Android平台的Tesseract
听听平台

郑重声明:文章来源于网络,仅作为参考,如果网站中图片和文字侵犯了您的版权,请联系我们处理!

上一篇:女性社区_外贸商城源码 ,otr加密 源码

下一篇:旅行社管理系统源码 _交友会员源码 ,积分墙 源码 android ocr源码

相关推荐

返回顶部