Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

in a more "modern" world, you'd do:

cv::Mat_<float> kernel(3,3); kernel << -1, -1, -1, 0, 1, 1, 1, 1, 1; .. Mat src = .... Mat dst; filter2D(src, dst, 0, 1, kernel);

in a more "modern" world, you'd do:

cv::Mat_<float> kernel(3,3);
kernel << -1, -1, -1,  0, 1, 1, 1, 1, 1;
..
Mat src = ....
Mat dst;
filter2D(src, dst, 0, 1, kernel);

kernel);

in a more "modern" world, you'd do:

cv::Mat_<float> kernel(3,3);
kernel << -1, -1, -1,  0, 1, 1, 1, 1, 1;
..
Mat src = ....
Mat dst;
filter2D(src, dst, 0, 1, -1, kernel);

in a more "modern" world, you'd do:

cv::Mat_<float> kernel(3,3);
kernel << -1, -1, -1,
          -1, 0, 1,
 0, 1, 1,  1, 1, 1;
..
Mat src = ....
Mat dst;
filter2D(src, dst, -1, kernel);

in a more "modern" world, you'd do:

cv::Mat_<float> kernel(3,3);
kernel << -1, -1, -1,
          -1, 0, 1,
           1, 1, 1;
..
Mat src = ....
... // your input.
Mat dst;
dst;      // output. intentionally left blank.
filter2D(src, dst, -1, kernel);