A zebra crossing pedestrian safety warning method and device

By optimizing the sensor layout and angle through the genetic coding scheme and genetic algorithm, the problem of insufficient recognition ability of the traditional traffic monitoring system in dealing with complex traffic scenes is solved, and more efficient pedestrian activity monitoring and accident warning are achieved.

CN118411829BActive Publication Date: 2024-09-03SHANDONG LEADING INTELLIGENT TRANSPORTATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410887981.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-04
Publication Date
2024-09-03
Estimated Expiration
2044-07-04

AI Technical Summary

Technical Problem

When traditional traffic monitoring systems deal with dynamic and complex traffic scenes, the sensor layout is fixed and difficult to adapt to traffic flow fluctuations, resulting in insufficient recognition capabilities and affecting monitoring performance.

Method used

Gene coding scheme and genetic algorithm are used to optimize the sensor layout and angle, and crossover and mutation are performed through fitness function to generate the optimal sensor layout and angle configuration, monitor pedestrian activities in real time, and send warnings through wireless communication.

Benefits of technology

It improves sensor coverage and data collection accuracy, can automatically adapt to different traffic intersections and traffic changes, monitor pedestrian activities in real time, and reduce the risk of traffic accidents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118411829B
    Figure CN118411829B
Patent Text Reader

Abstract

The present invention provides a zebra crossing pedestrian safety warning method and device, which relates to the field of data processing technology. The method comprises: determining a fitness function for evaluating the advantages and disadvantages of each sensor layout and angle configuration; determining the corresponding individuals to enter the next generation according to the fitness function, randomly pairing the determined individuals, and performing a crossover operation to generate new individuals; performing a mutation operation on the newly generated individuals until a preset number of iterations is reached to obtain the final individuals; determining the final sensor layout and angle according to the final individuals; installing sensors according to the final sensor layout and angle so that the sensors monitor the pedestrian activity data in the zebra crossing area in real time. The present invention can monitor the pedestrian activities in the zebra crossing area in real time and accurately capture the dynamics of pedestrians.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a zebra crossing pedestrian safety early warning method and device. Background Art

[0002] At a busy traffic intersection in a large city, a traditional traffic monitoring system consisting of multiple cameras and sensors has been installed to monitor traffic flow and pedestrian activities. However, in actual application, the system has revealed its limitations, especially in the layout of data collection.

[0003] For example, the system’s data collection layout was not adequate to cope with dynamic fluctuations in traffic flow. During peak traffic hours, as the number of pedestrians and vehicles increased significantly, the fixed camera view and sensor coverage did not flexibly adjust accordingly, which to some extent affected the system’s ability to accurately identify each moving target. This relatively fixed layout and lack of sufficient adaptability resulted in the system’s performance failing to reach reasonable levels when dealing with changing and complex traffic scenarios. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a zebra crossing pedestrian safety warning method, which can monitor the pedestrian activities in the zebra crossing area in real time and accurately capture the dynamics of the pedestrians.

[0005] In order to solve the above technical problems, the technical solution of the present invention is as follows:

[0006] In a first aspect, a zebra crossing pedestrian safety warning method is provided, the method comprising:

[0007] Define a genetic encoding scheme to represent the position and angle of the sensor;

[0008] An initial population is randomly generated, where each individual has a randomly generated sensor layout and angle configuration according to a genetic encoding scheme;

[0009] Determine the fitness function used to evaluate the merits of each sensor layout and angle configuration;

[0010] According to the fitness function, the corresponding individuals are determined to enter the next generation, the determined individuals are randomly paired, and a crossover operation is performed to generate new individuals; the newly generated individuals are mutated until the preset number of iterations is reached to obtain the final individuals; based on the final individuals, the final sensor layout and angle are determined;

[0011] Install sensors according to the final sensor layout and angles so that the sensors can monitor pedestrian activity data in the zebra crossing area in real time;

[0012] Processing the pedestrian activity data to obtain processed data, and extracting key features based on the processed data;

[0013] According to the key features, when a pedestrian is detected entering the zebra crossing area, the information of the pedestrian entering the zebra crossing area is sent to the display device in real time through wireless communication to warn the driver.

[0014] Furthermore, the calculation formula of the fitness function is:

[0015] ;

[0016] in, Indicates the number of pedestrians that are actually detected correctly; Indicates the number of actual non-pedestrians but incorrectly detected as pedestrians; Indicates the number of actual non-pedestrians that are not falsely detected; Indicates the number of pedestrians that are not detected. , , and They are the weight coefficients of coverage, false alarm rate, missed alarm rate and accuracy; , , and Represents weight.

[0017] Further, the pedestrian activity data is processed to obtain processed data, including:

[0018] The pedestrian activity data is processed by Performing filtering to obtain filtered data;

[0019] in, represents the output signal after filtering, indicating the filtering result at the current time n; N represents the window size of the moving average, indicating the number of data points considered when calculating the current filtering result; represents the mean of the Gaussian weights, located at the center of the window; represents the standard deviation of Gaussian weights; represents the original input signal, which represents the data point k moments before the current moment n; b represents the bias term, n is the index of the current moment; k is the index of the data point in the window, which varies from 0 to N-1, in the summation symbol In the summation symbol, k is used to traverse all data points in the window; i is the index of the data point in the window. In , i is used to traverse all data points in the window to calculate the sum of weights; Represents the index of the data point k moments before the current moment n; and It represents the distance between each data point index in the window and the mean of the Gaussian distribution;

[0020] The filtered output signal Processing is performed to obtain processed data.

[0021] Furthermore, the filtered output signal Processing to obtain processed data, including:

[0022] The filtered output signal pass Processing to obtain processed data;

