A mixed gaussian model foreground segmentation method overcoming illumination mutation
By collecting light intensity data with a light sensor and combining it with a Gaussian mixture model, the background model is updated in real time. This solves the problems of accuracy and real-time performance in foreground segmentation under sudden changes in lighting, and enables complete extraction of moving targets.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING JIAOTONG UNIV
- Filing Date
- 2022-10-26
- Publication Date
- 2026-06-12
AI Technical Summary
Existing foreground segmentation methods suffer from large errors in the frame difference method, complex calculations in the optical flow method, poor noise resistance in the background difference method, and large computational cost and poor real-time performance of the Gaussian mixture model under sudden changes in illumination, making it impossible to effectively extract moving targets.
Light intensity is collected by a light sensor, and the rate of change of light is obtained by linear fitting. Combined with a Gaussian mixture model, the background model is updated in real time, and the model parameters are updated using an adaptive learning rate to extract the foreground target.
In the event of sudden changes in illumination, it can accurately detect illumination changes, improve the accuracy of the background model, completely extract moving targets, and meet real-time requirements.
Smart Images

Figure CN115797396B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a Gaussian mixture model for foreground segmentation method that overcomes sudden changes in illumination. Background Technology
[0002] Foreground segmentation is a crucial step in video image processing. By separating the foreground from the background, it detects, identifies, extracts, and tracks the foreground portion of interest. Furthermore, by analyzing the dynamic behavior patterns of the target, it enables the discrimination and prediction of its behavior. This technique is widely used in moving target recognition, such as people recognition and road vehicle detection, and provides data support for the research of various control algorithms. Currently, the most widely used foreground segmentation methods include the following:
[0003] 1. Frame Difference Method: The main idea is to extract moving targets by subtracting pixel values from adjacent images. In adjacent images, the pixel values of the background region do not change significantly, while the pixel values of the moving targets change considerably. The corresponding pixel values in consecutive frames are subtracted, and a threshold is defined. Pixels greater than the threshold are considered moving targets, while those less than the threshold are considered background. The frame difference method is simple and fast, making it suitable for applications requiring high target identification speed. Currently, widely used methods include two-frame difference, three-frame difference, and four-frame difference methods.
[0004] 2. Optical Flow Method: The main idea is to calculate the instantaneous velocity of the pixels that make up the moving target, and extract the moving target by observing the changes of pixels on the time axis. Feature points such as corner points are found in the image, and the target's trajectory can be described by tracking and calculating these feature points.
[0005] 3. Background Subtraction: Also known as background subtraction, background subtraction extracts the moving target by subtracting the background image from the original image. Therefore, the core of background subtraction lies in background modeling. Commonly used background modeling methods include the mean method, median method, single Gaussian model, and Gaussian mixture model. Among these, the Gaussian mixture model can extract the foreground target region relatively completely and is currently widely used in foreground segmentation algorithms. Summary of the Invention
[0006] The embodiments of the present invention provide a Gaussian mixture model foreground segmentation method to overcome the problems existing in the prior art by overcoming the sudden changes in illumination.
[0007] To achieve the above objectives, the present invention adopts the following technical solution.
[0008] A Gaussian mixture model for foreground segmentation method to overcome abrupt changes in illumination includes:
[0009] Based on the collected ambient light intensity values, a linear fit is performed to obtain the light intensity change function over time.
[0010] A background model is constructed and initialized based on grayscale images of historical images combined with a Gaussian mixture model;
[0011] Determine whether each pixel in a subsequent input frame of the initial grayscale image belongs to the background target. If it does, update the matching model parameters by calculating the learning rate; otherwise, determine that the pixel belongs to the foreground target and update the unmatched model parameters by calculating the learning rate.
[0012] Determine whether all pixels of the initial grayscale image of a certain frame have been processed. If so, complete the construction of the background model; otherwise, return to the third step above.
[0013] Using the background model, the foreground target is extracted from the processing results of the third or fourth step above, and a grayscale image of the target composed of moving targets is obtained.
[0014] Preferably, based on the collected ambient light intensity values, linear fitting is performed to obtain the light intensity variation function over time, including:
[0015] Through
[0016]
[0017] The rate of change of illumination in the environment at a certain moment is calculated; where h is the time increment, which approaches 0 infinitely.
[0018] Through
[0019]
[0020] Construct a mapping function for the rate of change of illumination; where e is the natural logarithm.
[0021] Preferably, the background model is constructed and initialized by combining a grayscale image of historical imagery with a Gaussian mixture model, including:
[0022] Based on grayscale images from historical imagery, a historical observation dataset X1, X2, ..., X is established. t ;
[0023] Based on historical observation datasets, through formula
[0024]
[0025]
[0026]
[0027] Construct a background model; where k is the total number of models with a Gaussian distribution function, and η(X) t ,μ i,t ,τi,t Let μ be the i-th Gaussian distribution function at time t. i,t , and τ i,t Let be the mean, variance, and covariance matrices of the i-th Gaussian distribution function at time t, respectively, where I is the identity matrix, and w is the mean, variance, and covariance matrix. i,t Let be the weights of the i-th Gaussian distribution at time t;
[0028] The pixel value of each pixel in the first frame of the historical image is taken as the mean of the first Gaussian distribution function of the Gaussian mixture model corresponding to that pixel.
[0029] Initialize the variance of the first Gaussian distribution function of the mixture model corresponding to each pixel of the first frame of the historical image;
[0030] The weight coefficients of the first Gaussian distribution function of the Gaussian mixture model corresponding to each pixel of the first frame of the historical image are initialized to 1.
[0031] Set the mean, variance, and weight coefficients of the remaining k-1 Gaussian distribution functions for each pixel in the first frame of the historical image to 0.
[0032] Preferably, determining whether each pixel of a subsequently input initial grayscale image frame belongs to the background target includes:
[0033] X is a pixel of the initial grayscale image of a subsequent input frame. t The mean of the corresponding current k Gaussian functions is calculated according to the formula...
[0034] |X t -μ i,t-1 |≤2.5σ i,t-1 (6)
[0035] The comparison operation is performed in a certain way. If the condition of equation (6) is met, then the pixel is determined to belong to the background target; otherwise, the pixel is determined to belong to the foreground target. In the equation, X t μ is the grayscale value of the pixel at time t. i,t-1 and σ i,t-1 These are the mean and standard deviation of the i-th Gaussian model corresponding to a certain pixel at the previous time step;
[0036] Calculating the learning rate includes using the formula
[0037]
[0038] Calculate the learning rate α; where g(t) is the pixel X. tThe rate of change of illumination at time t is mapped to a value in the interval (0,1) to reflect the rate of change of illumination. α0 is the initial learning rate coefficient, initially 1, which can be increased when a background target is misclassified as a foreground target and decreased when a moving target is misclassified as a background target. t0 is the value of t when g(t) reaches its maximum value; n is the number of frames, starting from 1 and increasing over time; M is the threshold for drastic changes in illumination, and satisfies... z i Factors that cause sudden changes in light intensity, This refers to the moment of sudden change in illumination.
[0039] Updating the matching model parameters includes:
[0040] Through
[0041] w i,t =(1-α)w i,t-1 +α (8)
[0042] Update the weights of the Gaussian mixture model corresponding to a pixel that is identified as a background target;
[0043] Through
[0044] ρ=α*η(X t |μ k ,σ k (9)
[0045] μ t =(1-ρ)μ t-1 +ρ*X t (10)
[0046]
[0047] The update rate ρ and mean μ of the Gaussian mixture model corresponding to a pixel identified as a background target. t and variance Update; where σ k Standard deviation;
[0048] The weights for the remaining mismatched Gaussian mixture model are obtained through the formula
[0049] w i,t =(1-α)w i,t-1 (12)
[0050] Update; the mean and standard deviation of the remaining mismatched Gaussian mixture models remain unchanged;
[0051] The updated weights of the k Gaussian models corresponding to this pixel are obtained through the formula...
[0052]
[0053] Perform normalization;
[0054] Updating the parameters of unmatched models includes:
[0055] The Gaussian mixture model corresponding to a pixel that is judged to belong to the foreground target with the smallest weight is replaced, and the mean of the new Gaussian mixture model is the pixel value of that pixel.
[0056] Preferably, the construction of the background model includes:
[0057] For a given grayscale image, the k Gaussian distribution models corresponding to all pixels are calculated according to... Sort in descending order;
[0058] The first B patterns after permutation are selected as background targets to complete the construction of the background model; where T represents the proportion of the background.
[0059]
[0060] Preferably, the process of obtaining a grayscale image of a target composed of moving targets includes:
[0061] The foreground target is extracted by subtracting the initial grayscale image of a frame from the background target obtained through the background model, and the target grayscale image composed of moving targets is obtained.
[0062] As can be seen from the technical solutions provided by the embodiments of the present invention above, the present invention provides a Gaussian mixture model for foreground segmentation method to overcome abrupt changes in illumination. When illumination changes drastically, illumination intensity information is collected by an illumination sensor and real-time linear fitting is performed to obtain the change in illumination intensity over time. Then, the derivative is calculated to obtain the illumination change rate, and different algorithms are used to calculate the learning rate according to different illumination change rates, thereby updating the background and extracting the complete moving target. The method provided by the present invention, through a combination of hardware and software, accurately detects illumination changes, overcomes the influence of abrupt illumination changes, meets the accuracy requirements of background modeling, and is beneficial for the complete extraction of foreground targets.
[0063] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and will become apparent from the description or may be learned by practice of the invention. Attached Figure Description
[0064] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0065] Figure 1 The flowchart of a Gaussian mixture model foreground segmentation method to overcome abrupt changes in illumination provided by the present invention is shown.
[0066] Figure 2 A flowchart illustrating a preferred embodiment of a Gaussian mixture model foreground segmentation method for overcoming abrupt changes in illumination provided by the present invention;
[0067] Figure 3 This diagram illustrates the learning rate variation strategy of a Gaussian mixture model foreground segmentation method to overcome sudden changes in illumination provided by the present invention. Detailed Implementation
[0068] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0069] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this specification means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “coupled” to another element, it can be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein can include wireless connections or couplings. The term “and / or” as used herein includes any and all combinations of one or more of the associated listed items.
[0070] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless defined as herein.
[0071] To facilitate understanding of the embodiments of the present invention, the following will provide further explanation and description with reference to the accompanying drawings and several specific embodiments. These embodiments do not constitute a limitation on the embodiments of the present invention.
[0072] This invention provides a Gaussian mixture model foreground segmentation method to overcome abrupt changes in illumination, addressing the following technical problems in existing technologies:
[0073] Frame differencing is highly sensitive to the speed of target motion in video images; slow or fast target motion introduces significant errors, failing to separate targets at all, while fast motion creates holes. Optical flow is computationally complex and unsuitable for real-time applications. Background differencing has poor noise resistance, and in practical applications, drastic changes in lighting and shadows significantly interfere with accurate background establishment. Furthermore, experiments show that Gaussian mixture model detection is computationally intensive, resulting in poor real-time performance for large-capacity videos.
[0074] For example, one existing method for addressing illumination abrupt changes primarily utilizes a combination of frame differencing and Gaussian mixture modeling. First, the frame differencing method is used to determine if an illumination abrupt change occurs, defining the illumination abrupt change magnitude, Aver, as:
[0075]
[0076] Where M and N represent the length and width of the video image, respectively, and f k (x,y) represents the grayscale value of point (x,y) in the k-th frame of the image. When Aver exceeds a certain threshold, a sudden change in illumination is considered to have occurred, and μ is adjusted in the Gaussian mixture model. t and The update method can overcome the effects of sudden changes in lighting.
[0077] While this method can overcome the effects of sudden changes in illumination and fully extract the foreground target, the background is destroyed at the moment of the illumination change, making it no longer applicable to studies that aim to extract the background.
[0078] See Figure 1 and 2 The present invention provides a Gaussian mixture model for foreground segmentation method to overcome abrupt changes in illumination, comprising the following steps:
[0079] Based on the collected ambient light intensity values, a linear fit is performed to obtain the light intensity change function over time.
[0080] A background model is constructed and initialized based on grayscale images of historical images combined with a Gaussian mixture model;
[0081] Determine whether each pixel in a subsequent input frame of the initial grayscale image belongs to the background target. If it does, update the matching model parameters by calculating the learning rate; otherwise, determine that the pixel belongs to the foreground target and update the unmatched model parameters by calculating the learning rate.
[0082] Determine whether all pixels of the initial grayscale image of a certain frame have been processed. If so, complete the construction of the background model; otherwise, return to the third step above.
[0083] Using the background model, the foreground target is extracted from the processing results of the third or fourth step above, and a grayscale image of the target composed of moving targets is obtained.
[0084] In a preferred embodiment of the present invention, the process of obtaining the function of light intensity changing with time is as follows.
[0085] First, the indoor light intensity data is collected in real time by a light sensor. The light sensor module can collect data according to the communication protocol. If the transmitted data is a hexadecimal number, it can be converted into a decimal number to obtain the light intensity value at that moment (range: 0-65535 lux). Then, the light intensity value measured at each moment is linearly fitted to obtain the light intensity change function f(t) over time. The derivative f′(t) of f(t) can be obtained from equation (1). f′(t) is the rate of change of light intensity at the current moment.
[0086]
[0087] In the formula, h is the time increment, which approaches 0 infinitely.
[0088] Because the change in illumination is uncertain, f′(t) varies within the interval (-∞, +∞), while the learning rate α should be a value between 0 and 1. Therefore, f′(t) is transformed into an illumination change rate mapping function g(t) (as shown in equation (2)). The purpose is to map the numerical range of illumination change to the interval (0, 1) to meet the range requirement of the learning rate α, i.e., g(t) ∈ (0, 1). The change of g(t) is consistent with the change of f′(t): when the illumination changes slowly, the value of f′(t) is small, and the value of g(t) is also small; when the illumination changes rapidly, the value of f′(t) is large, and the value of g(t) is also large. Therefore, g(t) reflects the speed of illumination change to a certain extent.
[0089]
[0090] In the formula, e is the natural logarithm.
[0091] Furthermore, the second step mentioned above specifically includes:
[0092] (1) Image preprocessing: The input color image is converted to grayscale, with the pixel grayscale value range being 0-255. The image is also filtered, such as median filtering, to remove image noise interference.
[0093] (2) Initialize the background model: For each pixel in each frame of the image, its historical observation dataset is {X1,X2,…,X...} t If the pixel value at time t follows a Gaussian mixture distribution probability density function (as shown in equation (3)).
[0094]
[0095]
[0096]
[0097] Where k is the total number of Gaussian distribution function models, typically 3-5, η(X t ,μ i,t ,τ i,t Let μ be the i-th Gaussian distribution function at time t. i,t , and τ i,t Let be the mean, variance, and covariance matrices of the i-th Gaussian distribution function at time t, respectively, where I is the identity matrix, and w is the mean, variance, and covariance matrix. i,t Let be the weights of the i-th Gaussian distribution at time t.
[0098] The pixel value of each pixel in the first frame image is used as the mean of the first Gaussian distribution function of the corresponding Gaussian mixture model. The variance is initialized to a large value, and the weight coefficients are initialized to 1. The mean, variance, and weight coefficients of the remaining k-1 Gaussian distribution functions for each pixel are all 0. When initializing the variance, a large value can be chosen based on experience, generally between 10 and 40. As the model is updated, the variance value will gradually converge, thus obtaining a Gaussian model that can accurately describe the changes in the pixels.
[0099] The process of model matching is as follows.
[0100] For subsequent input of new video images, for each pixel X in the video image t First, the pixel is compared with the mean of the current k Gaussian functions corresponding to it according to equation (6). If the following judgment condition (6) is satisfied, the pixel belongs to the background; otherwise, it belongs to the foreground.
[0101] |X t -μ i,t-1 |≤2.5σ i,t-1 (6)
[0102] Where X t μ is the grayscale value of the pixel at time t. i,t-1 σ i,t-1 These are the mean and standard deviation of the i-th Gaussian model corresponding to a certain pixel at the previous time step.
[0103] If α is too large, the update speed will be too fast, and moving targets will be misclassified as background; if α is too small, the update speed will be too slow, and background will be misclassified as foreground. It can be seen that selecting a suitable α value can effectively improve the accuracy of the background model. Therefore, the learning rate is set to Equation (7) to adapt to the background modeling requirements according to the changes in illumination.
[0104]
[0105] Where g(t) is the pixel X t The rate of change in illumination at time t is mapped to a value in the interval (0,1), reflecting the rate of change in illumination; α0 is the initial learning rate coefficient, initially 1, which can be adjusted appropriately according to different situations: it can be increased when the background is misjudged as the foreground, and decreased when the moving target is misjudged as the background, but α must always be kept within the range of 0-1; t0 is the value of t when g(t) reaches its maximum value; n is the number of frames, starting from 1 and increasing with time; M is the threshold for drastic changes in illumination, obtained through actual measurement. Define D = {all factors causing sudden changes in indoor illumination}, z i Factors that cause sudden changes in light intensity, If the moment of sudden change in illumination is...
[0106]
[0107] That is, M is the minimum value of the light change rate mapping function corresponding to all factors that cause drastic changes in indoor lighting.
[0108] like Figure 3 As shown, due to the one-to-one correspondence between the time axis and the frame number axis in the video image, the time axis is uniformly represented by the frame number axis for ease of explanation. Assume the illumination change is represented by the solid line in the diagram, and a sudden illumination change occurs near the 6th frame. Before the illumination reaches its maximum, the learning rate is updated according to the value of g(t). After g(t) reaches its maximum and begins to decay, the extreme point t0 is recorded as the first frame, i.e., n=1. Subsequent learning rates α are updated according to the value of g(t). Update (as shown by the dotted line in the image), that is, frame 6 is... Frame 7 is And so on. The numerator is set to g(t0), and the denominator increases frame by frame, exhibiting an overall gradient descent trend. This is to ensure a sufficient update rate to meet background update requirements even after dramatic changes in lighting disappear. Until... or When the learning rate resumes its initial decrease and returns to the original learning rate update curve, that is, when the dashed line intersects the solid line, the learning rate changes from the dashed line to the solid line.
[0109] The process of updating the matching model parameters includes:
[0110] For each pixel in the newly input video image, if pixel X t After step (3), if one of the k models is matched, the learning rate α is calculated according to the illumination value returned by the illumination sensor in step (4). For the successfully matched model, the update rate ρ and the mean μ are... t and variance The parameters and weights are updated according to equations (8)-(11), where w i,t Let be the weight of the i-th Gaussian distribution function at time t; for the remaining k-1 mismatched models, the mean and variance of their weights remain unchanged, and the weights are updated according to equation (12). Then, the weights of each model are normalized according to equation (13), as follows:
[0111] Through
[0112] w i,t =(1-α)w i,t-1 +α (8)
[0113] Update the weights of the Gaussian mixture model corresponding to a pixel that is identified as a background target;
[0114] Through
[0115] ρ=α*η(X t |μ k ,σ k (9)
[0116] μ t =(1-ρ)μ t-1 +ρ*X t (10)
[0117]
[0118] The update rate ρ and mean μ of the Gaussian mixture model corresponding to a pixel identified as a background target. t and variance Update; where σ is the standard deviation;
[0119] Through
[0120] w i,t =(1-α)w i,t-1 (12)
[0121] Update the weights of the remaining mismatched Gaussian mixture models;
[0122] The mean and variance of the remaining mismatched Gaussian mixture models remain unchanged;
[0123] The updated weights of the k Gaussian models corresponding to this pixel are obtained through the formula...
[0124]
[0125] Normalize.
[0126] Unmatched model parameter update: After the model matching process of formula (6), if the pixel does not match any of the corresponding k models, the Gaussian model with the smaller weight is replaced by a new Gaussian model with the mean being the pixel value of the pixel, the variance being initialized to a maximum value (or a relatively large value), and the weight being initialized to a minimum value (or a relatively small value).
[0127] For models that successfully match, it means that the model can accurately describe the pixel value changes of the corresponding pixel at the current moment. Its accuracy needs to be maintained by updating the mean and variance of the current moment using the mean and variance of the previous moment combined with the pixel value of the current moment, while assigning a larger weight to accurately describe subsequent pixel changes. Models that do not successfully match, however, cannot describe the pixel changes at the current moment, and are assigned a smaller weight to avoid affecting the model's accuracy.
[0128] Furthermore, the process of completing the background model construction includes:
[0129] The k Gaussian distribution models corresponding to each pixel are as follows: Arranged in descending order, a larger ratio indicates a larger weight and smaller variance, resulting in a more accurate description of the background; therefore, these ratios should be placed earlier in the list. Selecting the first B patterns as the background yields the background model, as shown in the following formula:
[0130]
[0131] Where the parameter T represents the proportion of the background, which is generally taken as an empirical value of 0.6, and b is the number of Gaussian distribution functions that achieve the minimum proportion.
[0132] After obtaining the completed background model, subtract the background from the preprocessed grayscale image to obtain a grayscale image containing only the moving target.
[0133] By repeating the above process to process the images of subsequent frames, a video stream containing only moving targets can be obtained.
[0134] In summary, this invention provides a Gaussian mixture model for foreground segmentation method to overcome abrupt changes in illumination. When illumination changes drastically, an illumination sensor collects illumination intensity information and performs real-time linear fitting to obtain the change in illumination intensity over time. The derivative is then used to derive the illumination change rate, and different algorithms are applied to calculate the learning rate based on different illumination change rates, thereby updating the background and extracting the complete moving target. The method provided by this invention, in conjunction with an illumination sensor, achieves a hardware-software integrated illumination detection mode. It can detect illumination changes in real time and update the background model in real time according to the magnitude of the illumination change, improving the accuracy of background model updates and facilitating accurate extraction of moving targets.
[0135] Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of one embodiment, and the modules or processes shown in the drawings are not necessarily essential for implementing the present invention.
[0136] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that the present invention can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of the present invention.
[0137] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for apparatus or system embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. The apparatus and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0138] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for overcoming illumination change in Gaussian mixture model based foreground segmentation, characterized in that, include: Based on the collected ambient light intensity values, a linear fit is performed to obtain the light intensity variation function over time; specifically including: Through (1) The rate of change of illumination in the environment at a certain moment is calculated; where h is the time increment, which approaches 0 infinitely. Through (2) constructing a light change rate mapping function; in the formula, is a natural logarithm; A background model is constructed and initialized using grayscale images based on historical imagery combined with a Gaussian mixture model; specifically including: A historical observation dataset was established based on grayscale images from historical imagery. ; Based on the historical observation dataset, using the formula... (3) (4) (5) Construct a background model; where k is the total number of models with a Gaussian distribution function. Let be the i-th Gaussian distribution function at time t. , and Let be the mean, variance, and covariance matrix of the i-th Gaussian distribution function at time t, respectively. It is the identity matrix. Let be the weights of the i-th Gaussian distribution at time t; The pixel value of each pixel in the first frame of the historical image is taken as the mean of the first Gaussian distribution function of the Gaussian mixture model corresponding to that pixel. Initialize the variance of the first Gaussian distribution function of the mixture model corresponding to each pixel of the first frame of the historical image; The weight coefficients of the first Gaussian distribution function of the Gaussian mixture model corresponding to each pixel of the first frame of the historical image are initialized to 1. Set the mean, variance, and weighting coefficients of the remaining k-1 Gaussian distribution functions for each pixel in the first frame of the historical image to 0; Determine whether each pixel of a subsequent input frame of the initial grayscale image belongs to the background target. If so, update the matching model parameters by calculating the learning rate; otherwise, determine that the pixel is a foreground target, and update the unmatched model parameters by calculating the learning rate. The determination of whether each pixel of a subsequent input frame of the initial grayscale image belongs to the background target includes: A pixel from a subsequent input frame of the initial grayscale image. The mean of the corresponding current k Gaussian functions is calculated according to the formula... (6) The comparison operation is performed in a certain way. If the condition of equation (6) is met, then the pixel is determined to belong to the background target; otherwise, the pixel is determined to belong to the foreground target. In the equation, It is the grayscale value of the pixel at time t. These are the mean and standard deviation of the i-th Gaussian model corresponding to a certain pixel at the previous time step; The calculation of the learning rate includes the following formula: (7) Calculate the learning rate In the formula, For pixels The rate of change of illumination at time t is mapped to a value in the interval (0,1) to reflect the rate of change of illumination. This is the initial learning rate coefficient, initially set to 1. It increases when a background target is misclassified as a foreground target and decreases when a moving target is misclassified as a background target. for When taking the maximum value Values: n is the frame number, starting from 1 and increasing over time; M is the threshold for drastic changes in illumination, satisfying M = , Factors that cause sudden changes in light intensity, This refers to the moment of sudden change in light intensity; The updating of the matching model parameters includes: Through (8) Update the weights of the Gaussian mixture model corresponding to a pixel that is identified as a background target; Through (9) (10) (11) The update rate of the Gaussian mixture model for a pixel identified as belonging to the background target. mean and variance Update; in the formula, Standard deviation; The weights for the remaining mismatched Gaussian mixture model are obtained through the formula (12) Update; the mean and standard deviation of the remaining mismatched Gaussian mixture models remain unchanged; The updated weights of the k Gaussian models corresponding to this pixel are obtained through the formula... (13) Perform normalization; The updating of unmatched model parameters includes: The Gaussian mixture model corresponding to a pixel that is judged to belong to the foreground target with the smallest weight is replaced, and the mean of the new Gaussian mixture model is the pixel value of that pixel. Determine whether all pixels of the initial grayscale image of a given frame have been processed. If so, the background model construction is complete; otherwise, return to the third step mentioned above. The completion of the background model construction includes: The k Gaussian distribution models corresponding to all pixels of the initial grayscale image of a certain frame are calculated according to... Sort in descending order; The first B patterns after permutation are selected as background targets to complete the construction of the background model; where T represents the proportion of the background. (14); Using the background model, the foreground target is extracted from the processing results of the third or fourth step above, and a grayscale image of the target composed of moving targets is obtained.
2. The method according to claim 1, characterized in that, The process of obtaining a grayscale image of a target composed of moving targets includes: The initial grayscale image of a certain frame is subtracted from the background target obtained through the background model to extract the foreground target and obtain a target grayscale image composed of moving targets.