From 70dada42ea242244b527aedc188104b81db863cf Mon Sep 17 00:00:00 2001 From: Colombo Date: Fri, 6 Sep 2019 14:52:46 +0400 Subject: [PATCH] fix --- imagelib/common.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/imagelib/common.py b/imagelib/common.py index 3838c43..2e66441 100644 --- a/imagelib/common.py +++ b/imagelib/common.py @@ -12,8 +12,12 @@ def normalize_channels(img, target_channels): if c == 0 and target_channels > 0: img = img[...,np.newaxis] + c = 1 + if c == 1 and target_channels > 1: img = np.repeat (img, target_channels, -1) + c = target_channels + if c > target_channels: img = img[...,0:target_channels] c = target_channels