[0023] in, , W represents the size of the sliding window, which is a positive integer; Used to represent any moment in the sliding window The signal value of is the local mean at time n; is an index variable; The value range is from to n; is the starting time of the sliding window.

[0024] Furthermore, based on the processed data, key features are extracted, including:

[0025] Splitting continuous processing data into data segments;

[0026] For each data segment, pedestrian targets are identified and their moving trajectories are tracked; based on the moving trajectories of pedestrians, the displacement of pedestrians between adjacent frames is calculated, and based on the time difference between adjacent frames, the instantaneous speed of pedestrians is calculated; the instantaneous speeds of all pedestrians in the data segment are averaged to obtain the average speed of pedestrians in the corresponding data segment; for each pedestrian, the difference between its leaving timestamp and entering timestamp is calculated, and the passing time of pedestrians in all data segments is averaged to obtain the average passing time of the corresponding data segment;

[0027] Key features are extracted based on the pedestrian's moving trajectory, pedestrian's instantaneous speed, pedestrian's average speed and average passing time.

[0028] Further, the continuous processing data is divided into data segments, including:

[0029] traversing the continuous processing data to determine the signal strength at each time point, and performing spectrum analysis on the continuous processing data to identify frequency components in the continuous processing data; identifying stable intervals in the continuous processing data, and calculating the duration of the stable intervals;

[0030] The signal strength at each time point, the frequency components in the processed data, and the duration of the stable interval are combined into a feature vector, with each time point or data segment corresponding to one feature vector;

[0031] Determine the number of clusters K, and randomly determine K points as the initial cluster centers;

[0032] Assign each point in the continuous processing data to the corresponding cluster center to form K groups;

[0033] Recalculate the center point of each group and repeat the operation until the preset number of iterations is reached to obtain the clustering result;

[0034] According to the clustering results, each point in the continuous processing data is assigned to the corresponding group;

[0035] Points where groups change are identified in the continuous processing data to determine data segments.

[0036] Furthermore, for each data segment, pedestrian targets are identified and the movement trajectory of pedestrians is tracked, including:

[0037] Preprocess each frame of the image, and extract the foreground target by comparing each preprocessed image with a preset background model; perform morphological operations on the extracted foreground target to obtain a coherent foreground target image; analyze the features of the coherent foreground target image to identify pedestrian targets;

[0038] Pedestrian targets in consecutive frames are associated to obtain associated target positions; and the movement trajectory of the pedestrian is generated according to the associated target positions.

[0039] In a second aspect, a zebra crossing pedestrian safety warning device includes:

[0040] An acquisition module is used to define a gene encoding scheme for representing the position and angle of the sensor; randomly generate an initial population, in which each individual is a sensor layout and angle configuration randomly generated according to the gene encoding scheme; determine a fitness function for evaluating the quality of each sensor layout and angle configuration;

[0041] The processing module is used to determine the corresponding individuals to enter the next generation according to the fitness function, randomly pair the determined individuals, and perform crossover operations to generate new individuals; perform mutation operations on the newly generated individuals until a preset number of iterations is reached to obtain the final individuals; determine the final sensor layout and angle according to the final individuals; install sensors according to the final sensor layout and angle so that the sensors can monitor the pedestrian activity data in the zebra crossing area in real time; process the pedestrian activity data to obtain processed data, and extract key features based on the processed data; based on the key features, when a pedestrian is detected entering the zebra crossing area, the information of the pedestrian entering the zebra crossing area is sent to the display device in real time through wireless communication to warn the driver.

[0042] According to a third aspect, a computing device includes:

[0043] one or more processors;

[0044] The storage device is used to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method described.

[0045] In a fourth aspect, a computer-readable storage medium stores a program, and when the program is executed by a processor, the method described is implemented.

[0046] The above solution of the present invention includes at least the following beneficial effects:

[0047] By defining a genetic coding scheme and optimizing it using a genetic algorithm, the present invention can automatically determine the reasonable layout and angle of sensors, which not only improves the monitoring coverage, but also ensures the accuracy and completeness of data collection, thereby more comprehensively understanding the pedestrian activities in the zebra crossing area.

[0048] Due to the optimized layout and angle of the sensors, the present invention can monitor pedestrian activities in the zebra crossing area in real time and accurately capture the dynamics of pedestrians. By processing and analyzing the collected pedestrian activity data, the present invention can extract key features such as the number, speed, direction, etc. of pedestrians. When a pedestrian is detected entering the zebra crossing area, the system will immediately send the relevant information to the display device in real time through wireless communication to warn the driver.

[0049] The genetic coding scheme and genetic algorithm of the present invention make the optimization of sensor layout and angle an automated process. This means that no matter at different traffic intersections or when traffic flow changes, the present invention can quickly adapt and provide a reasonable sensor configuration scheme. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 The present invention is a flowchart of a zebra crossing pedestrian safety warning method provided by an embodiment of the present invention.

[0051] Figure 2 It is a schematic diagram of a zebra crossing pedestrian safety warning device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0052] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0053] like Figure 1 As shown, an embodiment of the present invention provides a zebra crossing pedestrian safety warning method, the method comprising the following steps:

[0054] Step 11, defining a genetic encoding scheme for representing the position and angle of the sensor;

[0055] Step 12, randomly generate an initial population, where each individual has a sensor layout and angle configuration randomly generated according to the genetic encoding scheme;

[0056] Step 13, determining a fitness function for evaluating the pros and cons of each sensor layout and angle configuration;

[0057] Step 14, according to the fitness function, determine the corresponding individuals to enter the next generation, randomly pair the determined individuals, and perform a crossover operation to generate new individuals; perform a mutation operation on the newly generated individuals until a preset number of iterations is reached to obtain the final individuals; and determine the final sensor layout and angle based on the final individuals;

