本文整理汇总了Java中com.google.zxing.aztec.detector.Detector类的典型用法代码示例。如果您正苦于以下问题:Java Detector类的具体用法?Java Detector怎么用?Java Detector使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Detector类属于com.google.zxing.aztec.detector包,在下文中一共展示了Detector类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: decode
import com.google.zxing.aztec.detector.Detector; //导入依赖的package包/类
@Override
public Result decode(BinaryBitmap image, Map<DecodeHintType,?> hints)
throws NotFoundException, FormatException {
AztecDetectorResult detectorResult = new Detector(image.getBlackMatrix()).detect();
ResultPoint[] points = detectorResult.getPoints();
if (hints != null) {
ResultPointCallback rpcb = (ResultPointCallback) hints.get(DecodeHintType.NEED_RESULT_POINT_CALLBACK);
if (rpcb != null) {
for (ResultPoint point : points) {
rpcb.foundPossibleResultPoint(point);
}
}
}
DecoderResult decoderResult = new Decoder().decode(detectorResult);
Result result = new Result(decoderResult.getText(), decoderResult.getRawBytes(), points, BarcodeFormat.AZTEC);
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);
}
return result;
}
示例2: decode
import com.google.zxing.aztec.detector.Detector; //导入依赖的package包/类
@Override
public Result decode(BinaryBitmap image, Map<DecodeHintType, ?> hints)
throws NotFoundException, FormatException {
AztecDetectorResult detectorResult = new Detector(image.getBlackMatrix()).detect();
ResultPoint[] points = detectorResult.getPoints();
if (hints != null) {
ResultPointCallback rpcb = (ResultPointCallback) hints.get(DecodeHintType.NEED_RESULT_POINT_CALLBACK);
if (rpcb != null) {
for (ResultPoint point : points) {
rpcb.foundPossibleResultPoint(point);
}
}
}
DecoderResult decoderResult = new Decoder().decode(detectorResult);
Result result = new Result(decoderResult.getText(), decoderResult.getRawBytes(), points, BarcodeFormat.AZTEC);
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);
}
return result;
}
示例3: decode
import com.google.zxing.aztec.detector.Detector; //导入依赖的package包/类
public Result decode(BinaryBitmap binarybitmap, Map map)
{
AztecDetectorResult aztecdetectorresult = (new Detector(binarybitmap.getBlackMatrix())).detect();
com.google.zxing.ResultPoint aresultpoint[] = aztecdetectorresult.getPoints();
if (map != null)
{
ResultPointCallback resultpointcallback = (ResultPointCallback)map.get(DecodeHintType.NEED_RESULT_POINT_CALLBACK);
if (resultpointcallback != null)
{
int i = aresultpoint.length;
for (int j = 0; j < i; j++)
{
resultpointcallback.foundPossibleResultPoint(aresultpoint[j]);
}
}
}
DecoderResult decoderresult = (new Decoder()).decode(aztecdetectorresult);
Result result = new Result(decoderresult.getText(), decoderresult.getRawBytes(), aresultpoint, BarcodeFormat.AZTEC);
java.util.List list = decoderresult.getByteSegments();
if (list != null)
{
result.putMetadata(ResultMetadataType.BYTE_SEGMENTS, list);
}
String s = decoderresult.getECLevel();
if (s != null)
{
result.putMetadata(ResultMetadataType.ERROR_CORRECTION_LEVEL, s);
}
return result;
}
示例4: decode
import com.google.zxing.aztec.detector.Detector; //导入依赖的package包/类
public Result decode(BinaryBitmap image, Hashtable hints)
throws NotFoundException, FormatException {
AztecDetectorResult detectorResult = new Detector(image.getBlackMatrix()).detect();
ResultPoint[] points = detectorResult.getPoints();
if (hints != null && detectorResult.getPoints() != null) {
ResultPointCallback rpcb = (ResultPointCallback) hints.get(DecodeHintType.NEED_RESULT_POINT_CALLBACK);
if (rpcb != null) {
for (int i = 0; i < detectorResult.getPoints().length; i++) {
rpcb.foundPossibleResultPoint(detectorResult.getPoints()[i]);
}
}
}
DecoderResult decoderResult = new Decoder().decode(detectorResult);
Result result = new Result(decoderResult.getText(), decoderResult.getRawBytes(), points, BarcodeFormat.AZTEC);
if (decoderResult.getByteSegments() != null) {
result.putMetadata(ResultMetadataType.BYTE_SEGMENTS, decoderResult.getByteSegments());
}
if (decoderResult.getECLevel() != null) {
result.putMetadata(ResultMetadataType.ERROR_CORRECTION_LEVEL, decoderResult.getECLevel().toString());
}
return result;
}
示例5: decode
import com.google.zxing.aztec.detector.Detector; //导入依赖的package包/类
public Result decode(BinaryBitmap image, Map<DecodeHintType, ?> hints) throws
NotFoundException, FormatException {
ReaderException e;
NotFoundException notFoundException = null;
FormatException formatException = null;
Detector detector = new Detector(image.getBlackMatrix());
ResultPoint[] points = null;
DecoderResult decoderResult = null;
try {
AztecDetectorResult detectorResult = detector.detect(false);
points = detectorResult.getPoints();
decoderResult = new Decoder().decode(detectorResult);
} catch (NotFoundException e2) {
notFoundException = e2;
} catch (FormatException e3) {
formatException = e3;
}
if (decoderResult == null) {
try {
detectorResult = detector.detect(true);
points = detectorResult.getPoints();
decoderResult = new Decoder().decode(detectorResult);
} catch (ReaderException e4) {
e = e4;
if (notFoundException != null) {
throw notFoundException;
} else if (formatException == null) {
throw formatException;
} else {
throw e;
}
} catch (ReaderException e42) {
e = e42;
if (notFoundException != null) {
throw notFoundException;
} else if (formatException == null) {
throw e;
} else {
throw formatException;
}
}
}
if (hints != null) {
ResultPointCallback rpcb = (ResultPointCallback) hints.get(DecodeHintType
.NEED_RESULT_POINT_CALLBACK);
if (rpcb != null) {
for (ResultPoint point : points) {
rpcb.foundPossibleResultPoint(point);
}
}
}
Result result = new Result(decoderResult.getText(), decoderResult.getRawBytes(), points,
BarcodeFormat.AZTEC);
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);
}
return result;
}