Image texture feature extraction method based on morphology

Through the morphology-based image texture feature extraction method, including image preprocessing, morphological operations, adaptive feature selection and feature vector optimization steps, the problems of inaccurate feature extraction, susceptibility to noise interference and complex feature combination in the prior art are solved, and more accurate and efficient image texture feature extraction is achieved.

CN120182343APending Publication Date: 2025-06-20JIANGSU UNIV OF SCI & TECH
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202510253578.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-05
Publication Date
2025-06-20

AI Technical Summary

Technical Problem

The existing image texture feature extraction methods have problems such as inaccurate feature extraction, susceptibility to noise interference, and complex feature combinations.

Method used

A morphology-based image texture feature extraction method is proposed, including image preprocessing, morphological operations, adaptive feature selection and feature vector optimization steps. Specific steps include grayscale processing, Gaussian filter smoothing processing, morphological operations, local binary mode feature extraction and principal component analysis.

Benefits of technology

This method can more accurately reflect the texture information in the image, reduce the dimension of the feature vector, reduce the amount of calculation, and retain the main texture information in the image, and improve the support capabilities of tasks such as image classification and recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120182343A_ABST
    Figure CN120182343A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, and discloses a morphology-based image texture feature extraction method, which comprises the following steps: an image preprocessing step: carrying out graying processing on an original image, and carrying out smoothing processing on a grayscale image by using a Gaussian filter; a morphological operation step: selecting structural elements suitable for image texture characteristics, performing expansion and erosion operation on the smoothed image, performing opening operation on the expanded image, and performing closing operation on the eroded image; and an adaptive feature selection step: carrying out local binary pattern feature extraction on the image after morphological processing, adaptively determining a threshold according to statistical distribution of LBP features, and segmenting the image into a foreground and a background. The image texture feature extraction method based on morphology aims at solving the problems that feature extraction is inaccurate, noise interference is likely to happen, and feature combination is complex in an existing image texture feature extraction method.
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 processing, and particularly to a method for extracting image texture features based on morphology. Background Technique

[0002] Image texture feature extraction is a key step in image processing and analysis, aiming to extract features that describe the texture information of the object surface from the image. This process usually involves preprocessing the image, such as grayscale conversion, denoising, etc., to reduce interference factors. Subsequently, various algorithms and techniques, such as gray-level co-occurrence matrix (GLCM), local binary pattern (LBP), wavelet transform, etc., are used to capture the spatial relationship and arrangement law between pixels in the image. These algorithms can quantify attributes such as the thickness, directionality, and contrast of the texture, thereby generating a series of numerical features. These features are crucial for subsequent image classification, recognition, retrieval, etc. tasks because they can provide important clues about the image content and help the algorithm more accurately understand and distinguish different objects or scenes.

[0003] Traditional image texture feature extraction methods, such as statistical methods, geometric methods, signal processing methods, and structural methods, although widely used in the field of image processing, have exposed some significant defects in practical applications. First of all, these methods usually involve complex calculation processes, resulting in large computational amounts and slow processing speeds, making it difficult to meet the requirements of application scenarios with high real-time requirements. Secondly, parameter adjustment is a difficult point in these methods. Different parameter settings often have a significant impact on the extraction results, and how to find the optimal parameter combination is a time-consuming and cumbersome process. In addition, under complex backgrounds and noise interference, the features extracted by these methods are often not accurate enough. Due to the interference of the background and noise, the texture information in the image may be masked or distorted, resulting in the extracted features being unable to truly reflect the texture characteristics in the image. This will not only reduce the accuracy of image processing but also increase the difficulty of subsequent image classification, recognition, etc. tasks. Summary of the Invention

[0004] The purpose of the present invention is to solve the problems of inaccurate feature extraction, susceptibility to noise interference, and complex feature combination in existing image texture feature extraction methods, and to propose a method for extracting image texture features based on morphology.

[0005] The technical solution of the present invention to solve the above technical problems is as follows:

[0006] A method for extracting image texture features based on morphology includes the following steps:

[0007] S10. Image preprocessing step: Perform grayscale processing on the original image, and apply a Gaussian filter to smooth the grayscale image;

[0008] S20. Morphological operation steps: Select a structuring element suitable for the texture characteristics of the image, perform dilation and erosion operations on the smoothed image, then perform an opening operation on the dilated image and a closing operation on the eroded image;

[0009] S30. Adaptive feature selection steps: Extract local binary pattern features from the morphologically processed image, adaptively determine the threshold according to the statistical distribution of LBP features, segment the image into foreground and background, and select the LBP features in the foreground region as the final feature vector;

[0010] S40. Feature vector optimization steps: Perform principal component analysis on the extracted feature vector, and select the top N principal components with the highest cumulative contribution rate as the optimized feature vector.

[0011] Based on the above technical solutions, the present invention can also be improved as follows.

[0012] Furthermore, in the S10 image preprocessing step, the specific operation steps include:

[0013] S101. Grayscale processing sub-step;

[0014] Convert the color value of each pixel point of the original image into a grayscale value, perform weighted summation on the values of the red, green, and blue color channels in the color image according to specific weights to obtain a grayscale value, and apply a Gaussian filter to the grayscale processed image for smoothing. The standard deviation σ of the Gaussian filter is adaptively adjusted according to the image noise level;

[0015] S102. Noise level estimation sub-step;

[0016] Estimate the noise level of the image, which is achieved by analyzing the histogram of the image, observing the distribution of grayscale values, and judging whether there are abnormal noise peaks. In addition, the Fourier transform can also be used to detect the high-frequency noise components in the image. By comprehensively analyzing these results, the noise level of the image can be estimated.

[0017] S103. Adaptive adjustment sub-step of the standard deviation σ:

[0018] Dynamically adjust the standard deviation σ of the Gaussian filter according to the noise level estimated in the S102 sub-step. When the noise level is high, select a larger σ value to enhance the smoothing effect and effectively remove noise. On the contrary, when the noise level is low, select a smaller σ value to retain more image details and avoid detail loss caused by over-smoothing;

[0019] S104. Smoothing effect evaluation sub-step:

[0020] After the Gaussian filter application is completed, the effect of the smoothing process is evaluated by comparing the image quality before and after the process, observing whether the noise is effectively removed and whether the image details are preserved.

[0021] Furthermore, in the S20 morphological operation step, the selection of the structuring element is based on the scale and direction characteristics of the image texture, and different structuring element sizes and shapes are set to reflect the texture features in the image.

[0022] Furthermore, in the S20 morphological operation step, the selection of the structuring element not only depends on the scale and direction characteristics of the image texture, but also the local contrast and spatial frequency of the image texture to more comprehensively reflect the texture features in the image. The selection of the structuring element is determined by the following formula:

[0023] S = f(σ, θ, C, SF)

[0024] where S represents the structuring element, σ represents the scale of the image texture, θ represents the direction of the image texture, C represents the local contrast of the image texture, and SF represents the spatial frequency of the image texture.

[0025] Furthermore, in the S30 adaptive feature selection step, the specific operation of LBP feature extraction is as follows: for each pixel in the image, a 3x3 neighborhood is defined with it as the center, and the gray value of each pixel in the neighborhood is compared with the gray value of the center pixel to generate an 8-bit binary number, which is converted to a decimal number as the LBP feature value of the pixel.

[0026] Furthermore, in the adaptive threshold segmentation step, the distribution characteristics of the LBP feature values, the global gray characteristics of the image, and the local contrast information of the image are also incorporated to more accurately determine the segmentation threshold. The adaptive threshold T is calculated by the following formula:

[0027] T = α·min(H(LBP)) + β·mean(G(LBP)) + γ·G glabal -δ·C local

[0028] where T represents the adaptive threshold, H(LBP) represents the histogram of the LBP feature values, min(H(LBP)) represents the minimum value in the histogram, mean(H(LBP)) represents the average value of the histogram G glabal represents the global gray mean of the image, reflecting the overall brightness level of the image; C local represents the local contrast of the image, measuring the difference degree of the gray values in adjacent regions of the image; α, β, γ, and δ are weight coefficients used to adjust the influence degree of each feature on the final threshold.

[0029] Furthermore, the specific operation of principal component analysis in the S40 feature vector optimization step is as follows: First, calculate the covariance matrix of the extracted feature vector set to measure the correlation between feature vectors; then, solve the eigenvalues and corresponding eigenvectors of the covariance matrix. The magnitude of the eigenvalues reflects the importance of the feature vectors in the dataset; finally, according to the cumulative contribution rate of the eigenvalues, select the top N feature vectors with the highest contribution rates as the principal components for subsequent image processing or analysis tasks to reduce the data dimension and improve the processing efficiency.

[0030] Furthermore, the stability of the eigenvalues, the correlation between feature vectors, and the noise level of the dataset are also incorporated into the S40 feature vector optimization step to more accurately evaluate the degree of retention of the selected principal components for the original data information. The formula for the complicated cumulative contribution rate is as follows:

[0031]

[0032] where λ i represents the eigenvalue of the i-th principal component, M represents the total number of feature vectors, N represents the number of selected principal components, which is consistent with the original formula; w i represents the weight of the i-th principal component, which is used to adjust the contribution degree of each principal component to the cumulative contribution rate, and its value can be determined according to factors such as the stability of the eigenvalues and the correlation between feature vectors; represents the noise variance in the dataset, represents the total variance of the dataset, and the ratio of the two is used to measure the degree to which the dataset is affected by noise, thereby adjusting the calculation of the cumulative contribution rate; R stability represents the stability index of the eigenvalues, which is used to evaluate the consistency of the eigenvalues of the selected principal components in different datasets or under different conditions. The closer its value is to 1, the higher the stability.