[0058] Step 15, installing sensors according to the final sensor layout and angle, so that the sensors can monitor pedestrian activity data in the zebra crossing area in real time;

[0059] Step 16, processing the pedestrian activity data to obtain processed data, and extracting key features based on the processed data;

[0060] Step 17, based on the key features, when a pedestrian is detected entering the zebra crossing area, the information of the pedestrian entering the zebra crossing area is sent to the display device in real time via wireless communication to warn the driver.

[0061] In the embodiment of the present invention, step 11, through the genetic coding scheme, the layout and angle of the sensor can be systematically represented and optimized, which is helpful to realize the automated design of the sensor layout and angle, and improve the design efficiency and accuracy. Step 12, by randomly generating the initial population, the diversity of the search space is increased, which helps to avoid falling into the local optimal solution and improves the possibility of finding the global optimal solution. Step 13, the fitness function is the key to evaluating the performance of the sensor layout and angle configuration. It can help the algorithm identify which configurations are more effective in monitoring pedestrian activities, thereby guiding the search process in a better direction. Step 14, through the selection, crossover and mutation operations of the genetic algorithm, it can effectively search for sensor layouts and angle configurations with better performance, with adaptability and global search capabilities, which helps to find better solutions. Step 15, installing sensors according to the optimized sensor layout and angle can ensure that the sensors can more effectively monitor pedestrian activities in the zebra crossing area and improve the accuracy and reliability of the data. Step 16, by processing and extracting features of pedestrian activity data, noise and redundant information can be removed and key information can be highlighted. Step 17, real-time detection and sending of warning information can effectively improve the driver's perception of pedestrians in the zebra crossing area, reduce the risk of traffic accidents, and improve road traffic safety. At the same time, wireless communication also ensures the real-time and accuracy of information.

[0062] In another preferred embodiment of the present invention, the specific implementation process of the above step 11 is as follows:

[0063] The position and angle of the sensor are represented by binary coding and real number coding. The position can be represented by two-dimensional coordinates (x, y), which can be encoded as binary strings or real numbers. The angle of the sensor can be a value between 0 and 360 degrees, which can also be encoded as a binary string or a real number. The position and angle codes are combined to form a complete genetic code, representing a specific sensor configuration.

[0064] The specific implementation process of the above step 12 is as follows:

[0065] Determine the size of the initial population, that is, the number of individuals in the population; for each individual in the population, use a random number generator to generate a binary string or real number that meets the requirements of the coding scheme, and randomly generate its genetic code; the specific implementation process of the above step 13 is as follows:

[0066] Determine the factors for evaluating the advantages and disadvantages of sensor layout and angle configuration, including coverage, detection accuracy, minimization of overlapping areas, etc. Based on the above evaluation criteria, determine the mathematical function to calculate the fitness value of each individual. The fitness function can return a value. The higher the value, the better the individual configuration.

[0067] The specific implementation process of the above step 14 is as follows:

[0068] The fitness of each individual in the population is evaluated using a fitness function, and which individuals will enter the next generation are selected based on the fitness value, for example, by a roulette wheel selection method; a crossover operation, such as a single-point crossover, is performed on each pair of individuals to generate new individuals; the newly generated individuals are randomly mutated to increase the diversity of the population, and the mutation may involve changing certain bits in the gene encoding, such as flipping certain bits in a binary string or modifying values ​​in a real number encoding; the above selection, crossover and mutation process is repeated until a preset number of iterations is reached, and after the last iteration, the individual with the highest fitness is selected as the final solution, i.e., the final sensor layout and angle configuration.

[0069] In a preferred embodiment of the present invention, the calculation formula of the fitness function is:

[0070] ;

[0071] in, Indicates the number of pedestrians that are actually detected correctly; Indicates the number of actual non-pedestrians but incorrectly detected as pedestrians; Indicates the number of actual non-pedestrians that are not falsely detected; Indicates the number of pedestrians that are not detected. , , and They are the weight coefficients of coverage, false alarm rate, missed alarm rate and accuracy; , , and Represents weight.

[0072] In the embodiment of the present invention, the function can comprehensively consider multiple performance indicators to more comprehensively evaluate the effect of sensor configuration. This helps to avoid focusing on a single indicator and ignoring other important aspects during the optimization process. , , and and weight parameters , , and , the priority of each indicator can be adjusted according to actual needs. This flexibility enables the function to adapt to different application scenarios and optimization goals. The value of can increase the penalty of false positives on coverage calculation, thereby reducing the positive impact of false positives on the overall fitness function. The value of can increase the contribution of true negatives to the false alarm rate calculation, thereby reducing the negative impact of the false alarm rate on the overall fitness function. The value of can reduce the negative impact of the false negative rate on the overall fitness function; by increasing The value of can increase the contribution of true negatives to the accuracy calculation, thereby improving the positive impact of accuracy on the overall fitness function. By incorporating statistics of actual detection results (such as TP, FP, TN, FN), the function can more accurately reflect the performance of the sensor configuration in actual applications, helping to ensure the practicality and reliability of the optimization results.

[0073] In a preferred embodiment of the present invention, the above step 16, processing the pedestrian activity data to obtain processed data, may include:

[0074] Step 161: the pedestrian activity data is processed by Performing filtering to obtain filtered data;

