algo.h
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2015 Intel Corporation. All Rights Reserved.
3 #pragma once
4 
5 #include "core/frame-holder.h"
6 #include "core/roi.h"
8 #include "float3.h"
9 
11 #include <stdint.h>
12 #include <vector>
13 #include <mutex>
14 #include <deque>
15 #include <cmath>
16 #include <memory>
17 
18 namespace librealsense
19 {
20  static const float ae_step_default_value = 0.5f;
21 
22  enum class auto_exposure_modes {
26  };
27 
29  {
30  public:
32  is_auto_exposure(true),
34  rate(60),
36  {}
37 
38  bool get_enable_auto_exposure() const;
40  unsigned get_auto_exposure_antiflicker_rate() const;
41  float get_auto_exposure_step() const;
42 
46  void set_auto_exposure_step(float value);
47 
48  static const unsigned sample_rate = 1;
49  static const unsigned skip_frames = 2;
50 
51  private:
54  unsigned rate;
55  float step;
56  };
57 
58 
60  public:
61  void modify_exposure(float& exposure_value, bool& exp_modified, float& gain_value, bool& gain_modified); // exposure_value in milliseconds
62  bool analyze_image(const frame_interface* image);
65  void update_roi(const region_of_interest& ae_roi);
66 
67  private:
69  enum class rounding_mode_type { round, ceil, floor };
70 
71  inline void im_hist(const uint8_t* data, const region_of_interest& image_roi, const int rowStep, int h[]);
72  void increase_exposure_target(float mult, float& target_exposure);
73  void decrease_exposure_target(float mult, float& target_exposure);
74  void increase_exposure_gain(const float& target_exposure, const float& target_exposure0, float& exposure, float& gain);
75  void decrease_exposure_gain(const float& target_exposure, const float& target_exposure0, float& exposure, float& gain);
76  void static_increase_exposure_gain(const float& target_exposure, const float& target_exposure0, float& exposure, float& gain);
77  void static_decrease_exposure_gain(const float& target_exposure, const float& target_exposure0, float& exposure, float& gain);
78  void anti_flicker_increase_exposure_gain(const float& target_exposure, const float& target_exposure0, float& exposure, float& gain);
79  void anti_flicker_decrease_exposure_gain(const float& target_exposure, const float& target_exposure0, float& exposure, float& gain);
80  void hybrid_increase_exposure_gain(const float& target_exposure, const float& target_exposure0, float& exposure, float& gain);
81  void hybrid_decrease_exposure_gain(const float& target_exposure, const float& target_exposure0, float& exposure, float& gain);
82 
83  #if defined(_WINDOWS) || defined(WIN32) || defined(WIN64)
84  inline float round(float x) { return std::round(x); }
85  #else
86  inline float round(float x) { return x < 0.0 ? std::ceil(x - 0.5f) : std::floor(x + 0.5f); }
87  #endif
88 
89  float exposure_to_value(float exp_ms, rounding_mode_type rounding_mode);
90  float gain_to_value(float gain, rounding_mode_type rounding_mode);
91  template <typename T> inline T sqr(const T& x) { return (x*x); }
92  void histogram_score(std::vector<int>& h, const int total_weight, histogram_metric& score);
93 
94 
95  float minimal_exposure = 0.2f, maximal_exposure = 20.f, base_gain = 2.0f, gain_limit = 15.0f;
96  float exposure = 10.0f, gain = 2.0f, target_exposure = 0.0f;
98  int direction = 0, prev_direction = 0; float hysteresis = 0.075f;// 05;
99  float eps = 0.01f;
100  std::atomic<float> exposure_step;
103  bool is_roi_initialized = false;
104  std::recursive_mutex state_mutex;
105  };
106 
108  public:
109  auto_exposure_mechanism(option& gain_option, option& exposure_option, const auto_exposure_state& auto_exposure_state);
114 
117  : exposure(0), frame_counter(0)
118  {}
119 
122  {}
123 
124  double exposure;
125  unsigned long long frame_counter;
126  };
127 
128  private:
129  static const int queue_size = 2;
133  std::shared_ptr<std::thread> _exposure_thread;
134  std::condition_variable _cv;
135  std::atomic<bool> _keep_alive;
137  std::mutex _queue_mtx;
138  std::atomic<unsigned> _frames_counter;
139  std::atomic<unsigned> _skip_frames;
140  };
141 
142  // Interface for target calculator
144  {
145  public:
146  virtual bool calculate(const uint8_t* img, float* target_dims, unsigned int target_dims_size) = 0;
147  virtual ~target_calculator_interface() = default;
148  };
149 
150  const int _roi_ws = 480;
151  const int _roi_we = 800;
152  const int _roi_hs = 240;
153  const int _roi_he = 480;
154  const int _patch_size = 20; // in pixels
155 
157  {
158  public:
159  rect_gaussian_dots_target_calculator(int width, int height, int roi_start_x, int roi_start_y, int roi_width, int roi_height);
161  bool calculate(const uint8_t* img, float* target_dims, unsigned int target_dims_size) override;
162 
165 
168 
169  protected:
170  void normalize(const uint8_t* img);
171  void calculate_ncc();
172 
173  bool find_corners();
174  void refine_corners();
175  bool validate_corners(const uint8_t* img);
176 
177  void calculate_rect_sides(float* rect_sides);
178 
179  void minimize_x(const double* p, int s, double* f, double& x);
180  void minimize_y(const double* p, int s, double* f, double& y);
181  double subpixel_agj(double* f, int s);
182 
183  protected:
184  const int _tsize = 28; // template size
185  const int _htsize = _tsize >> 1;
186  const int _tsize2 = _tsize * _tsize;
187  std::vector<double> _imgt;
188 
189  const std::vector<double> _template
190  {
191  -0.02870443, -0.02855973, -0.02855973, -0.02841493, -0.02827013, -0.02812543, -0.02783583, -0.02769113, -0.02725683, -0.02696723, -0.02667773, -0.02624343, -0.02609863, -0.02595393, -0.02580913, -0.02595393, -0.02609863, -0.02624343, -0.02667773, -0.02696723, -0.02725683, -0.02769113, -0.02783583, -0.02812543, -0.02827013, -0.02841493, -0.02855973, -0.02855973,
192  -0.02855973, -0.02855973, -0.02841493, -0.02827013, -0.02798063, -0.02769113, -0.02740153, -0.02682253, -0.02624343, -0.02566433, -0.02508533, -0.02465103, -0.02421673, -0.02392713, -0.02378243, -0.02392713, -0.02421673, -0.02465103, -0.02508533, -0.02566433, -0.02624343, -0.02682253, -0.02740153, -0.02769113, -0.02798063, -0.02827013, -0.02841493, -0.02855973,
193  -0.02855973, -0.02841493, -0.02827013, -0.02798063, -0.02754633, -0.02711203, -0.02638823, -0.02566433, -0.02479573, -0.02378243, -0.02276903, -0.02190043, -0.02117663, -0.02074233, -0.02059753, -0.02074233, -0.02117663, -0.02190043, -0.02276903, -0.02378243, -0.02479573, -0.02566433, -0.02638823, -0.02711203, -0.02754633, -0.02798063, -0.02827013, -0.02841493,
194  -0.02841493, -0.02827013, -0.02798063, -0.02754633, -0.02696723, -0.02609863, -0.02508533, -0.02392713, -0.02247953, -0.02088703, -0.01929463, -0.01799173, -0.01683363, -0.01610973, -0.01582023, -0.01610973, -0.01683363, -0.01799173, -0.01929463, -0.02088703, -0.02247953, -0.02392713, -0.02508533, -0.02609863, -0.02696723, -0.02754633, -0.02798063, -0.02827013,
195  -0.02827013, -0.02798063, -0.02754633, -0.02696723, -0.02609863, -0.02479573, -0.02320333, -0.02132133, -0.01914983, -0.01683363, -0.01451733, -0.01234583, -0.01060863, -0.00945043, -0.00916093, -0.00945043, -0.01060863, -0.01234583, -0.01451733, -0.01683363, -0.01914983, -0.02132133, -0.02320333, -0.02479573, -0.02609863, -0.02696723, -0.02754633, -0.02798063,
196  -0.02812543, -0.02769113, -0.02711203, -0.02609863, -0.02479573, -0.02305853, -0.02074233, -0.01799173, -0.01480683, -0.01133243, -0.00785803, -0.00481793, -0.00221213, -0.00061973, -0.00004063, -0.00061973, -0.00221213, -0.00481793, -0.00785803, -0.01133243, -0.01480683, -0.01799173, -0.02074233, -0.02305853, -0.02479573, -0.02609863, -0.02711203, -0.02769113,
197  -0.02783583, -0.02740153, -0.02638823, -0.02508533, -0.02320333, -0.02074233, -0.01755743, -0.01364873, -0.00916093, -0.00423883, 0.00053847, 0.00488147, 0.00850057, 0.01081687, 0.01154077, 0.01081687, 0.00850057, 0.00488147, 0.00053847, -0.00423883, -0.00916093, -0.01364873, -0.01755743, -0.02074233, -0.02320333, -0.02508533, -0.02638823, -0.02740153,
198  -0.02769113, -0.02682253, -0.02566433, -0.02392713, -0.02132133, -0.01799173, -0.01364873, -0.00829233, -0.00221213, 0.00430237, 0.01081687, 0.01660757, 0.02138487, 0.02456977, 0.02558307, 0.02456977, 0.02138487, 0.01660757, 0.01081687, 0.00430237, -0.00221213, -0.00829233, -0.01364873, -0.01799173, -0.02132133, -0.02392713, -0.02566433, -0.02682253,
199  -0.02725683, -0.02624343, -0.02479573, -0.02247953, -0.01914983, -0.01480683, -0.00916093, -0.00221213, 0.00560527, 0.01400177, 0.02239827, 0.03021567, 0.03629587, 0.04034937, 0.04179697, 0.04034937, 0.03629587, 0.03021567, 0.02239827, 0.01400177, 0.00560527, -0.00221213, -0.00916093, -0.01480683, -0.01914983, -0.02247953, -0.02479573, -0.02624343,
200  -0.02696723, -0.02566433, -0.02378243, -0.02088703, -0.01683363, -0.01133243, -0.00423883, 0.00430237, 0.01400177, 0.02456977, 0.03499297, 0.04469237, 0.05236497, 0.05743187, 0.05916907, 0.05743187, 0.05236497, 0.04469237, 0.03499297, 0.02456977, 0.01400177, 0.00430237, -0.00423883, -0.01133243, -0.01683363, -0.02088703, -0.02378243, -0.02566433,
201  -0.02667773, -0.02508533, -0.02276903, -0.01929463, -0.01451733, -0.00785803, 0.00053847, 0.01081687, 0.02239827, 0.03499297, 0.04758767, 0.05916907, 0.06828937, 0.07436957, 0.07639627, 0.07436957, 0.06828937, 0.05916907, 0.04758767, 0.03499297, 0.02239827, 0.01081687, 0.00053847, -0.00785803, -0.01451733, -0.01929463, -0.02276903, -0.02508533,
202  -0.02624343, -0.02465103, -0.02190043, -0.01799173, -0.01234583, -0.00481793, 0.00488147, 0.01660757, 0.03021567, 0.04469237, 0.05916907, 0.07234287, 0.08291078, 0.08985968, 0.09217588, 0.08985968, 0.08291078, 0.07234287, 0.05916907, 0.04469237, 0.03021567, 0.01660757, 0.00488147, -0.00481793, -0.01234583, -0.01799173, -0.02190043, -0.02465103,
203  -0.02609863, -0.02421673, -0.02117663, -0.01683363, -0.01060863, -0.00221213, 0.00850057, 0.02138487, 0.03629587, 0.05236497, 0.06828937, 0.08291078, 0.09463698, 0.10230958, 0.10491538, 0.10230958, 0.09463698, 0.08291078, 0.06828937, 0.05236497, 0.03629587, 0.02138487, 0.00850057, -0.00221213, -0.01060863, -0.01683363, -0.02117663, -0.02421673,
204  -0.02595393, -0.02392713, -0.02074233, -0.01610973, -0.00945043, -0.00061973, 0.01081687, 0.02456977, 0.04034937, 0.05743187, 0.07436957, 0.08985968, 0.10230958, 0.11041658, 0.11316708, 0.11041658, 0.10230958, 0.08985968, 0.07436957, 0.05743187, 0.04034937, 0.02456977, 0.01081687, -0.00061973, -0.00945043, -0.01610973, -0.02074233, -0.02392713,
205  -0.02580913, -0.02378243, -0.02059753, -0.01582023, -0.00916093, -0.00004063, 0.01154077, 0.02558307, 0.04179697, 0.05916907, 0.07639627, 0.09217588, 0.10491538, 0.11316708, 0.11606248, 0.11316708, 0.10491538, 0.09217588, 0.07639627, 0.05916907, 0.04179697, 0.02558307, 0.01154077, -0.00004063, -0.00916093, -0.01582023, -0.02059753, -0.02378243,
206  -0.02595393, -0.02392713, -0.02074233, -0.01610973, -0.00945043, -0.00061973, 0.01081687, 0.02456977, 0.04034937, 0.05743187, 0.07436957, 0.08985968, 0.10230958, 0.11041658, 0.11316708, 0.11041658, 0.10230958, 0.08985968, 0.07436957, 0.05743187, 0.04034937, 0.02456977, 0.01081687, -0.00061973, -0.00945043, -0.01610973, -0.02074233, -0.02392713,
207  -0.02609863, -0.02421673, -0.02117663, -0.01683363, -0.01060863, -0.00221213, 0.00850057, 0.02138487, 0.03629587, 0.05236497, 0.06828937, 0.08291078, 0.09463698, 0.10230958, 0.10491538, 0.10230958, 0.09463698, 0.08291078, 0.06828937, 0.05236497, 0.03629587, 0.02138487, 0.00850057, -0.00221213, -0.01060863, -0.01683363, -0.02117663, -0.02421673,
208  -0.02624343, -0.02465103, -0.02190043, -0.01799173, -0.01234583, -0.00481793, 0.00488147, 0.01660757, 0.03021567, 0.04469237, 0.05916907, 0.07234287, 0.08291078, 0.08985968, 0.09217588, 0.08985968, 0.08291078, 0.07234287, 0.05916907, 0.04469237, 0.03021567, 0.01660757, 0.00488147, -0.00481793, -0.01234583, -0.01799173, -0.02190043, -0.02465103,
209  -0.02667773, -0.02508533, -0.02276903, -0.01929463, -0.01451733, -0.00785803, 0.00053847, 0.01081687, 0.02239827, 0.03499297, 0.04758767, 0.05916907, 0.06828937, 0.07436957, 0.07639627, 0.07436957, 0.06828937, 0.05916907, 0.04758767, 0.03499297, 0.02239827, 0.01081687, 0.00053847, -0.00785803, -0.01451733, -0.01929463, -0.02276903, -0.02508533,
210  -0.02696723, -0.02566433, -0.02378243, -0.02088703, -0.01683363, -0.01133243, -0.00423883, 0.00430237, 0.01400177, 0.02456977, 0.03499297, 0.04469237, 0.05236497, 0.05743187, 0.05916907, 0.05743187, 0.05236497, 0.04469237, 0.03499297, 0.02456977, 0.01400177, 0.00430237, -0.00423883, -0.01133243, -0.01683363, -0.02088703, -0.02378243, -0.02566433,
211  -0.02725683, -0.02624343, -0.02479573, -0.02247953, -0.01914983, -0.01480683, -0.00916093, -0.00221213, 0.00560527, 0.01400177, 0.02239827, 0.03021567, 0.03629587, 0.04034937, 0.04179697, 0.04034937, 0.03629587, 0.03021567, 0.02239827, 0.01400177, 0.00560527, -0.00221213, -0.00916093, -0.01480683, -0.01914983, -0.02247953, -0.02479573, -0.02624343,
212  -0.02769113, -0.02682253, -0.02566433, -0.02392713, -0.02132133, -0.01799173, -0.01364873, -0.00829233, -0.00221213, 0.00430237, 0.01081687, 0.01660757, 0.02138487, 0.02456977, 0.02558307, 0.02456977, 0.02138487, 0.01660757, 0.01081687, 0.00430237, -0.00221213, -0.00829233, -0.01364873, -0.01799173, -0.02132133, -0.02392713, -0.02566433, -0.02682253,
213  -0.02783583, -0.02740153, -0.02638823, -0.02508533, -0.02320333, -0.02074233, -0.01755743, -0.01364873, -0.00916093, -0.00423883, 0.00053847, 0.00488147, 0.00850057, 0.01081687, 0.01154077, 0.01081687, 0.00850057, 0.00488147, 0.00053847, -0.00423883, -0.00916093, -0.01364873, -0.01755743, -0.02074233, -0.02320333, -0.02508533, -0.02638823, -0.02740153,
214  -0.02812543, -0.02769113, -0.02711203, -0.02609863, -0.02479573, -0.02305853, -0.02074233, -0.01799173, -0.01480683, -0.01133243, -0.00785803, -0.00481793, -0.00221213, -0.00061973, -0.00004063, -0.00061973, -0.00221213, -0.00481793, -0.00785803, -0.01133243, -0.01480683, -0.01799173, -0.02074233, -0.02305853, -0.02479573, -0.02609863, -0.02711203, -0.02769113,
215  -0.02827013, -0.02798063, -0.02754633, -0.02696723, -0.02609863, -0.02479573, -0.02320333, -0.02132133, -0.01914983, -0.01683363, -0.01451733, -0.01234583, -0.01060863, -0.00945043, -0.00916093, -0.00945043, -0.01060863, -0.01234583, -0.01451733, -0.01683363, -0.01914983, -0.02132133, -0.02320333, -0.02479573, -0.02609863, -0.02696723, -0.02754633, -0.02798063,
216  -0.02841493, -0.02827013, -0.02798063, -0.02754633, -0.02696723, -0.02609863, -0.02508533, -0.02392713, -0.02247953, -0.02088703, -0.01929463, -0.01799173, -0.01683363, -0.01610973, -0.01582023, -0.01610973, -0.01683363, -0.01799173, -0.01929463, -0.02088703, -0.02247953, -0.02392713, -0.02508533, -0.02609863, -0.02696723, -0.02754633, -0.02798063, -0.02827013,
217  -0.02855973, -0.02841493, -0.02827013, -0.02798063, -0.02754633, -0.02711203, -0.02638823, -0.02566433, -0.02479573, -0.02378243, -0.02276903, -0.02190043, -0.02117663, -0.02074233, -0.02059753, -0.02074233, -0.02117663, -0.02190043, -0.02276903, -0.02378243, -0.02479573, -0.02566433, -0.02638823, -0.02711203, -0.02754633, -0.02798063, -0.02827013, -0.02841493,
218  -0.02855973, -0.02855973, -0.02841493, -0.02827013, -0.02798063, -0.02769113, -0.02740153, -0.02682253, -0.02624343, -0.02566433, -0.02508533, -0.02465103, -0.02421673, -0.02392713, -0.02378243, -0.02392713, -0.02421673, -0.02465103, -0.02508533, -0.02566433, -0.02624343, -0.02682253, -0.02740153, -0.02769113, -0.02798063, -0.02827013, -0.02841493, -0.02855973,
219  };
220 
221  const double _thresh = 0.7; // used internally, range from 0 to 1 for normalized image ma
222  std::vector<double> _buf;
223 
224  std::vector<double> _img;
225  std::vector<double> _ncc;
226  int _width = 0;
227  int _height = 0;
228  int _size = 0;
229 
230  int _wt = 0;
231  int _ht = 0;
232  int _hwidth;
233  int _hheight;
234 
235  template <typename T>
236  struct point
237  {
238  T x;
239  T y;
240  };
241 
244 
249  };
250 
251  // Utility class for calculating the rectangle sides on the specific target
253  {
254  public:
255  rect_calculator(bool roi = false) : _roi(roi) {}
256  virtual ~rect_calculator() {}
257 
258  // return 1 if target found, zero otherwise
259  int extract_target_dims(const rs2_frame* frame_ref, float4& rect_sides);
260 
261  private:
262  bool _roi = false;
263  };
264 }
librealsense::rect_gaussian_dots_target_calculator::calculate
bool calculate(const uint8_t *img, float *target_dims, unsigned int target_dims_size) override
Definition: algo.cpp:591
librealsense::auto_exposure_modes::auto_exposure_anti_flicker
@ auto_exposure_anti_flicker
librealsense::rect_gaussian_dots_target_calculator::minimize_x
void minimize_x(const double *p, int s, double *f, double &x)
Definition: algo.cpp:926
librealsense
Definition: algo.h:18
librealsense::auto_exposure_state::sample_rate
static const unsigned sample_rate
Definition: algo.h:48
librealsense::target_calculator_interface
Definition: algo.h:143
uint8_t
unsigned char uint8_t
Definition: stdint.h:78
concurrency.h
librealsense::rect_gaussian_dots_target_calculator::_ht
int _ht
Definition: algo.h:231
librealsense::auto_exposure_algorithm::gain
float gain
Definition: algo.h:96
librealsense::auto_exposure_mechanism::~auto_exposure_mechanism
~auto_exposure_mechanism()
Definition: algo.cpp:132
librealsense::rect_calculator::~rect_calculator
virtual ~rect_calculator()
Definition: algo.h:256
librealsense::auto_exposure_algorithm::static_decrease_exposure_gain
void static_decrease_exposure_gain(const float &target_exposure, const float &target_exposure0, float &exposure, float &gain)
Definition: algo.cpp:352
librealsense::auto_exposure_mechanism::add_frame
void add_frame(frame_holder frame)
Definition: algo.cpp:155
librealsense::rect_gaussian_dots_target_calculator::_height
int _height
Definition: algo.h:227
librealsense::auto_exposure_mechanism::_gain_option
option & _gain_option
Definition: algo.h:130
librealsense::rect_gaussian_dots_target_calculator::_img
std::vector< double > _img
Definition: algo.h:224
librealsense::rect_gaussian_dots_target_calculator::_width
int _width
Definition: algo.h:226
librealsense::rect_gaussian_dots_target_calculator::refine_corners
void refine_corners()
Definition: algo.cpp:849
librealsense::rect_gaussian_dots_target_calculator::_tsize2
const int _tsize2
Definition: algo.h:186
librealsense::auto_exposure_algorithm::histogram_metric::shadow_limit
int shadow_limit
Definition: algo.h:68
librealsense::rect_gaussian_dots_target_calculator::_buf
std::vector< double > _buf
Definition: algo.h:222
librealsense::region_of_interest
Definition: roi.h:12
librealsense::auto_exposure_algorithm::rounding_mode_type::ceil
@ ceil
librealsense::rect_gaussian_dots_target_calculator::_roi_start_x
int _roi_start_x
Definition: algo.h:245
librealsense::auto_exposure_mechanism::auto_exposure_mechanism
auto_exposure_mechanism(option &gain_option, option &exposure_option, const auto_exposure_state &auto_exposure_state)
Definition: algo.cpp:50
librealsense::rect_gaussian_dots_target_calculator::minimize_y
void minimize_y(const double *p, int s, double *f, double &y)
Definition: algo.cpp:943
librealsense::auto_exposure_state::mode
auto_exposure_modes mode
Definition: algo.h:53
librealsense::auto_exposure_algorithm::hybrid_increase_exposure_gain
void hybrid_increase_exposure_gain(const float &target_exposure, const float &target_exposure0, float &exposure, float &gain)
Definition: algo.cpp:408
librealsense::rect_gaussian_dots_target_calculator::calculate_rect_sides
void calculate_rect_sides(float *rect_sides)
Definition: algo.cpp:907
example1 - object detection.score
score
Definition: example1 - object detection.py:63
librealsense::rect_gaussian_dots_target_calculator::_full_width
int _full_width
Definition: algo.h:247
rsutils::number::float4
Definition: third-party/rsutils/include/rsutils/number/float3.h:47
librealsense::rect_gaussian_dots_target_calculator::_template
const std::vector< double > _template
Definition: algo.h:190
librealsense::rect_calculator
Definition: algo.h:252
librealsense::auto_exposure_algorithm::minimal_exposure
float minimal_exposure
Definition: algo.h:95
librealsense::auto_exposure_state::get_auto_exposure_antiflicker_rate
unsigned get_auto_exposure_antiflicker_rate() const
Definition: algo.cpp:20
data
Definition: parser.hpp:153
librealsense::target_calculator_interface::~target_calculator_interface
virtual ~target_calculator_interface()=default
rs2_frame
struct rs2_frame rs2_frame
Definition: rs_types.h:230
librealsense::auto_exposure_mechanism::queue_size
static const int queue_size
Definition: algo.h:129
librealsense::rect_gaussian_dots_target_calculator::_hheight
int _hheight
Definition: algo.h:233
librealsense::auto_exposure_algorithm::exposure_step
std::atomic< float > exposure_step
Definition: algo.h:100
librealsense::rect_gaussian_dots_target_calculator::point::x
T x
Definition: algo.h:238
mode
GLenum mode
Definition: glad/glad/glad.h:1385
options-container.h
librealsense::auto_exposure_state::set_auto_exposure_step
void set_auto_exposure_step(float value)
Definition: algo.cpp:45
librealsense::auto_exposure_algorithm::rounding_mode_type
rounding_mode_type
Definition: algo.h:69
librealsense::auto_exposure_algorithm::over_exposure_limit
uint8_t over_exposure_limit
Definition: algo.h:97
librealsense::rect_gaussian_dots_target_calculator::validate_corners
bool validate_corners(const uint8_t *img)
Definition: algo.cpp:891
librealsense::auto_exposure_algorithm::hysteresis
float hysteresis
Definition: algo.h:98
librealsense::auto_exposure_algorithm::histogram_metric::lower_q
int lower_q
Definition: algo.h:68
mult
float3 mult(const float3x3 &a, const float3 &b)
Definition: test-pose.cpp:69
librealsense::rect_gaussian_dots_target_calculator::operator=
rect_gaussian_dots_target_calculator & operator=(const rect_gaussian_dots_target_calculator &)=delete
librealsense::auto_exposure_algorithm::increase_exposure_gain
void increase_exposure_gain(const float &target_exposure, const float &target_exposure0, float &exposure, float &gain)
Definition: algo.cpp:325
librealsense::auto_exposure_algorithm::target_exposure
float target_exposure
Definition: algo.h:96
float3.h
librealsense::auto_exposure_state
Definition: algo.h:28
librealsense::frame_interface
Definition: frame-interface.h:20
librealsense::target_calculator_interface::calculate
virtual bool calculate(const uint8_t *img, float *target_dims, unsigned int target_dims_size)=0
librealsense::rect_gaussian_dots_target_calculator::_hwidth
int _hwidth
Definition: algo.h:232
librealsense::auto_exposure_algorithm::auto_exposure_algorithm
auto_exposure_algorithm(const auto_exposure_state &auto_exposure_state)
Definition: algo.cpp:172
librealsense::auto_exposure_state::set_enable_auto_exposure
void set_enable_auto_exposure(bool value)
Definition: algo.cpp:30
single_consumer_queue
Definition: concurrency.h:16
librealsense::rect_gaussian_dots_target_calculator::rect_gaussian_dots_target_calculator
rect_gaussian_dots_target_calculator(int width, int height, int roi_start_x, int roi_start_y, int roi_width, int roi_height)
Definition: algo.cpp:569
librealsense::auto_exposure_algorithm::anti_flicker_decrease_exposure_gain
void anti_flicker_decrease_exposure_gain(const float &target_exposure, const float &target_exposure0, float &exposure, float &gain)
Definition: algo.cpp:383
librealsense::auto_exposure_algorithm::maximal_exposure
float maximal_exposure
Definition: algo.h:95
librealsense::auto_exposure_algorithm::histogram_metric::main_std
float main_std
Definition: algo.h:68
width
GLint GLsizei width
Definition: glad/glad/glad.h:1397
librealsense::auto_exposure_modes
auto_exposure_modes
Definition: algo.h:22
librealsense::auto_exposure_mechanism::update_auto_exposure_roi
void update_auto_exposure_roi(const region_of_interest &roi)
Definition: algo.cpp:149
librealsense::rect_gaussian_dots_target_calculator::_full_height
int _full_height
Definition: algo.h:248
librealsense::auto_exposure_mechanism::exposure_and_frame_counter::exposure_and_frame_counter
exposure_and_frame_counter()
Definition: algo.h:116
librealsense::auto_exposure_mechanism
Definition: algo.h:107
librealsense::_roi_we
const int _roi_we
Definition: algo.h:151
librealsense::rect_gaussian_dots_target_calculator::point::y
T y
Definition: algo.h:239
librealsense::rect_calculator::rect_calculator
rect_calculator(bool roi=false)
Definition: algo.h:255
librealsense::rect_gaussian_dots_target_calculator::_pts
point< int > _pts[4]
Definition: algo.h:243
librealsense::auto_exposure_algorithm::update_roi
void update_roi(const region_of_interest &ae_roi)
Definition: algo.cpp:295
librealsense::auto_exposure_algorithm::im_hist
void im_hist(const uint8_t *data, const region_of_interest &image_roi, const int rowStep, int h[])
Definition: algo.cpp:302
librealsense::auto_exposure_algorithm::exposure_to_value
float exposure_to_value(float exp_ms, rounding_mode_type rounding_mode)
Definition: algo.cpp:448
librealsense::auto_exposure_algorithm::gain_to_value
float gain_to_value(float gain, rounding_mode_type rounding_mode)
Definition: algo.cpp:459
height
GLint GLsizei GLsizei height
Definition: glad/glad/glad.h:1397
librealsense::auto_exposure_algorithm::base_gain
float base_gain
Definition: algo.h:95
librealsense::auto_exposure_algorithm::increase_exposure_target
void increase_exposure_target(float mult, float &target_exposure)
Definition: algo.cpp:315
librealsense::rect_gaussian_dots_target_calculator::~rect_gaussian_dots_target_calculator
virtual ~rect_gaussian_dots_target_calculator()
Definition: algo.cpp:587
librealsense::auto_exposure_algorithm::histogram_metric::main_mean
float main_mean
Definition: algo.h:68
librealsense::auto_exposure_mechanism::_exposure_thread
std::shared_ptr< std::thread > _exposure_thread
Definition: algo.h:133
value
GLfloat value
Definition: glad/glad/glad.h:2099
f
GLdouble f
Definition: glad/glad/glad.h:1517
librealsense::rect_gaussian_dots_target_calculator::_size
int _size
Definition: algo.h:228
librealsense::auto_exposure_mechanism::_frames_counter
std::atomic< unsigned > _frames_counter
Definition: algo.h:138
librealsense::_patch_size
const int _patch_size
Definition: algo.h:154
librealsense::_roi_ws
const int _roi_ws
Definition: algo.h:150
librealsense::rect_gaussian_dots_target_calculator::_thresh
const double _thresh
Definition: algo.h:221
librealsense::frame_holder
Definition: frame-holder.h:15
librealsense::auto_exposure_state::get_auto_exposure_mode
auto_exposure_modes get_auto_exposure_mode() const
Definition: algo.cpp:15
librealsense::auto_exposure_algorithm::gain_limit
float gain_limit
Definition: algo.h:95
librealsense::auto_exposure_mechanism::_cv
std::condition_variable _cv
Definition: algo.h:134
librealsense::rect_gaussian_dots_target_calculator
Definition: algo.h:156
librealsense::rect_gaussian_dots_target_calculator::normalize
void normalize(const uint8_t *img)
Definition: algo.cpp:621
librealsense::auto_exposure_algorithm::prev_direction
int prev_direction
Definition: algo.h:98
librealsense::auto_exposure_algorithm::decrease_exposure_gain
void decrease_exposure_gain(const float &target_exposure, const float &target_exposure0, float &exposure, float &gain)
Definition: algo.cpp:336
librealsense::rect_gaussian_dots_target_calculator::subpixel_agj
double subpixel_agj(double *f, int s)
Definition: algo.cpp:960
librealsense::rect_gaussian_dots_target_calculator::_wt
int _wt
Definition: algo.h:230
librealsense::auto_exposure_state::step
float step
Definition: algo.h:55
librealsense::auto_exposure_algorithm::sqr
T sqr(const T &x)
Definition: algo.h:91
librealsense::auto_exposure_state::rate
unsigned rate
Definition: algo.h:54
librealsense::auto_exposure_state::is_auto_exposure
bool is_auto_exposure
Definition: algo.h:52
stdint.h
librealsense::auto_exposure_state::skip_frames
static const unsigned skip_frames
Definition: algo.h:49
librealsense::auto_exposure_algorithm::hybrid_decrease_exposure_gain
void hybrid_decrease_exposure_gain(const float &target_exposure, const float &target_exposure0, float &exposure, float &gain)
Definition: algo.cpp:426
librealsense::auto_exposure_algorithm::under_exposure_limit
uint8_t under_exposure_limit
Definition: algo.h:97
librealsense::auto_exposure_algorithm::analyze_image
bool analyze_image(const frame_interface *image)
Definition: algo.cpp:225
librealsense::auto_exposure_algorithm::eps
float eps
Definition: algo.h:99
librealsense::auto_exposure_algorithm::histogram_metric::highlight_limit
int highlight_limit
Definition: algo.h:68
librealsense::auto_exposure_algorithm::is_roi_initialized
bool is_roi_initialized
Definition: algo.h:103
librealsense::_roi_hs
const int _roi_hs
Definition: algo.h:152
librealsense::rect_gaussian_dots_target_calculator::_ncc
std::vector< double > _ncc
Definition: algo.h:225
librealsense::frame
Definition: frame.h:19
librealsense::rect_calculator::extract_target_dims
int extract_target_dims(const rs2_frame *frame_ref, float4 &rect_sides)
Definition: algo.cpp:1018
librealsense::auto_exposure_algorithm::roi
region_of_interest roi
Definition: algo.h:102
librealsense::auto_exposure_mechanism::update_auto_exposure_state
void update_auto_exposure_state(const auto_exposure_state &auto_exposure_state)
Definition: algo.cpp:142
librealsense::auto_exposure_mechanism::exposure_and_frame_counter::exposure
double exposure
Definition: algo.h:124
frame-holder.h
librealsense::auto_exposure_mechanism::exposure_and_frame_counter
Definition: algo.h:115
librealsense::rect_gaussian_dots_target_calculator::_roi_start_y
int _roi_start_y
Definition: algo.h:246
librealsense::auto_exposure_state::auto_exposure_state
auto_exposure_state()
Definition: algo.h:31
librealsense::auto_exposure_algorithm::histogram_metric
Definition: algo.h:68
librealsense::auto_exposure_algorithm::decrease_exposure_target
void decrease_exposure_target(float mult, float &target_exposure)
Definition: algo.cpp:320
librealsense::auto_exposure_state::set_auto_exposure_antiflicker_rate
void set_auto_exposure_antiflicker_rate(unsigned value)
Definition: algo.cpp:40
librealsense::auto_exposure_state::set_auto_exposure_mode
void set_auto_exposure_mode(auto_exposure_modes value)
Definition: algo.cpp:35
librealsense::auto_exposure_algorithm::exposure
float exposure
Definition: algo.h:96
librealsense::rect_gaussian_dots_target_calculator::_corners
point< double > _corners[4]
Definition: algo.h:242
librealsense::auto_exposure_mechanism::_auto_exposure_algo
auto_exposure_algorithm _auto_exposure_algo
Definition: algo.h:132
librealsense::auto_exposure_mechanism::exposure_and_frame_counter::exposure_and_frame_counter
exposure_and_frame_counter(double exposure, unsigned long long frame_counter)
Definition: algo.h:120
p
double p[GRIDW][GRIDH]
Definition: wave.c:109
librealsense::auto_exposure_algorithm::histogram_metric::upper_q
int upper_q
Definition: algo.h:68
librealsense::auto_exposure_mechanism::_exposure_option
option & _exposure_option
Definition: algo.h:131
librealsense::option
Definition: option-interface.h:22
librealsense::auto_exposure_modes::auto_exposure_hybrid
@ auto_exposure_hybrid
librealsense::rect_gaussian_dots_target_calculator::point
Definition: algo.h:236
librealsense::rect_gaussian_dots_target_calculator::_htsize
const int _htsize
Definition: algo.h:185
librealsense::auto_exposure_algorithm::anti_flicker_increase_exposure_gain
void anti_flicker_increase_exposure_gain(const float &target_exposure, const float &target_exposure0, float &exposure, float &gain)
Definition: algo.cpp:357
librealsense::auto_exposure_algorithm::under_exposure_noise_limit
int under_exposure_noise_limit
Definition: algo.h:97
librealsense::auto_exposure_algorithm::histogram_score
void histogram_score(std::vector< int > &h, const int total_weight, histogram_metric &score)
Definition: algo.cpp:472
librealsense::auto_exposure_algorithm::state_mutex
std::recursive_mutex state_mutex
Definition: algo.h:104
librealsense::auto_exposure_algorithm::state
auto_exposure_state state
Definition: algo.h:101
librealsense::auto_exposure_mechanism::exposure_and_frame_counter::frame_counter
unsigned long long frame_counter
Definition: algo.h:125
librealsense::auto_exposure_algorithm::over_exposure_noise_limit
int over_exposure_noise_limit
Definition: algo.h:97
image
GLenum GLenum GLsizei void * image
Definition: glad/glad/glad.h:3587
librealsense::auto_exposure_mechanism::_keep_alive
std::atomic< bool > _keep_alive
Definition: algo.h:135
librealsense::auto_exposure_algorithm::update_options
void update_options(const auto_exposure_state &options)
Definition: algo.cpp:286
librealsense::auto_exposure_algorithm::static_increase_exposure_gain
void static_increase_exposure_gain(const float &target_exposure, const float &target_exposure0, float &exposure, float &gain)
Definition: algo.cpp:347
img
GLint void * img
Definition: glad/glad/glad.h:2435
librealsense::auto_exposure_algorithm::anti_flicker_mode
bool anti_flicker_mode
Definition: algo.h:101
librealsense::rect_gaussian_dots_target_calculator::calculate_ncc
void calculate_ncc()
Definition: algo.cpp:661
x
GLdouble x
Definition: glad/glad/glad.h:2279
librealsense::auto_exposure_mechanism::_skip_frames
std::atomic< unsigned > _skip_frames
Definition: algo.h:139
librealsense::auto_exposure_state::get_auto_exposure_step
float get_auto_exposure_step() const
Definition: algo.cpp:25
librealsense::auto_exposure_modes::static_auto_exposure
@ static_auto_exposure
librealsense::auto_exposure_mechanism::_queue_mtx
std::mutex _queue_mtx
Definition: algo.h:137
librealsense::_roi_he
const int _roi_he
Definition: algo.h:153
direction
direction
Definition: rs-align.cpp:25
librealsense::auto_exposure_algorithm::rounding_mode_type::round
@ round
librealsense::auto_exposure_algorithm::flicker_cycle
float flicker_cycle
Definition: algo.h:101
librealsense::rect_gaussian_dots_target_calculator::_imgt
std::vector< double > _imgt
Definition: algo.h:187
librealsense::rect_gaussian_dots_target_calculator::find_corners
bool find_corners()
Definition: algo.cpp:744
s
GLdouble s
Definition: glad/glad/glad.h:2441
realdds::topics::notification::device_options::key::options
const std::string options
Definition: test-device-discovery.py:297
librealsense::auto_exposure_mechanism::_data_queue
single_consumer_queue< frame_holder > _data_queue
Definition: algo.h:136
roi.h
librealsense::auto_exposure_algorithm::histogram_metric::under_exposure_count
int under_exposure_count
Definition: algo.h:68
librealsense::auto_exposure_algorithm::round
float round(float x)
Definition: algo.h:86
librealsense::auto_exposure_state::get_enable_auto_exposure
bool get_enable_auto_exposure() const
Definition: algo.cpp:10
librealsense::ae_step_default_value
static const float ae_step_default_value
Definition: algo.h:20
librealsense::auto_exposure_algorithm::rounding_mode_type::floor
@ floor
librealsense::rect_gaussian_dots_target_calculator::_tsize
const int _tsize
Definition: algo.h:184
librealsense::auto_exposure_algorithm::modify_exposure
void modify_exposure(float &exposure_value, bool &exp_modified, float &gain_value, bool &gain_modified)
Definition: algo.cpp:178
y
GLint y
Definition: glad/glad/glad.h:1397
sw.h
int h
Definition: sw-dev/sw.py:11
librealsense::auto_exposure_algorithm
Definition: algo.h:59
librealsense::auto_exposure_algorithm::histogram_metric::over_exposure_count
int over_exposure_count
Definition: algo.h:68
librealsense::rect_calculator::_roi
bool _roi
Definition: algo.h:262


librealsense2
Author(s): LibRealSense ROS Team
autogenerated on Fri Aug 2 2024 08:30:00