当前位置: 首页>>代码示例>>Java>>正文


Java MultiDetector类代码示例

本文整理汇总了Java中com.google.zxing.multi.qrcode.detector.MultiDetector的典型用法代码示例。如果您正苦于以下问题:Java MultiDetector类的具体用法?Java MultiDetector怎么用?Java MultiDetector使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MultiDetector类属于com.google.zxing.multi.qrcode.detector包,在下文中一共展示了MultiDetector类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: decodeMultiple

import com.google.zxing.multi.qrcode.detector.MultiDetector; //导入依赖的package包/类
@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 {
      DecoderResult decoderResult = getDecoder().decode(detectorResult.getBits(), hints);
      ResultPoint[] points = detectorResult.getPoints();
      // If the code was mirrored: swap the bottom-left and the top-right points.
      if (decoderResult.getOther() instanceof QRCodeDecoderMetaData) {
        ((QRCodeDecoderMetaData) decoderResult.getOther()).applyMirroredCorrection(points);
      }
      Result result = new Result(decoderResult.getText(), decoderResult.getRawBytes(), points,
                                 BarcodeFormat.QR_CODE);
      List<byte[]> byteSegments = decoderResult.getByteSegments();
      if (byteSegments != null) {
        result.putMetadata(ResultMetadataType.BYTE_SEGMENTS, byteSegments);
      }
      String ecLevel = decoderResult.getECLevel();
      if (ecLevel != null) {
        result.putMetadata(ResultMetadataType.ERROR_CORRECTION_LEVEL, ecLevel);
      }
      if (decoderResult.hasStructuredAppend()) {
        result.putMetadata(ResultMetadataType.STRUCTURED_APPEND_SEQUENCE,
                           decoderResult.getStructuredAppendSequenceNumber());
        result.putMetadata(ResultMetadataType.STRUCTURED_APPEND_PARITY,
                           decoderResult.getStructuredAppendParity());
      }
      results.add(result);
    } catch (ReaderException re) {
      // ignore and continue 
    }
  }
  if (results.isEmpty()) {
    return EMPTY_RESULT_ARRAY;
  } else {
    results = processStructuredAppend(results);
    return results.toArray(new Result[results.size()]);
  }
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:41,代码来源:QRCodeMultiReader.java

示例2: decodeMultiple

