import sys h, w = input().strip().split() h = int(h) w = int(w) img = [] for i in range(h): line = sys.stdin.readline().strip() line = list(map(int, line.split(' '))) img.append(line) kernel = [] m = int(input()) for i in range(m): line = sys.stdin.r…
filter2D Convolves an image with the kernel. C++: void filter2D(InputArray src, OutputArray dst, int ddepth, InputArraykernel, Point anchor=Point(-1,-1), double delta=0, int borderType=BORDER_DEFAULT ) Python: cv2.filter2D(src, ddepth, kernel[, dst[,…