Artec 3D Scanning SDK  2.0
IScanningProcedure.h
Go to the documentation of this file.
1 /********************************************************************
2 *
3 * Project Artec 3D Scanning SDK
4 *
5 * Purpose: Scanning procedure
6 *
7 * Copyright: Artec Group
8 *
9 ********************************************************************/
10 
11 #ifndef _ISCANNINGPROCEDURE_H_
12 #define _ISCANNINGPROCEDURE_H_
13 
14 #include <artec/sdk/base/Errors.h>
15 #include <artec/sdk/base/IScan.h>
16 #include <artec/sdk/base/IJob.h>
17 #include <artec/sdk/base/Rect.h>
19 
20 namespace artec { namespace sdk { namespace capturing {
21  class IScanner;
22 } } }
23 
24 namespace artec { namespace sdk { namespace scanning
25 {
26 using namespace artec::sdk::base::errors;
27 
28 class IScanningProcedureObserver;
29 class IScanningProcedure;
30 
31 /*! \public
32  Setting of the scanning procedure to specify the way it works.
33 */
35 {
36  /// Capture frames without adding them to the scan.
38  /// Capture frames and add them to the scan.
40  /// Not supported now.
42  /// Stop frame capturing. If you set it for the procedure, capturing stops, but some frames can be captured afterwards.
44 
45  ScanningState_ForceDword = 0x7fffffff /* force 32-bit size enum */
46 };
47 
48 /*! \public
49  Frame registration type that the procedure uses while scanning.
50 */
52 {
53  /// Register surfaces by geometry only.
55  /// Register surfaces by both texture and geometry (hybrid registration).
56  /// Texture will be captured automatically.
58  /// Register surfaces by texture only.
60 
61  RegistrationAlgorithmType_ForceDword = 0x7fffffff /* force 32-bit size enum */
62 };
63 
64 /*! \public
65  The flags that define stages in the scanning procedure pipeline.
66 */
68 {
69  /// Capture frames and reconstruct surfaces from them.
71 
72  /// Convert textures from raw to color format.
74 
75  /// Calculate normals for the registered surfaces.
77 
78  /// Map raw (either half-size or full-size) texture to the surface.
79  /// If no texture is captured, then no action is taken.
81 
82  /// Apply frame registration.
83  /// If this flag is enabled, the successfully registered
84  /// frames are added to the scan whereas failed frames are dropped.
85  /// Otherwise all frames are added to the scan.
86  /// If this flag is enabled, normals are calculated automatically.
87  /// If registration type is set to texture or hybrid, textures are also mapped to the frames.
89 
90  /// Detect whether a captured frame is the geometry key frame (skeleton frame).
91  /// If registration is unsuccessful or ScanningPipeline_RegisterFrame is not set,
92  /// this detection is skipped.
94 
95  /// Perform only capture during scanning and postpone all postprocessing steps.
96  /// This mode is suitable for scanning with bundle.
98 
99  ScanningPipelene_ForceDword = 0x7fffffff /* force 32-bit size enum */
100 };
101 
102 /*! \public
103  This setting defines a condition for the full-sized texture capturing.
104 */
106 {
107  /// Textures are not captured at all.
109 
110  /// Textures are captured at each N-th frame.
112 
113  /// Textures are captured only if the frame is detected as a key frame for the texturing algorithm.
114  /// This flag is skipped if registration is unsuccessful or ScanningPipeline_FindGeometryKeyFrame is not set.
116 
117  /// Textures are captured for each single frame.
118  /// Use this capturing mode to apply registration algorithm by texture and geometry (hybrid registration) later.
120 
121  CaptureTextureMethod_ForceDword = 0x7fffffff /* force 32-bit size enum */
122 };
123 
124 /*! \public
125  These settings specify the scanning procedure entirely.
126 */
128 {
129  /// @brief Limit number of frames to scan.
130  /// @details Zero means unlimited, negative values are not valid.
131  /// Capturing will continue until ScanningState_Stop is set.
133 
134  /// Tracking type (frame registration).
136 
137  /// ScanningPipeline flags combined.
139 
140  /// Initial scanning state.
142 
143  /// @brief Callback interface for processing of the captured data.
144  /// @details For example, one can render frames immediately while scanning. Can be NULL.
146 
147  /// @brief Ignore tracking errors (from frame registration).
148  /// @details If this flag is true, scanning procedure adds all successfully reconstructed frames to the resulting scan.
149  /// If it is false, scanning procedure adds to the result scan only successfully registered frames.
150  /// This flag is taken into account only if "ScanningPipeline_RegisterFrame" is enabled.
152 
153  /// Defines the method of how to capture texture from scanner.
155 
156  /// @brief How often to capture texture.
157  /// @details Used if CaptureTextureMethod_EveryNFrame is specified.
158  /// If CaptureTextureMethod_EveryNFrame selected, 0 and 1 means capture on each frame,
159  /// other values mean "capture texture on each N'th frame".
161 
162  /// @brief Keep "empty" frames.
163  /// @details This flag indicates that surfaces with reconstruction failures will still be added
164  /// to the scan as "empty" ones. It might be useful for texturizing algorithm post-processing and
165  /// for preserving frame numbering among different scans (in case of scanning with bundle).
167 };
168 
169 extern "C"
170 {
171  /// Initialize scanning procedure descriptor with the default settings.
174 
175  /**
176  * @brief Create scanning procedure instance.
177  * @param job - scanning procedure to return
178  * @param scanner - scanner to use
179  * @param desc - scanning procedure settings (NULL means default settings)
180  */
183 }
184 
185 /// Interface to start/pause/stop recording, control scanner sensitivity, FOV, ROI, etc.
186 /// This class needs AlgorithmWorkset because the way of its calling follows the one for the algorithms.
188 {
189 public:
190  /**
191  * Get current scanning state (ScanningState_Preview, ScanningState_Record, etc.).
192  * @return current scanning state.
193  */
194  virtual ScanningState getState() = 0;
195 
196  /**
197  * Set new scanning state. It can be changed while capture is in progress.
198  * @param state - current scanning state.
199  */
200  virtual ErrorCode setState( ScanningState state ) = 0;
201 
202  /**
203  * @brief Set the "improve by neighbor" sensitivity parameter.
204  * @details Used for mesh reconstruction. It can be changed while capture is in progress.
205  * It doesn't take effect for EVA cameras
206  * @param sensitivity - value in the range of 0.0f to 1.0f
207  */
208  virtual ErrorCode setSensitivity(float sensitivity) = 0;
209 
210  /**
211  * @brief Get the current "improve by neighbor" sensitivity parameter.
212  * @details Used for mesh reconstruction.
213  * @return sensitivity - value in the range of 0.0f to 1.0f
214  */
215  virtual float getSensitivity() = 0;
216 
217  /**
218  * @brief Update scanning range.
219  * @details Can be changed while capture is in progress.
220  * @param rangeNear - near range limit
221  * @param rangeFar - far range limit
222  */
223  virtual ErrorCode setScanningRange(float rangeNear, float rangeFar) = 0;
224 
225  /**
226  * Get current scanning range.
227  * @param rangeNear - near range limit to return
228  * @param rangeFar - far range limit to return
229  */
230  virtual ErrorCode getScanningRange(float* rangeNear, float* rangeFar) = 0;
231 
232  /**
233  * Update region of scanning interest (ROI).
234  * @details Can be changed while capture is in progress.
235  * @param rect - region of interest. NULL means disabled ROI.
236  */
237  virtual ErrorCode setROI(artec::sdk::base::RectF* rect) = 0;
238 
239  /**
240  * Get current region of scanning interest (ROI).
241  * @param rect - region of interest to return
242  */
243  virtual ErrorCode getROI(artec::sdk::base::RectF* rect) = 0;
244 };
245 
246 } } } // namespace artec::sdk::scanning
247 
248 #endif // _ISCANNINGPROCEDURE_H_
Interface to start/pause/stop recording, control scanner sensitivity, FOV, ROI, etc.
Perform only capture during scanning and postpone all postprocessing steps.
ScanningState initialState
Initial scanning state.
Textures are captured only if the frame is detected as a key frame for the texturing algorithm...
int captureTextureFrequency
How often to capture texture.
RegistrationAlgorithmType registrationType
Tracking type (frame registration).
Capture frames and reconstruct surfaces from them.
RegistrationAlgorithmType
Frame registration type that the procedure uses while scanning.
IScanningProcedureObserver * scanningCallback
Callback interface for processing of the captured data.
Textures are captured for each single frame.
Calculate normals for the registered surfaces.
CaptureTextureMethod captureTexture
Defines the method of how to capture texture from scanner.
Textures are captured at each N-th frame.
Structure that defines rectangle, i.e. two-dimensional range.
Definition: Rect.h:26
Register surfaces by both texture and geometry (hybrid registration).
Convert textures from raw to color format.
ScanningState
Setting of the scanning procedure to specify the way it works.
Stop frame capturing. If you set it for the procedure, capturing stops, but some frames can be captur...
int maxFrameCount
Limit number of frames to scan.
Interface that represents a basic multithreaded work item; Used by executeJob and launchJob...
Definition: IJob.h:51
Capture frames and add them to the scan.
#define ASCANNINGSDK_LINK_SPEC
CaptureTextureMethod
This setting defines a condition for the full-sized texture capturing.
These settings specify the scanning procedure entirely.
bool ignoreRegistrationErrors
Ignore tracking errors (from frame registration).
Map raw (either half-size or full-size) texture to the surface.
ErrorCode ASCANNINGSDK_LINK_SPEC createScanningProcedure(IScanningProcedure **job, artec::sdk::capturing::IScanner *scanner, const ScanningProcedureSettings *desc=NULL)
Create scanning procedure instance.
Capture frames without adding them to the scan.
ErrorCode ASCANNINGSDK_LINK_SPEC initializeScanningProcedureSettings(ScanningProcedureSettings *desc)
Initialize scanning procedure descriptor with the default settings.
Detect whether a captured frame is the geometry key frame (skeleton frame).
Interface to initiate capture and control scanner parameters (fps, texture, exposure time...
Definition: IScanner.h:97
Interface to receive notifications about events during scanning (e.g., frame scanned).
int pipelineConfiguration
ScanningPipeline flags combined.
ScanningPipeline
The flags that define stages in the scanning procedure pipeline.