Socket
Socket
Sign inDemoInstall

capacitor-vision

Package Overview
Dependencies
0
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    capacitor-vision

Capacitor plugin for Apple Vision (OCR) to extract text from images


Version published
Weekly downloads
0
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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!

Keywords

FAQs

Last updated on 14 Sep 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc