An image segmentation method based on adaptive feature perception

The image segmentation method that combines adaptive feature perception and K-means++ algorithm solves the problem of low image segmentation accuracy in the existing technology and achieves more efficient image feature extraction and segmentation effects.

CN117765008BActive Publication Date: 2024-09-06NORTHWEST INST OF NUCLEAR TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311818218.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-26
Publication Date
2024-09-06
Estimated Expiration
2043-12-26

AI Technical Summary

Technical Problem

Existing image segmentation methods have low accuracy in segmentation results in complex geographical environments, and it is difficult to extract accurate data information in geographical images.

Method used

An image segmentation method based on adaptive feature perception is adopted. The RGB value, LBP value and position of each pixel are obtained to form a feature vector. The K-means++ algorithm is used to determine the initial clustering center, and the silhouette coefficient is used to determine whether to update the clustering center. , dynamically adjust feature weights to optimize the clustering process.

Benefits of technology

It improves the accuracy and robustness of image segmentation, can better extract image feature information, adapts to different types of image data and segmentation tasks, and improves the quality and efficiency of extracting geographical and structural information from images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117765008B
    Figure CN117765008B
Patent Text Reader

Abstract

The present invention relates to the field of image segmentation technology, and in particular to an image segmentation method based on adaptive feature perception, comprising: obtaining a feature vector corresponding to each pixel point in an image to be segmented and its initial weight, determining each initial cluster center, and obtaining an initial cluster cluster corresponding to each initial cluster center; judging whether to update the cluster center according to the contour coefficient of each pixel point in the determined initial cluster cluster, and if the cluster center needs to be updated, adaptively weighting and updating the initial weight of the feature vector to obtain a first weight, and determining each first cluster center; determining the cluster cluster at the next iteration based on the first weight and the first cluster center, and so on, iteratively executing the cluster cluster acquisition and evaluation process until the cluster result obtained meets the preset clustering requirements, and using the cluster result at this time as the segmentation result of the image to be segmented. The present invention improves the accuracy of image segmentation by adaptively optimizing the clustering process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image segmentation, and in particular to an image segmentation method based on adaptive feature perception. Background Art

[0002] With the widespread application of drone technology, from agricultural monitoring to urban planning, it is necessary to quickly and accurately extract ground feature information from a large number of images, and image segmentation plays an important role in drone mapping and data information processing. As a powerful data collection tool, drones can obtain a large number of high-resolution geographic images, which require precise segmentation to identify objects and landform features, such as roads, buildings, water bodies, and vegetation. Regarding image segmentation methods, there are existing threshold-based segmentation, edge-based segmentation, and clustering-based segmentation. In the image segmentation process, the existing image segmentation methods are affected by the complex geographical environment in the geographic image, and the segmentation results are inaccurate, which is not conducive to extracting more accurate data information from the geographic image. Summary of the invention

[0003] In order to solve the technical problem that the segmentation results of the above-mentioned existing image segmentation methods are inaccurate and not conducive to extracting more accurate data information from geographic images, the purpose of the present invention is to provide an image segmentation method based on adaptive feature perception, and the technical solution adopted is as follows:

[0004] An embodiment of the present invention provides an image segmentation method based on adaptive feature perception, the method comprising the following steps:

[0005] Step S1, obtaining the RGB value, LBP value and position of each pixel in the image to be segmented, forming a vector with the RGB value, LBP value and position, and using the vector as a feature vector;

[0006] Step S2, determining the initial weight of the feature vector corresponding to each pixel in the image to be segmented; using the K-means++ algorithm, determining each initial cluster center in the image to be segmented according to the feature vector corresponding to each pixel in the image to be segmented;

[0007] Step S3, obtaining each initial cluster according to the feature vector corresponding to each pixel in the image to be segmented and its initial weight, and the feature vector corresponding to each initial cluster center;

[0008] Step S4, calculating the silhouette coefficient corresponding to each pixel point in each initial cluster according to the feature vector corresponding to each pixel point in each initial cluster; judging whether to update the cluster center according to the silhouette coefficient;

[0009] Step S5, if the cluster center needs to be updated, the first weight of the feature vector corresponding to each pixel is determined according to the initial weight, silhouette coefficient and learning rate of each pixel;

[0010] Step S6, updating the cluster center according to the feature vector corresponding to each pixel point in each initial cluster cluster and its first weight, and determining each first cluster center; and so on, iteratively executing steps S3 to S6 until there is no need to update the cluster center, and taking the clustering result at this time as the segmentation result of the image to be segmented.

[0011] Furthermore, the initial weight of the feature vector corresponding to each pixel in the image to be segmented is determined, including:

[0012] Determine the number of elements in the feature vector corresponding to each pixel, use the equal weight method, and take the reciprocal of the number of elements as the initial weight of the feature vector corresponding to each pixel.

[0013] Furthermore, according to the feature vector corresponding to each pixel in the image to be segmented, the K-means++ algorithm is used to determine each initial cluster center in the image to be segmented, including:

[0014] Select any pixel point in the image to be segmented as the first initial cluster center, and use all other pixel points in the image to be segmented except the first initial cluster center as reference pixel points; calculate the distance between each reference pixel point and the first initial cluster center according to the feature vector corresponding to each pixel point in the image to be segmented, and obtain the distance of each reference pixel point; calculate the cluster center selection probability of each reference pixel point according to the distance of each reference pixel point; use the reference pixel point corresponding to the maximum cluster center selection probability as the second initial cluster center;

[0015] Each pixel point in the image to be segmented except the first initial cluster center and the second initial cluster center is taken as a reference pixel point; the distance between each reference pixel point and the second initial cluster center is calculated to obtain the distance of each reference pixel point; the cluster center selection probability of each reference pixel point is calculated, and the reference pixel point corresponding to the maximum cluster center selection probability is taken as the third initial cluster center; and so on, iteratively executing the initial cluster center determination process until all the initial cluster centers are obtained.

[0016] Furthermore, according to the distance of each reference pixel point, the probability of selecting the cluster center of each reference pixel point is calculated, including:

[0017] The square of the distance of each reference pixel is calculated, and the ratio of the square of the distance of a single reference pixel to the sum of the squares of the distances of all reference pixels is used as the cluster center selection probability of the corresponding reference pixel to obtain the cluster center selection probability of each reference pixel.

[0018] Furthermore, according to the feature vector corresponding to each pixel point in the image to be segmented and its initial weight, and the feature vector corresponding to each initial cluster center, each initial cluster cluster is obtained, including:

[0019] Take any pixel as the selected pixel, determine the weighted distances of the selected pixel according to the feature vector corresponding to the selected pixel and its initial weight, and the feature vectors corresponding to each initial cluster center; take the initial cluster center corresponding to the minimum weighted distance as the target initial cluster center of the selected pixel;

[0020] The target initial cluster center of each pixel is obtained, and the cluster composed of all pixels corresponding to the target initial cluster center is used as the initial cluster cluster.

[0021] Furthermore, the calculation formula for each weighted distance of the selected pixel point is:

[0022] Where Dw p,c is the cth weighted distance of the pth pixel in the image to be segmented, the pth pixel is the selected pixel, d is the number of elements in the feature vector corresponding to the pth pixel in the image to be segmented, and w p,i is the initial weight of the i-th element in the feature vector corresponding to the p-th pixel in the image to be segmented, g p,i is the i-th element in the feature vector corresponding to the p-th pixel in the image to be segmented, j c,i It is the i-th element in the feature vector corresponding to the c-th initial cluster center in the image to be segmented; the initial weight of each element in the feature vector corresponding to the pixel point is equal to the initial weight of the feature vector; the weighted distance corresponds to the initial cluster center one by one, and the sequence number of the weighted distance and the initial cluster center can be represented by the character c.

[0023] Furthermore, the calculation formula of the first weight of the feature vector corresponding to each pixel is:

[0024] In the formula, is the first weight of the feature vector corresponding to the pth pixel in the image to be segmented, w p is the initial weight of the feature vector corresponding to the p-th pixel in the image to be segmented, η is the learning rate, which is 0.01, Q is the contour coefficient corresponding to the p-th pixel in the image to be segmented, is the partial derivative of the silhouette coefficient with respect to the initial weight of the eigenvector corresponding to the pth pixel.

[0025] Further, the cluster center is updated according to the feature vector corresponding to each pixel point in each initial cluster and its first weight, and each first cluster center is determined, including:

[0026] Any initial clustering cluster is taken as the selected initial clustering cluster, the product of the feature vector corresponding to each pixel point in the selected initial clustering cluster and its corresponding first weight is calculated, and the average value of all products corresponding to the selected initial clustering cluster is taken as the feature vector corresponding to the first clustering center to obtain the first clustering center.

[0027] Further, judging whether to update the cluster center according to the silhouette coefficient includes:

[0028] If the preset number of silhouette coefficients is greater than the preset threshold, it is determined that the cluster center does not need to be updated; if the preset number of silhouette coefficients is not greater than the preset threshold, it is determined that the cluster center needs to be updated.

[0029] The present invention has the following beneficial effects:

[0030] The present invention provides an image segmentation method based on adaptive feature perception. The image segmentation method extracts image feature information and obtains data from three different angles, which helps to extract complete feature information and facilitates subsequent more accurate image segmentation. A weight is set for a feature vector corresponding to each pixel in an image to be segmented, which helps to improve the ability to distinguish different areas in a more complex image, especially in scene images with small differences in color, texture or shape. When determining each initial clustering cluster, a method of initializing the clustering center using K-means++ helps to reduce the sensitivity of the traditional K-means algorithm to the selection of initial values ​​and improves the stability and repeatability of the segmentation result. The clustering effect of the clustering cluster is quantified, that is, the contour coefficient is determined, and it is judged whether to iteratively update the clustering center. The process is repeated until the clustering result converges or reaches a preset number of iterations, which helps to improve the accuracy of clustering-based image segmentation. The first weight is determined by the present invention to adaptively optimize the clustering process by dynamically adjusting the feature weight, so that it can better adapt to different types of image data and segmentation tasks, improve the quality and efficiency of extracting geographic and structural information from the image, and also improve the robustness of image segmentation. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0032] Figure 1 The present invention is a flowchart of an image segmentation method based on adaptive feature perception. DETAILED DESCRIPTION

[0033] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the specific implementation methods, structures, features and effects of the technical solutions proposed by the present invention are described in detail below in conjunction with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0034] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0035] The application scenarios targeted by the present invention can be: image analysis in drone mapping and big data information processing. The present invention not only supports the processing of drone image data, but is also suitable for the automated analysis of large-scale data sets; in application fields such as disaster response, agricultural monitoring or environmental protection, accurate image segmentation is particularly critical for processing and understanding rapidly growing amounts of data.

[0036] In order to provide new possibilities for UAV mapping and data processing, make the information extracted from the image more accurate, and further promote the technical development and application expansion of related fields, this embodiment provides an image segmentation method based on adaptive feature perception, such as Figure 1 As shown, the following steps are included:

[0037] Step S1, obtaining the RGB value, LBP value and position of each pixel in the image to be segmented, forming a vector with the RGB value, LBP value and position, and using the vector as a feature vector.

[0038] In this embodiment, in order to achieve image segmentation, it is necessary to extract the color, texture and position information of each pixel in the image to be segmented, that is, the RGB value, LBP value and position, and form a feature vector with the three feature elements to obtain the feature vector corresponding to each pixel, that is, each pixel in the image to be segmented has its corresponding feature vector.

[0039] It should be noted that when analyzing the image features of the image to be segmented, analyzing the image features from three perspectives helps to extract the image feature information more comprehensively and completely, making it easier to obtain more accurate segmentation areas later.

[0040] Among them, the image to be segmented can be a geographic image; the RGB value can reflect the color characteristics of the image to be segmented, the image to be segmented is converted into an RGB image, and the RGB value of each pixel is obtained from the RGB image. The conversion process of the RGB image is a prior art and is not within the protection scope of the present invention, and will not be elaborated on here; the position can be the coordinate position of each pixel in the image to be segmented, and the coordinate position includes a horizontal coordinate and a vertical coordinate; the LBP value can reflect the texture information of each pixel, and the LBP value can be obtained by calculating the local binary pattern of the neighborhood around the pixel.

[0041] As an example, the calculation formula of the LBP value can be:

[0042] Where, LBP p is the LBP value of the p-th pixel in the image to be segmented, 8 is the total number of pixels in the eight-neighborhood of the p-th pixel in the image to be segmented, m is the sequence number of the pixels in the eight-neighborhood of the p-th pixel in the image to be segmented, s() is the sign function, I p,m is the gray value of the mth pixel in the eight-neighborhood of the pth pixel in the image to be segmented, I p is the gray value of the pth pixel in the image to be segmented.

[0043] In the calculation formula of the LBP value, the sign function s() returns 0 or 1 according to whether the grayscale value of the pixel in the eight neighborhoods is greater than the central pixel. By referring to the calculation process of the LBP value of the pth pixel, the LBP value of each pixel in the image to be segmented can be obtained.

[0044] So far, this embodiment has obtained the feature vector corresponding to each pixel point in the image to be segmented.

