gray2b = cv2.warpAffine(gray2, Minv, shape(gray2.T))
figure(figsize=(10, 10))
imshow(gray1, cmap=cm.gray, alpha=0.5)
plot(x1[ind1], y1[ind1], 'b-')
imshow(gray2b, cmap=cm.gray, alpha=0.5)
axis([0, 1500, 1000, 0])
title('image1 and transformed image2 overlain with 50% transparency')
Аффинное преобразование между контурами в OpenCV