VisionCamera Frame Processor Plugin to detect and read MRZ data from passports using MLKit Text Recognition.
yarn add @op-engineering/op-ocrAdd the following permission to the AndroidManifest.xml located at ~/android/app/src/AndroidManifest.xml
<uses-permission android:name="android.permission.CAMERA"/>import * as React from 'react';
import { StyleSheet, View } from 'react-native';
import { MRZProperties, MRZScanner } from '@op-engineering/op-ocr';
export default function App() {
return (
<View style={styles.container}>
<MRZScanner
mrzFinalResults={(mrzResults: MRZProperties) => {
// do something with the results
console.log('mrzResults: ', JSON.stringify(mrzResults, null, 2));
}}
/>
</View>
);
}
const styles = StyleSheet.create({
container: {
height: '100%',
width: '100%',
alignItems: 'center',
justifyContent: 'center',
},
});See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT