Open adnankhan74444 opened 3 weeks ago
Future<void> recognizeArabicText(File imageFile) async { final inputImage = InputImage.fromFile(imageFile); final textRecognizer = TextRecognizer(script: TextRecognitionScript.latin); try { final recognizedTextResult = await textRecognizer.processImage(inputImage); print('RecognizedTextResult: ${recognizedTextResult.text}'); } catch (e) { print('Error during text recognition: $e'); } finally { textRecognizer.close(); } } Future<File> getImageFileFromAssets(String path) async { final byteData = await rootBundle.load('assets/$path'); final file = File('${(await getTemporaryDirectory()).path}/$path'); await file.create(recursive: true); await file.writeAsBytes(byteData.buffer .asUint8List(byteData.offsetInBytes, byteData.lengthInBytes)); return file; } Future<void> getOCRText() async { var assetsFile = await getImageFileFromAssets('002.png'); print('Loaded image: ${assetsFile.path}, Size: ${await assetsFile.length()} bytes'); await recognizeArabicText(assetsFile); }
recognizedTextResult.text always return empty.
It should return the result
Yes
Android, iOS and Android
No response
google_mlkit_text_recognition: ^0.13.1
@bensonarafat any update on this?
Describe your issue. If applicable, add screenshots to help explain your problem.
recognizedTextResult.text always return empty.
Steps to reproduce.
recognizedTextResult.text always return empty.
What is the expected result?
It should return the result
Did you try our example app?
Yes
Is it reproducible in the example app?
Yes
Reproducible in which OS?
Android, iOS and Android
Flutter/Dart Version?
No response
Plugin Version?
google_mlkit_text_recognition: ^0.13.1