Deskewing photo with a defined line or angle

I am currently in the process of trying to deskew some antique prints, around 10,000 images. I have pretty well figured out how to automate the rest, as novice as it may be, but I am stuck on deskewing and centering the photos. Due to the age, the various aspects are never uniformly angled, so all the options I have found have a 10% chance of straightening successfully. Ideally, the app would display each photo, allow me to define a line to rotate to 90degrees, or an angle measurement tool to subtract that angle from the original angle, and move to the next photo in a que. Deskewing the photo is the priority, but, it would be nice to be able to define a centerline to re-center the photo as well. Thanks

Deskewing photo with a defined line or angle
 
 
Q