You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been using a camera before, and I'm going to introduce vision-camera-ocr for a new function.
But I tried to follow the example, but it didn't work.
If you run like this, runOnJS says it can't find it, but it doesn't work.
What is the problem and how do I solve it?
[package information]
react-native-vision-camera : 3.0.0
vision-camera-ocr : 1.0.0
react-native-reanimated : 3.5.1
react-native-worklets-core : 0.2.0
[code]
import {Camera, useCameraDevices, useFrameProcessor} from 'react-native-vision-camera';
import {runOnJS} from 'react-native-reanimated'
import { OCRFrame, scanOCR } from 'vision-camera-ocr';
const App = () => {
const camera = useRef<any>(null); // 카메라 화면
const devices = useCameraDevices();
const device = devices.back; // 후면 카메라 사용
const [ocr, setOcr] = React.useState<OCRFrame>();
const frameProcessor = useFrameProcessor((frame) => {
'worklet';
const data = scanOCR(frame);
runOnJS(setOcr)(data);
}, []);
...
return(
<Camera
ref={camera}
style={{
height: '100%',
width: windowWidth,
}}
device={device}
isActive={showCamera}
photo={true}
fps={240}
frameProcessor={frameProcessor}
/>
)
}
I've been using a camera before, and I'm going to introduce vision-camera-ocr for a new function.
But I tried to follow the example, but it didn't work.
If you run like this, runOnJS says it can't find it, but it doesn't work.
What is the problem and how do I solve it?
[package information]
[code]
[babel.config.js]
The text was updated successfully, but these errors were encountered: