aarongrider / vision-camera-ocr

VisionCamera Frame Processor Plugin to detect text in real time using MLKit Text Detector (OCR)
MIT License
235 stars 86 forks source link

fix: fix ocr scanning method name mismatch #7

Open stanleyugwu opened 2 years ago

stanleyugwu commented 2 years ago

The global __scanOCR method specified in babel.config.js does not match the method called in the example scanOCR. It throws error saying Can't find variable: scanOCR

markrickert commented 1 year ago

I actually think that the import is incorrect in the readme example. It's referencing an import from vision-camera-image-labeler instead of this library.

import { labelImage } from "vision-camera-image-labeler";

// ...
const frameProcessor = useFrameProcessor((frame) => {
  'worklet';
  const scannedOcr = scanOCR(frame);
}, []);

should be:

import { scanOCR } from 'vision-camera-ocr';

// ...
const frameProcessor = useFrameProcessor((frame) => {
  'worklet';
  const scannedOcr = scanOCR(frame);
}, []);