how to display 2 images in one ? [closed]
I read an image: im=cv2.imread('image.jpg')
I divide it into 2 pictures:
im1=im[0:199,0:99]
im2=im[200:399,0:99]
I display im1
and im2
separately. It is ok.
But now, I want to save im1
and im2
in combine
and display combine
which must display me the same image as im
. How can I fulfill this ?
This is a duplicate: here is the answer
@thdrksdfthmn thank you. In fact I have 4 blocks of the same image, all of them with the same size. Can I use push_back in this case too ?
@thdrksdfthmn I tried but the push_back does not exist in Python/numpy
Use np.hstack, np.vstack or np.concatenate, e.g. np.concatenate( [im1,im2], axis=1).
@Guanta thank you very much. Your idea works fine