I am working on an application that reads QR codes and I need code orientation. ZXING source claims that orientation can be obtained from the ResultMetaData strong> hash table via the ORIENTATION key
Now my problem is that getResultMetaData () does not return any results when I run the following:
orientation = (Integer) Returned[v].getResultMetadata().get("ORIENTATION");
However, the line directly above it,
points = Returned[v].getResultPoints();
It works fine, so I know that the code is read and it returns data.
Does anyone know of a fix for this or another method of getting orientation?
Last note: I use QRCodeMultiReader , so Returned is an array.
Thanks Zander
EDIT I just found that getResultMetaData strong> only supports orientation for 1D barcodes, so I think the questions now are: How do I get the orientation of a QR code?
EDIT # 2 Here is the code for getting the rotation (doesn't support perspectives)
ResultPoint a= points[1]; ResultPoint b= points[2]; ResultPoint c= points[0]; float distance = Math.abs(a.getX()-b.getX()); RectF rect = new RectF(a.getX(), a.getY(), a.getX()+distance, a.getY()+distance);
source share