rodgomesc / vision-camera-code-scanner

VisionCamera Frame Processor Plugin to read barcodes using MLKit Vision QrCode Scanning
MIT License
336 stars 222 forks source link

What are the coordinates of corner points relative to? #84

Open quimbaget opened 2 years ago

quimbaget commented 2 years ago

I learned that for react native vision camera, all the frames returned are of the size 640x480.

I've been trying to draw a rectangle around the detected barcodes by the camera, but when I put the corner points of the barcode detected into the screen, they don't match with the barcode.

I suppose that is because I am putting the frame in full screen in the mobile, so it gets resized from 640x480.

Do you have any recommendations in order to use the barcode corner points correctly since the resize frame plugin of the library is still in progress ?

lucasahlgrenToxic commented 2 years ago

@quimbaget I am dealing with the same problem. Did you find any solution?

codeapp17 commented 2 years ago

@lucasahlgrenToxic you can set the specific format to the vision camera , and then get pixel ratio using format width by camera width and same with height. Dividing that pixel ratio with corner points will get screen coordinates and we can filter the results then.