A telecentric lens would fix the scaling issue, but they usually don't have a large depth of field. You would only be able to move a small distance before being unable to focus.
I would just figure out the mm/pixel for several heights, and see if you can fit a curve through the points.
Bruce
Bruce Ammons
Ammons Engineering