Closed kroikie closed 3 years ago
@nachtmaar
The issue at https://github.com/flutter/flutter/issues/36705 has been closed and moved here. Future collaboration on this issue will be done here.
Hi @nachtmaar
If you are still experiencing this issue
with the latest version of Flutter and FlutterFire plugin
can you please provide your updated flutter doctor -v
and your and your flutter run --verbose
/flutter build --verbose
?
Also, to better address the issue, would be helpful
if you could post a self contained app on github
or the steps to reproduce it.
Thank you
Yes, I am still experiencing the issue.
Sample code is at: https://github.com/nachtmaar/flutter-meetup-munich-ocr-demo/pull/1 Please see the PR for more information and let me know if you need more!
$ flutter doctor -v
[✓] Flutter (Channel stable, v1.9.1+hotfix.5, on Mac OS X 10.15 19A602, locale en-DE)
• Flutter version 1.9.1+hotfix.5 at /Users/xxxxx/development/flutter
• Framework revision 1aedbb1835 (10 days ago), 2019-10-17 08:37:27 -0700
• Engine revision b863200c37
• Dart version 2.5.0
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
• Android SDK at /Users/xxxxxx/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.1
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.1, Build version 11A1027
• CocoaPods version 1.8.4
[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 40.2.2
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] VS Code (version 1.39.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.5.1
[✓] Connected device (2 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)
• iPhone 11 • EB26A332-279C-4282-81FF-E2B5DD96AA94 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-1 (simulator)
• No issues found!
cc @collinjackson
I've the same problem with android (Galaxy Tablet A6). If i use the tablet in portrait mode it's all fine, the boxes are show in the right position around the text. When i use the tablet in landscape mode i see the same behaviour of the second image above, all the boxes are not in right place around the text.
@BondarenkoStas @kroikie could you reproduce with the given code? any news?
I updated the dependencies and checked again on iOS. Unfortunately, the bug still exists.
I had another look at the problem. It works if the input image width and height are both smaller than or equal to 1000px. My guess is that the image gets resized above a certain threshold. However, it is unclear to me who does the resizing. The firebase sdk or the Google Vision API.
When using the original image with the Vision API via the demo formular the vertices are drawn correctly.
When using the max dimension of 1000 px everything works:
When leaving the image in its original resolution the vertices are incorrect:
However, the vertices are never totally wrong. It is just a scaling factor which seems to be missing. That's why I think some resizing is going on ...
Given the age and inactivity of this issue I'm going to close this issue in favour of trying the latest release. Also, given the upcoming potential refactor of ML Vision to use the new Google ML Kit sdks as well I'm not sure where the best place for this issue is - as far as I know FlutterFire itself doesn't do any image resizing like mentioned above.
@Salakar let me know then the refactoring is done. I will give it a try :)
When using the new cloud text recognizer introduced in https://github.com/flutter/plugins/pull/1847, the coordinates of the recognized text are not correct on iOS (works on Android). However, text detection works fine.
The problem does not appear when using offline OCR on both platforms. Moreover, the problem with cloud OCR on IOS does not happen on every image. See attached screenshots.
Steps to Reproduce
FirebaseVision.instance.cloudTextRecognizer()
File
Supporting Code:
Coordinates code:
Vision API JSON Representation
Online OCR:
iOS
Android
Offline OCR
iOS
Android
Attachements
Original Image:
Coordinates visualization cloud on iOS. Rectangles are not placed correctly on text.
Coordinates visualization cloud on Android. Rectangles are placed correctly on text
Logs