Traffic jam condition evaluation method, equipment and medium

By segmenting and tracking the traffic video images using the SAM2 model, combining the area proportion and offset of the vehicle mask in the background mask area, the problems of poor prospect segmentation effect and lack of adaptability of traditional traffic congestion judgment methods are solved, and a more accurate assessment of traffic congestion conditions is achieved.

CN119693886APending Publication Date: 2025-03-25WUHAN CITMS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411589022.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-08
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

The traditional method of judging traffic congestion is based on the frame difference method or the background difference method, with poor foreground segmentation effect and lack of adaptability and matching, resulting in the inability to accurately evaluate traffic congestion under complex vehicle conditions or camera angle problems.

Method used

The SAM2 model is used to segment the traffic video image frames in the area, construct the background mask and vehicle mask of the vehicle circulation area, and obtain the vehicle mask sequence through the target tracking algorithm. Combining the area proportion of the vehicle mask in the background mask area and the vehicle mask offset, the vehicle congestion value is calculated and a comprehensive evaluation of the traffic congestion value is carried out.

Benefits of technology

A more accurate assessment of traffic congestion conditions is achieved, and traffic density and comprehensive congestion conditions can be measured more accurately under complex vehicle conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119693886A_ABST
    Figure CN119693886A_ABST
Patent Text Reader

Abstract

The invention discloses a traffic jam condition evaluation method, which adopts an advanced video image segmentation technology SAM2, and aims to extract the coverage area of vehicles in a traffic scene video picture by combining a visual segmentation large model SAM2. Therefore, the visual segmentation area mask of the traffic target vehicle can be more accurately obtained in a traffic jam analysis scene, and the traffic density can be more intuitively measured. Meanwhile, the area proportion of the vehicle mask area in the background mask area of the traffic vehicle circulation area is adopted in the assessment of the traffic jam condition, and the comprehensive overall assessment is carried out by combining the factors such as the vehicle mask offset and the time length, so that the comprehensive traffic jam condition can be measured more accurately and effectively.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of video image detection, and more specifically, to a method, device and medium for evaluating traffic congestion conditions. Background Art

[0002] Intelligent highway supervision has received more and more attention in the field of intelligent transportation. The increasing number of vehicles has inevitably brought about serious traffic congestion and reduced the traffic capacity of roads. Therefore, it is necessary to use newer scientific and technological methods to conduct intelligent evaluation and management of roads.

[0003] However, traditional traffic congestion judgment is based on the frame difference method or background difference method to detect vehicle flow. These two methods have poor foreground segmentation effects and are not adaptive and matching. In complex vehicle conditions or due to camera angle problems, the foreground extraction effect is poor, and better judgment and evaluation cannot be performed. Therefore, it is urgent to develop a more advanced technical means for evaluating traffic congestion conditions. Summary of the invention

[0004] In response to at least one defect or improvement need in the prior art, the present application provides a traffic congestion condition assessment method, device and medium for more accurately assessing traffic congestion conditions.

[0005] To achieve the above objectives, in a first aspect, the present application provides a method for evaluating traffic congestion conditions, comprising:

[0006] Based on the SAM2 model, the traffic video image frame is segmented to construct the background mask area and vehicle mask area of ​​the traffic vehicle circulation area;

[0007] Using the target tracking algorithm of the SAM2 model, mask tracking is performed on the traffic video image frame sequence to obtain a vehicle mask sequence of the target vehicle;

[0008] Intercepting the vehicle mask sequence related to the target vehicle within a preset time period, combining the area ratio of the corresponding vehicle mask area in the background mask area of ​​the traffic vehicle circulation area, and the vehicle mask offset, to obtain the vehicle congestion value of the target vehicle at the end time of the preset time period;

[0009] The above-mentioned vehicle congestion value is calculated for all vehicles detected in the traffic video image frame corresponding to the end time of the preset time period, and the calculated vehicle congestion values ​​are summed to obtain the traffic congestion value corresponding to the end time of the preset time period;

