Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Occlusion in Tango AR Camera

I have a simple Tango Unity app which uses the Tango AR Camera prefab to display a 3D object in augmented reality.

Following this question, I wanted to try out the occlusion feature provided by TangoARScreen.

Therefore I have:

  • checked the "Enable Occlusion" checkbox
  • enabled depth detection in Tango Manager
  • added a Tango Point Cloud with Update points mesh enabled.

However the 3D object never gets hidden by foreground real-world objects. What am I missing?

Is there any sample project that demonstrates this "Enable Occlusion" feature?

like image 787
sdabet Avatar asked Jun 21 '16 07:06

sdabet


3 Answers

Try to look in the Unity Examples, the one named ExperimentalMeshOcclusion.

I just ran it and the occlusion there works well, so you can see the scene objects and the code being used.

like image 161
Oren Avatar answered Nov 07 '22 05:11

Oren


In order to use occlusion on TnagoARScreen, you have to check the Update Points Mesh checkbox on TangoPointCloud prefab in the scene.

like image 22
xuguo Avatar answered Nov 07 '22 05:11

xuguo


There is no sample, but here's steps to alter an existing sample to turn it on. Tested working on the Phab2.

  1. Start from the Area Learning Example.
  2. Load the scene in Unity and Open "Tango Point Cloud" Inspector from your Hierarchy.
  3. Tick "Update Points Mesh" under the "Tango Point Cloud" script.
  4. Open the "Tango AR Camera" Inspector.
  5. Tick "Enable Occlusion" under the "Tango AR Screen" script
  6. Run the app and make sure you are testing by placing a mark behind a good sized object, and moving far enough back so that the depth sensor can see the object. Rendering the Point cloud data to screen can help you make sure that you are getting the input from Depth sensor that you expect.

I do find better results using the Experimental sample referenced by @Oren

like image 3
Jethro Avatar answered Nov 07 '22 04:11

Jethro