A mechanism for rapidly detecting and localizing external markers placed on a patient in projection images. Markers can 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. In addition to motion correction, the rapid detection and localization may also be used for scanner calibration, automatic cephalometric measurements, and quality control assessment.