A background subtraction method using improved bayesian revision binary map

CN117057979BActive Publication Date: 2026-09-18GUILIN UNIV OF ELECTRONIC TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311083804.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-25
Publication Date
2026-09-18
Estimated Expiration
2043-08-25

AI Technical Summary

Technical Problem

[0003]本发明所要解决的是现有背景减除方法所得到的前景二值图中存在的空洞现象和误判现象的问题,提供一种利用改进贝叶斯修正二值图的背景减除方法

Benefits of technology

[0050]Compared with existing technologies, this invention proposes an improved Bayesian correction method for background subtraction of binary images. The binary image correction process is incorporated into each iteration of the existing background subtraction algorithm, ensuring that the effective information from each correction is used in the next iteration. Feedback is achieved by recording information differences and their corresponding positions, avoiding information waste in each iteration. During the binary image correction process, a new method combining the sign function and the l0 norm replaces the l0 norm method used in calculating label probabilities, thus achieving the integration of the Bayesian correction model. This new method considers the influence of non-zero neighborhood blocks surrounding the element on the element itself, allowing the Bayesian correction model to fully account for the impact of pixel neighborhood blocks on the pixel itself. Cosine similarity replaces the Euclidean distance used in the Bayesian correction model to measure the relationship between the center pixel and its neighbors, improving the accuracy of characterizing this relationship.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117057979B_ABST
    Figure CN117057979B_ABST
Patent Text Reader

Abstract

This invention discloses an improved Bayesian correction method for background subtraction of binary images. The binary image correction process is incorporated into each iteration of the existing background subtraction algorithm, ensuring that the effective information from each correction is used in the next iteration. Feedback is achieved by recording information differences and their corresponding positions, avoiding information waste in each iteration. During the binary image correction process, a new method combining the sign function and the l0 norm replaces the l0 norm method used in calculating label probabilities, thus achieving integration with the Bayesian correction model. This new method considers the influence of non-zero neighborhood blocks surrounding the element on the element itself, allowing the Bayesian correction model to fully account for the impact of pixel neighborhood blocks on the pixel itself. Cosine similarity replaces the Euclidean distance used in the Bayesian correction model to measure the relationship between the center pixel and its neighbors, improving the accuracy of characterizing this relationship.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of digital image processing technology, and specifically to a method for background subtraction of binary images using an improved Bayesian correction. Background Technology

[0002] With the rapid development of internet technology, video has increasingly become the primary form of information recording. In computer vision, moving object detection plays a crucial role in numerous scenarios and has gradually become a research hotspot. The main method for object detection is background subtraction, which involves removing the background from the video to leave the foreground of interest. However, due to the complexity and variability of real-life scenes, and the high constraints imposed by existing background subtraction methods on either the background or the foreground, the resulting binary foreground image often exhibits voids and false positives, leading to poor performance in background-foreground separation. Summary of the Invention

[0003] The present invention aims to solve the problems of holes and misjudgments in the foreground binary image obtained by existing background subtraction methods, and provides a background subtraction method using an improved Bayesian correction method.

[0004] To solve the above problems, the present invention is achieved through the following technical solution:

[0005] A method for background subtraction of binary images using improved Bayesian correction includes the following steps:

[0006] Step 1: Perform grayscale conversion on the original image X to obtain the original grayscale image X0, and set the original grayscale image X0 as the current grayscale image Y;

[0007] Step 2: Perform principal component analysis on the current grayscale image Y to obtain the current original background grayscale image L and the current original foreground grayscale image S;

[0008] Step 3: Perform a binary transformation on the current original foreground grayscale image S to obtain the current original foreground binary image N;

[0009] Step 4: Based on the original image X and the current original foreground binary image N, calculate the prediction probability p(0|F(x,y)) that the pixel value of pixel F(x,y) in the current corrected foreground binary image F is 0, and the prediction probability p(1|F(x,y)) that the pixel value of pixel F(x,y) in the current corrected foreground binary image F is 1; if p(0|F(x,y)) < p(1|F(x,y)), then set the pixel value of pixel F(x,y) in the current corrected foreground binary image F to 1; otherwise, set the pixel value of pixel F(x,y) in the current corrected foreground binary image F to 0; thus obtaining the current corrected foreground binary image F.

[0010] Step 5: Adjust the current original foreground grayscale image S using the current original foreground binary image N and the current corrected foreground binary image F to obtain the current adjusted foreground grayscale image H; the adjustment process is as follows:

[0011] Calculate the difference between the pixel value of pixel F(x,y) in the current corrected foreground binary image F and the pixel value of pixel N(x,y) in the current original foreground binary image N;

[0012] If the difference is 0, then set the pixel value of the current adjusted foreground grayscale image H (x,y) to be equal to the pixel value of the current original foreground grayscale image S (x,y).

[0013] If the difference is -1, then set the pixel value of the pixel H(x,y) of the current adjusted foreground grayscale image H to the minimum pixel value of all pixels in the current original foreground grayscale image S.

[0014] If the difference is 1, then set the pixel value of the pixel H(x,y) of the current adjusted foreground grayscale image H to be equal to the maximum pixel value of all pixels in the current original foreground grayscale image S.

[0015] Step 6: Determine ||L+H-X0|| ∞ <||L+S-X0|| ∞ Is it true or false?

[0016] If true, then set the current foreground grayscale image H to the current grayscale image Y;

[0017] Otherwise, let the current original foreground grayscale image S be the current grayscale image Y;

[0018] Where X0 is the original grayscale image, L is the current original background grayscale image, S is the current original foreground grayscale image, and H is the current adjusted foreground grayscale image. The infinite norm of a matrix is ​​represented by .

[0019] Step 7: Determine whether the predetermined iteration termination condition has been met, i.e., the number of iterations has reached the set maximum number of iterations or the current grayscale image Y has not changed after the set number of iterations:

[0020] If not achieved, return to step 2;

[0021] Otherwise, output the current grayscale image Y.

[0022] The specific process of step 4 above is as follows:

[0023] The prediction probability p(0|F(x,y)) of pixel value F(x,y) being 0 is:

[0024]

[0025] The prediction probability p(1|F(x,y)) of the pixel value of pixel F(x,y) being 1 is:

[0026]

[0027] In the formula:

[0028] Q (x,y) Let Q represent the square neighborhood of pixel X(x,y) in the original image X. (x,y) The center point is Q(x,y), and the side length is r; Represents the square neighborhood Q (x,y) A pixel matrix of dimension r×r, wherein the element in the x'th row and y'th column is a square neighborhood Q. (x,y) The pixel value q of pixel point N(x′,y′) x',y' ,Right now

[0029] G (x,y) G represents the square neighborhood of pixel N(x,y) in the current original foreground binary image N. (x,y) The center point is N(x,y), and the side length is r; G represents the square neighborhood G of pixel N(x,y) in the current original foreground binary image N. (x,y) A pixel matrix of dimension r×r, wherein the element in row x′ and column y′ is a square neighborhood G. (x,y) The pixel value g of pixel point N(x′,y′) x',y' ,Right now

[0030] v c (x,y) represents the LAB color matrix of pixel X(x,y) of the original image X, with dimensions h×3. The first column elements are the brightness values ​​of pixel X(x,y) of the original image X, the second column elements are the red-green hue of pixel X(x,y) of the original image X, and the third column elements are the yellow-blue hue of pixel X(x,y) of the original image X.

[0031] v s (x,y) represents the position matrix of pixel point X(x,y) in the original image X, with a dimension of h×2, where the first column elements are all x and the second column elements are all y;

[0032] pixel matrix pixel matrix Tag matrix, pixel matrix element q x',y' The label is a pixel matrix element g in x',y' ;

[0033] Q 0 (x,y) Represents a pixel matrix Chinese label g x',y' The element q with a value of 0 x',y' A set; It is set Q 0 (x,y) The elements, f = 1, 2, ..., F, where F is a set Q. 0 (x,y) The total number of elements; Construct a matrix for the color of the f-th label being 0, with dimensions h×3, where all elements are equal to 0. This is represented as a matrix constructed for the position of the f-th label being 0, with dimensions h×2, and all its elements being...

[0034] Q 1 (x,y) Represents a pixel matrix Chinese label g x',y' The element q with a value of 1 x',y' A set; It is set Q 1 (x,y) The elements, d = 1, 2, ..., D, are set Q. 1 (x,y) The total number of elements; Construct a matrix for the color of the d-th label being 1, with dimensions h×3, where all elements are 1. This is represented as a matrix constructed for the position of the d-th label being 1, with dimensions h×2, and all its elements being 1.

