13 #include "../include/librealsense2/hpp/rs_frame.hpp" 14 #include "../include/librealsense2/hpp/rs_processing.hpp" 52 intertial_holes_fill<T>(
static_cast<T*
>(
frame_data));
67 const float round = fp ? 0.f : 0.5f;
69 const T valid_threshold = fp ?
static_cast<T>(std::numeric_limits<T>::epsilon()) : static_cast<T>(1);
70 const T delta_z =
static_cast<T>(deltaZ);
82 for (u = 1; u < _width - 1; u++)
86 if (fabs(val0) >= valid_threshold)
88 if (fabs(val1) >= valid_threshold)
91 T diff =
static_cast<T>(fabs(val1 - val0));
93 if (diff >= valid_threshold && diff <= delta_z)
95 float filtered = val1 * alpha + val0 * (1.0f -
alpha);
96 val1 =
static_cast<T>(filtered + round);
115 im =
image + (
v + 1) * _width - 2;
119 for (u = _width - 1; u > 0; u--)
123 if (val1 >= valid_threshold)
125 if (val0 > valid_threshold)
128 T diff =
static_cast<T>(fabs(val1 - val0));
132 float filtered = val0 * alpha + val1 * (1.0f -
alpha);
133 val0 =
static_cast<T>(filtered + round);
153 template <
typename T>
162 const float round = fp ? 0.f : 0.5f;
164 const T valid_threshold = fp ?
static_cast<T>(std::numeric_limits<T>::epsilon()) : static_cast<T>(1);
165 const T delta_z =
static_cast<T>(deltaZ);
178 for (u = 0; u <
_width; u++)
185 T diff =
static_cast<T>(fabs(im0 - imw));
188 float filtered = imw * alpha + im0 * (1.f -
alpha);
189 im[
_width] =
static_cast<T>(filtered + round);
200 for (u = 0; u <
_width; u++)
205 if ((fabs(im0) >= valid_threshold) && (fabs(imw) >= valid_threshold))
207 T diff =
static_cast<T>(fabs(im0 - imw));
210 float filtered = im0 * alpha + imw * (1.f -
alpha);
211 im[0] =
static_cast<T>(filtered + round);
222 std::function<bool(T*)> fp_oper = [](
T* ptr) {
return !*((
int *)ptr); };
223 std::function<bool(T*)> uint_oper = [](
T* ptr) {
return !(*ptr); };
float _spatial_edge_threshold
rs2::stream_profile _target_stream_profile
void recursive_filter_horizontal(void *image_data, float alpha, float deltaZ)
rs2::frame prepare_target_frame(const rs2::frame &f, const rs2::frame_source &source)
void intertial_holes_fill(T *image_data)
uint8_t _spatial_iterations
uint8_t _holes_filling_mode
GLenum GLenum GLsizei void * image
float _stereo_baseline_mm
float _spatial_alpha_param
GLfloat GLfloat GLfloat alpha
rs2::stream_profile _source_stream_profile
void recursive_filter_horizontal_fp(void *image_data, float alpha, float deltaZ)
rs2_extension _extension_type
void dxf_smooth(void *frame_data, float alpha, float delta, int iterations)
void recursive_filter_vertical_fp(void *image_data, float alpha, float deltaZ)
void update_configuration(const rs2::frame &f)
rs2_extension
Specifies advanced interfaces (capabilities) objects may implement.
uint8_t _spatial_delta_param
GLsizei GLsizei GLchar * source
uint8_t _holes_filling_radius
void recursive_filter_vertical(void *image_data, float alpha, float deltaZ)
size_t _current_frm_size_pixels
MAP_EXTENSION(RS2_EXTENSION_POINTS, librealsense::points)
rs2::frame process_frame(const rs2::frame_source &source, const rs2::frame &f) override