friend. I seeketh thy assistance in recognizing the text from an image. I hath utilized tesseract.js for this purpose. Pray, how may I rectify this matter?
import Tesseract from 'tesseract.js';
const recognizeImage = async () => {
try {
console.log("image uri ==> ", image.uri);
const result = await Tesseract.recognize(image.uri, 'eng', {});
setRecText(result);;
} catch (err) {
console.log(err);
}
};
return (
<TouchableOpacity onPress={recognizeImage}>
<Text style={styles.button}>Recognize</Text>
</TouchableOpacity>
)
In terminal
Image uri:
file:///data/user/0/com.recoginize_poke/cache/rn_image_picker_lib_temp_09d32693-dd14-44ff-a7a7-cbbeab1d6001.png
[ReferenceError: Property 'document' doesn't exist]