# ZED API and ZED SDK calibration parameters discrepancy

**URL:** <https://community.stereolabs.com/t/zed-api-and-zed-sdk-calibration-parameters-discrepancy/4172>\
**Category:** Python\
**Tags:** svo, python, sdk\
**Created:** [December 14, 2023, 3:04pm UTC](https://community.stereolabs.com/t/zed-api-and-zed-sdk-calibration-parameters-discrepancy/4172 "2023-12-14T15:04:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![NVG97](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/n/a698b9/32.png) [@NVG97](https://community.stereolabs.com/u/NVG97)\
**Post date:** [December 14, 2023, 3:04pm UTC](https://community.stereolabs.com/t/zed-api-and-zed-sdk-calibration-parameters-discrepancy/4172/1 "2023-12-14T15:04:49Z")

</div>

Hello,

I’m trying to automatically retrieve the calibration parameters of a ZED camera using .svo files with the next script:

```auto
        self.input_type = sl.InputType()
        self.input_type.set_from_svo_file(self.svo_filepath)
        self.init = sl.InitParameters(input_t=self.input_type, svo_real_time_mode=False)    
        self.init.camera_resolution = sl.RESOLUTION.HD1080
        self.init.depth_mode = sl.DEPTH_MODE.NEURAL
        self.cam = sl.Camera()
        self.status = self.cam.open(self.init)
        if self.status != sl.ERROR_CODE.SUCCESS:
            print(repr(self.status))
            exit()

        calibration_params = self.cam.get_camera_information().camera_configuration.calibration_parameters_raw
        focal_left_x = calibration_params.left_cam.fx
        focal_left_y = calibration_params.left_cam.fy
        principal_left_x = calibration_params.left_cam.cx
        principal_left_y = calibration_params.left_cam.cy

```

When executing it wih a .svo file I get the next results:  
focal\_left\_x: 739.197998046875  
focal\_left\_y: 739.073974609375  
principal\_left\_x: 972.2130126953125  
principal\_left\_y: 527.6489868164062  
Upon opening the same .svo file with the ZED\_Explorer from the SDK I can see the next window:

 ![calibration_parameters](https://community.stereolabs.com/uploads/default/original/2X/8/866ff6ddb3e6842b834a097ffbcaa40537efced9.png)

As you can see the cy parameter is different. Is this normal?

The purpose of doing this is to be able to grab an (x, y) pixel coordenate on a frame, get the current (Xo, Yo, Zo) coordenate in the point cloud data and compare it to the (X1, Y1 , Z1) in the same pixel if the depth was different.  
As I understand it this is possible by using the intrinsic camera parameters as follows:

```auto
K = np.array([[fx, 0, cx],
              [0, fy, cy],
              [0, 0, 1]])

# Pixel coordinates and depth example values
x = 340
y = 240
Z = 5.0

# World coordinates (X, Y, Z) calculation
pixel_coords = np.array([x, y, 1])
inv_K = np.linalg.inv(K)
world_coords = Z * np.dot(inv_K, pixel_coords)

```

Any comments would be apreciated. Thank you in advanced.

---

<div class="post-metadata">

**Author:** ![SL-PY](https://community.stereolabs.com/user_avatar/community.stereolabs.com/sl-py/32/3_2.png) [@SL-PY](https://community.stereolabs.com/u/SL-PY)\
**Post date:** [December 14, 2023, 3:37pm UTC](https://community.stereolabs.com/t/zed-api-and-zed-sdk-calibration-parameters-discrepancy/4172/2 "2023-12-14T15:37:03Z")

</div>

Hi,  
indeed it is not expected.  
ZED Explorer should report the same parameters as the ones from _calibration\_parameters\_raw_.  
Can you share your camera serial number? I will be easier for us to check what’s going on.

---

<div class="post-metadata">

**Author:** ![NVG97](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/n/a698b9/32.png) [@NVG97](https://community.stereolabs.com/u/NVG97)\
**Post date:** [December 14, 2023, 4:00pm UTC](https://community.stereolabs.com/t/zed-api-and-zed-sdk-calibration-parameters-discrepancy/4172/3 "2023-12-14T16:00:45Z")

</div>

The camera is a ZED X, the serial number is 48284538.

---

<div class="post-metadata">

**Author:** ![SL-PY](https://community.stereolabs.com/user_avatar/community.stereolabs.com/sl-py/32/3_2.png) [@SL-PY](https://community.stereolabs.com/u/SL-PY)\
**Post date:** [December 14, 2023, 4:31pm UTC](https://community.stereolabs.com/t/zed-api-and-zed-sdk-calibration-parameters-discrepancy/4172/4 "2023-12-14T16:31:55Z")

</div>

which version of the ZED SDK do you use?  
in your case, the values reported by the SDK are correct, not the one from ZED Explorer.  
In the current 4.0.8 version ZED Explorer displays the correct ones

---

<div class="post-metadata">

**Author:** ![NVG97](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/n/a698b9/32.png) [@NVG97](https://community.stereolabs.com/u/NVG97)\
**Post date:** [December 14, 2023, 5:20pm UTC](https://community.stereolabs.com/t/zed-api-and-zed-sdk-calibration-parameters-discrepancy/4172/5 "2023-12-14T17:20:16Z")

</div>

The SDK version is 4.0.7. But I also opened the .svo file from a 4.0.8 ZED Explorer in a ZED Box Orin, from which I recorded the video and the cy value remains the same (587.6490)
