diff --git a/Question_11_20/answers_py/answer_17.py b/Question_11_20/answers_py/answer_17.py index c3064c89..8f641dc8 100644 --- a/Question_11_20/answers_py/answer_17.py +++ b/Question_11_20/answers_py/answer_17.py @@ -16,7 +16,11 @@ def BGR2GRAY(img): # laplacian filter def laplacian_filter(img, K_size=3): - H, W, C = img.shape + if len(img.shape) == 3: + H, W, C = img.shape + else: + img = np.expand_dims(img, axis=-1) + H, W, C = img.shape # zero padding pad = K_size // 2