A moving object detection method and system combined with foreground contour extraction

By improving the foreground contour extraction algorithm and using a CPU-GPU parallel optimization scheme, the problems of 'ghosting' and dynamic background noise in moving target detection are solved, achieving efficient and real-time moving target detection.

CN116071392BActive Publication Date: 2026-06-23QILU UNIVERSITY OF TECHNOLOGY (SHANDONG ACADEMY OF SCIENCES)

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
QILU UNIVERSITY OF TECHNOLOGY (SHANDONG ACADEMY OF SCIENCES)
Filing Date
2023-01-31
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Existing moving target detection methods are prone to ghosting when the initial frame contains moving targets, and are easily affected by dynamic background noise, failing to meet real-time requirements.

Method used

An improved foreground contour extraction algorithm combined with a CPU-GPU parallel optimization scheme is adopted. The background model is obtained through the VFCE algorithm, and the Sobel operator and adaptive multi-level threshold segmentation are used. The VIBE algorithm is combined for background updating and foreground extraction to enhance anti-interference and detection efficiency.

Benefits of technology

It effectively reduces dynamic background noise interference, improves the accuracy and real-time performance of moving target detection, eliminates the 'ghosting' phenomenon, and enhances detection efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116071392B_ABST
    Figure CN116071392B_ABST
Patent Text Reader

Abstract

The application discloses a kind of motion target detection method, system, electronic equipment and computer readable storage medium combined with foreground contour extraction, belong to motion target detection technical field.The method includes that CPU end obtains the multiple frames of images to be detected captured for the detection area to be detected, according to image order, corresponding background model is established;GPU end executes the following operation: according to current frame image, corresponding background model is acquired in real time, by VFCE algorithm, according to current frame image and corresponding background model, extract foreground contour image;By VIBE algorithm, current frame image is updated and foreground is extracted, and motion target entity is obtained;According to foreground contour image and motion target entity, obtain motion target sequence.In the process of motion target detection, external interference can be avoided, and clear motion target is obtained;Solve the problem of "motion target detection is susceptible to other factors interference, detection is not accurate" in prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of moving target detection technology, and in particular to a moving target detection method and system that combines foreground contour extraction. Background Technology

[0002] The statements in this section merely refer to the background art relevant to this application and do not necessarily constitute prior art.

[0003] Moving object detection is a hot research topic in computer vision, and it is widely used in pedestrian analysis, intelligent monitoring, autonomous driving, and other fields. In scenes containing moving objects, such as pedestrians, the background of some scenes is dynamic, such as swaying leaves or falling snowflakes.

[0004] Common moving target detection methods include inter-frame differencing, optical flow, and background subtraction. Inter-frame differencing is a relatively simple algorithm, characterized by its fast computation speed. However, it exhibits "holes" when the moving target moves slowly and "ghosting" when the moving target moves quickly. Therefore, this method is generally used as an auxiliary tool in combination with other methods. Optical flow is widely used because it can accurately calculate the velocity of moving targets, but it suffers from excessive noise and high computational complexity, failing to meet the requirements for detection accuracy and real-time performance. The core of background subtraction is to establish a robust background model. A classic algorithm is the ViBe algorithm (Visual Background Extractor) proposed by Barnich et al. This algorithm offers high detection accuracy and a certain degree of real-time performance.

[0005] The ViBe algorithm has two main problems: First, when the initial frame contains moving targets, the detection results will show a "ghosting" phenomenon. This is because the ViBe algorithm uses the first frame to initialize the background and builds the sample library on this basis. Second, ViBe is susceptible to environmental noise. This is because ViBe will identify some dynamic backgrounds (such as swaying leaves) as foreground, and ViBe uses a random strategy to assign values ​​to the sample library and update the background. This approach can easily detect background pixels as noise in the foreground. Summary of the Invention