[0045] Step S2, determining the initial weight of the feature vector corresponding to each pixel in the image to be segmented; and determining each initial cluster center in the image to be segmented using the K-means++ algorithm based on the feature vector corresponding to each pixel in the image to be segmented.

[0046] The first step is to determine the initial weight of the feature vector corresponding to each pixel in the image to be segmented.

[0047] It should be noted that the weight of the initialized feature vector, that is, the initial weight, is usually determined by an equal or domain knowledge-based method. The weight of the feature vector can reflect the importance of the feature vector corresponding to the pixel point relative to the segmentation task.

[0048] Determine the number of elements in the feature vector corresponding to each pixel, use the equal weight method, and take the reciprocal of the number of elements as the initial weight of the feature vector corresponding to each pixel.

[0049] In this embodiment, it can be known from step S1 that the number of elements in the feature vector corresponding to each pixel is 3, and the equal weight method is adopted, the initial weights of the feature vectors corresponding to all pixels are 1 / 3, and the weight of each feature element in the feature vector is also 1 / 3. Of course, the embodiment can also adopt other methods to determine the initial weight of the feature vector corresponding to each pixel in the image to be segmented.

[0050] The second step is to determine the initial cluster centers in the image to be segmented using the K-means++ algorithm according to the feature vector corresponding to each pixel in the image to be segmented. The specific implementation steps may include:

[0051] The first sub-step is to determine the first initial cluster center and the second initial cluster center.

[0052] Select any pixel point in the image to be segmented as the first initial cluster center, and use all other pixel points in the image to be segmented except the first initial cluster center as reference pixel points; calculate the distance between each reference pixel point and the first initial cluster center according to the feature vector corresponding to each pixel point in the image to be segmented, and obtain the distance of each reference pixel point; calculate the cluster center selection probability of each reference pixel point according to the distance of each reference pixel point; and use the reference pixel point corresponding to the maximum cluster center selection probability as the second initial cluster center.

[0053] In this embodiment, the distance between the reference pixel and the first initial cluster center is calculated, that is, the distance between the feature vector corresponding to the reference pixel and the feature vector corresponding to the first initial cluster center is calculated. The calculation formula of the distance between the two vectors is the prior art and will not be elaborated here; each reference pixel is calculated for distance with the first initial cluster center, and each reference pixel corresponds to a distance value. The greater the probability of cluster center selection, the farther the distance between the reference pixel and the first initial cluster center, and the greater the possibility that the corresponding reference pixel is selected as the second initial cluster center. Therefore, in this embodiment, the reference pixel corresponding to the maximum probability of cluster center selection is used as the second initial cluster center.

[0054] Among them, according to the distance of each reference pixel point, the probability of selecting the cluster center of each reference pixel point is calculated.

[0055] The square of the distance of each reference pixel is calculated, and the ratio of the square of the distance of a single reference pixel to the sum of the squares of the distances of all reference pixels is used as the cluster center selection probability of the corresponding reference pixel to obtain the cluster center selection probability of each reference pixel.

[0056] As an example, the calculation formula for cluster center selection probability can be:

[0057] In the formula, G k is the probability of selecting the cluster center of the kth reference pixel, D k is the distance to the kth reference pixel, D k 2 is the square of the distance to the kth reference pixel, ∑ k∈K D k 2 is the sum of the squares of the distances of all reference pixels, and K is the number of reference pixels.

[0058] In the calculation formula of cluster center selection probability, the cluster center selection probability G k and the square of the distance D k 2 Positive correlation, distance squared D k 2 The larger the value is, the greater the distance between the feature vector corresponding to the kth reference pixel and the feature vector corresponding to the first initial cluster center is, so the probability of cluster center selection G is k The bigger it will be.

[0059] In the second sub-step, all initial cluster centers are obtained based on the first initial cluster center and the second initial cluster center.

[0060] Each pixel point in the image to be segmented except the first initial cluster center and the second initial cluster center is taken as a reference pixel point; the distance between each reference pixel point and the second initial cluster center is calculated to obtain the distance of each reference pixel point; the cluster center selection probability of each reference pixel point is calculated, and the reference pixel point corresponding to the maximum cluster center selection probability is taken as the third initial cluster center; and so on, iteratively executing the initial cluster center determination process until all the initial cluster centers are obtained.