[0010] A traffic congestion condition assessment is performed based on the traffic congestion value.

[0011] Furthermore, the formula for the vehicle congestion value includes:

[0012]

[0013] Among them, t i Indicates the starting time of the preset time period; t j Indicates the end time of the preset time period; j represents the vehicle mask offset; Indicates the area of ​​the vehicle mask region corresponding to the end time of the preset time period; Represents the area of ​​the background mask region of the traffic vehicle circulation area; represents the vehicle congestion value of the target vehicle at the end time of the preset time period; α represents the time factor coefficient; β represents the vehicle mask offset factor coefficient.

[0014] Furthermore, the vehicle mask offset is obtained by:

[0015] According to the target vehicle, the starting time t is taken within the fixed time step Δt. i The image frame and the termination time t j Image frame, obtain the vehicle mask id_mask corresponding to the target vehicle i and id_mask j ;

[0016] According to id_mask i The center point position and id_mask j The center point position of the target vehicle is obtained by obtaining the vehicle mask offset l j .

[0017] Furthermore, the method of constructing the background mask area of ​​the traffic vehicle circulation area includes:

[0018] According to the fixed area covered by the traffic camera, a background image without motor vehicles, non-motor vehicles and pedestrians is selected, and the SAM2 model is used to obtain the segmented area of ​​the road area, which is set as the background mask area of ​​the traffic vehicle circulation area.

[0019] Furthermore, the vehicle mask area is constructed in the following manner:

[0020] According to the traffic video image frame, the SAM2 model is used to obtain the vehicle segmentation area for the target vehicle;

[0021] When multiple target vehicles appear in the traffic video image frame, a series of vehicle mask regions corresponding to each target vehicle are obtained.

[0022] Furthermore, the target tracking algorithm of the SAM2 model is used to perform mask tracking on the traffic video image frame sequence to obtain a vehicle mask sequence of the target vehicle, including:

[0023] The target tracking algorithm of the SAM2 model is used to track the sequence of traffic video image frames frame1, frame2, ..., frame M Perform mask tracking to obtain the same vehicle mask sequence related to the target vehicle: id_mask1, id_mask2, ... id_mask M ;frame M Indicates the Mth frame of traffic video image; id_mask M Representation and frame M The corresponding vehicle mask;

[0024] If the vehicle mask of the target vehicle does not appear, leaves or is lost in the traffic video image frame, the vehicle mask is set to 0.

[0025] In a second aspect, the present application provides an electronic device comprising at least one processing unit and at least one storage unit, wherein the storage unit stores a computer program, and when the computer program is executed by the processing unit, the processing unit is enabled to perform the steps of any of the aforementioned traffic congestion condition assessment methods.

[0026] In a third aspect, the present application provides a storage medium storing a computer program executable by an access authentication device, wherein when the computer program runs on the access authentication device, the access authentication device is enabled to execute the steps of any of the aforementioned traffic congestion condition assessment methods.

[0027] In general, the above technical solutions conceived by the present application can achieve the following beneficial effects compared with the prior art:

[0028] The present application discloses a method for evaluating traffic congestion conditions, which uses the advanced video image segmentation technology SAM2, and aims to extract the coverage area of ​​vehicles in the traffic scene video screen by combining the visual segmentation large model SAM2, so as to obtain the visual segmentation area mask of the traffic target vehicle more accurately in the traffic congestion analysis scene, and to measure the traffic density more intuitively. At the same time, in the evaluation of traffic congestion conditions, the area ratio of the vehicle mask area in the background mask area of ​​the traffic vehicle circulation area is adopted, and the vehicle mask offset and duration are combined to perform a comprehensive overall evaluation, so as to more accurately and effectively measure the comprehensive traffic congestion conditions. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0030] Figure 1 A core flow chart of a traffic congestion condition assessment method provided in an embodiment of the present application;

