Based on the capacitances obtained from a 12-electrode electrical capacitance tomography (ECT) system and the least-squares support vector machine (LS-SVM) technique, a new method is proposed for the online voidage measurement of the gas-oil two-phase flow. In the practical voidage-measurement process, the real-time flow pattern of the gas-oil two-phase flow is directly identified from 66 capacitances obtained from the ECT system. Then, according to the flow pattern-identification results, a suitable measurement model is selected, and the voidage value is calculated. Both static and dynamic experimental results show that the proposed method is effective. The voidage-measurement result is independent of the flow pattern, and the real-time performance is satisfactory. Meanwhile, compared with the conventional voidage-measurement method based on an ECT system, the proposed method can produce more accurate voidage measurement without going through an image-reconstruction process.