[0006] To address the shortcomings of existing technologies, this application provides a moving target detection method, system, electronic device, and computer-readable storage medium that combines foreground contour extraction. A novel foreground contour extraction algorithm is proposed, which uses an improved mode background model to obtain the image background, uses background subtraction and the Sobel operator to determine the moving target region, and uses adaptive multi-level thresholding for image segmentation to enhance the algorithm's anti-interference capability. Combining this algorithm with the ViBe algorithm can significantly reduce environmental noise problems caused by dynamic backgrounds, etc. Simultaneously, a CPU-GPU parallel optimization scheme is proposed, which greatly improves the detection efficiency of the algorithm and meets real-time requirements.

[0007] Firstly, this application provides a moving target detection method that combines foreground contour extraction;

[0008] A moving target detection method combining foreground contour extraction includes:

[0009] The CPU acquires multiple frames of images of the region to be detected, and builds a corresponding background model based on the image order.

[0010] The GPU performs the following operations:

[0011] Based on the current frame image, the corresponding background model is acquired in real time. The foreground contour image is extracted using the VFCE algorithm based on the current frame image and the corresponding background model. The background is updated and the foreground is extracted using the VIBE algorithm to obtain the moving target entity.

[0012] Obtain the sequence of moving targets based on the foreground contour image and the moving target entity.

[0013] Furthermore, the specific steps for acquiring multiple frames of images captured for the region to be detected, and establishing the corresponding background model according to the image order, include:

[0014] Acquire multiple frames of images of the region to be detected, and use the mode modeling method to establish an initial background model for the first 100 frames.

[0015] A new background model is rebuilt every 100 frames and stored in the background image sequence.

[0016] Furthermore, the specific steps for extracting the foreground contour image using the VFCE algorithm based on the current frame image and the corresponding background model include:

[0017] Based on the current frame image and the corresponding background model, the background subtraction method is used to calculate the foreground image.

[0018] The gradient of the foreground image is calculated using the Sobel operator to obtain the gradient image of the foreground image;

[0019] The gradient image is denoised to extract the foreground contour image.

[0020] Further, the specific steps for denoising gradient images include:

[0021] The image segmentation threshold of the gradient image is obtained by the maximum inter-class variance method, and a first threshold and a second threshold are set to determine the image segmentation based on the image segmentation threshold.

[0022] The first threshold is used to segment the gradient image to obtain the first-level foreground, and the second threshold is used to segment the gradient image to obtain the second-level foreground.

[0023] An erosion operation is performed on the second-level foreground. The intersection of the eroded second-level foreground with the first-level foreground is then obtained to acquire the denoised foreground contour image.

[0024] Furthermore, the specific steps for updating the background and extracting the foreground of the current frame image using the VIBE algorithm to obtain the moving target entity include:

[0025] Obtain the initial background model, and build a sample library based on the initial background model;

[0026] Based on the sample library, a random strategy is used to extract the foreground and update the background of the current frame image to obtain the foreground image;

[0027] Erosion is performed on the foreground image to obtain the moving target entity.

[0028] Furthermore, the specific steps for obtaining the moving target sequence based on the foreground contour image and the moving target entity include:

[0029] Find the intersection of the foreground contour image and the moving target entity to obtain the moving target contour;

[0030] Find the union of the moving target outline and the moving target entity to obtain the complete moving target.

[0031] Furthermore, operations on the CPU and GPU sides are performed simultaneously.

[0032] Secondly, this application provides a moving target detection system that combines foreground contour extraction;

[0033] A moving target detection system combining foreground contour extraction, comprising:

[0034] The background model update module is configured to: acquire multiple frames of images to be detected captured for the region to be detected on the CPU side, and establish the corresponding background model according to the image order;

[0035] The foreground contour extraction module is configured to perform the following operations on the GPU:

[0036] Based on the current frame image, the corresponding background model is acquired in real time. The foreground contour image is extracted using the VFCE algorithm based on the current frame image and the corresponding background model. The background is updated and the foreground is extracted using the VIBE algorithm to obtain the moving target entity.

