Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments that can be derived by one of ordinary skill in the art from the embodiments given herein are intended to be within the scope of the present invention.
The scheme provides a method for detecting and managing illegal parking vehicles based on urban roads, which can be used for distinguishing a forbidden parking area and a temporary parking area in a targeted manner so as to obtain more prepared illegal parking vehicle data, and can be used for carrying out big data analysis on the illegal parking vehicle data so as to carry out subsequent management and control on the illegal parking vehicles.
In a first aspect of the present disclosure, a method for detecting illegal parking vehicles based on urban roads is provided, which includes the following steps
Acquiring monitoring video images of continuous frames and selecting a monitoring area;
if the monitoring area is a no-parking area, detecting vehicle coordinate data and license plate numbers of vehicles in the monitoring area in the continuous frame monitoring video images, and if the deviation value of the vehicle coordinate data of the vehicles corresponding to the same license plate number is smaller than a position threshold value, determining that the vehicles are illegal-parking vehicles;
if the monitoring area is a temporary parking area, detecting the vehicle coordinate data and the license plate number of the vehicle in the monitoring area in the continuous frame of monitoring video images, if the deviation value of the vehicle coordinate data of the vehicle corresponding to the same license plate number is smaller than a position threshold value, carrying out face detection and parking duration statistics on the vehicle, and if the conditions that the face is detected and the parking duration is smaller than a duration threshold value are met simultaneously, the vehicle is a temporary parking vehicle.
In the scheme, the monitoring video images are selected from monitoring cameras installed on urban roads, the urban roads are divided into no-parking areas and temporary parking areas according to traffic demands, each monitoring camera monitors a specific area, and the monitoring video images of continuous frames of the same monitoring camera can be selected as judgment data.
And inputting the monitoring video images of the continuous frames into a illegal parking judgment module to judge illegal parking, and firstly selecting the monitoring area in the monitoring video images of the continuous frames. It is worth mentioning that the selection of the monitoring area may be manually selected, or may be automatically selected by a computer through deep learning. The no-parking area refers to an area where parking is forbidden, such as a pedestrian crossing, a yellow grid area, a bus stop, a bus lane or a fire fighting channel; the temporary parking area refers to an area where parking is possible, such as a taxi boarding and disembarking point.
Whether the temporary parking area or the no-parking area is aimed at, the vehicle coordinate data and the license plate number of the vehicle in the monitoring area in the monitoring video images of the continuous frames are detected, and the difference value between the offset value and the position threshold value of the vehicle coordinate data of the vehicle corresponding to the same license plate number is judged.
The method comprises the following specific steps:
inputting the monitoring video images of the continuous frames into a vehicle detection model for vehicle detection, and acquiring vehicle coordinate data of the vehicle, wherein the vehicle coordinate data at least comprises a vehicle center point coordinate and a vehicle width and height; and intercepting a vehicle area from the corresponding monitoring video image based on the vehicle coordinate data, carrying out license plate recognition on the vehicle area, acquiring the vehicle number, selecting the vehicle center point coordinates of the vehicles corresponding to the same license plate number, calculating whether the difference value between the vehicle center point coordinates is smaller than a position threshold value, and if the difference value is smaller than the position threshold value, identifying that the vehicle is in a stop state.
For the no-parking area, if the same vehicle stops in the no-parking area, the vehicle can be determined as a no-parking vehicle, that is, the vehicle is determined as the no-parking vehicle only when the offset value of the vehicle coordinate data is smaller than the position threshold value.
In contrast, in the temporary parking area, if a driver only stops the temporary parking area for a predetermined time, the driver does not belong to the parking violation vehicle. In particular, a temporary parking area for facilitating passengers to get on and off is provided at a location such as a station entrance of a railway station. For the temporary parking area, firstly, whether the vehicle is in a parking state is judged based on the preamble, and if the vehicle is in the parking state, subsequent detection is carried out, wherein the specific detection process is as follows:
inputting the vehicle area corresponding to the vehicle into a face detection model for face detection, and if no face is detected on the driver seat, directly judging that the vehicle is an illegal parking vehicle; if the driver seat detects a face, parking time statistics is carried out, if the parking time is not less than a parking threshold value, the vehicle is an illegal parking vehicle, and if not, the vehicle is a temporary parking vehicle.
It is worth mentioning that the method for counting the parking time length comprises the following steps: and selecting the time corresponding to the monitoring video image of the vehicle appearing earliest and the time corresponding to the monitoring video image of the vehicle appearing latest, and solving the difference between the two times as the parking time.
The vehicle detection model adopts a trained deep learning network framework, and specifically, the construction process of the vehicle detection model is as follows:
labeling training samples: preprocessing the collected monitoring video image, and converting the image size of the monitoring video image into W1×H1And labeling the monitoring video image, wherein the labeling information comprises the position coordinates of the center point of the vehicle and the width and height of the vehicle.
Building and training a vehicle detection network structure: the vehicle detection network structure adopts an hourglass network to extract features of input data to obtain a feature map, the feature map is connected with 3 convolutional layers, the 3 convolutional layers are respectively connected with a focal loss function, a central offset loss function and a frame size loss function, the vehicle detection network is trained by adopting the focal loss function, the central offset loss function and the frame size loss function until the loss functions are not reduced, the training is stopped, the focal loss function carries out a target central point and target category prediction task, the central offset loss function carries out a central point offset prediction task, and the frame size loss function carries out a target width and height prediction task.
And inputting the monitoring video images of the continuous frames into the vehicle detection model obtained based on the training, so that at least the coordinates of the center point of the vehicle and the width and the height of the vehicle can be obtained.
The license plate recognition process comprises the following steps: intercepting a vehicle region from a corresponding monitoring video image based on the vehicle coordinate data, inputting the vehicle region into an open-source license plate detection model for license plate detection, acquiring a license plate region, and transforming the size of the license plate region into W2×H2And inputting the license plate number into an open-source license plate recognition model for license plate recognition to obtain a license plate number.
The face detection model adopts a trained deep learning network framework, and specifically, the construction process of the face detection model is as follows:
step 1: preparing a training sample: randomly cropping the public face data set WIDER FACE to generate a positive sample, a negative sample and an intermediate sample, wherein the negative sample is a sample which intersects the annotated face region at a ratio less than a threshold U1, the positive sample is a sample which intersects the annotated face region at a ratio greater than a threshold U2, and the intermediate sample is a sample which intersects the annotated face region at a ratio between the threshold U3 and a threshold U4;
step 2: and (3) building a network structure of the face detection model: the network structure of the face detection model comprises two networks, namely a candidate frame network and an output network, wherein the candidate frame network comprises p1 convolutional layers and p2 pooling layers, and the output network comprises p3 convolutional layers, p4 pooling layers and p5 full-connection layers;
and step 3: training: transforming the positive, negative and intermediate sample sizes into W3×H3Inputting the candidate frame network, and training the candidate frame network by adopting a SoftMax loss function and an Euclidean loss function, wherein the SoftMax loss function carries out a face two-classification task, and the Euclidean loss function carries out a frame regression task, and the training is stopped until the loss value is not reduced any more;
and 4, step 4: inputting the original image corresponding to the public face data set into the candidate frame network trained in the step 3 to obtain a candidate area, dividing the intersection ratio of the candidate area and the labeled face area into a positive sample, a negative sample and an intermediate sample, wherein the negative sample is a sample which is smaller than a threshold value U1 in the intersection ratio with the labeled face area, the positive sample is a sample which is larger than a threshold value U2 in the intersection ratio with the labeled face area, and the intermediate sample is a sample which is between a threshold value U3 and a threshold value U4 in the intersection ratio with the labeled face area;
and 5: converting the positive, negative and intermediate sample sizes obtained in step 4 into W4×H4Input to the output network, and train the output network by using SoftMax loss function and Euclidean loss function until the loss valueStopping training when the speed is not reduced any more;
step 6: and (3) testing: zooming the image to be tested for multiple times according to a certain proportion to form an image pyramid;
and 7: inputting the pyramid into the trained candidate frame network to obtain candidate frames, and deleting the candidate frames with excessively high overlap by adopting a non-maximum suppression algorithm;
and 8: intercepting an interested area from an original image to be tested according to the position of the candidate frame and transforming the size of the interested area into W4×H4Inputting the candidate frames into the trained output network, deleting some overlapped candidate frames by adopting a non-maximum suppression algorithm, and taking the remaining candidate frames as final face frames.
The second aspect of the scheme provides a method for managing illegal vehicles based on urban roads, which comprises the following steps:
acquiring monitoring video images of continuous frames, and detecting whether illegal vehicles exist by using the illegal vehicle detection method based on the urban road;
the method comprises the steps of obtaining illegal parking data of illegal parking vehicles, analyzing the illegal parking data, and obtaining the vehicles with the largest number of illegal parking times and the areas with the largest number of illegal parking vehicles, wherein the illegal parking data comprise dates, illegal parking addresses, parking time of the illegal parking vehicles and license plate numbers.
Correspondingly, in an embodiment of the scheme, manual management is strengthened for the address with the most illegal parking vehicles, and a blacklist library of the illegal parking vehicles is added for the vehicle with the most illegal parking times, so that the illegal parking phenomenon can be substantially controlled.
Specifically, the process of analyzing the violation data is as follows:
classifying the illegal parking addresses based on the illegal parking addresses of the illegal parking data, counting the quantity of illegal parking vehicles at different addresses, and sequentially acquiring the areas with the most illegal parking vehicles;
and counting the number of the same license plate numbers based on the license plate numbers of the illegal parking data, and sequentially acquiring the vehicles with the largest number of illegal parking times.
It should be noted that in some embodiments, a control time period may be defined, and the violation data in the control time period may be selected for control and analysis.
Through the scheme, the place, the time, the license plate number and other data of the vehicle parking against the regulations can be stored and subjected to data analysis, the place where the vehicle parking against the regulations often occurs is managed in an enhanced mode, the vehicle parking against the regulations often adds a black list library, and the vehicle parking against the regulations can be effectively managed.
A third aspect of the present invention provides an urban road-based illegal parking vehicle detection system, which is used as a carrier to operate the above urban road-based illegal parking vehicle detection method, and includes:
the monitoring area acquisition module is used for acquiring a monitoring area of a monitoring video image with continuous frames, wherein the monitoring area is a no-parking area or a temporary parking area;
the vehicle detection module is internally loaded with a trained vehicle detection model and used for acquiring vehicle coordinate data;
the license plate recognition module is used for recognizing the license plate number of the vehicle;
the stop state judgment module is used for judging whether the deviation value of the vehicle coordinate data of the vehicles corresponding to the same license plate number is smaller than a position threshold value or not;
the face recognition module is internally loaded with a trained face detection model and used for detecting whether a driver seat is occupied or not;
and the parking duration judging module is used for calculating the parking duration of the vehicle and judging whether the parking duration is less than a duration threshold value.
It should be noted that the steps involved in the operation of the urban road-based illegal vehicle detection system are as described above, and are not described herein in a cumbersome manner.
A fourth aspect of the present invention provides an urban road-based parking violation management system, which is used as a carrier to operate the above urban road-based parking violation management method, and additionally includes, on the basis of an urban road-based parking violation detection system:
and the illegal parking data analysis module is used for analyzing illegal parking data of illegal parking vehicles and analyzing the illegal parking data to obtain the vehicles with the most illegal parking times and the areas with the most illegal parking vehicles, wherein the illegal parking data comprises dates, illegal parking addresses, parking time of the illegal parking vehicles and license plate numbers.
The computer system of the server for implementing the urban road-based illegal vehicle detection and management method according to the present embodiment includes a central processing unit CPU) that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) or a program loaded from a storage section into a Random Access Memory (RAM). In the RAM, various programs and data necessary for system operation are also stored. The CPU, ROM, and RAM are connected to each other via a bus. An input/output (I/O) interface is also connected to the bus.
In particular, according to an embodiment of the present disclosure, the process of the urban road-based illegal vehicle detection and management method described above with reference to the flowchart may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method of urban road-based illegal vehicle detection and management method illustrated in the flowchart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication section, and/or installed from a removable medium. The computer program performs the above-described functions defined in the system of the present invention when executed by a Central Processing Unit (CPU).
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing.
The flowchart and block diagrams of a method for urban road-based illegal parking vehicle detection and management in the figures illustrate the architecture, functionality, and operation of possible implementations of an urban road-based illegal parking vehicle detection and management system, an urban road-based illegal parking vehicle detection and management method, and a computer program product according to various embodiments of the present invention.
In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. Each block of the block diagrams or flowchart illustrations, and combinations of blocks in the block diagrams or flowchart illustrations, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software, or may be implemented by hardware, and the described modules may also be disposed in a processor.
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the apparatus to perform process steps corresponding to a method for urban road-based illegal vehicle detection and management.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.