[0075] in, represents the output signal after filtering, indicating the filtering result at the current time n; N represents the window size of the moving average, indicating the number of data points considered when calculating the current filtering result; represents the mean of the Gaussian weights, located at the center of the window; represents the standard deviation of Gaussian weights; represents the original input signal, which represents the data point k moments before the current moment n; b represents the bias term, n is the index of the current moment; k is the index of the data point in the window, which varies from 0 to N-1, in the summation symbol In the summation symbol, k is used to traverse all data points in the window; i is the index of the data point in the window. In , i is used to traverse all data points in the window to calculate the sum of weights; Represents the index of the data point k moments before the current moment n; and It represents the distance between each data point index in the window and the mean of the Gaussian distribution;

[0076] Step 162: The filtered output signal Processing is performed to obtain processed data.

[0077] In an embodiment of the present invention, a Gaussian weighted moving average filter can effectively suppress random noise in the data. Due to the use of Gaussian weights, the filter gives higher weights to data points near the center of the window, and gives lower weights to data points far from the center. This weighting method helps to smooth the data, while reducing the interference of noise on the signal, making the processed data more accurate and reliable. Through filtering, mutations and outliers in the original data are smoothed, making it easier to observe the overall trend and law of the data. The signal-to-noise ratio of the filtered data is improved, that is, the ratio of useful signals to noise increases. This helps in subsequent data analysis and processing, making it easier to extract useful information from the data. The original data may have large fluctuations due to various factors (such as sensor errors, environmental interference, etc.). Through Gaussian weighted moving average filtering, this fluctuation can be reduced, making the data more stable. Compared with the traditional simple moving average filter, the Gaussian weighted moving average filter can better retain the local characteristics of the data. Due to the introduction of Gaussian weights, the filter can more accurately reflect the relative importance of data points while smoothing the data.

[0078] In a preferred embodiment of the present invention, the above step 162 is to filter the output signal Processing to obtain processed data may include:

[0079] Step 1621, the filtered output signal pass Processing to obtain processed data;

[0080] in, , W represents the size of the sliding window, which is a positive integer; Used to represent any moment in the sliding window The signal value of is the local mean at time n; is an index variable; The value range is from to n; is the starting time of the sliding window.

[0081] In an embodiment of the present invention, the method converts the filtered signal into a standard score by subtracting the local mean and dividing by the local standard deviation. The advantage of this is that the processed data will have zero mean and unit variance, making the data at different time points comparable, which is convenient for further data analysis and processing. By calculating the local mean and standard deviation within the sliding window, the method can remove local trends and seasonal changes in the data, thereby more accurately revealing the fluctuations of the data. The standardized data is more sensitive to the detection of outliers. Because the data is converted to a standard score, those points far from the mean (i.e., outliers) will be more easily identified. The original data may have different dimensions and value ranges, which may affect the results of the data analysis. Through standardization, this dimensional difference can be eliminated, making the comparison between different features or variables more fair and accurate.

[0082] In a preferred embodiment of the present invention, the above step 16, extracting key features based on the processed data, may also include:

[0083] Step 163, dividing the continuous processing data into data segments;

[0084] Step 164, for each data segment, identify pedestrian targets and track the movement trajectory of pedestrians; calculate the displacement of pedestrians between adjacent frames according to the movement trajectory of pedestrians, and calculate the instantaneous speed of pedestrians according to the time difference between adjacent frames; average the instantaneous speeds of all pedestrians in the data segment to obtain the average speed of pedestrians in the corresponding data segment; for each pedestrian, calculate the difference between the departure timestamp and the entry timestamp, and average the pedestrian passing time in all data segments to obtain the average passing time of the corresponding data segment;

[0085] Step 165 , extracting key features based on the pedestrian's moving trajectory, the pedestrian's instantaneous speed, the pedestrian's average speed, and the average passing time.

[0086] In an embodiment of the present invention, by dividing the continuous processing data into data segments, the pedestrian activities in each time period can be analyzed more finely, which helps to discover the characteristics and patterns of pedestrian activities in different time periods. By identifying pedestrian targets and tracking the movement trajectories of pedestrians, the activity patterns of pedestrians in the zebra crossing area can be understood more accurately. The instantaneous speed, average speed and average passing time of pedestrians are calculated. These quantitative indicators can more intuitively reflect the activity status of pedestrians. These indicators not only help to evaluate the traffic efficiency of zebra crossing areas. Based on the extracted key features, the traffic management department can formulate more targeted measures, such as adjusting the timing of traffic lights, optimizing the layout of zebra crossings, etc., to improve traffic efficiency and safety.

[0087] In a preferred embodiment of the present invention, the above step 163 of dividing the continuous processed data into data segments may include:

[0088] Step 1631, traverse the continuous processing data, determine the signal strength at each time point, and perform spectrum analysis on the continuous processing data to identify the frequency components in the continuous processing data; identify the stable interval in the continuous processing data, and calculate the duration of the stable interval;

[0089] Step 1632, combining the signal strength at each time point, the frequency components in the processed data, and the duration of the stable interval into a feature vector, wherein each time point or data segment corresponds to one feature vector;

[0090] Step 1633, determining the number of clusters K, and randomly determining K points as initial cluster centers, may include: determining the corresponding number of clusters K by calculating the silhouette coefficient, and randomly selecting K points from the continuous processing data as the initial cluster centers;

[0091] Step 1634, assigning each point in the continuous processing data to a corresponding cluster center to form K groups, specifically including: for each point in the continuous processing data, calculating the distance (such as Euclidean distance) between it and the K cluster centers; assigning each point to the cluster center with the closest distance, thereby forming K groups;

[0092] Step 1635, recalculate the center point of each group, repeat the operation until the preset number of iterations is reached to obtain the clustering result, specifically including: for each group, calculate the average or median of all points within it as the new cluster center, use the new cluster center, repeat step 1634, that is, reallocate each point to the nearest cluster center, and continue this process until the preset number of iterations is reached, indicating that the clustering has stabilized;

