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) {
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++) {
List<FinderPattern> possibleCenters = getPossibleCenters(); int size = possibleCenters.size();
List<FinderPattern> possibleCenters = getPossibleCenters(); int size = possibleCenters.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) {
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()]); } }
Vector possibleCenters = getPossibleCenters(); int size = possibleCenters.size();
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; } }