Vehicle parking inspection method, device and equipment
By extracting and identifying the license plate number in the vehicle inspection video, the problem of inaccurate license plate number extraction in the existing technology is solved, the accurate identification and comprehensive determination of the license plate number of the parked vehicle is achieved, and the efficiency of parking management is improved.
Patent Information
- Application Number
- CN202311076318.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-24
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2043-08-24
AI Technical Summary
Existing video analysis and processing methods are difficult to accurately extract the license plate number of parked vehicles, which affects the efficiency of parking management.
By acquiring the inspection video, the target image in each frame of image is extracted, and based on the pre-built vehicle recognition model, license plate recognition model and character recognition model, the initial license plate number and its confidence are identified, and the initial license plate number whose similarity is greater than the preset threshold is The license plate number is stored in the statistical queue and the license plate number is comprehensively determined.
It achieves accurate extraction of license plate numbers of parked vehicles and improves the efficiency of parking management.
Smart Images

Figure CN116977949B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing technology, and in particular to a vehicle parking inspection method, device and equipment. Background Art
[0002] With the continuous increase in the number of vehicles, the demand for parking spaces is increasing, and the parking pressure is increasing. In order to regulate parking order and better manage parking behavior, a camera is usually used to capture videos of vehicles in the parking area, and then the captured videos are analyzed and processed to obtain the license plate numbers and parking status of the parked vehicles. Finally, parking management is performed based on the license plate numbers and parking status of the parked vehicles. However, it is difficult to accurately extract the license plate numbers of the parked vehicles currently being inspected using the current video analysis and processing methods, which affects the efficiency of subsequent parking management. Summary of the invention
[0003] In view of this, the present disclosure proposes a vehicle parking inspection method, device and equipment, which can accurately extract the license plate number of the parked vehicle currently being inspected.
[0004] According to a first aspect of the present disclosure, a vehicle parking inspection method is provided, comprising:
[0005] Obtain inspection videos;
[0006] For each inspection image frame in the inspection video, a target image of the current inspection vehicle is extracted from the inspection image, and based on the target image, an initial license plate number of the current inspection vehicle and the confidence of each character in the initial license plate number are identified;
[0007] Multiple initial license plate numbers identified in continuous inspection image frames and having a similarity greater than a preset threshold and the confidence of each character in each of the initial license plate numbers are stored in a statistical queue, and the license plate number of the current inspection vehicle is determined based on the statistical queue.
[0008] In a possible implementation, the inspection video is generated by a parking inspection system;
[0009] When generating the inspection video, the parking inspection system includes:
[0010] Using at least one camera to collect at least two initial videos respectively;
[0011] Image frames in at least two of the initial videos are spliced to obtain the inspection video.
[0012] In a possible implementation, after obtaining the inspection video, the parking inspection system further includes: performing image preprocessing on each image frame in the inspection video.
[0013] In a possible implementation, when extracting the target image of the current inspection vehicle from the inspection image, it is implemented based on a pre-built vehicle recognition model.
[0014] In a possible implementation, when the initial license plate number of the current inspection vehicle and the confidence level of each character in the initial license plate number are identified based on the target image, the method includes:
[0015] Based on the target image, a pre-built license plate recognition model is used to obtain the license plate image of the current inspection vehicle;
[0016] Based on the license plate image, a pre-built character segmentation model is used to obtain each character image in the license plate image;
[0017] Based on each of the character images, a pre-built character recognition model is used to obtain the initial license plate number of the current patrol vehicle and the confidence level of each character in the initial license plate number.
[0018] In a possible implementation, when the license plate number of the current patrol vehicle is determined based on the statistical queue, it is implemented based on the confidence and mode of each character in the statistical queue.
[0019] In a possible implementation, when determining the license plate number of the current inspection vehicle based on the confidence and mode of each character in the statistical queue, it includes:
[0020] Traversing each character constituting each of the initial license plate numbers in the statistical queue;
[0021] For the current character traversed, a set number of characters with the highest confidence levels are selected from the initial license plate numbers as preferred characters, and the majority of the preferred characters is calculated;
[0022] After the traversal is completed, the license plate number of the current patrol vehicle is determined based on each of the modes.
[0023] In a possible implementation, the method further includes:
[0024] Based on the target image, a pre-built parking state recognition model is used to obtain the parking state of the current inspection vehicle, wherein the parking state includes at least one of normal parking, off-line parking and straddling parking.
[0025] According to a second aspect of the present disclosure, a vehicle parking inspection device is provided, comprising:
[0026] Video acquisition module, used to acquire inspection videos;
[0027] An image frame processing module is used to extract a target image of a current inspection vehicle from each inspection image frame in the inspection video, and based on the target image, identify an initial license plate number of the current inspection vehicle and the confidence level of each character in the initial license plate number;
[0028] The license plate number recognition module is used to store multiple initial license plate numbers identified in continuous inspection image frames and with a similarity greater than a preset threshold and the confidence of each character in each of the initial license plate numbers in a statistical queue, and determine the license plate number of the current inspection vehicle based on the statistical queue.
[0029] According to a third aspect of the present disclosure, a vehicle parking inspection device is provided, comprising: a processor; and a memory for storing processor executable instructions; wherein the processor is configured to execute the method described in the first aspect of the present disclosure.
[0030] The present disclosure provides a vehicle parking inspection method, including: obtaining an inspection video; for each inspection image frame in the inspection video, extracting a target image of the current inspection vehicle from the inspection image, and identifying the initial license plate number of the current inspection vehicle and the confidence of each character in the initial license plate number based on the target image; storing multiple initial license plate numbers with similarities greater than a preset threshold and the confidence of each character in each initial license plate number identified in continuous inspection image frames in a statistical queue, and determining the license plate number of the current inspection vehicle based on the statistical queue. Since the present disclosure comprehensively determines the license plate number of the current inspection vehicle based on the continuous image frames in the inspection video, the license plate number of the parked vehicle currently being inspected can be accurately extracted.
[0031] Further features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.
[0033] Figure 1 A flow chart showing a vehicle parking inspection method according to an embodiment of the present disclosure is shown;
[0034] Figure 2 A system framework diagram of a parking inspection system according to an embodiment of the present disclosure is shown;
[0035] Figure 3 A hardware layout diagram of a parking inspection system according to an embodiment of the present disclosure is shown;
[0036] Figure 4 A schematic block diagram of a vehicle parking inspection device according to an embodiment of the present disclosure is shown;
[0037] Figure 5 A schematic block diagram of a vehicle parking inspection device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0038] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.
[0039] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.
[0040] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the main purpose of the present disclosure.
[0041] <Method Example>
[0042] Figure 1 FIG. 1 is a flow chart showing a vehicle parking inspection method according to an embodiment of the present disclosure, the method being executed by a cloud server. Figure 1 As shown, the method includes steps S1100-S1300.
[0043] S1100, obtaining inspection videos. Specifically, during the vehicle parking inspection process, the parking inspection system will collect videos of each vehicle parked in the parking area, and the video collected by the parking inspection system is the inspection video. After collecting the inspection video, the parking inspection system sends the inspection video to the cloud server, so that the cloud server can obtain the inspection video.
[0044] In a possible implementation, the parking inspection system is as follows: Figure 2As shown, it includes a power management system 110, an embedded terminal mainboard 120, an Ethernet switch 130, a 5G Ethernet module 140, a camera module 150 and a cloud server 160. Among them, the power management system 110 is used to provide working power for the parking inspection system. The camera module 150 is used to collect videos of each vehicle parked in the parking area, and send the collected videos to the embedded terminal mainboard 120 through the Ethernet switch 130. After acquiring the video sent by the camera module, the embedded terminal mainboard 120 processes the acquired video into an inspection video, and sends the inspection video to the cloud server 160 through the Ethernet switch 130 and the 5G Ethernet module 140.
[0045] In this embodiment, the power management system 110 is composed of a 12v lithium battery, a battery protection and voltage-stabilized power supply module, and a power charging interface. The power supply is stepped down to meet the power supply requirements of the device, and the current device power can be displayed to power the system when there is no external power supply. The capacity of the lithium battery is not less than 8000mah, and the battery protection and voltage-stabilized power supply module provides an input charging current of not less than 1.5A, supports a power supply output current of not less than 6A, and supports a wide voltage input of 12v-30v. The power interface adopts a 5521-type circular DC interface.
[0046] The embedded terminal mainboard 120 can adopt a high-performance ARM architecture main control and integrate a hardware acceleration platform to accelerate video data processing. The embedded terminal mainboard 120 is also equipped with multiple interfaces such as a Gigabit Ethernet port, a USB interface, and a TF card interface, and has rich expansion capabilities.
[0047] The Ethernet switch 130 provides no less than five 10 / 100 / 1000Mbps adaptive RJ45 ports, supports automatic flipping (Auto-MDI / MDIX), complies with IEEE 802.3, IEEE 802.3u and IEEE 802.3ab standards, adopts a non-blocking switching architecture, and forwards and filters packets at full line speed and throughput.
[0048] The 5G Ethernet module 140 meets the SRRC / NAL / CCC mandatory certification, supports SA and NSA networking, supports multiple operators, and the maximum downlink bandwidth of 5G SA Sub-6 is 2Gbps, and the maximum uplink bandwidth is 1Gbps.
[0049] In a possible implementation, the camera module 150 includes at least two cameras, and each camera is distributed in a circle. In this way, when capturing video of a vehicle located in a parking area, at least two cameras can be used to capture at least two initial videos respectively, and the two initial videos can be sent to the embedded terminal mainboard 120. After acquiring at least two initial videos, the embedded terminal mainboard 120 splices the image frames in the at least two initial videos to obtain an inspection video. When splicing the image frames in the at least two initial videos, the image frames captured at the same time in the at least two initial videos are spliced to obtain a spliced image frame with a wider field of view. Specifically, the image frames captured at the same time in each initial video can be spliced into a panoramic picture; the image frames captured at the same time in each initial video can also be spliced in an N*N window, which is not specifically limited here. When the image frames collected at the same time in each initial video are spliced into an N*N window, the following steps are specifically included: after the window is established, the picture of each camera occupies one grid of the window, and then the picture of the entire window is output, so as to merge the image frames collected by multiple cameras into one inspection image frame. In this embodiment, since each inspection image frame in the inspection video is spliced by at least two initial image frames with different field of view, each inspection image frame has a larger field of view, thereby improving the accuracy of subsequent license plate number recognition.
[0050] Example 1, refer to Figure 3 As shown in the first layer in the figure, the camera module 150 includes three cameras, which are distributed in a circle (i.e., the angle between the three cameras is 120°). For each moment in the inspection process: three cameras are used to collect image frames to obtain three inspection images; the three inspection images collected are sent to the embedded terminal mainboard 120; after acquiring the three inspection images, the embedded terminal mainboard 120 splices the three inspection images into a 2*2 window (for example, the three inspection images are spliced into the upper left, upper right and lower left areas of the window respectively) to generate the inspection image frame at the current moment, thereby overcoming the blind spot of the field of view of a single camera, repeating the above operation, and combining the inspection image frames in sequence to obtain the inspection video. Among them, the size of the entire window is twice the size of a single frame. If the size of a single frame is 1280*960, then the actual window size is 2560*1920.
[0051] Example 2, refer to Figure 3As shown, the camera module 150 includes three cameras, and the three cameras are distributed in a circle (that is, the angle between the three cameras is 120°). For each moment in the inspection process: three cameras are used to collect image frames to obtain three inspection image frames; the collected three inspection image frames are sent to the embedded terminal mainboard 120; after acquiring the three inspection image frames, the embedded terminal mainboard 120 splices the three inspection image frames into a panoramic image, thereby overcoming the blind spot of the field of view of a single camera, repeating the above operation, and combining the inspection image frames in sequence to obtain the inspection video.
[0052] In a possible implementation, after the embedded terminal mainboard 120 generates the inspection video, it also includes an operation of performing image preprocessing on each inspection image frame in the inspection video. The image preprocessing operation may include at least one of noise reduction processing and contrast enhancement processing. Specifically, each inspection image frame may be subjected to noise reduction processing by using a median filter or a Gaussian filter algorithm, and then each inspection image frame after denoising may be subjected to contrast enhancement processing by using a histogram equalization algorithm or an adaptive histogram equalization algorithm, thereby improving the recognizability of the license plate in each inspection image frame.
[0053] In a possible implementation, after the embedded terminal mainboard 120 performs image preprocessing operations on each inspection image frame in the inspection video, the inspection video is compressed, and the compressed inspection video is pushed to the cloud server in real time through the Ethernet switch 130 and the 5G Ethernet module 140. In this embodiment, after receiving the compressed inspection video, the cloud server decompresses it to obtain the inspection video.
[0054] S1200, for each inspection image frame in the inspection video, extract a target image of the current inspection vehicle from the inspection image, and identify the initial license plate number of the current inspection vehicle and the confidence level of each character in the initial license plate number based on the target image. The current inspection vehicle refers to the vehicle located to the right of the parking inspection system and closest to the parking inspection system during the inspection process.
[0055] First of all, it should be noted that there are often multiple parked vehicles in the parking area. Therefore, when capturing video of the current patrol vehicle, other vehicles will inevitably be captured. In order to improve the accuracy of the license plate number recognition of the current patrol vehicle, when processing each inspection image in the inspection video, the target image of the current patrol vehicle must first be identified from the inspection image, and then the subsequent license plate recognition operation is performed based on the target image of the current patrol vehicle.
[0056] In a possible implementation, when extracting the target image of the current inspection vehicle from the inspection image, it is implemented based on a pre-built vehicle recognition model.
[0057] Before extracting the target image of the current patrol vehicle from the patrol image based on the pre-built vehicle recognition model, it is necessary to build a vehicle recognition model first. When building the vehicle recognition model, the following steps may be included: First, a parking inspection system is used to collect video of the parking conditions of vehicles in multiple parking areas. Then, each image frame is extracted from the collected video, and for each image frame, the bounding box of the current patrol vehicle, the bounding box confidence and the probability of the current patrol vehicle in the bounding box are marked, and each marked image frame is used as the first training data of the vehicle recognition model. Finally, the first YOLO model is trained based on the first training data and the preset first loss function to obtain the vehicle recognition model. Specifically, for each first training data, it is input into the first YOLO model, and the first YOLO model will predict the bounding box of the current patrol vehicle, the bounding box confidence and the probability of the current patrol vehicle in the bounding box. The predicted data is input into the preset first loss function, and the loss value is calculated. Based on the calculated loss value, back propagation is used, and the network parameters of the first YOLO model are continuously optimized in a gradient descent manner. After the training, the vehicle recognition model can be obtained. Among them, the preset first loss function can be as follows:
[0058] Where:
[0059] : It is a hyperparameter used to increase the emphasis on the accuracy of object center coordinate prediction.
[0060] : It is a sum operation, used to traverse all grids.
[0061] : It is a sum operation that traverses all predicted bounding boxes in each grid.
[0062] : is an indicator function whose value is 1 if and only if the bounding box j in grid i contains an object.
[0063] : is the error between the predicted bounding box center and the actual bounding box center in the x and y directions.
[0064] : is the error between the predicted bounding box width and height and the actual bounding box width and height. In order to make the coordinate error of the smaller bounding box and the coordinate error of the larger bounding box equally important, the square root is used.
[0065] : Indicates the confidence that the predicted bounding box contains the current inspection vehicle; Indicates the confidence that the actual bounding box contains the current inspection vehicle.
[0066] : is a hyperparameter used to reduce the importance of predicting bounding boxes that do not contain the current inspection vehicle.
[0067] : is an indicator function, whose value is 1 if and only if the bounding box j in grid i does not contain the current inspection vehicle.
[0068] : is an indicator function, whose value is 1 if and only if grid i contains the current inspection vehicle.
[0069] : represents the conditional probability of the predicted category c; Represents the conditional probability of the actual category c, where category C is the current inspection vehicle.
[0070] After obtaining the vehicle recognition model, the vehicle recognition model can be used to extract the target image of the current inspection vehicle from the inspection image. Specifically, after the inspection image is input into the vehicle recognition model, the vehicle recognition model divides the input and output inspection image into an S*S network. Preferably, S takes a value of 7, that is, the input and output inspection image is divided into a 7*7 grid, and when the center of the object falls into the grid, the bounding box of the object, the bounding box confidence C, and the probability P that the object in the bounding box belongs to each category are predicted. For each predicted bounding box, the product of the confidence C of the bounding box and the probability P that the object category in the bounding box is a vehicle is calculated, and the calculated product is used as the comprehensive confidence of the bounding box. The image in the bounding box with the highest comprehensive confidence is extracted as the target image of the current inspection vehicle.
[0071] Furthermore, after extracting the target image of the current patrol vehicle from the patrol image, the initial license plate number of the current patrol vehicle and the confidence of each character in the initial license plate number can be identified based on the target image of the current patrol vehicle. Specifically, the following steps can be included:
[0072] First, based on the target image of the current patrol vehicle, a pre-built license plate recognition model is used to obtain the license plate image of the current patrol vehicle.
[0073] Before executing this step, it is necessary to build a license plate recognition model. The specific construction process includes the following steps: First, a large number of images containing license plates are obtained, and the bounding box, bounding box confidence, and probability of the license plate in the bounding box are marked, and the marked image is used as the second training data of the license plate recognition model. Finally, the second YOLO model is trained based on the second training data and the preset second loss function to obtain the license plate recognition model. Specifically, for each second training data, it is input into the second YOLO model, and the second YOLO model will predict the bounding box, bounding box confidence, and probability of the license plate in the bounding box. The predicted data is input into the preset second loss function, and the loss value is calculated. Based on the calculated loss value, back propagation is used, and the network parameters of the second YOLO model are continuously optimized in a gradient descent manner. The license plate recognition model can be obtained after the training is completed. Among them, the preset second loss function can be the same as the first loss function, which will not be repeated here.
[0074] After obtaining the license plate recognition model, the license plate image of the current patrol vehicle can be obtained based on the target image of the current patrol vehicle using the pre-built license plate recognition model. Specifically, after the target image of the current patrol vehicle is input into the license plate recognition model, the license plate recognition model divides the input target image into an S*S network, and predicts the bounding box of the object, the bounding box confidence C, and the probability P that the object in the bounding box belongs to each category when the center of the object falls into the grid. For each predicted bounding box, the product of the confidence C of the bounding box and the probability P that the object category in the bounding box is a license plate is calculated, and the calculated product is used as the comprehensive confidence of the bounding box. The image in the bounding box with the highest comprehensive confidence is extracted as the license plate image of the current patrol vehicle.
[0075] Second, based on the license plate image, a pre-built character segmentation model is used to obtain each character image in the license plate image. The character segmentation model can use an existing character segmentation model. Specifically, after the character segmentation model is built, the license plate image can be input into the character segmentation model to obtain the image of each character output by the character segmentation model.
[0076] Third, based on the character images in the license plate, a pre-built character recognition model is used to obtain the initial license plate number of the current patrol vehicle and the confidence of each character in the initial license plate number. Among them, the character recognition model can adopt an existing character recognition model. Specifically, after the character recognition model is constructed, each character image segmented from the license plate image can be input into the character recognition model in sequence, that is, each character in the initial license plate number and the confidence of each character can be obtained, and the recognized characters can be combined in order to obtain the initial license plate number of the current patrol vehicle.
[0077] S1300, storing multiple initial license plate numbers with similarity greater than a preset threshold and the confidence of each character in each initial license plate number identified in continuous inspection image frames in a statistical queue, and determining the license plate number of the current inspection vehicle based on the statistical queue.
[0078] In a possible implementation, the inspection image frames in the inspection video are acquired frame by frame. For the inspection image frames acquired at the current time t, the initial license plate number of the current inspection vehicle at time t and the confidence of each character in the initial license plate number are identified by executing the above step S1200. Further, the similarity between the initial license plate number of the current inspection vehicle at time t and the initial license plate number at time t-1 is calculated. When the similarity is greater than or equal to the set threshold, it indicates that the current inspection vehicle is the same vehicle. At this time, the initial license plate number at time t and the confidence of each character in the initial license plate number are stored in the statistical queue. Repeat the above operation until the similarity between the initial license plate number at the current time and the initial license plate number at the previous time is less than the set threshold, and the license plate number cannot be detected in consecutive F frames, indicating that the inspection video collection of the next vehicle has been entered. At this time, the license plate number of the current inspection vehicle can be determined based on the data stored in the statistical queue. Among them, the set threshold can be set to 0.9, and the value of F can be set to be greater than or equal to 3.
[0079] In a possible implementation, when determining the license plate number of the current patrol vehicle based on the statistical queue, it is implemented based on the confidence and mode of each character in the statistical queue. Specifically, traverse each character in the statistical queue that constitutes each initial license plate number; for the current traversed character, select a set number of characters with the highest confidence from each initial license plate number as the preferred characters, and calculate the mode of the preferred characters; after the traversal, determine the license plate number of the current patrol vehicle based on each mode. Among them, the set number can be determined by the following formula:
[0080] M2=M1-M1 / 4
[0081] Where M1 is the total number of initial license plate numbers stored in the statistical queue, M1 / 4 is the number of characters with the lowest confidence, and M2 is the number of characters with the highest confidence, that is, the set number.
[0082] For example, the data stored in the statistics queue is shown in Table 1:
[0083] Table 1:
[0084]
[0085] When determining the license plate number of the current inspection vehicle based on the statistical queue, for each character sequence in the statistical queue (a column in Table 1), such as "JingJingJingYue", delete the 1 / 4 of the records with the lowest confidence, that is, delete "Yue" with a confidence of 0.2. Then, find the mode of the remaining queue content to get the mode "Jing" with the highest frequency. The processing methods for the other 6 characters are the same. After processing all characters, combine the mode characters corresponding to each character in order to obtain the final license plate number "Jing A11B20". The confidence of each character is the average value of its respective queue, "0.8, 0.8, 0.8, 0.8, 0.9, 0.8, 0.9", and the overall confidence is the average value of each character, 0.83.
[0086] In a possible implementation, when identifying the license plate image, the license plate color is also identified and the license plate color is counted into the statistical queue together. Then, by calculating the mode of the license plate colors in the statistical queue, the license plate color of the current inspection vehicle is determined. As shown in the statistical queue in Table 1, after calculating the mode of the license plate colors, it is determined that the license plate color of the current inspection vehicle is blue.
[0087] In a possible implementation, for each frame of inspection image, the comprehensive confidence of the license plate image obtained during the processing is also recorded during the processing and the comprehensive confidence is recorded into the statistical queue. Furthermore, when determining the license plate number based on the statistical queue, the time with the highest comprehensive confidence can also be selected as the inspection time of the current inspection vehicle.
[0088] In a possible implementation, the method further includes: based on the target image, using a pre-constructed parking state recognition model to obtain the parking state of the current inspection vehicle, where the parking state includes at least one of normal parking, over-line parking, and cross-position parking. Among them, the parking state recognition model can use an existing parking state recognition model. Specifically, by inputting the target image into the parking state recognition model, the parking state of the current inspection vehicle can be obtained.
[0089] Through the above processing, at least one of the inspection time, license plate color, license plate number, and parking state of the current inspection vehicle can be obtained.
[0090] Furthermore, after obtaining the inspection time, license plate color, license plate number and parking status of the current inspection vehicle, parking management can be performed based on the acquired information. For example: when the license plate number and license plate color of the current inspection vehicle are identified, the management system will enter the database, where the database has already entered the basic information of multiple vehicles in advance, such as license plate number, license plate color, owner's name, owner's phone number, whether there is ETC, etc. By comparing the license plate number and license plate color of the current inspection vehicle with those of each vehicle in the database, other information of the current inspection vehicle can be obtained, such as the owner of the blue license plate Beijing A11111 is Zhang San, the mobile phone number is 12345678900, and there is ETC. Then, make corresponding parking management according to the parking status of the current inspection vehicle. Specifically, if the parking status of the current patrol vehicle is normal, only the current parking time will be recorded; if the parking status of the current patrol vehicle is across-line parking or across-space parking, it is illegal parking. At this time, a text message will be sent to the owner of the current patrol vehicle through the management system, notifying the owner that the vehicle is illegally parked and to adjust the parking position in time, and record the current parking time.
[0091] The present disclosure provides a vehicle parking inspection method, including obtaining an inspection video; for each inspection image frame in the inspection video, extracting a target image of the current inspection vehicle from the inspection image, and identifying the initial license plate number of the current inspection vehicle and the confidence of each character in the initial license plate number based on the target image; storing multiple initial license plate numbers with similarities greater than a preset threshold and the confidence of each character in each initial license plate number identified in continuous inspection image frames in a statistical queue, and determining the license plate number of the current inspection vehicle based on the statistical queue. Since the present disclosure comprehensively determines the license plate number of the current inspection vehicle based on the continuous image frames in the inspection video, the license plate number of the parked vehicle currently being inspected can be accurately extracted.
[0092] <Device Example>
[0093] Figure 4 FIG. 2 is a schematic block diagram of a vehicle parking inspection device according to an embodiment of the present disclosure. Figure 4 As shown, the vehicle parking inspection device 100 includes:
[0094] The video acquisition module 110 is used to acquire the inspection video;
[0095] The image frame processing module 120 is used to extract the target image of the current inspection vehicle from the inspection image for each inspection image frame in the inspection video, and identify the initial license plate number of the current inspection vehicle and the confidence level of each character in the initial license plate number based on the target image;
[0096] The license plate number recognition module 130 is used to store multiple initial license plate numbers with similarity greater than a preset threshold identified in continuous inspection image frames and the confidence of each character in each initial license plate number in a statistical queue, and determine the license plate number of the current inspection vehicle based on the statistical queue.
[0097] <Equipment Embodiment>
[0098] Figure 5 FIG. 1 is a schematic block diagram of a vehicle parking inspection device according to an embodiment of the present disclosure. Figure 5 As shown, the vehicle parking inspection device 200 includes: a processor 210 and a memory 220 for storing executable instructions of the processor 210. The processor 210 is configured to implement any of the above-mentioned vehicle parking inspection methods when executing the executable instructions.
[0099] Here, it should be noted that the number of processors 210 may be one or more. Meanwhile, in the vehicle parking inspection device 200 of the embodiment of the present disclosure, an input device 230 and an output device 240 may also be included. The processor 210, the memory 220, the input device 230 and the output device 240 may be connected via a bus or in other ways, which are not specifically limited here.
[0100] The memory 220 is a computer-readable storage medium that can be used to store software programs, computer executable programs, and various modules, such as the program or module corresponding to the vehicle parking inspection method of the embodiment of the present disclosure. The processor 210 executes various functional applications and data processing of the vehicle parking inspection device 200 by running the software programs or modules stored in the memory 220.
[0101] The input device 230 may be used to receive input numbers or signals. The signals may be key signals related to user settings and function control of the device / terminal / server. The output device 240 may include display devices such as display screens.
[0102] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A vehicle parking inspection method, which is implemented by a cloud server and is characterized in that: include: Obtain inspection videos; For each inspection image frame in the inspection video, a target image of the current inspection vehicle is extracted from the inspection image, and based on the target image, an initial license plate number of the current inspection vehicle and the confidence of each character in the initial license plate number are identified, wherein the current inspection vehicle refers to a vehicle located on the right side of the parking inspection system and closest to the parking inspection system during the inspection process; Store multiple initial license plate numbers with similarity greater than a preset threshold value identified in continuous inspection image frames and the confidence of each character in each of the initial license plate numbers in a statistical queue, and determine the license plate number of the current inspection vehicle based on the statistical queue; When extracting the target image of the current patrol vehicle from the patrol image, it is implemented based on the pre-built vehicle recognition model. Specifically, after the patrol image is input into the vehicle recognition model, the vehicle recognition model divides the patrol image into a 7*7 grid, and predicts the bounding box of the object, the confidence C of the bounding box, and the probability P of the object in the bounding box belonging to each category when an object falls into the grid; for each predicted bounding box, the product of the confidence C of the bounding box and the probability P that the object category in the bounding box is a vehicle is calculated, and the calculated product is used as the comprehensive confidence of the bounding box; the image in the bounding box with the highest comprehensive confidence is extracted as the target image of the current patrol vehicle; When determining the license plate number of the current patrol vehicle based on the statistical queue, it is implemented based on the confidence and mode of each character in the statistical queue. Specifically, each character constituting each initial license plate number in the statistical queue is traversed; for the current traversed character, a set number of characters with the highest confidence are selected from each initial license plate number as preferred characters, and the mode of the preferred characters is calculated; after the traversal, the license plate number of the current patrol vehicle is determined based on each mode, wherein the set number can be determined by the following formula: M2=M1-M1 / 4 Wherein, M1 is the total number of initial license plate numbers stored in the statistical queue, M1 / 4 is the number of characters with the lowest confidence, and M2 is the number of characters with the highest confidence, that is, the set number; Before extracting the target image of the current patrol vehicle from the patrol image based on the pre-constructed vehicle recognition model, it is necessary to first construct the vehicle recognition model. The following steps may be included when constructing the vehicle recognition model: first, a parking patrol system is used to collect video of the parking conditions of vehicles in multiple parking areas; then, each image frame is extracted from the collected video, and for each image frame, the bounding box of the current patrol vehicle, the confidence of the bounding box, and the probability that the bounding box is the current patrol vehicle are marked, and each marked image frame is used as the first training data of the vehicle recognition model; finally, the first YOLO model is trained based on the first training data and a preset first loss function to obtain the vehicle recognition model; For each first training data, it is input into the first YOLO model, and the first YOLO model will predict the bounding box of the current inspection vehicle, the confidence of the bounding box, and the probability that the bounding box is the current inspection vehicle; the predicted data is input into the preset first loss function, and the loss value is calculated; based on the calculated loss value, back propagation is used, and the network parameters of the first YOLO model are continuously optimized in a gradient descent manner; after the training is completed, the vehicle recognition model can be obtained; The inspection video is generated by a parking inspection system, wherein the parking inspection system includes a camera module, the camera module includes three cameras, and the three cameras are distributed in a circle, that is, the angle between the three cameras is 120°. When generating the inspection video, the parking inspection system includes: Collect three inspection image frames respectively through the three cameras; The three inspection image frames collected are stitched into a 2*2 window to obtain the inspection image frame at the current moment, wherein the three inspection image frames are respectively located in the upper left, upper right and lower left areas of the window; Repeat the above two steps, and combine all the inspection image frames obtained in order to obtain the inspection video; The inspection image frames in the inspection video are acquired frame by frame. For the inspection image frame acquired at the current time t, the target image of the current inspection vehicle is first extracted from the inspection image. Based on the target image, the initial license plate number of the current inspection vehicle at time t and the confidence of each character in the initial license plate number are identified. Then, the similarity between the initial license plate number of the current inspection vehicle at time t and the initial license plate number at time t-1 is calculated. When the similarity is greater than or equal to the set threshold, it indicates that the current inspection vehicle is the same vehicle. At this time, the initial license plate number at time t and the confidence of each character in the initial license plate number are stored in the statistical queue. The above operation is repeated until the similarity between the initial license plate number at the current moment and the initial license plate number at the previous moment is less than the set threshold, and the license plate number cannot be detected for consecutive F frames, indicating that the inspection video acquisition of the next vehicle has begun. At this time, the license plate number of the current inspection vehicle can be determined based on the data stored in the statistical queue, where the threshold is set to 0.9 and F is set to 3.
2. The method according to claim 1, characterized in that After obtaining the inspection video, the parking inspection system further includes: performing image preprocessing on each image frame in the inspection video.
3. The method according to claim 1, characterized in that When the initial license plate number of the current inspection vehicle and the confidence level of each character in the initial license plate number are identified based on the target image, the method includes: Based on the target image, a pre-built license plate recognition model is used to obtain the license plate image of the current inspection vehicle; Based on the license plate image, a pre-built character segmentation model is used to obtain each character image in the license plate image; Based on each of the character images, a pre-built character recognition model is used to obtain the initial license plate number of the current patrol vehicle and the confidence level of each character in the initial license plate number.
4. The method according to claim 1, characterized in that: Also includes: Based on the target image, a pre-built parking state recognition model is used to obtain the parking state of the current inspection vehicle, wherein the parking state includes at least one of normal parking, off-line parking and straddling parking.
5. A vehicle parking inspection device, characterized in that: include: Video acquisition module, used to acquire inspection videos; An image frame processing module, for extracting a target image of a current inspection vehicle from each inspection image in the inspection video, and identifying an initial license plate number of the current inspection vehicle and the confidence level of each character in the initial license plate number based on the target image, wherein the current inspection vehicle refers to a vehicle located to the right of the parking inspection system and closest to the parking inspection system during the inspection process; A license plate number recognition module, used to store multiple initial license plate numbers with similarity greater than a preset threshold value identified in continuous inspection image frames and the confidence of each character in each of the initial license plate numbers into a statistical queue, and determine the license plate number of the current inspection vehicle based on the statistical queue; The image frame processing module is implemented based on a pre-built vehicle recognition model when extracting the target image of the current patrol vehicle from the patrol image. Specifically, after the patrol image is input into the vehicle recognition model, the vehicle recognition model divides the patrol image into a 7*7 grid, and predicts the bounding box of the object, the confidence C of the bounding box, and the probability P of the object in the bounding box belonging to each category when an object falls into the grid; for each predicted bounding box, the product of the confidence C of the bounding box and the probability P that the object category in the bounding box is a vehicle is calculated, and the calculated product is used as the comprehensive confidence of the bounding box; the image in the bounding box with the highest comprehensive confidence is extracted as the target image of the current patrol vehicle; The license plate number recognition module determines the license plate number of the current inspection vehicle based on the statistical queue, based on the confidence and mode of each character in the statistical queue. Specifically, each character constituting each initial license plate number in the statistical queue is traversed; for the current position character traversed, a set number of characters with the highest confidence are selected from each initial license plate number as preferred characters, and the mode of the preferred characters is calculated; after the traversal, the license plate number of the current inspection vehicle is determined based on each mode, wherein the set number can be determined by the following formula: M2=M1-M1 / 4 Wherein, M1 is the total number of initial license plate numbers stored in the statistical queue, M1 / 4 is the number of characters with the lowest confidence, and M2 is the number of characters with the highest confidence, that is, the set number; Before extracting the target image of the current patrol vehicle from the patrol image based on the pre-constructed vehicle recognition model, it is necessary to first construct the vehicle recognition model. The following steps may be included when constructing the vehicle recognition model: first, a parking patrol system is used to collect video of the parking conditions of vehicles in multiple parking areas; then, each image frame is extracted from the collected video, and for each image frame, the bounding box of the current patrol vehicle, the confidence of the bounding box, and the probability that the bounding box is the current patrol vehicle are marked, and each marked image frame is used as the first training data of the vehicle recognition model; finally, the first YOLO model is trained based on the first training data and a preset first loss function to obtain the vehicle recognition model; For each first training data, it is input into the first YOLO model, and the first YOLO model will predict the bounding box of the current inspection vehicle, the confidence of the bounding box, and the probability that the bounding box is the current inspection vehicle; the predicted data is input into the preset first loss function, and the loss value is calculated; based on the calculated loss value, back propagation is used, and the network parameters of the first YOLO model are continuously optimized in a gradient descent manner; after the training is completed, the vehicle recognition model can be obtained; The inspection video is generated by a parking inspection system, wherein the parking inspection system includes a camera module, the camera module includes three cameras, and the three cameras are distributed in a circle, that is, the angle between the three cameras is 120°. When generating the inspection video, the parking inspection system includes: Collect three inspection image frames respectively through the three cameras; The three inspection image frames collected are stitched into a 2*2 window to obtain the inspection image frame at the current moment, wherein the three inspection image frames are respectively located in the upper left, upper right and lower left areas of the window; Repeat the above two steps, and combine all the inspection image frames obtained in order to obtain the inspection video; The inspection image frames in the inspection video are acquired frame by frame. For the inspection image frame acquired at the current time t, the target image of the current inspection vehicle is first extracted from the inspection image. Based on the target image, the initial license plate number of the current inspection vehicle at time t and the confidence of each character in the initial license plate number are identified. Then, the similarity between the initial license plate number of the current inspection vehicle at time t and the initial license plate number at time t-1 is calculated. When the similarity is greater than or equal to the set threshold, it indicates that the current inspection vehicle is the same vehicle. At this time, the initial license plate number at time t and the confidence of each character in the initial license plate number are stored in the statistical queue. The above operation is repeated until the similarity between the initial license plate number at the current moment and the initial license plate number at the previous moment is less than the set threshold, and the license plate number cannot be detected for consecutive F frames, indicating that the inspection video acquisition of the next vehicle has begun. At this time, the license plate number of the current inspection vehicle can be determined based on the data stored in the statistical queue, where the threshold is set to 0.9 and F is set to 3.
6. A vehicle parking inspection device, characterized in that: include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to implement the method described in any one of claims 1 to 4 when executing the executable instructions.
