Image segmentation method, device, electronic device and storage medium based on improved NCM
By improving the Neutrosophic Fuzzy C-means clustering algorithm, the image is converted from the spatial domain to the Neutrosophic domain. By using the improved distance metric and objective function, the problem of the Fuzzy C-means clustering algorithm being sensitive to noise is solved, and the accuracy and robustness of image segmentation are improved.
Patent Information
- Application Number
- CN202310759598.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-26
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2043-06-26
AI Technical Summary
The existing fuzzy C-means clustering algorithm is sensitive to noise, and the accuracy of image segmentation still needs to be improved, especially when processing complex image scenes.
An improved neutrosophic fuzzy C-means clustering method is used to transform the image from the spatial domain to the neutrosophic domain. The image segmentation is performed by combining the fuzzy membership, uncertain membership and non-membership through an improved distance measurement formula and objective function.
The accuracy and robustness of image segmentation are improved, noise can be better processed, and the segmentation effect of complex image scenes is enhanced.
Smart Images

Figure CN116777924B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image segmentation technology, and in particular to an image segmentation method, device, electronic device and storage medium based on an improved NCM. Background Art
[0002] Image segmentation is a key task in computer vision, aiming to divide an image into regions or objects with similar features. Among early image segmentation methods, pixel-based threshold segmentation is one of the simplest and most commonly used. However, threshold-based methods are often sensitive to lighting variations and noise, and cannot handle complex image scenes. With the development of computer technology and the deepening of research, more image segmentation methods have emerged. These methods are based on different principles and techniques, including edge-based, region-based, and clustering-based methods.
[0003] The fuzzy C-means clustering algorithm ([1] Dunn, A fuzzy image processing method related to iterative self-organizing analysis algorithm and its application to the detection of compact and separable clusters [J]. Journal of Cybernetics, 1973, 3(3): 32-57) is one of the classic clustering algorithms. The algorithm divides image pixels into different clusters so that pixels in the same cluster have similar features, while the features between different clusters are quite different. Compared with the traditional hard clustering algorithm, the fuzzy C-means clustering algorithm introduces the concept of fuzziness, so that each pixel can belong to multiple clusters and be assigned corresponding membership. This enables the fuzzy C-means clustering algorithm to better handle fuzzy boundaries and mixed areas in the image. Although the fuzzy C-means clustering method has certain advantages in image segmentation, it also has some disadvantages, including sensitivity to initial parameters, noise and outliers.
[0004] Therefore, scholars have proposed a variety of improved fuzzy C-means clustering algorithms, including a fuzzy C-means clustering algorithm based on spatial constraints ([2] Ahmed, Yamani, Mohadi, Farage, Moriarty, An improved fuzzy C-means algorithm for bias field estimation and segmentation of MRI data [J]. IEEE Journal of Medical Imaging, 21(3)(2002)193–199), a fuzzy C-means clustering algorithm based on hidden Markov random fields ([3] Chazis, Vavargu, A fuzzy clustering method for enhancing the hidden Markov random field model for spatially constrained image segmentation [J]. IEEE Transactions on Fuzzy Systems, 16(5)(2008)1351–1361), and a robust fuzzy local information C-means clustering algorithm ([4] S Krinidis, Chazis, A robust fuzzy local information C-means clustering algorithm [J]. IEEE Journal of Image Processing, 19(5)(2010)1328–1337). Although the improved fuzzy C-means clustering algorithm takes into account the neighborhood information of the image, the fuzzy set only uses the membership degree to express the positive information that an element belongs to the set, and lacks the ability to express uncertain information.
[0005] Neutronolytic sets, as a generalization of fuzzy sets, have advantages over fuzzy sets and are more powerful in processing and describing uncertain and fuzzy information. In 2015, Guo Yanhui et al. introduced the Neutronolytic set into the traditional fuzzy C-means clustering algorithm based on its characteristic of considering uncertainty ([5] Guo Yanhui, Abdulkadir Senger, NCM: Neutronolytic Logic C-means Clustering Algorithm [J]. Pattern Recognition, 48(8)(2015)2710–2724), and proposed the Neutronolytic Fuzzy C-means Clustering Algorithm. Compared with the Fuzzy C-means Clustering Algorithm, the Neutronolytic Fuzzy C-means Clustering Algorithm effectively processes uncertain information and obtains a more accurate segmentation effect. However, the algorithm still has certain shortcomings: it is sensitive to noise, and the accuracy of image segmentation needs to be improved. Summary of the Invention
[0006] The purpose of the present invention is to provide an image segmentation method, device, electronic device and computer-readable storage medium based on improved neutrosophic fuzzy C-means clustering, which can enhance the robustness to noise and effectively improve the quality of image segmentation.
[0007] To achieve the above object, the present invention proposes the following technical solution: an image segmentation method based on improved NCM, comprising the following steps:
[0008] S1: Acquire an image to be segmented, neutralize the original image, and determine whether the original image is a grayscale image. If the original image is not a grayscale image, first convert the original image into a grayscale image and then convert the converted grayscale image from the spatial domain to the neutral intelligence domain to obtain a neutral intelligence image. If the original image is a grayscale image, convert the original image from the spatial domain to the neutral intelligence domain to obtain a neutral intelligence image.
[0009] S2: Segment the neutral image to generate a segmented image of the image to be segmented.
[0010] Preferably, the method for determining whether the original image is a grayscale image in S1 is:
[0011] Use the image processing library to load the image and check the number of channels. A grayscale image has only one channel, which represents brightness information. If the number of channels is 1, the original image is determined to be a grayscale image. If the number of channels is 3, the original image is determined to be a non-grayscale image.
[0012] Preferably, the method for converting the original image that is not a grayscale image into a grayscale image in S1 is:
[0013] Weighted average method: gray_value = 0.2989*R + 0.5870*G + 0.1140*B, where gray_value is the grayscale value, R is the custom red brightness value, G is the custom green brightness value, and B is the custom blue brightness value.
[0014] Preferably, another method for converting the original image that is not a grayscale image into a grayscale image in S1 is:
[0015] Use color conversion function: Select a color conversion function from the image processing library to convert a non-grayscale image into a grayscale image.
[0016] Preferably, after obtaining the grayscale image, the grayscale image is converted from the spatial domain to the neutral domain by the following steps and formulas to obtain the neutral image, in which the pixel P NS (i, j) is determined by three neutral elements: T(i, j), I(i, j) and F(i, j):
[0017] P NS (i,j)={F(i,j),I(i,j),F(i,j)}
[0018] Among them, the representation of the neutrosophic elements T, I and F is:
[0019]
[0020] in,
[0021]
[0022]
[0023] g(i, j) represents the grayscale value of pixel p(i, j) in the grayscale image. is the w×w regional mean of the grayscale value g(i, j), and the value of the pixel area w satisfies w=2N+1(N≥1), δ(i, j) is the sum of g(i, j) and The absolute difference between , M×N represents the size of the image, i=1, 2, ..., M, j=1, 2, ..., N, M and N are positive natural numbers.
[0024] Preferably, clustering is used to segment the neutrosophic image obtained in S1.
[0025] A distance measurement formula is proposed:
[0026]
[0027] Where p and λ are any positive real numbers, ρ=(λ+1) p / 3, 0≤σ≤2,
[0028] The objective function of the improved Neutrosophic Fuzzy C-means clustering algorithm using this distance metric is defined as follows:
[0029]
[0030]
[0031] Where m is the fuzzy weighted index, p i and q i Represent the number of clusters with the largest and second largest membership respectively, and the calculation is The value of is a constant at each pixel, n is the number of elements in the data set, c is the number of cluster centers (1<c<n), ω i is the weighting factor (ω1+ω2+ω3=1), ω1 is the weighting factor of the membership degree, ω2 is the weighting factor of the uncertain boundary area, ω3 is the weighting factor of the noise area, d(x i , v j ) represents the distance between the i-th sample and the j-th cluster center, and finally the fuzzy membership of the sample T is obtained. ij , uncertain membership I i , non-membership degree F i and cluster center v j as follows:
[0032]
[0033]
[0034]
[0035]
[0036] in,
[0037]
[0038] The specific segmentation steps are:
[0039] S2.1: Initialization parameters: Give the initial cluster center C and initialize the membership matrix T 0 , I 0 , F 0 , set the number of cluster categories c, spatial constraint parameter β, fuzzy weighted index m, σ in the kernel function, neighborhood radius r, iteration stop threshold ε, maximum number of iterations δ, and membership weight factors ω1, ω2, ω3;
[0040] S2.2: Calculate cluster center v k , k=1,2,...,j;
[0041] S2.3: Calculate the two largest values of membership T, and calculate
[0042] S2.4: Update fuzzy membership T k , uncertain membership I k and non-membership F k ;
[0043] S2.5: Determine whether the iteration stop condition |T is reached k+1 -T k |<ε, if the condition is met, stop the loop; otherwise, return to step S2.1;
[0044] S2.6: Complete clustering based on the maximum membership principle.
[0045] The present invention also provides an image segmentation device based on the improved NCM, the device comprising:
[0046] an acquisition module, the acquisition module being configured to acquire an image to be segmented, neutralize the original image, and determine whether the original image is a grayscale image. If the original image is not a grayscale image, the original image is first converted into a grayscale image and then the converted grayscale image is converted from a spatial domain to a neutral domain to obtain a neutral image. If the original image is a grayscale image, the original image is converted from a spatial domain to a neutral domain to obtain a neutral image.
[0047] An image segmentation module is used to segment the Neutral Intelligence image acquired by the acquisition module using an improved NCM image segmentation method to generate a segmented image of the image to be segmented.
[0048] The present invention also provides an electronic device, comprising a memory, a processor, and computer instructions stored in the memory and running on the processor. When the computer instructions are run by the processor, the image segmentation method based on the improved NCM as described in any one of claims 1 to 4 is implemented.
[0049] The present invention also provides a storage medium storing a computer program. When the computer program is run on a computer, the computer is enabled to execute the image segmentation method based on the improved NCM according to any one of claims 1 to 4.
[0050] Beneficial effects:
[0051] As can be seen from the above technical solutions, the technical solutions of the present invention provide an image segmentation method, device, electronic device, and computer-readable storage medium based on improved neutrosophic fuzzy C-means clustering. The image segmentation method based on improved neutrosophic fuzzy C-means clustering of the present invention uses neutrosophic theory to convert the original image into a grayscale image and then into a neutrosophic image to reduce the noise in the image; then the improved neutrosophic fuzzy C-means clustering algorithm is applied to the neutrosophic image to enhance the robustness to image noise and improve the image segmentation accuracy. The distance metric used in the image segmentation method based on improved neutrosophic fuzzy C-means clustering of the present invention can improve segmentation accuracy compared to the Euclidean distance in the original neutrosophic fuzzy C-means clustering algorithm.
[0052] The present invention has the advantages of fewer processing steps and higher segmentation accuracy.
[0053] It should be appreciated that all combinations of the foregoing concepts, as well as additional concepts described in greater detail below, to the extent such concepts are not mutually inconsistent, can be considered to be part of the inventive subject matter of this disclosure.
[0054] The foregoing and other aspects, embodiments, and features of the present invention will be more fully understood from the following description in conjunction with the accompanying drawings. Other additional aspects of the present invention, such as features and / or beneficial effects of the exemplary embodiments, will become apparent from the following description or through practice of specific embodiments according to the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] The accompanying drawings are not drawn to scale. In the accompanying drawings, each identical or nearly identical component shown in various figures may be represented by the same reference numeral. For clarity, not every component is labeled in every figure. Embodiments of various aspects of the present invention will now be described by way of example with reference to the accompanying drawings, in which:
[0056] Figure 1 This is a flow chart of the image segmentation method based on the improved NCM of the present invention.
[0057] Figure 2 This is a comparison chart of the segmentation results of the present invention and the existing method on the Berkeley segmentation dataset and the image numbered 86016 in the benchmark.
[0058] Figure 3 Schematic diagram of the structure of the image segmentation device based on the improved NCM of the present invention.
[0059] Figure 4 Schematic diagram of the structure of the electronic device of the present invention. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings of the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the described embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. Unless otherwise defined, the technical terms or scientific terms used herein should be the common meanings understood by people with ordinary skills in the field to which the present invention belongs.
[0061] The words “first”, “second” and similar words used in the patent application specification and claims of the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, unless the context clearly indicates otherwise, the singular forms of “a”, “an” or “the” and similar words do not indicate a quantity limitation, but rather indicate the presence of at least one. Words such as “include” or “comprise” mean that the elements or objects appearing before “include” or “comprises” cover the features, wholes, steps, operations, elements and / or components listed after “include” or “comprises”, and do not exclude the existence or addition of one or more other features, wholes, steps, operations, elements, components and / or their collections. “Up”, “down”, “left”, “right” and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0062] The disclosure below provides many different embodiments or examples for implementing different structures of the present application. In order to simplify the disclosure of the present application, the components and settings of specific examples are described below. Of course, these are merely examples and are not intended to limit the present application. In addition, the present application may repeat reference numbers and / or reference letters in different examples. Such repetition is for the purpose of simplicity and clarity and does not in itself indicate the relationship between the various embodiments and / or settings discussed.
[0063] Neutral intelligence sets, as a generalization of fuzzy sets, offer advantages over fuzzy sets, including greater capabilities for handling and describing uncertain and ambiguous information. In 2015, Guo Yanhui et al., building on the uncertainty-accepting nature of Neutral Intelligence Sets, incorporated them into the traditional fuzzy C-means clustering algorithm, proposing the Neutral Intelligence Fuzzy C-means clustering algorithm. Compared to the fuzzy C-means clustering algorithm, the Neutral Intelligence Fuzzy C-means clustering algorithm effectively handles uncertain information, resulting in more accurate segmentation results. However, this algorithm still has certain limitations: it is sensitive to noise, and its image segmentation accuracy still needs improvement.
[0064] The present invention proposes the following technical solution: providing an image segmentation method based on an improved NCM, comprising the following steps:
[0065] S1: Acquire an image to be segmented, neutralize the original image, and determine whether the original image is a grayscale image. If the original image is not a grayscale image, first convert the original image into a grayscale image and then convert the converted grayscale image from the spatial domain to the neutral intelligence domain to obtain a neutral intelligence image. If the original image is a grayscale image, convert the original image from the spatial domain to the neutral intelligence domain to obtain a neutral intelligence image.
[0066] S2: Segment the neutral image to generate a segmented image of the image to be segmented.
[0067] The method for determining whether the original image is a grayscale image in S1 is:
[0068] Use the image processing library to load the image and check the number of channels. A grayscale image has only one channel, which represents brightness information. If the number of channels is 1, the original image is determined to be a grayscale image. If the number of channels is 3, the original image is determined to be a non-grayscale image.
[0069] The method for converting the original image that is not a grayscale image into a grayscale image in S1 is:
[0070] Weighted average method: gray_value = 0.2989*R + 0.5870*G + 0.1140*B, where gray_value is the grayscale value, R is the custom red brightness value, G is the custom green brightness value, and B is the custom blue brightness value.
[0071] Another method for converting the original image that is not a grayscale image into a grayscale image in S1 is:
[0072] Use color conversion function: Select a color conversion function from the image processing library to convert a non-grayscale image into a grayscale image.
[0073] After obtaining the grayscale image, the grayscale image is converted from the spatial domain to the neutral domain through the following steps and formulas to obtain the neutral image. In the neutral image, the pixel P NS (i, j) is determined by three neutrosophic elements: T(i, j), I(i, j) and F(i, j):
[0074] P NS (i,j)={T(i,j),I(i,j),F(i,j)}
[0075] Among them, the representation of the neutrosophic elements T, I and F is:
[0076]
[0077] in,
[0078]
[0079]
[0080] g(i, j) represents the grayscale value of pixel p(i, j) in the grayscale image. is the w×w regional mean of the grayscale value g(i, j), and the value of the pixel area w satisfies w=2N+1(N≥1), δ(i, j) is the sum of g(i, j) and The absolute difference between , M×N represents the size of the image, i=1, 2, ..., M, j=l, 2, ..., N, M and N are positive natural numbers.
[0081] The neutrosophic image obtained in S1 is segmented by clustering.
[0082] A distance measurement formula is proposed:
[0083]
[0084] Where p and λ are any positive real numbers, ρ=(λ+1) p / 3, 0≤σ≤2,
[0085] The objective function of the improved Neutrosophic Fuzzy C-means clustering algorithm using this distance metric is defined as follows:
[0086]
[0087]
[0088] Where m is the fuzzy weighted index, p i and q i Represent the number of clusters with the largest and second largest membership respectively, and the calculation is The value of is a constant at each pixel, n is the number of elements in the data set, c is the number of cluster centers (1<c<n), ω i is the weighting factor (ω1+ω2+ω3=1), ω1 is the weighting factor of the membership degree, ω2 is the weighting factor of the uncertain boundary area, ω3 is the weighting factor of the noise area, d(x i , v j ) represents the distance between the i-th sample and the j-th cluster center, and finally the fuzzy membership of the sample T is obtained. ij , uncertain membership I i , non-membership degree F i and cluster center v j as follows:
[0089]
[0090]
[0091]
[0092]
[0093] in,
[0094]
[0095] The specific segmentation steps are:
[0096] S2.1: Initialization parameters: Give the initial cluster center C and initialize the membership matrix T 0 , I 0 , F 0 , set the number of cluster categories c, spatial constraint parameter β, fuzzy weighted index m, σ in the kernel function, neighborhood radius r, iteration stop threshold ε, maximum number of iterations δ, and membership weight factors ω1, ω2, ω3;
[0097] S2.2: Calculate cluster center v k , k=1,2,...,j;
[0098] S2.3: Calculate the two largest values of membership T, and calculate
[0099] S2.4: Update fuzzy membership T k , uncertain membership Ik and non-membership F k ;
[0100] S2.5: Determine whether the iteration stop condition |T is reached k+1 -T k |<ε, if the condition is met, stop the loop; otherwise, return to step S2.1;
[0101] S2.6: Complete clustering based on the maximum membership principle.
[0102] The image segmentation method based on improved neutrosophic fuzzy C-means clustering of the present invention utilizes neutrosophic theory to convert the original image into a grayscale image and then into a neutrosophic image, thereby reducing image noise. The improved neutrosophic fuzzy C-means clustering algorithm is then applied to the neutrosophic image, enhancing its robustness to image noise and improving image segmentation accuracy. The distance metric used in the improved neutrosophic fuzzy C-means clustering method of the present invention improves segmentation accuracy compared to the Euclidean distance used in the original neutrosophic fuzzy C-means clustering algorithm.
[0103] The present invention selects the BSDS dataset, i.e., the Berkeley segmentation dataset, and the image numbered 86016 in the benchmark, and segments it using the present invention, the existing FCM method, the NCM method, the FCMS method, the HMRF-FCM method, and the FLICM method. The results are as follows: Figure 2As shown. Among them, the existing FCM method is the fuzzy C-means clustering algorithm ([1] Dunn, A fuzzy image processing method related to iterative self-organizing analysis algorithm and its application to the detection of compact and easily separable clusters [J]. Journal of Cybernetics, 1973, 3(3): 32-57); the NCM method is the neutrosophic fuzzy C-means clustering algorithm ([5] Guo Yanhui, Abdulkadir Senger, NCM: Neutrosophic logic C-means clustering algorithm [J]. Pattern Recognition, 48(8)(2015) 2710–2724), and FCMS is the fuzzy C-means clustering algorithm based on spatial constraints ([2] Ahmed, Yamani, Mohadi, Farage, Moriarty, An improved fuzzy C-means algorithm for the deviation field of MRI data Estimation and segmentation [J]. IEEE Journal of Medical Imaging, 21(3)(2002)193–199), HMRF-FCM is a fuzzy C-means clustering algorithm based on hidden Markov random field ([3] Chazis, Vavarigu, A fuzzy clustering method for enhancing spatially constrained image segmentation using hidden Markov random field models [J]. IEEE Transactions on Fuzzy Systems, 16(5)(2008)1351–1361), FLICM is a robust fuzzy local information C-means clustering algorithm ([4] Scriannidis, Chazis, A robust fuzzy local information C-means clustering algorithm [J]. IEEE Journal of Image Processing, 19(5)(2010)1328–1337).
[0104] Among them, 2(a) is the original image of 86016;
[0105] 2(b) is the segmentation result of the original image using the existing FCM method;
[0106] 2(c) is the segmentation result of the original image using the existing NCM method;
[0107] 2(d) is the segmentation result of the original image using the existing FCMS method;
[0108] 2(e) is the segmentation result of the original image using the existing HMRF-FCM method;
[0109] 2(f) is the segmentation result of the original image using the existing FLICM method;
[0110] 2(g) is the neutrosophic image of the 86016 image;
[0111] 2(h) is the segmentation result of the original image using the method of the present invention;
[0112] 2(i) is the Gaussian noise image of the 86016 image with a noise intensity of 0.05;
[0113] 2(j) is the segmentation result of the image containing Gaussian noise using the existing FCM method;
[0114] 2(k) is the segmentation result of the image containing Gaussian noise using the existing NCM method;
[0115] 2(l) is the segmentation result of the image containing Gaussian noise using the existing FCMS method;
[0116] 2(m) is the segmentation result of the image containing Gaussian noise using the existing HMRF-FCM method;
[0117] 2(n) is the segmentation result of the image containing Gaussian noise using the existing FLICM method;
[0118] 2(o) is the neutral image of the 86016 image with Gaussian noise;
[0119] 2(p) is the segmentation result of the image containing Gaussian noise using the method of the present invention;
[0120] 2(q) is the salt and pepper noise image of the 86016 image, with a noise intensity of 0.05;
[0121] 2(r) is the segmentation result of the salt and pepper noise image using the existing FCM method;
[0122] 2(s) is the segmentation result of the salt and pepper noise image using the existing NCM method;
[0123] 2(t) is the segmentation result of the salt and pepper noise image using the existing FCMS method;
[0124] 2(u) is the segmentation result of the salt and pepper noise image using the existing HMRF-FCM method;
[0125] 2(v) is the segmentation result of the salt and pepper noise image using the existing FLICM method;
[0126] 2(w) is the neutral image of the salt and pepper noise image of the 86016 image;
[0127] 2(x) is the segmentation result of the salt and pepper noise image using the method of the present invention;
[0128] 2(y) is the standard segmentation map of the 86016 image.
[0129] In order to quantitatively illustrate the effectiveness of the present invention, the effects of image segmentation will be compared using two indicators: segmentation accuracy SA and similarity VI.
[0130] The definitions of segmentation accuracy SA and similarity VI are:
[0131]
[0132] Among them, A iis the set of pixels of the i-th category in the segmented image, C i is the set of pixels of class i in the standard segmentation map, and c is the number of clusters. The larger the SA, the more accurate the segmentation.
[0133] VI(P,P s )=H(P)+H(P s )-2I(P,P s )
[0134] Among them, P is the standard segmentation map, P s is the experimental segmentation map, where H and I represent the entropy and mutual information between two segments, respectively. The smaller VI, the more accurate the segmentation. The experimental results are shown in Table 1.
[0135] Table 1 Comparison of segmentation accuracy of each algorithm
[0136]
[0137] Among them, FCM is a fuzzy C-means clustering algorithm, NCM is a Neutrosophic Fuzzy C-means clustering algorithm, FCMS is a fuzzy C-means clustering algorithm based on spatial constraints, HMRF-FCM is a fuzzy C-means clustering algorithm based on hidden Markov random fields, and FLICM is a robust fuzzy local information C-means clustering algorithm.
[0138] Table 1 shows that the proposed algorithm achieves the highest SA and the lowest VI when segmenting the original image, the image with 5% Gaussian noise, and the image with 5% salt and pepper noise. Furthermore, the proposed algorithm maintains its performance both before and after noise addition. Therefore, the proposed algorithm achieves the best segmentation results compared to the other five algorithms.
[0139] See also Figure 3 As shown, the present invention also provides another technical solution: providing an image segmentation device 101 based on an improved NCM, comprising:
[0140] An acquisition module 102 is configured to acquire an image to be segmented, neutralize the original image, and determine whether the original image is a grayscale image. If the original image is not a grayscale image, the original image is first converted into a grayscale image and then the converted grayscale image is converted from a spatial domain to a neutral domain to obtain a neutral image. If the original image is a grayscale image, the original image is converted from a spatial domain to a neutral domain to obtain a neutral image.
[0141] The image segmentation module 103 segments the Neutral Intelligence image acquired by the acquisition module 102 using an improved NCM image segmentation method to generate a segmented image of the image to be segmented.
[0142] See also Figure 4 As shown, the present invention further provides an electronic device 400, including:
[0143] The memory 200, the processor 300, and the computer instructions 100 stored in the memory 200 and executed on the processor 300, when the computer instructions 100 are executed by the processor 300, can implement the steps of the image segmentation method based on improved neutrosophic fuzzy C-means clustering.
[0144] The present invention also provides a storage medium storing a computer program. When the computer program is run on a computer, the computer is enabled to execute the image segmentation method based on the improved NCM according to any one of claims 1 to 4.
[0145] In summary, the technical solution provided by the present invention has the following significant effects compared with the existing known technologies:
[0146] 1. The image segmentation method adopted by the present invention uses the neutral domain to represent the uncertainty of pixels, has good noise resistance, is more capable of recognizing uncertain edges of images with high fuzziness, and can improve segmentation accuracy.
[0147] 2. The distance metric adopted by the improved Neutrosophic Fuzzy C-means clustering algorithm of the present invention can improve the segmentation accuracy compared with the Euclidean distance in the original Neutrosophic Fuzzy C-means clustering algorithm.
[0148] The algorithm is applied to BSDS (Berkeley segmentation dataset) and benchmark images. Experiments show that the algorithm has good noise suppression performance and high segmentation accuracy.
[0149] While the present invention has been disclosed above with reference to preferred embodiments, this is not intended to limit the present invention. Persons skilled in the art will readily appreciate that various modifications and variations can be made without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention shall be determined by the claims.
Claims
1. An image segmentation method based on improved NCM, characterized in that: The following steps are involved: S1: Acquire an image to be segmented, neutralize the original image, and determine whether the original image is a grayscale image. If the original image is not a grayscale image, first convert the original image into a grayscale image and then convert the converted grayscale image from the spatial domain to the neutral intelligence domain to obtain a neutral intelligence image. If the original image is a grayscale image, the original image is converted from the spatial domain to the neutral domain to obtain a neutral image. After obtaining the grayscale image, the grayscale image is converted from the spatial domain to the neutral domain by the following steps and formulas to obtain the neutral image. In the neutral image, the pixel P NS (i,j) is determined by three neutrosophic elements: T(i,j), I(i,j) and F(i,j): P NS (i,j)={T(i,j),I(i,j),F(i,j)} Among them, the representation of the neutrosophic elements T, I and F is: F(i,j)=1-T(i,j); in, g(i,j) represents the grayscale value of pixel p(i,j) in the grayscale image. is the w×w regional mean of the grayscale value g(i,j), and the value of the pixel area w satisfies w=2N+1(N≥1), δ(i,j) is g(i,j) and The absolute difference between the two, M×N represents the size of the image, i=1,2,...,M; j=1,2,...,N, M and N are positive natural numbers; S2: Segment the neutral intelligence image to generate a segmented image of the image to be segmented, wherein the neutral intelligence image is segmented by clustering, and a distance measurement formula is proposed: Where p and λ are any positive real numbers, ρ=(λ+1) p / 3, 0≤σ≤2; The objective function of the improved Neutrosophic Fuzzy C-means clustering algorithm using this distance metric is defined as follows: Among them, m is the fuzzy weighted index, p i and q i Represent the number of clusters with the largest and second largest membership respectively, and the calculation is The value of is a constant at each pixel, n is the number of elements in the data set, c is the number of cluster centers (1<c<n), ω i is the weighting factor (ω1+ω2+ω3=1), ω1 is the weighting factor of the membership degree, ω2 is the weighting factor of the uncertain boundary area, ω3 is the weighting factor of the noise area, d(x i ,y i ) represents the distance between the i-th sample and the j-th cluster center, and finally the fuzzy membership of the sample T is obtained. ij , uncertain membership I i , non-membership degree F i and cluster center v j as follows: in, 2. The image segmentation method based on improved NCM according to claim 1, characterized in that: The method for determining whether the original image is a grayscale image in S1 is: Use the image processing library to load the image and check the number of channels. A grayscale image has only one channel, which represents brightness information. If the number of channels is 1, the original image is determined to be a grayscale image. If the number of channels is 3, the original image is determined to be a non-grayscale image.
3. The image segmentation method based on improved NCM according to claim 1, characterized in that: The method for converting the original image that is not a grayscale image into a grayscale image in S1 is: Weighted average method: gray_value = 0.2989*R + 0.5870*G + 0.1140*B, where gray_value is the grayscale value, R is the custom red brightness value, G is the custom green brightness value, and B is the custom blue brightness value.
4. The image segmentation method based on improved NCM according to claim 1, characterized in that: The method for converting the original image that is not a grayscale image into a grayscale image in S1 is: Use color conversion function: Select a color conversion function from the image processing library to convert a non-grayscale image into a grayscale image.
5. The image segmentation method based on improved NCM according to claim 1, characterized in that: The specific segmentation steps of S2 are: S2.1: Initialization parameters: Give the initial cluster center C and initialize the membership matrix T 0 ,I 0 ,F 0 , set the number of cluster categories c, spatial constraint parameter β, fuzzy weighted index m, σ in the kernel function, neighborhood radius r, iteration stop threshold ε, maximum number of iterations δ, and membership weight factors ω1, ω2, ω3; S2.2: Calculate cluster center v k ,k=1,2,...,j; S2.3: Calculate the two largest values of membership T, and calculate S2.4: Update fuzzy membership T k , uncertain membership I k and non-membership F k ; S2.5: Determine whether the iteration stop condition |T is reached k+1 -T k |<ε, the condition is reached and the loop stops; Otherwise, return to step S2.1; S2.6: Complete clustering based on the maximum membership principle.
6. An image segmentation device based on improved NCM, applied to the image segmentation method based on improved NCM according to any one of claims 1 to 4, characterized in that: The device includes an acquisition module, the acquisition module being configured to acquire an image to be segmented, neutralize the original image, determine whether the original image is a grayscale image, and if the original image is not a grayscale image, first convert the original image into a grayscale image and then convert the converted grayscale image from a spatial domain to a neutral domain to obtain a neutral image; If the original image is a grayscale image, convert the original image from the spatial domain to the neutral domain to obtain a neutral image; An image segmentation module is used to segment the Neutral Intelligence image acquired by the acquisition module using an improved NCM image segmentation method to generate a segmented image of the image to be segmented.
7. An electronic device, characterized in that: The method comprises a memory, a processor, and computer instructions stored in the memory and executed on the processor. When the computer instructions are executed by the processor, the image segmentation method based on the improved NCM according to any one of claims 1 to 4 is implemented.
8. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is run on a computer, the computer is enabled to execute the image segmentation method based on the improved NCM according to any one of claims 1 to 4.
Citation Information
Patent Citations
Robust FCM image segmentation method
CN105654453A
An image segmentation method based on improved intuitionistic fuzzy C-means clustering
CN109145921A