表格线识别通用库文档
载入中...
搜索中...
未找到
cm::imp::EdgeDetection类 参考

图像边缘检测预处理动作 更多...

#include <image_preprocess.hpp>

类 cm::imp::EdgeDetection 继承关系图:
cm::imp::EdgeDetection 的协作图:

struct  CannyEdgeDection
 Canny算子
 
struct  DoGEdgeDection
 DoG算子
 
struct  LaplacianEdgeDection
 Laplacian算子
 
struct  PrewittEdgeDection
 Prewitt算子
 
struct  RobertsEdgeDection
 Roberts算子
 
struct  ScharrEdgeDection
 Scharr算子
 
struct  SobelEdgeDection
 Sobel算子
 

Public 成员函数

 EdgeDetection (const SobelEdgeDection &_, int ddepth=-1, int dx=1, int dy=1, int ksize=3, double scale=1, double delta=0, int type=cv::BORDER_DEFAULT)
 边缘检测动作的构造函数
 
 EdgeDetection (const ScharrEdgeDection &_, int ddepth=-1, int dx=0, int dy=1, double scale=1, double delta=0, int type=cv::BORDER_DEFAULT)
 边缘检测动作的构造函数
 
 EdgeDetection (const LaplacianEdgeDection &_, int ddepth=-1, int ksize=1, double scale=1, double delta=0, int type=cv::BORDER_DEFAULT)
 边缘检测动作的构造函数
 
 EdgeDetection (const CannyEdgeDection &_, double threshold1=100, double threshold2=200, int aperture_size=3, bool l2_gradient=false)
 边缘检测动作的构造函数
 
 EdgeDetection (const RobertsEdgeDection &_, int ddepth=-1, cv::Mat kernel=(cv::Mat_< float >(2, 2)<< 1, 0, 0, -1), cv::Point anchor=cv::Point(-1, -1), double delta=0, int type=cv::BORDER_DEFAULT)
 边缘检测动作的构造函数
 
 EdgeDetection (const PrewittEdgeDection &_, int ddepth=-1, cv::Mat kernel=(cv::Mat_< float >(3, 3)<< -1, 0, 1, -1, 0, 1, -1, 0, 1), cv::Point anchor=cv::Point(-1, -1), double delta=0, int type=cv::BORDER_DEFAULT)
 边缘检测动作的构造函数
 
 EdgeDetection (const DoGEdgeDection &_, int ddepth=-1, cv::Mat kernel=(cv::Mat_< float >(5, 5)<< 0, 0, 1, 0, 0, 0, 1, 2, 1, 0, 1, 2, -16, 2, 1, 0, 1, 2, 1, 0, 0, 0, 1, 0, 0), cv::Point anchor=cv::Point(-1, -1), double delta=0, int type=cv::BORDER_DEFAULT)
 边缘检测动作的构造函数
 
 EdgeDetection (const EdgeDetection &edge_detection)=default
 边缘检测类默认构造函数
 
 ~EdgeDetection ()=default
 边缘检测类析构函数
 
cv::Mat Preprocess (const cv::Mat &image) const override
 预处理图像
 
- Public 成员函数 继承自 cm::ImagePreprocessor
 ImagePreprocessor ()=default
 图像预处理器类的默认构造函数
 
 ImagePreprocessor (const ImagePreprocessor &img_preprocessor)=default
 图像预处理器类的拷贝构造函数
 
virtual ~ImagePreprocessor ()=default
 图像预处理器类的析构函数
 
ImagePreprocessor operator| (const ImagePreprocessor &img_preprocessor) const
 图像预处理器类重载 | 运算符
 
ImagePreprocessoroperator|= (const ImagePreprocessor &img_preprocessor)
 图像预处理器类重载 |= 运算符
 
ImagePreprocessorAddAction (const ImagePreprocessor &img_preprocessor)
 增加图像预处理动作
 
cv::Mat operator() (const cv::Mat &image) const
 图像预处理器类重载括号运算符
 

静态 Public 属性

static const struct cm::imp::EdgeDetection::SobelEdgeDection SOBEL
 Sobel 算子
 
static const struct cm::imp::EdgeDetection::ScharrEdgeDection SCHARR
 Scharr 算子
 
static const struct cm::imp::EdgeDetection::LaplacianEdgeDection LAPLACIAN
 Laplacian 算子
 