[0037] The moving target acquisition module is configured to acquire a sequence of moving targets based on the foreground contour image and the moving target entities.

[0038] Thirdly, this application provides an electronic device;

[0039] An electronic device includes a memory and a processor, as well as computer instructions stored in the memory and running on the processor, wherein the computer instructions, when executed by the processor, perform the steps of the moving target detection method combined with foreground contour extraction described above.

[0040] Fourthly, this application provides a computer-readable storage medium;

[0041] A computer-readable storage medium for storing computer instructions, which, when executed by a processor, perform the steps of the above-described moving target detection method incorporating foreground contour extraction.

[0042] Compared with the prior art, the beneficial effects of this application are:

[0043] 1. The technical solution provided in this application proposes a new Visual Foreground Contour Extractor (VFCE) algorithm, which removes most of the background contours that we are not interested in, and only retains the contours of the moving targets that we are interested in. The VFCE algorithm enhances the contour features of the moving targets and reduces the interference of factors such as lighting changes and dynamic backgrounds on the ViBe algorithm; it can eliminate noise and obtain clear moving targets.

[0044] 2. Since foreground detection requires waiting for the background model to be built, running the algorithm in this proposal using a traditional serial program takes a long time and cannot meet the real-time requirements. Therefore, this application proposes a CPU-GPU parallel scheme, in which the CPU is responsible for building the background model and the GPU is responsible for foreground detection. The two are performed simultaneously to improve the execution efficiency of the algorithm. Attached Figure Description

[0045] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments of this application and their descriptions are used to explain this application and do not constitute an undue limitation of this application.

[0046] Figure 1 A flowchart illustrating the moving target detection method combining foreground contour extraction provided in this application embodiment;

[0047] Figure 2 An example image provided for an embodiment of this application when the first frame of an image sequence contains a moving target;

[0048] Figure 3 The use of the classic ViBe algorithm provided in the embodiments of this application Figure 2 Example image of the moving target obtained through processing;

[0049] Figure 4 The improved ViBe algorithm provided in the embodiments of this application Figure 2 Example image of the moving target obtained through processing;

[0050] Figure 5 The VFCE algorithm provided in the embodiments of this application is used for Figure 2 Example image of the moving target obtained through processing;

[0051] Figure 6 The moving target detection method using foreground contour extraction provided in the embodiments of this application is for... Figure 2 Example image of the moving target obtained through processing;

[0052] Figure 7 Example diagrams showing complex scenarios and high-speed motion provided in the embodiments of this application;

[0053] Figure 8 The use of the classic ViBe algorithm provided in the embodiments of this application Figure 7 Example image of the moving target obtained through processing;

[0054] Figure 9 The improved ViBe algorithm provided in the embodiments of this application Figure 7 Example image of the moving target obtained through processing;

[0055] Figure 10 The VFCE algorithm provided in the embodiments of this application is used for Figure 7 Example image of the moving target obtained through processing;

[0056] Figure 11 The moving target detection method using foreground contour extraction provided in the embodiments of this application is for... Figure 7 Example image of the moving target obtained through processing;

[0057] Figure 12A frame rate comparison diagram of the classic ViBe algorithm provided in the embodiments of this application and the method described in the embodiments of this application during the detection process. Detailed Implementation

[0058] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of this application. Unless otherwise specified, all technical and scientific terms used in this application have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.

[0059] It should be noted that the terminology used herein is for the purpose of describing particular implementations only and is not intended to limit the exemplary implementations according to this application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. Furthermore, it should be understood that the terms “comprising” and “having”, and any variations thereof, are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such process, method, product, or apparatus.

[0060] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.

[0061] Example 1

[0062] Existing moving target detection methods are not suitable for initial frames containing moving targets or the influence of environmental noise; therefore, this application provides a moving target detection method that combines foreground contour extraction.

