Since I don't have a digital camera and it is hard to maintain the same point of view on cell phone, I only shot two pictures for image rectification and two image for mosaic. The rest of the images are collected from the internet. Here are the images shot from my cell phone:
Here comes the most complex part of this project. The target is reshape the original pH = p' equation into a form that the 3 by 3 matrix H becomes a 8 by 1 vector h so that we could use the least square equatoin to solve it; So first, here is the original equation:
Although I only demostrated two image blending here, the function itself could blend any number of imgs together, all the user need to do is take the output of previous round and treat it as a new image and select control point between it and the next image.
The first mosaic:
There are mainly two parts. First of all, I learned how to convert the pH = p' homography equation into the form that could be solved by the least square equation. I believe the method of re-organizing the structure of that linear algebra equation would be useful in the future. The second part I learned is how to develop a big function efficiently, during the implementation of warpImage() function, it come to my notice that write pseudo code first would be very helpful.