Target detection method, target detection system, and computer-readable storage medium

By using a Gaussian mixture model and a hierarchical weighting method, combined with pixel overlay of multiple video frames and target trajectory correction, the problems of false detection and missed detection in target detection in complex scenes are solved, thereby improving the accuracy and reliability of detection.

CN114419531BActive Publication Date: 2025-10-21ZHEJIANG DAHUA TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202111481397.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-06
Publication Date
2025-10-21
Estimated Expiration
2041-12-06

AI Technical Summary

Technical Problem

Existing target detection methods are prone to false detection and missed detection in complex scenarios, especially in conditions of insufficient lighting, strong lighting, or congestion, resulting in frequent false alarms in intelligent traffic warning services.

Method used

The Gaussian mixture model (GMMS) is used for background modeling and foreground segmentation. The target to be detected is verified by pixel superposition of multiple video frames and target trajectory correction, combined with a hierarchical weighted method to reduce the probability of false detection.

Benefits of technology

It improves the accuracy of target detection, reduces the probability of false detection and missed detection, and enhances the detection capability in complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114419531B_ABST
    Figure CN114419531B_ABST
Patent Text Reader

Abstract

The application discloses a target detection method, a target detection system and a computer readable storage medium. The method comprises the following steps: acquiring a plurality of video frames; wherein at least one target to be detected is included in the video frames; segmenting foreground and background in each video frame to obtain a corresponding segmentation result; superimposing the segmentation results of the plurality of video frames to obtain a superimposed result, and obtaining a candidate lane area corresponding to the foreground from the superimposed result; correcting the candidate lane area according to a target track of the target to be detected in the plurality of video frames to obtain a first lane area; and checking the target to be detected by using the background in the superimposed result and the first lane area through a hierarchical weighting method. Through the design, the accuracy of filtering of abnormal detection targets can be ensured, and the probability of false detection can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer vision technology, and in particular to a target detection method, a target detection system, and a computer-readable storage medium. Background Art

[0002] With the rapid development of computer vision technology based on deep learning, target detection has become one of the most important research directions. A large number of scientific researchers have achieved excellent results in the field of target detection, fully demonstrating the advancement and superiority of deep learning. With the development of deep learning technology, the effectiveness and robustness of target detection algorithms have been further improved. However, due to the complexity and diversity of real-world scenarios, deep learning training samples cannot cover them well. As a result, in the application process, there are often fewer samples in certain scenarios (for example, insufficient lighting, strong lighting, or congestion). This leads to poor target detection results, a large number of false detections and missed detections, and a serious impact on product implementation. For example, in intelligent traffic warning services, a large number of false detections and missed detections will cause a large number of false alarms, making it the most urgent problem to be solved in the implementation of intelligent warning services. Therefore, a new target detection method is urgently needed to solve the above problems. Summary of the Invention

[0003] The main technical problem solved by this application is to provide a target detection method, a target detection system and a computer-readable storage medium, which can ensure the accuracy of filtering abnormal detection targets.

[0004] In order to solve the above technical problems, a technical solution adopted in the present application is: providing a target detection method, including: obtaining multiple video frames; wherein the video frames include at least one target to be detected; segmenting the foreground and background in each of the video frames to obtain corresponding segmentation results; pixel-wise superimposing the segmentation results of the multiple video frames to obtain a superposition result, and obtaining a candidate lane area corresponding to the foreground from the superposition result; correcting the candidate lane area according to the target trajectory of the target to be detected in the multiple video frames to obtain a first lane area; and verifying the target to be detected using the background and the first lane area in the superposition result through a hierarchical weighted method.

[0005] Among them, the step of verifying the target to be detected by using the background in the superposition result and the first lane area through a hierarchical weighted method includes: obtaining the target detection frame of the target to be detected and its first information from the target detector; wherein the first information includes the size information and spatial position of the target detection frame, and the size information includes the width of the target detection frame; in response to the spatial position of the target detection frame being outside the first lane area, the width of the target detection frame and the width of the first lane area meeting the preset conditions, and the position corresponding to the target detection frame being at least one of the background, determining that the target to be detected is an abnormal detection target; and verifying the type of the target to be detected according to the size information and the spatial position through a hierarchical weighted method.

[0006] Among them, the step of verifying the type of the target to be detected by a hierarchical weighted method based on the size and the spatial position includes: obtaining a first overlap ratio between the target detection frame and the first lane area, a ratio between the width of the target detection frame and the width of the first lane area, and a second overlap ratio between the target detection frame and the background; in response to the first overlap ratio being greater than a first threshold, setting a first condition value to a preset constant; in response to the ratio being greater than a second threshold and less than a third threshold, setting the second condition value to a preset constant; in response to the second overlap ratio being less than a fourth threshold, setting the third condition value to a preset constant; obtaining a sum of a first product of the first condition value and a first weighted ratio, a second product of the second condition value and the second weighted ratio, and a third product of the third condition value and the third weighted ratio; in response to the sum being greater than or equal to a fifth threshold, determining that the target to be detected is a normal detection target.

[0007] Among them, the step of superimposing the segmentation results of multiple video frames by pixels to obtain a superposition result, and obtaining the candidate lane area corresponding to the foreground from the superposition result includes: superimposing the segmentation results of multiple video frames by pixels to obtain a superposition result, and performing edge detection on the superimposed foreground to obtain the candidate lane area corresponding to the foreground; wherein, each of the candidate lane areas is configured with a lane number; traversing the targets to be detected in all the video frames; wherein, each of the targets to be detected is configured with a target number; in response to the status of the target to be detected being created, obtaining the candidate lane area where the target to be detected is located, and binding the target number of the target to be detected with the lane number of the corresponding candidate lane area.

[0008] Among them, the step of correcting the candidate lane area according to the target trajectory of the target to be detected in the multiple video frames to obtain the first lane area includes: in response to the state of the target to be detected not being created and the state of the target to be detected being deleted, judging whether the target number of the target to be detected has been bound to the lane number of the corresponding candidate lane area; if so, correcting the candidate lane area through the target trajectory set of the target to be detected from creation to deletion to obtain the first lane area, and determining the direction of the first lane area through the displacement direction of the target trajectory point of the target to be detected.

[0009] The target trajectory set includes multiple target trajectories of the target to be detected from creation to deletion; the step of correcting the candidate lane area to obtain the first lane area using the target trajectory set of the target to be detected from creation to deletion includes: fitting the multiple target trajectories of the target to be detected to obtain a fitting line; and using the fitting line to correct the lane line slope of the candidate lane area to obtain the first lane area.

[0010] Among them, the step of segmenting the foreground and background in each of the video frames to obtain corresponding segmentation results includes: establishing a Gaussian model for each first pixel point in the first video frame, and taking the pixel value of the first pixel point as the model mean; obtaining the pixel value of the second pixel point at the same position as the first pixel point in the current video frame, and judging whether the difference between the pixel value of the second pixel point and the model mean is greater than or equal to a sixth threshold; if so, judging that the target to be detected corresponding to the second pixel point is the foreground; otherwise, judging that the target to be detected corresponding to the second pixel point is the background.

[0011] Wherein, after the step of segmenting the foreground and background in each video frame to obtain corresponding segmentation results, the method further comprises: removing background noise by using a morphological noise filter.

[0012] To solve the above technical problems, another technical solution adopted in this application is: to provide a target detection system, including a memory and a processor coupled to each other, wherein the memory stores program instructions, and the processor is used to execute the program instructions to implement the target detection method mentioned in any of the above embodiments.

[0013] In order to solve the above technical problems, another technical solution adopted in this application is: providing a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is used to implement the target detection method mentioned in any of the above embodiments.

[0014] Different from the prior art, the beneficial effect of the present application is that the target detection method provided by the present application includes: obtaining multiple video frames; wherein the video frames include at least one target to be detected, segmenting the foreground and background in each video frame to obtain corresponding segmentation results, pixel-wise superimposing the segmentation results of multiple video frames to obtain a superposition result, and obtaining a candidate lane area corresponding to the foreground from the superposition result, then correcting the candidate lane area according to the target trajectory of the target to be detected in the multiple video frames to obtain a first lane area, and finally using the background and the first lane area in the superposition result to verify the target to be detected by a hierarchical weighted method. Through this design method, the accuracy of filtering abnormal detection targets can be guaranteed, thereby reducing the probability of false detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without inventive efforts. Among them:

[0016] Figure 1 This is a flow chart of an embodiment of the target detection method of the present application;

[0017] Figure 2 yes Figure 1 A schematic flow chart of an embodiment of step S2;

[0018] Figure 3 This is the original image of the high-speed scene instance;

[0019] Figure 4 This is the GMMS rendering of a high-speed scenario example;

[0020] Figure 5 This is a schematic diagram of the parking false alarm result;

[0021] Figure 6 This is a schematic diagram of the GMMS processing results of the parking false alarm frame;

[0022] Figure 7 This is a schematic diagram of pedestrian false alarm results;

[0023] Figure 8 This is a schematic diagram of the GMMS processing results of pedestrian false alarm frames;

[0024] Figure 9 yes Figure 1 A schematic flow chart of an implementation method of step S3;

[0025] Figure 10 yes Figure 1A schematic flow chart of an implementation method of step S4 in FIG.

[0026] Figure 11 yes Figure 1 A schematic flow chart of an implementation method of step S5;

[0027] Figure 12 yes Figure 11 A schematic flow chart of an embodiment of step S42;

[0028] Figure 13 This is a schematic structural diagram of an embodiment of the target detection system of the present application;

[0029] Figure 14 This is a schematic diagram of the framework of an embodiment of the target detection system of the present application;

[0030] Figure 15 It is a schematic diagram of a framework of an embodiment of the computer-readable storage medium of the present application. DETAILED DESCRIPTION

[0031] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments of this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0032] See also Figure 1 , Figure 1 It is a flow chart of an implementation method of the target detection method of the present application.

[0033] Specifically, the target detection method includes:

[0034] S1: Acquire multiple video frames.

[0035] Specifically, the video frame includes at least one target to be detected.

[0036] S2: Segment the foreground and background in each video frame to obtain corresponding segmentation results.

[0037] Specifically, the background modeling is performed through Gaussian mixture model (GMMS) to complete the segmentation of foreground (moving target) and background (static object), and the corresponding segmentation results are obtained.

[0038] Specifically, in this embodiment, please refer to Figure 2-Figure 4 , Figure 2 yes Figure 1 A schematic flow chart of an embodiment of step S2 in FIG. Figure 3 This is the original image of a high-speed scene instance. Figure 4This is a GMMS rendering of a high-speed scenario. Step S2 specifically includes:

[0039] S10: Establish a Gaussian model for each first pixel in the first video frame, and use the pixel value of the first pixel as the model mean.

[0040] Specifically, the Gaussian model is a common variable distribution model, the Gaussian probability density function, whose formula is as follows:

[0041]

[0042] Among them, μ represents the mean, σ 2 represents the variance.

[0043] The Gaussian mixture model (GMMS) uses the Gaussian probability density function to accurately quantify things. It is a model that decomposes things into several Gaussian probability density functions. The joint probability density distribution function of the Gaussian mixture model (GMMS) is:

[0044]

[0045] Where p(x|k)=N(x|μ k ,∑k) represents the Gaussian probability density function of the kth Gaussian model; p(k)=π k represents the weight of the k-th Gaussian model.

[0046] S11: Obtain a pixel value of a second pixel at the same position as the first pixel in the current video frame, and determine whether a difference between the pixel value of the second pixel and the model mean is greater than or equal to a sixth threshold.

[0047] S12: If yes, determine that the target to be detected corresponding to the second pixel is a foreground.

[0048] S13: Otherwise, determine that the target to be detected corresponding to the second pixel point is the background.

[0049] Specifically, the Gaussian mixture model is initialized with the first frame of traffic scene image, and a Gaussian model is established for each pixel, with the pixel value of the first pixel as the model mean, and the variance σ is given. 2 An initial value (constant) is input each time an image is framed. The distance between the pixel value of the second pixel at the same position as the first pixel in the current video frame and the model mean is calculated. If the difference is large, the target is considered to be in motion and is regarded as the foreground. Otherwise, it is the background. The hybrid model is updated with each frame of continuous traffic scene images to achieve the segmentation of the static background of the traffic scene and the foreground of the vehicle target.

[0050] Taking the vehicles in the traffic scene as an example, Figure 3and Figure 4 GMMS has a high ability to acquire small targets at a distance, thereby improving the efficiency of extracting moving vehicles. Through this design approach, the segmentation of static background and vehicle target foreground in traffic scenes can be achieved.

[0051] Preferably, in this embodiment, after step S2, i.e., after the step of segmenting the foreground and background in each video frame to obtain a corresponding segmentation result, the process includes: removing background noise using a morphological noise filter. This can make the foreground and background segmentation more complete, thereby improving the accuracy of the segmentation.

[0052] In addition, in this embodiment, while using the Gaussian mixture model to segment the foreground and background, an object detector (such as YOLOv3, etc.) is used to detect and track the vehicle target in the video frame, and each target is assigned a target number. However, since the YOLOv3 detector is unstable in detecting small targets at the far end (i.e., missed detection), the target detection frame will be in a lost state for a long time and remain stationary in one position, which will lead to false parking alarms, such as Figure 5 As shown, Figure 5 The figure is a schematic diagram of the parking false alarm result. The false alarm vehicle is at the far end of the screen. The reason for the false alarm is that the small moving target at the far end is mistakenly judged as a stationary target. At this time, it is necessary to accurately obtain the motion state of the target. Figure 6 As shown, Figure 6 This diagram shows the results of GMMS processing of a false parking alarm frame. By introducing GMMS, the current motion state of the parking alarm target can be verified. If the verification result indicates that the target is in motion, the previous parking alarm is canceled, significantly reducing the probability of false alarms and missed alarms. The Gaussian mixture model (GMMS)'s sensitivity to moving targets can effectively compensate for the missed detection of small, distant targets in complex environments by deep learning detectors.

[0053] In addition, Figure 7 As shown, Figure 7 This is a diagram showing the result of a pedestrian false alarm. The YOLOv3 detector may also detect roadside signs as pedestrians, resulting in pedestrian false alarms. Figure 8 , Figure 8 The following diagram shows the results of GMMS processing for a false pedestrian alarm frame. GMMS fails to detect objects where the YOLOv3 detector mistakenly detects pedestrians, thus providing a corrective effect on the YOLOv3 detector. This is particularly effective for detecting small objects far away in the video frame.

[0054] S3: Perform pixel superposition on the segmentation results of multiple video frames to obtain a superposition result, and obtain a candidate lane area corresponding to the foreground from the superposition result.

[0055] Specifically, in this embodiment, please refer to Figure 9 , Figure 9 yes Figure 1 Schematic diagram of a flow chart of an embodiment of step S3 in FIG. Step S3 specifically includes:

[0056] S20: Pixel-overlapping the segmentation results of the multiple video frames to obtain a superposition result, and performing edge detection on the superposed foreground to obtain a candidate lane area corresponding to the foreground.

[0057] Specifically, each candidate lane area is assigned a lane ID. In step S2, the static background and moving foreground are segmented using a Gaussian mixture model (GMMS). The segmentation results of multiple frames are pixel-overlaid to obtain a superposition result. Edge detection is then performed on the superposed foreground area. Morphological methods, such as dilation, erosion, and opening operations, are used to shape the superposed foreground foreground. Edge detection is then performed using a gradient operator to obtain candidate lane areas corresponding to each foreground area. Each candidate lane area is then assigned a corresponding lane ID.

[0058] S21: Traverse the targets to be detected in all video frames.

[0059] Specifically, each target to be detected is configured with a target ID.

[0060] S22: Determine whether the status of the target to be detected is created.

[0061] Specifically, if the status of a target to be detected is created, it means that the target to be detected appears for the first time; if the status of a target to be detected is not created, it means that the target to be detected does not appear for the first time.

[0062] S23: If yes, obtain the candidate lane area where the target to be detected is located, and bind the target number of the target to be detected with the lane number of the corresponding candidate lane area.

[0063] Specifically, if the status of the target to be detected is created, the candidate lane area where the target to be detected is located is further determined, and the target number of the target to be detected is bound to the lane number of the corresponding candidate lane area.

[0064] S24: Otherwise, go to step S4.

[0065] Specifically, if the state of the target to be detected is not created, it means that the target to be detected is not the first time appearing, and the process proceeds to the step of correcting the candidate lane area according to the target trajectory of the target to be detected in multiple video frames to obtain the first lane area.

[0066] S4: Correcting the candidate lane region according to the target trajectory of the target to be detected in multiple video frames to obtain a first lane region.

