ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ChamferDistanceTransform.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 // Local
11 #include "Grid3D.h"
12 #include "MathTools.h"
13 
14 namespace cloudViewer {
15 
16 class GenericProgressCallback;
17 class NormalizedProgress;
18 
20 
24 class CV_CORE_LIB_API ChamferDistanceTransform : public Grid3D<unsigned short>,
25  public MathTools {
26 public:
28 
30  static const unsigned short MAX_DIST = 0xFAFA;
31 
33 
37  inline bool init(const Tuple3ui& gridSize) {
38  return Grid3D<GridElement>::init(gridSize.x, gridSize.y, gridSize.z, 1,
39  MAX_DIST);
40  }
41 
43 
51  int propagateDistance(CHAMFER_DISTANCE_TYPE type,
52  GenericProgressCallback* progressCb = nullptr);
53 };
54 
55 } // namespace cloudViewer
CHAMFER_DISTANCE_TYPE
Chamfer distances types.
Definition: CVConst.h:114
#define CV_CORE_LIB_API
Definition: CVCoreLibWin.h:15
char type
Type y
Definition: CVGeom.h:137
Type x
Definition: CVGeom.h:137
Type z
Definition: CVGeom.h:137
Class to compute a Chamfer distance field on a 3D grid.
bool init(const Tuple3ui &gridSize)
Initializes the grid.
Simple 3D grid structure.
Definition: Grid3D.h:32
bool init(unsigned di, unsigned dj, unsigned dk, unsigned margin, GridElement defaultCellValue=0)
Initializes the grid.
Definition: Grid3D.h:77
Empty class - for classification purpose only.
Definition: MathTools.h:15
Generic file read and write utility for python interface.