1. 程式人生 > >矩陣掩膜操作-API呼叫

矩陣掩膜操作-API呼叫

#include <opencv2/opencv.hpp>
#include <iostream>

using namespace std;
using namespace cv;

int main() {
    Mat src = imread("D:/a.jpg");
    imshow("input image", src);
    Mat dst;
    Mat kernel = (Mat_<int>(3, 3) << 0, -1, 0, -1, 5, -1, 0, -1, 0);
    filter2D(src, dst, -1, kernel);
    imshow("dst"
, dst); waitKey(0); return 0; }