Mat kernel = (Mat_ (3, 3) << 0, -1, 0, -1, 5, -1, 0, -1, 0); definition of the 3 × 3 convolution kernel.
filter2D (src, dst, src.depth ( ), kernel); for convolving kernel using src, dst and then placed in the results.