Unable to detect large Aztec codes using BarCodeScanner/Camera

Hi,

Using BarCodeScanner or Camera I can pretty easily detect any type of bar codes, including Aztec codes. But for some reason Aztec codes with edges larger than about 70-75 modules are rarely detected and those with edge larger than 80 aren’t detected at all, event on perfect conditions when code is on plain white surface and fills the preview. Doesn’t matter if Camera is set to detect only Aztec codes or any type. I tested on two Android phones and one iPhone with pretty much same results.

I use https://racoindustries.com/barcodegenerator/2d/aztec-code/ to test various sizes of codes.

My guess is that codes are too complex to be detected live on high resolution frames (see line https://github.com/expo/expo/blob/57db1352c0b95296b15e2dacde154afb5c88bc6f/android/expoview/src/main/java/versioned/host/exp/exponent/modules/api/components/camera/ExpoCameraView.java#L113). Unfortunately I see no way to limit the resolution of frames.

Is there a way to change resolution on the preview or maybe limit fps?

Is there a way I could take a picture (instead of camera preview, so I could adjust the resolution) and pass it to bar codes detector (like creating BarCodeScannerAsyncTask in onPictureTaken in ExpoCameraView)?

Or some way to expose com.google.android.gms.vision.barcode.BarcodeDetector api to javascript so I could pass any frame I like?

I also played a bit with detecting codes serverside (mostly using ZXing library) but with at most similar results. If anyone could recommend something in java world that would be also cool.

I wouldn’t want to detach to ExpoKit, since it’s the only issue I have right now.

Excelent job by the way, Expo is really great. It’s my second app using this tech. Also greetings to other devs playing with Expo using Clojurescript :smiley:

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.