[0063] Next, combined Figure 1-12 This embodiment discloses a moving target detection method combining foreground contour extraction, which includes the following steps:

[0064] S1. Acquire multiple frames of images captured for the region to be detected, and establish the corresponding background model according to the image order; this step is executed on the CPU, and the specific operations are as follows:

[0065] S101. Acquire multiple frames of images of the region to be detected, and use the mode modeling method to establish an initial background model f for the first 100 frames. b0 And send it to the GPU; the mode background modeling method counts the frequency of gray values ​​in the image sequence and takes the gray value with the most occurrences as the background. However, it has problems such as low efficiency and large memory consumption when modeling long image sequences. Therefore, in this embodiment, an initial background model is first established for the first 100 frames of images.

[0066] However, if there are background changes in the scene, the initial background cannot adapt to the subsequent scene changes, so the background needs to be updated, and step S102 is executed.

[0067] S102. Based on the image arrangement order, a new background model is rebuilt every 100 frames, and the updated background model is saved to the background image sequence (denoted as F). b,k ={f b1 ,f b2 ,…,f bk This is stored in the GPU for subsequent reading during the detection process.

[0068] The GPU receives the background model f. b0 Then, the first 100 frames of images are detected sequentially. At this time, the CPU is also building the background model in parallel. The GPU will then obtain the background image from the background image sequence to update the background model after the first 100 frames of images have been detected.

[0069] The GPU performs the following steps:

[0070] S2. Based on the current frame image, obtain the corresponding background model in real time, and extract the foreground contour image based on the current frame image and the corresponding background model using the VFCE algorithm;

[0071] For example, firstly, for the i-th frame image f i (i = 1, 2, ..., n) The background subtraction method is used to initially extract the foreground image f. fi .

[0072] f fi =abs(f i -f bk )

[0073] Then, the foreground contour is initially calculated by using a Sobel convolution kernel to calculate the image gradient. To obtain the image gradient more accurately, two directions, 45° and 135°, are added:

[0074]

[0075]

[0076] The above convolution kernels are respectively connected to f fi Convolution yields four gradient components g. 0° g 45° g 90° g 135° f can be obtained using the following formula. fi Gradient image:

[0077]

[0078] Using the four-directional Sobel operator can detect the contours of moving targets more clearly, but it introduces some background noise. Therefore, finally, the gradient image obtained by the proposed adaptive multi-level threshold is subjected to noise reduction processing. The specific steps are as follows:

[0079] (1) The image segmentation threshold of the gradient image is obtained by the Otsu's method, as shown below:

[0080] T OTSU =OTSU(f grad )

[0081] Among them, T OTSU This represents the image segmentation threshold obtained using the Otsu's method.

[0082] (2) Set a first threshold and a second threshold for judging image segmentation based on the image segmentation threshold;

[0083] However, in complex scenes with significant noise, the OTSU algorithm tends to classify some environmental noise as foreground and some foreground contours as background. Therefore, this embodiment improves upon the OTSU algorithm by adding two thresholds: a first threshold T1 and a second threshold T2. Specifically, the frequency of all grayscale values ​​in the current image is counted. Among pixels with a grayscale value higher than the OTSU threshold, the pixel fre with the highest frequency of grayscale value is selected. After multiple experiments, 0.9 times this value is assigned to the first threshold T1. This threshold is used to segment the image and obtain the first-level foreground. A higher threshold can effectively remove environmental noise caused by dynamic backgrounds and other factors, but it can also damage the contours of moving targets. This is illustrated below:

[0084] T1 = 0.9 × fre, fre > T OTSU

[0085] T2 = 0.5 × fre, fre > T OTSU

[0086] (3) The gradient image is segmented using a first threshold to obtain the first-level foreground, and the gradient image is segmented using a second threshold to obtain the second-level foreground; specifically as follows:

[0087]

[0088]

[0089] (4) Since there are the above problems in using the second threshold to segment the gradient image, the second-level foreground is eroded, the intersection of the second-level foreground after erosion is found with the first-level foreground, the denoised foreground contour is obtained, the foreground contour is connected, and the foreground contour image is obtained.

[0090] Specifically, the method for performing contour connection is to determine whether there is a contour in the 8-neighborhood of a non-contour pixel. If there is, the point is also considered a contour.

[0091] S3. Using the VIBE algorithm, update the background and extract the foreground of the current frame image to obtain the moving target entity; the specific steps include:

[0092] S301, Background Initialization

[0093] When a moving target exists in the first frame of a video or image sequence, the ViBe algorithm incorrectly classifies the moving target as background. Therefore, this embodiment uses the background modeling method described in the foreground contour extraction algorithm, taking only the first 100 frames to establish the initial background f. b0 Then for f b0 For each pixel (x, y), a sample library S is built, and N random samples v from the 8-neighborhood of (x, y) are taken. j (j = 1, 2, ..., N) are assigned to the sample library. The ViBe strategy for updating the background is then applied to f. b0 renew.

[0094] S302, Foreground Detection

[0095] Based on the sample library, a random strategy is used to extract the foreground and update the background of the current frame image to obtain moving target entities. The specific calculation is as follows:

[0096]

[0097]

[0098] Where, ED(f) i (x,y),v j ) represents the i-th frame image f i The pixel value at (x,y) and the sample library element v at (x,y) of the background image. j If the Euclidean distance between pixel (x,y) and v is less than the radius threshold R, then pixel (x,y) is considered to be at the same distance. j Similar. The formula pixel represents f i If (x,y) is compared with all elements in the sample library, and the number of similarities is small, then the point is classified as foreground; otherwise, it is classified as background.

