I added a hook, similar to the one in vision-camera-code-scanner so you don't have to manually deal with all the frame processor worklet and javascript thread stuff yourself.
Now, you can just do:
import { useScanOCR } from "vision-camera-ocr";
// ...
const [frameProcessor, ocrData] = useScanOCR();
React.useEffect(() => {
// This effect will run every time the frameprocessor gets different data.
if (ocrData) {
console.log('Got Data: ', ocrData);
}
}, [ocrData]);
return (
<Camera
// ...
frameProcessor={frameProcessor}
frameProcessorFps='auto'
/>
)
I also fixed a typo in the readme usage section that should close #7
I added a hook, similar to the one in vision-camera-code-scanner so you don't have to manually deal with all the frame processor worklet and javascript thread stuff yourself.
Now, you can just do:
I also fixed a typo in the readme usage section that should close #7