Machine vision system for automated spectroscopy