Skip to content

Commit 77514f7

Browse files
committed
added better comments
1 parent 319361f commit 77514f7

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

raycloudtools/raydecimate/raydecimate.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ void usage(int exit_code = 1)
2020
// clang-format off
2121
std::cout << "Decimate a ray cloud spatially or temporally" << std::endl;
2222
std::cout << "usage:" << std::endl;
23-
std::cout << "raydecimate raycloud 3 cm - reduces to one end point every 3 cm" << std::endl;
24-
std::cout << "raydecimate raycloud 4 rays - reduces to every fourth ray" << std::endl;
25-
std::cout << "raydecimate raycloud 100 cm 1000 rays - A maximum of 1000 rays per metre cubed" << std::endl;
23+
std::cout << "raydecimate raycloud 3 cm - reduces to one end point every 3 cm. A spatially even subsampling" << std::endl;
24+
std::cout << "raydecimate raycloud 4 rays - reduces to every fourth ray. A temporally even subsampling (if rays are chronological)" << std::endl;
25+
std::cout << "raydecimate raycloud 20 cm 64 rays - A maximum of 64 rays per cubic 20 cm. Retains small-scale details compared to spatial decimation" << std::endl;
2626
std::cout << "raydecimate raycloud 3 cm/m - reduces to ray ends spaced 3 cm apart for each metre of their length" << std::endl;
2727
// clang-format off
2828
exit(exit_code);

raylib/raydecimation.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,22 @@
1313

1414
namespace ray
1515
{
16+
/// @brief subsample to 1 point per @c vox_width wide voxel in metres
17+
/// This is a spatially even subsampling, but also emphasises outlier as a side-effect
1618
bool RAYLIB_EXPORT decimateSpatial(const std::string &file_stub, double vox_width);
19+
20+
/// @brief subsample to every @c num_rays rays
21+
/// This is an unbiased subsampling, but will be over-sampled in stationary areas as a side-effect
22+
/// Note that while this is called temporal decimation, it decimates evenly in file order, which isn't
23+
/// necessarily temporal order. Though it typically is stored that way on single scans.
1724
bool RAYLIB_EXPORT decimateTemporal(const std::string &file_stub, int num_rays);
25+
26+
/// @brief subsample to @c num_rays rays (temporally decimated) for each @c vox_width wide voxel
27+
/// This allows a more even distribution of points while maintaining details better than pure spatial decimation
1828
bool RAYLIB_EXPORT decimateSpatioTemporal(const std::string &file_stub, double vox_width, int num_rays);
29+
30+
/// @brief decimate to no more than 1 point per voxel of width @c radius_per_length x ray length.
31+
/// This is used when error is proportional to ray length, prioritising closer measurements and leaving distant areas sparse
1932
bool RAYLIB_EXPORT decimateAngular(const std::string &file_stub, double radius_per_length);
2033
} // namespace ray
2134

0 commit comments

Comments
 (0)