Hi Rafael,
I'm working on exactly same issue for two days. The information is hard to find, but this is what I got til now:
Somebody also with this problem: https://groups.google.com/forum/#!searchin/zxing/coordinate/zxing/MSaLOuBaLKM/3djqWfBKY54J
A class that supose to do the job (but I can't make it work - there is no enough information): https://zxing.github.io/zxing/apidocs/com/google/zxing/qrcode/detector/FinderPatternInfo.html
What I did to work:
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;
}
}
And, whith result you can do:
//position of reference
posX = result.getResultPoints()[1].getX();
posY = result.getResultPoints()[1].getY();
Note:
result.getResultPoints() contains 3 points, that are the tree main corners.
That is it! Works for me.
Sorry, there are a lithe mistake, this code is for QRCode, but for BarCode I believe is very similar.
My resultpoint[] return 2 itens:
[0] - x-> 172.0 and y -> 150.0
[1] - x-> 847.0 and y-> 150.0
Looking in my analized image ... What is the relationship of the points with the barcode since they are not at the ends of barcode found (red points) ?
This is the position of "guard pattern" or "guard bars".
Take a look at :
http://stackoverflow.com/questions/11340996/is-zxing-providing-upc-barcodes-coordinates-on-the-screen
and
http://www.av1611.org/666/barcode.html
What is your main objective?
Works. Thanks a lot about explanation, Gustavo.
You're welcome
Boa sorte