I am working on a Computer Vision problem (https://www.kaggle.com/c/tensorflow-great-barrier-reef) in which we're given pictures of coral reefs and asked to locate a certain kind of starfish that preys on coral. The pictures are taken from a camera looking obliquely at the surface of the coral, and there is perspective distortion that effectively changes the local magnification of the pictures. I would like to characterize the perspective distortion at each point in the image, assigning to each pixel some parameters (e.g., magnification, keystone-ing). My plan is to use this "perspective distortion field" as an additional input to the Convolutional Neural Net that is doing the object detection.
So, my question: given a geometric camera model (position, orientation, focal length), is there an analytic formula for characterizing perspective distortion and calculating the perspective distortion field?