A method for detecting a pedestrian violation of a road barrier
By combining instance segmentation and semantic segmentation algorithms with the Deepsort algorithm, the high false positive rate and occlusion problems of pedestrian illegal crossing detection in existing technologies are solved, achieving high-precision pedestrian illegal crossing detection and realizing intelligent and real-time road monitoring.
Patent Information
- Application Number
- CN202311228274.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-22
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2043-09-22
AI Technical Summary
Existing technologies have high false alarm rates and cannot detect situations where legs are obscured when detecting pedestrians illegally crossing road medians, especially when the road guardrails are curved. Furthermore, they require information about specific parts of the pedestrian's body, leading to inaccurate detection.
Instance segmentation is used to detect targets in the monitoring scene. Each pixel is classified, and the pixel coordinates and ground area probabilities are initialized. Instance segmentation and semantic segmentation algorithms are combined with the Deepsort algorithm for target tracking. Changes in the median strip area are judged and combined with the pedestrian position to determine whether there is any climbing behavior.
It improves the accuracy and convenience of detection, enabling timely and effective detection of pedestrians illegally crossing the median strip, and achieving intelligent, real-time, and timely supervision of roads.
Smart Images

Figure CN117095335B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to a method for detecting illegal crossing of a road separation strip, in particular to a method for detecting illegal crossing of a road separation strip by a pedestrian, and belongs to the technical field of road safety. BACKGROUND
[0002] With the rapid development of society and the increasing prosperity of people's life, the number of motor vehicles is increasing, and a separation strip is essential to ensure road traffic safety. In some traffic arteries, pedestrians often illegally cross the separation strip in the middle of the road for convenience, do not use the pedestrian crossing according to the regulations, or arbitrarily cross the separation strip in the middle of the road. These behaviors that ignore road regulations and ethics will constitute a huge traffic safety hazard. If not timely warned and corrected, it will cause serious safety and economic problems. Figure One
[0003] In the traditional inspection of the illegal behavior of crossing the separation strip, traffic police personnel are usually arranged to supervise on site at the road or intersection, but this method not only consumes a lot of manpower, but also the range covered by the traffic police personnel is very limited and cannot achieve all-weather supervision. If the edge computing technology is used to access the camera video stream at the Internet of Things terminal device in real time, the artificial intelligence deep learning method is used to identify and detect the separation strip in the road, and then the computer vision method is used to judge whether there is the behavior of the pedestrian illegally crossing the separation strip. Undoubtedly, it is a good solution.
[0004] Publication No. CN115713726A proposes a method, device and medium for detecting pedestrians crossing traffic barriers. The method acquires frame images in the video to be identified, detects the frame images, determines the traffic barrier region in the frame images, and determines the target region where the two legs of the pedestrian in the frame images are located. If the two target regions of the pedestrian in the frame images are located on one side or the other side of the traffic barrier region, the frame image is determined to be a first target image or a second target image, and if the two target regions of the pedestrian in the frame images are located on both sides of the traffic barrier region, the frame image is determined to be a third target image. If the first target image, the second target image and the third target image are determined in the video to be identified, it is determined that the pedestrian crosses the traffic barrier, so that the image of the pedestrian crossing the traffic barrier is collected in real time, and the accuracy and real-time performance of detecting the pedestrian crossing the traffic barrier are improved.
[0005] But this method still has some problems: the minimum circumscribed rotating matrix method is used to generate the detection area according to the road guardrail segmentation result. When the road guardrail is a curve, the corresponding minimum circumscribed rotating matrix will include a large non-road guardrail area, and the finally generated detection area will include more non-road guardrail area, which will greatly increase the misjudgment rate of crossing the guardrail; and the position information of the two legs of the pedestrian is needed to make a judgment whether to cross the guardrail, and when the legs of the pedestrian are blocked, the detection cannot be made. For example, when the legs of the pedestrian are blocked by wearing a skirt, the method cannot detect. SUMMARY
[0006] Hereinafter, a brief summary of the present application is given in order to provide a basic understanding of some aspects of the present application. It should be understood that this summary is not an exhaustive overview of the present application. It is not intended to identify key or important parts of the present application nor is it intended to limit the scope of the present application. Its sole purpose is to present some concepts in a simplified form as a prelude to the more detailed description that is discussed later.
[0007] In view of this, in order to solve the technical problems existing in the prior art, the present application provides a pedestrian illegal crossing road barrier detection method. The present application uses an instance segmentation method to detect targets in the monitoring scene while classifying each pixel point; neither manual labeling of target areas nor detection of specific parts of pedestrians is required, and the fitting of the barrier target area is very accurate; greatly improving the accuracy and convenience of event judgment.
[0008] Scheme one, a pedestrian illegal crossing road barrier detection method, comprising the following steps:
[0009] S1. Collecting road video stream information, image processing the video stream information;
[0010] S2. Obtaining instance segmentation information of different objects and pedestrians in the image;
[0011] S3. Judging the road barrier in the scene;
[0012] S31. Initializing the pixel coordinates X, Y and the probability p of each ground area being a barrier, wherein the p value is bound with the area UID;
[0013] S32. Taking the top-left pixel as the starting point, saving the ground area information and corresponding UID of the pixel to a temporary list;
[0014] S33. Processing the next pixel information, saving the ground area and corresponding UID to which the pixel point belongs in the dictionary data structure in the order of the positive direction of the X axis, according to the actual input image size, when the X coordinate is greater than or equal to the maximum value of the image width, switching to the next row of pixel points for processing, and updating the dictionary to be empty at the same time;
[0015] S34. When new pixel information is added to the list, check whether the newly added pixel point belongs to the highway area category, if yes, execute S35, otherwise execute S33;
[0016] S35. Check whether there is a pixel point belonging to different UID highway area in the historical pixel information, if yes, execute S36, otherwise execute S33;
[0017] S36. Check whether other category ground area pixels are contained between the two different UID highway area pixels, if yes, increase the probability value p of the ground area being a separation belt by 1 until the probability p of the ground area remains unchanged before searching the next row of pixels, otherwise execute S33;
[0018] S37. Check whether there is a ground area with a probability value of being a separation belt greater than or equal to 100, if yes, output the ground area and UID, output the ground area as a separation belt area, if there is a next pixel point, execute S33, otherwise end;
[0019] S4. Analyzing whether the pedestrian has the behavior of crossing the separation belt;
[0020] Preferably, the method for collecting road video stream information and performing image processing on the video stream information comprises the following steps:
[0021] S11. Accessing camera video stream information: using RJ45 Ethernet cable to connect the network interface of the camera and the edge computing gateway, and accessing the real-time video stream information collected by the camera through the RTSP video stream address;
[0022] S12. Video decoding: decoding the original video into a single frame picture in a unified RGB format;
[0023] S13. Video preprocessing: performing color space conversion and image filtering and denoising processing on the single frame picture.
[0024] Preferably, the method for obtaining instance segmentation information of different objects and pedestrians in an image comprises the following steps:
[0025] S21. Constructing a traffic scene instance segmentation dataset and training model weights;
[0026] S22. Analyzing the scene picture based on a semantic segmentation algorithm.
[0027] Preferably, the method for constructing a traffic scene instance segmentation dataset and training model weights comprises the following steps:
[0028] S211. Obtain pictures under a traffic monitoring view field, and save the pictures in png format to a local folder image_2, wherein the resolution of the pictures is 1920*1080;
[0029] S212. Label the preprocessed picture set using a labeling tool Labelme, perform instance segmentation labeling on road traffic targets and zebra crossings, and refer to the cityscapes dataset for the instance segmentation label format; and finely label the true value information of different ground regions, wherein the ground regions include roads and sidewalks.
[0030] S213. Save the ground region true value files and the instance segmentation label files of the traffic participating targets corresponding to the scene pictures to a label_2 folder;
[0031] S214. Divide the data into a training set and a test set; randomly extract 80% of the pictures in the image_2 folder as the training set and place the pictures in a training folder, and the remaining 20% is the test set and is placed in a testing folder, and then package the dataset into a corresponding directory of a deep learning model training environment of a high-performance GPU server;
[0032] S215. Use a SOLOv2 instance segmentation algorithm to perform transfer learning under the condition of the labeled data set using a pre-trained model, and obtain a high-precision instance segmentation model.
[0033] Preferably, the method for analyzing a scene picture based on a semantic segmentation algorithm comprises the following steps:
[0034] S221. The pixel point coordinates of the upper left corner of the image are (0, 0), a coordinate system is established by setting the horizontal direction as the X axis and the right direction as the positive direction, and the vertical direction as the Y axis and the downward direction as the positive direction;
[0035] S222. The instance segmentation model labels the ground true value regions and the road traffic targets of the same category with the same color, and labels different categories with different colors.
[0036] S223. Perform target tracking on the ground regions based on a Deepsort algorithm, and mark different UID for different ground regions of the same category to distinguish them.
[0037] S224. For each independent ground region, all pixel point coordinates in the region are taken as input, linear regression is performed on a monomial equation, and the monomial equation obtained for each region is bound to the UID in a one-to-one manner.
[0038] Preferably, the method for analyzing whether the pedestrian has the behavior of crossing the isolation belt comprises the following steps:
[0039] S41. Taking a monomial equation y=a*x as a linear regression equation, taking the pixel coordinate information contained in each ground area as input, performing regression calculation on each ground area, and obtaining a regression equation bound with the UID;
[0040] S42. Setting a slope threshold, judging whether the slope change of the ground area exceeds the slope threshold, and recording the UID of the isolation belt area when the slope threshold is exceeded, and the slope threshold range is ±0.1;
[0041] S43. Saving the region information to a dictionary data structure by taking the UID as a key value;
[0042] S44. Retrieving whether the UID region pixel point in the dictionary data structure is adjacent to the pedestrian pixel one by one, if the isolation belt region is adjacent to the pedestrian pixel, it is judged that the pedestrian violates the crossing guardrail behavior, otherwise, it is returned that there is no pedestrian violation crossing guardrail behavior.
[0043] Scheme two, an electronic device comprising a memory and a processor, the memory stores a computer program, and the processor executes the computer program to realize the steps of the pedestrian violation crossing road isolation belt detection method in scheme one.
[0044] Scheme three, a computer readable storage medium, which stores a computer program, and the computer program is executed by the processor to realize the pedestrian violation crossing road isolation belt detection method in scheme one.
[0045] The beneficial effects of the present application are as follows: the present application adopts edge meter and deep learning technology to perform image recognition analysis on the real-time video stream of the camera at the edge of the roadside camera, and judges whether there is the behavior of pedestrian violation crossing the isolation belt through the method of computer vision, so that the behavior of pedestrian violation crossing the isolation belt with high safety hidden danger can be found in time and effectively, and the effective supervision of the intelligent, real-time and timely management of the road is realized. BRIEF DESCRIPTION OF DRAWINGS
[0046] The drawings described herein are used to provide further understanding of the present application, and form a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application, and do not constitute an improper limitation on the present application. In the drawings:
[0047] Figure 1 It is a flow chart of a pedestrian violation crossing road isolation belt detection method;
[0048] Figure 2The schematic diagram of slope change in the isolation zone is shown. Wherein, a is before the slope change, and b is after the slope change. DETAILED DESCRIPTION
[0049] In order to make the technical solutions and advantages in the embodiments of the present application clearer, the exemplary embodiments of the present application are further described in detail below with reference to the drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.
[0050] Embodiment 1, reference Figures 1-2 In this embodiment, a pedestrian violation detection method for crossing a road isolation zone includes the following steps:
[0051] S1. Collecting road video stream information, and performing image processing on the video stream information;
[0052] S11. Accessing camera video stream information: using RJ45 Ethernet network cable to connect the network interface of the camera and the edge computing gateway, and accessing the real-time video stream information collected by the camera through the RTSP video stream address;
[0053] S12. Video decoding: decoding the original video into a single frame picture in a unified RGB format;
[0054] S13. Video preprocessing: converting the color space of the single frame picture and performing image filtering and denoising processing, so as to improve the picture and facilitate further processing of the image information;
[0055] S2. Obtaining instance segmentation information of different objects and pedestrians in the image;
[0056] Different objects include objects on the road such as highways, sidewalk ground areas, street lamps, zebra crossings, green belts, and road traffic participants;
[0057] The instance segmentation model is constructed, and based on the deep learning algorithm, the hyperparameters are continuously screened and optimized, and a large number of labeled instance segmentation data sets are used for transfer learning training based on the pre-trained model to obtain the instance segmentation model;
[0058] S21. Constructing a traffic scene instance segmentation data set and training model weights;
[0059] S211. Obtaining pictures under a traffic monitoring view scene, and saving them to a local folder image_2 in png format, wherein the resolution of the pictures is 1920*1080;
[0060] Specifically, the pictures under the traffic monitoring view scene are obtained according to actual needs, and can use public data sets or self-collected data;
[0061] S212. Using the annotation tool Labelme to annotate the preprocessed picture set, instance segmentation annotation is performed for road traffic targets and zebra crossings, and the instance segmentation label format refers to the cityscapes data set; fine annotation of true value information of different ground areas, wherein the ground areas include roads and sidewalks;
[0062] S213. Save the ground area true value file and the instance segmentation label file of the traffic participating target corresponding to the scene picture to the label_2 folder;
[0063] S214. Divide the data into a training set and a test set; randomly extract 80% of the pictures in the image_2 folder as the training set and put them into the training folder, and the remaining 20% is the test set and is put into the testing folder, and then the data set is packaged and put into the corresponding directory of the deep learning model training environment of the high-performance GPU server;
[0064] S215. Use the SOLOv2 instance segmentation algorithm to perform transfer learning under the condition of the annotated data set using the pre-trained model to obtain a high-precision instance segmentation model;
[0065] S22. Analyze the scene picture based on the semantic segmentation algorithm;
[0066] In the field of computer vision, the pixel position at the top left corner of a picture is usually set as the zero point, and the horizontal direction is set as the X axis, the right direction is positive, the vertical direction is set as the Y axis, and the downward direction is positive to establish a coordinate system; The pixel point coordinate system usually uses the coordinate system, and each pixel point is positioned and operated using the pixel coordinate system;
[0067] S221. The pixel point coordinate at the top left corner of the image is (0, 0), and the horizontal direction is set as the X axis, the right direction is positive, the vertical direction is set as the Y axis, and the downward direction is positive to establish a coordinate system;
[0068] S222. The instance segmentation model marks the ground true value area and the road traffic target of the same category with the same color, and the different categories have different colors;
[0069] S223. Based on the Deepsort algorithm, the ground area is tracked, and different ground areas of the same category are marked with different UIDs for distinction;
[0070] S224. For each independent ground area, all pixel point coordinates in the area are input, and linear regression is performed on a first-order equation, and the first-order equation obtained by each area is bound to the UID one by one;
[0071] S3. Determine the road separation belt in the scene;
[0072] S31. Input image, initialize pixel coordinates X, Y and the probability p of each ground area being a separation zone, wherein the value of p is bound with the area UID;
[0073] Specifically, the image resolution is 1920*1080, wherein the image width is 1920 and the image height is 1080.
[0074] S32. Take the upper left pixel as the starting point, save the ground area information and the corresponding UID of the pixel to a temporary list;
[0075] S33. Process the next pixel information, save the ground area and the corresponding UID of the pixel to a dictionary data structure with the UID as the key value in the order of the positive direction of the X axis, and update the dictionary to be empty when the X coordinate is greater than or equal to the maximum value of the image width according to the actual input image size, and switch to the next row of pixel points for processing;
[0076] S34. When new pixel information is added to the list, check whether the newly added pixel point belongs to the highway area category, if yes, execute S35, otherwise execute S33;
[0077] S35. Check whether there is a pixel point belonging to different UID highway area in the historical pixel information, if yes, execute S36, otherwise execute S33;
[0078] S36. Check whether other types of ground area pixels are contained between the two different UID highway area pixels, if yes, increase the probability value p of the ground area being a separation zone by 1 until the probability p of the ground area remains unchanged before searching the next row of pixels, otherwise execute S33;
[0079] S37. Check whether there is a ground area with a probability value of being a separation zone greater than or equal to 100, if yes, output the ground area and UID, output the ground area as a separation zone, if there is a next pixel point, execute S33, otherwise end;
[0080] S4. Analyze whether the pedestrian has a behavior of crossing the separation zone;
[0081] Specifically, when there is no object in the ground area, the area of the ground area will not be blocked, so the equation obtained by regression of all pixel points will not change (see Figure 2 a), when the ground area is partially blocked, the equation obtained by regression of the entire ground area will change slightly, and by setting the acceptable slope change interval of the linear regression equation, the false alarm frequency of the pedestrian violation of crossing the separation zone can be reduced (see Figure 2b), therefore, setting the slope change a of the linear regression equation of the monomial equation (y = a * x) in the interval of ±0.1 is an acceptable interval of the linear regression equation change tolerance interval of the isolation belt region. The interval can be adjusted according to the actual application scene.
[0082] S41. Taking the monomial equation y = a * x as a linear regression equation, the pixel coordinate information contained in each ground area is taken as input, and each ground area is calculated by regression to obtain a regression equation bound to the UID;
[0083] S42. Set the slope threshold, judge whether the slope change of the ground area exceeds the slope threshold, and record the UID of the isolation belt region when the slope threshold is exceeded, and the slope threshold range is ±0.1;
[0084] S43. Save the region information to the dictionary data structure as the key value of the isolation belt region UID;
[0085] S44. Retrieve the UID region pixel points in the dictionary data structure one by one to see if there are pedestrian pixels adjacent, if there are isolation belt regions adjacent to the pedestrian pixels, it is judged that the pedestrian violates the barrier behavior, otherwise it returns that there is no pedestrian violation of the barrier behavior.
[0086] The working process of the application: in the road edge terminal device, by accessing the real-time video stream of the camera sensor, first, the video stream is decoded into picture data, and the picture data is preprocessed such as color space conversion and filter denoising, which is convenient for subsequent input into the deep learning model for inference; then the instance segmentation deep learning model is inferred to obtain the category to which each pixel belongs and the coordinate information of each target frame; finally, the computer vision method is used to judge whether there is a pedestrian violation of the isolation belt behavior, specifically, first, according to the category and position information of each pixel, it is judged in real time whether there is an isolation belt region in the monitoring scene, then all the pixels in the isolation belt region are calculated by regression using a monomial equation, when the monitoring scene appears a pedestrian target and the regression equation of the isolation belt region changes greatly, it is further judged whether the pedestrian pixel is adjacent to the isolation belt pixel, and finally the prediction result of the pedestrian violation of the isolation belt is obtained.
[0087] The application can automatically identify the isolation belt region in the target scene, greatly facilitating the user and simplifying the deployment process; the instance segmentation algorithm not only can detect the target in the scene, but also can realize the accurate classification of each pixel point, and the operation of analyzing and judging pixel by pixel according to the instance segmentation result, and taking the change degree of the regression equation of the isolation belt pixel as the auxiliary judgment basis greatly improves the accuracy of this detection method.
[0088] Embodiment 2, the computer device of the present application can be a device comprising a processor and a memory, such as a single-chip microcomputer comprising a central processing unit, and the like. The processor is used to execute the computer program stored in the memory to realize the steps of the above-mentioned pedestrian violation detection method for jumping over road isolation belts.
[0089] The processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.
[0090] The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, and the like), and the like; and the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, and the like), and the like. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other volatile solid-state memory devices.
[0091] Embodiment 3, computer readable storage medium embodiment
[0092] The computer readable storage medium of the present application can be any form of storage medium readable by the processor of the computer device, including but not limited to a non-volatile memory, a volatile memory, a ferroelectric memory, and the like, and the computer readable storage medium stores a computer program. When the processor of the computer device reads and executes the computer program stored in the memory, the steps of the above-mentioned pedestrian violation detection method for jumping over road isolation belts can be realized.
[0093] The computer readable medium can include any entity or apparatus capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, software distribution medium, etc. It should be noted that the computer readable medium contains content that can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
[0094] Although the present application has been described in terms of limited number of embodiments, those skilled in the art, with the benefit of the description, will appreciate that other embodiments can be envisaged within the scope of the application described herein. Furthermore, it should be noted that the language used in the specification has been chosen primarily for readability and instructional purposes and can not have been chosen to convey 5 all technical details. Therefore, a number of modifications and variations are possible in light of the above teachings without departing from the scope and spirit of the appended claims. The disclosure of the application is illustrative only and not restrictive of the scope of the application, which is defined by the appended claims.
Claims
1. A method for detecting pedestrians illegally crossing road medians, characterized in that, Includes the following steps: S1. Collect road video stream information and perform image processing on the video stream information; S2. Obtain instance segmentation information for different objects and pedestrians in the image; S3. Determine the road median strip in the scene; S31. Initialize pixel coordinates X, Y and the probability p of each ground area being an isolation zone, where the value of p is bound to the area UID; S32. Starting from the top left pixel, save the ground area information and corresponding UID of the pixel to a temporary list; S33. Process the next pixel information. Save the ground region to which the pixel belongs and the corresponding UID in the dictionary data structure with UID as the key value according to the positive X-axis direction. According to the actual input image size, when the X coordinate is greater than or equal to the maximum image width, switch to the next row of pixels for processing, and update the dictionary to empty at the same time. S34. When new pixel information is added to the list, check whether the newly added pixel belongs to the highway area category. If it does, execute S35; otherwise, execute S33. S35. Check if there are any pixels in the historical pixel information that belong to different UID highway areas. If they do, execute S36; otherwise, execute S33. S36. Check whether there are other types of ground area pixels between two different UID highway area pixels. If they exist, increase the probability value p of the ground area being a segregation zone by 1 until the probability p of the ground area before the next row of pixels remains unchanged. Otherwise, execute S33. S37. Check if there is a ground area with a probability value greater than or equal to 100. If it exists, output the ground area and UID, and output that the ground area is an isolation zone area. If it exists, execute S33; otherwise, end. S4. Analyze whether pedestrians have crossed the median strip; including the following steps: S41. Using the linear equation y=a*x as the linear regression equation, the pixel coordinate information contained in each ground region is used as input, regression calculation is performed on each ground region, and the resulting regression equation is bound to the UID. S42. Set a slope threshold to determine whether the slope change of the ground area exceeds the slope threshold. When it exceeds the slope threshold, record the UID of the isolation zone area. The slope threshold range is ±0.
1. S43. Use the UID as the key to save the region information into a dictionary data structure; S44. Search each pixel in the UID region of the dictionary data structure to see if there is a pedestrian pixel adjacent to it. If there is a barrier area adjacent to the pedestrian pixel, it is determined that a pedestrian has illegally climbed over the guardrail. Otherwise, it is returned that no pedestrian has illegally climbed over the guardrail.
2. The method for detecting pedestrians illegally crossing road medians according to claim 1, characterized in that, A method for acquiring road video stream information and performing image processing on the video stream information includes the following steps: S11. Access camera video stream information: Connect the camera and the network interface of the edge computing gateway using an RJ45 Ethernet cable, and access the real-time video stream information captured by the camera via RTSP video stream address; S12. Video Decoding: Decode the original video into single-frame images in a unified RGB format; S13. Video preprocessing: Perform color space conversion and image filtering and noise reduction on single-frame images.
3. The method for detecting pedestrians illegally crossing road medians according to claim 2, characterized in that, A method for obtaining instance segmentation information of different objects and pedestrians in an image includes the following steps: S21. Construct a traffic scene instance segmentation dataset and train the model weights; S22. Analyze scene images based on semantic segmentation algorithms.
4. The method for detecting pedestrians illegally crossing road medians according to claim 3, characterized in that, A method for constructing a traffic scene instance segmentation dataset and training model weights includes the following steps: S211. Obtain images from the traffic monitoring scene and save them in PNG format to the local folder image_2, where the image resolution is 1920*1080; S212. Use the labeling tool Labelme to label the preprocessed image set, and perform instance segmentation labeling for road traffic targets and zebra crossings. The instance segmentation label format should refer to the cityscapes dataset. Finely label the ground truth information of different ground regions, including roads and sidewalks. S213. Save the ground region ground truth file and the instance segmentation label file of the traffic participation target for the corresponding scene image to the label_2 folder; S214. Divide the data into training set and test set; randomly select 80% of the images in the image_2 folder as training set and put them into the training folder, and the remaining 20% as test set and put them into the testing folder. Then package the dataset and put it into the corresponding directory of the deep learning model training environment on the high-performance GPU server. S215. Using the SOLOv2 instance segmentation algorithm, a high-precision instance segmentation model is obtained by performing transfer learning on a pre-trained model with a labeled dataset.
5. The method for detecting pedestrians illegally crossing road medians according to claim 4, characterized in that, The method for analyzing scene images based on semantic segmentation algorithms includes the following steps: S221. The coordinates of the pixel at the top left corner of the image are (0,0). Establish a coordinate system with the horizontal direction as the X-axis, the rightward direction as the positive direction, the vertical direction as the Y-axis, and the downward direction as the positive direction. S222. The instance segmentation model marks ground truth regions and road traffic targets of the same category with the same color, while different categories are marked with different colors; S223. Based on the Deepsort algorithm, target tracking is performed on the ground area, and different ground areas of the same category are distinguished by different UIDs; S224. For each independent ground region, take the coordinates of all pixels in the region as input and perform linear regression using a linear equation in one variable. The linear equation obtained for each region is bound to a UID in a one-to-one correspondence.
6. An electronic device, characterized in that, It includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the method for detecting pedestrians illegally crossing road medians as described in any one of claims 1-5.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the method for detecting pedestrians illegally crossing the road median strip as described in any one of claims 1-5.