 |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Go to the documentation of this file.
24 const std::vector<Tensor>& index_tensors)
45 const std::vector<Tensor>& index_tensors);
50 const Tensor& tensor,
const std::vector<Tensor>& index_tensors);
54 static std::pair<std::vector<Tensor>,
SizeVector>
87 const std::vector<Tensor>& index_tensors);
123 const std::vector<Tensor>& index_tensors,
128 if (indexed_shape.size() != indexed_strides.size()) {
130 "Internal error: indexed_shape's ndim {} does not equal to "
131 "indexed_strides' ndim {}",
132 indexed_shape.size(), indexed_strides.size());
137 std::vector<Tensor> inputs;
138 inputs.push_back(src);
139 for (
const Tensor& index_tensor : index_tensors) {
140 if (index_tensor.NumDims() != 0) {
141 inputs.push_back(index_tensor);
147 if (
num_indices_ !=
static_cast<int64_t
>(indexed_strides.size())) {
149 "Internal error: indexed_shape's ndim {} does not equal to "
150 "indexd_strides' ndim {}",
161 "src's dtype {} is not the same as dst's dtype {}.",
168 int64_t workload_idx)
const {
176 int64_t workload_idx)
const {
187 int64_t index = *(
reinterpret_cast<int64_t*
>(
191 "Index out of bounds.");
A generic 3D point cloud with index-based point access.
Definition: GenericIndexedCloud.h:18
bool isClosed() const
Returns whether the polyline is closed or not.
Definition: Polyline.h:26
SizeVector GetOutputShape() const
Definition: AdvancedIndexing.h:35
@ TRI
Definition: CVConst.h:124
static bool GetEigenVector(const SquareMatrix &eigenVectors, unsigned index, Scalar eigenVector[])
Returns the given eigenvector.
Definition: Jacobi.h:364
virtual void setCurrentPointScalarValue(ScalarType value)
Sets the current point associated scalar value.
Definition: ReferenceCloud.h:126
GenericIndexedMesh * triangulateFromQuadric(unsigned stepsX, unsigned stepsY)
Definition: Neighbourhood.cpp:682
unsigned m_rowSize
Shift for cell access acceleration (Y dimension)
Definition: FastMarching.h:227
virtual const CCVector3 * getCurrentPointCoordinates() const
Returns the coordinates of the point pointed by the current element.
Definition: ReferenceCloud.cpp:77
Generic file read and write utility for python interface.
Definition: CloudViewerConfig.cpp:12
bool resize(unsigned newCount) override
Resizes the point database.
Definition: CVPointCloud.h:41
Fake QAtomicInt.
Definition: NormalizedProgress.cpp:27
Dtype GetDtype() const
Definition: Tensor.h:1164
Eigen::Matrix3d ComputeCovariance(const std::vector< Eigen::Vector3d > &points, const std::vector< IdxType > &indices)
Function to compute the covariance matrix of a set of points.
Definition: Eigen.cpp:287
void * bytes
Definition: TriangleMeshBuffers.cpp:159
VertexIterator itA
Definition: PointProjectionTools.cpp:506
int find(int x)
Definition: Universe.cpp:29
unsigned radiusSearch(const PointCoordinateType *queryPoint, ScalarType distance, ScalarType tolerance, std::vector< unsigned > &pointndexes)
Definition: CVKdTree.cpp:288
int cpu_clock_by_os()
Returns the CPU clock, as reported by the OS.
Definition: Cpu.cpp:62
virtual bool removeOuterTriangles(const std::vector< CCVector2 > &vertices2D, const std::vector< CCVector2 > &polygon2D, bool removeOutside=true)
Removes the triangles falling outside of a given (2D) polygon.
Definition: Delaunay2dMesh.cpp:207
TrueKdTree(GenericIndexedCloudPersist *cloud)
Default constructor.
Definition: TrueKdTree.cpp:17
constexpr double M_PI
Pi.
Definition: CVConst.h:19
Universe(int elements)
Definition: Universe.cpp:11
QTextStream & endl(QTextStream &stream)
Definition: QtCompat.h:718
virtual const CCVector3 * getNextPoint()=0
Returns the next point (relatively to the global iterator position)
unsigned nearestPointIndex
Definition: PointProjectionTools.cpp:507
const CCVector3 & getCenter() const
Returns the model center.
Definition: LocalModel.h:37
~Universe()
Definition: Universe.cpp:27
bool DirectoryExists(const std::string &directory)
Definition: FileSystem.cpp:473
Definition: Universe.h:15
SimpleMesh(GenericIndexedCloud *_theVertices, bool linkVerticesWithMesh=false)
SimpleMesh Constructor.
Definition: SimpleMesh.cpp:18
virtual double computePfromZero(ScalarType x) const =0
Computes the cumulative probability between 0 and x.
std::string filename
Definition: PointCloudIO.cpp:47
static const int MAX_OCTREE_LENGTH
Max octree length at last level of subdivision (number of cells)
Definition: DgmOctree.h:84
void addNormal(const CCVector3 &N)
Adds a normal.
Definition: CVPointCloud.h:61
std::string toString()
Definition: MemoryInfo.cpp:162
@ Linearity
Definition: Neighbourhood.h:167
virtual void getTriangleVertices(unsigned triangleIndex, CCVector3 &A, CCVector3 &B, CCVector3 &C) const override
Returns the vertices of a given triangle.
Definition: Delaunay2dMesh.cpp:358
SquareMatrixTpl transposed() const
Returns the transposed version of this matrix.
Definition: SquareMatrix.h:311
virtual bool reserve(unsigned n)
Reserves some memory for hosting the point references.
Definition: ReferenceCloud.cpp:51
std::string & LeftStripString(std::string &str, const std::string &chars="\t\n\v\f\r ")
Definition: Helper.cpp:228
char m_name[256]
Scalar field name.
Definition: ScalarField.h:115
PointCoordinateType cuttingCoordinate
Place where the space is cut into two sub-spaces (children)
Definition: CVKdTree.h:140
bool EnsureDirectory(const std::string &directory_path)
Check if a specified directory specified by directory_path exists. If not, recursively create the dir...
Definition: FileSystem.cpp:484
bool StringStartsWith(const std::string &str, const std::string &prefix)
Definition: Helper.cpp:158
static bool ComparisonZ(const unsigned &a, const unsigned &b)
Compares Z coordinates of two points designated by their index.
Definition: CVKdTree.cpp:103
static Delaunay2dMesh * TesselateContour(const std::vector< CCVector2 > &contourPoints)
Definition: Delaunay2dMesh.cpp:397
static int s_verbosityLevel
Definition: CVLog.cpp:47
normal_z rgb
Definition: my_point_types.h:168
bool setParameters(ScalarType a, ScalarType b, ScalarType valueShift=0)
Sets the distribution parameters.
Definition: WeibullDistribution.cpp:112
static PointCoordinateType ComputeMinDistanceToCellBorder(const CCVector3 &queryPoint, PointCoordinateType cs, const CCVector3 &cellCenter)
Definition: DgmOctree.h:1057
unsigned startingPointIndex
Index of the first element that belongs to this cell.
Definition: CVKdTree.h:150
SizeVector output_shape_
Output shape.
Definition: AdvancedIndexing.h:97
void SplitString(std::vector< std::string > &tokens, const std::string &str, const std::string &delimiters=" ", bool trim_empty_str=true)
Definition: Helper.cpp:197
bool IsDirectory(const std::string &directory)
Definition: FileSystem.cpp:454
Tuple3i prevMaxCornerPos
Previous search box (max corner)
Definition: DgmOctree.h:710
void Close()
Close the file.
Definition: FileSystem.cpp:750
SizeVector BroadcastedShape(const SizeVector &l_shape, const SizeVector &r_shape)
Returns the broadcasted shape of two shapes.
Definition: ShapeUtil.cpp:56
InsideOutsideIndexes(unsigned inside, unsigned outside)
Definition: ManualSegmentationTools.cpp:341
unsigned m_maxPointCountPerCell
Max number of points per cell (speed-up)
Definition: TrueKdTree.h:172
void normalize()
Sets vector norm to unity.
Definition: CVGeom.h:428
void add(const Vector3Tpl< T > &P)
'Enlarges' the bounding box with a point
Definition: BoundingBox.h:131
bool getParameters(ScalarType &a, ScalarType &b) const
Returns the distribution parameters.
Definition: WeibullDistribution.cpp:97
unsigned size() const override
Returns the number of points.
Definition: DgmOctreeReferenceCloud.h:28
bool oneStep()
Increments total progress value of a single unit.
Definition: NormalizedProgress.cpp:99
Tuple3i maxFillIndexes
Grid occupancy of mesh (maximum indexes for each dimension)
Definition: DistanceComputationTools.cpp:71
CLOUDVIEWER_HOST_DEVICE Pair< First, Second > make_pair(const First &_first, const Second &_second)
Definition: SlabTraits.h:49
bool DirectoryIsEmpty(const std::string &directory)
Definition: FileSystem.cpp:477
ScalarType getSigma2() const
Returns the distribution variance.
Definition: NormalDistribution.h:59
const CellCode & getCellCode(unsigned index) const
Returns the ith cell code.
Definition: DgmOctree.h:963
void computeCellCenter(CellCode code, unsigned char level, CCVector3 ¢er, bool isCodeTruncated=false) const
Definition: DgmOctree.h:862
std::string JoinPath(const std::vector< std::string > &path_components)
Definition: FileSystem.cpp:58
int64_t m_sliceSize
2D slice size (with margin)
Definition: Grid3D.h:553
normal_z x
Definition: my_point_types.h:165
static unsigned char GET_BIT_SHIFT(unsigned char level)
Returns the binary shift for a given level of subdivision.
Definition: DgmOctree.cpp:113
bool isValid() const
Returns matrix validity.
Definition: SquareMatrix.h:138
Vector3Tpl< T > getCenter() const
Returns center.
Definition: BoundingBox.h:164
CCVector3 center
Cylinder center.
Definition: DgmOctree.h:660
bool isNode() const
Definition: TrueKdTree.h:38
@ LOG_ERROR
Definition: CVLog.h:47
ScalarType pointToCellSquareDistance(const PointCoordinateType *queryPoint, KdCell *cell)
Computes the distance between a point and a cell inside bounding box.
Definition: CVKdTree.cpp:419
SizeVector GetShape() const
Definition: Tensor.h:1127
static constexpr int IGNORE_MAX_EDGE_LENGTH
Definition: Neighbourhood.h:27
Delaunay2dMesh()
Delaunay2dMesh constructor.
Definition: Delaunay2dMesh.cpp:30
Type x
Definition: CVGeom.h:137
void resetCells(std::vector< unsigned > &list)
Resets the state of cells in a given list.
Definition: FastMarching.cpp:132
unsigned size() const
Returns matrix size.
Definition: SquareMatrix.h:133
CV_LOCAL_MODEL_TYPES
Definition: CVConst.h:121
Definition: CVKdTree.h:20
A generic class to handle a probability distribution.
Definition: GenericDistribution.h:25
unsigned size() const override
Returns the number of points.
Definition: ReferenceCloud.h:41
DgmOctree::NeighboursSet * m_set
Associated PointDescriptor set.
Definition: DgmOctreeReferenceCloud.h:92
PointCoordinateType radius
Cylinder radius.
Definition: DgmOctree.h:664
virtual bool instantiateGrid(unsigned size)=0
Instantiates grid in memory.
virtual unsigned size() const =0
Returns the number of triangles.
ModelCloud(const ModelCloud &m)
Definition: RegistrationTools.cpp:125
unsigned i2
Definition: GenericIndexedMesh.h:19
virtual unsigned size() const =0
Returns the number of points.
virtual bool normalsAvailable() const
Returns whether normals are available.
Definition: GenericIndexedCloud.h:53
void getCellDistanceFromBorders(const Tuple3i &cellPos, unsigned char level, int *cellDists) const
Definition: DgmOctree.cpp:781
virtual void computeMinAndMax()
Determines the min and max values.
Definition: ScalarField.h:123
bool ListDirectory(const std::string &directory, std::vector< std::string > &subdirs, std::vector< std::string > &filenames)
Definition: FileSystem.cpp:532
virtual void linkMeshWith(GenericIndexedCloud *aCloud, bool passOwnership=false)
Associate this mesh to a point cloud.
Definition: Delaunay2dMesh.cpp:52
unsigned m_dy
Grid size along the Y dimension.
Definition: FastMarching.h:223
Json::Value StringToJson(const std::string &json_str)
Parse string and conver to Json::value. Throws exception if the conversion is invalid.
Definition: IJsonConvertible.cpp:21
std::string JoinPaths(T const &...paths)
Definition: FileSystem.h:23
unsigned m_dx
Grid size along the X dimension.
Definition: FastMarching.h:221
unsigned m_indexShift
First index of innerbound grid.
Definition: FastMarching.h:231
virtual bool resize(unsigned n)
Resizes the mesh database.
Definition: SimpleMesh.cpp:118
Least Squares Best Fitting Plane "local modelization".
Definition: LocalModel.cpp:19
int allelems
Definition: Universe.h:40
constexpr unsigned CV_LOCAL_MODEL_MIN_SIZE[]
Min number of points to compute local models (see CV_LOCAL_MODEL_TYPES)
Definition: CVConst.h:129
std::function< void(GenericTriangle &)> genericTriangleAction
Generic function to apply to a triangle (used by foreach)
Definition: GenericMesh.h:53
int offset
Definition: FileIOFactory.cpp:135
FPSTimer(const std::string &fps_timer_info="", int expectation=-1, double time_to_print=3000.0, int events_to_print=100)
Definition: Timer.cpp:67
std::size_t totalRam
Definition: MemoryInfo.h:20
Type norm() const
Returns vector norm.
Definition: CVGeom.h:424
py::object get_item(const py::object &index)
Definition: ScalarField.cpp:37
ScalarType m_sigma2
Normal distribution equivalent parameter: variance.
Definition: WeibullDistribution.h:103
static std::string GetCPUModelName()
Returns the CPU model name/brand string.
Definition: CPUInfo.cpp:115
bool copy
Definition: VtkUtils.cpp:74
Triangle described by the indexes of its 3 vertices.
Definition: GenericIndexedMesh.h:16
std::string GetWorkingDirectory()
Definition: FileSystem.cpp:333
DgmOctreeReferenceCloud(DgmOctree::NeighboursSet *associatedSet, unsigned count=0)
Default constructor.
Definition: DgmOctreeReferenceCloud.cpp:12
CCVector3 m_gravityCenter
Model gravity center.
Definition: LocalModel.cpp:158
Tensor GetTensor() const
Definition: AdvancedIndexing.h:29
QString character(int index)
Definition: utils.cpp:19
void clear()
Clears structure.
Definition: TrueKdTree.cpp:29
CCVector3 A
A vertex.
Definition: SimpleTriangle.h:73
const float Pi
Definition: utils.cpp:15
Main log interface.
Definition: CVLog.h:25
#define NULL
Definition: UVUnwrapping.cpp:40
double normal[3]
Definition: FileIOFactory.cpp:53
std::string & RightStripString(std::string &str, const std::string &chars="\t\n\v\f\r ")
Definition: Helper.cpp:233
int64_t m_rowSize
1D row size (with margin)
Definition: Grid3D.h:551
std::string GetFileExtensionInLowerCase(const std::string &filename)
Definition: FileSystem.cpp:281
SizeVector indexed_strides_
Definition: AdvancedIndexing.h:105
static bool Available()
Returns whether 2D Delaunay triangulation is supported or not.
Definition: Delaunay2dMesh.cpp:44
ScalarType & getValue(std::size_t index)
Definition: ScalarField.h:92
Tree node.
Definition: TrueKdTree.h:53
virtual bool buildMesh(const std::vector< CCVector2 > &points2D, std::size_t pointCountToUse, std::string &outputErrorStr)
Build the Delaunay mesh on top a set of 2D points.
Definition: Delaunay2dMesh.cpp:133
filament::Texture::InternalFormat format
Definition: FilamentResourceManager.cpp:181
bool getLeaves(LeafVector &leaves) const
Returns all leaf nodes.
Definition: TrueKdTree.cpp:321
DistanceComputationTools::ERROR_MEASURES m_errorMeasure
Error measurement.
Definition: TrueKdTree.h:162
@ LOG_VERBOSE
Definition: CVLog.h:43
@ EigenEntropy
Definition: Neighbourhood.h:164
Eigen::Matrix3d R_
Definition: OrientedBoundingBox.h:113
GraphType data
Definition: graph_cut.cc:138
ScalarType getValueShift() const
Returns the distribution value shift.
Definition: WeibullDistribution.h:65
void squareDistances(const Vector3Tpl< T > &P, double &radial, double &toOrigin) const
Definition: RayAndBox.h:35
GenericIndexedMesh * triangulateOnPlane(bool duplicateVertices, PointCoordinateType maxEdgeLength, std::string &outputErrorStr)
Applies 2D Delaunay triangulation.
Definition: Neighbourhood.cpp:620
Simple Ray structure.
Definition: RayAndBox.h:14
unsigned m_cellCount
Number of cells.
Definition: CVKdTree.h:175
int get_total_cpus()
Returns the total number of CPUs.
Definition: Cpu.cpp:162
static bool PrintHigh(const char *format,...)
Prints out an important formatted message in console.
Definition: CVLog.cpp:123
int64_t indexed_shape_[MAX_DIMS]
Definition: AdvancedIndexing.h:205
virtual void removePointGlobalIndex(unsigned localIndex)
Removes a given element.
Definition: ReferenceCloud.cpp:146
static constexpr int64_t MAX_DIMS
Definition: Indexer.h:38
Tensor Reshape(const SizeVector &dst_shape) const
Definition: Tensor.cpp:671
std::size_t freeRam
Definition: MemoryInfo.h:21
const cellsContainer & pointsAndTheirCellCodes() const
Returns the octree 'structure'.
Definition: DgmOctree.h:1196
int getArrayLengthFromFile(std::string fileName)
Definition: StaticVector.cpp:14
static bool IsIndexSplittedBySlice(const std::vector< Tensor > &index_tensors)
Definition: AdvancedIndexing.cpp:17
Definition: DistanceComputationTools.cpp:727
Weighted graph edge.
Definition: PointProjectionTools.cpp:491
int rank
Definition: Universe.h:16
unsigned IndexType
Definition: DgmOctree.cpp:3070
uint8_t splitDim
Definition: TrueKdTree.h:60
InsideOutsideIndexes()
Definition: ManualSegmentationTools.cpp:340
bool getCellCodes(unsigned char level, cellCodesContainer &vec, bool truncatedCodes=false) const
Definition: DgmOctree.cpp:2822
VerticesIndexes * getNextTriangleVertIndexes() override
Definition: SimpleMesh.cpp:184
const CCVector3 * getPoint(unsigned index) const override
Returns the ith point.
Definition: DgmOctreeReferenceCloud.h:54
static bool PrintVerbose(const char *format,...)
Prints out a verbose formatted message in console.
Definition: CVLog.cpp:103
unsigned nbPoints
Number of elements in this cell.
Definition: CVKdTree.h:152
virtual int initOther()
Definition: FastMarching.cpp:99
bool MakeDirectoryHierarchy(const std::string &directory)
Definition: FileSystem.cpp:499
Square matrix.
Definition: SquareMatrix.h:25
math::float3 position
Definition: LineSetBuffers.cpp:44
void define_LocalModel(py::module &cccorelib)
Definition: LocalModel.cpp:15
Indexer indexer_
Definition: AdvancedIndexing.h:201
@ SurfaceVariation
Definition: Neighbourhood.h:170
static constexpr bool DO_NOT_DUPLICATE_VERTICES
Definition: Neighbourhood.h:30
std::string JoinStrings(const std::vector< std::string > &strs, const std::string &delimiter=", ")
Definition: Helper.cpp:168
static void SetVerbosityLevel(int level)
Sets the verbosity level.
Definition: CVLog.cpp:59
NeighboursSet potentialCandidates
Vector to store potential candidates for the next pass.
Definition: DgmOctree.h:706
ReferenceCloud * getPointsInCellsWithSortedCellCodes(cellCodesContainer &cellCodes, unsigned char level, ReferenceCloud *subset, bool areCodesTruncated=false) const
Returns the points lying in multiple cells.
Definition: DgmOctree.cpp:2909
Eigen::Vector3uint8 ColorToUint8(const Eigen::Vector3d &color)
Definition: Eigen.cpp:269
void setValidity(bool state)
Sets bonding box validity.
Definition: BoundingBox.h:200
Quadric "local modelization".
Definition: LocalModel.cpp:106
double computePfromZero(ScalarType x) const override
Computes the cumulative probability between 0 and x.
Definition: NormalDistribution.cpp:76
float m_cellSize
Octree cell size at equivalent subdivision level.
Definition: FastMarching.h:242
virtual ~FastMarching()
Destructor.
Definition: FastMarching.cpp:36
int64_t ByteSize() const
Definition: Dtype.h:59
static bool codeComp(const IndexAndCode &a, const IndexAndCode &b)
Compares two IndexAndCode instances based on their code.
Definition: DgmOctree.h:333
std::size_t getPointsInCylindricalNeighbourhoodProgressive(ProgressiveCylindricalNeighbourhood ¶ms) const
Same as getPointsInCylindricalNeighbourhood with progressive approach.
Definition: DgmOctree.cpp:2264
bool computeRobustParameters(const ScalarContainer &values, double nSigma)
Definition: NormalDistribution.cpp:135
virtual void swap(unsigned i, unsigned j)
Swaps two point references.
Definition: ReferenceCloud.h:185
GenericIndexedCloudPersist * m_theAssociatedCloud
Associated cloud.
Definition: ReferenceCloud.h:247
unsigned char level
subdivision level at which to apply the extraction process
Definition: DgmOctree.h:670
Eigen::Matrix< double, 6, 6 > Matrix6d
Extending Eigen namespace by adding frequently used matrix type.
Definition: Eigen.h:106
Local modelization (generic interface)
Definition: LocalModel.h:17
bool setParameters(ScalarType _mu, ScalarType _sigma2)
Sets the distribution parameters.
Definition: NormalDistribution.cpp:43
Structure used during nearest neighbour search.
Definition: DgmOctree.h:136
static bool Print(const char *format,...)
Prints out a formatted message in console.
Definition: CVLog.cpp:113
void placeIteratorAtBeginning() override
Places the mesh iterator at the beginning.
Definition: Delaunay2dMesh.cpp:320
Scalar trace() const
Returns trace.
Definition: SquareMatrix.h:465
static void LogMessage(const QString &message, int level)
Static shortcut to CVLog::logMessage.
Definition: CVLog.cpp:64
Definition: DgmOctree.cpp:65
static void InitProgress(GenericProgressCallback *progressCb, unsigned totalCount)
Definition: TrueKdTree.cpp:44
std::vector< unsigned > m_indexes
Point indexes.
Definition: CVKdTree.h:171
VerticesIndexes * getTriangleVertIndexes(unsigned triangleIndex) override
Returns the indexes of the vertices of a given triangle.
Definition: SimpleMesh.cpp:180
Definition: GenericCloud.h:20
@ LOG_STANDARD
Definition: CVLog.h:44
std::string StringReplaceLast(const std::string &str, const std::string &old_str, const std::string &new_str)
Definition: Helper.cpp:144
const CCVector3 * getPoint(unsigned index) const override
Definition: PointCloudTpl.h:143
PointCoordinateType m_lsPlaneEquation[4]
Least-square best fitting plane parameters.
Definition: Neighbourhood.h:296
MonoDimensionalCellCodes()
Default initialization.
Definition: DgmOctree.cpp:73
ScalarType getMu() const
Returns the distribution mean.
Definition: NormalDistribution.h:56
ScalarField(const char *name=nullptr)
Default constructor.
Definition: ScalarField.cpp:16
std::vector< Leaf * > LeafVector
A vector of leaves.
Definition: TrueKdTree.h:105
Vector3Tpl< PointCoordinateType > toPC() const
Definition: CVGeom.h:263
static const double one_sqrtpi
Definition: ErrorFunction.cpp:47
std::vector< unsigned int > cellIndexesContainer
Octree cell indexes container.
Definition: DgmOctree.h:95
~ScopeTimer()
Definition: Timer.cpp:62
SimpleTriangle dummyTriangle
Dump triangle structure to transmit temporary data.
Definition: SimpleMesh.h:109
unsigned outsideIndex
Definition: ManualSegmentationTools.cpp:344
const CCVector3 * getPoint(unsigned index) const override
Returns the ith point.
Definition: ReferenceCloud.h:79
void forEach(genericTriangleAction action) override
Fast iteration mechanism.
Definition: SimpleMesh.cpp:32
void define_TrueKdTree(py::module &cccorelib)
Definition: TrueKdTree.cpp:22
bool computeParameters(const ScalarContainer &values) override
Computes the distribution parameters from a set of values.
Definition: WeibullDistribution.cpp:137
virtual bool isCancelRequested()=0
Checks if the process should be canceled.
std::vector< unsigned > m_trialCells
TRIAL cells list.
Definition: FastMarching.h:214
void scale(Scalar coef)
Scales matrix (all elements are multiplied by the same coef.)
Definition: SquareMatrix.h:459
@ FLAG_DEPRECATED
Definition: Neighbourhood.h:35
static bool EigenVector4dToJsonArray(const Eigen::Vector4d &vec, Json::Value &value)
Definition: IJsonConvertible.cpp:77
~Timer()
Definition: Timer.cpp:20
Eigen::Matrix< double, 6, 1 > Vector6d
Definition: Eigen.h:107
ScalarFieldView(cloudViewer::ScalarField &field, const py::slice &slice)
Definition: ScalarField.cpp:32
std::tuple< bool, Eigen::Matrix4d > SolveJacobianSystemAndObtainExtrinsicMatrix(const Eigen::Matrix6d &JTJ, const Eigen::Vector6d &JTr)
Definition: Eigen.cpp:105
OctreeAndMeshIntersection()
Default constructor.
Definition: DistanceComputationTools.cpp:77
virtual bool setChi2ClassesPositions(unsigned numberOfClasses)
Compute each Chi2 class limits.
Definition: WeibullDistribution.cpp:386
unsigned size() const override
Definition: PointCloudTpl.h:38
DgmOctree(GenericIndexedCloudPersist *cloud)
DgmOctree constructor.
Definition: DgmOctree.cpp:174
int n
Definition: StatisticalTestingTools.cpp:32
static bool EigenMatrix3dToJsonArray(const Eigen::Matrix3d &mat, Json::Value &value)
Definition: IJsonConvertible.cpp:99
GenericTriangle * _getNextTriangle() override
Returns the next triangle (relatively to the global iterator position)
Definition: Delaunay2dMesh.cpp:324
ccGuiPythonInstance * GetInstance() noexcept
Definition: Runtime.cpp:72
void updateCellSizeTable()
Definition: DgmOctree.cpp:405
double GetDurationInSecond() const
Definition: Timer.cpp:40
static bool EigenMatrix4dToJsonArray(const Eigen::Matrix4d &mat, Json::Value &value)
Definition: IJsonConvertible.cpp:120
ScalarType computeRoughness(const CCVector3 &P, const CCVector3 *roughnessUpDir=nullptr)
Definition: Neighbourhood.cpp:886
const char * ReadLine()
Definition: FileSystem.cpp:820
Cell ** m_theGrid
Grid used to process Fast Marching.
Definition: FastMarching.h:235
Tensor Permute(const SizeVector &dims) const
Permute (dimension shuffle) the Tensor, returns a view.
Definition: Tensor.cpp:1028
constexpr Rgbaf middle(0.50f, 0.50f, 0.50f, 1.00f)
CPU information.
Definition: CPUInfo.h:19
ScalarField * weights
Definition: RegistrationTools.cpp:140
Type cross(const Vector2Tpl &v) const
Cross product.
Definition: CVGeom.h:76
A class to perform a conjugate gradient optimization.
Definition: ConjugateGradient.h:25
virtual unsigned capacity() const
Returns max capacity.
Definition: ReferenceCloud.h:174
virtual const CCVector3 * _getA() const =0
Returns the first vertex (A)
@ DELAUNAY_2D_AXIS_ALIGNED
Definition: PointProjectionTools.h:23
A simple scalar field (to be associated to a point cloud)
Definition: ScalarField.h:25
virtual unsigned size() const override
Returns the number of triangles.
Definition: SimpleMesh.h:47
virtual ScalarType getCurrentPointScalarValue() const
Returns the current point associated scalar value.
Definition: ReferenceCloud.h:119
int p
Definition: Universe.h:17
static double GetSystemTimeInMilliseconds()
Definition: Timer.cpp:22
DgmOctree * octree
Octree structure.
Definition: DistanceComputationTools.cpp:62
std::vector< Tensor > GetIndexTensors() const
Definition: AdvancedIndexing.h:31
std::string GetFileNameWithoutExtension(const std::string &filename)
Definition: FileSystem.cpp:295
std::vector< IndexAndCode > cellsContainer
Container of 'IndexAndCode' structures.
Definition: DgmOctree.h:351
static bool PrintDebug(const char *format,...)
Same as Print, but works only in Debug mode.
Definition: CVLog.cpp:153
Eigen::VectorXd GetProgramOptionAsEigenVectorXd(int argc, char **argv, const std::string &option, const Eigen::VectorXd default_value=Eigen::VectorXd::Zero(0))
Definition: Console.cpp:71
WeibullDistribution()
WeibullDistribution constructor.
Definition: WeibullDistribution.cpp:89
@ EigenValue3
Definition: Neighbourhood.h:175
PointCoordinateType computeLargestRadius()
Definition: Neighbourhood.cpp:184
const CCVector3 * getLSPlaneY()
Returns best interpolating plane (Least-square) 'Y' base vector.
Definition: Neighbourhood.cpp:95
Tuple3i m_minFillIndexes
Octree min fill indexes at 'm_gridLevel'.
Definition: FastMarching.h:244
NormalizedProgress(GenericProgressCallback *callback, unsigned totalSteps, unsigned totalPercentage=100)
Default constructor.
Definition: NormalizedProgress.cpp:44
double stddev(std::vector< double > const &func)
Definition: qAutoSeg.cpp:86
virtual void stop()=0
Notifies the fact that the process has ended.
std::string GetTempDirectoryPath()
Definition: FileSystem.cpp:423
DgmOctree::CellCode cellCode
Equivalent cell code in the octree.
Definition: FastMarchingForPropagation.h:97
std::string GetHomeDirectory()
Get the HOME directory for the user.
Definition: FileSystem.cpp:74
static const CellCode INVALID_CELL_CODE
Invalid cell code.
Definition: DgmOctree.h:89
static bool ComparisonX(const unsigned &a, const unsigned &b)
Compares X coordinates of two points designated by their index.
Definition: CVKdTree.cpp:91
void computeCellsStatistics(unsigned char level)
Computes statistics about cells for a given level of subdivision.
Definition: DgmOctree.cpp:423
Tree leaf.
Definition: TrueKdTree.h:79
math::float4 color
Definition: LineSetBuffers.cpp:46
@ Anisotropy
Definition: Neighbourhood.h:165
int m_fillIndexes[(MAX_OCTREE_LEVEL+1) *6]
Definition: DgmOctree.h:1258
Tensor tensor_
Definition: AdvancedIndexing.h:91
unsigned globalIterator
Iterator on the list of triangles.
Definition: SimpleMesh.h:107
virtual void setMethodTitle(const char *methodTitle)=0
Notifies the algorithm title.
std::tuple< MatType, VecType, double > ComputeJTJandJTr(std::function< void(int, VecType &, double &, double &)> f, int iteration_num, bool verbose=true)
Definition: Eigen.cpp:148
static ScalarType NaN()
Returns the specific NaN value.
Definition: ScalarField.h:46
void addElement(ScalarType value)
Definition: ScalarField.h:99
Tensor AsStrided(const SizeVector &new_shape, const SizeVector &new_strides) const
Create a Tensor view of specified shape and strides. The underlying buffer and data_ptr offsets remai...
Definition: Tensor.cpp:1061
PointCoordinateType getSquareSize() const
Returns the model max radius (squared)
Definition: LocalModel.h:40
virtual ScalarType getPointScalarValue(unsigned pointIndex) const =0
Returns the ith point associated scalar value.
float computeTCoefApprox(Cell *currentCell, Cell *neighbourCell) const override
Computes the front acceleration between two cells.
Definition: FastMarchingForPropagation.cpp:212
constexpr double EPSILON_VALUE
Definition: CVConst.h:87
virtual unsigned getPointGlobalIndex(unsigned localIndex) const
Definition: ReferenceCloud.h:103
#define ParallelSort
Definition: ParallelSort.h:33
unsigned executeFunctionForAllCellsAtLevel(unsigned char level, octreeCellFunc func, void **additionalParameters, bool multiThread=false, GenericProgressCallback *progressCb=nullptr, const char *functionTitle=nullptr, int maxThreadCount=0)
Definition: DgmOctree.cpp:3573
void invalidate()
Invalidates matrix.
Definition: SquareMatrix.h:143
Definition: GenericProgressCallback.h:20
AdvancedIndexerMode
Definition: AdvancedIndexing.h:119
void swap(optional< T > &x, optional< T > &y) noexcept(noexcept(x.swap(y)))
Definition: Optional.h:890
unsigned char findBestLevelForAGivenPopulationPerCell(unsigned indicativeNumberOfPointsPerCell) const
Definition: DgmOctree.cpp:2737
static bool SortEigenValuesAndVectors(SquareMatrix &eigenVectors, EigenValues &eigenValues)
Definition: Jacobi.h:333
bool setPropagationTimingsAsDistances()
Sets the propagation timings as distances for each point.
Definition: FastMarchingForPropagation.cpp:168
bool normalsAvailable() const override
Returns whether normals are available.
Definition: SimpleMesh.cpp:127
std::tuple< Eigen::Vector3d, Eigen::Matrix3d > ComputeMeanAndCovariance(const std::vector< Eigen::Vector3d > &points, const std::vector< IdxType > &indices)
Function to compute the mean and covariance matrix of a set of points.
Definition: Eigen.cpp:321
bool HasFileExtension(const std::string &file_name, const std::string &ext)
Definition: FileSystem.cpp:117
void forwardIterator()
Forwards global iterator.
Definition: DgmOctreeReferenceCloud.h:75
const CCVector3 & getOctreeMaxs() const
Returns the higher boundaries of the octree.
Definition: DgmOctree.h:458
const CCVector3 * getLSPlaneX()
Returns best interpolating plane (Least-square) 'X' base vector.
Definition: Neighbourhood.cpp:88
std::mutex m_mutex
For concurrent access.
Definition: ReferenceCloud.h:250
@ RC_CLOSE_POINTS
Definition: DgmOctree.h:1179
static const int MAX_OCTREE_LEVEL
Max octree subdivision level.
Definition: DgmOctree.h:67
std::vector< size_t > GetPointIndicesWithinBoundingBox(const std::vector< Eigen::Vector3d > &points) const
Return indices to points that are within the bounding box.
Definition: OrientedBoundingBox.cpp:50
static bool TriangleAABB(const Eigen::Vector3d &box_center, const Eigen::Vector3d &box_half_size, const Eigen::Vector3d &vert0, const Eigen::Vector3d &vert1, const Eigen::Vector3d &vert2)
Definition: IntersectionTest.cpp:56
Scalar ** m_values
The matrix rows.
Definition: SquareMatrix.h:157
ScalarType m_a
Weibull distribution parameter a (k)
Definition: WeibullDistribution.h:94
void destroy(C *item)
To manually delete an item already in the trash.
Definition: Garbage.h:32
ScalarType computeDistanceFromModelToPoint(const CCVector3 *P, CCVector3 *nearestPoint=nullptr) const override
Compute the (unsigned) distance between a 3D point and this model.
Definition: LocalModel.cpp:33
static DgmOctree::CellCode GenerateCellCodeForDim(int pos)
Definition: DgmOctree.cpp:158
unsigned m_dz
Grid size along the Z dimension.
Definition: FastMarching.h:225
static const uint8_t Z_DIM
Definition: TrueKdTree.h:28
CLOUDVIEWER_HOST_DEVICE char * GetInputPtr(int64_t workload_idx) const
Definition: AdvancedIndexing.h:167
Tuple3ui m_innerSize
Dimensions of the grid (without margin)
Definition: Grid3D.h:547
static std::function< void(const std::string &)> console_print_fcn_
Definition: Logging.h:136
ScalarType mean
K-mean class mean value.
Definition: ScalarFieldTools.h:24
Vector3Tpl< PointCoordinateType > CCVector3
Default 3D Vector.
Definition: CVGeom.h:798
bool computeParameters(const ScalarContainer &values) override
Computes the distribution parameters from a set of values.
Definition: NormalDistribution.cpp:109
QtCompatTextCodec * qtCompatCodecForLocale()
Definition: QtCompat.h:650
VerticesIndexes m_dumpTriangleIndexes
Dump triangle index structure to transmit temporary data.
Definition: Delaunay2dMesh.h:148
float m_detectionThreshold
Threshold for propagation stop.
Definition: FastMarchingForPropagation.h:111
ScalarType insidePointToCellDistance(const PointCoordinateType *queryPoint, KdCell *cell)
Definition: CVKdTree.cpp:462
const GridElement & getValue(int i, int j, int k) const
Returns the value of a given cell (const version)
Definition: Grid3D.h:498
A simple triangle class.
Definition: SimpleTriangle.h:52
Association between an index and the code of an octree cell.
Definition: DgmOctree.h:301
~SimpleMesh() override
SimpleMesh destructor.
Definition: SimpleMesh.cpp:25
#define LOG_ARGS(flags)
Definition: CVLog.cpp:94
@ PCA1
Definition: Neighbourhood.h:168
Definition: DgmOctree.h:658
void toIdentity()
Sets matrix to identity.
Definition: SquareMatrix.h:452
static std::vector< PointCoordinateType > s_sortedCoordsForSplit
Definition: TrueKdTree.cpp:38
uni_elt * elts
Definition: Universe.h:39
std::vector< unsigned int > face
Definition: TriangleMeshIO.cpp:50
BitShiftValues()
Default initialization.
Definition: DgmOctree.cpp:49
bool rayCast(const CCVector3 &rayAxis, const CCVector3 &rayOrigin, double maxRadiusOrFov, bool isFOV, RayCastProcess process, std::vector< PointDescriptor > &output) const
Ray casting algorithm.
Definition: DgmOctree.cpp:4353
unsigned short GridElement
Cell type.
Definition: Grid3D.h:35
static std::string GetEnvVar(const std::string &name)
Definition: Parallel.cpp:23
void initFromQuaternion(const float q[])
Creates a rotation matrix from a quaternion (float version)
Definition: SquareMatrix.h:480
SizeVector GetIndexedShape() const
Definition: AdvancedIndexing.h:37
bool(*)(const octreeCell &, void **, NormalizedProgress *) octreeCellFunc
Definition: DgmOctree.h:395
unsigned m_numberOfNeighbours
Current number of neighbours (6 or 26)
Definition: FastMarching.h:247
A generic Fast Marching grid cell.
Definition: FastMarching.h:95
double squareDistd
Point associated distance value.
Definition: DgmOctree.h:107
Eigen::Matrix4d TransformVector6dToMatrix4d(const Eigen::Vector6d &input)
Definition: Eigen.cpp:76
A bounding box oriented along an arbitrary frame of reference.
Definition: OrientedBoundingBox.h:22
CCVector3 C
C vertex.
Definition: SimpleTriangle.h:77
bool Copy(const std::string &from, const std::string &to, bool include_parent_dir=false, const std::string &extname="")
Copy a file or directory.
Definition: FileSystem.cpp:249
CCVector3 outbbmax
Outside bounding box max point.
Definition: CVKdTree.h:134
VerbosityLevel GetVerbosityLevel()
Get global verbosity level of CloudViewer.
Definition: Logging.cpp:93
core::Tensor result
Definition: VtkUtils.cpp:76
int64_t indexed_strides_[MAX_DIMS]
Definition: AdvancedIndexing.h:206
Definition: MemoryInfo.h:19
Octree cell descriptor.
Definition: DgmOctree.h:354
ScalarType maxValue
K-mean class maximum value.
Definition: ScalarFieldTools.h:28
bool enableScalarField() override
Definition: PointCloudTpl.h:77
static int OCTREE_LENGTH(int level)
Definition: DgmOctree.cpp:118
int num
Definition: Universe.h:40
virtual void setInfo(const char *infoStr)=0
Notifies some information about the ongoing process.
virtual bool setSeedCell(const Tuple3i &pos)
Sets a given cell as "seed".
Definition: FastMarching.cpp:150
cloudViewer::SquareMatrixTpl< Scalar > & A()
Returns A matrix.
Definition: ConjugateGradient.h:39
@ MEAN_CURV
Definition: Neighbourhood.h:42
bool Open(const std::string &filename, const std::string &mode)
Open a file.
Definition: FileSystem.cpp:739
float
Definition: my_point_types.h:154
static bool Error(const char *format,...)
Display an error dialog with formatted message.
Definition: CVLog.cpp:143
static std::vector< Message > s_backupMessages
Definition: CVLog.cpp:41
bool interpolateNormals(unsigned triIndex, const CCVector3 &P, CCVector3 &N) override
Interpolates normal(s) inside a given triangle.
Definition: SimpleMesh.cpp:131
void store(int value)
Definition: NormalizedProgress.cpp:31
#define CC_FM_MAX_NUMBER_OF_NEIGHBOURS
Definition: FastMarching.h:26
static CVLog * s_instance
Definition: CVLog.cpp:51
int64_t NumDims() const
Definition: Tensor.h:1172
virtual bool reserve(unsigned n)
Reserves the memory to store the triangles (as 3 indexes each)
Definition: SimpleMesh.cpp:109
virtual void getTriangleVertices(unsigned triangleIndex, CCVector3 &A, CCVector3 &B, CCVector3 &C) const =0
Returns the vertices of a given triangle.
void diff(const cellCodesContainer &codesA, const cellCodesContainer &codesB, cellCodesContainer &diffA, cellCodesContainer &diffB) const
Definition: DgmOctree.cpp:2955
@ Verticality
Definition: Neighbourhood.h:172
void fill(ScalarType fillValue=0)
Fills the array with a particular value.
Definition: ScalarField.h:77
unsigned numberOfTriangles
Definition: DistanceComputationTools.cpp:1903
virtual bool addPointIndex(unsigned globalIndex)
Point global index insertion mechanism.
Definition: ReferenceCloud.cpp:84
A Fast Marching grid cell for surfacical propagation.
Definition: FastMarchingForPropagation.h:86
void define_ScalarField(py::module &cccorelib)
Definition: ScalarField.cpp:155
virtual void getBoundingBox(CCVector3 &bbMin, CCVector3 &bbMax)=0
Returns the cloud bounding box.
virtual bool isScalarFieldEnabled() const =0
Returns true if the scalar field is enabled, false otherwise.
bool FileExists(const std::string &filename)
Definition: FileSystem.cpp:524
CLOUDVIEWER_HOST_DEVICE int64_t GetIndexedOffset(int64_t workload_idx) const
Definition: AdvancedIndexing.h:184
ScalarType computeMomentOrder1(const CCVector3 &P)
Definition: Neighbourhood.cpp:760
int findNeighborsInASphereStartingFromCell(NearestNeighboursSearchStruct &nNSS, double radius, bool sortValues=true) const
Advanced form of the nearest neighbours search algorithm (in a sphere)
Definition: DgmOctree.cpp:2479
@ LOG_IMPORTANT
Definition: CVLog.h:45
PointCoordinateType splitValue
Definition: TrueKdTree.h:57
int size
Definition: FileIOFactory.cpp:130
ScalarType m_sigma2
Variance.
Definition: NormalDistribution.h:88
bool ChangeWorkingDirectory(const std::string &directory)
Definition: FileSystem.cpp:427
static bool TriangleTriangle3d(const Eigen::Vector3d &p0, const Eigen::Vector3d &p1, const Eigen::Vector3d &p2, const Eigen::Vector3d &q0, const Eigen::Vector3d &q1, const Eigen::Vector3d &q2)
Definition: IntersectionTest.cpp:32
Tuple3Tpl< int > Tuple3i
Tuple of 3 int values.
Definition: CVGeom.h:217
virtual ~octreeCell()
Default destructor.
Definition: DgmOctree.cpp:3506
unsigned char m_X
Height function first dimension (0=X, 1=Y, 2=Z)
Definition: LocalModel.cpp:152
Eigen::Matrix3d SkewMatrix(const Eigen::Vector3d &vec)
Genretate a skew-symmetric matrix from a vector 3x1.
Definition: Eigen.cpp:414
std::string GetProgramOptionAsString(int argc, char **argv, const std::string &option, const std::string &default_value="")
Definition: Console.cpp:19
int m_neighboursIndexShift[26]
Neighbours coordinates shifts in grid.
Definition: FastMarching.h:249
unsigned m_sliceSize
Shift for cell access acceleration (Z dimension)
Definition: FastMarching.h:229
int64_t element_byte_size_
Definition: AdvancedIndexing.h:204
void getTriangleVertices(unsigned triangleIndex, CCVector3 &A, CCVector3 &B, CCVector3 &C) const override
Returns the vertices of a given triangle.
Definition: SimpleMesh.cpp:60
int size
Definition: Universe.h:18
~DelaunayLocalModel() override
Destructor.
Definition: LocalModel.cpp:64
ScalarType getMin() const
Returns the minimum value.
Definition: ScalarField.h:72
ReferenceCloud * points
Definition: TrueKdTree.h:83
std::tuple< bool, Eigen::VectorXd > SolveLinearSystemPSD(const Eigen::MatrixXd &A, const Eigen::VectorXd &b, bool prefer_sparse=false, bool check_symmetric=false, bool check_det=false, bool check_psd=false)
Function to solve Ax=b.
Definition: Eigen.cpp:21
const Tuple3ui & size() const
Returns the grid dimensions.
Definition: Grid3D.h:48
static bool EigenMatrix6dFromJsonArray(Eigen::Matrix6d &mat, const Json::Value &value)
Definition: IJsonConvertible.cpp:150
normal_z y
Definition: my_point_types.h:168
Rgb at(size_t color_id)
Definition: ecvColorTypes.cpp:77
CCShareable()
Default constructor.
Definition: CVShareable.cpp:27
double m_normFactor
Normalization factor.
Definition: NormalDistribution.h:92
Vector3Tpl< double > toDouble() const
Cast operator to a double vector (explicit call version)
Definition: CVGeom.h:255
bool checkDistantPointInSubTree(const PointCoordinateType *queryPoint, ScalarType &maxSqrDist, KdCell *cell)
Definition: CVKdTree.cpp:528
virtual std::string ToString() const
Convert to a styled string representation of JSON data for display.
Definition: IJsonConvertible.cpp:37
AdvancedIndexerMode mode_
Definition: AdvancedIndexing.h:202
static GenericProgressCallback * s_progressCb
Definition: TrueKdTree.cpp:39
LocalModel(const CCVector3 ¢er, PointCoordinateType squaredRadius)
Constructor.
Definition: LocalModel.cpp:161
static double critchi(double p, int df)
Compute critical chi-square value toproduce given p.
Definition: Chi2Helper.h:148
PointCloud * CPSetPlain
Definition: RegistrationTools.cpp:142
Vector3Tpl cross(const Vector3Tpl &v) const
Cross product.
Definition: CVGeom.h:412
bool resizeSafe(std::size_t count, bool initNewElements=false, ScalarType valueForNewElements=0)
Resizes memory (no exception thrown)
Definition: ScalarField.cpp:81
void getBoundingBox(CCVector3 &bbMin, CCVector3 &bbMax) override
Returns the mesh bounding-box.
Definition: SimpleMesh.cpp:84
Eigen::Matrix< double, 6, 6, Eigen::DontAlign > Matrix6d_u
Definition: Eigen.h:112
AtomicCounter()
Definition: NormalizedProgress.cpp:29
GenericProgressCallback * progressCallback
associated GenericProgressCallback
Definition: GenericProgressCallback.h:124
unsigned char findBestLevelForAGivenCellNumber(unsigned indicativeNumberOfCells) const
Definition: DgmOctree.cpp:2766
double volume() const
Returns the volume of the bounding box.
Definition: OrientedBoundingBox.cpp:30
void updateOutsideBoundingBox(KdCell *cell)
Definition: CVKdTree.cpp:390
bool reserveSafe(std::size_t count)
Reserves memory (no exception thrown)
Definition: ScalarField.cpp:71
bool StringContains(const std::string &src, const std::string &dst)
Definition: Helper.cpp:154
const unsigned & getCellNumber(unsigned char level) const
Returns the number of cells for a given level of subdivision.
Definition: DgmOctree.h:1038
bool m_cloudIsOwnedByMesh
Definition: Delaunay2dMesh.h:142
Eigen::Matrix< uint8_t, 3, 1 > Vector3uint8
Definition: Eigen.h:108
std::string GetFileNameWithoutDirectory(const std::string &filename)
Definition: FileSystem.cpp:301
Eigen::Matrix3d RotationMatrixX(double radians)
Definition: Eigen.cpp:248
virtual const CCVector3 * _getB() const =0
Returns the second vertex (B)
unsigned m_cellCount[MAX_OCTREE_LEVEL+1]
Number of cells per level of subdivision.
Definition: DgmOctree.h:1260
GenericMesh * m_tri
Associated triangulation.
Definition: LocalModel.cpp:100
Jacobi eigen vectors/values decomposition.
Definition: Jacobi.h:23
STATE state
Cell state.
Definition: FastMarching.h:115
static bool PointsCoplanar(const Eigen::Vector3d &p0, const Eigen::Vector3d &p1, const Eigen::Vector3d &p2, const Eigen::Vector3d &p3)
Tests if the given four points all lie on the same plane.
Definition: IntersectionTest.cpp:69
bool getOtherParameters(ScalarType &mu, ScalarType &sigma2) const
Returns the normal distribution equivalent parameters.
Definition: WeibullDistribution.cpp:104
FastMarchingForPropagation()
Default constructor.
Definition: FastMarchingForPropagation.cpp:17
float nearestPointSquareDist
Definition: PointProjectionTools.cpp:508
void define_NormalDistribution(py::module &cccorelib)
Definition: NormalDistribution.cpp:17
std::vector< ScalarType > ScalarContainer
Scalar values container.
Definition: GenericDistribution.h:46
int EstimateMaxThreads()
Estimate the maximum number of threads to be used in a parallel region.
Definition: Parallel.cpp:31
void initConjugateGradient(const Scalar *X0)
Initializes the conjugate gradient.
Definition: ConjugateGradient.h:47
unsigned theIndex
index
Definition: DgmOctree.h:303
const DgmOctree * parentOctree
Octree to which the cell belongs.
Definition: DgmOctree.h:359
double pi
Definition: StatisticalTestingTools.cpp:31
bool extractPropagatedPoints(ReferenceCloud *Zk)
Definition: FastMarchingForPropagation.cpp:141
bool operator<(const Edge &e) const
Definition: PointProjectionTools.cpp:502
Definition: ManualSegmentationTools.cpp:339
static unsigned s_lastProgressCount
Definition: TrueKdTree.cpp:40
virtual VerticesIndexes * getNextTriangleVertIndexes()=0
static bool ValidValue(ScalarType value)
Returns whether a scalar value is valid or not.
Definition: ScalarField.h:61
bool IsFile(const std::string &filename)
Definition: FileSystem.cpp:435
GenericIndexedCloud * m_associatedCloud
Associated cloud.
Definition: CVKdTree.h:173
@ QUADRIC
Definition: CVConst.h:125
unsigned char m_Z
Height function third dimension (0=X, 1=Y, 2=Z)
Definition: LocalModel.cpp:156
static std::pair< Tensor, std::vector< Tensor > > ShuffleIndexedDimsToFront(const Tensor &tensor, const std::vector< Tensor > &index_tensors)
Definition: AdvancedIndexing.cpp:41
void Start()
Definition: Timer.cpp:28
const char * getName() const
Returns scalar field name.
Definition: ScalarField.h:43
std::size_t trianglesToTestCount
Definition: DistanceComputationTools.cpp:1901
static int PhysicalConcurrency()
Returns the number of physical CPU cores.
Definition: CPUInfo.cpp:36
double computeMode() const
Returns the distribution 'mode'.
Definition: WeibullDistribution.cpp:420
std::size_t trianglesToTestCapacity
Definition: DistanceComputationTools.cpp:1902
bool StringEndsWith(const std::string &str, const std::string &postfix)
Definition: Helper.cpp:163
static const std::string path
Definition: PointCloud.cpp:59
const double * e
Definition: essential_matrix_poly.h:10
unsigned findNearestNeighborsStartingFromCell(NearestNeighboursSearchStruct &nNSS, bool getOnlyPointsWithValidScalar=false) const
Definition: DgmOctree.cpp:1655
SquareMatrixTpl< PointCoordinateType > SquareMatrix
Default CC square matrix type (PointCoordinateType)
Definition: SquareMatrix.h:1020
SaitoSquaredDistanceTransform * distanceTransform
Distance transform.
Definition: DistanceComputationTools.cpp:66
ScalarType computeCurvature(const CCVector3 &P, CurvatureType cType)
Computes the curvature of a set of point (by fitting a 2.5D quadric)
Definition: Neighbourhood.cpp:906
Tree base node.
Definition: TrueKdTree.h:33
bool GreaterThanEpsilon(float x)
Test a floating point number against our epsilon (a very small number).
Definition: CVMath.h:37
int checkNearerPointInSubTree(const PointCoordinateType *queryPoint, ScalarType &maxSqrDist, KdCell *cell)
Definition: CVKdTree.cpp:502
GenericTriangle * _getNextTriangle() override
Returns the next triangle (relatively to the global iterator position)
Definition: SimpleMesh.cpp:45
void define_DgmOctree(py::module &cccorelib)
Definition: DgmOctree.cpp:21
double m_maxError
Max error for planarity-based split strategy (see m_errorMeasure)
Definition: TrueKdTree.h:159
virtual int step()=0
Propagates the front (one step)
virtual GenericTriangle * _getNextTriangle()=0
Returns the next triangle (relatively to the global iterator position)
virtual void forwardIterator()
Forwards the local element iterator.
Definition: ReferenceCloud.h:133
virtual void cleanLastPropagation()
Definition: FastMarching.cpp:143
BoundingBox m_bbox
Bounding-box.
Definition: SimpleMesh.h:118
std::size_t countValidValues() const
Returns the number of valid values in this scalar field.
Definition: ScalarField.cpp:29
unsigned m_numberOfTriangles
The number of triangles.
Definition: Delaunay2dMesh.h:138
virtual const CCVector3 * getNormal(unsigned index) const
If per-point normals are available, returns the one at a specific index.
Definition: GenericIndexedCloud.h:59
virtual void placeIteratorAtBeginning()=0
Places the mesh iterator at the beginning.
void swap(cloudViewer::core::SmallVectorImpl< T > &LHS, cloudViewer::core::SmallVectorImpl< T > &RHS)
Implement std::swap in terms of SmallVector swap.
Definition: SmallVector.h:1370
#define LogDebug(...)
Definition: Logging.h:90
Eigen::Matrix3d RotationMatrixZ(double radians)
Definition: Eigen.cpp:262
void visit(TrueKdTree::BaseNode *node)
Definition: TrueKdTree.cpp:304
virtual void setPointIndex(unsigned localIndex, unsigned globalIndex)
Sets global index for a given element.
Definition: ReferenceCloud.cpp:127
const GenericIndexedCloud * vertices() const
Returns the vertices.
Definition: SimpleMesh.h:67
static const int VALUE_COUNT
Total number of positions/values.
Definition: DgmOctree.cpp:70
A K-mean class position and boundaries.
Definition: ScalarFieldTools.h:22
static std::pair< std::vector< Tensor >, SizeVector > ExpandToCommonShapeExceptZeroDim(const std::vector< Tensor > &index_tensors)
Definition: AdvancedIndexing.cpp:63
Definition: CVPointCloud.h:18
void applySlicing(const py::slice &slice)
Definition: ScalarField.cpp:133
void define_ErrorFunction(py::module &cccorelib)
Definition: ErrorFunction.cpp:15
virtual void addTrialCell(unsigned index)
Add a cell to the TRIAL cells list.
Definition: FastMarching.cpp:191
int init(GenericCloud *theCloud, DgmOctree *theOctree, unsigned char gridLevel, bool constantAcceleration=false)
Initializes the grid with a point cloud (and ist corresponding octree)
Definition: FastMarchingForPropagation.cpp:27
void invalidateBoundingBox()
Invalidates the bounding-box.
Definition: ReferenceCloud.h:227
bool isValid() const
Returns whether bounding box is valid or not.
Definition: BoundingBox.h:203
unsigned capacity() const
Returns cloud capacity (i.e. reserved size)
Definition: PointCloudTpl.h:540
octreeCell(const DgmOctree *parentOctree)
Default constructor.
Definition: DgmOctree.cpp:3482
double GetDurationInMillisecond() const
Definition: Timer.cpp:36
std::string EnsureTrailingSlash(const std::string &str)
Definition: FileSystem.cpp:106
virtual unsigned getNearestTrialCell()
Returns the TRIAL cell with the smallest front arrival time.
Definition: FastMarching.cpp:206
virtual void link()
Increase counter.
Definition: CVShareable.cpp:33
virtual void setAssociatedCloud(GenericIndexedCloudPersist *cloud)
Sets the associated (source) cloud.
Definition: ReferenceCloud.cpp:161
unsigned char values[DgmOctree::MAX_OCTREE_LEVEL+1]
Values.
Definition: DgmOctree.cpp:59
TriangleIndexesContainer m_triIndexes
The triangles indexes.
Definition: SimpleMesh.h:104
int load()
Definition: NormalizedProgress.cpp:30
unsigned i3
Definition: GenericIndexedMesh.h:19
float m_percentAdd
Percentage added to total progress value at each step.
Definition: GenericProgressCallback.h:116
std::string GetRegularizedDirectoryName(const std::string &directory)
Definition: FileSystem.cpp:323
static int VerbosityLevel()
Returns the current verbosity level.
Definition: CVLog.cpp:57
BaseNode * leftChild
Definition: TrueKdTree.h:58
constexpr double ZERO_TOLERANCE_D
Definition: CVConst.h:49
double findTheNearestNeighborStartingFromCell(NearestNeighboursSearchStruct &nNSS) const
Definition: DgmOctree.cpp:1468
static void EnableMessageBackup(bool state)
Enables the message backup system.
Definition: CVLog.cpp:55
unsigned i[3]
Definition: GenericIndexedMesh.h:21
CCVector3 m_dimMax
Max coordinates of the octree bounding-box.
Definition: DgmOctree.h:1245
virtual void release()
Decrease counter and deletes object when 0.
Definition: CVShareable.cpp:35
void forEach(genericPointAction action) override
Fast iteration mechanism.
Definition: DgmOctreeReferenceCloud.cpp:65
virtual float getTime(Tuple3i &pos, bool absoluteCoordinates=false) const
Returns the front arrival time at a given cell.
Definition: FastMarching.cpp:49
Type x
Definition: CVGeom.h:36
int * m_triIndexes
Triangle vertex indexes.
Definition: Delaunay2dMesh.h:129
GenericIndexedCloud * theVertices
The associated point cloud (vertices)
Definition: SimpleMesh.h:112
Fast Marching algorithm (front propagation)
Definition: FastMarching.h:41
virtual bool setChi2ClassesPositions(unsigned numberOfClasses)
Compute each Chi2 class limits.
Definition: NormalDistribution.cpp:221
static bool ErrorDebug(const char *format,...)
Same as Error, but works only in Debug mode.
Definition: CVLog.cpp:181
void placeIteratorAtBeginning() override
Sets the cloud iterator at the beginning.
Definition: ReferenceCloud.h:50
static PointCoordinateType vdistance2(const PointCoordinateType p[], const PointCoordinateType q[])
Definition: CVGeom.h:581
bool intersects(const Ray< T > &r, T *t0=0, T *t1=0) const
Definition: RayAndBox.h:69
virtual int initGridWithOctree(DgmOctree *octree, unsigned char gridLevel)
Definition: FastMarching.cpp:78
static double erf(double x)
Computes erf(x)
Definition: ErrorFunction.cpp:22
DgmOctree::CellCode theCode
cell code
Definition: DgmOctree.cpp:3077
int64_t CurPos()
Returns current position in the file (ftell).
Definition: FileSystem.cpp:760
const int c_FastMarchingNeighbourPosShift[]
Grid neighboring cells positions.
Definition: FastMarching.h:29
float m_neighboursDistance[26]
Neighbours distance weight.
Definition: FastMarching.h:251
virtual ~KDTree()
Destructor.
Definition: CVKdTree.cpp:21
int extractCCs(const cellCodesContainer &cellCodes, unsigned char level, bool sixConnexity, GenericProgressCallback *progressCb=nullptr) const
Definition: DgmOctree.cpp:3093
unsigned pos2index(const Tuple3i &pos) const
Definition: FastMarching.h:87
ScalarType minValue
K-mean class minimum value.
Definition: ScalarFieldTools.h:26
ScalarType getMax() const
Returns the maximum value.
Definition: ScalarField.h:74
Definition: StatisticalTestingTools.cpp:30
bool CopyDir(const std::string &from, const std::string &to)
Copy a directory.
Definition: FileSystem.cpp:202
Definition: Neighbourhood.h:25
float T
Front arrival time.
Definition: FastMarching.h:118
This class is based on PyTorch's aten/src/ATen/native/Indexing.cpp.
Definition: AdvancedIndexing.h:21
unsigned m_step
Definition: GenericProgressCallback.h:113
bool DeleteDirectory(const std::string &directory)
Definition: FileSystem.cpp:514
void setPointScalarValue(unsigned pointIndex, ScalarType value) override
Sets the ith point associated scalar value.
Definition: ReferenceCloud.h:66
static bool GetMinEigenValueAndVector(const SquareMatrix &eigenVectors, const EigenValues &eigenValues, Scalar &minEigenValue, Scalar minEigenVector[])
Returns the smallest eigenvalue and its associated eigenvector.
Definition: Jacobi.h:410
GenericIndexedCloudPersist * m_associatedCloud
Associated cloud.
Definition: Neighbourhood.h:319
void reset()
Clears the cloud database.
Definition: PointCloudTpl.h:233
bool getPointsInCellByCellIndex(ReferenceCloud *cloud, unsigned cellIndex, unsigned char level, bool clearOutputCloud=true) const
Returns the points lying in a specific cell.
Definition: DgmOctree.cpp:2879
std::vector< Tensor > index_tensors_
The processed index tensors.
Definition: AdvancedIndexing.h:94
virtual unsigned char testVisibility(const CCVector3 &P) const
Definition: GenericCloud.h:65
std::ostream & operator<<(std::ostream &os, const MemoryInfo &infos)
Definition: MemoryInfo.cpp:146
virtual bool reserve(unsigned newCapacity)
Reserves memory for the point database.
Definition: PointCloudTpl.h:213
virtual ~NormalizedProgress()
Destructor.
Definition: NormalizedProgress.cpp:55
CHAMFER_DISTANCE_TYPE
Chamfer distances types.
Definition: CVConst.h:114
const int * getMinFillIndexes(unsigned char level) const
Definition: DgmOctree.h:474
Definition: ScalarField.cpp:19
PointCloud * rotatedCloud
Definition: RegistrationTools.cpp:139
virtual bool isValid() const
Indicates if the distribution parameters are valid.
Definition: GenericDistribution.h:43
static CellCode GenerateTruncatedCellCode(const Tuple3i &cellPos, unsigned char level)
Definition: DgmOctree.cpp:120
CellCode truncatedCode
Truncated cell code.
Definition: DgmOctree.h:361
static bool AABBAABB(const Eigen::Vector3d &min0, const Eigen::Vector3d &max0, const Eigen::Vector3d &min1, const Eigen::Vector3d &max1)
Definition: IntersectionTest.cpp:16
std::size_t getPointsInBoxNeighbourhood(BoxNeighbourhood ¶ms) const
Returns the points falling inside a box.
Definition: DgmOctree.cpp:1951
const Dtype Bool
Definition: Dtype.cpp:52
std::string ToString() const
Definition: Dtype.h:65
void setValue(unsigned row, unsigned column, Scalar value)
Sets a particular matrix value.
Definition: SquareMatrix.h:163
bool getCellIndexes(unsigned char level, cellIndexesContainer &vec) const
Definition: DgmOctree.cpp:2850
static void vsubstract(const PointCoordinateType p[], const PointCoordinateType q[], PointCoordinateType r[])
Definition: CVGeom.h:550
static bool s_backupEnabled
Definition: CVLog.cpp:39
The octree structure used throughout the library.
Definition: DgmOctree.h:39
static const double LOG_NAT_2
Const value: ln(2)
Definition: DgmOctree.cpp:44
virtual void placeIteratorAtBeginning()=0
Sets the cloud iterator at the beginning.
ScalarType m_mu
Normal distribution equivalent parameter: mean.
Definition: WeibullDistribution.h:101
static double erfc(double x)
Computes erfc(x)
Definition: ErrorFunction.cpp:49
Garbage container (automatically deletes pointers when destroyed)
Definition: Garbage.h:15
static Tensor RestrideTensor(const Tensor &tensor, int64_t dims_before, int64_t dims_indexed, SizeVector replacement_shape)
Definition: AdvancedIndexing.cpp:85
Eigen::Vector3d color_
The color of the bounding box in RGB.
Definition: OrientedBoundingBox.h:117
FILE * FOpen(const std::string &filename, const std::string &mode)
Definition: FileSystem.cpp:609
@ EigenValue2
Definition: Neighbourhood.h:174
@ EigenValuesSum
Definition: Neighbourhood.h:162
void define_SimpleMesh(py::module &cccorelib)
Definition: SimpleMesh.cpp:18
static PointCoordinateType vnorm(const PointCoordinateType p[])
Definition: CVGeom.h:594
std::string GetCurrentTimeStamp()
Returns current time stamp.
Definition: Helper.cpp:286
unsigned findPointNeighbourhood(const CCVector3 *_queryPoint, ReferenceCloud *Yk, unsigned maxNumberOfNeighbors, unsigned char level, double &maxSquareDist, double maxSearchDist=0, int *finalNeighbourhoodSize=nullptr) const
Finds the nearest neighbours around a query point.
Definition: DgmOctree.cpp:721
unsigned m_numberOfProjectedPoints
Number of points projected in the octree.
Definition: DgmOctree.h:1236
static PointCoordinateType vnorm2(const PointCoordinateType p[])
Definition: CVGeom.h:573
std::string GetEnvVar(const std::string &env_var)
Definition: FileSystem.cpp:66
std::string ToLower(const std::string &s)
Convert string to the lower case.
Definition: Helper.cpp:242
GenericIndexedCloudPersist * m_associatedCloud
Associated cloud.
Definition: TrueKdTree.h:156
int * m_globalIteratorEnd
End position of global iterator.
Definition: Delaunay2dMesh.h:135
unsigned getCellIndex(CellCode truncatedCellCode, unsigned char bitDec) const
Returns the index of a given cell represented by its code.
Definition: DgmOctree.cpp:559
bool onlyPositiveDir
Definition: DgmOctree.h:673
BoundingBox m_bbox
Bounding-box.
Definition: ReferenceCloud.h:240
QString toUnicode(const char *chars, int len=-1)
Definition: QtCompat.h:610
MiniVec< float, N > floor(const MiniVec< float, N > &a)
Definition: MiniVec.h:75
virtual ScalarType computeDistanceFromModelToPoint(const CCVector3 *P, CCVector3 *nearestPoint=nullptr) const =0
Compute the (unsigned) distance between a 3D point and this model.
unsigned getNumberOfProjectedPoints() const
Returns the number of points projected into the octree.
Definition: DgmOctree.h:446
a[190]
Definition: essential_matrix_poly.h:19
Type dot(const Vector2Tpl &v) const
Dot product.
Definition: CVGeom.h:71
double computeFeature(GeomFeature feature)
Computes the given feature on a set of point.
Definition: Neighbourhood.cpp:796
ScalarType getPointScalarValue(unsigned pointIndex) const override
Definition: PointCloudTpl.h:134
AtomicCounter * m_counter
Current number of calls to 'oneStep'.
Definition: GenericProgressCallback.h:121
Device GetDevice() const override
Definition: Tensor.cpp:1435
bool CopyFile(const std::string &from, const std::string &to)
Copy a file.
Definition: FileSystem.cpp:163
std::size_t availableRam
Definition: MemoryInfo.h:22
void flagValueAsInvalid(std::size_t index)
Sets the value as 'invalid' (i.e. NAN_VALUE)
Definition: ScalarField.h:66
bool ListFilesInDirectory(const std::string &directory, std::vector< std::string > &filenames)
Definition: FileSystem.cpp:561
static bool EigenVector3dFromJsonArray(Eigen::Vector3d &vec, const Json::Value &value)
Definition: IJsonConvertible.cpp:43
Eigen::Matrix3d RotationMatrixY(double radians)
Definition: Eigen.cpp:255
Definition: DistanceComputationTools.cpp:59
std::function< void(std::shared_ptr< core::Tensor >)> callback
Definition: FilamentRenderer.cpp:183
struct KdCell * gSon
Definition: CVKdTree.h:146
SizeVector GetIndexedStrides() const
Definition: AdvancedIndexing.h:39
size_t ReadData(T *data, size_t num_elems)
Definition: FileSystem.h:253
static CPUInfo & GetInstance()
Definition: CPUInfo.cpp:174
CCVector3 dir
Cylinder axis (direction)
Definition: DgmOctree.h:662
virtual void forEach(genericPointAction action)=0
Fast iteration mechanism.
static Tensor RestrideIndexTensor(const Tensor &index_tensor, int64_t dims_before, int64_t dims_after)
Definition: AdvancedIndexing.cpp:100
std::vector< ScalarType > m_chi2ClassesPositions
Chi2 classes limits.
Definition: NormalDistribution.h:98
int points
Definition: FileIOFactory.cpp:144
DelaunayLocalModel(GenericMesh *tri, const CCVector3 ¢er, PointCoordinateType squaredRadius)
Constructor.
Definition: LocalModel.cpp:56
std::vector< ScalarType > m_Pi
Structure used during the Chi2 distance computation.
Definition: NormalDistribution.h:101
A generic mesh with index-based vertex access.
Definition: GenericIndexedMesh.h:37
std::string GetFileParentDirectory(const std::string &filename)
Definition: FileSystem.cpp:314
OrientedBoundingBox & Clear()
Definition: OrientedBoundingBox.cpp:22
double GetProgramOptionAsDouble(int argc, char **argv, const std::string &option, const double default_value=0.0)
Definition: Console.cpp:52
virtual bool textCanBeEdited() const
Returns whether the dialog title and info can be updated or not.
Definition: GenericProgressCallback.h:70
constexpr unsigned char POINT_VISIBLE
Definition: CVConst.h:92
static constexpr bool DUPLICATE_VERTICES
Definition: Neighbourhood.h:29
void updateCellCountTable()
Definition: DgmOctree.cpp:416
QString text
Definition: CVLog.cpp:34
void Stop()
Definition: Timer.cpp:32
virtual CV_LOCAL_MODEL_TYPES getType() const =0
Returns the model type.
PointCoordinateType m_cellSize[MAX_OCTREE_LEVEL+2]
Cell dimensions for all subdivision levels.
Definition: DgmOctree.h:1255
cloudViewer::DgmOctree::CellCode values[VALUE_COUNT]
Mono-dimensional cell codes.
Definition: DgmOctree.cpp:101
bool build(double maxError, DistanceComputationTools::ERROR_MEASURES errorMeasure=DistanceComputationTools::RMS, unsigned minPointCountPerCell=3, unsigned maxPointCountPerCell=0, GenericProgressCallback *progressCb=nullptr)
Builds KD-tree.
Definition: TrueKdTree.cpp:247
void clear()
Clears the mesh.
Definition: SimpleMesh.h:70
bool FReadToBuffer(const std::string &path, std::vector< char > &bytes, std::string *errorStr)
Definition: FileSystem.cpp:678
Type z
Definition: CVGeom.h:137
~CFile()
The destructor closes the file automatically.
Definition: FileSystem.cpp:737
unsigned insideIndex
Definition: ManualSegmentationTools.cpp:343
void setClosed(bool state)
Sets whether the polyline is closed or not.
Definition: Polyline.h:29
int64_t pos2index(int i, int j, int k) const
Converts a 3D position to an absolute index.
Definition: Grid3D.h:538
IndexType theIndex
index
Definition: DgmOctree.cpp:3074
FastMarching()
Default constructor.
Definition: FastMarching.cpp:15
virtual bool resize(unsigned n)
Presets the size of the vector used to store point references.
Definition: ReferenceCloud.cpp:64
Definition: GenericMesh.h:21
Definition: SizeVector.h:70
Edge(const VertexIterator &A, unsigned _nearestPointIndex, float _nearestPointSquareDist)
Definition: PointProjectionTools.cpp:494
const CCVector3 * getLSPlaneNormal()
Returns best interpolating plane (Least-square) normal vector.
Definition: Neighbourhood.cpp:102
ReferenceCloud * CPSetRef
Definition: RegistrationTools.cpp:141
flann::Index< flann::L2< float > > KDTree
Definition: FastGlobalRegistration.cpp:22
static bool EigenVector3dToJsonArray(const Eigen::Vector3d &vec, Json::Value &value)
Definition: IJsonConvertible.cpp:55
void setValueShift(ScalarType vs)
Sets the distribution value shift.
Definition: WeibullDistribution.cpp:414
static float T_INF()
Returns infinite time value.
Definition: FastMarching.h:98
Eigen::Vector3d ColorToDouble(uint8_t r, uint8_t g, uint8_t b)
Color conversion from uint8_t 0-255 to double [0,1].
Definition: Eigen.cpp:278
const PointCoordinateType * getLSPlane()
Returns best interpolating plane equation (Least-square)
Definition: Neighbourhood.cpp:69
A kind of ReferenceCloud based on the DgmOctree::NeighboursSet structure.
Definition: DgmOctreeReferenceCloud.h:17
Tuple3i pos
Cell position.
Definition: DistanceComputationTools.cpp:732
Eigen::Vector3d origin
Definition: VoxelGridIO.cpp:26
Type y
Definition: CVGeom.h:36
@ ACTIVE_CELL
Definition: FastMarching.h:105
cloudViewer::SquareMatrixd computeCovarianceMatrix()
Computes the covariance matrix.
Definition: Neighbourhood.cpp:144
ReferenceCloud * points
Set of points lying inside this cell.
Definition: DgmOctree.h:365
ScalarField * weights
Definition: RegistrationTools.cpp:127
virtual void initTrialCells()
Initializes the TRIAL cells list.
Definition: FastMarching.cpp:168
CCVector3 B
B vertex.
Definition: SimpleTriangle.h:75
bool steps(unsigned n)
Increments total progress value of more than a single unit.
Definition: NormalizedProgress.cpp:114
unsigned index
Cell index in octree structure (see m_thePointsAndTheirCellCodes)
Definition: DgmOctree.h:363
A generic 3D point cloud with index-based and presistent access to points.
Definition: GenericIndexedCloudPersist.h:18
A class to compute and handle a Delaunay 2D mesh on a subset of points.
Definition: Delaunay2dMesh.h:24
Definition: DgmOctree.h:699
float DegreesToRadians(int degrees)
Convert degrees to radians.
Definition: CVMath.h:98
Neighbourhood(GenericIndexedCloudPersist *associatedCloud)
Default constructor.
Definition: Neighbourhood.cpp:46
static bool MultiThreadSupport()
Definition: DgmOctree.cpp:162
static bool EigenMatrix6dToJsonArray(const Eigen::Matrix6d &mat, Json::Value &value)
Definition: IJsonConvertible.cpp:162
virtual void clear(bool releaseMemory=false)
Clears the cloud.
Definition: ReferenceCloud.cpp:26
std::vector< Eigen::Vector3d > GetBoxPoints() const
Definition: OrientedBoundingBox.cpp:34
int64_t GetFileSize()
Returns the file size in bytes.
Definition: FileSystem.cpp:772
CCVector3 center
Box center.
Definition: DgmOctree.h:729
std::atomic< unsigned > m_globalIterator
Iterator on the point references container.
Definition: ReferenceCloud.h:237
virtual VerticesIndexes * getTriangleVertIndexes(unsigned triangleIndex)=0
Returns the indexes of the vertices of a given triangle.
static std::vector< Eigen::Matrix< double, 3, 1 > > fromArrayContainer(const std::vector< Vector3Tpl< PointCoordinateType >> &container)
Definition: CVGeom.h:301
std::string GetFileBaseName(const std::string &filename)
Definition: FileSystem.cpp:310
#define LogError(...)
Definition: Logging.h:60
void Print(const std::string &timer_info) const
Definition: Timer.cpp:52
virtual float computeT(unsigned index)
Computes the front arrival time at a given cell.
Definition: FastMarching.cpp:234
virtual bool enableScalarField()=0
Enables the scalar field associated to the cloud.
Definition: Logging.h:309
std::function< void(const CCVector3 &, ScalarType &)> genericPointAction
Generic function applied to a point (used by foreach)
Definition: GenericCloud.h:30
virtual void setPointScalarValue(unsigned pointIndex, ScalarType value)=0
Sets the ith point associated scalar value.
double e3[36]
Definition: essential_matrix_poly.h:13
bool verticesLinked
Definition: SimpleMesh.h:115
void define_Polyline(py::module &cccorelib)
Definition: Polyline.cpp:15
bool projectPointsOn2DPlane(std::vector< Vec2D > &points2D, const PointCoordinateType *planeEquation=nullptr, CCVector3 *O=nullptr, CCVector3 *X=nullptr, CCVector3 *Y=nullptr, InputVectorsUsage vectorsUsage=None)
Projects points on the best fitting LS plane.
Definition: Neighbourhood.h:89
Pre-computed bit shift values (one for each level)
Definition: DgmOctree.cpp:47
CLOUDVIEWER_HOST_DEVICE char * GetOutputPtr(int64_t workload_idx) const
Definition: Indexer.h:438
double computeP(ScalarType x) const override
Computes the probability of x.
Definition: WeibullDistribution.cpp:195
CLOUDVIEWER_HOST_DEVICE char * GetOutputPtr(int64_t workload_idx) const
Definition: AdvancedIndexing.h:175
double computeChi2Dist(const GenericCloud *cloud, unsigned numberOfClasses, int *histo=nullptr) override
Computes the Chi2 distance (related to the Chi2 Test)
Definition: WeibullDistribution.cpp:328
~OctreeAndMeshIntersection()
Destructor.
Definition: DistanceComputationTools.cpp:85
Simple axis aligned box structure.
Definition: RayAndBox.h:50
virtual void getBoundingBox(CCVector3 &bbMin, CCVector3 &bbMax)=0
Returns the mesh bounding-box.
Definition: QtCompat.h:584
std::vector< unsigned > indexes
Triangles indexes.
Definition: DistanceComputationTools.cpp:42
Type norm() const
Returns vector norm.
Definition: CVGeom.h:63
double radialSquareDistance(const Vector3Tpl< T > &P) const
Definition: RayAndBox.h:25
std::vector< std::string > GetPathComponents(const std::string &path)
Definition: FileSystem.cpp:348
void getBoundingBox(CCVector3 &bbMin, CCVector3 &bbMax) const
Returns the octree bounding box.
Definition: DgmOctree.cpp:493
Grid3D< TriangleList * > perCellTriangleList
Array of FacesInCellPtr structures.
Definition: DistanceComputationTools.cpp:74
constexpr PointCoordinateType PC_ONE
'1' as a PointCoordinateType value
Definition: CVConst.h:67
Type dot(const Vector3Tpl &v) const
Dot product.
Definition: CVGeom.h:408
static double vdotd(const PointCoordinateType p[], const PointCoordinateType q[])
Definition: CVGeom.h:523
double computeSkewness() const
Returns the distribution 'skewness'.
Definition: WeibullDistribution.cpp:428
virtual unsigned size() const override
Returns the number of triangles.
Definition: Delaunay2dMesh.h:82
@ RC_NEAREST_POINT
Definition: DgmOctree.h:1179
@ DELAUNAY_2D_BEST_LS_PLANE
Definition: PointProjectionTools.h:25
bool MakeDirectory(const std::string &directory)
Definition: FileSystem.cpp:491
static double Gamma_cc(double x)
Definition: WeibullDistribution.cpp:24
@ EMPTY_CELL
Definition: FastMarching.h:102
virtual const CCVector3 * getPoint(unsigned index) const =0
Returns the ith point.
virtual void reset()
Resets structure (depreactes all associated geometrical fetaures)
Definition: Neighbourhood.cpp:56
@ LOG_WARNING
Definition: CVLog.h:46
static double ComputeG(const ScalarContainer &values, double a, ScalarType valueShift, double valueRange)
internal function for parameters evaluation from sample points
Definition: WeibullDistribution.cpp:222
GenericIndexedCloud * getAssociatedCloud() const
Gets the point cloud from which the tree has been build.
Definition: CVKdTree.h:40
unsigned capacity() const
Returns the mesh capacity.
Definition: SimpleMesh.h:62
void computeCellLimits(CellCode code, unsigned char level, CCVector3 &cellMin, CCVector3 &cellMax, bool isCodeTruncated=false) const
Returns the spatial limits of a given cell.
Definition: DgmOctree.cpp:520
std::vector< unsigned > m_activeCells
ACTIVE cells list.
Definition: FastMarching.h:212
std::size_t totalSwap
Definition: MemoryInfo.h:25
void getPointsInNeighbourCellsAround(NearestNeighboursSearchStruct &nNSS, int neighbourhoodLength, bool getOnlyPointsWithValidScalar=false) const
Gets point in the neighbourhing cells of a specific cell.
Definition: DgmOctree.cpp:906
ModelCloud()
Definition: RegistrationTools.cpp:124
std::tuple< bool, std::vector< Eigen::Matrix4d, Matrix4d_allocator > > SolveJacobianSystemAndObtainExtrinsicMatrixArray(const Eigen::MatrixXd &JTJ, const Eigen::VectorXd &JTr)
Definition: Eigen.cpp:119
Message(const QString &t, int f)
Definition: CVLog.cpp:32
unsigned char level
Cell level of subdivision.
Definition: DgmOctree.h:367
bool m_initialized
Specifiies whether structure is initialized or not.
Definition: FastMarching.h:219
CCVector3 m_dimMin
Min coordinates of the octree bounding-box.
Definition: DgmOctree.h:1243
GenericTriangle * _getTriangle(unsigned triangleIndex) override
Returns the ith triangle.
Definition: SimpleMesh.cpp:49
void setValue(int i, int j, int k, GridElement value)
Sets the value of a given cell.
Definition: Grid3D.h:480
NeighboursSet neighbours
Neighbour points falling inside the box.
Definition: DgmOctree.h:735
int GetProgramOptionAsInt(int argc, char **argv, const std::string &option, const int default_value=0)
Definition: Console.cpp:31
Scalar * b()
Returns b vector.
Definition: ConjugateGradient.h:42
virtual void logMessage(const QString &message, int level)=0
Generic message logging method.
void findPeaks()
Find peaks of local acceleration values.
Definition: FastMarchingForPropagation.cpp:219
void deleteSubTree(KdCell *cell)
Deletes a sub tree.
Definition: CVKdTree.cpp:76
CLOUDVIEWER_HOST_DEVICE char * GetInputPtr(int64_t input_idx, int64_t workload_idx) const
Definition: Indexer.h:406
GenericIndexedCloudPersist * cloud
Definition: RegistrationTools.cpp:126
struct KdCell * father
To go up in the tree.
Definition: CVKdTree.h:148
CCVector3 m_gravityCenter
Gravity center.
Definition: Neighbourhood.h:306
std::vector< PointDescriptor > NeighboursSet
A set of neighbours.
Definition: DgmOctree.h:133
GenericIndexedCloud * m_associatedCloud
Associated point cloud.
Definition: Delaunay2dMesh.h:126
int m_value
Definition: NormalizedProgress.cpp:37
double computeP(ScalarType x) const override
Computes the probability of x.
Definition: NormalDistribution.cpp:64
virtual void addTriangle(unsigned i1, unsigned i2, unsigned i3)
Adds a triangle to the mesh.
Definition: SimpleMesh.cpp:103
CCVector3 m_pointsMax
Definition: DgmOctree.h:1252
void SplitFileExtension(const std::string &path, std::string *root, std::string *ext)
Definition: FileSystem.cpp:137
virtual const CCVector3 * _getC() const =0
Returns the third vertex (C)
void initialize()
Initialize all elements to the default values.
Definition: Universe.cpp:18
static bool indexComp(const IndexAndCodeExt &a, const IndexAndCodeExt &b)
Compares two IndexAndCodeExt instances based on their index.
Definition: DgmOctree.cpp:3087
#define LogInfo(...)
Definition: Logging.h:81
unsigned char level
Subdivision level.
Definition: DistanceComputationTools.cpp:736
GeomFeature
Geometric feature computed from eigen values/vectors.
Definition: Neighbourhood.h:161
std::vector< ReferenceCloud * > ReferenceCloudContainer
A standard container to store several subsets of points.
Definition: AutoSegmentationTools.h:28
Tuple3ub m_quadricEquationDirections
2.5D Quadric equation dimensions
Definition: Neighbourhood.h:290
int count
Definition: FileIOFactory.cpp:132
static const double c_erfRelativeError
Relative error for Error Function computation.
Definition: ErrorFunction.h:21
SizeVector GetStrides() const
Definition: Tensor.h:1135
static PointCoordinateType vdot(const PointCoordinateType p[], const PointCoordinateType q[])
Definition: CVGeom.h:520
IndexAndCodeExt()
Default constructor.
Definition: DgmOctree.cpp:3080
void updateMinAndMaxTables()
Updates the tables containing octree limits and boundaries.
Definition: DgmOctree.cpp:395
unsigned char boundsMask
Mask to know if the outside box is bounded for a given dimmension.
Definition: CVKdTree.h:160
Scalar * row(unsigned index)
Returns pointer to matrix row.
Definition: SquareMatrix.h:160
static bool Warning(const char *format,...)
Prints out a formatted warning message in console.
Definition: CVLog.cpp:133
virtual ~CCShareable()
Destructor.
Definition: CVShareable.cpp:42
TrueKdTree::LeafVector * m_leaves
Definition: TrueKdTree.cpp:318
CCVector3 inbbmin
Inside bounding box min point.
Definition: CVKdTree.h:124
bool push(unsigned index)
Adds a triangle index.
Definition: DistanceComputationTools.cpp:47
double e2[36]
Definition: essential_matrix_poly.h:12
Scalar getValue(unsigned row, unsigned column) const
Returns a particular matrix value.
Definition: SquareMatrix.h:168
const int * getMaxFillIndexes(unsigned char level) const
Definition: DgmOctree.h:485
CCVector3 m_lsPlaneVectors[3]
Least-square best fitting plane base vectors.
Definition: Neighbourhood.h:301
CCVector3 inbbmax
Inside bounding box max point.
Definition: CVKdTree.h:119
std::size_t freeSwap
Definition: MemoryInfo.h:26
bool ProgramOptionExists(int argc, char **argv, const std::string &option)
Definition: Console.cpp:100
A very simple point cloud (no point duplication)
Definition: ReferenceCloud.h:29
QByteArray fromUnicode(const QString &str)
Definition: QtCompat.h:594
struct KdCell * leSon
Definition: CVKdTree.h:143
std::vector< unsigned > processTriangles
Definition: DistanceComputationTools.cpp:1906
void setDetectionThreshold(float value)
Sets the threshold for propagation stop.
Definition: FastMarchingForPropagation.h:63
int fetchAndAddRelaxed(int add)
Definition: NormalizedProgress.cpp:32
VerticesIndexes * getNextTriangleVertIndexes() override
Definition: Delaunay2dMesh.cpp:335
CCVector3 outbbmin
Outside bounding box min point.
Definition: CVKdTree.h:129
size_t len() const
Definition: ScalarField.cpp:128
@ FAR_CELL
Definition: FastMarching.h:103
bool findNearestNeighbourWithMaxDist(const PointCoordinateType *queryPoint, ScalarType maxDist)
Optimized version of findNearestNeighbour with a maximum distance.
Definition: CVKdTree.cpp:235
Proper KD-tree implementation.
Definition: TrueKdTree.h:23
KdCell * m_root
Tree root.
Definition: CVKdTree.h:169
GetLeavesVisitor(TrueKdTree::LeafVector &leaves)
Definition: TrueKdTree.cpp:301
static double pochisq(double x, int df)
Probability of chi-square value.
Definition: Chi2Helper.h:108
std::string GetIOErrorString(const int errnoVal)
Definition: FileSystem.cpp:627
CCVector3 * axes
Box axes (optional)
Definition: DgmOctree.h:731
static bool EigenMatrix4dFromJsonArray(Eigen::Matrix4d &mat, const Json::Value &value)
Definition: IJsonConvertible.cpp:108
int cellSize
Cell size.
Definition: DistanceComputationTools.cpp:734
CCVector3 m_bbMax
Bounding-box max corner.
Definition: DgmOctreeReferenceCloud.h:87
int64_t num_indices_
Definition: AdvancedIndexing.h:203
Helper structure for triangles to test.
Definition: DistanceComputationTools.cpp:1886
unsigned m_gridSize
Grid size.
Definition: FastMarching.h:233
Eigen::Vector3d extent_
The extent of the bounding box in its frame of reference.
Definition: OrientedBoundingBox.h:115
static CVLog * TheInstance()
Returns the static and unique instance.
Definition: CVLog.cpp:53
static unsigned s_lastProgress
Definition: TrueKdTree.cpp:42
ScopeTimer(const std::string &scope_timer_info="")
Definition: Timer.cpp:57
Type norm2() const
Returns vector square norm.
Definition: CVGeom.h:61
Edge()
Definition: PointProjectionTools.cpp:492
The Normal/Gaussian statistical distribution.
Definition: NormalDistribution.h:18
VerbosityLevel
Definition: Logging.h:97
PointCoordinateType m_quadricEquation[6]
2.5D Quadric equation
Definition: Neighbourhood.h:284
@ FLAG_LS_PLANE
Definition: Neighbourhood.h:37
static bool distComp(const PointDescriptor &a, const PointDescriptor &b)
Comparison operator.
Definition: DgmOctree.h:126
void setPointScalarValue(unsigned pointIndex, ScalarType value) override
Definition: PointCloudTpl.h:120
unsigned char m_Y
Height function second dimension (0=X, 1=Y, 2=Z)
Definition: LocalModel.cpp:154
double computePfromZero(ScalarType x) const override
Computes the cumulative probability between 0 and x.
Definition: WeibullDistribution.cpp:203
void define_ReferenceCloud(py::module &cccorelib)
Definition: ReferenceCloud.cpp:19
int flags
Definition: CVLog.cpp:35
AdvancedIndexer(const Tensor &src, const Tensor &dst, const std::vector< Tensor > &index_tensors, const SizeVector &indexed_shape, const SizeVector &indexed_strides, AdvancedIndexerMode mode)
Definition: AdvancedIndexing.h:121
static BitShiftValues PRE_COMPUTED_BIT_SHIFT_VALUES
Definition: DgmOctree.cpp:61
bool isLeaf() const
Definition: TrueKdTree.h:39
unsigned char m_gridLevel
Equivalent octree subdivision level.
Definition: FastMarching.h:240
PointCoordinateType currentHalfLength
Current search depth.
Definition: DgmOctree.h:701
List of triangles (indexes)
Definition: DistanceComputationTools.cpp:40
GenericIndexedMesh * mesh
Mesh.
Definition: DistanceComputationTools.cpp:64
void addEdge(int x, int y)
Definition: Universe.cpp:53
unsigned CellCode
Type of the code of an octree cell.
Definition: DgmOctree.h:78
virtual void addIgnoredCell(unsigned index)
Add a cell to the IGNORED cells list.
Definition: FastMarching.cpp:201
ScalarType computeDistanceFromModelToPoint(const CCVector3 *P, CCVector3 *nearestPoint=nullptr) const override
Compute the (unsigned) distance between a 3D point and this model.
Definition: LocalModel.cpp:70
int64_t NumWorkloads() const
Definition: AdvancedIndexing.h:198
constexpr ScalarType NAN_VALUE
NaN as a ScalarType value.
Definition: CVConst.h:76
void Sleep(int milliseconds)
Definition: Helper.cpp:278
void setLSPlane(const PointCoordinateType eq[4], const CCVector3 &X, const CCVector3 &Y, const CCVector3 &N)
Sets the best interpolating plane equation (Least-square)
Definition: Neighbourhood.cpp:76
std::vector< unsigned > trianglesToTest
Definition: DistanceComputationTools.cpp:1900
ScalarType m_b
Weibull distribution parameter b (lambda)
Definition: WeibullDistribution.h:96
CCVector3 dimensions
Box dimensions.
Definition: DgmOctree.h:733
virtual void clear()
Clears the octree.
Definition: DgmOctree.cpp:183
Vector3Tpl< T > getDiagVec() const
Returns diagonal vector.
Definition: BoundingBox.h:169
double norm2d() const
Returns vector square norm (forces double precision output)
Definition: CVGeom.h:419
GenericIndexedCloudPersist * associatedCloud() const
Returns the associated cloud.
Definition: DgmOctree.h:1191
Tuple3i minFillIndexes
Grid occupancy of mesh (minimum indexes for each dimension)
Definition: DistanceComputationTools.cpp:69
BaseNode * m_root
Root node.
Definition: TrueKdTree.h:153
@ GAUSSIAN_CURV
Definition: Neighbourhood.h:42
Recursive visitor for TrueKdTree::getLeaves.
Definition: TrueKdTree.cpp:299
float f
Local front acceleration.
Definition: FastMarchingForPropagation.h:95
constexpr PointCoordinateType PC_NAN
'NaN' as a PointCoordinateType value
Definition: CVConst.h:71
bool compute3DQuadric(double quadricEquation[10])
Computes the best interpolating quadric (Least-square)
Definition: Neighbourhood.cpp:524
ReferencesContainer m_theIndexes
Indexes of (some of) the associated cloud points.
Definition: ReferenceCloud.h:234
std::vector< unsigned > m_ignoredCells
IGNORED cells lits.
Definition: FastMarching.h:216
virtual void computeBB()
Computes the cloud bounding-box (internal)
Definition: DgmOctreeReferenceCloud.cpp:22
CCVector3 m_bbMin
Bounding-box min corner.
Definition: DgmOctreeReferenceCloud.h:85
bool computeLeastSquareBestFittingPlane()
Computes the least-square best fitting plane.
Definition: Neighbourhood.cpp:206
Tuple3i prevMinCornerPos
Previous search box (min corner)
Definition: DgmOctree.h:708
A simple polyline class.
Definition: Polyline.h:20
#define LogWarning(...)
Definition: Logging.h:72
Type y
Definition: CVGeom.h:137
bool m_isClosed
Closing state.
Definition: Polyline.h:36
RayCastProcess
Ray casting processes.
Definition: DgmOctree.h:1179
int NumCores() const
Definition: CPUInfo.cpp:179
std::string ToUpper(const std::string &s)
Convert string to the upper case.
Definition: Helper.cpp:249
static bool GetMaxEigenValueAndVector(const SquareMatrix &eigenVectors, const EigenValues &eigenValues, Scalar &maxEigenValue, Scalar maxEigenVector[])
Returns the biggest eigenvalue and its associated eigenvector.
Definition: Jacobi.h:385
unsigned char level
subdivision level at which to apply the extraction process
Definition: DgmOctree.h:737
unsigned findPointsLyingToDistance(const PointCoordinateType *queryPoint, ScalarType distance, ScalarType tolerance, std::vector< unsigned > &points)
Definition: CVKdTree.cpp:347
const Vector3Tpl< T > & maxCorner() const
Returns max corner (const)
Definition: BoundingBox.h:156
static const size_t s_bufferMaxSize
Definition: CVLog.cpp:27
void forEach(genericTriangleAction action) override
Fast iteration mechanism.
Definition: Delaunay2dMesh.cpp:306
BaseNode * parent
Definition: TrueKdTree.h:44
ScalarField * getCurrentInScalarField() const
Returns the scalar field currently associated to the cloud input.
Definition: PointCloudTpl.h:391
void setValue(std::size_t index, ScalarType value)
Definition: ScalarField.h:96
void setValid(bool state)
Sets distribution current validity.
Definition: GenericDistribution.h:93
ReferenceCloud(GenericIndexedCloudPersist *associatedCloud)
Default constructor.
Definition: ReferenceCloud.cpp:15
Vector3Tpl orthogonal() const
Returns a normalized vector which is orthogonal to this one.
Definition: CVGeom.h:433
const CCVector3 * getGravityCenter()
Returns gravity center.
Definition: Neighbourhood.cpp:58
A simple mesh structure, with index-based vertex access.
Definition: SimpleMesh.h:26
void clear()
Resets the bounding box.
Definition: BoundingBox.h:125
#define CLOUDVIEWER_ASSERT(...)
Definition: Macro.h:51
NeighboursSet neighbours
Neighbour points falling inside the cylinder.
Definition: DgmOctree.h:668
Timer()
Definition: Timer.cpp:17
Polyline(GenericIndexedCloudPersist *associatedCloud)
Polyline constructor.
Definition: Polyline.cpp:12
unsigned m_nearestPow2
Definition: DgmOctree.h:1240
Definition: ccGuiPythonInstance.h:15
Input/output parameters structure for getPointsInBoxNeighbourhood.
Definition: DgmOctree.h:727
Logger class should be used as a global singleton object (GetInstance()).
Definition: Logging.h:129
virtual const CCVector3 * getPointPersistentPtr(unsigned index)=0
Returns the ith point as a persistent pointer.
Eigen::Matrix< double, 4, 4, Eigen::DontAlign > Matrix4d_u
Definition: Eigen.h:113
Type norm2() const
Returns vector square norm.
Definition: CVGeom.h:417
bool getCellCodesAndIndexes(unsigned char level, cellsContainer &vec, bool truncatedCodes=false) const
Definition: DgmOctree.cpp:2794
virtual void removeCurrentPointGlobalIndex()
Removes current element.
Definition: ReferenceCloud.h:195
void clear()
Sets all elements to 0.
Definition: SquareMatrix.h:319
static const uint8_t Y_DIM
Definition: TrueKdTree.h:27
void computeGravityCenter()
Computes the gravity center.
Definition: Neighbourhood.cpp:122
void reset()
Resets progress state.
Definition: NormalizedProgress.cpp:91
void addPoint(const CCVector3 &P)
Adds a 3D point to the database.
Definition: PointCloudTpl.h:246
void SetVerbosityLevel(VerbosityLevel level)
Definition: Logging.cpp:89
@ DEBUG_FLAG
Definition: CVLog.h:49
static void RegisterInstance(CVLog *logInstance)
Registers a unique instance.
Definition: CVLog.cpp:81
CellCode theCode
cell code
Definition: DgmOctree.h:305
@ FLAG_QUADRIC
Definition: Neighbourhood.h:38
double m_stdDevCellPopulation[MAX_OCTREE_LEVEL+1]
Std. dev. of cell population per level of subdivision.
Definition: DgmOctree.h:1266
ScalarFieldView(cloudViewer::ScalarField &field)
Definition: ScalarField.cpp:22
SizeVector indexed_shape_
Definition: AdvancedIndexing.h:101
LSLocalModel(const PointCoordinateType eq[4], const CCVector3 ¢er, PointCoordinateType squaredRadius)
Constructor.
Definition: LocalModel.cpp:22
double computeMeanOctreeDensity(unsigned char level) const
Definition: DgmOctree.cpp:2789
static std::vector< Tensor > ExpandBoolTensors(const std::vector< Tensor > &index_tensors)
Expand boolean tensor to integer index.
Definition: AdvancedIndexing.cpp:230
void computeMeanAndVariance(ScalarType &mean, ScalarType *variance=nullptr) const
Definition: ScalarField.cpp:41
~Delaunay2dMesh() override
Delaunay2dMesh destructor.
Definition: Delaunay2dMesh.cpp:38
int64_t NumWorkloads() const
Definition: Indexer.cpp:406
AdvancedIndexPreprocessor(const Tensor &tensor, const std::vector< Tensor > &index_tensors)
Definition: AdvancedIndexing.h:23
static vtkPVTrivialProducerStaticInternal Value
Definition: vtkDistributedTrivialProducer.cxx:65
bool ListFilesInDirectoryWithExtension(const std::string &directory, const std::string &extname, std::vector< std::string > &filenames)
Definition: FileSystem.cpp:567
void distanceScanTree(const PointCoordinateType *queryPoint, ScalarType distance, ScalarType tolerance, KdCell *cell, std::vector< unsigned > &localArray)
Definition: CVKdTree.cpp:551
std::string StringReplaceFirst(const std::string &str, const std::string &old_str, const std::string &new_str)
Definition: Helper.cpp:134
QuadricLocalModel(const PointCoordinateType eq[6], unsigned char X, unsigned char Y, unsigned char Z, CCVector3 gravityCenter, const CCVector3 ¢er, PointCoordinateType squaredRadius)
Constructor.
Definition: LocalModel.cpp:109
bool findPointBelowDistance(const PointCoordinateType *queryPoint, ScalarType maxDist)
Optimized version of nearest point search method.
Definition: CVKdTree.cpp:301
static double module(T *vector)
Definition: utils.h:105
std::tuple< int, int, double > GetDurationInHMS() const
Definition: Timer.cpp:44
void * X
Definition: SmallVector.cpp:45
@ LS
Definition: CVConst.h:123
int64_t GetStride(int64_t dim) const
Definition: Tensor.h:1139
void define_WeibullDistribution(py::module &cccorelib)
Definition: WeibullDistribution.cpp:15
Definition: GenericProgressCallback.h:78
bool findNearestNeighbour(const PointCoordinateType *queryPoint, unsigned &nearestPointIndex, ScalarType maxDist)
Nearest point search.
Definition: CVKdTree.cpp:178
Delaunay 2D1/2 "local modelization".
Definition: LocalModel.cpp:53
static void UpdateProgress(unsigned increment)
Definition: TrueKdTree.cpp:62
float PointCoordinateType
Type of the coordinates of a (N-D) point.
Definition: CVTypes.h:16
static const uint8_t X_DIM
Definition: TrueKdTree.h:26
normal_z z
Definition: my_point_types.h:165
@ NORMAL_CHANGE_RATE
Definition: Neighbourhood.h:42
TrianglesToTest(const GenericIndexedMesh &mesh)
Definition: DistanceComputationTools.cpp:1887
void getBoundingBox(CCVector3 &bbMin, CCVector3 &bbMax) override
Returns the mesh bounding-box.
Definition: Delaunay2dMesh.cpp:389
const PointCoordinateType * getQuadric(Tuple3ub *dims=nullptr)
Returns the best interpolating 2.5D quadric.
Definition: Neighbourhood.cpp:109
std::size_t getPointsInCylindricalNeighbourhood(CylindricalNeighbourhood ¶ms) const
Returns the points falling inside a cylinder.
Definition: DgmOctree.cpp:2111
static double FindGRoot(const ScalarContainer &values, ScalarType valueShift, double valueRange)
internal function for parameters evaluation from sample points
Definition: WeibullDistribution.cpp:275
void scale(unsigned totalSteps, unsigned totalPercentage=100, bool updateCurrentProgress=false)
Definition: NormalizedProgress.cpp:61
std::string StringPrintf(const char *format,...)
Definition: Helper.cpp:110
size_t WordLength(const std::string &doc, size_t start_pos, const std::string &valid_chars="_")
Definition: Helper.cpp:257
static unsigned s_totalProgressCount
Definition: TrueKdTree.cpp:41
const CCVector3 & getOctreeMins() const
Returns the lower boundaries of the octree.
Definition: DgmOctree.h:453
bool ProgramOptionExistsAny(int argc, char **argv, const std::vector< std::string > &options)
Definition: Console.cpp:104
static constexpr int USE_ALL_POINTS
Definition: Delaunay2dMesh.h:26
#define CLOUDVIEWER_HOST_DEVICE
Definition: CUDAUtils.h:44
@ FLAG_GRAVITY_CENTER
Definition: Neighbourhood.h:36
virtual void setExtendedConnectivity(bool state)
Sets extended connectivity mode.
Definition: FastMarching.h:81
void define_FastMarching(py::module &cccorelib)
Definition: FastMarching.cpp:18
Type u[3]
Definition: CVGeom.h:139
int build(GenericProgressCallback *progressCb=nullptr)
Builds the structure.
Definition: DgmOctree.cpp:196
CV_LOCAL_MODEL_TYPES getType() const override
Returns the model type.
Definition: LocalModel.cpp:125
double m_averageCellPopulation[MAX_OCTREE_LEVEL+1]
Average cell population per level of subdivision.
Definition: DgmOctree.h:1264
virtual float computeTCoefApprox(Cell *currentCell, Cell *neighbourCell) const =0
Computes the front acceleration between two cells.
bool removeTrianglesWithEdgesLongerThan(PointCoordinateType maxEdgeLength)
Filters out the triangles based on their edge length.
Definition: Delaunay2dMesh.cpp:265
static void vcross(const PointCoordinateType p[], const PointCoordinateType q[], PointCoordinateType r[])
Definition: CVGeom.h:528
CV_LOCAL_MODEL_TYPES getType() const override
Returns the model type.
Definition: LocalModel.cpp:30
@ EigenValue1
Definition: Neighbourhood.h:173
ScalarType m_mu
Mean.
Definition: NormalDistribution.h:86
virtual int initGrid(float step, unsigned dim[3])
Intializes the grid with a given step and dimensions.
Definition: FastMarching.cpp:65
unsigned m_linkCount
Links counter.
Definition: CVShareable.h:54
@ Sphericity
Definition: Neighbourhood.h:171
@ CHAMFER_345
Definition: CVConst.h:116
@ TRIAL_CELL
Definition: FastMarching.h:104
ScalarFieldView(const ScalarFieldView view, const py::slice &slice)
Definition: ScalarField.cpp:27
std::string AddIfExist(const std::string &path, const std::vector< std::string > &folder_names)
Definition: FileSystem.cpp:726
unsigned m_maxCellPopulation[MAX_OCTREE_LEVEL+1]
Max cell population per level of subdivision.
Definition: DgmOctree.h:1262
static bool EigenMatrix3dFromJsonArray(Eigen::Matrix3d &mat, const Json::Value &value)
Definition: IJsonConvertible.cpp:87
virtual bool ConvertToJsonValue(Json::Value &value) const =0
void Signal()
Definition: Timer.cpp:80
std::vector< ScalarType > chi2ClassesPositions
Chi2 classes limits.
Definition: WeibullDistribution.h:89
void setGravityCenter(const CCVector3 &G)
Sets gravity center.
Definition: Neighbourhood.cpp:64
KDTree()
Default constructor.
Definition: CVKdTree.cpp:18
cellsContainer m_thePointsAndTheirCellCodes
The coded octree structure.
Definition: DgmOctree.h:1230
static bool EigenVector4dFromJsonArray(Eigen::Vector4d &vec, const Json::Value &value)
Definition: IJsonConvertible.cpp:64
void add(C *item)
Puts an item in the trash.
Definition: Garbage.h:18
PointCoordinateType maxHalfLength
Cylinder (half) length.
Definition: DgmOctree.h:666
MemoryInfo getMemoryInfo()
Definition: MemoryInfo.cpp:63
ScalarType computeDistanceFromModelToPoint(const CCVector3 *_P, CCVector3 *nearestPoint=nullptr) const override
Compute the (unsigned) distance between a 3D point and this model.
Definition: LocalModel.cpp:128
void setName(const char *name)
Sets scalar field name.
Definition: ScalarField.cpp:22
@ PCA2
Definition: Neighbourhood.h:169
double m_qFactor
Exponential quotient.
Definition: NormalDistribution.h:90
A KDTre cell struct.
Definition: CVKdTree.h:101
std::vector< CellCode > cellCodesContainer
Octree cell codes container.
Definition: DgmOctree.h:92
int step() override
Propagates the front (one step)
Definition: FastMarchingForPropagation.cpp:73
DataCloud()
Definition: RegistrationTools.cpp:131
SimpleTriangle m_dumpTriangle
Dump triangle structure to transmit temporary data.
Definition: Delaunay2dMesh.h:145
bool reserveNormals(unsigned newCount)
Reserves memory to store the normals.
Definition: CVPointCloud.h:28
TRIANGULATION_TYPES
Triangulation types.
Definition: PointProjectionTools.h:22
Eigen::Vector3d center_
The center point of the bounding box.
Definition: OrientedBoundingBox.h:110
static char s_buffer[s_bufferMaxSize]
Definition: CVLog.cpp:28
DgmOctree * m_octree
Associated octree.
Definition: FastMarching.h:238
bool buildFromCloud(GenericIndexedCloud *cloud, GenericProgressCallback *progressCb=nullptr)
Builds the KD-tree.
Definition: CVKdTree.cpp:23
KdCell * buildSubTree(unsigned first, unsigned last, KdCell *father, unsigned &nbBuildCell, GenericProgressCallback *progressCb=nullptr)
Builds a sub tree.
Definition: CVKdTree.cpp:108
GenericTriangle * _getTriangle(unsigned triangleIndex) override
Returns the ith triangle.
Definition: Delaunay2dMesh.cpp:347
#define DEFAULT_IO_BUFFER_SIZE
Definition: Logging.h:31
void updateInsideBoundingBox(KdCell *cell)
Definition: CVKdTree.cpp:359
static bool WarningDebug(const char *format,...)
Same as Warning, but works only in Debug mode.
Definition: CVLog.cpp:167
int propagate() override
Propagates the front.
Definition: FastMarchingForPropagation.cpp:130
void join(int x, int y)
Definition: Universe.cpp:40
virtual GenericIndexedCloudPersist * getAssociatedCloud()
Returns the associated (source) cloud.
Definition: ReferenceCloud.h:206
Eigen::Vector3d GetHalfExtent() const
Returns the half extent of the bounding box in its frame of reference.
Definition: OrientedBoundingBox.h:55
BaseNode * rightChild
Definition: TrueKdTree.h:59
void forEach(genericPointAction action) override
Fast iteration mechanism.
Definition: ReferenceCloud.cpp:133
@ CHAMFER_111
Definition: CVConst.h:115
virtual const char * getName() const =0
Returns distribution name.
std::string StringReplace(const std::string &str, const std::string &old_str, const std::string &new_str)
Definition: Helper.cpp:119
static double distance(T *pot1, T *pot2)
Definition: utils.h:111
Chi2Class(double _pi, int _n)
Constructor from parameters.
Definition: StatisticalTestingTools.cpp:37
Fast Marching algorithm for surface front propagation.
Definition: FastMarchingForPropagation.h:22
void RunPreprocess()
Preprocess tensor and index tensors.
Definition: AdvancedIndexing.cpp:110
bool LessThanEpsilon(float x)
Test a floating point number against our epsilon (a very small number).
Definition: CVMath.h:23
NormalDistribution()
NormalDistribution constructor.
Definition: NormalDistribution.cpp:24
@ NO_MODEL
Definition: CVConst.h:122
std::string JsonToString(const Json::Value &json)
Serialize a Json::Value to a string.
Definition: IJsonConvertible.cpp:33
float m_percent
Total progress value (in percent)
Definition: GenericProgressCallback.h:109
static Vector3Tpl fromArray(const int a[3])
Constructor from an int array.
Definition: CVGeom.h:268
bool getPointsInCell(CellCode cellCode, unsigned char level, ReferenceCloud *subset, bool isCodeTruncated=false, bool clearOutputCloud=true) const
Returns the points lying in a specific cell.
Definition: DgmOctree.cpp:537
static double LineSegmentsMinimumDistance(const Eigen::Vector3d &p0, const Eigen::Vector3d &p1, const Eigen::Vector3d &q0, const Eigen::Vector3d &q1)
Definition: IntersectionTest.cpp:117
size_t GetFileSize(const std::string &path)
Definition: misc.cc:219
Definition: Indexer.h:262
@ Omnivariance
Definition: Neighbourhood.h:163
VerticesIndexes * getTriangleVertIndexes(unsigned triangleIndex) override
Returns the indexes of the vertices of a given triangle.
Definition: Delaunay2dMesh.cpp:382
std::vector< GridElement > m_grid
Grid data.
Definition: Grid3D.h:544
Definition: AdvancedIndexing.h:117
@ Planarity
Definition: Neighbourhood.h:166
void getBoundingBox(CCVector3 &bbMin, CCVector3 &bbMax) override
Returns the cloud bounding box.
Definition: DgmOctreeReferenceCloud.cpp:57
CCVector3 m_pointsMin
Definition: DgmOctree.h:1249
constexpr float EPS
Definition: IoUImpl.h:20
const Dtype Int64
Definition: Dtype.cpp:47
char type
Definition: FileIOFactory.cpp:131
void getCellPos(CellCode code, unsigned char level, Tuple3i &cellPos, bool isCodeTruncated) const
Definition: DgmOctree.cpp:498
const PointCoordinateType & getCellSize(unsigned char level) const
Returns the octree cells length for a given level of subdivision.
Definition: DgmOctree.h:494
void set_item(const py::object &index, const py::object &value)
Definition: ScalarField.cpp:65
ReferenceCloud * cloud
Definition: RegistrationTools.cpp:138
const CCVector3 * point
Point.
Definition: DgmOctree.h:103
bool m_validBB
Bounding-box validity.
Definition: DgmOctreeReferenceCloud.h:89
static MonoDimensionalCellCodes PRE_COMPUTED_POS_CODES
Definition: DgmOctree.cpp:107
std::string & StripString(std::string &str, const std::string &chars="\t\n\v\f\r ")
Definition: Helper.cpp:238
int * m_globalIterator
Iterator on the list of triangle vertex indexes.
Definition: Delaunay2dMesh.h:132
unsigned char findBestLevelForAGivenNeighbourhoodSizeExtraction(PointCoordinateType radius) const
Definition: DgmOctree.cpp:2664
A generic triangle interface.
Definition: GenericTriangle.h:18
const CCVector3 * getPointPersistentPtr(unsigned index) override
Returns the ith point as a persistent pointer.
Definition: ReferenceCloud.h:93
void setJumpCoef(float value)
Sets the accceleration exageration factor.
Definition: FastMarchingForPropagation.h:72
bool getParameters(ScalarType &_mu, ScalarType &_sigma2) const
Returns the distribution parameters.
Definition: NormalDistribution.cpp:35
unsigned currentSize() const
Definition: ScalarField.h:100
unsigned executeFunctionForAllCellsStartingAtLevel(unsigned char startingLevel, octreeCellFunc func, void **additionalParameters, unsigned minNumberOfPointsPerCell, unsigned maxNumberOfPointsPerCell, bool multiThread=true, GenericProgressCallback *progressCb=nullptr, const char *functionTitle=nullptr, int maxThreadCount=0)
Definition: DgmOctree.cpp:3820
std::vector< std::string > FindFilesRecursively(const std::string &directory, std::function< bool(const std::string &)> is_match)
Definition: FileSystem.cpp:586
Structure used during nearest neighbour search.
Definition: DgmOctree.h:101
virtual void update(float percent)=0
Notifies the algorithm progress.
static OrientedBoundingBox CreateFromAxisAlignedBoundingBox(const BoundingBox &aabox)
Definition: OrientedBoundingBox.cpp:74
static PointCoordinateType vdistance(const PointCoordinateType p[], const PointCoordinateType q[])
Definition: CVGeom.h:598
~TrueKdTree()
Destructor.
Definition: TrueKdTree.cpp:27
void placeIteratorAtBeginning() override
Places the mesh iterator at the beginning.
Definition: SimpleMesh.cpp:43
std::string GetError()
Returns the last encountered error for this file.
Definition: FileSystem.cpp:748
MiniVec< float, N > ceil(const MiniVec< float, N > &a)
Definition: MiniVec.h:89
Definition: DgmOctree.cpp:3066
SquareMatrixTpl< double > SquareMatrixd
Double square matrix type.
Definition: SquareMatrix.h:1026
virtual void addActiveCell(unsigned index)
Add a cell to the ACTIVE cells list.
Definition: FastMarching.cpp:196
ScalarType getPointScalarValue(unsigned pointIndex) const override
Returns the ith point associated scalar value.
Definition: ReferenceCloud.h:72
Definition: RegistrationTools.cpp:123
::ccPointCloud PointCloud
Definition: PointCloud.h:19
unsigned i1
Definition: GenericIndexedMesh.h:19
Eigen::Vector6d TransformMatrix4dToVector6d(const Eigen::Matrix4d &input)
Definition: Eigen.cpp:88
void getNeighborCellsAround(const Tuple3i &cellPos, cellIndexesContainer &neighborCellsIndexes, int neighbourhoodLength, unsigned char level) const
Definition: DgmOctree.cpp:825
unsigned char m_structuresValidity
Geometrical elements validity (flags)
Definition: Neighbourhood.h:309
Message.
Definition: CVLog.cpp:31
int64_t GetNumLines()
Returns the number of lines in the file.
Definition: FileSystem.cpp:793
BaseNode * split(ReferenceCloud *subset)
Recursive split process.
Definition: TrueKdTree.cpp:76
float m_jumpCoef
Accceleration exageration factor.
Definition: FastMarchingForPropagation.h:109
int getPointsInSphericalNeighbourhood(const CCVector3 &sphereCenter, PointCoordinateType radius, NeighboursSet &neighbours, unsigned char level) const
Returns the points falling inside a sphere.
Definition: DgmOctree.cpp:1846
GridElement * data()
Gives access to the internal grid data (with margin)
Definition: Grid3D.h:527
bool InParallel()
Returns true if in an parallel section.
Definition: Parallel.cpp:48
void define_DgmOctreeReferenceCloud(py::module &cccorelib)
Definition: DgmOctreeReferenceCloud.cpp:16
bool CopyA(const std::string &src_path, const std::string &dst_path)
Definition: FileSystem.cpp:236
unsigned cuttingDim
Definition: CVKdTree.h:138
Vector2Tpl< PointCoordinateType > CCVector2
Default 2D Vector.
Definition: CVGeom.h:780
unsigned char findBestLevelForComparisonWithOctree(const DgmOctree *theOtherOctree) const
Definition: DgmOctree.cpp:2691
CurvatureType
Curvature type.
Definition: Neighbourhood.h:42
bool RemoveFile(const std::string &filename)
Definition: FileSystem.cpp:528
static LocalModel * New(CV_LOCAL_MODEL_TYPES type, Neighbourhood &subset, const CCVector3 ¢er, PointCoordinateType squaredRadius)
Factory.
Definition: LocalModel.cpp:165
static double LinesMinimumDistance(const Eigen::Vector3d &p0, const Eigen::Vector3d &p1, const Eigen::Vector3d &q0, const Eigen::Vector3d &q1)
Definition: IntersectionTest.cpp:76
static bool ComparisonY(const unsigned &a, const unsigned &b)
Compares Y coordinates of two points designated by their index.
Definition: CVKdTree.cpp:97
double normd() const
Returns vector norm (forces double precision output)
Definition: CVGeom.h:426
void pointToCellDistances(const PointCoordinateType *queryPoint, KdCell *cell, ScalarType &min, ScalarType &max)
Definition: CVKdTree.cpp:446
bool add(const ReferenceCloud &cloud)
Add another reference cloud.
Definition: ReferenceCloud.cpp:166
const Vector3Tpl< T > & minCorner() const
Returns min corner (const)
Definition: BoundingBox.h:154
double squareDistanceToOrigin(const Vector3Tpl< T > &P) const
Definition: RayAndBox.h:30
Scalar iterConjugateGradient(Scalar *Xn)
Iterates the conjugate gradient.
Definition: ConjugateGradient.h:59
std::string name
Definition: FileIOFactory.cpp:129
GenericIndexedCloudPersist * m_theAssociatedCloud
Associated cloud.
Definition: DgmOctree.h:1233
constexpr double SQRT_3
Square root of 3.
Definition: CVConst.h:29
static cloudViewer::GenericIndexedCloud * s_comparisonCloud
Definition: CVKdTree.cpp:88
double computeChi2Dist(const GenericCloud *Yk, unsigned numberOfClasses, int *histo=nullptr) override
Computes the Chi2 distance (related to the Chi2 Test)
Definition: NormalDistribution.cpp:164
#define CV_CORE_LIB_API
Definition: CVCoreLibWin.h:15
unsigned m_minPointCountPerCell
Min number of points per cell (speed-up)
Definition: TrueKdTree.h:167
CV_LOCAL_MODEL_TYPES getType() const override
Returns the model type.
Definition: LocalModel.cpp:67
void clear(bool unusedParam=true) override
Clears the cloud.
Definition: Polyline.cpp:15
bool computeQuadric()
Computes best fitting 2.5D quadric.
Definition: Neighbourhood.cpp:302
std::vector< std::string > StringSplit(const std::string &str, const std::string &delimiters=" ", bool trim_empty_str=true)
Definition: Helper.cpp:180
int genericBuild(GenericProgressCallback *progressCb=nullptr)
Generic method to build the octree structure.
Definition: DgmOctree.cpp:221
void getTheCellPosWhichIncludesThePoint(const CCVector3 *thePoint, Tuple3i &cellPos) const
Definition: DgmOctree.h:779
ScalarType m_valueShift
Weibull distribution parameter 'value shift'.
Definition: WeibullDistribution.h:98
void getBoundingBox(CCVector3 &bbMin, CCVector3 &bbMax) override
Returns the cloud bounding box.
Definition: ReferenceCloud.cpp:37
Definition: RegistrationTools.cpp:130