0.0.16 • Published 8 months ago

capacitor-vision v0.0.16

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Capacitor-Vision: OCR Plugin for Capacitor with Apple Vision & Google ML Kit

Unlock powerful Optical Character Recognition (OCR) capabilities in your Capacitor applications. With capacitor-vision, tap into Apple Vision for iOS and Google's ML Kit for Android to seamlessly extract text from images.

Installation

Integrate capacitor-vision into your project with just a few commands:

npm install capacitor-vision
npx cap sync

Usage

OCR Scan API

Effortlessly extract text from images with the scan method.

Method Signature:

scan(options: { image: string; }) => Promise<{ text: string[]; }>

Parameters:

  • options: Object containing:
    • image: A base64 encoded string of the image you wish to process.

Returns:

  • A promise resolving to an object containing an array of extracted text strings.

Example:

Extract text from a base64 formatted image:

import { CapacitorVision } from 'capacitor-vision';

const imageBase64 = "YOUR_BASE64_ENCODED_IMAGE_HERE";

CapacitorVision.scan({ image: imageBase64 })
  .then(response => {
    console.log(response.text);  // Logs the extracted text from the image
  })
  .catch(error => {
    console.error("OCR error:", error);
  });

Apps Using capacitor-vision

  • AiTutor - A homework helper app that uses capacitor-vision to extract text from images of math problems.

Are you using capacitor-vision in your app? Submit a PR to add it to the list!

0.0.13

10 months ago

0.0.14

10 months ago

0.0.15

10 months ago

0.0.16

8 months ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago