Video image-based rail traffic crowd density analysis and prediction method and system

Through video image processing and YOLOV3 detection, real-time monitoring and early warning of crowd density in rail transit are realized, which solves the problems of single crowd density supervision and low intelligence in the existing technology, and improves safety management efficiency and public safety stability.

CN118570729AInactive Publication Date: 2024-08-30SHANGHAI JUNYU DIGITAL TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410712657.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-04
Publication Date
2024-08-30
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing technology has a single approach to crowd density monitoring in rail transit and a low degree of intelligence, which results in the inability to detect potential safety hazards in advance, resulting in high manpower consumption and can only be handled after the incident occurs, making it impossible to implement timely intervention.

Method used

By acquiring video images of the monitored area, using image processing and YOLOV3 detection methods, we can extract target person characteristics, predict location coordinates, calculate crowd density, and generate early warning information based on preset thresholds to achieve crowd density estimation and early warning upload.

Benefits of technology

It improves the efficiency of rail transit management, detects potential hazards in a timely manner, improves public safety and stability, and reduces the need for human supervision.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118570729A
    Figure CN118570729A
Patent Text Reader

Abstract

The invention relates to a rail traffic crowd density analysis and prediction method and system based on video images, and belongs to the technical field of video analysis. The method comprises the steps of obtaining de-noised video image information through image processing according to a video image, obtaining a target person frame set and a person frame set number according to a standard station hall area image and a station hall area video image, and obtaining target person features according to the target person frame set and the person frame set number, obtaining predicted position coordinates according to the target character features, obtaining the total number of head mark points according to the station region video image, obtaining the station crowd density according to the total number of head mark points and the station region area, and obtaining the predicted station passenger entering amount according to the predicted position coordinates and the station entrance position coordinates in combination with the target character frame set number. The crowd density estimation and the early warning information are obtained according to the predicted passenger entering amount of the platform and the crowd density of the platform, so that the crowd density estimation of the platform is realized, the rail traffic management efficiency is improved, and the stability of public safety is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of video analysis, and in particular relates to a method and system for analyzing and predicting rail transit crowd density based on video images. Background Art

[0002] With the acceleration of urbanization and the upgrading of urban infrastructure construction, the continuous growth of urban population and the increasing traffic pressure on citizens, urban rail transit has played an important role in meeting the travel needs of urban residents and alleviating urban traffic congestion. However, urban rail transit is a typical place with dense crowds. It has the characteristics of high passenger flow density. Serious congestion is prone to occur during peak passenger flow periods, causing passengers to stay on the platform, and even causing passenger disputes, trampling and riots and other safety accidents, which will affect personal safety, the stability of public order and the normal operation of trains. At present, the supervision of the density of rail transit crowds usually relies mainly on station staff to monitor the monitoring screen and security personnel to patrol the station to collect passenger density data. When crowd congestion or abnormal events occur, other staff in the station area are notified to deal with the relevant situations. The monitoring and management means are single and the workload is large, resulting in large manpower consumption and low intelligence. It also leads to the problem that it can only be handled after the incident occurs, and it is impossible to intervene in advance and discover potential safety hazards in time. Summary of the invention

[0003] In order to solve the above problems existing in the prior art, the present invention provides a method for analyzing and predicting rail transit crowd density based on video images, by acquiring a video image of a monitoring area, obtaining denoised video image information through image processing according to the video image, obtaining a foreground image through foreground segmentation according to a standard station hall area image and a station hall area video image, obtaining a target person frame set and a person frame set number through YOLOV3 detection method according to the foreground image, obtaining target person features through feature extraction according to the target person frame set and the person frame set number, obtaining predicted position coordinates through neural network processing according to the target person features, and obtaining predicted position coordinates through target detection according to the platform area video image. The total number of head marking points is obtained through measurement algorithm processing, and the crowd density of the platform is obtained based on the total number of head marking points and the platform area. The coordinate similarity is obtained by matching the predicted position coordinates with the platform entrance position coordinates. The estimated passenger volume of the platform is obtained based on the coordinate similarity combined with the target person frame set number. The crowd density is estimated based on the estimated passenger volume of the platform and the platform crowd density. When the crowd density estimate is greater than or equal to the preset threshold, a warning message is obtained and uploaded to the terminal, thus realizing the crowd density estimation of the platform and improving the efficiency of rail transit management. By estimating the crowd density of the platform, it is beneficial to improve the stability of public safety and timely discover potential hazards.

[0004] The purpose of the present invention can be achieved by the following technical solutions:

[0005] A method for analyzing and predicting rail transit crowd density based on video images specifically comprises the following steps:

[0006] S1: Acquire a video image of a monitoring area, where the monitoring area includes a station hall area and a platform area;

[0007] S2: According to the video image, a video grayscale image is obtained by performing image grayscale processing, according to the video grayscale image, a balanced video image is obtained by performing histogram equalization processing, according to the balanced video image, a denoised video image is obtained by performing image filtering model processing, and the denoised video image includes a video image of a station hall area and a video image of a platform area;

[0008] S3: Acquire a standard station hall area image, obtain a foreground image by foreground segmentation based on the standard station hall area image and the station hall area video image, obtain a target person frame set by processing the foreground image through the YOLOV3 detection method, number the target person frame set to obtain a person frame set number, obtain target person features by feature extraction based on the target person frame set and the person frame set number, and obtain predicted position coordinates based on the target person features by processing through a neural network;

[0009] S4: Obtain the platform area, obtain a head mark image based on the platform area video image through the target detection algorithm, obtain the total number of head mark points based on the head mark image, and calculate the total number of head mark points and the platform area based on the formula The platform crowd density is calculated, where ρ represents the platform crowd density, N represents the total number of head marking points, and S represents the platform area;

[0010] S5: Acquire the platform entrance position coordinates, match the predicted position coordinates with the platform entrance position coordinates to obtain coordinate similarity, obtain the expected platform passenger volume based on the coordinate similarity combined with the target person frame set number, obtain a crowd density estimate based on the expected platform passenger volume and the platform crowd density, obtain a warning message when the crowd density estimate is greater than or equal to a preset threshold, and upload the warning message to the terminal.

[0011] Preferably, the step S2 specifically includes the following steps:

[0012] S201: Determine a pixel point set according to the video image, the pixel point set includes pixel points and color components corresponding to the pixel points, and calculate the pixel point grayscale value according to the pixel point set by formula JK(i)=Z×R(i)+X×G(i)+C×B(i), wherein JK(i) represents the pixel point grayscale value of the i-th pixel point, R(i), G(i) and B(i) respectively represent the color component corresponding to the i-th pixel point, Z, X and C represent weight coefficients, and obtain the video grayscale image according to the pixel point grayscale value;

[0013] S202: Determine the total number of pixels according to the pixel set, determine a transformation function according to the total number of pixels and the grayscale value of the pixels, the histogram equalization processing includes obtaining an image grayscale value according to the video grayscale image, and obtaining a mapping grayscale value by mapping the image grayscale value in combination with the transformation function, wherein the transformation function is expressed as Wherein, N represents the total number of pixels, i represents the gray level, and n i Indicates the number of pixels contained in gray level i, H i represents the mapping grayscale value, a represents the image grayscale value, s represents the highest grayscale level, and the equalized video image is obtained according to the mapping grayscale value;

[0014] S203: Obtain pixel coordinates of the equalized video image. The equalized video image is processed by the image filtering model to obtain the denoised video image information. The image filtering model is expressed as: Wherein, A represents the equalized video image, S represents the preset structure element, (x, y) represents the pixel point coordinates, represents the dilation operator, Represents the erosion operator.

[0015] Preferably, the step S3 specifically includes the following steps:

[0016] S301: Perform foreground segmentation on the video image of the station hall area using a Gaussian distribution model to obtain the foreground image, select the i-th frame of the video image of the station hall area, obtain Gaussian distribution weights based on the pixel points of the i-th frame of the video image of the station hall area, and extract the Gaussian distribution model to be expressed as Wherein, tyz represents the preset threshold, P represents the number of Gaussian distribution models, ω i represents the Gaussian distribution weight, matches the Gaussian distribution model according to the pixel point, if the match is successful, the current pixel point is used as the background point, if the match is unsuccessful, the current pixel point is used as the foreground point, and the foreground image is obtained according to the foreground point;

[0017] S302: labeling the foreground image with a rectangular box using a Labelbox image labeling tool to obtain a target area box, obtaining a center coordinate distance of the target area box, calculating a confidence level according to the target area box and the center coordinates, calculating a target person frame set according to the confidence level using a loss function of the YOLOV3 target detection method, and obtaining a person frame set number by numbering the target person frame set;

[0018] S303: Obtain centroid coordinates and rectangular position information through feature extraction based on the target person frame set, obtain the horizontal speed and horizontal average speed of the target person based on the difference of the horizontal coordinates of the centroid coordinates of adjacent frames and the time difference between frames, obtain the horizontal average acceleration based on the difference of the horizontal speeds of adjacent frames and the time difference between frames, the target person features include the centroid coordinates, the rectangular position information, the horizontal average speed and the horizontal average acceleration, determine the initial weights of the target person features, and obtain the predicted position coordinates through neural network processing based on the target person frame set in the video image of the station hall area in combination with the initial weights.

[0019] Preferably, the step S302 specifically includes the following steps:

[0020] The confidence score is calculated based on the distance between the target area frame and the center coordinates, and the calculation formula is: Wherein, con is the confidence score, L and T are the target area boxes, d is the center coordinate distance, C is the diagonal distance of the target area box, α is the weight coefficient, and γ is the aspect ratio parameter;

[0021] When the confidence score is greater than a preset threshold, the target area frame corresponding to the confidence score is calculated through the loss function of the YOLOV3 target detection method to obtain the target person frame set. The loss function formula is: loss = γ1loss qw +γ2loss con +γ3loss cov , where loss is the loss function, γ1, γ2, γ3 are weight coefficients, and loss qw is the target area box loss function, loss con is the confidence loss function, loss cov is the positioning loss function.

[0022] Preferably, the step S5 specifically includes: The coordinate similarity is calculated, where Sim(α1, α2) represents the coordinate similarity, α1 represents the predicted position coordinates, and α2 represents the platform entrance position coordinates. When the coordinate similarity is greater than a preset threshold, the estimated number of passengers entering the platform is obtained based on the predicted position coordinates and the character frame set number.

[0023] A rail transit crowd density analysis and prediction system based on video images, comprising:

[0024] A video acquisition module, used to obtain video images of the monitoring area, wherein the monitoring area includes the station hall area and the platform area;

[0025] A video processing module, used for obtaining a video grayscale image by performing image grayscale processing on the video image, obtaining a balanced video image by performing histogram equalization processing on the video grayscale image, and obtaining a denoised video image by performing image filtering model processing on the balanced video image, wherein the denoised video image includes a video image of a station hall area and a video image of a platform area;

[0026] The video analysis module is used to obtain a standard station hall area image, obtain a foreground image by foreground segmentation based on the standard station hall area image and the station hall area video image, obtain a target person frame set by processing the foreground image through the YOLOV3 detection method, number the target person frame set to obtain a person frame set number, obtain target person features by feature extraction based on the target person frame set and the person frame set number, obtain predicted position coordinates based on the target person features through neural network processing, obtain the platform area, obtain a head mark image based on the platform area video image through the target detection algorithm, obtain the total number of head mark points based on the head mark image, and calculate the total number of head mark points and the platform area through the formula The platform crowd density is calculated, where ρ represents the platform crowd density, N represents the total number of head marking points, and S represents the platform area;

[0027] The crowd density prediction module is used to obtain the coordinates of the platform entrance position, match the predicted position coordinates with the platform entrance position coordinates to obtain coordinate similarity, obtain the expected platform passenger volume based on the coordinate similarity combined with the target person frame set number, obtain the crowd density estimate based on the expected platform passenger volume and the platform crowd density, obtain warning information when the crowd density estimate is greater than or equal to a preset threshold, and upload the warning information to the terminal.

[0028] The beneficial effects of the present invention are:

[0029] 1. By acquiring a standard station hall area image, obtaining a foreground image through foreground segmentation according to the standard station hall area image and the station hall area video image, obtaining a target person frame set through YOLOV3 detection method according to the foreground image, numbering the target person frame set to obtain a person frame set number, obtaining target person features through feature extraction according to the target person frame set and the person frame set number, obtaining predicted position coordinates according to the target person features through neural network processing, obtaining the platform area, obtaining a head mark image according to the platform area video image through target detection algorithm processing, obtaining the total number of head mark points according to the head mark image, obtaining the platform crowd density according to the total number of head mark points and the platform area, obtaining the expected passenger volume of the platform by predicting the crowd position information of the station hall, and obtaining the platform crowd density estimation according to the expected passenger volume of the platform combined with the platform crowd density at the same time, thereby improving the accuracy of crowd density estimation and facilitating the efficiency of rail transit safety management;

[0030] 2. Obtain the coordinates of the platform entrance position, match the predicted position coordinates with the platform entrance position coordinates to obtain coordinate similarity, obtain the expected number of passengers entering the platform based on the coordinate similarity combined with the target person frame set number, obtain a crowd density estimate based on the expected number of passengers entering the platform and the platform crowd density, obtain a warning message when the crowd density estimate is greater than or equal to a preset threshold, and upload the warning message to the terminal. By estimating the crowd density of the platform, it is beneficial to improve the stability of public safety and timely discover potential trampling and congestion hazards. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to facilitate understanding by those skilled in the art, the present invention is further described below with reference to the accompanying drawings.

[0032] Figure 1 It is a flow chart of the method for analyzing and predicting rail transit crowd density based on video images of the present invention. DETAILED DESCRIPTION

[0033] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the specific implementation methods, structures, features and effects of the present invention are described in detail below in conjunction with the accompanying drawings and preferred embodiments.

[0034] See also Figure 1 , a method for analyzing and predicting rail transit crowd density based on video images, specifically comprising the following steps:

[0035] S1: Acquire a video image of a monitoring area, where the monitoring area includes a station hall area and a platform area;

[0036] S2: According to the video image, a video grayscale image is obtained by performing image grayscale processing, according to the video grayscale image, a balanced video image is obtained by performing histogram equalization processing, according to the balanced video image, a denoised video image is obtained by performing image filtering model processing, and the denoised video image includes a video image of a station hall area and a video image of a platform area;

[0037] S3: Acquire a standard station hall area image, obtain a foreground image by foreground segmentation based on the standard station hall area image and the station hall area video image, obtain a target person frame set by processing the foreground image through the YOLOV3 detection method, number the target person frame set to obtain a person frame set number, obtain target person features by feature extraction based on the target person frame set and the person frame set number, and obtain predicted position coordinates based on the target person features by processing through a neural network;

[0038] S4: Obtain the platform area, obtain a head mark image based on the platform area video image through the target detection algorithm, obtain the total number of head mark points based on the head mark image, and calculate the total number of head mark points and the platform area based on the formula The platform crowd density is calculated, where ρ represents the platform crowd density, N represents the total number of head marking points, and S represents the platform area;

[0039] S5: Acquire the platform entrance position coordinates, match the predicted position coordinates with the platform entrance position coordinates to obtain coordinate similarity, obtain the expected platform passenger volume based on the coordinate similarity combined with the target person frame set number, obtain a crowd density estimate based on the expected platform passenger volume and the platform crowd density, obtain a warning message when the crowd density estimate is greater than or equal to a preset threshold, and upload the warning message to the terminal.

[0040] Specifically, the step S2 comprises the following steps:

[0041] S201: Determine a pixel point set according to the video image, the pixel point set includes pixel points and color components corresponding to the pixel points, and calculate the pixel point grayscale value according to the pixel point set by formula JK(i)=Z×R(i)+X×G(i)+C×B(i), wherein JK(i) represents the pixel point grayscale value of the i-th pixel point, R(i), G(i) and B(i) respectively represent the color component corresponding to the i-th pixel point, Z, X and C represent weight coefficients, and obtain the video grayscale image according to the pixel point grayscale value;

[0042] S202: Determine the total number of pixels according to the pixel set, determine a transformation function according to the total number of pixels and the grayscale value of the pixels, the histogram equalization processing includes obtaining an image grayscale value according to the video grayscale image, and obtaining a mapping grayscale value by mapping the image grayscale value in combination with the transformation function, wherein the transformation function is expressed as Wherein, N represents the total number of pixels, i represents the gray level, and n i Indicates the number of pixels contained in gray level i, H i represents the mapping grayscale value, a represents the image grayscale value, s represents the highest grayscale level, and the equalized video image is obtained according to the mapping grayscale value;

[0043] S203: Obtain pixel coordinates of the equalized video image. The equalized video image is processed by the image filtering model to obtain the denoised video image information. The image filtering model is expressed as: Wherein, A represents the equalized video image, S represents the preset structure element, (x, y) represents the pixel point coordinates, represents the dilation operator, Represents the erosion operator.

[0044] It should be further explained that, in formula (1), if the intersection of the preset structure element at the image (x, y) and the equalized video image is not an empty set, then the equalized video image and the preset structure element are dilated. In formula (2), if the preset structure element at the image (x, y) is completely contained in the area of ​​the equalized video image, then the equalized video image and the preset structure tuple are eroded.

[0045] Specifically, the step S3 comprises the following steps:

[0046] S301: Perform foreground segmentation on the video image of the station hall area using a Gaussian distribution model to obtain the foreground image, select the i-th frame of the video image of the station hall area, obtain Gaussian distribution weights based on the pixel points of the i-th frame of the video image of the station hall area, and extract the Gaussian distribution model to be expressed as Wherein, tyz represents the preset threshold, P represents the number of Gaussian distribution models, ω i represents the Gaussian distribution weight, matches the Gaussian distribution model according to the pixel point, if the match is successful, the current pixel point is used as the background point, if the match is unsuccessful, the current pixel point is used as the foreground point, and the foreground image is obtained according to the foreground point;

[0047] S302: labeling the foreground image with a rectangular box using a Labelbox image labeling tool to obtain a target area box, obtaining a center coordinate distance of the target area box, calculating a confidence level according to the target area box and the center coordinates, calculating a target person frame set according to the confidence level using a loss function of the YOLOV3 target detection method, and obtaining a person frame set number by numbering the target person frame set;

[0048] S303: Obtain centroid coordinates and rectangular position information through feature extraction based on the target person frame set, obtain the horizontal speed and horizontal average speed of the target person based on the difference of the horizontal coordinates of the centroid coordinates of adjacent frames and the time difference between frames, obtain the horizontal average acceleration based on the difference of the horizontal speeds of adjacent frames and the time difference between frames, the target person features include the centroid coordinates, the rectangular position information, the horizontal average speed and the horizontal average acceleration, determine the initial weights of the target person features, and obtain the predicted position coordinates through neural network processing based on the target person frame set in the video image of the station hall area in combination with the initial weights.

[0049] Specifically, step S302 includes the following steps:

[0050] The confidence score is calculated based on the distance between the target area frame and the center coordinates, and the calculation formula is: Wherein, con is the confidence score, L and T are the target area boxes, d is the center coordinate distance, C is the diagonal distance of the target area box, α is the weight coefficient, and γ is the aspect ratio parameter;

[0051] When the confidence score is greater than a preset threshold, the target area frame corresponding to the confidence score is calculated through the loss function of the YOLOV3 target detection method to obtain the target person frame set. The loss function formula is: loss = γ1loss qw +γ2loss con +γ3loss cov , where loss is the loss function, γ1, γ2, γ3 are weight coefficients, and loss qw is the target area box loss function, loss con is the confidence loss function, loss cov is the positioning loss function.

[0052] It should be noted that the standard station hall area image is an image of the station hall area without any moving targets. Here, it is used as a background image input to separate the moving targets in the foreground.

[0053] Preferably, the step S5 specifically includes: The coordinate similarity is calculated, where Sim(α1, α2) represents the coordinate similarity, α1 represents the predicted position coordinates, and α2 represents the platform entrance position coordinates. When the coordinate similarity is greater than a preset threshold, the estimated number of passengers entering the platform is obtained based on the predicted position coordinates and the character frame set number.

[0054] Furthermore, the present application also provides a rail transit crowd density analysis and prediction system based on video images, comprising:

[0055] A video acquisition module, used to obtain video images of the monitoring area, wherein the monitoring area includes the station hall area and the platform area;

[0056] A video processing module, used for obtaining a video grayscale image by performing image grayscale processing on the video image, obtaining a balanced video image by performing histogram equalization processing on the video grayscale image, and obtaining a denoised video image by performing image filtering model processing on the balanced video image, wherein the denoised video image includes a video image of a station hall area and a video image of a platform area;

[0057] The video analysis module is used to obtain a standard station hall area image, obtain a foreground image by foreground segmentation based on the standard station hall area image and the station hall area video image, obtain a target person frame set by processing the foreground image through the YOLOV3 detection method, number the target person frame set to obtain a person frame set number, obtain target person features by feature extraction based on the target person frame set and the person frame set number, obtain predicted position coordinates based on the target person features through neural network processing, obtain the platform area, obtain a head mark image based on the platform area video image through the target detection algorithm, obtain the total number of head mark points based on the head mark image, and calculate the total number of head mark points and the platform area through the formula

[0058] The platform crowd density is calculated, where ρ represents the platform crowd density, N represents the total number of head marking points, and S represents the platform area;

[0059] The crowd density prediction module is used to obtain the coordinates of the platform entrance position, match the predicted position coordinates with the platform entrance position coordinates to obtain coordinate similarity, obtain the expected platform passenger volume based on the coordinate similarity combined with the target person frame set number, obtain the crowd density estimate based on the expected platform passenger volume and the platform crowd density, obtain warning information when the crowd density estimate is greater than or equal to a preset threshold, and upload the warning information to the terminal.

[0060] The working principle and use process of the present invention:

[0061] The video image of the monitoring area is obtained, and denoised video image information is obtained through image processing according to the video image. The foreground image is obtained through foreground segmentation according to the standard station hall area image and the station hall area video image. The target person frame set and the person frame set number are obtained by processing the foreground image through the YOLOV3 detection method. The target person features are obtained by feature extraction according to the target person frame set and the person frame set number. The predicted position coordinates are obtained through neural network processing according to the target person features. The total number of head marking points is obtained according to the platform area video image through the target detection algorithm. The platform crowd density is obtained according to the total number of head marking points and the platform area. The predicted position coordinates are matched with the platform entrance position coordinates to obtain coordinate similarity. The estimated platform passenger volume is obtained according to the coordinate similarity combined with the target person frame set number. The crowd density is estimated according to the estimated platform passenger volume and the platform crowd density. When the crowd density estimate is greater than or equal to a preset threshold, an early warning message is obtained, and the early warning message is uploaded to the terminal.

[0062] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, a device or a device or used in combination with it.

[0063] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0064] The program code included in the computer readable medium can be transmitted with any appropriate medium, including but not limited to wireless, electric wire, optical cable, RF, etc., or any suitable combination of the above. The computer program code for performing the operation of the present invention can be written in one or more programming languages ​​or their combinations, and the programming language includes object-oriented programming languages-such as Java, Smalltalk, C++, and also includes conventional procedural programming languages-such as "C" language or similar programming languages. The program code can be executed completely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on the remote computer, or completely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0065] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technical personnel in this field can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any brief modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention are still within the scope of the technical solution of the present invention.

Claims