[0099] S4. Obtain the moving target sequence based on the foreground contour image and the moving target entity; the specific steps are as follows:

[0100] S401. Find the intersection of the foreground contour image and the moving target entity to obtain the moving target contour; represented as follows:

[0101] FV = f VFCE ∩f ViBe

[0102] Among them, f ViBe f represents the detection result of the ViBe algorithm (i.e., the moving target entity). VFCE The result of the VFCE algorithm (i.e., the foreground contour image) is represented by the intersection of the results of the two algorithms. The moving target contour FV with almost no noise can be obtained.

[0103] However, at this time, there is a "cavity" inside the moving target, so step S402 is executed.

[0104] S402. Perform an erosion operation on the moving target entity, and find the union between the moving target outline and the eroded moving target entity to obtain the complete moving target; specifically represented as follows:

[0105]

[0106] In step S402, a 3×3 identity matrix M is first used. 3×3 For f ViBe Erosion is performed to remove environmental noise in the ViBe algorithm, but this also destroys the internal shape of the moving target. Then, the union with FV is taken to obtain the complete moving target and solve the "hole" problem, so as to obtain the final moving target detection result.

[0107] In this embodiment, since foreground detection requires waiting for the construction of the background model, running the proposed algorithm using a traditional serial program is time-consuming and cannot meet real-time requirements. Therefore, a CPU-GPU parallel scheme is proposed, where the CPU is responsible for constructing the background model and the GPU is responsible for foreground detection, both proceeding simultaneously. Specifically, the CPU reads the foreground image sequence, takes the first 100 frames to construct the initial background, and passes it to the GPU. Every subsequent 100 frames, a new background image is constructed and stored in the background image sequence. In the GPU, CUDA is used to accelerate the execution efficiency of algorithms such as VFCE and ViBe, and shared memory is used to optimize thread memory access time. Every 100 frames detected by the GPU, the background needs to be updated; that is, before detecting the next frame, the GPU needs to read the new background from the background image sequence. To prevent detection pauses caused by the GPU waiting for the CPU, this paper uses OMP to construct the image background in parallel, ensuring smoothness and stability during the detection process.

[0108] To verify the technical effectiveness of the moving target detection method combining foreground contour extraction provided in this embodiment, a simulation experiment was conducted.

[0109] Figure 3 This demonstrates that when the first frame of an image sequence contains a moving target, the classic ViBe algorithm produces noticeable ghosting. This is because the classic ViBe algorithm uses the first frame as the initial background. In contrast, the motion detection result obtained by the method described in this embodiment is as follows: Figure 6 As shown, it can eliminate noise and obtain a clear moving target.

[0110] Figure 7 The data is selected from the PETS2001 dataset. This scene is relatively complex, and the speeds of moving targets vary. The classic ViBe algorithm misses some moving targets because the moving targets are moving slowly, and the classic ViBe algorithm classifies them as background. However, the method described in this embodiment does not produce obvious environmental noise, and the final detection results are better.

[0111] To analyze the performance of the method described in this embodiment, 2000 frames of images were selected from the TownCentre dataset for testing. A frame rate graph was plotted during the detection process, and device resource utilization was analyzed. Figure 12 As shown, the classic ViBe algorithm has low resource utilization and significant room for performance improvement. In this embodiment, the detection frame rate is relatively low when simultaneously constructing the background image sequence and detecting the foreground. This is because using the CPU to construct the background image sequence in parallel consumes all CPU threads, and the operating system automatically allocates threads to processes, leading to resource conflicts between background image sequence construction and data transfer between the CPU and GPU. After the background image sequence is constructed, the CPU's work is largely complete, and the remaining work is mainly performed by the GPU for foreground detection. At this point, the detection frame rate is higher, and GPU utilization is also improved.

[0112] Example 2

[0113] This embodiment discloses a moving target detection system that combines foreground contour extraction, including:

[0114] The background model update module is configured to: acquire multiple frames of images to be detected captured for the region to be detected on the CPU side, and establish the corresponding background model according to the image order;

[0115] The foreground contour extraction module is configured to perform the following operations on the GPU:

[0116] Based on the current frame image, the corresponding background model is acquired in real time. The foreground contour image is extracted using the VFCE algorithm based on the current frame image and the corresponding background model. The background is updated and the foreground is extracted using the VIBE algorithm to obtain the moving target entity.

[0117] The moving target acquisition module is configured to acquire a sequence of moving targets based on the foreground contour image and the moving target entities.

[0118] It should be noted that the background model update module, foreground contour extraction module, and moving target acquisition module described above correspond to the steps in Embodiment 1. The examples and application scenarios implemented by these modules and their corresponding steps are the same, but they are not limited to the content disclosed in Embodiment 1. It should also be noted that these modules, as part of the system, can be executed in a computer system, such as a set of computer-executable instructions.

[0119] Example 3

[0120] Embodiment 3 of the present invention provides an electronic device, including a memory and a processor, as well as computer instructions stored in the memory and running on the processor. When the computer instructions are executed by the processor, they complete the steps of the above-described moving target detection method combined with foreground contour extraction.

[0121] Example 4

[0122] Embodiment 4 of the present invention provides a computer-readable storage medium for storing computer instructions, which, when executed by a processor, complete the steps of the above-described moving target detection method combined with foreground contour extraction.

