Hello,

I have some doubts about the node Spatial Calculator (both on device and on host, for the latter please consider the example provided in depthai-experiments).

As regards the node on the host, can you confirm that also in the latest depthai versions the y coordinate is still inverted?

As regards the provided host version: even here the y coordinate seems to be inverted, moreover there must be something wrong in the x and y measurements. In fact, in the function

def _calc_angle(self, frame, offset, HFOV):

    return atan(tan(HFOV / 2.0) \* offset / (frame.shape[1] / 2.0))

tan(HFOV / 2.0) should be equal to (frame.shape[1] / 2.0) / focal_length_x, but, when I resolve for the focal length, I find a different value than the one stored in the camera intrinsics parameters (I'm working with OAK-D-PRO with the depth stream aligned on RGB).

Many thanks!

Best

Alessandro

Hi @AlessandroB
The location calculator uses left hand coordinate system, so x points right, y up and z forward.

You are right, the FOV is wrong as it uses the value from specifications.
You can modify the function in calc.py to
HFOV = np.deg2rad(self.calibData.getFov(dai.CameraBoardSocket(depthData.getInstanceNum()), useSpec=False)) .

Thanks,
Jaka

    Hi jakaskerl,

    thank you for your feedback.

    Can you confirm that the node running on the device doesn't use the value from specifications, but the actual one?

    Cheers

    Alessandro