Hello.
I have a question that can I Change the Depth map accuracy like this:
rs2::pipeline pipe;
rs2::pipeline_profile selection = pipe.start();
rs2::device selected_device = selection.get_device();
auto depth_sensor = selected_device.first();
if (depth_sensor.supports(RS2_OPTION_EMITTER_ENABLED))
{
depth_sensor.set_option(RS2_OPTION_EMITTER_ENABLED, 1.f); // Enable emitter
depth_sensor.set_option(RS2_OPTION_EMITTER_ENABLED, 0.f); // Disable emitter
}
if (depth_sensor.supports(RS2_OPTION_LASER_POWER))
{
// Query min and max values:
auto range = depth_sensor.get_option_range(RS2_OPTION_LASER_POWER);
depth_sensor.set_option(RS2_OPTION_LASER_POWER, range.max); // Set max power
depth_sensor.set_option(RS2_OPTION_LASER_POWER, 0.f); // Disable laser
}
Does depth_sensor.set_option(RS2_OPTION_LASER_POWER, range.max) can change dehpth accruacy. The depth image is 16 bit ,and D400 camera can detect distance of 65m,
if I set range.max to 2.0m, dose the max value 65536 I get from depth img represent 2.0m? thanks.
連結已複製
Thanks.
I use API
float rs2_depth_frame_get_distance(const rs2_frame* frame_ref, int x, int y, rs2_error** error);
In default, if the return value of rs2_depth_frame_get_distance represent the real distance in Meter, for example, return 1.5, is this reprensent 1.5m?
or I must multiply the scale factor of 0.01?
rs2_depth_frame_get_distance does indeed return values in metres. If you get values from the 16 bit depth image directly, you'll need to multiply by the depth unit to get the depth in metres.
Since the D400 cameras are stereo, they only need the projector to help when looking at a region with little colour texture like a plain wall or something, then the projector adds texture to the scene so the cameras can pick out points more easily. So changing the laser power will improve depth accuracy in some circumstances, but if you're outside where IR from the sun will overpower the projector, or too far away from a wall that the projector pattern is too dim by the time it reaches it (I don't know what the max range of the projector is), the projector won't do much to help. Changing the laser power value therefore won't necessarily directly affect the depth range.
As Marty pointed out, changing the depth unit will alter the maximum reported range as well as the reported resolution (though not necessarily accuracy - just because it's reported to more decimal places doesn't automatically make it a more reliable value but in my experience at short range, it generally looks pretty good down to 0.1mm resolution), and you can clip the depth data values on the top and bottom ends using depth clamp max/min (see viewer app>advanced controls>depth table) - but I don't think that will affect the values left over in the middle at all. To improve the reliability of the depth values, you could look at the post-processing options to alleviate random errors.