[0067] Specifically, in this embodiment, please refer to Figure 10 , Figure 10 yes Figure 1 Schematic diagram of a flow chart of an embodiment of step S4 in FIG. Step S4 specifically includes:

[0068] S30: If the status of the target to be detected is not creation, determine whether the status of the target to be detected is deletion.

[0069] Specifically, if it is determined in step S24 that the state of the target to be detected is not creation, it is determined whether the state of the target to be detected is deletion, that is, it is determined whether the target to be detected disappears in the video frame.

[0070] S31: If yes, determine whether the target number of the target to be detected is bound to the lane number of the corresponding candidate lane area.

[0071] Specifically, if the status of the target to be detected is deleted, it is determined whether the target number of the target to be detected has been bound to the lane number of the corresponding candidate lane area.

[0072] S32: If yes, correct the candidate lane area by using the target trajectory set of the target to be detected from creation to deletion to obtain a first lane area, and determine the direction of the first lane area by the displacement direction of the target trajectory point of the target to be detected.

[0073] Specifically, if the target number of the target to be detected in the deleted state has been bound to the lane number of the corresponding candidate lane area, the candidate lane area is corrected by the target trajectory set of the target to be detected from creation to deletion to obtain the first lane area, and the direction to the first lane area is determined by the displacement direction of the target trajectory point of the target to be detected. This method increases the recognition of scene information, and the moving targets obtained by the Gaussian mixture model (GMMS) are superimposed frame by frame to obtain the area of ​​target movement, and the lane area can be recognized in the corresponding traffic road scene.

[0074] In this embodiment, the target trajectory set includes multiple target trajectories of the target to be detected from creation to deletion. Specifically, in this embodiment, the step of correcting the candidate lane area to obtain the first lane area through the target trajectory set of the target to be detected from creation to deletion in step S32 specifically includes: A. fitting the multiple target trajectories of the target to be detected to obtain a fitting line; B. using the fitting line to correct the lane line slope of the candidate lane area to obtain the first lane area. Through such a design approach, the state of the target is predicted based on the motion changes of the target in consecutive frames from a clustering perspective, which significantly optimizes the detection problem of small targets of the deep learning-based detector. The directions of multiple target trajectories can be counted to avoid the risk of errors when determining the direction through a single target trajectory, thereby improving the accuracy of correcting the candidate lane area.

[0075] Traffic scene information recognition is completed through Gaussian mixture model (GMMS) and target trajectory fitting, which reduces manual participation and greatly improves the environmental adaptability of edge computing products.

[0076] S33: Otherwise, end.

[0077] Specifically, if step S30 determines that the status of the target to be detected is neither created nor deleted, the lane information identification step ends. If step S31 determines that the target ID of the target to be detected is not associated with a lane ID in the corresponding candidate lane area, the lane information identification step also ends. This saves resources and processing time.

[0078] S5: Use the background and the first lane area in the superposition result to verify the target through a hierarchical weighted method.

[0079] Taking into account Figure 5 and Figure 7 In order to reduce the probability of missed detection or false detection in the YOLOv3 detector, the traffic scene information obtained by the YOLOv3 detector needs to be verified by the Gaussian Mixture Model (GMMS). Specifically, in this embodiment, please refer to Figure 11 , Figure 11 yes Figure 1 Schematic diagram of a flow chart of an embodiment of step S5 in FIG. Step S5 specifically includes:

[0080] S40: Obtain an object detection frame of the object to be detected and its first information from the object detector.

[0081] Specifically, the first information includes size information and spatial position of the target detection frame, and the size information includes the width of the target detection frame.

[0082] S41: In response to at least one of the following: the spatial position of the target detection frame is outside the first lane area, the width of the target detection frame and the width of the first lane area meet a preset condition, and the position corresponding to the target detection frame is the background, it is determined that the target to be detected is an abnormal detection target.

[0083] Specifically, (1) if the spatial position of the target detection frame is outside the first lane area, the target to be detected corresponding to the target detection frame can be determined as a suspected abnormal detection target; (2) if the width of the target detection frame and the width of the first lane area meet the preset conditions, the possibility that the detection target is an abnormal detection target can be increased; (3) if the position corresponding to the target detection frame is at least one of the backgrounds extracted by the Gaussian mixture model (GMMS), the possibility that the detection target is an abnormal detection target can be further increased. Preferably, in this embodiment, the preset condition in (2) can be that the width (size) of the target to be detected is seriously too large or seriously too small compared to the width (size) of the first lane area, and the target to be detected can be determined as an abnormal detection target.

