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)