mrousavy / react-native-vision-camera

📸 A powerful, high-performance React Native Camera library.
https://react-native-vision-camera.com
MIT License
7.34k stars 1.07k forks source link

💭How to process the image captured for OCR scanning? #2604

Closed johnernest02-automanager closed 7 months ago

johnernest02-automanager commented 7 months ago

Question

I have already implemented the OCR scanning frame processor and it works well. But I would like to implement OCR as some sort of fallback from QR scanning when the user taps on the capture button, realizes there is no readable QR code, then checks to see the text on screen. Is this possible?

What I tried

No response

VisionCamera Version

3.8.2

Additional information

xulihang commented 7 months ago

It seems that you need to process the same frame for QR code reading and OCR.

You can try this frame cropping plugin to get the base64 and then use native module methods to process it.

You can add native module methods in a frame processor plugin like this one: https://github.com/tony-xlh/vision-camera-dynamsoft-barcode-reader

mrousavy commented 7 months ago

Not sure if I understand, but if you want to process a local image which has already been captured, then no, that is not part of VisionCamera.