About the loading of point cloud

hello,I use this: point_cloud.write(file_name) to save point cloud.And I get a file 0.ply,like this:ply
format ascii 1.0
element vertex 520712
property float x
property float y
property float z
property uchar red
property uchar green
property uchar blue
end_header
-2.316577 1.411975 -2.083041 172 193 224
-2.306743 1.408357 -2.077704 171 192 223
-2.302844 1.408357 -2.077704 170 191 222
-1.434491 0.932553 -1.375765 152 167 190
-1.414838 0.926446 -1.366756 151 165 189

But I can not correctly load the point cloud in the following way:point_cloud.read(point_cloud_file). The coordinates obtained are blank.Can you help me ?

I see point_cloud.read(point_cloud_file) can only read png or jpeg.Can we read files such as .ply?

Hi, can you send more context ? What kind of code did you use ?

Hi,
I use python.
The .ply file like this:
ply
format ascii 1.0
element vertex 520712
property float x
property float y
property float z
property uchar red
property uchar green
property uchar blue
end_header
-2.316577 1.411975 -2.083041 172 193 224
-2.306743 1.408357 -2.077704 171 192 223
-2.302844 1.408357 -2.077704 170 191 222
-1.434491 0.932553 -1.375765 152 167 190
-1.414838 0.926446 -1.366756 151 165 189
-1.406756 0.922826 -1.361416 152 165 189
-1.404201 0.922826 -1.361416 153 165 189
-1.396350 0.919339 -1.356271 153 164 187
-1.393805 0.919339 -1.356271 153 164 186
-1.391260 0.919339 -1.356271 153 164 185
-1.368629 0.911050 -1.344043 159 168 185
-1.371378 0.914565 -1.349229 170 179 194
-1.367200 0.913466 -1.347607 186 196 208
-1.416475 0.948141 -1.398762 200 209 222
-1.755281 1.222496 -1.803509 249 255 253
-1.736636 1.211847 -1.787799 249 255 253
-1.733282 1.211847 -1.787799 249 255 253
-1.726662 1.209560 -1.784425 249 255 253

Each row after is composed of six numbers like this:-0.395744 0.323674 -0.477505 237 242 246

I meant, your code. Your python file.

Hi,
Firsty,I use the following codes to save point cloud:
# save point cloud
# file_name = “{}.ply”.format(temp)
# err = point_cloud.write(file_name)
The .ply file like this:
//
ply
format ascii 1.0
element vertex 520712
property float x
property float y
property float z
property uchar red
property uchar green
property uchar blue
end_header
-2.316577 1.411975 -2.083041 172 193 224
-2.306743 1.408357 -2.077704 171 192 223
-2.302844 1.408357 -2.077704 170 191 222
//
Then,in the other file,I want to read the point cloud.

for i in range(5):

point_cloud_file = f"{i}.ply"
print(point_cloud_file)

point_cloud = sl.Mat(res.width, res.height, sl.MAT_TYPE.F32_C4, sl.MEM.CPU)
point_cloud.read(point_cloud_file)

width = point_cloud.get_width()
height = point_cloud.get_height()

x = width // 2
y = height // 2

coordinates = point_cloud.get_value(x, y)

print(coordinates)

But, I didn 't find the corresponding function.By using function point_cloud.read(point_cloud_file), we got the blank coordinates.By consulting the manual, I found that read can only read png format file.Do you have any way to read point cloud data

Hi, you should check our tutorials and sample which explain how to retrieve the data from sl.Mat.
Start here : https://github.com/stereolabs/zed-sdk/blob/master/depth%20sensing/depth%20sensing/python/depth_sensing.py