sepFilter2D函数
生活随笔
收集整理的這篇文章主要介紹了
sepFilter2D函数
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
sepFilter2D函數
函數功能:
sepFilter2D() 用分解的核函數對圖像做卷積。首先,圖像的每一行與一維的核kernelX做卷積;然后,運算結果的每一列與一維的核kernelY做卷積
調用格式:
void?sepFilter2D(InputArray?src, OutputArray?dst, int?ddepth, InputArray?kernelX, InputArray?kernelY, Pointanchor=Point(-1,-1), double?delta=0, int?borderType=BORDER_DEFAULT?)
參數詳解:
InputArray?src:輸入圖像
OutputArray?dst:輸出圖像
?int?ddepth:輸出圖像的深度
The following combination of?src.depth()?and?ddepth?are supported:
- 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
InputArray?kernelX:x方向的卷積核
InputArray?kernelY:y方向的卷積核
Pointanchor=Point(-1,-1):處理的像素是核中心的像素
double?delta=0:表示像素是不是加增量
int?borderType=BORDER_DEFAULT:圖像邊界的處理方式
opencv代碼:
#include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <iostream> #include<stdlib.h> using namespace cv; using namespace std;int main() {Mat src, dst;src = imread("D:6.jpg");Mat kx = (Mat_<float>(1, 3) << 0,-1,0);Mat ky = (Mat_<float>(1, 3) << -1,0, -1);sepFilter2D(src, dst, src.depth(),kx,ky,Point(-1,-1),0,BORDER_DEFAULT );imshow("shiyan", dst);waitKey(0);return 0; }
總結
以上是生活随笔為你收集整理的sepFilter2D函数的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: pyrMeanShiftFilterin
- 下一篇: smooth函数