A plugin to Scanning Text,Translate using ML Kit Text Recognition and ML Kit Translation. With High Performance and many features.
react-native-vision-camera = 4.0.5
react-native-worklets-core = 1.3.3
npm install react-native-vision-camera-text-recognition
yarn add react-native-vision-camera-text-recognition
Easy To Use.
Works Just Writing few lines of Code.
Works With React Native Vision Camera.
Works for Both Cameras.
Works Fast.
Works With Android ๐ค and IOS.๐ฑ
Writen With Kotlin and Swift.
Can translate text. ๐
import React, { useState } from 'react'
import { useCameraDevice } from 'react-native-vision-camera'
import { Camera } from 'react-native-vision-camera-text-recognition';
function App (){
const [data,setData] = useState(null)
const device = useCameraDevice('back');
console.log(data)
return(
<>
{!!device && (
<Camera
style={StyleSheet.absoluteFill}
device={device}
isActive
options={{
language: 'latin',
mode: 'translate',
from: 'english',
to: 'german'
}}
callback={(d) => setData(d)}
/>
)}
</>
)
}
export default App;
import React from 'react';
import { StyleSheet } from "react-native";
import {
Camera,
useCameraDevice,
useFrameProcessor,
} from "react-native-vision-camera";
import { useTextRecognition } from "react-native-vision-camera-text-recognition";
function App() {
const device = useCameraDevice('back');
const options = { language : 'latin', mode: 'recognize' }
const {scanText} = useTextRecognition(options)
const frameProcessor = useFrameProcessor((frame) => {
'worklet'
const data = scanText(frame)
console.log(data, 'data')
}, [])
return (
<>
{!!device && (
<Camera
style={StyleSheet.absoluteFill}
device={device}
isActive
frameProcessor={frameProcessor}
/>
)}
</>
);
}
export default App;
Name | Type | Values | Default |
---|---|---|---|
language | string | latin, chinese, devanagari, japanese, korean | latin |
mode | string | recognize, translate | recognize |
from,to | string | See Below | english,german |