I'm trying to do an image stitch using OpenCV by doing SIFT->KNN->warpPerspective. There are whole lot of resource on how to warp the image on the right to be stitched on to the destination on the left. I've tried calculating the homography matrix for warping left image to be stitched to the right and that seems to work. Problem is, I can't stitch the image together with cv2.warpPerspective since it seems to put the image in where it should be if the right side image is warped.
My code is basically:
result = cv2.warpPerspective(left, H, (left.shape[1] + right.shape[1], left.shape[0])
result[0:right.shape[0], result.shape[1]-right[1]:] = right
But this creates image offset shifted to the right. How could I stitch the images correctly?