static const struct cm::imp::EdgeDetection::CannyEdgeDection CANNY
 Canny 算子
 
static const struct cm::imp::EdgeDetection::RobertsEdgeDection ROBERTS
 Roberts 算子
 
static const struct cm::imp::EdgeDetection::PrewittEdgeDection PREWITT
 Prewitt 算子
 
static const struct cm::imp::EdgeDetection::DoGEdgeDection DOG
 DoG 算子
 

详细描述

图像边缘检测预处理动作

该类共有继承 ImagePreprocessor ,用于对图像进行各种边缘检测。

注意
支持任意通道图
作者
dreamy-xay
日期
2023-12-17

在文件 image_preprocess.hpp335 行定义.

构造及析构函数说明

◆ EdgeDetection() [1/8]

cm::imp::EdgeDetection::EdgeDetection ( const SobelEdgeDection & _,
int ddepth = -1,
int dx = 1,
int dy = 1,
int ksize = 3,
double scale = 1,
double delta = 0,
int type = cv::BORDER_DEFAULT )
inlineexplicit

边缘检测动作的构造函数

该函数用于基于 Sobel 算子计算图像的边缘,并根据提供的参数进行设置。可以指定输出图像的深度、导数阶数、卷积核大小、缩放因子等参数,进而调整边缘检测的效果。

参数
_使用 Sobel 算子计算边缘
ddepth输出图像的深度,取值范围为CV_8U、CV_16U、CV_16S、CV_32F或CV_64F。如果该值为-1,则输出图像的深度与输入图像的深度相同, 默认值为 -1
dxx方向上的导数阶数,取值为0、1或2, 默认值为 1
dyy方向上的导数阶数,取值为0、1或2, 默认值为 1
ksizeSobel 算子的卷积核大小,必须是1、3、5、7等奇数, 默认值为 3
scale缩放因子,可以用来调整输出图像中像素值的幅度, 默认值为 1
delta偏移量,可以用来调整输出图像中像素值的基准线, 默认值为 0
type边界处理方式,可以指定如何处理输入图像的边界, 默认值为 cv::BORDER_DEFAULT
作者
justliulong
日期
2024-01-27

在文件 image_preprocess.hpp401 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ EdgeDetection() [2/8]

cm::imp::EdgeDetection::EdgeDetection ( const ScharrEdgeDection & _,
int ddepth = -1,
int dx = 0,
int dy = 1,
double scale = 1,
double delta = 0,
int type = cv::BORDER_DEFAULT )
inlineexplicit

边缘检测动作的构造函数

该函数用于基于 Scharr 算子获取图像的边缘,并根据提供的参数进行设置。可以指定输出图像的深度、导数阶数、缩放因子等参数,进而调整边缘检测的效果。

参数
_使用 Scharr 算子来获取图像边缘
ddepth输出图像的深度,取值范围为CV_8U、CV_16U、CV_16S、CV_32F或CV_64F。如果该值为-1,则输出图像的深度与输入图像的深度相同, 默认值为 -1
dxx方向上的导数阶数,取值为0或1, 默认值为 1
dyy方向上的导数阶数,取值为0或1, 默认值为 1
scale缩放因子,可以用来调整输出图像中像素值的幅度, 默认值为 1
delta偏移量,可以用来调整输出图像中像素值的基准线, 默认值为 0
type边界处理方式,可以指定如何处理输入图像的边界, 默认值为 cv::BORDER_DEFAULT
作者
justliulong
日期
2024-01-27

在文件 image_preprocess.hpp420 行定义.

函数调用图:

◆ EdgeDetection() [3/8]

cm::imp::EdgeDetection::EdgeDetection ( const LaplacianEdgeDection & _,
int ddepth = -1,
int ksize = 1,
double scale = 1,
double delta = 0,
int type = cv::BORDER_DEFAULT )
inlineexplicit

边缘检测动作的构造函数

该函数用于利用 Laplacian 算子计算图像的边缘,并根据提供的参数进行设置。可以指定输出图像的深度、卷积核大小、缩放因子等参数,从而调整边缘检测的效果。

