Algorithms.h
Go to the documentation of this file.
1 /********************************************************************
2 *
3 * Project Artec 3D Scanning SDK
4 *
5 * Purpose: Algorithms creators declarations
6 *
7 * Copyright: Artec Group
8 *
9 ********************************************************************/
10 
11 #ifndef _ALGORITHMS_H_
12 #define _ALGORITHMS_H_
13 
15 #include <artec/sdk/base/Errors.h>
17 #include <artec/sdk/base/Point.h>
19 
20 namespace artec { namespace sdk { namespace base
21 {
22  class ICompositeMesh;
23  class IScan;
24  class ICompositeContainer;
25  class IModel;
26  class ICancellationToken;
27  class IProgressInfo;
28  struct AlgorithmWorkset;
29 } } }
30 
31 namespace artec { namespace sdk { namespace algorithms
32 {
33 using namespace artec::sdk::base::errors;
34 
35 class IAlgorithm;
36 
38 {
39  /// Use this type by default
40  InputFilter_UseTextureKeyFrames = 0, ///< Algorithm considers only frames, which have texture key frame attribute
41  /// Other types
42  InputFilter_UseAllTextures, ///< Algorithm considers all frames, which have not empty textures
43 };
44 
45 //////////////////////////////////////////////////////////////////////////
47 {
48  base::ScannerType scannerType; ///< Scanner type
49  float resolution; ///< Mesh resolution (step size)
50  int radius; ///< Averaging radius (in steps)
51  bool generateNormals; ///< Calculate normals for created mesh
52 };
53 
54 //////////////////////////////////////////////////////////////////////////
56 {
59 
60  PoissonFusionType_ForceDword = 0x7fffffff ///< Force 32-bit size enum
61 };
62 
64 {
67 
68  FillHolesType_ForceDword = 0x7fffffff ///< Force 32-bit size enum
69 };
70 
72 {
73  base::ScannerType scannerType; ///< Scanner type
74  PoissonFusionType fusionType; ///< Fusion type
75  FillHolesType fillType; ///< Fill holes method type
76  float resolution; ///< Mesh resolution in millimeters
77  float maxHoleRadius; ///< Maximum hole radius in millimeters
78  bool removeTargets; ///< Remove targets from geometry
79  float targetInnerSize; ///< Round type target - black circle diameter
80  float targetOuterSize; ///< Round type target - white circle diameter
81  bool generateNormals; ///< Calculate normals for created mesh
82  InputFilter inputFilterType; ///< Type of frames, which should be used by the algorithm
83 };
84 
85 //////////////////////////////////////////////////////////////////////////
87 {
88  SerialRegistrationType_Rough, ///< Use this registration type for any data. Fast but less accuracy.
89  SerialRegistrationType_RoughTextured, ///< Use this registration type only if all frames have texture. Fast but less accuracy.
90  SerialRegistrationType_Fine, ///< Use this registration type for any data
91  SerialRegistrationType_FineTextured, ///< Use this registration type only if all frames have texture.
92 
93  SerialRegistrationType_ForceDword = 0x7fffffff ///< Force 32-bit size enum
94 };
95 
97 {
98  base::ScannerType scannerType; ///< Scanner type
99  SerialRegistrationType registrationType; ///< Serial registration type
100 };
101 
102 //////////////////////////////////////////////////////////////////////////
104 {
105  GlobalRegistrationType_Geometry, ///< Use this registration type for any data
106  GlobalRegistrationType_GeometryAndTexture, ///< Use this registration type only if all frames have texture
107 
108  GlobalRegistrationType_ForceDword = 0x7fffffff ///< Force 32-bit size enum
109 };
110 
112 {
113  base::ScannerType scannerType; ///< Scanner type
114  GlobalRegistrationType registrationType; ///< Global registration type
115 };
116 
117 //////////////////////////////////////////////////////////////////////////
119 {
120  /// Each vertex gets multiple coordinates for each of adjacent triangles,
121  /// final texture coordinates are continuous only for a given triangle area
123 
124  TexturizeType_Simple, ///< Right angle triangle texture mapping
125  TexturizeType_Atlas, ///< Unfold mesh to UV plane, then gather the texture image
126  TexturizeType_KeepAtlas, ///< Keep UV coordinates set, just re-gather the texture image
127 
128  TexturizeType_ForceDword = 0x7fffffff ///< Force 32-bit size enum
129 };
130 
132 {
139 
140  TexturizeResolution_ForceDword = 0x7fffffff ///< Force 32-bit size enum
141 };
142 
143 
145 {
146  base::ScannerType scannerType; ///< Scanner type
147  TexturizeType texturizeType; ///< Texturize type to use
148  TexturizeResolution texturizeResolution; ///< Texturize output resolution
149  bool enableBackgroundSegmentation; ///< Enables background segmentation for input texture frames
150  bool enableAmbientLightingCompensation; ///< Enable compensation of ambient light
151  int atlasUnfoldingPolygonLimit; ///< Set the limit for number of polygons for mesh unfolding:
152  ///< 0 - disable simplification (unfold original mesh)
153  ///< N - reduce number of polygons to N, then make unfolding
154  ///< and re-project atlas to the original mesh
155  bool enableTextureInpainting; ///< Interpolate colors for empty texture areas
156  bool useTextureNormalization; ///< Correct texture brightness for Artec scanners
157  InputFilter inputFilterType; ///< Type of frames, which should be used by the algorithm
158 };
159 
160 //////////////////////////////////////////////////////////////////////////
162 {
163  SmallObjectsFilterType_LeaveBiggestObject = 0, ///< Leave only biggest object
164  SmallObjectsFilterType_FilterByThreshold = 1, ///< Remove objects that contain the number of
165  ///< triangles is less than the specified
166 
167  SmallObjectsFilterType_ForceDword = 0x7fffffff ///< Force 32-bit size enum
168 };
169 
171 {
172  base::ScannerType scannerType; ///< Scanner type
174  int filterThreshold; ///< Threshold - number of triangles
175 };
176 
177 //////////////////////////////////////////////////////////////////////////
179 {
180  SimplifyType_TriangleQuantity, ///< Reduce triangle quantity to given number
181  SimplifyType_Accuracy, ///< Keep simplified mesh accuracy
182  SimplifyType_Remesh, ///< Minimal acceptable edge length
183  SimplifyType_TriangleQuantityFast, ///< Reduce triangle quantity to given number. Very fast but less accuracy.
184 
185  SimplifyType_ForceDword = 0x7fffffff ///< Force 32-bit size enum
186 };
187 
189 {
190  SimplifyMetric_EdgeLength, ///< Reduce triangle quantity to given number
191  SimplifyMetric_EdgeLengthAndAngle, ///< Keep simplified mesh accuracy
192  SimplifyMetric_DistanceToSurface, ///< Minimal acceptable edge length
193  SimplifyMetric_DistanceToSurfaceIterative, ///< Minimal acceptable edge length
194 
195  SimplifyMetric_ForceDword = 0x7fffffff ///< Force 32-bit size enum
196 };
197 
199 {
200  base::ScannerType scannerType; ///< Scanner type
201  SimplifyType simplifyType; ///< Simplify type
202  SimplifyMetric simplifyMetrics; ///< Simplify metrics. Not supported for fast simplification.
203  int triangleNumber; ///< Triangles number after simplification
204  bool keepBoundary; ///< Algorithms won't modify boundary of given surface if true
205  float angleThreshold; ///< Maximal angle between neighbor normals (in degrees). Not supported for fast simplification.
206  float remeshEdgeThreshold; ///< Minimal edge length after remesh. Not supported for fast simplification.
207  float error; ///< Max error. Not supported for fast simplification.
208 };
209 
211 {
212  base::ScannerType scannerType; ///< Scanner type
213  int triangleNumber; ///< Triangles number after simplification
214  bool keepBoundary; ///< Algorithms won't modify boundary of given surface if true
215 
216  bool enableAdditionalCriteria; ///< Simplification stops if one of the thresholding criteras below are not satisfied
217  bool enableDistanceThreshold; ///< Limit maximal distance between original and simplified meshes
218  float distanceThreshold; ///< Max error(in units^2)
219  bool enableAngleThreshold; ///< Limit maximal normals deviation
220  float angleThreshold; ///< Maximal angle between neighbor faces normals (in degrees)
221  bool enableAspectRatioThreshold; ///< Limit edges length ratio
222  float aspectRatioThreshold; ///< Maximal available ratio of edges in triangle
223 };
224 
225 //////////////////////////////////////////////////////////////////////////
227 {
228  base::ScannerType scannerType; ///< Scanner type
229 };
230 
231 //////////////////////////////////////////////////////////////////////////
233 {
234  base::ScannerType scannerType; ///< Scanner type
235  float standardDeviationMultiplier; ///< Standard deviation multiplier.
236  float resolution; ///< Marching cube resolution in mm.
237 };
238 
239 //////////////////////////////////////////////////////////////////////////
240 
241 extern "C"
242 {
243  /// Check whether the algorithms are available on this machine
244  ///
245  /// @retval true if algorithms can be created
246  /// @retval false if algorithms creation denied
249 
250  /// Initializes fusion algorithm descriptor with scanner related defaults
253 
254  /// Initializes fusion algorithm descriptor with scanner related defaults
257 
258  /// Initialize texturize algorithm descriptor with scanner related defaults
261 
262  /// Initializes small object filter descriptor with scanner related defaults
265 
266  /// Initializes mesh simplification descriptor with scanner related defaults
269 
270  /// Initializes fast mesh simplification descriptor with scanner related defaults
273 
274  /// Initializes outliers removal descriptor with scanner related defaults
277 
278 
279  /// Creates basic fusion algorithm
282 
283  /// Creates poisson fusion algorithm
286 
287  /// Creates serial registration algorithm
289  createSerialRegistrationAlgorithm( IAlgorithm** serialRegistration, const SerialRegistrationSettings* desc );
290 
291  /// Creates global registration algorithm
293  createGlobalRegistrationAlgorithm( IAlgorithm** globalRegistration, const GlobalRegistrationSettings* desc );
294 
295  /// Create texturize algorithm
298 
299  /// Creates small objects filter algorithm
301  createSmallObjectsFilterAlgorithm( IAlgorithm** smallObjectsFilter, const SmallObjectsFilterSettings* desc );
302 
303  /// Creates mesh simplification algorithm
305  createMeshSimplificationAlgorithm( IAlgorithm** meshSimplification, const MeshSimplificationSettings* desc );
306 
307  /// Creates fast mesh simplification algorithm
310 
311  /// Creates loop closure algorithm
313  createLoopClosureAlgorithm( IAlgorithm** loopClosure, const LoopClosureSettings* desc );
314 
315  /// Creates outliers removal algorithm
317  createOutliersRemovalAlgorithm( IAlgorithm** outliesRemoval, const OutliersRemovalSettings* desc );
318 }
319 
320 } } } // namespace artec::sdk::algorithms
321 
322 #endif // _ALGORITHMS_H_
SimplifyMetric simplifyMetrics
Simplify metrics. Not supported for fast simplification.
Definition: Algorithms.h:202
ErrorCode AALGORITHMSDK_LINK_SPEC createMeshSimplificationAlgorithm(IAlgorithm **meshSimplification, const MeshSimplificationSettings *desc)
Creates mesh simplification algorithm.
Keep simplified mesh accuracy.
Definition: Algorithms.h:181
bool removeTargets
Remove targets from geometry.
Definition: Algorithms.h:78
Use this registration type for any data.
Definition: Algorithms.h:90
base::ScannerType scannerType
Scanner type.
Definition: Algorithms.h:98
This namespace is auto-generated from internal event code list.
Definition: Errors.h:55
bool enableAngleThreshold
Limit maximal normals deviation.
Definition: Algorithms.h:219
ErrorCode AALGORITHMSDK_LINK_SPEC createGlobalRegistrationAlgorithm(IAlgorithm **globalRegistration, const GlobalRegistrationSettings *desc)
Creates global registration algorithm.
Reduce triangle quantity to given number. Very fast but less accuracy.
Definition: Algorithms.h:183
ErrorCode AALGORITHMSDK_LINK_SPEC createFastMeshSimplificationAlgorithm(IAlgorithm **meshSimplification, const FastMeshSimplificationSettings *desc)
Creates fast mesh simplification algorithm.
ErrorCode AALGORITHMSDK_LINK_SPEC initializeFastFusionSettings(FastFusionSettings *desc, base::ScannerType scannerType)
Initializes fusion algorithm descriptor with scanner related defaults.
Use this registration type only if all frames have texture.
Definition: Algorithms.h:106
InputFilter inputFilterType
Type of frames, which should be used by the algorithm.
Definition: Algorithms.h:157
ErrorCode AALGORITHMSDK_LINK_SPEC initializePoissonFusionSettings(PoissonFusionSettings *desc, base::ScannerType scannerType)
Initializes fusion algorithm descriptor with scanner related defaults.
SerialRegistrationType registrationType
Serial registration type.
Definition: Algorithms.h:99
bool keepBoundary
Algorithms won't modify boundary of given surface if true.
Definition: Algorithms.h:204
float resolution
Mesh resolution in millimeters.
Definition: Algorithms.h:76
float angleThreshold
Maximal angle between neighbor normals (in degrees). Not supported for fast simplification.
Definition: Algorithms.h:205
float targetOuterSize
Round type target - white circle diameter.
Definition: Algorithms.h:80
bool enableAmbientLightingCompensation
Enable compensation of ambient light.
Definition: Algorithms.h:150
base::ScannerType scannerType
Scanner type.
Definition: Algorithms.h:73
ErrorCode AALGORITHMSDK_LINK_SPEC createOutliersRemovalAlgorithm(IAlgorithm **outliesRemoval, const OutliersRemovalSettings *desc)
Creates outliers removal algorithm.
bool generateNormals
Calculate normals for created mesh.
Definition: Algorithms.h:51
float angleThreshold
Maximal angle between neighbor faces normals (in degrees)
Definition: Algorithms.h:220
float maxHoleRadius
Maximum hole radius in millimeters.
Definition: Algorithms.h:77
ErrorCode AALGORITHMSDK_LINK_SPEC createFastFusionAlgorithm(IAlgorithm **fusion, const FastFusionSettings *desc)
Creates basic fusion algorithm.
Minimal acceptable edge length.
Definition: Algorithms.h:182
Reduce triangle quantity to given number.
Definition: Algorithms.h:180
ErrorCode AALGORITHMSDK_LINK_SPEC initializeSmallObjectsFilterSettings(SmallObjectsFilterSettings *desc, base::ScannerType scannerType)
Initializes small object filter descriptor with scanner related defaults.
TexturizeType texturizeType
Texturize type to use.
Definition: Algorithms.h:147
int triangleNumber
Triangles number after simplification.
Definition: Algorithms.h:213
Use this registration type for any data. Fast but less accuracy.
Definition: Algorithms.h:88
ErrorCode AALGORITHMSDK_LINK_SPEC initializeFastMeshSimplificationSettings(FastMeshSimplificationSettings *desc, base::ScannerType scannerType)
Initializes fast mesh simplification descriptor with scanner related defaults.
ErrorCode AALGORITHMSDK_LINK_SPEC createSerialRegistrationAlgorithm(IAlgorithm **serialRegistration, const SerialRegistrationSettings *desc)
Creates serial registration algorithm.
float aspectRatioThreshold
Maximal available ratio of edges in triangle.
Definition: Algorithms.h:222
ErrorCode AALGORITHMSDK_LINK_SPEC initializeTexturizationSettings(TexturizationSettings *desc, base::ScannerType scannerType)
Initialize texturize algorithm descriptor with scanner related defaults.
Use this registration type for any data.
Definition: Algorithms.h:105
Keep UV coordinates set, just re-gather the texture image.
Definition: Algorithms.h:126
float resolution
Mesh resolution (step size)
Definition: Algorithms.h:49
bool enableAdditionalCriteria
Simplification stops if one of the thresholding criteras below are not satisfied. ...
Definition: Algorithms.h:216
bool useTextureNormalization
Correct texture brightness for Artec scanners.
Definition: Algorithms.h:156
Reduce triangle quantity to given number.
Definition: Algorithms.h:190
bool enableBackgroundSegmentation
Enables background segmentation for input texture frames.
Definition: Algorithms.h:149
ErrorCode AALGORITHMSDK_LINK_SPEC initializeMeshSimplificationSettings(MeshSimplificationSettings *desc, base::ScannerType scannerType, SimplifyType simplifyType)
Initializes mesh simplification descriptor with scanner related defaults.
base::ScannerType scannerType
Scanner type.
Definition: Algorithms.h:113
Use this registration type only if all frames have texture. Fast but less accuracy.
Definition: Algorithms.h:89
base::ScannerType scannerType
Scanner type.
Definition: Algorithms.h:234
base::ScannerType scannerType
Scanner type.
Definition: Algorithms.h:228
ErrorCode AALGORITHMSDK_LINK_SPEC createPoissonFusionAlgorithm(IAlgorithm **fusion, const PoissonFusionSettings *desc)
Creates poisson fusion algorithm.
PoissonFusionType fusionType
Fusion type.
Definition: Algorithms.h:74
#define AALGORITHMSDK_LINK_SPEC
bool enableTextureInpainting
Interpolate colors for empty texture areas.
Definition: Algorithms.h:155
float error
Max error. Not supported for fast simplification.
Definition: Algorithms.h:207
InputFilter inputFilterType
Type of frames, which should be used by the algorithm.
Definition: Algorithms.h:82
int filterThreshold
Threshold - number of triangles.
Definition: Algorithms.h:174
base::ScannerType scannerType
Scanner type.
Definition: Algorithms.h:172
FillHolesType fillType
Fill holes method type.
Definition: Algorithms.h:75
ErrorCode AALGORITHMSDK_LINK_SPEC createTexturizationAlgorithm(IAlgorithm **texturizer, const TexturizationSettings *desc)
Create texturize algorithm.
float standardDeviationMultiplier
Standard deviation multiplier.
Definition: Algorithms.h:235
float resolution
Marching cube resolution in mm.
Definition: Algorithms.h:236
base::ScannerType scannerType
Scanner type.
Definition: Algorithms.h:146
Right angle triangle texture mapping.
Definition: Algorithms.h:124
base::ScannerType scannerType
Scanner type.
Definition: Algorithms.h:200
int radius
Averaging radius (in steps)
Definition: Algorithms.h:50
int triangleNumber
Triangles number after simplification.
Definition: Algorithms.h:203
ErrorCode AALGORITHMSDK_LINK_SPEC createLoopClosureAlgorithm(IAlgorithm **loopClosure, const LoopClosureSettings *desc)
Creates loop closure algorithm.
bool enableAspectRatioThreshold
Limit edges length ratio.
Definition: Algorithms.h:221
float remeshEdgeThreshold
Minimal edge length after remesh. Not supported for fast simplification.
Definition: Algorithms.h:206
bool enableDistanceThreshold
Limit maximal distance between original and simplified meshes.
Definition: Algorithms.h:217
bool AALGORITHMSDK_LINK_SPEC checkAlgorithmsPermission()
Use this registration type only if all frames have texture.
Definition: Algorithms.h:91
base::ScannerType scannerType
Scanner type.
Definition: Algorithms.h:48
GlobalRegistrationType registrationType
Global registration type.
Definition: Algorithms.h:114
ErrorCode AALGORITHMSDK_LINK_SPEC initializeOutliersRemovalSettings(OutliersRemovalSettings *desc, base::ScannerType scannerType)
Initializes outliers removal descriptor with scanner related defaults.
float targetInnerSize
Round type target - black circle diameter.
Definition: Algorithms.h:79
bool generateNormals
Calculate normals for created mesh.
Definition: Algorithms.h:81
TexturizeResolution texturizeResolution
Texturize output resolution.
Definition: Algorithms.h:148
SmallObjectsFilterType filterType
Filter type.
Definition: Algorithms.h:173
bool keepBoundary
Algorithms won't modify boundary of given surface if true.
Definition: Algorithms.h:214
ErrorCode AALGORITHMSDK_LINK_SPEC createSmallObjectsFilterAlgorithm(IAlgorithm **smallObjectsFilter, const SmallObjectsFilterSettings *desc)
Creates small objects filter algorithm.
Unfold mesh to UV plane, then gather the texture image.
Definition: Algorithms.h:125