From 7d4ccc2450bead5098404953256a254e003a6360 Mon Sep 17 00:00:00 2001 From: bmad4ever Date: Fri, 20 Oct 2023 17:21:25 +0100 Subject: [PATCH] Update optical_flow.py only access required shape values; this minor change enables the use of single-channel images in remap. --- optical_flow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/optical_flow.py b/optical_flow.py index 13078f8..decc74a 100644 --- a/optical_flow.py +++ b/optical_flow.py @@ -36,7 +36,7 @@ def remap(img, flow, border_mode = cv2.BORDER_REFLECT_101): def center_crop_image(img, w, h): - y, x, _ = img.shape + y, x = img.shape[:2] width_indent = int((x - w) / 2) height_indent = int((y - h) / 2) cropped_img = img[height_indent:y-height_indent, width_indent:x-width_indent]