[0035] P(G (x,y) |0) indicates that the pixel with a value of 0 in the current original foreground binary image N belongs to the square neighborhood G. (x,y) The probability of:

[0036]

[0037] P(G (x,y) |1) indicates that the pixel with a value of 1 in the current original foreground binary image N belongs to the square neighborhood G. (x,y) The probability of:

[0038]

[0039] P(0) represents the square neighborhood G (x,y)The probability that there is a pixel with a value of 0:

[0040]

[0041] P(1) represents the square neighborhood G (x,y) The probability that there is a pixel with a value of 1:

[0042]

[0043] This represents the pixel matrix of the current original foreground binary image N, with dimensions h×w, where the element in the x-th row and y-th column is the pixel value n of pixel point N(x,y) in the current original foreground binary image N. x,y ,Right now

[0044] Represents a pixel matrix The sliding extraction matrix has dimensions t×t, and its element in the x″-th row and y″-th column is derived from the pixel matrix. The element n extracted from x″,y″ ,Right now

[0045] Represents a pixel matrix The sliding extraction matrix has dimensions t×t, and its element in the x″-th row and y″-th column is derived from the pixel matrix. The element g extracted from x″,y″ ,Right now

[0046] O represents a matrix of dimension t×t consisting entirely of 1s;

[0047] h represents the length of the original image X or the current original foreground binary image N, w represents the width of the original image X or the current original foreground binary image N; r represents the set neighborhood side length, r < h and r < w; t represents the set extraction side length, t < r; x∈[1,h], y∈[1,w], x′,y′∈[1,r], x″,y″∈[1,t];

[0048] ed<a,b> Represents the Euclidean distance between matrices; cos<a,b> Represents the improved cosine distance of a matrix. In<a,b> Represents the inner product of matrices. Denotes the F-norm; Represents the 0 norm; This represents the sign function; α is the set proportionality coefficient, 0 < α < 1.

[0049] In step 2 above, robust principal component analysis is used to perform principal component analysis on the original image X.

[0050] Compared with existing technologies, this invention proposes an improved Bayesian correction method for background subtraction of binary images. The binary image correction process is incorporated into each iteration of the existing background subtraction algorithm, ensuring that the effective information from each correction is used in the next iteration. Feedback is achieved by recording information differences and their corresponding positions, avoiding information waste in each iteration. During the binary image correction process, a new method combining the sign function and the l0 norm replaces the l0 norm method used in calculating label probabilities, thus achieving the integration of the Bayesian correction model. This new method considers the influence of non-zero neighborhood blocks surrounding the element on the element itself, allowing the Bayesian correction model to fully account for the impact of pixel neighborhood blocks on the pixel itself. Cosine similarity replaces the Euclidean distance used in the Bayesian correction model to measure the relationship between the center pixel and its neighbors, improving the accuracy of characterizing this relationship. Attached Figure Description

[0051] Figure 1 This is a flowchart of a background subtraction method for binary graphs using an improved Bayesian correction.

[0052] Figure 2 These are visual comparison images of aircraft surveillance videos, including (a) the original image, (b) the L112 algorithm, and (c) the algorithm of this invention.

[0053] Figure 3 These are visual comparison images of the "Highway" surveillance video, including (a) the original image, (b) the L112 algorithm, and (c) the algorithm of this invention. Detailed Implementation

[0054] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific examples and the accompanying drawings.

[0055] A method for background subtraction of binary images using an improved Bayesian correction, such as... Figure 1 As shown, the steps are as follows:

[0056] Step 1: Perform grayscale conversion on the original image X to obtain the original grayscale image X0, and set the original grayscale image X0 as the current grayscale image Y.

[0057] Step 2: Perform principal component analysis on the current grayscale image Y to obtain the current original background grayscale image L and the current original foreground grayscale image S.

[0058] In a preferred embodiment of the present invention, robust principal component analysis (RPCA) is used to perform principal component analysis on the original image X.

[0059] Step 3: Perform a binary transformation on the current original foreground grayscale image S to obtain the current original foreground binary image N.

[0060] In this invention, the current original foreground grayscale image S is converted into the current original foreground binary image N, wherein the threshold transformation method is implemented by the im2bw() function in MATLAB.

[0061] Step 4: Based on the original image X and the current original foreground binary image N, determine the current corrected foreground binary image F.

