-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get an extra feature from point clouds and set it as a scalar field? #51
Comments
Hi, I'm not sure if I understood your question correctly. If not, maybe can you provide a small data set and more details on what you do usually with the CloudCompare GUI? Regards, |
Dear Paul, Thanks for your quick reply. Yes, it helps. But can I directly use one of the features of the point cloud, e.g., label, to color the point cloud? For example, the columns of my ply files are as follows. How can I get the "label" field from the ply file, and then fill the scalar field using numpy? It seems "ccPointCloud" has not provided a function to extract an extra field into a numpy array. Best regards, Eric. |
Dear Eric, I think the column title is important. I hope this can help you out. I'll see if it's possible to change the behavior in CloudComPy to systematically interpret additional columns as scalarFields regardless of their name. I'd rather avoid a complex, .ply file-specific setup to reproduce all the flexibility of the CloudCompare GUI! Regards,
|
Hi, Paul. Thanks for your reply. Indeed, if I save the ply file with the "label" field in cloudcompare first, I can get the values of column "label" using "scalar_label" in cloudcompy. Just like what I have mentioned in my first question, but actually, not all files can be conveniently saved with a scalar field using cloudcompare in advance, especially for batch work. So if possible, a new function can be added to directly extract additional features of the point cloud. Just like that, to get the "label" field, pcd = cc.loadPointCloud("xxx.ply") Nevertheless, this library is good enough. Thank you for your help. Cheers, Eric. |
I agree with you: the idea is not to manually change the column title. I still think the best option I have is to force all additional columns as scalarFields to be read regardless of their name. Otherwise, from CloudComPy, I won't be aware of the existence of these columns, discarded by the ply reader. |
Yeah, totally agree. Thanks. |
…ly reader, extra scalar fields selection (issue CloudCompare#51)
Hello, |
Wow, many thanks. Will have a try. |
Hi, thanks for your great work.
I have a problem about coloring the point cloud using an extra feature.
Normally, I can set a feature of point cloud, e.g., "label" as a scalar field to manually color the point cloud in cloudcompare.
But when I used this library, I found no way to extract the "label" field from the point cloud and set it as a scalar field.
The class "ccPointCloud" only provides functions to get the arrays of positions and colors.
Another finding is that if I saved the scalar field in cloudcompare, I could directly get the feature values using pcd.getScalarField(0).toNpArray().
But not all files are saved with a scalar field in advance. How can I get the "label" field and set it as a scalar field using cloudcompy?
Have I missed some parts of the library?
Hope you can give me some help.
Many thanks,
Eric.
The text was updated successfully, but these errors were encountered: