A method, electronic device and storage medium for identifying abnormal vehicles on highways
By analyzing the pixel grayscale changes and flicker frequency of highway video images and combining them with a semantic segmentation model, the problems of accuracy and computational load in identifying abnormally parked vehicles in existing technologies have been solved, achieving fast and accurate identification under low-resolution conditions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG MEIRI HUDONG NETWORK TECH CO LTD
- Filing Date
- 2026-04-27
- Publication Date
- 2026-05-26
AI Technical Summary
Existing technologies for identifying abnormally parked vehicles on highways, especially at night, in foggy conditions, or when shooting from a distance, suffer from insufficient recognition capabilities of large visual models and machine learning models, resulting in high computational demands and low accuracy.
By analyzing the changes in the grayscale values of pixels in video images, flickering pixels are filtered out and connected, and stationary vehicle areas are identified. By combining semantic segmentation models and large AI models, interference from dynamic objects is reduced, thereby improving the accuracy of stationary vehicle identification.
It can quickly and accurately identify stationary vehicles even in low-resolution images, reducing the amount of data processing and improving the accuracy and efficiency of identifying abnormally parked vehicles.
Smart Images

Figure CN122090633A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of transportation technology, and in particular to a method, electronic device and storage medium for identifying abnormal vehicles on highways. Background Technology
[0002] Most abnormal incidents on highways are caused by vehicles stopping abnormally. Therefore, timely identification of stopped vehicles is crucial for understanding and managing highway conditions. Currently, the main method for vehicle detection in highway surveillance videos is object detection, which involves identifying vehicles in the frame and monitoring whether they have stopped or changed speed. This requires constant monitoring of vehicle movement and data processing, resulting in a large computational load. In practice, the mainstream technologies used are visual large-scale models and machine learning models. However, visual large-scale models are only accurate for clear images, while machine learning models require a large number of video samples to label vehicles and undergo supervised learning, making them highly complex. Furthermore, neither of these methods can effectively identify abnormally stopped vehicles when the footage is unclear, such as at night, during the day with heavy fog, or when the vehicle is at a distance. Summary of the Invention
[0003] To address the aforementioned technical problems, this invention provides a method, electronic device, and storage medium for identifying abnormal vehicles on highways. By subtracting the identified dynamic objects, the method enhances the target of stationary vehicles and analyzes the pixel changes in static images. Even in images with low resolution, it can accurately and quickly locate stationary vehicle areas and obstacle areas.
[0004] According to a first aspect of the present invention, a method for identifying abnormal vehicles on highways is provided, comprising the following steps: S100: When an abnormal event is determined to have occurred on a target section of the highway according to a preset judgment rule, the target video corresponding to the target section is acquired; the target video refers to a video taken with the current time as the starting point and for a first preset duration.
[0005] S200: When the light intensity corresponding to the target video is less than the preset light intensity threshold or during the preset nighttime period, perform grayscale conversion on each frame of the target video to obtain several grayscale images.
[0006] S300: Analyze the grayscale value changes of pixels in each frame of grayscale image. Based on the grayscale value changes of each pixel, select pixels whose corresponding grayscale values show periodic changes as flashing pixels. Obtain the flashing frequency and the dwell time of each grayscale value in any change cycle for each flashing pixel.
[0007] S400: When the flashing frequency of a flashing pixel meets the preset flashing frequency range, and the dwell time of each gray value in any change cycle meets the preset flashing duration range of the corresponding gray value, the flashing pixel is marked and adjacent flashing pixels are connected in sequence. The connected area is located and characterized as a stationary vehicle area.
[0008] S500: When a stationary vehicle area is identified, the stationary duration of the corresponding stationary vehicle in the stationary vehicle area is recorded. When the stationary duration exceeds a second preset duration, the stationary vehicle is identified as an abnormally parked vehicle and an alarm is triggered.
[0009] According to a second aspect of the present invention, a non-transitory computer-readable storage medium is provided, wherein at least one instruction or at least one program is stored therein, the at least one instruction or the at least one program being loaded and executed by a processor to implement the above-described method for identifying abnormal vehicles on highways.
[0010] According to a third aspect of the present invention, an electronic device is provided, including a processor and the aforementioned non-transitory computer-readable storage medium.
[0011] The present invention has at least the following beneficial effects: This invention provides a method for identifying abnormal vehicles on highways. When an abnormal event is detected on a target road segment, the method acquires the target video corresponding to that segment. The target video refers to a video taken from the current moment to a predetermined duration. This eliminates the need for constant analysis and data processing of monitored vehicles on the highway; image analysis of the target video is sufficient, significantly reducing data processing volume. Then, the method analyzes the changes in preset indicators of pixels in each frame of the target video. Based on the frequency of several preset indicators corresponding to each pixel, dynamic objects are separated from each frame, resulting in the target image for each frame. By separating dynamic pixels, dynamic objects in the image are eliminated, avoiding interference from dynamic vehicles during image analysis, thus enhancing the recognition of static objects in static pixels. Furthermore, pixel analysis of the target image identifies stationary vehicle regions and records the stationary duration of the corresponding stationary vehicles. Since stationary vehicles become more prominent after removing dynamic vehicles, pixel difference analysis can accurately identify differentiated pixels even in low-resolution images, improving the accuracy of identifying abnormal parked vehicles and obstacles. Attached Figure Description
[0012] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 A flowchart of a method for identifying abnormal vehicles on highways provided in an embodiment of the present invention. Detailed Implementation
[0014] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0015] This invention provides a method for identifying abnormal vehicles on highways, such as... Figure 1 As shown, the method includes the following steps: S100: When an abnormal event is determined to have occurred on a target section of the highway according to a preset judgment rule, the target video corresponding to the target section is acquired; the target video refers to a video taken from the current moment as the starting point and lasting for a first preset duration. Those skilled in the art can set the first preset duration according to actual needs, for example, 2 seconds or 3 seconds.
[0016] Furthermore, the step of determining that an abnormal event has occurred on the target road segment according to preset judgment rules includes the following steps: S101: Real-time acquisition of the average speed of traffic flow at the starting point and the average speed of traffic flow at the ending point of the target road segment. When the difference between the average speed of traffic flow at the starting point and the average speed of traffic flow at the ending point is greater than a preset speed threshold, it is determined that an abnormal event has occurred in the target road segment.
[0017] S102, based on a preset time period, obtain the number of target vehicles corresponding to the target road segment and the travel time of each target vehicle from the starting point to the end point of the target road segment; wherein, the target vehicle refers to the vehicle that enters and exits the target road segment within the same preset time period.
[0018] S103, when the proportion of the number of target vehicles whose corresponding travel time exceeds the preset time threshold to the total number of target vehicles is greater than the preset proportion threshold, it is determined that an abnormal event has occurred on the target road segment.
[0019] As mentioned above, when analyzing abnormal events, the impact of traffic slowdown and the abnormal travel time of a large number of vehicles on the target road segment were taken into account. By analyzing these two driving conditions, it can be determined that an abnormal event has occurred. Then, the subsequent video footage of the target road segment can be retrieved. It is not necessary to analyze the abnormal vehicle video of the target road segment at all times. Only 2-3 seconds of video need to be processed, which greatly reduces the amount of data processing.
[0020] It should be noted that before analyzing the target video, it is necessary to preprocess the target video, including grayscale conversion and Gaussian filtering. Grayscale conversion eliminates the complexity caused by color differences and copes with changes in lighting. Gaussian filtering smooths the image and removes random noise.
[0021] In one embodiment, the method identifies stationary vehicle areas through the following steps: S10: Analyze the preset index changes of pixels in each frame of the target video, and separate the dynamic object from each frame of the given image based on the frequency of several preset indexes corresponding to each pixel, to obtain the target image corresponding to each frame of the given image; it can be understood that each frame of the image is composed of several pixels, and the given image can be the image obtained after frame sampling.
[0022] Preferably, the preset index is a grayscale value or an RGB value.
[0023] In one implementation, step S10 includes the following steps: S11, when the preset index is grayscale value, obtain k target grayscale values corresponding to each pixel based on the k given images in the target video; where k is the total number of given images in the target video.
[0024] S13: For any pixel, obtain several gray value frequencies corresponding to the pixel based on k target gray value frequencies, and take the highest gray value frequency among these frequencies as the first target frequency for the pixel. For example, when k is 48, there are 20 target gray value frequencies with a gray value of 100 and 28 target gray value frequencies with a gray value of 200. Therefore, the gray value frequencies corresponding to the pixel are 20 and 28, and 28 is taken as the first target frequency.
[0025] S15, based on the first target frequency corresponding to each pixel, pixels whose first target frequency is greater than a preset frequency threshold are determined as static pixels, and pixels whose first target frequency is not greater than the preset frequency threshold are determined as dynamic pixels. Those skilled in the art can set the preset frequency threshold according to actual needs, for example, 95%. When the first target frequency exceeds 95%, it is considered a static object such as a stationary road surface or a stationary vehicle.
[0026] S17: For any given frame of image, subtract the dynamic pixels corresponding to the given image and combine them with a pre-constructed historical background image to obtain the target image corresponding to the given image; this can be understood as: using the corresponding pixels of the pre-constructed historical background image to fill in the positions of the subtracted pixels in the given image.
[0027] As described above, by analyzing the frequency of grayscale values in the image and setting a frequency threshold to filter out static and dynamic pixels, the separation of dynamic and static pixels is achieved. In this process, there is no need to further identify dynamic vehicles; only the dynamic pixels need to be separated, thus eliminating all dynamic objects in the image and avoiding interference from dynamic vehicles during image analysis. Therefore, it enhances the static objects in the static pixels, making it easier to find the required static vehicle area.
[0028] In another embodiment, step S10 includes the following steps: S12, when the preset index is RGB value, obtain k RGB values corresponding to each pixel based on k given images in the target video; where k is the total number of given images in the target video.
[0029] S14: For any pixel, based on several pre-divided RGB value intervals, determine the RGB value interval corresponding to each RGB value of the pixel, and determine the number of RGB values corresponding to each RGB value interval as the RGB value frequency. For example, divide the RGB of red into segments, and obtain the number of k RGB values of the same pixel belonging to each RGB interval.
[0030] S16, based on the frequency of several RGB values corresponding to a pixel, the frequency of the corresponding maximum RGB value is taken as the second target frequency corresponding to the pixel.
[0031] S18, based on the second target frequency corresponding to each pixel, pixels with a second target frequency greater than a preset frequency threshold are determined as static pixels, and pixels with a second target frequency not greater than the preset frequency threshold are determined as dynamic pixels. In specific implementations, the preset frequency threshold in the two implementations can be set to different thresholds according to actual needs.
[0032] As mentioned above, since there are only slight changes between adjacent RGB pixels, errors can easily occur when determining RGB. Therefore, RGB is segmented to improve the accuracy of dynamic and static pixel analysis. Furthermore, by subtracting dynamic pixels in the subsequent process, interference from dynamic vehicles during image analysis is avoided.
[0033] Furthermore, the method can also obtain the target image corresponding to each given image frame through the following steps: S1 involves performing background modeling and foreground detection on the target video using a background subtraction-based video image algorithm to obtain the dynamic object. For example, the background subtraction-based video image algorithm could be the MOG2 algorithm.
[0034] S2 separates the pixels corresponding to the dynamic object in each frame of a given image to obtain the target image corresponding to each frame of a given image.
[0035] The above-mentioned background subtraction video image algorithm is introduced. Since the background subtraction algorithm can subtract the static background to obtain the foreground target, that is, the moving object, this application obtains the moving object through the background subtraction algorithm and then performs the reverse operation to subtract the moving object from the image to obtain the target image. Through this operation, the background subtraction algorithm can also be applied to this application, thereby improving the applicability of this application.
[0036] S20 identifies stationary vehicle areas from the target image by performing pixel analysis on the target image.
[0037] In one specific embodiment, step S20 includes the following steps: S21, compare the target image with a pre-constructed historical background image, and identify pixels whose grayscale value change rate exceeds a preset change rate threshold as difference pixels. Those skilled in the art can set the preset change rate threshold according to actual needs, which will not be elaborated here.
[0038] S22: Morphological processing is performed on the difference pixels in the target image, and several connected contour regions are determined based on the processed difference pixels. For example, the difference pixels in the target image are first binarized and used as a foreground mask, and then processed by erosion, dilation, opening and closing operations to obtain the processed image. Several connected contour regions are then obtained by connecting region search.
[0039] Based on this, the following steps are included after step S22: S221, Based on the pixels corresponding to each connected contour region, a semantic segmentation model or a multimodal large model is used to determine the object category corresponding to each connected contour region.
[0040] Taking a semantic segmentation model as an example, when determining the object category corresponding to a connected contour region, the semantic segmentation model used is the U-Net architecture based on a deep convolutional neural network. This model is pre-trained through the following steps: First, a training dataset is constructed, including image frames from highway monitoring videos under different lighting and weather conditions. Pixel-level annotations are performed on objects such as vehicles, pedestrians, traffic cones, and spilled materials in the image frames to form semantic segmentation labels. Then, the annotated images are input into the U-Net neural network for supervised training using the cross-entropy loss function until the accuracy of the validation set meets a preset stability condition. The specific training process of this neural network is well-known to those skilled in the art and will not be elaborated here. Based on the trained semantic segmentation model, the image corresponding to the connected contour region is input into the trained semantic segmentation model, which outputs the object category corresponding to each pixel in the image. The category distribution of all pixels is statistically analyzed, and the semantic category with the highest frequency is taken as the object category corresponding to the connected contour region. Alternatively, the largest connected sub-region is extracted through connected component analysis, and the semantic category of the largest connected sub-region is taken as the object category of the connected contour region. In this embodiment, the object categories output by the semantic segmentation model include at least: vehicles, pedestrians, obstacles, and background.
[0041] S222, determine the obstacle category from the object categories corresponding to several connected contour regions, and determine the obstacle's location information based on the connected contour regions corresponding to the obstacle category.
[0042] As mentioned above, after obtaining the connected contour region, since the connected contour region is a region composed of pixels that differ from the background image, obstacle recognition is also introduced. By identifying the object category in the connected contour region, the location information of obstacles on the highway can be accurately obtained when there are obstacles on the highway, so that staff can clear them in time and achieve rapid lane clearing.
[0043] S23, based on preset vehicle contour attributes, filter out non-vehicle areas from several connected contour areas to identify stationary vehicle areas.
[0044] Specifically, the preset vehicle outline attributes include vehicle area and vehicle width-to-height ratio.
[0045] As mentioned above, the target image is the image after removing dynamic objects. By finding the difference pixels and using them as the foreground, pixels that are different from the original background can be found. Through morphological processing, contour finding, and filtering, small noise blocks and subtle shadow residues can be filtered out, thereby finding the area of stationary vehicles. In this method, the difference in the gray value of the pixels is used to find the difference pixels. Even in images with low clarity, such as at night or on rainy days, the difference pixels can be accurately found, which improves the accuracy of identifying abnormally parked vehicles. Moreover, the vehicle can be identified with only one image, reducing the complexity of data processing.
[0046] In another implementation, the target image is input into a large AI model to identify areas with stationary vehicles. Due to the aforementioned separation of dynamic objects, only static objects remain in the target image, eliminating the interference of dynamic vehicles and enabling the large AI model to easily and accurately identify abnormally parked vehicles.
[0047] Furthermore, the method also includes the following steps: S200: When the light intensity corresponding to the target video is less than a preset light intensity threshold, or during a preset nighttime period, grayscale conversion is performed on each frame of the target video to obtain several grayscale images. In specific implementations, those skilled in the art set the preset nighttime period based on the nighttime conditions in the area where the highway is located, which will not be elaborated here. Since different weather conditions can lead to different nighttime periods, light intensity can also be used as a prerequisite for image grayscale conversion.
[0048] S300: Analyze the grayscale value changes of pixels in each frame of grayscale image. Based on the grayscale value changes of each pixel, select pixels whose corresponding grayscale values show periodic changes as flashing pixels. Obtain the flashing frequency and the dwell time of each grayscale value in any change cycle for each flashing pixel.
[0049] S400: When the flashing frequency of the flashing pixel and the dwell time at each gray value in any change cycle both meet the preset flashing attributes, the flashing pixel is marked and adjacent flashing pixels are connected in sequence. The connected area is located and characterized as a stationary vehicle area. This can be understood as: connecting flashing pixels whose positions do not change to obtain a circular or approximately circular connected area as the vehicle's hazard lights area, used to locate the vehicle. The specific shape of the connected area can vary depending on the vehicle model.
[0050] Specifically, the preset flashing attributes include a flashing frequency range and a flashing duration range for different grayscale values. For example, the flashing frequency of most vehicles' hazard lights is 1 Hz, and the on and off times of most vehicles are equal, each 0.5 seconds. However, some models have an on time that is longer than the off time. Those skilled in the art can set the flashing frequency range and the flashing duration range for different grayscale values according to actual needs, which will not be elaborated here.
[0051] As mentioned above, since abnormally parked vehicles will turn on their hazard lights, and the flashing frequency and duration of the hazard lights change in a fixed cycle, by analyzing the flashing pixels in the video, the hazard light area can be accurately screened out. This enables accurate positioning of stationary vehicles even in unclear shooting environments such as at night, further enhancing the recognition effect of abnormally parked vehicles.
[0052] S500: When a stationary vehicle area is identified, the stationary duration of the corresponding stationary vehicle in the stationary vehicle area is recorded. When the stationary duration exceeds a second preset duration, the stationary vehicle is identified as an abnormally parked vehicle and an alarm is triggered. Those skilled in the art can set the second preset duration according to actual needs, for example, 5-10 seconds.
[0053] In one specific embodiment, the stationary duration of stationary vehicles corresponding to the stationary vehicle area is recorded through the following steps: S501, when a stationary vehicle region is identified, mark the centroid of the stationary vehicle region in the target image.
[0054] S502, based on the target image and several consecutive frames after the target image, sequentially obtain the centroid distance between the stationary vehicle regions in every two adjacent consecutive frames.
[0055] S503, when the centroid distance between stationary vehicle regions in two adjacent consecutive frame images is less than a preset distance threshold, the corresponding vehicle is determined to be stationary, and the total duration of the stationary state is updated in real time as the stationary duration of the stationary vehicle; this can be understood as: when the updated total duration of the stationary state exceeds the second preset duration, recording can be stopped.
[0056] Furthermore, the S500 procedure also includes the following steps: S510, when a stationary vehicle area is identified, it is determined whether the stationary vehicle area is within a preset defined area in the target image. Those skilled in the art can set the preset defined area according to actual needs, such as the area between guardrails on both sides of a highway.
[0057] S520, when the stationary vehicle area is within a preset defined area in the target image, the step of recording the stationary duration of the stationary vehicle corresponding to the stationary vehicle area is executed; otherwise, the execution step is terminated.
[0058] As mentioned above, by setting a preset area, the influence of stationary vehicles on side roads under the highway can be avoided, thereby improving the reliability of identifying abnormally parked vehicles on the highway.
[0059] In some other implementation scenarios, highways can be replaced with similar scenarios such as tunnels, elevated roads, or expressways. The specific implementation method is described above. That is, by shooting videos of the target road segment in the tunnel, elevated road, or expressway, dynamic objects identified from the video images are subtracted, thereby achieving target enhancement for stationary vehicles. Then, the pixel changes of the static image are analyzed, and even in images with low resolution, the areas of stationary vehicles and obstacles can be accurately and quickly found, which is applicable to a variety of scenarios.
[0060] In summary, this invention provides a method for identifying abnormal vehicles on highways. When an abnormal event is detected on a target road segment, the method acquires the target video corresponding to that segment. The target video refers to a video taken from the current moment to a first preset duration. This eliminates the need for constant analysis and data processing of monitored vehicles on the highway; image analysis of the target video is sufficient, significantly reducing data processing volume. Then, the method analyzes the changes in preset indicators of pixels in each frame of the target video. Based on the frequency of several preset indicators corresponding to each pixel, dynamic objects are separated from each frame, resulting in the target image for each frame. By separating dynamic pixels, dynamic objects in the image are eliminated, avoiding interference from dynamic vehicles during image analysis, thus enhancing the recognition of static objects in static pixels. Furthermore, pixel analysis of the target image identifies stationary vehicle regions and records the stationary duration of the corresponding stationary vehicles. Since stationary vehicles become more prominent after removing dynamic vehicles, pixel difference analysis can accurately identify differentiated pixels even in low-resolution images, improving the accuracy of identifying abnormally parked vehicles.
[0061] Embodiments of the present invention also provide a non-transitory computer-readable storage medium that can be disposed in an electronic device to store at least one instruction or at least one program related to implementing a method in the method embodiments, wherein the at least one instruction or the at least one program is loaded and executed by the processor to implement the method provided in the above embodiments.
[0062] Embodiments of the present invention also provide an electronic device, including a processor and the aforementioned non-transitory computer-readable storage medium.
[0063] While specific embodiments of the invention have been described in detail by way of example, those skilled in the art should understand that the examples are for illustrative purposes only and not intended to limit the scope of the invention. It should also be understood that various modifications can be made to the embodiments without departing from the scope and spirit of the invention. The scope of the invention is defined by the appended claims.
Claims
1. A method for identifying abnormal vehicles on highways, characterized in that, The method includes the following steps: S100, when an abnormal event is determined to have occurred on a target section of the highway according to a preset judgment rule, the target video corresponding to the target section is acquired; the target video refers to a video taken with the current moment as the starting point and for a first preset duration. S200: When the light intensity corresponding to the target video is less than the preset light intensity threshold or during the preset nighttime period, perform grayscale conversion on each frame of the target video to obtain several grayscale images. S300, analyze the gray value changes of pixels in each frame of grayscale image, and select pixels whose corresponding gray values show periodic changes as flashing pixels based on the gray value changes of each pixel, and obtain the flashing frequency and the dwell time of each gray value in any change cycle for each flashing pixel. S400, when the flashing frequency of the flashing pixel meets the preset flashing frequency range, and the dwell time of each gray value in any change cycle meets the preset flashing duration range of the corresponding gray value, the flashing pixel is marked and adjacent flashing pixels are connected in sequence, the connected area is located and characterized as a stationary vehicle area. S500: When a stationary vehicle area is identified, the stationary duration of the corresponding stationary vehicle in the stationary vehicle area is recorded. When the stationary duration exceeds a second preset duration, the stationary vehicle is identified as an abnormally parked vehicle and an alarm is triggered.
2. The method for identifying abnormal vehicles on highways according to claim 1, characterized in that, Following step S100, the method further identifies stationary vehicle areas through the following steps: S10: Analyze the changes in preset indicators of pixels in each frame of the target video, and separate the dynamic object from each frame of the given image based on the frequency of several preset indicators corresponding to each pixel, so as to obtain the target image corresponding to each frame of the given image. The preset index is a grayscale value or an RGB value; S20 identifies stationary vehicle areas from the target image by performing pixel analysis on the target image.
3. The method for identifying abnormal vehicles on highways according to claim 2, characterized in that, The method can also obtain the target image corresponding to each given image frame through the following steps: S1, using the corresponding video image algorithm for background subtraction, performs background modeling and foreground detection on the target video to obtain the dynamic object; S2 separates the pixels corresponding to the dynamic object in each frame of a given image to obtain the target image corresponding to each frame of a given image.
4. The method for identifying abnormal vehicles on highways according to claim 2, characterized in that, Step S10 includes the following steps: S11, when the preset index is grayscale value, obtain k target grayscale values corresponding to each pixel based on k given images in the target video; where k is the total number of given images in the target video. S13, for any pixel, obtain a number of gray value frequencies corresponding to the pixel based on the k target gray values corresponding to the pixel, and take the maximum gray value frequency among the number of gray value frequencies as the first target frequency corresponding to the pixel. S15, based on the first target frequency corresponding to each pixel, the pixels whose first target frequency is greater than a preset frequency threshold are determined as static pixels, and the pixels whose first target frequency is not greater than the preset frequency threshold are determined as dynamic pixels. S17: For any given image frame, subtract the dynamic pixels corresponding to the given image and combine them with a pre-constructed historical background image to obtain the target image corresponding to the given image.
5. The method for identifying abnormal vehicles on highways according to claim 2, characterized in that, Step S10 also includes the following steps: S12, when the preset index is RGB value, obtain k RGB values corresponding to each pixel based on k given images in the target video; where k is the total number of given images in the target video. S14. For any pixel, based on several pre-divided RGB value intervals, determine the RGB value interval corresponding to each RGB value of the pixel, and determine the number of RGB values corresponding to each RGB value interval as the RGB value frequency. S16, based on the frequency of several RGB values corresponding to a pixel, the frequency of the maximum RGB value is taken as the second target frequency corresponding to the pixel; S18, based on the second target frequency corresponding to each pixel, pixels whose second target frequency is greater than a preset frequency threshold are determined as static pixels, and pixels whose second target frequency is not greater than the preset frequency threshold are determined as dynamic pixels.
6. The method for identifying abnormal vehicles on highways according to claim 2, characterized in that, Step S20 includes the following steps: S21, compare the target image with the pre-constructed historical background image, and find the pixels whose corresponding pixel grayscale value change rate exceeds the preset change rate threshold as the difference pixels; S22, morphological processing is performed on the difference pixels in the target image, and several connected contour regions are determined based on the processed difference pixels; S23, based on preset vehicle contour attributes, filter out non-vehicle areas from several connected contour areas to identify stationary vehicle areas.
7. The method for identifying abnormal vehicles on highways according to claim 6, characterized in that, The following steps are included after step S22: S221, Based on the pixels corresponding to each connected contour region, the object category corresponding to each connected contour region is determined by a semantic segmentation model or a multimodal large model. S222, determine the obstacle category from the object categories corresponding to several connected contour regions, and determine the obstacle's location information based on the connected contour regions corresponding to the obstacle category.
8. The method for identifying abnormal vehicles on highways according to claim 1, characterized in that, Record the stationary duration of vehicles corresponding to the stationary vehicle area using the following steps: S501, When a stationary vehicle region is identified, mark the centroid of the stationary vehicle region in the target image; S502, based on the target image and several consecutive frame images after the target image, sequentially obtain the centroid distance between the stationary vehicle regions in every two adjacent consecutive frame images; S503, when the centroid distance between stationary vehicle regions in two adjacent consecutive frame images is less than a preset distance threshold, the corresponding vehicle is determined to be stationary, and the total duration of the stationary state is updated in real time as the stationary duration of the stationary vehicle.
9. A non-transitory computer-readable storage medium, wherein the storage medium stores at least one instruction or at least one program segment, characterized in that, The at least one instruction or the at least one program segment is loaded and executed by the processor to implement the highway abnormal vehicle identification method as described in any one of claims 1-8.
10. An electronic device, characterized in that, Includes a processor and the non-transitory computer-readable storage medium as described in claim 9.