Closed thongquach closed 6 months ago
Hey, so about the runAtTargetFps
the src/index.tsx only exports the JSX Camera
but you can access the scanText
function just by importing it with
import { scanText } from 'react-native-vision-camera-v3-text-recognition/src/scanText'
I made a previous implementation of this library which i did use runAtTargetFps
on my frameprocesor along with this plugin
https://github.com/pedrol2b/example-v3-text-recognition/blob/main/App.tsx
I'm opening an PR for @gev2002 for both text-recognition
and barcode-scanner
which exposed the scan methods
until then hope this quick hack helps you
Opened a PR #3 #6
Hi, I appreciate your effort in creating this plugin. Nonetheless, I'm using https://github.com/francesco-clementi-92/vision-camera-ocr-plugin and trying to migrate to this plugin since I encountered some bugs on Android and that library is no longer maintained. Unfortunately:
- The types seems not to be precise. For example,
callback
is defined as a function. Maybe we can be more specific about the input of that function. We can based onOCRFrame
of that library.- In my case, I need to run the frame processor only at 2fps with
runAtTargetFps
. Nonetheless, this cannot be done since your library does not exposescanText
pure version without worklet, can you expose that? For example, in that library, it isscanOCR
.My current code with TS and
scanOCR
:const calculateCameraHeightWorklet = Worklets.createRunInJsFn( (frame: Frame) => { calculateCameraHeight({ frame, cameraWidth: deviceWidth, setCameraHeight, }) } ) const scanContainerInfoWorklet = Worklets.createRunInJsFn( (frame: Frame, ocrFrame: OCRFrame) => { scanContainerInfo({ frame, ocrFrame, setContainerInfo, }) } ) const frameProcessor = useFrameProcessor((frame) => { 'worklet' runAtTargetFps(2, () => { 'worklet' calculateCameraHeightWorklet(frame) const ocrFrame = scanOCR(frame) scanContainerInfoWorklet(frame, ocrFrame) }) }, [])
Thanks a lot for any support!
Hey ! I merge @pedrol2b request. Now you can import scanText and create your Worklets core.
Thanks @pedrol2b @gev2002 for your very quick support <3 I'll try it out.
Hi, I appreciate your effort in creating this plugin. Nonetheless, I'm using https://github.com/francesco-clementi-92/vision-camera-ocr-plugin and trying to migrate to this plugin since I encountered some bugs on Android and that library is no longer maintained. Unfortunately:
callback
is defined as a function. Maybe we can be more specific about the input of that function. We can based onOCRFrame
of that library.runAtTargetFps
. Nonetheless, this cannot be done since your library does not exposescanText
pure version without worklet, can you expose that? For example, in that library, it isscanOCR
.My current code with TS and
scanOCR
:Thanks a lot for any support!