A moving target detection method based on sparse decomposition and block multi-channel background subtraction
Through the methods of sparse decomposition and block multi-channel background subtraction, and using image segmentation and filtering algorithms to process multi-channel information, efficient detection of weak moving targets in complex backgrounds is achieved, solving the problems of unstable detection results and complex calculations in existing methods.
Patent Information
- Application Number
- CN202411730704.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2044-11-29
AI Technical Summary
Existing moving target detection methods have unstable detection results under complex and changing backgrounds, making it difficult to effectively distinguish between real targets and backgrounds. In addition, the calculations are complex and real-time performance is difficult to ensure.
The method of sparse decomposition and block multi-channel background subtraction is adopted. By obtaining the gray value matrix of image data, segmentation algorithm and filtering algorithm are used to process multi-channel information, and motion saliency and morphological saliency information are comprehensively utilized to filter out background noise and detect weak targets.
It effectively filters out background noise under complex and changing backgrounds, improves the detection accuracy and real-time performance of weak moving targets, reduces computational complexity, and solves the problem of target and background confusion.
Smart Images

Figure CN119672061B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of image processing technology and motion target detection technology, and particularly relates to a motion target detection method, apparatus, device and medium based on sparse decomposition and block multi-channel background subtraction. Background Art
[0002] Motion target detection methods are mainly used to detect moving targets in video and image frame sequences. Among them, deep learning methods generally require a large number of sample training, and the detection results are generally not stable enough for weak targets and complex and changing backgrounds; frame difference methods can detect all areas with motion, but they can neither distinguish between significant motion areas nor distinguish between real targets and moving backgrounds; optical flow methods generally have a large amount of computation, and complex and changing backgrounds will cause great interference to the detection work; sparse decomposition methods can detect areas with more significant motion, but there is also the problem of complex and changing backgrounds interfering with the detection.
[0003] Image segmentation primarily segments images by analyzing texture (gradient, skeleton, edges), grayscale, and color information. This allows for foreground objects to be morphologically distinguished from the background. However, image segmentation methods cannot effectively distinguish foreground objects morphologically when the target is small, camouflaged, or when the morphological distinction between the target and the background is not high.
[0004] The present invention aims to achieve effective filtering of background noise and effective detection of weak moving targets under complex and changing backgrounds by integrating sparse decomposition-based moving target detection methods and image morphological segmentation methods while ensuring the algorithm's operating efficiency and real-time performance.
[0005] Numerous studies have attempted to improve the performance or efficiency of moving object detection by comprehensively utilizing multi-channel, multi-modal, or multi-source information. Hauberg et al. proposed a scalable robust principal component analysis (RPCA) method based on Gaussian averages (GA) to address the data scalability issues of sparse decomposition methods. This method has also been applied to moving object detection. While this method boasts high efficiency and excellent compatibility with high-dimensional data, its actual moving object detection results are susceptible to noise. Sajid Javed et al. proposed a method for moving object detection that utilizes spatiotemporal sparse robust principal component analysis to comprehensively analyze scene information. This method utilizes multi-channel and spatiotemporal information to perform frame windowing, multiple representations, and superpixel segmentation on video data. Temporal and spatial graphs are then constructed for this information, representations, and superpixel blocks. These graphs are then combined with the input data for comprehensive analysis and sparse decomposition, ultimately yielding moving object detection results. Compared to comparison methods, this method offers significant advantages in detection accuracy and F1 performance, but the method is computationally complex and cannot guarantee real-time performance. Summary of the Invention
[0006] In view of this, an embodiment of the present application proposes a moving target detection method based on sparse decomposition and block multi-channel background subtraction, aiming at a moving target detection method based on sparse decomposition and block multi-channel background subtraction.
[0007] To achieve the above-mentioned purpose, an embodiment of the present application provides a motion target detection method based on sparse decomposition and block multi-channel background subtraction, comprising: acquiring image data to be processed, and obtaining a gray value matrix based on the image data to be processed; processing the gray value matrix using a preset first segmentation algorithm to obtain a first matrix to be processed, and obtaining a plurality of targets based on the first matrix to be processed; dividing the image data to be processed and the gray value matrix into blocks, and correspondingly obtaining each first original image block matrix and a first gray image block matrix, and based on the first original image block matrix and the first gray image block value matrix where each target is located, respectively determining each second original image block matrix and each second gray image block matrix; in the current frame, processing the gray value matrix using a preset second segmentation algorithm Process each second grayscale image block matrix to obtain each second to-be-processed matrix, and process each second to-be-processed matrix according to the preset first filtering algorithm to obtain each first binary matrix; in the current frame, obtain the red channel matrix, the green channel matrix and the blue channel matrix according to each second original image block matrix, and process the red channel matrix, the green channel matrix and the blue channel matrix based on the preset second to fourth filtering algorithms, respectively, to obtain second to fourth binary matrices; perform an AND operation on the second to fourth binary matrices to obtain a fifth binary matrix; perform an AND operation on the fifth binary matrix and the first binary matrix at the same position of the current frame to obtain a moving target detection result.
[0008] Optionally, the gray value matrix is processed using a preset first segmentation algorithm to obtain a first matrix to be processed, and multiple target points are obtained based on the first matrix to be processed, including: obtaining a first sparse decomposition motion target detection problem pre-constructed according to the gray value matrix; solving the first sparse decomposition motion target detection problem using a coarse-grained sparse decomposition operator to obtain the corresponding first matrix to be processed; obtaining each maximum point in the first matrix to be processed, and using each maximum point as a target point.
[0009] Optionally, the image data to be processed and the grayscale value matrix are divided into blocks to obtain the first original image block matrices and the first grayscale image block matrices, and based on the first original image block matrix and the first grayscale block value matrix where each target point is located, the second original image block matrices and the second grayscale image block matrices are determined respectively, including: using a fixed size to divide the image data to be processed and the grayscale value matrix into blocks to obtain the first original image block matrices and the first grayscale image block matrices; in the first original image block matrix, based on the block matrix to which each target point belongs, each first target candidate area is determined, and based on each first target candidate area, each second original image block matrix is obtained; in the first grayscale block matrix, based on the block matrix to which each target point belongs, each second target candidate area is determined, and based on each second grayscale image block matrix, each second target candidate area is obtained.
[0010] Optionally, in the current frame, each second grayscale image block matrix is processed using a preset second segmentation algorithm to obtain each second matrix to be processed, and each second matrix to be processed is processed according to a preset first filtering algorithm to obtain each first binary matrix, including: obtaining each second sparse decomposition motion target detection problem pre-constructed according to each second grayscale image block matrix; solving each second sparse decomposition motion target detection problem based on a fine-grained sparse decomposition operator to obtain each second matrix to be processed; obtaining each pre-constructed first empty matrix of the same size as each second matrix to be processed; filtering each second matrix to be processed using a preset first filtering algorithm to obtain the first binary matrix of the same size as each first empty matrix, wherein the formula used by the first filtering algorithm is:
[0011]
[0012] Where (x, y) represents the second matrix to be processed Sr i The coordinate value of a point on the first empty matrix and the coordinate value of the corresponding position, c i is a positive constant.
[0013] Optionally, in the current frame, the red channel matrix, the green channel matrix and the blue channel matrix are obtained according to each second original image block matrix, including: obtaining the red channel value, the green channel value and the blue channel value of each second target candidate area in the current frame; arranging the red channel value, the green channel value and the blue channel value based on the spatial position, and correspondingly obtaining the red channel matrix, the green channel matrix and the blue channel matrix.
[0014] Optionally, the processing of the red channel matrix, the green channel matrix, and the blue channel matrix based on the preset second to fourth filtering algorithms, respectively, to obtain second to fourth binary matrices correspondingly, includes: constructing second to fourth empty matrices with the same sizes as the red channel matrix, the green channel matrix, and the blue channel matrix, respectively; processing the red channel matrix, the green channel matrix, and the blue channel matrix based on the preset second to fourth filtering algorithms, respectively, to obtain the second to fourth binary matrices with the same sizes as the second to fourth empty matrices;
[0015] The expression of the second filtering algorithm is:
[0016]
[0017] Where R i Represents the red channel matrix, (x, y) represents the coordinate value of a point on the red channel matrix, and represents the coordinate value of the corresponding position of the second empty matrix, (x i ,y i ) is the coordinate value of the target point in the first target candidate area, a1 i 、b1 i are all positive constants, BR i Represents the second binary matrix.
[0018] The expression of the third filtering algorithm is:
[0019]
[0020] Where G i Represents the green channel matrix, (x, y) represents the coordinate value of a point on the green channel matrix, and also represents the coordinate value of the corresponding position of the third empty matrix, (x i ,y i ) is the coordinate value of the target point in the first target candidate area, a2 i 、b2 i are all positive constants, BG i represents the third binary matrix;
[0021] The expression of the fourth filtering algorithm is:
[0022]
[0023] Where B i Represents the blue channel matrix, (x,y) is B i The coordinate value of a point on the matrix is also its coordinate value on BB i The coordinate value of the corresponding position of the matrix. (x i ,y i) is the target coordinate value of the candidate target area, a3 i 、b3 i are all positive constants, BB i Represents the fourth binary matrix.
[0024] Optionally, performing an AND operation on the second binary matrix to the fourth binary matrix to obtain a fifth binary matrix includes: obtaining each fifth empty matrix having the same size as each first candidate area in the current frame; performing an AND operation on the second binary matrix to the fourth binary matrix to obtain each fifth binary matrix having the same size as each fifth empty matrix.
[0025] To achieve the above-mentioned purpose, an embodiment of the present application further provides a motion target detection device based on sparse decomposition and block multi-channel background subtraction, comprising: an acquisition module for acquiring image data to be processed, and obtaining a gray value matrix based on the image data to be processed; a target determination module for processing the gray value matrix using a preset first segmentation algorithm to obtain a first matrix to be processed, and obtaining a plurality of targets based on the first matrix to be processed; a matrix blocking module for blocking the image data to be processed and the gray value matrix, and correspondingly obtaining each first original image block matrix and a first gray image block matrix, and respectively determining each second original image block matrix and each second gray image block matrix based on the first original image block matrix and the first gray block value matrix where each target is located; a first processing module for, in the current frame, using a preset second The segmentation algorithm processes each second grayscale image block matrix to obtain each second to-be-processed matrix, and processes each second to-be-processed matrix according to the preset first filtering algorithm to obtain each first binary matrix; the second processing module is used to obtain the red channel matrix, the green channel matrix and the blue channel matrix according to each second original image block matrix in the current frame, and processes the red channel matrix, the green channel matrix and the blue channel matrix respectively based on the preset second to fourth filtering algorithms to obtain second to fourth binary matrices; the third processing module is used to perform an AND operation on the second to fourth binary matrices to obtain a fifth binary matrix; the output module is used to perform an AND operation on the fifth binary matrix and the first binary matrix at the same position of the current frame to obtain a moving target detection result.
[0026] To achieve the above-mentioned purpose, an embodiment of the present application also provides a device, including: at least one processor; and a memory communicatively connected to the at least one processor for effectively filtering out background noise and effectively detecting weak moving targets under complex and changing backgrounds; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the devices, equipment and media, including: at least one processor, so that the at least one processor can execute the aforementioned motion target detection method based on sparse decomposition and block multi-channel background subtraction.
[0027] To achieve the above-mentioned purpose, an embodiment of the present application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it can implement the above-mentioned motion target detection method based on sparse decomposition and block multi-channel background subtraction.
[0028] The embodiments of the present application propose a motion target detection method, device, electronic device and medium based on sparse decomposition and block multi-channel background subtraction, which obtains image data to be processed and obtains a gray value matrix and a non-gray value matrix based on the image data to be processed; uses a preset first segmentation algorithm to process the gray value matrix to obtain a first matrix to be processed, and obtains multiple targets based on the first matrix to be processed; divides the non-gray value matrix and the gray value matrix into blocks to obtain corresponding first original image block matrices and first gray block value matrices, and based on the first original image block matrix and the first gray block value matrix where each target point is located, respectively determines corresponding second original image block matrices and second gray image block matrices; uses a preset second segmentation algorithm to process each second gray image block matrix of the current frame to obtain corresponding second matrices to be processed, and processes each second matrix to be processed according to a preset first filtering algorithm. Each first binary matrix should be obtained; a red channel matrix, a green channel matrix and a blue channel matrix pre-constructed based on each second original image block matrix of the current frame are obtained, and the red channel matrix, the green channel matrix and the blue channel matrix are processed respectively based on the preset second filtering algorithm to the fourth filtering algorithm, and the second binary matrix to the fourth binary matrix of each non-grayscale block matrix are correspondingly obtained; and operations are performed on the corresponding second binary matrices to the fourth binary matrices respectively to obtain a fifth binary matrix; and operations are performed on each fifth binary matrix and each first binary matrix respectively to obtain a moving target detection result. The present invention can effectively solve the problem of confusion between some targets and backgrounds in terms of texture, grayscale, color, etc. through the comprehensive utilization of multi-channel information. Through the comprehensive utilization of motion saliency and morphological saliency information, the interference problem of complex and changeable background, noise, etc. on moving target detection is effectively solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1This is a process of a moving target detection method based on sparse decomposition and block multi-channel background subtraction provided in an embodiment of the present application. Figure 1 ;
[0030] Figure 2 This is a process of a moving target detection method based on sparse decomposition and block multi-channel background subtraction provided in an embodiment of the present application. Figure 2 ;
[0031] FIG3 shows an image before and after processing of a moving target detection method based on sparse decomposition and block multi-channel background subtraction provided in one embodiment of the present application;
[0032] Figure 4 It is a structural diagram of a moving target detection device based on sparse decomposition and block multi-channel background subtraction provided in one embodiment of the present application. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, each embodiment of the present application will be described in detail below with reference to the accompanying drawings. However, it will be understood by those skilled in the art that in each embodiment of the present application, many technical details are proposed to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical solutions claimed in the present application can be implemented. The division of the following embodiments is for convenience of description and should not constitute any limitation on the specific implementation of the present application. The various embodiments can be combined and referenced with each other under the premise of no contradiction.
[0034] One embodiment of the present application proposes a method for detecting a moving target based on sparse decomposition and block multi-channel background subtraction, which is applied to a processor in an electronic device, where the electronic device can be a terminal or a server. This embodiment and the following embodiments are described as examples. The following describes in detail the implementation details of the method for detecting a moving target based on sparse decomposition and block multi-channel background subtraction proposed in this embodiment. The following content is only provided for ease of understanding and is not required for implementing this solution.
[0035] like Figure 1 and 2 As shown, this embodiment proposes a moving target detection method based on sparse decomposition and block multi-channel background subtraction, which may include:
[0036] S10, acquiring image data to be processed, and obtaining a grayscale value matrix based on the image data to be processed;
[0037] Specifically, the processor inputs a video or image frame sequence X, calculates its grayscale values, and constructs a grayscale data matrix Gray based on the temporal and spatial relationships of each pixel. This matrix, a matrix with temporal and spatial relationships, is also the matrix to be decomposed by the subsequent coarse-grained sparse decomposition operator. For real-time detection tasks, a frame-by-frame windowing method can be used to complete data input and matrix construction.
[0038] S20, processing the gray value matrix using a preset first segmentation algorithm to obtain a first matrix to be processed, and obtaining a plurality of target points based on the first matrix to be processed;
[0039] In an embodiment of the present application, step S20 may include the following execution process:
[0040] S201, obtaining a first sparse decomposition moving target detection problem pre-constructed according to the gray value matrix;
[0041] S202, using a coarse-grained sparse decomposition operator to solve the first sparse decomposition moving target detection problem, and correspondingly obtaining a first matrix to be processed;
[0042] S203: Acquire each maximum point in the first matrix to be processed, and use each maximum point as a target point.
[0043] Exemplarily, the processor may construct a sparse decomposition moving target detection problem 1 based on the grayscale data matrix Gray.
[0044]
[0045] subject to Gray=Lr+Se
[0046] The processor can use the coarse-grained sparse decomposition operator (the first segmentation algorithm) to solve the problem, and obtain the coarse-grained low-rank matrix Lr and the coarse-grained sparse matrix Se (the first matrix to be processed). Then, several maximum points of the Se matrix are used as targets, and the coordinates of the i-th target point are recorded as (x i ,y i ).
[0047] S30, dividing the image data to be processed and the grayscale value matrix into blocks to obtain corresponding first original image block matrices and first grayscale image block matrices, and determining corresponding second original image block matrices and second grayscale image block matrices based on the first original image block matrix and the first grayscale image block matrix where each target point is located;
[0048] In an embodiment of the present application, step S30 may include the following execution process:
[0049] S301, dividing the image data to be processed and the gray value matrix into blocks using a fixed size to obtain corresponding first original image block matrices and first gray image block matrices;
[0050] S302: In the first original image block matrix, based on the block matrix to which each target point belongs, determine each first target candidate region, and obtain each second original image block matrix corresponding to each first target candidate region;
[0051] S303 , in the first grayscale block matrix, based on the block matrix to which each target point belongs, determining each second target candidate region, and obtaining each second grayscale image block matrix corresponding to each second target candidate region.
[0052] Specifically, the processor divides the input data X and the data matrix Gray into blocks of fixed size, and takes the block where the target point is located as the target candidate area (the first target candidate area and the second target candidate area), and the block where the i-th target point is located is recorded as B i , its gray matrix is divided into Gray i (Second grayscale image block matrix);
[0053] S40: In the current frame, using a preset second segmentation algorithm to process each of the second grayscale image block matrices to obtain corresponding second matrices to be processed, and processing each of the second matrices to be processed according to a preset first filtering algorithm to obtain corresponding first binary matrices;
[0054] In an embodiment of the present application, step S40 may include the following execution process:
[0055] S401, obtaining each second sparse decomposition moving target detection problem pre-constructed according to each second grayscale image block matrix;
[0056] S402, solving each of the second sparse decomposition moving target detection problems based on a fine-grained sparse decomposition operator to obtain each of the second to-be-processed matrices;
[0057] S403: Obtain pre-constructed first empty matrices of the same size as the second matrices to be processed;
[0058] S404: Filter each of the second to-be-processed matrices using a preset first filtering algorithm to obtain a first binary matrix having the same size as each of the first empty matrices. The formula used by the first filtering algorithm is:
[0059]
[0060] Where (x, y) represents the second matrix to be processed Sr iThe coordinate value of a point on the first empty matrix and the coordinate value of the corresponding position, c i is a positive constant.
[0061] For example, the processor uses Gray i Construct sparse decomposition for the matrix to be solved for motion target detection problem 2:
[0062]
[0063] subject to Gray i =Le i +Sr i
[0064] The processor uses the fine-grained sparse decomposition operator (the second segmentation algorithm) to solve the problem and obtains the fine-grained low-rank matrix Le and the fine-grained sparse matrix Sr. To distinguish, the matrices corresponding to the i-th block are Le i and Sr i (The second matrix to be processed).
[0065] The processor constructs a binary matrix BS of the same size as the i-th candidate region i , for the corresponding Sr i The matrix performs the following filtering operations:
[0066]
[0067] Where (x,y) is Sr i The coordinate value of a point on the matrix is also its coordinate value in BS i The coordinate value of the corresponding position of the matrix, c i is a positive constant. For points that meet the requirements, the BS i The value of the point at the corresponding position of the matrix is set to 1, otherwise its BS i The values of the points at the corresponding positions of the matrix are set to 0, thus obtaining the first binary matrix BS i (x,y).
[0068] S50. In the current frame, a red channel matrix, a green channel matrix, and a blue channel matrix are obtained according to each of the second original image block matrices. The red channel matrix, the green channel matrix, and the blue channel matrix are processed respectively based on the preset second to fourth filtering algorithms to obtain second to fourth binary matrices respectively. An AND operation is performed on the second to fourth binary matrices to obtain a fifth binary matrix.
[0069] In an embodiment of the present application, step S50 may include the following execution process:
[0070] S501, obtaining the red channel value, the green channel value, and the blue channel value of each second target candidate region in the current frame;
[0071] S502, arranging the red channel value, the green channel value, and the blue channel value based on spatial position, and obtaining the red channel matrix, the green channel matrix, and the blue channel matrix accordingly.
[0072] S503, constructing a second empty matrix to a fourth empty matrix having the same size as the red channel matrix, the green channel matrix, and the blue channel matrix respectively;
[0073] S504: Process the red channel matrix, the green channel matrix, and the blue channel matrix respectively based on the preset second to fourth filtering algorithms, and obtain the second to fourth binary matrices with the same sizes as the second to fourth empty matrices;
[0074] The expression of the second filtering algorithm is:
[0075]
[0076] Where R i Represents the red channel matrix, (x, y) represents the coordinate value of a point on the red channel matrix, and represents the coordinate value of the corresponding position of the second empty matrix, (x i ,y i ) is the coordinate value of the target point in the first target candidate area, a1 i 、b1 i are all positive constants, BR i Represents the second binary matrix.
[0077] The expression of the third filtering algorithm is:
[0078]
[0079] Where G i Represents the green channel matrix, (x, y) represents the coordinate value of a point on the green channel matrix, and also represents the coordinate value of the corresponding position of the third empty matrix, (x i ,y i ) is the coordinate value of the target point in the first target candidate area, a2 i 、b2 i are all positive constants, BG i represents the third binary matrix;
[0080] The expression of the fourth filtering algorithm is:
[0081]
[0082] Where B i Represents the blue channel matrix, (x,y) is B i The coordinate value of a point on the matrix is also its coordinate value on BB i The coordinate value of the corresponding position of the matrix. (x i ,y i ) is the target coordinate value of the candidate target area, a3 i 、b3 i are all positive constants, BB i Represents the fourth binary matrix.
[0083] For example, the red channel value of the i-th target candidate area in the current frame is calculated by inputting data X, and the red matrix R is constructed according to the spatial relationship. i After that, construct a second binary matrix BR of the same size as the i-th candidate region i .
[0084] For points that meet the requirements, their BR i The value of the point at the corresponding position of the matrix is set to 1, otherwise its BR i The values of the points at the corresponding positions in the matrix are set to 0.
[0085] The processor calculates the green channel value of the i-th target candidate area in the current frame through the input data X, and constructs the green matrix G based on the spatial relationship i After that, construct the third binary matrix BG of the same size as the i-th candidate region i .
[0086] For points that meet the requirements, their BG i The value of the point at the corresponding position of the matrix is set to 1, otherwise its BG i The values of the points at the corresponding positions in the matrix are set to 0.
[0087] The processor calculates the blue channel value of the i-th target candidate area in the current frame through the input data X, and constructs the blue matrix B based on the spatial relationship i After that, construct the fourth binary matrix BB of the same size as the i-th candidate region i .
[0088] For points that meet the requirements, the processor determines its BB i The value of the point at the corresponding position of the matrix is set to 1, otherwise its BB i The values of the points at the corresponding positions in the matrix are set to 0.
[0089] The processor constructs a binary matrix BC of the same size as the i-th candidate region i , for the corresponding BR i , BG i ,BB i Perform related OR operations and record the results in BCi .
[0090] S60 , performing an AND operation on the fifth binary matrix and the first binary matrix at the same position in the current frame to obtain a moving target detection result.
[0091] For example, a binary matrix Result of the same size as the i-th candidate region is constructed i , for the corresponding BC i ,BS i Perform correlation and operation, and output the final result of the current frame as Result i .
[0092] Referring to FIG3 , FIG3( a ) is a video frame image before detection provided by the present application, and FIG3( b ) is a detected target image provided by the present application.
[0093] The step division of the above various methods is only for the purpose of clear description. During implementation, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this application; adding insignificant modifications or introducing insignificant designs to the algorithm or process without changing the core design of the algorithm and process are all within the scope of protection of this application.
[0094] It is important to note that the above steps can be operated in series or in parallel, and can be combined in groups of several steps. When operating in series, changing the order of these steps does not affect the test results. Generally, when computer performance is sufficient, parallel operations can significantly improve computational efficiency and shorten calculation time.
[0095] The beneficial effects of the method of the present invention mainly include:
[0096] (1) The present invention makes full use of the sparse decomposition method to detect motion salient areas and the morphological segmentation method to effectively achieve large-scale subtraction of complex changing backgrounds, thereby achieving effective detection of weak moving targets under complex changing backgrounds.
[0097] (2) In general, the introduction of image segmentation methods will generate a large amount of additional calculations, which seriously affects the operating efficiency of the target detection method. The present invention avoids complex calculations such as gradients and operators with high computational load while ensuring the effectiveness of filtering and background subtraction and high accuracy of detection results. At the same time, the present invention adopts a strategy of first performing region screening and then performing block operations, which can avoid a large amount of redundant calculations for non-candidate areas and achieve real-time operation on computers with general performance.
[0098] (3) Through the comprehensive utilization of multi-channel information, the problem of confusion between some targets and backgrounds in terms of texture, grayscale, color, etc. can be effectively solved; through the comprehensive utilization of motion saliency and morphological saliency information, the problem of interference of complex and changing backgrounds, noise, etc. on the detection of moving targets can be effectively solved.
[0099] (4) Through the parallel or operational design of the present invention, while fully ensuring the effective reduction of background noise, when there is some missing or erroneous information in the input data in the red, green, blue and other channels, it will not affect the detection work.
[0100] refer to Figure 4 On the basis of the above embodiments, the present invention further provides a moving target detection device based on sparse decomposition and block multi-channel background subtraction. The moving target detection device 100 may include: an acquisition module 1001 for acquiring image data to be processed, and obtaining a gray value matrix based on the image data to be processed; a target determination module 1002 for processing the gray value matrix using a preset first segmentation algorithm to obtain a first matrix to be processed, and obtaining a plurality of targets based on the first matrix to be processed; a matrix blocking module 1003 for blocking the image data to be processed and the gray value matrix to obtain the first original image block matrix and the first gray image block matrix respectively, and based on the first original image block matrix and the first gray block value matrix where each target is located, respectively determine the second original image block matrix and the second gray image block matrix respectively; a first processing module 1004 for, in the current frame, The preset second segmentation algorithm is used to process each second grayscale image block matrix to obtain each second matrix to be processed, and the preset first filtering algorithm is used to process each second matrix to be processed to obtain each first binary matrix; the second processing module 1005 is used to obtain the red channel matrix, the green channel matrix and the blue channel matrix according to each second original image block matrix in the current frame, and process the red channel matrix, the green channel matrix and the blue channel matrix based on the preset second to fourth filtering algorithms respectively to obtain the second to fourth binary matrices; the third processing module 1006 is used to perform an AND operation on the second to fourth binary matrices to obtain a fifth binary matrix; the output module 1007 is used to perform an AND operation on the fifth binary matrix and the first binary matrix at the same position of the current frame to obtain a moving target detection result.
[0101] It is not difficult to find that this embodiment is a system embodiment corresponding to the above-mentioned method embodiment, and this embodiment can be implemented in conjunction with the above-mentioned method embodiment. The relevant technical details and technical effects mentioned in the above-mentioned embodiments are still valid in this embodiment, and to reduce repetition, they are not repeated here. Accordingly, the relevant technical details mentioned in this embodiment can also be applied to the above-mentioned embodiments.
[0102] It is worth mentioning that all modules involved in this embodiment are logical modules. In actual applications, a logical unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. In addition, to highlight the innovation of this application, this embodiment does not introduce units that are not closely related to solving the technical problems proposed by this application. However, this does not mean that other units do not exist in this embodiment.
[0103] Another embodiment of the present application proposes an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the motion target detection method based on sparse decomposition and block multi-channel background subtraction in the above-mentioned embodiments.
[0104] The memory and processor are connected using a bus, which can include any number of interconnected buses and bridges. The bus connects various circuits of one or more processors and memories. The bus can also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits. These are all well known in the art and therefore will not be described further in this article. The bus interface provides an interface between the bus and the transceiver. The transceiver can be a single component or multiple components, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. Data processed by the processor is transmitted on a wireless medium via an antenna. Furthermore, the antenna also receives data and transmits it to the processor.
[0105] The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory can be used to store data used by the processor when performing operations.
[0106] Another embodiment of the present application relates to a computer-readable storage medium storing a computer program, which implements the above method embodiment when executed by a processor.
[0107] That is, those skilled in the art will understand that all or part of the steps in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a program, which is stored in a storage medium and includes a number of instructions for causing a device (which may be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: a USB flash drive, a mobile hard drive, a ROM (Read-Only Memory), a RAM (Random Access Memory), a magnetic disk, or an optical disk, etc., various media that can store program code.
[0108] Those skilled in the art will appreciate that the above embodiments are specific embodiments for implementing the present application, and that in actual applications, various changes may be made thereto in form and detail without departing from the spirit and scope of the present application.
Claims
1. A moving target detection method based on sparse decomposition and block multi-channel background subtraction, characterized in that: include: Acquiring image data to be processed, and obtaining a grayscale value matrix based on the image data to be processed; Processing the gray value matrix using a preset first segmentation algorithm to obtain a first matrix to be processed, and obtaining a plurality of target points based on the first matrix to be processed; Dividing the image data to be processed and the grayscale value matrix into blocks to obtain first original image block matrices and first grayscale image block matrices, and determining second original image block matrices and second grayscale image block matrices based on the first original image block matrix and the first grayscale image block matrix where each target point is located; In the current frame, each second grayscale image block matrix is processed using a preset second segmentation algorithm to obtain corresponding second matrices to be processed, and each second matrices to be processed is processed according to a preset first filtering algorithm to obtain corresponding first binary matrices; In the current frame, a red channel matrix, a green channel matrix, and a blue channel matrix are obtained according to each of the second original image block matrices, and the red channel matrix, the green channel matrix, and the blue channel matrix are processed respectively based on the preset second to fourth filtering algorithms to obtain second to fourth binary matrices respectively, and an AND operation is performed on the second to fourth binary matrices to obtain a fifth binary matrix; Performing an AND operation on the fifth binary matrix and the first binary matrix at the same position of the current frame to obtain a moving target detection result; The step of dividing the image data to be processed and the grayscale value matrix into blocks to obtain the first original image block matrices and the first grayscale image block matrices, and determining the second original image block matrices and the second grayscale image block matrices based on the first original image block matrix and the first grayscale block value matrix where each target point is located includes: Dividing the to-be-processed image data and the grayscale value matrix into blocks using a fixed size, and correspondingly obtaining each of the first original image block matrices and the first grayscale image block matrices; In the first original image block matrix, determining each first target candidate region based on the block matrix to which each target point belongs, and obtaining each second original image block matrix based on the first target candidate region; In the first grayscale block matrix, each second target candidate region is determined based on the block matrix to which each target point belongs, and each second grayscale image block matrix is obtained according to the correspondence of each second target candidate region.
2. The moving target detection method based on sparse decomposition and block multi-channel background subtraction according to claim 1, characterized in that: The step of processing the gray value matrix using a preset first segmentation algorithm to obtain a first matrix to be processed, and obtaining a plurality of target points based on the first matrix to be processed, includes: Obtain a first sparse decomposition moving target detection problem pre-constructed according to the gray value matrix; Solving the first sparse decomposition moving target detection problem using a coarse-grained sparse decomposition operator to obtain a first matrix to be processed; Acquire each maximum point in the first matrix to be processed, and use each maximum point as a target point.
3. The moving target detection method based on sparse decomposition and block multi-channel background subtraction according to claim 1, characterized in that: The method of processing each second grayscale image block matrix in the current frame using a preset second segmentation algorithm to obtain corresponding second matrices to be processed, and processing each second matrices to be processed according to a preset first filtering algorithm to obtain corresponding first binary matrices includes: Obtaining each second sparse decomposition moving target detection problem pre-constructed according to each second grayscale image block matrix; Solving each of the second sparse decomposition moving target detection problems based on a fine-grained sparse decomposition operator to obtain each of the second to-be-processed matrices; Obtaining pre-constructed first empty matrices of the same size as the second matrices to be processed; Each of the second to-be-processed matrices is filtered using a preset first filtering algorithm to obtain the first binary matrix having the same size as each of the first empty matrices. The formula used by the first filtering algorithm is: Where, represent The coordinate value of a point on the matrix and the coordinate value of the corresponding position of the first empty matrix, is a positive constant.
4. The moving target detection method based on sparse decomposition and block multi-channel background subtraction according to claim 1, characterized in that: The step of obtaining a red channel matrix, a green channel matrix, and a blue channel matrix according to each of the second original image block matrices in the current frame includes: Obtaining a red channel value, a green channel value, and a blue channel value of each of the second target candidate regions in the current frame; The red channel value, the green channel value, and the blue channel value are arranged based on spatial positions to obtain the red channel matrix, the green channel matrix, and the blue channel matrix accordingly.
5. The moving target detection method based on sparse decomposition and block multi-channel background subtraction according to claim 1, characterized in that: The second to fourth filtering algorithms based on the preset filtering algorithms process the red channel matrix, the green channel matrix, and the blue channel matrix respectively, and obtain second to fourth binary matrices respectively, including: Constructing second to fourth empty matrices having the same sizes as the red channel matrix, the green channel matrix, and the blue channel matrix, respectively; Processing the red channel matrix, the green channel matrix, and the blue channel matrix respectively based on the preset second to fourth filtering algorithms, and correspondingly obtaining the second to fourth binary matrices having the same sizes as the second to fourth empty matrices; The expression of the second filtering algorithm is: Where, represents the red channel matrix, Represents the coordinate value of a point on the red channel matrix, and represents The coordinate value of the corresponding position, is the coordinate value of the target point in the first target candidate area, 、 are all positive constants, represents the second binary matrix; The expression of the third filtering algorithm is: Where, represents the green channel matrix, Represents the coordinate value of a point on the green channel matrix, and also represents The coordinate value of the corresponding position, is the coordinate value of the target point in the first target candidate area, 、 are all positive constants, represents the third binary matrix; The expression of the fourth filtering algorithm is: Where, represents the blue channel matrix, is the coordinate value of a point in the blue channel, and is also its The coordinate value of the corresponding position of the matrix, is the target point coordinate value of the target candidate area, 、 are all positive constants, Represents the fourth binary matrix.
6. The moving target detection method based on sparse decomposition and block multi-channel background subtraction according to claim 5, characterized in that: The performing an AND operation on the second binary matrix to the fourth binary matrix to obtain a fifth binary matrix includes: Obtain each fifth empty matrix of the same size as the target candidate region in the current frame; An AND operation is performed on the second binary matrix to the fourth binary matrix to obtain the corresponding fifth binary matrices having the same size as the fifth empty matrices.
7. A moving target detection device based on sparse decomposition and block multi-channel background subtraction, which executes the moving target detection method based on sparse decomposition and block multi-channel background subtraction according to any one of claims 1 to 6, characterized in that: include: An acquisition module, configured to acquire image data to be processed and obtain a grayscale value matrix based on the image data to be processed; a target determination module, configured to process the gray value matrix using a preset first segmentation algorithm to obtain a first matrix to be processed, and obtain a plurality of target points based on the first matrix to be processed; a matrix blocking module, configured to block the image data to be processed and the grayscale value matrix to obtain first original image blocking matrices and first grayscale image blocking matrices, and to determine second original image blocking matrices and second grayscale image blocking matrices based on the first original image blocking matrix and the first grayscale blocking value matrix where each target point is located; a first processing module configured to process, in a current frame, each of the second grayscale image block matrices using a preset second segmentation algorithm to obtain corresponding second matrices to be processed, and to process each of the second matrices to be processed according to a preset first filtering algorithm to obtain corresponding first binary matrices; a second processing module, configured to obtain, in a current frame, a red channel matrix, a green channel matrix, and a blue channel matrix according to each of the second original image block matrices, and process the red channel matrix, the green channel matrix, and the blue channel matrix respectively based on a preset second to fourth filtering algorithms to obtain second to fourth binary matrices, respectively; a third processing module, configured to perform an AND operation on the second binary matrix to the fourth binary matrix to obtain a fifth binary matrix; The output module is used to perform an AND operation on the fifth binary matrix and the first binary matrix at the same position of the current frame to obtain a moving target detection result.
8. An electronic device, characterized in that: include: at least one processor; and, a memory communicatively coupled to the at least one processor; In which, the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the motion target detection method based on sparse decomposition and block multi-channel background subtraction as described in any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the moving target detection method based on sparse decomposition and block multi-channel background subtraction according to any one of claims 1 to 6 can be implemented.
Citation Information
Patent Citations
Moving small target detection method based on high-time-phase satellite-borne SAR sequential image
CN113570632A
Sonar image small target detection method based on matrix decomposition
CN116403100A