[0084] Through this design approach, combined with traffic scene information, target size and spatial position information, the one-sidedness of target detection results based on deep learning models is avoided, and abnormal detection targets are judged and filtered, ensuring the accuracy of abnormal detection target filtering and reducing the probability of false detection.

[0085] S42: Verify the type of the target to be detected by a hierarchical weighted method based on the size information and the spatial position.

[0086] Furthermore, in order to make the verification result more accurate, the above three situations can be comprehensively considered by a hierarchical weighting method. Figure 12 , Figure 12 yes Figure 11 Schematic diagram of a flow chart of an embodiment of step S42 in FIG. Step S42 specifically includes:

[0087] S420: Obtain a first overlap ratio between the target detection frame and the first lane area, a ratio between the width of the target detection frame and the width of the first lane area, and a second overlap ratio between the target detection frame and the background.

[0088] Specifically, the above three situations correspond to the following three calculation methods: (1) the first overlap ratio between the target detection frame and the first lane area; (2) the ratio between the width of the target detection frame and the width of the first lane area; (3) the second overlap ratio between the target detection frame and the background.

[0089] S421: In response to the first overlap ratio being greater than a first threshold, setting a first condition value to a preset constant.

[0090] Specifically, condition a: if the first overlap ratio between the target detection frame and the first lane area is greater than 60%, indicating that the spatial position of the target detection frame is within the first lane area and the target to be detected corresponding to the target detection frame is a normal detection target, then the first condition value a is set to 1; otherwise, the first condition value a is set to 0. Of course, in other embodiments, the value of the first threshold may also be other values, which is not limited here.

[0091] S422: In response to the ratio being greater than the second threshold and less than the third threshold, setting the second condition value to a preset constant.

[0092] Specifically, if condition b: 30% < the ratio of the width of the target detection frame to the width of the first lane area < 120%, it indicates that the width of the target detection frame and the width of the first lane area do not meet the preset condition in step S41, and the second condition value b is set to 1; otherwise, the second condition value b is set to 0. Of course, in other embodiments, the values ​​of the second threshold and the third threshold may also be other values, which are not limited here.

[0093] S423: In response to the second overlap ratio being less than a fourth threshold, setting the third condition value to a preset constant.

[0094] Specifically, condition c: if the second overlap ratio between the target detection frame and the background is less than 50%, indicating that the position corresponding to the target detection frame is at least one of the background extracted by the Gaussian mixture model (GMMS), then the third condition value c is set to 1; otherwise, the third condition value c is set to 0. Of course, in other embodiments, the value of the fourth threshold may also be other values, which are not limited here.

[0095] S424: Obtain a sum of a first product of the first condition value and the first weighting ratio, a second product of the second condition value and the second weighting ratio, and a third product of the third condition value and the third weighting ratio.

[0096] Specifically, the calculation formula of the final calculation result res is:

[0097] res=λa+βb+ηc;

[0098] Wherein, λ, β, and η are weighted ratios of conditions a, b, and c, respectively. Preferably, in this embodiment, the weighted ratio λ:β:η=2:2:6. Of course, in other embodiments, the weighted ratio can be set according to actual conditions and is not limited here.

[0099] S425: Determine whether the sum value is greater than or equal to a fifth threshold.

[0100] Specifically, when the weighting ratio λ:β:η=2:2:6, it is determined whether the final calculation result res is greater than or equal to 8. Of course, the value of the fifth threshold may also be other values, which are not limited here.

[0101] S426: If yes, determine that the target to be detected is a normal detection target.

[0102] Specifically, if the final calculation result res≥8, the target to be detected is determined to be a normal detection target and can be subsequently detected and tracked.

[0103] S427: Otherwise, discard the target to be detected.

[0104] Specifically, if the final calculation result res<8, the target to be detected is determined to be an abnormal target, and the target to be detected is discarded and not subjected to the next step of detection, which can save resources and overall processing time.

[0105] Through this design approach, a variety of information is combined and comprehensively considered to make the final judgment, which not only ensures the accuracy of filtering abnormal detection targets, but also reduces the probability of false detection of the detector.