[0062] Step 4.1: Calculate the prediction probability p(0|F(x,y)) of the pixel value of the current corrected foreground binary image F when the pixel value of the pixel point F(x,y) is 0 and the prediction probability p(1|F(x,y)) of the pixel value of the current corrected foreground binary image F when the pixel value of the pixel point F(x,y) is 1.

[0063] The prediction probability p(0|F(x,y)) of pixel value F(x,y) being 0 is:

[0064]

[0065] The prediction probability p(1|F(x,y)) of the pixel value of pixel F(x,y) being 1 is:

[0066]

[0067] in:

[0068] G (x,y) G represents the square neighborhood of pixel N(x,y) in the current original foreground binary image N. (x,y) The center point is N(x,y), and the side length is r. Represents the square neighborhood G (x,y) A pixel matrix of dimension r×r, wherein the element in row x′ and column y′ is a square neighborhood G. (x,y) The pixel value g of pixel point N(x′,y′) x',y' ,Right now Specifically, if the square neighborhood G (x,y) If the pixel values ​​exceed the range of the current original foreground binary image N, the pixel values ​​of the excess pixels are filled with 0.

[0069] Q (x,y) Let Q represent the square neighborhood of pixel X(x,y) in the original image X. (x,y) The center point is Q(x,y), and the side length is r. Represents the square neighborhood Q (x,y) A pixel matrix of dimension r×r, wherein the element in the x'th row and y'th column is a square neighborhood Q. (x,y)The pixel value q of pixel point N(x′,y′) x',y' ,Right now Specifically, if the square neighborhood Q (x,y) If the pixels exceed the range of the original image X, the pixel values ​​of the pixels in the excess portion are filled with 0.

[0070] because and Mutual correspondence, that is element g 1,1 and element q 1,1 correspond, element g 2,1 and element q 2,1 Correspondingly, the rest of the elements follow the same pattern; and because... element g in x',y' The value can be 0 or 1; therefore we define for The label matrix, element q x',y' The tag is g x',y' .

[0071] Q 0 (x,y) Represents a pixel matrix Chinese label g x',y' The element q with a value of 0 x',y' A set; It is set Q 0 (x,y) The elements, f = 1, 2, ..., F, where F is a set Q. 0 (x,y) The total number of elements. Construct a matrix for the color of the f-th label being 0, with dimensions h×3, where all elements are equal to 0. This is represented as a matrix constructed with the f-th label at position 0, having dimensions h×2, and all its elements being...

[0072] Q 1 (x,y) Represents a pixel matrix Chinese label g x',y' The element q with a value of 1 x',y' A set; It is set Q 1 (x,y) The elements, d = 1, 2, ..., D, are set Q. 1 (x,y) The total number of elements. Construct a matrix for the color of the d-th label being 1, with dimensions h×3, where all elements are 1. This is represented as a matrix constructed for the position of the d-th label being 1, with dimensions h×2, and all its elements being 1.

[0073] v c (x,y) represents the LAB color matrix of pixel X(x,y) of the original image X, with dimensions h×3. The first column elements are the brightness values ​​of pixel X(x,y) of the original image X, the second column elements are the red-green hue of pixel X(x,y) of the original image X, and the third column elements are the yellow-blue hue of pixel X(x,y) of the original image X.

[0074] v s (x,y) represents the position matrix of pixel point X(x,y) in the original image X, with a dimension of h×2, where the first column elements are all x and the second column elements are all y.

[0075] P(G (x,y) |0) indicates that the pixel with a value of 0 in the current original foreground binary image N belongs to the square neighborhood G. (x,y) The probability of:

[0076]

[0077] P(G (x,y) |1) indicates that the pixel with a value of 1 in the current original foreground binary image N belongs to the square neighborhood G. (x,y) The probability of:

[0078]

[0079] P(0) represents the square neighborhood G (x,y) The probability that there is a pixel with a value of 0:

[0080]

[0081] P(1) represents the square neighborhood G (x,y) The probability that there is a pixel with a value of 1:

[0082]

[0083] This represents the pixel matrix of the current original foreground binary image N, with dimensions h×w, where the element in the x-th row and y-th column is the pixel value n of pixel point N(x,y) in the current original foreground binary image N. x,y ,Right now

