4 #include "../include/librealsense2/rs.hpp" 5 #include "../include/librealsense2/rsutil.h" 12 #include "../device.h" 13 #include "../stream.h" 30 for (
int x = 0;
x < intrin.
width; ++
x)
32 const float pixel[] = { (float)
x, (
float)
y };
79 bool found_depth_intrinsics =
false;
80 bool found_depth_units =
false;
93 found_depth_intrinsics =
true;
101 found_depth_units =
true;
107 template<
class callback >
128 = std::shared_ptr< pointcloud >(
this, [](
pointcloud *
p ) {} );
130 auto dev =
sensor->get_device().shared_from_this();
144 for(
size_t x = 0, N = dev->get_sensors_count();
x < N; ++
x )
151 auto vspi = As< video_stream_profile_interface >(
171 .get_extrinsics_graph()
172 .try_fetch_extrinsics( *ds, *os, &ex ) )
175 LOG_ERROR(
"Failed to refresh extrinsics after calibration change" );
180 d2r->register_calibration_change_callback(
183 catch(
const std::bad_weak_ptr & )
213 const unsigned int width,
214 const unsigned int height,
221 for (
unsigned int y = 0;
y <
height; ++
y)
223 for (
unsigned int x = 0;
x <
width; ++
x)
230 *pixels_ptr =
project(&other_intrinsics, trans);
237 *tex_ptr = { 0.f, 0.f };
238 *pixels_ptr = { 0.f, 0.f };
265 bool map_texture =
false;
277 auto height = vid_frame.get_height();
278 auto width = vid_frame.get_width();
309 "Occlusion removal");
310 occlusion_invalidation->on_set([
this, occlusion_invalidation](
float val)
312 if (!occlusion_invalidation->is_valid(val))
314 <<
"Unsupported occlusion filtering requiested " << val <<
" is out of range.");
319 occlusion_invalidation->set_description(1.
f,
"Off");
320 occlusion_invalidation->set_description(2.
f,
"On");
395 return std::make_shared<librealsense::pointcloud_cuda>();
398 return std::make_shared<librealsense::pointcloud_sse>();
400 return std::make_shared<librealsense::pointcloud>();
rs2::frame process_depth_frame(const rs2::frame_source &source, const rs2::depth_frame &depth)
static void rs2_transform_point_to_point(float to_point[3], const struct rs2_extrinsics *extrin, const float from_point[3])
std::shared_ptr< occlusion_filter > _occlusion_filter
rs2::stream_profile _output_stream
GLuint const GLchar * name
bool should_process(const rs2::frame &frame) override
void inspect_depth_frame(const rs2::frame &depth)
stream_profile get_profile() const
void inspect_other_frame(const rs2::frame &other)
stream_filter _prev_stream_filter
calibration_change_callback_ptr create_calibration_change_callback_ptr(callback &&cb)
GLint GLint GLsizei GLsizei GLsizei depth
optional_value< rs2_extrinsics > _extrinsics
const void * get_data() const
frame allocate_points(const stream_profile &profile, const frame &original) const
float2 project_to_texcoord(const rs2_intrinsics *intrin, const float3 &point)
const texture_coordinate * get_texture_coordinates() const
GLenum GLenum GLsizei void * image
status
Defines return codes that SDK interfaces use. Negative values indicate errors, a zero value indicates...
virtual bool run__occlusion_filter(const rs2_extrinsics &extr)
void register_option(rs2_option id, std::shared_ptr< option > option)
optional_value< rs2_intrinsics > _other_intrinsics
frame first_or_default(rs2_stream s, rs2_format f=RS2_FORMAT_ANY) const
virtual void get_texture_map(rs2::points output, const float3 *points, const unsigned int width, const unsigned int height, const rs2_intrinsics &other_intrinsics, const rs2_extrinsics &extr, float2 *pixels_ptr)
static std::shared_ptr< pointcloud > create()
static void rs2_deproject_pixel_to_point(float point[3], const struct rs2_intrinsics *intrin, const float pixel[2], float depth)
virtual void preprocess()
GLint GLsizei GLsizei height
const vertex * get_vertices() const
void deproject_depth(float *points, const rs2_intrinsics &intrin, const uint16_t *depth, MAP_DEPTH map_depth)
virtual rs2::points allocate_points(const rs2::frame_source &source, const rs2::frame &f)
float2 project(const rs2_intrinsics *intrin, const float3 &point)
optional_value< float > _depth_units
std::vector< float2 > _pixels_map
stream_filter _stream_filter
static environment & get_instance()
librealsense::stream_profile_interface * profile
float3 transform(const rs2_extrinsics *extrin, const float3 &point)
Cross-stream extrinsics: encodes the topology describing how the different devices are oriented...
rs2_format format() const
float2 pixel_to_texcoord(const rs2_intrinsics *intrin, const float2 &pixel)
static void rs2_project_point_to_pixel(float pixel[2], const struct rs2_intrinsics *intrin, const float point[3])
optional_value< rs2_intrinsics > _depth_intrinsics
const rs2_stream_profile * get() const
std::pair< int, int > pixel
typename::boost::move_detail::remove_reference< T >::type && move(T &&t) BOOST_NOEXCEPT
GLsizei GLsizei GLchar * source
std::shared_ptr< pointcloud > _registered_auto_calib_cb
virtual const float3 * depth_to_points(rs2::points output, const rs2_intrinsics &depth_intrinsics, const rs2::depth_frame &depth_frame, float depth_scale)
virtual stream_profiles get_active_streams() const =0
rs2_stream stream_type() const
rs2::frame process_frame(const rs2::frame_source &source, const rs2::frame &f) override
GLdouble GLdouble GLint GLint const GLdouble * points
std::shared_ptr< rs2_calibration_change_callback > calibration_change_callback_ptr
std::string to_string(T value)