2.0.0 • Published 2 years ago

react-native-japanese-ocr v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

react-native-japanese-ocr

A React-Native package for preforming OCR on Japanese text using Google MLKit TextRecognition v2

Installation

npm install react-native-japanese-ocr

Usage

import { ocr } from "react-native-japanese-ocr";

// ...

const result = await ocr(path).then(response => ...);
import { ocrFromURL } from "react-native-japanese-ocr";

// ...

const result = await ocrFromURL(url).then(response => ...);

Example Response

  [
    {
      "bounding": {
        "height": 0.0,
        "width": 0.0,
        "origin": {
          "x": 0.0,
          "y": 0.0
        }
      },
      "text": "",
      "lines": [
        {
          "text": "",
          "bounding": {
            "height": 0.0,
            "width": 0.0,
            "origin": {
              "x": 0.0,
              "y": 0.0
            }
          },
          "elements": [
            {
              "text": "",
              "bounding": {
                "height": 0.0,
                "width": 0.0,
                "origin": {
                  "x": 0.0,
                  "y": 0.0
                }
              },
              "cornerPoints": [
                {
                  "x": 0.0,
                  "y": 0.0
                },
                {
                  "x": 0.0,
                  "y": 0.0
                },
                {
                  "x": 0.0,
                  "y": 0.0
                },
                {
                  "x": 0.0,
                  "y": 0.0
                }
              ]
            }
          ],
          "cornerPoints": [
            {
              "x": 0.0,
              "y": 0.0
            },
            {
              "x": 0.0,
              "y": 0.0
            },
            {
              "x": 0.0,
              "y": 0.0
            },
            {
              "x": 0.0,
              "y": 0.0
            }
          ]
        }
      ],
      "cornerPoints": [
        {
          "x": 0.0,
          "y": 0.0
        },
        {
          "x": 0.0,
          "y": 0.0
        },
        {
          "x": 0.0,
          "y": 0.0
        },
        {
          "x": 0.0,
          "y": 0.0
        }
      ]
    }
  ]

Uses Google MLKit TextRecognition v2

documentation

License

MIT