# cv::error: 内存不足 在函数 'cv::detail::MultiBandBlender::feed' 中

- **ID:** `opencv/image-stitching-out-of-memory`
- **领域:** opencv
- **类别:** resource_error
- **验证级别:** ai_generated
- **修复率:** 85%

## 根因

图像拼接管线在尝试混合大图像时内存耗尽，通常是由于分辨率过高或全景图中的图像数量过多。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 4.7.0 | active | — | — |
| 4.8.0 | active | — | — |
| 4.9.0 | active | — | — |

## 解决方案

1. ```
   Reduce image resolution before stitching: cv::resize each image to 50% using INTER_AREA, then run stitching. For example: cv::resize(img, img, cv::Size(), 0.5, 0.5, cv::INTER_AREA).
   ```
2. ```
   Use the 'scans' or 'affine' warper type in cv::Stitcher::create which uses less memory than the default 'spherical' warper.
   ```

## 无效尝试

- **Increasing the system swap space without reducing image size** — Swap space does not help with GPU memory or large CPU allocations; the blender still fails due to insufficient RAM. (70% 失败率)
- **Switching to CUDA backend without checking GPU memory limits** — GPU memory is often more limited than system RAM; this can cause out-of-memory errors faster. (85% 失败率)
