Filter point cloud

Hi @an99990,

Calling mat.get_data() will output you an array that has your resolution size (in your case 1080x1920). Each element of the array contains 4 values. Depending on the sl.MEASURE you chose when retrieving your point cloud, your 4 values will either correspond to [X,Y,Z,color] or [X,Y,Z,none].
You can check the API Doc for the details on the existing sl.MEASURE and this post to see how to interpret color info.

If you want to get X,Y,Z coordinates at pixel (i,j), you will need to do something like :

pc_data = mat.get_data()
x = pc_data[i,j,0]
y = pc_data[i,j,1]
z = pc_data[i,j,2]

If you filter your point cloud by removing values from your initial array and end up with an array of different size, you indeed won’t be able to link an array value to the pixel coordinates it corresponds to.
Instead of removing the unwanted values when filtering you can for example set the unwanted values to another value in order to keep the same array size

Hope this helped