[0093] Step 1636, assigning each point in the continuous processed data to a corresponding group according to the clustering results, specifically including: after the iteration, each point will be assigned to a final group, which are more compact and separated, representing different patterns and structures in the data;

[0094] Step 1637, identifying the points where groups change in the continuously processed data to determine the data segments, specifically includes: traversing each point of the continuously processed data to check whether its group affiliation has changed; for example, if a point belongs to group A at time point t and belongs to group B at time point t+1, then this point is a point where groups change; according to the points where groups change, the continuously processed data is divided into different data segments, and the points in each data segment should belong to the same group and represent a specific data pattern or behavior.

[0095] In an embodiment of the present invention, by comprehensively considering the signal strength, frequency components and duration of the stable interval, different characteristic areas in the data can be more accurately identified, thereby achieving more accurate data segmentation. By identifying the frequency components through spectral analysis, the inherent structure and periodic characteristics of the data can be better understood. At the same time, identifying the stable interval helps to understand the stability of the data in different time periods. Using clustering algorithms for data segmentation can realize the automation of the process and reduce human intervention, thereby improving the efficiency and objectivity of data processing. By setting different numbers of clusters K, the granularity of data segmentation can be flexibly adjusted to meet different analysis requirements. The data segments obtained through this process can more truly reflect the inherent structure and characteristics of the data, thereby improving the accuracy and reliability of subsequent analysis. For example, by analyzing the characteristics of pedestrian activities in different data segments, the control strategy of traffic lights can be optimized to improve the efficiency and safety of urban traffic.

[0096] The above step 1631 specifically includes:

[0097] Determine the continuous processing data, which is a signal sequence sorted by time points, set a sliding window for local analysis on the data; start from the starting point of the processing data, traverse each time point one by one, and record the signal strength value at each time point; in each sliding window, apply spectrum analysis methods (such as fast Fourier transform FFT) to identify the frequency components in the data. Through spectrum analysis, the main frequency components and amplitudes of the data in the window can be obtained, for example:

[0098] Select data in a sliding window from the continuously processed data, apply the FFT algorithm to the data in the sliding window to convert the time domain signal into a frequency domain signal. The result obtained by FFT calculation is a set of complex numbers, whose modulus represents the amplitude of the corresponding frequency component, and the phase angle represents the phase information. Extract the modulus of the FFT result to form a spectrum; the horizontal axis of the spectrum represents the frequency, and the vertical axis represents the amplitude; in the obtained spectrum, look for peaks with larger amplitudes. The frequencies corresponding to these peaks are the main frequency components in the data, and record each main frequency component and its corresponding amplitude value; move the sliding window forward by a certain step size, and then repeat the above steps to perform spectrum analysis on the data in the new window. By continuously moving the sliding window and repeating the analysis, the frequency component information of different time periods in the continuously processed data can be obtained;

[0099] Define a stability threshold and a duration threshold. During the traversal process, compare the changes in signal strength at adjacent time points. If the change in signal strength is lower than the stability threshold, these time points are considered to belong to the same stable interval. Continue traversing until the change in signal strength exceeds the stability threshold. At this time, mark the end of the stable interval and record the duration of the stable interval (i.e., the difference between the end time point and the start time point). Record the signal strength value at each time point, record the main frequency components and their amplitudes in each sliding window, record the start time, end time, and duration of each identified stable interval, and end this step when all processed data have been traversed. By executing the above-mentioned concrete step 1631, the signal strength at each time point, the frequency component information in the data, and the position and duration of the stable interval can be obtained.

[0100] The above step 1632 specifically includes:

[0101] For each time point or data segment, a feature vector will be constructed, which will contain the following information:

[0102] The signal strength value at the time point, the main frequency components identified in the sliding window at the time point (the first few frequencies with the largest amplitude can be selected), the amplitude value of the main frequency components, if the time point is in a stable interval, it includes the duration of the stable interval; if it is not in the stable interval, this value can be set to 0 or a specific mark. For example, the frequency components can be sorted from large to small according to the amplitude, or the first N frequencies with the largest amplitudes can be fixedly selected. For signal strength and frequency amplitude, normalization is performed to ensure that they are on the same scale. If the feature vector is constructed based on the time point, each time point will correspond to a feature vector. If the feature vector is constructed based on the data segment (such as the stable interval), all time points in the data segment need to be summarized or averaged to form a feature vector representing the data segment.

[0103] In a preferred embodiment of the present invention, the above step 164, for each data segment, identifying a pedestrian target and tracking the moving trajectory of the pedestrian, includes:

[0104] Step 1641, preprocessing each frame of the image, extracting a foreground target by comparing each preprocessed frame of the image with a preset background model; performing morphological operations on the extracted foreground target to obtain a coherent foreground target image; analyzing the features of the coherent foreground target image to identify a pedestrian target;

[0105] Step 1642, associate the pedestrian targets in the consecutive frames to obtain associated target positions; and generate the movement trajectory of the pedestrian according to the associated target positions.

[0106] In an embodiment of the present invention, by preprocessing each frame of image and comparing it with a preset background model, the foreground target, i.e., pedestrian, can be extracted more effectively. This method can reduce the interference of background noise, thereby improving the accuracy of pedestrian target recognition. By performing morphological operations on the extracted foreground target, a more coherent foreground target image can be obtained, which helps to reduce false detection and missed detection in the subsequent pedestrian recognition process and improve the stability and reliability of recognition. By analyzing the features of the coherent foreground target image, the pedestrian target can be identified more accurately. This feature-based recognition method not only improves the accuracy of recognition, but also improves the recognition efficiency to a certain extent, because feature analysis is usually faster than pixel-by-pixel comparison. By associating pedestrian targets in consecutive frames, the associated target positions can be obtained, thereby generating the movement trajectory of pedestrians. This tracking method can track the movement of pedestrians in real time and accurately.