[0033] Furthermore, the optimized feature vector processing step also includes normalization processing. The specific operation is as follows: Divide each element in the optimized feature vector by the norm of the feature vector, so that the values of the elements in the processed feature vector are in the interval [0,1], and the norm of the feature vector is 1. Normalization processing can eliminate the numerical differences between different feature dimensions, improve the sensitivity and accuracy of subsequent image classification and recognition algorithms to feature vectors, and thus improve the overall processing efficiency and performance.

[0034] Compared with the prior art, the technical solution of this application has the following beneficial technical effects:

[0035] The present invention simplifies subsequent processing steps and reduces computational complexity by performing grayscale processing on the original image. At the same time, a Gaussian filter is applied to smooth the grayscale image, effectively reducing noise and redundant information in the image, providing a clearer and more accurate image basis for subsequent morphological operations. A structuring element suitable for the texture characteristics of the image is also selected for dilation and erosion operations, as well as opening and closing operations. These morphological operations can retain the key texture features in the image while removing unnecessary details and noise. Then, local binary pattern (LBP) feature extraction is performed on the morphologically processed image, and a threshold is adaptively determined according to the statistical distribution of the LBP features to segment the image into foreground and background. The LBP features in the foreground region are selected as the final feature vector. The present invention can more accurately reflect the texture information in the image, providing a more reliable feature basis for subsequent image processing tasks. Finally, principal component analysis is performed on the extracted feature vector, and the top N principal components with the highest cumulative contribution rate are selected as the optimized feature vector. This step further reduces the dimension of the feature vector, reduces the amount of calculation, and retains the main texture information in the image. Through principal component analysis, the present invention can extract a more compact and effective feature vector, providing more powerful support for subsequent image classification, recognition, and other tasks. Description of the Drawings

[0036] Figure 1 It is a flowchart of a method for extracting image texture features based on morphology according to the present invention. Detailed Embodiments

[0037] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0038] Combined with Figure 1 As shown, a method for extracting image texture features based on morphology according to the present invention includes the following steps:

[0039] S10. Image preprocessing step: Perform grayscale processing on the original image and apply a Gaussian filter to smooth the grayscale image;

[0040] S20. Morphological operation step: Select a structuring element suitable for the texture characteristics of the image, perform dilation and erosion operations on the smoothed image, then perform an opening operation on the dilated image, and perform a closing operation on the eroded image;

[0041] S30. Adaptive feature selection step: Extract local binary pattern features from the morphologically processed image, adaptively determine a threshold based on the statistical distribution of the LBP features, segment the image into foreground and background, and select the LBP features in the foreground region as the final feature vector;

[0042] S40. Feature vector optimization step: Perform principal component analysis on the extracted feature vector, and select the top N principal components with the highest cumulative contribution rate as the optimized feature vector.

[0043] In a preferred embodiment of the present invention, it can be further configured as follows: In the S10 image preprocessing step, the specific operation steps include:

[0044] S101. Grayscale processing sub-step;

[0045] Convert the color value of each pixel point of the original image into a grayscale value. Weightedly sum the values of the red, green, and blue color channels in the color image according to specific weights to obtain a grayscale value. Apply a Gaussian filter to the grayscale processed image for smoothing. This grayscale value reflects the brightness information of the original pixel point without including color information. The specific weighted summation formula may vary depending on the application, but a common formula is: Gray = 0.299R + 0.587G + 0.114*B, where R, G, and B represent the values of the red, green, and blue channels respectively, and Gray represents the calculated grayscale value. The weight coefficients of the Gaussian filter are determined by a two-dimensional Gaussian function. The shape of this function is a bell-shaped curve, with the largest weight at the center point, and the weight gradually decreasing as the distance from the center point increases. The standard deviation σ of the Gaussian filter is a key parameter that determines the smoothing degree of the filter. In this method, the standard deviation σ of the Gaussian filter is adaptively adjusted according to the image noise level;

[0046] S102. Noise level estimation sub-step;

[0047] Estimate the noise level of the image, which is achieved by analyzing the histogram of the image, observing the distribution of grayscale values, and judging whether there are abnormal noise peaks. In addition, the Fourier transform can also be used to detect the high-frequency noise components in the image. By synthesizing these analysis results, the noise level of the image can be estimated.

[0048] S103. Adaptive adjustment sub-step of the standard deviation σ:

[0049] The noise level estimated in the sub-step S102 is used to dynamically adjust the standard deviation σ of the Gaussian filter. When the noise level is high, a larger σ value is selected to enhance the smoothing effect and effectively remove noise. On the contrary, when the noise level is low, a smaller σ value is selected to retain more image details and avoid detail loss caused by over-smoothing. This adaptive adjustment strategy can ensure good smoothing effects on images with different noise levels.

[0050] S104. Sub-step for evaluating the smoothing effect:

[0051] After the application of the Gaussian filter, the effect of the smoothing process is evaluated by comparing the image quality before and after processing, observing whether the noise is effectively removed and whether the image details are retained. In addition, some objective evaluation metrics, such as Peak Signal-to-Noise Ratio (PSNR) or Structural Similarity (SSIM), can be used to quantitatively evaluate the smoothing effect. These evaluation metrics can provide more accurate and objective evaluation results, which helps to optimize the algorithm parameters and improve the processing effect. The grayscale processing sub-step S101 not only converts the color image into a grayscale image, reducing the computational complexity, but also calculates the grayscale value through a specific weighted summation formula to ensure that the grayscale image can accurately reflect the luminance information of the original image. In addition, the noise level estimation sub-step S102 and the adaptive adjustment sub-step S103 of the standard deviation σ before the application of the Gaussian filter enable the Gaussian filter to be dynamically adjusted according to the noise level of the image, thereby effectively removing noise while ensuring image details. This adaptive strategy overcomes the defects of inconvenient parameter adjustment and poor image processing effect in traditional methods, improving the accuracy and robustness of image preprocessing.

[0052] In the sub-step S104 for evaluating the smoothing effect, a series of objective evaluation metrics, such as Peak Signal-to-Noise Ratio (PSNR) and Structural Similarity (SSIM), are introduced. These evaluation metrics can quantitatively evaluate the smoothing effect, providing a more accurate and objective basis for optimizing the algorithm parameters and improving the processing effect. By comparing the image quality before and after processing, observing the noise removal and detail retention situations, and combining with the quantitative results of the objective evaluation metrics, the present invention can comprehensively and meticulously evaluate the image preprocessing effect. This evaluation mechanism not only helps to improve the image preprocessing effect, but also provides a more reliable basis for subsequent morphological operations and feature extraction. At the same time, through continuous iterative optimization, the present invention can gradually approach the optimal processing effect, further improving the accuracy and efficiency of image texture feature extraction.

[0053] In a preferred embodiment of the present invention, it can be further configured as follows: in the morphological operation step of S20, the selection of the structural element is based on the scale and direction characteristics of the image texture. By setting different sizes and shapes of the structural element, the texture characteristics in the image can be reflected. By setting different sizes and shapes of the structural element, it can more flexibly adapt to texture characteristics of different scales and directions, thereby extracting more accurate and rich texture information. This adaptive strategy not only improves the accuracy and robustness of the morphological operation, but also helps to improve the performance of subsequent image classification, recognition and other tasks.

[0054] The size of the structural element should match the scale of the texture characteristics in the image to ensure that the morphological operation can accurately capture these characteristics. At the same time, the shape of the structural element should also be set according to the directionality of the texture to better reflect the texture orientation in the image. For example, for texture characteristics with obvious directionality, a structural element consistent with or perpendicular to the texture direction can be selected for the operation, so as to enhance the extraction effect of such characteristics.

[0055] In a preferred embodiment of the present invention, it can be further configured as follows: in the morphological operation step of S20, the selection of the structural element not only depends on the scale and direction characteristics of the image texture, but also has the local contrast and spatial frequency of the image texture to more comprehensively reflect the texture characteristics in the image. The selection of the structural element is determined by the following formula:

[0056] S = f(σ, θ, C, SF)

[0057] Wherein, S represents the structural element, σ represents the scale of the image texture, θ represents the direction of the image texture, C represents the local contrast of the image texture, SF represents the spatial frequency of the image texture. Usually, the selection of the structural element only depends on the scale and direction characteristics of the image texture, which to a certain extent limits the extraction accuracy of the morphological operation for the image texture characteristics. However, by comprehensively considering multiple dimensions such as the scale, direction, local contrast and spatial frequency of the image texture, the present invention can more accurately reflect the texture characteristics in the image, thereby extracting more rich and fine texture information. This multi-dimensional consideration not only improves the accuracy and robustness of the morphological operation, but also helps to improve the performance of subsequent image processing tasks.

[0058] By integrating parameters such as the scale, direction, local contrast, and spatial frequency of image texture, the fine-tuning of structural elements is achieved. Among them, the scale parameter of image texture reflects the size of texture features, the direction parameter describes the orientation of the texture, the local contrast parameter reflects the intensity of light and dark changes within the texture, and the spatial frequency parameter reveals the distribution density and periodicity of the texture in the image space. The organic combination of these parameters makes the selection of structural elements more in line with the actual characteristics of image texture, thereby improving the extraction effect of morphological operations on image texture features. In addition, the introduction of this formula also makes it possible to achieve adaptive morphological operations, that is, to dynamically adjust parameters such as the size, shape, and direction of structural elements according to the texture features in different images or image regions, so as to further enhance the flexibility and accuracy of morphological operations.