1. A method for analyzing and predicting rail transit crowd density based on video images, characterized in that: The specific steps include: S1: Acquire a video image of a monitoring area, where the monitoring area includes a station hall area and a platform area; S2: According to the video image, a video grayscale image is obtained by performing image grayscale processing, according to the video grayscale image, a balanced video image is obtained by performing histogram equalization processing, according to the balanced video image, a denoised video image is obtained by performing image filtering model processing, and the denoised video image includes a video image of a station hall area and a video image of a platform area; S3: Acquire a standard station hall area image, obtain a foreground image by foreground segmentation based on the standard station hall area image and the station hall area video image, obtain a target person frame set by processing the foreground image through the YOLOV3 detection method, number the target person frame set to obtain a person frame set number, obtain target person features by feature extraction based on the target person frame set and the person frame set number, and obtain predicted position coordinates based on the target person features by processing through a neural network; S4: Obtain the platform area, obtain a head mark image based on the platform area video image through the target detection algorithm, obtain the total number of head mark points based on the head mark image, and calculate the total number of head mark points and the platform area based on the formula The platform crowd density is calculated, where ρ represents the platform crowd density, N represents the total number of head marking points, and S represents the platform area; S5: Acquire the platform entrance position coordinates, match the predicted position coordinates with the platform entrance position coordinates to obtain coordinate similarity, obtain the expected platform passenger volume based on the coordinate similarity combined with the target person frame set number, obtain a crowd density estimate based on the expected platform passenger volume and the platform crowd density, obtain a warning message when the crowd density estimate is greater than or equal to a preset threshold, and upload the warning message to the terminal.

2. The method for analyzing and predicting rail transit crowd density based on video images according to claim 1 is characterized in that: The step S2 specifically includes the following steps: S201: Determine a pixel point set according to the video image, the pixel point set includes pixel points and color components corresponding to the pixel points, and calculate the pixel point grayscale value according to the pixel point set by formula JK(i)=Z×R(i)+X×G(i)+C×B(i), wherein JK(i) represents the pixel point grayscale value of the i-th pixel point, R(i), G(i) and B(i) respectively represent the color component corresponding to the i-th pixel point, Z, X and C represent weight coefficients, and obtain the video grayscale image according to the pixel point grayscale value; S202: Determine the total number of pixels according to the pixel set, determine a transformation function according to the total number of pixels and the grayscale value of the pixels, the histogram equalization processing includes obtaining an image grayscale value according to the video grayscale image, and obtaining a mapping grayscale value by mapping the image grayscale value in combination with the transformation function, wherein the transformation function is expressed as Wherein, N represents the total number of pixels, i represents the gray level, and n i Indicates the number of pixels contained in gray level i, H i represents the mapping grayscale value, a represents the image grayscale value, s represents the highest grayscale level, and the equalized video image is obtained according to the mapping grayscale value; S203: Obtain pixel coordinates of the equalized video image. The equalized video image is processed by the image filtering model to obtain the denoised video image information. The image filtering model is expressed as: Wherein, A represents the equalized video image, S represents the preset structure element, (x, y) represents the pixel point coordinates, represents the dilation operator, Represents the erosion operator.