[0107] In another preferred embodiment of the present invention, the above step 1641 may include:

[0108] Preprocess each frame of the image, including denoising, contrast enhancement, color correction and other operations, to improve image quality and reduce the complexity of subsequent processing. Select a period of time from the surveillance video to ensure that there are no dynamic targets (such as pedestrians, vehicles, etc.) in the scene during this period, only static background. This period of time can be from a few seconds to a few minutes, depending on the stability of the scene and the change of lighting conditions; for each pixel position in the video ( x , y ), initialize a background model. In this case, the background model is an average pixel value, denoted by B ( x , y ); Initially, you can B ( x , y ) is set to a default value, such as 0 or the corresponding pixel value of the first frame in the video sequence; traverse each frame in the video sequence without dynamic targets, and for each pixel position ( x , y ), get the pixel value of the current frame I t ( x , y ); using an accumulator S ( x , y ) to record the cumulative sum of pixel values, and a counter C ( x , y ) to record the cumulative number of times.

[0109] Update accumulator: S( x ,y )=S( x , y )+ I t ( x , y );

[0110] Update counter: C( x , y )=C( x , y )+1;

[0111] Calculate the new background model (average pixel value): B( x , y )=S( x , y ) / C( x , y ).

[0112] After a period of updating (multi-frame iterations), the background model B( x , y ) will gradually stabilize and be able to represent scenes without dynamic targets.

[0113] For a new video frame (which may contain dynamic objects), iterate over each pixel position again ( x , y ).

[0114] Get the pixel value of the current frame ; Calculate the difference between the current pixel value and the background model, for example using the absolute difference: . Set a threshold T, if , then the pixel is marked as a foreground pixel; in this way, areas that do not match the background model can be extracted, which usually correspond to dynamically changing objects such as pedestrians, vehicles, etc.

[0115] Select a suitable structural element according to the size and shape of the foreground target. For example, you can select a 3×3 or 5×5 square structural element; apply a dilation operation to the extracted foreground pixel image. The dilation operation will merge all background pixels overlapping with the structural element into the foreground, thereby expanding the area of ​​the foreground target. You can use the dilate function in image processing libraries such as OpenCV to implement the dilation operation. After the dilation operation, the originally broken or small foreground target area will become more coherent and obvious, so that a more complete and coherent foreground target image can be obtained.

[0116] In the coherent foreground target images, feature extraction is performed on each foreground target. The features that can be extracted include shape, size, contour, texture, etc. For example, the findContours function in OpenCV can be used to find the contour of the foreground target and calculate its area, perimeter, aspect ratio, etc. A series of features are extracted from the data set, including the aspect ratio, area, complexity of the contour (such as the number of contour points), speed (if the video sequence provides time information), etc. of the target; By observing and analyzing the pedestrian targets in the data set, a series of rules and thresholds are determined. For example, the aspect ratio of pedestrians is usually within a certain range (such as between 0.4 and 1.2), and the area is not too small or too large, etc. A threshold is set for each feature. The threshold can be obtained by statistically analyzing the data set, such as calculating the feature distribution of pedestrians and non-pedestrian targets and finding the corresponding segmentation points; For each coherent foreground target detected in the video frame, the same features are extracted and compared with the previously set thresholds. For example, if the aspect ratio of the target is within the set range of pedestrian aspect ratios and the area also meets the expected size of a pedestrian, the target can be preliminarily judged to be a pedestrian. If a target simultaneously meets multiple conditions such as aspect ratio, area and contour complexity, it is more likely to be judged as a pedestrian. Based on the results of the rule judgment, each foreground target is marked as a pedestrian or non-pedestrian.

[0117] In another preferred embodiment of the present invention, the above step 1642 may include:

[0118] For each pedestrian target detected in the current frame, first extract its features. These features can include:

[0119] Position: The coordinates of the center point of the object or the upper left and lower right corners of the bounding box.

[0120] Size: The width and height of the object, or the area of ​​its bounding box.

[0121] Shape: The shape of an object can be described by calculating the aspect ratio of its bounding box.

[0122] Speed: If there is enough temporal information between video frames, it is possible to estimate the speed at which an object moves between consecutive frames.

[0123] Use the intersection-over-union (IoU) matching algorithm to match the target in the current frame with the tracked target in the previous frame, and calculate the IoU value between each target bounding box in the current frame and each tracked target bounding box in the previous frame; set an IoU threshold (such as 0.5), and only when the IoU value exceeds this threshold, the two targets are considered matched. For each target in the current frame, find the tracked target with the highest IoU value. If the IoU value exceeds the threshold, they are considered as a pair of matching pairs; for successfully associated target pairs:

[0124] Update the position, size, and shape information of the tracked target to the information of the matching target in the current frame. According to the position change between consecutive frames, update the speed and movement direction of the target, and add the new position information to the trajectory of the target.

[0125] For new targets in the current frame that could not be associated:

[0126] Initialize a new tracker, including setting the initial position, size, shape and other features, assign a new track ID to the new target, and add it to the tracking target list. For targets that existed in the previous frame but could not be associated in the current frame, mark the target as temporarily lost and retain its tracking information. If the target still cannot be associated in multiple consecutive frames (such as 3 or 5 frames), it is considered to have disappeared. Once it is determined that the target has disappeared, remove the target from the tracking target list and terminate its track.

[0127] For each continuously tracked target, add the position information of the current frame to its trajectory. The trajectory can be represented as a list or array, where each element represents the position (coordinates) and timestamp of the target in a specific frame. As the video plays, the above steps are repeated to continuously track and update the trajectory of each pedestrian target.

