public DetectorResult[] detectMulti(Hashtable hints) throws NotFoundException { BitMatrix image = getImage(); MultiFinderPatternFinder finder = new MultiFinderPatternFinder(image); FinderPatternInfo[] info = finder.findMulti(hints); if (info == null || info.length == 0) { throw NotFoundException.getNotFoundInstance(); } Vector result = new Vector(); for (int i = 0; i < info.length; i++) { try { result.addElement(processFinderPatternInfo(info[i])); } catch (ReaderException e) { // ignore } } if (result.isEmpty()) { return EMPTY_DETECTOR_RESULTS; } else { DetectorResult[] resultArray = new DetectorResult[result.size()]; for (int i = 0; i < result.size(); i++) { resultArray[i] = (DetectorResult) result.elementAt(i); } return resultArray; } }
public FinderPatternInfo[] findMulti(Map<DecodeHintType,?> hints) throws NotFoundException { boolean tryHarder = hints != null && hints.containsKey(DecodeHintType.TRY_HARDER); boolean pureBarcode = hints != null && hints.containsKey(DecodeHintType.PURE_BARCODE); BitMatrix image = getImage(); int maxI = image.getHeight(); int maxJ = image.getWidth(); if ((currentState & 1) == 0) { // Counting black pixels if (currentState == 4) { // A winner? if (foundPatternCross(stateCount) && handlePossibleCenter(stateCount, i, j, pureBarcode)) { // Yes if (foundPatternCross(stateCount)) { handlePossibleCenter(stateCount, i, maxJ, pureBarcode); FinderPattern[][] patternInfo = selectMutipleBestPatterns(); List<FinderPatternInfo> result = new ArrayList<>(); for (FinderPattern[] pattern : patternInfo) {
public FinderPatternInfo[] findMulti(Hashtable hints) throws NotFoundException { boolean tryHarder = hints != null && hints.containsKey(DecodeHintType.TRY_HARDER); BitMatrix image = getImage(); int maxI = image.getHeight(); int maxJ = image.getWidth(); if ((currentState & 1) == 0) { // Counting black pixels if (currentState == 4) { // A winner? if (foundPatternCross(stateCount)) { // Yes boolean confirmed = handlePossibleCenter(stateCount, i, j); if (!confirmed) { do { // Advance to next black pixel if (foundPatternCross(stateCount)) { handlePossibleCenter(stateCount, i, maxJ); FinderPattern[][] patternInfo = selectBestPatterns(); Vector result = new Vector(); for (int i = 0; i < patternInfo.length; i++) {
Vector possibleCenters = getPossibleCenters(); int size = possibleCenters.size(); Collections.insertionSort(possibleCenters, new ModuleSizeComparator());
public Result[] decodeMultiple(BinaryBitmap image, Hashtable hints) throws NotFoundException { Vector results = new Vector(); DetectorResult[] detectorResult = new MultiDetector(image.getBlackMatrix()).detectMulti(hints); for (int i = 0; i < detectorResult.length; i++) { try { DecoderResult decoderResult = getDecoder().decode(detectorResult[i].getBits()); ResultPoint[] points = detectorResult[i].getPoints(); Result result = new Result(decoderResult.getText(), decoderResult.getRawBytes(), points, BarcodeFormat.QR_CODE); if (decoderResult.getByteSegments() != null) { result.putMetadata(ResultMetadataType.BYTE_SEGMENTS, decoderResult.getByteSegments()); } if (decoderResult.getECLevel() != null) { result.putMetadata(ResultMetadataType.ERROR_CORRECTION_LEVEL, decoderResult.getECLevel().toString()); } results.addElement(result); } catch (ReaderException re) { // ignore and continue } } if (results.isEmpty()) { return EMPTY_RESULT_ARRAY; } else { Result[] resultArray = new Result[results.size()]; for (int i = 0; i < results.size(); i++) { resultArray[i] = (Result) results.elementAt(i); } return resultArray; } }
public DetectorResult[] detectMulti(Map<DecodeHintType,?> hints) throws NotFoundException { BitMatrix image = getImage(); ResultPointCallback resultPointCallback = hints == null ? null : (ResultPointCallback) hints.get(DecodeHintType.NEED_RESULT_POINT_CALLBACK); MultiFinderPatternFinder finder = new MultiFinderPatternFinder(image, resultPointCallback); FinderPatternInfo[] infos = finder.findMulti(hints); if (infos.length == 0) { throw NotFoundException.getNotFoundInstance(); } List<DetectorResult> result = new ArrayList<>(); for (FinderPatternInfo info : infos) { try { result.add(processFinderPatternInfo(info)); } catch (ReaderException e) { // ignore } } if (result.isEmpty()) { return EMPTY_DETECTOR_RESULTS; } else { return result.toArray(new DetectorResult[result.size()]); } }
public FinderPatternInfo[] findMulti(Map<DecodeHintType,?> hints) throws NotFoundException { boolean tryHarder = hints != null && hints.containsKey(DecodeHintType.TRY_HARDER); boolean pureBarcode = hints != null && hints.containsKey(DecodeHintType.PURE_BARCODE); BitMatrix image = getImage(); int maxI = image.getHeight(); int maxJ = image.getWidth(); if ((currentState & 1) == 0) { // Counting black pixels if (currentState == 4) { // A winner? if (foundPatternCross(stateCount) && handlePossibleCenter(stateCount, i, j, pureBarcode)) { // Yes if (foundPatternCross(stateCount)) { handlePossibleCenter(stateCount, i, maxJ, pureBarcode); FinderPattern[][] patternInfo = selectMutipleBestPatterns(); List<FinderPatternInfo> result = new ArrayList<>(); for (FinderPattern[] pattern : patternInfo) {
List<FinderPattern> possibleCenters = getPossibleCenters(); int size = possibleCenters.size(); Collections.sort(possibleCenters, new ModuleSizeComparator());
@Override public Result[] decodeMultiple(BinaryBitmap image, Map<DecodeHintType,?> hints) throws NotFoundException { List<Result> results = new ArrayList<>(); DetectorResult[] detectorResults = new MultiDetector(image.getBlackMatrix()).detectMulti(hints); for (DetectorResult detectorResult : detectorResults) { try {
public DetectorResult[] detectMulti(Map<DecodeHintType,?> hints) throws NotFoundException { BitMatrix image = getImage(); ResultPointCallback resultPointCallback = hints == null ? null : (ResultPointCallback) hints.get(DecodeHintType.NEED_RESULT_POINT_CALLBACK); MultiFinderPatternFinder finder = new MultiFinderPatternFinder(image, resultPointCallback); FinderPatternInfo[] infos = finder.findMulti(hints); if (infos.length == 0) { throw NotFoundException.getNotFoundInstance(); } List<DetectorResult> result = new ArrayList<>(); for (FinderPatternInfo info : infos) { try { result.add(processFinderPatternInfo(info)); } catch (ReaderException e) { // ignore } } if (result.isEmpty()) { return EMPTY_DETECTOR_RESULTS; } else { return result.toArray(new DetectorResult[result.size()]); } }
List<FinderPattern> possibleCenters = getPossibleCenters(); int size = possibleCenters.size(); Collections.sort(possibleCenters, new ModuleSizeComparator());
@Override public Result[] decodeMultiple(BinaryBitmap image, Map<DecodeHintType,?> hints) throws NotFoundException { List<Result> results = new ArrayList<>(); DetectorResult[] detectorResults = new MultiDetector(image.getBlackMatrix()).detectMulti(hints); for (DetectorResult detectorResult : detectorResults) { try {