Traffic video AI intelligent analysis method based on the trusted innovation environment
By applying the intelligent analysis method of traffic video AI in the information and innovation environment, the precise identification and behavior analysis of vehicles and pedestrians is achieved, and the problems of complex accident data processing and the inability to adapt to the smoothing coefficient in the existing technology are solved, which improves traffic management Accuracy and response speed.
Patent Information
- Application Number
- CN202411689954.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2044-11-25
AI Technical Summary
The prior art has complicated steps when processing accident data, which is easy to introduce errors, and the fixed smoothing coefficient cannot adapt to the prediction of dynamic traffic data, affecting the accuracy of traffic management.
Adopt traffic video AI intelligent analysis method based on the information and innovation environment, and accurately identify and classify vehicles, pedestrians, etc., analyze the behavioral patterns and movement trajectories of traffic participants, promptly discover potential traffic accident risks, and take preventive measures to adjust them. The traffic flow and signal lights are matched to alleviate traffic congestion.
It improves the response speed to emergencies, reduces the demand for manual monitoring, reduces the false alarm rate, improves system reliability, optimizes traffic management, improves road traffic efficiency, and provides a basis for urban traffic planning.
Smart Images

Figure CN119181248B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent transportation technology, and in particular to an AI intelligent analysis method for traffic videos based on a trusted innovation environment. Background Art
[0002] Traditional traffic monitoring methods can no longer meet the needs of efficient and accurate management. Regarding traffic data analysis, the patent application with publication number: CN113570846B discloses a traffic warning situation analysis and judgment method, equipment and readable storage medium, including the following steps: S1. Obtain traffic data, S2. Clean the traffic data and remove abnormal data; S3. Use the TLBO algorithm to improve the FCM clustering algorithm; S4. Use the improved FCM clustering algorithm to calculate the fuzzy level interval division result of the traffic flow speed; S5. Establish the number of multi-attribute intervals for the police situation analysis and judgment decision; S6. Calculate the weight of the police situation analysis and judgment index; S7. Calculate the comprehensive analysis and judgment index of the police situation. Through the detectors on the urban roads and the mobile police terminals, the data related to the traffic flow, weather, accidents, etc. are obtained, and the current police situation of the urban roads is analyzed to form a judgment result with practical guiding significance.
[0003] Although the above patent improves the proactive prevention and control capabilities of urban road traffic management, the processing of accident data involves multiple steps, which is relatively complex and prone to errors, affecting the accuracy of traffic participant identification. In addition, the fixed smoothing coefficient cannot adapt to the prediction of dynamic traffic data. Summary of the invention
[0004] The purpose of the present invention is to provide an AI intelligent analysis method for traffic videos based on a trusted computing environment. By accurately identifying and classifying vehicles, pedestrians, etc., analyzing the behavior patterns and movement trajectories of traffic participants, potential traffic accident risks can be discovered in a timely manner, and preventive measures can be taken, thereby improving the response speed to emergencies, adjusting traffic flow and signal light timing according to prediction results, effectively alleviating traffic congestion, improving road traffic efficiency, providing a basis for urban traffic planning, and improving the rationality of urban planning, so as to solve the problems raised in the above-mentioned background technology.
[0005] To achieve the above object, the present invention provides the following technical solutions:
[0006] The traffic video AI intelligent analysis method based on the trusted innovation environment includes the following steps:
[0007] Step 1: Traffic video collection and processing: Based on the cameras installed at the main traffic routes, the traffic video data is collected in real time, and the collected traffic video data is pre-processed, and the pre-processed traffic video data is frame-processed;
[0008] Among them, the collected traffic video data is preprocessed, including:
[0009] The traffic video data is segmented according to a preset unit time length to obtain videos corresponding to a plurality of unit time lengths; wherein the value range of the unit time length is 10s-30s;
[0010] Perform frame processing on the video corresponding to each unit time length to obtain a frame image group contained in each unit time length;
[0011] Obtaining a gray balance index coefficient for each frame image in each frame image group;
[0012] The gray balance index coefficient is obtained by the following formula:
[0013] ;
[0014] Where K represents the gray balance index coefficient; n represents the number of pixels contained in each frame image; H i Indicates the gray value corresponding to the i-th pixel of each frame image; H i-1 Indicates the gray value corresponding to the i-1th pixel of each frame image; H z Indicates the grayscale median value of each frame image; H m Indicates the maximum value of the grayscale intermediate values of all frame images contained in each frame image group; H mp represents the average value of the grayscale intermediate values of all frame images contained in each frame image group; m represents the number of frame images contained in each frame image group; H bj represents the grayscale standard deviation of the jth frame image in each frame image group; H bj-1 Represents the grayscale standard deviation of the j-1th frame image in each frame image group;
[0015] The frame image corresponding to the maximum value of the gray balance index coefficient in each frame image group is used as the target frame image;
[0016] Using the target frame image corresponding to each frame image group, the contrast of the collected traffic video data is adjusted;
[0017] Step 2: Target detection and recognition: Target detection is performed on each frame of image data based on the frame processing results, the identified target analysis objects are classified based on the target detection results, and the feature information of each type of target analysis object is extracted;
[0018] Step 3: Traffic prediction and dispatch: Analyze the key indicators of traffic prediction in the monitoring area based on the characteristic information of each type of target analysis object, establish a traffic prediction model, predict the traffic conditions in the monitoring area in the future, and match the corresponding dispatch plan according to the prediction results;
[0019] Step 4: Behavior analysis and abnormal alarm: Based on the time series of each frame of image data, the identified target analysis object is analyzed in combination with the traffic condition prediction results, and abnormal behavior detection is performed on the target analysis object based on the analysis results. When abnormal behavior is detected, the alarm mechanism is triggered immediately.
[0020] Furthermore, contrast adjustment is performed on the collected traffic video data using the target frame image corresponding to each frame image group, including:
[0021] Extract the target frame image corresponding to each frame image group and its corresponding gray balance index coefficient;
[0022] Obtaining a first contrast adjustment coefficient using the gray balance index coefficient corresponding to each of the target frame images;
[0023] The first contrast adjustment coefficient is obtained by the following formula:
[0024] ;
[0025] Among them, J 01 represents the first contrast adjustment coefficient; k represents the total number of frame image groups; K i represents the gray balance index coefficient corresponding to the i-th frame image group; K c Indicates the preset gray balance index coefficient reference value; K p K represents the average value of the gray balance index coefficient corresponding to the k-group frame image group; z K represents the middle value of the gray balance index coefficient corresponding to the k-group frame image group; b Indicates the standard deviation of the gray balance index coefficient corresponding to the k-group frame image group;
[0026] The contrast of the collected traffic video data is adjusted by using the first contrast adjustment coefficient in combination with the central grayscale value corresponding to each of the target frame images.
[0027] Further, the contrast of the collected traffic video data is adjusted by using the first contrast adjustment coefficient in combination with the central grayscale value corresponding to each of the target frame images, including:
[0028] Extracting the central grayscale value corresponding to each of the target frame images;
[0029] Obtaining a second contrast adjustment coefficient using the central grayscale value corresponding to each of the target frame images;
[0030] The second contrast adjustment coefficient is obtained by the following formula:
[0031] ;
[0032] Among them, J 02 represents the second contrast adjustment coefficient; k represents the total number of frame image groups; H fi represents the central gray value corresponding to the target frame image of the i-th frame image group; H fi-1 represents the central gray value corresponding to the target frame image of the i-1th frame image group; H fb H represents the middle value of the central grayscale value corresponding to the k-group frame image group; bp Represents the average grayscale standard deviation corresponding to all frame images;
[0033] Retrieving a first contrast adjustment coefficient;
[0034] The contrast adjustment coefficient of the traffic video data is obtained by using the first contrast adjustment coefficient and the second contrast adjustment coefficient; wherein the contrast adjustment coefficient is obtained by the following formula:
[0035] ;
[0036] Where, J represents the contrast adjustment coefficient; J 01 represents the first contrast adjustment coefficient; J 02 represents the second contrast adjustment coefficient;
[0037] The contrast of the traffic video data is adjusted using the contrast adjustment coefficient to obtain the traffic video data after contrast adjustment, wherein the adjusted contrast is obtained by the following formula:
[0038] ;
[0039] Among them, D t represents the contrast after adjustment; D represents the contrast before adjustment; J represents the contrast adjustment coefficient.
[0040] Furthermore, in the step 1, the pre-processed traffic video data is subjected to frame processing, including:
[0041] Collecting brightness data in the traffic video data, determining a brightness compensation coefficient of the traffic video data according to the brightness data, matching a corresponding brightness compensation function, and performing brightness compensation on the traffic video data based on the brightness compensation function;
[0042] Decompose the traffic video data after brightness compensation into separate frame images, ensuring that each frame image after frame processing has a unique timestamp;
[0043] The frame rate of the framed images is adjusted, and the adjusted images are adjusted to a uniform size and ratio.
[0044] Furthermore, in step 2, target detection is performed on each frame of image data, including:
[0045] Establishing a target detection model, passing each frame of the preprocessed image as input data to the target detection model, the target detection model extracts feature points from the input data, and determines the target position features of each frame of the image according to the extraction results;
[0046] Based on the target position features of each frame image, the target type of the feature points at that position is determined and marked with category labels, the target detection results are output, and the corresponding feature vectors are extracted based on the target detection results.
[0047] Furthermore, in step 2, the identified target analysis objects are classified, including:
[0048] Compare the feature point extraction results of each frame of image, select the target feature points that appear in each frame of image, determine the feature points with high overlap rate in each frame of image comparison, and classify the feature points. Based on the classification results, match them with the feature database one by one to establish the corresponding target analysis object label;
[0049] Among them, the feature database includes vehicle features, pedestrian features and traffic environment features;
[0050] The feature point extraction results of each frame image are used as the model input samples, and the vehicle features, pedestrian features and environmental features are used as model output samples to train the preset network model and establish a feature recognition model corresponding to each feature category.
[0051] Furthermore, the characteristic information of each type of target analysis object is extracted, specifically:
[0052] Using the feature recognition model corresponding to each feature category to obtain each target analysis object in each frame of the image, and obtaining feature information of each target analysis object according to the feature vector of each target analysis object;
[0053] Analyzing the changes in the characteristic information of each target analysis object in the continuous frames, and determining the dynamic behavior rules of each target analysis object according to the changes;
[0054] The target analysis objects whose dynamic behavior rule similarity is greater than or equal to a preset threshold are confirmed as target analysis objects of the same type, and the feature information of any target analysis object in each type of target analysis object is confirmed as the final feature information of the target analysis object of that type.
[0055] Furthermore, the traffic prediction and scheduling in step 3 are specifically as follows:
[0056] The extracted characteristic information of each type of target analysis object is integrated to form a unified data set, and traffic data corresponding to the impact on traffic prediction is extracted from the data set;
[0057] Obtain historical traffic data to train the constructed traffic prediction model, use the trained traffic prediction model to predict traffic conditions in the future and output key indicators;
[0058] At the same time, according to the forecast results, formulate corresponding traffic dispatch plan.
[0059] Furthermore, in step 4, the identified target analysis object is subjected to behavioral analysis, specifically:
[0060] Screening each frame of the image based on the feature point extraction result of the target analysis object, and acquiring image data in which the target analysis object appears based on the screening result;
[0061] Arrange the image data based on the time series of the timestamps of the image data to obtain dynamic data of the target analysis object;
[0062] Dividing the dynamic data into a plurality of time data segments, and obtaining the moving position of each target analysis object in each time data segment;
[0063] Obtaining the initial position of the same target analysis object and the moving position corresponding to each time data segment, establishing a moving trajectory, calculating the total moving distance and average moving speed of each target analysis object in the time data segment according to the moving trajectory, and generating the moving features of each target analysis object;
[0064] At the same time, in each time data segment, it is determined whether the target analysis object stays at the same position for more than a preset pause time threshold, and the position and the stay time are recorded to generate a pause feature of the target analysis object;
[0065] Obtaining the target time data segment where the pause feature corresponding to each target analysis object is located, and judging whether there are multiple target analysis objects pausing in the same time period based on the time series of the target time data segment in the dynamic data, and determining the interaction features between the target analysis objects;
[0066] A location feature data set of the target analysis object is established according to the movement feature and interaction feature of each target analysis object, and the behavior pattern of the target analysis object contained in the location feature data set is analyzed.
[0067] Furthermore, abnormal behavior detection is performed on the target analysis object, specifically:
[0068] Establish a baseline model of normal behavior for each type of target analysis object and determine the threshold of normal behavior parameters;
[0069] Comparing the target analysis object behavior pattern with a normal behavior pattern, and comparing the difference between the movement characteristics, pause characteristics, and interaction characteristics included in the current behavior pattern and the normal behavior parameter threshold;
[0070] When the comparison result shows that the characteristics of the behavior pattern of the target analysis object exceed the normal behavior parameter threshold range, it is marked as a potential abnormality;
[0071] Performing abnormal analysis on the behavior marked as potentially abnormal, calculating the abnormal behavior coefficient of the target analysis object, confirming whether the abnormal behavior coefficient is greater than a preset coefficient, and if so, acquiring multiple frames of abnormal behavior image data of the target analysis object based on the abnormal behavior;
[0072] Combined with traffic video data, multiple frames of abnormal behavior image data are manually reviewed. Once abnormal behavior is confirmed, the alarm mechanism is immediately triggered.
[0073] Compared with the prior art, the present invention has the following beneficial effects:
[0074] By collecting and processing traffic video data in real time, accurate identification and classification of traffic participants such as vehicles and pedestrians are achieved, and monitoring efficiency is improved. By analyzing behavior patterns and movement trajectories, traffic conditions are predicted, and abnormal behaviors are automatically detected, alarms are triggered in a timely manner, effectively preventing traffic accidents, optimizing traffic management, reducing the need for manual monitoring, reducing false alarm rates, and improving system reliability. At the same time, it provides data support for traffic planning and infrastructure improvements, promotes the advancement of intelligent transportation systems, ensures traffic safety, and improves road traffic efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] Figure 1 This is a flow chart of the AI intelligent analysis method for traffic videos based on the trusted innovation environment of the present invention. DETAILED DESCRIPTION
[0076] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0077] In order to solve the technical problems in the existing technology that the processing of accident data involves multiple steps, is relatively complex, easily introduces errors, affects the accuracy of traffic participant identification, and the fixed smoothing coefficient cannot adapt to the prediction of dynamic traffic data, please refer to Figure 1 , this embodiment provides the following technical solutions:
[0078] The traffic video AI intelligent analysis method based on the trusted innovation environment includes the following steps:
[0079] Step 1: Traffic video collection and processing: Based on the cameras installed on the main traffic roads, the traffic video data is collected in real time, and the collected traffic video data is pre-processed, and the pre-processed traffic video data is frame-processed, including:
[0080] Collecting brightness data in the traffic video data, determining a brightness compensation coefficient of the traffic video data according to the brightness data, matching a corresponding brightness compensation function, and performing brightness compensation on the traffic video data based on the brightness compensation function;
[0081] Decompose the traffic video data after brightness compensation into separate frame images for subsequent frame-by-frame analysis, and ensure that each frame image after frame processing has a unique timestamp to facilitate time series analysis;
[0082] Adjust the frame rate of the divided images to optimize processing speed and storage requirements, and adjust the adjusted images to a uniform size and ratio;
[0083] Step 2: Target detection and recognition: Target detection is performed on each frame of image data based on the frame processing results to identify target analysis objects such as vehicles, pedestrians, and transportation tools. Based on the target detection results, the identified target analysis objects are classified to distinguish different types of vehicles, pedestrians, traffic environments, etc., and feature information of each type of target analysis object is extracted;
[0084] Step 3: Traffic prediction and dispatch: Based on the characteristic information of each target analysis object, analyze the key indicators of traffic forecast in the monitoring area, such as traffic flow, vehicle speed, congestion, etc., establish a traffic prediction model, predict the traffic conditions in the monitoring area in the future, provide a basis for traffic planning and management, and match the corresponding dispatch plan according to the prediction results, such as optimizing traffic flow, adjusting signal light timing, planning road reconstruction, etc.;
[0085] Step 4: Behavior analysis and abnormal alarm: Based on the time series of each frame of image data, combined with the traffic condition prediction results, the identified target analysis object is subjected to behavioral analysis, and its movement trajectory and behavior pattern are analyzed. Based on the analysis results, abnormal behavior detection is performed on the target analysis object, such as vehicle violations, pedestrians crossing the road, abnormal congestion, traffic accidents, etc. When abnormal behavior is detected, the alarm mechanism is triggered immediately.
[0086] In this embodiment, by real-time collection and processing of traffic video data, vehicles, pedestrians, etc. are accurately identified and classified, and different types of traffic participants are effectively distinguished, which greatly improves the efficiency and accuracy of traffic monitoring, analyzes the behavior patterns and movement trajectories of traffic participants, timely discovers potential traffic accident risks, and takes preventive measures, thereby improving the response speed to emergencies. By establishing a traffic prediction model, traffic flow, vehicle speed, and congestion are predicted in advance, and traffic flow and signal light timing are adjusted according to the prediction results, which effectively alleviates traffic congestion and improves road traffic efficiency. It provides a basis for urban traffic planning, helps to improve transportation infrastructure, improve the rationality of urban planning, reduce the need for manual monitoring, reduce labor costs, and reduce human errors.
[0087] Specifically, the collected traffic video data is preprocessed, including:
[0088] The traffic video data is segmented according to a preset unit time length to obtain videos corresponding to a plurality of unit time lengths; wherein the value range of the unit time length is 10s-30s;
[0089] Perform frame processing on the video corresponding to each unit time length to obtain a frame image group contained in each unit time length;
[0090] Obtaining a gray balance index coefficient for each frame image in each frame image group;
[0091] The gray balance index coefficient is obtained by the following formula:
[0092] ;
[0093] Where K represents the gray balance index coefficient; n represents the number of pixels contained in each frame image; H i Indicates the gray value corresponding to the i-th pixel of each frame image; H i-1 Indicates the gray value corresponding to the i-1th pixel of each frame image; H z Indicates the grayscale median value of each frame image; H m Indicates the maximum value of the grayscale intermediate values of all frame images contained in each frame image group; Hmp represents the average value of the grayscale intermediate values of all frame images contained in each frame image group; m represents the number of frame images contained in each frame image group; H bj represents the grayscale standard deviation of the jth frame image in each frame image group; H bj-1 Represents the grayscale standard deviation of the j-1th frame image in each frame image group;
[0094] The frame image corresponding to the maximum value of the gray balance index coefficient in each frame image group is used as the target frame image;
[0095] The target frame image corresponding to each frame image group is used to perform contrast adjustment on the collected traffic video data.
[0096] The technical effect of the above technical solution is: by segmenting the traffic video data according to the preset unit time length (10s-30s), the long video data can be divided into multiple small video segments that are easy to process and manage. This helps to reduce the memory usage during data processing, and makes subsequent processing steps (such as frame processing, gray balance analysis, etc.) more efficient. The video corresponding to each unit time length is frame processed to obtain a frame image group, so that the video content can be analyzed frame by frame. This is crucial for capturing subtle changes in traffic scenes (such as changes in vehicle speed, pedestrian behavior, etc.). By calculating the gray balance index coefficient K of each frame image, the gray balance state of the frame image can be quantitatively evaluated. This coefficient comprehensively considers the continuity of the gray value of the pixel point in the frame, the relationship between the gray median value in the frame and the gray median value of the frame group, and the difference in the gray standard deviation between frames, so as to more comprehensively reflect the gray balance characteristics of the frame image. Taking the frame image corresponding to the maximum value of the gray balance index coefficient in each frame image group as the target frame image helps to screen out the frame that best represents the gray balance state of the traffic scene in that time period. This is of great significance for subsequent processing steps such as video contrast adjustment. Using the target frame image corresponding to each frame image group to adjust the contrast of the collected traffic video data can ensure that the adjusted video has a more balanced and comfortable visual effect while maintaining the original scene details. This is of great significance for improving the usability and readability of traffic monitoring videos.
[0097] In summary, this technical solution achieves effective segmentation of traffic video data, acquisition of frame image groups, quantitative evaluation of gray balance status, accurate selection of target frame images, and optimization adjustment of video contrast through sophisticated video data preprocessing steps and innovative gray balance index coefficient calculation method. These technical effects jointly improve the processing efficiency and usability of traffic video data, providing strong support for subsequent traffic monitoring and analysis.
[0098] Specifically, using the target frame image corresponding to each frame image group to adjust the contrast of the collected traffic video data includes:
[0099] Extract the target frame image corresponding to each frame image group and its corresponding gray balance index coefficient;
[0100] Obtaining a first contrast adjustment coefficient using the gray balance index coefficient corresponding to each of the target frame images;
[0101] The first contrast adjustment coefficient is obtained by the following formula:
[0102] ;
[0103] Among them, J 01 represents the first contrast adjustment coefficient; k represents the total number of frame image groups; K i represents the gray balance index coefficient corresponding to the i-th frame image group; K c Indicates the preset gray balance index coefficient reference value; K p K represents the average value of the gray balance index coefficient corresponding to the k-group frame image group; z K represents the middle value of the gray balance index coefficient corresponding to the k-group frame image group; b Indicates the standard deviation of the gray balance index coefficient corresponding to the k-group frame image group;
[0104] The contrast of the collected traffic video data is adjusted by using the first contrast adjustment coefficient in combination with the central grayscale value corresponding to each of the target frame images.
[0105] The technical effect of the above technical solution is: by extracting the target frame image and its gray balance index coefficient corresponding to each frame image group, the solution can perform contrast adjustment based on the most representative frame image (i.e., the frame with the best gray balance state). This ensures that the adjusted video is more in line with the needs of the actual scene in terms of contrast, and avoids detail loss or over-enhancement caused by improper contrast. The first contrast adjustment coefficient is obtained by using the gray balance index coefficient corresponding to the target frame image. This step realizes the dynamic and personalized contrast adjustment. Since the gray balance index coefficient can reflect the gray distribution characteristics of the frame image, the contrast adjustment based on this coefficient can more accurately adapt to the illumination changes and gray differences in different traffic scenes. The calculation formula of the first contrast adjustment coefficient comprehensively considers multiple gray balance indicators, including the total value, average value, median value and standard deviation of the gray balance index coefficient. This comprehensive consideration makes the contrast adjustment more comprehensive and robust, and can cope with various complex traffic scenes. The contrast of the collected traffic video data is adjusted by using the first contrast adjustment coefficient combined with the central gray value corresponding to each target frame image. This step realizes the refinement and localization of the contrast adjustment. By considering the central grayscale value of the target frame image, the scheme can more accurately adjust the contrast of the video, so that the adjusted video can better show the details while maintaining overall consistency. After the above contrast adjustment steps, the contrast of the collected traffic video data will be significantly improved. This helps to improve the clarity and readability of the video, making traffic monitoring and analysis more efficient and accurate. At the same time, the optimized video can also provide better input data for subsequent image processing, feature extraction, and pattern recognition tasks.
[0106] In summary, this technical solution achieves effective contrast optimization of collected traffic video data through precise contrast adjustment steps and dynamic calculation methods. This not only improves the quality and readability of the video, but also provides strong support for subsequent traffic monitoring and analysis work.
[0107] Specifically, using the first contrast adjustment coefficient in combination with the central grayscale value corresponding to each of the target frame images to adjust the contrast of the collected traffic video data includes:
[0108] Extracting the central grayscale value corresponding to each of the target frame images;
[0109] Obtaining a second contrast adjustment coefficient using the central grayscale value corresponding to each of the target frame images;
[0110] The second contrast adjustment coefficient is obtained by the following formula:
[0111] ;
[0112] Among them, J 02 represents the second contrast adjustment coefficient; k represents the total number of frame image groups; H fi represents the central gray value corresponding to the target frame image of the i-th frame image group; H fi-1 represents the central gray value corresponding to the target frame image of the i-1th frame image group; H fb H represents the middle value of the central grayscale value corresponding to the k-group frame image group; bp Represents the average grayscale standard deviation corresponding to all frame images;
[0113] Retrieving a first contrast adjustment coefficient;
[0114] The contrast adjustment coefficient of the traffic video data is obtained by using the first contrast adjustment coefficient and the second contrast adjustment coefficient; wherein the contrast adjustment coefficient is obtained by the following formula:
[0115] ;
[0116] Where, J represents the contrast adjustment coefficient; J 01 represents the first contrast adjustment coefficient; J 02 represents the second contrast adjustment coefficient;
[0117] The contrast of the traffic video data is adjusted using the contrast adjustment coefficient to obtain the traffic video data after contrast adjustment, wherein the adjusted contrast is obtained by the following formula:
[0118] ;
[0119] Among them, D t represents the contrast after adjustment; D represents the contrast before adjustment; J represents the contrast adjustment coefficient.
[0120] The technical effect of the above technical solution is: by extracting the central gray value corresponding to each target frame image and calculating the second contrast adjustment coefficient based on it, the solution realizes the refinement of contrast adjustment. The central gray value is an important indicator reflecting the overall brightness level of the image. The contrast adjustment based on the central gray value can more accurately grasp the overall brightness change of the image, thereby avoiding the problem of over-adjustment or under-adjustment. When calculating the contrast adjustment coefficient, the scheme comprehensively considers the first contrast adjustment coefficient (based on the gray balance index coefficient) and the second contrast adjustment coefficient (based on the central gray value). This comprehensive consideration makes the contrast adjustment more comprehensive and accurate, and can better adapt to the lighting changes and grayscale differences in different traffic scenes. The contrast adjustment coefficient is dynamically calculated based on the grayscale characteristics of each target frame image and the grayscale distribution of the overall video data. This means that the scheme can make adaptive adjustments according to the actual situation of the video content to ensure that the adjusted video is more in line with actual needs in terms of contrast. After the above contrast adjustment steps, the collected traffic video data will be significantly improved in terms of contrast. The adjusted video will be clearer and easier to identify, which is of great significance for traffic monitoring, accident analysis and other work. At the same time, the optimized video can also provide better input data for subsequent image processing, feature extraction, and pattern recognition tasks. The solution enhances the robustness and adaptability of the algorithm by comprehensively considering multiple contrast adjustment factors and using dynamic calculation methods. This enables the solution to cope with various complex traffic scenes and lighting conditions, ensuring that the adjusted video always maintains the best contrast and clarity. The solution enhances the operability and repeatability of the algorithm by formulating the contrast adjustment coefficient and the calculation method of the adjusted contrast. This enables the algorithm to achieve consistent results on different platforms and facilitates subsequent optimization and improvement.
[0121] In summary, this technical solution achieves effective contrast optimization of collected traffic video data through refined contrast adjustment steps, comprehensive consideration of multiple contrast adjustment factors, dynamic contrast adjustment, and formulaic expression. This not only improves the quality and readability of the video, but also enhances the robustness and adaptability of the algorithm, providing strong support for subsequent traffic monitoring and analysis work.
[0122] In this embodiment, in step 2, target detection is performed on each frame of image data, including:
[0123] Establishing a target detection model, passing each frame of the preprocessed image as input data to the target detection model, the target detection model extracts feature points from the input data, and determines the target position features of each frame of the image according to the extraction results;
[0124] Based on the target position features of each frame image, determine the target type of the feature points at that position and mark them with category labels, output the target detection results, including the position coordinates, category labels and confidence scores of each target analysis object, and extract the corresponding feature vector based on the target detection results;
[0125] In this embodiment, in step 2, the identified target analysis objects are classified, including:
[0126] Compare the feature point extraction results of each frame of image, select the target feature points that appear in each frame of image, determine the feature points with high overlap rate in each frame of image comparison, and classify the feature points. Based on the classification results, match them with the feature database one by one to establish the corresponding target analysis object label;
[0127] Among them, the feature database includes vehicle features, pedestrian features and traffic environment features;
[0128] The feature point extraction results of each frame image are used as the model input samples. At the same time, the vehicle features, pedestrian features and environmental features are used as model output samples to train the preset network model, and a feature recognition model corresponding to each feature category is established, thereby realizing the extraction and classification of the feature information of the target analysis object.
[0129] In this embodiment, the characteristic information of each type of target analysis object is extracted, specifically:
[0130] Using the feature recognition model corresponding to each feature category to obtain each target analysis object in each frame of the image, and obtaining feature information of each target analysis object according to the feature vector of each target analysis object;
[0131] Analyzing the changes in the characteristic information of each target analysis object in the continuous frames, and determining the dynamic behavior rules of each target analysis object according to the changes;
[0132] The target analysis objects whose dynamic behavior rule similarity is greater than or equal to a preset threshold are confirmed as target analysis objects of the same type, and the feature information of any target analysis object in each type of target analysis object is confirmed as the final feature information of the target analysis object of that type.
[0133] In this embodiment, by establishing a target detection model and a feature recognition model, accurate recognition and classification of vehicles, pedestrians and environmental features in traffic videos are achieved, and feature points are classified and matched with a feature database to establish target analysis object labels. Using the trained feature recognition model, feature information of the target analysis object in each frame of the image can be extracted, and its changes in consecutive frames can be analyzed to determine dynamic behavior rules, which not only improves recognition accuracy, but also realizes real-time monitoring and early warning, optimizes traffic management, reduces false alarm rates, and enhances the system's ability to efficiently process large amounts of video data, providing strong technical support for the safety and smoothness of urban traffic.
[0134] In this embodiment, the traffic prediction and scheduling in step 3 is specifically as follows:
[0135] The extracted characteristic information of each type of target analysis object is integrated to form a unified data set, and traffic data corresponding to the impact on traffic prediction, such as the number of vehicles, pedestrian density, vehicle speed, etc., are extracted from the data set;
[0136] Obtain historical traffic data to train the constructed traffic prediction model, use the trained traffic prediction model to predict traffic conditions in the future, and output key indicators such as traffic flow, vehicle speed, congestion, etc.
[0137] At the same time, according to the forecast results, formulate corresponding traffic dispatch plans, including the following measures:
[0138] Optimize traffic flow: rationally allocate road resources by adjusting traffic light timing, implementing traffic guidance and other measures;
[0139] Adjust signal timing: Dynamically adjust signal timing based on predicted traffic flow and vehicle speed to reduce waiting time and congestion;
[0140] Plan road reconstruction: For areas with long-term congestion, propose road reconstruction suggestions, such as adding lanes, improving intersection design, etc.
[0141] In this embodiment, by integrating the characteristic information of the target analysis object to form a unified data set, and extracting key traffic data from it, it is possible to predict traffic conditions in the future and output key indicators, so as to formulate corresponding traffic scheduling plans, effectively improving the efficiency of traffic management and the traffic capacity of the road.
[0142] In this embodiment, the behavior analysis of the identified target analysis object in step 4 is specifically as follows:
[0143] Screening each frame of the image based on the feature point extraction result of the target analysis object, and acquiring image data in which the target analysis object appears based on the screening result;
[0144] Arrange the image data based on the time series of the timestamps of the image data to obtain dynamic data of the target analysis object;
[0145] Dividing the dynamic data into a plurality of time data segments, and obtaining the moving position of each target analysis object in each time data segment;
[0146] Obtaining the initial position of the same target analysis object and the moving position corresponding to each time data segment, establishing a moving trajectory, calculating the total moving distance and average moving speed of each target analysis object in the time data segment according to the moving trajectory, and generating the moving features of each target analysis object;
[0147] At the same time, in each time data segment, it is determined whether the target analysis object stays at the same position for more than a preset pause time threshold, and the position and the stay time are recorded to generate a pause feature of the target analysis object;
[0148] Obtaining the target time data segment where the pause feature corresponding to each target analysis object is located, and judging whether there are multiple target analysis objects pausing in the same time period based on the time series of the target time data segment in the dynamic data, and determining the interaction features between the target analysis objects;
[0149] A location feature data set of the target analysis object is established according to the movement feature and interaction feature of each target analysis object, and the behavior pattern of the target analysis object contained in the location feature data set is analyzed.
[0150] In this embodiment, the dynamic data of the target analysis object is obtained by screening the feature point extraction results, and divided into time data segments, the movement trajectory is established, the movement distance and average speed are calculated, and the movement characteristics are generated. At the same time, the pause characteristics and interaction characteristics of the target analysis object are identified, the location feature data set is established, and the behavior pattern is analyzed. The dynamic behavior analysis provides real-time information for traffic flow control and emergency response, which helps to discover potential traffic accident risk points and take preventive measures in advance.
[0151] In this embodiment, abnormal behavior detection is performed on the target analysis object, specifically:
[0152] Establish a baseline model of normal behavior for each type of target analysis object, and determine the thresholds of normal behavior parameters such as normal movement speed, dwell time, and common movement paths;
[0153] Comparing the target analysis object behavior pattern with a normal behavior pattern, and comparing the difference between the movement characteristics, pause characteristics, and interaction characteristics included in the current behavior pattern and the normal behavior parameter threshold;
[0154] When the comparison result shows that the characteristics of the target analysis object's behavior pattern exceed the normal behavior parameter threshold range, it is marked as a potential abnormality, and the judgment criteria for abnormal behavior are set, such as abnormal speed, too long stay time, unusual movement path, etc.
[0155] Perform abnormal analysis on the behavior marked as potentially abnormal, calculate the abnormal behavior coefficient of the target analysis object, and confirm whether the abnormal behavior coefficient is greater than a preset coefficient. If so, obtain multiple frames of abnormal behavior image data of the target analysis object based on the abnormal behavior to eliminate false alarms;
[0156] Combined with traffic video data, multiple frames of abnormal behavior image data are manually reviewed to confirm the authenticity of the abnormal behavior. Once the abnormal behavior is confirmed, the alarm mechanism is immediately triggered, including sound warnings, visual prompts, system log records, or notifications to management personnel.
[0157] In this embodiment, by real-time monitoring and identification of abnormal behavior, timely measures can be taken to prevent traffic accidents and illegal behaviors, calculate abnormal behavior coefficients and manually review, effectively reduce the false alarm rate of the system, and improve the reliability of the monitoring system. The automated anomaly detection and alarm mechanism reduces the workload of managers, improves the efficiency of traffic management, and helps to formulate more effective traffic policies and safety measures.
[0158] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. Traffic video AI intelligent analysis method based on the trusted innovation environment, characterized by: The following steps are involved: Step 1: Traffic video collection and processing: Based on the cameras installed on the main traffic roads, the traffic video data is collected in real time, and the collected traffic video data is pre-processed, and the pre-processed traffic video data is frame-processed; Among them, the collected traffic video data is preprocessed, including: The traffic video data is segmented according to a preset unit time length to obtain videos corresponding to a plurality of unit time lengths; wherein the value range of the unit time length is 10s-30s; Perform frame processing on the video corresponding to each unit time length to obtain a frame image group contained in each unit time length; Obtaining a gray balance index coefficient for each frame image in each frame image group; The gray balance index coefficient is obtained by the following formula: ; Where K represents the gray balance index coefficient; n represents the number of pixels contained in each frame image; H i Indicates the gray value corresponding to the i-th pixel of each frame image; H i-1 Indicates the gray value corresponding to the i-1th pixel of each frame image; H z Indicates the grayscale median value of each frame image; H m Indicates the maximum value of the grayscale intermediate values of all frame images contained in each frame image group; H mp represents the average value of the grayscale intermediate values of all frame images contained in each frame image group; m represents the number of frame images contained in each frame image group; H bj represents the grayscale standard deviation of the jth frame image in each frame image group; H bj-1 Represents the grayscale standard deviation of the j-1th frame image in each frame image group; The frame image corresponding to the maximum value of the gray balance index coefficient in each frame image group is used as the target frame image; Using the target frame image corresponding to each frame image group, the contrast of the collected traffic video data is adjusted; The contrast of the collected traffic video data is adjusted using the target frame image corresponding to each frame image group, including: Extract the target frame image corresponding to each frame image group and its corresponding gray balance index coefficient; Obtaining a first contrast adjustment coefficient using the gray balance index coefficient corresponding to each of the target frame images; The first contrast adjustment coefficient is obtained by the following formula: ; Among them, J 01 represents the first contrast adjustment coefficient; k represents the total number of frame image groups; K i represents the gray balance index coefficient corresponding to the i-th frame image group; K c Indicates the preset gray balance index coefficient reference value; K p K represents the average value of the gray balance index coefficient corresponding to the k-group frame image group; z K represents the middle value of the gray balance index coefficient corresponding to the k-group frame image group; b Indicates the standard deviation of the gray balance index coefficient corresponding to the k-group frame image group; Using the first contrast adjustment coefficient in combination with the center grayscale value corresponding to each of the target frame images, the contrast of the collected traffic video data is adjusted; The contrast of the collected traffic video data is adjusted by using the first contrast adjustment coefficient in combination with the central grayscale value corresponding to each of the target frame images, including: Extracting the central grayscale value corresponding to each of the target frame images; Obtaining a second contrast adjustment coefficient using the central grayscale value corresponding to each of the target frame images; The second contrast adjustment coefficient is obtained by the following formula: ; Among them, J 02 represents the second contrast adjustment coefficient; k represents the total number of frame image groups; H fi represents the central gray value corresponding to the target frame image of the i-th frame image group; H fi-1 represents the central gray value corresponding to the target frame image of the i-1th frame image group; H fb H represents the middle value of the central grayscale value corresponding to the k-group frame image group; bp Represents the average grayscale standard deviation corresponding to all frame images; Retrieving a first contrast adjustment coefficient; The contrast adjustment coefficient of the traffic video data is obtained by using the first contrast adjustment coefficient and the second contrast adjustment coefficient; wherein the contrast adjustment coefficient is obtained by the following formula: ; Where, J represents the contrast adjustment coefficient; J 01 represents the first contrast adjustment coefficient; J 02 represents the second contrast adjustment coefficient; The contrast of the traffic video data is adjusted using the contrast adjustment coefficient to obtain the traffic video data after contrast adjustment, wherein the adjusted contrast is obtained by the following formula: ; Among them, D t represents the contrast after adjustment; D represents the contrast before adjustment; J represents the contrast adjustment coefficient; Step 2: Target detection and recognition: Target detection is performed on each frame of image data based on the frame processing results, the identified target analysis objects are classified based on the target detection results, and the feature information of each type of target analysis object is extracted; Step 3: Traffic prediction and dispatch: Analyze the key indicators of traffic prediction in the monitoring area based on the characteristic information of each type of target analysis object, establish a traffic prediction model, predict the traffic conditions in the monitoring area in the future, and match the corresponding dispatch plan according to the prediction results; Step 4: Behavior analysis and abnormal alarm: Based on the time series of each frame of image data, the identified target analysis object is analyzed in combination with the traffic condition prediction results, and abnormal behavior detection is performed on the target analysis object based on the analysis results. When abnormal behavior is detected, the alarm mechanism is triggered immediately.
2. The traffic video AI intelligent analysis method based on the trust creation environment as claimed in claim 1 is characterized in that: In the step 1, the pre-processed traffic video data is subjected to frame processing, including: Collecting brightness data in the traffic video data, determining a brightness compensation coefficient of the traffic video data according to the brightness data, matching a corresponding brightness compensation function, and performing brightness compensation on the traffic video data based on the brightness compensation function; Decompose the traffic video data after brightness compensation into separate frame images, ensuring that each frame image after frame processing has a unique timestamp; The frame rate of the framed images is adjusted, and the adjusted images are adjusted to a uniform size and ratio.
3. The traffic video AI intelligent analysis method based on the trust creation environment as claimed in claim 2 is characterized in that: In the step 2, target detection is performed on each frame of image data, including: Establishing a target detection model, passing each frame of the preprocessed image as input data to the target detection model, the target detection model extracts feature points from the input data, and determines the target position features of each frame of the image according to the extraction results; Based on the target position features of each frame image, the target type of the feature points at that position is determined and marked with category labels, the target detection results are output, and the corresponding feature vectors are extracted based on the target detection results.
4. The traffic video AI intelligent analysis method based on the trust innovation environment as claimed in claim 3 is characterized in that: In the step 2, the identified target analysis objects are classified, including: Compare the feature point extraction results of each frame of image, select the target feature points that appear in each frame of image, determine the feature points with high overlap rate in each frame of image comparison, and classify the feature points. Based on the classification results, match them with the feature database one by one to establish the corresponding target analysis object label; Among them, the feature database includes vehicle features, pedestrian features and traffic environment features; The feature point extraction results of each frame image are used as the model input samples. At the same time, the vehicle features, pedestrian features and environmental features are used as model output samples to train the preset network model and establish a feature recognition model corresponding to each feature category.
5. The traffic video AI intelligent analysis method based on the trust creation environment as claimed in claim 4 is characterized in that: Extract the characteristic information of each type of target analysis object, specifically: Using the feature recognition model corresponding to each feature category to obtain each target analysis object in each frame of the image, and obtaining feature information of each target analysis object according to the feature vector of each target analysis object; Analyzing the changes in the characteristic information of each target analysis object in the continuous frames, and determining the dynamic behavior rules of each target analysis object according to the changes; The target analysis objects whose dynamic behavior rule similarity is greater than or equal to a preset threshold are confirmed as target analysis objects of the same type, and the feature information of any target analysis object in each type of target analysis object is confirmed as the final feature information of the target analysis object of that type.
6. The traffic video AI intelligent analysis method based on the trust creation environment as claimed in claim 5 is characterized in that: The traffic prediction and scheduling in step 3 are specifically as follows: The extracted characteristic information of each type of target analysis object is integrated to form a unified data set, and traffic data corresponding to the impact on traffic prediction is extracted from the data set; Obtain historical traffic data to train the constructed traffic prediction model, use the trained traffic prediction model to predict traffic conditions in the future and output key indicators; At the same time, according to the forecast results, formulate corresponding traffic dispatch plan.
7. The traffic video AI intelligent analysis method based on the trust creation environment as claimed in claim 6 is characterized in that: In step 4, the behavior analysis of the identified target analysis object is performed, specifically: Screening each frame of the image based on the feature point extraction result of the target analysis object, and acquiring image data in which the target analysis object appears based on the screening result; Arrange the image data based on the time series of the timestamps of the image data to obtain dynamic data of the target analysis object; Dividing the dynamic data into a plurality of time data segments, and obtaining the moving position of each target analysis object in each time data segment; Obtaining the initial position of the same target analysis object and the moving position corresponding to each time data segment, establishing a moving trajectory, calculating the total moving distance and average moving speed of each target analysis object in the time data segment according to the moving trajectory, and generating the moving features of each target analysis object; At the same time, in each time data segment, it is determined whether the target analysis object stays at the same position for more than a preset pause time threshold, and the position and the stay time are recorded to generate a pause feature of the target analysis object; Obtaining the target time data segment where the pause feature corresponding to each target analysis object is located, and judging whether there are multiple target analysis objects pausing in the same time period based on the time series of the target time data segment in the dynamic data, and determining the interaction features between the target analysis objects; A location feature data set of the target analysis object is established according to the movement feature and interaction feature of each target analysis object, and the behavior pattern of the target analysis object contained in the location feature data set is analyzed.
8. The traffic video AI intelligent analysis method based on the trust creation environment as claimed in claim 7 is characterized in that: Perform abnormal behavior detection on the target analysis object, specifically: Establish a baseline model of normal behavior for each type of target analysis object and determine the threshold of normal behavior parameters; Comparing the target analysis object behavior pattern with a normal behavior pattern, and comparing the difference between the movement characteristics, pause characteristics, and interaction characteristics included in the current behavior pattern and the normal behavior parameter threshold; When the comparison result shows that the characteristics of the behavior pattern of the target analysis object exceed the normal behavior parameter threshold range, it is marked as a potential abnormality; Performing abnormal analysis on the behavior marked as potentially abnormal, calculating the abnormal behavior coefficient of the target analysis object, confirming whether the abnormal behavior coefficient is greater than a preset coefficient, and if so, acquiring multiple frames of abnormal behavior image data of the target analysis object based on the abnormal behavior; Combined with traffic video data, multiple frames of abnormal behavior image data are manually reviewed. Once abnormal behavior is confirmed, the alarm mechanism is immediately triggered.
Citation Information
Patent Citations
A method, device, and readable storage medium for analyzing and assessing traffic police situations.
CN113570846B
Intelligent safety monitoring system based on visual identification
CN118279834A
System, method, and device for intelligent vehicle loaded fatigue detection based on facial discrimination
JP2021034035A