[0128] In another preferred embodiment of the present invention, the above step 164 may further include:

[0129] For each pedestrian, determine the position of the pedestrian between adjacent frames based on its movement trajectory, and calculate the displacement of the pedestrian between adjacent frames. This can be done by calculating the distance between two positions, for example, using the Euclidean distance formula; get the time difference between adjacent frames. If the frame rate of the video is known, the time difference can be calculated by the inverse of the frame rate. For example, if the frame rate is 30fps, the time difference between adjacent frames is 1 / 30 second. Use the displacement divided by the time difference to calculate the instantaneous speed of the pedestrian between adjacent frames.

[0130] In a data segment, the instantaneous speeds of all pedestrians are summed up, and the summed total instantaneous speeds are divided by the number of pedestrians to obtain the average speed of pedestrians in the data segment; for each pedestrian, the timestamp of entering the monitoring area (entry timestamp) and the timestamp of leaving the monitoring area (exit timestamp) are recorded; the passing time of each pedestrian is calculated, that is, the difference between the leaving timestamp and the entering timestamp. In a data segment, the passing time of all pedestrians is summed up, and the summed total passing time is divided by the number of pedestrians to obtain the average passing time of the data segment.

[0131] In another preferred embodiment of the present invention, in the above step 165, the key features may include trajectory features, speed features and time features; the trajectory features include trajectory length and trajectory complexity:

[0132] The total length of each pedestrian's moving trajectory is calculated to reflect the distance the pedestrian has moved in the monitoring area, that is, the trajectory length; the complexity of the trajectory is evaluated by calculating the curvature of the trajectory, the number of corners, or the frequency of direction changes. Speed ​​characteristics include maximum instantaneous speed, average instantaneous speed, and speed fluctuation. The maximum instantaneous speed reflects the fastest movement ability of the pedestrian, and the average instantaneous speed can more carefully describe the movement state of the pedestrian; the standard deviation or coefficient of variation of the instantaneous speed is calculated to evaluate the stability of the pedestrian's moving speed. Time characteristics include average passing time and standard deviation and the number and duration of stop points.

[0133] In another preferred embodiment of the present invention, the above step 17 may include:

[0134] Step 171, receiving the pedestrian data processed in step 16 in real time, which includes key information such as the pedestrian's position, speed, and movement trajectory.