[0031] Figure 2 A block diagram of an electronic device suitable for implementing the traffic congestion condition assessment method described above provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. In addition, the technical features involved in each embodiment of the present application described below can be combined with each other as long as they do not conflict with each other.

[0033] The terms "including" or "having" and any variations thereof in the specification, claims or drawings of the present application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.

[0034] As described in the background technology section of the specification, traditional traffic congestion judgment is based on the frame difference method or the background difference method to detect vehicle flow. These two methods have poor foreground segmentation effects and are not adaptive and matching. In more complex vehicle conditions or due to camera angle problems, the foreground extraction effect is poor, and better judgment and evaluation cannot be performed. Therefore, it is urgent to develop a more advanced technical means for evaluating traffic congestion conditions.

[0035] refer to Figure 1 An embodiment of the present application provides a method for evaluating traffic congestion conditions, which may include the following steps.

[0036] Step 1: Construct the background mask area of ​​the traffic vehicle circulation area

[0037] According to the fixed area covered by the traffic camera, a "clean" background image without objects such as motor vehicles, non-motor vehicles and pedestrians is selected, and the SAM2 object segmentation model (Segment Anything Model 2) is used to obtain the segmented area of ​​the road area and set it as the background mask area of ​​the traffic vehicle circulation area.

[0038] Step 2: Construct the vehicle segmentation mask area of ​​the real-time traffic video.

[0039] According to the real-time traffic image frame i , the SAM2 object segmentation model is used to obtain the vehicle segmentation area for the target vehicle; when there are multiple vehicle IDs in the picture, the vehicle mask areas corresponding to these vehicles are obtained one by one

[0040] Step 3: Track the vehicle ID in the traffic video and obtain the mask sequence.

[0041] Through the target tracking algorithm of the SAM2 object segmentation model, the sequence of traffic real-time image frames frame1, frame2, ..., frame M By performing mask tracking, we can get the mask sequence of the same vehicle ID: id_mask1, id_mask2, ... id_mask M If the vehicle ID mask id_mask i If the user does not appear in the video, leaves, or is lost, id_mask i Set to 0.

[0042] Step 4: Calculate the congestion score of the vehicle ID in the traffic video sequence.

[0043] According to the vehicle ID, the starting time t is taken within the fixed time step Δt. i The image frame and the termination time t j Image frame, get the corresponding vehicle ID mask id_mask i and id_mask j , according to id_mask i The center point position centroid i and id_mask j The center point position centroid j Calculate the vehicle mask offset l j The vehicle ID at the termination time t is calculated by combining the area ratio of the corresponding vehicle mask area in the background mask area of ​​the traffic vehicle circulation area and the vehicle stay time factor. jThe vehicle congestion score at the time. The specific calculation method is:

[0044]

[0045] Among them, t i represents the starting time of the fixed time step Δt; t j Indicates the end time of the fixed time step Δt; l j Indicates the vehicle mask offset; represents the end time t j The area of ​​the corresponding vehicle mask region; Represents the area of ​​the background mask region of the traffic vehicle circulation area; The vehicle terminates at time t j The vehicle congestion score; α represents the time factor coefficient; β represents the vehicle mask offset factor coefficient.

[0046] Step 5: Calculate the traffic congestion score of the video sequence.

[0047] For the end time t j The vehicle congestion scores of all vehicle IDs detected by SAM2 in the image frame of step 4 are calculated and summed to obtain the termination time t j Traffic congestion score

[0048] Step 6: Based on the termination time t j Traffic congestion score Conduct traffic congestion assessment.

