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 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 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; } }