Method, system, device and storage medium for detecting vehicle occupying lane
Through the artificial intelligence vehicle road occupation detection method, monitoring image preprocessing and multiple data analysis, the problems of high cost and low efficiency in vehicle road occupation detection are solved, and high-accurate road occupation recognition and alarm push are achieved, which improves the Fire safety and management efficiency in the community.
Patent Information
- Application Number
- CN202210729948.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-24
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2042-06-24
AI Technical Summary
The prior art has problems of high employment costs and low processing efficiency in vehicle road occupation detection, making it difficult to effectively monitor and manage the vehicle road occupation on community roads, resulting in reduced fire safety and increased household disputes.
The artificial intelligence vehicle lane-occupying detection method is adopted, and the preprocessing of monitoring pictures and multiple data comparison and analysis is used, the object_detection_v2 model is used to identify the vehicle, calculate the vehicle confidence and intersection rate, determine whether the vehicle occupies the road, and push the road-occupying alarm information.
It improves the accuracy and versatility of vehicle road detection, achieves an accuracy rate of more than 90%, reduces safety hazards in property management, reduces labor costs, and improves fire safety and service efficiency in the community.
Smart Images

Figure CN115116036B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence vehicle detection, and in particular to a method, system, device and storage medium for detecting vehicles occupying a lane. Background Art
[0002] With the continuous development of the industry, the standards and requirements for property management are increasing day by day, and the management requirements for security, environmental protection, service efficiency, etc. of residential areas, parks, commercial entities and other business formats are becoming increasingly stringent. The smooth flow of roads inside and outside community parks has become an important guarantee for community safety. However, in real life, it is often seen that the roads inside and outside community parks are blocked by vehicles and illegally occupy the road. As a result, when a fire occurs in the community park, fire-fighting facilities cannot enter the community, and the blockage of vehicle entrances and exits leads to disputes among personnel.
[0003] In real life, property management companies have developed a series of industry service standards for passages inside and outside the community, and have used a series of methods such as offline inspections, offline patrols, and online video monitoring of community roads to solve the problem of vehicles occupying the road, thereby improving the community's fire safety and reducing disputes among residents.
[0004] However, in traditional solutions for controlling vehicles occupying the road, whether using supervisory personnel or third-party supervision software to assist in supervision, such as photo-taking and clocking-in systems, video surveillance to inspect road conditions, etc., they all face higher project labor costs and processing efficiency issues.
[0005] Therefore, it is necessary to develop a method, system, device and storage medium for detecting vehicles occupying the road with artificial intelligence with high accuracy. Summary of the Invention
[0006] In order to overcome the shortcomings of the existing technology, the purpose of the present invention is to provide a universal artificial intelligence vehicle lane occupation detection method, system, device and storage medium. By preprocessing the monitoring images and comparing and analyzing multiple data in different dimensions, a high-accuracy artificial intelligence algorithm is implemented to monitor whether the vehicle is occupying the road and input and push vehicle lane occupation warning information.
[0007] The present invention is achieved through the following technical solutions: a method for detecting vehicles occupying lanes, comprising: step S1: capturing a real-time image of a monitoring point; step S2: preprocessing the real-time image; step S3: performing object_detection_v2 model inference on the preprocessed image, outputting the target vehicle category, target vehicle confidence, and target vehicle rectangular coordinates; step S4: calculating the above output data, if the target vehicle category meets the vehicle category, the target vehicle confidence reaches or exceeds the vehicle confidence threshold, and the target vehicle rectangle falls within the recognition area, then outputting the target vehicle rectangular coordinates and calculating the color of the corresponding target vehicle; otherwise, repeating step S3; step S5: comparing step S4 The output target vehicle rectangular coordinate data and the vehicle identification rectangular data in the historical set are used to calculate the target vehicle intersection rate, and the target vehicle color is obtained. If the target vehicle intersection rate reaches or exceeds the vehicle intersection rate threshold, and the target vehicle color is the same as the vehicle color in the vehicle history cache set, then the current target vehicle is determined to be a historical parked vehicle, and the current stay time of the target vehicle is recorded, and step S6 is performed. Otherwise, the target vehicle data is saved as new parked vehicle data in the vehicle database in the historical set, and the vehicle database in the historical set is updated; step S6: when the current stay time of the target vehicle in step S5 is greater than the road occupying time threshold, then the current target vehicle is determined to be a road occupying vehicle, and the target vehicle road occupying warning information is output.
[0008] Furthermore, in step S1 , capturing the real-time image of the monitoring point is specifically performed by using a self-built frame extraction module to extract video frames of the target monitoring point in the monitoring area.
[0009] Furthermore, the preprocessing of the real-time image in step S2 includes step S21: cropping the identification area of the real-time image to obtain a picture of the image area to be detected; and step S22: performing geometric scaling and white-filling on the picture of the image area to be detected to obtain a preprocessed picture.
[0010] Furthermore, the recognition area cropping in step S21 is specifically cropping the real-time image according to the rectangular coordinates of the preset road occupation detection area on the monitoring point image.
[0011] Furthermore, in step S21, the image of the image area to be detected is scaled and filled with white space by dividing the longest side of the image of the image area to be detected by the length of the standard rectangle of the inference algorithm to calculate the ratio, and the image of the image area to be detected is scaled according to the ratio and placed in the standard rectangle, and the blank part in the standard rectangle is supplemented with white RGB processing.
[0012] Furthermore, obtaining the target vehicle color in step S5 specifically involves extracting each color vector value in the vehicle identification rectangle image data, and outputting the color name corresponding to the maximum value of the vector.
[0013] Another technical solution of the present invention is a system for detecting vehicles occupying the road, including: a data preset module, which presets and stores a road occupying time threshold, a vehicle confidence threshold, a vehicle intersection rate threshold, and the rectangular coordinates of the road occupying detection area on the monitoring point image; a data processing module, which executes steps S1 to S6 of the above-mentioned vehicle occupying the road detection method; and a data push module, which pushes the target vehicle occupying the road warning information output by the data processing module.
[0014] The third technical solution of the present invention is an electronic push device for detecting vehicles occupying lanes, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned method for detecting vehicles occupying lanes.
[0015] A fourth technical solution of the present invention is a storage medium storing processor-executable instructions, including: the processor-executable instructions are used to execute the above-mentioned method for detecting vehicle lane occupation when executed by the processor.
[0016] Compared with the prior art, the present invention can achieve the following beneficial effects:
[0017] Since the vehicle lane occupation detection method of the present invention pre-processes the real-time image according to the rectangular coordinates of the lane occupation detection area on the monitoring point image, and performs data calculations in multiple dimensions such as vehicle confidence, vehicle intersection rate, and storage lane occupation time, the versatility of the vehicle lane occupation detection method of the present invention is improved, and the accuracy of the result output of the present invention, system, device and storage medium is increased. By using artificial intelligence methods to infer and calculate whether there is a vehicle occupying the road at a given road position, a high-precision target recognition model is used for vehicle inference calculation, and a rigorous alarm event output is obtained after comprehensive evaluation of each processing algorithm, with an accuracy rate of more than 90%, which can reduce the safety hazards of perimeter roads in property management and greatly reduce labor costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 Shown is a flow chart of a method for detecting a vehicle occupying a lane according to the present invention;
[0019] Figure 2 The figure shows a schematic diagram of the image preprocessing process in the method for detecting vehicle occupying lanes according to the present invention. DETAILED DESCRIPTION
[0020] The present invention will be further described below in conjunction with the accompanying drawings and specific implementation methods. It should be noted that, under the premise of no conflict, the various embodiments or technical features described below can be arbitrarily combined to form new embodiments.
[0021] like Figure 1 As shown, an embodiment of the present invention discloses a flow chart of a method for detecting vehicles occupying the road. The method for detecting vehicles occupying the road provided in this embodiment is suitable for performing efficient vehicle occupying the road warning, and is specifically applied to an Internet of Things smart parking lot operation system consisting of a terminal device, a network and a server, wherein the network is a medium for directly providing a communication link between the terminal device and the server, which may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.; the operating system on the terminal device may include a handheld device operating system (iPhone operating system, iOS system), Android system or other operating system, and the terminal device is connected to the server through the network to achieve interaction, thereby performing operations such as receiving or sending data, etc., and specifically can be various electronic devices with a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, portable computers and desktop servers, etc. This embodiment can be applicable to situations where artificial intelligence pushes vehicle occupying the road warning information, and is typically applicable to property management of vehicle occupying the road in the community. The method can be executed by a vehicle occupying the road detection system, and the device can be implemented by software and / or hardware. Before executing the method for detecting vehicles occupying lanes, the threshold for the length of time a lane is occupied, the threshold for vehicle confidence, the threshold for vehicle intersection rate, and the rectangular coordinates of the lane occupation detection area on the monitoring point image are preset. Specifically, the threshold for the length of time a lane is occupied refers to the length of time a vehicle is judged to be occupying lanes. If a vehicle stays for more than this length of time, it is judged to be occupying lanes, and the unit is seconds; the vehicle confidence refers to the degree of credibility of the vehicle detection results, and a decimal value between 0 and 1 is configured based on the actual detection environment and the customer's accuracy requirements; the vehicle intersection rate indicates the degree of overlap of the two vehicle identification results: setting 1 requires an inclusion relationship between the two, setting 0 does not require intersection and means they are considered to be at the same location, and setting between 0 and 1 requires intersection to be considered to be at the same location; the larger the value, the larger the overlapping area required to be considered to be the same location.
[0022] See also Figure 1 The method for detecting a vehicle occupying a lane provided in this embodiment includes:
[0023] Step S1: Capture real-time images of monitoring points;
[0024] In this embodiment, capturing the real-time image of the monitoring point specifically involves using a self-built frame extraction module to extract video frames of the target monitoring point in the monitoring area.
[0025] Step S2: pre-processing the real-time image;
[0026] like Figure 2 As shown, the preprocessing includes step S21: cropping the identification area of the real-time image to obtain a picture of the image area to be detected; step S22: performing geometric scaling and white-filling on the image of the image area to be detected to obtain a preprocessed picture.
[0027] Furthermore, the recognition area cropping in step S21 is specifically performed by cropping the real-time image according to the rectangular coordinates of the preset road occupation detection area on the monitoring point image (composed of the left, top, right, and bottom of the rectangle). The image of the image area to be detected is specifically scaled and filled with white space by dividing the longest side of the image of the image area to be detected by the length of the standard rectangle of the inference algorithm (generally 640X640) to calculate the ratio, and scaling the image of the image area to be detected by the ratio and placing it in the standard rectangle. The blank part of the standard rectangle is filled with white RGB (255,255,255) processing.
[0028] Step S3: Perform object_detection_v2 model inference on the preprocessed image and output the target vehicle category, target vehicle confidence, and target vehicle rectangular coordinates;
[0029] Step S4: Calculate the output data. If the target vehicle category matches the detected vehicle category, the target vehicle confidence reaches or exceeds the vehicle confidence threshold, and the target vehicle rectangle falls within the recognition area, then output the target vehicle rectangle coordinates and calculate the corresponding target vehicle color. Otherwise, repeat step S3.
[0030] Step S5: Compare the target vehicle rectangular coordinate data output in step S4 with the vehicle identification rectangular data in the history set to calculate the target vehicle intersection rate and obtain the target vehicle color. If the target vehicle intersection rate reaches or exceeds the vehicle intersection rate threshold, and the target vehicle color is the same as the vehicle color in the vehicle history cache set, then the current target vehicle is determined to be a historically parked vehicle, and the current stay time of the target vehicle is recorded. Then, step S6 is performed. Otherwise, the target vehicle data is saved as new parked vehicle data in the vehicle database in the history set, and the vehicle database in the history set is updated.
[0031] Specifically, obtaining the target vehicle color in step S5 is specifically to extract each color vector value (red, orange, yellow, green, cyan, blue, violet, black, gray, white) in the vehicle identification rectangle image data, and output the color name corresponding to the maximum value of the vector.
[0032] Step S6: When the current stay time of the target vehicle in step S5 is greater than the road occupying time threshold, the current target vehicle is determined to be a road occupying vehicle, and the target vehicle road occupying warning information is output.
[0033] The method for detecting vehicles occupying the road of the present invention pre-processes the real-time image based on the rectangular coordinates of the road occupation detection area on the monitoring point image, and performs data calculations in multiple dimensions such as vehicle confidence, vehicle intersection rate, and storage road occupation time. This improves the versatility of the method for detecting vehicles occupying the road of the present invention, and also increases the accuracy of the output results of the present invention, system, device, and storage medium. It can flexibly set the number of detected vehicles occupying the road, set the triggering road occupation time, and output the detection results in the form of alarm events. Compared with traditional property management solutions, this technology can reduce the labor cost of management and achieve the purpose of reducing costs and increasing efficiency. At the same time, it improves the fire safety of the community and reduces disputes among residents.
[0034] and Figure 1 Corresponding to the method, an embodiment of the present invention also provides a system for detecting vehicles occupying the road, including: a data preset module, which presets and stores a road occupying time threshold, a vehicle confidence threshold, a vehicle intersection rate threshold, and the rectangular coordinates of the road occupying detection area on the monitoring point image; a data processing module, which executes steps S1 to S6 of the above-mentioned vehicle occupying the road detection method; and a data push module, which pushes the target vehicle occupying the road warning information output by the data processing module.
[0035] and Figure 1 Corresponding to the method, an embodiment of the present invention also provides an electronic push device for detecting vehicle occupying lanes, comprising at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned method for detecting vehicle occupying lanes.
[0036] and Figure 1 Corresponding to the method, an embodiment of the present invention further provides a storage medium storing processor-executable instructions, characterized in that the processor-executable instructions are used to execute the above-mentioned method for detecting vehicle lane occupation when executed by the processor.
[0037] The contents of the above method embodiments are all applicable to the present system embodiments. The functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0038] The processor may be a central processing unit (CPU), or 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, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the online recruitment intelligent recommendation system, and utilizes various interfaces and lines to connect various parts of the operational devices of the entire network Internet of Things smart parking lot operation system.
[0039] The memory can be used to store the computer programs and / or modules. The processor implements the various functions of the online recruitment intelligent recommendation system by running or executing the computer programs and / or modules stored in the memory and calling the data stored in the memory. 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 required for a function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created based on the use of the mobile phone (such as audio data, a phone book, etc.). 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 memory card (Smart-Media-Card, SMC), a secure digital (Secure-Digital, SD) card, a flash card (Flash-Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage device.
[0040] The above embodiments are only preferred embodiments of the present invention and cannot be used to limit the scope of protection of the present invention. Any non-substantial changes and replacements made by technicians in this field on the basis of the present invention fall within the scope of protection required by the present invention.
Claims
1. A method for detecting a vehicle occupying a lane, characterized in that: include: Step S1: Capture real-time images of monitoring points; Step S2: preprocessing the real-time image; Step S3: Perform object_detection_v2 model inference on the preprocessed image and output the target vehicle category, target vehicle confidence, and target vehicle rectangular coordinates; Step S4: judging the above output data, if the target vehicle category meets the detection vehicle category, the target vehicle confidence reaches or exceeds the vehicle confidence threshold, and the target vehicle rectangle falls within the recognition area, then output the target vehicle rectangle coordinates and calculate the color of the corresponding target vehicle, otherwise, repeat step S3; Step S5: Compare the target vehicle rectangular coordinate data outputted in step S4 with the vehicle identification rectangular data in the history set to calculate the target vehicle intersection rate, and obtain the target vehicle color. If the target vehicle intersection rate threshold reaches or exceeds the vehicle intersection rate threshold, and the target vehicle color is the same as the vehicle color in the vehicle history cache set, then the current target vehicle is determined to be a historically parked vehicle, and the current stay time of the target vehicle is recorded, and step S6 is performed. Otherwise, the target vehicle data is saved as new parked vehicle data in the vehicle database in the history set, and the vehicle database in the history set is updated. Step S6: When the current stay time of the target vehicle in step S5 is greater than the road occupying time threshold, the current target vehicle is judged as a road occupying vehicle, and the target vehicle road occupying warning information is output.
2. The method for detecting a vehicle occupying a lane according to claim 1, characterized in that: In step S1, capturing the real-time image of the monitoring point specifically involves using a self-owned frame extraction module to extract video frames for the target monitoring point in the monitoring area.
3. The method for detecting vehicle occupying a lane according to claim 1, characterized in that: The preprocessing of the real-time image in step S2 includes step S21: cropping the identification area of the real-time image to obtain a picture of the image area to be detected; and step S22: performing geometric scaling and whitening on the picture of the image area to be detected to obtain a preprocessed picture.
4. The method for detecting a vehicle occupying a lane according to claim 3, characterized in that: The recognition area cropping in step S21 is specifically to crop the real-time image according to the rectangular coordinates of the preset road occupation detection area on the monitoring point image.
5. The method for detecting vehicle occupying a lane as claimed in claim 3, characterized in that: The geometric scaling and whitening of the image in the image area to be detected in step S22 is specifically to calculate the ratio by dividing the longest side of the image in the image area to be detected by the length of the standard rectangle of the inference algorithm, and scaling the image in the image area to be detected with the ratio and putting it into the standard rectangle, and supplementing the blank part in the standard rectangle with white RGB processing.
6. The method for detecting a vehicle occupying a lane according to claim 1, characterized in that: In step S5, obtaining the target vehicle color specifically involves extracting each color vector value in the vehicle identification rectangular image data, and outputting the color name corresponding to the maximum value of the vector.
7. A system for detecting vehicle occupying a lane, characterized in that: include: A data preset module, which presets and stores the threshold of road occupation duration, vehicle confidence threshold, vehicle intersection rate threshold, and rectangular coordinates of the road occupation detection area on the monitoring point image; A data processing module, executing steps S1 to S6 of the method for detecting vehicle occupying a lane according to claim 1; The data push module pushes the target vehicle lane-occupying warning information output by the data processing module.
8. An electronic push device for detecting vehicle occupying the road, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for detecting vehicle lane occupation as described in any one of claims 1-6.
9. A storage medium storing instructions executable by a processor, characterized in that: include: The processor-executable instructions are used to execute a method for detecting vehicle lane occupation as described in any one of claims 1-6 when executed by the processor.