AFBR-S50 API Reference Manual  v1.6.5
AFBR-S50 Time-of-Flight Sensor SDK for Embedded Software
argus_pba.h
Go to the documentation of this file.
1 /*************************************************************************/
38 #ifndef ARGUS_PBA_H
39 #define ARGUS_PBA_H
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44 /*!***************************************************************************
45  * @defgroup argus_pba Pixel Binning Algorithm
46  * @ingroup argus_api
47  *
48  * @brief Pixel Binning Algorithm (PBA) parameter definitions and API functions.
49  *
50  * @details Defines the generic Pixel Binning Algorithm (PBA) setup parameters
51  * and data structure.
52  *
53  * The PBA module contains filter algorithms that determine the
54  * pixels with the best signal quality and extract an 1D distance
55  * information from the filtered pixels by averaging them in a
56  * specified way.
57  *
58  * Basically, the Pixel Binning Algorithm is a multi-stage filter:
59  *
60  * -# A fixed pre-filter mask is applied to statically disable
61  * specified pixels.
62  *
63  * -# A relative and absolute amplitude filter is applied in the
64  * second stage. The relative filter is determined by a ratio
65  * of the maximum amplitude off all available (i.e. not filtered
66  * in stage 1) pixels. Pixels that have an amplitude below the
67  * relative threshold are dismissed. The same holds true for
68  * the absolute amplitude threshold. All pixel with smaller
69  * amplitude are dismissed.\n
70  * Note that the absolute amplitude threshold is disabled if
71  * the Golden Pixel (see below) is also disabled in order to
72  * prevent invalid filtering for multi-pixel devices.\n
73  * The relative threshold is useful to setup a distance
74  * measurement scenario. All well illuminated pixels are
75  * selected and considered for the final 1D distance. The
76  * absolute threshold is used to dismiss pixels that are below
77  * the noise level. The latter would be considered for the 1D
78  * result if the maximum amplitude is already very low.\n
79  * Those threshold are implemented using a hysteresis behavior.
80  * For its configuration, see the following parameters:
81  * - #argus_cfg_pba_t::RelativeAmplitudeInclusion
82  * - #argus_cfg_pba_t::RelativeAmplitudeExclusion
83  * - #argus_cfg_pba_t::AbsoluteAmplitudeInclusion
84  * - #argus_cfg_pba_t::AbsoluteAmplitudeExclusion
85  * .
86  *
87  * -# An absolute minimum distance filter is applied in addition
88  * to the amplitude filter. This removes all pixel that have
89  * a lower distance than the specified threshold. This is used
90  * to remove invalid pixels that can be detected by a physically
91  * not correct negative distance.\n
92  * For its configuration, see the following parameters:
93  * - #PBA_ENABLE_MIN_DIST_SCOPE
94  * - #argus_cfg_pba_t::AbsoluteDistanceScopeInclusion
95  * - #argus_cfg_pba_t::AbsoluteDistanceScopeExclusion
96  * - #argus_cfg_pba_t::RelativeDistanceScopeInclusion
97  * - #argus_cfg_pba_t::RelativeDistanceScopeExclusion
98  * .
99  *
100  * -# A distance filter is used to distinguish pixels that target
101  * the actual object from pixels that see the brighter background,
102  * e.g. white walls. Thus, the pixel with the minimum distance
103  * is referenced and all pixel that have a distance between
104  * the minimum and the given minimum distance scope are selected
105  * for the 1D distance result. The minimum distance scope is
106  * determined by an relative (to the current minimum distance)
107  * and an absolute value. The larger scope value is the
108  * relevant one, i.e. the relative distance scope can be used
109  * to heed the increasing noise at larger distances.\n
110  * For its configuration, see the following parameters:
111  * - #argus_cfg_pba_t::AbsoluteMinimumDistanceThreshold
112  * .
113  *
114  * -# If all of the above filters fail to determine a single valid
115  * pixel, the Golden Pixel is used as a fallback value. The
116  * Golden Pixel is the pixel that sits right at the focus point
117  * of the optics at large distances. Thus, it is expected to
118  * have the best signal at large distances.\n
119  * For its configuration, see the following parameters:
120  * - #PBA_ENABLE_GOLDPX_FALLBACK_MODE
121  * .
122  *
123  * -# In order to avoid unwanted effects from "out-of-focus" pixels
124  * in application that require a smaller focus, the Golden Pixel
125  * Priority Mode prioritizes a valid signal on the central
126  * Golden Pixel over other pixels. That is, while the Golden
127  * Pixel has a reasonable signal strength, it is the only pixel
128  * considered for the 1D result.\n
129  * For its configuration, see the following parameters:
130  * - #PBA_ENABLE_GOLDPX_FALLBACK_MODE
131  * - #argus_cfg_pba_t::GoldenPixelPriorityAmplitudeInclusion
132  * - #argus_cfg_pba_t::GoldenPixelPriorityAmplitudeExclusion
133  * .
134  *
135  * After filtering is done, there may be more than a single pixel
136  * left to determine the 1D signal. Therefore several averaging
137  * methods are implemented to obtain the best 1D result from many
138  * pixels. See #argus_pba_averaging_mode_t for details.
139  *
140  *
141  * @addtogroup argus_pba
142  * @{
143  *****************************************************************************/
144 
145 #include "argus_def.h"
146 
147 /*!***************************************************************************
148  * @brief Enable flags for the pixel binning algorithm.
149  *
150  * @details Determines the pixel binning algorithm feature enable status.
151  *
152  * - [0]: #PBA_ENABLE: Enables the pixel binning feature.
153  * - [1]: reserved
154  * - [2]: reserved
155  * - [3]: reserved
156  * - [4]: #PBA_ENABLE_GOLDPX_PRIORITY_MODE: Enables the Golden Pixel
157  * priority mode feature.
158  * - [5]: #PBA_ENABLE_GOLDPX_FALLBACK_MODE: Enables the Golden Pixel
159  * fallback mode feature.
160  * - [6]: #PBA_ENABLE_MIN_DIST_SCOPE: Enables the minimum distance
161  * scope feature.
162  * - [7]: reserved
163  * .
164  *****************************************************************************/
165 typedef enum argus_pba_flags_t
166 {
168  PBA_ENABLE = 1U << 0U,
169 
174 
181 
184 
186 
187 /*!***************************************************************************
188  * @brief The averaging modes for the pixel binning algorithm.
189  *****************************************************************************/
191 {
195 
200 
202 
203 /*!***************************************************************************
204  * @brief The pixel binning algorithm settings data structure.
205  * @details Describes the pixel binning algorithm settings.
206  *****************************************************************************/
207 typedef struct
208 {
214 
220 
247 
274 
305 
336 
357 
378 
403 
428 
452 
476 
493 
507 
512 
523  uint32_t PrefilterMask;
524 
526 
528 #ifdef __cplusplus
529 } // extern "C"
530 #endif
531 #endif /* ARGUS_PBA_H */
argus_cfg_pba_t::RelativeDistanceScopeInclusion
uq0_8_t RelativeDistanceScopeInclusion
Definition: argus_pba.h:402
argus_cfg_pba_t::Enabled
argus_pba_flags_t Enabled
Definition: argus_pba.h:213
argus_cfg_pba_t::AbsoluteDistanceScopeExclusion
uq1_15_t AbsoluteDistanceScopeExclusion
Definition: argus_pba.h:475
PBA_ENABLE_GOLDPX_FALLBACK_MODE
@ PBA_ENABLE_GOLDPX_FALLBACK_MODE
Definition: argus_pba.h:180
uq0_8_t
uint8_t uq0_8_t
Unsigned fixed point number: UQ0.8.
Definition: fp_def.h:162
PBA_SIMPLE_AVG
@ PBA_SIMPLE_AVG
Definition: argus_pba.h:194
argus_def.h
This file is part of the AFBR-S50 hardware API.
uq12_4_t
uint16_t uq12_4_t
Unsigned fixed point number: UQ12.4.
Definition: fp_def.h:231
q9_22_t
int32_t q9_22_t
Signed fixed point number: Q9.22.
Definition: fp_def.h:538
PBA_ENABLE_MIN_DIST_SCOPE
@ PBA_ENABLE_MIN_DIST_SCOPE
Definition: argus_pba.h:183
PBA_ENABLE_GOLDPX_PRIORITY_MODE
@ PBA_ENABLE_GOLDPX_PRIORITY_MODE
Definition: argus_pba.h:173
argus_cfg_pba_t::GoldenPixelOutOfSyncAgeThreshold
uint8_t GoldenPixelOutOfSyncAgeThreshold
Definition: argus_pba.h:506
argus_cfg_pba_t::RelativeAmplitudeExclusion
uq0_8_t RelativeAmplitudeExclusion
Definition: argus_pba.h:273
argus_cfg_pba_t::AbsoluteDistanceScopeInclusion
uq1_15_t AbsoluteDistanceScopeInclusion
Definition: argus_pba.h:451
PBA_LINEAR_AMPLITUDE_WEIGHTED_AVG
@ PBA_LINEAR_AMPLITUDE_WEIGHTED_AVG
Definition: argus_pba.h:199
argus_cfg_pba_t::GoldenPixelPriorityAmplitudeInclusion
uq12_4_t GoldenPixelPriorityAmplitudeInclusion
Definition: argus_pba.h:356
argus_cfg_pba_t::RelativeDistanceScopeExclusion
uq0_8_t RelativeDistanceScopeExclusion
Definition: argus_pba.h:427
argus_cfg_pba_t::RelativeAmplitudeInclusion
uq0_8_t RelativeAmplitudeInclusion
Definition: argus_pba.h:246
argus_cfg_pba_t::GoldenPixelPriorityAmplitudeExclusion
uq12_4_t GoldenPixelPriorityAmplitudeExclusion
Definition: argus_pba.h:377
argus_pba_flags_t
argus_pba_flags_t
Enable flags for the pixel binning algorithm.
Definition: argus_pba.h:165
argus_cfg_pba_t::AbsoluteAmplitudeInclusion
uq12_4_t AbsoluteAmplitudeInclusion
Definition: argus_pba.h:304
argus_cfg_pba_t::GoldenPixelSaturationFilterPixelThreshold
uint8_t GoldenPixelSaturationFilterPixelThreshold
Definition: argus_pba.h:492
argus_cfg_pba_t::AveragingMode
argus_pba_averaging_mode_t AveragingMode
Definition: argus_pba.h:219
argus_cfg_pba_t::AbsoluteMinimumDistanceThreshold
q9_22_t AbsoluteMinimumDistanceThreshold
Definition: argus_pba.h:511
argus_cfg_pba_t::PrefilterMask
uint32_t PrefilterMask
Definition: argus_pba.h:523
PBA_ENABLE
@ PBA_ENABLE
Definition: argus_pba.h:168
argus_cfg_pba_t
The pixel binning algorithm settings data structure.
Definition: argus_pba.h:207
argus_cfg_pba_t::AbsoluteAmplitudeExclusion
uq12_4_t AbsoluteAmplitudeExclusion
Definition: argus_pba.h:335
argus_pba_averaging_mode_t
argus_pba_averaging_mode_t
The averaging modes for the pixel binning algorithm.
Definition: argus_pba.h:190
uq1_15_t
uint16_t uq1_15_t
Unsigned fixed point number: UQ1.15.
Definition: fp_def.h:271