Doing it optically is a fun project, but worth pointing out that the various rotations are so well known and studied that once you calibrate for position, a purely mechanical positioning system is more than adequate, and computer control has been a solved problem for decades. You might want to read Trueblood and Genet to get a feel for the control and automation side, and start with a mathematical/physical solution - you can add vision later.
Edit: specifically https://www.amazon.com/Microcomputer-Control-Telescopes-Mark-Trueblood/dp/0943396050 - the hardware is much easier these days, but the control theory and algorithms are the same.