> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 启用多个 ROI 流

> 高级摄像头控制功能，可在 QCS6490 上从单个全视场 (FOV) 源提取最多三个独立的感兴趣区域 (ROI) 流。

<div style={{display:'flex',gap:'8px',flexWrap:'wrap',marginBottom:'16px'}}>
  <span style={{background:'#ede9fe',color:'#5b21b6',padding:'2px 10px',borderRadius:'999px',fontSize:'12px',fontWeight:600}}>QCS6490</span>
  <span style={{background:'#fee2e2',color:'#1b996d',padding:'2px 10px',borderRadius:'999px',fontSize:'12px',fontWeight:600}}>功能已启用</span>
</div>

<CardGroup cols={3}>
  <Card title="3 ROI + 1 全视场" icon="camera-retro">流密度</Card>
  <Card title="再处理" icon="microchip">管线逻辑</Card>
  <Card title="最高 4K" icon="bolt">带宽限制</Card>
</CardGroup>

<Note>
  **平台适用范围：**<br />
  本节仅适用于 **QCS6490**。
</Note>

***

## 01 · 这是什么？

这是一项高级摄像头控制功能，允许用户从单个摄像头获取多个 ROI 流，每个流显示全视场 (FOV) 中不同的 ROI。它最多支持三个裁剪的 ROI 流和一个全 ROI 流。

### 架构逻辑

在三个 ROI 的情况下，应用程序发送五个流进行配置，包括一个全 FOV 输出流、一个输入流和三个 ROI 输出流。

* **实时管线：** 生成初始的全 FOV 图像。
* **缓冲区反馈：** 应用程序接收全 FOV 图像，并将缓冲区作为输入图像提交回摄像头再处理管线。
* **再处理管线：** 从全 FOV 源生成最多三个 ROI 图像。

***

## 02 · 设置与初始化

<Note>
  使用 SSH 连接到设备控制台。有关说明，请参阅[如何使用 SSH？](https://dragonwingdocs.qualcomm.com/Linux/devices/iq9075-evk/set-up-the-device#connect-over-ssh)。
</Note>

<Steps>
  <Step title="初始化日志收集">
    要收集日志，请在设备上运行以下命令：

    ```bash Log Collection theme={null}
    # journalctl -f > /opt/log.txt
    ```
  </Step>
</Steps>

***

## 03 · 功能验证

<Steps>
  <Step title="执行 ROI 管线">
    运行以下 GStreamer 命令：

    ```bash GStreamer (Multiple ROI Pipeline) theme={null}
    gst-pipeline-app qtivcomposer name=mixer sink_0::position="<0, 0>" sink_0::dimensions="<960, 540>" \
    sink_1::position="<960, 0>" sink_1::dimensions="<960, 540>" \
    sink_2::position="<0, 540>" sink_2::dimensions="<960, 540>" \
    sink_3::position="<960, 540>" sink_3::dimensions="<960, 540>" mixer. ! queue ! \
    waylandsink qos=false sync=false fullscreen=true \
    qtiqmmfsrc input-roi-enable=true video_0::type=preview video_1::type=preview \
    video_2::type=preview video_3::type=preview video_0::reprocess-enable=true \
    name=camsrc ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! queue ! mixer. \
    camsrc. ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! queue ! mixer. \
    camsrc. ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! queue ! mixer. \
    camsrc. ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! queue ! mixer.
    ```
  </Step>

  <Step title="状态初始化">
    1. 选择 **(1) READY**。
    2. 选择 **(3) PLAYING**。按 **Enter**。
  </Step>

  <Step title="交互式插件配置">
    1. 选择 **(p) Plugin Mode**。
    2. 选择 **(12) camsrc**。您应该会看到四个全 FOV 预览流。
    3. 选择 **(32) input-roi-info**。
  </Step>

  <Step title="定义感兴趣区域">
    输入以下内容：

    ```text ROI Input String theme={null}
    <1920, 0, 1920, 1080, 0, 1080, 1920, 1080, 0, 0, 1920, 1080>
    ```

    您应该会在 HDMI 上看到一个全 FOV 流和三个 ROI 流。
  </Step>

  <Step title="终止">
    要关闭摄像头，请选择 **(b) BACK**，然后选择 **(q) QUIT**。
  </Step>

  <Step title="日志验证">
    检查以下 UMD 日志以验证已选择多 ROI 管线：

    ```text Log Verification (Pipeline Status) theme={null}
    cam-server[2218]: CamX: [CORE_CFG]2218 2368 [CORE   ] camxpipeline.h:3024 SetPipelineStatus() ZSLReprocessYuvToYuvMultiRoIStreams_0 status is now PipelineStatus::STREAM_ON
    ```
  </Step>
</Steps>

<Note>
  **性能约束**\
  全 FOV 流 + ROI 流的总带宽需要小于 4K，这是 QCS6490 芯片组的最大能力。
</Note>
