💭 Getting incorrect coordinates and bounds when using CodeScanner when scanning barcodes #3011
Open
4 tasks done
Labels
💭 question
Further information is requested
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
The text was updated successfully, but these errors were encountered: