New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
boundingBox transformation #13
Comments
Hey @saddy001 did you check https://github.com/bparrishMines/mlkit_demo ? it does draw boxes on detected text already, might help you :) |
I got it. I was using CameraMlVision.size, where I should have used _cameraController.value.previewSize. However, the CameraMlVisionState._cameraController property is private in flutter_camera_ml_vision.dart. Could you please find a way to make it accessible from outside packages or at least define a get-method for previewSize? |
Thanks! |
Hey, at first thanks for this useful package.
Currently I'm drawing bounding boxes around text in the live preview (examples/main_live.dart) with CustomPainter. However, when using the ocrElement.boundingBox left, top, right and bottom properties, the box appears displaced and not directly around the recognized words.
So I guess the coordinates must be scaled or shifted somehow.
For top and bottom, there seems to be a constant scaling factor that fixes the issue (e.g. ocrElement.boundingBox.top * 0.96). For left and right, this is not the case: If the detected text is on the left hand side of the image, the box appears too far right and if it's on the right hand side, the box is too far left.
I had a look at the new ScannerOverlayShape in example/main.dart, but there is much scaling going on. Could you explain how the X and Y coordinates must be transformed to display the boxes at the right location?
The text was updated successfully, but these errors were encountered: