当前位置: 首页 > 软件库 > 手机/移动开发 > >

nativescript-ocr

授权协议 MIT License
开发语言 JavaScript TypeScript
所属分类 手机/移动开发
软件类型 开源软件
地区 不详
投 递 者 陈朗
操作系统 iOS
开源组织
适用人群 未知
 软件概览

NativeScript OCR

⚠️ This repo is hardly maintained - if you want an OCR solution in NativeScript, please consider using Firebase MLKit.

Optical Character Recognition - powered by Tesseract

Installation

tns plugin add nativescript-ocr

Setup

You'll need to add language files to help Tesseract recognizing text in the images you feed it.

Download version 3.04.00 of the tessdata files here andadd your required language to the app/tesseract/tessdata/ folder of your app.

Note that if your language(s) has multiple files (like English: there's 9 files matching eng.*), copy all those files to the folder.

iOS

iOS searches for the tessdata folder in app/App_Resources/iOS, but instead of dulicating the folderyou can create a symbolic link:

cd app/App_Resources/iOS
ln -s ../../tesseract/tessdata

API

retrieveText

JavaScript

This is just a basic example using the default settings, look at the TypeScript code belowfor a more elaborate example.

var OCRPlugin = require("nativescript-ocr");
var ocr = new OCRPlugin.OCR();

ocr.retrieveText({
  image: myImage
}).then(
    function (result) {
      console.log("Result: " + result.text);
    },
    function (error) {
      console.log("Error: " + error);
    }
);

TypeScript

This example shows how to use all possible (but optional) options you can pass into retrieveText:

import { OCR, RetrieveTextResult } from "nativescript-ocr";
import { ImageSource } from "image-source";

export Class MyOCRClass {
  private ocr: OCR;
  
  constructor() {
    this.ocr = new OCR();
  }

  doRecognize(): void {
    let img: ImageSource = new ImageSource();

    img.fromFile("~/samples/scanned.png").then((success: boolean) => {
      if (success) {
        this.ocr.retrieveText({
          image: img,
          whitelist: "ABCDEF",     // you can include only certain characters in the result
          blacklist: "0123456789", // .. or you can exclude certain characters from the result
          onProgress: (percentage: number ) => {
            console.log(`Decoding progress: ${percentage}%`);
          }
        }).then(
            (result: RetrieveTextResult) => {
              this.set(HelloWorldModel.BUSY_KEY, false);
              console.log(`Result: ${result.text}`);
            }, (error: string) => {
              console.log(`Error: ${err}`);
            })
      }
    });
  }
}
  •                                                    重建ocr(recreate ocr) 没有备份的情况下如何重建ocr,mos上有比较详细的步骤,这里我只贴出我的语句和命令供参考 1.查看当前状态记录asm,database配置,如数据库名为orcl asm两个实例是+ASM1 [oracle@rac1 ~]$ crs_stat -t    

  • OCR 和 Voting disk 对RAC 来说是非常重要的。 OCR记录节点成员的配置信息,如database、ASM、instance、listener、VIP等CRS资源的配置信息。Voting disk记录节点成员信息,如包含哪些节点成员、节点的添加删除信息记录。在日常维护中需要对他们进行备份。当然OCR 也会自动备份。 当OCR或者Voting disk 出现问题时,有备份的话就使用备

  • 假设我们的RAC环境中OCR磁盘和votedisk磁盘全部被破坏,并且都没有备份,那么我们该如何恢复我们的RAC环境。 最近简单的办法就是重新初始化我们的ocr盘和votedisk盘,把集群中的所有相关资源重新注册到OCR磁盘和votedisk磁盘中。 1.停掉所有节点的Clusterware Stack [root@rac3 bin]# ./crsctl stop crs Stopping re

 相关资料
  • NativeScript 可以使用 Javascript,CSS, XML 创建真正的 Native 跨平台应用,支持 iOS Android,NativeScript 将您的跨平台代码翻译成目标平台的代码。 UI 使用 XML 描述,CSS 样式,在编译时将 UI 转化成本地原生代码,最终得到正在的 Native 原生应用。 Telerik 公开了用于创建安卓、iOS和Windows Unive

  • NativeScript Command-Line Interface The NativeScript CLI lets you create, build, and deploy NativeScript-based apps on iOS and Android devices. Get it using: npm install -g nativescript What is Native

  • NativeScript-Snackbar �� �� �� NativeScript plugin for Material Design SnackBar component. Installation: NativeScript 7+:tns plugin add @nstudio/nativescript-snackbar NativeScript version prior to 7:t

  • Nativescript-Ripple This plugin aims to bring a native (or close to native) ripple implementation on Android and iOS. The android version uses a RippleDrawable and conserves the previous background, a

  • NativeScript-FloatingActionButton NativeScript plugin for Material Design Floating Action Button UI component. Installation Nativescript 7+: ns plugin add @nstudio/nativescript-floatingactionbutton Na

  • NativeScript CardView A NativeScript plugin to provide an XML widget to implement the Material Design CardView component. Installation NativeScript 7+: ns plugin add @nstudio/nativescript-cardview Nat