# IMX582

IMX582 是一个 rolling 快门 color 传感器。

| 规格 | 值 |
| --- | --- |
| 快门类型 | rolling |
| 类型 | color |
| 传感器尺寸 | 1/2" (12.7mm) |
| 像素尺寸 | 0.8 μm |
| 平台支持 | **RVC2, RVC4** |

## RVC2 支持的分辨率

| 分辨率名称 | 分辨率尺寸 | 最大 FPS | MIPI 通道数 | 模式 |
| --- | --- | --- | --- | --- |
| | 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 支持的分辨率

| 分辨率名称 | 分辨率尺寸 | 最大 FPS | MIPI 通道数 | 模式 |
| --- | --- | --- | --- | --- |
| | 8000x6000 | 18.9 | 4 | Full resolution |
| | 4000x3000 | 30 | 4 | Binning 2x2 |

## RVC2 驱动限制

传感器驱动程序为该传感器添加了对 [RVC2](https://docs.luxonis.com/hardware/platform/rvc/rvc2.md) 的支持。以下是该传感器的 RVC2 驱动规格

ISP（图像信号处理器）的一部分还包括 3A（自动曝光、自动白平衡、自动对焦）算法。 它们默认启用，但您也可以禁用它们并手动设置曝光、增益、白平衡等。

### 手动限制

 * 最小 FPS：1.67
 * 最小曝光时间：1 μs
 * 最大曝光时间：1 / CAM_FPS 秒。例如 33ms @ 30FPS

### 自动限制

 * 最小曝光时间：101 μs
 * 最大曝光时间：取决于防频闪模式：
   * 防频闪模式关闭：33 ms
   * 防频闪模式 50Hz：30 ms
   * 防频闪模式 60Hz：25 ms

最大 AE 曝光时间取决于防频闪（AB）模式，该模式有助于避免使用人工照明时出现闪烁。 我们可以通过 API 配置防频闪：

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

### IMX582 RAM 消耗

在最高分辨率下，IMX582 图像传感器产生 32MP 帧，这会消耗大量 RAM。由于 OAK 相机是嵌入式设备，其 RAM 本身就不多。在大多数管线中，即使是默认池大小下的
[彩色相机](https://docs.luxonis.com/software-v3/depthai/depthai-components/nodes/color_camera.md) 也会过大，因此您需要非常谨慎地对待 RAM，我们建议阅读 [RAM
使用文档](https://docs.luxonis.com/software-v3/depthai/tutorials/debugging.md)。对于 ColorCamera 节点，您可能需要更改池大小，示例如下：

```python
cam = pipeline.create(dai.node.ColorCamera)
cam.setResolution(dai.ColorCameraProperties.SensorResolution.THE_5312X6000) # 32MP
# 减少所有输出（raw, isp, preview, video, still）的池大小：
cam.setNumFramesPool(2,2,1,1,1)
```

### 高动态范围（HDR）

IMX582 传感器支持片上 HDR，因此 [Robotics Vision Core 2 (RVC2)](https://docs.luxonis.com/hardware/platform/rvc/rvc2.md)
也可以利用该功能。下面的对比图中，我们使用的是 [OAK-1 Max](https://docs.luxonis.com/hardware/products/OAK-1%2520Max.md)。

不同曝光设置下的 HDR 图像对比：

对于上述 HDR 图像，我们在 [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
```
