The invention relates to the technical field of computer vision, and discloses a crowd density estimation recognition and crowd behavior analysis algorithm. The algorithm has the advantages that a system can automatically remind each point location abnormal condition, a passenger flow peak period can be predicted to make a deployment scheme in advance, and after a dangerous condition occurs, the system automatically makes a chain reaction to minimize the life and property safety loss of people. The crowd density estimation and recognition system uses current advanced machine vision, graphic image video analysis technique, human body pattern recognition technology, and artificial intelligence machine learning technology, to detect the mobile people flow density of a preset area at a second-level speed. The method has the advantages that the influence of light, shadow and heat can be effectively eliminated through node passenger flow quantity and queuing length statistics, interference objects in a detection area can be self-calibrated and eliminated every two minutes, when the monitored passenger flow quantity reaches a set threshold value, passenger flow alarming is carried out, acorresponding early warning scheme is started, and safety accidents are prevented.