A target segmentation method for complex background images
By performing boundary filling and smoothing on complex background images, constructing a sampling matrix and performing downsampling, and using fuzzy C-means clustering and joint metric analysis, target contour lines are generated. This solves the problem of inaccurate segmentation of active contour models in complex background images and improves segmentation accuracy and stability.
Patent Information
- Application Number
- CN202511838831.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-08
- Publication Date
- 2026-03-06
- Estimated Expiration
- 2045-12-08
AI Technical Summary
Existing active contour models struggle to accurately distinguish between foreground and background in complex background images, resulting in insufficient segmentation stability and decreased accuracy, and are prone to oversegmentation or undersegmentation.
By performing boundary filling and smoothing on the image to be segmented, a sampling matrix is constructed and downsampled. The feature image is recovered using fuzzy C-means clustering and rearrangement operators. Joint metric analysis is performed by combining JS divergence and Euclidean distance. A data-driven term is constructed to iteratively update the initial level set function, generating the target contour line.
It effectively reduces the influence of background texture in complex background images, improves the accuracy and efficiency of image segmentation, ensures the accuracy and robustness of target contours, and enhances the precision and stability of image segmentation.
Smart Images

Figure CN121304693B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a target segmentation method for complex background images. Background Technology
[0002] Image segmentation is a fundamental problem in the fields of image processing and computer vision. Its core task is to divide an image into several independent regions based on information such as gray-level distribution, geometric shape and texture features, and to accurately extract the target region of interest from them, laying the foundation for subsequent higher-level visual analysis.
[0003] Among various segmentation techniques, active contour models have attracted widespread attention due to their ability to flexibly describe boundaries in continuous space. These models define initial contour lines in the image and drive the evolution of the curve towards the target edge through energy functional optimization. Within the level set framework, active contour models can naturally handle topological changes in the curve and maintain boundary smoothness and evolutionary stability during iteration, thus achieving accurate description of the target boundary. However, traditional active contour models rely on image gradient information to drive contour evolution. In complex backgrounds, image gradients are easily affected by noise, and for targets with weak or blurred boundaries, gradient information is severely lacking. This leads to oversegmentation problems such as misclassifying the background as the target or undersegmentation problems such as missing parts of the target area during contour evolution.
[0004] In summary, current mainstream active contour models, when faced with complex background images where the background region and the target are similar in terms of grayscale distribution and texture features, suffer from weakened foreground-background distinction. This makes the active contour models susceptible to background influence during energy evolution, making it difficult to converge to the true boundary and resulting in oversegmentation or undersegmentation, leading to low segmentation accuracy for complex background images. Summary of the Invention
[0005] Therefore, the technical problem to be solved by the present invention is to overcome the problem that the existing technology is unable to accurately distinguish between the foreground and the background, and is prone to insufficient segmentation stability and decreased segmentation accuracy when segmenting complex background images.
[0006] To address the aforementioned technical problems, this invention provides a target segmentation method for complex background images, comprising:
[0007] The image to be segmented is filled with boundaries to obtain the filled image to be segmented; the filled image to be segmented is smoothed to obtain the smoothed image to be segmented; after sliding sampling and vectorization on both the filled image to be segmented and the smoothed image to be segmented using a preset sampling window, the first downsampling matrix and the second downsampling matrix are obtained after downsampling.
[0008] Parallel clustering is performed on all corresponding column vector pairs in the first and second downsampling matrices to obtain the membership degree of the center point of the preset sampling window corresponding to each pair of vectors to the background and foreground categories, as well as the background and foreground category cluster centers of the pixel values in the preset sampling window, forming the background membership vector and foreground membership vector, as well as the background cluster center vector and foreground cluster center vector of the image to be segmented and filled.
[0009] Based on the background membership vector, background cluster center vector, foreground membership vector, and foreground cluster center vector, a prefit denoising vector for the image to be segmented and filled is constructed.
[0010] The background cluster center vector, foreground cluster center vector, and prefitted denoising vector are rearranged and their sizes restored to obtain the background prefitted feature map, foreground prefitted feature map, and prefitted denoising image of the image to be segmented and filled. Combined with the image to be segmented and filled, a global fidelity fitting term is constructed.
[0011] Using JS divergence and Euclidean distance, the prefitted background feature map and the prefitted foreground feature map are subjected to joint multiplicative metric analysis with the prefitted denoised image to obtain the background difference energy and the foreground difference energy, and to construct local fitting terms.
[0012] Based on local fitting terms and global fidelity fitting terms, a data-driven term is constructed to iteratively update the initial level set function of the image to be segmented and filled until the updated level set function converges, thereby obtaining the target level set function and generating the target contour line.
[0013] Preferably, the image to be segmented is filled with boundaries to obtain a filled image, including:
[0014] If the number of rows in the image to be segmented is even, then the image to be segmented is used as the fill image to be segmented;
[0015] If the number of rows in the image to be segmented is odd, then repeat a row at the bottom of the image to be segmented to obtain the filled image to be segmented.
[0016] Preferably, after obtaining the target level set function, the method further includes:
[0017] If the number of rows in the image to be segmented is even, then the target contour line is generated based on the target level set function, the image to be segmented is segmented, and the image segmentation result is obtained.
[0018] If the number of rows in the image to be segmented is odd, the vector corresponding to the last row of the image to be segmented in the target level set function is discarded, an optimized level set function is obtained, and a target contour line is generated based on the optimized level set function to segment the image and obtain the image segmentation result.
[0019] Preferably, after performing sliding sampling and vectorization on the image using a preset sampling window, the image is then downsampled to obtain a downsampling matrix, including:
[0020] Using a preset sampling window, slide sampling is performed on all pixels in the image. After each slide, the sampling results of the corresponding pixel and its neighborhood are vectorized to obtain the vector corresponding to each pixel and its neighborhood in the image.
[0021] Stack the vectors corresponding to all pixels in the image and their neighborhoods column-wise to form a sampling matrix;
[0022] Discard the even-numbered columns in the sampling matrix to obtain the corresponding downsampling matrix.
[0023] Preferably, fuzzy C-means clustering is used to perform parallel clustering on vector pairs of corresponding columns in the first and second downsampling matrices, including:
[0024] Using fuzzy C-means clustering, and based on a preset number of clustering iterations, parallel clustering is performed on all pairs of vectors in corresponding columns of the first and second downsampling matrices; where the... The first vector in the preset sampling window corresponding to the column Pixel pairs Membership of a category With the preset sampling window Cluster centers of categories , represented as:
[0025] ;
[0026] After parallel clustering of vector pairs in all corresponding columns of the first and second downsampling matrices, the center point of the corresponding preset sampling window is obtained for each vector pair. right Membership of a category ;
[0027] Based on vector pairs of all columns in the first and second downsampling matrices and The following components make up the image to be segmented and filled:
[0028] Background membership vector , This indicates the first and second downsampling matrices. The membership degree of the center point of the preset sampling window corresponding to a pair of vectors in the column to the background category;
[0029] Foreground membership vector , This indicates the first and second downsampling matrices. The membership degree of the center point of the preset sampling window corresponding to a pair of vectors in the column to the foreground category;
[0030] Background cluster center vector , This indicates the first and second downsampling matrices. The cluster centers of the background categories in the preset sampling window corresponding to a pair of vectors in the column;
[0031] Foreground cluster center vector , This indicates the first and second downsampling matrices. The cluster centers of the foreground categories in the preset sampling window corresponding to a pair of vectors in the column;
[0032] in, , Time indicates background category, Time indicates the foreground category; ,and ; This indicates the pixel index within the preset sampling window. , This indicates the total number of pixels in the preset sampling window; For category index, the value is... ; When the value is 1, , When the value is 2, ; and These represent the first sample in the preset sampling window. The grayscale value of a pixel and its spatial neighborhood smoothing value, wherein the spatial neighborhood smoothing value is the value of the pixel after Gaussian filtering; Indicates spatial weights, Represents the fuzzy coefficient. This represents the summation operation; This represents the index of the corresponding column in the first and second downsampling matrices. , This represents the total number of pixels in the image to be segmented and filled. The symbol for L2 norm calculation.
[0033] Preferably, the background cluster center vector, foreground cluster center vector, and prefitted denoising vector are rearranged and their sizes restored to obtain the background prefitted feature map, foreground prefitted feature map, and prefitted denoising image of the image to be segmented and filled, including:
[0034] Using rearrangement operators For the background cluster center vector respectively Foreground cluster center vector With prefitted denoised vector According to the sampling order, the corresponding two-dimensional downsampled image is restored. , , , represented as: ;
[0035] Using bilinear interpolation operators Size restoration is performed on the 2D downsampled image to obtain the background prefit feature map of the image to be segmented and filled. Foreground prefit feature map With prefitted denoised image ;
[0036] in, The prefitted denoising vector of the image to be segmented and filled is expressed as follows: , This indicates the operation of multiplying elements at corresponding positions in a vector; and They represent sizes of Background 2D downsampled image and foreground 2D downsampled image; Indicates size Downsampled prefitted denoised image; and They represent sizes of Background prefit feature map and foreground prefit feature map and These represent the number of rows and columns of the image to be segmented and filled, respectively. Indicates size is Prefitted denoised image.
[0037] Preferably, using JS divergence and Euclidean distance, the prefitted background feature map and the prefitted foreground feature map are jointly subjected to multiplicative metric analysis with the prefitted denoised image to obtain the background difference energy and the foreground difference energy, including:
[0038] Calculate the background prefit feature map separately Foreground prefit feature map , with prefitted denoised image The Jensen-Shannon divergence is expressed as:
[0039] ;
[0040] A joint multiplicative metric analysis based on Jensen-Shannon divergence and Euclidean distance is performed to obtain the dissimilarity energy, expressed as:
[0041] ;
[0042] in, This represents the operator for calculating the JS divergence; When it is 1, Indicates background difference energy; When it is 2, Indicates the energy of prospective difference; Fill the vector pixels within the image to be segmented; Point place Category prefit feature map eigenvalues The expression is ; For point The grayscale values of the prefitted denoised image; Based on Euler's constant Logarithmic operations with base 0; For Gaussian kernel function, , Gaussian kernel function standard deviation For the positional variable within the neighborhood, denoted as , Indicates Centered on, with side length as The square neighborhood, In order to make The constant; express Category prefit feature map With prefitted denoised image The square of the Euclidean distance; This represents the set of pixels in the image to be segmented and filled. This is for integration operations.
[0043] Preferably, constructing local fitting terms and global fidelity fitting terms includes:
[0044] Based on background difference energy Energy of difference with the prospect Constructing local fitting terms , represented as: ;
[0045] Based on the image to be segmented and filled, its prefitted background feature map, prefitted foreground feature map, and prefitted denoised image, a global fidelity fitting term is constructed. , represented as:
[0046] ;
[0047] in, A constant that is greater than zero. , Points The feature values of the background prefit feature map and the foreground prefit feature map; For point The grayscale value of the image to be segmented and filled.
[0048] Preferably, based on local fitting terms and global fidelity fitting terms, data-driven terms are constructed, including:
[0049] Preset approximate Dirac Delta function , represented as , It is the circumference constant. The variables used in the calculation of the approximate Dirac Delta function;
[0050] Preset adaptive weight parameters , represented as ;
[0051] Preset adaptive energy scaling parameters , represented as , Let the mean gray level of the pixels in the image to be segmented be denoted as . ;
[0052] The data-driven term after the (n-1)th iteration , represented as:
[0053] ;
[0054] in, To adjust the weight parameters for the strength of data-driven items; It is the arctangent function; For the initial level set function The level set function after the (n-1)th iteration.
[0055] Preferably, the initial level set function is iteratively updated using data-driven terms, as follows:
[0056] ;
[0057] in, For the number of iterations, The target level set function is obtained after the nth iteration of the initial level set function. The representative window side length is Standard deviation is Gaussian filter; Let be the level set regularization function. The formula for calculating the level set regularization function is: , Let be the variables used to compute the level set regularization function. The symbol for absolute value calculation; A constant that is greater than zero. For time step.
[0058] Compared with the prior art, the above-described technical solution of the present invention has the following advantages:
[0059] The target segmentation method for complex background images described in this invention constructs sampling matrices for a filled image and a smoothed image to be segmented based on a preset sampling window and the image to be segmented, respectively. Downsampling is then used to obtain the corresponding downsampling matrices to reduce computation. Simultaneously, an improved fuzzy C-means clustering method based on parallelization and downsampling strategies is used to jointly cluster vector pairs in the same column of the two downsampling matrices. Joint clustering is performed using the preset sampling window as a local unit, preserving original details based on the filled image to be segmented and smoothing noise based on the smoothed image to be segmented. This forces corresponding pixels to maintain a consistent membership degree in both matrices, avoiding fitting errors caused by noise or detail loss in a single matrix. This effectively weakens the influence of background texture in complex background images, thus more accurately representing the feature differences between foreground and background in local regions. Furthermore, a rearrangement operator and bilinear interpolation are used to recover the full-size pre-fitted background feature map, pre-fitted foreground feature map, and pre-fitted denoised image, ensuring feature integrity. Neighborhood feature similarity is used to weaken isolated noise interference, further ensuring the accuracy of the target contour lines obtained iteratively, and improving image segmentation accuracy and efficiency.
[0060] This invention introduces a joint multiplicative metric analysis of Jensen-Shannon divergence and Euclidean distance to obtain background and foreground difference energy. JS divergence is used to measure the distribution similarity between the prefitted denoised image and the prefitted background and foreground feature maps, while Euclidean distance measures pixel-level numerical differences. The joint multiplicative metric analysis of the two constructs a more accurate and stable difference energy based on distribution features and local details. This can effectively suppress false edges generated by structures similar to the target foreground in the background in complex background images, improve the accuracy of target contour lines, and thus ensure image segmentation accuracy and robustness.
[0061] This invention constructs a data-driven term based on local fitting and global fidelity fitting terms to iteratively update the initial contour line to obtain the target contour line. The local fitting term is constructed based on the background difference energy and foreground difference energy. Based on the difference between the prefitted denoised image and the background and foreground features, a steep energy gradient is formed in the target edge region, guiding the contour to converge quickly to the true boundary. The global fidelity fitting term combines the image to be segmented, the prefitted denoised image, and the prefitted feature maps of the background and foreground. By introducing the original grayscale constraint of the image to be segmented, it compensates for the loss of weak edges and details while smoothing noise using the prefitted denoised image, so as to ensure the effective preservation of image structure information during the segmentation process. The logarithmic operation of JS divergence is used to measure the consistency of global features to avoid contour deviation caused by local noise. The contribution ratio of the local fitting term and the global fidelity fitting term is automatically adjusted by adaptive weights, and the energy amplitude is scaled based on image information by energy scaling parameters to ensure that complex images with different brightness and contrast can evolve stably, thereby significantly improving the accuracy and robustness of image segmentation in complex background image segmentation. Attached Figure Description
[0062] To make the content of this invention easier to understand, the invention will be further described in detail below with reference to specific embodiments and accompanying drawings, wherein:
[0063] Figure 1 This is a flowchart of the steps of the target segmentation method for complex background images of the present invention;
[0064] Figure 2 This is a schematic diagram comparing the segmentation results of the first image to be segmented based on this application and existing methods;
[0065] Figure 3 This is a schematic diagram comparing the segmentation results of the second image to be segmented based on this application and existing methods;
[0066] Figure 4 This is a schematic diagram comparing the segmentation results of the third image to be segmented based on this application and existing methods;
[0067] Figure 5 This is a schematic diagram comparing the segmentation results of the fourth image to be segmented based on this application and existing methods. Detailed Implementation
[0068] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, so that those skilled in the art can better understand and implement the present invention. However, the embodiments described are not intended to limit the present invention.
[0069] Reference Figure 1The flowchart shown illustrates the steps of the target segmentation method for complex background images according to the present invention. The specific steps include:
[0070] S101: Fill the boundary of the image to be segmented to obtain the filled image to be segmented; smooth the filled image to be segmented to obtain the smoothed image to be segmented; use a preset sampling window to perform sliding sampling and vectorization on both the filled image to be segmented and the smoothed image to be segmented, and then perform downsampling to obtain the first downsampling matrix and the second downsampling matrix.
[0071] S102: Perform parallel clustering on all corresponding column vector pairs in the first downsampling matrix and the second downsampling matrix, obtain the membership degree of the center point of the preset sampling window corresponding to each pair of vectors to the background category and the foreground category, as well as the background category cluster center and the foreground category cluster center of the pixel value in the preset sampling window, and form the background membership vector and the foreground membership vector, as well as the background cluster center vector and the foreground cluster center vector of the image to be segmented and filled;
[0072] S103: Based on the background membership vector, background cluster center vector, foreground membership vector and foreground cluster center vector, construct the prefit denoising vector of the image to be segmented and filled;
[0073] S104: Rearrange and restore the size of the background cluster center vector, the foreground cluster center vector and the prefitted denoising vector to obtain the background prefitted feature map, the foreground prefitted feature map and the prefitted denoising image of the image to be segmented and filled. Combine the image to be segmented and filled to construct a global fidelity fitting term.
[0074] S105: Using JS divergence and Euclidean distance, the background prefit feature map and the foreground prefit feature map are combined with the prefitted denoised image for joint multiplicative metric analysis to obtain the background difference energy and the foreground difference energy, and to construct the local fitting term.
[0075] S106: Based on local fitting terms and global fidelity fitting terms, construct data-driven terms, iteratively update the initial level set function of the image to be segmented and filled until the updated level set function converges, obtain the target level set function, and generate the target contour line.
[0076] Specifically, in step S101 of this embodiment, obtaining the first downsampling matrix and the second downsampling matrix based on the image to be segmented includes:
[0077] S101-1: Perform boundary padding on the image to be segmented, and obtain the padded image to be segmented, including:
[0078] If the number of rows in the image to be segmented is even, then the image to be segmented is used as the fill image to be segmented;
[0079] If the number of rows in the image to be segmented is odd, then repeat a row at the bottom of the image to be segmented to obtain the filled image to be segmented;
[0080] S101-2: Smooth the image to be segmented and fill it to obtain the smoothed image to be segmented;
[0081] S101-3: After performing sliding sampling and vectorization on both the filled image and the smoothed image to be segmented using a preset sampling window, the first downsampling matrix and the second downsampling matrix are obtained through downsampling.
[0082] The process involves performing sliding sampling and vectorization on the image using a preset sampling window, followed by downsampling to obtain a downsampling matrix. This includes: performing sliding sampling on all pixels in the image using a preset sampling window; vectorizing the sampling results of the corresponding pixel and its neighborhood after each sliding motion to obtain the vector corresponding to each pixel and its neighborhood in the image; stacking the vectors corresponding to all pixels and their neighborhoods in the image column-wise to form a sampling matrix; and discarding the even-numbered columns in the sampling matrix to obtain the corresponding downsampling matrix.
[0083] Based on the above embodiments, in this embodiment, after obtaining the target level set function, the method further includes:
[0084] If the number of rows in the image to be segmented is even, then the target contour line is generated based on the target level set function, the image to be segmented is segmented, and the image segmentation result is obtained.
[0085] If the number of rows in the image to be segmented is odd, the vector corresponding to the last row of the image to be segmented in the target level set function is discarded, an optimized level set function is obtained, and a target contour line is generated based on the optimized level set function to segment the image and obtain the image segmentation result.
[0086] Specifically, in step S102 of this embodiment, fuzzy C-means clustering is used to perform parallel clustering on a pair of vectors in all corresponding columns of the first downsampling matrix and the second downsampling matrix based on a preset number of clustering iterations, including:
[0087] S102-1: The The first vector in the preset sampling window corresponding to the column Pixel pairs Membership of a category With the preset sampling window Cluster centers of categories , represented as:
[0088] ;
[0089] S102-2: After parallel clustering of vector pairs in all corresponding columns of the first and second downsampling matrices, obtain the center point of the corresponding preset sampling window for each vector pair. right Membership of a category , represented as: ;
[0090] S102-3: Based on vector pairs of all columns in the first and second downsampling matrices. and The following components make up the image to be segmented and filled:
[0091] Background membership vector , This indicates the first and second downsampling matrices. The membership degree of the center point of the preset sampling window corresponding to a pair of vectors in the column to the background category;
[0092] Foreground membership vector , This indicates the first and second downsampling matrices. The membership degree of the center point of the preset sampling window corresponding to a pair of vectors in the column to the foreground category;
[0093] Background cluster center vector , This indicates the first and second downsampling matrices. The cluster centers of the background categories in the preset sampling window corresponding to a pair of vectors in the column;
[0094] Foreground cluster center vector , This indicates the first and second downsampling matrices. The cluster centers of the foreground categories in the preset sampling window corresponding to a pair of vectors in the column;
[0095] in, , Time indicates background category, Time indicates the foreground category; ,and ; This indicates the pixel index within the preset sampling window. , This indicates the total number of pixels in the preset sampling window; For category index, the value is... ; When the value is 1, , When the value is 2, ; and These represent the first sample in the preset sampling window. The grayscale value of a pixel and its spatial neighborhood smoothing value, wherein the spatial neighborhood smoothing value is the value of the pixel after Gaussian filtering; Indicates spatial weights, Represents the fuzzy coefficient. This represents the summation operation; This represents the index of the corresponding column in the first and second downsampling matrices. , This represents the total number of pixels in the image to be segmented and filled. The symbol for L2 norm calculation.
[0096] The target segmentation method for complex background images described in this invention constructs sampling matrices for a filled image and a smoothed image to be segmented based on a preset sampling window and the image to be segmented, respectively. Downsampling is then used to obtain the corresponding downsampling matrices to reduce computation. Simultaneously, an improved fuzzy C-means clustering method based on parallelization and downsampling strategies is used to jointly cluster vector pairs in the same column of the two downsampling matrices. Joint clustering is performed using the preset sampling window as a local unit, preserving original details based on the filled image to be segmented and smoothing noise based on the smoothed image to be segmented. This forces corresponding pixels to maintain a consistent membership degree in both matrices, avoiding fitting errors caused by noise or detail loss in a single matrix. This effectively weakens the influence of background texture in complex background images, thus more accurately representing the feature differences between foreground and background in local regions. Furthermore, a rearrangement operator and bilinear interpolation are used to recover the full-size pre-fitted background feature map, pre-fitted foreground feature map, and pre-fitted denoised image, ensuring feature integrity. Neighborhood feature similarity is used to weaken isolated noise interference, further ensuring the accuracy of the target contour lines obtained iteratively, and improving image segmentation accuracy and efficiency.
[0097] Specifically, in step S103 of this embodiment, the prefitted denoising vector is expressed as:
[0098] ;
[0099] in, This represents the operation of multiplying elements at corresponding positions in a vector.
[0100] Specifically, in step S104 of this embodiment, the acquisition of the background prefit feature map, the foreground prefit feature map, and the prefitted denoised image includes:
[0101] S104-1: Utilizing the rearrangement operator For the background cluster center vector respectively Foreground cluster center vector With prefitted denoised vector According to the sampling order, the corresponding two-dimensional downsampled image is restored. , , , represented as: ;
[0102] S104-2: Using bilinear interpolation operators Size restoration is performed on the 2D downsampled image to obtain the background prefit feature map of the image to be segmented and filled. Foreground prefit feature map With prefitted denoised image ;
[0103] in, and They represent sizes of Background 2D downsampled image and foreground 2D downsampled image; Indicates size Downsampled prefitted denoised image; and They represent sizes of Background prefit feature map and foreground prefit feature map and These represent the number of rows and columns of the image to be segmented and filled, respectively. Indicates size is Prefitted denoised image.
[0104] Specifically, in step S105 of this embodiment, the acquisition of background difference energy and foreground difference energy includes:
[0105] S105-1: Calculate the background prefit feature maps respectively Foreground prefit feature map , with prefitted denoised image The Jensen-Shannon divergence is expressed as:
[0106] ;
[0107] S105-2: Based on the joint multiplicative metric analysis of Jensen-Shannon divergence and Euclidean distance, the dissimilarity energy is obtained, expressed as:
[0108] ;
[0109] in, This represents the operator for calculating the JS divergence; When it is 1, Indicates background difference energy; When it is 2, Indicates the energy of prospective difference; Fill the vector pixels within the image to be segmented; Point place Category prefit feature map eigenvalues The expression is ; For point The grayscale values of the prefitted denoised image; Based on Euler's constant Logarithmic operations with base 0; For Gaussian kernel function, , Gaussian kernel function standard deviation For the positional variable within the neighborhood, denoted as , Indicates Centered on, with side length as The square neighborhood, In order to make The constant; express Category prefit feature map With prefitted denoised image The square of the Euclidean distance; This represents the set of pixels in the image to be segmented and filled. This is for integration operations.
[0110] This invention introduces a joint multiplicative metric analysis of Jensen-Shannon divergence and Euclidean distance to obtain background and foreground difference energy. JS divergence is used to measure the distribution similarity between the prefitted denoised image and the prefitted background and foreground feature maps, while Euclidean distance measures pixel-level numerical differences. The joint multiplicative metric analysis of the two constructs a more accurate and stable difference energy based on distribution features and local details. This can effectively suppress false edges generated by structures similar to the target foreground in the background in complex background images, improve the accuracy of target contour lines, and thus ensure image segmentation accuracy and robustness.
[0111] Specifically, in step S106 of this embodiment, constructing a data-driven item includes:
[0112] S106-1: Energy Based on Background Differences Energy of difference with the prospect Constructing local fitting terms , represented as: ; A constant that is greater than zero;
[0113] S106-2: Construct a global fidelity fitting term based on the image to be segmented and filled, its background prefit feature map, foreground prefit feature map, and the prefitted denoised image. , represented as:
[0114] ;
[0115] in, , Points The feature values of the background prefit feature map and the foreground prefit feature map; For point The grayscale value of the image to be segmented and filled;
[0116] S106-3: Construct data-driven terms based on local fitting terms and global fidelity fitting terms, including:
[0117] Preset approximate Dirac Delta function , represented as , It is the circumference constant. The variables used in the calculation of the approximate Dirac Delta function;
[0118] Preset adaptive weight parameters , represented as ;
[0119] Preset adaptive energy scaling parameters , represented as , Let be the mean gray value of the pixels in the image to be segmented, denoted as . , This represents the set of pixels in the image to be segmented;
[0120] The data-driven term after the (n-1)th iteration , represented as:
[0121] ;
[0122] in, To adjust the weight parameters for the strength of data-driven items; It is the arctangent function; For the initial level set function The level set function after the (n-1)th iteration;
[0123] S106-4: Iteratively update the initial level set function using data-driven terms. The iterative update formula is as follows: ;
[0124] in, For the number of iterations, The target level set function is obtained after the nth iteration of the initial level set function. The representative window side length is Standard deviation is Gaussian filter; Let be the level set regularization function. The formula for calculating the level set regularization function is: , Let be the variables used to compute the level set regularization function. The symbol for absolute value calculation; A constant that is greater than zero. For time step.
[0125] This invention introduces a joint multiplicative metric analysis of Jensen-Shannon divergence and Euclidean distance to obtain background and foreground difference energy. JS divergence is used to measure the distribution similarity between the prefitted denoised image and the prefitted background and foreground feature maps, while Euclidean distance measures pixel-level numerical differences. The joint multiplicative metric analysis of the two constructs a more accurate and stable difference energy based on distribution features and local details. This can effectively suppress false edges generated by structures similar to the target foreground in the background in complex background images, improve the accuracy of target contour lines, and thus ensure image segmentation accuracy and robustness. This invention constructs a data-driven term based on local fitting and global fidelity fitting terms to iteratively update the initial contour line to obtain the target contour line. The local fitting term is constructed based on the background difference energy and foreground difference energy. Based on the difference between the prefitted denoised image and the background and foreground features, a steep energy gradient is formed in the target edge region, guiding the contour to converge quickly to the true boundary. The global fidelity fitting term combines the image to be segmented, the prefitted denoised image, and the prefitted feature maps of the background and foreground. By introducing the original grayscale constraint of the image to be segmented, it compensates for the loss of weak edges and details while smoothing noise using the prefitted denoised image, so as to ensure the effective preservation of image structure information during the segmentation process. The logarithmic operation of JS divergence is used to measure the consistency of global features to avoid contour deviation caused by local noise. The contribution ratio of the local fitting term and the global fidelity fitting term is automatically adjusted by adaptive weights, and the energy amplitude is scaled based on image information by energy scaling parameters to ensure that complex images with different brightness and contrast can evolve stably, thereby significantly improving the accuracy and robustness of image segmentation in complex background image segmentation.
[0126] Based on the above embodiments, in this embodiment of the invention, image segmentation is performed using the target segmentation method for complex background images provided by the present invention, and the specific steps include:
[0127] S201: Obtain the image to be segmented, perform size preprocessing, and use the initial level set function to form the initial contour line;
[0128] S201-1: Perform boundary padding on the image to be segmented to obtain a filled image to be segmented; boundary padding includes: if the number of rows in the image to be segmented is even, then the image to be segmented is used as the filled image to be segmented; if the number of rows in the image to be segmented is odd, then repeat a row at the bottom of the image to be segmented to obtain a filled image to be segmented, so as to ensure that the number of rows in the filled image to be segmented is even in subsequent processing.
[0129] S201-2: Let the initial level set function be... For vector pixels located within the initial contour line and its enclosed region, let For vector pixels located outside the region enclosed by the initial contour line, let ;in, Fill the vector pixels within the image to be segmented;
[0130] S201-3: On the image to be segmented after boundary padding, with a size of... The sampling window performs sliding sampling on all pixels, and then samples and vectorizes each neighboring window. Finally, the samples are stacked column-wise to form the first sampling matrix. The sampling window radius The calculation formula is: ;
[0131] Among them, the Gaussian kernel function is set. for: ; Gaussian kernel function In this embodiment, the standard deviation of is... The range of values is , For the positional variable within the neighborhood, denoted as , Indicates Centered on, with side length as The square neighborhood, In order to make constant, For integration operations; The symbol for L2 norm calculation;
[0132] S201-4: Apply a Gaussian kernel function to the image to be segmented and filled. After processing, according to the first sampling matrix Construct the second sampling matrix using the same steps. ;
[0133] S201-5: Discard the first sampling matrix The second sampling matrix The even-numbered sequence yields the first downsampled matrix after downsampling. Second downsampling matrix ; This represents the total number of pixels in the image to be segmented and filled. The calculation formula is: ; and These represent the number of rows and columns of the image to be segmented and filled, respectively.
[0134] S202: By using fuzzy C-means clustering improved based on parallelization and downsampling strategies, the foreground and background features of the image to be segmented are prefitted, and the prefitted denoised image is reconstructed.
[0135] S202-1: Regarding , A fuzzy C-means clustering operation based on parallelization and downsampling strategies is implemented. Based on a preset number of clustering iterations, the cluster center vectors of the background and foreground in the remaining sampling window are obtained iteratively. , And the membership vectors of the center point of the remaining sampling window to the background and foreground. , : ;
[0136] , , and They represent the first The membership degree of the center element of the sampling box to the background category and the foreground category in each local cluster; , , and They represent the first The cluster centers of the background and foreground categories in the first local cluster; the second... The local clustering represents the first and second subsampled matrices during parallelized clustering. Clustering a pair of vectors in a column;
[0137] The fuzzy C-means clustering operator, which incorporates spatial information, is calculated using the following formula:
[0138] ;
[0139] in, This indicates the total number of pixels in the preset sampling window. , Time indicates background category, Time indicates the foreground category; For category index, the value is... ; When the value is 1, , When the value is 2, ; This represents the index of the corresponding column in the first and second downsampling matrices. ; For the pixel index in the preset sampling window, Represents the fuzzy coefficient. Represents spatial weight, This represents the summation operation; For the first The pixel point is the first The membership degree of a class, satisfying ,and , ; and These represent the first sample in the preset sampling window. The grayscale value of a pixel and its spatial neighborhood smoothing value, wherein the spatial neighborhood smoothing value is the value of the pixel after Gaussian filtering;
[0140] S202-2: Softly combine the membership vector of the center point of the sampling window and the cluster center vector to obtain the prefitted denoising vector. : ; This indicates the element-wise multiplication operation of corresponding positions in a vector.
[0141] S202-3: Utilizing rearrangement operators Following the sampling order, the resulting column vectors are reconstructed into a two-dimensional downsampled image: ;
[0142] and They represent sizes of Background 2D downsampled image and foreground 2D downsampled image; Indicates size Downsampled prefitted denoised image; , Cluster center vectors for the background and foreground, respectively. This is the prefitted denoised vector; This indicates a rearrangement operator, which rearranges the resulting vector according to the sampling order. , , Restored to a two-dimensional downsampled image; , These are the membership vectors of the center point of the sampling window to the background and the foreground, respectively.
[0143] S202-4: Next, the bilinear interpolation operator is used. The downsampled feature map and the downsampled prefitted denoised map are resized to obtain the prefitted values of the background and foreground features. and prefitted denoised images ;
[0144] in, and They represent sizes of The full-size feature maps of the background and foreground, i.e., the background prefit feature map and the foreground prefit feature map; Indicates size is Prefitted denoised image;
[0145] S203: Jensen-Shannon divergence and Euclidean distance are introduced to perform joint multiplicative metric analysis on the three components of the prefitted foreground features, background features, and denoised image to obtain the differential energy, including:
[0146] S203-1: Calculation and , The Jensen-Shannon divergence is expressed as:
[0147] ;
[0148] in, This represents the operator for calculating the JS divergence; Point place Category prefit feature map eigenvalues The expression is ; For point The grayscale values of the prefitted denoised image;
[0149] S203-2: The Jensen-Shannon divergence is combined with the traditional Euclidean distance discrepancy measure to construct a discrepancy energy, expressed as:
[0150] ;
[0151] in, When it is 1, Indicates background difference energy; When it is 2, Indicates the energy of prospective difference; This represents the set of pixels in the image to be segmented and filled.
[0152] S204: Based on the prefit components and differential energy, construct data-driven terms that include local fitting terms and global fidelity fitting terms, including:
[0153] S204-1: Setting an approximate DiracDelta function The calculation formula is: , It is the circumference constant. The variables used for calculating the approximate DiracDelta function;
[0154] S204-2: Set the pre-computed local fitting term The expression is:
[0155] ;
[0156] in, A constant that is greater than zero. and These represent the difference energies between the prefitted background and foreground, respectively.
[0157] S204-3: Set the pre-computed global fidelity fitting term Its expression is:
[0158] ;
[0159] in, , Points Prefit values for background and foreground features, For point The grayscale value of the image to be segmented and filled. Based on Euler's constant Logarithmic operations with base 0;
[0160] S204-4: Setting Adaptive Weight Parameters The calculation formula is: ;
[0161] S204-5: Setting Adaptive Energy Scaling Parameters , represented as , For point The grayscale value of the image to be segmented and filled. Let the mean gray level of the pixels in the image to be segmented be denoted as . ;
[0162] S204-6: Set the data-driven term after the (n-1)th iteration , represented as:
[0163] ;
[0164] in, To adjust the weight parameters for the strength of data-driven items; It is the arctangent function;
[0165] S205: The initial level set function is iteratively updated using data-driven terms to obtain the final contour line, including:
[0166] S205-1: Set the update and iteration formula for the level set function as follows:
[0167] ;
[0168] in, For the number of iterations, The target level set function is obtained after the nth iteration of the initial level set function. The level set function is the level set function after the (n-1)th iteration of the initial level set function. The representative window side length is Standard deviation is Gaussian filter; Let be the level set regularization function. The formula for calculating the level set regularization function is: , Let be the variables used to compute the level set regularization function. The symbol for absolute value calculation; A constant that is greater than zero. For time step;
[0169] S205-2: During the process of updating and iterating the initial level set function using the data-driven term, when it is determined that the termination condition is met... When the time is reached, the level set function stops iterating, the target level set function is obtained, and the contour line generated by the target level set function is taken as the target contour line;
[0170] S206: Using the target contour line as the boundary, segment the image to be segmented and obtain the image segmentation result, including:
[0171] If the number of rows in the image to be segmented is even, then the image to be segmented is segmented based on the target contour line to obtain the image segmentation result;
[0172] If the number of rows in the image to be segmented is odd, the vector corresponding to the last row of the image to be segmented in the target level set function is discarded, an optimized level set function is obtained, and a target contour line is generated based on the optimized level set function to segment the image and obtain the image segmentation result.
[0173] This invention provides a target segmentation method for complex background images. It pre-fits foreground and background features using fuzzy C-means clustering, improved by parallelization and downsampling strategies, effectively reducing the influence of background texture in complex background images and thus more accurately representing the feature differences between foreground and background within local regions. Furthermore, it introduces a joint multiplicative metric analysis of Jensen-Shannon divergence and Euclidean distance, effectively suppressing false edges generated by structures similar to the target foreground in the background. Moreover, by fusing local and global energy data-driven terms, the energy ratio can be automatically adjusted according to the size of different Gaussian kernel functions, significantly improving the accuracy and robustness of the model in complex background image segmentation.
[0174] The target segmentation method for complex background images described in this invention constructs sampling matrices for a filled image and a smoothed image to be segmented based on a preset sampling window and the image to be segmented, respectively. Downsampling is then used to obtain the corresponding downsampling matrices to reduce computation. Simultaneously, an improved fuzzy C-means clustering method based on parallelization and downsampling strategies is used to jointly cluster vector pairs in the same column of the two downsampling matrices. Joint clustering is performed using the preset sampling window as a local unit, preserving original details based on the filled image to be segmented and smoothing noise based on the smoothed image to be segmented. This forces corresponding pixels to maintain a consistent membership degree in both matrices, avoiding fitting errors caused by noise or detail loss in a single matrix. This effectively weakens the influence of background texture in complex background images, thus more accurately representing the feature differences between foreground and background in local regions. Furthermore, a rearrangement operator and bilinear interpolation are used to recover the full-size pre-fitted background feature map, pre-fitted foreground feature map, and pre-fitted denoised image, ensuring feature integrity. Neighborhood feature similarity is used to weaken isolated noise interference, further ensuring the accuracy of the target contour lines obtained iteratively, and improving image segmentation accuracy and efficiency.
[0175] This invention introduces a joint multiplicative metric analysis of Jensen-Shannon divergence and Euclidean distance to obtain background and foreground difference energy. JS divergence is used to measure the distribution similarity between the prefitted denoised image and the prefitted background and foreground feature maps, while Euclidean distance measures pixel-level numerical differences. The joint multiplicative metric analysis of the two constructs a more accurate and stable difference energy based on distribution features and local details. This can effectively suppress false edges generated by structures similar to the target foreground in the background in complex background images, improve the accuracy of target contour lines, and thus ensure image segmentation accuracy and robustness.
[0176] This invention constructs a data-driven term based on local fitting and global fidelity fitting terms to iteratively update the initial contour line and obtain the target contour line. The local fitting term is constructed based on the background difference energy and foreground difference energy. Based on the difference between the prefitted denoised image and the background and foreground features, a steep energy gradient is formed in the target edge region, guiding the contour to converge quickly to the true boundary. The global fidelity fitting term combines the image to be segmented, the prefitted denoised image, and the prefitted feature maps of the background and foreground. By introducing the original grayscale constraint of the image to be segmented, it compensates for the loss of weak edges and details while smoothing noise using the prefitted denoised image, so as to ensure the effective preservation of image structural information during the segmentation process. The logarithmic operation of JS divergence is used to measure the consistency of global features to avoid contour deviation caused by local noise. The contribution ratio of the local fitting term and the global fidelity fitting term is automatically adjusted by adaptive weights, and the energy amplitude is scaled based on the image grayscale mean by the energy scaling parameter to ensure that complex images with different brightness and contrast can evolve stably, thereby significantly improving the accuracy and robustness of image segmentation in complex background image segmentation.
[0177] In this embodiment, image segmentation simulation experiments were conducted using the method described in this application and the existing APFJDACM (adaptive pre-fitting function Jeffreys divergence active contour model), and the experimental results were compared.
[0178] All experiments were implemented in MATLAB 2024a on a 2.60 GHz Intel Core i5 PC. The images used for segmentation in all experiments were from the Weizmann dataset. In all experiments, the segmentation accuracy of each model was quantitatively compared using two evaluation metrics: IoU (Intersection over Union) and DSC (Dice Similarity Coefficient). IoU is defined as... The definition of DSC is ,in, These are the target regions segmented by various models in the experiment. These are standard target regions provided in the Weizmann dataset. The closer the DSC and IoU values are to 1, the higher the segmentation accuracy. In this embodiment, the fixed parameters of this application are set to: , , , The preset clustering iteration count is 10; this application sets corresponding adjustable parameters for different complex background images. Specifically, the adjustable parameter values for the first image to be segmented are as follows: , , , The adjustable parameters for the second image to be segmented are as follows: , , , The adjustable parameters for the third image to be segmented are as follows: , , , The adjustable parameters for the fourth image to be segmented are as follows: , , , .
[0179] Four images with complex backgrounds were selected from the Weizmann dataset, and segmented using both the APFJDACM method provided in the journal "Expert Systems With Applications" and the method of this invention. The results are as follows. Figures 2 to 5 As shown. (Refer to...) Figure 2 The image shown is a comparative diagram of the segmentation results of the first image to be segmented based on this application and existing methods; see reference. Figure 3 The image shown is a comparative diagram of the segmentation results of the second image to be segmented based on this application and existing methods; see reference. Figure 4 The image shown is a comparative diagram of the segmentation results of the third image to be segmented based on this application and existing methods; see reference. Figure 5 As shown, this is a schematic diagram comparing the segmentation results of the fourth image to be segmented based on the present application and existing methods; in the figure, the green rectangle represents the initial outline, and the red outline represents the final segmentation curve. Figures 2 to 5 In the table, from left to right, are the image to be segmented and its initial contour line, the segmentation result of APFJDACM, and the segmentation result of this application. It can be seen that APFJDACM is susceptible to interference from complex backgrounds, resulting in oversegmentation or undersegmentation, while the results of this invention are more ideal. Furthermore, a comparison of the IoU and DSC of segmenting these four images using APFJDACM and the method described in this invention is shown in Table 1. This invention demonstrates superior segmentation accuracy.
[0180] Table 1. Comparison of IoU and DSC (IoU / DSC) for segmenting four images with complex backgrounds using APFJDACM and the method described in this invention.
[0181] Image to be segmented APFJDACM This invention First picture 0.9149 / 0.9556 0.9359 / 0.9669 Second picture 0.8986 / 0.9466 0.9222 / 0.9595 The third one 0.9493 / 0.9740 0.9587 / 0.9789 Fourth 0.8448 / 0.9159 0.9022 / 0.9486
[0182] This application prefits the foreground and background information of an image using fuzzy C-means clustering improved by parallelization and downsampling strategies, weakening the interference of complex background textures on the fitting information. This allows for accurate fitting and calculation of foreground and background information in images with complex backgrounds. Furthermore, it introduces Jensen-Shannon divergence and Euclidean distance to perform a joint multiplicative metric on the fitting results, enhancing the performance of this application in accurately extracting target edges from complex background images, thereby improving the segmentation accuracy of this application for such images. In addition, this application constructs a data-driven term consisting of a local fitting term and a global fidelity fitting term, which can adaptively adjust the weights of the two in the data-driven term according to the size of the selected local region, improving the accuracy and robustness of this application when segmenting images with complex backgrounds.
[0183] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0184] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0185] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0186] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0187] Obviously, the above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.
Claims
1. A method for target segmentation of complex background images, characterized in that, The method comprises the following steps: boundary padding is performed on the image to be segmented to obtain a padding image to be segmented; the padding image to be segmented is smoothed to obtain a smoothed image to be segmented; a preset sampling window is used to perform sliding sampling and vectorization on the padding image to be segmented and the smoothed image to be segmented respectively, and then down-sampling is performed to obtain a first down-sampling matrix and a second down-sampling matrix; all corresponding vector pairs in the first down-sampling matrix and the second down-sampling matrix are parallelized and clustered to obtain the membership degrees of the center points of the preset sampling window corresponding to each vector pair to the background class and the foreground class, and the background class clustering center and the foreground class clustering center of the pixel values in the preset sampling window, which are combined to form a background membership vector and a foreground membership vector of the padding image to be segmented, and a background clustering center vector and a foreground clustering center vector; based on the background membership vector, the background clustering center vector, the foreground membership vector and the foreground clustering center vector, a pre-fitting denoising vector of the padding image to be segmented is constructed; the background clustering center vector, the foreground clustering center vector and the pre-fitting denoising vector are rearranged and restored to the original size to obtain a background pre-fitting feature map, a foreground pre-fitting feature map and a pre-fitting denoising image of the padding image to be segmented, which are combined with the padding image to be segmented to construct a global fidelity fitting term; the background pre-fitting feature map and the foreground pre-fitting feature map are respectively combined with the pre-fitting denoising image for joint multiplicative measurement analysis by using the JS divergence and the Euclidean distance to obtain a background difference performance energy and a foreground difference performance energy, and a local fitting term is constructed; based on the local fitting term and the global fidelity fitting term, a data-driven term is constructed, and an initial level set function of the padding image to be segmented is iteratively updated until the updated level set function converges, so that a target level set function is obtained, and a target contour line is generated.
2. The method for object segmentation of complex background images according to claim 1, characterized in that, The method comprises the following steps: if the number of rows of the image to be segmented is even, the image to be segmented is used as the padding image to be segmented; if the number of rows of the image to be segmented is odd, a row is repeatedly filled at the bottom of the image to be segmented to obtain the padding image to be segmented.
3. The method for object segmentation of complex background images according to claim 2, characterized in that, After the target level set function is obtained, the method comprises the following steps: if the number of rows of the image to be segmented is even, the target contour line is generated based on the target level set function, the image to be segmented is segmented, and an image segmentation result is obtained; if the number of rows of the image to be segmented is odd, the vector corresponding to the last row of the padding image to be segmented in the target level set function is discarded to obtain an optimized level set function, the target contour line is generated based on the optimized level set function, the image to be segmented is segmented, and an image segmentation result is obtained.
4. The method for object segmentation of complex background images according to claim 1, wherein, The method comprises the following steps: the preset sampling window is used to perform sliding sampling on the image, and then vectorization is performed on the sampling results of each time of sliding and the neighborhood of the corresponding pixel points to obtain vectors corresponding to each pixel point and its neighborhood in the image; all the vectors corresponding to the pixel points and their neighborhoods in the image are stacked by columns to form a sampling matrix; even columns in the sampling matrix are discarded to obtain a corresponding down-sampling matrix.
5. The method for object segmentation of complex background images according to claim 1, wherein, Parallel clustering of all corresponding column vector pairs in the first down-sampling matrix and the second down-sampling matrix is performed using fuzzy C-means clustering operation, including: Using fuzzy C-means clustering, and based on a preset number of clustering iterations, parallel clustering is performed on all pairs of vectors in corresponding columns of the first and second downsampling matrices; where the... The first vector in the preset sampling window corresponding to the column Pixel pairs Membership of a category With the preset sampling window Cluster centers of categories , is represented as: ; After the parallelization clustering of all corresponding vector pairs of columns in the first down-sampling matrix and the second down-sampling matrix is finished, for all vector pairs, a center point of a preset sampling window corresponding to the vector pair is obtained to membership of the class ; based on vector pairs of all columns of the first down-sampling matrix and the second down-sampling matrix with , which compose the padding image to be segmented: Background membership vector , This indicates the first and second downsampling matrices. The membership degree of the center point of the preset sampling window corresponding to a pair of vectors in the column to the background category; Foreground membership vector , This indicates the first and second downsampling matrices. The membership degree of the center point of the preset sampling window corresponding to a pair of vectors in the column to the foreground category; background cluster center vector , represents a cluster center of a background class in a preset sampling window corresponding to a pair of vectors of a first down-sampling matrix and a second down-sampling matrix column foreground cluster center vector , represents a cluster center of a foreground class in a preset sampling window corresponding to a pair of vectors of a first down-sampling matrix and a second down-sampling matrix column in, , Time indicates the background category, Time indicates the foreground category; ,and ; This indicates the pixel index within the preset sampling window. , This indicates the total number of pixels in the preset sampling window; For category index, the value is... ; When the value is 1, , When the value is 2, ; and These represent the first sample in the preset sampling window. The grayscale value of a pixel and its spatial neighborhood smoothing value, wherein the spatial neighborhood smoothing value is the value of the pixel after Gaussian filtering; Indicates spatial weights, Represents the fuzzy coefficient. This represents the summation operation; This represents the index of the corresponding column in the first and second downsampling matrices. , This represents the total number of pixels in the image to be segmented and filled. The symbol for L2 norm calculation.
6. The method for object segmentation of complex background images according to claim 5, characterized in that, The background cluster center vector, the foreground cluster center vector, and the pre-fitting denoising vector are rearranged and size-restored to obtain a background pre-fitting feature map, a foreground pre-fitting feature map, and a pre-fitting denoising image of the image to be segmented and filled, including: Using a rearrangement operator Respectively, the background cluster center vector , the foreground cluster center vector , and the pre-fitted denoising vector , are restored into the corresponding two-dimensional down-sampled maps , , , denoted as: ; Using bilinear interpolation operators Size recovery is performed on the two-dimensional down-sampled map to obtain a background pre-fitted feature map of the image to be segmented and filled , a foreground pre-fitted feature map , and a pre-fitted denoised image ; wherein, represents a pre-fitted denoising vector of the filled image to be segmented, expressed as , represents an operation of multiplying elements at corresponding positions of vectors; and respectively represent a background two-dimensional down-sampling map and a foreground two-dimensional down-sampling map, both having a size of ; represents a down-sampled pre-fitted denoising image having a size of ; and respectively represent a background pre-fitted feature map and a foreground pre-fitted feature map, both having a size of ; and respectively represent a number of rows and a number of columns of the filled image to be segmented; represents a pre-fitted denoising image having a size of .
7. The method for object segmentation of complex background images according to claim 6, characterized in that, The background pre-fitting feature map and the foreground pre-fitting feature map are respectively subjected to joint multiplicative metric analysis with the pre-fitting denoising image using JS divergence and Euclidean distance to obtain background difference performance energy and foreground difference performance energy, including: respectively, of the background pre-fitted feature map , foreground pre-fitted feature map , and pre-fitted denoised image JS divergence, denoted as: ; Joint multiplicative metric analysis is performed based on Jensen-Shannon divergence and Euclidean distance to obtain difference performance energy, expressed as: ; wherein, represents an operator for calculating JS divergence; is 1, represents background difference energy; is 2, represents foreground difference energy; is a vector pixel point within a filling image to be segmented; represents a point class pre-fitting feature map feature value, the expression of is ; is a gray value of a pre-fitting denoising image at a point ; is a logarithm operation with Euler constant as a base; is a Gaussian kernel function, , is a standard deviation of the Gaussian kernel function , is a position variable within a neighborhood, denoted as , represents a square neighborhood with as a center and a side length of , is a constant for making ; represents a square of the Euclidean distance between class pre-fitting feature map and pre-fitting denoising image ; represents a set of pixel points in a filling image to be segmented, is an integral operation.
8. The method for object segmentation of complex background images according to claim 7, characterized in that, A local fitting term and a global fidelity fitting term are constructed, including: Based on background difference energy With foreground difference energy , constructing a local fitting term , denoted as: ; Based on the image to be segmented and filled, its prefitted background feature map, prefitted foreground feature map, and prefitted denoised image, a global fidelity fitting term is constructed. , is represented as: ; wherein, is a constant greater than zero, , are eigenvalues of the background pre-fitted feature map and the foreground pre-fitted feature map at the point , respectively; is a gray value of the to-be-segmented filled image at the point .
9. The method for object segmentation of complex background images according to claim 8, characterized in that, A data-driven term is constructed based on the local fitting term and the global fidelity fitting term, including: Predefined approximation of the Dirac Delta function , is denoted as , is the circular constant, is a calculation variable of the approximation of the Dirac Delta function; Pre-set adaptive weight parameter , is expressed as ; Pre-set adaptive energy scaling parameter , is expressed as , is the mean value of the gray scale of the pixel points in the filling image to be segmented, is expressed as ; data driven term after the (n-1)th iteration is represented as: ; wherein, is a weight parameter for adjusting the intensity of the data driven term; is an arctangent function; is an initial level set function is the level set function after the n-1th iteration.
10. The method for object segmentation of complex background images according to claim 9, characterized in that, The initial level set function of the image to be segmented and filled is iteratively updated using the data-driven term, expressed as: ; wherein, is the iteration number, is the target level set function of the initial level set function of the filling image to be segmented after the n-th iteration, represents a Gaussian filter with a window side length of and a standard deviation of ; is a level set regularization function, and the calculation formula of the level set regularization function is , is a calculation variable of the level set regularization function, is an absolute value calculation symbol; is a constant greater than zero, is a time step.
Citation Information
Patent Citations
Finger vein image segmentation method based on improved active contour algorithm
CN114677395A
Visual detection method for wind turbine generator blade surface damage in complex scene
CN117764979A