Vehicle identification method and device and storage medium
By collecting video data in vehicle recognition devices to detect vehicle detection frames and filter abandoned vehicles, the problem of multiple vehicle recognition devices in complex environments is solved, enabling rapid deployment and high adaptability, and improving the reliability and accuracy of vehicle recognition.
Patent Information
- Application Number
- CN202411049446.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-11-15
AI Technical Summary
Existing vehicle recognition devices tend to identify multiple vehicles in complex environments, leading to a waste of computing resources. Furthermore, they are poorly debugged, have poor adaptability, and are difficult to deploy quickly.
By collecting video data, detecting vehicle detection frames, filtering abandoned vehicles according to preset filtering rules, identifying target vehicle information, determining whether they meet the conditions for adding abandoned vehicles, and adding eligible vehicle information to the abandoned vehicle queue to avoid duplicate identification and tracking.
It effectively filters abandoned vehicles, reduces the waste of computing resources, enables rapid deployment and high adaptability, and improves the reliability and accuracy of vehicle identification.
Smart Images

Figure CN118968467A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent video surveillance technology, and in particular to a vehicle identification method, device and storage medium. Background Art
[0002] With the continuous development of science and technology, vehicle identification equipment has been widely used in parking lot entrances and exits, shopping mall entrances and exits, toll station entrances and exits, lane parking space monitoring and other places.
[0003] Due to the complex application environment of vehicle identification equipment, current vehicle identification equipment often identifies multiple vehicles, such as zombie vehicles, which increases computing resources and easily affects the judgment of subsequent vehicle matching and tracking events. Therefore, how to realize the intelligence of vehicle identification equipment has increasingly higher requirements for preventing multiple vehicle identification.
[0004] At present, although the installation of vehicle recognition equipment can be adjusted, such as drawing shielding areas, recognition areas and adjusting camera angles to prevent multiple vehicles from being recognized, on the one hand, it requires a lot of labor costs for debugging, and on the other hand, the effect after debugging may not be achieved, and it has poor resistance to various external unexpected situations, such as the equipment being knocked off course by external factors, and cannot be deployed quickly, and has poor adaptability. Summary of the invention
[0005] Based on this, it is necessary to provide a vehicle identification method, device and storage medium to address the above technical issues, so as to solve at least one problem existing in the above-mentioned prior art.
[0006] In a first aspect, the embodiment of the present application is implemented as follows: a vehicle identification method is provided, comprising:
[0007] Collecting video data to be detected, and detecting a vehicle detection frame of each vehicle in each frame image of the video data to be detected;
[0008] Filter the vehicle detection frame according to a preset filtering rule to obtain a target vehicle detection frame;
[0009] Identify the target vehicle detection frame to obtain target vehicle information;
[0010] When the target vehicle information matches the cached vehicle information in the cached vehicle queue, determining whether the target vehicle information meets the preset zombie vehicle adding condition;
[0011] If so, the target vehicle information is used as new zombie car information and added to the zombie car queue.
[0012] In one embodiment, filtering the vehicle detection frame according to a preset filtering rule includes:
[0013] Determine whether a matching result between the vehicle detection frame and a zombie car detection frame in the zombie car queue meets a first preset matching condition;
[0014] If so, determining whether a ratio of matching results between the vehicle detection frame and the zombie car detection frames in the zombie car queue that meet the first preset matching condition is greater than a first preset ratio threshold;
[0015] If so, the vehicle detection frame is filtered.
[0016] In one embodiment, determining whether a matching result between the vehicle detection frame and a zombie car detection frame in the zombie car queue meets a first preset matching condition includes:
[0017] Calculating a first intersection-over-union ratio between the vehicle detection frame and the zombie car detection frames in the zombie car queue;
[0018] Determine whether the first intersection-over-intersection ratio is greater than a first preset intersection-over-intersection ratio threshold:
[0019] If so, the first preset matching condition is met.
[0020] In one embodiment, determining whether the target vehicle information meets a preset new zombie vehicle condition includes:
[0021] Determine whether the target vehicle information meets the first newly added zombie vehicle rule;
[0022] If not, determining whether a matching result between the vehicle regression frame corresponding to the target vehicle information and each vehicle regression frame in the cached vehicle queue meets a second preset matching condition;
[0023] If yes, then the cached vehicle queue is updated;
[0024] Based on the update result, determine whether the target vehicle information complies with the second newly added zombie car rule.
[0025] In one embodiment, determining whether the target vehicle information meets the first newly added zombie vehicle rule includes:
[0026] When the cache count of the target vehicle information is greater than a first preset count threshold; and
[0027] The difference between the current time and the first cache time of the target vehicle information is greater than a first preset time threshold; and
[0028] The ratio of the target vehicle information to the cached vehicle information in the cached vehicle queue is greater than a second preset ratio threshold; and
[0029] A preset amount of target vehicle information is cached;
[0030] It is determined that the target vehicle information meets the first newly added zombie car rule.
[0031] In one embodiment, determining whether the target vehicle information complies with the second newly added zombie vehicle rule based on the update result includes:
[0032] Based on the update result, determining the number of cache times of the target vehicle information within a first preset time range;
[0033] Determine whether the cache count of the target vehicle information is less than a second preset count threshold;
[0034] If not, determine whether the target vehicle information is converted into zombie vehicle information within a second preset time range:
[0035] If not, the historical cache information of the target vehicle information in the cache vehicle queue is deleted.
[0036] In one embodiment, after determining whether the matching result between the vehicle regression frame corresponding to the target vehicle information and each vehicle regression frame in the cached vehicle queue meets the second preset matching condition, the method includes:
[0037] If not, deleting the historical cache information of the target vehicle information in the cache vehicle queue;
[0038] The target vehicle information is used as new cached vehicle information and added to the cached vehicle queue for re-caching.
[0039] In one embodiment, after detecting the vehicle detection frame of each vehicle in each frame of the video data to be detected, the method further comprises:
[0040] When a matching result between the vehicle detection frame and a cached vehicle detection frame in the cached vehicle queue meets a third preset matching condition, updating the cached vehicle queue;
[0041] When the matching result between the vehicle detection frame and the zombie car detection frame in the zombie car queue meets the fourth preset matching condition, the zombie car queue is updated.
[0042] In one embodiment, when the matching result between the vehicle detection frame and the cached vehicle detection frame in the cached vehicle queue meets the third preset matching condition, updating the cached vehicle queue includes:
[0043] Calculating a second intersection-and-union ratio between the vehicle detection frame and the vehicle detection frames of the cached vehicles in the cached vehicle queue;
[0044] When the second intersection-and-joint ratio is greater than a second preset intersection-and-joint ratio threshold, determining whether a difference between the current time and the most recent update time is greater than a second preset time threshold;
[0045] If so, the cached vehicle queue is updated.
[0046] In a second aspect, a vehicle identification device is provided, comprising:
[0047] A vehicle detection frame acquisition unit is used to collect the video data to be detected and detect the vehicle detection frame of each vehicle in each frame image of the video data to be detected;
[0048] A target vehicle detection frame acquisition unit, used to filter the vehicle detection frame according to a preset filtering rule to obtain a target vehicle detection frame;
[0049] A target vehicle information recognition unit, used to recognize the target vehicle detection frame and obtain target vehicle information;
[0050] A newly added zombie vehicle determining unit is used to determine whether the target vehicle information meets a preset newly added zombie vehicle condition when the target vehicle information matches the cached vehicle information in the cached vehicle queue;
[0051] The vehicle identification unit is used to take the target vehicle information as the newly added zombie car information and add it to the zombie car queue when the target vehicle information meets the preset newly added zombie car condition.
[0052] In a third aspect, a computer device is provided, comprising a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, wherein the processor implements the steps of the vehicle identification method as described above when executing the computer-readable instructions.
[0053] In a fourth aspect, a readable storage medium is provided, wherein the readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the vehicle identification method as described above are implemented.
[0054] The above-mentioned vehicle identification method, device, computer equipment and storage medium, the method implementation includes: collecting video data to be detected, detecting the vehicle detection frame of each vehicle in each frame image of the video data to be detected; filtering the vehicle detection frame according to the preset filtering rules to obtain the target vehicle detection frame; identifying the target vehicle detection frame to obtain the target vehicle information; when the target vehicle information matches the cached vehicle information in the cached vehicle queue, determining whether the target vehicle information meets the preset new zombie car conditions; when the target vehicle information meets the preset new zombie car conditions, the target vehicle information is used as the new zombie car information and added to the zombie car queue. In the embodiment of the present application, by caching the historical vehicle identification results and vehicle detection frame information, matching with the currently acquired vehicle detection frame and vehicle identification results, to filter out zombie cars that do not need to be identified, prevent subsequent matching and tracking of zombie cars, avoid the problem of repeated identification, reduce the waste of computing resources, and can realize debugging-free installation in a variable environment, with the characteristics of rapid deployment and high adaptability, so as to achieve more reliable, fast and accurate vehicle identification. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0056] Figure 1 A schematic diagram of a vehicle identification method according to an embodiment of the present invention is shown in FIG. Figure 1 ;
[0057] Figure 2 A schematic diagram of a vehicle identification method according to an embodiment of the present invention is shown in FIG. Figure 2 ;
[0058] Figure 3 It is a flow chart of a method for determining whether target vehicle information meets preset conditions for adding a zombie vehicle in one embodiment of the present invention;
[0059] Figure 4 is a structural schematic diagram of a vehicle identification device in one embodiment of the present invention;
[0060] Figure 5 is a schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION
[0061] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0062] In the present application, the identification and differentiation of different vehicles is achieved by obtaining the vehicle information corresponding to each vehicle. It can be understood that the vehicle information referred to in the present application includes but is not limited to license plate information, vehicle color information, vehicle logo information, and vehicle model information. Since license plates are currently the most common way to identify and differentiate different vehicles, the license plates or license plate information mentioned in this embodiment actually refer to vehicle information. In the opinion of those skilled in the art, replacing license plates or license plate information with one or more other types of information in vehicle information can still implement the solution of the present application and all belong to the protection scope of the present application.
[0063] In one embodiment, if Figure 1 As shown, a vehicle identification method is provided, comprising the following steps:
[0064] In step S110, the video data to be detected is collected, and the vehicle detection frame of each vehicle in each frame image of the video data to be detected is detected;
[0065] In an embodiment of the present application, the video data to be detected can be collected by a vehicle identification device, which may include a camera device for real-time video data collection of the area to be detected, and target detection of the vehicle collected in the video data is performed by a target detection algorithm, such as using the Yolo algorithm, the R-CNN algorithm, etc., and then the vehicle area is selected based on the detected vehicle to obtain a vehicle detection frame. It should be noted that the vehicle detection frame may include a license plate detection frame, a vehicle head detection frame, a vehicle top detection frame, a vehicle tail detection frame, etc., wherein, taking the license plate detection frame as an example, the license plate area can be determined, and the license plate area can be selected by the license plate detection frame to obtain a license plate detection frame.
[0066] The vehicle detection frame is used to select the area where the vehicle is located, and may specifically include a variety of shapes, such as a rectangular frame, a square frame, etc.
[0067] It can be understood that the video data to be detected may include multiple vehicles, so the video data can be divided into multiple continuous image frames, target detection is performed on the vehicle in each image frame, and a vehicle detection frame of each vehicle is obtained.
[0068] In step S120, the vehicle detection frame is filtered according to a preset filtering rule to obtain a target vehicle detection frame;
[0069] In an embodiment of the present application, after obtaining the vehicle detection frame, the vehicle detection frame can be matched with the zombie car detection frame in the pre-generated zombie car queue. If it meets the preset filtering rules, the vehicle detection frame detected this time can be considered to be a zombie car detection frame, and the vehicle detection frame can be directly deleted without the need for subsequent tracking, identification and other event processing, thereby saving computing processes and improving vehicle identification efficiency.
[0070] Among them, the preset filtering rules may specifically include that the matching degree between the vehicle detection frame and the zombie car detection frame is greater than a preset threshold, for example, greater than 0.5, and the proportion greater than the preset threshold is higher than a preset proportion, for example, higher than 0.3, then the vehicle detection frame can be considered as a zombie car detection frame and directly deleted.
[0071] In step S130, the target vehicle detection frame is identified to obtain target vehicle information;
[0072] In an embodiment of the present application, the target vehicle information may specifically include information such as license plate number, license plate type, and license plate color.
[0073] In the embodiment of the present application, taking the license plate number as an example, the target license plate detection frame image can be captured and input into a pre-trained image recognition model for recognition to obtain the license plate number. Alternatively, the target license plate detection frame image can be segmented to obtain each character image, and then each character image can be extracted and compared with pre-stored character samples to determine the numbers, letters or symbols corresponding to each character, and arrange them in order to obtain the license plate number.
[0074] In step S140, when the target vehicle information matches the cached vehicle information in the cached vehicle queue, it is determined whether the target vehicle information meets the preset new zombie vehicle condition;
[0075] In an embodiment of the present application, a cached vehicle queue is used to temporarily cache the identified vehicle information when it is uncertain whether the vehicle information is the vehicle information of a zombie vehicle. The vehicle information can be arranged in the order of cache time to form the cached vehicle queue.
[0076] Among them, the cached vehicle queue may specifically include information such as the license plate number and vehicle detection frame of the cached vehicle. If a cached vehicle in the cached vehicle queue is determined to be a zombie car, it will be moved to the zombie vehicle queue and filtered without subsequent processing. If it is not identified as a zombie car within a preset time, it can be removed from the cached vehicle queue for subsequent tracking and identification to perform corresponding event judgment and processing, such as vehicle passage.
[0077] In an embodiment of the present application, target vehicle information is obtained, and the target vehicle information may include a target license plate number. At this time, the target license plate number can be compared with the license plate numbers of cached vehicles in the cached vehicle queue. If the comparison is consistent, it is determined whether the target vehicle information meets the preset conditions for adding a zombie car. Otherwise, the target vehicle information is added to the cache identification queue as newly added cached vehicle information.
[0078] In an embodiment of the present application, the preset conditions for adding zombie cars may specifically include but are not limited to whether the number of times the target vehicle information is cached is greater than a preset number; whether the difference between the current time and the first cache time of the target vehicle information is greater than a preset time; whether the ratio of the matching results between the target vehicle detection frame and the cached multi-frame vehicle detection frame that meets the preset ratio threshold is greater than a preset ratio; whether one or any combination of the preset target vehicle detection frames is cached.
[0079] In step S150, if yes, the target vehicle information is used as new zombie car information and added to the zombie car queue.
[0080] In the embodiment of the present application, when the target vehicle information meets the preset new zombie vehicle condition, the target vehicle information is taken as the new zombie vehicle information and added to the zombie vehicle queue, and the target vehicle information is deleted, that is, no subsequent event judgment processing is performed. At the same time, the target vehicle corresponding to the target vehicle information can be considered as a zombie vehicle, and no identification and application are required, and it can be directly filtered. Subsequently, only the unfiltered vehicles are subjected to target tracking, identification and other processing, and corresponding event judgments are performed, such as vehicle passage event judgment, which can effectively save computing time.
[0081] The zombie car queue is used to cache vehicle information that has been determined to be zombie cars, and the vehicles can be arranged in the order of cache time to form a zombie car queue.
[0082] In an embodiment of the present application, a vehicle identification method is provided, including: collecting video data to be detected, detecting a vehicle detection frame of each vehicle in each frame of the video data to be detected; filtering the vehicle detection frame according to a preset filtering rule to obtain a target vehicle detection frame; identifying the target vehicle detection frame to obtain target vehicle information; when the target vehicle information matches the cached vehicle information in the cached vehicle queue, determining whether the target vehicle information meets the preset new zombie vehicle condition; when the target vehicle information meets the preset new zombie vehicle condition, the target vehicle information is used as the new zombie vehicle information and added to the zombie vehicle queue. In an embodiment of the present application, by caching historical vehicle identification results and vehicle detection frame information, matching with the currently acquired vehicle detection frame and vehicle identification results, to filter zombie vehicles that do not need to be identified and applied, to prevent subsequent matching and tracking of zombie vehicles, to avoid multiple identification problems, and to achieve debugging-free installation in complex environments, with the characteristics of rapid deployment and high adaptability, while avoiding subsequent vehicle identification, tracking, and event judgment, reducing computing resources, and achieving more reliable, faster, and more accurate vehicle identification.
[0083] In an embodiment of the present application, filtering the vehicle detection frame according to a preset filtering rule includes:
[0084] Determine whether a matching result between the vehicle detection frame and the zombie car detection frame in the zombie car queue meets a first preset matching condition;
[0085] If so, determining whether a ratio of matching results between the vehicle detection frame and the zombie car detection frames in the zombie car queue that meet a first preset matching condition is greater than a first preset ratio threshold;
[0086] If so, filter the vehicle detection frame.
[0087] It can be understood that the zombie car queue is used to cache the vehicle information that has been determined to be zombie cars, which can be arranged in the order of cache time to form a zombie car queue.
[0088] Optionally, after obtaining the vehicle detection frame, the vehicle detection frame can be matched with each zombie car detection frame in the zombie car queue in turn. When the matching degree reaches a preset threshold, the match can be considered successful, that is, it meets the first preset matching condition. At this time, the total number of successful matches can be obtained, and the matching ratio can be determined. If the ratio is greater than the first preset ratio threshold, for example, greater than 0.3, the vehicle detection frame can be considered to be a zombie car queue, that is, it is filtered without subsequent processing, so that all detected vehicle detection frames are filtered once.
[0089] In an embodiment of the present application, determining whether a matching result between a vehicle detection frame and a zombie car detection frame in a zombie car queue meets a first preset matching condition includes:
[0090] Calculate the first intersection-over-union ratio between the vehicle detection frame and the zombie car detection frames in the zombie car queue;
[0091] Determine whether the first intersection-over-union ratio is greater than a first preset intersection-over-union ratio threshold;
[0092] If so, the first preset matching condition is met.
[0093] It should be noted that the vehicle detection frame may include a license plate detection frame, a vehicle head detection frame, a vehicle tail detection frame, etc. Taking the license plate detection frame as an example, the license plate detection frame can be drawn according to the actual area of the license plate, and a coordinate system can be established to obtain the coordinates of key points of the license plate detection frame, such as the coordinates of each vertex. Then, the first intersection over union (IOU) can be calculated by the preset intersection over union function, which can be calculated by the following formula:
[0094]
[0095] For example, the coordinates of the upper left vertex of the license plate detection frame are (x a1 ,y a1 ), the coordinates of the lower right vertex are (x a2 ,y a2 ), the coordinate of the upper left vertex of the zombie car’s license plate detection frame is (x b1 ,y b1 ), the coordinates of the lower right vertex are (x b2 ,y b2 ) Then, the set A of license plate detection frames can be expressed as:
[0096] A={(x,y)▏x a1 ≤x≤x a2 ,y a1 ≤y≤y a2 , x, y∈R}
[0097] The set B of the zombie car's license plate detection frame can be expressed as:
[0098] B={(x,y)▏x b1 ≤x≤x b2 ,y b1 ≤y≤y b2 , x, y∈R}
[0099] Then the intersection A∪B between the license plate detection frame and the zombie car's license plate detection frame can be expressed as:
[0100] A∪B={(x,y)▏max{x a1 , x b1}≤x≤min{x a2 ,xb2},max{y a1 ,y b1}≤y≤min{y a2 ,y b2}}
[0101] S A∪B =(min{x a2 ,x b2}-max{x a1 ,x b1})ⅹ(min{y a2 ,y b2}-max{y a1 ,y b1})
[0102] The union A∩B between the license plate detection frame and the zombie car's license plate detection frame can be expressed as:
[0103] A∩B=A+BA∪B
[0104] but,
[0105] S A∩B =(x a2 -x a1 )(y a2 -y a1 )+(x b2 -x b1 )(y b2 -y b1 )-(min{x a2 ,x b2}-max{xa1,xb1}ⅹmin{ya2,yb2}-max{ya1,yb1}
[0106]
[0107] If the IOU is greater than a first preset intersection-over-union ratio threshold, such as 0.5, it can be considered that it meets the first preset matching condition.
[0108] It can be understood that if the zombie car information in the zombie car queue is not updated within a preset time, such as 120 seconds, such as the zombie license plate, it can be removed from the zombie car queue. The zombie car removed from the zombie car queue is no longer a zombie car and can be used for subsequent event judgment and other processing.
[0109] See also Figure 2 In one embodiment of the present application, after detecting the vehicle detection frame of each vehicle in each frame of the video data to be detected, the method includes:
[0110] In step S210, when the matching result between the vehicle detection frame and the cached vehicle detection frame in the cached vehicle queue meets the third preset matching condition, the cached vehicle queue is updated;
[0111] In step S220, when the matching result between the vehicle detection frame and the zombie car detection frame in the zombie car queue meets the fourth preset matching condition, the zombie car queue is updated.
[0112] Optionally, after obtaining the vehicle detection frame, the vehicle detection frame can be matched with the cached vehicle detection frame and the zombie vehicle detection frame of the cached vehicle, and based on the matching results, it is determined whether the cached vehicle queue and the zombie vehicle queue need to be updated, and whether the vehicle detection frame needs to be filtered. For example, when the matching result meets the third preset matching condition, the cached vehicle queue is updated, and if the matching result meets the fourth preset matching condition, the cached vehicle queue is updated.
[0113] The third preset matching condition and the fourth preset matching condition may be the same, that is, when the matching degree reaches a preset matching threshold, it is considered that the matching is successful.
[0114] It is understandable that step 210 and step 220 can be performed before step 120, and can be used to maintain the cached vehicle information in the cached vehicle queue and the zombie vehicle information in the zombie vehicle queue. And the order of step 210 and step 220 is not specific, that is, step 210 can be performed first and then step 220, or step 220 can be performed first and then step 210, or both can be performed in parallel, that is, simultaneously.
[0115] In an embodiment of the present application, when a matching result between a vehicle detection frame and a cached vehicle detection frame in a cached vehicle queue meets a third preset matching condition, updating the cached vehicle queue includes:
[0116] Calculating a second intersection-and-union ratio between the vehicle detection frame and the vehicle detection frames of the cached vehicles in the cached vehicle queue;
[0117] When the second intersection-over-intersection ratio is greater than a second preset intersection-over-intersection ratio threshold, determining whether a difference between the current time and the most recent update time is greater than a second preset time threshold;
[0118] If so, the cached vehicle queue is updated.
[0119] Optionally, the license plate detection frame may include a license plate detection frame, a vehicle head detection frame, a vehicle tail detection frame, etc. The second intersection over union (IOU) is calculated by a preset intersection over union function, which can be specifically calculated by the following formula:
[0120]
[0121] The specific calculation process can refer to the calculation process of the first intersection-over-union (IOU) mentioned above, which will not be described in detail in this application.
[0122] When the second intersection-and-annealing ratio is greater than the second preset intersection-and-annealing ratio threshold, for example greater than 0.5, it can be further determined whether the difference between the current time and the last update time recorded for the vehicle detection frame in the cached vehicle queue is greater than the second preset time threshold, for example greater than 5 seconds, then the vehicle detection frame in the cached vehicle queue can be updated and the current time can be used as the update time.
[0123] It can be understood that if the image frame where the vehicle detection frame is in a stationary state is +1, that is, the vehicle detection frame in the image frame where the current vehicle detection frame is located is in a stationary state, the cache time is not updated.
[0124] See also Figure 3 In one embodiment of the present application, determining whether the target vehicle information meets the preset new zombie vehicle conditions includes:
[0125] In step S141, it is determined whether the target vehicle information meets the first newly added zombie vehicle rule;
[0126] If not in step S142, determining whether the matching result between the vehicle regression frame corresponding to the target vehicle information and each cached vehicle regression frame in the cached vehicle queue meets the second preset matching condition;
[0127] In step S143, if yes, the cached vehicle queue is updated;
[0128] In step S144, based on the update result, it is determined whether the target vehicle information complies with the second newly added zombie car rule.
[0129] Optionally, the vehicle detection frame may include a license plate detection frame. Taking the license plate detection frame as an example, when the target vehicle information meets the first newly added zombie car rule, the image of the license plate detection frame may be input into the pre-trained license plate regression model to obtain the license plate regression frame. The license plate regression frame may include four corner point coordinates, which are closer to the four real corner points of the license plate. Similarly, the license plate detection frame of the cached vehicle may also obtain its corresponding license plate regression frame in the above manner. Then, the matching result between the two license plate regression frames is calculated, for example, the intersection and union ratio between the two license plate regression frames is calculated. If the intersection and union ratio is greater than a preset threshold, such as 0.5, it is considered that it meets the second preset matching condition. At this time, the cached vehicle queue can be updated, the number of caches of the license plate detection frame is +1, and the update results within the preset time period, such as the number of updates, are counted to determine whether it meets the second newly added zombie car rule. If so, the target vehicle information is converted into zombie car information.
[0130] If the target vehicle information meets the first rule for adding a zombie car, step S145 is executed to add the target vehicle information to the zombie car queue and remove it from the cache identification queue.
[0131] For further information, see Figure 3 After determining whether the matching result between the vehicle regression frame corresponding to the target vehicle information and each cached regression frame in the cached vehicle queue meets the second preset matching condition, it includes:
[0132] In step S146, if not, the historical cache information of the target vehicle information in the cached vehicle queue is deleted;
[0133] In step S147, the target vehicle information is taken as new cached vehicle information and added to the cached vehicle queue for re-caching.
[0134] Optionally, if the matching result between the vehicle regression box corresponding to the target vehicle information and each cached vehicle regression box in the cache vehicle queue does not meet the second preset matching condition, the historical cache records related to the target vehicle information can be cleared in the cache queue, and caching can be restarted with the newly identified vehicle information.
[0135] In one embodiment of the present application, determining whether the target vehicle information meets the first newly added zombie vehicle rule in step S141 includes:
[0136] When the target vehicle information is cached for a number of times greater than a first preset number threshold; and
[0137] The difference between the current time and the first cache time of the target vehicle information is greater than the first preset time threshold; and
[0138] The ratio of the target vehicle information to the cached vehicle information in the cached vehicle queue is greater than a second preset ratio threshold; and
[0139] A preset number of target vehicle information is cached;
[0140] It is determined that the target vehicle information meets the first newly added zombie car rule.
[0141] Optionally, when the number of times the target vehicle information is cached is greater than a first preset number threshold, for example, greater than 60 times; and the difference between the current time and the first cache time of the target vehicle information is greater than the first preset time threshold, for example, greater than 60 seconds; and the proportion of the target vehicle information matching the cached vehicle information in the cached vehicle queue is greater than a second preset proportion threshold, for example, the intersection and union ratio of the license plate detection frame of the target license plate and the license plate detection frame of the cached vehicle in the cached vehicle queue is greater than 0.5, and the proportion greater than 0.5 is greater than 0.8; and a preset number of target vehicle information is cached in the zombie car queue, for example, at least 3 target vehicle information are cached; when all are met, the target vehicle information is considered to meet the first new zombie car rule.
[0142] In an embodiment of the present application, in step S144, based on the update result, determining whether the target vehicle information meets the second newly added zombie vehicle rule includes:
[0143] Based on the update result, determining the number of cache times of the target vehicle information within a first preset time range;
[0144] Determine whether the number of cache times of the target vehicle information is less than a second preset number threshold;
[0145] If not, determining whether the target vehicle information is converted into zombie vehicle information within a second preset time range;
[0146] If not, the historical cache information of the target vehicle information in the cache vehicle queue is deleted.
[0147] Optionally, based on the update result, the cumulative number of cache times within a first preset time range, such as 60 seconds, can be counted. If the cache number is greater than or equal to a preset number threshold, such as 60 times, it can be directly removed from the cache identification queue. If the cache number is less than 60 times, it can be further determined whether the target vehicle information is converted into zombie car information within a second preset time range, such as whether it is converted into a zombie brand within 120 seconds. If so, it is added to the zombie car queue to achieve filtering. Otherwise, the historical cache information of the target vehicle information in the cache vehicle queue can be deleted.
[0148] In an embodiment of the present application, historical vehicle identification results and vehicle detection frame information are cached and matched with the currently acquired vehicle detection frame and vehicle identification results to filter out zombie vehicles that do not need to be identified and applied, prevent subsequent matching and tracking of zombie vehicles, avoid repeated identification problems, reduce waste of computing resources, and achieve debugging-free installation in changing environments. It has the characteristics of rapid deployment and high adaptability, and can achieve more reliable, faster, and more accurate vehicle identification.
[0149] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0150] In one embodiment, a vehicle identification device is provided, which corresponds one-to-one with the vehicle identification method in the above embodiment. Figure 4 As shown, the vehicle identification device includes a vehicle detection frame acquisition unit 10, a target vehicle detection frame acquisition unit 20, a target vehicle information identification unit 30, a newly added zombie vehicle determination unit 40 and a vehicle identification unit 50. The functional modules are described in detail as follows:
[0151] The vehicle detection frame acquisition unit 10 is used to collect the video data to be detected and detect the vehicle detection frame of each vehicle in each frame image of the video data to be detected;
[0152] A target vehicle detection frame acquisition unit 20 is used to filter the vehicle detection frame according to a preset filtering rule to obtain a target vehicle detection frame;
[0153] The target vehicle information recognition unit 30 is used to recognize the target vehicle detection frame and obtain the target vehicle information;
[0154] A newly added zombie vehicle determining unit 40 is used to determine whether the target vehicle information meets a preset newly added zombie vehicle condition when the target vehicle information matches the cached vehicle information in the cached vehicle queue;
[0155] The vehicle identification unit 50 is used to take the target vehicle information as the newly added zombie vehicle information and add it to the zombie vehicle queue when the target vehicle information meets the preset newly added zombie vehicle condition.
[0156] In one embodiment of the present application, the target vehicle detection frame acquisition unit 20 is further used to:
[0157] Determine whether a matching result between the vehicle detection frame and the zombie car detection frame in the zombie car queue meets a first preset matching condition;
[0158] If so, determining whether a ratio of matching results between the vehicle detection frame and the zombie car detection frames in the zombie car queue that meet a first preset matching condition is greater than a first preset ratio threshold;
[0159] If so, filter the vehicle detection frame.
[0160] In one embodiment of the present application, the target vehicle detection frame acquisition unit 20 is further used to:
[0161] Calculate the first intersection-over-union ratio between the vehicle detection frame and the zombie car detection frames in the zombie car queue;
[0162] Determine whether the first intersection-over-union ratio is greater than a first preset intersection-over-union ratio threshold;
[0163] If so, the first preset matching condition is met.
[0164] In one embodiment of the present application, a zombie car determining unit 40 is added, which is also used to:
[0165] Determine whether the target vehicle information meets the first newly added zombie vehicle rule;
[0166] If not, determining whether a matching result between the vehicle regression frame corresponding to the target vehicle information and each cached vehicle regression frame in the cached vehicle queue meets a second preset matching condition;
[0167] If yes, the cached vehicle queue is updated;
[0168] Based on the update result, determine whether the target vehicle information meets the second newly added zombie car rule.
[0169] In one embodiment of the present application, a zombie car determining unit 40 is added, which is also used to:
[0170] Based on the update result, determining the number of cache times of the target vehicle information within a first preset time range;
[0171] Determine whether the number of cache times of the target vehicle information is less than a second preset number threshold;
[0172] If not, determining whether the target vehicle information is converted into zombie vehicle information within a second preset time range;
[0173] If not, the historical cache information of the target vehicle information in the cache vehicle queue is deleted.
[0174] In one embodiment of the present application, a zombie car determining unit 40 is added, which is also used to:
[0175] When the target vehicle information is cached for a number of times greater than a first preset number threshold; and
[0176] The difference between the current time and the first cache time of the target vehicle information is greater than the first preset time threshold; and
[0177] The ratio of the target vehicle information to the cached vehicle information in the cached vehicle queue is greater than a second preset ratio threshold; and
[0178] A preset number of target vehicle information is cached;
[0179] It is determined that the target vehicle information meets the first newly added zombie car rule.
[0180] In one embodiment of the present application, a zombie car determining unit 40 is added, which is also used to:
[0181] If not, the historical cache information of the target vehicle information in the cached vehicle queue is deleted;
[0182] The target vehicle information is used as new cached vehicle information and added to the cached vehicle queue for re-caching.
[0183] In one embodiment of the present application, the device further includes a queue updating unit, which is used to:
[0184] When a matching result between the vehicle detection frame and the cached vehicle detection frame in the cached vehicle queue meets a third preset matching condition, updating the cached vehicle queue;
[0185] When the matching result between the vehicle detection frame and the zombie car detection frame in the zombie car queue meets the fourth preset matching condition, the zombie car queue is updated.
[0186] In one embodiment of the present application, the queue updating unit is further used to:
[0187] Calculating a second intersection-and-union ratio between the vehicle detection frame and the vehicle detection frames of the cached vehicles in the cached vehicle queue;
[0188] When the second intersection-over-intersection ratio is greater than a second preset intersection-over-intersection ratio threshold, determining whether a difference between the current time and the most recent update time is greater than a second preset time threshold;
[0189] If so, the cached vehicle queue is updated.
[0190] In an embodiment of the present application, historical vehicle identification results and vehicle detection frame information are cached and matched with the currently acquired vehicle detection frame and vehicle identification results to filter out zombie vehicles that do not need to be identified and applied, prevent subsequent matching and tracking of zombie vehicles, avoid repeated identification problems, reduce waste of computing resources, and achieve debugging-free installation in changing environments. It has the characteristics of rapid deployment and high adaptability, and can achieve more reliable, faster, and more accurate vehicle identification.
[0191] For the specific definition of the vehicle identification device, please refer to the definition of the vehicle identification method above, which will not be repeated here. Each module in the above-mentioned vehicle identification device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0192] In one embodiment, a computer device is provided. The computer device may be a terminal device, and its internal structure diagram may be as follows: Figure 5As shown. The computer device includes a processor, a memory, and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a readable storage medium. The readable storage medium stores computer-readable instructions. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer-readable instructions are executed by the processor, a vehicle identification method is implemented. The readable storage medium provided in this embodiment includes a non-volatile readable storage medium and a volatile readable storage medium.
[0193] In an embodiment of the present application, a computer device is provided, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor. When the processor executes the computer-readable instructions, the steps of the vehicle identification method described above are implemented.
[0194] In an embodiment of the application, a readable storage medium is provided, which stores computer-readable instructions. When the computer-readable instructions are executed by a processor, the steps of the vehicle identification method as described above are implemented.
[0195] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through computer-readable instructions, and the computer-readable instructions can be stored in a non-volatile readable storage medium or a volatile readable storage medium. When the computer-readable instructions are executed, they may 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 in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of 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), etc.
[0196] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0197] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such 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, and should be included in the protection scope of the present invention.
Claims
1. A vehicle identification method, characterized in that: The method comprises: Collecting video data to be detected, and detecting a vehicle detection frame of each vehicle in each frame image of the video data to be detected; Filter the vehicle detection frame according to a preset filtering rule to obtain a target vehicle detection frame; Identify the target vehicle detection frame to obtain target vehicle information; When the target vehicle information matches the cached vehicle information in the cache queue, determining whether the target vehicle information meets the preset zombie vehicle adding condition; If so, the target vehicle information is used as new zombie car information and added to the zombie car queue.
2. The vehicle identification method according to claim 1, characterized in that: The filtering the vehicle detection frame according to a preset filtering rule includes: Determine whether a matching result between the vehicle detection frame and a zombie car detection frame in the zombie car queue meets a first preset matching condition; If so, determining whether a ratio of matching results between the vehicle detection frame and the zombie car detection frames in the zombie car queue that meet the first preset matching condition is greater than a first preset ratio threshold; If so, the vehicle detection frame is filtered.
3. The vehicle identification method according to claim 2, characterized in that: The determining whether a matching result between the vehicle detection frame and a zombie car detection frame in the zombie car queue meets a first preset matching condition includes: Calculating a first intersection-over-union ratio between the vehicle detection frame and the zombie car detection frames in the zombie car queue; Determining whether the first intersection-over-intersection ratio is greater than a first preset intersection-over-intersection ratio threshold; If so, the first preset matching condition is met.
4. The vehicle identification method according to claim 1, characterized in that: The determining whether the target vehicle information meets the preset new zombie vehicle condition includes: Determine whether the target vehicle information meets the first newly added zombie vehicle rule; If not, determining whether a matching result between the vehicle regression frame corresponding to the target vehicle information and each vehicle regression frame in the cached vehicle queue meets a second preset matching condition; If yes, then the cached vehicle queue is updated; Based on the update result, determine whether the target vehicle information complies with the second newly added zombie car rule.
5. The vehicle identification method according to claim 4, characterized in that: The determining whether the target vehicle information complies with the first newly added zombie vehicle rule includes: When the cache count of the target vehicle information is greater than a first preset count threshold; and The difference between the current time and the first cache time of the target vehicle information is greater than a first preset time threshold; and The ratio of the target vehicle information to the cached vehicle information in the cached vehicle queue is greater than a second preset ratio threshold; and A preset amount of target vehicle information is cached; It is determined that the target vehicle information meets the first newly added zombie car rule.
6. The vehicle identification method according to claim 4, characterized in that: The determining, based on the update result, whether the target vehicle information complies with the second newly added zombie vehicle rule includes: Based on the update result, determining the number of cache times of the target vehicle information within a first preset time range; Determine whether the cache count of the target vehicle information is less than a second preset count threshold; If not, determining whether the target vehicle information is converted into zombie vehicle information within a second preset time range; If not, the historical cache information of the target vehicle information in the cache vehicle queue is deleted.
7. The vehicle identification method according to claim 4, characterized in that: After determining whether a matching result between the vehicle regression frame corresponding to the target vehicle information and each vehicle regression frame in the cached vehicle queue meets a second preset matching condition, the method includes: If not, deleting the historical cache information of the target vehicle information in the cache vehicle queue; The target vehicle information is used as new cached vehicle information and added to the cached vehicle queue for re-caching.
8. The vehicle identification method according to any one of claims 1 to 7, characterized in that: After detecting the vehicle detection frame of each vehicle in each frame of the video data to be detected, the method further comprises: When a matching result between the vehicle detection frame and a cached vehicle detection frame in the cached vehicle queue meets a third preset matching condition, updating the cached vehicle queue; When the matching result between the vehicle detection frame and the zombie car detection frame in the zombie car queue meets the fourth preset matching condition, the zombie car queue is updated.
9. The vehicle identification method according to claim 8, characterized in that: When the matching result between the vehicle detection frame and the cached vehicle detection frame in the cached vehicle queue meets the third preset matching condition, updating the cached vehicle queue includes: Calculating a second intersection-and-union ratio between the vehicle detection frame and the vehicle detection frames of the cached vehicles in the cached vehicle queue; When the second intersection-and-joint ratio is greater than a second preset intersection-and-joint ratio threshold, determining whether a difference between the current time and the most recent update time is greater than a second preset time threshold; If so, the cached vehicle queue is updated.
10. A vehicle identification device, characterized in that: The device comprises: A vehicle detection frame acquisition unit is used to collect the video data to be detected and detect the vehicle detection frame of each vehicle in each frame image of the video data to be detected; A target vehicle detection frame acquisition unit, used to filter the vehicle detection frame according to a preset filtering rule to obtain a target vehicle detection frame; A target vehicle information recognition unit, used to recognize the target vehicle detection frame and obtain target vehicle information; A newly added zombie vehicle determining unit is used to determine whether the target vehicle information meets a preset newly added zombie vehicle condition when the target vehicle information matches the cached vehicle information in the cached vehicle queue; The vehicle identification unit is used to take the target vehicle information as the newly added zombie car information and add it to the zombie car queue when the target vehicle information meets the preset newly added zombie car condition.
11. A readable storage medium storing computer-readable instructions, characterized in that: When the computer-readable instructions are executed by a processor, the steps of the vehicle identification method as described in any one of claims 1 to 9 are implemented.
