Coordinate
Classes for point coordinates
NormalizeCoord
Normalizes the point cloud into a unit sphere, where the center is the mean of the point set.
This transform expects a dictionary containing:
"coord": NumPy array of shape (N, 3) with point coordinates.
Source code in src\augmentation_class.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | |
__call__(data_dict)
Normalizes point cloud coordinates into unit sphere.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dict
|
dict
|
Input dictionary that contains a "coord" key with a NumPy array of shape (N, 3) representing point coordinates. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The same dictionary with |
Source code in src\augmentation_class.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | |
Normalize PC into Unit Sphere Space
PositiveShift
Shift point coordinates so all values are non-negative.
This transform expects a dictionary containing:
"coord": NumPy array of shape (N, 3) with point coordinates.
Source code in src\augmentation_class.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | |
__call__(data_dict)
Moves points so that all coordinate values become non-negative.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dict
|
dict
|
Input dictionary that must contain a "coord" key with a NumPy array of shape (N, 3) representing point coordinates. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The same dictionary with "coord" shifted so all values are greater than or equal to zero. |
Source code in src\augmentation_class.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | |
Positive Shift PC
CenterShift
Translate point coordinates so they are centered around a reference point.
This transform expects a dictionary containing:
"coord": NumPy array of shape (N, 3) with point coordinates.
It computes a shift vector and subtracts it from all coordinates in place. There are two ways to define the shift:
- Mean-based centering (
mean=True): - The shift is the mean (centroid) of all points along each axis.
-
If
apply_zis False, the z-component of the shift is replaced by the minimum z value of the points, so:- x and y are centered by their mean.
- z is shifted so that the lowest point lies at z = 0.
-
Bounding-box centering (
mean=False): - The shift is the center of the axis-aligned bounding box (AABB), i.e., the midpoint between min and max along each axis.
- If
apply_zis False, the z-component of the shift is set to the minimum z value of the points, so the bottom of the bounding box is at z = 0.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mean
|
bool
|
If True, use the mean of the coordinates as the shift (centroid). If False, use the center of the bounding box. Defaults to False. |
False
|
apply_z
|
bool
|
If True, apply the same centering logic to the z-axis as x and y. If False, the z shift is always set to the minimum z value, so the lowest point (or bottom of the bounding box) sits at z = 0. Defaults to True. |
True
|
Source code in src\augmentation_class.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | |
__call__(data_dict)
Center the point cloud coordinates in place.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dict
|
dict
|
Input dictionary that must contain a |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The same dictionary with |
Source code in src\augmentation_class.py
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | |
Center Shift PC
RandomShift
Randomly translate point coordinates along the x, y, and z axes.
This transform expects a dictionary containing:
"coord": NumPy array of shape (N, 3) with point coordinates.
It samples a random shift for each axis from the corresponding interval in shift and adds it to all points in place.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shift
|
tuple[tuple[float, float], tuple[float, float], tuple[float, float]]
|
A tuple of three
Each shift value is sampled from a uniform distribution:
With the default configuration:
Defaults to |
((-0.02, 0.02), (-0.02, 0.02), (0.02, 0.02))
|
apply_p
|
float
|
Probability of applying the random shift. Defaults to 1.0. |
1.0
|
Source code in src\augmentation_class.py
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | |
__call__(data_dict)
Apply a random global shift to the point coordinates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dict
|
dict
|
Input dictionary that must contain a |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The same dictionary with |
Source code in src\augmentation_class.py
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | |
Random Shift PC
RandomRotate
Randomly rotate 3D points (and optionally normals) around a given axis.
This transform expects a dictionary containing:
"coord": NumPy array of shape (N, 3) with point coordinates.- Optionally
"norm": NumPy array of shape (N, 3) with normals associated with each point.
The transform samples a rotation angle (in degrees) from angle, builds a rotation matrix around the specified axis,
and applies it to the coordinates (and normals, if present). The rotation is applied around a center point:
- If
centerisNone, the rotation center is taken as the center of the axis-aligned bounding box (AABB) of the coordinates. - If
centeris provided, it is used directly as the rotation center.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
angle
|
tuple[float, float] | None
|
A |
None
|
center
|
tuple[float, float, float] | ndarray | None
|
Rotation center in 3D, given as a 3-element tuple or NumPy array
|
None
|
axis
|
str
|
Axis (or axes) around which the rotation is applied. One of
In all cases, angles are sampled (in degrees) from the same
|
'y'
|
apply_p
|
float
|
Probability of applying the rotation. Defaults to 1.0. |
1.0
|
Source code in src\augmentation_class.py
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 | |
__call__(data_dict)
Apply a random rotation to coordinates (and normals, if present).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dict
|
dict
|
Input dictionary that must contain a |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The same dictionary with |
Source code in src\augmentation_class.py
262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 | |
Random Rotate PC
RandomScale
Randomly scale 3D coordinates uniformly or per-axis.
This transform expects a dictionary containing:
"coord": NumPy array of shape (N, 3) with point coordinates.
It samples a scale factor (or factors) from scale and multiplies the coordinates in place.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scale
|
list[float, float] | tuple[float, float]
|
A Examples:
* Defaults to |
(0.95, 1.05)
|
anisotropic
|
bool
|
Controls whether scaling is uniform or per-axis.
Defaults to |
False
|
apply_p
|
float
|
Probability of applying the random scaling. Defaults to 1.0. |
1.0
|
Source code in src\augmentation_class.py
323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 | |
__call__(data_dict)
Apply a random scaling to the point coordinates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dict
|
dict
|
Input dictionary that must contain a |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The same dictionary with |
Source code in src\augmentation_class.py
360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 | |
Random Scale PC
RandomTranslate
Randomly translate 3D coordinates by the same offset vector along x, y, z.
This transform expects a dictionary containing:
"coord": NumPy array of shape (N, 3) with point coordinates.
It samples a translation vector [tx, ty, tz] from the given range and adds it to all coordinates in place.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
translate_range
|
tuple[float, float]
|
A translate = np.random.uniform(min_translate, max_translate, size=3) That is:
Defaults to |
(-0.2, 0.2)
|
apply_p
|
float
|
Probability of applying the translation. Defaults to 1.0. |
1.0
|
Source code in src\augmentation_class.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 | |
__call__(data_dict)
Apply a random global translation to the point coordinates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dict
|
dict
|
Input dictionary that must contain a |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The same dictionary with |
Source code in src\augmentation_class.py
411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 | |
Random Translate PC
RandomJitter
Add small Gaussian noise to 3D coordinates (point-wise jitter).
This transform expects a dictionary containing:
"coord": NumPy array of shape (N, 3) with point coordinates.
It samples Gaussian noise for each point and each axis, scales it by sigma, clips it to [-clip, clip], and
adds it to the coordinates in place.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sigma
|
float
|
Standard deviation of the Gaussian noise before clipping. Noise is drawn as:
per coordinate. Defaults to 0.01. |
0.01
|
clip
|
float
|
Maximum absolute value for the jitter. After sampling, the noise is clipped to the range
Must be positive. Defaults to 0.05. |
0.05
|
apply_p
|
float
|
Probability of applying the jitter. Defaults to 1.0. |
1.0
|
Source code in src\augmentation_class.py
430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 | |
__call__(data_dict)
Apply point-wise Gaussian jitter to the point coordinates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dict
|
dict
|
Input dictionary that must contain a |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The same dictionary with |
Source code in src\augmentation_class.py
466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 | |
Random Jitter PC
RandomFlip
Randomly flip point coordinates (and normals) by sign along selected axes.
This transform expects a dictionary containing:
"coord": NumPy array of shape (N, 3) with point coordinates.- Optionally
"norm": NumPy array of shape (N, 3) with normals associated with each point.
Given the axes in flip_axis, each axis may be flipped by multiplying
the corresponding coordinate (and normal, if present) by -1.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
flip_axis
|
tuple[int, ...]
|
Indices of axes to consider for flipping. Each element must be in
For each axis in this tuple, a random decision is made (with
probability Examples:
* Defaults to |
(0, 2)
|
apply_p
|
float
|
Probability of flipping each axis. Defaults to 1.0. |
1.0
|
Source code in src\augmentation_class.py
485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 | |
__call__(data_dict)
Apply random sign flips along selected axes to coords (and normals).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dict
|
dict
|
Input dictionary that should contain a |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The same dictionary with |
Source code in src\augmentation_class.py
523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 | |
Random Flip PC
RandomDropout
Randomly drop a subset of points (and aligned per-point attributes).
This transform expects a dictionary containing:
"coord": NumPy array of shape (N, 3) with point coordinates.- Optionally other per-point arrays (e.g.,
"norm","color","label") that have length N along the first dimension.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
max_dropout_ratio
|
float
|
Maximum fraction of points that may be dropped. The actual dropout ratio is drawn from:
For example, if |
0.2
|
apply_p
|
float
|
Probability of applying the dropout. Defaults to 1.0. |
1.0
|
Source code in src\augmentation_class.py
545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 | |
__call__(data_dict)
Apply random point dropout to coords and aligned attributes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dict
|
dict
|
Input dictionary that must contain a |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The same dictionary with a subset of points (and aligned per-point attributes) kept, if dropout is applied. |
Source code in src\augmentation_class.py
572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 | |
Random Dropout PC
ShufflePoint
Randomly permute the order of points (and aligned per-point attributes).
This transform expects a dictionary containing:
"coord": NumPy array of shape (N, 3) with point coordinates.- Optionally other per-point arrays (e.g.,
"norm","color","label") that have length N along the first dimension.
All per-point arrays of matching length are shuffled with the same permutation, preserving correspondence between them.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
apply_p
|
float
|
Probability of applying the shuffling. Defaults to 1.0. |
1.0
|
Source code in src\augmentation_class.py
599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 | |
__call__(data_dict)
Shuffle the order of points and aligned per-point attributes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dict
|
dict
|
Input dictionary that must contain a |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The same dictionary with |
Source code in src\augmentation_class.py
619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 | |
PointClip
Randomly clip a local region around a randomly chosen point.
This transform expects a dictionary containing:
"coord": NumPy array of shape (N, 3) with point coordinates.- Optionally other per-point arrays (e.g.,
"norm","color","label") that have length N along the first dimension.
A random point index is selected and its coordinate is used as the center:
center = coord[center_idx]
Then it builds either:
- a spherical region of radius
radiusaroundcenterifuse_sphere=True, or - an axis-aligned box centered at
centerwith half-extentbox_rangeifuse_sphere=False.
Only points inside this region are kept; all others are dropped. All aligned per-point attributes are filtered with the same mask.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
use_sphere
|
bool
|
If True, use a spherical region. For each point
and keep points with |
True
|
radius
|
float
|
Radius of the sphere used when
Defaults to 1.0. |
1.0
|
box_range
|
tuple[float, float, float]
|
Half-extent of the axis-aligned box along each axis,
used when
A point
Defaults to |
(0.0, 0.0, 0.0)
|
apply_p
|
float
|
Probability of applying the clipping. Defaults to 1.0. |
1.0
|
Source code in src\augmentation_class.py
644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 | |
__call__(data_dict)
Apply a local region crop (sphere or box) around a random center.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dict
|
dict
|
Input dictionary that must contain a |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The same dictionary with |
Source code in src\augmentation_class.py
704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 | |
Clip PC
ClipGaussianJitter
Add clipped multivariate Gaussian noise to 3D coordinates.
This transform expects a dictionary containing:
* "coord": NumPy array of shape (N, 3) with point coordinates.
Unlike a simple per-axis jitter (RandomJitter) with independent 1D Gaussians, this transform uses a
multivariate normal distribution, allowing you to encode correlations between axes via the covariance matrix.
It samples 3D Gaussian noise from a multivariate normal, normalizes and clips it using a quantile parameter, scales
it by scalar, and adds it to the coordinates in place.
In the default setting:
mean = [0.0, 0.0, 0.0]cov = I_3(3×3 identity matrix → isotropic Gaussian)
A raw sample is drawn as:
jitter_raw ~ N(mean, cov)
Then it is transformed as:
jitter = scalar * clip(jitter_raw / quantile, -1, 1)
Intuition:
- For a standard normal, most values lie within ±
quantile(e.g., 1.96 ≈ 97.5% quantile). - Dividing by
quantileand clipping to [-1, 1] effectively bounds each component before scaling, so typical magnitudes are on the order of±scalar.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
quantile
|
float
|
Normalization factor used before clipping. Noise is divided by |
1.96
|
scalar
|
float
|
Overall scale factor for the jitter after clipping. Roughly controls the maximum perturbation per coordinate
(since final values are typically in approximately |
0.02
|
apply_p
|
float
|
Probability of applying the jitter. Defaults to 1.0. |
1.0
|
Source code in src\augmentation_class.py
741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 | |
__call__(data_dict)
Apply clipped multivariate Gaussian jitter to the point coordinates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dict
|
dict
|
Input dictionary that must contain a |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The same dictionary with |
Source code in src\augmentation_class.py
796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 | |
Clip Gaussian Jitter on PC
ElasticDistortion
Apply elastic distortion to 3D point coordinates.
This transform expects a dictionary containing:
"coord": NumPy array of shape (N, 3) with point coordinates.
The distortion is implemented by:
- Creating a coarse 3D grid of Gaussian noise with resolution determined
by
granularity. - Smoothing the noise with separable 3D convolutions.
- Trilinearly interpolating the smoothed noise at each input coordinate.
- Adding the interpolated noise (scaled by
magnitude) to the original coordinates.
Multiple (granularity, magnitude) pairs can be applied sequentially to
produce multi-scale elastic deformations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
distortion_params
|
list[list[float]] | list[tuple[float, float]] | None
|
List of
If |
None
|
apply_p
|
float
|
Probability of applying the elastic Defaults to 1.0. |
1.0
|
Source code in src\augmentation_class.py
1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 | |
__call__(data_dict)
Apply elastic distortion(s) to "coord" in data_dict.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dict
|
dict
|
Input dictionary that must contain a |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The same dictionary with |
Source code in src\augmentation_class.py
1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 | |
Elastic Distortion on PC