A moving target detection method and system based on a ZYNQ platform and a Vibe algorithm

By improving the ViBe algorithm and combining it with the parallel acceleration advantages of the ZYNQ platform, the adaptability problem of moving target detection in complex scenarios was solved, achieving low power consumption, small size, and fast moving target detection, thus improving the accuracy and real-time performance of detection.

CN115830058BActive Publication Date: 2026-04-14YUNNAN NORMAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-29
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing moving target detection methods have poor adaptability in complex scenarios. In particular, optical flow methods are slow to compute, frame difference methods are inaccurate in scenarios with sudden changes in lighting, and deep learning methods are not effective when there is a lack of sample sets. Traditional embedded devices also lack scalability and flexibility.

Method used

The improved ViBe algorithm adds 24 neighborhood sample acquisitions during the background modeling stage, introduces an adaptive sensitivity coefficient, and leverages the parallel acceleration advantages of the ZYNQ platform. Image processing is achieved through a combination of FPGA and ARM, improving the algorithm's adaptability and detection accuracy in complex scenes.

Benefits of technology

It achieves low-power, small-size, and fast motion target detection in complex environments, improving detection accuracy and real-time performance, and has strong adaptability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115830058B_ABST
    Figure CN115830058B_ABST
Patent Text Reader

Abstract

The application relates to a moving target detection method and system based on a ZYNQ platform and a Vibe algorithm and belongs to the technical field of digital image processing.The CPU-based ViBe algorithm is decomposed into various modules, the characteristics that parallel computing and pipeline operation can be accelerated in the ZYNQ platform are utilized, each step of the algorithm is optimized and improved, and the purpose of accelerating the processing speed of the system is achieved.The parallel acceleration advantages of the ZYNQ platform are utilized to accelerate the tasks, and the application aims to provide a moving target detection method and system which are low in power consumption, small in size, easy to deploy, fast in processing speed, good in robustness and strong in expansibility.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a moving target detection method and system based on the ZYNQ platform and the Vibe algorithm, belonging to the field of digital image processing technology. Background Technology

[0002] Video surveillance systems, as the most effective means of information security, have been actively deployed across all sectors of society, and their coverage and scale are increasing daily. The ever-growing scale of video surveillance systems generates massive amounts of video data. How to quickly, efficiently, and intelligently acquire the usable information that people need is a crucial issue for video surveillance systems today.

[0003] Moving target detection, based on digital image technology, utilizes image segmentation methods to accurately and quickly identify and extract moving targets from video sequences, providing a fundamental function for subsequent processes. The results of moving target detection play a crucial role in video surveillance, directly impacting the overall performance of subsequent research such as target recognition, target tracking, and abnormal behavior analysis.

[0004] Currently, commonly used moving target detection methods include optical flow, frame difference, deep learning-based methods, and background modeling. Optical flow is a method that uses pixel vector information to calculate the motion field of objects in a video, thereby detecting moving targets. Frame difference is a method that uses the difference operation between two or three adjacent frames to calculate the relationship between the difference and a threshold to obtain the features of moving targets in the video. Deep learning-based methods are trained on a large sample set and use convolutional networks to extract the features of moving targets. The algorithm based on the Visual Background Extractor (ViBe) model proposed by Oliver Barnich et al. is a commonly used moving target detection method. The ViBe algorithm is based on the similarity between neighboring pixels. It selects only the first frame of the video to build a background model and detects moving targets by the similarity between the background model and the pixel values ​​of the current frame. Its main steps are: (1) Initialize the sample set of each pixel in the background model using the first frame image; (2) Perform moving target detection on the current frame image; (3) Update the background model.

[0005] There are generally two approaches to applying moving target detection technology in intelligent video surveillance:

[0006] One approach is computer-based video analytics, where video capture devices send captured video data to a computer for motion target detection. This method utilizes a high-performance computer for unified analysis and processing of the video information, allowing for the deployment of various algorithms to achieve optimal detection results for different scenarios. However, this centralized data processing suffers from problems such as large data volumes, slow processing speed, large space requirements, and high power consumption.

[0007] One approach is to integrate an intelligent video processor. This solution uses embedded devices to integrate moving target detection algorithms. After completing intelligent video analysis, it only transmits a small amount of key information to the backend monitoring center. Currently, commonly used embedded devices for image processing include ARM, DSP, and FPGA. ARM is a microprocessor based on the RISC architecture, suitable as a control platform and for implementing simple image processing. DSP is a digital signal processor with certain computing power, suitable for building image processing platforms. FPGA, or Field-Programmable Gate Array, inherently possesses parallelism, making it ideal for processing frame-based or pixel-based image data. Furthermore, FPGA has abundant logic resources, offering great flexibility and meeting the computational needs of various image processing tasks. ZYNQ is a new generation of fully programmable system-on-a-chip from Xilinx. The combination of "FPGA + ARM" gives this series of products both the traditional parallel data processing capabilities and abundant programmable logic resources of FPGA, and the rich interface resources and powerful logic control capabilities of ARM. When performing image processing with ZYNQ, computationally intensive tasks requiring low latency can be implemented on the hardware side using FPGA, while process control and system porting can be implemented on the ARM side, thus balancing speed and flexibility.

[0008] For the ZYNQ platform, optical flow and deep learning-based methods have excessively long computation times, complex algorithms, and poor real-time performance; frame difference and background modeling methods are relatively simple, require less computation, and have good real-time performance, making them suitable for deployment on ZYNQ to detect moving targets in videos.

[0009] Optical flow-based detection methods suffer from slow computation speed and difficulty in ensuring real-time performance due to their large computational load and complex algorithms. Frame difference-based algorithms are simple to implement and offer high real-time performance, but they are unsuitable for scenarios with sudden changes in lighting and suffer from numerous holes within the detection results, making it easy to miss slow-moving targets. Deep learning-based algorithms rely heavily on the size of the sample set; in some special scenarios with insufficient samples, it is difficult to train neural network models for immediate deployment, and they also have high hardware performance requirements, resulting in computational costs far exceeding traditional algorithms. The ViBe algorithm features low computational complexity, fast processing speed, and high real-time performance, but in complex scenes with large areas of dynamic change, such as raindrops, snowflakes, swaying vegetation, and shimmering water, it still detects large areas of false targets, affecting the accuracy of moving target detection.

[0010] Due to their limited resources, ARM single-core processors can only perform some simple image processing tasks. They cannot complete the expected functions when dealing with complex algorithms or large amounts of data. While DSP single-core processors have powerful computing capabilities, they are essentially serial execution systems, and their general architecture is fixed, limiting their application. FPGAs are well-suited for processing pixel-based or frame-based image data; however, their poor scalability and flexibility hinder further applications of the image processing results. Summary of the Invention

[0011] The technical problem to be solved by the present invention is to provide a moving target detection method and system based on the ZYNQ platform and the ViBe algorithm, so as to solve the problem of poor adaptability of the existing technology in complex scenarios.

[0012] This invention makes the following improvements to the traditional ViBe algorithm: (1) In the background modeling stage, the original 8-neighborhood sample collection is changed to 24-neighborhood sample collection to enhance the accuracy of the sample set, and according to the hardware characteristics of the ZYNQ platform, random sampling is changed to fixed-point sampling; (2) In the moving target detection stage, an adaptive sensitivity coefficient is introduced to dynamically change the detection threshold according to the complexity of the current frame image, thereby enhancing the algorithm's adaptability in complex scenes. In the implementation process, a series of image processing is required, including data format conversion, filtering, binarization, morphological processing, etc.

[0013] This invention leverages the parallel acceleration advantages of the ZYNQ platform to accelerate these tasks, aiming to provide a moving target detection method and system that is low-power, small-sized, easy to deploy, fast-processing, robust, and highly scalable.

[0014] The technical solution of this invention is: a moving target detection method based on the ZYNQ platform and the Vibe algorithm, the specific steps of which are as follows:

[0015] Step 1: Acquire images to obtain real-time video stream data.

[0016] Step 2: Monitor the frame number of the current video image and determine if it is the first frame of the video. If it is, initialize the background model and proceed to Step 1; otherwise, proceed to Step 3.

[0017] Step 3: Obtain the foreground detection result by calculating the current frame image and the background model.

[0018] Step 4: Update the background model based on the detection results of Step 3.

[0019] Step 5: Perform morphological processing on the detection results from Step 3.

[0020] Step 6: Output the processing result from Step 5 as a video stream.

[0021] The background model in Step 2 is specifically as follows:

[0022] Step 2.1: Convert the real-time data stream in RGB888 format to YCbCr format to obtain the grayscale image of a single frame of video. RGB888 represents a color space model with red, green, and blue as the three primary colors. Y, Cb, and Cr are a color coding method used by European television systems. Y represents luminance, i.e., grayscale level, while Cb and Cr represent chrominance, used to describe the saturation and hue of the image.

[0023] The formula for converting from the RGB color space to the YCbCr color space model is as follows:

[0024]

[0025] Step 2.2: Use median filtering to denoise and obtain the denoised grayscale image.

[0026] Step 2.3: Obtain the grayscale image of the first frame and construct a background model M(x) for each pixel.

[0027] M(x)={S(x),L(x),P(x)}

[0028] Where S(x) is the adaptive sensitivity coefficient, L(x) is the foreground lifetime, and P(x) is the background sample set.

[0029] Step 2.3 specifically refers to:

[0030] Step 2.3.1: Initialize the foreground lifetime. L(x) represents the number of times a pixel is continuously classified as a foreground pixel. Initially, it is 0, so L(x) = 0.

[0031] In this invention, the number of times a pixel is continuously classified as a foreground pixel is the foreground lifetime.

[0032] Step 2.3.2: Take the average of the differences between the grayscale values ​​within the 24 neighborhoods and the center grayscale value, and initialize the adaptive sensitivity coefficient:

[0033]

[0034] Wherein G(x) i G′(x) represents the gray value at the center of a 5×5 image matrix. i ) represents the grayscale value of each position within a 24-bit neighborhood, where M = 24.

[0035] Step 2.3.3: Collect samples from the 24 neighborhood. If the following requirements are met, add them to the background sample set. If not, add the mean as a sample to the background sample model.

[0036] |G′(x i )-J(x)| <S(x i )#

[0037] Where J(x) is the mean gray value within the 5x5 template, and S(x) is the mean gray value. i ) represents the adaptive sensitivity coefficient.

[0038] Step 3 specifically refers to:

[0039] Step 3.1: Convert the real-time data stream in RGB888 format to YCbCr format to obtain a grayscale image.

[0040] Step 3.2: Use median filtering to denoise and obtain the denoised grayscale image.

[0041] Step 3.3: Calculate the new adaptive sensitivity coefficient. First, calculate the dynamic background coefficient D(x):

[0042]

[0043] Where, F(x) i ) represents the pixel value of the current frame, p k represents the sample values ​​of the background model, and N is the number of sample values.

[0044] Calculate the new adaptive sensitivity coefficient S(x) based on the dynamic background coefficient and the adaptive sensitivity coefficient S(x) within the background model. i The formula is as follows:

[0045]

[0046] Where α is a fixed coefficient.

[0047] Step 3.4: Subtract the pixel values ​​of the grayscale image from the sample values ​​in the background model, and count the number of samples whose absolute value of the difference is less than the adaptive sensitivity coefficient to obtain the number of matches.

[0048] p i ={P(x i ),P(x i )∈|P(x i )-F(x i )|≥S(x i )}

[0049] Match = count(P(x) i ))

[0050] Step 3.5: Based on the number of matches (Match) obtained in Step 3.4, classify the pixels:

[0051]

[0052] If there are 2 or fewer points, the point is considered to be in the foreground; otherwise, it is considered to be in the background.

[0053] Step 4 specifically refers to:

[0054] Step 4.1: Apply the new adaptive sensitivity coefficient S(x) obtained in Step 3.3 i Update to the background model.

[0055] Step 4.2: Obtain the classification of each pixel in the current frame image from Step 3.5.

[0056] If the pixel is classified as foreground, the foreground lifetime L(x) = L(x) + 1.

[0057] If the pixel is classified as background, L(x) = 0.

[0058] The meaning of foreground lifetime refers to the number of times each pixel is consecutively classified as foreground. This invention processes video streams, which consist of multiple consecutive frames. Therefore, the logic here is to count the classification of pixels at the same position in each frame. If a pixel is classified as foreground, its lifetime (the number of consecutive foreground classifications) is incremented by 1; if it is background, its lifetime is reset to 0.

[0059] If the point is classified as background, it is determined by a random factor. To determine whether to update the sample set corresponding to the current pixel, there are... The probability of replacing a gray value in the sample set corresponding to the current pixel.

[0060] Step 4.3: If the point is classified as foreground and the foreground lifetime L(x) > 50, it is considered that a static area has been misjudged as moving, and the current pixel value is replaced with a gray value in the sample set corresponding to the current pixel.

[0061] Step 5 specifically includes:

[0062] Step 5.1: First, perform an etching operation on the test results.

[0063] Step 5.2: Perform an expansion operation on the test results.

[0064] A moving target detection system based on the ZYNQ platform and the ViBe algorithm includes:

[0065] The image acquisition module is used to drive the OV5460 camera to capture the external scene and convert the video data output by the camera into an AXI4-Stream data stream.

[0066] The background model initialization module is used to initialize the background model, build a corresponding model for each pixel, and cache it in DDR via VDMA.

[0067] The image detection module is used to classify each pixel as either foreground or background and update the background model.

[0068] The morphological processing module is used to perform morphological processing on the detection results, namely, corrosion and expansion operations.

[0069] The image display module is used to convert the final detection result into a minimum differential signal, which can be transmitted to the display screen via an HDMI interface.

[0070] The image acquisition module includes:

[0071] The camera driver module is used to configure the OV5460 camera via the SCCB serial port protocol and drive the camera to capture external scenes.

[0072] The data format conversion module is used to convert the video stream data output by the OV5460 camera into an AXI4-Stream data stream.

[0073] The background model initialization module includes:

[0074] The median filtering module is used to remove some noise from the input video stream data.

[0075] The background sample set acquisition module is used to acquire samples from a 5×5 image matrix and initialize the background model.

[0076] The image detection module:

[0077] The foreground detection module compares each pixel in the current frame with all samples in its corresponding background model sample set to determine whether the current pixel belongs to the background or the foreground.

[0078] The background model update module is used for random updates to the background model sample set and for replacing samples at random locations within the background model sample set.

[0079] The beneficial effects of this invention are:

[0080] 1. This invention improves the background modeling stage and moving target detection stage of the traditional ViBe algorithm, thereby enhancing the system's adaptability to complex environments and increasing the detection accuracy.

[0081] 2. This invention uses the ZYNQ platform to implement the moving target detection algorithm and utilizes FPGA to accelerate image processing, which has the advantages of small size, low power consumption and fast calculation speed. Attached Figure Description

[0082] Figure 1 This is a flowchart of the steps of the method of the present invention;

[0083] Figure 2 This is a flowchart of the background model initialization process in the method of this invention;

[0084] Figure 3 This is a flowchart of the foreground detection process in the method of this invention;

[0085] Figure 4 This is a flowchart of the background model update process in the method of this invention;

[0086] Figure 5 This is a flowchart of the morphological processing in the method of this invention;

[0087] Figure 6 This is a hardware system structure diagram of the present invention;

[0088] Figure 7 This is the logic diagram of the background model initialization module of this invention;

[0089] Figure 8 This is a diagram of the median filtering template of the present invention;

[0090] Figure 9 This is a diagram illustrating the process of collecting the background sample set for this invention.

[0091] Figure 10 This is a logic diagram of the foreground detection module of the present invention;

[0092] Figure 11 This is the hardware logic diagram of the corrosion operation of this invention;

[0093] Figure 12 This is the hardware logic diagram of the expansion operation of this invention. Detailed Implementation

[0094] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.

[0095] Example 1: As Figure 1 As shown, a moving target detection method based on the ZYNQ platform and the Vibe algorithm includes the following steps:

[0096] Step 1: Acquire images to obtain real-time video stream data.

[0097] Step 2: Monitor the frame number of the current video image and determine if it is the first frame of the video. If it is, initialize the background model and proceed to Step 1; otherwise, proceed to Step 3.

[0098] Step 3: Obtain the foreground detection result by calculating the current frame image and the background model.

[0099] Step 4: Update the background model based on the detection results of Step 3.

