Body surface potential mapping (BSPM) can be used to non- invasively measure the electrical activity of the heart using a dense set of thorax electrodes and a CT/MR scan of the thorax to solve the inverse problem of electrophysiology (ECGi). This technique now shows potential clinical value for the assessment and treatment of patients with arrhythmias. Co-localisation of the electrode positions and the CT/MR thorax scan is essential. This manuscript describes a method to perform the co-localisation using multiple biplane X-ray images. The electrodes are automatically detected and paired in the X-ray images. Then the 3D positions of the electrodes are computed and mapped onto the thorax surface derived from CT/MR. The proposed method is based on a multi-scale blob detection algorithm and the generalized Hough transform, which can automatically discriminate the leads used for BSPM from other ECG leads. The pairing method is based on epi-polar constraint matching and line pattern detection which assumes that BSPM electrodes are arranged in strips. The proposed methods are tested on a thorax phantom and two clinical cases. Results show an accuracy of 0.33 ± 0.20mm for detecting electrodes in the X-ray images and a success rate of 95.4%. The automatic pairing method achieves a 91.2% success rate.