2

I would like to do the following with my application in Project Tango:

  1. Read the Point cloud data.
  2. Filter the points using PCL
  3. Segment Points Using PCL RANSAC plane fitting algorithm
  4. Color each segment
  5. Display the point cloud segmented with different color on the screen

I have reach step 3 now, and my problem is how to display the points. what I need is an output similar to the plane-fitting C++ example provided by Google. I'm using java point cloud example with native code. I need the displaying to ensure of the filter step and the segmenting output.

My problem is that I don't have any idea how should I perform the visualization in Android from PCL?.

Thanks

sakurami
  • 343
  • 3
  • 18

1 Answers1

2

For simple task like this, pure OpenGL could work. Tango sample code uses a render library called Rajawalli, which is used more for games.

xuguo
  • 1,816
  • 1
  • 11
  • 15
  • Thank you @Jason-Guo, I will check the Rajawalli library, but could you please explain if I add a thread inside the onXyzIjAvailable() function and in that thread I sent the xyz from java to JNI function to read the flaotbuffer and save it in a PCL point vector and after that I did apply the down-sampling and RANSAC segmentation. Where should I add the code for visualizing, is it better to add it inside the thread or is there any better way for that? – sakurami Apr 13 '16 at 06:43
  • sakurami, I'm not very familiar with the PCL visualization. You can use openGL or Rajawalli on rendering. One thing you need to pay attention is that when you create a new thread to send data to PCL, you need to copy the buffer to it, because the buffer from Tango callback will be destroyed when the stack unwind.. On the visualization part, you could retrieve the data from PCL (I assume), then send it to the render loop to draw out. The render loop could be OpenGL, Rajawalli, or any 3D render code could render points. – xuguo Apr 18 '16 at 18:01
  • Any Android Studio (Java) project that uses Rajawali to generate a mesh from Tango PCL captures? – Matthew Sep 03 '16 at 14:26
  • @Matthew You can look at this project, maybe it can help you https://github.com/stetro/project-tango-poc.git – sakurami Oct 05 '16 at 17:54
  • @sakurami Yes, that's the kind of project I'm talking about, but it's based on a pretty old version of Rajawali and more importantly it depends on several packages not included in the project (or in gradle). – Matthew Oct 05 '16 at 20:38
  • @Matthew I did explored the code, which I saw it very useful and sometimes I return to it to help me out, but I never test it or run it in my Tango (as you said it depend on a lot of packages). I'm new in Rajawalli field, so I don't have that knowledge in its versions. – sakurami Oct 20 '16 at 21:05
  • Google's Tango dev team has released a Java example app that captures a point cloud and builds meshes from it, visualizing the scene in OpenGL as it builds: https://github.com/googlesamples/tango-examples-java/tree/master/java_mesh_builder_example – Matthew Oct 25 '16 at 21:55