Time-of-Flight Library(ToF) 3.7.3
processing_config.hpp
1#ifndef _CHRONOPTICS_TOF_PROCESSING_CONFIG_HPP_
2#define _CHRONOPTICS_TOF_PROCESSING_CONFIG_HPP_
3
4#include <chronoptics/tof/processing_config.h>
5
6#include <chronoptics/tof/base.hpp>
7
8namespace chronoptics {
9namespace tof {
10
11/** The shape of which surrounding pixels are checked in the flying pixel filter
12 */
13enum class FlyingShape {
14 PLUS = 0, /** Four neighboring pixels in a plus shape */
15 BOX = 1, /** All eight neighboring pixels */
16};
17
18/** Mixed pixel sort mode. The mode you want to use depends on your application.
19 */
20enum class MpSortMode {
21 DARKEST = 0, /** Choose darkest path */
22 SHORTEST = 1, /** Return the surface of a translucent object, resolve corners or checkerboard lens flare */
23 BRIGHTEST = 2, /** Mixed pixels between foreground and background, get the best SNR */
24 LONGEST = 3, /** Correct lens flare from close bright objects */
25 AGGRESSOR = 4, /** Correct lens flare */
26 ADAPTIVE_SHORT_V0 = 5, /** Adaptive shortest */
27 ADAPTIVE_SHORT_V1 = 6, /** Adaptive shortest version two */
28 AGGRESSOR_V2 = 7, /** Correct lens flare version two */
29};
30
31/** What kind of binning to do
32 */
33enum class BinningMode {
34 NORMAL = 0, /** Normal binning, a BxB grid averaged to a single pixel */
35 SMART = 1, /** Smart binning, take into account the standard deviation around a chosen pixel. Similar to local means but reduces the image size */
36};
37
38/** In what dimension the xyz is exported
39 */
40enum class XyzDimension {
41 MILLIMETER = 0, /** Export in millimeters */
42 METER = 1, /** Export in meters */
43};
44
45/** Processing that can be done
46*/
47class ProcessingConfig : public detail::Base<tof_processing_config, tof_processing_config_delete> {
48 public:
49 /** Construct from pointer */
50 ProcessingConfig(tof_processing_config_t ptr) {
51 this->ptr_ = ptr;
52 }
53
54 /** Create default processing config
55 */
57 this->ptr_ = tof_processing_config_new_default(TOF_ERROR_HANDLER{});
58 }
59
60 /** Load processing config from disk
61 * @param file_location Location of processing config
62 */
63 ProcessingConfig(StringView file_location) {
64 this->ptr_ = tof_processing_config_new_from_disk(file_location, TOF_ERROR_HANDLER{});
65 }
66
67 /** Write processing config to disk
68 * @param file_location Location where to save the processing config
69 */
70 void write(StringView file_location) const {
71 return tof_processing_config_write(this->ptr_, file_location, TOF_ERROR_HANDLER{});
72 }
73
74 /** Get whether processing on the gpu is enabled
75 * @return Enabled
76 */
77 bool get_gpu() const {
78 return tof_processing_config_get_gpu(this->ptr_, TOF_ERROR_HANDLER{});
79 }
80
81 /** Set whether processing on the gpu is enabled
82 * @param gpu Enabled
83 */
84 void set_gpu(bool gpu) {
85 return tof_processing_config_set_gpu(this->ptr_, gpu, TOF_ERROR_HANDLER{});
86 }
87
88 /** Get whether the calibration is applied
89 * @return Enabled
90 */
92 return tof_processing_config_get_calibration_enabled(this->ptr_, TOF_ERROR_HANDLER{});
93 }
94
95 /** Set whether the calibration is applied
96 * @param enabled Enabled
97 */
98 void set_calibration_enabled(bool enabled) {
99 return tof_processing_config_set_calibration_enabled(this->ptr_, enabled, TOF_ERROR_HANDLER{});
100 }
101
102 /** Get whether phase unwrapping is enabled
103 * @return Enabled
104 */
106 return tof_processing_config_get_phase_unwrapping_enabled(this->ptr_, TOF_ERROR_HANDLER{});
107 }
108
109 /** Set whether phase unwrapping is enabled
110 * @param enabled Enabled
111 */
112 void set_phase_unwrapping_enabled(bool enabled) {
113 return tof_processing_config_set_phase_unwrapping_enabled(this->ptr_, enabled, TOF_ERROR_HANDLER{});
114 }
115
116 /** Get The maximum distance between ideal location and actual
117 * @return Max offset, range [0, 1]
118 */
120 return tof_processing_config_get_phase_unwrapping_max_offset(this->ptr_, TOF_ERROR_HANDLER{});
121 }
122
123 /** Set The maximum distance between ideal location and actual
124 * @param max_offset Max offset, range [0, 1]
125 */
126 void set_phase_unwrapping_max_offset(double max_offset) {
127 return tof_processing_config_set_phase_unwrapping_max_offset(this->ptr_, max_offset, TOF_ERROR_HANDLER{});
128 }
129
130 /** Get wether mixed pixel is enabled
131 * @return Enabled
132 */
134 return tof_processing_config_get_mixed_pixel_enabled(this->ptr_, TOF_ERROR_HANDLER{});
135 }
136
137 /** Set wether mixed pixel is enabled
138 * @param enabled Enabled
139 */
140 void set_mixed_pixel_enabled(bool enabled) {
141 return tof_processing_config_set_mixed_pixel_enabled(this->ptr_, enabled, TOF_ERROR_HANDLER{});
142 }
143
144 /** Get location of the mixed pixel look up table file
145 * @return File location
146 */
147 const char* get_mixed_pixel_lut_file() const {
148 return tof_processing_config_get_mixed_pixel_lut_file(this->ptr_, TOF_ERROR_HANDLER{});
149 }
150
151 /** Set location of the mixed pixel look up table file
152 * @param file_location File location
153 */
154 void set_mixed_pixel_lut_file(StringView file_location) {
155 return tof_processing_config_set_mixed_pixel_lut_file(this->ptr_, file_location, TOF_ERROR_HANDLER{});
156 }
157
158 /** Get minimum amplitude that pixel needs to have to apply mixed pixel to it
159 * @return Minimum amplitude
160 */
161 double get_mixed_pixel_amp_min() const {
162 return tof_processing_config_get_mixed_pixel_amp_min(this->ptr_, TOF_ERROR_HANDLER{});
163 }
164
165 /** Set minimum amplitude that pixel needs to have to apply mixed pixel to it
166 * @param amp_min Minimum amplitude
167 */
168 void set_mixed_pixel_amp_min(double amp_min) {
169 return tof_processing_config_set_mixed_pixel_amp_min(this->ptr_, amp_min, TOF_ERROR_HANDLER{});
170 }
171
172 /** Get what output is selected
173 * @return Sort mode
174 */
175 MpSortMode get_mixed_pixel_sort_mode() const {
176 return static_cast<MpSortMode>(tof_processing_config_get_mixed_pixel_sort_mode(this->ptr_, TOF_ERROR_HANDLER{}));
177 }
178
179 /** Set what output is selected
180 * @param sort_mode Sort mode
181 */
182 void set_mixed_pixel_sort_mode(MpSortMode sort_mode) {
183 return tof_processing_config_set_mixed_pixel_sort_mode(this->ptr_, static_cast<tof_mp_sort_mode>(sort_mode), TOF_ERROR_HANDLER{});
184 }
185
186 /** Get the amplitude ratio for detecting MPI
187 * @return Amplitude ratio
188 */
189 double get_mixed_pixel_aratio() const {
190 return tof_processing_config_get_mixed_pixel_aratio(this->ptr_, TOF_ERROR_HANDLER{});
191 }
192
193 /** Set the amplitude ratio for detecting MPI
194 * @param aratio Amplitude ratio
195 */
196 void set_mixed_pixel_aratio(double aratio) {
197 return tof_processing_config_set_mixed_pixel_aratio(this->ptr_, aratio, TOF_ERROR_HANDLER{});
198 }
199
200 /** Get the phase difference for detecting MPI
201 * @return Phase difference
202 */
204 return tof_processing_config_get_mixed_pixel_phi_diff(this->ptr_, TOF_ERROR_HANDLER{});
205 }
206
207 /** Set the phase difference for detecting MPI
208 * @param phi_diff Phase difference
209 */
210 void set_mixed_pixel_phi_diff(double phi_diff) {
211 return tof_processing_config_set_mixed_pixel_phi_diff(this->ptr_, phi_diff, TOF_ERROR_HANDLER{});
212 }
213
214 /** Get the threshold to classify a pixel as an aggressor
215 * @return Aggressor threshold
216 */
218 return tof_processing_config_get_mixed_pixel_aggressor_threshold(this->ptr_, TOF_ERROR_HANDLER{});
219 }
220
221 /** Set the threshold to classify a pixel as an aggressor
222 * @param threshold Aggressor threshold
223 */
224 void set_mixed_pixel_aggressor_threshold(double threshold) {
225 return tof_processing_config_set_mixed_pixel_aggressor_threshold(this->ptr_, threshold, TOF_ERROR_HANDLER{});
226 }
227
228 /** Get the minimum amount of bright pixels before a bright spot is classified
229 * as an aggressor
230 * @return Minimum aggressor size
231 */
233 return tof_processing_config_get_mixed_pixel_min_aggressor_size(this->ptr_, TOF_ERROR_HANDLER{});
234 }
235
236 /** Set the minimum amount of bright pixels before a bright spot is classified
237 * as an aggressor
238 * @param size Minimum aggressor size
239 */
241 return tof_processing_config_set_mixed_pixel_min_aggressor_size(this->ptr_, size, TOF_ERROR_HANDLER{});
242 }
243
244 /** Get the maximum error when using three modulation frequencies
245 * @return The error
246 */
248 return tof_processing_config_get_mixed_pixel_max_error_3f(this->ptr_, TOF_ERROR_HANDLER{});
249 }
250
251 /** Set the maximum error when using three modulation frequencies
252 * @param max_error_3f The error
253 */
254 void set_mixed_pixel_max_error_3f(double max_error_3f) {
255 return tof_processing_config_set_mixed_pixel_max_error_3f(this->ptr_, max_error_3f, TOF_ERROR_HANDLER{});
256 }
257
258 /** Get the maximum amplitude for adaptive sorting
259 * @return Maximum amplitude
260 */
262 return tof_processing_config_get_mixed_pixel_adaptive_amp_max(this->ptr_, TOF_ERROR_HANDLER{});
263 }
264
265 /** Set the maximum amplitude for adaptive sorting
266 * @param adaptive_amp_max Maximum amplitude
267 */
268 void set_mixed_pixel_adaptive_amp_max(double adaptive_amp_max) {
269 return tof_processing_config_set_mixed_pixel_adaptive_amp_max(this->ptr_, adaptive_amp_max, TOF_ERROR_HANDLER{});
270 }
271
272 /** Get the minimum amplitude for adaptive sorting
273 * @return Minimum amplitude
274 */
276 return tof_processing_config_get_mixed_pixel_adaptive_amp_min(this->ptr_, TOF_ERROR_HANDLER{});
277 }
278
279 /** Set the minimum amplitude for adaptive sorting
280 * @param adaptive_amp_min Minimum amplitude
281 */
282 void set_mixed_pixel_adaptive_amp_min(double adaptive_amp_min) {
283 return tof_processing_config_set_mixed_pixel_adaptive_amp_min(this->ptr_, adaptive_amp_min, TOF_ERROR_HANDLER{});
284 }
285
286 /** Get the minimum return amplitude ratio for adaptive sorting
287 * @return Minimum return ratio
288 */
290 return tof_processing_config_get_mixed_pixel_aratio_min(this->ptr_, TOF_ERROR_HANDLER{});
291 }
292
293 /** Set the minimum return amplitude ratio for adaptive sorting
294 * @param aratio_min Minimum return ratio
295 */
296 void set_mixed_pixel_aratio_min(double aratio_min) {
297 return tof_processing_config_set_mixed_pixel_aratio_min(this->ptr_, aratio_min, TOF_ERROR_HANDLER{});
298 }
299
300 /** Get The maximum phase difference before a return is not classified as
301 * aggressor
302 * @return Phase offset before not a aggressor return
303 */
305 return tof_processing_config_get_mixed_pixel_aggressor_phi_offset(this->ptr_, TOF_ERROR_HANDLER{});
306 }
307
308 /** Set The maximum phase difference before a return is not classified as
309 * aggressor
310 * @param aggressor_phi_offset Phase offset before not a aggressor return
311 */
312 void set_mixed_pixel_aggressor_phi_offset(double aggressor_phi_offset) {
313 return tof_processing_config_set_mixed_pixel_aggressor_phi_offset(this->ptr_, aggressor_phi_offset, TOF_ERROR_HANDLER{});
314 }
315
316 /** Get whether hdr is enabled. High dynamic range allows you to separate
317 * depth with high intensity difference. This is mostly useful when the sensor
318 * is being saturated.
319 * @return Enabled
320 */
321 bool get_hdr_enabled() const {
322 return tof_processing_config_get_hdr_enabled(this->ptr_, TOF_ERROR_HANDLER{});
323 }
324
325 /** Set whether hdr is enabled. High dynamic range allows you to separate
326 * depth with high intensity difference. This is mostly useful when the sensor
327 * is being saturated.
328 * @param enabled Enabled
329 */
330 void set_hdr_enabled(bool enabled) {
331 return tof_processing_config_set_hdr_enabled(this->ptr_, enabled, TOF_ERROR_HANDLER{});
332 }
333
334 /** Get whether averaging is enabled. The average process allows you to
335 * average multiple frames together at the cost of frame rate
336 * @return Enabled
337 */
338 bool get_average_enabled() const {
339 return tof_processing_config_get_average_enabled(this->ptr_, TOF_ERROR_HANDLER{});
340 }
341
342 /** Set whether averaging is enabled. The average process allows you to
343 * average multiple frames together at the cost of frame rate
344 * @param enabled Enabled
345 */
346 void set_average_enabled(bool enabled) {
347 return tof_processing_config_set_average_enabled(this->ptr_, enabled, TOF_ERROR_HANDLER{});
348 }
349
350 /** Get the number of frames to average together
351 * @return Number of frames
352 */
353 size_t get_average_nframes() const {
354 return tof_processing_config_get_average_nframes(this->ptr_, TOF_ERROR_HANDLER{});
355 }
356
357 /** Set the number of frames to average together
358 * @param nframes Number of frames
359 */
360 void set_average_nframes(size_t nframes) {
361 return tof_processing_config_set_average_nframes(this->ptr_, nframes, TOF_ERROR_HANDLER{});
362 }
363
364 /** Get whether the temporal filter is enabled. The temporal filter is a
365 * running average as long as the values are within sigma standard deviations
366 * of each other
367 * @return Enabled
368 */
369 bool get_temporal_enabled() const {
370 return tof_processing_config_get_temporal_enabled(this->ptr_, TOF_ERROR_HANDLER{});
371 }
372
373 /** Set whether the temporal filter is enabled. The temporal filter is a
374 * running average as long as the values are within sigma standard deviations
375 * of each other
376 * @param enabled Enabled
377 */
378 void set_temporal_enabled(bool enabled) {
379 return tof_processing_config_set_temporal_enabled(this->ptr_, enabled, TOF_ERROR_HANDLER{});
380 }
381
382 /** Get the number of standard deviations before resetting the running
383 * average
384 * @return The standard deviation
385 */
386 double get_temporal_sigma() const {
387 return tof_processing_config_get_temporal_sigma(this->ptr_, TOF_ERROR_HANDLER{});
388 }
389
390 /** Set the number of standard deviations before resetting the running
391 * average
392 * @param sigma The standard deviation
393 */
394 void set_temporal_sigma(double sigma) {
395 return tof_processing_config_set_temporal_sigma(this->ptr_, sigma, TOF_ERROR_HANDLER{});
396 }
397
398 /** Get the maximum number of frames to average together
399 * @return Number of frames
400 */
401 size_t get_temporal_nframes() const {
402 return tof_processing_config_get_temporal_nframes(this->ptr_, TOF_ERROR_HANDLER{});
403 }
404
405 /** Set the maximum number of frames to average together
406 * @param nframes Number of frames
407 */
408 void set_temporal_nframes(size_t nframes) {
409 return tof_processing_config_set_temporal_nframes(this->ptr_, nframes, TOF_ERROR_HANDLER{});
410 }
411
412 /** Get whether the gaussian blur is enabled. This is a standard gaussian blur
413 * applied over the depth image
414 * @return Enabled
415 */
416 bool get_gaussian_enabled() const {
417 return tof_processing_config_get_gaussian_enabled(this->ptr_, TOF_ERROR_HANDLER{});
418 }
419
420 /** Set whether the gaussian blur is enabled. This is a standard gaussian blur
421 * applied over the depth image
422 * @param enabled Enabled
423 */
424 void set_gaussian_enabled(bool enabled) {
425 return tof_processing_config_set_gaussian_enabled(this->ptr_, enabled, TOF_ERROR_HANDLER{});
426 }
427
428 /** Get the gaussian region size
429 * @return Region size, 3x3 and 5x5 are supported
430 */
431 size_t get_gaussian_size() const {
432 return tof_processing_config_get_gaussian_size(this->ptr_, TOF_ERROR_HANDLER{});
433 }
434
435 /** Set the gaussian region size
436 * @param size Region size, 3x3 and 5x5 are supported
437 */
438 void set_gaussian_size(size_t size) {
439 return tof_processing_config_set_gaussian_size(this->ptr_, size, TOF_ERROR_HANDLER{});
440 }
441
442 /** Get the gaussian sigma
443 * @return The standard deviation
444 */
445 double get_gaussian_sigma() const {
446 return tof_processing_config_get_gaussian_sigma(this->ptr_, TOF_ERROR_HANDLER{});
447 }
448
449 /** Set the gaussian sigma
450 * @param sigma The standard deviation
451 */
452 void set_gaussian_sigma(double sigma) {
453 return tof_processing_config_set_gaussian_sigma(this->ptr_, sigma, TOF_ERROR_HANDLER{});
454 }
455
456 /** Get whether the median filter is enabled. This is a standard median filter
457 * applied over the depth image
458 * @return Enabled
459 */
460 bool get_median_enabled() const {
461 return tof_processing_config_get_median_enabled(this->ptr_, TOF_ERROR_HANDLER{});
462 }
463
464 /** Set whether the median filter is enabled. This is a standard median filter
465 * applied over the depth image
466 * @param enabled Enabled
467 */
468 void set_median_enabled(bool enabled) {
469 return tof_processing_config_set_median_enabled(this->ptr_, enabled, TOF_ERROR_HANDLER{});
470 }
471
472 /** Get the median region size
473 * @return Region size, 3x3 and 5x5 are supported
474 */
475 size_t get_median_size() const {
476 return tof_processing_config_get_median_size(this->ptr_, TOF_ERROR_HANDLER{});
477 }
478
479 /** Set the median region size
480 * @param size Region size, 3x3 and 5x5 are supported
481 */
482 void set_median_size(size_t size) {
483 return tof_processing_config_set_median_size(this->ptr_, size, TOF_ERROR_HANDLER{});
484 }
485
486 /** Get whether the bilateral filter is enabled. This filter averages the
487 * current pixel with neighboring ones if they're within the specified
488 * standard deviation
489 * @return Enabled
490 */
492 return tof_processing_config_get_bilateral_enabled(this->ptr_, TOF_ERROR_HANDLER{});
493 }
494
495 /** Set whether the bilateral filter is enabled. This filter averages the
496 * current pixel with neighboring ones if they're within the specified
497 * standard deviation
498 * @param enabled Enabled
499 */
500 void set_bilateral_enabled(bool enabled) {
501 return tof_processing_config_set_bilateral_enabled(this->ptr_, enabled, TOF_ERROR_HANDLER{});
502 }
503
504 /** Get the bilateral region size
505 * @return Region size, 3x3 and 5x5 are supported
506 */
507 size_t get_bilateral_size() const {
508 return tof_processing_config_get_bilateral_size(this->ptr_, TOF_ERROR_HANDLER{});
509 }
510
511 /** Set the bilateral region size
512 * @param size Region size, 3x3 and 5x5 are supported
513 */
514 void set_bilateral_size(size_t size) {
515 return tof_processing_config_set_bilateral_size(this->ptr_, size, TOF_ERROR_HANDLER{});
516 }
517
518 /** Get the bilateral standard deviation
519 * @return The standard deviation
520 */
521 double get_bilateral_sigma() const {
522 return tof_processing_config_get_bilateral_sigma(this->ptr_, TOF_ERROR_HANDLER{});
523 }
524
525 /** Set the bilateral standard deviation
526 * @param sigma The standard deviation
527 */
528 void set_bilateral_sigma(double sigma) {
529 return tof_processing_config_set_bilateral_sigma(this->ptr_, sigma, TOF_ERROR_HANDLER{});
530 }
531
532 /** Get Whether the local means filter is enabled.
533 * @return Enabled
534 */
536 return tof_processing_config_get_local_means_enabled(this->ptr_, TOF_ERROR_HANDLER{});
537 }
538
539 /** Set Whether the local means filter is enabled.
540 * @param enabled Enabled
541 */
542 void set_local_means_enabled(bool enabled) {
543 return tof_processing_config_set_local_means_enabled(this->ptr_, enabled, TOF_ERROR_HANDLER{});
544 }
545
546 /** Get The local means region size
547 * @return Region size
548 */
549 size_t get_local_means_size() const {
550 return tof_processing_config_get_local_means_size(this->ptr_, TOF_ERROR_HANDLER{});
551 }
552
553 /** Set The local means region size
554 * @param size Region size
555 */
556 void set_local_means_size(size_t size) {
557 return tof_processing_config_set_local_means_size(this->ptr_, size, TOF_ERROR_HANDLER{});
558 }
559
560 /** Get The local means standard deviation for how close values are
561 * @return The stand deviation
562 */
563 double get_local_means_sigma() const {
564 return tof_processing_config_get_local_means_sigma(this->ptr_, TOF_ERROR_HANDLER{});
565 }
566
567 /** Set The local means standard deviation for how close values are
568 * @param sigma The stand deviation
569 */
570 void set_local_means_sigma(double sigma) {
571 return tof_processing_config_set_local_means_sigma(this->ptr_, sigma, TOF_ERROR_HANDLER{});
572 }
573
574 /** Get whether flying pixel filter is enabled. The flying pixel filters out
575 * pixels when more than x edges are farther than x size away
576 * @return Enabled
577 */
578 bool get_flying_enabled() const {
579 return tof_processing_config_get_flying_enabled(this->ptr_, TOF_ERROR_HANDLER{});
580 }
581
582 /** Set whether flying pixel filter is enabled. The flying pixel filters out
583 * pixels when more than x edges are farther than x size away
584 * @param enabled Enabled
585 */
586 void set_flying_enabled(bool enabled) {
587 return tof_processing_config_set_flying_enabled(this->ptr_, enabled, TOF_ERROR_HANDLER{});
588 }
589
590 /** Get the shape of which surrounding pixels are checked
591 * @return The shape
592 */
593 FlyingShape get_flying_shape() const {
594 return static_cast<FlyingShape>(tof_processing_config_get_flying_shape(this->ptr_, TOF_ERROR_HANDLER{}));
595 }
596
597 /** Set the shape of which surrounding pixels are checked
598 * @param shape The shape
599 */
600 void set_flying_shape(FlyingShape shape) {
601 return tof_processing_config_set_flying_shape(this->ptr_, static_cast<tof_flying_shape>(shape), TOF_ERROR_HANDLER{});
602 }
603
604 /** Get the maximum distance allowed between surrounding pixels
605 * @return Maximum distance
606 */
607 size_t get_flying_distance() const {
608 return tof_processing_config_get_flying_distance(this->ptr_, TOF_ERROR_HANDLER{});
609 }
610
611 /** Set the maximum distance allowed between surrounding pixels
612 * @param distance Maximum distance
613 */
614 void set_flying_distance(size_t distance) {
615 return tof_processing_config_set_flying_distance(this->ptr_, distance, TOF_ERROR_HANDLER{});
616 }
617
618 /** Get the number of edges allowed to be larger than maximum distance
619 * @return Maximum edges
620 */
621 size_t get_flying_edges() const {
622 return tof_processing_config_get_flying_edges(this->ptr_, TOF_ERROR_HANDLER{});
623 }
624
625 /** Set the number of edges allowed to be larger than maximum distance
626 * @param edges Maximum edges
627 */
628 void set_flying_edges(size_t edges) {
629 return tof_processing_config_set_flying_edges(this->ptr_, edges, TOF_ERROR_HANDLER{});
630 }
631
632 /** Get whether the amplitude threshold filter is enabled. This filter filters
633 * out pixels outside of the specified values
634 * @return Enabled
635 */
637 return tof_processing_config_get_amp_threshold_enabled(this->ptr_, TOF_ERROR_HANDLER{});
638 }
639
640 /** Set whether the amplitude threshold filter is enabled. This filter filters
641 * out pixels outside of the specified values
642 * @param enabled Enabled
643 */
644 void set_amp_threshold_enabled(bool enabled) {
645 return tof_processing_config_set_amp_threshold_enabled(this->ptr_, enabled, TOF_ERROR_HANDLER{});
646 }
647
648 /** Get the minimum amplitude allowed
649 * @return Minimum value
650 */
651 double get_amp_threshold_min() const {
652 return tof_processing_config_get_amp_threshold_min(this->ptr_, TOF_ERROR_HANDLER{});
653 }
654
655 /** Set the minimum amplitude allowed
656 * @param min Minimum value
657 */
658 void set_amp_threshold_min(double min) {
659 return tof_processing_config_set_amp_threshold_min(this->ptr_, min, TOF_ERROR_HANDLER{});
660 }
661
662 /** Get the maximum amplitude allowed
663 * @return Maximum value
664 */
665 double get_amp_threshold_max() const {
666 return tof_processing_config_get_amp_threshold_max(this->ptr_, TOF_ERROR_HANDLER{});
667 }
668
669 /** Set the maximum amplitude allowed
670 * @param max Maximum value
671 */
672 void set_amp_threshold_max(double max) {
673 return tof_processing_config_set_amp_threshold_max(this->ptr_, max, TOF_ERROR_HANDLER{});
674 }
675
676 /** Get whether the distance threshold filter is enabled. This filter filters
677 * out pixels outside of the specified values
678 * @return Enabled
679 */
681 return tof_processing_config_get_dist_threshold_enabled(this->ptr_, TOF_ERROR_HANDLER{});
682 }
683
684 /** Set whether the distance threshold filter is enabled. This filter filters
685 * out pixels outside of the specified values
686 * @param enabled Enabled
687 */
688 void set_dist_threshold_enabled(bool enabled) {
689 return tof_processing_config_set_dist_threshold_enabled(this->ptr_, enabled, TOF_ERROR_HANDLER{});
690 }
691
692 /** Get the minimum distance allowed
693 * @return Minimum value
694 */
695 double get_dist_threshold_min() const {
696 return tof_processing_config_get_dist_threshold_min(this->ptr_, TOF_ERROR_HANDLER{});
697 }
698
699 /** Set the minimum distance allowed
700 * @param min Minimum value
701 */
702 void set_dist_threshold_min(double min) {
703 return tof_processing_config_set_dist_threshold_min(this->ptr_, min, TOF_ERROR_HANDLER{});
704 }
705
706 /** Get the maximum distance allowed
707 * @return Maximum value
708 */
709 double get_dist_threshold_max() const {
710 return tof_processing_config_get_dist_threshold_max(this->ptr_, TOF_ERROR_HANDLER{});
711 }
712
713 /** Set the maximum distance allowed
714 * @param max Maximum value
715 */
716 void set_dist_threshold_max(double max) {
717 return tof_processing_config_set_dist_threshold_max(this->ptr_, max, TOF_ERROR_HANDLER{});
718 }
719
720 /** Get how much to scale the radial value by
721 * @return Radial scale
722 */
723 float get_radial_scale() const {
724 return tof_processing_config_get_radial_scale(this->ptr_, TOF_ERROR_HANDLER{});
725 }
726
727 /** Set how much to scale the radial value by
728 * @param scale Radial scale
729 */
730 void set_radial_scale(float scale) {
731 return tof_processing_config_set_radial_scale(this->ptr_, scale, TOF_ERROR_HANDLER{});
732 }
733
734 /** Get how much to add to the radial value
735 * @return Radial addition
736 */
737 float get_radial_add() const {
738 return tof_processing_config_get_radial_add(this->ptr_, TOF_ERROR_HANDLER{});
739 }
740
741 /** Set how much to add to the radial value
742 * @param addition Radial addition
743 */
744 void set_radial_add(float addition) {
745 return tof_processing_config_set_radial_add(this->ptr_, addition, TOF_ERROR_HANDLER{});
746 }
747
748 /** Get how much to scale the intensity value by
749 * @return Intensity scale
750 */
751 float get_intensity_scale() const {
752 return tof_processing_config_get_intensity_scale(this->ptr_, TOF_ERROR_HANDLER{});
753 }
754
755 /** Set how much to scale the intensity value by
756 * @param scale Intensity scale
757 */
758 void set_intensity_scale(float scale) {
759 return tof_processing_config_set_intensity_scale(this->ptr_, scale, TOF_ERROR_HANDLER{});
760 }
761
762 /** Get how much to add to the intensity value
763 * @return Intensity addition
764 */
765 float get_intensity_add() const {
766 return tof_processing_config_get_intensity_add(this->ptr_, TOF_ERROR_HANDLER{});
767 }
768
769 /** Set how much to add to the intensity value
770 * @param addition Intensity addition
771 */
772 void set_intensity_add(float addition) {
773 return tof_processing_config_set_intensity_add(this->ptr_, addition, TOF_ERROR_HANDLER{});
774 }
775
776 /** Get the characterization addition component. The characterization function
777 * computes the sigma for the temporal and bilateral filter
778 * @return addition
779 */
780 double get_char_add() const {
781 return tof_processing_config_get_char_add(this->ptr_, TOF_ERROR_HANDLER{});
782 }
783
784 /** Set the characterization addition component. The characterization function
785 * computes the sigma for the temporal and bilateral filter
786 * @param addition addition
787 */
788 void set_char_add(double addition) {
789 return tof_processing_config_set_char_add(this->ptr_, addition, TOF_ERROR_HANDLER{});
790 }
791
792 /** Get the characterization multiplication component. The characterization
793 * function computes the sigma for the temporal and bilateral filter
794 * @return Multiplication
795 */
796 double get_char_mult() const {
797 return tof_processing_config_get_char_mult(this->ptr_, TOF_ERROR_HANDLER{});
798 }
799
800 /** Set the characterization multiplication component. The characterization
801 * function computes the sigma for the temporal and bilateral filter
802 * @param multiplication Multiplication
803 */
804 void set_char_mult(double multiplication) {
805 return tof_processing_config_set_char_mult(this->ptr_, multiplication, TOF_ERROR_HANDLER{});
806 }
807
808 /** Get whether software binning is enabled
809 * @return Enabled
810 */
811 bool get_binning_enabled() const {
812 return tof_processing_config_get_binning_enabled(this->ptr_, TOF_ERROR_HANDLER{});
813 }
814
815 /** Set whether software binning is enabled
816 * @param enabled Enabled
817 */
818 void set_binning_enabled(bool enabled) {
819 return tof_processing_config_set_binning_enabled(this->ptr_, enabled, TOF_ERROR_HANDLER{});
820 }
821
822 /** Get the size of the area to bin, 2 would bin a 2x2 area
823 * @return The bin size
824 */
825 size_t get_binning_size() const {
826 return tof_processing_config_get_binning_size(this->ptr_, TOF_ERROR_HANDLER{});
827 }
828
829 /** Set the size of the area to bin, 2 would bin a 2x2 area
830 * @param size The bin size
831 */
832 void set_binning_size(size_t size) {
833 return tof_processing_config_set_binning_size(this->ptr_, size, TOF_ERROR_HANDLER{});
834 }
835
836 /** Get the binning mode to use
837 * @return The binning mode
838 */
839 BinningMode get_binning_mode() const {
840 return static_cast<BinningMode>(tof_processing_config_get_binning_mode(this->ptr_, TOF_ERROR_HANDLER{}));
841 }
842
843 /** Set the binning mode to use
844 * @param mode The binning mode
845 */
846 void set_binning_mode(BinningMode mode) {
847 return tof_processing_config_set_binning_mode(this->ptr_, static_cast<tof_binning_mode>(mode), TOF_ERROR_HANDLER{});
848 }
849
850 /** Get The maximum standard deviation to use, only used in the smart binning
851 * mode
852 * @return The standard deviation
853 */
854 float get_binning_sigma() const {
855 return tof_processing_config_get_binning_sigma(this->ptr_, TOF_ERROR_HANDLER{});
856 }
857
858 /** Set The maximum standard deviation to use, only used in the smart binning
859 * mode
860 * @param sigma The standard deviation
861 */
862 void set_binning_sigma(float sigma) {
863 return tof_processing_config_set_binning_sigma(this->ptr_, sigma, TOF_ERROR_HANDLER{});
864 }
865
866 /** Get the dimension of the xyz output
867 * @return The dimension
868 */
869 XyzDimension get_xyz_dimension() const {
870 return static_cast<XyzDimension>(tof_processing_config_get_xyz_dimension(this->ptr_, TOF_ERROR_HANDLER{}));
871 }
872
873 /** Set the dimension of the xyz output
874 * @param dimension The dimension
875 */
876 void set_xyz_dimension(XyzDimension dimension) {
877 return tof_processing_config_set_xyz_dimension(this->ptr_, static_cast<tof_xyz_dimension>(dimension), TOF_ERROR_HANDLER{});
878 }
879
880 /** Get whether rigid transformation is enabled
881 * @return Enabled
882 */
884 return tof_processing_config_get_rigid_transformation_enabled(this->ptr_, TOF_ERROR_HANDLER{});
885 }
886
887 /** Set whether rigid transformation is enabled
888 * @param enabled Enabled
889 */
891 return tof_processing_config_set_rigid_transformation_enabled(this->ptr_, enabled, TOF_ERROR_HANDLER{});
892 }
893
894 /** Get the rigid transformation 4x4 matrix
895 * @return 4x4 transformation matrix
896 */
897 std::array<float, 16> get_rigid_transformation_matrix() const {
898 std::array<float, 16> array;
899 auto data = tof_processing_config_get_rigid_transformation_matrix(this->ptr_, TOF_ERROR_HANDLER{});
900 std::copy(data, data + array.size(), array.data());
901 return array;
902 }
903
904 /** Set the rigid transformation 4x4 matrix
905 * @param matrix 4x4 transformation matrix
906 */
907 void set_rigid_transformation_matrix(const std::array<float, 16> &matrix) {
908 return tof_processing_config_set_rigid_transformation_matrix(this->ptr_, matrix.data(), TOF_ERROR_HANDLER{});
909 }
910
911};
912
913} // tof
914} // chronoptics
915
916#endif
Processing that can be done.
void set_mixed_pixel_max_error_3f(double max_error_3f)
Set the maximum error when using three modulation frequencies.
size_t get_average_nframes() const
Get the number of frames to average together.
void set_bilateral_size(size_t size)
Set the bilateral region size.
void set_mixed_pixel_enabled(bool enabled)
Set wether mixed pixel is enabled.
size_t get_flying_edges() const
Get the number of edges allowed to be larger than maximum distance.
double get_bilateral_sigma() const
Get the bilateral standard deviation.
void set_hdr_enabled(bool enabled)
Set whether hdr is enabled.
bool get_phase_unwrapping_enabled() const
Get whether phase unwrapping is enabled.
double get_mixed_pixel_adaptive_amp_min() const
Get the minimum amplitude for adaptive sorting.
bool get_hdr_enabled() const
Get whether hdr is enabled.
void set_rigid_transformation_matrix(const std::array< float, 16 > &matrix)
Set the rigid transformation 4x4 matrix.
void set_temporal_nframes(size_t nframes)
Set the maximum number of frames to average together.
bool get_binning_enabled() const
Get whether software binning is enabled.
void set_amp_threshold_enabled(bool enabled)
Set whether the amplitude threshold filter is enabled.
bool get_mixed_pixel_enabled() const
Get wether mixed pixel is enabled.
float get_intensity_add() const
Get how much to add to the intensity value.
double get_mixed_pixel_aggressor_threshold() const
Get the threshold to classify a pixel as an aggressor.
bool get_gpu() const
Get whether processing on the gpu is enabled.
FlyingShape get_flying_shape() const
Get the shape of which surrounding pixels are checked.
float get_radial_add() const
Get how much to add to the radial value.
double get_mixed_pixel_aratio_min() const
Get the minimum return amplitude ratio for adaptive sorting.
std::array< float, 16 > get_rigid_transformation_matrix() const
Get the rigid transformation 4x4 matrix.
void set_temporal_sigma(double sigma)
Set the number of standard deviations before resetting the running average.
double get_temporal_sigma() const
Get the number of standard deviations before resetting the running average.
void set_binning_sigma(float sigma)
Set The maximum standard deviation to use, only used in the smart binning mode.
void set_mixed_pixel_min_aggressor_size(int32_t size)
Set the minimum amount of bright pixels before a bright spot is classified as an aggressor.
bool get_local_means_enabled() const
Get Whether the local means filter is enabled.
void set_local_means_size(size_t size)
Set The local means region size.
void set_gaussian_sigma(double sigma)
Set the gaussian sigma.
void set_average_nframes(size_t nframes)
Set the number of frames to average together.
ProcessingConfig()
Create default processing config.
float get_intensity_scale() const
Get how much to scale the intensity value by.
double get_char_mult() const
Get the characterization multiplication component.
void set_binning_enabled(bool enabled)
Set whether software binning is enabled.
bool get_rigid_transformation_enabled() const
Get whether rigid transformation is enabled.
void set_mixed_pixel_sort_mode(MpSortMode sort_mode)
Set what output is selected.
double get_gaussian_sigma() const
Get the gaussian sigma.
void set_mixed_pixel_aggressor_phi_offset(double aggressor_phi_offset)
Set The maximum phase difference before a return is not classified as aggressor.
double get_mixed_pixel_aggressor_phi_offset() const
Get The maximum phase difference before a return is not classified as aggressor.
double get_mixed_pixel_adaptive_amp_max() const
Get the maximum amplitude for adaptive sorting.
double get_mixed_pixel_aratio() const
Get the amplitude ratio for detecting MPI.
void set_radial_add(float addition)
Set how much to add to the radial value.
size_t get_gaussian_size() const
Get the gaussian region size.
bool get_flying_enabled() const
Get whether flying pixel filter is enabled.
void set_amp_threshold_max(double max)
Set the maximum amplitude allowed.
void set_char_add(double addition)
Set the characterization addition component.
void set_flying_enabled(bool enabled)
Set whether flying pixel filter is enabled.
void set_char_mult(double multiplication)
Set the characterization multiplication component.
void set_flying_edges(size_t edges)
Set the number of edges allowed to be larger than maximum distance.
double get_phase_unwrapping_max_offset() const
Get The maximum distance between ideal location and actual.
void set_flying_distance(size_t distance)
Set the maximum distance allowed between surrounding pixels.
bool get_temporal_enabled() const
Get whether the temporal filter is enabled.
void set_binning_size(size_t size)
Set the size of the area to bin, 2 would bin a 2x2 area.
bool get_bilateral_enabled() const
Get whether the bilateral filter is enabled.
size_t get_local_means_size() const
Get The local means region size.
float get_binning_sigma() const
Get The maximum standard deviation to use, only used in the smart binning mode.
bool get_median_enabled() const
Get whether the median filter is enabled.
bool get_amp_threshold_enabled() const
Get whether the amplitude threshold filter is enabled.
void set_amp_threshold_min(double min)
Set the minimum amplitude allowed.
void set_median_enabled(bool enabled)
Set whether the median filter is enabled.
void set_mixed_pixel_aggressor_threshold(double threshold)
Set the threshold to classify a pixel as an aggressor.
void set_phase_unwrapping_enabled(bool enabled)
Set whether phase unwrapping is enabled.
void set_rigid_transformation_enabled(bool enabled)
Set whether rigid transformation is enabled.
MpSortMode get_mixed_pixel_sort_mode() const
Get what output is selected.
BinningMode get_binning_mode() const
Get the binning mode to use.
void set_gaussian_size(size_t size)
Set the gaussian region size.
int32_t get_mixed_pixel_min_aggressor_size() const
Get the minimum amount of bright pixels before a bright spot is classified as an aggressor.
double get_mixed_pixel_max_error_3f() const
Get the maximum error when using three modulation frequencies.
void set_mixed_pixel_aratio_min(double aratio_min)
Set the minimum return amplitude ratio for adaptive sorting.
void set_local_means_sigma(double sigma)
Set The local means standard deviation for how close values are.
void write(StringView file_location) const
Write processing config to disk.
void set_intensity_scale(float scale)
Set how much to scale the intensity value by.
void set_mixed_pixel_phi_diff(double phi_diff)
Set the phase difference for detecting MPI.
bool get_calibration_enabled() const
Get whether the calibration is applied.
void set_temporal_enabled(bool enabled)
Set whether the temporal filter is enabled.
void set_local_means_enabled(bool enabled)
Set Whether the local means filter is enabled.
size_t get_binning_size() const
Get the size of the area to bin, 2 would bin a 2x2 area.
void set_calibration_enabled(bool enabled)
Set whether the calibration is applied.
double get_mixed_pixel_amp_min() const
Get minimum amplitude that pixel needs to have to apply mixed pixel to it.
void set_xyz_dimension(XyzDimension dimension)
Set the dimension of the xyz output.
bool get_average_enabled() const
Get whether averaging is enabled.
void set_radial_scale(float scale)
Set how much to scale the radial value by.
void set_mixed_pixel_amp_min(double amp_min)
Set minimum amplitude that pixel needs to have to apply mixed pixel to it.
void set_phase_unwrapping_max_offset(double max_offset)
Set The maximum distance between ideal location and actual.
void set_dist_threshold_enabled(bool enabled)
Set whether the distance threshold filter is enabled.
double get_dist_threshold_max() const
Get the maximum distance allowed.
XyzDimension get_xyz_dimension() const
Get the dimension of the xyz output.
void set_mixed_pixel_adaptive_amp_max(double adaptive_amp_max)
Set the maximum amplitude for adaptive sorting.
bool get_gaussian_enabled() const
Get whether the gaussian blur is enabled.
size_t get_flying_distance() const
Get the maximum distance allowed between surrounding pixels.
const char * get_mixed_pixel_lut_file() const
Get location of the mixed pixel look up table file.
void set_mixed_pixel_aratio(double aratio)
Set the amplitude ratio for detecting MPI.
ProcessingConfig(StringView file_location)
Load processing config from disk.
bool get_dist_threshold_enabled() const
Get whether the distance threshold filter is enabled.
void set_dist_threshold_min(double min)
Set the minimum distance allowed.
double get_amp_threshold_max() const
Get the maximum amplitude allowed.
double get_local_means_sigma() const
Get The local means standard deviation for how close values are.
void set_median_size(size_t size)
Set the median region size.
void set_mixed_pixel_adaptive_amp_min(double adaptive_amp_min)
Set the minimum amplitude for adaptive sorting.
void set_mixed_pixel_lut_file(StringView file_location)
Set location of the mixed pixel look up table file.
void set_intensity_add(float addition)
Set how much to add to the intensity value.
void set_gpu(bool gpu)
Set whether processing on the gpu is enabled.
void set_dist_threshold_max(double max)
Set the maximum distance allowed.
void set_flying_shape(FlyingShape shape)
Set the shape of which surrounding pixels are checked.
ProcessingConfig(tof_processing_config_t ptr)
Construct from pointer.
double get_amp_threshold_min() const
Get the minimum amplitude allowed.
void set_binning_mode(BinningMode mode)
Set the binning mode to use.
void set_average_enabled(bool enabled)
Set whether averaging is enabled.
void set_bilateral_enabled(bool enabled)
Set whether the bilateral filter is enabled.
double get_mixed_pixel_phi_diff() const
Get the phase difference for detecting MPI.
float get_radial_scale() const
Get how much to scale the radial value by.
double get_char_add() const
Get the characterization addition component.
void set_bilateral_sigma(double sigma)
Set the bilateral standard deviation.
size_t get_median_size() const
Get the median region size.
void set_gaussian_enabled(bool enabled)
Set whether the gaussian blur is enabled.
double get_dist_threshold_min() const
Get the minimum distance allowed.
size_t get_temporal_nframes() const
Get the maximum number of frames to average together.
size_t get_bilateral_size() const
Get the bilateral region size.