Skip to content
This repository has been archived by the owner on Sep 1, 2023. It is now read-only.

Commit

Permalink
docs(website): add MinCutSegmentation and removeNaNNormalsFromPointCl…
Browse files Browse the repository at this point in the history
…oud docs
  • Loading branch information
luoxuhai committed Oct 3, 2022
1 parent 689f76c commit e6529bd
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 0 deletions.
16 changes: 16 additions & 0 deletions website/docs/api/filters/remove-nan-from-point-cloud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# removeNaNFromPointCloud

Removes points with x, y, or z equal to NaN.

```ts
removeNaNFromPointCloud(cloudIn, cloudOut, indices)
```

## Type Definitions

```ts
function removeNaNFromPointCloud<T>(cloudIn: PointCloud<T>, cloudOut?: PointCloud<T>, indices?: Indices): {
cloud: PointCloud<T>;
indices: Indices;
};
```
16 changes: 16 additions & 0 deletions website/docs/api/filters/remove-nan-normals-from-point-cloud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# removeNaNNormalsFromPointCloud

Removes points that have their normals invalid (i.e., equal to NaN).

```ts
removeNaNNormalsFromPointCloud(cloudIn, cloudOut, indices)
```

## Type Definitions

```ts
function removeNaNNormalsFromPointCloud<T extends Normal | PointNormal>(cloudIn: PointCloud<T>, cloudOut?: PointCloud<T>, indices?: Indices): {
cloud: PointCloud<T>;
indices: Indices;
};
```
6 changes: 6 additions & 0 deletions website/docs/api/segmentation/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"label": "Segmentation",
"link": {
"type": "generated-index"
}
}
64 changes: 64 additions & 0 deletions website/docs/api/segmentation/min-cut-segmentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@

# MinCutSegmentation

This class implements the segmentation algorithm based on minimal cut of the graph.

More:
1. https://pointclouds.org/documentation/classpcl_1_1_min_cut_segmentation.html
2. https://pcl.readthedocs.io/projects/tutorials/en/master/min_cut_segmentation.html#min-cut-segmentation

## Example

```ts title="TypeScript" showLineNumbers
import * as PCl from 'pcl'

const pcl = await PCL.init();

const mcSeg = new pcl.segmentation.MinCutSegmentation<PCL.PointXYZ>(
PCL.PointXYZ,
);
const objectCenter = new PCL.PointXYZ(68.97, -18.55, 0.57);

const radius = 3.0433856;
const sigma = 0.25;
const sourceWeight = 0.8;
const neighborNumber = 14;

const foregroundPoints = new pcl.common.PointCloud<PCL.PointXYZ>(PCL.PointXYZ);
foregroundPoints.addPoint(objectCenter);

mcSeg.setForegroundPoints(foregroundPoints);
mcSeg.setInputCloud(cloud);
mcSeg.setRadius(radius);
mcSeg.setSigma(sigma);
mcSeg.setSourceWeight(sourceWeight);
mcSeg.setNumberOfNeighbours(neighborNumber);

const clusters = mcSeg.extract();
```

## Type Definitions
```ts
class MinCutSegmentation<T> {
_native: Emscripten.NativeAPI;
constructor(PT?: TPointTypesUnion);
setInputCloud(cloud: PointCloud<T>): any;
setSigma(sigma: number): void;
getSigma(): number;
setRadius(radius: number): void;
getRadius(): number;
setSourceWeight(weight: number): void;
getSourceWeight(): number;
setSearchMethod(tree: string | null): void;
getSearchMethod(): string | null;
setNumberOfNeighbours(neighbourNumber: number): void;
getNumberOfNeighbours(): number;
setForegroundPoints(cloud: PointCloud<T>): any;
getForegroundPoints(): PointCloud<T>;
setBackgroundPoints(cloud: PointCloud<T>): any;
getBackgroundPoints(): PointCloud<T>;
extract(): Vector<unknown>;
getMaxFlow(): number;
getColoredCloud(): PointCloud<T>;
}
```

1 comment on commit e6529bd

@vercel
Copy link

@vercel vercel bot commented on e6529bd Oct 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

pcl-js – ./

pcl-js-darkce.vercel.app
pcljs.org
pcl-js-git-master-darkce.vercel.app
www.pcljs.org

Please sign in to comment.