ece4580:module_pcd:connectedcomponents
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| ece4580:module_pcd:connectedcomponents [2017/02/10 19:53] – pvela | ece4580:module_pcd:connectedcomponents [2024/08/20 21:38] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 7: | Line 7: | ||
| Here is the main algorithm for doing so: | Here is the main algorithm for doing so: | ||
| - | | + | - Compute the proximity matrix (see '' |
| - | Apply a threshold to the proximity matrix to get the connectivity matrix $C$. | + | |
| + | - Find the first row with a non-zero as the index. | ||
| + | - numSets = 0 | ||
| + | - Set labels to be a 1 x $n_p$ matrix where $n_p$ is the number of points in the point cloud. | ||
| + | - While there is an index to grab | ||
| + | * numSets = numSets + 1 | ||
| + | * Grab a random point from the point cloud. Let its index be $i$. | ||
| + | * Initialize the index set $S = {i}$. | ||
| + | * Initialize the neighbor index set $N = {i}$. | ||
| + | * While the neighbor set is not empty, do the following: | ||
| + | * Zero out the rows for the current neighbor index set ($C(N,:) = 0$). Makes them no longer available. | ||
| + | * Given the neighbor set, find indices of its connected components. These are all of the indices that are non-zero in the column $C(N,:)$. | ||
| + | * Add these indices to the index set $S$. | ||
| + | * SOverwrite the neighbor index set $N$ to the found connected components. | ||
| + | * The index set $S$ forms a cluster. | ||
| + | * Set labels($S$) = numSets | ||
| + | |||
| + | Each time a new set $S$ is computed, it defines a connected component cluster. The indices in the set $S$ are then used to label the points. | ||
| + | The labels variable should be returned. | ||
| - | Find the first row with a non-zero as the index. | ||
| - | While there is an index to grab | ||
| - | Grab a random point from the point cloud. Let its index be $i$. | ||
| - | Initialize the index set $S = {i}$. | ||
| - | Initialize the neighbor index set $N = {i}$. | ||
| - | While the neighbor set is not empty, do the following: | ||
| - | Zero out the rows for the current neighbor index set ($C(N,:) = 0$). | ||
| - | Given the neighbor set, find indices of its connected components | ||
| - | There are all of the indices that are non-zero in the column $C(N,:$)). | ||
| - | Add these indices to the index set $S$. | ||
| - | Set the new neighbor index set $N$ to the found connected components. | ||
| - | End | ||
| - | The set $S$ forms a cluster. | ||
| - | End | ||
| ----------------------- | ----------------------- | ||
ece4580/module_pcd/connectedcomponents.1486774436.txt.gz · Last modified: 2024/08/20 21:38 (external edit)
