1

I am working on an Android application where I want to integrate an object detection model with Augmented Reality (AR). My current setup is working fine with a normal CameraX implementation. However, I am struggling to adapt it to AR.

Here’s what I have:

•   Object Detection Model: A TensorFlow Lite (TFLite) model that provides bounding box values for each input frame (in pixel coordinates).
•   Output: The bounding box coordinates (top, bottom, left, right) and a confidence score for detected objects in the camera frame.

Problem:

Since the model output is frame-based (2D), I am unable to map the bounding boxes to real-world coordinates in AR. I need the bounding boxes to appear correctly positioned in the AR scene, aligned with the detected objects in the real world.

What I Have Tried:

•   Displaying bounding boxes on a CameraX preview — works perfectly.
•   Using Sceneform and ARCore to overlay 3D objects, but I can’t figure out how to map the bounding box from the model to AR coordinates.

My Questions:

1.  How can I map the 2D bounding box (frame coordinates) to 3D world coordinates in AR?
2.  Are there any libraries or tools that simplify this process?
3.  Should I use anchors or some other ARCore functionality to achieve this?

Additional Information:

•   Tools: ARCore, TensorFlow Lite, CameraX
•   Goal: To accurately display the detected object’s bounding boxes in the AR world, so they appear at the correct position relative to the real-world object.

Any guidance, code snippets, or examples would be greatly appreciated!

3
  • Related: How to Detect Physical object in Android Augmented Reality? and 3D reconstruction -- How to create 3D model from 2D image? (closed) You could visually fake the 3-D bounding box by finding any 2-D plane surface adjacent/intersecting with the 2D object detection. Don't know how 'good' it will look without say detecting the tabletop/wall as a plane. Commented Jan 6 at 4:24
  • If you're using arcore, you're not going to find a lot of good answers. It's a rarely used library with mediocre documentation, and a lot of the libraries that made it easier to use are dicontinued. You're going to have to really study how it works at a low level to make this kind of thing usable. Look at the funcitonality on Frame, particularly tansformCoordinated2D and transformCoordinates3D. Commented Jan 6 at 6:26
  • Yes @GabeSechan, I can't find good answers till now. Is this can be done with Unity3D and integrate to android app? Commented Jan 6 at 6:41

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.