A method, device and electronic equipment for detecting passenger flow at a bus stop
By setting up cameras at the bus stops and using the improved head detection network to detect the flow of people at the bus stops in real time, the problem of not being able to know the flow of people in real time in the existing technology is solved, and the efficiency of bus scheduling is improved.
Patent Information
- Application Number
- CN202111143638.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-28
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2041-09-28
AI Technical Summary
The existing bus dispatching system cannot obtain traffic flows in real time, resulting in low bus dispatch efficiency and unable to automatically adjust bus shifts.
By setting up a camera at the bus stop, real-time video images of the waiting area are obtained, and head detection is performed using the improved head detection network to determine the flow of people at the bus stop in real time.
Real-time detection of the traffic flow of bus stops is achieved, data support is provided for bus scheduling, and the accuracy of head detection and bus scheduling efficiency are improved.
Smart Images

Figure CN113963310B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent transportation technology, and in particular to a method, a device and electronic equipment for detecting passenger flow at a bus stop. Background Art
[0002] With the development of urbanization, a large number of immigrants have poured into cities, bringing great pressure to urban public transportation. As the main force of urban public transportation, buses play an important role in the normal operation of cities.
[0003] In order to improve the level of public transportation informatization, the urban public transportation system has introduced an advanced public transportation dispatching system. The public transportation dispatching system uses traffic passenger flow as the basis for public transportation operation dispatching. At present, the determination of traffic passenger flow mainly relies on experience, and the passenger flow of each bus line is determined by counting the passenger flow of previous bus operations, and then the bus schedule is set according to the passenger flow of each bus line.
[0004] However, this method can only guide bus operation according to the pre-set bus schedule, and cannot automatically adjust the bus schedule by knowing the real-time traffic flow, resulting in low bus scheduling efficiency. Summary of the invention
[0005] The present invention provides a method, device and electronic equipment for detecting the flow of people at a bus stop. A camera arranged at a bus stop captures a video of pedestrians in a waiting area, and an improved head detection network performs head detection on the waiting area in the video to determine the number of pedestrians in the waiting area. The present invention realizes real-time detection of the flow of people at a bus stop, provides data support for bus dispatching, and improves the accuracy of head detection and the efficiency of bus dispatching.
[0006] In a first aspect, the present invention provides a method for detecting passenger flow at a bus stop, comprising:
[0007] Obtain real-time video images captured by cameras installed at bus stops;
[0008] Segmenting the real-time video image according to the position of the waiting area in the video screen to obtain a real-time video image of the waiting area;
[0009] Using a pre-trained head detection network based on an anchor free algorithm to perform head detection on the real-time video image of the waiting area to obtain an initial head detection frame; wherein the head detection network based on the anchor free algorithm uses a MobileNet network with an added channel attention module as a backbone network;
[0010] According to a preset deduplication rule, the falsely detected head detection frames in the initial head detection frame are removed to obtain a final head detection frame;
[0011] The passenger flow information of the bus stop waiting area is determined according to the number of the final head detection frames.
[0012] In an optional embodiment, segmenting the real-time video image according to the position of the waiting area in the video screen to obtain the real-time video image of the waiting area includes:
[0013] Configure image segmentation parameters according to the position of the waiting area in the video image;
[0014] The real-time video image is segmented according to the image segmentation parameters to obtain a real-time video image of the waiting area.
[0015] In an optional embodiment, removing the misdetected head detection frame in the initial head detection frame according to a preset deduplication rule to obtain a final head detection frame includes:
[0016] Using a non-maximum suppression method to remove overlapping head detection frames in the initial head detection frame to obtain a screened head detection frame;
[0017] Classifying the screened head detection frames according to the height information of the head detection frames in the image to obtain a list of head detection frames of different heights, and calculating the average area of the head detection frames in the list of head detection frames of different heights;
[0018] Calculate the ratio of the absolute value of the difference between the area of each head detection frame in the head detection frame list of different heights and the average area of the head detection frames to the average area of the head detection frames;
[0019] Determine whether the ratio of the absolute value of the difference between the area of each head detection frame in the head detection frame list of different heights and the average area of the head detection frames to the average area of the head detection frames is greater than a preset threshold;
[0020] If yes, delete the corresponding head detection box.
[0021] Furthermore, before obtaining the real-time video image captured by the camera installed at the bus stop, the method further includes:
[0022] Obtain head sample data and head annotation data;
[0023] Using a mosaic data enhancement method to process the head sample data to obtain head training data;
[0024] The constructed head detection network is trained using the head training data and the head annotation data to obtain the trained head detection network.
[0025] Furthermore, the process of training the constructed head detection network using the head training data includes the following rules: when performing anchor frame anchor matching, the distance between the center point of the anchor frame anchor and the center point of the labeled frame ground-truth and the intersection-over-union (IOU) of the anchor frame anchor and the labeled frame ground-truth are calculated, and the positive and negative samples of the anchor frame anchor are determined according to preset hyperparameters and the distance between the center point of the anchor frame anchor and the center point of the labeled frame ground-truth and the intersection-over-union (IOU) of the anchor frame anchor and the labeled frame ground-truth.
[0026] In an optional embodiment, the method further includes:
[0027] The passenger flow information is sent to the public transportation management platform for real-time scheduling of public transportation.
[0028] In a second aspect, the present invention provides a pedestrian flow detection device at a bus stop, comprising:
[0029] An acquisition module is used to acquire real-time video images captured by a camera installed at a bus stop;
[0030] A segmentation module is used to segment the real-time video image according to the position of the waiting area in the video screen to obtain a real-time video image of the waiting area;
[0031] A detection module, used to perform head detection on the real-time video image of the waiting area using a pre-trained head detection network based on an anchor free algorithm to obtain an initial head detection frame; wherein the head detection network based on the anchor free algorithm uses a MobileNet network with an added channel attention module as a backbone network;
[0032] A screening module, used to remove the falsely detected head detection frames according to the initial head detection frame and a preset deduplication rule to obtain a final head detection frame;
[0033] A determination module is used to determine the passenger flow information of the bus stop waiting area according to the number of the final head detection frames.
[0034] In an optional embodiment, the device further includes: a sending module;
[0035] It is used to send the passenger flow information to the public transportation management platform for real-time scheduling of public transportation.
[0036] In a third aspect, the present invention provides an electronic device, comprising: at least one processor and a memory;
[0037] The memory stores computer-executable instructions;
[0038] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the human flow detection method described in any one of the first aspects.
[0039] The present invention provides a method, device and electronic device for detecting the flow of people at a bus station, which obtains a real-time video image taken by a camera installed at the bus station; the real-time video image is segmented according to the position of the waiting area in the video screen to obtain a real-time video image of the waiting area; a head detection network based on an anchor free algorithm that has been pre-trained is used to detect heads in the real-time video image of the waiting area to obtain an initial head detection frame; wherein the head detection network based on the anchor free algorithm uses a MobileNet network with an added channel attention module as a backbone network; the head detection frames that are misdetected are removed according to the initial head detection frame and a preset deduplication rule to obtain a final head detection frame; and the flow of people information in the waiting area of the bus station is determined according to the number of the final head detection frames. Compared with the prior art, the present solution uses a camera installed at the bus station to shoot a video of pedestrians in the waiting area, and uses an improved head detection network to detect heads in the waiting area in the video to determine the number of pedestrians in the waiting area, so as to determine the flow of people at the bus station in real time, provide data support for bus scheduling, and improve the accuracy of head detection and the efficiency of bus scheduling. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0041] Figure 1 A schematic diagram of a scenario architecture on which the present disclosure is based;
[0042] Figure 2 A flow chart of a method for detecting passenger flow at a bus stop provided in the first embodiment of the present disclosure;
[0043] Figure 3 A flowchart of a head detection network training method provided in the first embodiment of the present disclosure;
[0044] Figure 4 A flow chart of another method for detecting passenger flow at a bus stop provided in the first embodiment of the present disclosure;
[0045] Figure 5A schematic diagram of the structure of a pedestrian flow detection device at a bus station provided in Embodiment 2 of the present disclosure;
[0046] Figure 6 A schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present disclosure. DETAILED DESCRIPTION
[0047] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0048] Urban bus dispatch is based on traffic flow. Currently, traffic flow is mainly determined by counting the traffic flow of previous buses to determine the traffic flow of each bus line, and then setting the bus schedule according to the traffic flow of each bus line. This method can only set the bus schedule according to the past traffic flow of bus lines, and cannot automatically adjust the bus schedule according to the real-time traffic flow, resulting in low bus dispatch efficiency.
[0049] In recent years, with the rapid development of computer vision, especially in the field of deep learning, big data and deep learning methods are used to automatically detect bus stops and obtain the number of people at bus stops. The crowd flow detection technology based on head detection can realize real-time automatic detection of bus stop passenger flow, so it is of great significance to improve the efficiency of bus dispatching.
[0050] Figure 1 A schematic diagram of a scenario architecture based on the present disclosure is shown in FIG. Figure 1 As shown, a scenario architecture based on which the present disclosure is based may include a pedestrian flow detection device 1 and a camera 2 .
[0051] Among them, the human flow detection device 1 is hardware or software that can interact with the camera 2 through the network, and can be used to execute the human flow detection method described in the following embodiments.
[0052] When the human flow detection device 1 is hardware, it can be an electronic device with computing functions. When the human flow detection device 1 is software, it can be installed in an electronic device with computing functions. The electronic device includes but is not limited to a server, a notebook, a desktop computer, and the like.
[0053] The camera 2 may be a hardware device with a shooting function, such as a gun camera or a ball camera.
[0054] In actual scenarios, the pedestrian flow detection device 1 can be a server integrated or installed on the camera 2. The pedestrian flow detection device 1 can run on the camera 2. The pedestrian flow detection device 1 can also be integrated or installed in a server that processes vehicle videos to provide pedestrian flow detection services for the bus dispatching system. In this case, the camera 2 can be a device including a gun camera, a ball camera, etc. that can communicate and exchange data with the pedestrian flow detection device 1 through the network. The camera 2 can send the real-time video stream of the bus station to the pedestrian flow detection device 1, so that the pedestrian flow detection device 1 uses the method shown below to detect the pedestrian flow on the real-time video stream of the bus station.
[0055] The following is a further description of a method, device and electronic device for detecting passenger flow at a bus stop provided by the present application:
[0056] Embodiment 1
[0057] Figure 2 The flowchart of a method for detecting the flow of people at a bus stop provided in the first embodiment of the present disclosure is shown in FIG. Figure 2 As shown, a method for detecting passenger flow at a bus stop provided by an embodiment of the present disclosure includes:
[0058] S21. Acquire real-time video images captured by a camera installed at a bus stop.
[0059] Among them, the camera can capture the waiting area of the bus stop.
[0060] In this embodiment, the real-time video stream can be accessed based on RTSP, and the video decoding API can be called to decode the real-time video stream data into original image data.
[0061] S22, segmenting the real-time video image according to the position of the waiting area in the video picture to obtain a real-time video image of the waiting area.
[0062] In this embodiment, in view of the fact that passengers taking the bus are mainly concentrated in the waiting area, when pre-processing the real-time video image, only the waiting area part can be retained, and the real-time video image is segmented according to the position of the waiting area in the video screen. The advantage of this processing is to avoid interference with head detection from other invalid areas, and only focus on the flow of people in the target area.
[0063] S23. Perform head detection on the real-time video image of the waiting area using a pre-trained head detection network based on an anchor free algorithm to obtain an initial head detection frame; wherein the head detection network based on the anchor free algorithm uses a MobileNet network with an added channel attention module as a backbone network.
[0064] In this embodiment, the constructed head detection network is constructed based on the anchor free algorithm. The anchor free anchor box generation method does not need to use kmean clustering to generate the size of the anchor box anchor, so it has stronger generalization. In order to take into account the accuracy and real-time performance of head detection, the head detection network uses the MobileNet network with an added channel attention module as the backbone network. It is mainly based on MobileNet and adds an attention mechanism to achieve this. It combines the advantages of both, not only greatly reducing the reasoning time, but also focusing on the effective area of the feature map to improve the accuracy. MobileNet can greatly reduce the amount of calculation and improve the network reasoning time when the network accuracy loss is negligible. The key to MobileNet is the design of the depthwise separable convolution, which consists of depthwise convolution and pointwise convolution. The calculation amount of the depthwise convolution is DF*DF*DC*DCxC i , point-by-point convolution is the standard convolution with a convolution kernel of 1*1, and the amount of calculation is C i *C o *DF*DF. The computational complexity of standard convolution is DF*DF*DC*DC*C i *C o , so the ratio of depth-wise separable convolution to standard convolution is Where DF is the size of the feature map, DC is the size of the convolution kernel, and C i and C o are the number of input and output channels respectively. Assuming the size of the convolution kernel is 3*3, that is, DC is 3, the computational complexity of the depthwise separable convolution is reduced by more than 9 times, and the corresponding inference speed can be accelerated by about 9 times.
[0065] S24, removing the falsely detected head detection frames in the initial head detection frames according to a preset deduplication rule to obtain a final head detection frame.
[0066] In the present embodiment, for head detection frames that may be falsely detected in the initial head detection frame, the false detections can be removed according to preset deduplication rules. The preset deduplication rules are set according to the areas of head detection frames at different heights, and the head detection frames whose areas are significantly different from the average areas of head detection frames at corresponding heights are removed.
[0067] S25. Determine the passenger flow information of the waiting area of the bus stop according to the number of the final head detection frames.
[0068] In this embodiment, the number of final head detection frames at the current moment is counted to obtain the passenger flow information in the waiting area of the bus stop.
[0069] This embodiment provides a method for detecting the flow of people at a bus stop, which obtains a real-time video image taken by a camera installed at the bus stop; the real-time video image is segmented according to the position of the waiting area in the video screen to obtain a real-time video image of the waiting area; a pre-trained head detection network based on an anchor free algorithm is used to detect heads in the real-time video image of the waiting area to obtain an initial head detection frame; wherein the head detection network based on the anchor free algorithm uses a MobileNet network with an added channel attention module as the backbone network; the head detection frames that are misdetected in the initial head detection frame are removed according to a preset deduplication rule to obtain a final head detection frame; the flow of people information in the waiting area of the bus stop is determined according to the number of the final head detection frames. By adopting the technical solution provided by the present disclosure, real-time detection of the flow of people at the bus stop is achieved, data support is provided for bus scheduling, and the accuracy of head detection and the efficiency of bus scheduling are improved.
[0070] exist Figure 2 On the basis of the above-mentioned embodiment, the embodiment of the present disclosure provides a specific method for segmenting a real-time video image, and further explains step S22 in the above-mentioned embodiment. S22 includes:
[0071] S221, configuring image segmentation parameters according to the position of the waiting area in the video image;
[0072] S232: Segment the real-time video image according to the image segmentation parameters to obtain a real-time video image of the waiting area.
[0073] In this embodiment, in view of the fact that the waiting areas are located at different positions of the video screen due to the different camera positions installed at different bus stops, corresponding image segmentation parameters can be configured for different cameras so that only the waiting area image is retained in the segmented real-time video image. For example, in the video screen taken by camera 6 of bus stop, the waiting area is located on the left side of the entire video screen, and the real-time video image is segmented from the middle position, and the left half of the real-time video image is retained, which is the real-time video image of the waiting area of bus stop 6; in the video screen taken by camera 8 of bus stop, the waiting area is located in the right third of the entire video screen, and the real-time video image is segmented from the right third position, and the right third of the real-time video image is retained, which is the real-time video image of the waiting area of bus stop 8.
[0074] Based on the above technical solutions, this technical solution provides a specific image segmentation method. The advantage of this setting in this embodiment is that it can avoid interference with head detection caused by other invalid areas, and only focus on the flow of people in the target area, which is conducive to faster and more accurate detection of the flow of people at the bus stop.
[0075] exist Figure 2 On the basis of the above-mentioned embodiment, the embodiment of the present disclosure provides a specific method for removing the falsely detected head detection frame, and further explains step S24 in the above-mentioned embodiment. S24 includes:
[0076] S241, using a non-maximum suppression method to remove overlapping head detection frames in the initial head detection frames to obtain screened head detection frames;
[0077] S242, classifying the screened head detection frames according to the height information of the head detection frames in the image to obtain a list of head detection frames of different heights, and calculating the average area of the head detection frames in the list of head detection frames of different heights;
[0078] S243, calculating the ratio of the absolute value of the difference between the area of each head detection frame in the head detection frame list of different heights and the average area of the head detection frames to the average area of the head detection frames;
[0079] S244, determining whether the ratio of the absolute value of the difference between the area of each head detection frame in the head detection frame list of different heights and the average area of the head detection frames to the average area of the head detection frames is greater than a preset threshold;
[0080] S245: If yes, delete the corresponding head detection frame.
[0081] In this embodiment, in response to the situation where there are falsely detected head detection frames in the initial head detection frames, the non-maximum suppression method can be first used to remove overlapping head detection frames, and then the head detection frames detected in the video are classified according to their heights based on the height information of the head detection frames in the image. The head detection frames of the same height are put into the same list, and for the head detection frames in the same list, the average area of the head detection frames is calculated, the area of each head detection frame is subtracted from the average area and the absolute value is taken, and the ratio of each absolute value to the average area of the head detection frames is calculated. If the ratio of the absolute value to the average area of the head detection frames is greater than a preset threshold, the head detection frame corresponding to the absolute value is a falsely detected head detection frame, and the above operation is repeated until the calculation of all lists is completed.
[0082] Based on the above technical solutions, the present technical solution provides a specific method for removing falsely detected head detection frames. The advantage of such a setting in the present embodiment is that falsely detected head detection frames can be removed, making the flow of people calculated based on the head detection frames more accurate.
[0083] Based on the above embodiments, Figure 3 A flowchart of a head detection network training method provided in the first embodiment of the present disclosure is provided. Before obtaining the real-time video image captured by the camera installed at the bus stop in step S21, a head detection network training phase is also included. Figure 3 As shown, including:
[0084] S31. Obtain head sample data and head annotation data.
[0085] In this embodiment, the head sample data is head image data at different shooting angles, and the corresponding head annotation data is head frame annotation data corresponding to the head image data at different shooting angles.
[0086] S32. Use a mosaic data enhancement method to process the head sample data to obtain head training data.
[0087] In this embodiment, in order to enrich the background information, the mosaic data enhancement method is used to merge four training pictures into one, so that the number of positive samples of the merged image is greatly increased, the background is also greatly enriched, and each back propagation in the training stage is equivalent to training four picture data, so the training time is greatly reduced and the detection accuracy is improved.
[0088] S33: Use the head training data and the head annotation data to train the constructed head detection network to obtain the trained head detection network.
[0089] In this embodiment, head training data is input into the head detection network to be trained, and the head training data is processed by the head detection network to be trained to obtain output head detection frame information; the loss function value is calculated according to the output head detection frame information and the head frame annotation data, and the loss function value is back-propagated to each layer of the head detection network to update the weight parameters of each layer according to the loss function value; the above training steps are repeated until the head detection network converges.
[0090] During network training, the matching strategy of anchor box positive and negative samples will also have an important impact on the detection results. This paper designs a new anchor box matching rule, which not only uses the intersection of union (IOU) of the anchor box and the labeled box ground-truth as the basis for anchor box matching, but also considers the distance between the center point of the anchor box and the center point of the labeled box ground-truth as the basis for anchor box matching. The matching rule is as follows: When performing anchor box matching, calculate the distance between the center point of the anchor box and the center point of the labeled box ground-truth and the intersection of union (IOU) of the anchor box and the labeled box ground-truth, and determine the positive and negative samples of the anchor box according to the preset hyperparameters and the distance between the center point of the anchor box and the center point of the labeled box ground-truth and the intersection of union (IOU) of the anchor box and the labeled box ground-truth.
[0091] After determining the passenger flow information of the waiting area of the bus station, bus schedules can be performed according to the passenger flow of the bus station. Based on the above embodiment, Figure 4 A flow chart of another method for detecting passenger flow at a bus stop provided in the first embodiment of the present disclosure, wherein the method further includes:
[0092] S26: Send the passenger flow information to a public transportation management platform to schedule public transportation in real time.
[0093] In this embodiment, the passenger flow information can be sent to the public transportation management platform in real time through the network, so that the public transportation management platform can adjust the bus schedule according to the passenger flow information to realize bus scheduling.
[0094] Embodiment 2
[0095] Corresponding to the method for detecting passenger flow at a bus stop in the above embodiment, Figure 5 This is a schematic diagram of the structure of a pedestrian flow detection device for a bus station provided in the second embodiment of the present disclosure. For the sake of convenience, only the parts related to the embodiment of the present disclosure are shown. Figure 5 The passenger flow detection device at a bus stop comprises:
[0096] An acquisition module 51 is used to acquire real-time video images captured by a camera installed at a bus stop;
[0097] A segmentation module 52 is used to segment the real-time video image according to the position of the waiting area in the video screen to obtain a real-time video image of the waiting area;
[0098] The detection module 53 is used to perform head detection on the real-time video image of the waiting area using a pre-trained head detection network based on an anchor free algorithm to obtain an initial head detection frame; wherein the head detection network based on the anchor free algorithm uses a MobileNet network with a channel attention module added as a backbone network;
[0099] A screening module 54 is used to remove the falsely detected head detection frame according to the initial head detection frame and a preset deduplication rule to obtain a final head detection frame;
[0100] The determination module 55 is used to determine the passenger flow information of the waiting area of the bus stop according to the number of the final head detection frames.
[0101] This embodiment provides a device for detecting the flow of people at a bus station. The acquisition module acquires the real-time video image taken by the camera installed at the bus station; the segmentation module segments the real-time video image according to the position of the waiting area in the video screen to obtain the real-time video image of the waiting area; the detection module uses the pre-trained head detection network based on the anchor free algorithm to detect the head of the real-time video image of the waiting area to obtain the initial head detection frame; wherein the head detection network based on the anchor free algorithm uses the MobileNet network with the channel attention module added as the backbone network; the screening module removes the misdetected head detection frame in the initial head detection frame according to the preset deduplication rule to obtain the final head detection frame; the determination module determines the flow of people in the waiting area of the bus station according to the number of the final head detection frames. By adopting the technical solution provided by the present disclosure, the real-time detection of the flow of people at the bus station is realized, data support is provided for bus scheduling, and the accuracy of head detection and the efficiency of bus scheduling are improved.
[0102] Optionally, the segmentation module 52 is specifically used to:
[0103] Configure image segmentation parameters according to the position of the waiting area in the video image;
[0104] The real-time video image is segmented according to the image segmentation parameters to obtain a real-time video image of the waiting area.
[0105] Optionally, the screening module 54 is specifically used for:
[0106] Using a non-maximum suppression method to remove overlapping head detection frames in the initial head detection frame to obtain a screened head detection frame;
[0107] According to the height information of the head detection frames in the image, the screened head detection frames are classified to obtain a list of head detection frames of different heights, and the average area of the head detection frames in the list of head detection frames of different heights is calculated;
[0108] Calculate the ratio of the absolute value of the difference between the area of each head detection frame in the head detection frame list of different heights and the average area of the head detection frames to the average area of the head detection frames;
[0109] Determine whether the ratio of the absolute value of the difference between the area of each head detection frame in the head detection frame list of different heights and the average area of the head detection frames to the average area of the head detection frames is greater than a preset threshold;
[0110] If yes, delete the corresponding head detection box.
[0111] Optionally, the device further comprises: a network training module 56;
[0112] The network training module 56 is specifically used to obtain head sample data and head annotation data; use the mosaic data enhancement method to process the head sample data to obtain head training data; use the head training data and the head annotation data to train the constructed head detection network to obtain the trained head detection network.
[0113] Optionally, the process of training the constructed head detection network using the head training data includes the following rules: when performing anchor box anchor matching, calculating the distance between the center point of the anchor box anchor and the center point of the labeled box ground-truth and the intersection-over-union (IOU) of the anchor box anchor and the labeled box ground-truth, and determining the anchor box anchor positive sample and negative sample according to preset hyper parameters according to the distance between the center point of the anchor box anchor and the center point of the labeled box ground-truth and the intersection-over-union (IOU) of the anchor box anchor and the labeled box ground-truth.
[0114] Optionally, the device further includes: a sending module 57;
[0115] The sending module 57 is used to send the passenger flow information to the public transportation management platform for real-time scheduling of buses.
[0116] The above-mentioned product can execute the method provided by any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0117] Embodiment 3
[0118] Figure 6A schematic diagram of the structure of an electronic device provided in the third embodiment of the present disclosure is shown in FIG. Figure 6 As shown, the electronic device 60 of this embodiment may include: a memory 61 and a processor 62 .
[0119] A memory 61, used for storing computer programs (such as application programs, functional modules, etc. for implementing the above-mentioned method for detecting passenger flow at a bus stop), computer instructions, etc.;
[0120] The above-mentioned computer programs, computer instructions, etc. may be stored in one or more memories 61 in partitions. And the above-mentioned computer programs, computer instructions, etc. may be called by the processor 62.
[0121] The processor 62 is used to execute the computer program stored in the memory 61 to implement the various steps in the method involved in the above embodiment.
[0122] For details, please refer to the relevant description in the previous method embodiment.
[0123] The memory 61 and the processor 62 may be independent structures or integrated structures. When the memory 61 and the processor 62 are independent structures, the memory 61 and the processor 62 may be coupled and connected via a bus 63 .
[0124] An electronic device of this embodiment can execute the technical solution in the method described in Embodiment 1. The specific implementation process and technical principles thereof refer to the relevant description in the method described in Embodiment 1, which will not be repeated here.
[0125] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0126] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point, the mutual coupling or direct coupling or communication connection shown or discussed can be through some ports, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, each functional unit in each embodiment of the present invention may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit. The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims of the present invention.
Claims
1. A method for detecting passenger flow at a bus stop, characterized in that: include: Obtain head sample data and head annotation data; Using a mosaic data enhancement method to process the head sample data to obtain head training data; The constructed head detection network based on the anchor-free algorithm is trained using the head training data and the head annotation data to obtain the trained head detection network; wherein the head detection network based on the anchor-free algorithm uses the MobileNet network with an added channel attention module as a backbone network; Obtain real-time video images captured by cameras installed at bus stops; Segmenting the real-time video image according to the position of the waiting area in the video screen to obtain a real-time video image of the waiting area; Using a pre-trained head detection network based on an anchor-free algorithm to perform head detection on the real-time video image of the waiting area, and obtain an initial head detection frame; According to a preset deduplication rule, the falsely detected head detection frames in the initial head detection frame are removed to obtain a final head detection frame; Determine the passenger flow information of the waiting area of the bus stop according to the number of the final head detection frames; The removing of the misdetected head detection frame in the initial head detection frame according to the preset deduplication rule comprises: Using a non-maximum suppression method to remove overlapping head detection frames in the initial head detection frame to obtain a screened head detection frame; Classifying the screened head detection frames according to the height information of the head detection frames in the image to obtain a list of head detection frames of different heights, and calculating the average area of the head detection frames in the list of head detection frames of different heights; Calculate the ratio of the absolute value of the difference between the area of each head detection frame in the head detection frame list of different heights and the average area of the head detection frames to the average area of the head detection frames; Determine whether the ratio of the absolute value of the difference between the area of each head detection frame in the head detection frame list of different heights and the average area of the head detection frames to the average area of the head detection frames is greater than a preset threshold; If yes, delete the corresponding head detection frame; The process of training the constructed head detection network using the head training data includes the following rules: when performing anchor frame anchor matching, calculating the distance between the center point of the anchor frame anchor and the center point of the labeled frame ground-truth and the intersection-over-union (IOU) of the anchor frame anchor and the labeled frame ground-truth, and determining the positive and negative samples of the anchor frame anchor according to preset hyperparameters and the distance between the center point of the anchor frame anchor and the center point of the labeled frame ground-truth and the intersection-over-union (IOU) of the anchor frame anchor and the labeled frame ground-truth.
2. The method for detecting human flow according to claim 1, characterized in that: The real-time video image is segmented according to the position of the waiting area in the video screen to obtain the real-time video image of the waiting area, including: Configure image segmentation parameters according to the position of the waiting area in the video image; The real-time video image is segmented according to the image segmentation parameters to obtain a real-time video image of the waiting area.
3. The method for detecting human flow according to any one of claims 1 and 2, characterized in that: The method further comprises: The passenger flow information is sent to the public transportation management platform for real-time scheduling of public transportation.
4. A passenger flow detection device at a bus stop, characterized in that: Used to implement the human flow detection method described in any one of claims 1-3.
5. An electronic device, characterized in that: include: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the human flow detection method as described in any one of claims 1-3.
Citation Information
Patent Citations
System for adjusting capacity of public transportation
CN107248306A
Urban bus passenger flow survey method based on platform video analysis and survey system thereof
CN107330840A
People number detection method and device, face detection method and device and electronic equipment
CN112560557A