Cloud/mesh distance and projection

To post any request/idea for new functionalities
palmitoale
Posts: 6
Joined: Tue May 12, 2015 4:17 pm

Cloud/mesh distance and projection

Post by palmitoale »

Hello,

the cloud/mesh distance functionnality allows to compute the shortest distance from a point to a mesh.
Could it be possible to calculate the distance along a projection ?

For instance, distance of a point to a mesh but using a vertical projection and not the shortest distance ?

This could be useful when we have a XYZ cloud, and a mesh representing the water level (calculated by any software), to calculate water heigth.

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

Re: Cloud/mesh distance and projection

Post by daniel »

This one would require a completely different process. Therefore even though the algorithm would be rather simple, it will require some integration work.

I'll add this to the TODO list. We should discuss about this with people at the LNHE as they often have similar needs.
Daniel, CloudCompare admin
Dimitri
Posts: 156
Joined: Mon Oct 18, 2010 9:01 am
Location: Rennes (France)
Contact:

Re: Cloud/mesh distance and projection

Post by Dimitri »

That's easily feasible with M3C2 in vertical mode or C2C (using the Z component). I use it quite often for this application:
. turn your mesh into a point cloud (with a density similar to your bed data)
. Use M3C2 to operate a vertical differencing between the bed point cloud and the water point cloud. You can create a first a grid of point from your bed topography (using rasterize), to use it as core points, and outputs directly the water depth computed by M3C2 over a grid. Bonus: you get the measurement of bed roughness from M3C2.
. Otherwise use C2C with water as the reference point cloud, and then look at the Z component. Not as precise as M3C2, but can be good enough and is a bit faster as there's less manipulations.

Hope this helps
daniel
Site Admin
Posts: 7717
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Cloud/mesh distance and projection

Post by daniel »

Indeed!
Daniel, CloudCompare admin
palmitoale
Posts: 6
Joined: Tue May 12, 2015 4:17 pm

Re: Cloud/mesh distance and projection

Post by palmitoale »

Hi,

thanks for the tips, it works perfectly.

It is true that the rasterize tool is pretty powerful and if we use it correcly, it's possible to calculate volumes easily.
For instance : water height summed up, on a 5x5 m grid, gives volume/25.

Daniel, I think it would be interesting (that's could be part of the histogramm stuff to be developped I guess) to have the sum of the scalad field over every point of a cloud. If you don't know what to do of your nights...

Thank you again, you can add [SOLVED] in the topic's title.
muha
Posts: 2
Joined: Wed May 27, 2015 5:40 pm

Re: Cloud/mesh distance and projection

Post by muha »

Hey,

I have a similar problem, so I hope it's okay to use this thread.

I have a digital terrain modell as a pointcloud with 1m raster cells. I want to compare this cloud to an erratic dense pointcloud obtained by photogrammetry and get only the height distance between those two. Since I want to have the height difference saved in the photogrammetry pointcloud I need to use the terrain modell as reference. How do I do this.
Do I really have to mesh the terrain modell, then subsample (but to which density?) it again and use M3C2 in vertical mode? Or is there any better way to do this yet?

Thanks in advance!
daniel
Site Admin
Posts: 7717
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Cloud/mesh distance and projection

Post by daniel »

Doesn't the M3C2 plugin has an option to output the distances on the 'reference' cloud? (the 'Project core points on' option in the 'Output' tab).

But I never use this option so I'm not 100% sure. Otherwise you could use a quite big projection diameter so as to use the low density terrain model as reference? And of course the idea of meshing and sampling points is not that bad (but you should keep it as a 'last resort' plan if the other ways don't work).

Don't hesitate to ask Dimitri Lague directly also!
Daniel, CloudCompare admin
Dimitri
Posts: 156
Joined: Mon Oct 18, 2010 9:01 am
Location: Rennes (France)
Contact:

Re: Cloud/mesh distance and projection

Post by Dimitri »

muha wrote:Hey,

I have a similar problem, so I hope it's okay to use this thread.

I have a digital terrain modell as a pointcloud with 1m raster cells. I want to compare this cloud to an erratic dense pointcloud obtained by photogrammetry and get only the height distance between those two. Since I want to have the height difference saved in the photogrammetry pointcloud I need to use the terrain modell as reference. How do I do this.
Do I really have to mesh the terrain modell, then subsample (but to which density?) it again and use M3C2 in vertical mode? Or is there any better way to do this yet?

Thanks in advance!
Hi Muha,

extremely simple with M3C2, and no need to mesh:
. choose your DTM as cloud #1
. choose the unorganized point cloud as cloud #2
. select your parameters in M3C2:
Normal scale : you don't care as it's a vertical differencing (be sure to select vertical normal in the "normal" tab"
projection scale : around 1.4 m (to be sure to cover all the surface corresponding to each pixel))
projection depth: 2 times the maximum distance between your point clouds.
Core points: use cloud #1 (i.e. the raster)
And in the output tab, select: keep original position: it will map the difference on the original raster.

Enjoy

Dimitri
muha
Posts: 2
Joined: Wed May 27, 2015 5:40 pm

Re: Cloud/mesh distance and projection

Post by muha »

Hi,

thank you both very much for your quick help.

Seems like this is exactly what I needed, Dimitri.
Unfortunately I think I didn't make one point really clear. I wan't to have the vertical distances saved in the unorganized point cloud, not in the raster DTM, so I can get as much information out of it as possible. So I switched the two clouds and made the same selections, only problem was that this wouldn't give me the right orientation for the distance even if I switched the prefered orientation to "-Z".
I eventually switch back to DTM = cloud #1 and unorganized = cloud #2, than I selected cloud #2 to in the dropdown in core points - use other cloud. I think I have my desired result now. Just wanted to check if this was the right way.


Edit:

Actually there is one question that bugs me. How does the plugin know what vertical really means? Does it compute one normal for all points in respect of the whole cloud? Or does it obtain this information from the Z-coordinate of the cloud?
I'm generating the dense pointcloud with Agisoft PhotoScan which actually also gives me the option of exporting normals with the pointcloud. So I could even use them, but I'm not sure in which neighborhood they are computed. This is just nitpicking, but I'm kind of interested in this topic now :)


Thanks again for your help.
Dimitri
Posts: 156
Joined: Mon Oct 18, 2010 9:01 am
Location: Rennes (France)
Contact:

Re: Cloud/mesh distance and projection

Post by Dimitri »

HI Muha,

when the vertical mode is used, M3C2 considered (quite logically, I'd say ;-)) that the normal is oriented along the Z direction. If you want to compute a normal at large scale (not necessarily all the point cloud as it'd requires a specific process and could be quite long if you use all the points), then you should use the 3D mode and very large normal scale, or you could use the normal calculated by Photoscan, but you'd have to be sure that the orientation is correct.

Dimitri
Post Reply