Stitching images in python
Question: I would like to stitch multiple (5 or 6) images using python. I'm new to
python but I want to use this since it runs on the server and is opensource.
OpenCV seems very well capable of doing this and would be my prefered option,
but the functions are mostly in C++ and I can't find any example that does it
in python (although it should be capable). I found this link:
<http://richardt.name/teaching/supervisions/vision-2011/practical/> but I
think that I'm not capable of doing the exercise.

I also found a lot about panotools and Hugin. Hugin is supposed to be able to
do the stitching using HSI (Hugin Scripting Interface) but the documentation
is very scarce. The example I found should maybe work, but I can't get Hugin
and HSI to work in python, there is no explaination on how to install/import
the library.

Is there anyone that can help me with this? I come from programming in php and
am really new to Python, OpenCV and Hugin.

Many thanks


Answer: I think this is the code you want  

    
    
    import cv2
    import numpy as np
    
    img1 = cv2.imread('Bird1.jpg')
    img2 = cv2.imread('Bird2.jpg')
    
    img3 = np.hstack((img1,img2))
    cv2.imwrite('Bird3.jpg',img3)
    

Note : These two input images size(height,width) should be same.  
Input Image:-

![enter image description here](http://i.stack.imgur.com/lT0tZ.jpg)

  
Output Image :-  
![enter image description here](http://i.stack.imgur.com/pM63v.png)

