Simultaneous recording of electroencephalogram (EEG)-functional magnetic resonance imaging (fMRI) plays an important role in scientific research and clinical field due to its high spatial and temporal resolution. However, the fusion results are seriously influenced by ballistocardiogram (BCG) artifacts under MRI environment. In this paper, we improve the off-line constrained independent components analysis using real-time technique (rt-cICA), which is applied to the simulated and real resting-state EEG data. The results show that for simulated data analysis, the value of error in signal amplitude (Er) obtained by rt-cICA method was obviously lower than the traditional methods such as average artifact subtraction (P<0.005). In real EEG data analysis, the improvement of normalized power spectrum (INPS) calculated by rt-cICA method was much higher than other methods (P<0.005). In conclusion, the novel method proposed by this paper lays the technical foundation for further research on the fusion model of EEG-fMRI.