Function rs2_depth_frame_get_distance

Function Documentation

float rs2_depth_frame_get_distance(const rs2_frame *frame_ref, int x, int y, rs2_error **error)

Given the 2D depth coordinate (x,y) provide the corresponding depth in metric units

Parameters:
  • frame_ref[in] 2D depth pixel coordinates (Left-Upper corner origin)

  • x, y[in] 2D depth pixel coordinates (Left-Upper corner origin)

  • error[out] if non-null, receives any error that occurs during this call, otherwise, errors are ignored