[0059] In a preferred embodiment of the present invention, it can be further configured as follows: In the S30 adaptive feature selection step, the specific operation of LBP feature extraction is as follows: For each pixel in the image, a 3x3 neighborhood is defined with it as the center. The gray value of each pixel in the neighborhood is compared with the gray value of the central pixel to generate an 8-bit binary number, which is converted into a decimal number as the LBP feature value of the pixel. The LBP feature extraction method adopted, with its advantages of simple calculation and strong feature expression ability, significantly improves the efficiency and accuracy of feature extraction. By comparing the gray values of the 3x3 neighborhood of each pixel in the image, generating a binary number and converting it into a decimal number as the LBP feature value, the present invention can effectively extract the local texture features in the image, providing a more reliable basis for subsequent feature selection and classification.

[0060] The LBP feature extraction method generates an 8-bit binary number by comparing the gray values of the pixels in the neighborhood with the central pixel. This operation is not only simple and fast but also can reflect the change of the gray values of the pixels in the neighborhood, that is, the local texture features. After converting the binary number into a decimal number, each pixel obtains a unique LBP feature value, and these feature values together constitute the LBP feature map of the image. Since the LBP feature has a certain robustness to illumination changes and can capture the subtle texture changes in the image, introducing the LBP feature extraction method in the adaptive feature selection step can significantly improve the accuracy and efficiency of feature selection. In addition, the LBP feature extraction method also has advantages such as rotational invariance, which can further enhance the robustness and applicability of feature extraction.

[0061] In a preferred embodiment of the present invention, it can be further configured as follows: In the adaptive threshold segmentation step, the distribution characteristics of LBP feature values, the global gray characteristics of the image, and the local contrast information of the image are also incorporated to more accurately determine the segmentation threshold. The adaptive threshold T is calculated by the following formula:

[0062] T = α·min(H(LBP)) + β·mean(H(LBP)) + γ·G glabal - δ·C local

[0063] Wherein, T represents the adaptive threshold, H(LBP) represents the histogram of LBP feature values, min(H(LBP)) represents the minimum value in the histogram, and mean(H(LBP)) represents the average value of the histogram G glabal represents the global grayscale mean of the image, reflecting the overall brightness level of the image; C local represents the local contrast of the image, measuring the degree of difference in grayscale values between adjacent regions in the image; α, β, γ, and δ are weight coefficients used to adjust the influence degree of each feature on the final threshold. It is shown that by comprehensively considering multiple dimensions such as the distribution of LBP feature values, the global grayscale mean, and the local contrast, the feature information of the image can be more comprehensively reflected, and thus the segmentation threshold can be more accurately determined. This adaptive threshold determination method not only improves the accuracy and robustness of image segmentation but also helps to enhance the performance of subsequent image analysis and processing.

[0064] The histogram of LBP feature values reflects the distribution of local texture features in the image. By considering the minimum value and the average value in the histogram, the present invention can capture the changing trend of texture features in the image, providing an important basis for determining the segmentation threshold. The global grayscale mean reflects the overall brightness level of the image, helping to adjust the segmentation threshold to adapt to images under different lighting conditions. The local contrast measures the degree of difference in grayscale values between adjacent regions in the image. By introducing this feature, the present invention can more sensitively capture the edge and detail information in the image, further improving the accuracy of segmentation. The weight coefficients are used to adjust the influence degree of each feature on the final threshold. Through reasonable weight allocation, the present invention can effectively fuse different feature information, thereby obtaining a more accurate segmentation threshold. In addition, the introduction of this formula also makes it possible to achieve automated image segmentation, that is, to dynamically adjust the segmentation threshold according to the feature information of different images to adapt to various complex image scenarios.

[0065] In a preferred embodiment of the present invention, it can be further configured as follows: The specific operation of principal component analysis in the S40 feature vector optimization step is as follows: First, calculate the covariance matrix of the extracted feature vector set to measure the correlation between each feature vector; then, solve the eigenvalues and corresponding eigenvectors of this covariance matrix. The magnitude of the eigenvalues reflects the importance of the feature vectors in the dataset; finally, according to the cumulative contribution rate of the eigenvalues, select the top N feature vectors with the highest contribution rates as the principal components for subsequent image processing or analysis tasks to reduce the data dimension and improve the processing efficiency. By using the PCA method, through calculating the covariance matrix of the feature vector set and solving the eigenvalues and eigenvectors, it can accurately measure the correlation between each feature vector and identify the most important feature vectors in the dataset. Selecting the top N feature vectors with the highest contribution rates as the principal components according to the cumulative contribution rate of the eigenvalues, the present invention not only significantly reduces the data dimension and computational amount, but also retains the main information in the data, improving the processing efficiency and accuracy of subsequent tasks.

[0066] The PCA method first calculates the covariance matrix of the feature vector set, which reflects the linear correlation between each feature vector. By solving the eigenvalues and corresponding eigenvectors of the covariance matrix, the PCA method can identify the principal component directions in the dataset, that is, the directions represented by the several feature vectors with the largest eigenvalues. These principal component directions are not only orthogonal to each other, but also can retain the variation information in the data to the greatest extent. Selecting the top N principal components according to the cumulative contribution rate of the eigenvalues, the present invention realizes effective dimensionality reduction of the data while retaining the main structure and information in the data. This dimensionality reduction method not only reduces the redundancy and noise of the data, but also improves the robustness and generalization ability of subsequent image processing or analysis tasks. In addition, as an unsupervised learning method, the PCA method does not rely on label information and is applicable to various complex image scenarios and task requirements.

