我正在为我的android项目使用Zxing库。我正在通过Intent.I扫描二维码。我可以获得二维码内容。但我不知道如何获得它的对齐图案位置,这是除了最简单的二维码之外,所有其他地方都能找到的较小的正方形图案。我如何访问它?任何帮助都将不胜感激。谢谢!
发布于 2015-11-07 01:14:37
private Result readQRCode(BufferedImage bi){
BinaryBitmap binaryBitmap;
Result result;
try{
binaryBitmap = new BinaryBitmap( new HybridBinarizer(new BufferedImageLuminanceSource( bi )));
result = new QRCodeReader().decode(binaryBitmap);
return result;
}catch(Exception ex){
ex.printStackTrace();
return null;
}
}result.getResultPoints()包含3个点,它们是树的主角。所以,你可以这样做:
//position of reference
posX = result.getResultPoints()[1].getX();
posY = result.getResultPoints()[1].getY();就这样!
https://stackoverflow.com/questions/27823628
复制相似问题