SFraissTU / BA_PointCloud

PointCloud-BachelorThesis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Change color of points with new attributes( Classificattion, intensity, height)

akharroubi opened this issue · comments

Hello!

Thank you very much for making this project available, it's simply awesome.

I'm working on a point cloud visualizer in VR with unity and I want to add new attributes like Classification, Intensity and Height for points, and also to be able to visualize just some classes.

I've tried to do it with modifications in( cloudLoader, PointAttributes, and defaultMeshConfiguration). With an UI i maked it work very good, but i have a problem in how to refresh in runtime all GameObjects already reandered in the scene with my new color
Do you have any method to refresh all GameObjects already rendered in scene with my classification colors for exemple? If not, do you maybe have some clues to give me so I can try doing it myself?

Thanks a lot for your answer!

Hi! Thanks for your compliments and your interest!

So one thing that might help you is the Reload-property of the DefaultMeshConfiguration. If you set it to true (for example by hitting the checkbox in the editor) while the program is running, the materials of all GameObject are updated, such that the changes you make to the configuration (such as point radius, interpolation mode etc.) get applied. The property is set back to false automatically after updating.
If it's necessary, you could update this behaviour (which is implemented at the beginning of DefaultMeshConfiguration::Update) by also changing the attributes of the components of the GameObject. So for example, I guess it should be possible to access the MeshFilter, and change the colors-attribute of the Mesh, such that it fits your classification colors.

Simon

Hi Simon,

thank you for your consistent response, indeed the change of attributes (rgb, classification, intensity) works perfectly after adding lines of code in DefaultMeshConfiguration.

In fact my final goal is even bigger, and consists of interacting with the classes present in my cloud of points (tree, car, ground, trotoir ...) for example once I point one of these elements( a car for exemple have the classe id 10) the rest is off. what do you think of the idea of ​​intercation using this dynamic structure of potree? is this feasible? will the visualization be always with a 90 FPS and more or no? and if you have ideas on how to proceed with the main line of the approach to follow because the structure of potree apparently remains a dynamic structure and has less control with all these GameObjects created and removed in real time.

Thank you

Kharroubi

So as long as you do not mean to change the point cloud, but just do some kind of point picking or something like that, it should be manageable with this data structure. In fact, Markus Schütz, the guy behind Potree and the Potree format (which I am using), actually mentions this in his master thesis (https://publik.tuwien.ac.at/files/publik_252607.pdf chapter 5.3.1). But I did not really look into this so far. Maybe this helps you.

Simon

Hey Simon,

thank you very much for your quick response, and thank you for the proposal it will help me enormously. I will try to implement this solution as possible and I'll keep you informed.

Kharroubi

commented

hey Simon,

Have you successfully deploy the point cloud to VR ? Because i have a problem to build. I could not see the point with hololens . i try to put the file in build file still doesnot work. Do you have any idea. Thanks.

Hi,

Here is an approch, if you want to take into consideration new attributes( intensity, classification...), first I add some modifications, here they are;
I added all the new attributes in the script "PointAttrributs"
Then I created a ByteSize () function in "Cloud_Loader" which calculates the pointByteSize so that you will not need to modify this number each time.
And I added an additional condition in LoadPoints() to integrate the new attributes in the function node.SetPoints (), and it is necessary to modify also in the script "Node.cs" the functions SetPoints () and CreateGameObjects (), by after it is necessary to modify in the script "MeshConfiguration" the function CreateGameObjectet () finally to manage the display of the point cloud with the intensity or the classification is to manage at the level of the script "DefaultMeshConfiguration" more exactly in the function CreateGameObject () at the level of Mesh.colors

public static int ByteSize(PointCloudMetaData metaData) { string[] Attributes = new string[] { "POSITION_CARTESIAN", "COLOR_PACKED", "INTENSITY", "CLASSIFICATION", "SOURCE_ID" }; int[] Size = new int[] { 12, 4, 2, 1, 2 }; int pointByteSize = 0; foreach (string pointAttribute in metaData.pointAttributes) { for (int i = 0; i < Attributes.Length; i++) { if (pointAttribute.Equals(Attributes[i])) { pointByteSize += Size[i]; } } } return pointByteSize; }