> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.stereolabs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.stereolabs.com/_mcp/server.

# Tutorial - Hello ZED

This tutorial shows how to configure and open a ZED camera, retrieve its serial number, and close it again. It is the most basic tutorial in this series and the best starting point for using the ZED SDK API, available in C, C++, Python and C#.

## Getting Started

* First, download the latest version of the [ZED SDK](https://www.stereolabs.com/developers/).
* Download the [Hello ZED](https://github.com/stereolabs/zed-sdk/tree/master/tutorials/tutorial%201%20-%20hello%20ZED) sample code in C, C++, Python or C#.
* Follow the instructions on how to build your project in C++ on [Windows](/docs/development/api-languages/cpp/windows/) or [Linux](/docs/development/api-languages/cpp/linux/), or run it in [Python](/docs/development/api-languages/python).

## Code Overview

The ZED API provides low-level access to camera control and configuration. To use the ZED in your application, you will need to create and open a Camera object. The API can be used with two different video inputs: the ZED live video (Live mode) or video files recorded in SVO format with the ZED API (Playback mode).

### Camera configuration

To configure the camera, create a Camera object and specify your `InitParameters`. Initial parameters let you adjust camera resolution, FPS, depth sensing parameters and more. These parameters can only be set before opening the camera and cannot be changed while the camera is in use.

**`C++`**

```cpp C++
// Create a ZED camera object
Camera zed;

// Set configuration parameters
InitParameters init_params;
init_params.camera_resolution = RESOLUTION::HD1080;
init_params.camera_fps = 30;
```

**`Python`**

```python Python
# Create a ZED camera object
zed = sl.Camera()

# Set configuration parameters
init_params = sl.InitParameters()
init_params.camera_resolution = sl.RESOLUTION.HD1080
init_params.camera_fps = 30
```

**`C#`**

```csharp C#
// Create a ZED camera object
Camera zed = new Camera(0);

// Set configuration parameters
InitParameters init_params = new InitParameters();
init_params.resolution = RESOLUTION.HD1080;
init_params.cameraFPS = 30;
```

`InitParameters` comes with a default configuration. You can set the following initial parameters:

* Camera configuration parameters, using the `camera_*` entries (resolution, image flip...).
* SDK configuration parameters, using the `sdk_*` entries (verbosity, GPU device used...).
* Depth configuration parameters, using the `depth_*` entries (depth mode, minimum distance...).
* Coordinate frame configuration parameters, using the `coordinate_*` entries (coordinate system, coordinate units...).
* SVO parameters to use StereoLabs video files with the ZED SDK (filename, real-time mode...)

To get the list of available parameters, see [API](https://www.stereolabs.com/docs/api/structsl_1_1InitParameters.html) documentation.

### Open the camera

Once the initial configuration is done, open the camera.

**`C++`**

```cpp C++
// Open the camera
ERROR_CODE err = zed.open(init_params);
if (err != ERROR_CODE::SUCCESS)
    exit(-1);
```

**`Python`**

```python Python
# Open the camera
err = zed.open(init_params)
if err != sl.ERROR_CODE.SUCCESS:
    exit()
```

**`C#`**

```csharp C#
// Open the camera
ERROR_CODE err = zed.Open(ref init_params);
if (err != ERROR_CODE.SUCCESS)
    Environment.Exit(-1);
```

### Retrieve Camera Information

Camera parameters such as focal length, the field of view or stereo calibration can be retrieved for each eye and resolution. Those values are available in `CalibrationParameters`. They can be accessed using `getCameraInformation()`. You can also access IMU and sensor configuration using the [Sensors API](/docs/development/zed-sdk/modules/sensors/using-the-api/).

In this tutorial, we simply retrieve the serial number of the camera:

**`C++`**

```cpp C++
// Get camera information (serial number)
int zed_serial = zed.getCameraInformation().serial_number;
printf("Hello! This is my serial number: %d\n", zed_serial);
```

**`Python`**

```python Python
# Get camera information (serial number)
zed_serial = zed.get_camera_information().serial_number
print("Hello! This is my serial number: {}".format(zed_serial))
```

**`C#`**

```csharp C#
// Get camera information (serial number)
int zed_serial = zed.GetZEDSerialNumber();
Console.WriteLine("Hello! This is my serial number: " + zed_serial);
```

In the console window, you should now see the serial number of the camera.

### Close the Camera

To close the camera properly, use `zed.close()` and exit the program.

**`C++`**

```cpp C++
// Close the camera
zed.close();
```

**`Python`**

```python Python
# Close the camera
zed.close()
```

**`C#`**

```csharp C#
// Close the camera
zed.Close();
```