utils
estimate_spacing(coords)
Estimate the spacing between points in a point cloud. This is just the median distance between nearest neighbors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
coords |
NDArray[floating]
|
The point cloud to estimate spacing of. Should have shape (npoint, ndim). |
required |
Source code in megham/utils.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
|
estimate_var(src, dst, dim_groups=None)
Estimate variance between point clouds for use with something like a GMM.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
src |
NDArray[floating]
|
The set of source points to be mapped onto the target points. Should have shape (nsrcpoints, ndim). |
required |
dst |
NDArray[floating]
|
The set of destination points to be mapped onto. Should have shape (ndstpoints, ndim). |
required |
dim_groups |
Optional[Sequence[Sequence[int] | NDArray[int_]]]
|
Which dimensions should be computed together. If None all dimensions will be treated seperately. |
None
|
Returns:
Name | Type | Description |
---|---|---|
var |
NDArray[floating]
|
The estimated variance. Will have shape (ndim,). |
Source code in megham/utils.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
|
make_edm(coords)
Make an Euclidean distance matrix from a set of points.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
coords |
NDArray[floating]
|
The (npoint, ndim) array of input points. |
required |
Returns:
Name | Type | Description |
---|---|---|
edm |
NDArray[floating]
|
The (npoint, npoint) euclidean distance matrix. |
Source code in megham/utils.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|