[0061] In this embodiment, the first and second initial cluster centers that have been determined are excluded from the image to be segmented, and the remaining pixels in the image to be segmented are used as candidate pixels for the initial cluster centers, and the candidate pixels are reference pixels; the cluster center selection probability of each reference pixel in this iteration is calculated, and the reference pixel corresponding to the maximum cluster center selection probability is used as the third initial cluster center; and so on, the determined initial cluster centers are first excluded, and then the distance between the remaining pixels and the determined last initial cluster center is calculated, and then the cluster center selection probability of each reference pixel in the current iteration is obtained, and the reference pixel corresponding to the maximum cluster center selection probability is used as the next initial cluster center; the number of initial cluster centers can be set to k, and the value of k can be set by the implementer according to the specific actual situation, and is not specifically limited.

[0062] So far, this embodiment has obtained the initial cluster centers in the image to be segmented.

[0063] Step S3, obtaining each initial cluster according to the feature vector corresponding to each pixel in the image to be segmented and its initial weight, and the feature vector corresponding to each initial cluster center.

[0064] It should be noted that after obtaining the feature vector corresponding to each pixel point and its initial weight, and the feature vector corresponding to each initial cluster center, the image to be segmented can be initially clustered to obtain each initial cluster cluster. The specific implementation steps may include:

[0065] The first step is to select the target initial cluster center of the pixel points.

[0066] Take any pixel point as the selected pixel point, determine the weighted distances of the selected pixel point according to the feature vector corresponding to the selected pixel point and its initial weight, and the feature vectors corresponding to each initial clustering center; take the initial clustering center corresponding to the minimum weighted distance as the target initial clustering center of the selected pixel point.

[0067] In this embodiment, the weighted distance refers to the use of the initial weight of the feature vector to weight the distance between the two feature vectors when calculating the distance between the two feature vectors, which helps to obtain a more realistic similarity between the feature information of the two pixels. The smaller the weighted clustering, the greater the similarity between the feature information of the two pixels.

[0068] As an example, the calculation formula for each weighted distance of the selected pixel point can be:

[0069] Where Dw p,c is the cth weighted distance of the pth pixel in the image to be segmented, the pth pixel is the selected pixel, d is the number of elements in the feature vector corresponding to the pth pixel in the image to be segmented, and w p,i is the initial weight of the i-th element in the feature vector corresponding to the p-th pixel in the image to be segmented, g p,i is the i-th element in the feature vector corresponding to the p-th pixel in the image to be segmented, j c,i It is the i-th element in the feature vector corresponding to the c-th initial cluster center in the image to be segmented; the initial weight of each element in the feature vector corresponding to the pixel point is equal to the initial weight of the feature vector; the weighted distance corresponds to the initial cluster center one by one, and the sequence number of the weighted distance and the initial cluster center can be represented by the character c.

[0070] In the calculation formula of the weighted distance, the difference between the feature elements at the corresponding positions in the feature vector corresponding to the two pixels is calculated, and the difference is weighted using the initial weight to obtain the final weighted distance; the weighted distance is used to measure the feature similarity between a single pixel in the image to be segmented and the initial clustering center. The smaller the weighted distance, the greater the feature similarity, indicating that the pixel is more likely to belong to the initial clustering cluster of the corresponding initial clustering center; referring to the calculation process of the cth weighted distance of the selected pixel, the weighted distances of each pixel in the image to be segmented can be obtained.

[0071] In the second step, each initial cluster is obtained by referring to the target initial cluster center of the selected pixel point.

[0072] The target initial cluster center of each pixel is obtained, and the cluster composed of all pixels corresponding to the target initial cluster center is used as the initial cluster cluster.

[0073] In this embodiment, the target initial clustering center of each pixel point in the image to be segmented is determined, and each pixel point is assigned to the initial clustering cluster corresponding to the target initial clustering center, so that each initial clustering cluster can be obtained, that is, the clustering cluster composed of all pixel points corresponding to the target initial clustering center is used as the initial clustering cluster, and the area composed of pixel points in each initial clustering cluster is the segmentation area.

[0074] So far, this embodiment has obtained various initial clusters.

[0075] Step S4, calculating the silhouette coefficient corresponding to each pixel point in each initial cluster according to the feature vector corresponding to each pixel point in each initial cluster; and determining whether to update the cluster center according to the silhouette coefficient.

[0076] The first step is to determine the silhouette coefficient corresponding to each pixel in each initial cluster.

[0077] In this embodiment, the silhouette coefficient can be used to evaluate the clustering effect and measure the quality of each initial cluster. The larger the silhouette coefficient, the higher the clustering effect. The value range of the silhouette coefficient can be -1 to 1. When the silhouette coefficient is close to 1, it means that the samples are tightly clustered inside their initial cluster and far away from other initial clusters, which is an ideal clustering result; when the silhouette coefficient is close to -1, it means that the samples may be assigned to the wrong initial cluster; when the silhouette coefficient is 0, it means that the initial clusters overlap and the boundary effect is not obvious.

