You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CustomPaint(
foregroundPainter: new DetectedTextBoxPainter(_ValueNotifier),//new TestPainter(_ValueNotifier),
child: new AspectRatio(
aspectRatio: _controller.value.aspectRatio,
//child: CameraPreview(_controller)
child: CameraMlVision<VisionText>(
resolution: ResolutionPreset.max,
detector:
FirebaseVision.instance.textRecognizer().processImage,
onResult: (VisionText vt) {
if (!mounted ) {
return;
}
if (vt.text.length == 0) return;
_ValueNotifier.value = new Tuple2(vt, _controller.value.aspectRatio);
},
)
)
),
The controller, which is usually passed to CameraPreview, is used to calculate screen position using aspectRatio, but CameraMlVision doesn't accept a controller.
How can I get the aspectRatio in onResult?
What I tried:
if I multiply the aspectRatio by 0.88 it solves the problem, but it will probably not work on other devices.
I tries to copy the implementation of CameraMlVision and expose the controller, but the aspectRatio is still off
I tried to use the CameraImage width and height, but it returns the same value, ie. aspectRatio = height/width
I tried to disable Scaffold, because I thought maybe the AppBar is responsible for the 12% error - it didn't work.
The text was updated successfully, but these errors were encountered:
I have the following code:
The controller, which is usually passed to
CameraPreview
, is used to calculate screen position usingaspectRatio
, butCameraMlVision
doesn't accept a controller.How can I get the
aspectRatio
inonResult
?What I tried:
if I multiply the aspectRatio by 0.88 it solves the problem, but it will probably not work on other devices.
I tries to copy the implementation of
CameraMlVision
and expose the controller, but the aspectRatio is still offI tried to use the CameraImage width and height, but it returns the same value, ie. aspectRatio = height/width
I tried to disable
Scaffold
, because I thought maybe theAppBar
is responsible for the 12% error - it didn't work.The text was updated successfully, but these errors were encountered: