- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I used the the code from the python wrapper to get point cloud:
depth = frames.get_depth_frame()
color = frames.get_color_frame()
if not depth or not color:
continue
pc.map_to(color)
points = pc.calculate(depth)
Then I transform the vertex to ndarray:
vtx = np.asarray(points.get_vertices())
vtx_list=vtx.tolist()
vtx=np.array(vtx_list, 'float')
And I try to plot the vertex as scatter points:
fig = pyplot.figure()
ax = Axes3D(fig)
ax.scatter(vtx[:,0], vtx[:,1], vtx[:,2])
pyplot.show()
I get following result:
The graph does not look like it is supposed to be (It should not be just a few straight lines). Anyone knows what I am missing? Thanks MartyG
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Update:
I just found the problem is because of scaling, since the viewer will scale the point cloud according to the XYZ values. I deleted the outliers (i.e. threshold XYZ at 10), and I finally saw my expected result.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm not sure, but I recall a recent case where a point cloud generated in Python was missing data points because their depth was registering as invalid NaN values. I found that someone had written scripting that includes the coordinates of those points in the cloud by making all NaN values have a depth value of '0'.
Once the user had integrated the NaN fix into their application, they kindly posted their script so others could benefit from it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I checked the depth frame data. There are around 197371 zeros values out of 640*480=307200, which is weird.
I just checked the color-depth alignment example, it also has lots of zeros values. Seems like the depth frame is fine, and the problem is from the 'pc.map_to' or 'pc.calculate'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Update:
I just found the problem is because of scaling, since the viewer will scale the point cloud according to the XYZ values. I deleted the outliers (i.e. threshold XYZ at 10), and I finally saw my expected result.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page