Hello,
I have 3 photos taken from the same point of view at years 2014, 2017 and 2020. I’d like to align theses photos using controls points and a perspective transformation.
I’ve computed the following perspectives matrices :
M1 transform from 2017 to 2014
M2 transform from 2020 to 2014.
The alignment is very good !
I thought I could align the picture from 2017 to the picture from 2020 by combining 2 successive transformations (M1 following inverse of M2). It work great if I decompose the steps with 2 calls of warpPerspective()
M2 = np.linalg.inv(M2)
im = cv2.warpPerspective(im, M1, (w, h))
im = cv2.warpPerspective(im, M2, (w, h))
But if I try to combine the 2 matrices with a dot product, then the alignment is not as perfect.
M = np.dot(M1, M2)
im = cv2.warpPerspective(im, M, (w, h))
Left is the picture from 2020, right the result of the 2 successive transformations and then on right comparison, the result of the dot product
I thought I’d get the same result. Anyone can help me to understand what’s can be wrong in this assumption ?
thanks you very much