An imaging system such as a medical C-arm x-ray fluoroscopy machine includes a tracking system that tracks a position of an x-ray source and an x-ray detector using sensors which monitor positions of joints which allow relative motions of segments in a support for the x-ray source and detector. Sensor readings are used in a kinematic chain. One or more segments that behave in a non-rigid manner are replaced by a virtual rigid link in the kinematic chain that takes into account deformations of the segments (e.g. under the influence of gravity). Calibration methods permit calibration of the system using images of phantoms.