3. The method for analyzing and predicting rail transit crowd density based on video images according to claim 1 is characterized in that: The step S3 specifically comprises the following steps: S301: Perform foreground segmentation on the video image of the station hall area using a Gaussian distribution model to obtain the foreground image, select the i-th frame of the video image of the station hall area, obtain Gaussian distribution weights based on the pixel points of the i-th frame of the video image of the station hall area, and extract the Gaussian distribution model to be expressed as Wherein, tyz represents the preset threshold, P represents the number of Gaussian distribution models, ω i represents the Gaussian distribution weight, matches the Gaussian distribution model according to the pixel point, if the match is successful, the current pixel point is used as the background point, if the match is unsuccessful, the current pixel point is used as the foreground point, and the foreground image is obtained according to the foreground point; S302: labeling the foreground image with a rectangular box using a Labelbox image labeling tool to obtain a target area box, obtaining a center coordinate distance of the target area box, calculating a confidence level according to the target area box and the center coordinates, calculating a target person frame set according to the confidence level using a loss function of the YOLOV3 target detection method, and obtaining a person frame set number by numbering the target person frame set; S303: Obtain centroid coordinates and rectangular position information through feature extraction based on the target person frame set, obtain the horizontal speed and horizontal average speed of the target person based on the difference of the horizontal coordinates of the centroid coordinates of adjacent frames and the time difference between frames, obtain the horizontal average acceleration based on the difference of the horizontal speeds of adjacent frames and the time difference between frames, the target person features include the centroid coordinates, the rectangular position information, the horizontal average speed and the horizontal average acceleration, determine the initial weights of the target person features, and obtain the predicted position coordinates through neural network processing based on the target person frame set in the video image of the station hall area in combination with the initial weights.

4. The method for analyzing and predicting rail transit crowd density based on video images according to claim 3 is characterized in that: The step S302 specifically includes the following steps: The confidence score is calculated based on the distance between the target area frame and the center coordinates, and the calculation formula is: Wherein, con is the confidence score, L and T are the target area boxes, d is the center coordinate distance, C is the diagonal distance of the target area box, α is the weight coefficient, and γ is the aspect ratio parameter; When the confidence score is greater than a preset threshold, the target area frame corresponding to the confidence score is calculated through the loss function of the YOLOV3 target detection method to obtain the target person frame set. The loss function formula is: loss = γ1loss qw +γ2loss con +γ3loss cov , where loss is the loss function, γ1, γ2, γ3 are weight coefficients, and loss qw is the target area box loss function, loss con is the confidence loss function, loss cov is the positioning loss function.

5. The method for analyzing and predicting rail transit crowd density based on video images according to claim 1 is characterized in that: The step S5 specifically includes calculating the predicted position coordinates and the platform entrance position coordinates by the formula The coordinate similarity is calculated, where Sim(α1, α2) represents the coordinate similarity, α1 represents the predicted position coordinates, and α2 represents the platform entrance position coordinates. When the coordinate similarity is greater than a preset threshold, the estimated number of passengers entering the platform is obtained based on the predicted position coordinates and the character frame set number.

6. A rail transit crowd density analysis and prediction system based on video images, the rail transit crowd density analysis and prediction system based on video images adopts the rail transit crowd density analysis and prediction method based on video images as claimed in claim 1, characterized in that: include: A video acquisition module, used to obtain video images of the monitoring area, wherein the monitoring area includes the station hall area and the platform area; A video processing module, used for obtaining a video grayscale image by performing image grayscale processing on the video image, obtaining a balanced video image by performing histogram equalization processing on the video grayscale image, and obtaining a denoised video image by performing image filtering model processing on the balanced video image, wherein the denoised video image includes a video image of a station hall area and a video image of a platform area; The video analysis module is used to obtain a standard station hall area image, obtain a foreground image by foreground segmentation based on the standard station hall area image and the station hall area video image, obtain a target person frame set by processing the foreground image through the YOLOV3 detection method, number the target person frame set to obtain a person frame set number, obtain target person features by feature extraction based on the target person frame set and the person frame set number, obtain predicted position coordinates based on the target person features through neural network processing, obtain the platform area, obtain a head mark image based on the platform area video image through the target detection algorithm, obtain the total number of head mark points based on the head mark image, and calculate the total number of head mark points and the platform area through the formula The platform crowd density is calculated, where ρ represents the platform crowd density, N represents the total number of head marking points, and S represents the platform area; The crowd density prediction module is used to obtain the coordinates of the platform entrance position, match the predicted position coordinates with the platform entrance position coordinates to obtain coordinate similarity, obtain the expected platform passenger volume based on the coordinate similarity combined with the target person frame set number, obtain the crowd density estimate based on the expected platform passenger volume and the platform crowd density, obtain warning information when the crowd density estimate is greater than or equal to a preset threshold, and upload the warning information to the terminal.