An accurate electric dipole moment function(EDMF) is obtained for the carbon monoxide(CO) molecule(X1+Σ)by fitting the experimental rovibrational transitional moments. Additionally, an accurate ab initio EDMF is found using the highly accurate, multi-reference averaged coupled-pair functional(ACPF) approach with the basis set, aug-cc-p V6 Z, and a finite-field with ±0.005 a.u.(The unit a.u. is the abbreviation of atomic unit). This ab initio EDMF is very consistent with the fitted ones. The vibrational transition matrix moments and the Herman–Wallis factors, calculated with the Rydberg–Klein–Rees(RKR) potential and the fitted and ab initio EDMFs, are compared with experimental measurements. The consistency of these line intensities with the high-resolution transmission(HITRAN) molecular database demonstrates the improved accuracy of the fitted and ab initio EDMFs derived in this work.