import com.google.zxing.multi.qrcode.detector.MultiDetector; //导入依赖的package包/类
public Result[] decodeMultiple(BinaryBitmap image, Map<DecodeHintType, ?> hints) throws
        NotFoundException {
    List<Result> results = new ArrayList();
    for (DetectorResult detectorResult : new MultiDetector(image.getBlackMatrix())
            .detectMulti(hints)) {
        try {
            DecoderResult decoderResult = getDecoder().decode(detectorResult.getBits(), hints);
            ResultPoint[] points = detectorResult.getPoints();
            if (decoderResult.getOther() instanceof QRCodeDecoderMetaData) {
                ((QRCodeDecoderMetaData) decoderResult.getOther()).applyMirroredCorrection
                        (points);
            }
            Result result = new Result(decoderResult.getText(), decoderResult.getRawBytes(),
                    points, BarcodeFormat.QR_CODE);
            List<byte[]> byteSegments = decoderResult.getByteSegments();
            if (byteSegments != null) {
                result.putMetadata(ResultMetadataType.BYTE_SEGMENTS, byteSegments);
            }
            String ecLevel = decoderResult.getECLevel();
            if (ecLevel != null) {
                result.putMetadata(ResultMetadataType.ERROR_CORRECTION_LEVEL, ecLevel);
            }
            if (decoderResult.hasStructuredAppend()) {
                result.putMetadata(ResultMetadataType.STRUCTURED_APPEND_SEQUENCE, Integer
                        .valueOf(decoderResult.getStructuredAppendSequenceNumber()));
                result.putMetadata(ResultMetadataType.STRUCTURED_APPEND_PARITY, Integer
                        .valueOf(decoderResult.getStructuredAppendParity()));
            }
            results.add(result);
        } catch (ReaderException e) {
        }
    }
    if (results.isEmpty()) {
        return EMPTY_RESULT_ARRAY;
    }
    results = processStructuredAppend(results);
    return (Result[]) results.toArray(new Result[results.size()]);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:39,代码来源:QRCodeMultiReader.java

示例3: decodeMultiple

import com.google.zxing.multi.qrcode.detector.MultiDetector; //导入依赖的package包/类
@Override
public Result[] decodeMultiple(BinaryBitmap image, Map<DecodeHintType,?> hints) throws NotFoundException {
  List<Result> results = new ArrayList<Result>();
  DetectorResult[] detectorResults = new MultiDetector(image.getBlackMatrix()).detectMulti(hints);
  for (DetectorResult detectorResult : detectorResults) {
    try {
      DecoderResult decoderResult = getDecoder().decode(detectorResult.getBits(), hints);
      ResultPoint[] points = detectorResult.getPoints();
      Result result = new Result(decoderResult.getText(), decoderResult.getRawBytes(), points,
                                 BarcodeFormat.QR_CODE);
      List<byte[]> byteSegments = decoderResult.getByteSegments();
      if (byteSegments != null) {
        result.putMetadata(ResultMetadataType.BYTE_SEGMENTS, byteSegments);
      }
      String ecLevel = decoderResult.getECLevel();
      if (ecLevel != null) {
        result.putMetadata(ResultMetadataType.ERROR_CORRECTION_LEVEL, ecLevel);
      }
      results.add(result);
    } catch (ReaderException re) {
      // ignore and continue 
    }
  }
  if (results.isEmpty()) {
    return EMPTY_RESULT_ARRAY;
  } else {
    return results.toArray(new Result[results.size()]);
  }
}
 
开发者ID:atomsheep,项目名称:sres-app,代码行数:30,代码来源:QRCodeMultiReader.java

示例4: decodeMultiple

import com.google.zxing.multi.qrcode.detector.MultiDetector; //导入依赖的package包/类
@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 {
            DecoderResult decoderResult = getDecoder().decode(detectorResult.getBits(), hints);
            ResultPoint[] points = detectorResult.getPoints();
            // If the code was mirrored: swap the bottom-left and the top-right points.
            if (decoderResult.getOther() instanceof QRCodeDecoderMetaData) {
                ((QRCodeDecoderMetaData) decoderResult.getOther()).applyMirroredCorrection(points);
            }
            Result result = new Result(decoderResult.getText(), decoderResult.getRawBytes(), points,
                    BarcodeFormat.QR_CODE);
            List<byte[]> byteSegments = decoderResult.getByteSegments();
            if (byteSegments != null) {
                result.putMetadata(ResultMetadataType.BYTE_SEGMENTS, byteSegments);
            }
            String ecLevel = decoderResult.getECLevel();
            if (ecLevel != null) {
                result.putMetadata(ResultMetadataType.ERROR_CORRECTION_LEVEL, ecLevel);
            }
            if (decoderResult.hasStructuredAppend()) {
                result.putMetadata(ResultMetadataType.STRUCTURED_APPEND_SEQUENCE,
                        decoderResult.getStructuredAppendSequenceNumber());
                result.putMetadata(ResultMetadataType.STRUCTURED_APPEND_PARITY,
                        decoderResult.getStructuredAppendParity());
            }
            results.add(result);
        } catch (ReaderException re) {
            // ignore and continue
        }
    }
    if (results.isEmpty()) {
        return EMPTY_RESULT_ARRAY;
    } else {
        results = processStructuredAppend(results);
        return results.toArray(new Result[results.size()]);
    }
}
 
开发者ID:Ag47,项目名称:TrueTone,代码行数:41,代码来源:QRCodeMultiReader.java

示例5: decodeMultiple

