I have calculated homography ,taken out perspective transform .I am able two display two images in one window but unable to merge them.Here are my example images->
OpenCV already has image stitching implemented. If you compile with "-D BUILD_EXAMPLES", you can use the binary stitching_detailed. The usage is simple: ./stitching_detailed img1 img2 ...
Or, you can just use the stitcher class (example from here):
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/stitching/stitcher.hpp"
using namespace std;
using namespace cv;
bool try_use_gpu = false;
string result_name = "result.jpg";
int main(int argc, char* argv[])
{
vector imgs;
// add images...
Mat pano;
Stitcher stitcher = Stitcher::createDefault(try_use_gpu);
stitcher.stitch(imgs, pano);
imwrite(result_name, pano);
}