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
12 changes: 12 additions & 0 deletions concatimages.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down