Georgietree

  • Sep 4, 2023
  • Joined Sep 3, 2023
  • 0 best answers
  • Hi jenanaputra
    To get the depth data of a particular pixel (x,y), you can use the depth map that DepthAI provides. The depth map is a 2D array where each pixel represents the depth value at that particular location. You can access the depth value of a particular pixel by indexing into this array with the x and y coordinates.

    Here is a simple example in Python:

    "Assuming frame is your depth map"
    depth_value = frame[y, x]

    Please note that the value of depth data is stored in uint16, where 0 means that the distance is invalid/unknown. The actual depth can be calculated by multiplying the depth value with the depth unit, which can be retrieved using StereoDepthConfig.getDepthUnit().

    Thanks,
    Jaka