[0078] As an example, the calculation formula of the silhouette coefficient can be:

[0079] Where S(x) is the silhouette coefficient corresponding to sample x in the initial cluster, b(x) is the average distance from sample x to other samples in the same initial cluster, b(x) represents the intra-class cohesion, a(x) is the average distance from sample x to all samples in the nearest other initial cluster, the other initial cluster refers to the initial cluster to which sample x does not belong, and max is the maximum value function.

[0080] It should be noted that each pixel in each initial cluster has its corresponding silhouette coefficient. The detailed calculation process of the silhouette coefficient is prior art and is not within the scope of protection of the present invention, so it will not be elaborated in detail here. Calculating the silhouette coefficient is beneficial to the subsequent determination of whether to perform the next cluster determination iteration based on the clustering effect.

[0081] The second step is to determine whether to update the cluster center based on the silhouette coefficient.

[0082] If the preset number of silhouette coefficients is greater than the preset threshold, it is determined that the cluster center does not need to be updated; if the preset number of silhouette coefficients is not greater than the preset threshold, it is determined that the cluster center needs to be updated.

[0083] In this embodiment, the preset threshold can be set to 0.9, and the preset number can be set to 80% of the number of all pixels in the image to be segmented. The preset threshold and the preset number can be adjusted by the implementer according to the specific real-time scene, and are not specifically limited. When the contour coefficient of most pixels in the image to be segmented is greater than the preset threshold, it means that the clustering effect of each initial clustering cluster is good. A good clustering effect is conducive to improving the precision and accuracy of segmentation, which can better adapt to different types of image data and segmentation tasks. At this time, there is no need to perform the next iteration to determine a new clustering cluster. When the contour coefficient of most pixels in the image to be segmented is less than or equal to the preset threshold, it means that the clustering quality of each initial clustering cluster is poor, and the accuracy of the image segmentation result is poor. It is necessary to determine the next clustering cluster based on the contour coefficient of each pixel in this iteration, that is, it is necessary to update the cluster center, and update each initial cluster center of this iteration to obtain each first cluster center.

[0084] Step S5: If the cluster center needs to be updated, the first weight of the feature vector corresponding to each pixel is determined according to the initial weight, silhouette coefficient and learning rate of each pixel.

[0085] In this embodiment, the silhouette coefficient is used as a clustering effect indicator to measure the quality of the current clustering. The weight can be adjusted through the feedback of the silhouette coefficient, specifically: increase the weight of the feature vector with high clustering quality and reduce the weight of the feature vector with low clustering quality. The adjustment of the initial weight can be achieved by the gradient ascent method, and the specific implementation steps may include:

[0086] As an example, the calculation formula for the first weight of the feature vector corresponding to the pixel point may be:

[0087] In the formula, is the first weight of the feature vector corresponding to the pth pixel in the image to be segmented, w p is the initial weight of the feature vector corresponding to the p-th pixel in the image to be segmented, η is the learning rate, which is 0.01, and Q is the contour coefficient corresponding to the p-th pixel in the image to be segmented. is the partial derivative of the silhouette coefficient with respect to the initial weight of the eigenvector corresponding to the pth pixel.

[0088] In the calculation formula of the first weight, Can be used to correct w p , which helps to obtain the first weight that can improve the clustering effect The first weight is the weight of the feature vector corresponding to the pixel point when the clustering cluster is determined in the second iteration. The weight of the feature vector needs to be updated in each iteration to improve the clustering effect and facilitate the subsequent acquisition of more accurate clustering results.

[0089] So far, this embodiment obtains the first weight of the feature vector corresponding to each pixel in the image to be segmented during the second iteration.

[0090] Step S6, updating the cluster center according to the feature vector corresponding to each pixel point in each initial cluster cluster and its first weight, and determining each first cluster center; and so on, iteratively executing steps S3 to S6 until there is no need to update the cluster center, and taking the clustering result at this time as the segmentation result of the image to be segmented.

[0091] In the first step, the cluster center is updated according to the feature vector corresponding to each pixel point in each initial cluster and its first weight, and each first cluster center is determined.

[0092] In this embodiment, the initial cluster center can be updated by calculating the average value of the weighted features of all pixels in the initial cluster to which the initial cluster center belongs. Based on each initial cluster, each first cluster center is determined, and the specific implementation steps may include:

