Page 1 of 2

Assigning scalar values from one point cloud to another

Posted: Mon Apr 04, 2016 10:40 pm
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

Re: Assigning scalar values from one point cloud to another

Posted: Tue Apr 05, 2016 7:43 am
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

Re: Assigning scalar values from one point cloud to another

Posted: Tue Apr 05, 2016 12:28 pm
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

Re: Assigning scalar values from one point cloud to another

Posted: Tue Apr 05, 2016 3:46 pm
by daniel
Indeed, but the code is not public yet ;)

Re: Assigning scalar values from one point cloud to another

Posted: Tue Apr 05, 2016 4:25 pm
by j-coop
Awesome! That is exactly what I was looking for. Here is a quick&dirty result:

Image

Re: Assigning scalar values from one point cloud to another

Posted: Tue Apr 05, 2016 8:43 pm
by daniel
Have you modified the code or simply interpolated the colors?

Re: Assigning scalar values from one point cloud to another

Posted: Tue Apr 05, 2016 9:10 pm
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++

Re: Assigning scalar values from one point cloud to another

Posted: Wed Nov 27, 2019 9:47 am
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

Re: Assigning scalar values from one point cloud to another

Posted: Wed Nov 27, 2019 9:15 pm
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

Re: Assigning scalar values from one point cloud to another

Posted: Thu Oct 07, 2021 11:31 am
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