Open shehanGuruge opened 2 months ago
Guten Tag, Hans here.
[!NOTE] New features, bugfixes, updates and other improvements are all handled mostly by
@mrousavy
in his free time. To support@mrousavy
, please consider 💖 sponsoring him on GitHub 💖. Sponsored issues will be prioritized.
Any luck with this? I am getting unexpected results from the bounds, getting negative values... Do you know what order the corners are by any chance? The docs are very unhelpful on this.
Question
I am using react-native-vision-camera v4.1.0, and I implemented the CodeScanner as per the docs. However every time I scan a barcode I am getting incorrect width which is in range of 3 - 10 in IOS. Hence it's impossible to map those values to the screen width and height and limit the scan area
What I tried
This is what I have done so far,
My Code Scanner looks like this
This is how I have set the codeScanner
I am also using onLayout to map the coordinates to the width and height of the camera view and limit the scan area like below
This is the response I get
Scanned [{"value":"1234567890128","corners":[{"x":929.5000279190813,"y":801.097824131347},{"x":932.5000393631731,"y":801.0978240575837},{"y":397.90094443226377,"x":932.5000080310912},{"x":929.4999965869994,"y":397.90094450602703}],"frame":{"width":3.000011444091797,"x":929.5000076293945,"height":403.1969118118286,"y":397.9009437561035},"type":"ean-13"}] codes!
As you can see the frame width is always within 3 and 10 irrespective of how closer or away the phone/camera is from the code. Any way I could fix this? Any suggestions how I could limit the scan area using this library?
VisionCamera Version
4.0.1
Additional information