From 129b26bd797e7d4e3f3116f2e1d3eeaf7f7a3ac0 Mon Sep 17 00:00:00 2001 From: Zpadger <31385823+Zpadger@users.noreply.github.com> Date: Wed, 4 Dec 2019 17:33:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=BA=86=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 还是HWC的传值问题,我已经在yoyoyo那里提交了 --- Question_11_20/answers_py/answer_17.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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