参数
_使用 Laplacian 算子计算图像边缘
ddepth输出图像的深度,取值范围为CV_8U、CV_16U、CV_16S、CV_32F或CV_64F。如果该值为-1,则输出图像的深度与输入图像的深度相同, 默认值为 -1
ksizeLaplacian 算子的卷积核大小,必须是1、3、5等奇数, 默认值为 1
scale缩放因子,可以用来调整输出图像中像素值的幅度, 默认值为 1
delta偏移量,可以用来调整输出图像中像素值的基准线, 默认值为 0
type边界处理方式,可以指定如何处理输入图像的边界, 默认值为 cv::BORDER_DEFAULT
作者
justliulong
日期
2024-01-27

在文件 image_preprocess.hpp438 行定义.

函数调用图:

◆ EdgeDetection() [4/8]

cm::imp::EdgeDetection::EdgeDetection ( const CannyEdgeDection & _,
double threshold1 = 100,
double threshold2 = 200,
int aperture_size = 3,
bool l2_gradient = false )
inlineexplicit

边缘检测动作的构造函数

该函数用于利用 Canny 算子获取图像的边缘,并根据提供的参数进行设置。可以指定阈值、Sobel算子的孔径大小、梯度计算方式等参数,从而调整边缘检测的效果。

参数
_使用 Canny 算子获取图像边缘
threshold1第一个阈值,用于控制边缘的强度 默认值为 100
threshold2第二个阈值,用于控制边缘的弱度 默认值为 200
aperture_sizeSobel算子的孔径大小,用于求取图像的梯度, 默认值为 3
l2_gradient布尔值,表示是否使用L2范数进行梯度计算。如果设置为true,则使用L2范数;如果设置为false,则使用L1范数, 默认值为 false
作者
justliulong
日期
2024-01-27

在文件 image_preprocess.hpp455 行定义.

函数调用图:

◆ EdgeDetection() [5/8]

cm::imp::EdgeDetection::EdgeDetection ( const RobertsEdgeDection & _,
int ddepth = -1,
cv::Mat kernel = (cv::Mat_<float>(2, 2) << 1, 0, 0, -1),
cv::Point anchor = cv::Point(-1, -1),
double delta = 0,
int type = cv::BORDER_DEFAULT )
inlineexplicit

边缘检测动作的构造函数

该函数用于利用 Roberts 算子获取图像的边缘,并根据提供的参数进行设置。可以指定输出图像的深度、卷积核、锚点位置、偏移量、边界处理方式等参数,从而调整边缘检测的效果。

参数
_使用 Roberts 算子获取图像边缘
ddepth输出图像的深度,取值范围为CV_8U、CV_16U、CV_16S、CV_32F或CV_64F。如果该值为-1,则输出图像的深度与输入图像的深度相同, 默认值为 -1
kernel卷积核,用于指定滤波器的权重, 默认值为
[1, 0],
 [0, -1]
anchor锚点位置,用于指定卷积核的中心位置,表示卷积核的中心位置 默认值为 (-1,-1)
delta偏移量,可以用来调整输出图像中像素值的基准线, 默认值为 0
type边界处理方式,可以指定如何处理输入图像的边界, 默认值为 cv::BORDER_DEFAULT
作者
justliulong
日期
2024-01-27

在文件 image_preprocess.hpp475 行定义.

函数调用图:

◆ EdgeDetection() [6/8]

cm::imp::EdgeDetection::EdgeDetection ( const PrewittEdgeDection & _,
int ddepth = -1,
cv::Mat kernel = (cv::Mat_<float>(3, 3) << -1, 0, 1, -1, 0, 1, -1, 0, 1),
cv::Point anchor = cv::Point(-1, -1),
double delta = 0,
int type = cv::BORDER_DEFAULT )
inlineexplicit

边缘检测动作的构造函数

该函数用于利用 Prewitt 算子获取图像的边缘,并根据提供的参数进行设置。可以指定输出图像的深度、卷积核、锚点位置、偏移量、边界处理方式等参数,从而调整边缘检测的效果。

参数
_使用 Prewitt 算子获取图像边缘
ddepth输出图像的深度,取值范围为CV_8U、CV_16U、CV_16S、CV_32F或CV_64F。如果该值为-1,则输出图像的深度与输入图像的深度相同, 默认值为 -1
kernel卷积核,用于指定滤波器的权重, 默认值为
[-1, 0, 1],
 [-1, 0, 1],
 [-1, 0, 1]
anchor锚点位置,用于指定卷积核的中心位置,表示卷积核的中心位置 默认值为 (-1,-1)
delta偏移量,可以用来调整输出图像中像素值的基准线, 默认值为 0
type边界处理方式,可以指定如何处理输入图像的边界, 默认值为 cv::BORDER_DEFAULT
作者
justliulong
日期
2024-01-27