import com.google.zxing.multi.qrcode.detector.MultiDetector; //导入依赖的package包/类
@Override
public Result[] decodeMultiple(BinaryBitmap image, Map<DecodeHintType, ?> hints) throws NotFoundException {
    List<Result> results = new ArrayList<Result>();
    DetectorResult[] detectorResults = new MultiDetector(image.getBlackMatrix()).detectMulti(hints);
    for (DetectorResult detectorResult : detectorResults) {
        try {
            DecoderResult decoderResult = getDecoder().decode(detectorResult.getBits(), hints);
            ResultPoint[] points = detectorResult.getPoints();
            Result result = new Result(decoderResult.getText(), decoderResult.getRawBytes(), points,
                    BarcodeFormat.QR_CODE);
            List<byte[]> byteSegments = decoderResult.getByteSegments();
            if (byteSegments != null) {
                result.putMetadata(ResultMetadataType.BYTE_SEGMENTS, byteSegments);
            }
            String ecLevel = decoderResult.getECLevel();
            if (ecLevel != null) {
                result.putMetadata(ResultMetadataType.ERROR_CORRECTION_LEVEL, ecLevel);
            }
            results.add(result);
        } catch (ReaderException re) {
            // ignore and continue
        }
    }
    if (results.isEmpty()) {
        return EMPTY_RESULT_ARRAY;
    } else {
        return results.toArray(new Result[results.size()]);
    }
}
 
开发者ID:yakovenkodenis,项目名称:Discounty,代码行数:30,代码来源:QRCodeMultiReader.java

示例6: decodeMultiple

import com.google.zxing.multi.qrcode.detector.MultiDetector; //导入依赖的package包/类
@Override
public Result[] decodeMultiple(BinaryBitmap image, Map<DecodeHintType,?> hints) throws NotFoundException {
  List<Result> results = new ArrayList<Result>();
  DetectorResult[] detectorResults = new MultiDetector(image.getBlackMatrix()).detectMulti(hints);
  for (DetectorResult detectorResult : detectorResults) {
    try {
      DecoderResult decoderResult = getDecoder().decode(detectorResult.getBits(), hints);
      ResultPoint[] points = detectorResult.getPoints();
      // If the code was mirrored: swap the bottom-left and the top-right points.
      if (decoderResult.getOther() instanceof QRCodeDecoderMetaData) {
        ((QRCodeDecoderMetaData) decoderResult.getOther()).applyMirroredCorrection(points);
      }
      Result result = new Result(decoderResult.getText(), decoderResult.getRawBytes(), points,
                                 BarcodeFormat.QR_CODE);
      List<byte[]> byteSegments = decoderResult.getByteSegments();
      if (byteSegments != null) {
        result.putMetadata(ResultMetadataType.BYTE_SEGMENTS, byteSegments);
      }
      String ecLevel = decoderResult.getECLevel();
      if (ecLevel != null) {
        result.putMetadata(ResultMetadataType.ERROR_CORRECTION_LEVEL, ecLevel);
      }
      if (decoderResult.hasStructuredAppend()) {
        result.putMetadata(ResultMetadataType.STRUCTURED_APPEND_SEQUENCE,
                           decoderResult.getStructuredAppendSequenceNumber());
        result.putMetadata(ResultMetadataType.STRUCTURED_APPEND_PARITY,
                           decoderResult.getStructuredAppendParity());
      }
      results.add(result);
    } catch (ReaderException re) {
      // ignore and continue 
    }
  }
  if (results.isEmpty()) {
    return EMPTY_RESULT_ARRAY;
  } else {
    results = processStructuredAppend(results);
    return results.toArray(new Result[results.size()]);
  }
}
 
开发者ID:ourbeehive,项目名称:AndPlug,代码行数:41,代码来源:QRCodeMultiReader.java

示例7: decodeMultiple

import com.google.zxing.multi.qrcode.detector.MultiDetector; //导入依赖的package包/类
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;
  }
}
 
开发者ID:saqimtiaz,项目名称:BibSearch,代码行数:31,代码来源:QRCodeMultiReader.java


注:本文中的com.google.zxing.multi.qrcode.detector.MultiDetector类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。