diff --git a/Question_11_20/answers_py/answer_18.py b/Question_11_20/answers_py/answer_18.py index 79f6c626..b44f720b 100644 --- a/Question_11_20/answers_py/answer_18.py +++ b/Question_11_20/answers_py/answer_18.py @@ -15,7 +15,11 @@ def BGR2GRAY(img): # emboss filter def emboss_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