Open only1chi opened 1 year ago
@mrousavy Please let me know what it will take to get this done. I'm happy to discuss further or privately.
did you get any solution or any Workable code @mrousavy
Hi yes this is implemented in the latest version!
Hi @mrousavy do you have any example for Android & iOS ?
Also, what values to set in regionOfIntereset
a pixel, dp or something else?
Thanks
@mrousavy As per the latest API documentation, regionOfInterest has not been implemented for Android. v. 3.8.2 https://react-native-vision-camera.com/docs/api/interfaces/CodeScanner
Any updates on this?
You're right, regionOfInterest
is not implemented on Android. idk what was going on in my head when I said it is now implemented, I must've been tripping.
I'll re-open this feature request, but I won't implement it on Android since it is really hard to do so - the MLKit library from Google doesn't provide an API for it, and doing it manually will be very complex.
So there's two solutions:
vision-camera-resize-plugin
first)regionOfInterest
feature. Then I can also add it in VisionCamera.@mrousavy Thank you for the update! I'll take those two solutions into consideration.
What feature or enhancement are you suggesting?
It would be cool to have a way of creating a mask on android devices for the QR code area that you're scanning. The
regionOfInterest
property is supposed to this, but it only works in IOS and not Android.The alternative is to try to create the mask ourselves. However, some android devices return the image in
landscape-left
, some inlandscape-right
, and tablets inportrait
orientation. This leaves the task up to the developer trying to translate the native device coordinate frame, to the react-native analysis frame. With the currentCode
type returned from theCodeScanner
there isn't enough information to do this accurately in a consistent manner. TheCode
type response, returns an object with bounds, and it does not contain the corner points of the QR code scanned. Therefore, it is rather difficult to verify that the image is within a custom scan region (if you try to create one).Implementing
regionOfInterest
in android can solve this problem. Alternatively, you can also implement a masking feature react-native-vision-camera.What Platforms whould this feature/enhancement affect?
iOS, Android
Alternatives/Workarounds
I am trying to use
bounds
property returned in theCode
scanner object. However, I can't accurately trace the corner points of the QR code because I can't consistently transform from the native coordinate frame to the analysis frame.Additional information