[0135] Step 172: Compare the received pedestrian location information with the preset zebra crossing area boundary. If the pedestrian's location coordinates fall within the zebra crossing area, or if the pedestrian's movement trajectory predicts that the pedestrian is about to enter the zebra crossing area (for example, the pedestrian's movement direction is toward the zebra crossing and the distance is close enough), it is determined that the pedestrian has entered the zebra crossing area.

[0136] Step 173: Once a pedestrian is detected entering the zebra crossing area, the system immediately prepares a warning message, which may include a basic text description (such as "watch out for pedestrians"), the location information of the pedestrian, a timestamp, and the like.

[0137] Step 174, through a wireless communication module (such as Wi-Fi, Bluetooth, LoRa, 4G / 5G, etc.), the prepared warning information is sent in real time to nearby display devices (such as traffic lights, roadside display screens, vehicle display screens, etc.) or related applications (such as navigation applications, traffic management apps, etc.), effectively improving the safety of road traffic.

[0138] like Figure 2 As shown, an embodiment of the present invention further provides a zebra crossing pedestrian safety warning device 20, comprising:

[0139] The acquisition module 21 is used to define a gene encoding scheme for representing the position and angle of the sensor; randomly generate an initial population, in which each individual is a sensor layout and angle configuration randomly generated according to the gene encoding scheme; determine a fitness function for evaluating the advantages and disadvantages of each sensor layout and angle configuration;

[0140] The processing module 22 is used to determine the corresponding individuals to enter the next generation according to the fitness function, randomly pair the determined individuals, and perform crossover operations to generate new individuals; perform mutation operations on the newly generated individuals until a preset number of iterations is reached to obtain the final individuals; determine the final sensor layout and angle according to the final individuals; install sensors according to the final sensor layout and angle so that the sensors can monitor the pedestrian activity data in the zebra crossing area in real time; process the pedestrian activity data to obtain processed data, and extract key features based on the processed data; based on the key features, when a pedestrian is detected entering the zebra crossing area, the information of the pedestrian entering the zebra crossing area is sent to the display device in real time through wireless communication to warn the driver.

[0141] It should be noted that the device is a device corresponding to the above method, and all implementation methods in the above method embodiment are applicable to this embodiment and can achieve the same technical effect.

[0142] The embodiment of the present invention further provides a computing device, comprising: a processor, a memory storing a computer program, wherein when the computer program is executed by the processor, the method described above is executed. All implementations in the above method embodiment are applicable to this embodiment and can achieve the same technical effect.

[0143] The embodiment of the present invention also provides a computer-readable storage medium storing instructions, which, when executed on a computer, enable the computer to execute the method described above. All implementations in the above method embodiment are applicable to this embodiment and can achieve the same technical effect.

Claims

1. A zebra crossing pedestrian safety warning method, characterized in that: The method comprises: Define a genetic encoding scheme to represent the position and angle of the sensor; An initial population is randomly generated, where each individual has a randomly generated sensor layout and angle configuration according to a genetic encoding scheme; Determine the fitness function used to evaluate the merits of each sensor layout and angle configuration; According to the fitness function, the corresponding individuals are determined to enter the next generation, the determined individuals are randomly paired, and a crossover operation is performed to generate new individuals; the newly generated individuals are mutated until the preset number of iterations is reached to obtain the final individuals; based on the final individuals, the final sensor layout and angle are determined; Install sensors according to the final sensor layout and angles so that the sensors can monitor pedestrian activity data in the zebra crossing area in real time; Processing the pedestrian activity data to obtain processed data, and extracting key features based on the processed data, the key features including trajectory features, speed features and time features; According to the key features, when a pedestrian is detected entering the zebra crossing area, the information of the pedestrian entering the zebra crossing area is sent to the display device in real time through wireless communication to warn the driver; The calculation formula of the fitness function is: ; in, Indicates the number of pedestrians that are actually detected correctly; Indicates the number of actual non-pedestrians but incorrectly detected as pedestrians; Indicates the number of actual non-pedestrians that are not falsely detected; Indicates the number of pedestrians that are not detected. , , and They are the weight coefficients of coverage, false alarm rate, missed alarm rate and accuracy; , , and Represents weight.

2. A zebra crossing pedestrian safety warning method according to claim 1, characterized in that: Processing the pedestrian activity data to obtain processed data includes: The pedestrian activity data is processed by Performing filtering to obtain filtered data; in, represents the output signal after filtering, indicating the filtering result at the current time n; N represents the window size of the moving average, indicating the number of data points considered when calculating the current filtering result; represents the mean of the Gaussian weights, located at the center of the window; represents the standard deviation of Gaussian weights; represents the original input signal, which represents the data point k moments before the current moment n; b represents the bias term, n is the index of the current moment; k is the index of the data point in the window, which varies from 0 to N-1, in the summation symbol In the summation symbol, k is used to traverse all data points in the window; i is the index of the data point in the window. In , i is used to traverse all data points in the window to calculate the sum of weights; Represents the index of the data point k moments before the current moment n; and It represents the distance between each data point index in the window and the mean of the Gaussian distribution; The filtered output signal Processing is performed to obtain processed data.

3. A zebra crossing pedestrian safety warning method according to claim 2, characterized in that: The filtered output signal Processing to obtain processed data, including: The filtered output signal pass Processing to obtain processed data; in, , W represents the size of the sliding window, which is a positive integer; Used to represent any moment in the sliding window The signal value of is the local mean at time n; is an index variable; The value range is from to n; is the starting time of the sliding window.

4. A zebra crossing pedestrian safety warning method according to claim 3, characterized in that: Based on the processed data, key features are extracted, including: Splitting continuous processing data into data segments; For each data segment, pedestrian targets are identified and their moving trajectories are tracked; based on the moving trajectories of pedestrians, the displacement of pedestrians between adjacent frames is calculated, and based on the time difference between adjacent frames, the instantaneous speed of pedestrians is calculated; the instantaneous speeds of all pedestrians in the data segment are averaged to obtain the average speed of pedestrians in the corresponding data segment; for each pedestrian, the difference between its leaving timestamp and entering timestamp is calculated, and the passing time of pedestrians in all data segments is averaged to obtain the average passing time of the corresponding data segment; Key features are extracted based on the pedestrian's moving trajectory, pedestrian's instantaneous speed, pedestrian's average speed and average passing time.

5. A zebra crossing pedestrian safety warning method according to claim 4, characterized in that: Split the continuous processing data into data segments, including: traversing the continuous processing data, determining the signal strength at each time point, and performing spectrum analysis on the continuous processing data to identify frequency components in the continuous processing data; identifying stable intervals in the continuous processing data, and calculating the duration of the stable intervals; The signal strength at each time point, the frequency components in the processed data, and the duration of the stable interval are combined into a feature vector, with each time point or data segment corresponding to one feature vector; Determine the number of clusters K, and randomly determine K points as the initial cluster centers; Assign each point in the continuous processing data to the corresponding cluster center to form K groups; Recalculate the center point of each group and repeat the operation until the preset number of iterations is reached to obtain the clustering result; According to the clustering results, each point in the continuous processing data is assigned to the corresponding group; Points where groups change are identified in the continuous processing data to determine data segments.

6. A zebra crossing pedestrian safety warning method according to claim 5, characterized in that: For each data segment, pedestrian targets are identified and their movement trajectories are tracked, including: Preprocess each frame of the image, and extract the foreground target by comparing each preprocessed image with a preset background model; perform morphological operations on the extracted foreground target to obtain a coherent foreground target image; analyze the features of the coherent foreground target image to identify pedestrian targets; Pedestrian targets in consecutive frames are associated to obtain associated target positions; and the movement trajectory of the pedestrian is generated according to the associated target positions.

7. A zebra crossing pedestrian safety warning device, characterized in that: Applied to the method according to any one of claims 1 to 6, comprising: An acquisition module is used to define a gene encoding scheme for representing the position and angle of the sensor; randomly generate an initial population, in which each individual is a sensor layout and angle configuration randomly generated according to the gene encoding scheme; determine a fitness function for evaluating the quality of each sensor layout and angle configuration; The processing module is used to determine the corresponding individuals to enter the next generation according to the fitness function, randomly pair the determined individuals, and perform crossover operations to generate new individuals; perform mutation operations on the newly generated individuals until a preset number of iterations is reached to obtain the final individuals; determine the final sensor layout and angle according to the final individuals; install sensors according to the final sensor layout and angle so that the sensors can monitor the pedestrian activity data in the zebra crossing area in real time; process the pedestrian activity data to obtain processed data, and extract key features based on the processed data; based on the key features, when a pedestrian is detected entering the zebra crossing area, the information of the pedestrian entering the zebra crossing area is sent to the display device in real time through wireless communication to warn the driver.

8. A computing device, characterized in that include: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the method as claimed in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program, which, when executed by a processor, implements the method according to any one of claims 1 to 6.