[0106] See also Figure 13 , Figure 13 This is a schematic diagram of the structure of an embodiment of the target detection system of the present application. The target detection system specifically includes:

[0107] The acquisition module 10 is used to acquire multiple video frames; wherein the video frames include at least one target to be detected.

[0108] The segmentation module 12 is coupled to the acquisition module 10 and is configured to segment the foreground and background in each video frame to obtain a corresponding segmentation result.

[0109] The superposition module 14 is coupled to the segmentation module 12 and is configured to perform pixel superposition on the segmentation results of the plurality of video frames to obtain a superposition result, and obtain a candidate lane region corresponding to the foreground from the superposition result.

[0110] The correction module 16 is coupled to the superposition module 14 and is configured to correct the candidate lane region according to the target trajectory of the target to be detected in the plurality of video frames to obtain a first lane region.

[0111] The verification module 18 is coupled to the correction module 16 and is configured to verify the target to be detected by using the background and the first lane area in the superposition result through a hierarchical weighting method.

[0112] See also Figure 14 , Figure 142 is a schematic diagram of a framework of an embodiment of the target detection system of the present application. The target detection system includes a memory 20 and a processor 22 coupled to each other. Specifically, in this embodiment, the memory 20 stores program instructions, and the processor 22 is used to execute the program instructions to implement the target detection method mentioned in any of the above embodiments.

[0113] Specifically, the processor 22 may also be referred to as a CPU (Central Processing Unit). The processor 22 may be an integrated circuit chip having signal processing capabilities. The processor 22 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. In addition, the processor 22 may be implemented by multiple integrated circuit chips.

[0114] See also Figure 15 , Figure 15 It is a schematic diagram of a framework of an embodiment of a computer-readable storage medium of the present application. The computer-readable storage medium 30 stores a computer program 300, which can be read by a computer, and the computer program 300 can be executed by a processor to implement the target detection method mentioned in any of the above embodiments. Wherein, the computer program 300 can be stored in the above-mentioned computer-readable storage medium 30 in the form of a software product, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to execute all or part of the steps of the method described in each embodiment of the present application. The computer-readable storage medium 30 with a storage function can be a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk, etc., which can store program code, or a terminal device such as a computer, a server, a mobile phone, or a tablet.

[0115] In summary, different from the prior art, the target detection method provided by the present application includes: obtaining multiple video frames; wherein the video frames include at least one target to be detected, segmenting the foreground and background in each video frame to obtain corresponding segmentation results, pixel-wise superimposing the segmentation results of multiple video frames to obtain a superposition result, and obtaining a candidate lane area corresponding to the foreground from the superposition result, then correcting the candidate lane area according to the target trajectory of the target to be detected in the multiple video frames to obtain a first lane area, and finally using the background and the first lane area in the superposition result to verify the target to be detected by a hierarchical weighted method. Through this design method, the accuracy of filtering abnormal detection targets can be guaranteed, thereby reducing the probability of false detection.

[0116] The above description is only an implementation method of the present application and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the description and drawings of this application, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A target detection method, characterized in that: include: Acquire multiple video frames; wherein the video frames include at least one target to be detected; Segmenting the foreground and background in each of the video frames to obtain corresponding segmentation results; Performing pixel superposition on the segmentation results of the plurality of video frames to obtain a superposition result, and obtaining a candidate lane area corresponding to the foreground from the superposition result; Correcting the candidate lane area according to the target trajectory of the target to be detected in the multiple video frames to obtain a first lane area; Verifying the target to be detected by using the background in the superposition result and the first lane area through a hierarchical weighted method; The verifying the target to be detected by using the background in the superposition result and the first lane area through a hierarchical weighted method includes: The first condition value, the second condition value, and the third condition value are weighted to obtain a sum value, wherein the first condition value is determined based on a determination result of whether the spatial position of the target detection frame of the target to be detected is outside the first lane area, the second condition value is determined based on a determination result of whether the width of the target detection frame and the width of the first lane area meet a preset condition, and the third condition value is determined based on a determination result of whether the position corresponding to the target detection frame is the background; Based on the sum value, it is determined whether the target to be detected is a normal detection target.

