Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Question_11_20/answers_py/answer_17.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down