1 year ago

#361074

test-img

alihank

Couldn't find homography while image stitching

I am trying to stitch multiple images. At first 9 photo my code works well, when it comes to stitch one more couple images(left and right) it couldn't find any homography and returns an error message like: "The input arrays should have at least 4 corresponding point sets to calculate Homography". In below you can see part of my code. I can't figure it out how to deal with that or what is the wrong with my code.

def get_transform(src, dst):
    first_points, second_points = feature_matching(src, dst)

    src_pts = np.float32(first_points).reshape(-1, 1, 2)
    dst_pts = np.float32(second_points).reshape(-1, 1, 2)
    M, mask = cv2.findHomography(src_pts, dst_pts, cv2.RANSAC)

return M, first_points, second_points, mask

python-3.x

opencv

homography

image-stitching

0 Answers

Your Answer

Accepted video resources