[0123] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0124] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0125] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment, whereby a series of operational steps are performed to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0126] The descriptions of each embodiment in the above embodiments have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0127] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A moving target detection method combining foreground contour extraction, characterized in that, include: The CPU acquires multiple frames of images of the region to be detected, and builds a corresponding background model based on the image order. The GPU performs the following operations: Based on the current frame image, the corresponding background model is acquired in real time. The foreground contour image is extracted using the VFCE algorithm based on the current frame image and the corresponding background model. The background is updated and the foreground is extracted using the VIBE algorithm to obtain the moving target entity. Based on the foreground contour image and the moving target entity, obtain the moving target sequence; The step of extracting the foreground contour image using the VFCE algorithm based on the current frame image and the corresponding background model includes: Based on the current frame image and the corresponding background model, the background subtraction method is used to calculate the foreground image. The gradient of the foreground image is calculated using the Sobel operator to obtain the gradient image of the foreground image; The gradient image is denoised to extract the foreground contour image; The steps for denoising gradient images include: The image segmentation threshold of the gradient image is obtained by the maximum inter-class variance method, and a first threshold and a second threshold are set to determine the image segmentation based on the image segmentation threshold. The first threshold is used to segment the gradient image to obtain the first-level foreground, and the second threshold is used to segment the gradient image to obtain the second-level foreground. An erosion operation is performed on the second-level foreground. The intersection of the eroded second-level foreground with the first-level foreground is obtained to get the denoised foreground contour. A contour connection operation is then performed on the foreground contour to obtain the foreground contour image.

2. The moving target detection method combining foreground contour extraction as described in claim 1, characterized in that, The specific steps for acquiring multiple frames of images captured for the region to be detected, and establishing the corresponding background model according to the image order, include: Acquire multiple frames of images of the region to be detected, and use the mode modeling method to establish an initial background model for the first 100 frames. A new background model is rebuilt every 100 frames and stored in the background image sequence.

3. The moving target detection method combining foreground contour extraction as described in claim 1, characterized in that, The specific steps for updating the background and extracting the foreground of the current frame image using the VIBE algorithm to obtain the moving target entity include: Obtain the initial background model, and build a sample library based on the initial background model; Based on the sample library, a random strategy is used to extract the foreground and update the background of the current frame image to obtain the moving target entity.

4. The moving target detection method combining foreground contour extraction as described in claim 1, characterized in that, The specific steps for obtaining the moving target sequence based on the foreground contour image and the moving target entity include: Find the intersection of the foreground contour image and the moving target entity to obtain the moving target contour; The moving target entity is subjected to an erosion operation. The moving target outline is then joined with the eroded moving target entity to obtain the complete moving target.

5. The moving target detection method combining foreground contour extraction as described in claim 1, characterized in that, Operations on the CPU and GPU can be performed simultaneously.

6. A moving target detection system combining foreground contour extraction, characterized in that, include: The background model update module is deployed on the CPU and is configured to: acquire multiple frames of images captured for the region to be detected, and build the corresponding background model according to the image order; The foreground contour extraction module is deployed on the GPU and configured to perform the following operations: Based on the current frame image, the corresponding background model is acquired in real time. The foreground contour image is extracted using the VFCE algorithm based on the current frame image and the corresponding background model. The background is updated and the foreground is extracted using the VIBE algorithm to obtain the moving target entity. The moving target acquisition module is configured to acquire a sequence of moving targets based on the foreground contour image and the moving target entities; The step of extracting the foreground contour image using the VFCE algorithm based on the current frame image and the corresponding background model includes: Based on the current frame image and the corresponding background model, the background subtraction method is used to calculate the foreground image. The gradient of the foreground image is calculated using the Sobel operator to obtain the gradient image of the foreground image; The gradient image is denoised to extract the foreground contour image; The steps for denoising gradient images include: The image segmentation threshold of the gradient image is obtained by the maximum inter-class variance method, and a first threshold and a second threshold are set to determine the image segmentation based on the image segmentation threshold. The first threshold is used to segment the gradient image to obtain the first-level foreground, and the second threshold is used to segment the gradient image to obtain the second-level foreground. An erosion operation is performed on the second-level foreground. The intersection of the eroded second-level foreground with the first-level foreground is obtained to get the denoised foreground contour. A contour connection operation is then performed on the foreground contour to obtain the foreground contour image.

7. An electronic device, characterized in that, It includes a memory and a processor, as well as computer instructions stored in the memory and running on the processor, which, when executed by the processor, perform the steps described in any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, Used to store computer instructions, which, when executed by a processor, perform the steps described in any one of claims 1-5.