polyTEM.tomography.alignment.chain_affine_transformation_mats

polyTEM.tomography.alignment.chain_affine_transformation_mats(M0, M1)

Chaining affine transformations given by M0 and M1 matrices to use with OpenCV2 warpAffine.

Written by Rotem on StackOverflow https://stackoverflow.com/questions/75388906/how-to-rotate-and-translate-an-image-with-opencv-without-losing-off-screen-data

M0 - 2x3 matrix applying the first affine transformation (e.g rotation). M1 - 2x3 matrix applying the second affine transformation (e.g translation). The method returns M - 2x3 matrix that chains the two transformations M0 and M1 (e.g rotation then translation in a single matrix).