[0093] Any initial clustering cluster is taken as the selected initial clustering cluster, the product of the feature vector corresponding to each pixel point in the selected initial clustering cluster and its corresponding first weight is calculated, and the average value of all products corresponding to the selected initial clustering cluster is taken as the feature vector corresponding to the first clustering center to obtain the first clustering center.

[0094] It is worth noting that the first cluster center is a pixel point formed by the average value of the weighted feature vectors of all pixels in the corresponding initial cluster, so the first cluster center is not necessarily a pixel point on the image to be segmented.

[0095] As an example, the calculation formula of the feature vector corresponding to the first cluster center can be:

[0096] In the formula, is the eigenvector corresponding to the hth first cluster center, C h is the number of pixels in the hth initial cluster, is the first weight of the feature vector corresponding to the vth pixel in the hth initial cluster, μ h,v is the feature vector corresponding to the vth pixel in the hth initial cluster, and ⊙ represents element-by-element multiplication.

[0097] It should be noted that the hth first cluster center will replace the initial cluster center in the hth initial cluster cluster, so the first cluster center and the initial cluster cluster present a one-to-one correspondence, so the two can be represented by the same character. Referring to the calculation process of the feature vector corresponding to the hth first cluster center, all the first cluster centers can be obtained.

[0098] In the second step, steps S3 to S6 are iteratively executed in the same manner until the cluster center does not need to be updated, and the clustering result at this time is used as the segmentation result of the image to be segmented.

[0099] After obtaining each first cluster center, this embodiment executes step S3 to obtain each first cluster cluster; then executes step S4, that is, calculates the contour coefficient according to the feature vector corresponding to each pixel point in each first cluster cluster, and determines whether to perform the next iteration to update the cluster center; if the cluster center still needs to be updated, executes steps S5 and S6, that is, determines the second weight of the feature vector corresponding to each pixel point according to the first weight, contour coefficient and learning rate of each pixel point, and then determines each second cluster center; and so on, iteratively executes steps S3 to S6 until there is no need to update the cluster center, and uses the clustering result of the last iteration as the segmentation result of the image to be segmented, so as to obtain accurate segmentation areas corresponding to the image to be segmented.

[0100] So far, this embodiment has achieved accurate image segmentation based on clustering.

[0101] The present invention provides an image segmentation method based on adaptive feature perception, which first extracts the color, position and texture features of each pixel in the image to be segmented, and dynamically weights these features to enhance the accuracy of segmentation; based on the K-means++ algorithm, intelligent initialization of cluster centers and gradient descent or similar optimization methods are performed to adjust the weights of feature vectors, aiming to improve the accuracy of image segmentation. The present invention significantly improves the segmentation capability of these features by extracting multidimensional features of the image and using an adaptive weighting mechanism, which is crucial for subsequent map generation, terrain analysis and 3D model reconstruction.

[0102] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. An image segmentation method based on adaptive feature perception, It is characterized in that The following steps are involved: Step S1, obtaining the RGB value, LBP value and position of each pixel in the image to be segmented, forming a vector with the RGB value, LBP value and position, and using the vector as a feature vector; Step S2, determining the initial weight of the feature vector corresponding to each pixel in the image to be segmented; using the K-means++ algorithm, determining each initial cluster center in the image to be segmented according to the feature vector corresponding to each pixel in the image to be segmented; Step S3, obtaining each initial cluster according to the feature vector corresponding to each pixel in the image to be segmented and its initial weight, and the feature vector corresponding to each initial cluster center; Step S4, calculating the silhouette coefficient corresponding to each pixel point in each initial cluster according to the feature vector corresponding to each pixel point in each initial cluster; judging whether to update the cluster center according to the silhouette coefficient; Step S5, if the cluster center needs to be updated, the first weight of the feature vector corresponding to each pixel is determined according to the initial weight, silhouette coefficient and learning rate of each pixel; Step S6, updating the cluster center according to the feature vector corresponding to each pixel point in each initial cluster and its first weight, and determining each first cluster center; and so on, iteratively executing steps S3 to S6 until the cluster center does not need to be updated, and taking the clustering result at this time as the segmentation result of the image to be segmented; The calculation formula of the first weight of the feature vector corresponding to each pixel is: In the formula, is the first weight of the feature vector corresponding to the pth pixel in the image to be segmented, w p is the initial weight of the feature vector corresponding to the p-th pixel in the image to be segmented, η is the learning rate, which is 0.01, Q is the contour coefficient corresponding to the p-th pixel in the image to be segmented, is the partial derivative of the silhouette coefficient with respect to the initial weight of the eigenvector corresponding to the pth pixel; The cluster center is updated according to the feature vector corresponding to each pixel point in each initial cluster and its first weight, and each first cluster center is determined, including: Taking any initial clustering cluster as the selected initial clustering cluster, calculating the product of the feature vector corresponding to each pixel point in the selected initial clustering cluster and the first weight corresponding thereto, taking the average value of all the products corresponding to the selected initial clustering cluster as the feature vector corresponding to the first clustering center, and obtaining the first clustering center; Determine whether to update the cluster center based on the silhouette coefficient, including: If the preset number of silhouette coefficients is greater than the preset threshold, it is determined that the cluster center does not need to be updated; if the preset number of silhouette coefficients is not greater than the preset threshold, it is determined that the cluster center needs to be updated.

