mgcrea / vision-camera-barcode-scanner

High performance barcode scanner for React Native using VisionCamera
MIT License
87 stars 11 forks source link

How to get frame size? #6

Closed joratapok closed 1 year ago

joratapok commented 1 year ago

I'm trying to filter barcodes that only in square layout, but I don't have frame size, and position in barcodes do not equal screen size or screen resolution

mgcrea commented 1 year ago

I could indeed pass the frame as a second argument to the onBarcodeScanned callback so you can access it easily.

Meanwhile you can also write your own frame processor leveraging scanCodes to access the frame directly, eg. https://github.com/mgcrea/vision-camera-barcode-scanner/issues/5#issuecomment-1761004490.

Regarding the barcode bonding boxes they are quite messy and need pretty complex translations to actually match the camera frame, it is something that is done to compute highlights but I guess I should do it by default in the returned object so that you get useable coordinates outside the box.