Java r与这些图片一样糟糕甚至更差的图片。谢谢分享。你的解码测试有多差?当您将libdmtx与ZXing(加上您的更改)进行比较时,是否注意到解码速率和速度上的差异?感谢您的分享。你的解码测试有多差?当您将libdmtx与ZXing(加上您的更改)进行比较时,是
Java r与这些图片一样糟糕甚至更差的图片。谢谢分享。你的解码测试有多差?当您将libdmtx与ZXing(加上您的更改)进行比较时,是否注意到解码速率和速度上的差异?感谢您的分享。你的解码测试有多差?当您将libdmtx与ZXing(加上您的更改)进行比较时,是,java,barcode,zxing,datamatrix,Java,Barcode,Zxing,Datamatrix,r与这些图片一样糟糕甚至更差的图片。谢谢分享。你的解码测试有多差?当您将libdmtx与ZXing(加上您的更改)进行比较时,是否注意到解码速率和速度上的差异?感谢您的分享。你的解码测试有多差?当您将libdmtx与ZXing(加上您的更改)进行比较时,是否注意到解码速率和速度的差异? public class BarcodeReader { private static Map<DecodeHintType,Object> hintsMap; public st
r与这些图片一样糟糕甚至更差的图片。谢谢分享。你的解码测试有多差?当您将libdmtx与ZXing(加上您的更改)进行比较时,是否注意到解码速率和速度上的差异?感谢您的分享。你的解码测试有多差?当您将libdmtx与ZXing(加上您的更改)进行比较时,是否注意到解码速率和速度的差异?
public class BarcodeReader {
private static Map<DecodeHintType,Object> hintsMap;
public static void main(String...args){
BufferedImage before = null;
hintsMap = new EnumMap<DecodeHintType, Object>(DecodeHintType.class);
hintsMap.put(DecodeHintType.TRY_HARDER, Boolean.TRUE);
hintsMap.put(DecodeHintType.POSSIBLE_FORMATS, EnumSet.allOf(BarcodeFormat.class));
//hintsMap.put(DecodeHintType.PURE_BARCODE, Boolean.FALSE);
try
{
before = ImageIO.read(new File("C:/ocr.jpg"));
decode(before);
/* for(int i=1; i < 1000;i++){
AffineTransform transform = new AffineTransform();
double rad = (double)i/100;
double scale = (double)i/100;
System.out.println("rad "+scale);
//transform.rotate(rad, before.getWidth()/2, before.getHeight()/2);
transform.scale(scale, scale);
BufferedImage after = new BufferedImage(before.getWidth(), before.getHeight(), BufferedImage.TYPE_INT_ARGB);
AffineTransformOp op = new AffineTransformOp(transform, AffineTransformOp.TYPE_BILINEAR);
after = op.filter(before, after);
decode(after);
}*/
//tmpBfrImage = tmpBfrImage.getSubimage(200, 100, 800, 800);
}
catch (IOException tmpIoe)
{
tmpIoe.printStackTrace();
}
}
public static void decode(BufferedImage tmpBfrImage){
if (tmpBfrImage == null)
throw new IllegalArgumentException("Could not decode image.");
LuminanceSource tmpSource = new BufferedImageLuminanceSource(tmpBfrImage);
BinaryBitmap tmpBitmap = new BinaryBitmap(new HybridBinarizer(tmpSource));
MultiFormatReader tmpBarcodeReader = new MultiFormatReader();
Result tmpResult;
String tmpFinalResult;
try
{
if (hintsMap != null && ! hintsMap.isEmpty())
tmpResult = tmpBarcodeReader.decode(tmpBitmap, hintsMap);
else
tmpResult = tmpBarcodeReader.decode(tmpBitmap);
// setting results.
tmpFinalResult = String.valueOf(tmpResult.getText());
System.out.println(tmpFinalResult);
System.exit(0);;
}
catch (Exception tmpExcpt)
{
tmpExcpt.printStackTrace();
}
}
}
ResultPoint pointA = correctPoints(cornerPoints[0], Vertices.TOPLEFT);
ResultPoint pointB = correctPoints(cornerPoints[1], Vertices.BOTTOMLEFT);
ResultPoint pointC = correctPoints(cornerPoints[2], Vertices.TOPRIGHT);
ResultPoint pointD = correctPoints(cornerPoints[3], Vertices.BOTTOMRIGHT);
---
---
private ResultPoint correctPoints(ResultPoint point, Vertices vertice){
if(vertice.equals(Vertices.TOPLEFT))
return new ResultPoint(point.getX()+10, point.getY()+5);
else if(vertice.equals(Vertices.BOTTOMLEFT)){
return new ResultPoint(point.getX()+10, point.getY()-5);
}else if(vertice.equals(Vertices.TOPRIGHT)){
return new ResultPoint(point.getX(), point.getY()+10);
}else{
return new ResultPoint(point.getX()-10, point.getY()-5);
}
}