mgcrea / vision-camera-barcode-scanner

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

How to get frame size? #6

Closed joratapok closed 10 months ago

joratapok commented 11 months 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 11 months 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.