Aiming at the problem of the poor detection effect of ViBe algorithm under static background and the existence of "ghosting" in the detection target, an improved ViBe algorithm is proposed by combining the knowledge of the Hash algorithm and the two-dimensional information entropy of the image. First, the Hash algorithm is used to perform differential operations on the selected three frames of images, and the target area obtained after the difference is filled in the background to obtain the background image, and then the background image is modeled to eliminate the ghost phenomenon. Then, the adaptive threshold and update rate are obtained according to the complexity of the background, the adaptive threshold is used for foreground detection, and the connected domain information is used for secondary detection to obtain the target image. Finally, the target image is processed and the background is updated. According to the experimental data, after the improved algorithm detects pedestrians and vehicles in static scenes such as grass, leaves, and snow scenes, the F-measure value of the image is above 0.8, which is improved and more stable than the ViBe algorithm and the Gaussian mixture model. Experimental results show that the improved ViBe algorithm can eliminate ghosting, suppress background interference, and better detect target information.