I'm trying to implement an automatic focus stacking algorithm. The scene and the camera position is static, but the view angle changes with focus length. I can take several images, and I have direct API controll over the focus lenses. Is there any robust automatic method to allign the images? Or any method to calibrate the setup? (measure the angles)