[0100] Step 5: Perform morphological processing on the detection results from Step 3.

[0101] Step 6: Output the processing result from Step 5 as a video stream.

[0102] like Figure 2 As shown, the background model in Step 2 is specifically as follows:

[0103] Step 2.1: Convert the real-time data stream in RGB888 format to YCbCr format to obtain the grayscale image of a single frame of video. RGB888 represents a color space model with red, green, and blue as the three primary colors. Y, Cb, and Cr are a color coding method used by European television systems. Y represents luminance, i.e., grayscale level, while Cb and Cr represent chrominance, used to describe the saturation and hue of the image.

[0104] The formula for converting from the RGB color space to the YCbCr color space model is as follows:

[0105]

[0106] Step 2.2: Use median filtering to denoise and obtain the denoised grayscale image.

[0107] Step 2.3: Obtain the grayscale image of the first frame and construct a background model M(x) for each pixel.

[0108] M(x)={S(x),L(x),P(x)}

[0109] Where S(x) is the adaptive sensitivity coefficient, L(x) is the foreground lifetime, and P(x) is the background sample set.

[0110] Step 2.3 specifically refers to:

[0111] Step 2.3.1: Initialize the foreground lifetime. L(x) represents the number of times a pixel is continuously classified as a foreground pixel. Initially, it is 0, so L(x) = 0.

[0112] In this invention, the number of times a pixel is continuously classified as a foreground pixel is the foreground lifetime.

[0113] Step 2.3.2: Take the average of the differences between the grayscale values ​​within the 24 neighborhoods and the center grayscale value, and initialize the adaptive sensitivity coefficient:

[0114]

[0115] Wherein G(x) i G represents the gray value at the center of a 5×5 image matrix. ′ (x i ) represents the grayscale value of each position within a 24-bit neighborhood, where M = 24.

[0116] Step 2.3.3: Collect samples from the 24 neighborhood. If the following requirements are met, add them to the background sample set. If not, add the mean as a sample to the background sample model.

[0117] |G′(x i )-J(x)| <S(x i )#

[0118] Where J(x) is the mean gray value within the 5x5 template, and S(x) is the mean gray value. i ) represents the adaptive sensitivity coefficient.

[0119] like Figure 3 As shown, Step 3 specifically includes:

[0120] Step 3.1: Convert the real-time data stream in RGB888 format to YCbCr format to obtain a grayscale image.

[0121] Step 3.2: Use median filtering to denoise and obtain the denoised grayscale image.

[0122] Step 3.3: Calculate the new adaptive sensitivity coefficient. First, calculate the dynamic background coefficient D(x):

[0123]

[0124] Where, F(x) i ) represents the pixel value of the current frame, p k represents the sample values ​​of the background model, and N is the number of sample values.

[0125] Calculate the new adaptive sensitivity coefficient S(x) based on the dynamic background coefficient and the adaptive sensitivity coefficient S(x) within the background model. i The formula is as follows:

[0126]

[0127] Where α is a fixed coefficient.

[0128] Step 3.4: Subtract the pixel values ​​of the grayscale image from the sample values ​​in the background model, and count the number of samples whose absolute value of the difference is less than the adaptive sensitivity coefficient to obtain the number of matches.

[0129] p i ={P(x i ),P(x i )∈|P(x i )-F(x i )|≥S(x i )}

[0130] Match = count(P(x) i ))

[0131] Step 3.5: Based on the number of matches (Match) obtained in Step 3.4, classify the pixels:

[0132]

[0133] If there are 2 or fewer points, the point is considered to be in the foreground; otherwise, it is considered to be in the background.

[0134] like Figure 4 As shown, Step 4 specifically includes:

[0135] Step 4.1: Apply the new adaptive sensitivity coefficient S(x) obtained in Step 3.3 i Update to the background model.

[0136] Step 4.2: Obtain the classification of each pixel in the current frame image from Step 3.5.

[0137] If the pixel is classified as foreground, the foreground lifetime L(x) = L(x) + 1.

[0138] If the pixel is classified as background, L(x) = 0.

[0139] The meaning of foreground lifetime refers to the number of times each pixel is consecutively classified as foreground. This invention processes video streams, which consist of multiple consecutive frames. Therefore, the logic here is to count the classification of pixels at the same position in each frame. If a pixel is classified as foreground, its lifetime (the number of consecutive foreground classifications) is incremented by 1; if it is background, its lifetime is reset to 0.

[0140] If the point is classified as background, it is determined by a random factor. To determine whether to update the sample set corresponding to the current pixel, there are... The probability of replacing a gray value in the sample set corresponding to the current pixel.

[0141] Step 4.3: If the point is classified as foreground and the foreground lifetime L(x) > 50, it is considered that a static area has been misjudged as moving, and the current pixel value is replaced with a gray value in the sample set corresponding to the current pixel.

[0142] like Figure 5 As shown, Step 5 specifically includes:

[0143] Step 5.1: First, perform an etching operation on the test results.

[0144] Step 5.2: Perform an expansion operation on the test results.

[0145] Example 2: A moving target detection system based on the ZYNQ platform and Vibe algorithm, including an image acquisition module, a background model initialization module, an image detection module, a morphological processing module, and an image display module. The hardware system structure is as follows: Figure 6 As shown.

[0146] The system's workflow is as follows: Under FPGA control, the OV5640 camera begins acquiring real-time video stream data, which is then sent to the FPGA for further processing. The image acquisition module converts the video data into an AXI4-Stream data stream and sends it to the background model initialization module to build the background model. VDMA0 is mainly responsible for buffering the established background model data into DDR. Once VMDA0 successfully buffers the data into DDR, it shuts down VDMA0 via an interrupt mechanism. Simultaneously, the OV5640 continues to acquire video stream data and sends the acquired video data to the image detection module. Meanwhile, VDMA1 reads the previously buffered background model data from DDR and sends it to the image detection module for unified processing with the previously input video stream data. Specifically, this involves target detection and background model updates. Finally, the detected video stream containing moving targets is input to the morphological processing module. After morphological processing, the video stream data containing moving targets is buffered three times by VDMA2 and directly output to the image display module. The real-time detection results can then be viewed on an HDMI monitor. The updated background model data will be cached in DDR via VDMA1, waiting for moving target detection in the next frame.

[0147] The image acquisition module mainly consists of two modules: a camera driver module and a data format conversion module. The camera driver module configures the OV5460 camera via the SCCB serial port protocol. The camera outputs image data in RGB565 format. For ease of subsequent algorithm processing, the acquired RGB565 image is converted to an RGB888 image. Furthermore, since subsequent system processing requires an AXI4-Stream format data stream, the RGB88 image is converted to an AXI4-Stream data stream.

[0148] The background model initialization module receives the first frame image from the image acquisition module and initializes the background model of the ViBe algorithm based on the first frame image. The logic diagram of this module is as follows: Figure 7 As shown. Because the background model initialization module completes its function after writing data once, VMDA0 should stop running. This invention achieves this through interrupts. An interrupt frame counter is configured in the VMDA0 control register on the PS side. When the interrupt threshold is met, an interrupt output is generated. This indicates that initialization is complete and VDMA0 stops working.

[0149] The background model initialization module receives the AXI4-Stream data stream and preprocesses it, including grayscale conversion and median filtering. The data format is converted; implementing floating-point calculations in the FPGA consumes significant resources. The formula in Step 2.1 is transformed to obtain the following formula for grayscale conversion:

[0150]

[0151] The method for implementing median filtering in the background model initialization module is as follows: Data rows are buffered in two Block RAMs within the PL terminal to obtain three rows of image data. Each row is then buffered in columns using three shift registers to obtain a 3×3 image matrix. First, the max, med, and min values ​​of each row in the matrix are calculated. Then, the minimum value min_of_max in the first column, the median value med_of_med in the second column, and the maximum value max_of_min in the third column are calculated. Finally, the median value med_of_max is calculated, thus completing the median filtering.

[0152] This invention provides a novel method for establishing a background sample set. For example... Figure 9 As shown, in a 5×5 image matrix, 20 points are taken and the difference between them and the mean of the matrix is ​​calculated. If the difference is greater than the adaptive sensitivity coefficient, the mean is added to the background sample set; otherwise, the pixel value is added to the background sample set.

[0153] The image detection module mainly includes two modules: a foreground detection module and a background model update module. The foreground detection module compares each pixel in the current frame with all samples in its corresponding background model sample set to determine whether the current pixel matches the features in the background model samples. In this invention, it determines whether the absolute value of the difference between the grayscale value of each pixel and the grayscale values ​​of all sample points is less than the adaptive sensitivity coefficient S(x). For feature points in the sample set that meet the requirements, if the number of matches is greater than or equal to 2, the current pixel is determined to be background; otherwise, it is determined to be foreground. Specific implementation steps are as follows... Figure 10 As shown.

[0154] The background model update module updates the background model according to the update strategy in step 4. Implementing a random number generation module in the FPGA would consume a lot of resources. In the background model update module, this invention uses a random function on the PS side to generate random numbers, and uses the AXI-Lite protocol to transmit the generated random numbers from the PS side to the background model update module on the PL side, thereby realizing the random update of the background model sample set and the replacement of samples at random positions in the background model sample set.

[0155] The morphological processing module implements an opening operation that proceeds after erosion. In the FPGA logic implementation, this invention uses two RAMs to cache row data, and each row uses three registers for column caching, resulting in a 3×3 image matrix. To leverage the parallel computing advantages of the FPGA, a pipelined approach is adopted. In the first stage of the pipeline, all data in each row of the 3×3 image matrix are ANDed to obtain three intermediate values, P1, P2, and P3. In the second stage of the pipeline, these three intermediate values ​​are ANDed again to complete the erosion operation. The hardware logic diagram of the erosion operation is shown below. Figure 11 As shown. The implementation process of the expansion operation is similar; it can be achieved by simply replacing all "AND" operations with "OR" operations. The specific hardware logic diagram of the expansion operation is shown below. Figure 11 As shown.

[0156] The image display module connects to an external HDMI interface monitor to display the detection result image. The image display module includes a dynamic clock generator IP core and a DVI conversion IP core. The dynamic clock generator IP core generates a 74.25MHz clock to drive the DVI conversion IP core. Since the HDMI interface is backward compatible with the DVI interface, this invention implements the DVI conversion IP core to drive the HDMI interface. The DVI conversion IP core converts the parallel image data signal and clock signal into TMDS (Transition Minimized Differential Signaling), thereby enabling the normal display of digital video.

[0157] The specific embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the present invention.

Claims

1. A moving target detection method based on the ZYNQ platform and the Vibe algorithm, characterized in that: Step 1: Acquire images to obtain real-time video stream data; Step 2: Monitor the frame number of the current video image and determine if it is the first frame of the video. If it is, initialize the background model and proceed to Step 1; otherwise, proceed to Step 3. Step 3: Obtain the foreground detection result by calculating the current frame image and the background model; Step 4: Update the background model based on the detection results of Step 3; Step 5: Perform morphological processing on the detection results from Step 3; Step 6: Output the processing result of Step 5 as a video stream; The specific process of constructing the background model in Step 2 is as follows: Step 2.1: Convert the real-time data stream in RGB888 format to YCbCr format to obtain the grayscale image of a single frame video image; RGB888 represents a color space model with red, green and blue as the three primary colors. Y, Cb and Cr are a color coding method used by European television systems. Y represents brightness, i.e. grayscale level, and Cb and Cr represent chromaticity, which are used to describe the saturation and hue of the image; The formula for converting from the RGB color space to the YCbCr color space model is as follows: ; Step 2.2: Use median filtering to denoise, and obtain the denoised grayscale image; Step 2.3: Obtain the grayscale image of the first frame and construct a background model for each pixel. ; ; in, It is an adaptive sensitivity coefficient. It is the lifespan of the prospect. It is the background sample set; Step 2.3 specifically refers to: Step 2.3.1: Initialize the foreground lifetime Among them, the prospective lifespan The calculation is based on the number of times a pixel is consecutively classified as a foreground pixel, with an initial value of 0. Step 2.3.2: Take the average of the differences between the gray values ​​in the 24-neighborhood and the center gray value, and initialize the adaptive sensitivity coefficient: ; in, The gray value at the center of a 5×5 image matrix. Let M = 24, where M is the gray value of each location within a 24-neighborhood. Step 2.3.3: Collect samples from the 24 neighborhood. If the following requirements are met, add them to the background sample set. If not, add the mean as a sample to the background sample model. ; in, The mean of the gray values ​​within the 5x5 image matrix. It represents the adaptive sensitivity coefficient for each location within a 24-neighborhood.

