Hello to everyone. I am making a barcode reader wi...
# compose
t
Hello to everyone. I am making a barcode reader with Jetpack compose and zxing library. I just want to have the rectangle area analyzed. Anyone have an idea about this?
a
So to be fair, the rectangle in most apps are usually just for decoration
Try messages for web bar code scanner for example
t
It is a bit important as I will use it for product counting. sometimes there are barcodes next to each other.That's why barcodes get mixed up
a
Are they identical?
t
No datamatrix and ean13
a
And also, this question is kinda general outside of the compose world as well, it might serve you well to ask in other places too, especially since it might be better suited to be handled by your barcode reader lib
If you're getting different information then it might be worth checking if it's already scanned
t
I think it has to do with Camerax. But I have no idea how to do it. Thanks your answer 🙂
s
I faced the same problem a couple of months ago (but was a barcode scanner). I just couldn't make zxing process the whole image because the result accuracy was low. I ended up doing the following (which worked): • Set the same target resolution for both preview and image analysis. I used an hardcoded size (1080 x 1920) which should be supported by every device; • Use the same calculation you use to draw the centered rectangle to create the
cropRect
to pass to
PlanarYUVLuminanceSource
- you should get a decent accuracy
t
Thanks. I will try this:)