def _solve(img1, img2):
h, w, d = img1.shape
# step 1: Find homography of 2 images
homo = homography(img2, img1)
# step 2: warp image2 to image1 frame
img2_w = cv.warpPerspective(img2, homo, (w, h))
# step 3: resolve highlights by picking the best pixels out of two images
im1 = _resolve_spec(img1, img2_w)
# step 4: repeat the same process for Image2 using warped Image1
im_w = cv.warpPerspective(im1, np.linalg.inv(homo), (w, h))
im2 = _resolve_spec(img2, im_w)
return im1, im2
评论列表
文章目录