I believe it would a homography transform, which is less constrained than an affine transform, as it does not preserve parallel lines/angles. Instead it maps lines to lines as a way to adjust perspective.
You could also just use the corners to compute the homograph transform.
Really depends on the constraints too. If you're going for archival quality scans then maybe it would be better to do it with hardware. At that point I'd just get a way higher res camera than needed, transform and down sample as needed. Would still probably be cheaper than a gimbal.