- DetectorResult result = new Detector(image).detect();
- text = decoder.decode(result.getBits());
- points = result.getPoints();
+ DetectorResult detectorResult = new Detector(image.getBlackMatrix()).detect(hints);
+ decoderResult = decoder.decode(detectorResult.getBits(), hints);
+ points = detectorResult.getPoints();
+ }
+
+ Result result = new Result(decoderResult.getText(), decoderResult.getRawBytes(), points, BarcodeFormat.QR_CODE);
+ if (decoderResult.getByteSegments() != null) {
+ result.putMetadata(ResultMetadataType.BYTE_SEGMENTS, decoderResult.getByteSegments());