# IMX582

IMX582 is a rolling shutter color sensor.

| Spec | Value |
| --- | --- |
| Shutter type | rolling |
| Type | color |
| Sensor size | 1/2" (12.7mm) |
| Pixel size | 0.8 μm |
| Platform Support | **RVC2, RVC4** |

## RVC2 supported resolutions

| Resolution name | Resolution size | Max FPS | MIPI lanes | Mode |
| --- | --- | --- | --- | --- |
| | 5312x6000 | 10 | 4 | Full resolution and maps to THE_5312X6000 (not supported) |
| | 5312x6000 | 10 | 4 | Width is cropped - QBC remosaic’ed mode |
| | 4000x3000 | 30 | 4 | Full FOV - QBC Binning |
| | 3840x2160 | 42 | 4 | QBC Binning (to 4000x3000) then Cropping |

## RVC4 supported resolutions

| Resolution name | Resolution size | Max FPS | MIPI lanes | Mode |
| --- | --- | --- | --- | --- |
| | 8000x6000 | 18.9 | 4 | Full resolution |
| | 4000x3000 | 30 | 4 | Binning 2x2 |

## RVC2 driver limits

Sensor driver adds support for that sensor to the [RVC2](https://docs.luxonis.com/hardware/platform/rvc/rvc2.md). Here are RVC2
driver specifications for this sensor

Part of the ISP (Image Signal Processor) is also the 3A (Auto Exposure, Auto White Balance, Auto Focus) algorithm. They are
enabled by default, but you can also disable them and manually set the exposure, gain, white balance, etc.

### Manual limits

 * Min FPS: 1.67
 * Min exposure time: 1 μs
 * Max exposure time: 1 / CAM_FPS seconds. Eg. 33ms @ 30FPS

### Auto limits

 * Min exposure time: 101 μs
 * Max exposure time: Depends on the Anti-Banding mode:
   * Anti-Banding mode OFF: 33 ms
   * Anti-Banding mode 50Hz: 30 ms
   * Anti-Banding mode 60Hz: 25 ms

Max AE exposure time depends on the Anti-Banding (AB) mode, which helps to avoid flickering when using artificial lighting. We can
configure the AB using the API:

```python
cam = pipeline.create(dai.node.ColorCamera) # Or MonoCamera
# "OFF", "MAINS_50_HZ", or "MAINS_60_HZ"
cam.initialControl.setAntiBandingMode(dai.CameraControl.AntiBandingMode.OFF)
```

### IMX582 RAM consumption

At highest resolution, the IMX582 image sensor produces 32MP frames, which can consume a lot of RAM. As OAK cameras are embedded
devices, they don’t have a lot of RAM to begin with. In most pipelines, even just the [color
camera](https://docs.luxonis.com/software-v3/depthai/depthai-components/nodes/color_camera.md) with default pool sizes will be too
large, so you need to be very cautious when it comes to RAM and we suggest reading the [RAM usage
documentation](https://docs.luxonis.com/software-v3/depthai/tutorials/debugging.md). For ColorCamera node, you’d likely need to
change pool sizes, example here:

```python
cam = pipeline.create(dai.node.ColorCamera)
cam.setResolution(dai.ColorCameraProperties.SensorResolution.THE_5312X6000) # 32MP
# Decrease pool sizes for all outputs (raw, isp, preview, video, still):
cam.setNumFramesPool(2,2,1,1,1)
```

### High Dynamic Range (HDR)

IMX582 sensor supports on-sensor HDR, so it can be leveraged by the [Robotics Vision Core 2
(RVC2)](https://docs.luxonis.com/hardware/platform/rvc/rvc2.md) as well. In the comparison image below we are using [OAK-1
Max](https://docs.luxonis.com/hardware/products/OAK-1%2520Max.md).

HDR image comparison in different exposure settings:

For the HDR image above we used the following argument for
[cam_test.py](https://github.com/luxonis/depthai-python/blob/main/utilities/cam_test.py):

```bash
python3 cam_test.py -cams rgb,c -rs -cres 12mp -fps 10 -misc hdr-exposure-ratio=4 hdr-local-tone-weight=75
```
