I am currently developing a scanner that reads multiple QR codes found in one image. I manage to read the QR codes in the image but it's giving me inconsistent results. Assuming there are 4 QR codes in the image, sometimes I can read 2 and sometimes 3 or just 1. Unlike in the original scanner (ZXing Scanner) it decodes fast. While in my case, I have to make sure there is enough light and the image is not blurred to decode it.

I am using the QRCodeMultiReader to decode the image. Currently using ZXing Library to create the application.

Below is the snippet of my code:

public void onPictureTaken(byte[] data, Camera camera) {
   BitmapFactory.Options opt = new BitmapFactory.Options();
    opt.inMutable = true;
   Bitmap bitmap = BitmapFactory
            .decodeByteArray(data, 0, data.length, opt);
   Hashtable<DecodeHintType, Object> hints = new Hashtable<DecodeHintType, Object>();
   hints.put(DecodeHintType.TRY_HARDER, Boolean.TRUE);
   LuminanceSource source = new RGBLuminanceSource(bitmap);

   QRCodeMultiReader multiReader = new QRCodeMultiReader();
   Result[] results = multiReader.decodeMultiple(new BinaryBitmap(
   new HybridBinarizer(source)), hints);
}
Edit
Report