Assigning scalar values from one point cloud to another

Feel free to ask any question here
j-coop
Posts: 4
Joined: Wed Mar 23, 2016 7:12 pm

Assigning scalar values from one point cloud to another

Post by j-coop »

Hi,

I was wondering if anyone has an approach to assign scalar values from on point cloud to another. I have two point clouds created by SfM photogrammetry with having the R,G,B colors assigned to the points the other with NIR assigned to the points. Now the geometries of the two point clouds are very similar, however since the datasets are from two consecutive flights, the points are not on top of each other. Ideally I would like to merge the two clouds and to have R,G,B,NIR as scalar fields (NDVI calculation etc). Any ideas on this? I assume I'd need some sort of 3D neighborhood function to do so.

Thank you!

Jakob
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Assigning scalar values from one point cloud to another

Post by daniel »

In CC there's already a function to do this with the colors ('interpolate from another entity' - see http://www.cloudcompare.org/doc/wiki/in ... her_entity).

It would be rather easy to do the same thing with a scalar field. In the code the entrey point is here:
https://github.com/cloudcompare/trunk/b ... .cpp#L1109
Daniel, CloudCompare admin
Dimitri
Posts: 156
Joined: Mon Oct 18, 2010 9:01 am
Location: Rennes (France)
Contact:

Re: Assigning scalar values from one point cloud to another

Post by Dimitri »

Hi Daniel,

I think there's also the function implemented in qCanupo when you apply the classification result from core points to the point cloud.

Cheers

Dim
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Assigning scalar values from one point cloud to another

Post by daniel »

Indeed, but the code is not public yet ;)
Daniel, CloudCompare admin
j-coop
Posts: 4
Joined: Wed Mar 23, 2016 7:12 pm

Re: Assigning scalar values from one point cloud to another

Post by j-coop »

Awesome! That is exactly what I was looking for. Here is a quick&dirty result:

Image
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Assigning scalar values from one point cloud to another

Post by daniel »

Have you modified the code or simply interpolated the colors?
Daniel, CloudCompare admin
j-coop
Posts: 4
Joined: Wed Mar 23, 2016 7:12 pm

Re: Assigning scalar values from one point cloud to another

Post by j-coop »

For now I just converted the R,G,B values from one cloud to scalar fields, then deleted the colors. Then interpolated the colors of the other cloud to the now un-colored cloud. The newly assigned R,G,B values were again converted to scalar fields which then lets me do some calculations such as NDVI, NDWI etc. As I said it was just a quick solution. I will look into modifying the code but I'm new to C++
justtheone
Posts: 1
Joined: Wed Nov 27, 2019 9:37 am

Re: Assigning scalar values from one point cloud to another

Post by justtheone »

I'm stealing the thread, but I didn't want to start the new one for just one question.

Is there a paper published on "Scalar fields - Interpolate from another entity" or can someone just direct me on some literature describing what is happening in the background of the filter/algorithm?

Thank you
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Assigning scalar values from one point cloud to another

Post by daniel »

No paper. We just look for each point of the 'destination' cloud the nearest neighbors in the 'source' cloud and compute the average / median / weighted average of the neighbors scalar values.

See https://www.cloudcompare.org/doc/wiki/i ... her_entity
Daniel, CloudCompare admin
Cova_Prendes
Posts: 3
Joined: Wed Sep 15, 2021 12:35 pm

Re: Assigning scalar values from one point cloud to another

Post by Cova_Prendes »

hi! I have followed the steps you indicate in the answers and I have taken the scalar field (which is Z coordinate referred to the ground, named Zo) from one point cloud to another. However when I export the resulting point cloud, it doesn´t contain the Zo coordinate. Do you have any idea why is this happening?

Thanks in advance
Post Reply