A method for determining the three-dimensional location of an object in real-time from a two-dimensional medical image obtained with a medical imaging system is provided. For example, the three-dimensional location of an interventional medical device or a marker positioned on such a device may be determined from a two-dimensional x-ray image obtained with an interventional x-ray imaging system. Template images corresponding to the object under different imaging geometries and orientations are produced and are compared to images acquired with the medical imaging system. Similarity measures, such as normalized cross correlation and normalized similarity integral, are used to determine the similarity between a selected template image and the medical images in different stages of refining the position information for the object.