This paper proposes a novel density-based real-time segmentation algorithm, to extract ground point cloud in real time from point cloud data collected by roadside LiDAR. The algorithm solves the problems such as the large amount of original point cloud data collected by LiDAR, which leads to heavy computational burden in ground point search. First, point cloud data is filtered by straight-through filtering method and rasterized to improve the real-time performance of the algorithm. Then, the density of the point cloud in horizontal plane is calculated, and the threshold of the density is selected to extract the low-density regional point cloud according to the density statistical histogram and 95% loci. Finally, the low-density regional point cloud is used as the initial ground seeds for iterative optimization of ground parameters, and the ground point cloud is extracted by the fitted ground model to realize road point cloud extraction. The experimental results on 1055 frames of continuous data collected on real scenes show that the average time consumption of the proposed method is 0.11 s, and the average segmentation precision is 92.48%. This shows that the density-based road segmentation algorithm can reduce the time of point cloud traversal in the process of ground parameter fitting and improve the real-time performance of the algorithm while maintaining the accuracy of ground extraction.