边缘检测

一般步骤:(1)滤波(2)增强(3)检测
1 Canny()函数
void Canny(InputArray image,OutputArray edges,double threshold1,double threshold2,int apertureSize=3,bool L2gradient=false)

2 sobel算子
void Sobel(InputArray src,OutputArray dst,int ddepth,int dx,int dy,int ksize=3,double scale=1,double delta=0,int borderType=BORDER_DEFAULT);
{{uploading-image-829012.png(uploading...)}}
3 Laplacian算子
Laplacian()函数:void Laplacian(InputArray src,OutputArray dst,int ddepth,int ksize=1,double scale=1,double delta=0,intborderType=BORDER_DEFAULT);

4 scharr滤波器
使用Scharr滤波器运算符计算x或y方向的图像差分。其实它的参数变量和Sobel基本上一样,除了没有ksize核的大小
void Scharr(InputArray sec//源图,OutputArray dst//目标图,int ddepth,int dx//x方向上的差分阶数,int dy,double scale=1//缩放因子,double delta=0,//delta值,intborderType=BORDER_DEFAULT)//边界模式

原文地址:https://www.cnblogs.com/shuguomeifuguo/p/11992362.html