[0067] In a preferred embodiment of the present invention, it can be further configured as follows: The stability of the eigenvalues, the correlation between the feature vectors, and the noise level of the dataset are also incorporated into the S40 feature vector optimization step to more accurately evaluate the degree of retention of the selected principal components for the original data information. The complicated cumulative contribution rate calculation formula is as follows:

[0068]

[0069] where λ i represents the eigenvalue of the i-th principal component, M represents the total number of feature vectors, N represents the number of selected principal components, which is consistent with the original formula; w i represents the weight of the i-th principal component, which is used to adjust the contribution degree of each principal component to the cumulative contribution rate, and its value can be determined according to factors such as the stability of the eigenvalues and the correlation between the feature vectors; represents the noise variance in the dataset, represents the total variance of the dataset. The ratio between the two is used to measure the degree to which the dataset is affected by noise, thereby adjusting the calculation of the cumulative contribution rate; R stability represents the stability index of the eigenvalue, which is used to evaluate the consistency of the selected principal components' eigenvalues in different datasets or under different conditions. The closer its value is to 1, the higher the stability. By comprehensively considering these factors, it can more comprehensively reflect the performance of the principal components in retaining the original data information, thereby selecting more stable and reliable principal components. This improvement not only enhances the accuracy and robustness of data dimensionality reduction but also helps improve the performance of subsequent image processing or analysis tasks.

[0070] The weight parameter is used to adjust the contribution degree of each principal component to the cumulative contribution rate, and its value can be determined comprehensively according to factors such as the stability of the eigenvalue and the correlation between eigenvectors. By introducing this parameter, the present invention can achieve a differential evaluation of the importance of different principal components, thereby selecting more principal components that meet the actual needs. The ratio of the noise variance to the total variance reflects the degree to which the dataset is affected by noise. By considering this factor, the present invention can adjust the calculation of the cumulative contribution rate to reduce the interference of noise on the data dimensionality reduction effect. The stability index of the eigenvalue is used to evaluate the consistency of the selected principal components' eigenvalues in different datasets or under different conditions. The closer its value is to 1, the higher the stability. By introducing this index, the present invention can achieve a quantitative evaluation of the stability of the principal components, thereby selecting more stable principal components. In addition, the introduction of the complex cumulative contribution rate calculation formula also makes it possible to achieve adaptive data dimensionality reduction, that is, to dynamically adjust the values of various parameters according to the characteristics and requirements of different datasets to obtain a more optimized data dimensionality reduction effect.

[0071] In a preferred embodiment of the present invention, it can be further configured as follows: the optimized feature vector processing step further includes normalization processing. The specific operation is as follows: each element in the optimized feature vector is divided by the norm of the feature vector, so that the values of each element in the processed feature vector are within the interval [0, 1], and the norm of the feature vector is 1. Normalization processing can eliminate the numerical differences between different feature dimensions, improve the sensitivity and accuracy of subsequent image classification and recognition algorithms to the feature vector, thereby enhancing the overall processing efficiency and performance. By introducing normalization processing, the sensitivity and accuracy of subsequent image classification and recognition algorithms to the feature vector are significantly improved. In traditional methods, there may be large numerical differences between the elements of the feature vector, which not only increases the computational complexity of the algorithm, but also may affect the stability and performance of the algorithm. Through normalization processing, each element in the feature vector is divided by the norm of the feature vector, so that the values of each element in the processed feature vector are within the interval [0, 1], and the norm of the feature vector is 1. This processing process not only eliminates the numerical differences between different feature dimensions, making the feature vector more unified and stable numerically, but also helps subsequent algorithms better capture and utilize the information in the feature vector, thereby improving the accuracy and efficiency of classification and recognition.

[0072] Normalization processing can not only simplify the numerical representation of the feature vector, reduce the computational complexity, but also enhance the robustness and generalization ability of the algorithm. Since the normalized feature vector is more unified numerically, the algorithm can be more fair and consistent when processing different feature dimensions, thus avoiding algorithm biases or instabilities caused by excessive numerical differences. In addition, normalization processing helps to improve the robustness of the algorithm to noise. In practical applications, image data is often disturbed by various noises. Through normalization processing, the numerical fluctuations in the feature vector are reduced, enabling the algorithm to more accurately capture and utilize the effective information in the image, thereby improving the accuracy of classification and recognition. Therefore, the introduction of normalization processing not only optimizes the numerical representation of the feature vector, but also enhances the performance and stability of subsequent image classification and recognition algorithms.

