- 操作系统:ubuntu22.04
- OpenCV版本:OpenCV4.9
- IDE:Visual Studio Code
- 编程语言:C++11
算法描述
函数主要是对图像进行模糊处理并将其降采样。
默认情况下,输出图像的大小计算为 Size((src.cols+1)/2, (src.rows+1)/2),但无论如何,以下条件必须满足:
∣ dstsize.width ∗ 2 − s r c . c o l s ∣ ≤ 2 ∣ dstsize.height ∗ 2 − s r c . r o w s ∣ ≤ 2 \begin{array}{l} | \texttt{dstsize.width} *2-src.cols| \leq 2 \\ | \texttt{dstsize.height} *2-src.rows| \leq 2 \end{array} ∣dstsize.width∗2−src.cols∣≤2∣dstsize.height∗2−src.rows∣≤2
该函数执行高斯金字塔构建中的降采样步骤。首先,它使用以下核对源图像进行卷积:
1 256 [ 1 4 6 4 1 4 16 24 16 4 6 24 36 24 6 4 16 24 16 4 1 4 6 4 1 ] \frac{1}{256} \begin{bmatrix} 1 & 4 & 6 & 4 & 1 \\ 4 & 16 & 24 & 16 & 4 \\ 6 & 24 & 36 & 24 & 6 \\ 4 & 16 & 24 & 16 & 4 \\ 1 & 4 & 6 & 4 & 1 \end{bmatrix}