01_user_documentation:groimp-platform:pointcloudtools
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| 01_user_documentation:groimp-platform:pointcloudtools [2025/01/24 11:59] – ↷ Links adapted because of a move operation gaetan | 01_user_documentation:groimp-platform:pointcloudtools [2025/01/24 17:04] (current) – removed gaetan | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Point cloud tools ====== | ||
| - | |||
| - | This wiki present the base tools included in the [[https:// | ||
| - | |||
| - | Every tools presented here are available both from GUI or from RGG code. The projects used to create the images are available from the example explorer embedded in GroIMP. The tools consider the local transformation of the point cloud. The coordinate of the Point are local in relatively to the Point cloud Node. | ||
| - | |||
| - | See more: | ||
| - | |||
| - | * [[01_user_documentation: | ||
| - | * [[tutorials: | ||
| - | |||
| - | === Using tools from the GUI === | ||
| - | |||
| - | There are two GUI way for accessing the point clouds tools: | ||
| - | * The edit menu: | ||
| - | {{: | ||
| - | |||
| - | * The interactive toolbar (from the [[https:// | ||
| - | {{: | ||
| - | |||
| - | |||
| - | In order to select several objects please hold the **CTRL** key while clicking on the objects. | ||
| - | |||
| - | === Using tools from RGG code === | ||
| - | |||
| - | To use the tools in RGG you should import the following packages: | ||
| - | <code java> | ||
| - | import de.grogra.pointcloud.objects.impl.*; | ||
| - | import de.grogra.pointcloud.tools.Tools; | ||
| - | </ | ||
| - | |||
| - | |||
| - | ===== Local transformation ===== | ||
| - | |||
| - | It is key to understand that in GroIMP each node have a local transformation, | ||
| - | |||
| - | For point clouds nodes, it means that two point clouds with points that have the SAME coordinates, | ||
| - | |||
| - | {{: | ||
| - | |||
| - | The first image results from // | ||
| - | |||
| - | It is possible to force a point cloud to have global coordinates by moving it to the root of the graph and transforming it with its globalTransformation with : | ||
| - | |||
| - | <code java> | ||
| - | PointCloud myPC = ...; | ||
| - | Matrix34d transfo = de.grogra.pointcloud.utils.Utils.getGlobalTransform( myPC); | ||
| - | Matrix4d localT = myPC.getLocalTransformation(); | ||
| - | myPC.setTransform( transfo.transform( localT ) ); | ||
| - | [c: | ||
| - | </ | ||
| - | |||
| - | ===== Split by plane ===== | ||
| - | |||
| - | A given point cloud can be split into two point clouds based on a plane object. | ||
| - | |||
| - | === GUI === | ||
| - | |||
| - | The function requires the selection of a plane and a point cloud (in that order!). If the splitting was successful, both point clouds are selected afterwards. If the plane did not cut the point cloud, one of the new point clouds remains empty. | ||
| - | |||
| - | |||
| - | === RGG === | ||
| - | |||
| - | in RGG the split function from the tools class can be used. This class returns a cloud array with the old and the new cloud. The new one has to be added to the graph afterwards. | ||
| - | |||
| - | <code java> | ||
| - | public void splitByPlane(){ | ||
| - | Cloud c = first((*PointCloud*)).getCloud(); | ||
| - | Plane p = first((*Plane*)); | ||
| - | | ||
| - | Cloud c2 =clouds[1]; | ||
| - | [ | ||
| - | ==>> | ||
| - | ] | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | //Note: The RGG split only works with a plane added through RGG// | ||
| - | |||
| - | === Output === | ||
| - | |||
| - | {{: | ||
| - | |||
| - | ===== Split by leaf ===== | ||
| - | |||
| - | A selection of leafs (points) of a point cloud can be seperated to become their own point cloud. | ||
| - | |||
| - | === GUI === | ||
| - | |||
| - | Select first the cloud that holds the points and then the points that are suppose to be separated. after executing the function two point cloud appear. | ||
| - | |||
| - | === RGG === | ||
| - | |||
| - | The following example shows the usage of this tool on a CloudGraph: | ||
| - | <code java> | ||
| - | |||
| - | public void splitByLeaf(){ | ||
| - | // get the first Cloud object that handle LeafPoint object. | ||
| - | Cloud c = first((* pc: | ||
| - | (pc.getCloud() instanceof CloudGraph), | ||
| - | ( ((CloudGraph)pc.getCloud()).getChildrenType().isAssignableFrom( LeafPointImpl.class) | ||
| - | |||
| - | //get the first three points found in the graph below the cloud root | ||
| - | Cloud[] clouds = Tools.split(slice((*c.getNode() (--> | ||
| - | Cloud c2 =clouds[1]; | ||
| - | [ | ||
| - | ==>> | ||
| - | ] | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | === Output === | ||
| - | |||
| - | {{: | ||
| - | |||
| - | ===== Merge ===== | ||
| - | |||
| - | Turning several point clouds into one. The end result will be of the format (graph/ | ||
| - | |||
| - | The merge tool is considering the coordinate of the point relatively to the Point cloud Node. For Node added to the root of the project graph, their local transformations are equivalent to a global one. Thus, Point clouds added at the root of the project graph, or having not transforming parent to the root, have " | ||
| - | |||
| - | However, if the point clouds are under other transformations in the graph, the merged Points will be added to the other Point cloud with their local coordinate. | ||
| - | |||
| - | === GUI === | ||
| - | |||
| - | Select all point clouds to merge and execute the merge command. | ||
| - | |||
| - | === RGG === | ||
| - | |||
| - | A simple way to merge all point clouds in RGG is to combine the tool with a query. | ||
| - | <code java> | ||
| - | public void merge(){ | ||
| - | | ||
| - | | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | Additionally with Tools.merge(cloud ,cloud[]), it is possible to add all clouds form cloud[] to the given first cloud. | ||
| - | |||
| - | |||
| - | === Output === | ||
| - | |||
| - | Point clouds added to the Project graph root: | ||
| - | |||
| - | {{: | ||
| - | |||
| - | Point clouds with local transformations (as part branch of Nodes with transformations). | ||
| - | In the following example, the two point clouds are added each after a F build by the following code (where //PC1// and //PC2// are the Point cloud nodes: | ||
| - | <code java> | ||
| - | Axiom ==> F PC1 F PC2 ; | ||
| - | </ | ||
| - | |||
| - | In that example, the points of PC1 are translated by the //F// Node, but their local coordinates do not include this translation. Similarly, the points of PC2 are translated twice, once per F. | ||
| - | |||
| - | If we merge the //RED// point cloud (PC2) into the //BLACK// one we have the following result (the points of PC2 are translated only by the first F): | ||
| - | |||
| - | {{: | ||
| - | |||
| - | ==== Cluster ==== | ||
| - | |||
| - | === K-means === | ||
| - | |||
| - | Basic K-means clustering | ||
| - | |||
| - | == GUI == | ||
| - | |||
| - | after selecting a point cloud and clustering it, the new created point clouds are added to the graph. | ||
| - | |||
| - | == RGG == | ||
| - | |||
| - | <code java> | ||
| - | public void Kcluster(){ | ||
| - | | ||
| - | (pc.getCloud() instanceof BoundedCloud) *)).getCloud(); | ||
| - | | ||
| - | | ||
| - | [ | ||
| - | ==>> | ||
| - | ] | ||
| - | } | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | === DBSCAN === | ||
| - | |||
| - | |||
01_user_documentation/groimp-platform/pointcloudtools.1737716340.txt.gz · Last modified: 2025/01/24 11:59 by gaetan
