License plate desensitization method, terminal and storage medium

By acquiring and tracking the vehicle spatial information in the video frame, and using the license plate recognition model to extract and process the license plate information, the problem of non-desensitization of the license plate information in the video is solved, and effective protection and information security of the license plate information are achieved.

CN112215063BActive Publication Date: 2024-08-23PENG CHENG LAB
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010909591.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-02
Publication Date
2024-08-23
Estimated Expiration
2040-09-02

AI Technical Summary

Technical Problem

Existing technology fails to effectively desensitize the license plate information in the video, resulting in an increased risk of information leakage.

Method used

By obtaining the vehicle spatial information in the video frame, the vehicle position is identified and tracked, the license plate recognition model is used to extract the license plate information, and desensitization processing is performed based on the license plate spatial information, including predicting the license plate position and performing mosaic processing.

Benefits of technology

It achieves effective desensitization of license plate information in the video, reduces the risk of information leakage, and improves the accuracy of license plate detection and tracking.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112215063B
    Figure CN112215063B
Patent Text Reader

Abstract

The present invention discloses a license plate desensitization method, terminal and storage medium. The method comprises: obtaining a target video, obtaining vehicle space information corresponding to each vehicle in each frame of the target video, wherein the vehicle space information comprises a frame number, a vehicle ID and a vehicle position information; obtaining the first license plate space information of each vehicle in each frame of the target video according to the vehicle space information of each vehicle in each frame of the target video; obtaining the target license plate space information according to the first license plate space information; and desensitizing each license plate in the target video according to the target license plate space information. The present invention tracks the vehicles in the target video, obtains the vehicle space information of each vehicle in each frame, obtains the license plate space information of the license plate in each frame according to the vehicle space information of the vehicle, and then performs license plate desensitization according to the license plate space information, thereby achieving desensitization of the license plate information in the video.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of video processing, and in particular to a license plate desensitization method, a terminal and a storage medium. Background Art

[0002] With the rapid development of information technology, information leakage occurs more and more frequently. License plate information is sensitive data. For example, in the actual demonstration of traffic monitoring video system, if the desensitization of license plate information is ignored, information leakage will occur. At present, there is no method to desensitize license plate information in the video. Therefore, the existing technology needs to be improved and enhanced. Summary of the invention

[0003] In view of the above-mentioned defects of the prior art, the present invention provides a license plate desensitization method, terminal and storage medium, aiming to solve the problem that there is no method for desensitizing the license plate information in the video in the prior art.

[0004] In order to solve the above technical problems, the technical solution adopted by the present invention is as follows:

[0005] A first aspect of the present invention provides a license plate desensitization method, the method comprising:

[0006] Acquire a target video, and acquire vehicle spatial information corresponding to each vehicle in each frame of the target video, wherein the vehicle spatial information includes a frame number, a vehicle ID, and vehicle position information;

[0007] Acquire first license plate spatial information of each vehicle in each frame of the target video according to vehicle spatial information of each vehicle in each frame of the target video;

[0008] Acquire target license plate space information according to the first license plate space information;

[0009] Each license plate in the target video is desensitized according to the target license plate spatial information.

[0010] The second aspect of the present invention provides a terminal, which includes a processor and a storage medium communicatively connected to the processor, the storage medium is suitable for storing multiple instructions, and the processor is suitable for calling the instructions in the storage medium to execute the steps of implementing any of the above-mentioned license plate desensitization methods.

[0011] A third aspect of the present invention provides a storage medium storing one or more programs, which can be executed by one or more processors to implement the steps of any of the above-mentioned license plate desensitization methods.

[0012] Compared with the prior art, the present invention provides a license plate desensitization method, a terminal and a storage medium. The license plate desensitization method provided by the present invention tracks the vehicles in the target video, obtains the vehicle spatial information of each vehicle in each frame, and then obtains the license plate spatial information of the license plate in each frame according to the vehicle spatial information of the vehicle, and then performs license plate desensitization processing according to the license plate spatial information, thereby realizing desensitization of the license plate information in the video. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 A flowchart of an embodiment of the license plate desensitization method provided by the present invention;

[0014] Figure 2 A schematic diagram of obtaining the first vehicle position information in an embodiment of the license plate desensitization method provided by the present invention;

[0015] Figure 3 A schematic diagram of the process of obtaining vehicle spatial information in an embodiment of the license plate desensitization method provided by the present invention;

[0016] Figure 4 A schematic diagram of obtaining the spatial information of the first license plate in an embodiment of the license plate desensitization method provided by the present invention;

[0017] Figure 5 A schematic diagram of the process of obtaining the spatial information of the target license plate in an embodiment of the license plate desensitization method provided by the present invention;

[0018] Figure 6 A schematic diagram of the principles of an embodiment of a terminal provided by the present invention. DETAILED DESCRIPTION

[0019] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0020] Embodiment 1

[0021] The license plate desensitization method provided by the present invention can be applied to a terminal, and the terminal can be but is not limited to various computers, laptops, mobile devices, etc.

[0022] like Figure 1 As shown, in one embodiment of the license plate desensitization method provided by the present invention, the method comprises:

[0023] S100: Acquire a target video, and acquire vehicle space information corresponding to each vehicle in each frame of the target video.

[0024] The vehicle spatial information includes the frame number, vehicle ID and vehicle location information. Of course, in other implementations, in order to improve the accuracy of subsequent license plate detection, the vehicle spatial information may also include other parameters, such as vehicle category, confidence, etc. The target video is a video that needs to be desensitized for license plates. Specifically, the terminal that executes the license plate desensitization method provided in this embodiment may be a remote server. After the Web service receives the desensitization instruction, it obtains the target video from the Hadoop server, builds a license plate data desensitization system through the Spring Boot framework and the LayUI front-end framework, and uploads the target video to the remote server for desensitization.

[0025] After acquiring the target video, obtain the vehicle space information corresponding to each vehicle in each frame of the target video, including:

[0026] S110, identifying first vehicle position information corresponding to each vehicle in each frame in the target video.

[0027] Specifically, Figure 2 As shown, the position information of each vehicle in each frame can be identified as the first vehicle position information by a YOLOv3 (You Only Look Once V3, a target detection algorithm) detection module. The vehicle position information is information reflecting the position of the vehicle in the frame. In this embodiment, the vehicle position can be identified by a rectangular bounding box surrounding the vehicle. Of course, the step of detecting the vehicle position information can also be implemented by other target detection algorithms, and the present invention does not make specific restrictions on this.

[0028] S120. Assign a vehicle ID to each vehicle in the first video frame in the target video, and use first vehicle position information corresponding to the vehicle in the first video frame as vehicle position information in the vehicle spatial information corresponding to the vehicle.

[0029] As mentioned above, the vehicle spatial information of a vehicle includes the frame number, the vehicle ID and the license plate position information. In the video, the vehicle is moving, that is, the number and position of the vehicles in each frame will change. In this embodiment, in order to achieve vehicle tracking, a vehicle ID is first assigned to each vehicle in the first video frame in the target video, and the first vehicle position information corresponding to the vehicle in the first video frame is used as the vehicle position information in the vehicle spatial information of the vehicle. In this way, the vehicle spatial information of each vehicle in the first video frame is determined, and the vehicle spatial information of the vehicle in each subsequent frame is determined based on the vehicle spatial information of the previous video frame.

[0030] S130 , predicting each second vehicle position information in the T frame according to the vehicle position information in the vehicle spatial information in the T-1 frame.

[0031] The T frame is the frame after the T-1 frame in the target video frame, and the second vehicle position information is the vehicle position information of the vehicle in the T frame. In the present embodiment, the vehicle position information of the vehicle in the T-1 frame is used to predict the vehicle position information of the vehicle in the T frame (i.e., the second vehicle position information). Specifically, a Kalman filter can be used to predict the trajectory of the vehicle based on the vehicle position information in the T-1 frame, thereby predicting the vehicle position information of the T frame.

[0032] S140: Match each second vehicle position information in the T frame with each first vehicle position information in the T frame.

[0033] In this embodiment, the second vehicle position information is matched with the first vehicle position information by using the Hungarian algorithm, and the specific process is as follows:

[0034] When matching the target first vehicle position information with the target second vehicle position information, the IOU (intersection over union) between the target first vehicle position information and the target second vehicle position information is calculated, and then the IPU is assigned to the edge weight of the bipartite graph. Finally, the maximum match of the IOU matrix of the bipartite graph is solved by the Hungarian algorithm. If the maximum match is higher than the preset value, the match is successful, otherwise the match is unsuccessful.

[0035] S150. If the target first vehicle position information in the T frame successfully matches the target second vehicle position information, the vehicle ID of the first vehicle in the T frame is set to the vehicle ID of the vehicle corresponding to the target second vehicle position information in the T-1 frame, and the target first vehicle position information is used as the vehicle position information in the vehicle space information corresponding to the first vehicle in the T frame.

[0036] The first vehicle is the vehicle corresponding to the target first vehicle position information. It is not difficult to see from the previous description that the second vehicle position information in the T frame is obtained based on the vehicle trajectory predicted by the first vehicle position information of the vehicle in the T-1 frame. Therefore, if a certain first vehicle position information in the T frame matches a certain second vehicle position information successfully, then it means that a certain vehicle in the T frame is the same vehicle as a certain vehicle in the T-1 frame. In this embodiment, if the target first vehicle position information in the T frame matches the target second vehicle position information successfully, the vehicle ID of the first vehicle in the T frame is set to the vehicle ID of the vehicle corresponding to the target second vehicle position information in the T-1 frame, and the target first vehicle position information is used as the vehicle position information in the vehicle spatial information corresponding to the first vehicle in the T frame. In this way, the vehicle spatial information corresponding to the first vehicle in the T frame is determined.

[0037] S160: If the target second vehicle position information in the T frame cannot match any of the first vehicle position information in the T frame, the target second vehicle position information is discarded.

[0038] If the target second vehicle position information of frame T cannot match the first vehicle position information in frame T, it means that a vehicle in frame T-1 has left the shooting area of ​​the target video in frame T and no longer appears in the target video. At this time, the target second vehicle position information can be directly discarded without any processing.

[0039] S170. If the target first vehicle position information in the T frame cannot match any of the second vehicle position information in the T frame, a new vehicle ID is assigned to the first vehicle, and the target first vehicle position information is used as the vehicle position information in the vehicle space information corresponding to the first vehicle in the T frame.

[0040] If the target first vehicle position information in the T frame cannot match any of the second vehicle position information in the T frame, it means that the vehicle corresponding to the target first vehicle position information in the T frame is a newly appeared vehicle. In this way, a new vehicle ID is assigned to the vehicle corresponding to the target first vehicle position information, and the target first vehicle position information is used as the vehicle position information in the vehicle spatial information corresponding to the first vehicle. In this way, the vehicle spatial information of the vehicle corresponding to the target first vehicle position information in the T frame is determined.

[0041] The schematic diagram of the process of obtaining vehicle space information in this embodiment can be as follows: Figure 3 shown.

[0042] Please refer again Figure 1 In this embodiment, after obtaining the vehicle space information of each vehicle in each frame of the target video, the steps include:

[0043] S200. Acquire first license plate spatial information of each vehicle in each frame of the target video according to the vehicle spatial information of each vehicle in each frame of the target video.

[0044] Specifically, obtaining the first license plate spatial information of each vehicle in each frame of the target video according to the vehicle spatial information of each vehicle in each frame of the target video includes:

[0045] The vehicle spatial information corresponding to each vehicle in the target frame is input into a pre-trained license plate recognition model, and the first license plate spatial information corresponding to each vehicle in the target frame is output.

[0046] The license plate recognition model is trained based on multiple sets of training data. Each set of training data includes sample vehicle spatial information and sample license plate spatial information corresponding to the sample spatial information. In this way, the license plate recognition model after training has the ability to output license plate spatial information based on vehicle spatial information, that is, the license plate recognition model can detect license plates. The schematic diagram of the license plate recognition model detecting license plates is shown in Figure 4In this embodiment, the license plate spatial information includes the frame number, the vehicle ID and the license plate position information. The format of the first license plate spatial information output by the license plate recognition model can be: <frame number, vehicle ID, license plate position information>. Of course, it can be understood that in other possible implementations, in order to improve the accuracy of subsequent license plate detection, the vehicle spatial information can also include other parameters, such as vehicle category, confidence level, etc.

[0047] Specifically, the license plate detection mode can be based on MobileNet-SSD training, and the training data can be converted into an XML file, and the format can refer to the VOC data set. Of course, those skilled in the art can understand that the license plate recognition model can also be constructed and trained through other model frameworks.

[0048] After acquiring the first license plate spatial information, the license plate desensitization method provided in this embodiment further includes the steps of:

[0049] S300: Acquire target license plate space information according to the first license plate space information.

[0050] In this embodiment, for each vehicle in the target video, after the corresponding first license plate spatial information is obtained through the license plate recognition model, since the license plate recognition model may have false detection, in this embodiment, for the target license plate spatial information corresponding to the target vehicle in each frame of the target video, the license plate position information of the target vehicle in the frame is predicted based on the license plate position information of the previous frame and the next frame, and then the target license plate spatial information of the target vehicle is determined by combining the first license plate spatial information and the predicted license plate position information. The flow chart of obtaining the target license plate spatial information based on the first license plate spatial information can be as follows: Figure 5 As shown, specifically including:

[0051] S310, predicting the second license plate position information of the target vehicle in the T frame according to the license plate position information in the positive sequence license plate spatial information of the target vehicle in the T-1 frame;

[0052] S320, acquiring the positive-sequence license plate spatial information of the target vehicle in the T frame according to the first license plate spatial information and the second license plate position information of the target vehicle in the T frame;

[0053] S330, predicting the third license plate position information of the target vehicle in the T frame according to the license plate position information in the target license plate spatial information of the target vehicle in the T+1 frame;

[0054] S340, acquiring the target license plate spatial information of the target vehicle in the T frame according to the positive-sequence license plate spatial information of the target vehicle in the T frame and the third license plate position information.

[0055] Among them, the positive sequence license plate spatial information of the target vehicle in the first frame of the target video is the first license plate spatial information of the target vehicle in the first frame, and the target license plate spatial information corresponding to the last frame of the target vehicle in the target video is the positive sequence license plate spatial information of the target vehicle in the last frame.

[0056] Specifically, since the first license plate spatial information includes the vehicle ID, it is possible to determine which vehicle in the previous frame or the next frame is the same vehicle as the target vehicle in the current frame based on the vehicle ID. The license plate position information in the T frame can be predicted based on the license plate position information of the target vehicle in the T-1 frame or the T+1 frame through the OpenCV multi-target detector. Of course, those skilled in the art may use other target detectors to implement license plate position information prediction, and the present invention does not make any specific limitation on this.

[0057] The license plate position information in the positive sequence license plate spatial information includes two, that is, there can be two license plate position information in the positive sequence license plate spatial information. According to the first license plate spatial information and the second license plate position information of the target vehicle in the T frame, the positive sequence license plate spatial information of the target vehicle in the T frame is obtained, including:

[0058] S321, when the vehicle spatial information of the target vehicle exists in the T frame and the first license plate spatial information of the target vehicle does not exist, the second license plate position information is used as the license plate position information in the positive sequence license plate spatial information of the target vehicle in the T frame;

[0059] When the target vehicle's vehicle spatial information does not exist in the T frame, it means that the target vehicle has left the video shooting area in the T frame, and there is no need to detect the target vehicle's license plate spatial information in the T frame. At this time, the second license plate position information of the target vehicle can be discarded. When the target vehicle's vehicle spatial information exists in the T frame, but the target vehicle's first license plate spatial information does not exist, it means that the target vehicle exists in the T frame, and the license plate detection model fails to detect the target vehicle's first license plate spatial information. At this time, the second license plate position information of the target vehicle in the T frame predicted based on the target vehicle's license plate position information in the T-1 frame is used as the license plate position information in the positive-sequence license plate spatial information of the target vehicle in the T frame. Specifically, when the second license plate position information is used, the second license plate position information is used as the license plate position information in the positive-sequence license plate spatial information of the target vehicle in the T frame. It is worth noting that there are two license plate position information in the positive sequence license plate space information, and the second license plate position information is predicted based on the positive sequence license plate space information of the target vehicle in the T-1 frame. Therefore, there may also be two second license plate position information. When there is one second license plate position information, the second license plate position information is used as the second license plate position information of the target license plate in the positive sequence license plate space information in the T frame. At this time, the first license plate position information in the positive sequence license plate space information is empty. When there are two second license plate position information, when the second license plate position information is used as the license plate position information of the target vehicle in the positive sequence license plate space information in the T frame, the order remains unchanged.

[0060] S322, when there is first license plate spatial information of the target vehicle in the T frame and there is only one second license plate position information of the target vehicle in the T frame, obtaining a first intersection-over-union ratio of the rectangular bounding box of the license plate in the second license plate position information and the rectangular bounding box of the first license plate position information;

[0061] If the first intersection-over-union ratio is less than a preset threshold, the first license plate position information is used as the first license plate position information in the positive sequence license plate space information of the target vehicle in the T frame, and the second license plate position information is used as the second license plate position information in the positive sequence license plate space information of the target vehicle in the T frame;

[0062] If the first intersection-over-union ratio is greater than a preset threshold, the second license plate position information is discarded, and the first license plate position information is used as the first license plate position information in the positive-sequence license plate spatial information of the target vehicle.

[0063] The first license plate position information is the license plate position information in the first license plate space information of the target vehicle in the T frame. The second license plate information of the target vehicle in the T frame is predicted based on the positive-sequence license plate space information of the target vehicle in the T-1 frame. That is, when there is only one license plate position information in the positive-sequence license plate space information of the target vehicle in the T-1 frame, then there is only one second license plate position information of the target vehicle in the T frame. At this time, the intersection-and-union ratio (i.e., the first intersection-and-union ratio) of the license plate rectangular bounding box in the second license plate position information and the license plate rectangular bounding box in the first license plate position information is obtained. If the first intersection-and-union ratio is less than a preset threshold, it means that the second license plate position information and the first license plate position information point to different areas. Then both are saved. Specifically, the first license plate position information is used as the first license plate position information in the positive-sequence license plate space information of the target vehicle in the T frame, and the second license plate position information is used as the second license plate position information in the positive-sequence license plate space information of the target vehicle in the T frame. In this way, the positive-sequence license plate space information of the target vehicle in the T frame is determined. If the first intersection-and-union ratio is greater than the preset threshold, it means that the second license plate position information and the first license plate position information point to the same area, then the second license plate position information is discarded, and the first license plate position information is saved to the first license plate position information in the positive sequence license plate space information of the target vehicle in the T frame, completing the process of determining the positive sequence license plate space information of the target vehicle in the T frame. At this time, the second license plate position information in the positive sequence license plate space information of the target vehicle in the T frame is empty.

[0064] The preset threshold can be set by yourself, for example, it can be set to 0.5, 0.8, etc.

[0065] According to the first license plate space information and the second license plate position information of the target vehicle in the T frame, the positive sequence license plate space information of the target vehicle in the T frame is obtained, and further comprising:

[0066] S323, when there is first license plate spatial information of the target vehicle in the T frame and there are two second license plate position information of the target vehicle in the T frame, obtain a second intersection-and-union ratio of the license plate rectangular bounding box in the second second license plate position information and the rectangular bounding box in the first license plate position information;

[0067] If the second intersection-over-union ratio is less than a preset threshold, the first license plate position information is used as the first license plate position information in the positive-sequence license plate spatial information of the target vehicle, and the second license plate position information is used as the second license plate position information in the positive-sequence license plate spatial information of the target vehicle;

[0068] If the second intersection-and-union ratio is greater than a preset threshold, obtaining a third intersection-and-union ratio of the rectangular bounding box of the license plate in the first second license plate position information and the rectangular bounding box in the first license plate position information;

[0069] If the third intersection-over-union ratio is less than a preset threshold, the first license plate position information is used as the first license plate position information in the positive-sequence license plate spatial information of the target vehicle, and the first second license plate position information is used as the second license plate position information in the positive-sequence license plate spatial information of the target vehicle;

[0070] If the third intersection-over-union ratio is greater than a preset threshold, the second license plate position information is discarded, and the first license plate position information is used as the first license plate position information in the positive-sequence license plate spatial information of the target vehicle.

[0071] When there are two license plate position information in the positive sequence license plate spatial information of the target vehicle in the T-1 frame, there are two second license plate position information of the target vehicle in the T frame, and the first one is predicted based on the first license plate position information in the positive sequence license plate spatial information of the target vehicle in the T-1 frame, and the second one is predicted based on the second license plate position information in the positive sequence license plate spatial information of the target vehicle in the T-1 frame. At this time, the intersection and union ratio (i.e., the second intersection and union ratio) of the license plate rectangular bounding box in the second second license plate position information and the license plate rectangular bounding box in the first license plate position information is first obtained. If the second intersection and union ratio is less than the preset threshold, it means that the second second license plate position information and the first license plate position information point to different areas, then both are saved. Specifically, the first license plate position information is stored in the first license plate position information in the positive sequence license plate spatial information of the target vehicle in the T frame, and the second second license plate position information is used as the second license plate position information in the positive sequence license plate spatial information of the target vehicle in the T frame. If the second intersection-and-union ratio is greater than the preset threshold, it means that the second second license plate position information and the first license plate position information point to the same area. Then, it is further determined whether the first second license plate position information and the first license plate position information point to the same area, that is, the intersection-and-union ratio (i.e., the third intersection-and-union ratio) of the license plate rectangular bounding box in the first second license plate position information and the license plate rectangular bounding box in the first license plate position information is obtained. If the third intersection-and-union ratio is less than the preset threshold, it means that the first second license plate position information and the first license plate position information point to different areas. Then, both are saved. Specifically, the first license plate position information is used as the first license plate position information in the positive sequence license plate space information of the target vehicle in the T frame, and the first second license plate position information is used as the second license plate position information in the positive sequence license plate space information of the target vehicle in the T frame. If the third intersection-and-union ratio is greater than the preset threshold, it means that the first second license plate position information and the first license plate position information point to the same area. Then, the second license plate position information is discarded, and the first license plate position information is used as the first license plate position information in the positive sequence license plate space information of the target vehicle in the T frame.

[0072] Through the above steps, the positive sequence license plate spatial information of each vehicle in each frame can be determined. In this embodiment, the target license plate spatial information used for license plate desensitization is determined based on the positive sequence license plate spatial information of each vehicle in each frame. The target license plate spatial information also includes two. According to the positive sequence license plate spatial information of the target vehicle in the T frame and the third license plate position information, the target license plate spatial information of the target vehicle in the T frame is obtained, including:

[0073] S341. When the vehicle space information of the target vehicle is in the T frame and there is no positive-sequence license plate space information of the target vehicle, the third license plate position information is used as the second license plate position information of the target vehicle in the target license plate space information in the T frame.

[0074] When the target vehicle's vehicle space information exists in the T frame and the target vehicle's positive-sequence license plate space information does not exist, the target vehicle's third license plate position information in the T frame predicted based on the target vehicle's license plate position information in the T+1 frame is used as the target vehicle's license plate position information in the target license plate space information in the T frame. It is worth noting that there are two license plate position information in the target license plate space information, and the third license plate position information is predicted based on the target license plate space information of the target vehicle in the T+1 frame. Therefore, there may also be two third license plate position information. When there is one third license plate position information, the third license plate position information is used as the second license plate position information in the target license plate space information of the target vehicle in the T frame. At this time, the first license plate position information in the target license plate space information is empty. When there are two third license plate position information, when the second license plate position information is used as the license plate position information in the positive-sequence license plate space information of the target vehicle in the T frame, the order remains unchanged.

[0075] S342, when there is positive-sequence license plate spatial information of the target vehicle in the T frame and there is only one license plate position information in the positive-sequence license plate spatial information, obtain a fourth intersection-and-union ratio of the license plate rectangular bounding box in the third license plate position information and the rectangular bounding box of the license plate position information in the positive-sequence license plate spatial information;

[0076] If the fourth intersection-over-union ratio is less than a preset threshold, the license plate position information in the positive sequence license plate space information is used as the first license plate position information in the target license plate space information of the target vehicle in the T frame, and the third license plate position information is used as the second license plate position information in the target license plate space information of the target vehicle in the T frame;

[0077] If the fourth intersection-over-union ratio is greater than a preset threshold, the third license plate position information is discarded, and the license plate position information in the positive sequence license plate space information is used as the first license plate position information in the target license plate space information of the target vehicle in the T frame.

[0078] When there is the positive-sequence license plate spatial information of the target vehicle in the T frame and there is only one license plate position information in the positive-sequence license plate spatial information, the intersection-and-union ratio (i.e., the fourth intersection-and-union ratio) of the rectangular bounding box of the license plate in the third license plate position information and the rectangular bounding box of the license plate position information of the target vehicle in the positive-sequence license plate spatial information of the T frame is obtained. It is worth noting that if there are two third license plate position information, the second third license plate position information is used to obtain the fourth intersection-and-union ratio, that is, the license plate position information of the target vehicle in the T frame predicted by the second license plate position information in the target license plate spatial information of the target vehicle in the T+1 frame is used to obtain the fourth intersection-and-union ratio.

[0079] If the fourth intersection-and-union ratio is less than the preset threshold, it means that the third license plate position information and the license plate position information in the forward-sequence license plate space information point to different areas. At this time, both the third license plate position information and the first license plate position information are saved. Specifically, the license plate position information in the forward-sequence license plate space information is used as the first license plate position information in the target license plate space information of the target vehicle in the T frame, and the third license plate position information (when there are two third license plate position information, take the second one) is used as the second license plate position information in the target license plate space information of the target vehicle in the T frame.

[0080] If the fourth intersection-and-union ratio is greater than the preset threshold, it means that the third license plate position information and the license plate position information in the positive-sequence license plate spatial information point to the same area. In this case, the third license plate position information is discarded, and the license plate position information in the positive-sequence license plate spatial information is used as the first license plate position information in the target license plate spatial information of the target vehicle in the T frame. At this time, the second license plate position information in the target license plate spatial information of the target vehicle in the T frame is empty. S343. When the positive-sequence license plate spatial information of the target vehicle exists in the T frame and there are two license plate position information in the positive-sequence license plate spatial information, obtain the fifth intersection-and-union ratio of the license plate rectangular bounding boxes in the two license plate position information in the positive-sequence license plate spatial information and the rectangular bounding box in the third license plate position information respectively;

[0081] If both fifth intersection-union ratios are less than a preset threshold, the average value of the third license plate position information and the second license plate position information in the positive sequence license plate space information is taken, and the average value is used as the second license plate position information in the target license plate space information.

[0082] When there is the positive sequence license plate spatial information of the target vehicle in the T frame and there are two license plate position information in the positive sequence license plate spatial information, the intersection and union ratio (i.e., the fifth intersection and union ratio) of the license plate rectangular bounding box in the two license plate position information in the positive sequence license plate spatial information and the rectangular bounding box in the third license plate position information is obtained respectively. It is not difficult to see that there are two fifth intersection and union ratios, namely, the intersection and union ratio of the license plate rectangular bounding box in the first license plate position information in the positive sequence license plate spatial information and the rectangular bounding box in the third license plate position information, and the intersection and union ratio of the license plate rectangular bounding box in the second license plate position information in the positive sequence license plate spatial information and the rectangular bounding box in the third license plate position information. It is worth noting that if there are two third license plate position information, the second third license plate position information is used to obtain the fifth intersection and union ratio, that is, the license plate position information of the target vehicle in the T frame predicted by the second license plate position information in the target license plate spatial information of the target vehicle in the T+1 frame is used to obtain the fifth intersection and union ratio.

[0083] If both fifth intersection-and-union ratios are less than the preset threshold, then the average of the third license plate position information (if there are two third license plate position information, take the second one) and the second license plate position information in the positive-sequence license plate space information is taken as the second license plate position information in the target license plate space information of the target vehicle in the T frame, and the first license plate position information in the positive-sequence license plate space information of the target vehicle in the T frame is taken as the first license plate position information in the target license plate space information.

[0084] If one of the two fifth intersection-and-union ratios is greater than a preset threshold, the one greater than the preset threshold is discarded, and the one less than the preset threshold is used as the second license plate position information in the target license plate space information of the target vehicle in the T frame, and the first license plate position information in the positive sequence license plate space information of the target vehicle in the T frame is used as the first license plate position information in the target license plate space information.

[0085] If both fifth intersection-and-union ratios are greater than a preset threshold, the third license plate position information is discarded, and the positive-sequence license plate spatial information of the target vehicle in the T frame is used as the target license plate spatial information of the target vehicle in the T frame.

[0086] Please refer again Figure 1 The license plate desensitization method provided in this embodiment also includes the steps of:

[0087] S400: desensitizing each license plate in the target video according to the target license plate spatial information.

[0088] After the target license plate spatial information is obtained, the area corresponding to the license plate position information in the target license plate spatial information in each frame of the target video is mosaic processed to achieve license plate desensitization. If there are two license plate position information in the target license plate spatial information, the areas corresponding to the two license plate position information are mosaic processed. In summary, this embodiment provides a license plate desensitization method, which tracks the vehicles in the target video, obtains the vehicle spatial information of each vehicle in each frame, and then obtains the license plate spatial information of the license plate in each frame based on the vehicle spatial information of the vehicle, and then performs license plate desensitization processing based on the license plate spatial information, thereby achieving desensitization of the license plate information in the target video.

[0089] In a possible implementation, after the license plate is desensitized to the target video, the evaluation results such as the accuracy, recall rate and total evaluation index of the license plate detection and tracking results can also be calculated. The accuracy calculation formula is: The recall calculation formula is: Where P represents the positive samples in the test samples, TP represents the positive samples in the samples that have been detected and tracked, and FP represents the negative samples in the samples that have been detected and tracked. The calculation formula for the comprehensive evaluation index is: Where Pr represents the precision, Re represents the recall, and the parameter a is 1.

[0090] In terms of data storage, Cloudera can be used to build a Hadoop server, and the original video and the desensitized video can be stored in the Hadoop server for subsequent data processing, such as video demonstration, data reading, big data analysis, etc. After the video desensitization is completed, the video files (original video and desensitized video) are uploaded to the FTP server, and then the command is sent to the Hadoop proxy server. The Hadoop proxy server downloads the file from the FTP server and uploads it to the Hadoop server.

[0091] It should be understood that the steps provided in the present invention are not necessarily performed in the order of description. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be performed in other orders. Moreover, at least a part of the steps may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0092] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0093] Embodiment 2

[0094] Based on the above embodiments, the present invention also provides a terminal, such as Figure 6 As shown, the terminal includes a processor 10 and a memory 20. Figure 6 Only some components of the terminal are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.

[0095] The memory 20 may be an internal storage unit of the terminal in some embodiments, such as a hard disk or memory of the terminal. The memory 20 may also be an external storage device of the terminal in other embodiments, such as 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), etc. equipped on the terminal. Further, the memory 20 may also include both an internal storage unit of the terminal and an external storage device. The memory 20 is used to store application software and various types of data installed in the terminal. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, a license plate desensitization program 30 is stored on the memory 20, and the license plate desensitization program 30 may be executed by the processor 10, thereby realizing the license plate desensitization method in the present application.

[0096] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor or other chip, used to run the program code or process data stored in the memory 20, such as executing the license plate desensitization method, etc., as specifically described in Example 1.

[0097] Embodiment 3

[0098] The present invention also provides a storage medium, in which one or more programs are stored. The one or more programs can be executed by one or more processors to implement the steps of the license plate desensitization method as described above.

[0099] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A license plate desensitization method, characterized in that: The method comprises: Acquire a target video, and acquire vehicle spatial information corresponding to each vehicle in each frame of the target video, wherein the vehicle spatial information includes a frame number, a vehicle ID, and vehicle position information; Acquire first license plate spatial information of each vehicle in each frame of the target video according to vehicle spatial information of each vehicle in each frame of the target video; Acquire target license plate space information according to the first license plate space information; Desensitizing each license plate in the target video according to the target license plate spatial information; Among them, the license plate spatial information includes the frame sequence number, vehicle ID and license plate position information; The obtaining of vehicle space information corresponding to each vehicle in each frame of the target video includes: Identify first vehicle position information corresponding to each vehicle in each frame in the target video; Assigning a vehicle ID to each vehicle in a first video frame in the target video, and using first vehicle position information corresponding to the vehicle in the first video frame as vehicle position information in vehicle spatial information corresponding to the vehicle; Predicting each second vehicle position information in the T frame according to the vehicle position information in the vehicle spatial information of the T-1 frame, wherein the T frame is a frame subsequent to the T-1 frame in the target video; Matching each second vehicle position information in the T frame with each first vehicle position information in the T frame; If the target first vehicle position information in the T frame successfully matches the target second vehicle position information, the vehicle ID of the first vehicle in the T frame is set to the vehicle ID of the vehicle corresponding to the target second vehicle position information in the T-1 frame, and the target first vehicle position information is used as the vehicle position information in the vehicle space information corresponding to the first vehicle in the T frame; If the target second vehicle position information in the T frame cannot match any of the first vehicle position information in the T frame, discarding the target second vehicle position information; If the target first vehicle position information in the T frame cannot match any of the second vehicle position information in the T frame, a new vehicle ID is assigned to the first vehicle, and the target first vehicle position information is used as the vehicle position information in the vehicle space information corresponding to the first vehicle in the T frame; Among them, the first vehicle is the vehicle corresponding to the target first vehicle position information.

2. The license plate desensitization method according to claim 1, characterized in that: The step of obtaining first license plate spatial information of each vehicle in each frame of the target video according to the vehicle spatial information of each vehicle in each frame of the target video includes: Inputting the vehicle spatial information corresponding to each vehicle in the target frame into a pre-trained license plate recognition model, and outputting the first license plate spatial information corresponding to each vehicle in the target frame; The license plate recognition model is trained based on multiple sets of training data, and each set of training data includes sample vehicle spatial information and sample license plate spatial information corresponding to the sample vehicle spatial information.

3. The license plate desensitization method according to claim 1, characterized in that: The step of acquiring target license plate space information according to the first license plate space information includes: Predicting the second license plate position information of the target vehicle in the T frame according to the license plate position information in the positive sequence license plate spatial information in the T-1 frame; Acquire the positive-sequence license plate spatial information of the target vehicle in the T frame according to the first license plate spatial information and the second license plate position information of the target vehicle in the T frame; Predicting the third license plate position information of the target vehicle in the T frame according to the license plate position information in the target license plate spatial information of the target vehicle in the T+1 frame; According to the positive-sequence license plate spatial information of the target vehicle in the T frame and the third license plate position information, acquiring the target license plate spatial information of the target vehicle in the T frame; Among them, the positive sequence license plate spatial information of the target vehicle in the first frame of the target video is the first license plate spatial information of the target vehicle in the first frame, and the target license plate spatial information corresponding to the last frame of the target vehicle in the target video is the positive sequence license plate spatial information of the target vehicle in the last frame.

4. The license plate desensitization method according to claim 3, characterized in that: The positive-sequence license plate spatial information includes two license plate position information, and acquiring the positive-sequence license plate spatial information of the target vehicle in the T frame according to the first license plate spatial information and the second license plate position information of the target vehicle in the T frame includes: When the vehicle spatial information of the target vehicle exists in the T frame and the first license plate spatial information of the target vehicle does not exist, using the second license plate position information as the license plate position information of the target vehicle in the positive sequence license plate spatial information in the T frame; When the first license plate spatial information of the target vehicle exists in the T frame and there is only one second license plate position information of the target vehicle in the T frame, obtaining a first intersection-and-union ratio of a license plate rectangular bounding box in the second license plate position information and a license plate rectangular bounding box in the first license plate position information; If the first intersection-over-union ratio is less than a preset threshold, the first license plate position information is used as the first license plate position information in the positive-sequence license plate spatial information of the target vehicle in the T frame, and the second license plate position information is used as the second license plate position information in the positive-sequence license plate spatial information of the target vehicle in the T frame; If the first intersection-over-union ratio is greater than the preset threshold, the second license plate position information is discarded, and the first license plate position information is used as the first license plate position information in the positive sequence license plate space information of the target vehicle in the T frame; The first license plate position information is the license plate position information of the target vehicle in the first license plate space information in the T frame.

5. The license plate desensitization method according to claim 4, characterized in that: The step of acquiring the positive-sequence license plate spatial information of the target vehicle in the T frame according to the first license plate spatial information and the second license plate position information of the target vehicle in the T frame further includes: When the first license plate spatial information of the target vehicle exists in the T frame and there are two second license plate position information of the target vehicle in the T frame, obtaining a second intersection-and-union ratio of a license plate rectangular bounding box in a second second license plate position information and a rectangular bounding box in the first license plate position information; If the second intersection-over-union ratio is less than the preset threshold, the first license plate position information is used as the first license plate position information in the positive-sequence license plate spatial information of the target vehicle in the T frame, and the second license plate position information is used as the second license plate position information in the positive-sequence license plate spatial information of the target vehicle in the T frame; If the second intersection-and-union ratio is greater than the preset threshold, obtaining a third intersection-and-union ratio of the license plate rectangular bounding box in the first second license plate position information and the license plate rectangular bounding box in the first license plate position information; If the third intersection-over-union ratio is less than the preset threshold, the first license plate position information is used as the first license plate position information in the positive-sequence license plate spatial information of the target vehicle in the T frame, and the first second license plate position information is used as the second license plate position information in the positive-sequence license plate spatial information of the target vehicle in the T frame; If the third intersection-over-union ratio is greater than the preset threshold, the second license plate position information is discarded, and the first license plate position information is used as the first license plate position information in the positive sequence license plate space information of the target vehicle in the T frame.

6. The license plate desensitization method according to claim 3, characterized in that: The target license plate spatial information includes two license plate position information, and acquiring the target license plate spatial information of the target vehicle in the T frame according to the positive sequence license plate spatial information and the third license plate position information of the target vehicle in the T frame includes: When the vehicle spatial information of the target vehicle exists in the T frame and the positive-sequence license plate spatial information of the target vehicle does not exist, using the third license plate position information as the second license plate position information in the target license plate spatial information of the target vehicle in the T frame; When the positive-sequence license plate spatial information of the target vehicle exists in the T frame and there is only one license plate position information in the positive-sequence license plate spatial information, obtaining a fourth intersection-and-union ratio of the license plate rectangular bounding box in the third license plate position information and the rectangular bounding box of the license plate position information in the positive-sequence license plate spatial information; If the fourth intersection-over-union ratio is less than a preset threshold, the license plate position information in the positive sequence license plate space information is used as the first license plate position information in the target license plate space information of the target vehicle in the T frame, and the third license plate position information is used as the second license plate position information in the target license plate space information of the target vehicle in the T frame; If the fourth intersection-over-union ratio is greater than the preset threshold, the third license plate position information is discarded, and the license plate position information in the positive sequence license plate space information is used as the first license plate position information in the target license plate space information of the target vehicle in the T frame.

7. The license plate desensitization method according to claim 6, characterized in that: The step of acquiring the target license plate spatial information of the target vehicle in the T frame according to the positive-sequence license plate spatial information and the third license plate position information of the target vehicle in the T frame further includes: When the positive-sequence license plate spatial information of the target vehicle exists in the T frame and there are two license plate position information in the positive-sequence license plate spatial information, respectively obtaining a fifth intersection-and-union ratio of the license plate rectangular bounding boxes in the two license plate position information in the positive-sequence license plate spatial information and the rectangular bounding box in the third license plate position information; If both of the fifth intersection-and-union ratios are less than the preset threshold, the average of the third license plate position information and the second license plate position information in the positive-sequence license plate space information is taken, and the average value is used as the second license plate position information in the target license plate space information of the target vehicle in the T frame, and the first license plate position information in the positive-sequence license plate space information of the target vehicle in the T frame is used as the first license plate position information in the target license plate space information of the target vehicle in the T frame.

8. A terminal, characterized in that: The terminal includes: a processor, a storage medium communicatively connected to the processor, the storage medium being suitable for storing a plurality of instructions, and the processor being suitable for calling the instructions in the storage medium to execute the steps of implementing the license plate desensitization method described in any one of claims 1 to 7.

9. A storage medium, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the license plate desensitization method as described in any one of claims 1-7.