private void Filter2D(double kernel, double[] kern, Mat image)
{
Mat my_kernel = new Mat((int)kernel, (int)kernel, kern);
Cv2.Filter2D(image, image, -1, my_kernel);
}

улучши код используя using to dispose
 Write your response with at least 250 words.
user