CN114092883A - Crowd information acquisition method and device and computer-readable storage medium - Google Patents

Crowd information acquisition method and device and computer-readable storage medium Download PDF

Info

Publication number
CN114092883A
CN114092883A CN202111407068.8A CN202111407068A CN114092883A CN 114092883 A CN114092883 A CN 114092883A CN 202111407068 A CN202111407068 A CN 202111407068A CN 114092883 A CN114092883 A CN 114092883A
Authority
CN
China
Prior art keywords
target
information
historical
optical flow
acquiring
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
Application number
CN202111407068.8A
Other languages
Chinese (zh)
Inventor
肖传利
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Lianzhou International Technology Co Ltd
Original Assignee
Shenzhen Lianzhou International Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen Lianzhou International Technology Co Ltd filed Critical Shenzhen Lianzhou International Technology Co Ltd
Priority to CN202111407068.8A priority Critical patent/CN114092883A/en
Publication of CN114092883A publication Critical patent/CN114092883A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches

Landscapes

  • Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a method and a device for acquiring crowd information and a computer readable storage medium. Wherein, the method comprises the following steps: acquiring a target image, wherein the target image is an image to be subjected to crowd information detection; obtaining a target optical flow feature map based on the target image; determining a target position density map and a target size density map corresponding to the target image and the target optical flow feature map through a prediction model; and acquiring the crowd information in the target image based on the target position density map and the target size density map. The invention solves the technical problems that the prior art depends on the performance of equipment when acquiring high-density crowd information and has limited application scenes and can not meet the requirements of users due to single means.

Description

Crowd information acquisition method and device and computer-readable storage medium
Technical Field
The invention relates to the field of image processing, in particular to a method and a device for acquiring crowd information and a computer-readable storage medium.
Background
Under the condition that a large number of existing cameras are used, functions such as face detection and pedestrian detection are widely applied to the camera at the mobile end. The motion analysis of the pedestrian target population generally obtains the state of the population through the individual target analysis. For example, in the common crowd density detection, detection and tracking are combined, a track of a moving target is established by using tracking, and meanwhile, a pedestrian target is determined by using detection to perform crowd motion analysis. For another example, the number of people is estimated directly using the motion area, and then the crowd density is obtained.
However, it is difficult to estimate a distant target using a scheme combining detection and tracking, and it is difficult to maintain the accuracy of a tracking method in a crowd of people, and it is necessary to rely on detector performance, and it is impossible to process a small target; that is, the crowd density detection is performed on the crowd with a small target and a crowded crowd, and the crowd density cannot be effectively obtained. When a small target is estimated by using the motion foreground region, large deviation is easily caused in a complex scene due to simple characteristics and large number of false alarms.
Aiming at the problems that the density motion analysis mode of the crowd in the related technology is limited, the result of the density motion analysis of the crowd is easy to have larger error and lower reliability, an effective solution is not provided at present.
Disclosure of Invention
The embodiment of the invention provides a method and a device for acquiring crowd information and a computer readable storage medium, which are used for at least solving the technical problems that in the prior art, when acquiring high-density crowd information, the device performance is depended on, the application scene is limited due to single means, and the user requirements cannot be met.
According to an aspect of an embodiment of the present invention, there is provided a method for acquiring crowd information, including: acquiring a target image, wherein the target image is an image to be subjected to crowd information detection; obtaining a target optical flow feature map based on the target image; determining a target position density map and a target size density map corresponding to the target image and the target optical flow feature map by a prediction model, wherein the prediction model is obtained by machine learning training using a plurality of sets of training data, and each set of training data in the plurality of sets of training data comprises: a sample image, an optical flow feature map, and a position density map and a size density map corresponding to the sample image and the optical flow feature map; and acquiring crowd information in the target image based on the target position density map and the target size density map.
Optionally, deriving a target optical flow feature map based on the target image includes: acquiring a projection value of an optical flow feature of the target image in a preset direction; generating the target optical flow feature map based on the projection values.
Optionally, before determining, by the prediction model, a target position density map and a target size density map corresponding to the target image and the target optical flow feature map, the method further comprises: acquiring a plurality of historical original images in a historical time period; generating a plurality of optical flow characteristic graphs of the historical original images to obtain a plurality of historical optical flow characteristic graphs; acquiring a plurality of historical position density graphs and a plurality of historical size density graphs corresponding to a plurality of historical original images and a plurality of historical optical flow feature graphs; and training a plurality of groups of training data comprising a plurality of historical original images, a plurality of historical optical flow feature maps and a plurality of historical position density maps and a plurality of historical size density maps to obtain the prediction model.
Optionally, obtaining a plurality of historical position density maps corresponding to a plurality of the historical raw images includes: acquiring a header characteristic information set of a plurality of target objects in the historical original image; generating the historical location density map based on a first Gaussian kernel and the set of head feature information, wherein the first Gaussian kernel is a fixed-size Gaussian kernel.
Optionally, obtaining a plurality of historical size density maps corresponding to a plurality of the historical raw images includes: acquiring a header characteristic information set of a plurality of target objects in the historical original image; generating the historical size density map based on a second Gaussian kernel and the head feature information set, wherein the second Gaussian kernel is a Gaussian kernel having a predetermined relation with the head of the target object.
Optionally, obtaining the crowd information in the target image based on the target location density map and the target size density map includes: extracting central position information of a target object from the target position density map; extracting size information of the target object from the target size density map; and acquiring crowd information in the target image based on the central position information and the size information.
Optionally, obtaining crowd information in the target image based on the center position information and the size information includes: determining motion vector information of a single target object in a target area corresponding to the central position information and the size information based on an optical flow analysis mode; determining a predicted position of the single target object based on the motion vector information of the single target object and the current position information of the single target object; judging whether the single target object meets a preset condition or not based on the predicted position of the single target object and the current position information of the single target object to obtain a judgment result; determining statistical information of a part of target objects meeting the predetermined condition based on the judgment result, wherein the statistical information comprises at least one of the following: quantity information, location information.
According to another aspect of the embodiments of the present invention, there is provided a device for acquiring crowd information, including: the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a target image, and the target image is an image to be subjected to crowd information detection; the second acquisition module is used for obtaining a target optical flow characteristic diagram based on the target image; a determining module, configured to determine, through a prediction model, a target position density map and a target size density map corresponding to the target image and the target optical flow feature map, where the prediction model is obtained through machine learning training using multiple sets of training data, and each of the multiple sets of training data includes: a sample image, an optical flow feature map, and a position density map and a size density map corresponding to the sample image and the optical flow feature map; and the third acquisition module is used for acquiring the crowd information in the target image based on the target position density map and the target size density map.
Optionally, the second obtaining module includes: a first acquisition unit configured to acquire a projection value of an optical flow feature of the target image in a predetermined direction; a first generating unit configured to generate the target optical flow feature map based on the projection value.
Optionally, the apparatus for acquiring crowd information further includes: an acquisition module, configured to acquire a plurality of historical original images within a historical time period before determining, by a prediction model, a target position density map and a target size density map corresponding to the target image and the target optical flow feature map; the generating module is used for generating a plurality of optical flow characteristic graphs of the historical original images to obtain a plurality of historical optical flow characteristic graphs; a fourth obtaining module, configured to obtain a plurality of historical position density maps and a plurality of historical size density maps corresponding to the plurality of historical original images and the plurality of historical optical flow feature maps; and the training module is used for training a plurality of groups of training data comprising a plurality of historical original images, a plurality of historical optical flow feature maps and a plurality of historical position density maps and a plurality of historical size density maps to obtain the prediction model.
Optionally, the fourth obtaining module includes: the second acquisition unit is used for acquiring a head characteristic information set of a plurality of target objects in the original history graph; and a second generating unit, configured to generate the historical position density map based on a first gaussian kernel and the head feature information set, where the first gaussian kernel is a fixed-size gaussian kernel.
Optionally, the fourth obtaining module includes: the third acquisition unit is used for acquiring a head characteristic information set of a plurality of target objects in the original history graph; a third generating unit, configured to generate the historical size density map based on a second gaussian kernel and the set of head feature information, where the second gaussian kernel is a gaussian kernel having a predetermined relationship with the head of the target object.
Optionally, the third obtaining module includes: a first extraction unit configured to extract center position information of a target object from the target position density map; a second extraction unit configured to extract size information of the target object from the target size density map; and the fourth acquisition unit is used for acquiring the crowd information in the target image based on the central position information and the size information.
Optionally, the fourth obtaining unit includes: a first determining subunit, configured to determine, based on an optical flow analysis manner, motion vector information of a single target object in a target area corresponding to the center position information and the size information; a second determining subunit configured to determine a predicted position of the single target object based on the motion vector information of the single target object and the current position information of the single target object; a judging subunit, configured to judge, based on the predicted position of the single target object and the current position information of the single target object, whether the single target object satisfies a predetermined condition, to obtain a judgment result; a third determining subunit, configured to determine statistical information of a part of the target objects that satisfy the predetermined condition based on the determination result, wherein the statistical information includes at least one of: quantity information, location information.
According to another aspect of the embodiment of the present invention, there is provided a computer-readable storage medium, where the computer-readable storage medium includes a stored computer program, and when the computer program is executed by a processor, the apparatus in which the computer-readable storage medium is located is controlled to execute the method for acquiring crowd information described in any one of the above.
According to another aspect of the embodiment of the present invention, there is further provided a processor, where the processor is configured to execute a computer program, where the computer program executes to execute the method for acquiring crowd information according to any one of the above descriptions.
In the embodiment of the invention, a target image is obtained, wherein the target image is an image to be subjected to crowd information detection; obtaining a target optical flow feature map based on the target image; determining a target position density graph and a target size density graph corresponding to a target image and a target optical flow feature graph through a prediction model, wherein the prediction model is obtained by using a plurality of groups of training data through machine learning training, and each group of training data in the plurality of groups of training data comprises: the method comprises the steps of obtaining a sample image, an optical flow feature map and a position density map and a size density map corresponding to the sample image and the optical flow feature map; and acquiring the crowd information in the target image based on the target position density map and the target size density map. By the crowd information acquisition method, the purpose of processing the image to be subjected to the crowd information detection through the target position density map and the target size density map of the prediction model and acquiring the crowd information in the target image is achieved, so that the technical effect of increasing the richness of the crowd information acquisition means to better meet the user requirements is achieved, and the technical problems that the application scene is limited and the user requirements cannot be met due to the fact that the high-density crowd information is acquired by relying on the performance of equipment and the means are single in the prior art are solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a flowchart of a method for acquiring crowd information according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a crowd information acquiring apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in other sequences than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
In accordance with an embodiment of the present invention, there is provided a method embodiment of a method for obtaining crowd information, where the steps shown in the flowchart of the figure may be executed in a computer system such as a set of computer executable instructions, and where a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in an order different than that shown.
Fig. 1 is a flowchart of a method for acquiring crowd information according to an embodiment of the present invention, and as shown in fig. 1, the method for acquiring crowd information includes the following steps:
and S102, acquiring a target image, wherein the target image is an image to be subjected to crowd information detection.
Optionally, in the above step, the target image is acquired by an image acquisition device, where the target image is a crowd image to be analyzed, and the acquired image may be a static picture or an image acquired first and then decomposed into several frames.
And step S104, obtaining a target optical flow characteristic diagram based on the target image.
Optionally, in the above step, the projection values in the X-axis direction and the Y-axis direction in the target image are used to form the target optical flow feature map.
Step S106, determining a target position density graph and a target size density graph corresponding to the target image and the target optical flow characteristic graph through a prediction model, wherein the prediction model is obtained by using a plurality of groups of training data through machine learning training, and each group of training data in the plurality of groups of training data comprises: the optical flow characteristic map is generated by a position density map and a size density map corresponding to the sample image and the optical flow characteristic map.
And step S108, acquiring the crowd information in the target image based on the target position density map and the target size density map.
As can be seen from the above, in the embodiment of the present invention, a target image may be obtained first, where the target image is an image to be subjected to crowd information detection; then, obtaining a target optical flow characteristic diagram based on the target image; then, a target position density map and a target size density map corresponding to the target image and the target optical flow feature map may be determined through a prediction model, where the prediction model is obtained through machine learning training using multiple sets of training data, and each set of training data in the multiple sets of training data includes: the method comprises the steps that a sample image, an optical flow feature map and a position density map and a size density map which correspond to the sample image and the optical flow feature map are obtained; and finally, acquiring the crowd information in the target image based on the target position density map and the target size density map. By the crowd information acquisition method, the purpose of processing the image to be subjected to the crowd information detection through the target position density map and the target size density map of the prediction model and acquiring the crowd information in the target image is achieved, so that the technical effect of increasing the richness of the crowd information acquisition means to better meet the user requirements is achieved, and the technical problems that the application scene is limited and the user requirements cannot be met due to the fact that the high-density crowd information is acquired by relying on the performance of equipment and the means are single in the prior art are solved.
As an alternative embodiment, obtaining the target optical flow feature map based on the target image includes: acquiring a projection value of an optical flow characteristic of a target image in a preset direction; and generating a target optical flow feature map based on the projection values.
In the above alternative embodiment, the projected values of the optical-flow features in the X-direction and the Y-direction are recorded to form optical-flow feature maps, which are respectively denoted as flow _ X _ map (i.e., a target optical-flow feature map based on the projected values in the X-axis direction) and flow _ Y _ map (i.e., a target optical-flow feature map based on the projected values in the Y-axis direction).
As an alternative embodiment, before determining the target position density map and the target size density map corresponding to the target image and the target optical flow feature map through the prediction model, the method further includes: acquiring a plurality of historical original images in a historical time period; generating optical flow characteristic graphs of a plurality of historical original images to obtain a plurality of historical optical flow characteristic graphs; acquiring a plurality of historical position density graphs and a plurality of historical size density graphs corresponding to a plurality of historical original images and a plurality of historical optical flow feature graphs; and training a plurality of groups of training data including a plurality of historical original images, a plurality of historical optical flow characteristic graphs, a plurality of historical position density graphs and a plurality of historical size density graphs to obtain a prediction model.
In the above alternative embodiment, the head region of the video crowd target is labeled in the form of the center coordinates and the length and width dimensions (i.e., the head feature information) of the human head target p. Can be noted as [ x _ cen ]p,y_cenp,widthp,heightp]. Calculating the average value d of the width and height of the human head target ppIn a calculation manner of
Figure BDA0003372616720000061
Further, the optical flow feature maps flow _ x _ map, flow _ y _ map and the original image (designated as origin _ map) can be used as sample training networks for predicting the position density map and the size density map.
As an alternative embodiment, obtaining a plurality of historical position density maps corresponding to a plurality of historical raw images includes: acquiring a header characteristic information set of a plurality of target objects in a historical original image; and generating a historical position density map based on the first Gaussian kernel and the head characteristic information set, wherein the first Gaussian kernel is a Gaussian kernel with a fixed size.
In the above alternative embodiment, a set of head feature information of a plurality of target objects in the history original map is obtained and the history position density map is generated based on the first gaussian kernel.
As an alternative embodiment, obtaining a plurality of history size density maps corresponding to a plurality of history original images comprises: acquiring a header characteristic information set of a plurality of target objects in a historical original image; and generating a historical size density map based on a second Gaussian kernel and the head characteristic information set, wherein the second Gaussian kernel is a Gaussian kernel with a preset relation with the head of the target object.
In the above alternative embodiment, a density map (denoted as gt _ location _ severity _ map) may be generated by a fixed-size gaussian kernel (i.e., the first gaussian kernel) for determining the target location. First, a density map (denoted as gt _ size _ density _ map) is generated by a gaussian kernel (i.e., the second gaussian kernel) proportional to the size of the head of a person, and is used to determine the target size, wherein the position density map (denoted as gt _ location _ density _ map) is generated as follows. Assume that the target set of human head targets in the image is R. The position density map generation algorithm is
Figure BDA0003372616720000071
Wherein
Figure BDA0003372616720000072
Represents by xpStandard deviation of σ as centerpIs taken at the position x, where σpUsing a fixed value σ; next, a size density map (denoted as gt _ size _ density _ map) is generated in such a manner that a target set of human head targets in the image is assumed to be R, and the position density map generation algorithm is such that
Figure BDA0003372616720000073
Wherein the content of the first and second substances,
Figure BDA0003372616720000074
represents by xpStandard deviation of σ as centerpIs taken at the position x, where σpUsing the value r x dp
As an alternative embodiment, the obtaining of the crowd information in the target image based on the target position density map and the target size density map includes: extracting central position information of the target object from the target position density map; extracting size information of the target object from the target size density map; and acquiring the crowd information in the target image based on the central position information and the size information.
As an alternative embodiment, the obtaining of the crowd information in the target image based on the center position information and the size information includes: determining motion vector information of a single target object in a target area corresponding to the central position information and the size information based on an optical flow analysis mode; determining a predicted position of the single target object based on the motion vector information of the single target object and the current position information of the single target object; judging whether the single target object meets a preset condition or not based on the predicted position of the single target object and the current position information of the single target object to obtain a judgment result; determining statistical information of the part of the target objects meeting the predetermined condition based on the judgment result, wherein the statistical information comprises at least one of the following: quantity information, location information.
In the above optional embodiment, the image to be inferred is utilized to calculate the optical flow feature map thereof, and the predicted position density map prediction _ location _ density _ map and size density map prediction _ size _ density _ map are obtained according to the training network. Next, for the position density map, the center position information of the target is extracted from the position density map prediction _ location _ density _ map, and it is considered that the center position coordinates are obtained by using a maximum value or a gaussian fitting method. A simple method for calculating the center position of the target is provided according to an embodiment of the present invention.
Step 1, on the prediction _ location _ severity _ map, if a maximum value point is searched in a neighborhood N1(q) of a position q, if the position q is the maximum value point and the value is greater than a preset value, the point can be regarded as a target center position. Considering a partially dense object, the values of the prediction _ location _ density _ map in the neighborhood of location q, N1(q), are summed, and the sum is taken as the number of objects in the location, count _ q.
And 2, extracting width and height information of the target from the size density map according to the size density map, wherein the size information of the human head can be obtained by considering a Gaussian fitting method.
And 3, assuming that the position q meets the target center position condition in the step 6, assuming that the neighborhood range with the position q as the center is N2(q), and the coordinate of the position q is xqBased on the value of the prediction _ size _ density _ map in N2(q), the method uses
Figure BDA0003372616720000081
Fitting to obtain σqUsing the previously set r value to calculate
Figure BDA0003372616720000082
D is to bepThe target width and height may be set.
Step 4, taking the rectangular range with the position q obtained in the steps 2 and 3 as the center as a target area range, dpIs rectangular in width and height, and its area is assumed to be O (q). Calculating a motion vector of a single object and a motion vector V (q) of an object q based on the optical flow, and calculating V (q) ═ Vx (q), Vy (q)],
Figure BDA0003372616720000083
Figure BDA0003372616720000084
Wherein K is the number of pixels in O (q).
Step 5, according to the motion vector of the target and the target position, calculating a predicted position, wherein the predicted position is xq+V(q)。
And 6, determining whether to cross the line according to the target predicted position and the current position, and if the line is crossed, marking the line-crossed target. And simultaneously recording the number of the targets, thereby acquiring the positions and the number of the line-crossing targets.
As can be seen from the above, in the embodiment of the present invention, the method for estimating crowd density by combining optical flow provided by the embodiment, the method for determining position size information of a target by using a size density map and a position density map, and the method for analyzing a single target and detecting an object crossing by combining optical flow and density map obtain the number of objects crossing the line in the crowd information.
Example 2
According to another aspect of the embodiment of the present invention, there is also provided a device for acquiring crowd information, and fig. 2 is a schematic diagram of the device for acquiring crowd information according to the embodiment of the present invention, as shown in fig. 2, including: a first obtaining module 21, a second obtaining module 23, a determining module 25 and a third obtaining module 27. The following describes the crowd information acquiring apparatus.
The first obtaining module 21 is configured to obtain a target image, where the target image is an image to be subjected to crowd information detection.
And a second obtaining module 23, configured to obtain a target optical flow feature map based on the target image.
A determining module 25, configured to determine, through a prediction model, a target position density map and a target size density map corresponding to the target image and the target optical flow feature map, where the prediction model is obtained through machine learning training using multiple sets of training data, and each of the multiple sets of training data includes: the optical flow characteristic map is generated by a position density map and a size density map corresponding to the sample image and the optical flow characteristic map.
And a third obtaining module 27, configured to obtain the crowd information in the target image based on the target location density map and the target size density map.
It should be noted here that the first obtaining module 21, the second obtaining module 23, the determining module 25, and the third obtaining module 27 correspond to steps S102 to S108 in embodiment 1, and the modules are the same as the corresponding steps in the implementation example and the application scenario, but are not limited to the disclosure in embodiment 1. It should be noted that the modules described above as part of an apparatus may be implemented in a computer system such as a set of computer-executable instructions.
As can be seen from the above, in the embodiment of the present invention, first, a target image may be obtained by using the first obtaining module 21, where the target image is an image to be subjected to crowd information detection; then, a second acquisition module 23 is used for obtaining a target optical flow characteristic diagram based on the target image; next, the determining module 25 determines a target position density map and a target size density map corresponding to the target image and the target optical flow feature map through a prediction model, where the prediction model is obtained through machine learning training using multiple sets of training data, and each of the multiple sets of training data includes: the method comprises the steps that a sample image, an optical flow feature map and a position density map and a size density map which correspond to the sample image and the optical flow feature map are obtained; and finally, acquiring the crowd information in the target image based on the target position density map and the target size density map by using a third acquisition module 27. By the crowd information acquisition device, the purpose of processing the image to be subjected to crowd information detection through the target position density map and the target size density map of the prediction model and acquiring the crowd information in the target image is achieved, so that the technical effect of increasing the richness of the crowd information acquisition means to better meet the user requirements is achieved, and the technical problems that the application scene is limited and the user requirements cannot be met due to the fact that the high-density crowd information is acquired by relying on the equipment performance and the means are single in the prior art are solved.
Optionally, the second obtaining module includes: a first acquisition unit configured to acquire a projection value of an optical flow feature of a target image in a predetermined direction; and the first generation unit is used for generating the target optical flow feature map based on the projection value.
Optionally, the apparatus for acquiring crowd information further includes: the acquisition module is used for acquiring a plurality of historical original images in a historical time period before determining a target position density graph and a target size density graph corresponding to a target image and a target optical flow characteristic graph through a prediction model; the generating module is used for generating a plurality of optical flow characteristic graphs of historical original images to obtain a plurality of historical optical flow characteristic graphs; the fourth acquisition module is used for acquiring a plurality of historical position density graphs and a plurality of historical size density graphs corresponding to the plurality of historical original images and the plurality of historical optical flow feature graphs; and the training module is used for training a plurality of groups of training data comprising a plurality of historical original images, a plurality of historical optical flow characteristic graphs and a plurality of historical position density graphs and a plurality of historical size density graphs to obtain a prediction model.
Optionally, the fourth obtaining module includes: the second acquisition unit is used for acquiring a head characteristic information set of a plurality of target objects in the original history graph; and a second generating unit, configured to generate a historical position density map based on the first gaussian kernel and the head feature information set, where the first gaussian kernel is a fixed-size gaussian kernel.
Optionally, the fourth obtaining module includes: the third acquisition unit is used for acquiring a head characteristic information set of a plurality of target objects in the original history graph; and a third generating unit, configured to generate the historical size density map based on a second gaussian kernel and the head feature information set, where the second gaussian kernel is a gaussian kernel having a predetermined relationship with the head of the target object.
Optionally, the third obtaining module includes: a first extraction unit configured to extract center position information of the target object from the target position density map; a second extraction unit for extracting size information of the target object from the target size density map; and the fourth acquisition unit is used for acquiring the crowd information in the target image based on the central position information and the size information.
Optionally, the fourth obtaining unit includes: the first determining subunit is used for determining motion vector information of a single target object in a target area corresponding to the central position information and the size information based on an optical flow analysis mode; a second determining subunit configured to determine a predicted position of the single target object based on the motion vector information of the single target object and the current position information of the single target object; the judging subunit is used for judging whether the single target object meets a preset condition or not based on the predicted position of the single target object and the current position information of the single target object to obtain a judgment result; a third determining subunit, configured to determine statistical information of the part of the target objects that satisfy the predetermined condition based on the determination result, wherein the statistical information includes at least one of: quantity information, location information.
Example 3
According to another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is executed by a processor, the apparatus in which the computer-readable storage medium is located is controlled to execute the crowd information acquiring method according to any one of the above.
Example 4
According to another aspect of the embodiment of the present invention, there is further provided a processor, configured to execute a computer program, where the computer program executes the method for acquiring crowd information according to any one of the above methods.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and amendments can be made without departing from the principle of the present invention, and these modifications and amendments should also be considered as the protection scope of the present invention.

Claims (10)

1. A method for acquiring crowd information is characterized by comprising the following steps:
acquiring a target image, wherein the target image is an image to be subjected to crowd information detection;
obtaining a target optical flow feature map based on the target image;
determining a target position density map and a target size density map corresponding to the target image and the target optical flow feature map by a prediction model, wherein the prediction model is obtained by machine learning training using a plurality of sets of training data, and each set of training data in the plurality of sets of training data comprises: a sample image, an optical flow feature map, and a position density map and a size density map corresponding to the sample image and the optical flow feature map;
and acquiring crowd information in the target image based on the target position density map and the target size density map.
2. The method of claim 1, wherein deriving a target optical flow feature map based on the target image comprises:
acquiring a projection value of an optical flow feature of the target image in a preset direction;
generating the target optical flow feature map based on the projection values.
3. The method of claim 1, further comprising, prior to determining, by a predictive model, a target position density map and a target size density map corresponding to the target image and the target optical flow feature map:
acquiring a plurality of historical original images in a historical time period;
generating a plurality of optical flow characteristic graphs of the historical original images to obtain a plurality of historical optical flow characteristic graphs;
acquiring a plurality of historical position density graphs and a plurality of historical size density graphs corresponding to a plurality of historical original images and a plurality of historical optical flow feature graphs;
and training a plurality of groups of training data including a plurality of historical original images, a plurality of historical optical flow characteristic graphs and a plurality of historical position density graphs and a plurality of historical size density graphs to obtain the prediction model.
4. The method of claim 3, wherein obtaining a plurality of historical position density maps corresponding to a plurality of the historical raw images comprises:
acquiring a header characteristic information set of a plurality of target objects in the historical original image;
generating the historical location density map based on a first Gaussian kernel and the set of head feature information, wherein the first Gaussian kernel is a fixed-size Gaussian kernel.
5. The method of claim 3, wherein obtaining a plurality of historical size-placement density maps corresponding to a plurality of the historical raw images comprises:
acquiring a header characteristic information set of a plurality of target objects in the historical original image;
generating the historical size density map based on a second Gaussian kernel and the head feature information set, wherein the second Gaussian kernel is a Gaussian kernel having a predetermined relation with the head of the target object.
6. The method according to any one of claims 1 to 5, wherein obtaining crowd information in the target image based on the target location density map and the target size density map comprises:
extracting central position information of a target object from the target position density map;
extracting size information of the target object from the target size density map;
and acquiring crowd information in the target image based on the central position information and the size information.
7. The method of claim 6, wherein obtaining crowd information in the target image based on the center position information and the size information comprises:
determining motion vector information of a single target object in a target area corresponding to the central position information and the size information based on an optical flow analysis mode;
determining a predicted position of the single target object based on the motion vector information of the single target object and the current position information of the single target object;
judging whether the single target object meets a preset condition or not based on the predicted position of the single target object and the current position information of the single target object to obtain a judgment result;
determining statistical information of a part of target objects meeting the predetermined condition based on the judgment result, wherein the statistical information comprises at least one of the following: quantity information, location information.
8. An apparatus for acquiring crowd information, comprising:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a target image, and the target image is an image to be subjected to crowd information detection;
the second acquisition module is used for obtaining a target optical flow characteristic diagram based on the target image;
a determining module, configured to determine, through a prediction model, a target position density map and a target size density map corresponding to the target image and the target optical flow feature map, where the prediction model is obtained through machine learning training using multiple sets of training data, and each of the multiple sets of training data includes: a sample image, an optical flow feature map, and a position density map and a size density map corresponding to the sample image and the optical flow feature map;
and the third acquisition module is used for acquiring the crowd information in the target image based on the target position density map and the target size density map.
9. A computer-readable storage medium, comprising a stored computer program, wherein when the computer program is executed by a processor, the computer-readable storage medium controls an apparatus to execute the method for acquiring crowd information according to any one of claims 1 to 7.
10. A processor for executing a computer program, wherein the computer program executes to perform the method for acquiring crowd information according to any one of claims 1 to 7.
CN202111407068.8A 2021-11-24 2021-11-24 Crowd information acquisition method and device and computer-readable storage medium Pending CN114092883A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111407068.8A CN114092883A (en) 2021-11-24 2021-11-24 Crowd information acquisition method and device and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111407068.8A CN114092883A (en) 2021-11-24 2021-11-24 Crowd information acquisition method and device and computer-readable storage medium

Publications (1)

Publication Number Publication Date
CN114092883A true CN114092883A (en) 2022-02-25

Family

ID=80304328

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111407068.8A Pending CN114092883A (en) 2021-11-24 2021-11-24 Crowd information acquisition method and device and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN114092883A (en)

Similar Documents

Publication Publication Date Title
CN109858371B (en) Face recognition method and device
US10430667B2 (en) Method, device, and computer program for re-identification of objects in images obtained from a plurality of cameras
US7940957B2 (en) Object tracker for visually tracking object motion
CN110853033B (en) Video detection method and device based on inter-frame similarity
RU2607774C2 (en) Control method in image capture system, control apparatus and computer-readable storage medium
EP1542155A1 (en) Object detection
CN112989962B (en) Track generation method, track generation device, electronic equipment and storage medium
CN110691259A (en) Video playing method, system, device, electronic equipment and storage medium
EP1542154A2 (en) Object detection
CN112422909B (en) Video behavior analysis management system based on artificial intelligence
AU2018379393A1 (en) Monitoring systems, and computer implemented methods for processing data in monitoring systems, programmed to enable identification and tracking of human targets in crowded environments
CN110060278A (en) The detection method and device of moving target based on background subtraction
CN111091093A (en) Method, system and related device for estimating number of high-density crowds
CN114549582A (en) Track map generation method and device and computer readable storage medium
CN114926781A (en) Multi-user time-space domain abnormal behavior positioning method and system supporting real-time monitoring scene
CN109086725A (en) Hand tracking and machine readable storage medium
CN114613006A (en) Remote gesture recognition method and device
CN113920585A (en) Behavior recognition method and device, equipment and storage medium
CN111563492B (en) Fall detection method, fall detection device and storage device
JPWO2018179119A1 (en) Video analysis device, video analysis method, and program
Ma et al. Depth assisted occlusion handling in video object tracking
CN114092883A (en) Crowd information acquisition method and device and computer-readable storage medium
CN112257666B (en) Target image content aggregation method, device, equipment and readable storage medium
CN113489897A (en) Image processing method and related device
CN111860261A (en) Passenger flow value statistical method, device, equipment and medium

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