Disclosure of Invention
The embodiment provides a passenger flow statistics method, device and computer equipment based on an umbrella-opening pedestrian, so as to solve the problem that the pedestrian flow cannot be accurately counted under the umbrella-opening condition of the pedestrian in the related technology.
In a first aspect, in this embodiment, there is provided a passenger flow statistics method based on an umbrella-opening pedestrian, the method including:
detecting each input image through a complete target detection model to obtain a corresponding target label, wherein the target label comprises an umbrella label;
tracking pedestrian targets in the input images of successive multiframes based on different target tags;
determining the target labels matched with each pedestrian target and the corresponding identity;
And carrying out passenger flow statistics on each pedestrian target based on the movement track information corresponding to each identity.
In some embodiments, in a case where each of the target tags is an umbrella tag, the determining the target tag and the corresponding identity that match each of the pedestrian targets includes:
determining the umbrella tags that match each of the pedestrian targets;
The first identification of the matched umbrella label is used as the identity identification of the pedestrian target, and the first identification is used for uniquely identifying the corresponding umbrella label.
In some embodiments, where the target tag further includes a pedestrian head-shoulder tag and a pedestrian umbrella tag, the determining the target tag and corresponding identity matching each of the pedestrian targets includes:
determining a plurality of target tags matched with each pedestrian target, wherein a containing relationship exists between the position areas corresponding to the target tags;
And determining the identity of each pedestrian target based on each target label corresponding to each pedestrian target.
In some embodiments, in a case where the target tag further includes a pedestrian head-shoulder tag and a pedestrian umbrella tag, the determining the target tag and the corresponding identity that match each of the pedestrian targets further includes:
Determining a plurality of target tags matched with each pedestrian target, wherein a containing relationship exists between the position areas corresponding to the target tags, and the position movement tracks corresponding to the target tags meet a preset similarity relationship in pairs;
And determining the identity of each pedestrian target based on each target label corresponding to each pedestrian target.
In some embodiments, the determining, based on each of the target tags corresponding to each of the pedestrian targets, the identity of the pedestrian target includes:
determining a plurality of said target tags that match each of said pedestrian targets;
acquiring a second identifier of the target tag with the highest priority, wherein the second identifier is used for uniquely identifying the corresponding target tag;
And taking the second identifier as the identity identifier of the pedestrian target.
In some embodiments, determining whether there is an inclusion relationship between the location areas corresponding to the target tags includes:
The position coordinates of each target label are obtained, wherein the position coordinates comprise two diagonal vertex coordinates of a rectangular detection frame corresponding to the target label;
Calculating the position coordinates of the target labels in different categories to obtain the inclusion proportion among the position areas corresponding to the target labels;
and when the inclusion proportion is larger than a preset threshold value, judging that an inclusion relationship exists among the target labels.
In some embodiments, the performing passenger flow statistics on each pedestrian target based on the movement track information corresponding to each identity identifier includes:
Determining the in-out state of the pedestrian target corresponding to the identity based on the movement track information corresponding to each identity and a preset tripwire rule;
And carrying out passenger flow statistics on each pedestrian target based on the in-out state of each pedestrian target.
In a second aspect, in this embodiment, a passenger flow statistics device based on an umbrella-opening pedestrian is provided, where the device includes a detection module, a tracking module, a matching module, and a statistics module;
the detection module is used for detecting each input image through a complete target detection model to obtain a corresponding target label, wherein the target label comprises an umbrella label;
The tracking module is used for tracking pedestrian targets in the input images of continuous multiframes based on different target tags;
the matching module is used for determining the target label matched with each pedestrian target and the corresponding identity;
And the statistics module is used for carrying out passenger flow statistics on each pedestrian target based on the movement track information corresponding to each identity.
In a third aspect, in this embodiment, there is provided a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the method for statistics of passenger flows based on umbrella pedestrians according to the first aspect.
In a fourth aspect, in this embodiment, there is provided a storage medium having stored thereon a computer program which, when executed by a processor, implements the parachute-based pedestrian traffic statistics method described in the first aspect above.
Compared with the related art, the passenger flow statistics method, device and computer equipment based on the parachute-opening pedestrians are provided in the embodiment, each input image is detected through training a complete target detection model to obtain corresponding target labels, the target labels comprise umbrella labels, pedestrian targets in the input images of continuous multiframes are tracked based on different target labels, target labels matched with each pedestrian target and corresponding identity marks are determined, further passenger flow statistics is carried out on each pedestrian target based on movement track information corresponding to each identity mark, the problem that pedestrian flow cannot be accurately counted under the condition that a pedestrian opens a parachute is solved, and pedestrian flow is accurately counted under the condition that the pedestrian opens a parachute.
The details of one or more embodiments of the application are set forth in the accompanying drawings and the description below to provide a more thorough understanding of the other features, objects, and advantages of the application.
Detailed Description
The present application will be described and illustrated with reference to the accompanying drawings and examples for a clearer understanding of the objects, technical solutions and advantages of the present application.
Unless defined otherwise, technical or scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terms "a," "an," "the," "these" and similar terms in this application are not intended to be limiting in number, but may be singular or plural. The terms "comprises," "comprising," "includes," "including," "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, and system, article, or apparatus that comprises a list of steps or modules (units) is not limited to the list of steps or modules (units), but may include other steps or modules (units) not listed or inherent to such process, method, article, or apparatus. The terms "connected," "coupled," and the like in this disclosure are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The term "plurality" as used herein means two or more. "and/or" describes the association relationship of the association object, and indicates that three relationships may exist, for example, "a and/or B" may indicate that a exists alone, a and B exist simultaneously, and B exists alone. Typically, the character "/" indicates that the associated object is an "or" relationship. The terms "first," "second," "third," and the like, as referred to in this disclosure, merely distinguish similar objects and do not represent a particular ordering for objects.
The method embodiments provided in the present embodiment may be executed in a terminal, a computer, or similar computing device. For example, the method runs on a terminal, and fig. 1 is a block diagram of a hardware structure of the terminal based on the passenger flow statistics method of the parachute-opening pedestrian in the present embodiment. As shown in fig. 1, the terminal may include one or more (only one is shown in fig. 1) processors 102 and a memory 104 for storing data, wherein the processors 102 may include, but are not limited to, a microprocessor MCU, a programmable logic device FPGA, or the like. The terminal may also include a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those skilled in the art that the structure shown in fig. 1 is merely illustrative and is not intended to limit the structure of the terminal. For example, the terminal may also include more or fewer components than shown in fig. 1, or have a different configuration than shown in fig. 1.
The memory 104 may be used to store computer programs, such as software programs and modules of application software, such as a computer program corresponding to the parachute-based pedestrian traffic statistics method in the present embodiment, and the processor 102 executes the computer programs stored in the memory 104 to perform various functional applications and data processing, that is, to implement the above-described method. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory remotely located relative to the processor 102, which may be connected to the terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used to receive or transmit data via a network. The network includes a wireless network provided by a communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, simply referred to as a NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is configured to communicate with the internet wirelessly.
In this embodiment, a passenger flow statistics method based on an umbrella-opening pedestrian is provided, fig. 2 is a flowchart of the passenger flow statistics method based on the umbrella-opening pedestrian in this embodiment, as shown in fig. 2, and the flowchart includes the following steps:
Step S210, detecting each input image through training a complete target detection model to obtain a corresponding target label, wherein the target label comprises an umbrella label;
Step S220, tracking pedestrian targets in the input images of the continuous multiframes based on different target tags;
Step S230, determining a target label matched with each pedestrian target and a corresponding identity;
step S240, based on the movement track information corresponding to each identity, passenger flow statistics is carried out on each pedestrian target.
Specifically, the entrance and exit of a target place or scene is monitored in real time through monitoring equipment, pictures of pedestrians entering and exiting are collected to obtain continuous multi-frame input images, each input image is detected through training a complete target detection model to obtain a corresponding target label, the target label at least comprises an umbrella label, the umbrella label is a label obtained by identifying an umbrella under the condition that the pedestrians get on the umbrella, the label is output in the form of a boundary frame such as a rectangular frame and the like, and the spatial position of the label is conveniently determined.
The object detection model can adopt a YOLO detection model, a single-step multi-frame detection (Single Shot MultiBox Detector, SSD) model and the like, and is used for detecting pedestrian head and shoulder labels, pedestrian umbrella-opening labels and umbrella labels in images, marking the pedestrian head and shoulder labels, the pedestrian umbrella-opening labels and the umbrella labels in training images in the form of boundary frames such as rectangular frames and the like in the training process of the object detection model, and training the model by using the training images after marking.
Further, according to different target labels output by the model, pedestrian targets in the input images of the continuous multiframes are tracked. Under the condition that all the target labels are umbrella labels, as the umbrella used by the pedestrian for opening the umbrella moves along with the movement of the pedestrian, the movement track of the umbrella is relatively synchronous with the movement track of the pedestrian, corresponding pedestrian targets can be tracked based on each umbrella label, the umbrella label matched with each pedestrian target is determined, the first identification of the umbrella label matched with the pedestrian target is used as the identity identification of the pedestrian target, and the first identification is used for uniquely identifying the corresponding umbrella label.
In addition, under the condition that the target labels comprise a pedestrian head shoulder label, a pedestrian umbrella label and an umbrella label, as the umbrella used by the umbrella and the pedestrian moves along with the movement of the pedestrian, the position movement tracks corresponding to the pedestrian head shoulder label, the pedestrian umbrella label and the umbrella label are synchronous with the pedestrian targets relatively, the pedestrian targets in the input image can be tracked based on different target labels, whether the inclusion relationship exists between the position areas corresponding to the target labels or not is judged, if the inclusion relationship exists among the target labels, the inclusion relationship shows that the target labels belong to the same pedestrian target, the target labels are combined and matched to the same pedestrian target, so that a plurality of target labels matched with each pedestrian target can be determined, and the identity of the pedestrian target is determined based on the target labels corresponding to each pedestrian target.
And then, positioning and tracking the pedestrian targets based on the identity marks corresponding to each pedestrian target to obtain corresponding movement track information, analyzing the in-out states of the pedestrian targets corresponding to the identity marks according to the movement track information corresponding to each identity mark and a preset tripwire rule, and further carrying out passenger flow statistics on each pedestrian target based on the in-out states of each pedestrian target, wherein the statistical result comprises the number of the pedestrians entering and the number of the pedestrians leaving.
Under the condition that the pedestrians are not parachuted in the input image, the pedestrians can be detected and identified, the detected pedestrian head and shoulder labels are output, or the detected pedestrian rectangular frame is used as the pedestrian parachute label to be output, so that the pedestrians which are not parachuted can be tracked later, and the embodiment is simultaneously suitable for detecting the parachute-opening pedestrians and the non-parachute-opening pedestrians.
The passenger flow statistics aims at carrying out statistics and analysis on the pedestrian flow of a certain place or place, in the existing passenger flow statistics method, the position of the head area of the pedestrian is detected and tracked, and the personnel are counted according to the detection tracking result. However, under the scene that the pedestrians get in and out when opening the umbrella, the method is influenced by the shielding of the umbrella, and the pedestrian flow cannot be accurately counted under the condition that the pedestrians open the umbrella.
Compared with the prior art, the method and the device have the advantages that each input image is detected through training a complete target detection model to obtain corresponding target labels, the target labels comprise umbrella labels, pedestrian targets in the input images of continuous multiframes are tracked based on different target labels, target labels matched with each pedestrian target and corresponding identity marks are determined, and further passenger flow statistics is carried out on each pedestrian target based on movement track information corresponding to each identity mark. Based on the method, the umbrella label associated with the pedestrian in the input image is detected and acquired under the condition that the pedestrian is parachuted, and the pedestrian is accurately tracked and identified by utilizing the umbrella label, so that passenger flow statistics can be carried out according to the moving track of the pedestrian, the problem that pedestrian flow cannot be accurately counted under the condition that the pedestrian is parachuted is solved, and the pedestrian flow is accurately counted under the condition that the pedestrian is parachuted is realized.
In some embodiments, in the case that each target tag is an umbrella tag, the determining in step S230 of the target tag and the corresponding identity tag matched with each pedestrian target includes the following steps:
Determining umbrella tags matched with each pedestrian target;
The first identification of the matched umbrella label is used as the identity identification of the pedestrian target, and the first identification is used for uniquely identifying the corresponding umbrella label.
Specifically, when each target tag is an umbrella tag, for example, the monitoring device is installed at the top of the entrance, the input image only includes a picture of the top of the umbrella (as shown in fig. 3), the umbrella tag matched with each pedestrian target is determined, the first identifier of the matched umbrella tag is used as the identity of the pedestrian target, and the first identifier is the identification information of the umbrella tag and is used for uniquely identifying the corresponding umbrella tag.
It should be noted that, when the monitoring device is installed at the top of the doorway, the target labels output by the target detection model may further include a pedestrian head-shoulder label and a pedestrian umbrella-opening label due to the fact that the pedestrian does not open an umbrella or other reasons, at this time, it is determined whether a containment relationship exists between the position areas corresponding to the target labels, if the containment relationship exists between the target labels, it indicates that the target labels belong to the same pedestrian target, the target labels are combined and matched to the same pedestrian target, so that a plurality of target labels matched with each pedestrian target can be determined, and based on the target labels corresponding to each pedestrian target, the identity of the pedestrian target is determined.
According to the embodiment, the umbrella labels matched with each pedestrian target are determined, the first identification of the matched umbrella labels is used as the identity identification of the pedestrian targets, so that the pedestrian targets are tracked and identified by utilizing each umbrella label, the influence of factors such as shielding of umbrellas when a pedestrian plays an umbrella is avoided, the pedestrian targets are accurately identified, and the follow-up acquisition of the moving track of each pedestrian target is facilitated.
In some embodiments, in the case that the target tag further includes a pedestrian head-shoulder tag and a pedestrian umbrella tag, the determining in step S230 of the target tag and the corresponding identity matched with each pedestrian target includes the following steps:
determining a plurality of target labels matched with each pedestrian target, wherein the position areas corresponding to the target labels have a containing relation;
And determining the identity of the pedestrian target based on the target labels corresponding to each pedestrian target.
In this embodiment, the target labels output by the target detection model include a pedestrian head-shoulder label, a pedestrian umbrella-opening label, and an umbrella label. For example, the monitoring device is installed in an oblique manner to capture the overall motion gesture of the pedestrian, the acquired input image includes the head, trunk, limbs and other body parts of the pedestrian and the umbrella opening action of the pedestrian, and correspondingly, the target detection result of the input image includes the head and shoulder tag of the pedestrian, the umbrella opening tag of the pedestrian and the umbrella tag.
Specifically, whether the position areas corresponding to the target labels have the inclusion relationship is judged, if the position areas corresponding to the target labels have the inclusion relationship, the target labels are indicated to belong to the same pedestrian target, and the target labels are combined and matched to the same pedestrian target, so that a plurality of target labels matched with each pedestrian target can be determined.
Further, selecting a corresponding target label from a plurality of target labels matched with each pedestrian target according to preset priorities of different types of target labels, and taking the identification of the currently selected target label as the identity of the pedestrian target.
According to the method and the device for identifying the pedestrian targets, the plurality of target tags matched with each pedestrian target are determined, the containing relation exists between the position areas corresponding to the target tags, and the identity of the pedestrian targets is determined based on the target tags corresponding to the pedestrian targets, so that the pedestrian targets are tracked and identified by utilizing the multi-category tags, the pedestrian targets are prevented from being influenced by factors such as umbrella shielding under the condition that a person is umbrella-shaped, the pedestrian targets are accurately identified, and the follow-up acquisition of the moving track of each pedestrian target is facilitated.
In some embodiments, in the case that the target tag further includes a pedestrian head-shoulder tag and a pedestrian umbrella tag, the determining in step S230 of the target tag and the corresponding identity matched with each pedestrian target further includes the following steps:
Determining a plurality of target labels matched with each pedestrian target, wherein a containing relationship exists between the position areas corresponding to the target labels, and the position movement tracks corresponding to the target labels meet a preset similarity relationship;
And determining the identity of the pedestrian target based on the target labels corresponding to each pedestrian target.
In this embodiment, the target labels output by the target detection model include a pedestrian head-shoulder label, a pedestrian umbrella-opening label, and an umbrella label. For example, the monitoring device is installed in an oblique manner to capture the overall motion gesture of the pedestrian, the acquired input image includes the head, trunk, limbs and other body parts of the pedestrian and the umbrella opening action of the pedestrian, and correspondingly, the target detection result of the input image includes the head and shoulder tag of the pedestrian, the umbrella opening tag of the pedestrian and the umbrella tag.
Specifically, whether the position areas corresponding to the target labels have a containing relation is judged, meanwhile, the positions of the target labels are continuously tracked to obtain position moving tracks corresponding to the target labels, the similarity between the position moving tracks corresponding to different target labels is calculated, whether the position moving tracks meet a preset similarity relation is judged, and if the similarity between the position moving tracks is larger than a preset threshold value, the preset similarity relation is judged to be met. The calculation method of the similarity includes, but is not limited to, euclidean distance, editing distance and Haosdorff distance.
Further, if the plurality of target labels have a containing relationship, and the position movement tracks corresponding to the target labels meet a preset similarity relationship, then the current target labels belong to the same pedestrian target, and the target labels are combined and matched to the same pedestrian target, so that the plurality of target labels matched with each pedestrian target can be determined.
And selecting a corresponding target label from a plurality of target labels matched with each pedestrian target according to preset priorities of different types of target labels, and taking the identification of the currently selected target label as the identity identification of the pedestrian target.
According to the method and the device for identifying the pedestrian targets, the plurality of target tags matched with each pedestrian target are determined, wherein the position areas corresponding to the target tags have a containing relationship, the position moving tracks corresponding to the target tags are in a preset similarity relationship in pairs, the identity of the pedestrian target is determined based on the target tags corresponding to each pedestrian target, and the target tags are accurately matched to the pedestrian targets by combining track similarity among different tags on the basis of tracking and identifying the pedestrian targets by utilizing multi-category tags, so that the accuracy of identifying the pedestrian targets is improved.
In some embodiments, the identity of each pedestrian target is determined based on the target tag corresponding to the pedestrian target, including the following steps:
determining a plurality of target tags that match each pedestrian target;
Acquiring a second identifier of the target tag with the highest priority, wherein the second identifier is used for uniquely identifying the corresponding target tag;
and taking the second identifier as the identity identifier of the pedestrian target.
Specifically, from a plurality of target tags matched with each pedestrian target, selecting a target tag with the highest priority according to preset priorities of target tags of different categories, and taking a second identifier of the target tag with the highest priority as an identity identifier of the pedestrian target, wherein the second identifier is identification information of the target tag and is used for uniquely identifying the corresponding target tag, for example, in the case that the target tag is a pedestrian head-shoulder tag, the second identifier of the target tag is identification information of the pedestrian head-shoulder tag and is used for uniquely identifying the pedestrian head-shoulder tag. The priorities of the target labels can be preset in various modes, and the priorities of the target labels are set according to the detection difficulty of different target labels, or the priorities of the target labels are set based on whether the target labels are convenient to track the moving track of the pedestrian targets or not.
The priority of the target labels is set based on the detection difficulty level, the target labels are a pedestrian head-shoulder label, a pedestrian umbrella-opening label and an umbrella label in sequence from high to low according to the priority level, and based on the priority, when the target label matched with the current pedestrian target comprises the pedestrian head-shoulder label, the pedestrian umbrella-opening label and the umbrella label, a second identification of the pedestrian head-shoulder label is output as an identity identification of the pedestrian target, so that the position of the pedestrian head-shoulder label is conveniently used for positioning and tracking the moving condition of the pedestrian target.
According to the method and the device for identifying the pedestrian targets, the plurality of target tags matched with each pedestrian target are determined, the second identification of the target tag with the highest priority is obtained, and the second identification is used as the identity of the pedestrian target, so that the preferred label identification can be output to serve as the identity of the pedestrian target under the condition that the pedestrian targets are matched with the plurality of tags, and accuracy of identifying the pedestrian target is improved.
In some embodiments, determining whether there is an inclusion relationship between location areas corresponding to each target tag includes the following steps:
The method comprises the steps of obtaining the position coordinates of each target label, wherein the position coordinates comprise two diagonal vertex coordinates of a rectangular detection frame corresponding to the target label;
Calculating the position coordinates of the target labels of different categories to obtain the inclusion proportion among the position areas corresponding to the target labels;
And when the inclusion proportion is larger than a preset threshold value, judging that the inclusion relation exists among the target labels.
In this embodiment, the inclusion ratio between the location areas corresponding to the target tags of different categories is calculated, and whether the inclusion relationship exists between the target tags is determined according to the comparison result of the inclusion ratio and the preset threshold. The target label is usually output in the form of a bounding box such as a rectangular detection box, and a position area corresponding to the target label is an area in the bounding box.
Specifically, the position coordinates of each target tag are obtained, taking a rectangular detection frame as an example, where the position coordinates include two diagonal vertex coordinates of the rectangular detection frame corresponding to the target tag, such as an upper left corner coordinate and a lower right corner coordinate of the rectangular detection frame, respectively.
Further, the position coordinates of the target tags of different categories are calculated to obtain the inclusion proportion between the position areas corresponding to the target tags, and the number of the target tags with the inclusion proportion calculated at each time is usually two. And when the calculated inclusion ratio is larger than a preset threshold, judging that the inclusion relationship exists among the target labels, otherwise, indicating that the inclusion relationship does not exist among the target labels.
Illustratively, the target label to be judged includes a first pedestrian umbrella-shaped label and a first umbrella label, wherein the first pedestrian umbrella-shaped label corresponds to the upper left corner coordinate (x 11,y11) and the lower right corner coordinate (x 21,y21) of the rectangular frame, the first umbrella label corresponds to the upper left corner coordinate (x 12,y12) and the lower right corner coordinate (x 22,y22) of the rectangular frame, and the calculation formula of the inclusion ratio between the first pedestrian umbrella-shaped label and the first umbrella label is as follows:
In the formula (1), res represents the inclusion ratio between the first pedestrian umbrella tag and the first umbrella tag. When Res is larger than a preset threshold, judging that a containing relationship exists between the first pedestrian umbrella playing tag and the first umbrella tag, and indicating that the first pedestrian umbrella playing tag and the first umbrella tag belong to the same pedestrian target, and combining and matching the first pedestrian umbrella playing tag and the first umbrella tag to the same pedestrian target.
For the same pedestrian object, the pedestrian umbrella label generally includes a pedestrian head-shoulder label and a rain umbrella label related to the pedestrian.
According to the embodiment, the position coordinates of each target label are obtained, the position coordinates comprise two diagonal vertex coordinates of the rectangular detection frame corresponding to the target label, the position coordinates of the target labels in different categories are calculated, the inclusion proportion between the position areas corresponding to the target labels is obtained, when the inclusion proportion is larger than a preset threshold value, the inclusion relation between the target labels is judged, the inclusion proportion between the labels is calculated by using the position coordinates of the target labels, and therefore whether the inclusion relation exists between the labels can be accurately judged according to the calculated inclusion proportion.
In some embodiments, the step S240 of performing passenger flow statistics on each pedestrian target based on the movement track information corresponding to each identity identifier includes the following steps:
Based on the movement track information corresponding to each identity and a preset tripwire rule, determining the in-out state of a pedestrian target corresponding to the identity;
And carrying out passenger flow statistics on each pedestrian target based on the in-out state of each pedestrian target.
Specifically, in the input images of the continuous multiframes, the pedestrian targets are positioned and tracked based on the identity marks corresponding to the pedestrian targets, so that the moving track information of each pedestrian target is obtained, and the in-out state of the pedestrian targets is analyzed according to the moving track information and the preset tripwire rule. The trip wire rule is used for judging the in-out state of the pedestrian target according to the relative movement direction of the movement track of the pedestrian target when the pedestrian target passes through the entrance and the exit to preset the trip wire.
Illustratively, as shown in FIG. 4, the preset tripwire divides the doorway area into an area 1 and an area 2, the tripwire rule specifies that the relative movement direction generated when the moving track of the pedestrian object is the track A, i.e., the pedestrian object passes through the preset tripwire, is from the area 2 to the area 1, indicating that the pedestrian object is in an entering state, accounting for the total number of pedestrians entered, and the tripwire rule specifies that the relative movement direction generated when the moving track of the pedestrian object is the track B, i.e., the pedestrian object passes through the preset tripwire, is from the area 1 to the area 2, indicating that the pedestrian object is in an exiting state, accounting for the total number of pedestrians entered.
Further, based on the in-out state of each pedestrian target, the pedestrians in the in-out state and the pedestrians in the out-out state are respectively counted, and a final passenger flow statistical result is obtained, wherein the passenger flow statistical result comprises the number of the pedestrians in the in-out state and the number of the pedestrians out of the in-out state.
It should be noted that, in addition to analyzing the pedestrian in-out state based on the tripwire rule, the movement direction of the pedestrian may be detected by combining with a unidirectional sensor, such as an infrared sensor, a laser sensor, etc., on the basis of acquiring the movement track of the pedestrian, and the in-out state may be determined according to the sequence of the pedestrian triggering sensors.
According to the embodiment, the in-out states of the pedestrian targets corresponding to the identity marks are determined based on the movement track information corresponding to each identity mark and the preset tripwire rule, and passenger flow statistics is carried out on each pedestrian target based on the in-out states of each pedestrian target, so that the in-out states of the pedestrians can be accurately analyzed, and accurate statistics of in-out passenger flows can be realized.
The present embodiment is described and illustrated below by way of preferred embodiments.
Fig. 5 is a flowchart of the passenger flow statistics method based on the parachute-opening pedestrian according to the preferred embodiment, and as shown in fig. 5, the passenger flow statistics method based on the parachute-opening pedestrian comprises the following steps:
step S510, detecting each input image through a complete target detection model to obtain a corresponding target label, wherein the target label comprises a pedestrian head and shoulder label, a pedestrian umbrella label and a umbrella label;
Step S520, tracking pedestrian targets in the input images of the continuous multiframes based on different target tags;
Step S530, determining a plurality of target labels matched with each pedestrian target, wherein a containing relationship exists between the position areas corresponding to the target labels, and the position movement tracks corresponding to the target labels meet a preset similarity relationship in pairs;
step S540, a second identifier of the target label with the highest priority is obtained, and the second identifier is used for uniquely identifying the corresponding target label;
step S550, based on the movement track information corresponding to each identity and a preset tripwire rule, determining the in-out state of the pedestrian target corresponding to the identity;
Step S560, based on the in-out state of each pedestrian target, performing passenger flow statistics on each pedestrian target.
According to the embodiment, each input image is detected through training a complete target detection model, and a corresponding target label is obtained, wherein the target label comprises a pedestrian head and shoulder label, a pedestrian umbrella-opening label and an umbrella label. Based on different target labels, tracking pedestrian targets in continuous multi-frame input images, determining a plurality of target labels matched with each pedestrian target, wherein a containing relation exists between position areas corresponding to the target labels, the position movement tracks corresponding to the target labels are in a preset similarity relation, a second identification of the target label with the highest priority is obtained, the second identification is used as an identity identification of the pedestrian target, and therefore the target labels are accurately matched to the pedestrian targets by combining track similarity among different labels on the basis of tracking and identifying the pedestrian targets by utilizing multi-category labels, so that the accuracy of identifying the pedestrian targets is improved.
Further, based on the movement track information corresponding to each identity and a preset tripwire rule, the in-out state of the pedestrian targets corresponding to the identity is determined, and based on the in-out state of each pedestrian target, passenger flow statistics is carried out on each pedestrian target, so that the problem that pedestrian flow cannot be accurately counted under the condition that a pedestrian is parachuted is solved, and the pedestrian flow is accurately counted under the condition that the pedestrian is parachuted is realized.
It should be noted that the steps illustrated in the above-described flow or flow diagrams of the figures may be performed in a computer system, such as a set of computer-executable instructions, and that, although a logical order is illustrated in the flow diagrams, in some cases, the steps illustrated or described may be performed in an order other than that illustrated herein.
The embodiment also provides a passenger flow statistics device based on an umbrella-opening pedestrian, which is used for realizing the embodiment and the preferred implementation mode, and the description is omitted. The terms "module," "unit," "sub-unit," and the like as used below may refer to a combination of software and/or hardware that performs a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementations in hardware, or a combination of software and hardware, are also possible and contemplated.
Fig. 6 is a block diagram of the passenger flow statistics device based on the parachute-opening pedestrian of the present embodiment, and as shown in fig. 6, the device includes a detection module 10, a tracking module 20, a matching module 30 and a statistics module 40;
the detection module 10 is used for detecting each input image through training a complete target detection model to obtain a corresponding target label;
A tracking module 20, configured to track a pedestrian target in the input images of consecutive frames based on different target tags;
a matching module 30, configured to determine a target tag and a corresponding identity that are matched with each pedestrian target;
and the statistics module 40 is used for carrying out passenger flow statistics on each pedestrian target based on the movement track information corresponding to each identity.
The device provided by the embodiment detects each input image through training a complete target detection model to obtain corresponding target labels, wherein the target labels comprise umbrella labels, tracks pedestrian targets in continuous multi-frame input images based on different target labels, determines target labels matched with each pedestrian target and corresponding identity marks, further carries out passenger flow statistics on each pedestrian target based on movement track information corresponding to each identity mark, solves the problem that pedestrian flow cannot be accurately counted under the condition of parachute opening of pedestrians, and realizes accurate pedestrian flow statistics under the condition of parachute opening of pedestrians.
In some embodiments, the matching module 30 is further configured to determine an umbrella tag that matches each pedestrian object, and use a first identifier of the matched umbrella tag as an identity of the pedestrian object, where the first identifier is used to uniquely identify the corresponding umbrella tag.
In some embodiments, the matching module 30 is further configured to determine a plurality of target tags that match each pedestrian target, where a containment relationship exists between location areas corresponding to the target tags, and determine an identity of the pedestrian target based on the target tags corresponding to each pedestrian target.
In some embodiments, the matching module 30 is further configured to determine a plurality of target tags that are matched with each pedestrian target, where a containment relationship exists between the location areas corresponding to the target tags, and the location movement tracks corresponding to the target tags satisfy a preset similarity relationship, and determine the identity of the pedestrian target based on the target tags corresponding to each pedestrian target.
In some embodiments, the matching module 30 is further configured to determine a plurality of target tags that match each pedestrian target, obtain a second identifier of the target tag with the highest priority, use the second identifier to uniquely identify the corresponding target tag, and use the second identifier as an identity of the pedestrian target.
In some embodiments, on the basis of fig. 6, the device further includes a determining module, where the determining module is configured to obtain a position coordinate of each target label, where the position coordinate includes two diagonal vertex coordinates of a rectangular detection frame corresponding to the target label, calculate the position coordinates of different types of target labels to obtain a proportion of inclusion between the position areas corresponding to the target labels, and determine that an inclusion relationship exists between the target labels when the proportion of inclusion is greater than a preset threshold.
In some embodiments, the statistics module 40 is further configured to determine an in-out state of a pedestrian target corresponding to the identity based on the movement track information corresponding to each identity and a preset tripwire rule, and perform passenger flow statistics on each pedestrian target based on the in-out state of each pedestrian target.
The above-described respective modules may be functional modules or program modules, and may be implemented by software or hardware. For modules implemented in hardware, the modules may be located in the same processor, or may be located in different processors in any combination.
There is also provided in this embodiment a computer device comprising a memory in which a computer program is stored and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Optionally, the computer device may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s1, detecting each input image through a complete target detection model to obtain a corresponding target label, wherein the target label comprises an umbrella label;
S2, tracking pedestrian targets in input images of continuous multiframes based on different target tags;
S3, determining a target label matched with each pedestrian target and a corresponding identity;
s4, carrying out passenger flow statistics on each pedestrian target based on the movement track information corresponding to each identity.
It should be noted that, specific examples in this embodiment may refer to examples described in the foregoing embodiments and alternative implementations, and are not described in detail in this embodiment.
In addition, in combination with the passenger flow statistics method based on the parachute-opening pedestrian provided in the above embodiment, a storage medium may be further provided in this embodiment to implement. The storage medium has stored thereon a computer program which, when executed by a processor, implements any of the above-described embodiments of a method for parachute-based passenger flow statistics.
It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to be limiting. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure in accordance with the embodiments provided herein.
It is to be understood that the drawings are merely illustrative of some embodiments of the present application and that it is possible for those skilled in the art to adapt the present application to other similar situations without the need for inventive work. In addition, it should be appreciated that while the development effort might be complex and lengthy, it would nevertheless be a routine undertaking of design, fabrication, or manufacture for those of ordinary skill having the benefit of this disclosure, and thus should not be construed as a departure from the disclosure.
The term "embodiment" in this disclosure means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive. It will be clear or implicitly understood by those of ordinary skill in the art that the embodiments described in the present application can be combined with other embodiments without conflict.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the patent claims. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.