mlkit icon indicating copy to clipboard operation
mlkit copied to clipboard

How to obtain the direction of the QrCode

Open panyy opened this issue 3 years ago • 6 comments

panyy avatar Mar 11 '22 09:03 panyy

Use BarCode Scanning Function

panyy avatar Mar 11 '22 11:03 panyy

Can you clarify what does 'direction' mean here? Is it refers to the direction of QrCode's bounding box or something else?

zhouyiself avatar Mar 19 '22 00:03 zhouyiself

yes,Is it refers to the direction of QrCode's bounding box

panyy avatar Mar 25 '22 01:03 panyy

You can get it from Barcode#getCornerPoints https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getCornerPoints()

zhouyiself avatar Mar 25 '22 05:03 zhouyiself

getCornerPoints can't judge the direction.

panyy avatar Apr 11 '22 06:04 panyy

Hi! I have the same issue - specifically, it seems like the QR code detection seems to assign the top left corner to be aligned with the rotation of the MLKit InputImage - the rotation parameter seems to define the vertical axis that determines the criteria for the corner to be top left - However, QR codes have orientation squares that define a static ordering of the corners - these are almost surely detected as part of parsing the code contents. It would be great for the API to provide the corners based on the static ordering of these orientation corners.

Also see https://stackoverflow.com/questions/44249483/orientation-corners-of-a-qr-code https://github.com/googlesamples/android-vision/issues/103

icoderaven avatar Apr 13 '24 00:04 icoderaven