You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you know the index of the points that you want to change, you can assign RGB values to individual points as follows:
importnumpyasnpfrompyntcloudimportPyntCloudcloud=PyntCloud.from_file("tests/data/diamond.ply")
# Should show 4 red points, 1 blue, 1 green.cloud.plot()
point_to_change=0new_rgb=np.array([255, 255, 255], dtype=np.uint8)
cloud.points.loc[point_to_change, ["red", "green", "blue"]] =new_rgb# Should show 3 red points, 1 blue, 1 green and 1 white.cloud.plot()
That's perfect! For anyone else searching for the error KeyError: "['red' 'green' 'blue'] not in index", I fixed this by starting with a DataFrame like:
Is it possible to change the colours of individual points in a pointcloud? For example, having a different RGB value assigned to specific points.
Thanks for the library, BTW, has been very useful.
The text was updated successfully, but these errors were encountered: