User Tools

Site Tools


groimp-platform:pointcloudtools

This is an old revision of the document!


Point cloud tools

This wiki present the base tools included in the Pointcloud plugin. The version used in 1.7.

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/global transformation of the point cloud.

See more:

Using tools from the GUI

There are two GUI way for accessing the point clouds tools:

  • The edit menu:

  • The interactive toolbar (from the Coolbar plugin), which automatically display usable methods depending on the current selection. See here for more information.

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:

import de.grogra.pointcloud.groimp.*;
import de.grogra.pointcloud.groimp.PointCloud;
import de.grogra.pointcloud.objects.impl.*;
import de.grogra.pointcloud.tools.Tools;

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.

public void splitByPlane(){
 Cloud c = first((*PointCloud*)).getCloud();
 Plane p = first((*Plane*));
 Cloud[] clouds = de.grogra.pointcloud.tools.Tools.split(p, c);
 Cloud c2 =clouds[1];
 [
  ==>>^c2;
 ]
}

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:

public void splitByLeaf(){
// get the first Cloud object that handle LeafPoint object.
Cloud c = first((* pc:PointCloud, 
    (pc.getCloud() instanceof CloudGraph), 
    ( ((CloudGraph)pc.getCloud()).getChildrenType().isAssignableFrom( LeafPointImpl.class)  ) *)).getCloud(); 
 
//get the first three points found in the graph below the cloud root 
Cloud[] clouds = Tools.split(slice((*c.getNode() (-->)*LeafPointImpl*),0,3), c);
Cloud c2 =clouds[1];
[
  ==>>^c2;
]
}

Merge

Turning several point clouds into one. The end result will be of the format (graph/list/array) of the first selected point cloud.

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.

public void merge(){
 de.grogra.pointcloud.tools.Tools.merge(((*PontCloud*)));
 (*PontCloud*).update();
}

Additionally with Tools.merge(cloud ,cloud[]), it is possible to add all clouds form cloud[] to the given first cloud.

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
public void Kcluster(){
 BoundedCloud c = (BoundedCloud) first((* pc:de.grogra.pointcloud.groimp.PointCloud, 
    (pc.getCloud() instanceof BoundedCloud) *)).getCloud(); 
 Cloud[] res = de.grogra.pointcloud.tools.KMeans.cluster(c,2,4);
 for(Cloud y : res){
 [
  ==>>^y;
 ]
 }
}

DBSCAN

groimp-platform/pointcloudtools.1731343791.txt.gz · Last modified: 2024/11/11 17:49 by gaetan