Explore Library
Code QuizIntermediate

Applying a 2D Convolution

Identify the argument-order mistake in this filter2D call.

Codepython
import cv2, numpy as np

kernel = np.array([[0, -1, 0],
                   [-1, 5, -1],
                   [0, -1, 0]], dtype=np.float32)
out = cv2.filter2D(img, kernel, -1)

What is the bug in this convolution call?