[0073] In the image preprocessing step, the original image undergoes grayscale processing to convert the color image into a grayscale image to simplify subsequent processing and reduce the computational amount. Subsequently, a Gaussian filter is applied to smooth the grayscale image to remove the noise and detail fluctuations in the image. The standard deviation σ of the Gaussian filter is adaptively adjusted according to the noise level of the image to ensure good smoothing effects under different noise conditions. Through the noise level estimation sub-step and the smoothing effect evaluation sub-step, the parameters of the Gaussian filter can be precisely controlled, thereby effectively removing noise while ensuring the details of the image;

[0074] Next, in the morphological operation step, a structuring element suitable for the image texture characteristics is selected to perform dilation, erosion, opening, and closing operations on the smoothed image. These morphological operations can enhance the texture features in the image while suppressing unnecessary details and noise. The selection of the structuring element is based on the scale and direction characteristics of the image texture, and factors such as local contrast and spatial frequency are considered to ensure that the texture features in the image can be comprehensively and accurately reflected;

[0075] Then, in the adaptive feature selection step, local binary pattern (LBP) feature extraction is performed on the morphologically processed image. The LBP feature is an effective texture descriptor that can capture the local texture information in the image. By comparing the gray value of each pixel with the gray values of the pixels in its neighborhood, a binary number is generated as the LBP feature value of the pixel. Subsequently, the threshold is adaptively determined according to the statistical distribution of the LBP features, the image is segmented into foreground and background, and the LBP features in the foreground region are selected as the final feature vector. This step realizes the accurate determination of the segmentation threshold by integrating the distribution characteristics of the LBP feature values, the global gray characteristics of the image, and the local contrast information, thereby improving the accuracy and representativeness of the feature vector;

[0076] In the feature vector optimization step, principal component analysis (PCA) is performed on the extracted feature vector. PCA is a commonly used data dimensionality reduction technique that can calculate the covariance matrix and eigenvalue decomposition of the feature vector set, and select the top N principal components with the highest cumulative contribution rate as the optimized feature vector. These principal components not only retain the main information in the original data but also reduce the dimensionality and complexity of the data, thereby improving the efficiency and performance of subsequent processing. In addition, the present invention also incorporates factors such as the stability of the eigenvalues, the correlation between the feature vectors, and the noise level of the data set in the PCA process to more accurately evaluate the degree of retention of the selected principal components for the original data information. Through a complicated cumulative contribution rate calculation formula, the dynamic adjustment and optimization of the contribution degree of the principal components are realized;

[0077] Finally, in the optimized feature vector processing step, the feature vector is normalized. The normalization process divides each element in the feature vector by the norm of the feature vector, so that the values of the elements in the processed feature vector are in the range of [0,1], and the norm of the feature vector is 1. This step eliminates the numerical differences between different feature dimensions and improves the sensitivity and accuracy of subsequent image classification and recognition algorithms to the feature vector.

[0078] It should be noted that, in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprising", "including" or any other variant thereof are intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements not only includes those elements but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising a..." does not exclude the presence of additional identical elements in the process, method, article or device comprising said element.

[0079] Although the embodiments of the present invention have been shown and described, it will be understood by those of ordinary skill in the art that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of the present invention, and the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A morphologically based image texture feature extraction method, characterized in that: The following steps are involved: S10, image preprocessing step: graying the original image, and applying a Gaussian filter to smooth the gray image; S20, morphological operation step: selecting a structural element suitable for the texture characteristics of the image, performing dilation and erosion operations on the smoothed image, then performing an opening operation on the dilated image, and performing a closing operation on the eroded image; S30, adaptive feature selection step: extracting local binary pattern features from the image after morphological processing, adaptively determining a threshold value according to the statistical distribution of LBP features, segmenting the image into foreground and background, and selecting the LBP features in the foreground area as the final feature vector; S40, feature vector optimization step: perform principal component analysis on the extracted feature vector, and select the first N principal components with the highest cumulative contribution rate as the optimized feature vector.

2. The method for extracting image texture features based on morphology according to claim 1, characterized in that: In the S10 image preprocessing step, the specific operation steps include: S101, grayscale processing sub-step; The color value of each pixel of the original image is converted into a grayscale value, and the values ​​of the red, green and blue color channels in the color image are weighted and summed according to specific weights to obtain a grayscale value. The grayscale image is smoothed by applying a Gaussian filter, and the standard deviation σ of the Gaussian filter is adaptively adjusted according to the image noise level; S102, noise level estimation sub-step; The noise level of an image can be estimated by analyzing the histogram of the image, observing the distribution of grayscale values, and determining whether there are abnormal noise peaks. In addition, Fourier transform can be used to detect high-frequency noise components in the image. By combining these analysis results, the noise level of the image can be estimated. S103, sub-step of adaptive adjustment of standard deviation σ: The noise level estimated in sub-step S102 is used to dynamically adjust the standard deviation σ of the Gaussian filter. When the noise level is high, a larger σ value is selected to enhance the smoothing effect, thereby effectively removing the noise. On the contrary, when the noise level is low, a smaller σ value is selected to retain more image details and avoid detail loss caused by over-smoothing. S104. Smoothing effect evaluation sub-step: After the Gaussian filter is applied, the effect of the smoothing process is evaluated by comparing the image quality before and after the process to see whether the noise is effectively removed while the image details are preserved.

