I followed Panorama – Image Stitching in OpenCV to do same task on Android,by using openCV4Android
.My problem is in about warping image by founded homography matrix.I tested these images:
image1:
image2:
Result of warping image1 by founded homography is:
You can see that result is good warped but first part of that(left side) is cut! So stitching result was:
And result of above images in referenced link page,is:
Why warping by homography cut that?Or may be I did some things wrong?
OK! Finally I could solve the problem.I saw this answer and understand what causes this problem and how I can solve that:
The problem occurs because the homography maps part of the image to negative x,y values which are outside the image area so cannot be plotted. what we wish to do is to offset the warped output by some number of pixels to 'shunt' the entire warped image into positive coordinates(and hence inside the image area)...So just premultiply your homography by a matrix similar to the above, and your output image will be offset.