[0049] The traffic congestion assessment method disclosed in the present application adopts the advanced video image segmentation technology SAM2, and aims to extract the coverage area of ​​vehicles in the traffic scene video screen by combining the visual segmentation large model SAM2, so as to obtain the visual segmentation area mask of the traffic target vehicle more accurately in the traffic congestion analysis scene, and to measure the traffic density more intuitively. At the same time, in the assessment of the traffic congestion situation, the area ratio of the vehicle mask area in the background mask area of ​​the traffic vehicle circulation area is adopted, and the vehicle mask offset and duration are combined to conduct a comprehensive overall assessment, so as to measure the comprehensive traffic congestion situation more accurately and effectively.

[0050] Figure 2 The block diagram of an electronic device suitable for implementing the above-described traffic congestion condition assessment method according to an embodiment of the present application is schematically shown. Figure 2 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0051] like Figure 2As shown, the electronic device 1000 described in this embodiment includes: a processor 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage part 1008 to a random access memory (RAM) 1003. The processor 1001 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), and the like. The processor 1001 may also include an onboard memory for caching purposes. The processor 1001 may include a single processing unit or multiple processing units for executing different actions of the traffic congestion condition assessment method process according to an embodiment of the present application.

[0052] In RAM 1003, various programs and data required for the operation of system 1000 are stored. Processor 1001, ROM 1002 and RAM 1003 are connected to each other via bus 1004. Processor 1001 performs various operations of the traffic congestion condition assessment method process according to the embodiment of the present application by executing the program in ROM 1002 and / or RAM 1003. It should be noted that the program can also be stored in one or more memories other than ROM 1002 and RAM 1003. Processor 1001 can also perform various operations of the traffic congestion condition assessment method process according to the embodiment of the present application by executing the program stored in the one or more memories.

[0053] According to an embodiment of the present application, the electronic device 1000 may further include an input / output (I / O) interface 1005, which is also connected to the bus 1004. The system 1000 may further include one or more of the following components connected to the I / O interface 1005: an input part 1006 including a keyboard, a mouse, etc.; an output part 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage part 1008 including a hard disk, etc.; and a communication part 1009 including a network interface card such as a LAN card, a modem, etc. The communication part 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed, so that the computer program read therefrom is installed into the storage part 1008 as needed.

[0054] According to the traffic congestion condition assessment method process of the embodiment of the present application, it can be implemented as a computer software program. For example, the embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the traffic congestion condition assessment method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1009, and / or installed from the removable medium 1011. When the computer program is executed by the processor 1001, the above-mentioned functions defined in the system of the embodiment of the present application are executed. According to the embodiment of the present application, the system, equipment, device, module and / or unit described above can be implemented by a computer program module.

[0055] The embodiments of the present application also provide a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments, or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the steps of the traffic congestion condition assessment method according to the embodiments of the present application can be implemented.

[0056] According to an embodiment of the present application, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In an embodiment of the present application, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus, or a device. For example, according to an embodiment of the present application, the computer-readable storage medium may include one or more memories other than the ROM 1002 and / or RAM 1003 described above.

[0057] It should be noted that the functional modules in the various embodiments of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software functional modules. If the integrated modules are implemented in the form of software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product.

[0058] The flowchart and / or block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flowchart and / or block diagram can represent a part of a module, program segment or code, and a part of the above-mentioned module, program segment or code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. It should also be noted that each box in the block diagram or flowchart, and the combination of the boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0059] Those skilled in the art will appreciate that the features described in the various embodiments and / or claims of the present application may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present application. In particular, without departing from the spirit and teachings of the present application, the technical features described in the various embodiments and / or claims of the present application may be combined and / or combined in a variety of ways, and all of these combinations and / or combinations fall within the scope of the present application.

[0060] Although the present application has been shown and described with reference to specific exemplary embodiments of the present application, it should be understood by those skilled in the art that various changes in form and details may be made to the present application without departing from the spirit and scope of the present application as defined by the appended claims and their equivalents. Therefore, the scope of the present application should not be limited to the above-mentioned embodiments, but should be determined not only by the appended claims, but also by the equivalents of the appended claims.

Claims

