A mechanism for rapidly detecting and localizing external markers placed on a patient in projection images. Embodiments of the invention allow the markers to be detected even in the presence of dense surrounding anatomy and extensive patient motion. Once the positions of the marker points on the projection images are extracted, the marker points can be used to perform marker-based patient motion detection. Embodiments of the invention can also be used outside of motion correction, such as for scanner calibration, automatic cephalometric measurements, and quality control assessment.