Crowd counting is playing an increasingly important role in public security,event planning,space design and other fields.The crowd counting scheme based on computer vision has been paid more and more attention as a counting scheme which does not require contact with or active cooperation of the monitoring objects.However,for some large places,such as subway stations and large shopping malls,it is difficult for surveillance cameras to completely cover all corners due to the blind field of vision,so the total number of people in the place can be calculated by counting the number of people in each entrance and exit.At present,the study of population cross-line counting has not attracted enough attention.The existing methods can be roughly divided into two categories:the method based on individual detection and tracking and the method based on density map.The method based on individual detection and tracking is only suitable for the scene with sparse pedestrian distribution.For high-density crowd scenes,it is almost impossible to detect and track each individual due to the interference of serious mutual occlusion,background clutter and other factors.The method based on density map first estimates the population density map,and then uses optical flow and other methods to count the number of people crossing lines.Since the estimation of crowd density map and optical flow by existing methods is not accurate,this paper designs a method of crowd cross-line counting based on density map and optical flow estimation.The method based on density map adopts the method of density integration to count the number of people,and there are almost decimals in every statistical result,which is different from the actual number of people across the line.Therefore,this paper also puts forward a method of counting people across the line based on the consistency of key points.The research content and main innovation of this paper are as follows:(1)A population cross line counting method based on density map and optical flow estimation is designed.Firstly,image blocks are input into Transformer to extract features of different scales.Then,convolution and void convolution of different receptive fields are used to process the matrix composed of multi-scale features for predicting crowd density map.Here,a fitting strategy from large motion to small motion is used to estimate optical flow.Finally,by integrating the population density corresponding to the optical flow area intersected with the observed line,the number of people crossing the line was counted.The proposed cross-line population counting method was tested on the UCSD,PETS2009 and Grand Central data sets.Experimental results show that the proposed method can achieve more accurate cross-line population counting.(2)In this paper,a crowd cross-line counting method based on consistency of key points is proposed.Firstly,the predicted crowd density map is output by the video frame through the feature extraction network and several convolutional layers,and the key points are extracted by the local maximum detection algorithm.Since there are errors in the detection of key points,we conduct rerecognition training of key points in feature space to make the key points representing the same individual as consistent as possible.Finally,according to the individual movement track to judge whether the crossing of the observation line.To test the validity of the proposed method,tests were performed on UCSD,PETS2009 and Grand Central data sets.The experimental results show that the proposed cross-line crowd counting method based on the consistency of key points can achieve the most accurate crowd counting effect.(3)A crowd cross-line counting system is designed and implemented.Users can mark observation lines according to actual needs,and the system can automatically count the number of people crossing lines in both directions.The total number of people in the scene can be obtained according to the number of people at each inlet and outlet. |