2. The moving target detection method based on the ZYNQ platform and Vibe algorithm according to claim 1, characterized in that, Step 3 specifically refers to: Step 3.1: Convert the real-time data stream in RGB888 format to YCbCr format to obtain a grayscale image; Step 3.2: Use median filtering to denoise, and obtain the denoised grayscale image; Step 3.3: First calculate the dynamic background coefficient D(x): ; in, Let be the pixel value at the i-th position in the current frame. For the background model of the first k There are 1000 sample values, where N is the number of sample values. Based on the dynamic background coefficient and the adaptive sensitivity coefficient within the background model Calculate the new adaptive sensitivity coefficient The formula is as follows: ; Where α is a fixed coefficient; Step 3.4: Calculate the difference between the pixel values ​​of the grayscale image and the sample values ​​in the background model, and count the number of samples whose absolute value of the difference is less than the adaptive sensitivity coefficient to obtain the number of matches (Match). ; ; Step 3.5: Based on the number of matches (Match) obtained in Step 3.4, classify the pixels: ; If there are 2 or fewer pixels, the pixel is considered to belong to the foreground; otherwise, it is considered to belong to the background.

3. The moving target detection method based on the ZYNQ platform and Vibe algorithm according to claim 2, characterized in that, Step 4 specifically refers to: Step 4.1: Calculate the new adaptive sensitivity coefficient at the i-th position obtained in Step 3.

3. Update to the background model; Step 4.2: Obtain the classification of each pixel in the current frame image from Step 3.5; If the pixel is classified as foreground, the foreground lifetime will be... ; If the pixel is classified as background. ; If the point is classified as background, it is determined by a random factor. To determine whether to update the sample set corresponding to the current pixel, there are... The probability of replacing a gray value in the sample set corresponding to the current pixel; Step 4.3: If the point is classified as foreground and the foreground lifetime is... If a static region is misjudged as moving, the current pixel value is replaced with a gray value from the sample set corresponding to the current pixel.

4. The moving target detection method based on the ZYNQ platform and Vibe algorithm according to claim 2, characterized in that, Step 5 specifically includes: Step 5.1: First, perform an etching operation on the test results; Step 5.2: Perform an expansion operation on the test results.

5. A system for implementing the moving target detection method based on the ZYNQ platform and Vibe algorithm as described in claim 1, characterized in that, include: The image acquisition module is used to drive the OV5460 camera to capture the external scene and convert the video data output by the camera into an AXI4-Stream data stream; The background model initialization module is used to initialize the background model, build a corresponding model for each pixel, and cache it in DDR via VDMA. The image detection module is used to classify each pixel as either foreground or background and update the background model. The morphological processing module is used to perform morphological processing on the detection results, namely, to perform corrosion and expansion operations. The image display module is used to convert the final detection result into a minimum differential signal, which can be transmitted to the display screen via an HDMI interface.

6. The system according to claim 5, characterized in that, The image acquisition module includes: The camera driver module is used to configure the OV5460 camera via the SCCB serial port protocol and drive the camera to capture external scenes. The data format conversion module is used to convert the video stream data output by the OV5460 camera into an AXI4-Stream data stream.

7. The system according to claim 5, characterized in that, The background model initialization module includes: The median filtering module is used to remove some noise from the input video stream data; The background sample set acquisition module is used to acquire samples from a 5×5 image matrix and initialize the background model.

8. The system according to claim 5, characterized in that, The image detection module includes: The foreground detection module is used to compare each pixel in the current frame with all samples in its corresponding background model sample set to determine whether the current pixel belongs to the background or the foreground. The background model update module is used for random updates to the background model sample set and for replacing samples at random locations within the background model sample set.

Citation Information

Patent Citations

  • Method and system to indicate glycemic impacts of insulin infusion pump commands

    CN104620246A

  • Multi-moving target tracking method based on improved Vibe model and BP neural network

    CN108198207A