https://en.wikipedia.org/wiki/Standard-gauge_railway << This makes for fun reading if you're interested in that sort of thing.
Relevant passage
A popular legend that has circulated since at least 1937[8] traces the origin of the 1,435 mm (4 ft 8+1⁄2 in) gauge even further back than the coalfields of northern England, pointing to the evidence of rutted roads marked by chariot wheels dating from the Roman Empire.[a][9] Snopes categorised this legend as "false", but commented that it "is perhaps more fairly labeled as 'Partly true, but for trivial and unremarkable reasons.'"[10] The historical tendency to place the wheels of horse-drawn vehicles around 5 ft (1,524 mm) apart probably derives from the width needed to fit a carthorse in between the shafts.[10] Research, however, has been undertaken to support the hypothesis that "the origin of the standard gauge of the railway might result from an interval of wheel ruts of prehistoric ancient carriages".[11]Old school Open-CV was able to see tracks well from an onboard monocular camera, but calibration and scale was annoying. Track width is accurate enough that I was able to use it to input a bunch of head-end video to map the tracks.
It was mostly just a modified edge detect where the tracks approximately would be. Once finding the tracks, you could automatically calculate the camera's height, lateral location, and angle.
Since GPS is quite likely going to be unavailable at the time of use.
This Wikipedia entry isn't what I had in mind, but it describes an interesting analog mechanism,
- "For guidance systems based solely on star tracking, some sort of recording mechanism, typically a magnetic tape, was pre-recorded with a signal that represented the angle of the star over the period of a day. At launch, the tape was forwarded to the appropriate time.[2] During the flight, the signal on the tape was used to roughly position a telescope so it would point at the expected position of the star. At the telescope's focus was a photocell and some sort of signal-generator, typically a spinning disk known as a chopper. The chopper causes the image of the star to repeatedly appear and disappear on the photocell, producing a signal that was then smoothed to produce an alternating current output. The phase of that signal was compared to the one on the tape to produce a guidance signal.[2]"
https://en.wikipedia.org/wiki/Missile_guidance#Astro-inertia... ("the latter of which was adapted for the SR-71...")
(Actually the very first one, in that history, was an intercontinental cruise missile—a jet weapon that slightly predated (~1958) rockets powerful enough to cross oceans. ICBM's came a bit later. I'm pretty sure the first generation were pure-analog circuits, but I forgot where I read about that).