2. The target detection method according to claim 1, wherein: The step of verifying the target to be detected by using the background in the superposition result and the first lane area through a hierarchical weighting method includes: Obtaining an object detection frame of the object to be detected and first information thereof from an object detector; wherein the first information includes size information and spatial position of the object detection frame, and the size information includes a width of the object detection frame; In response to at least one of the following: a spatial position of the target detection frame is outside the first lane area, a width of the target detection frame and a width of the first lane area satisfy a preset condition, and a position corresponding to the target detection frame is the background, determining that the target to be detected is an abnormal detection target; Obtaining a first overlap ratio between the target detection frame and the first lane area, a ratio between a width of the target detection frame and a width of the first lane area, and a second overlap ratio between the target detection frame and the background; In response to the first overlap ratio being greater than a first threshold, setting the first conditional value to a preset constant; in response to the ratio being greater than a second threshold and less than a third threshold, setting the second conditional value to a preset constant; in response to the second overlap ratio being less than a fourth threshold, setting the third conditional value to a preset constant; The weighting the first condition value, the second condition value, and the third condition value to obtain a sum value includes: obtaining a sum value of a first product of the first condition value and a first weighting ratio, a second product of the second condition value and a second weighting ratio, and a third product of the third condition value and a third weighting ratio; The determining whether the target to be detected is a normal target based on the sum value includes: in response to the sum value being greater than or equal to a fifth threshold, determining that the target to be detected is a normal target.

3. The target detection method according to claim 1, wherein: The step of superimposing the segmentation results of the plurality of video frames to obtain a superposition result, and obtaining the candidate lane area corresponding to the foreground from the superposition result, comprises: Performing pixel superposition on the segmentation results of the plurality of video frames to obtain a superposition result, and performing edge detection on the superposed foreground to obtain a candidate lane region corresponding to the foreground; wherein each candidate lane region is assigned a lane number; Traversing all the targets to be detected in the video frames; wherein each target to be detected is assigned a target number; In response to the state of the target to be detected being created, a candidate lane area where the target to be detected is located is obtained, and the target number of the target to be detected is bound to the lane number of the corresponding candidate lane area.

4. The target detection method according to claim 3, wherein: The step of correcting the candidate lane area according to the target trajectory of the target to be detected in the multiple video frames to obtain the first lane area includes: In response to the state of the target to be detected not being created and the state of the target to be detected being deleted, determining whether the target number of the target to be detected has been bound to a lane number of a corresponding candidate lane area; If so, the candidate lane area is corrected by the target trajectory set of the target to be detected from creation to deletion to obtain the first lane area, and the direction of the first lane area is determined by the displacement direction of the target trajectory point of the target to be detected.

5. The target detection method according to claim 4, characterized in that: The target trajectory set includes multiple target trajectories of the target to be detected from creation to deletion; the step of correcting the candidate lane area to obtain the first lane area using the target trajectory set of the target to be detected from creation to deletion includes: Fitting multiple target trajectories of the target to be detected to obtain a fitting line; The lane line slope of the candidate lane region is corrected using the fitting line to obtain the first lane region.

6. The target detection method according to claim 1, wherein: The step of segmenting the foreground and background in each video frame to obtain corresponding segmentation results includes: Establish a Gaussian model for each first pixel in the first video frame, and use the pixel value of the first pixel as the model mean; Obtaining a pixel value of a second pixel at the same position as the first pixel in the current video frame, and determining whether a difference between the pixel value of the second pixel and the model mean is greater than or equal to a sixth threshold; If yes, then determining that the target to be detected corresponding to the second pixel point is a foreground; Otherwise, it is determined that the target to be detected corresponding to the second pixel point is the background.

7. The target detection method according to claim 1, wherein: After the step of segmenting the foreground and background in each video frame to obtain corresponding segmentation results, the method further comprises: Background noise is removed by using a morphological noise filter.

8. A target detection system, characterized in that: The invention comprises a memory and a processor coupled to each other, wherein the memory stores program instructions, and the processor is used to execute the program instructions to implement the target detection method according to any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and the computer program is used to implement the target detection method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Static target detection method based on two-background differencing

    CN107204006A

  • Lane line identification method and device, electronic equipment and computer readable storage medium

    CN113255404A

  • Multi-lane traffic flow detection method for complex monitoring scene

    CN113516853A

  • Target recognition system and target recognition method executed by the target recognition system

    US20130322692A1