A video-based license plate data desensitization method, storage medium and server
Patent Information
- Application Number
- CN202011077033.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-10
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2040-10-10
Smart Images

Figure CN112347853B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data protection, and in particular to a video-based license plate data desensitization method, storage medium and server. Background Art
[0002] Vehicle information in surveillance videos at traffic intersections, community gates, shopping mall gates, parking lots and other scenes can be used for scientific research such as traffic flow statistics. The license plate information in the vehicle is personal privacy. People are becoming more and more aware of privacy protection. It is particularly important to deform the data through desensitizing rules to achieve reliable protection of sensitive privacy data.
[0003] Although license plate detection and recognition technology is now quite mature and has been commercialized, most of them are limited to scenes, and the license plate is detected after the vehicle is stationary, such as parking lots and community gates. However, most vehicles are moving at traffic intersections, and the size of the license plate will change from far to near or from near to far. License plate detection technology often uses morphological license plate detection, color feature-based license plate detection, template matching-based license plate detection, texture analysis-based license plate detection, and neural network-based license plate detection. They all look for objects that may be license plates in the entire image, but because the license plate is too small relative to the entire image, it causes many false detections and missed detections. In complex scenes with heavy traffic such as traffic intersections, the detection accuracy of the license plate is not high, resulting in the inability to accurately desensitize the license plate data.
[0004] Therefore, the prior art still needs to be improved and developed. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide a video-based license plate data desensitization method, storage medium and server in response to the shortcomings of the existing technology, aiming to solve the problem that the existing technology has low accuracy in license plate detection, resulting in the inability to accurately desensitize the license plate data.
[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is as follows:
[0007] A video-based license plate data desensitization method, comprising the steps of:
[0008] Track and detect vehicles in the video to obtain vehicle location information;
[0009] According to the vehicle position information, a vehicle picture of a corresponding frame is intercepted from the video to obtain the license plate position information of the corresponding vehicle;
[0010] By constructing a decision tree binary classifier, it is determined whether the license plate is a falsely detected license plate. If so, the position information of the falsely detected license plate is removed, and the vehicle is recorded as a license plate missed detection vehicle; if not, the vehicle position information and the license plate position information are merged and stored accordingly;
[0011] The license plate coordinates of the vehicle whose license plate is missed are estimated by using Kalman filtering and saved;
[0012] The license plate of the vehicle in the video is mosaiced according to the stored license plate position information and license plate coordinates to achieve license plate data desensitization.
[0013] The video-based license plate data desensitization method, wherein the step of tracking and detecting the vehicle in the video and obtaining the vehicle position information comprises:
[0014] Detect vehicles in videos using a general object detection framework;
[0015] Use the SORT algorithm to track the detected vehicles. For each vehicle detected in the current frame, combine the position information of the same vehicle in the previous frame and the next frame, and take the average as the vehicle position information of the current frame;
[0016] The vehicle position information is smoothed and saved to a document, wherein the vehicle position information includes the frame number of the currently processed image, the detected object category, the vehicle ID, the coordinates of the four vertices of the vehicle detection frame sorted clockwise from the upper left point, and the confidence of the vehicle detection frame.
[0017] The video-based license plate data desensitization method, wherein the step of extracting a vehicle picture of a corresponding frame from the video according to the vehicle position information and obtaining the license plate position information of the corresponding vehicle comprises:
[0018] According to the vehicle position information, a vehicle picture of a corresponding frame is intercepted from the video, and the height of the intercepted vehicle picture is 110% of the height of the vehicle in the video;
[0019] A distorted plane object detection network is used to detect the license plate from the captured vehicle image to obtain the license plate position information, which includes the coordinates of the four vertices of the license plate detection frame sorted clockwise from the upper left point and the confidence of the license plate detection frame.
[0020] The video-based license plate data desensitization method, wherein the step of determining whether the license plate is a falsely detected license plate by constructing a decision tree binary classifier, if so, removing the position information of the falsely detected license plate and recording the vehicle as a license plate missed detection vehicle; if not, fusing the vehicle position information and the license plate position information and storing them accordingly includes:
[0021] According to the vehicle position information and the license plate position information, determining whether the four vertices of the license plate detection frame are all within the vehicle detection frame;
[0022] If at least one of the four vertices of the license plate detection frame is not within the vehicle detection frame, the license plate position information is removed, and the vehicle corresponding to the license plate is recorded as a license plate missed detection vehicle;
[0023] If the four vertices of the license plate detection frame are all within the vehicle detection frame, a decision tree binary classifier is constructed according to the vehicle position information and the license plate position information, and the decision tree binary classifier is used to determine whether the detected license plate is a falsely detected license plate;
[0024] If so, the position information of the misdetected license plate is removed, and the vehicle is recorded as a license plate missed detection vehicle; if not, the vehicle position information and the license plate position information are merged and stored accordingly.
[0025] The video-based license plate data desensitization method, wherein the step of using Kalman filtering to estimate the license plate coordinates of the vehicle whose license plate is missed and saving the coordinates comprises:
[0026] Traverse the vehicle position data and license plate position data stored in each frame of the image to find the vehicle whose license plate is missed;
[0027] A Kalman filter model is established, and the license plate coordinates of the vehicle whose license plate is missed are estimated and saved by using Kalman filter.
[0028] The video-based license plate data desensitization method, wherein the step of establishing a Kalman filter model and using Kalman filtering to estimate the license plate coordinates of the vehicle whose license plate is missed includes:
[0029] Setting a threshold value f_max traversed in the corresponding stored vehicle position information and license plate position information, and initializing the threshold value;
[0030] Determine the id of the vehicle whose license plate is missed as car_id and the frame number of the picture where the vehicle whose license plate is missed is frame_id;
[0031] In the corresponding stored vehicle position information and license plate position information, traverse the f_max frames forward from the missed frame frame_id, find the frame where the vehicle with the id car_id and the license plate is located, and store it in the forward frame list pre_frame_list;
[0032] In the corresponding stored vehicle position information and license plate position information, traverse f_max frames from the missed frame frame_id to find the frame where the vehicle with id car_id and license plate is located, and store it in the backward frame list back_frame_list;
[0033] Determine the state of the Kalman filter system [rptlx, rptly, rpw, rph], where rptlx is the ratio of the distance from the left vertex of the license plate to the left vertex of the corresponding vehicle to the vehicle width, rptly is the ratio of the distance from the left vertex of the license plate to the left vertex of the corresponding vehicle to the vehicle height, rpw is the ratio of the license plate width to the corresponding vehicle width, and rph is the ratio of the license plate height to the vehicle height. Establish a Kalman filter model based on the state of the Kalman filter system;
[0034] Determine whether the forward frame list pre_frame_list and the backward frame list back_frame_list are
[0035] is empty;
[0036] If the forward frame list pre_frame_list is not empty and the backward frame list back_frame_list is empty, the forward Kalman filter is used to estimate the license plate coordinates of the vehicle whose license plate is missed;
[0037] If the forward frame list pre_frame_list is empty and the backward frame list back_frame_list is not empty, the reverse Kalman filter is used to estimate the license plate coordinates of the vehicle whose license plate is missed;
[0038] If both the forward frame list pre_frame_list and the backward frame list back_frame_list are not empty, the forward frame list and the backward frame list are merged into a complete frame list full_frame_list, and the license plate coordinates of the vehicle whose license plate is missed are estimated by using bidirectional Kalman filtering.
[0039] The video-based license plate data desensitization method, wherein the step of estimating the license plate coordinates of the vehicle whose license plate is missed by using forward Kalman filtering comprises:
[0040] Find the vehicle with id car_id in the first frame frame_first of the forward frame list pre_frame_list, use the vehicle position information and license plate position information of the vehicle to calculate the corresponding Kalman filter system state, and initialize the Kalman model;
[0041] From the first frame frame_first to the missed frame frame_id, the system state of the license plate of the current frame car_id is predicted according to the system state of the license plate of the car car_id in the previous frame, and the predicted system state is updated with the detection value of the system state of the license plate of the car car_id in the current frame as the measurement value, and is used as the system state of the license plate of the car car_id in the current frame. If the license plate of the current frame is missed and has no detection value, the predicted value is used as the measurement value;
[0042] According to the updated system status of the missed license plate, the license plate coordinates of the missed license plate vehicle are calculated and saved.
[0043] The video-based license plate data desensitization method, wherein the step of estimating the position of the missed license plate by using reverse Kalman filtering comprises:
[0044] Find the vehicle with id car_id in the last frame frame_last of the backward frame list back_frame_list, use the vehicle position data and license plate position data of the vehicle to calculate the corresponding Kalman filter system state, and initialize the Kalman model;
[0045] From the last frame frame_last to the missed frame frame_id, the system state of the license plate of the car in the current frame car_id is predicted based on the system state of the license plate of the car in the next frame, and the predicted system state is updated with the detection value of the system state of the license plate of the car in the current frame car_id as the measurement value, and is used as the system state of the license plate of the car in the current frame car_id. If the license plate in the current frame is missed and has no detection value, the predicted value is used as the measurement value;
[0046] According to the updated system status of the missed license plate, the license plate coordinates of the vehicle with the missed license plate are calculated and saved.
[0047] The video-based license plate data desensitization method, wherein the step of estimating the position of the missed license plate using a bidirectional Kalman filter comprises:
[0048] Find the vehicle with id car_id from the first frame frame_first of the full frame list full_frame_list, use the vehicle position data and license plate position data of the vehicle to calculate the corresponding Kalman filter system state, and initialize the Kalman model;
[0049] From the first frame frame_first to the last frame frame_last in the complete frame list, predict the system state of the license plate of the car_id in the current frame according to the system state of the license plate of the car_id in the previous frame, and use the detection value of the system state of the license plate of the car_id in the current frame as the measurement value to update the predicted system state as the forward system state of the license plate of the car_id in the current frame. If the license plate in the current frame is missed and has no detection value, the predicted value is used as the measurement value;
[0050] Find the vehicle with id car_id from the last frame frame_last in the full frame list full_frame_list, use the vehicle position data and license plate position data of the vehicle to calculate the corresponding system state, and initialize the Kalman model;
[0051] From the last frame frame_last to the first frame frame_first in the complete frame list, predict the system state of the license plate of the car_id in the current frame according to the system state of the license plate of the car_id in the next frame, and use the detection value of the system state of the license plate of the car_id in the current frame as the measurement value to update the predicted system state as the reverse system state of the license plate of the car_id in the current frame. If the license plate in the current frame is missed and has no detection value, the predicted value is used as the measurement value;
[0052] The license plate coordinates of the missed-detection vehicle are calculated according to the forward system state and the reverse system state of the missed-detection frame frame_id, and the average is taken as the final license plate coordinates of the missed-detection vehicle and saved.
[0053] A video-based license plate data desensitization system, comprising: a processor, a memory and a communication bus; the memory stores a computer-readable program that can be executed by the processor;
[0054] The communication bus realizes the connection and communication between the processor and the memory;
[0055] When the processor executes the computer-readable program, the steps in the video-based license plate data desensitization method of the present invention are implemented.
[0056] Beneficial effect: Compared with the prior art, the video-based license plate data desensitization method provided by the present invention improves the accuracy of license plate detection, thereby improving the accuracy of license plate data desensitization, and realizes the desensitization of license plate data in surveillance videos in scenes such as traffic intersections, community gates, shopping mall gates, and parking lots, so that the desensitized videos can be publicly shared while protecting personal privacy. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 The present invention is a flowchart of a preferred embodiment of a video-based license plate data desensitization method.
[0058] Figure 2 The present invention is a schematic diagram of a video-based license plate data desensitization system. DETAILED DESCRIPTION
[0059] The present invention provides a method and system for desensitizing license plate data based on video. 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.
[0060] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0061] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as generally understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as herein.
[0062] The invention is further described below by describing embodiments in conjunction with the accompanying drawings.
[0063] Data desensitization refers to the deformation of certain sensitive information through desensitization rules to achieve reliable protection of sensitive privacy data, so that the desensitized real data set can be safely used in development, testing and other non-production environments and outsourcing environments. Vehicle information in surveillance videos at traffic intersections, community gates, shopping mall gates, parking lots and other scenes can be used for scientific research such as traffic flow statistics. The license plate information in the vehicle is personal privacy. People are becoming more and more aware of privacy protection. It is particularly important to deform sensitive information through desensitization rules to achieve reliable protection of sensitive privacy data. In order to make the information in the above scenario public and share it, it is necessary to desensitize the license plate data in the video.
[0064] Based on this, the present invention provides a video-based license plate data desensitization method, such as Figure 1 As shown, it includes the steps of:
[0065] S10, tracking and detecting the vehicle in the video to obtain vehicle position information;
[0066] S20, extracting a vehicle image of a corresponding frame from the video according to the vehicle position information, and obtaining license plate position information of the corresponding vehicle;
[0067] S30, determining whether the license plate is a falsely detected license plate by constructing a decision tree binary classifier, if so, removing the position information of the falsely detected license plate and recording the vehicle as a license plate missed detection vehicle; if not, merging the vehicle position information and the license plate position information and storing them accordingly;
[0068] S40, using Kalman filtering to estimate the license plate coordinates of the vehicle whose license plate is missed and save them;
[0069] S50: mosaic processing is performed on the license plate of the vehicle in the video according to the stored license plate position information and license plate coordinates to achieve license plate data desensitization.
[0070] This embodiment cuts out the vehicle from the video according to the vehicle tracking result, and then detects the license plate based on the cut-out vehicle, which reduces the scope of target detection, reduces the amount of calculation, and at the same time expands the ratio of the target license plate to be detected relative to the detection image, so that the accuracy of small target detection such as the license plate becomes higher. This embodiment only detects the license plate in the cut-out vehicle, which greatly reduces the false detection rate of the detected license plate outside the vehicle compared to other methods of detecting the license plate from the entire image.
[0071] The present embodiment fuses the detected license plate position information with the corresponding vehicle position information, constructs a decision tree binary classifier, removes the falsely detected license plate detected in the vehicle detection frame, and further reduces the false detection rate. Combined with the result of vehicle tracking, the effect of license plate tracking is achieved, and it is easy to correspond the same license plate at different times, and the system state corresponding to the same license plate at different times is iteratively updated using Kalman filtering. The detected vehicle position information and license plate position information are stored in correspondence, and it is easy to judge whether a certain vehicle license plate is missed. If missed, the position coordinates of the missed license plate are estimated and saved using Kalman filtering, which reduces the missed detection rate, improves the accuracy of license plate detection, and improves the accuracy of license plate data desensitization, which is of great significance for license plate data desensitization and protection of personal privacy.
[0072] In some embodiments, the step of tracking and detecting vehicles in the video and obtaining vehicle position information includes: detecting vehicles in the video using the general target detection framework YOLOv3; tracking the detected vehicles using the SORT algorithm, and for each vehicle detected in the current frame, combining the position information of the same vehicle in the previous frame and the subsequent frame, taking the average as the vehicle position information of the current frame; smoothing the vehicle position information to eliminate positioning jitter generated during vehicle movement, and saving the vehicle position information to a document, wherein the vehicle position information is saved in a format of [frameid, class, carid, ctlx, ctly, ctrx, ctry, cbrx, cbry, cblx, cbly, cs], which is, in sequence, the frame number of the currently processed image, the detected object category, the vehicle id, the coordinates of the four vertices of the vehicle detection box sorted clockwise from the upper left point, and the confidence of the vehicle detection box.
[0073] In some embodiments, the step of extracting a vehicle image of a corresponding frame from the video according to the vehicle position information and obtaining the license plate position information of the corresponding vehicle includes: extracting a vehicle image of a corresponding frame from the video according to the vehicle position information, and in order to prevent the vehicle from being located in an incomplete manner in the detection frame obtained by vehicle tracking, so that the license plate is outside the vehicle detection frame, and uniformly expanding the vehicle height downward by 10% of the vehicle height when extracting, that is, the height of the captured vehicle image is 110% of the vehicle height in the video; using the distorted plane object detection network in the alpr-unconstrained algorithm to detect the license plate from the extracted vehicle image, and obtaining the license plate position information, wherein the license plate position information is saved in the format of: [ptlx, ptly, ptrx, ptry, pbrx, pbry, pblx, pbly, ps], which are the coordinates of the four vertices of the license plate detection frame sorted clockwise from the upper left point and the confidence of the license plate detection frame.
[0074] In some implementations, based on the vehicle position information and the license plate position information, it is determined whether the four vertices of the license plate detection frame are all within the vehicle detection frame; if at least one of the four vertices of the license plate detection frame is not within the vehicle detection frame, indicating that the license plate is beyond the vehicle area, the license plate position information is removed, and the vehicle corresponding to the license plate is recorded as a license plate missed detection vehicle; if the four vertices of the license plate detection frame are all within the vehicle detection frame, a feature vector [ctlx, ctly, ctrx, ctry, cbrx, cbry, cblx, cbly, cs,ca,ptlx,ptly,ptrx,ptry,pbrx,pbry,pblx,pbly,par,pa,ps], which are the vehicle's location data, vehicle's confidence, vehicle's area, license plate's location data, license plate's aspect ratio, license plate's area, and license plate's confidence, respectively; construct a decision tree binary classifier based on the feature vector, and use the decision tree binary classifier to determine whether the detected license plate is a falsely detected license plate; if so, remove the location information of the falsely detected license plate, and record the vehicle as a license plate missed detection vehicle; if not, merge the vehicle location information and license plate location information and store them accordingly. This embodiment can effectively improve the accuracy of license plate desensitization by training a decision tree binary classifier to remove falsely detected license plates.
[0075] In some implementations, the vehicle position data and license plate position data stored in each frame of the image are traversed to find the vehicle with the license plate missed, that is, the vehicle with only vehicle position information but no corresponding license plate position information; a Kalman filter model is established, and the license plate coordinates of the vehicle with the license plate missed are estimated and saved using Kalman filtering. This embodiment can further improve the accuracy of license plate desensitization by estimating the missed license plate using Kalman filtering.
[0076] In some specific implementations, the step of establishing a Kalman filter model and estimating the license plate coordinates of the vehicle whose license plate is missed by using a Kalman filter includes: setting a threshold value f_max that is traversed in the corresponding stored vehicle position information and license plate position information, and initializing the threshold value; determining that the id of the vehicle whose license plate is missed by is car_id and the frame number of the picture where the vehicle whose license plate is missed by is frame_id; in the corresponding stored vehicle position information and license plate position information, traversing f_max frames from the missed frame frame_id forward, and finding the frame with the id car_id The frame where the vehicle with the license plate is located is stored in the forward frame list pre_frame_list; in the corresponding stored vehicle position information and license plate position information, traverse the f_max frames from the missed frame frame_id backward to find the frame where the vehicle with the id car_id and the license plate is located, and store it in the backward frame list back_frame_list; determine the Kalman filter system state [rptlx, rptly, rpw, rph], where rptlx is the ratio of the distance from the horizontal coordinate of the left vertex of the license plate to the horizontal coordinate of the left vertex of the corresponding vehicle to the width of the vehicle For example, rptly is the ratio of the distance from the ordinate of the left vertex of the license plate to the ordinate of the left vertex of the corresponding vehicle to the height of the vehicle, rpw is the ratio of the width of the license plate to the width of the corresponding vehicle, and rph is the ratio of the height of the license plate to the height of the vehicle. A kalman filter model is established according to the state of the kalman filter system; it is determined whether the forward frame list pre_frame_list and the backward frame list back_frame_list are empty; if the forward frame list pre_frame_list is not empty and the backward frame list back_frame_list is empty, the forward kalman filter is used to estimate the license plate coordinates of the vehicle whose license plate is missed; if the forward frame list pre_frame_list is empty and the backward frame list back_frame_list is not empty, the reverse kalman filter is used to estimate the license plate coordinates of the vehicle whose license plate is missed; if both the forward frame list pre_frame_list and the backward frame list back_frame_list are not empty, the forward frame list and the backward frame list are merged into a complete frame list full_frame_list, and the bidirectional kalman filter is used to estimate the license plate coordinates of the vehicle whose license plate is missed.
[0077] In some specific embodiments, the step of estimating the license plate coordinates of the vehicle with missed license plate using forward Kalman filtering includes: finding a vehicle with id car_id in the first frame frame_first of the forward frame list pre_frame_list, calculating the corresponding Kalman filtering system state using the vehicle position information and the license plate position information of the vehicle, and initializing the Kalman model; predicting the system state of the license plate of the vehicle in the current frame car_id according to the system state of the license plate of the vehicle car_id in the previous frame from the first frame frame_first to the missed detection frame frame_id, and updating the predicted system state with the detection value of the license plate system state of the vehicle car_id in the current frame as the measurement value, as the system state of the license plate of the vehicle car_id in the current frame, if there is no detection value for the missed license plate in the current frame, the predicted value is used as the measurement value; calculating and saving the license plate coordinates of the vehicle with missed license plate according to the updated system state of the missed license plate.
[0078] In some specific implementations, the step of estimating the position of the missed license plate using reverse Kalman filtering includes: finding a vehicle with id car_id in the last frame frame_last of the backward frame list back_frame_list, using the vehicle position data and the license plate position data of the vehicle to calculate the corresponding Kalman filter system state, and initializing the Kalman model; predicting the system state of the license plate of the current frame car_id according to the system state of the license plate of the car_id vehicle in the next frame from the last frame frame_last to the missed frame frame_id, and updating the predicted system state with the detection value of the license plate system state of the car_id vehicle in the current frame as the measurement value, as the system state of the license plate of the car_id vehicle in the current frame, if there is no detection value for the missed license plate in the current frame, the predicted value is used as the measurement value; according to the updated system state of the missed license plate, the license plate coordinates of the missed license plate vehicle are calculated and saved.
[0079] In some specific implementations, the step of estimating the position of the missed license plate using a bidirectional Kalman filter includes: finding a vehicle with an id of car_id from the first frame frame_first of the complete frame list full_frame_list, calculating the corresponding Kalman filter system state using the vehicle position data and the license plate position data of the vehicle, and initializing the Kalman model; predicting the system state of the license plate of the current frame car_id according to the system state of the license plate of the car_id vehicle in the previous frame from the first frame frame_first to the last frame frame_last of the complete frame list, and using the detection value of the system state of the license plate of the car_id vehicle in the current frame as the measurement value to update the predicted system state as the forward system state of the license plate of the car_id vehicle in the current frame, and if there is no detection value for the missed license plate in the current frame, the predicted value is used as the measurement value; Find the vehicle with id car_id in the last frame frame_last of frame_list, use the vehicle position data and license plate position data of the vehicle to calculate the corresponding system state, and initialize the Kalman model; predict the system state of the license plate of the car in the current frame car_id according to the system state of the license plate of the car in the next frame from the last frame frame_last to the first frame frame_first of the complete frame list, and use the detection value of the system state of the license plate of the car in the current frame as the measurement value to update the predicted system state as the reverse system state of the license plate of the car in the current frame car_id. If the license plate of the current frame is missed and there is no detection value, the predicted value is used as the measurement value; calculate the license plate coordinates of the missed license plate vehicle according to the forward system state and reverse system state of the missed license plate frame frame_id, take the average, and save it as the final license plate coordinates of the missed license plate vehicle.
[0080] In some implementations, the final complete license plate position information is obtained based on the stored license plate position information and license plate coordinates, and the license plate of the vehicle in the video is mosaic processed based on the complete license plate position information to achieve license plate data desensitization.
[0081] In some embodiments, a computer-readable storage medium is also provided, wherein the computer-readable 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 in the video-based license plate data desensitization method of the present invention.
[0082] In some embodiments, a video-based license plate data desensitization system is also provided, such as Figure 2As shown, it includes at least one processor (processor) 20; display screen 21; and memory (memory) 22, and may also include a communications interface (Communications Interface) 23 and a bus 24. Among them, the processor 20, the display screen 21, the memory 22 and the communication interface 23 can communicate with each other through the bus 24. The display screen 21 is configured to display a preset user guide interface in the initial setting mode. The communication interface 23 can transmit information. The processor 20 can call the logic instructions in the memory 22 to execute the method in the above embodiment.
[0083] In addition, the logic instructions in the memory 22 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.
[0084] The memory 22 is a computer-readable storage medium that can be configured to store software programs, computer executable programs, such as program instructions or modules corresponding to the methods in the embodiments of the present disclosure. The processor 20 executes functional applications and data processing by running the software programs, instructions or modules stored in the memory 22, that is, implementing the methods in the above embodiments.
[0085] The memory 22 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 22 may include a high-speed random access memory and may also include a non-volatile memory. For example, a variety of media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, may also be a transient storage medium.
[0086] In addition, the specific process of loading and executing the multiple instruction processors in the above-mentioned storage medium and the terminal device has been described in detail in the above-mentioned method, and will not be described one by one here.
[0087] In summary, the video-based license plate data desensitization method provided by the present invention inspects the license plate based on the result of vehicle tracking, indirectly realizes the tracking of the license plate, can greatly reduce the missed detection of license plates, and is convenient for the subsequent supplement of missed license plates based on license plate tracking; according to the result of vehicle tracking, the vehicle picture is cut out to perform license plate detection, which reduces the scope of target detection, reduces the amount of calculation, and at the same time expands the ratio of the target license plate to be detected relative to the detection picture, so that the accuracy of small target detection such as license plate becomes higher; the present invention also removes the misdetected license plate by training the decision tree binary classifier, and uses the Karaman filter to estimate the missed license plate, which can effectively improve the accuracy of license plate desensitization.
[0088] 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 video-based license plate data desensitization method, characterized in that: Includes steps: Track and detect vehicles in the video to obtain vehicle location information; According to the vehicle position information, a vehicle picture of a corresponding frame is intercepted from the video to obtain the license plate position information of the corresponding vehicle; By constructing a decision tree binary classifier, it is determined whether the license plate is a falsely detected license plate. If so, the position information of the falsely detected license plate is removed, and the vehicle is recorded as a license plate missed detection vehicle; if not, the vehicle position information and the license plate position information are merged and stored accordingly; The license plate coordinates of the vehicle whose license plate is missed are estimated by using Kalman filtering and saved; Mosaic processing is performed on the license plate of the vehicle in the video according to the stored license plate position information and license plate coordinates to achieve license plate data desensitization; The vehicle location information includes the number of frames of the currently processed image, the detected object category, the vehicle ID, the coordinates of the four vertices of the vehicle detection frame sorted clockwise from the upper left point, and the confidence of the vehicle detection frame; The license plate position information includes the coordinates of four vertices of the license plate detection frame arranged clockwise from the upper left point and the confidence of the license plate detection frame; The method determines whether the license plate is a falsely detected license plate by constructing a decision tree binary classifier, and if so, removes the position information of the falsely detected license plate and records the vehicle as a falsely detected license plate vehicle; If not, the steps of fusing the vehicle location information and the license plate location information and storing them accordingly include: According to the vehicle position information and the license plate position information, determining whether the four vertices of the license plate detection frame are all within the vehicle detection frame; If at least one of the four vertices of the license plate detection frame is not within the vehicle detection frame, the license plate position information is removed, and the vehicle corresponding to the license plate is recorded as a license plate missed detection vehicle; If the four vertices of the license plate detection frame are all within the vehicle detection frame, a decision tree binary classifier is constructed according to the vehicle position information and the license plate position information, and the decision tree binary classifier is used to determine whether the detected license plate is a falsely detected license plate; If so, the position information of the misdetected license plate is removed, and the vehicle is recorded as a license plate missed detection vehicle; if not, the vehicle position information and the license plate position information are merged and stored accordingly.
2. The video-based license plate data desensitization method according to claim 1 is characterized in that: The step of tracking and detecting the vehicle in the video and obtaining the vehicle position information comprises: Detect vehicles in videos using a general object detection framework; Use the SORT algorithm to track the detected vehicles. For each vehicle detected in the current frame, combine the position information of the same vehicle in the previous frame and the next frame, and take the average as the vehicle position information of the current frame; The vehicle position information is smoothed and saved in a document.
3. The video-based license plate data desensitization method according to claim 2 is characterized in that: The step of intercepting a vehicle picture of a corresponding frame from the video according to the vehicle position information and obtaining the license plate position information of the corresponding vehicle comprises: According to the vehicle position information, a vehicle image of a corresponding frame is intercepted from the video, and the height of the intercepted vehicle image is 110% of the height of the vehicle in the video; The distorted plane object detection network is used to detect the license plate from the captured vehicle image and obtain the license plate location information.
4. The video-based license plate data desensitization method according to claim 1, characterized in that: The step of estimating the license plate coordinates of the vehicle whose license plate is missed by using Kalman filtering and saving the coordinates comprises: Traverse the vehicle position data and license plate position data stored in each frame of the image to find the vehicle whose license plate is missed; A Kalman filter model is established, and the license plate coordinates of the vehicle whose license plate is missed are estimated and saved by using Kalman filter.
5. The video-based license plate data desensitization method according to claim 4 is characterized in that: The step of establishing a Kalman filter model and estimating the license plate coordinates of the vehicle whose license plate is missed by using Kalman filter comprises: Setting a threshold value f_max traversed in the corresponding stored vehicle position information and license plate position information, and initializing the threshold value; Determine the id of the vehicle whose license plate is missed as car_id and the frame number of the picture where the vehicle whose license plate is missed is frame_id; In the corresponding stored vehicle position information and license plate position information, traverse the f_max frames forward from the missed frame frame_id, find the frame where the vehicle with the id car_id and the license plate is located, and store it in the forward frame list pre_frame_list; In the corresponding stored vehicle position information and license plate position information, traverse f_max frames from the missed frame frame_id to find the frame where the vehicle with id car_id and license plate is located, and store it in the backward frame list back_frame_list; Determine the state of the Kalman filter system [rptlx, rptly, rpw, rph], where rptlx is the ratio of the distance from the left vertex of the license plate to the left vertex of the corresponding vehicle to the vehicle width, rptly is the ratio of the distance from the left vertex of the license plate to the left vertex of the corresponding vehicle to the vehicle height, rpw is the ratio of the license plate width to the corresponding vehicle width, and rph is the ratio of the license plate height to the vehicle height. Establish a Kalman filter model based on the state of the Kalman filter system; Determine whether the forward frame list pre_frame_list and the backward frame list back_frame_list are empty; If the forward frame list pre_frame_list is not empty and the backward frame list back_frame_list is empty, the forward Kalman filter is used to estimate the license plate coordinates of the vehicle whose license plate is missed; If the forward frame list pre_frame_list is empty and the backward frame list back_frame_list is not empty, the reverse Kalman filter is used to estimate the license plate coordinates of the vehicle whose license plate is missed; If both the forward frame list pre_frame_list and the backward frame list back_frame_list are not empty, the forward frame list and the backward frame list are merged into a complete frame list full_frame_list, and the license plate coordinates of the vehicle whose license plate is missed are estimated by using bidirectional Kalman filtering.
6. The video-based license plate data desensitization method according to claim 5 is characterized in that: The step of estimating the license plate coordinates of the vehicle whose license plate is missed by using forward Kalman filtering comprises: Find the vehicle with id car_id in the first frame frame_first of the forward frame list pre_frame_list, use the vehicle position information and license plate position information of the vehicle to calculate the corresponding Kalman filter system state, and initialize the Kalman model; From the first frame frame_first to the missed frame frame_id, the system state of the license plate of the current frame car_id is predicted according to the system state of the license plate of the car car_id in the previous frame, and the predicted system state is updated with the detection value of the system state of the license plate of the car car_id in the current frame as the measurement value, and is used as the system state of the license plate of the car car_id in the current frame. If the license plate of the current frame is missed and has no detection value, the predicted value is used as the measurement value; According to the updated system status of the missed license plate, the license plate coordinates of the missed license plate vehicle are calculated and saved.
7. The video-based license plate data desensitization method according to claim 5, characterized in that: The step of estimating the position of the missed license plate by using reverse Kalman filtering comprises: Find the vehicle with id car_id in the last frame frame_last of the backward frame list back_frame_list, use the vehicle position data and license plate position data of the vehicle to calculate the corresponding Kalman filter system state, and initialize the Kalman model; From the last frame frame_last to the missed frame frame_id, the system state of the license plate of the car in the current frame car_id is predicted based on the system state of the license plate of the car in the next frame, and the predicted system state is updated with the detection value of the system state of the license plate of the car in the current frame car_id as the measurement value, and is used as the system state of the license plate of the car in the current frame car_id. If the license plate in the current frame is missed and has no detection value, the predicted value is used as the measurement value; According to the updated system status of the missed license plate, the license plate coordinates of the missed license plate vehicle are calculated and saved.
8. The video-based license plate data desensitization method according to claim 5 is characterized in that: The step of estimating the position of the missed license plate by using a bidirectional Kalman filter comprises: Find the vehicle with id car_id from the first frame frame_first of the full frame list full_frame_list, use the vehicle position data and license plate position data of the vehicle to calculate the corresponding Kalman filter system state, and initialize the Kalman model; From the first frame frame_first to the last frame frame_last in the complete frame list, predict the system state of the license plate of the car_id in the current frame according to the system state of the license plate of the car_id in the previous frame, and use the detection value of the system state of the license plate of the car_id in the current frame as the measurement value to update the predicted system state as the forward system state of the license plate of the car_id in the current frame. If the license plate in the current frame is missed and has no detection value, the predicted value is used as the measurement value; Find the vehicle with id car_id from the last frame frame_last in the full frame list full_frame_list, use the vehicle position data and license plate position data of the vehicle to calculate the corresponding system state, and initialize the Kalman model; From the last frame frame_last to the first frame frame_first in the complete frame list, predict the system state of the license plate of the car_id in the current frame according to the system state of the license plate of the car_id in the next frame, and use the detection value of the system state of the license plate of the car_id in the current frame as the measurement value to update the predicted system state as the reverse system state of the license plate of the car_id in the current frame. If the license plate in the current frame is missed and has no detection value, the predicted value is used as the measurement value; The license plate coordinates of the missed-detection vehicle are calculated according to the forward system state and the reverse system state of the missed-detection frame frame_id, and the average is taken as the final license plate coordinates of the missed-detection vehicle and saved.
9. A video-based license plate data desensitization system, characterized in that: include: A processor, a memory and a communication bus; the memory stores a computer-readable program that can be executed by the processor; The communication bus realizes the connection and communication between the processor and the memory; When the processor executes the computer-readable program, the steps in the video-based license plate data desensitization method as described in any one of claims 1-8 are implemented.
