Is there a way to access the pixel pixels of a tango point camera in Java

So, I know about setSurface and have no problem using it as an overlay or anything else - on surface control. However, I'm focused on getting pixel data

1) I tried everything that I could (control, root, etc.) use the drawing cache functions to get a bit for the camera surface. No no. A cached bitmap always has a value of zero.

2) I used both SurfaceView and GLSurfaceView successfully as a setSurface tag. I cannot use any other class like TextureView.

3) I explored the C API, and I see that the camera provides connectOnFrameAvailable, which will give me access to pixels.

I guess the internal tango logic just uses the surface in java to access the base bit channel. API C requires a texture identifier, which makes me suspect at the end of the day, camera data is sent to the GPU quite quickly, and I'm sure CUDA lib works on it - given the state of things, I cannot figure out how to get a bit on the Java side without rooted devices - just because I have a texture or a simple representation of the surface displaying the raw bits on the screen does not mean that I can get to them.

I do not want to clear the image data from the GPU. I would need to switch my busy animation from the hour to the calendar for this.

Before diving into API C, is there a way to get camera bits in Java? I really want to be able to associate them with a certain pose, but now I canโ€™t even figure out how to get them. I really want to know the location and color of the 3D point. The internal cameras, point cloud and 2d image that generate the point cloud, I need. But I canโ€™t do anything if I canโ€™t get the pixels, and the more dubious the connection between the image and the (pose and pointcloud) sketchier, all efforts will become.

If I dive into C, will connectOnFrameAvailable give me what I need? How well synchronizes with point cloud generation? Oh, and did I succeed? A color camera is used for depth, is a fisheye used for posture?

Is it possible to mix Java and C, i.e. instantiate Tango in Java and then just use C for image problem? Or will I have to rethink everything in C and stop using java tango jar?

+5
source share
1 answer
  • will connectOnFrameAvailable give me what i need?

Yes, it does return a YUV byte buffer.

  • How well synchronizes with point cloud generation?

The Tango API itself does not provide synchronization between the color image and the cloud of the point of depth, however, it does provide a timestampe that allows you to synchronize at the application level.

  • A color camera is used for depth, is a fisheye used for posture?

Yes you are right.

  • Is it possible to mix Java and C (i.e. create an instance of Tango in Java, and then just use C for an image problem) Starting two instances of Tango is actually not what Tango supported, even though it works, he will be extremely hacker.

As a temporary walk, perhaps you might try to use the view drawing cache?

0
source

Source: https://habr.com/ru/post/1210871/


All Articles