Hey folks,

I was recently working with the sample programs( depth ai viewer and depthai_demo.py) and found the depth value obtained is not the perpendicular distance but the hypotenuse depth from the camera. Am I missing something or should I perform the depth value correction on the obtained values?

    Some critical lines of code to return X,Y,Z with your DepthAI pipeline are as follows:

    inDet = detectionNNQueue.get()
    ....
    detections = inDet.detections
    .....
    for detection in detections:
       print(detection.spatialCoordinates.x)
       print(detection.spatialCoordinates.y)
       print(detection.spatialCoordinates.z)

    Somewhere in your code, you should be able to return the X,Y,Z components of depth for the object you're trying to detect. Hopefully this helps point you in the right direction and lets you verify the intended depth value.

    PranavMP
    The depth map should return Z axis - perpendicular distance from the camera. If you are using the demo or viewer, it is possible it is using the spatial location calculator node (https://docs.luxonis.com/projects/api/en/latest/components/nodes/spatial_location_calculator/) which combines Z as well as FOV and resolution to produce XY coordinates and distance from the camera directly to the object.

    Thanks,
    Jaka