[0084] Represents a pixel matrix The sliding extraction matrix has dimensions t×t, and its element in the x″-th row and y″-th column is derived from the pixel matrix. The element n extracted from x″,y″ ,Right now

[0085] Represents a pixel matrix The sliding extraction matrix has dimensions t×t, and its element in the x″-th row and y″-th column is derived from the pixel matrix. The element g extracted from x″,y″ ,Right now

[0086] O represents a matrix of dimension t×t consisting entirely of 1s;

[0087] h represents the length of the original image X or the current original foreground binary image N, w represents the width of the original image X or the current original foreground binary image N; r represents the set neighborhood side length, r < h and r < w; t represents the set extraction side length, t < r; x∈[1,h], y∈[1,w], x′,y′∈[1,r], x″,y″∈[1,t];

[0088] ed<a,b> Represents the Euclidean distance between matrices; cos<a,b> Represents the improved cosine distance of a matrix. In<a,b> Represents the inner product of matrices. Denotes the F-norm; Represents the 0 norm; This represents the sign function; α is the set proportionality coefficient, 0 < α < 1.

[0089] Step 4.2: Compare the predicted probability p(0|F(x,y)) of a pixel value of 0 for the current corrected foreground binary image F with the predicted probability p(1|F(x,y)) of a pixel value of 1 for the current corrected foreground binary image F:

[0090] If p(0|F(x,y))<p(1|F(x,y)), then set the pixel value of the pixel point F(x,y) of the current modified foreground binary image F to 1;

[0091] Otherwise, set the pixel value of pixel F(x,y) in the current modified foreground binary image F to 0.

[0092] Step 5: Adjust the current original foreground grayscale image S using the current original foreground binary image N and the current corrected foreground binary image F to obtain the current adjusted foreground grayscale image H. The adjustment process is as follows:

[0093] Calculate the difference between the pixel value of pixel F(x,y) in the current corrected foreground binary image F and the pixel value of pixel N(x,y) in the current original foreground binary image N;

[0094] If the difference is 0, then set the pixel value of the current adjusted foreground grayscale image H (x,y) to be equal to the pixel value of the current original foreground grayscale image S (x,y).

[0095] If the difference is -1, then set the pixel value of the pixel H(x,y) of the current adjusted foreground grayscale image H to the minimum pixel value of all pixels in the current original foreground grayscale image S.

[0096] If the difference is 1, then the pixel value of the pixel H(x,y) of the current adjusted foreground grayscale image H is made equal to the maximum pixel value of all pixels in the current original foreground grayscale image S.

[0097] When adjusting the foreground grayscale image H, if a point at a certain position is assigned the minimum value, it will still be identified as background in the next iteration of the background subtraction algorithm; if a point at a certain position is assigned the maximum value, it will be identified as foreground in the next iteration.

[0098] Step 6: Determine ||L+H-X0|| ∞ <||L+S-X0|| ∞ Is it true or false?

[0099] If so, then set the current foreground grayscale image H to the current grayscale image Y;

[0100] Otherwise, let the current original foreground grayscale image S be the current grayscale image Y;

[0101] Where X0 is the original grayscale image, L is the current original background grayscale image, S is the current original foreground grayscale image, and H is the current adjusted foreground grayscale image. The infinite norm of a matrix is ​​represented.

[0102] Step 7: Determine whether the predetermined iteration termination condition has been met: If not, return to step 2; otherwise, output the current grayscale image Y.

[0103] The predetermined iteration termination condition is that the number of iterations reaches the set maximum number of iterations or the current grayscale image Y does not change after the set number of iterations.

[0104] The effectiveness of the present invention will be verified through simulation experiments below.

[0105] Simulation conditions: All experiments were run on Matlab 2016a, with an Intel Core i5-6500 processor, 8GB of RAM, and a Windows 10 64-bit operating system.

[0106] Simulation content: Aircraft surveillance videos and "Highway" surveillance videos were selected from the CDnet2014 database, and the L112 algorithm (see reference "CHEN Lixia, LIU Junli, WANG Xuewen. Background subtraction with Kronecker basis-representation based tensor sparsity and L112 norm[J]. Multidimensional Systems and Signal Processing, 2020, 32: 77-90.") and the algorithm of this invention were used to process the aircraft surveillance videos and pedestrian surveillance videos, respectively.

[0107] Simulation results:

[0108] Figure 2 and Figure 3 These are visual comparison images of aircraft surveillance video and "Highway" surveillance video, showing (a) the original image, (b) the L112 algorithm, and (c) the algorithm of this invention. Figure 2 As can be seen, the L112 algorithm misclassifies a large number of background elements as foreground elements, and the foreground contains many holes; while the algorithm of this invention effectively solves the misclassification problem, and the hole phenomenon in the foreground is also alleviated to a certain extent. Figure 3 As can be seen, the L112 algorithm is affected by the disturbance of leaves along the roadside, misjudging them as foreground objects, and there are a large number of holes in the foreground objects; while the algorithm of this invention can overcome the above problems to a large extent, thus achieving better detection results.

[0109] Table 1. F-measure values ​​for video data

[0110]

[0111] Table 1 lists the objective results of the foreground binary maps obtained by the L112 algorithm and the algorithm of this invention. It can be seen that the foreground binary map obtained by the algorithm of this invention has higher accuracy.

[0112] It should be noted that although the embodiments described above are illustrative, they are not intended to limit the invention. Therefore, the invention is not limited to the specific embodiments described above. Any other embodiments obtained by those skilled in the art under the guidance of this invention without departing from its principles are considered to be within the protection scope of this invention.

Claims

1. A background subtraction method for binary maps using an improved Bayesian correction, characterized in that, The steps include the following: Step 1: Perform grayscale conversion on the original image X to obtain the original grayscale image X0, and set the original grayscale image X0 as the current grayscale image Y; Step 2: Perform principal component analysis on the current grayscale image Y to obtain the current original background grayscale image L and the current original foreground grayscale image S; Step 3: Perform a binary transformation on the current original foreground grayscale image S to obtain the current original foreground binary image N; Step 4: Based on the original image X and the current original foreground binary image N, calculate the prediction probability p(0|F(x,y)) that the pixel value of pixel F(x,y) in the current corrected foreground binary image F is 0, and the prediction probability p(1|F(x,y)) that the pixel value of pixel F(x,y) in the current corrected foreground binary image F is 1; if p(0|F(x,y)) < p(1|F(x,y)), then set the pixel value of pixel F(x,y) in the current corrected foreground binary image F to 1; otherwise, set the pixel value of pixel F(x,y) in the current corrected foreground binary image F to 0; thus obtaining the current corrected foreground binary image F. Step 5: Adjust the current original foreground grayscale image S using the current original foreground binary image N and the current corrected foreground binary image F to obtain the current adjusted foreground grayscale image H; the adjustment process is as follows: Calculate the difference between the pixel value of pixel F(x,y) in the current corrected foreground binary image F and the pixel value of pixel N(x,y) in the current original foreground binary image N; If the difference is 0, then set the pixel value of the current adjusted foreground grayscale image H (x,y) to be equal to the pixel value of the current original foreground grayscale image S (x,y). If the difference is -1, then set the pixel value of the pixel H(x,y) of the current adjusted foreground grayscale image H to the minimum pixel value of all pixels in the current original foreground grayscale image S. If the difference is 1, then set the pixel value of the pixel H(x,y) of the current adjusted foreground grayscale image H to be equal to the maximum pixel value of all pixels in the current original foreground grayscale image S. Step 6: Determine ||L+H-X0|| ∞ <||L+S-X0|| ∞ Is it true or false? If true, then set the current foreground grayscale image H to the current grayscale image Y; Otherwise, let the current original foreground grayscale image S be the current grayscale image Y; Where X0 is the original grayscale image, L is the current original background grayscale image, S is the current original foreground grayscale image, and H is the current foreground grayscale image being adjusted. The infinite norm of a matrix is ​​represented by . Step 7: Determine whether the predetermined iteration termination condition has been met, i.e., the number of iterations has reached the set maximum number of iterations or the current grayscale image Y has not changed after the set number of iterations: If not achieved, return to step 2; Otherwise, output the current grayscale image Y.