在文件 image_preprocess.hpp496 行定义.

函数调用图:

◆ EdgeDetection() [7/8]

cm::imp::EdgeDetection::EdgeDetection ( const DoGEdgeDection & _,
int ddepth = -1,
cv::Mat kernel = (cv::Mat_<float>(5, 5) << 0, 0, 1, 0, 0, 0, 1, 2, 1, 0, 1, 2, -16, 2, 1, 0, 1, 2, 1, 0, 0, 0, 1, 0, 0),
cv::Point anchor = cv::Point(-1, -1),
double delta = 0,
int type = cv::BORDER_DEFAULT )
inlineexplicit

边缘检测动作的构造函数

该函数用于利用 DoG(Difference of Gaussians)算子获取图像的边缘,并根据提供的参数进行设置。可以指定输出图像的深度、卷积核、锚点位置、偏移量、边界处理方式等参数,从而调整边缘检测的效果。

参数
_使用 DoG 算子获取图像边缘
ddepth输出图像的深度,取值范围为CV_8U、CV_16U、CV_16S、CV_32F或CV_64F。如果该值为-1,则输出图像的深度与输入图像的深度相同, 默认值为 -1
kernel卷积核,用于指定滤波器的权重, 默认值为
[0, 0, 1, 0, 0],
 [0, 1, 2, 1, 0],
 [1, 2, -16, 2, 1],
 [0, 1, 2, 1, 0],
 [0, 0, 1, 0, 0]
anchor锚点位置,用于指定卷积核的中心位置,表示卷积核的中心位置 默认值为 (-1,-1)
delta偏移量,可以用来调整输出图像中像素值的基准线, 默认值为 0
type边界处理方式,可以指定如何处理输入图像的边界, 默认值为 cv::BORDER_DEFAULT
作者
justliulong
日期
2024-01-27

在文件 image_preprocess.hpp519 行定义.

函数调用图:

◆ EdgeDetection() [8/8]

cm::imp::EdgeDetection::EdgeDetection ( const EdgeDetection & edge_detection)
default

边缘检测类默认构造函数

◆ ~EdgeDetection()

cm::imp::EdgeDetection::~EdgeDetection ( )
default

边缘检测类析构函数

成员函数说明

◆ Preprocess()

cv::Mat cm::imp::EdgeDetection::Preprocess ( const cv::Mat & image) const
inlineoverridevirtual

预处理图像

此函数根据指定的边缘检测类型对输入图像进行预处理。处理后的图像更易于进行边缘检测或其他相关操作。

参数
image需要预处理的图像
注意
函数中输入的图像对通道数没有要求,可以是单通道或者彩色三通道图像
返回
返回预处理后的图像
作者
justliulong
日期
2024-01-27

重载 cm::ImagePreprocessor .

在文件 image_preprocess.hpp541 行定义.

类成员变量说明

◆ CANNY

const EdgeDetection::CannyEdgeDection cm::imp::EdgeDetection::CANNY
static

Canny 算子

在文件 image_preprocess.hpp576 行定义.

◆ DOG

const EdgeDetection::DoGEdgeDection cm::imp::EdgeDetection::DOG
static

DoG 算子

在文件 image_preprocess.hpp582 行定义.

◆ LAPLACIAN

const EdgeDetection::LaplacianEdgeDection cm::imp::EdgeDetection::LAPLACIAN
static

Laplacian 算子

在文件 image_preprocess.hpp574 行定义.

◆ PREWITT

const EdgeDetection::PrewittEdgeDection cm::imp::EdgeDetection::PREWITT
static

Prewitt 算子

在文件 image_preprocess.hpp580 行定义.

◆ ROBERTS

const EdgeDetection::RobertsEdgeDection cm::imp::EdgeDetection::ROBERTS
static

Roberts 算子

在文件 image_preprocess.hpp578 行定义.

◆ SCHARR

const EdgeDetection::ScharrEdgeDection cm::imp::EdgeDetection::SCHARR
static

Scharr 算子

在文件 image_preprocess.hpp572 行定义.

◆ SOBEL

const EdgeDetection::SobelEdgeDection cm::imp::EdgeDetection::SOBEL
static

Sobel 算子

在文件 image_preprocess.hpp570 行定义.


该类的文档由以下文件生成: