Muon radiography, which relies on measuring the absorption and attenuation of muons as they pass through matters, offers a new imaging technique capable of revealing the internal structure of large objects. Recent technological advancement allows for the application or testing of muon radiography in various fields, including mining, civil engineering, security check, etc. This study investigates the factors that influence muon radiography, which is used in density inversion, through simulations and experiments. The materials considered for density inversion include water, standard rock, and iron. Our simulation studies show that the number of events detected and selected has an impact on the reconstruction results, and several factors, such as multiple Coulomb scattering processes, recording time, and spatial resolution, which influence the number of muons, must be taken into account when measuring the rock density. We design and conduct a laboratory scale experiment based on the simulation results. We filter the 220 h of recording signals through time coincidence and straight-line fitting to obtain the selected events. Our results reveal that the statistical error of muons survival ratio in recording time significantly impacts the inversion result and decreases the error can improve accuracy greatly. In the experiment, the deviation between the inversion mean value and the expected value can be reduced to 2.4%–2.9% for iron, 7% for water, and 1.5% for standard rock. This density inversion approach provides insight into future density detection of underground structures.