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 
37 /// Enum for Poisson Fusion and Texturization algorithms.
39 {
40  /// The only frames with texture key frame attribute set will be used by an algorithm.
41  /// This type is used by default.
43 
44  /// Algorithm considers all frames, which have not empty textures.
46 };
47 
48 //////////////////////////////////////////////////////////////////////////
49 /// Parameters for fast fusion algorithm.
51 {
52  /// Scanner type
54 
55  /// Mesh resolution (in millimeters) - step of grid which is used to reconstruct a polygonal model.
56  /// Parameter defines the minimal space unit where the polygon of the model will be built in.
57  /// EVA resolution should be no less than 0.4
58  /// Spider resolution should be no less than 0.1
59  /// L2 resolution should be no less than 0.5
60  float resolution;
61 
62  /// Radius( for Fast Fusion only ) - a factor to define vicinity
63  /// that algorithm takes into consideration when adding each new minimal space unit.
64  int radius;
65 
66  /// If true then calculate normals for created mesh
68 };
69 
70 //////////////////////////////////////////////////////////////////////////
72 {
75 
76  PoissonFusionType_ForceDword = 0x7fffffff ///< Force 32-bit size enum
77 };
78 
79 /// Fill_holes (for PoissonFusion) settles the algorithm to fill holes in the mesh being reconstructed.
81 {
82  /// Automatically fills in all holes in the mesh
84 
85  /// All holes having radius no greater than the specified in "maxHoleRadius" value will be filled in;
87 
88  FillHolesType_ForceDword = 0x7fffffff ///< Force 32-bit size enum
89 };
90 
92 {
93  /// Scanner type
95 
96  /// Fusion type
98 
99  /// Fill holes method type: All or by radius
101 
102  /// Mesh resolution (in millimeters) - step of grid which is used to reconstruct a polygonal model.
103  /// Parameter defines the minimal space unit where the polygon of the model will be built in.
104  float resolution;
105 
106  /// Maximum hole radius in millimeters
108 
109  /// If true than erase small embossings from the surface, where targets were stuck on.
111 
112  /// Round type target - black circle diameter (in millimeters)
114 
115  /// Round type target - white circle diameter (in millimeters)
117 
118  /// If true then calculate normals for created mesh
120 
121  /// Type of frames, which should be used by the algorithm.
123 };
124 
125 //////////////////////////////////////////////////////////////////////////
127 {
128  SerialRegistrationType_Rough, ///< Use this registration type for any data. Fast but less accuracy.
129  SerialRegistrationType_RoughTextured, ///< Use this registration type only if all frames have texture. Fast but less accuracy.
130  SerialRegistrationType_Fine, ///< Use this registration type for any data
131  SerialRegistrationType_FineTextured, ///< Use this registration type only if all frames have texture.
132 
133  SerialRegistrationType_ForceDword = 0x7fffffff ///< Force 32-bit size enum
134 };
135 
137 {
138  /// Scanner type
140 
141  /// Serial registration type
143 };
144 
145 //////////////////////////////////////////////////////////////////////////
147 {
148  GlobalRegistrationType_Geometry, ///< Use this registration type for any data
149  GlobalRegistrationType_GeometryAndTexture, ///< Use this registration type only if all frames have texture
150 
151  GlobalRegistrationType_ForceDword = 0x7fffffff ///< Force 32-bit size enum
152 };
153 
155 {
156  /// Scanner type
158 
159  /// Global registration type
161 };
162 
163 //////////////////////////////////////////////////////////////////////////
165 {
166  /// Each vertex gets multiple coordinates for each of adjacent triangles,
167  /// final texture coordinates are continuous only for a given triangle area
169 
170  /// Obsolete. Now works the same way as TexturizeType_Advanced.
172 
173  /// Unfold mesh to UV plane, then gather the texture image
175 
176  /// Keep UV coordinates set, just re-gather the texture image
178 
179  TexturizeType_ForceDword = 0x7fffffff ///< Force 32-bit size enum
180 };
181 
183 {
190 
191  TexturizeResolution_ForceDword = 0x7fffffff ///< Force 32-bit size enum
192 };
193 
194 
196 {
197  /// Scanner type
199 
200  /// Texturize type to use
202 
203  /// Texturize output resolution (in pixel)
205 
206  /// If true than enable background segmentation for input texture frames
208 
209  /// If true then enable compensation of ambient light
211 
212  /// Set the limit for number of polygons for mesh unfolding:
213  /// 0 - disable simplification (unfold original mesh)
214  /// N - reduce number of polygons to N, then make unfolding and re-project atlas to the original mesh
216 
217  /// Interpolate colors for empty texture areas
219 
220  /// Correct texture brightness for Artec scanners
222 
223  /// Type of frames, which should be used by the algorithm
225 };
226 
227 //////////////////////////////////////////////////////////////////////////
229 {
230  SmallObjectsFilterType_LeaveBiggestObject = 0, ///< Leave only biggest object
231  SmallObjectsFilterType_FilterByThreshold = 1, ///< Remove objects that contain the number of
232  ///< triangles is less than the specified
233 
234  SmallObjectsFilterType_ForceDword = 0x7fffffff ///< Force 32-bit size enum
235 };
236 
238 {
239  /// Scanner type
241 
242  /// Filter type
244 
245  /// Threshold - number of triangles
247 };
248 
249 //////////////////////////////////////////////////////////////////////////
251 {
252  SimplifyType_TriangleQuantity, ///< Reduce triangle quantity to given number
253  SimplifyType_Accuracy, ///< Keep simplified mesh accuracy
254  SimplifyType_Remesh, ///< Minimal acceptable edge length
255  SimplifyType_TriangleQuantityFast, ///< Reduce triangle quantity to given number. Very fast but less accuracy.
256 
257  SimplifyType_ForceDword = 0x7fffffff ///< Force 32-bit size enum
258 };
259 
261 {
262  SimplifyMetric_EdgeLength, ///< Reduce triangle quantity to given number
263  SimplifyMetric_EdgeLengthAndAngle, ///< Keep simplified mesh accuracy
264  SimplifyMetric_DistanceToSurface, ///< Minimal acceptable edge length
265  SimplifyMetric_DistanceToSurfaceIterative, ///< Minimal acceptable edge length
266 
267  SimplifyMetric_ForceDword = 0x7fffffff ///< Force 32-bit size enum
268 };
269 
271 {
272  /// Scanner type
274 
275  /// Simplify type: TriangleQuantity, Accuracy, Remesh, TriangleQuantityFast
277 
278  /// Simplify metrics: EdgeLength, DistanceToSurface etc. Not supported for fast simplification.
280 
281  /// Triangles number after simplification
283 
284  /// If true then algorithms won't modify boundary of given surface
286 
287  /// Maximal angle between neighbor normals (in degrees). Not supported for fast simplification.
289 
290  /// Minimal edge length after remesh. Not supported for fast simplification.
292 
293  /// Max error. Not supported for fast simplification.
294  float error;
295 };
296 
298 {
299  /// Scanner type
301 
302  /// Triangles number after simplification.
304 
305  /// If true then Algorithms won't modify boundary of given surface.
307 
308  /// Simplification stops if one of the thresholding criteras below are not satisfied.
310 
311  /// Limit maximal distance between original and simplified meshes.
313 
314  /// Max error (in units^2).
316 
317  /// If true then Limit maximal normals deviation.
319 
320  /// Maximal angle between neighbor faces normals (in degrees).
322 
323  /// If true then limit edges length ratio.
325 
326  /// Maximal available ratio of edges in triangle.
328 };
329 
330 //////////////////////////////////////////////////////////////////////////
332 {
333  /// Scanner type
335 };
336 
337 //////////////////////////////////////////////////////////////////////////
339 {
340  /// Scanner type
342 
343  /// Standard deviation multiplier.
345 
346  /// Marching cube resolution (in millimeters).
347  float resolution;
348 };
349 
350 //////////////////////////////////////////////////////////////////////////
351 
352 extern "C"
353 {
354  /// Check whether the algorithms are available on this machine
355  ///
356  /// @retval true if algorithms can be created
357  /// @retval false if algorithms creation denied
360 
361  /// Initializes Fast Fusion algorithm descriptor with scanner related defaults
364 
365  /// Initializes Poisson Fusion algorithm descriptor with scanner related defaults
368 
369  /// Initialize texturize algorithm descriptor with scanner related defaults
372 
373  /// Initializes small object filter descriptor with scanner related defaults
376 
377  /// Initializes mesh simplification descriptor with scanner related defaults
380 
381  /// Initializes fast mesh simplification descriptor with scanner related defaults
384 
385  /// Initializes outliers removal descriptor with scanner related defaults
388 
389 
390  /// Creates basic fusion algorithm
393 
394  /// Creates poisson fusion algorithm
397 
398  /// Creates serial registration algorithm
400  createSerialRegistrationAlgorithm( IAlgorithm** serialRegistration, const SerialRegistrationSettings* desc );
401 
402  /// Creates global registration algorithm
404  createGlobalRegistrationAlgorithm( IAlgorithm** globalRegistration, const GlobalRegistrationSettings* desc );
405 
406  /// Create texturize algorithm
409 
410  /// Creates small objects filter algorithm
412  createSmallObjectsFilterAlgorithm( IAlgorithm** smallObjectsFilter, const SmallObjectsFilterSettings* desc );
413 
414  /// Creates mesh simplification algorithm
416  createMeshSimplificationAlgorithm( IAlgorithm** meshSimplification, const MeshSimplificationSettings* desc );
417 
418  /// Creates fast mesh simplification algorithm
421 
422  /// Creates loop closure algorithm
424  createLoopClosureAlgorithm( IAlgorithm** loopClosure, const LoopClosureSettings* desc );
425 
426  /// Creates outliers removal algorithm
428  createOutliersRemovalAlgorithm( IAlgorithm** outliesRemoval, const OutliersRemovalSettings* desc );
429 }
430 
431 } } } // namespace artec::sdk::algorithms
432 
433 #endif // _ALGORITHMS_H_
SimplifyMetric simplifyMetrics
Simplify metrics: EdgeLength, DistanceToSurface etc. Not supported for fast simplification.
Definition: Algorithms.h:279
ErrorCode AALGORITHMSDK_LINK_SPEC createMeshSimplificationAlgorithm(IAlgorithm **meshSimplification, const MeshSimplificationSettings *desc)
Creates mesh simplification algorithm.
Keep simplified mesh accuracy.
Definition: Algorithms.h:253
bool removeTargets
If true than erase small embossings from the surface, where targets were stuck on.
Definition: Algorithms.h:110
All holes having radius no greater than the specified in "maxHoleRadius" value will be filled in;...
Definition: Algorithms.h:86
Use this registration type for any data.
Definition: Algorithms.h:130
base::ScannerType scannerType
Scanner type.
Definition: Algorithms.h:139
This namespace is auto-generated from internal event code list.
Definition: Errors.h:55
bool enableAngleThreshold
If true then Limit maximal normals deviation.
Definition: Algorithms.h:318
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:255
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 Fast Fusion algorithm descriptor with scanner related defaults.
Use this registration type only if all frames have texture.
Definition: Algorithms.h:149
FillHolesType
Fill_holes (for PoissonFusion) settles the algorithm to fill holes in the mesh being reconstructed...
Definition: Algorithms.h:80
InputFilter inputFilterType
Type of frames, which should be used by the algorithm.
Definition: Algorithms.h:224
ErrorCode AALGORITHMSDK_LINK_SPEC initializePoissonFusionSettings(PoissonFusionSettings *desc, base::ScannerType scannerType)
Initializes Poisson Fusion algorithm descriptor with scanner related defaults.
SerialRegistrationType registrationType
Serial registration type.
Definition: Algorithms.h:142
bool keepBoundary
If true then algorithms won't modify boundary of given surface.
Definition: Algorithms.h:285
float angleThreshold
Maximal angle between neighbor normals (in degrees). Not supported for fast simplification.
Definition: Algorithms.h:288
float targetOuterSize
Round type target - white circle diameter (in millimeters)
Definition: Algorithms.h:116
bool enableAmbientLightingCompensation
If true then enable compensation of ambient light.
Definition: Algorithms.h:210
base::ScannerType scannerType
Scanner type.
Definition: Algorithms.h:94
ErrorCode AALGORITHMSDK_LINK_SPEC createOutliersRemovalAlgorithm(IAlgorithm **outliesRemoval, const OutliersRemovalSettings *desc)
Creates outliers removal algorithm.
bool generateNormals
If true then calculate normals for created mesh.
Definition: Algorithms.h:67
float angleThreshold
Maximal angle between neighbor faces normals (in degrees).
Definition: Algorithms.h:321
float maxHoleRadius
Maximum hole radius in millimeters.
Definition: Algorithms.h:107
ErrorCode AALGORITHMSDK_LINK_SPEC createFastFusionAlgorithm(IAlgorithm **fusion, const FastFusionSettings *desc)
Creates basic fusion algorithm.
Minimal acceptable edge length.
Definition: Algorithms.h:254
Reduce triangle quantity to given number.
Definition: Algorithms.h:252
ErrorCode AALGORITHMSDK_LINK_SPEC initializeSmallObjectsFilterSettings(SmallObjectsFilterSettings *desc, base::ScannerType scannerType)
Initializes small object filter descriptor with scanner related defaults.
InputFilter
Enum for Poisson Fusion and Texturization algorithms.
Definition: Algorithms.h:38
TexturizeType texturizeType
Texturize type to use.
Definition: Algorithms.h:201
int triangleNumber
Triangles number after simplification.
Definition: Algorithms.h:303
Use this registration type for any data. Fast but less accuracy.
Definition: Algorithms.h:128
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:327
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:148
Keep UV coordinates set, just re-gather the texture image.
Definition: Algorithms.h:177
bool enableAdditionalCriteria
Simplification stops if one of the thresholding criteras below are not satisfied. ...
Definition: Algorithms.h:309
bool useTextureNormalization
Correct texture brightness for Artec scanners.
Definition: Algorithms.h:221
Reduce triangle quantity to given number.
Definition: Algorithms.h:262
bool enableBackgroundSegmentation
If true than enable background segmentation for input texture frames.
Definition: Algorithms.h:207
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:157
Use this registration type only if all frames have texture. Fast but less accuracy.
Definition: Algorithms.h:129
base::ScannerType scannerType
Scanner type.
Definition: Algorithms.h:341
base::ScannerType scannerType
Scanner type.
Definition: Algorithms.h:334
ErrorCode AALGORITHMSDK_LINK_SPEC createPoissonFusionAlgorithm(IAlgorithm **fusion, const PoissonFusionSettings *desc)
Creates poisson fusion algorithm.
PoissonFusionType fusionType
Fusion type.
Definition: Algorithms.h:97
#define AALGORITHMSDK_LINK_SPEC
bool enableTextureInpainting
Interpolate colors for empty texture areas.
Definition: Algorithms.h:218
float error
Max error. Not supported for fast simplification.
Definition: Algorithms.h:294
InputFilter inputFilterType
Type of frames, which should be used by the algorithm.
Definition: Algorithms.h:122
int filterThreshold
Threshold - number of triangles.
Definition: Algorithms.h:246
base::ScannerType scannerType
Scanner type.
Definition: Algorithms.h:240
FillHolesType fillType
Fill holes method type: All or by radius.
Definition: Algorithms.h:100
Automatically fills in all holes in the mesh.
Definition: Algorithms.h:83
ErrorCode AALGORITHMSDK_LINK_SPEC createTexturizationAlgorithm(IAlgorithm **texturizer, const TexturizationSettings *desc)
Create texturize algorithm.
float standardDeviationMultiplier
Standard deviation multiplier.
Definition: Algorithms.h:344
float resolution
Marching cube resolution (in millimeters).
Definition: Algorithms.h:347
base::ScannerType scannerType
Scanner type.
Definition: Algorithms.h:198
Obsolete. Now works the same way as TexturizeType_Advanced.
Definition: Algorithms.h:171
base::ScannerType scannerType
Scanner type.
Definition: Algorithms.h:273
int triangleNumber
Triangles number after simplification.
Definition: Algorithms.h:282
ErrorCode AALGORITHMSDK_LINK_SPEC createLoopClosureAlgorithm(IAlgorithm **loopClosure, const LoopClosureSettings *desc)
Creates loop closure algorithm.
bool enableAspectRatioThreshold
If true then limit edges length ratio.
Definition: Algorithms.h:324
SimplifyType simplifyType
Simplify type: TriangleQuantity, Accuracy, Remesh, TriangleQuantityFast.
Definition: Algorithms.h:276
float remeshEdgeThreshold
Minimal edge length after remesh. Not supported for fast simplification.
Definition: Algorithms.h:291
bool enableDistanceThreshold
Limit maximal distance between original and simplified meshes.
Definition: Algorithms.h:312
bool AALGORITHMSDK_LINK_SPEC checkAlgorithmsPermission()
Parameters for fast fusion algorithm.
Definition: Algorithms.h:50
Use this registration type only if all frames have texture.
Definition: Algorithms.h:131
base::ScannerType scannerType
Scanner type.
Definition: Algorithms.h:53
GlobalRegistrationType registrationType
Global registration type.
Definition: Algorithms.h:160
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 (in millimeters)
Definition: Algorithms.h:113
bool generateNormals
If true then calculate normals for created mesh.
Definition: Algorithms.h:119
TexturizeResolution texturizeResolution
Texturize output resolution (in pixel)
Definition: Algorithms.h:204
Algorithm considers all frames, which have not empty textures.
Definition: Algorithms.h:45
SmallObjectsFilterType filterType
Filter type.
Definition: Algorithms.h:243
bool keepBoundary
If true then Algorithms won't modify boundary of given surface.
Definition: Algorithms.h:306
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:174