- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For a computer vision application, we're trying to access the depth of four specific pixels. We tried to do that with several member functions of the "points" class but it didn't work.
Thanks for any help!
// ---Capture a snapshot via realsense
// Declare pointcloud object, for calculating pointclouds and texture mappings
rs2::pointcloud pc;
// Declare points object
rs2::points points;
//--Create a Pipeline - this serves as an API for streaming and processing frames
rs2::pipeline pipe;
//Create a configuration for configuring the pipeline with a non default profile
rs2::config cfg;
//Add desired streams to configuration
cfg.enable_stream(RS2_STREAM_DEPTH, 640, 480, RS2_FORMAT_Z16, 30);
//--Configure and start the pipeline
pipe.start(cfg);
//--Camera warmup - dropping several first frames to let auto-exposure stabilize
auto frames = pipe.wait_for_frames();
//--Get one color and one depth frame
rs2::frame color_frame = frames.get_color_frame();
rs2::depth_frame depth_fr = frames.get_depth_frame();
// Generate the pointcloud and texture mappings
points = pc.calculate(depth_fr);
// Tell pointcloud object to map to this color frame
pc.map_to(color_frame);
// Get depth coordinates and print them
auto vertices = points.get_vertices();
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The link below has advice and scripting for getting the depth of a pixel in meters using the frame_get_distance instruction.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The link below has advice and scripting for getting the depth of a pixel in meters using the frame_get_distance instruction.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page