Join Images

Learn how to join images horizontally and vertically.

While editing, we may want to join images to display more of the images at once, perhaps to make them more visually appealing. We’ll be doing precisely that in this lesson.

Joining images horizontally

To join images horizontally, we use the hconcat() method of the OpenCV library. The parameters of this function are all the images we want to stack horizontally, and we have to add the variable of the image that’ll store the final joined image.

hconcat(img1,img2,finalImg);

There are two different images, img1 and img2, that’ll be joined horizontally and stored in the variable finalImg.

Note: All the images to be stacked should be the same size.

Get hands-on with 1400+ tech skills courses.