1

I am writing an AR Android application in which I scan QR codes (using the Google Mobile Vision Barcode API) as a trigger and then render objects into the camera view.

As there may be more than one QR code at the same time, I want to access the location of each code on the screen, so that the objects will be rendered on top of each code. At the moment - if there are two QR codes being detected by the camera - the objects will be placed at the exact same position in 3D space.

Example:

There are two QR codes being detected by the camera, one on the left and one on the right of my camera view. Right now, both objects would be rendered in the center of my camera view, as this is the default value of my app.

I want the object related with the left code to appear on the left and the object related with the right code to appear on the right.

I have tried calling Barcode.getBoundingBox().exactCenterX() and [...].exactCenterY() to get a rough value of the code's location, but it does not work out well. Unfortunately I can't find a more suitable method in the documentation.

I can't be the only one who needs the code's location on the screen. How did you guys do that?

Thanks a lot.

Community
  • 1
  • 1
高博衍
  • 53
  • 5

0 Answers0