Moving target detection method based on sparse decomposition and block multi-channel background subtraction
By using sparse decomposition and blocked multi-channel background subtraction, the problems of background noise filtering and weak motion object detection under complex and variable backgrounds are solved, and efficient and real-time motion object detection is achieved.
Patent Information
- Application Number
- CN202411730704.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2044-11-29
AI Technical Summary
Existing motion object detection methods are difficult to effectively filter out background noise and detect weak motion objects under complex and changing backgrounds.
The motion object detection method based on sparse decomposition and blocked multi-channel background subtraction is adopted. By acquiring the image data to be processed, the gray value matrix processing and blocking processing are performed, and combined with the multi-channel filtering algorithm, the effective filtering of background noise and the detection of weak motion objects are achieved.
Effectively filter out background noise under complex and variable backgrounds, improve the accuracy of detection of weak motion targets, and ensure the real-time and efficient algorithm.
Smart Images

Figure CN119672061A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of image processing technology and moving target detection technology, and in particular, relates to a moving target detection method, device, equipment 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 real targets and moving backgrounds; optical flow methods generally have a large amount of calculation, 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 mainly analyzes the image texture (gradient, skeleton, edge), grayscale and color information to segment the image region, and then obtains the foreground target that is morphologically distinguished from the background. However, when the target is relatively small, the target is camouflaged such as camouflage, or the morphological distinction between the target and the background is not high, the image segmentation method cannot effectively distinguish the foreground target in the morphological sense.
[0004] The present invention aims to achieve effective filtering of background noise and effective detection of small 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] There have been many studies that attempt to comprehensively utilize multi-channel, multi-modal or multi-source information to improve the results or efficiency of moving target detection. Among them, Hauberg et al. proposed a scalable robust principal component analysis method based on Gaussian mean (Grassmann Averages for RPCA, GA) to solve the data scalability problem of sparse decomposition methods. It has also been applied in moving target detection. This method has extremely high operating efficiency and good compatibility with high-dimensional data, but the actual moving target detection results are easily interfered by noise. Sajid Javed et al. proposed a method for comprehensively analyzing scene information using spatiotemporal structure sparse robust principal component analysis to achieve moving target detection. They proposed a method that comprehensively utilizes multi-channel and spatiotemporal information to perform frame windowing, multiple representations and superpixel segmentation on video data, and then establishes time graphs and spatial graphs for these information, representations and superpixel blocks respectively. Then, the time graph, spatial graph and input data are comprehensively analyzed and sparsely decomposed to finally obtain the moving target detection results. Compared with the comparison method, this method has obvious advantages in detection result accuracy and F1 index, but the method is complex in calculation and real-time performance is difficult to guarantee. 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, including: 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 multiple target points based on the first matrix to be processed; dividing the image data to be processed and the gray value matrix into blocks to obtain the first original image block matrices and the first gray image block matrices respectively, and based on the first original image block matrix and the first gray image block value matrix where each target point is located, respectively determining the second original image block matrices and the second gray image block matrices; in the current frame, processing the gray value matrix using a preset second segmentation algorithm Process each of the second grayscale image block matrices to obtain corresponding second matrices to be processed, and process each of the second matrices to be processed according to the preset first filtering algorithm to obtain corresponding first binary matrices; in the current frame, obtain the red channel matrix, the green channel matrix and the 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 based on the preset second filtering algorithm to the fourth filtering algorithm, respectively, to obtain second binary matrices to fourth binary matrices; perform an AND operation on the second binary matrices to the 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 a corresponding first matrix to be processed; obtaining each maximum point in the first matrix to be processed, and using each of the maximum points as a target point.
[0009] Optionally, the image data to be processed and the gray value matrix are divided into blocks to obtain the first original image block matrices and the first gray image block matrices, and based on the first original image block matrix and the first gray image block value matrix where each target point is located, the second original image block matrices and the second gray image block matrices are determined respectively, including: using a fixed size to divide the image data to be processed and the gray value matrix into blocks to obtain the first original image block matrices and the first gray 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 region is determined, and based on each first target candidate region, each second original image block matrix is obtained; in the first gray image block matrix, based on the block matrix to which each target point belongs, each second target candidate region is determined, and based on each second gray image block matrix, each second target candidate region 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 of the second original image block matrices, including: obtaining the red channel values, the green channel values and the blue channel values of each of the second target candidate areas in the current frame; arranging the red channel values, the green channel values and the blue channel values based on spatial position, and correspondingly obtaining the red channel matrix, the green channel matrix and the blue channel matrix.
[0014] Optionally, 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 correspondingly, including: 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 respectively based on the preset second to fourth filtering algorithms 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] In the formula, 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] In the formula, 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] In the formula, 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 in BB i The coordinate value of the corresponding position of the matrix. (x i ,y i) is the target point coordinate value of the target candidate 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 fifth empty matrices having the same size as the first candidate regions in the current frame; performing an AND operation on the second binary matrix to the fourth binary matrix to obtain corresponding fifth binary matrices having the same size as the fifth empty matrices.
[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, used to acquire image data to be processed, and obtain a gray value matrix based on the image data to be processed; a target determination module, used to process the gray value matrix using a preset first segmentation algorithm to obtain a first matrix to be processed, and obtain multiple targets based on the first matrix to be processed; a matrix blocking module, used to block the image data to be processed and the gray value matrix, and obtain the first original image block matrix and the first gray image block matrix respectively, and determine the second original image block matrix and the second gray image block matrix respectively based on the first original image block matrix and the first gray block value matrix where each target is located; a first processing module, used to, in the current frame, use the preset second The segmentation algorithm processes each of the second grayscale image block matrices to obtain corresponding second matrices to be processed, and processes each of the second matrices to be processed according to the preset first filtering algorithm to obtain corresponding first binary matrices; the second processing module is used to obtain the red channel matrix, the green channel matrix and the blue channel matrix according to each of the second original image block matrices 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 filtering algorithm to the fourth filtering algorithm to obtain corresponding second binary matrices to the fourth binary matrices; the third processing module is used to perform an AND operation on the second binary matrices to the 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 realizing effective filtering of background noise and effective detection of weak moving targets under complex and changing backgrounds; wherein the memory stores instructions executable 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 moving target detection method based on sparse decomposition and block multi-channel background subtraction.
[0027] To achieve the above objectives, 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 first original image block matrices and first gray block value matrices, and determines second original image block matrices and second gray image block matrices based on the first original image block matrix and the first gray block value matrix where each target is located; uses a preset second segmentation algorithm to process each second gray image block matrix of the current frame to obtain each second matrix to be processed, and processes each second matrix to be processed according to a preset first filtering algorithm. The first binary matrices should be obtained; the red channel matrix, green channel matrix and blue channel matrix pre-constructed based on the second original image block matrices of the current frame are obtained, and the red channel matrix, green channel matrix and 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; the corresponding second binary matrix to the fourth binary matrix are respectively ANDed to obtain the fifth binary matrix; the fifth binary matrix and the first binary matrix are respectively ANDed to obtain the 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, and effectively solve the interference problem of complex and changeable background, noise, etc. on the moving target detection through the comprehensive utilization of motion saliency and morphological saliency information. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1The 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 is Figure 1 ;
[0030] Figure 2 The 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 is Figure 2 ;
[0031] FIG3 is 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 schematic 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] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the embodiments of the present application will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in the present application, many technical details are proposed in order 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 scheme claimed in the present application can also be implemented. The division of the following embodiments is for the convenience of description, and the specific implementation of the present application should not be construed as any limitation, and the various embodiments can be combined and referenced with each other under the premise of no contradiction.
[0034] An embodiment of the present application proposes a moving target detection method based on sparse decomposition and block multi-channel background subtraction, which is applied to a processor in an electronic device, wherein the electronic device can be a terminal or a server, and this embodiment and the following embodiments are all described as examples. The implementation details of the moving target detection method based on sparse decomposition and block multi-channel background subtraction proposed in this embodiment are specifically described below. The following content is only the implementation details provided for the convenience of understanding and is not necessary for the implementation of 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 gray value matrix based on the image data to be processed;
[0037] Specifically, the video or image frame sequence X is input into the processor, its grayscale value is calculated, and the grayscale value is constructed into a grayscale data matrix Gray according to the time sequence and the spatial position relationship of each pixel. This matrix is a matrix with time and space relationship, and is also the matrix to be decomposed by the subsequent coarse-grained sparse decomposition operator. For real-time detection tasks, the frame-by-frame windowing method can be used to complete data input and matrix construction.
[0038] S20, using a preset first segmentation algorithm to process the gray value matrix 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, obtaining each maximum point in the first matrix to be processed, and taking 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 gray value matrix into blocks, and correspondingly obtaining each of the first original image block matrices and the first gray image block matrices, and correspondingly determining each of the second original image block matrices and each of the second gray image block matrices based on the first original image block matrix and the first gray 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 to-be-processed image data and the gray value matrix into blocks using a fixed size, and correspondingly obtaining the first original image block matrix and the first gray image block matrix;
[0050] S302, in the first original image block matrix, based on the block matrix to which each of the target points belongs, determining each of the first target candidate regions, and obtaining each of the second original image block matrices corresponding to each of the first target candidate regions;
[0051] S303, in the first grayscale block matrix, based on the block matrix to which each of the target points belongs, determine each second target candidate region, and obtain each second grayscale image block matrix according to the correspondence of each of the second target candidate regions.
[0052] Specifically, the processor divides the input data X and the data matrix Gray into blocks with a 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 , whose grayscale 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 using a preset first filtering algorithm to process each of the second matrices to be processed 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 of the second sparse decomposition moving target detection problems pre-constructed according to each of the second grayscale image block matrices;
[0056] S402, solving each of the second sparse decomposition moving target detection problems based on a fine-grained sparse decomposition operator, and correspondingly obtaining each of the second to-be-processed matrices;
[0057] S403, obtaining 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 the first binary matrix having the same size as each of the first empty matrices, wherein 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 moving target detection problem 2:
[0062]
[0063] subject to Gray i =Le i +Sr i
[0064] The processor uses a fine-grained sparse decomposition operator (the second segmentation algorithm) to solve the problem and obtains a fine-grained low-rank matrix Le and a fine-grained sparse matrix Sr. To distinguish, the matrices corresponding to the i-th block are Le and Sr. 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, obtaining a red channel matrix, a green channel matrix, and a blue channel matrix according to each of the second original image block matrices, and processing 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 correspondingly, and performing an AND operation 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, acquiring the red channel value, the green channel value and the blue channel value of each of the second target candidate regions in the current frame;
[0071] S502: Arrange the red channel value, the green channel value and the blue channel value based on the spatial position to obtain 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, based on the preset second to fourth filtering algorithms, respectively process the red channel matrix, the green channel matrix, and the blue channel matrix, and correspondingly obtain the second binary matrix to the fourth binary matrix having the same size as the second empty matrix to the fourth empty matrix;
[0074] The expression of the second filtering algorithm is:
[0075]
[0076] In the formula, 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] In the formula, 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] In the formula, 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 in BB i The coordinate value of the corresponding position of the matrix. (x i ,y i ) is the target point coordinate value of the target candidate 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 the 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 according to the spatial relationship i After that, construct a 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 a 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 correlation or operation and record the result in BCi .
[0090] S60, 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.
[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 FIG. 3 , FIG. 3( a ) is a video frame image before detection provided by the present application, and FIG. 3( b ) is a detected target image provided by the present application.
[0093] The step division of the above methods is only for clear description. When implemented, 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 to the algorithm or process or introducing insignificant designs without changing the core design of the algorithm and process are all within the scope of protection of this application.
[0094] It should be noted that the above steps can be operated in series or in parallel, and can also be combined in series or in parallel in groups of several steps. When operating in series, changing the order of these steps does not affect the test results. Generally, when the computer performance is sufficient, parallel operation can significantly improve the operation efficiency and shorten the 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-significant areas and the morphological segmentation method to effectively achieve large-scale subtraction of complex and changing backgrounds, thereby achieving effective detection of weak moving targets under complex and 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 with high computational loads such as gradients and operators while ensuring the effectiveness of filtering and background subtraction and the 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 regions 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 changeable background, noise, etc. on moving target detection 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 partial information missing or error 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, and respectively determining the second original image block matrix and the 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 1004 for, in the current frame, The second grayscale image block matrices are processed by a preset second segmentation algorithm to obtain corresponding second matrices to be processed, and the second matrices to be processed are processed according to a preset first filtering algorithm to obtain corresponding first binary matrices; the second processing module 1005 is used to obtain a red channel matrix, a green channel matrix and a blue channel matrix according to the second original image block matrices in the current frame, and process the red channel matrix, the green channel matrix and the blue channel matrix based on the preset second filtering algorithm to the fourth filtering algorithm, respectively, to obtain 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 method embodiment, and this embodiment can be implemented in conjunction with the above method embodiment. The relevant technical details and technical effects mentioned in the above embodiments are still valid in this embodiment, and in order to reduce repetition, they are not repeated here. Accordingly, the relevant technical details mentioned in this embodiment can also be applied in the above embodiments.
[0102] It is worth mentioning that all modules involved in this embodiment are logic modules. In practical applications, a logic unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. In addition, in order to highlight the innovative part of this application, this embodiment does not introduce units that are not closely related to solving the technical problems proposed by this application, but this does not mean that there are no other units 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 so that the at least one processor can execute the motion target detection method based on sparse decomposition and block multi-channel background subtraction in the above-mentioned embodiments.
[0104] Among them, the memory and the processor are connected in a bus manner, and the bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors and memories together. The bus can also connect various other circuits such as peripheral devices, voltage regulators and power management circuits together, which are all well known in the art, so this article will not describe them further. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. The data processed by the processor is transmitted on the wireless medium through the antenna, and further, the antenna also receives the data and transmits the data 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 can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including a number of instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, ROM (Read-Only Memory), RAM (Random Access Memory), disk or optical disk and other media that can store program codes.
[0108] Those skilled in the art will appreciate that the above embodiments are specific embodiments for implementing the present application, and 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: Acquire image data to be processed, and obtain 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 target points based on the first matrix to be processed; The image data to be processed and the gray value matrix are divided into blocks to obtain first original image block matrices and first gray image block matrices, and based on the first original image block matrix and the first gray image block matrix where each target point is located, second original image block matrices and second gray image block matrices are respectively determined; In the current frame, each of the second grayscale image block matrices is processed using a preset second segmentation algorithm to obtain corresponding second matrices to be processed, and each of the 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; An AND operation is performed 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.
2. The moving target detection method based on sparse decomposition and block multi-channel background subtraction according to claim 1 is characterized in that: The method 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: Obtaining 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, and correspondingly obtaining 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 2 is characterized in that: The method 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: The image data to be processed and the gray value matrix are divided into blocks using a fixed size to obtain the first original image block matrix and the first gray image block matrix respectively; In the first original image block matrix, each first target candidate region is determined based on the block matrix to which each target point belongs, and each second original image block matrix is obtained based on the correspondence of each 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.
4. The moving target detection method based on sparse decomposition and block multi-channel background subtraction according to claim 1 is characterized in that: In the current frame, each second grayscale image block matrix is processed by a preset second segmentation algorithm to obtain corresponding second matrices to be processed, and each second matrices to be processed are processed according to a preset first filtering algorithm to obtain corresponding first binary matrices, including: 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, and correspondingly obtaining 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, wherein the formula used by the first filtering algorithm is: 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.
5. The moving target detection method based on sparse decomposition and block multi-channel background subtraction according to claim 3 is 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, and the red channel matrix, the green channel matrix and the blue channel matrix are obtained accordingly.
6. The moving target detection method based on sparse decomposition and block multi-channel background subtraction according to claim 3 is 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 correspondingly, 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; Based on the preset second to fourth filtering algorithms, the red channel matrix, the green channel matrix, and the blue channel matrix are processed respectively, and the second to fourth binary matrices having the same size as the second to fourth empty matrices are correspondingly obtained; The expression of the second filtering algorithm is: In the formula, 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. The expression of the third filtering algorithm is: In the formula, 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; The expression of the fourth filtering algorithm is: In the formula, 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 in BB i The coordinate value of the corresponding position of the matrix. (x i ,y i ) is the target point coordinate value of the target candidate area, a3 i 、b3 i are all positive constants, BB i Represents the fourth binary matrix.
7. The moving target detection method based on sparse decomposition and block multi-channel background subtraction according to claim 6 is 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 in the current frame that has the same size as the target candidate region; An AND operation is performed on the second binary matrix to the fourth binary matrix to obtain the fifth binary matrices having the same size as the fifth empty matrices.
8. A moving target detection device based on sparse decomposition and block multi-channel background subtraction, characterized in that: include: An acquisition module, used 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, used 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 target points based on the first matrix to be processed; A matrix block module, used for dividing the image data to be processed and the gray value matrix into blocks, and correspondingly obtaining each first original image block matrix and first gray image block matrix, and correspondingly 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 value matrix where each target point is located; A first processing module is used to process each of the second grayscale image block matrices in the current frame using a preset second segmentation algorithm to obtain corresponding second matrices to be processed, and 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 is used to obtain 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, and process the red channel matrix, the green channel matrix and the blue channel matrix respectively based on a preset second filtering algorithm to a fourth filtering algorithm to obtain second to fourth binary matrices correspondingly; 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.
9. 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 7.
10. 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 as described in any one of claims 1 to 7 can be implemented.
Citation Information
Patent Citations
Significant object detection method based on sparse subspace clustering and low-order expression
CN105574534A
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
Face image restoration method and device, computer equipment and storage medium
CN116823640A
Bright spot location method, bright spot location apparatus, electronic device and storage medium
WO2024016632A1