googlesamples / mlkit

A collection of sample apps to demonstrate how to use Google's ML Kit APIs on Android and iOS
Apache License 2.0
3.51k stars 2.92k forks source link

How to obtain the direction of the QrCode #462

Open panyy opened 2 years ago

panyy commented 2 years ago

Use BarCode Scanning Function

zhouyiself commented 2 years ago

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

panyy commented 2 years ago

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

zhouyiself commented 2 years ago

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

panyy commented 2 years ago

getCornerPoints can't judge the direction.

icoderaven commented 5 months ago

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