![]() |
OpenCV 4.13.0
开源计算机视觉库 (Open Source Computer Vision)
|
本节介绍的函数和类用于对二维图像执行各种线性或非线性滤波操作。
类 | |
| 类 | cv::cuda::Filter |
| 所有 CUDA 滤波器的通用接口 : 更多... | |
函数 | |
| Ptr< Filter > | cv::cuda::createBoxFilter (int srcType, int dstType, Size ksize, Point anchor=Point(-1, -1), int borderMode=BORDER_DEFAULT, Scalar borderVal=Scalar::all(0)) |
| 创建一个归一化的 2D 盒式滤波器。 | |
| Ptr< Filter > | cv::cuda::createBoxMaxFilter (int srcType, Size ksize, Point anchor=Point(-1, -1), int borderMode=BORDER_DEFAULT, Scalar borderVal=Scalar::all(0)) |
| 创建最大值滤波器。 | |
| Ptr< Filter > | cv::cuda::createBoxMinFilter (int srcType, Size ksize, Point anchor=Point(-1, -1), int borderMode=BORDER_DEFAULT, Scalar borderVal=Scalar::all(0)) |
| 创建最小值滤波器。 | |
| Ptr< Filter > | cv::cuda::createColumnSumFilter (int srcType, int dstType, int ksize, int anchor=-1, int borderMode=BORDER_DEFAULT, Scalar borderVal=Scalar::all(0)) |
| 创建一个垂直 1D 盒式滤波器。 | |
| Ptr< Filter > | cv::cuda::createDerivFilter (int srcType, int dstType, int dx, int dy, int ksize, bool normalize=false, double scale=1, int rowBorderMode=BORDER_DEFAULT, int columnBorderMode=-1) |
| 创建一个通用的导数 (Deriv) 算子。 | |
| Ptr< Filter > | cv::cuda::createGaussianFilter (int srcType, int dstType, Size ksize, double sigma1, double sigma2=0, int rowBorderMode=BORDER_DEFAULT, int columnBorderMode=-1) |
| 创建一个高斯滤波器。 | |
| Ptr< Filter > | cv::cuda::createLaplacianFilter (int srcType, int dstType, int ksize=1, double scale=1, int borderMode=BORDER_DEFAULT, Scalar borderVal=Scalar::all(0)) |
| 创建一个拉普拉斯 (Laplacian) 算子。 | |
| Ptr< Filter > | cv::cuda::createLinearFilter (int srcType, int dstType, InputArray kernel, Point anchor=Point(-1, -1), int borderMode=BORDER_DEFAULT, Scalar borderVal=Scalar::all(0)) |
| 创建一个不可分线性 2D 滤波器。 | |
| Ptr< Filter > | cv::cuda::createMorphologyFilter (int op, int srcType, InputArray kernel, Point anchor=Point(-1, -1), int iterations=1) |
| 创建一个 2D 形态学滤波器。 | |
| Ptr< Filter > | cv::cuda::createRowSumFilter (int srcType, int dstType, int ksize, int anchor=-1, int borderMode=BORDER_DEFAULT, Scalar borderVal=Scalar::all(0)) |
| 创建一个水平 1D 盒式滤波器。 | |
| Ptr< Filter > | cv::cuda::createScharrFilter (int srcType, int dstType, int dx, int dy, double scale=1, int rowBorderMode=BORDER_DEFAULT, int columnBorderMode=-1) |
| 创建一个垂直或水平的 Scharr 算子。 | |
| Ptr< Filter > | cv::cuda::createSeparableLinearFilter (int srcType, int dstType, InputArray rowKernel, InputArray columnKernel, Point anchor=Point(-1,-1), int rowBorderMode=BORDER_DEFAULT, int columnBorderMode=-1) |
| 创建一个可分线性滤波器。支持就地处理。 | |
| Ptr< Filter > | cv::cuda::createSobelFilter (int srcType, int dstType, int dx, int dy, int ksize=3, double scale=1, int rowBorderMode=BORDER_DEFAULT, int columnBorderMode=-1) |
| 创建一个 Sobel 算子。 | |
| Ptr< Filter > cv::cuda::createBoxFilter | ( | int | srcType, |
| int | dstType, | ||
| Size | ksize, | ||
| 点 (Point) | anchor=Point(-1, -1), | ||
| int | borderMode = BORDER_DEFAULT, | ||
| Scalar | borderVal=Scalar::all(0) ) |
#include <opencv2/cudafilters.hpp>
创建一个归一化的 2D 盒式滤波器。
| srcType | 输入图像类型。目前仅支持 CV_8UC1、CV_8UC4 和 CV_32FC1。 |
| dstType | 输出图像类型。目前仅支持与 src 相同的类型。 |
| ksize | 内核大小。 |
| 锚点 (anchor) | 锚点。默认值 Point(-1, -1) 表示锚点位于内核中心。 |
| borderMode | 像素外插法。有关详细信息,请参阅 borderInterpolate 。 |
| borderVal | 默认边界值。 |
| Ptr< Filter > cv::cuda::createBoxMaxFilter | ( | int | srcType, |
| Size | ksize, | ||
| 点 (Point) | anchor=Point(-1, -1), | ||
| int | borderMode = BORDER_DEFAULT, | ||
| Scalar | borderVal=Scalar::all(0) ) |
#include <opencv2/cudafilters.hpp>
创建最大值滤波器。
| srcType | 输入/输出图像类型。仅支持 CV_8UC1 和 CV_8UC4。 |
| ksize | 内核大小。 |
| 锚点 (anchor) | 锚点。默认值 (-1) 表示锚点位于内核中心。 |
| borderMode | 像素外插法。有关详细信息,请参阅 borderInterpolate 。 |
| borderVal | 默认边界值。 |
| Ptr< Filter > cv::cuda::createBoxMinFilter | ( | int | srcType, |
| Size | ksize, | ||
| 点 (Point) | anchor=Point(-1, -1), | ||
| int | borderMode = BORDER_DEFAULT, | ||
| Scalar | borderVal=Scalar::all(0) ) |
#include <opencv2/cudafilters.hpp>
创建最小值滤波器。
| srcType | 输入/输出图像类型。仅支持 CV_8UC1 和 CV_8UC4。 |
| ksize | 内核大小。 |
| 锚点 (anchor) | 锚点。默认值 (-1) 表示锚点位于内核中心。 |
| borderMode | 像素外插法。有关详细信息,请参阅 borderInterpolate 。 |
| borderVal | 默认边界值。 |
| Ptr< Filter > cv::cuda::createColumnSumFilter | ( | int | srcType, |
| int | dstType, | ||
| int | ksize, | ||
| int | anchor=-1, | ||
| int | borderMode = BORDER_DEFAULT, | ||
| Scalar | borderVal=Scalar::all(0) ) |
#include <opencv2/cudafilters.hpp>
创建一个垂直 1D 盒式滤波器。
| srcType | 输入图像类型。目前仅支持 CV_8UC1 类型。 |
| dstType | 输出图像类型。目前仅支持 CV_32FC1 类型。 |
| ksize | 内核大小。 |
| 锚点 (anchor) | 锚点。默认值 (-1) 表示锚点位于内核中心。 |
| borderMode | 像素外插法。有关详细信息,请参阅 borderInterpolate 。 |
| borderVal | 默认边界值。 |
| Ptr< Filter > cv::cuda::createDerivFilter | ( | int | srcType, |
| int | dstType, | ||
| int | dx, | ||
| int | dy, | ||
| int | ksize, | ||
| bool | normalize=false, | ||
| double | scale = 1, | ||
| int | rowBorderMode=BORDER_DEFAULT, | ||
| int | columnBorderMode=-1 ) |
#include <opencv2/cudafilters.hpp>
创建一个通用的导数 (Deriv) 算子。
| srcType | 源图像类型。 |
| dstType | 目标数组类型。 |
| dx | x 方向的导数阶数。 |
| dy | y 方向的导数阶数。 |
| ksize | 孔径大小。有关详细信息,请参阅 getDerivKernels 。 |
| normalize | 指示是否对滤波器系数进行归一化(缩放)的标志。有关详细信息,请参阅 getDerivKernels 。 |
| scale | 计算出的导数值的可选缩放因子。默认情况下,不应用缩放。有关详细信息,请参阅 getDerivKernels 。 |
| rowBorderMode | 垂直方向的像素外插法。有关详细信息,请参阅 borderInterpolate。 |
| columnBorderMode | 水平方向的像素外插法。 |
| Ptr< Filter > cv::cuda::createGaussianFilter | ( | int | srcType, |
| int | dstType, | ||
| Size | ksize, | ||
| double | sigma1, | ||
| double | sigma2=0, | ||
| int | rowBorderMode=BORDER_DEFAULT, | ||
| int | columnBorderMode=-1 ) |
#include <opencv2/cudafilters.hpp>
创建一个高斯滤波器。
| srcType | 源图像类型。 |
| dstType | 目标数组类型。 |
| ksize | 孔径大小。有关详细信息,请参阅 getGaussianKernel 。 |
| sigma1 | 水平方向的 Gaussian sigma。有关详细信息,请参阅 getGaussianKernel 。 |
| sigma2 | 垂直方向的 Gaussian sigma。如果为 0,则 \(\texttt{sigma2}\leftarrow\texttt{sigma1}\)。 |
| rowBorderMode | 垂直方向的像素外插法。有关详细信息,请参阅 borderInterpolate。 |
| columnBorderMode | 水平方向的像素外插法。 |
| Ptr< Filter > cv::cuda::createLaplacianFilter | ( | int | srcType, |
| int | dstType, | ||
| int | ksize = 1, | ||
| double | scale = 1, | ||
| int | borderMode = BORDER_DEFAULT, | ||
| Scalar | borderVal=Scalar::all(0) ) |
#include <opencv2/cudafilters.hpp>
创建一个拉普拉斯 (Laplacian) 算子。
| srcType | 输入图像类型。支持 CV_8U 、 CV_16U 和 CV_32F 的单通道和四通道图像。 |
| dstType | 输出图像类型。目前仅支持与 src 相同的类型。 |
| ksize | 用于计算二阶导数滤波器的孔径大小(参见 getDerivKernels)。它必须是正数且为奇数。仅支持 ksize = 1 和 ksize = 3。 |
| scale | 计算出的拉普拉斯算子值的可选缩放因子。默认情况下,不应用缩放(参见 getDerivKernels)。 |
| borderMode | 像素外插法。有关详细信息,请参阅 borderInterpolate 。 |
| borderVal | 默认边界值。 |
| Ptr< Filter > cv::cuda::createLinearFilter | ( | int | srcType, |
| int | dstType, | ||
| InputArray | kernel, | ||
| 点 (Point) | anchor=Point(-1, -1), | ||
| int | borderMode = BORDER_DEFAULT, | ||
| Scalar | borderVal=Scalar::all(0) ) |
#include <opencv2/cudafilters.hpp>
创建一个不可分线性 2D 滤波器。
| srcType | 输入图像类型。支持 CV_8U 、 CV_16U 和 CV_32F 的单通道和四通道图像。 |
| dstType | 输出图像类型。目前仅支持与 src 相同的类型。 |
| kernel | 滤波器系数的二维数组。 |
| 锚点 (anchor) | 锚点。默认值 Point(-1, -1) 表示锚点位于内核中心。 |
| borderMode | 像素外插法。有关详细信息,请参阅 borderInterpolate 。 |
| borderVal | 默认边界值。 |
| Ptr< Filter > cv::cuda::createMorphologyFilter | ( | int | op, |
| int | srcType, | ||
| InputArray | kernel, | ||
| 点 (Point) | anchor=Point(-1, -1), | ||
| int | iterations=1 ) |
#include <opencv2/cudafilters.hpp>
创建一个 2D 形态学滤波器。
| op | 形态学操作的类型。可能的类型如下:
|
| srcType | 输入/输出图像类型。仅支持 CV_8UC1、CV_8UC4、CV_32FC1 和 CV_32FC4。 |
| kernel | 形态学操作的 8 位结构元素(二维)。 |
| 锚点 (anchor) | 结构元素内的锚点位置。负值表示锚点位于中心。 |
| iterations | 应用腐蚀和膨胀的次数。 |
| Ptr< Filter > cv::cuda::createRowSumFilter | ( | int | srcType, |
| int | dstType, | ||
| int | ksize, | ||
| int | anchor=-1, | ||
| int | borderMode = BORDER_DEFAULT, | ||
| Scalar | borderVal=Scalar::all(0) ) |
#include <opencv2/cudafilters.hpp>
创建一个水平 1D 盒式滤波器。
| srcType | 输入图像类型。目前仅支持 CV_8UC1 类型。 |
| dstType | 输出图像类型。目前仅支持 CV_32FC1 类型。 |
| ksize | 内核大小。 |
| 锚点 (anchor) | 锚点。默认值 (-1) 表示锚点位于内核中心。 |
| borderMode | 像素外插法。有关详细信息,请参阅 borderInterpolate 。 |
| borderVal | 默认边界值。 |
| Ptr< Filter > cv::cuda::createScharrFilter | ( | int | srcType, |
| int | dstType, | ||
| int | dx, | ||
| int | dy, | ||
| double | scale = 1, | ||
| int | rowBorderMode=BORDER_DEFAULT, | ||
| int | columnBorderMode=-1 ) |
#include <opencv2/cudafilters.hpp>
创建一个垂直或水平的 Scharr 算子。
| srcType | 源图像类型。 |
| dstType | 目标数组类型。 |
| dx | x 方向的导数阶数。 |
| dy | y 方向的导数阶数。 |
| scale | 计算出的导数值的可选缩放因子。默认情况下,不应用缩放。有关详细信息,请参阅 getDerivKernels 。 |
| rowBorderMode | 垂直方向的像素外插法。有关详细信息,请参阅 borderInterpolate。 |
| columnBorderMode | 水平方向的像素外插法。 |
| Ptr< Filter > cv::cuda::createSeparableLinearFilter | ( | int | srcType, |
| int | dstType, | ||
| InputArray | rowKernel, | ||
| InputArray | columnKernel, | ||
| 点 (Point) | anchor = Point(-1,-1), | ||
| int | rowBorderMode=BORDER_DEFAULT, | ||
| int | columnBorderMode=-1 ) |
#include <opencv2/cudafilters.hpp>
创建一个可分线性滤波器。支持就地处理。
| Ptr< Filter > cv::cuda::createSobelFilter | ( | int | srcType, |
| int | dstType, | ||
| int | dx, | ||
| int | dy, | ||
| int | ksize = 3, | ||
| double | scale = 1, | ||
| int | rowBorderMode=BORDER_DEFAULT, | ||
| int | columnBorderMode=-1 ) |
#include <opencv2/cudafilters.hpp>
创建一个 Sobel 算子。
| srcType | 源图像类型。 |
| dstType | 目标数组类型。 |
| dx | x 方向的导数阶数。 |
| dy | y 方向的导数阶数。 |
| ksize | 扩展 Sobel 内核的大小。可能的值为 1、3、5 或 7。 |
| scale | 计算出的导数值的可选缩放因子。默认情况下,不应用缩放。有关详细信息,请参阅 getDerivKernels 。 |
| rowBorderMode | 垂直方向的像素外插法。有关详细信息,请参阅 borderInterpolate。 |
| columnBorderMode | 水平方向的像素外插法。 |