From 1d0465a8df9b1c88c5d3591c7762a0ee84a4b0d1 Mon Sep 17 00:00:00 2001 From: muniyagoyal <56516947+muniyagoyal@users.noreply.github.com> Date: Sun, 13 Oct 2019 23:47:22 +0530 Subject: [PATCH] better with this --- concatimages.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/concatimages.py b/concatimages.py index 4d400bf..67c0603 100644 --- a/concatimages.py +++ b/concatimages.py @@ -7,6 +7,18 @@ i1=cv2.resize(picture,(600,450)) i2=cv2.resize(picture,(600,450)) print(i2.shape,i1.shape) + + if isinstance(colors, str): + cmap = cm.get_cmap(colors, N) + cmap = cmap(np.arange(N)) + colors = cmap[::-1,:].tolist() + if isinstance(colors, list): + if len(colors) == N: + colors = colors[::-1] + else: + raise Exception("\n\nnumber of colors {} not equal \ + to number of categories{}\n".format(len(colors), N)) + nhorizontal=np.hstack((i1,i2)) cv2.imshow("combined",nhorizontal) cv2.waitKey(0)