3. The method for extracting image texture features based on morphology according to claim 1, characterized in that: In the morphological operation step S20, the selection of the structural element is based on the scale and direction characteristics of the image texture, and the texture characteristics in the image are reflected by setting different sizes and shapes of the structural elements.

4. The method for extracting image texture features based on morphology according to claim 3, characterized in that: In the S20 morphological operation step, the selection of the structural element depends not only on the scale and direction characteristics of the image texture, but also on the local contrast and spatial frequency of the image texture to more comprehensively reflect the texture characteristics in the image. The selection of the structural element is determined by the following formula: S=f(σ,θ,C,SF) Among them, S represents the structural element, σ represents the scale of the image texture, θ represents the direction of the image texture, C represents the local contrast of the image texture, and SF represents the spatial frequency of the image texture.

5. The method for extracting image texture features based on morphology according to claim 1, characterized in that: In the S30 adaptive feature selection step, the specific operation of LBP feature extraction is: for each pixel in the image, a 3x3 neighborhood is defined with it as the center, the grayscale value of each pixel in the neighborhood is compared with the grayscale value of the central pixel, an 8-bit binary number is generated, and the number is converted into a decimal number as the LBP feature value of the pixel.

6. The method for extracting image texture features based on morphology according to claim 5, characterized in that: The adaptive threshold segmentation step also incorporates the distribution characteristics of the LBP feature value, the global grayscale characteristics of the image, and the local contrast information of the image to more accurately determine the segmentation threshold. The adaptive threshold T is calculated by the following formula: T=α·min(H(LBP))+β·mean(H(LBP))+γ·G glabal -δ·C local Where T represents the adaptive threshold, H(LBP) represents the histogram of LBP feature values, min(H(LBP)) represents the minimum value in the histogram, and mean(H(LBP)) represents the mean value of the histogram. glabal Represents the global grayscale mean of the image, reflecting the overall brightness level of the image; C local It represents the local contrast of the image, which measures the difference in grayscale values ​​between adjacent regions in the image. α, β, γ, and δ are weight coefficients used to adjust the influence of each feature on the final threshold.

7. The method for extracting image texture features based on morphology according to claim 1, characterized in that: The specific operation of the principal component analysis in the S40 feature vector optimization step is as follows: first, the covariance matrix of the extracted feature vector set is calculated to measure the correlation between the feature vectors; then, the eigenvalues ​​and corresponding eigenvectors of the covariance matrix are solved, and the size of the eigenvalue reflects the importance of the eigenvector in the data set; finally, according to the cumulative contribution rate of the eigenvalue, the first N eigenvectors with the highest contribution rate are selected as the principal components for subsequent image processing or analysis tasks to reduce the data dimension and improve processing efficiency.

8. The method for extracting image texture features based on morphology according to claim 1, characterized in that: The S40 eigenvector optimization step also incorporates the stability of eigenvalues, the correlation between eigenvectors, and the noise level of the data set to more accurately evaluate the degree to which the selected principal component retains the original data information. The complicated cumulative contribution rate calculation formula is as follows: Among them, λ i represents the eigenvalue of the i-th principal component, M represents the total number of eigenvectors, and N represents the number of selected principal components, which is consistent with the original formula; w i Represents the weight of the i-th principal component, which is used to adjust the contribution of each principal component to the cumulative contribution rate. Its value can be determined based on the stability of the eigenvalue and the correlation between the eigenvectors. represents the noise variance in the dataset, Represents the total variance of the data set. The ratio of the two is used to measure the degree to which the data set is affected by noise, thereby adjusting the calculation of the cumulative contribution rate; R stability It represents the stability index of the eigenvalue, which is used to evaluate the consistency of the eigenvalues ​​of the selected principal component in different data sets or under different conditions. The closer the value is to 1, the higher the stability.

9. The method for extracting image texture features based on morphology according to any one of claims 1 to 8, characterized in that: The optimized feature vector processing step also includes normalization processing, which specifically involves dividing each element in the optimized feature vector by the norm of the feature vector so that the values ​​of each element of the processed feature vector are within the interval [0,1] and the modulus of the feature vector is 1. Normalization processing can eliminate numerical differences between different feature dimensions, improve the sensitivity and accuracy of subsequent image classification and recognition algorithms to feature vectors, and thus improve overall processing efficiency and performance.

Citation Information

Cited By

  • Composite board production process monitoring method and system

    CN121258986A

  • Point cloud stripe noise LTCF elimination method and system for subsidence water area

    CN121962625A

  • A point cloud strip noise LTCF elimination method and system for a subsidence water area

    CN121962625B

  • Personnel appearance intelligent identification method for intelligent security camera

    CN122116447A