1. A method for evaluating traffic congestion, characterized in that: include: Based on the SAM2 model, the traffic video image frame is segmented to construct the background mask area and vehicle mask area of ​​the traffic vehicle circulation area; Using the target tracking algorithm of the SAM2 model, mask tracking is performed on the traffic video image frame sequence to obtain a vehicle mask sequence of the target vehicle; Intercepting the vehicle mask sequence related to the target vehicle within a preset time period, combining the area ratio of the corresponding vehicle mask area in the background mask area of ​​the traffic vehicle circulation area, and the vehicle mask offset, to obtain the vehicle congestion value of the target vehicle at the end time of the preset time period; The above-mentioned vehicle congestion value is calculated for all vehicles detected in the traffic video image frame corresponding to the end time of the preset time period, and the calculated vehicle congestion values ​​are summed to obtain the traffic congestion value corresponding to the end time of the preset time period; A traffic congestion condition assessment is performed based on the traffic congestion value.

2. The method for evaluating traffic congestion according to claim 1, characterized in that: The formulas for the vehicle congestion values ​​include: Among them, t i Indicates the starting time of the preset time period; t j Indicates the end time of the preset time period; j represents the vehicle mask offset; Indicates the area of ​​the vehicle mask region corresponding to the end time of the preset time period; Represents the area of ​​the background mask region of the traffic vehicle circulation area; represents the vehicle congestion value of the target vehicle at the end time of the preset time period; α represents the time factor coefficient; β represents the vehicle mask offset factor coefficient.

3. The method for evaluating traffic congestion according to claim 2, characterized in that: The vehicle mask offset is obtained by: According to the target vehicle, the starting time t is taken within the fixed time step Δt. i The image frame and the termination time t j Image frame, obtain the vehicle mask id_mask corresponding to the target vehicle i and id_mask j ; According to id_mask i The center point position and id_mask j The center point position of the target vehicle is obtained by obtaining the vehicle mask offset l j .

4. The method for evaluating traffic congestion according to claim 1, wherein: The method for constructing the background mask area of ​​the traffic vehicle circulation area includes: According to the fixed area covered by the traffic camera, a background image without motor vehicles, non-motor vehicles and pedestrians is selected, and the SAM2 model is used to obtain the segmented area of ​​the road area, which is set as the background mask area of ​​the traffic vehicle circulation area.

5. The method for evaluating traffic congestion according to claim 1, wherein: The vehicle mask area is constructed in the following manner: According to the traffic video image frame, the SAM2 model is used to obtain the vehicle segmentation area for the target vehicle; When multiple target vehicles appear in the traffic video image frame, a series of vehicle mask regions corresponding to each target vehicle are obtained.

6. The method for evaluating traffic congestion according to claim 5, characterized in that: The step of performing mask tracking on the traffic video image frame sequence by using the target tracking algorithm of the SAM2 model to obtain a vehicle mask sequence of the target vehicle includes: The target tracking algorithm of the SAM2 model is used to track the sequence of traffic video image frames frame1, frame2, ..., frame M Perform mask tracking to obtain the same vehicle mask sequence related to the target vehicle: id_mask1, id_mask2, ... id_mask M ;frame M Indicates the Mth frame of traffic video image; id_mask M Representation and frame M The corresponding vehicle mask; If the vehicle mask of the target vehicle does not appear, leaves or is lost in the traffic video image frame, the vehicle mask is set to 0.

7. An electronic device, characterized in that: It comprises at least one processing unit and at least one storage unit, wherein the storage unit stores a computer program, and when the computer program is executed by the processing unit, the processing unit is enabled to execute the steps of the traffic congestion condition assessment method according to any one of claims 1 to 6.

8. A storage medium, characterized in that: It stores a computer program executable by an access authentication device. When the computer program runs on the access authentication device, the access authentication device is enabled to execute the steps of the traffic congestion condition assessment method according to any one of claims 1 to 6.