2. The background subtraction method for binary images using an improved Bayesian correction method as described in claim 1, characterized in that, The specific process of step 4 is as follows: The prediction probability p(0|F(x,y)) of pixel value F(x,y) being 0 is: The prediction probability p(1|F(x,y)) of the pixel value of pixel F(x,y) being 1 is: In the formula: Q (x,y) Let Q represent the square neighborhood of pixel X(x,y) in the original image X. (x,y) The center point is Q(x,y), and the side length is r; Represents the square neighborhood Q (x,y) A pixel matrix of dimension r×r, wherein the element in the x'th row and y'th column is a square neighborhood Q. (x,y) The pixel value q of pixel point N(x′,y′) x',y' ,Right now G (x,y) G represents the square neighborhood of pixel N(x,y) in the current original foreground binary image N. (x,y) The center point is N(x,y), and the side length is r; G represents the square neighborhood G of pixel N(x,y) in the current original foreground binary image N. (x,y) A pixel matrix of dimension r×r, wherein the element in row x′ and column y′ is a square neighborhood G. (x,y) The pixel value g of pixel point N(x′,y′) x',y' ,Right now v c (x,y) represents the LAB color matrix of pixel X(x,y) of the original image X, with dimensions h×3. The first column elements are the brightness values ​​of pixel X(x,y) of the original image X, the second column elements are the red-green hue of pixel X(x,y) of the original image X, and the third column elements are the yellow-blue hue of pixel X(x,y) of the original image X. v s (x,y) represents the position matrix of pixel point X(x,y) in the original image X, with a dimension of h×2, where the first column element is x and the second column element is y; pixel matrix pixel matrix Tag matrix, pixel matrix element q x',y' The label is a pixel matrix element g in x',y' ; Q 0 (x,y) Represents a pixel matrix Chinese label g x',y' The element q with a value of 0 x',y' A set; It is set Q 0 (x,y) The elements, f = 1, 2, ..., F, where F is a set Q. 0 (x,y) The total number of elements; For the first f A color matrix with a label of 0 is constructed, having a dimension of h×3, and all its elements are... Represented as the first f Construct a matrix with the position of label 0, its dimension is h×2, and all its elements are 0. Q 1 (x,y) Represents a pixel matrix Chinese label g x',y' The element q with a value of 1 x',y' A set; It is set Q 1 (x,y) The elements, d = 1, 2, ..., D, are set Q. 1 (x,y) The total number of elements; Construct a matrix for the color of the d-th label being 1, with dimensions h×3, where all elements are 1. This is represented as a matrix constructed for the position of the d-th label being 1, with dimensions h×2, and all its elements being 1. P(G (x,y) |0) indicates that the pixel with a value of 0 in the current original foreground binary image N belongs to the square neighborhood G. (x,y) The probability of: P(G (x,y) |1) indicates that the pixel with a value of 1 in the current original foreground binary image N belongs to the square neighborhood G. (x,y) The probability of: P(0) represents the square neighborhood G (x,y) The probability that there is a pixel with a value of 0: P(1) represents the square neighborhood G (x,y) The probability that there is a pixel with a value of 1: This represents the pixel matrix of the current original foreground binary image N, with dimensions h×w, where the element in the x-th row and y-th column is the pixel value n of pixel point N(x,y) in the current original foreground binary image N. x,y ,Right now Represents a pixel matrix The sliding extraction matrix has dimensions t×t, and its element in the x″-th row and y″-th column is derived from the pixel matrix. The element n extracted from x″,y″ ,Right now Represents a pixel matrix The sliding extraction matrix has dimensions t×t, and its element in the x″-th row and y″-th column is derived from the pixel matrix. The element g extracted from it x″,y″ ,Right now O represents a matrix of dimension t×t consisting entirely of 1s; h represents the length of the original image X or the current original foreground binary image N, w represents the width of the original image X or the current original foreground binary image N; r represents the set neighborhood side length, r < h and r < w; t represents the set extraction side length, t < r; x∈[1,h], y∈[1,w], x′,y′∈[1,r], x″,y″∈[1,t]; ed<a,b> represents the Euclidean distance between matrices; cos<a,b> denotes the improved cosine distance between matrices. In<a,b> represents the matrix inner product. Denotes the F-norm; Represents the 0 norm; This represents the sign function; α is the set proportionality coefficient, 0 < α < 1.

3. The background subtraction method for binary images using an improved Bayesian correction method according to claim 1, characterized in that, In step 2, robust principal component analysis is used to perform principal component analysis on the original image X.

Citation Information

Patent Citations

  • Bayesian Decision Theory foreground extraction method combined with reflected illumination

    CN103164855A

  • Methods for background and noise suppression in binary to grayscale image conversion

    US20080037044A1