1.4.1 • Published 11 days ago

@anytestforpm/ocr v1.4.1

Weekly downloads
-
License
ISC
Repository
-
Last release
11 days ago

Install

npm i @anytestforpm/ocr

Language Support

支持地區為: VN IN ID BR MM PK TH PH NG BD TR US

Usage Example

1.初始化OCR的辨識語系及API路由設定,就會自動取得后台設定檔

import { initOCR } from '@anytestforpm/ocr';

mounted() {  
  //initOCR
  //@param {String} VN IN ID BR MM ...
  //@param {String} API URL
  if (process.env.NODE_ENV === 'production') {  
    initOCR('VN','https://your-api-domain/api/xxx');
  } else { 
    initOCR('VN','https://your-api-domain/api/xxx');
  } 
},

2.執行OCR圖片辨識

import { recognizeOCR, RESULT_TYPE } from '@anytestforpm/ocr';

try {
  //代入要辨識的img url
  let ocrResData = await recognizeOCR(imgUrl);
  //取得后台設定檔失敗
  if (ocrResData.type === RESULT_TYPE.CONFIG_INVALID) {
    //do something
  }
  //圖片辨識功能已停用
  if (ocrResData.type === RESULT_TYPE.CONFIG_DISABLED) {
    //do something
  }
  //驗證成功
  if (ocrResData.type === RESULT_TYPE.KEYWORDS_SUCCESS) {
    //do something
  }
  //驗證不合格 - 關鍵字匹配不合格
  if (ocrResData.type === RESULT_TYPE.KEYWORDS_NOT_FOUND) {
    //do something
  }
  //驗證不合格 - 不合法的關鍵字
  if (ocrResData.type === RESULT_TYPE.KEYWORDS_INVALID) {
    //do something
  }
  //驗證超時
  if (ocrResData.type === RESULT_TYPE.KEYWORDS_TIMEOUT) {
    //do something
  }  
} catch (execption) {
  //do something
}

3.recognizeOCR(imgUrl) ,入參imgUrl
let ocrResData = await recognizeOCR(imgUrl);
mixins.js image

1.4.1

11 days ago

1.4.0

23 days ago

1.3.10

23 days ago

1.3.9

1 month ago

1.3.8

5 months ago

1.3.7

5 months ago

1.3.6

5 months ago

1.3.5

5 months ago

1.3.4

5 months ago

1.3.3

5 months ago

1.3.2

5 months ago

1.3.1

5 months ago

1.2.3

6 months ago

1.3.0

6 months ago

1.2.2

7 months ago

1.2.1

7 months ago

1.2.0

10 months ago

1.1.25

10 months ago

1.1.24

10 months ago

1.1.23

10 months ago

1.1.22

10 months ago

1.1.21

10 months ago

1.1.20

10 months ago

1.1.19

10 months ago

1.1.18

10 months ago

1.1.17

10 months ago

1.1.16

10 months ago

1.1.15

10 months ago

1.1.14

10 months ago

1.1.13

10 months ago

1.1.12

10 months ago

1.1.11

10 months ago

1.1.10

10 months ago

1.1.9

10 months ago

1.1.8

10 months ago

1.1.7

10 months ago

1.1.6

10 months ago

1.1.5

10 months ago

1.1.4

10 months ago

1.1.3

10 months ago

1.1.2

10 months ago

1.1.1

10 months ago

1.1.0

10 months ago

1.0.22

10 months ago

1.0.21

10 months ago

1.0.20

10 months ago

1.0.19

10 months ago

1.0.18

10 months ago

1.0.17

10 months ago

1.0.16

10 months ago

1.0.15

10 months ago

1.0.14

10 months ago

1.0.13

10 months ago

1.0.12

10 months ago

1.0.11

10 months ago

1.0.10

10 months ago

1.0.9

10 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago