CN118097553A - Pedestrian number determining method and device and related equipment - Google Patents
Pedestrian number determining method and device and related equipment Download PDFInfo
- Publication number
- CN118097553A CN118097553A CN202410233851.4A CN202410233851A CN118097553A CN 118097553 A CN118097553 A CN 118097553A CN 202410233851 A CN202410233851 A CN 202410233851A CN 118097553 A CN118097553 A CN 118097553A
- Authority
- CN
- China
- Prior art keywords
- pedestrians
- pixel area
- image
- determining
- pedestrian
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 54
- 238000001514 detection method Methods 0.000 claims description 51
- 238000004422 calculation algorithm Methods 0.000 claims description 40
- 238000007635 classification algorithm Methods 0.000 claims description 11
- 238000004590 computer program Methods 0.000 claims description 6
- 238000003860 storage Methods 0.000 claims description 6
- 238000011002 quantification Methods 0.000 abstract description 5
- 238000013473 artificial intelligence Methods 0.000 abstract description 2
- 238000012549 training Methods 0.000 description 20
- 230000006870 function Effects 0.000 description 6
- 238000012360 testing method Methods 0.000 description 6
- 230000000694 effects Effects 0.000 description 5
- 238000002372 labelling Methods 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 238000013527 convolutional neural network Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 238000011156 evaluation Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 230000009172 bursting Effects 0.000 description 1
- 125000004122 cyclic group Chemical group 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 239000006185 dispersion Substances 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/50—Context or environment of the image
- G06V20/52—Surveillance or monitoring of activities, e.g. for recognising suspicious objects
- G06V20/53—Recognition of crowd images, e.g. recognition of crowd congestion
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/25—Determination of region of interest [ROI] or a volume of interest [VOI]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/764—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/766—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using regression, e.g. by projecting features on hyperplanes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/50—Context or environment of the image
- G06V20/52—Surveillance or monitoring of activities, e.g. for recognising suspicious objects
- G06V20/54—Surveillance or monitoring of activities, e.g. for recognising suspicious objects of traffic, e.g. cars on the road, trains or boats
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
- G06V40/103—Static body considered as a whole, e.g. static pedestrian or occupant recognition
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V2201/00—Indexing scheme relating to image or video recognition or understanding
- G06V2201/07—Target detection
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Multimedia (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Software Systems (AREA)
- Databases & Information Systems (AREA)
- Health & Medical Sciences (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Artificial Intelligence (AREA)
- Human Computer Interaction (AREA)
- Traffic Control Systems (AREA)
Abstract
The invention provides a method, a device and related equipment for determining the number of pedestrians, and relates to the technical field of artificial intelligence, wherein the method comprises the following steps: determining the number of pedestrians in a first pixel area in a first image based on the first image acquired by the acquisition equipment; determining a pedestrian number interval of a second pixel area based on the second pixel area of the first image; determining the number of pedestrians in the first image based on the number of pedestrians in the first pixel region and the number of pedestrians in the second pixel region corresponding to the pedestrian number interval; the distance between the first position area mapped by the first pixel area and the acquisition equipment is smaller than that between the second position area mapped by the second pixel area and the acquisition equipment. By the pedestrian number determining method combining quantification and qualitative, pedestrians can be detected and identified more accurately and efficiently, and the accuracy of statistical results is improved.
Description
Technical Field
The present invention relates to the field of artificial intelligence technologies, and in particular, to a method and apparatus for determining the number of pedestrians, and related devices.
Background
With the development of urban level, urban traffic is increasingly busy, and the corresponding public safety requirements are continuously improved. In order to better promote the security of public places (such as supermarkets, subway stations, bus stations, railway stations and the like), pedestrians can be counted so as to make emergency measures for emergencies.
In a scene of queuing pedestrians, a camera is generally arranged in front of or behind a team, when the number of the pedestrians in the queuing is large and the team is long, pedestrians at positions far away from the camera become very small and dense in a picture acquired by the camera, and shielding is also very serious, so that a large error occurs when the number of the pedestrians is counted.
Disclosure of Invention
The embodiment of the invention provides a method, a device and related equipment for determining the number of pedestrians, which are used for solving the problem that the error of determining the number of pedestrians is large in the prior art.
In order to solve the technical problems, the invention is realized as follows:
in a first aspect, an embodiment of the present invention provides a method for determining the number of pedestrians, where the method includes:
Determining the number of pedestrians in a first pixel area in a first image based on the first image acquired by the acquisition equipment;
Determining a pedestrian number interval of a second pixel area based on the second pixel area of the first image;
determining the number of pedestrians in the first image based on the number of pedestrians in the first pixel region and the number of pedestrians in the second pixel region corresponding to the pedestrian number interval;
The distance between the first position area mapped by the first pixel area and the acquisition equipment is smaller than that between the second position area mapped by the second pixel area and the acquisition equipment.
Optionally, the determining, based on the second pixel area of the first image, a pedestrian number interval of the second pixel area includes:
Determining a pedestrian number interval of a second pixel area according to the number of first target pixels, the number of second target pixels and the pedestrian number of the first pixel area, wherein the first target pixels are pixels with target features in the first pixel area, the second target pixels are pixels with the target features in the second pixel area, and the target features are features representing pedestrians.
Optionally, the determining, based on the second pixel area of the first image, a pedestrian number interval of the second pixel area includes:
And detecting a second pixel region of the first image according to an image classification algorithm, and determining a pedestrian number section corresponding to the second pixel region in a plurality of preset pedestrian number sections.
Optionally, the determining, based on the first image acquired by the acquisition device, the number of pedestrians in the first pixel area in the first image includes:
detecting the first image according to Yolo object detection algorithm to obtain the number of pedestrians in the first pixel region;
And determining a pixel area except the first pixel area in the first image as the second pixel area.
Optionally, the first pixel region is a pixel region marked by the Yolo object detection algorithm on the first image.
Optionally, the determining the number of pedestrians in the first image based on the number of pedestrians in the first pixel area and the number of pedestrians in the second pixel area corresponding to the number of pedestrians interval includes:
obtaining a first predicted number of pedestrians in the first image according to the number of pedestrians in the first pixel area and the number of pedestrians in the second pixel area;
determining the first predicted quantity as the quantity of pedestrians in the first image under the condition that the difference value between the first predicted quantity and the second predicted quantity is smaller than or equal to a preset threshold value;
The second predicted number is the number of pedestrians determined according to the historical number of pedestrians and external factors, wherein the external factors comprise weather factors and time factors when the acquisition device acquires the first image.
In a second aspect, an embodiment of the present invention provides a pedestrian number determination apparatus, including:
The first determining module is used for determining the number of pedestrians in a first pixel area in a first image based on the first image acquired by the acquisition equipment;
A second determining module, configured to determine a pedestrian number interval of a second pixel area based on the second pixel area of the first image;
A third determining module, configured to determine the number of pedestrians in the first image based on the number of pedestrians in the first pixel area and the number of pedestrians in the second pixel area corresponding to the pedestrian number interval;
The distance between the first position area mapped by the first pixel area and the acquisition equipment is smaller than that between the second position area mapped by the second pixel area and the acquisition equipment.
In a third aspect, embodiments of the present invention provide an electronic device, comprising a transceiver and a processor,
The processor is used for determining the number of pedestrians in a first pixel area in a first image based on the first image acquired by the acquisition equipment;
The processor is further configured to determine a pedestrian number interval of a second pixel area based on the second pixel area of the first image;
The processor is further configured to determine the number of pedestrians in the first image based on the number of pedestrians in the first pixel area and the number of pedestrians in the second pixel area corresponding to the pedestrian number interval;
The distance between the first position area mapped by the first pixel area and the acquisition equipment is smaller than that between the second position area mapped by the second pixel area and the acquisition equipment.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the pedestrian number determination method according to the first aspect.
In a fifth aspect, an embodiment of the present invention provides a computer program product comprising computer instructions which, when executed by a processor, implement the steps of the pedestrian number determination method as described in the first aspect.
In the embodiment of the invention, firstly, quantitative detection is carried out on pedestrians in a first image so as to determine the number of pedestrians in a first pixel area in the first image, and the pixel areas except the first pixel area in the first image are determined as second pixel areas; and then qualitatively detecting pedestrians in the second pixel area in the first image to determine the pedestrian number interval of the second pixel area, and reducing statistical errors caused by the second pixel area which cannot be identified by the missing object detection algorithm. By the pedestrian number determining method combining quantification and qualitative, pedestrians can be detected and identified more accurately and efficiently, and the accuracy of statistical results is improved. And further provides better technical support for the fields of public safety, intelligent transportation and the like.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is one of the flowcharts of a pedestrian number determination method provided by an embodiment of the present invention;
FIG. 2 is a second flowchart of a pedestrian number determination method according to an embodiment of the present invention;
Fig. 3 is a schematic structural view of a pedestrian number determination device provided in an embodiment of the present invention;
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1, fig. 1 is a flowchart of a method for determining the number of pedestrians, according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
step 101, determining the number of pedestrians in a first pixel area in a first image based on the first image acquired by an acquisition device;
The acquisition equipment can be vision acquisition equipment such as a video head, and the acquisition equipment can be arranged at the entrance and exit positions of public places (such as supermarkets, subway stations, bus stations, railway stations and the like) so as to count the number of pedestrians. The first image may be any frame of image in the video stream data captured by the capture device.
In some optional embodiments, the determining, based on the first image acquired by the acquisition device, the number of pedestrians in the first pixel area in the first image includes:
detecting the first image according to Yolo object detection algorithm to obtain the number of pedestrians in the first pixel region;
And determining a pixel area except the first pixel area in the first image as the second pixel area.
In this embodiment, the first image may be quantitatively detected using a Yolo (You Only Look Once) -based object detection algorithm to determine the number of pedestrians in the first pixel region in the first image. Wherein, the training process of the object detection algorithm model based on Yolo can be described as follows:
First, data acquisition: image data is acquired using an acquisition device (for example, a monitoring camera), and the resolution of the camera may include multiple formats such as 1080p, 720p, 480p, etc. At the same time, some historical image data with different sizes can be collected to expand the training data set. The image data are screened to find the image data meeting the pedestrian detection requirement, and then the image data are converted into pictures in a unified format to serve as sample images.
Then, data labeling: the labeling tool is used for labeling pedestrians in the sample image, and in order to avoid shielding, the pedestrians are easy to recognize, and a mode of labeling the head and the shoulders of the pedestrians can be adopted. The annotation frame may be a rectangular annotation frame comprising two points.
Training: training was performed on an official model, which included C3 module, conv module, SPPF module, and ConCat module. And obtaining the object detection algorithm model based on Yolo after training.
Thus, the first image acquired by the acquisition device is input into the object detection algorithm model based on Yolo, so that the number of pedestrians in the first pixel area can be obtained. In the embodiment of the invention, the fact that the object detection algorithm model based on Yolo has limited recognition capability in the pedestrian detection process is considered, for example, in a scene of queuing pedestrians, a camera is generally arranged in front of or behind a team, when the number of the queuing persons is large and the team is long, pedestrians at a position far away from the camera become very small and dense in a first image acquired by the camera, and shielding is also very serious, so that the object detection algorithm model based on Yolo is difficult to detect and count pedestrians in the area. Thus, a Yolo-based object detection algorithm model can be used to predict over the test set; then analyzing the obtained test result to determine an area which cannot be identified based on the Yolo object detection algorithm model, in other words, the first pixel area is a pixel area marked by the Yolo object detection algorithm in the first image, namely, the first pixel area is an area which can identify pedestrians in the first image; a pixel region of the first image other than the first pixel region is determined as a second pixel region.
Since the second pixel area may also contain pedestrians, the second pixel area may be further qualitatively detected by step 102, reducing errors in counting the number of pedestrians.
102, Determining a pedestrian number interval of a second pixel area based on the second pixel area of the first image;
in an example, first, quantitative detection is performed on pedestrians in a first image to determine the number of pedestrians in a first pixel area in the first image, and a pixel area except the first pixel area in the first image is determined as a second pixel area; and then qualitatively detecting pedestrians in the second pixel area in the first image to determine the pedestrian number interval of the second pixel area, and reducing statistical errors caused by the second pixel area which cannot be identified by the missing object detection algorithm.
In some optional embodiments, the determining, based on the second pixel region of the first image, a pedestrian number interval of the second pixel region includes:
And detecting a second pixel region of the first image according to an image classification algorithm, and determining a pedestrian number section corresponding to the second pixel region in a plurality of preset pedestrian number sections.
In this embodiment, the area that cannot be identified may be qualitatively analyzed by using an image classification algorithm, that is, the second pixel area of the first image is qualitatively detected, so as to determine the pedestrian number interval corresponding to the second pixel area in the first image. The second pixel region of the first image is detected according to an image classification algorithm, and a depth residual error network (ResNet) based model can be adopted to perform qualitative detection on the second pixel region. The training process of ResNet model can be described as follows:
First, data acquisition: pedestrian detection is carried out on the sample image based on the Yolo object detection algorithm model, and a second pixel area which is not detected by the object detection algorithm model in the sample image is extracted to manufacture a training data set of the ResNet model. According to the number of pedestrians, the method is divided into the following steps: the number of pedestrians is a plurality of preset pedestrian number intervals such as no people, few people (1 to 5), some people (about 5 to 10), crowding (a relatively large number of people), and bursting. The resulting training data set is divided into a training set and a test set.
Wherein the training data set needs to be preprocessed before inputting the model to ensure that the input format meets the model requirements. The preprocessing step may include adjusting the image size, normalizing pixel values, data enhancement (e.g., random clipping, rotation), etc., in order to improve the generalization ability and processing efficiency of the model.
Then, training is performed: and qualitatively detecting the second pixel region by using a depth residual error network (ResNet) based model. ResNet is a deep convolutional neural network, which is known for the problem of difficulty in deep network training by introducing a residual learning unit. First, depending on the complexity of the task and the available computing resources, resNet architectures of different depths, such as ResNet18, resNet34, resNet50, etc., may be selected. And constructing a model by using the selected ResNet architecture, and adjusting the output of the last layer of the network according to the category number of the actual classification tasks. If a pre-trained model is used, other layers, except the last layer, can keep the original parameters unchanged to take advantage of the existing feature extraction capabilities; the last layer (typically the fully connected layer) then needs to be retrained for the new classification task. Then, a loss function and an optimizer are defined, and a ResNet model is trained over multiple iterations. In each iteration, resNet models predict the output of training data, calculate the loss by comparing the predicted result to the real label, and update the weight parameters by a back propagation algorithm to reduce the loss. The performance on the training set and the test set needs to be monitored during training to adjust training parameters or to stop early to prevent overfitting.
After training is completed, the model performance is evaluated ResNet using a separate test dataset, and commonly used evaluation metrics include accuracy, precision, recall, and the like. This step is an important means of testing ResNet the generalization ability of the model. And finally, deploying the trained ResNet model into practical application to perform image classification tasks. When a new image is encountered, resNet models can identify the category of the image based on the learned characteristics. The whole process is iterative and cyclic, and according to the evaluation result and the feedback of the practical application, the process may need to return to the steps of data preparation, resNet model adjustment or retraining so as to continuously improve ResNet model performance to meet the practical requirements.
In this way, the first image acquired by the acquisition device is input to the object detection algorithm model based on Yolo first, so that the number of pedestrians in the first pixel area can be obtained. Meanwhile, a second pixel area which is not recognized by the object detection algorithm model in the first image is determined, and qualitative detection is further carried out on the second pixel area of the first image through the image classification algorithm model based on ResNet, so that the pedestrian number interval of the second pixel area is determined. The pedestrian counting problem is converted into the classification problem, so that the difficulty in determining the number of pedestrians in the first image is reduced. Finally, the number of pedestrians in the first image is determined according to step 103 based on the number of pedestrians in the first pixel region and the number of pedestrians in the second pixel region corresponding to the pedestrian number interval. The image classification algorithm and the object detection algorithm are combined, and the characteristics of pedestrians are extracted by adopting a Convolutional Neural Network (CNN), a attention mechanism and the like, so that statistical errors caused by missing a second pixel area which cannot be identified by the object detection algorithm are reduced, and the accuracy of a detection result is improved.
Step 103, determining the number of pedestrians in the first image based on the number of pedestrians in the first pixel area and the number of pedestrians in the second pixel area corresponding to the pedestrian number interval;
The distance between the first position area mapped by the first pixel area and the acquisition equipment is smaller than that between the second position area mapped by the second pixel area and the acquisition equipment.
Taking an example that a camera is arranged in front of a team in a scene of queuing pedestrians, a first position area mapped by a first pixel area is a front part area of the pedestrian team, which is close to the camera, and a second position area mapped by a second pixel area is a rear part area of the pedestrian team, which is far away from the camera, namely the distance between the first position area mapped by the first pixel area and the camera is smaller than the distance between the second position area mapped by the second pixel area and the camera.
In the embodiment of the invention, firstly, quantitative detection is carried out on pedestrians in a first image so as to determine the number of pedestrians in a first pixel area in the first image, and the pixel areas except the first pixel area in the first image are determined as second pixel areas; and then qualitatively detecting pedestrians in the second pixel area in the first image to determine the pedestrian number interval of the second pixel area, and reducing statistical errors caused by the second pixel area which cannot be identified by the missing object detection algorithm. By the pedestrian number determining method combining quantification and qualitative, pedestrians can be detected and identified more accurately and efficiently, and the accuracy of statistical results is improved. And further provides better technical support for the fields of public safety, intelligent transportation and the like.
In some optional embodiments, the determining, based on the second pixel region of the first image, a pedestrian number interval of the second pixel region includes:
Determining a pedestrian number interval of a second pixel area according to the number of first target pixels, the number of second target pixels and the pedestrian number of the first pixel area, wherein the first target pixels are pixels with target features in the first pixel area, the second target pixels are pixels with the target features in the second pixel area, and the target features are features representing pedestrians.
The characteristic of the pedestrian, i.e. the target characteristic, may be the characteristic of the entire pedestrian, or may be the characteristic of a specific part of the pedestrian, such as the characteristic of the head, eyes, shoulders or feet of the pedestrian. In this example, the number of pedestrians in the first pixel region may be a numerical value quantitatively output according to the object detection algorithm; and then determining the pedestrian number interval of the second pixel region according to the ratio of the number of the pixels with the target features (namely the first target pixels) in the first pixel region to the number of the pixels with the target features (namely the second target pixels) in the second pixel region in the first image, reducing the statistical error caused by the second pixel region which cannot be identified by the missing object detection algorithm, and improving the accuracy of the statistical result.
In an embodiment, in the scene of queuing the pedestrian, the ratio between the number of the first target pixels and the second target pixels may be converted into a ratio between the length corresponding to the first target pixels in the first image and the length corresponding to the second target pixels in the first image.
For example, pedestrians in the first image are queued from an A position, which is a position close to the camera, to a B position, which is a position far from the camera. And inputting the first image into a Yolo-based object detection algorithm model, and determining the number of pedestrians in a first pixel area in the first image as R1. The first pixel area is a pixel area marked by the Yolo object detection algorithm in the first image, namely the first pixel area is an area in the first image in which pedestrians can be identified. Thus, the first pixel region may be a region corresponding to the a position to the C position in the first image, and the C position is a position between the a position and the B position. Then, a pixel region other than the first pixel region in the first image is determined as a second pixel region, in other words, a region corresponding to the C position to the B position in the first image is determined as a second pixel region.
Further, the length AC from the a position to the C position and the length CB from the C position to the B position are determined, so that the pedestrian number section of the second pixel region can be determined as r2, r2= (cb×r1)/AC from AC, CB, and R1. Therefore, the number of pedestrians in the first image can be determined, pedestrians can be detected and identified more accurately and efficiently by the quantitative and qualitative combined pedestrian number determining method, and the accuracy of the statistical result is improved.
In another embodiment, in the scene of pedestrian dispersion, the ratio between the number of the first target pixels and the second target pixels may be converted into a ratio between the corresponding area of the first target pixels in the first image and the corresponding area of the second target pixels in the first image.
For example, pedestrians are dispersed at various positions in the first image. And inputting the first image into a Yolo-based object detection algorithm model, and determining the number of pedestrians in a first pixel area in the first image as R1. The first pixel area is a pixel area marked by the Yolo object detection algorithm in the first image, namely the first pixel area is an area in the first image in which pedestrians can be identified. Thus, the first pixel region may be region a in the first image. Then, a pixel region other than the first pixel region in the first image is determined as a second pixel region, in other words, a region B other than the region a in the first image is determined as a second pixel region.
Further, the area of the pixel having the pedestrian characteristic in the area a is determined to be M1, and the area of the pixel having the pedestrian characteristic in the area B is determined to be M2, so that the pedestrian number section of the second pixel area can be determined to be r2, r2= (m2×r1)/M1 from M1, M2, and R1. Therefore, the number of pedestrians in the first image can be determined, pedestrians can be detected and identified more accurately and efficiently by the quantitative and qualitative combined pedestrian number determining method, and the accuracy of the statistical result is improved.
When the camera acquires the first image, the number of pixels corresponding to the position of the camera, which is close to the camera, of the pedestrian is larger than the number of pixels corresponding to the position, which is far away from the camera, of the camera due to the inclination angle of the camera, namely, the number of pedestrians in the first pixel area is the same as that of pedestrians in the second pixel area, and the number of the first target pixels is larger than that of the second target pixels. Thus, in some embodiments, when determining the pedestrian number interval of the second pixel region according to the number of the first target pixels, the number of the second target pixels, and the number of pedestrians of the first pixel region, a ratio between the number of the first target pixels and the number of the second target pixels may be corrected. For example, the comparison value is compensated according to the tilting angle parameter of the camera shooting the first image, so that the accuracy of the pedestrian number prediction result is improved.
In some optional embodiments, the determining the number of pedestrians in the first image based on the number of pedestrians in the first pixel region and the number of pedestrians in the second pixel region corresponding to the number of pedestrians interval includes:
obtaining a first predicted number of pedestrians in the first image according to the number of pedestrians in the first pixel area and the number of pedestrians in the second pixel area;
determining the first predicted quantity as the quantity of pedestrians in the first image under the condition that the difference value between the first predicted quantity and the second predicted quantity is smaller than or equal to a preset threshold value;
The second predicted number is the number of pedestrians determined according to the historical number of pedestrians and external factors, wherein the external factors comprise weather factors and time factors when the acquisition device acquires the first image.
In this embodiment, as shown in fig. 2, first, a first image acquired by an acquisition device is input to an object detection algorithm model based on Yolo, so as to quantitatively detect pedestrians in the first image, and obtain the number of pedestrians in a first pixel area. Meanwhile, a second pixel area which is not recognized by the object detection algorithm model in the first image is determined, and qualitative detection is further carried out on the second pixel area of the first image through the image classification algorithm model based on ResNet, so that the pedestrian number interval of the second pixel area is determined. The pedestrian counting problem is converted into the classification problem, so that the difficulty in determining the number of pedestrians in the first image is reduced. And determining the number of pedestrians in the first image according to the number of pedestrians in the first pixel area and the number of pedestrians in the second pixel area corresponding to the pedestrian number interval. Therefore, by adopting a mode of combining the image classification algorithm and the object detection algorithm, the statistical error caused by missing the second pixel area which cannot be identified by the object detection algorithm is reduced, and the accuracy of the detection result is improved.
Further, a first predicted number of pedestrians in the first image is obtained according to the number of pedestrians in the first pixel area and the number of pedestrians in the second pixel area. Considering that there is a certain correlation between the number of people going on and external factors such as weather, time, etc., for example, there is a correlation that the number of people on the early peak and the late peak of the subway is more, the number of people before lunch and dinner in supermarket is more, the number of people on the weekend is more than the number of people in ordinary time, etc. Therefore, the first prediction quantity of the pedestrians in the first image can be checked based on the regression model obtained through training, so that accuracy of the detection result is improved. The regression model is a verification model obtained through training according to the number of historical pedestrians and sample data corresponding to external factors.
In an example, the weather factor and the time factor when the acquisition device acquires the first image, and the number of historic pedestrians can be input into a regression model to obtain a second prediction number; and determining the first predicted quantity as the quantity of pedestrians in the first image under the condition that the difference value between the first predicted quantity and the second predicted quantity is smaller than or equal to a preset threshold value. By the pedestrian number determining method combining quantification and qualitative, the influence of historical pedestrian data, weather factors and time factors is comprehensively considered, pedestrians can be detected and identified more accurately and efficiently, and the accuracy of statistical results is improved. And further provides better technical support for the fields of public safety, intelligent transportation and the like.
In another example, the weather factor and the time factor when the acquisition device acquires the first image, and the first prediction quantity may be input into a regression model obtained after training to obtain a third prediction quantity. The third predicted number is determined as the number of pedestrians in the first image. By the pedestrian number determining method combining quantification and qualitative, the influence of historical pedestrian data, weather factors and time factors is comprehensively considered, pedestrians can be detected and identified more accurately and efficiently, and the accuracy of statistical results is improved. And further provides better technical support for the fields of public safety, intelligent transportation and the like.
If the second pixel area which is not recognized by the object detection algorithm model does not exist in the first image, the number of pedestrians in the first image which is directly predicted is input into the regression algorithm model, and the same technical effect can be achieved, and the description is omitted here.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a pedestrian number determining apparatus according to an embodiment of the present invention, and as shown in fig. 3, the pedestrian number determining apparatus 300 includes:
a first determining module 301, configured to determine, based on a first image acquired by an acquisition device, a number of pedestrians in a first pixel area in the first image;
A second determining module 302, configured to determine, based on a second pixel area of the first image, a pedestrian number interval of the second pixel area;
A third determining module 303, configured to determine the number of pedestrians in the first image based on the number of pedestrians in the first pixel area and the number of pedestrians in the second pixel area corresponding to the pedestrian number interval;
The distance between the first position area mapped by the first pixel area and the acquisition equipment is smaller than that between the second position area mapped by the second pixel area and the acquisition equipment.
Optionally, the second determining module 302 includes:
The first determining submodule is used for determining a pedestrian number interval of the second pixel area according to the number of first target pixels, the number of second target pixels and the pedestrian number of the first pixel area, wherein the first target pixels are pixels with target features in the first pixel area, the second target pixels are pixels with the target features in the second pixel area, and the target features are features representing pedestrians.
Optionally, the second determining module 302 includes:
the second determining submodule is used for detecting a second pixel area of the first image according to an image classification algorithm and determining pedestrian number intervals corresponding to the second pixel area in a plurality of preset pedestrian number intervals.
Optionally, the first determining module 301 includes:
The detection sub-module is used for detecting the first image according to Yolo object detection algorithm to obtain the number of pedestrians in the first pixel area;
And a third determining sub-module configured to determine a pixel area other than the first pixel area in the first image as the second pixel area.
Optionally, the first pixel region is a pixel region marked by the Yolo object detection algorithm on the first image.
Optionally, the third determining module 303 includes:
A fourth determining submodule, configured to obtain a first predicted number of pedestrians in the first image according to the number of pedestrians in the first pixel area and the number of pedestrians in the second pixel area;
A fifth determining submodule, configured to determine the first predicted number as the number of pedestrians in the first image if the difference between the first predicted number and the second predicted number is less than or equal to a preset threshold;
The second predicted number is the number of pedestrians determined according to the historical number of pedestrians and external factors, wherein the external factors comprise weather factors and time factors when the acquisition device acquires the first image.
The pedestrian number determining device 300 can implement the processes of the embodiments of the pedestrian number determining method, technical features are in one-to-one correspondence, and the same technical effects can be achieved, so that repetition is avoided, and detailed description is omitted.
The embodiment of the invention also provides electronic equipment, which comprises: the processor, the memory and the program stored in the memory and capable of running on the processor, when the program is executed by the processor, the processes of the above embodiments of the fault prediction method are implemented, and the same technical effects can be achieved, so that repetition is avoided, and no description is repeated here.
Specifically, referring to fig. 4, the embodiment of the present invention further provides an electronic device, including a bus 401, a transceiver 402, an antenna 403, a bus interface 404, a processor 405, and a memory 406.
Wherein, the transceiver 402 is configured to acquire a first image acquired by the acquisition device;
A processor 405, configured to determine, based on a first image acquired by an acquisition device, a number of pedestrians in a first pixel area in the first image;
the processor 405 is further configured to determine, based on a second pixel region of the first image, a pedestrian number interval of the second pixel region;
The processor 405 is further configured to determine the number of pedestrians in the first image based on the number of pedestrians in the first pixel area and the number of pedestrians in the second pixel area corresponding to the pedestrian number interval;
The distance between the first position area mapped by the first pixel area and the acquisition equipment is smaller than that between the second position area mapped by the second pixel area and the acquisition equipment.
Optionally, the determining, based on the second pixel area of the first image, a pedestrian number interval of the second pixel area includes:
Determining a pedestrian number interval of a second pixel area according to the number of first target pixels, the number of second target pixels and the pedestrian number of the first pixel area, wherein the first target pixels are pixels with target features in the first pixel area, the second target pixels are pixels with the target features in the second pixel area, and the target features are features representing pedestrians.
Optionally, the determining, based on the second pixel area of the first image, a pedestrian number interval of the second pixel area includes:
And detecting a second pixel region of the first image according to an image classification algorithm, and determining a pedestrian number section corresponding to the second pixel region in a plurality of preset pedestrian number sections.
Optionally, the determining, based on the first image acquired by the acquisition device, the number of pedestrians in the first pixel area in the first image includes:
detecting the first image according to Yolo object detection algorithm to obtain the number of pedestrians in the first pixel region;
And determining a pixel area except the first pixel area in the first image as the second pixel area.
Optionally, the first pixel region is a pixel region marked by the Yolo object detection algorithm on the first image.
Optionally, the determining the number of pedestrians in the first image based on the number of pedestrians in the first pixel area and the number of pedestrians in the second pixel area corresponding to the number of pedestrians interval includes:
obtaining a first predicted number of pedestrians in the first image according to the number of pedestrians in the first pixel area and the number of pedestrians in the second pixel area;
determining the first predicted quantity as the quantity of pedestrians in the first image under the condition that the difference value between the first predicted quantity and the second predicted quantity is smaller than or equal to a preset threshold value;
The second predicted number is the number of pedestrians determined according to the historical number of pedestrians and external factors, wherein the external factors comprise weather factors and time factors when the acquisition device acquires the first image.
In fig. 4, a bus architecture (represented by bus 401), the bus 401 may include any number of interconnected buses and bridges, with the bus 401 linking together various circuits, including one or more processors, represented by processor 405, and memory, represented by memory 406. The bus 401 may also link together various other circuits such as peripheral devices, voltage regulators, power management circuits, etc., which are well known in the art and, therefore, will not be described further herein. Bus interface 404 provides an interface between bus 401 and transceiver 402. The transceiver 402 may be one element or may be multiple elements, such as multiple receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The data processed by the processor 405 is transmitted over a wireless medium via the antenna 403, and further, the antenna 403 receives the data and transmits the data to the processor 405.
The processor 405 is responsible for managing the bus 401 and general processing and may also provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. And memory 406 may be used to store data used by processor 405 in performing operations.
Alternatively, the processor 405 may be a central processing unit (Central Processing Unit, CPU), application SPECIFIC INTEGRATED Circuit (ASIC), field programmable gate array (Field Programmable GATE ARRAY, FPGA), or complex programmable logic device (Complex Programmable Logic Device, CPLD).
The embodiment of the invention also provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the processes of the above-mentioned pedestrian number determination method embodiment, and can achieve the same technical effects, and in order to avoid repetition, the description is omitted here. Wherein the computer readable storage medium is selected from Read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic disk or optical disk.
The embodiment of the application also provides a computer program product, which comprises computer instructions, wherein the computer instructions realize the processes of the pedestrian number determining method embodiment when being executed by a processor, and the same technical effects can be achieved, so that repetition is avoided, and the detailed description is omitted.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Furthermore, it should be noted that the scope of the methods and apparatus in the embodiments of the present invention is not limited to performing the functions in the order discussed, but may also include performing the functions in a substantially simultaneous manner or in an opposite order depending on the functions involved, e.g., the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The embodiments of the present invention have been described above with reference to the accompanying drawings, but the present invention is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present invention and the scope of the claims, which are to be protected by the present invention.
Claims (10)
1. A pedestrian number determination method, characterized in that the method comprises:
Determining the number of pedestrians in a first pixel area in a first image based on the first image acquired by the acquisition equipment;
Determining a pedestrian number interval of a second pixel area based on the second pixel area of the first image;
determining the number of pedestrians in the first image based on the number of pedestrians in the first pixel region and the number of pedestrians in the second pixel region corresponding to the pedestrian number interval;
The distance between the first position area mapped by the first pixel area and the acquisition equipment is smaller than that between the second position area mapped by the second pixel area and the acquisition equipment.
2. The method of claim 1, wherein the determining the pedestrian number interval for the second pixel region based on the second pixel region of the first image comprises:
Determining a pedestrian number interval of a second pixel area according to the number of first target pixels, the number of second target pixels and the pedestrian number of the first pixel area, wherein the first target pixels are pixels with target features in the first pixel area, the second target pixels are pixels with the target features in the second pixel area, and the target features are features representing pedestrians.
3. The method of claim 1, wherein the determining the pedestrian number interval for the second pixel region based on the second pixel region of the first image comprises:
And detecting a second pixel region of the first image according to an image classification algorithm, and determining a pedestrian number section corresponding to the second pixel region in a plurality of preset pedestrian number sections.
4. The method of claim 1, wherein the determining the number of pedestrians for the first pixel region in the first image based on the first image acquired by the acquisition device comprises:
detecting the first image according to Yolo object detection algorithm to obtain the number of pedestrians in the first pixel region;
And determining a pixel area except the first pixel area in the first image as the second pixel area.
5. The method of claim 4, wherein the first pixel region is a pixel region labeled by the Yolo object-detection algorithm at the first image.
6. The method of claim 1, wherein the determining the number of pedestrians in the first image based on the number of pedestrians in the first pixel region and the number of pedestrians in the second pixel region corresponding to the pedestrian number interval comprises:
obtaining a first predicted number of pedestrians in the first image according to the number of pedestrians in the first pixel area and the number of pedestrians in the second pixel area;
determining the first predicted quantity as the quantity of pedestrians in the first image under the condition that the difference value between the first predicted quantity and the second predicted quantity is smaller than or equal to a preset threshold value;
The second predicted number is the number of pedestrians determined according to the historical number of pedestrians and external factors, wherein the external factors comprise weather factors and time factors when the acquisition device acquires the first image.
7. A pedestrian number determination device, characterized in that the device comprises:
The first determining module is used for determining the number of pedestrians in a first pixel area in a first image based on the first image acquired by the acquisition equipment;
A second determining module, configured to determine a pedestrian number interval of a second pixel area based on the second pixel area of the first image;
A third determining module, configured to determine the number of pedestrians in the first image based on the number of pedestrians in the first pixel area and the number of pedestrians in the second pixel area corresponding to the pedestrian number interval;
The distance between the first position area mapped by the first pixel area and the acquisition equipment is smaller than that between the second position area mapped by the second pixel area and the acquisition equipment.
8. An electronic device comprising a transceiver and a processor,
The processor is used for determining the number of pedestrians in a first pixel area in a first image based on the first image acquired by the acquisition equipment;
The processor is further configured to determine a pedestrian number interval of a second pixel area based on the second pixel area of the first image;
The processor is further configured to determine the number of pedestrians in the first image based on the number of pedestrians in the first pixel area and the number of pedestrians in the second pixel area corresponding to the pedestrian number interval;
The distance between the first position area mapped by the first pixel area and the acquisition equipment is smaller than that between the second position area mapped by the second pixel area and the acquisition equipment.
9. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the pedestrian number determination method according to any one of claims 1 to 6.
10. A computer program product comprising computer instructions which, when executed by a processor, implement the steps of the pedestrian number determination method of any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410233851.4A CN118097553A (en) | 2024-03-01 | 2024-03-01 | Pedestrian number determining method and device and related equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410233851.4A CN118097553A (en) | 2024-03-01 | 2024-03-01 | Pedestrian number determining method and device and related equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118097553A true CN118097553A (en) | 2024-05-28 |
Family
ID=91149220
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410233851.4A Pending CN118097553A (en) | 2024-03-01 | 2024-03-01 | Pedestrian number determining method and device and related equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118097553A (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101025790A (en) * | 2007-01-15 | 2007-08-29 | 中北大学 | Image-based bus passenger number automatic statistics meter |
CN103218816A (en) * | 2013-04-18 | 2013-07-24 | 中山大学 | Crowd density estimation method and pedestrian volume statistical method based on video analysis |
CN103473114A (en) * | 2013-09-04 | 2013-12-25 | 李乐之 | Method for calculating architectural space activeness through people-stream simulation |
CN106203331A (en) * | 2016-07-08 | 2016-12-07 | 苏州平江历史街区保护整治有限责任公司 | A kind of crowd density evaluation method based on convolutional neural networks |
CN106845621A (en) * | 2017-01-18 | 2017-06-13 | 山东大学 | Dense population number method of counting and system based on depth convolutional neural networks |
CN109697435A (en) * | 2018-12-14 | 2019-04-30 | 重庆中科云从科技有限公司 | Stream of people's quantity monitoring method, device, storage medium and equipment |
CN114693674A (en) * | 2022-04-24 | 2022-07-01 | 深圳奇迹智慧网络有限公司 | People flow statistical method, device and computer storage medium |
-
2024
- 2024-03-01 CN CN202410233851.4A patent/CN118097553A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101025790A (en) * | 2007-01-15 | 2007-08-29 | 中北大学 | Image-based bus passenger number automatic statistics meter |
CN103218816A (en) * | 2013-04-18 | 2013-07-24 | 中山大学 | Crowd density estimation method and pedestrian volume statistical method based on video analysis |
CN103473114A (en) * | 2013-09-04 | 2013-12-25 | 李乐之 | Method for calculating architectural space activeness through people-stream simulation |
CN106203331A (en) * | 2016-07-08 | 2016-12-07 | 苏州平江历史街区保护整治有限责任公司 | A kind of crowd density evaluation method based on convolutional neural networks |
CN106845621A (en) * | 2017-01-18 | 2017-06-13 | 山东大学 | Dense population number method of counting and system based on depth convolutional neural networks |
CN109697435A (en) * | 2018-12-14 | 2019-04-30 | 重庆中科云从科技有限公司 | Stream of people's quantity monitoring method, device, storage medium and equipment |
CN114693674A (en) * | 2022-04-24 | 2022-07-01 | 深圳奇迹智慧网络有限公司 | People flow statistical method, device and computer storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11455805B2 (en) | Method and apparatus for detecting parking space usage condition, electronic device, and storage medium | |
CN110390262B (en) | Video analysis method, device, server and storage medium | |
CN108416250B (en) | People counting method and device | |
US10735694B2 (en) | System and method for activity monitoring using video data | |
US8917934B2 (en) | Multi-cue object detection and analysis | |
US9129524B2 (en) | Method of determining parking lot occupancy from digital camera images | |
CN109858389B (en) | Vertical ladder people counting method and system based on deep learning | |
WO2022134120A1 (en) | Target motion prediction-based parking lot management and control method, apparatus, and electronic device | |
CN110472599B (en) | Object quantity determination method and device, storage medium and electronic equipment | |
JP2016110635A (en) | Adapted vocabularies for matching image signatures with fisher vectors | |
CN111783589B (en) | Complex scene crowd counting method based on scene classification and multi-scale feature fusion | |
CN111807183A (en) | Elevator door state intelligent detection method based on deep learning | |
Khosravi et al. | Crowd emotion prediction for human-vehicle interaction through modified transfer learning and fuzzy logic ranking | |
CN108563977A (en) | A kind of the pedestrian's method for early warning and system of expressway entrance and exit | |
CN110189355A (en) | Safe escape channel occupies detection method, device, electronic equipment and storage medium | |
CN110942456B (en) | Tamper image detection method, device, equipment and storage medium | |
WO2021147055A1 (en) | Systems and methods for video anomaly detection using multi-scale image frame prediction network | |
CN113221804B (en) | Disordered material detection method and device based on monitoring video and application | |
CN113052039A (en) | Method, system and server for detecting pedestrian density of traffic network | |
CN102867214B (en) | Counting management method for people within area range | |
CN117292324A (en) | Crowd density estimation method and system | |
CN116959099A (en) | Abnormal behavior identification method based on space-time diagram convolutional neural network | |
CN118097553A (en) | Pedestrian number determining method and device and related equipment | |
US20230360402A1 (en) | Video-based public safety incident prediction system and method therefor | |
Thomopoulos | Chapter Risk Assessment and Automated Anomaly Detection Using a Deep Learning Architecture |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |