MRZ scanner A VisionCamera Frame Processor Plugin to preform mrz detection on images using Tensorflow.
yarn add react-native-vision-camera-plugin-mrz
cd ios && pod install
Add the plugin to your babel.config.js
:
module.exports = {
plugins: [
[
'react-native-reanimated/plugin',
{
globals: ['__mrz'],
},
],
],
}
// ...
Note: You have to restart metro-bundler for changes in the
babel.config.js
file to take effect.
import { mrz } from "react-native-vision-camera-plugin-mrz";
function App() {
const frameProcessor = useFrameProcessor((frame) => {
'worklet'
const mrzInfo = mrz(frame)
console.log(`MRZ info: ${mrzInfo}`)
}, [])
return (
<Camera frameProcessor={frameProcessor} {...cameraProps} />
)
}
mrz(frame)
returns an MRZFrame
with the following data shape. See the example for how to use this in your app.
MRZFrame = {
result: {
text: string, // Raw result text
;
};
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library