Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions include/CloudSamplingTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,15 @@ namespace CCCoreLib
\param nSigma number of sigmas under which the points should be kept
\param octree associated octree if available
\param progressCb the client application can get some notification of the process progress through this callback mechanism (see GenericProgressCallback)
\param maxThreadCount maximum number of threads to use (0 = max available)
\return a reference cloud corresponding to the filtered cloud
**/
static ReferenceCloud* sorFilter( GenericIndexedCloudPersist* cloud,
int knn = 6,
double nSigma = 1.0,
DgmOctree* octree = nullptr,
GenericProgressCallback* progressCb = nullptr);
GenericProgressCallback* progressCb = nullptr,
int maxThreadCount = 0);

//! Noise filter based on the distance to the approximate local surface
/** This filter removes points based on their distance relatively to the best fit plane computed on their neighbors.
Expand All @@ -171,6 +173,7 @@ namespace CCCoreLib
\param absoluteError absolute error (if useAbsoluteError is true)
\param octree associated octree if available
\param progressCb the client application can get some notification of the process progress through this callback mechanism (see GenericProgressCallback)
\param maxThreadCount maximum number of threads to use (0 = max available)
\return a reference cloud corresponding to the filtered cloud
**/
static ReferenceCloud* noiseFilter( GenericIndexedCloudPersist* cloud,
Expand All @@ -182,7 +185,8 @@ namespace CCCoreLib
bool useAbsoluteError = true,
double absoluteError = 0.0,
DgmOctree* octree = nullptr,
GenericProgressCallback* progressCb = nullptr);
GenericProgressCallback* progressCb = nullptr,
int maxThreadCount = 0);

protected:

Expand Down
14 changes: 9 additions & 5 deletions src/CloudSamplingTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,8 @@ ReferenceCloud* CloudSamplingTools::sorFilter( GenericIndexedCloudPersist* input
int knn/*=6*/,
double nSigma/*=1.0*/,
DgmOctree* inputOctree/*=nullptr*/,
GenericProgressCallback* progressCb/*=nullptr*/)
GenericProgressCallback* progressCb/*=nullptr*/,
int maxThreadCount/*=0*/)
{
if (!inputCloud || knn <= 0 || inputCloud->size() <= static_cast<unsigned>(knn))
{
Expand Down Expand Up @@ -517,7 +518,8 @@ ReferenceCloud* CloudSamplingTools::sorFilter( GenericIndexedCloudPersist* input
additionalParameters,
true,
progressCb,
"SOR filter") == 0)
"SOR filter",
maxThreadCount ) == 0)
{
//something went wrong
break;
Expand Down Expand Up @@ -579,7 +581,8 @@ ReferenceCloud* CloudSamplingTools::noiseFilter(GenericIndexedCloudPersist* inpu
bool useAbsoluteError/*=true*/,
double absoluteError/*=0.0*/,
DgmOctree* inputOctree/*=nullptr*/,
GenericProgressCallback* progressCb/*=nullptr*/)
GenericProgressCallback* progressCb/*=nullptr*/,
int maxThreadCount/*=0*/)
{
if (!inputCloud || inputCloud->size() < 2 || (useKnn && knn <= 0) || (!useKnn && kernelRadius <= 0))
{
Expand Down Expand Up @@ -612,7 +615,7 @@ ReferenceCloud* CloudSamplingTools::noiseFilter(GenericIndexedCloudPersist* inpu
}

//additional parameters
void* additionalParameters[] = {reinterpret_cast<void*>(filteredCloud),
void* additionalParameters[] { reinterpret_cast<void*>(filteredCloud),
reinterpret_cast<void*>(&kernelRadius),
reinterpret_cast<void*>(&nSigma),
reinterpret_cast<void*>(&removeIsolatedPoints),
Expand All @@ -633,7 +636,8 @@ ReferenceCloud* CloudSamplingTools::noiseFilter(GenericIndexedCloudPersist* inpu
additionalParameters,
true,
progressCb,
"Noise filter" ) == 0)
"Noise filter",
maxThreadCount ) == 0)
{
//something went wrong
delete filteredCloud;
Expand Down
Loading