2. The image segmentation method based on adaptive feature perception according to claim 1, It is characterized in that Determine the initial weight of the feature vector corresponding to each pixel in the image to be segmented, including: Determine the number of elements in the feature vector corresponding to each pixel, use the equal weight method, and take the reciprocal of the number of elements as the initial weight of the feature vector corresponding to each pixel.

3. The image segmentation method based on adaptive feature perception according to claim 1, It is characterized in that According to the feature vector corresponding to each pixel in the image to be segmented, the K-means++ algorithm is used to determine the initial cluster centers in the image to be segmented, including: Select any pixel point in the image to be segmented as the first initial cluster center, and use all other pixel points in the image to be segmented except the first initial cluster center as reference pixel points; calculate the distance between each reference pixel point and the first initial cluster center according to the feature vector corresponding to each pixel point in the image to be segmented, and obtain the distance of each reference pixel point; calculate the cluster center selection probability of each reference pixel point according to the distance of each reference pixel point; use the reference pixel point corresponding to the maximum cluster center selection probability as the second initial cluster center; Each pixel point in the image to be segmented except the first initial cluster center and the second initial cluster center is taken as a reference pixel point; the distance between each reference pixel point and the second initial cluster center is calculated to obtain the distance of each reference pixel point; the cluster center selection probability of each reference pixel point is calculated, and the reference pixel point corresponding to the maximum cluster center selection probability is taken as the third initial cluster center; and so on, iteratively executing the initial cluster center determination process until all the initial cluster centers are obtained.

4. The image segmentation method based on adaptive feature perception according to claim 3, It is characterized in that According to the distance of each reference pixel point, the probability of selecting the cluster center of each reference pixel point is calculated, including: The square of the distance of each reference pixel is calculated, and the ratio of the square of the distance of a single reference pixel to the sum of the squares of the distances of all reference pixels is used as the cluster center selection probability of the corresponding reference pixel to obtain the cluster center selection probability of each reference pixel.

5. The image segmentation method based on adaptive feature perception according to claim 1, It is characterized in that According to the feature vector corresponding to each pixel in the image to be segmented and its initial weight, and the feature vector corresponding to each initial cluster center, each initial cluster cluster is obtained, including: Take any pixel as the selected pixel, determine the weighted distances of the selected pixel according to the feature vector corresponding to the selected pixel and its initial weight, and the feature vectors corresponding to each initial cluster center; take the initial cluster center corresponding to the minimum weighted distance as the target initial cluster center of the selected pixel; The target initial cluster center of each pixel is obtained, and the cluster composed of all pixels corresponding to the target initial cluster center is used as the initial cluster cluster.

6. The image segmentation method based on adaptive feature perception according to claim 2, It is characterized in that The calculation formula for each weighted distance of the selected pixel point is: Where Dw p,c is the cth weighted distance of the pth pixel in the image to be segmented, the pth pixel is the selected pixel, d is the number of elements in the feature vector corresponding to the pth pixel in the image to be segmented, and w p,i is the initial weight of the i-th element in the feature vector corresponding to the p-th pixel in the image to be segmented, g p,i is the i-th element in the feature vector corresponding to the p-th pixel in the image to be segmented, j c,i It is the i-th element in the feature vector corresponding to the c-th initial cluster center in the image to be segmented; the initial weight of each element in the feature vector corresponding to the pixel point is equal to the initial weight of the feature vector; the weighted distance corresponds to the initial cluster center one by one, and the sequence number of the weighted distance and the initial cluster center can be represented by the character c.