just do it

与其苟延残喘,不如纵情燃烧

Sobel算子

函数原型

void Sobel(
    InputArray src,            
    OutputArray dst,
    int ddepth,                //图像深度
    int dx,                    //x,y方向的差分阶数
    int dy,
    int ksize=3,                //sobel核的大小,必须取1,3,5 or 7
    double scale=1,
    double delta=0,
    int borderType=BORDER_DEFAULT);

其中图像深度的取值支持如下组合

  • 若src.depth()=CV_8U, 取ddepth=-1/CV_16S/CV_32F/CV_64F
  • 若src.depth()=CV_16U/CV_16S, 取ddepth=-1/CV_32F/CV_64F
  • 若src.depth()=CV_32F, 取ddepth=-1/CV_32F/CV_64F
  • 若src.depth()=CV_64F, 取ddepth=-1/CV_64F

在interface.h文件中定义

#define CV_8U   0
#define CV_8S   1
#define CV_16U  2
#define CV_16S  3
#define CV_32S  4
#define CV_32F  5
#define CV_64F  6
#define CV_16F  7
posted @ 2019-05-13 16:16  elong1995  阅读(190)  评论(0编辑  收藏  举报