ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
qM3C2Tools.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 // CV_CORE_LIB
11 #include <DgmOctree.h>
12 #include <GenericIndexedCloud.h>
14 
17 class ccScalarField;
18 class ccPointCloud;
20 
22 class qM3C2Normals {
23 public:
25 
28  DEFAULT_MODE = 0, // compute normals on core points
31  VERT_MODE = 3,
34  };
35 
37 
40  static bool ComputeCorePointsNormals(
42  NormsIndexesTableType* corePointsNormals,
44  const std::vector<PointCoordinateType>& sortedRadii,
45  bool& invalidNormals,
46  int maxThreadCount = 0,
47  ccScalarField* normalScale = nullptr,
48  cloudViewer::GenericProgressCallback* progressCb = nullptr,
49  cloudViewer::DgmOctree* inputOctree = nullptr);
50 
57  int maxThreadCount = 0,
58  cloudViewer::GenericProgressCallback* progressCb = nullptr);
59 
62 };
63 
65 class qM3C2Tools {
66 public:
68 
73  bool useMedian,
74  double& meanOrMedian,
75  double& stdDevOrIQR);
76 
78  struct GuessedParams {
80  double normScale = 0.0;
81  double projScale = 0.0;
82  double projDepth = 0.0;
83  };
84 
86  static bool GuessBestParams(ccPointCloud* cloud1,
87  ccPointCloud* cloud2,
88  unsigned minPoints4Stats,
90  bool fastMode,
91  ecvMainAppInterface* app = nullptr,
92  unsigned probingCount = 1000);
93 };
cmdLineReadable * params[]
Array of compressed 3D normals (single index)
A 3D cloud interface with associated features (color, normals, octree, etc.)
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
A scalar field associated to display-related parameters.
The octree structure used throughout the library.
Definition: DgmOctree.h:39
std::vector< PointDescriptor > NeighboursSet
A set of neighbours.
Definition: DgmOctree.h:133
A generic 3D point cloud with index-based point access.
Main application interface (for plugins)
M3C2 normals computation related tools.
Definition: qM3C2Tools.h:22
ComputationMode
Normals computation mode.
Definition: qM3C2Tools.h:27
@ USE_CLOUD1_NORMALS
Definition: qM3C2Tools.h:29
@ USE_CORE_POINTS_NORMALS
Definition: qM3C2Tools.h:33
@ MULTI_SCALE_MODE
Definition: qM3C2Tools.h:30
static void MakeNormalsHorizontal(NormsIndexesTableType &normsCodes)
Makes all normals horizontal.
Definition: qM3C2Tools.cpp:429
static bool ComputeCorePointsNormals(cloudViewer::GenericIndexedCloud *corePoints, NormsIndexesTableType *corePointsNormals, ccGenericPointCloud *sourceCloud, const std::vector< PointCoordinateType > &sortedRadii, bool &invalidNormals, int maxThreadCount=0, ccScalarField *normalScale=nullptr, cloudViewer::GenericProgressCallback *progressCb=nullptr, cloudViewer::DgmOctree *inputOctree=nullptr)
Computes normals on core points only.
Definition: qM3C2Tools.cpp:179
static bool UpdateNormalOrientationsWithCloud(cloudViewer::GenericIndexedCloud *normCloud, NormsIndexesTableType &normsCodes, cloudViewer::GenericIndexedCloud *orientationCloud, int maxThreadCount=0, cloudViewer::GenericProgressCallback *progressCb=nullptr)
Definition: qM3C2Tools.cpp:346
M3C2 generic tools.
Definition: qM3C2Tools.h:65
static bool GuessBestParams(ccPointCloud *cloud1, ccPointCloud *cloud2, unsigned minPoints4Stats, GuessedParams &params, bool fastMode, ecvMainAppInterface *app=nullptr, unsigned probingCount=1000)
Tries to guess some M3C2 parameters by randomly 'probing' the cloud.
Definition: qM3C2Tools.cpp:529
static void ComputeStatistics(cloudViewer::DgmOctree::NeighboursSet &set, bool useMedian, double &meanOrMedian, double &stdDevOrIQR)
Computes statistics on a neighbors set.
Definition: qM3C2Tools.cpp:487
cloudViewer::GenericIndexedCloud * corePoints
ccGenericPointCloud * sourceCloud
cloudViewer::GenericIndexedCloud * normCloud
Definition: qM3C2Tools.cpp:300
NormsIndexesTableType * normsCodes
Definition: qM3C2Tools.cpp:299
ccScalarField * normalScale
Definition: qM3C2Tools.cpp:44
cloudViewer::GenericIndexedCloud * orientationCloud
Definition: qM3C2Tools.cpp:301
bool invalidNormals
Definition: qM3C2Tools.cpp:45
M3C2 parameters that can be guessed automatically by 'probing'.
Definition: qM3C2Tools.h:78