I have to print this floatbuffer
as array
and there is a function for that in the documentation but the function is not working. I cant understand what am I doing wrong?
I have tried using the floatBuffer.toString()
but it does print the array
that the documentation(ARCore
) has described.Thus not proper results.
Camera camera = frame.getCamera();
CameraIntrinsics cameraIntrinsics=camera.getImageIntrinsics();
float[] focal=cameraIntrinsics.getFocalLength();
Log.e("Focals",Arrays.toString(focal));
int [] getDiminsions=cameraIntrinsics.getImageDimensions();
Log.e("Dimensions ", Arrays.toString(getDiminsions));
backgroundRenderer.draw(frame);
PointCloud pointCloud=frame.acquirePointCloud();
FloatBuffer floatBuffer=pointCloud.getPoints();
FloatBuffer readonly=floatBuffer.asReadOnlyBuffer();
//final boolean res=readonly.hasArray();
final float[] points=floatBuffer.array();
//what should I do
As per the documentation(ARCore
) every point in the floatBuffer
has 4 values:x,y,z coordinates and a confidence value.