Nondestructive testing method for textile materials based on spectral characteristics

By analyzing the spectral data of textile materials in hyperspectral images, calculating the spectral difference, deviation coefficient and anomaly factor, adjusting the spectral data to reduce the influence of outliers, and extracting accurate characteristic wavelengths, it solves the problem of principal component analysis in the existing technology. Outlier-sensitive issues improve classification detection accuracy of textile materials.

CN118329929BActive Publication Date: 2024-08-23JIANGSU CHANGJINHENG TEXTILE TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410756533.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-13
Publication Date
2024-08-23
Estimated Expiration
2044-06-13

AI Technical Summary

Technical Problem

The existing technology is sensitive to outliers when extracting the main components of textile materials, resulting in inaccurate classification detection results.

Method used

By analyzing the spectral data of the pixel to be measured and neighboring pixels in the hyperspectral image, calculating the spectral difference, deviation coefficient and anomaly factor, adjusting the spectral data based on the adjustment coefficient to reduce the impact of outliers, thereby extracting more accurate Characteristic wavelength.

Benefits of technology

It effectively reduces the impact of outliers on principal component analysis and improves the accuracy and efficiency of textile material classification detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118329929B
    Figure CN118329929B
Patent Text Reader

Abstract

The present invention relates to the technical field of textile material analysis, and in particular to a nondestructive testing method for textile materials based on spectral characteristics. A hyperspectral image of a textile sample to be tested is obtained, and one pixel is selected as the pixel to be tested; the similarity between the spectral data of the pixel to be tested and the neighboring pixels is analyzed to obtain the spectral difference of the pixel to be tested. Under normal circumstances, the peak value, fluctuation and change trend of the spectral curve of the same substance should be relatively consistent, so the fluctuation change and change trend between the spectral data of the pixel to be tested and the neighboring pixels are analyzed in turn to obtain the spectral deviation coefficient and the abnormal factor respectively; the two are combined with the spectral difference to obtain the spectral abnormal value and adjust the spectral data to obtain the final data, reduce the influence of the abnormal value, extract the characteristic wavelength from all the final data of the hyperspectral image, and improve the accuracy when performing classification detection according to the characteristic wavelength of the textile sample to be tested.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of textile material analysis, and in particular to a nondestructive testing method for textile materials based on spectral characteristics. Background Art

[0002] Spectroscopy reveals the structure, composition and properties of matter by analyzing its absorption and reflection of electromagnetic waves. Spectral analysis can provide a deeper understanding of the intrinsic characteristics of matter, so it is usually used to detect the category of textiles, thereby ensuring that textile materials can be accurately classified and improving efficiency.

[0003] Since the amount of spectral data is large when conducting textile testing, the existing technology usually needs to reduce its dimension to extract the principal components. However, when extracting the principal components, due to the sensitivity to outliers, the extracted principal components will be greatly affected by the outliers, thus affecting the accuracy of the classification detection results. Summary of the invention

[0004] In order to solve the technical problem that the extraction of the main component is sensitive to outliers, resulting in the main component being greatly affected by the outliers and thus affecting the accuracy of the classification test results, the purpose of the present invention is to provide a non-destructive testing method for textile materials based on spectral characteristics. The technical solution adopted is as follows:

[0005] Acquire a hyperspectral image of the textile sample to be tested, and select any pixel in the hyperspectral image as the pixel to be tested;

[0006] In a preset neighborhood centered on the pixel to be measured, the spectral difference of the pixel to be measured is obtained according to the similarity between the spectral data of the pixel to be measured and all the corresponding neighboring pixels; the spectral deviation coefficient of the pixel to be measured is obtained according to the fluctuation change between the spectral data of the pixel to be measured and all the corresponding neighboring pixels; the abnormal factor of the pixel to be measured is obtained according to the similarity of the change trend between the spectral data of the pixel to be measured and all the neighboring pixels;

[0007] Obtaining an adjustment coefficient according to the correlation between the spectral difference and the spectral deviation coefficient of all pixels in the hyperspectral image; obtaining a spectral abnormality value of the pixel to be measured according to the adjustment coefficient, the abnormality factor of the pixel to be measured and the spectral deviation coefficient; adjusting the spectral data of the pixel to be measured according to the spectral abnormality value of the pixel to be measured to obtain the final data of the pixel to be measured;

[0008] Data analysis is performed on all final data in the hyperspectral image to extract characteristic wavelengths; and classification and detection of the textile samples to be tested are performed according to the characteristic wavelengths.

[0009] Furthermore, the obtaining of the spectral difference of the pixel to be measured according to the similarity between the spectral data of the pixel to be measured and all corresponding neighboring pixels includes:

[0010] Calculating the spectral angle and Chebyshev distance between the spectral data of the pixel to be measured and each corresponding neighboring pixel, and obtaining a difference factor between the pixel to be measured and each neighboring pixel according to the value of the spectral angle and the value of the Chebyshev distance, wherein the value of the spectral angle and the value of the Chebyshev distance are both positively correlated with the difference factor;

[0011] The average value of the difference factors between the pixel to be measured and all neighboring pixels is accumulated as the spectral difference of the pixel to be measured.

[0012] Furthermore, the spectral deviation coefficient of the pixel to be measured is obtained according to the fluctuation change between the spectral data of the pixel to be measured and all corresponding neighboring pixels, including:

[0013] The two-dimensional coordinates corresponding to the maximum value in the spectral data of the pixel to be measured and all the corresponding neighboring pixels are used as the data to be measured, and the mean of the accumulated Euclidean distances between all the data to be measured is calculated as the distance factor;

[0014] Based on the discrete coefficient formula, the discrete coefficient is obtained according to the value of the maximum point in the spectral data of the pixel to be measured and all corresponding neighboring pixels;

[0015] Based on the definite integral formula, the integral values ​​of the spectral data of the pixel to be measured and all corresponding neighboring pixels within a preset wavelength range are calculated respectively, and the variance of all the integral values ​​is obtained;

[0016] The spectral deviation coefficient of the pixel to be measured is obtained according to the distance factor, the discrete coefficient and the variance of all the integral values, and the distance factor, the discrete coefficient and the variance of all the integral values ​​are positively correlated with the spectral deviation coefficient.

[0017] Furthermore, the obtaining of the abnormal factor of the pixel to be measured according to the similarity of the variation trend between the spectral data of the pixel to be measured and all neighboring pixels comprises:

[0018] The slope value of each data point in the spectral data of the pixel to be measured and each neighboring pixel is calculated in sequence, and the slope values ​​are smoothly connected to obtain the change trend curves of the pixel to be measured and each neighboring pixel respectively;

[0019] The DTW distances between the change trend curves of the pixel to be measured and each neighboring pixel are calculated in sequence, and the average of all DTW distances corresponding to the pixel to be measured is used as the abnormal factor.

[0020] Furthermore, the step of obtaining the adjustment coefficient according to the correlation between the spectral difference and the spectral deviation coefficient of all pixels in the hyperspectral image includes:

[0021] A coordinate system is constructed with the spectral difference as the horizontal axis and the spectral deviation coefficient as the vertical axis, and the spectral difference and spectral deviation coefficient of all pixels in the hyperspectral image are mapped to the coordinate system;

[0022] Fitting at least two different functions to all data in the coordinate system to obtain a fitting curve;

[0023] According to the goodness of fit of all fitting curves, the fitting curve with the largest goodness of fit is taken as the optimal fitting curve;

[0024] The Pearson correlation coefficient between the value of the abscissa and the value of the ordinate in the best fitting curve is used as the adjustment coefficient.

[0025] Further, obtaining the spectral abnormality value of the pixel to be measured according to the adjustment coefficient, the abnormality factor of the pixel to be measured and the spectral deviation coefficient includes:

[0026] The product of the abnormal factor of the pixel to be measured, the spectral deviation coefficient and the adjustment coefficient is taken as the spectral abnormal value of the pixel to be measured.

[0027] Furthermore, the spectral data of the pixel to be measured is adjusted according to the spectral abnormal value of the pixel to be measured to obtain the final data of the pixel to be measured, including:

[0028] The spectral abnormal value of the pixel to be tested is negatively correlated and normalized to obtain the value as the adjustment weight, and the adjustment weight is multiplied by each data value in the spectral data of the pixel to be tested to obtain an updated data value, and all updated data values ​​are smoothly connected to obtain the final data of the pixel to be tested.

[0029] Furthermore, the data analysis of all final data in the hyperspectral image to extract characteristic wavelengths includes:

[0030] The final data of all pixels in the hyperspectral image are analyzed based on the principal component analysis method, and a preset number of principal components are used as characteristic wavelengths.

[0031] Furthermore, the classifying and testing of the textile samples to be tested according to the characteristic wavelengths includes:

[0032] Calculating the mean square error between the characteristic wavelength and the standard characteristic wavelength of each type of textile material in sequence, and taking the normalized value of each mean square error as an evaluation index;

[0033] The textile material corresponding to the minimum value of all the evaluation indicators is used as the material category of the textile sample to be tested.

[0034] Furthermore, the preset neighborhood is 3×3.

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

[0036] The present invention first obtains a hyperspectral image of a textile sample to be tested, and then selects any pixel in the hyperspectral image as the pixel to be tested for analysis; the analysis is performed locally, and within a preset neighborhood, the spectral difference of the pixel to be tested is obtained by analyzing the similarity between the spectral data of the pixel to be tested and the neighboring pixels, and the defect abnormality at the location of the pixel to be tested is preliminarily characterized; further, because under normal circumstances, the peak values ​​of the spectral curves in the spectral data corresponding to the same substance should be consistent, and the fluctuation conditions should be relatively consistent, the spectral deviation coefficient of the pixel to be tested can be obtained according to the fluctuation changes between the spectral data of the pixel to be tested and the neighboring pixels; at the same time, under normal circumstances, the spectral data of the same substance should also have a relatively consistent change trend, so according to the similarity of the change trends between the spectral data of the pixel to be tested and the neighboring pixels, the evaluation coefficient of the pixel to be tested is obtained. Whether there is an abnormal factor of defect abnormality in the pixel; then the spectral difference, spectral deviation coefficient and abnormal factor can be combined to obtain the spectral abnormality value of the pixel to be tested, which is used to evaluate the defect abnormality at the location of the pixel to be tested; further, since the abnormal data will affect the result when extracting the characteristic wavelength, in order to improve the accuracy of the result, the spectral abnormality value can be used to adjust the spectral data to obtain the final data after adjustment of the spectral data of each pixel. At this time, the final data has been adjusted, which can effectively reduce the impact of the abnormal value on the subsequent process, so all the final data in the hyperspectral image can be analyzed to extract the characteristic wavelength. The characteristic wavelength is the main component, and the characteristic wavelength at this time will be more accurate. Therefore, when the textile samples are classified and tested according to the characteristic wavelength of the textile samples to be tested, more accurate test results can be obtained. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] 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.

[0038] Figure 1 A flow chart of a nondestructive testing method for textile materials based on spectral characteristics provided by one embodiment of the present invention. DETAILED DESCRIPTION

[0039] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation method, structure, characteristics and effects of a non-destructive testing method for textile materials based on spectral characteristics proposed by the present invention in combination 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.

[0040] 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.

[0041] Embodiment of the nondestructive testing method of textile materials based on spectral characteristics:

[0042] The following is a detailed description of a method for nondestructive testing of textile materials based on spectral characteristics provided by the present invention in conjunction with the accompanying drawings.

[0043] See also Figure 1 , which shows a method flow chart of a nondestructive testing method for textile materials based on spectral characteristics provided by an embodiment of the present invention, the method comprising the following steps:

[0044] Step S1: obtaining a hyperspectral image of a textile sample to be tested, and selecting any pixel in the hyperspectral image as a pixel to be tested.

[0045] Spectroscopy is a very important analytical method. By analyzing the absorption and reflection of electromagnetic waves by a substance, the structure, composition and properties of the substance are revealed. Spectral analysis can provide a deeper understanding of the intrinsic characteristics of the substance. Since the spectral detection method is usually non-contact and will not cause damage to the textile being tested, it can ensure the integrity and availability of the material, thereby achieving non-destructive testing of textile materials, so it can be used in the classification and testing of textile materials.

[0046] The present invention first uses a hyperspectral sorter to obtain a hyperspectral image of the textile sample to be tested. The hyperspectral image is a three-dimensional data block, but in addition to containing position information and spectral data, it may also contain information generated by interference from external factors, such as sensor errors, atmospheric radiation transmission effects, and mixed pixels. Therefore, in order to reduce the interference of the above factors, the empirical linear method can be used to perform radiation correction on the hyperspectral image to eliminate interference and obtain more realistic spectral data, and the symmetric nearest neighbor mean filtering method can be used to filter the hyperspectral image to achieve noise control while maintaining the original image features; at this time, the processed hyperspectral image is used in subsequent steps to preliminarily improve the accuracy of the results. It should be noted that the implementer of the device for obtaining the hyperspectral image in this embodiment of the present invention can adjust it according to the implementation scenario, which is not limited here; the empirical linear method and the symmetric nearest neighbor mean filtering method are both technical means well known to those skilled in the art, and will not be repeated here; in order to reduce the influence of color on spectral data, the embodiment of the present invention is to analyze pure color textiles.

[0047] At this point, the hyperspectral image of the textile sample to be tested is obtained and can be used in the subsequent analysis process.

[0048] Step S2: In a preset neighborhood centered on the pixel to be measured, the spectral difference of the pixel to be measured is obtained according to the similarity between the spectral data of the pixel to be measured and all the corresponding neighboring pixels; the spectral deviation coefficient of the pixel to be measured is obtained according to the fluctuation change between the spectral data of the pixel to be measured and all the corresponding neighboring pixels; the abnormal factor of the pixel to be measured is obtained according to the similarity of the change trend between the spectral data of the pixel to be measured and all the neighboring pixels.

[0049] Hyperspectral images are three-dimensional data blocks, and the amount of data contained in them is much larger than that of two-dimensional images and one-dimensional spectra. Therefore, for a large amount of data, it is often necessary to perform dimensionality reduction analysis to reduce the residual redundant information. In the embodiment of the present invention, the principal component analysis method is used to extract the principal components and find out the main information in the textile sample to be tested. However, since the principal component analysis is sensitive to outliers, if there are abnormalities in the textile sample, the principal components finally obtained will be affected by the outliers, resulting in inaccurate and unstable results. Therefore, this situation needs to be analyzed to reduce the impact of outliers. For ease of understanding and explanation, in this embodiment of the present invention, any pixel in the hyperspectral image obtained in step S1 is selected as the pixel to be tested, and the specific step flow is explained by analyzing the pixel to be tested.

[0050] Hyperspectral images contain wavelength axes, so each pixel in the hyperspectral image has a spectral data, which represents the reflection of different bands. The horizontal axis is the wavelength, and the vertical axis is the reflectivity. If there are no defects or other flaws on the textile sample, then in the hyperspectral image of the textile sample, the spectral data of each pixel should have a large similarity. At the same time, since defects appear somewhere on the surface of the textile sample, they often form a more distinct contrast with the surrounding local area, so the abnormal situation of the textile sample surface can be analyzed from the local area. The pixel to be tested is taken as the central pixel to construct a preset neighborhood.

[0051] Preferably, in one embodiment of the present invention, the preset neighborhood is set to 3×3.

[0052] By analyzing the similarity of the spectral data of pixels in a preset neighborhood, the difference between the pixel to be tested and its neighborhood pixels can be preliminarily obtained.

[0053] Preferably, in one embodiment of the present invention, obtaining the spectral difference of the pixel to be measured according to the similarity between the spectral data of the pixel to be measured and all corresponding neighboring pixels includes:

[0054] Since spectral angle mapping and Chebyshev distance are two commonly used measurement methods in spectral data analysis, they can be used to measure the similarity of two spectral data. Therefore, the embodiment of the present invention calculates the spectral angle and Chebyshev distance between the spectral data of the pixel to be tested and each corresponding neighboring pixel, and then calculates the difference factor between the pixel to be tested and each neighboring pixel based on the obtained spectral angle value and Chebyshev distance value, and the spectral angle value and Chebyshev distance value are positively correlated with the difference factor. Then, the difference factors of the pixel to be tested and all neighboring pixels are integrated, that is, the mean value after the accumulation of all the difference factors is taken as the spectral difference of the pixel to be tested. The pixel to be tested is pixel For example, the formula model of spectral difference can be specifically as follows:

[0055]

[0056] in, Indicates the pixel to be tested The spectral difference of Indicates the pixel to be tested The total number of neighboring pixels of Indicates the pixel to be tested The corresponding The value of the spectral angle between the spectral data of neighboring pixels, Indicates the pixel to be tested The corresponding The value of the Chebyshev distance between the spectral data of neighboring pixels.

[0057] In the formula model of spectral difference, in the same textile sample, if there are no defects such as flaws on the textile surface, the spectral reflectance curves in the spectral data corresponding to each pixel should be basically the same. Therefore, under normal circumstances, the spectral angle value and Chebyshev distance value between the spectral data of the pixel to be tested and the neighboring pixel should be small, so the difference factor between the pixel to be tested and the neighboring pixel The smaller it is, the more likely it is that there will be defects in the pixel to be tested. On the contrary, when the spectral difference is smaller, it means that the similarity between the spectral data of the pixel to be tested and its surrounding neighboring pixels is higher in the preset neighborhood, that is, the pixel to be tested is more likely to be a normal area. It should be noted that the methods for obtaining spectral angle and Chebyshev distance are both well known to those skilled in the art and will not be elaborated here.

[0058] Since textiles have more obvious absorption peaks at specific wavelengths, and the more obvious absorption peaks corresponding to textiles of the same material should be the same, and near the absorption peaks, the changes in the spectral data of textiles of the same material should also be relatively consistent, therefore, under normal circumstances, the fluctuations in the spectral data between the pixel to be measured and its neighboring pixels should be relatively similar. Based on this, the spectral deviation coefficient of the pixel to be measured can be analyzed and obtained.

[0059] Preferably, in one embodiment of the present invention, the spectral deviation coefficient of the pixel to be measured is obtained according to the fluctuation change between the spectral data of the pixel to be measured and all corresponding neighboring pixels, including:

[0060] First, the two-dimensional coordinates of the location of the maximum absorption peak are obtained, and the two-dimensional coordinates corresponding to the maximum value in the spectral data of the pixel to be tested and all the corresponding neighboring pixels are taken as the data to be tested. At this time, the data to be tested contains multiple binary groups, and then the average of the accumulated Euclidean distances between all the data to be tested is calculated as the distance factor. The distance factor can characterize the position difference of the maximum absorption peak between the spectral data of the pixel to be tested and its neighboring pixels; at the same time, based on the calculation formula of the discrete coefficient, the discrete coefficient is obtained according to the maximum value point in the spectral data of the pixel to be tested and all the corresponding neighboring pixels. The discrete coefficient can reflect the distribution discreteness of the maximum absorption peak between the spectral data of the pixel to be tested and its neighboring pixels, that is, the fluctuation.

[0061] Then, considering that under normal circumstances, near the maximum absorption peak, the changes in the spectral data of textiles of the same material should be relatively consistent, the integral values ​​of the spectral data of the pixel to be tested and all corresponding neighboring pixels within a preset range can be calculated based on the definite integral formula, and the variance of all integral values ​​can be obtained. The variance of all integral values ​​can reflect the fluctuation changes between the spectral data of the pixel to be tested and its neighboring pixels.

[0062] Finally, the spectral deviation coefficient of the pixel to be tested is obtained based on the obtained distance factor, discrete coefficient and variance of all integral values, and the distance factor, discrete coefficient and variance of all integral values ​​are positively correlated with the spectral deviation coefficient. For example, the formula model of the spectrum deviation coefficient can be specifically as follows:

[0063]

[0064] in, Indicates the pixel to be tested The spectral deviation coefficient, Indicates the pixel to be tested The variance of all corresponding integral values ​​is, Indicates the pixel to be tested The corresponding coefficient of dispersion is Indicates the pixel to be tested The corresponding distance factor.

[0065] In the formula model of the spectral deviation coefficient, the absorption peak in the spectral data can reflect the properties of the detected substance. Therefore, on the textile sample to be tested, if there is no abnormality on the surface, the characteristics at each pixel should be relatively similar. Therefore, when the distance factor corresponding to the pixel to be tested is smaller, it means that the two-dimensional coordinates corresponding to the maximum absorption peak between the spectral data of the pixel to be tested and the spectral data of its neighboring pixels are closer, which means that the possibility of defects at the location of the pixel to be tested is lower. Conversely, the larger the distance factor, the higher the possibility of defects at the location of the pixel to be tested. Then analyze the discrete coefficient. Under normal circumstances, the location of the maximum absorption peak between the spectral data of each pixel will be relatively similar. Then the distribution of the maximum value points of the pixel to be tested and all the corresponding neighboring pixels should be relatively concentrated. Therefore, the value of the maximum value point of the pixel to be tested and all the corresponding pixels can be obtained. The dispersion coefficient of the pixel to be tested is as follows: the larger the dispersion coefficient, the more discrete the distribution, that is, the more likely it is that there will be defects at the location of the pixel to be tested; conversely, the smaller the dispersion coefficient, the more concentrated the distribution, that is, the more likely it is that the location of the pixel to be tested is normal; similarly, under normal circumstances, the changes in the spectral data of each pixel near the maximum absorption peak and the absorption and reflection of the wavelength are also relatively similar, so based on the definite integral calculation formula, the integral value of the spectral data of the pixel to be tested and the corresponding neighboring pixels within the preset wavelength range is calculated, and then the variance of all integral values ​​is obtained to characterize the fluctuation of the spectral data of the pixel to be tested and the corresponding neighboring pixels. The larger the variance of all integral values, the more drastic the fluctuation of the data within the preset range, then the higher the possibility of defects in the pixel to be tested; conversely, the smaller the variance of all integral values, the lower the possibility of defects in the pixel to be tested. Finally, the distance factor, the discrete coefficient and the variance of all the integral values ​​are comprehensively analyzed. In this embodiment of the present invention, the three are multiplied together to obtain the spectral deviation coefficient of the pixel to be measured. The larger the three are, the larger the spectral deviation coefficient of the pixel to be measured is, which means that defects are more likely to occur in the pixel to be measured.

[0066] It should be noted that the coefficient of dispersion is also called the coefficient of variation. The specific method for obtaining it is the ratio of the standard deviation to the mean value. The formula is a calculation process well known to those skilled in the art and will not be described in detail here. In this embodiment of the present invention, the value of the maximum point of the spectral data is recorded as , the preset wavelength range is set to The specific scope can be adjusted by implementers according to the implementation scenario and is not limited here.

[0067] Under normal circumstances, the change trends of the spectral data of the same textile samples should be similar, so the similarity of the change trends between the spectral data of the pixel to be tested and all its corresponding neighboring pixels can be analyzed to obtain the abnormal factor of the pixel to be tested as an indicator to evaluate whether it has abnormal conditions such as defects.

[0068] Preferably, in one embodiment of the present invention, obtaining the abnormal factor of the pixel to be measured according to the similarity of the variation trend between the spectral data of the pixel to be measured and all the neighboring pixels includes:

[0069] Since the slope can reflect the changing trend of the data, the slope value of each data point in the spectral data of the pixel to be tested and each neighboring pixel is first calculated in turn, and the respective slope values ​​are smoothly connected to obtain the changing trend curves of the pixel to be tested and each neighboring pixel. Then, in order to characterize similar situations, the DTW distance between the changing trend curves of the pixel to be tested and each neighboring pixel can be calculated in turn. Finally, a comprehensive analysis is performed and the mean of all DTW distances corresponding to the pixel to be tested is used as the abnormal factor. The pixel to be tested is pixel Take 2 as an example, the abnormal factor of the pixel to be tested is recorded as It should be noted that the calculation method of the DTW distance and the calculation method of the slope are both well-known operations to those skilled in the art and will not be described in detail here; at the same time, the slope value of the last data point in the spectral data is set to the same value as the slope value of the second to last data point.

[0070] At this point, based on the above method, the spectral difference, spectral deviation coefficient and abnormal factor of all pixels in the hyperspectral image of the textile sample to be tested can be obtained.

[0071] Step S3: obtaining an adjustment coefficient according to the correlation between the spectral differences and spectral deviation coefficients of all pixels in the hyperspectral image; obtaining a spectral anomaly value of the pixel to be measured according to the adjustment coefficient, the anomaly factor of the pixel to be measured and the spectral deviation coefficient; adjusting the spectral data of the pixel to be measured according to the spectral anomaly value of the pixel to be measured to obtain the final data of the pixel to be measured.

[0072] Based on the analysis in the above step S2, it can be known that the greater the spectral difference of the pixel, the lower the similarity between the spectral data of the pixel to be tested and the pixels in its surrounding neighborhood within the preset neighborhood, that is, the more likely it is that there are defects at the pixel to be tested; at the same time, the greater the spectral deviation coefficient of the pixel to be tested, the more likely it is that there are defects at the pixel to be tested. Therefore, in the embodiment of the present invention, if an abnormality occurs on the surface of the textile sample, the spectral difference corresponding to the pixel and the spectral deviation coefficient will have an obvious positive correlation, and this feature can be used in subsequent analysis processes.

[0073] Preferably, in one embodiment of the present invention, the adjustment coefficient is obtained according to the correlation between the spectral difference and the spectral deviation coefficient of all pixels in the hyperspectral image, including:

[0074] The Pearson correlation coefficient can be used to evaluate the correlation between two variables. However, if the Pearson correlation coefficient is obtained directly, a higher correlation coefficient may be obtained, but this correlation coefficient cannot well describe the true relationship between the two variables. Therefore, before obtaining the Pearson correlation coefficient, function fitting can be performed to better describe the relationship between the two variables.

[0075] First, a coordinate system can be constructed with spectral difference as the horizontal axis and spectral deviation coefficient as the vertical axis, so as to map the spectral difference and spectral deviation coefficient of all pixels in the hyperspectral image to the coordinate system. Then, at least two different functions are fitted to all data in the coordinate system to obtain a fitting curve, and then the fitting curve with the largest goodness of fit among all fitting curves is used as the optimal fitting curve. At this time, the optimal fitting curve can better describe the relationship between spectral difference and spectral deviation coefficient. Finally, the Pearson correlation coefficient between the horizontal and vertical values ​​in the optimal fitting curve is used as the adjustment coefficient, denoted as It should be noted that, in this embodiment of the present invention, the different function fittings selected may be, for example, a linear function, a quadratic function, etc., and the specific functions selected are not limited here; the method for obtaining the goodness of fit is a method well known to those skilled in the art, and will not be described in detail here; the method for calculating the Pearson correlation coefficient is a calculation process well known to those skilled in the art, and will not be described in detail here; and, in other embodiments of the present invention, when constructing a coordinate system, the spectral deviation coefficient may be the horizontal axis and the spectral difference may be the vertical axis.

[0076] After the adjustment coefficient is obtained, it can be combined with the abnormal factor of the pixel to be measured and the spectral deviation coefficient obtained in the above analysis process to obtain the spectral abnormal value of the pixel to be measured.

[0077] Preferably, in one embodiment of the present invention, obtaining the spectral abnormality value of the pixel to be measured according to the adjustment coefficient, the abnormality factor of the pixel to be measured and the spectral deviation coefficient includes:

[0078] The product of the abnormal factor, spectral deviation coefficient and adjustment coefficient of the pixel to be tested is taken as the spectral abnormal value of the pixel to be tested. For example, the formula model of spectral outliers can be specifically as follows:

[0079]

[0080] in, Indicates the pixel to be tested The spectral outliers of Indicates the pixel to be tested The spectral deviation coefficient, Indicates the pixel to be tested The abnormal factor, Represents the adjustment factor.

[0081] In the formula model of spectral anomaly value, when a defect abnormality occurs at the pixel to be tested in the tested textile, the spectral deviation coefficient and spectral difference at that location will be positively correlated, so the adjustment coefficient The larger the value of will be; and, when the spectral deviation coefficient and the anomaly factor corresponding to the pixel to be tested are larger, it can be said that the pixel to be tested is more likely to have defects. Therefore, the product of the three is taken as the spectral anomaly value of the pixel to be tested. At this time, the adjustment coefficient, the spectral deviation coefficient of the pixel to be tested and the anomaly factor of the pixel to be tested are all positively correlated with the spectral anomaly value of the pixel to be tested.

[0082] After obtaining the spectral abnormal value of the pixel to be measured, the spectral data of the pixel to be measured can be adjusted based on this value to eliminate the influence of the abnormal value on the subsequent extraction of characteristic wavelengths.

[0083] Preferably, adjusting the spectral data of the pixel to be measured according to the spectral abnormal value of the pixel to be measured to obtain updated data of the pixel to be measured includes:

[0084] Since the larger the spectral outlier value corresponding to a pixel is, the greater the possibility that the spectral data at the pixel is abnormal, in order to eliminate the impact it will cause when extracting the characteristic wavelength later, a smaller adjustment coefficient is required to avoid further distortion of the spectral data; for spectral data with smaller spectral outlier values, a larger adjustment coefficient can be assigned, because its spectral data is more normal and its adjustment will not have a negative impact.

[0085] Based on this, the spectral abnormal value of the pixel to be tested is first negatively correlated and normalized to the value obtained as the adjustment weight, and then the adjustment weight is multiplied by each data value in the spectral data of the pixel to be tested to obtain the updated data value, and finally all the updated data values ​​are smoothly connected to obtain the final data of the pixel to be tested. For example, the formula model for adjusting the weight may be specifically as follows:

[0086]

[0087] in, Indicates the pixel to be tested The adjustment weight of Indicates the pixel to be tested The spectral outliers of Expressed as a natural constant An exponential function with base .

[0088] In the formula model for adjusting weights, based on the above analysis, it can be seen that under abnormal circumstances, spectral data will be affected, resulting in higher absorption peaks in bands that do not conform to the characteristics of this type of textile, thereby affecting the subsequent extraction of characteristic wavelengths. Therefore, it is necessary to reduce the impact of abnormal data on the extraction of characteristic wavelengths. Therefore, spectral data with large spectral abnormality values ​​require a smaller adjustment weight. Conversely, spectral data with small spectral abnormality values ​​indicate that it is more normal. At this time, even if it has a larger adjustment weight, it will not have a negative impact. Therefore, the spectral abnormality values ​​of the pixels to be tested are negatively correlated and normalized to complete the logical relationship correction and obtain the adjustment weight. Used to adjust the spectral data of the pixel to be measured.

[0089] At this point, based on the above steps, the final data of all pixels in the hyperspectral image of the textile sample to be tested, that is, the adjusted spectral data, can be obtained.

[0090] Step S4: Analyze all final data in the hyperspectral image and extract characteristic wavelengths; classify and detect the textile samples to be tested according to the characteristic wavelengths.

[0091] Textiles of different materials, such as cotton, linen, polyester, silk, etc., will show different spectral characteristics when exposed to light, so the material category of the textile can be judged by the characteristic information in the spectral data.

[0092] Preferably, in one embodiment of the present invention, data analysis is performed on all final data in the hyperspectral image to extract characteristic wavelengths, including:

[0093] In the above steps, the final data of all pixels in the hyperspectral image of the textile sample to be tested, that is, the adjusted spectral data, have been obtained. Therefore, the final data of all pixels in the hyperspectral image can be analyzed based on the principal component analysis method to obtain the principal components, and the first preset number of principal components are used as characteristic wavelengths. It should be noted that the principal component analysis method is a technical means well known to those skilled in the art and will not be described in detail here; in this embodiment of the present invention, the first preset number is set to the first 4, that is, the first 4 principal components are used as characteristic wavelengths, and the specific numerical value can be adjusted by the implementer according to the implementation scenario, which is not limited here.

[0094] Since the characteristic wavelength can reflect the material characteristics of the textile sample to be tested, it can be used in the classification and detection process.

[0095] Preferably, in one embodiment of the present invention, the classification detection of the textile samples to be tested according to the characteristic wavelengths includes:

[0096] First, the characteristic wavelengths of various types of textile materials are obtained as the standard characteristic wavelengths of various types of textile materials. Since the mean square error can reflect the degree of difference between two sets of data, that is, the similarity, in the embodiment of the present invention, the mean square error is used to calculate the mean square error between the characteristic wavelength of the textile sample to be tested and the standard characteristic wavelength of each type of textile material in turn, and the value after normalization of each mean square error obtained is used as an evaluation index. Since the smaller the value of the mean square error, the higher the similarity between the two sets of data, and vice versa, the larger the value of the mean square error, the lower the similarity between the two sets of data, so in order to obtain the accurate category of the textile sample to be tested, the textile material corresponding to the minimum value of all evaluation indicators should be used as the material category of the textile sample to be tested.

[0097] At this point, the classification test of the textile samples to be tested can be completed.

[0098] In summary, the present invention first obtains a hyperspectral image of the textile sample to be tested, and then selects any pixel in the hyperspectral image as the pixel to be tested for analysis; performs analysis locally, and obtains the spectral difference of the pixel to be tested within a preset neighborhood by analyzing the similarity between the spectral data of the pixel to be tested and the neighboring pixels, and preliminarily characterizes the defect abnormality at the location of the pixel to be tested; further, because under normal circumstances, the peak values ​​of the spectral curves in the spectral data corresponding to the same substance should be consistent, and the fluctuations should be relatively consistent, the spectral deviation coefficient of the pixel to be tested can be obtained according to the fluctuation changes between the spectral data of the pixel to be tested and the neighboring pixels; at the same time, under normal circumstances, the spectral data of the same substance should also have a relatively consistent change trend, so according to the similarity of the change trends between the spectral data of the pixel to be tested and the neighboring pixels, the evaluation coefficient of the pixel to be tested is obtained. Whether there is an abnormal factor indicating defect abnormality in the measured pixel; then the spectral difference, spectral deviation coefficient and abnormal factor can be combined to obtain the spectral abnormality value of the pixel to be measured, which is used to evaluate the defect abnormality at the location of the pixel to be measured; further, since the abnormal data will affect the result when extracting the characteristic wavelength, in order to improve the accuracy of the result, the spectral abnormality value can be used to adjust the spectral data to obtain the final data after adjustment of the spectral data of each pixel. At this time, the final data has been adjusted, which can effectively reduce the impact of the abnormal value on the subsequent process, so all the final data in the hyperspectral image can be analyzed to extract the characteristic wavelength. The characteristic wavelength is the main component, and the characteristic wavelength at this time will be more accurate. Therefore, when the textile samples are classified and tested according to the characteristic wavelength of the textile samples to be tested, more accurate test results can be obtained.

[0099] Embodiment of the method for extracting textile material features based on spectral features:

[0100] Spectroscopy reveals the structure, composition and properties of a substance by analyzing its absorption and reflection of electromagnetic waves. Spectral analysis can provide a deeper understanding of the intrinsic characteristics of a substance. Since the amount of spectral data is large when performing spectral detection on textiles to obtain textile features, the prior art usually requires dimensionality reduction to extract the principal components. However, when extracting the principal components, the principal components extracted are greatly affected by the outliers due to their sensitivity to outliers, resulting in inaccurate feature extraction. Therefore, an embodiment of the present invention provides a method for extracting textile material features based on spectral features, including:

[0101] Step S1: obtaining a hyperspectral image of a textile sample to be tested, and selecting a pixel in the hyperspectral image as a pixel to be tested;

[0102] Step S2: in a preset neighborhood centered on the pixel to be tested, according to the similarity between the spectral data of the pixel to be tested and all the corresponding neighboring pixels, the spectral difference of the pixel to be tested is obtained; according to the fluctuation change between the spectral data of the pixel to be tested and all the corresponding neighboring pixels, the spectral deviation coefficient of the pixel to be tested is obtained; according to the similarity of the change trend between the spectral data of the pixel to be tested and all the corresponding neighboring pixels, the abnormal factor of the pixel to be tested is obtained;

[0103] Step S3: obtaining an adjustment coefficient according to the correlation between the spectral differences and spectral deviation coefficients of all pixels in the hyperspectral image; obtaining a spectral anomaly value of the pixel to be measured according to the adjustment coefficient, the anomaly factor of the pixel to be measured and the spectral deviation coefficient; adjusting the spectral data of the pixel to be measured according to the spectral anomaly value of the pixel to be measured to obtain the final data of the pixel to be measured.

[0104] Among them, steps S1 to S3 have been described in detail in the above embodiment of the nondestructive testing method for textile materials based on spectral features, and will not be repeated here.

[0105] Step S4: Perform data analysis on all final data in the hyperspectral image and extract characteristic wavelengths.

[0106] In the above steps, the final data of all pixels in the hyperspectral image of the textile sample to be tested, that is, the adjusted spectral data, has been obtained. At this time, data analysis is performed on the final data, and the extracted feature information will be more accurate.

[0107] Preferably, in one embodiment of the present invention, data analysis is performed on all final data in the hyperspectral image to extract characteristic wavelengths, including:

[0108] The principal components can be obtained by performing data analysis on the final data of all pixels in the hyperspectral image based on the principal component analysis method, and the first preset number of principal components are used as characteristic wavelengths. It should be noted that the principal component analysis method is a technical means well known to those skilled in the art and will not be described in detail here; in this embodiment of the present invention, the first preset number is set to the first 4, that is, the first 4 principal components are used as characteristic wavelengths, and the specific numerical value can be adjusted by the implementer according to the implementation scenario, which is not limited here.

[0109] At this point, by adjusting the spectral data of each pixel in the hyperspectral image of the textile sample to be tested, the interference of outliers on the feature information extracted by the principal component analysis method can be effectively eliminated, making the result more accurate.

[0110] The beneficial effects brought by this embodiment include:

[0111] The present invention first obtains a hyperspectral image of a textile sample to be tested, and then selects any pixel in the hyperspectral image as the pixel to be tested for analysis; the analysis is performed locally, and within a preset neighborhood, the spectral difference of the pixel to be tested is obtained by analyzing the similarity between the spectral data of the pixel to be tested and the neighboring pixels, and the defect abnormality at the location of the pixel to be tested is preliminarily characterized; further, because under normal circumstances, the peak values ​​of the spectral curves in the spectral data corresponding to the same substance should be consistent, and the fluctuation conditions should be relatively consistent, the spectral deviation coefficient of the pixel to be tested can be obtained according to the fluctuation changes between the spectral data of the pixel to be tested and the neighboring pixels; at the same time, under normal circumstances, the spectral data of the same substance should also have a relatively consistent change trend, so according to the spectral data of the pixel to be tested and the neighboring pixels, the spectral deviation coefficient of the pixel to be tested can be obtained. According to the similarity of the changing trends between them, the abnormal factor for evaluating whether there is a defect abnormality in the pixel to be tested is obtained; then the spectral difference, the spectral deviation coefficient and the abnormal factor can be combined to obtain the spectral abnormality value of the pixel to be tested, which is used to evaluate the defect abnormality at the location of the pixel to be tested; further, since the abnormal data will affect the result when extracting the characteristic wavelength, in order to improve the accuracy of the result, the spectral abnormality value can be used to adjust the spectral data to obtain the final data after the adjustment of the spectral data of each pixel. At this time, the final data has been adjusted, which can effectively reduce the impact of the abnormal value on the subsequent process, so all the final data in the hyperspectral image can be analyzed to extract the characteristic wavelength. The characteristic wavelength is the main component, and the characteristic wavelength at this time will be more accurate.

[0112] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0113] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

Claims

1. A nondestructive testing method for textile materials based on spectral characteristics, characterized in that: The method comprises: Acquire a hyperspectral image of the textile sample to be tested, and select any pixel in the hyperspectral image as the pixel to be tested; In a preset neighborhood centered on the pixel to be measured, the spectral difference of the pixel to be measured is obtained according to the similarity between the spectral data of the pixel to be measured and all the corresponding neighboring pixels; the spectral deviation coefficient of the pixel to be measured is obtained according to the fluctuation change between the spectral data of the pixel to be measured and all the corresponding neighboring pixels; the abnormal factor of the pixel to be measured is obtained according to the similarity of the change trend between the spectral data of the pixel to be measured and all the neighboring pixels; Obtaining an adjustment coefficient according to the correlation between the spectral difference and the spectral deviation coefficient of all pixels in the hyperspectral image; obtaining a spectral abnormality value of the pixel to be measured according to the adjustment coefficient, the abnormality factor of the pixel to be measured and the spectral deviation coefficient; adjusting the spectral data of the pixel to be measured according to the spectral abnormality value of the pixel to be measured to obtain the final data of the pixel to be measured; Performing data analysis on all final data in the hyperspectral image to extract characteristic wavelengths; and classifying and testing the textile samples to be tested according to the characteristic wavelengths; The step of obtaining the spectral difference of the pixel to be measured according to the similarity between the spectral data of the pixel to be measured and all corresponding neighboring pixels comprises: Calculating the spectral angle and Chebyshev distance between the spectral data of the pixel to be measured and each corresponding neighboring pixel, and obtaining a difference factor between the pixel to be measured and each neighboring pixel according to the value of the spectral angle and the value of the Chebyshev distance, wherein the value of the spectral angle and the value of the Chebyshev distance are both positively correlated with the difference factor; The average value of the difference factors between the pixel to be measured and all neighboring pixels is accumulated as the spectral difference of the pixel to be measured; The step of obtaining the spectral deviation coefficient of the pixel to be measured according to the fluctuation change between the spectral data of the pixel to be measured and all corresponding neighboring pixels comprises: The two-dimensional coordinates corresponding to the maximum value in the spectral data of the pixel to be measured and all the corresponding neighboring pixels are used as the data to be measured, and the mean of the accumulated Euclidean distances between all the data to be measured is calculated as the distance factor; Based on the discrete coefficient formula, the discrete coefficient is obtained according to the value of the maximum point in the spectral data of the pixel to be measured and all corresponding neighboring pixels; Based on the definite integral formula, the integral values ​​of the spectral data of the pixel to be measured and all corresponding neighboring pixels within a preset wavelength range are calculated respectively, and the variance of all the integral values ​​is obtained; Obtaining a spectral deviation coefficient of the pixel to be measured according to the distance factor, the discrete coefficient and the variance of all the integral values, wherein the distance factor, the discrete coefficient and the variance of all the integral values ​​are positively correlated with the spectral deviation coefficient; The method of obtaining the abnormal factor of the pixel to be tested based on the similarity of the variation trends between the spectral data of the pixel to be tested and all neighboring pixels comprises: The slope value of each data point in the spectral data of the pixel to be measured and each neighboring pixel is calculated in sequence, and the slope values ​​are smoothly connected to obtain the change trend curves of the pixel to be measured and each neighboring pixel respectively; Calculating the DTW distances between the change trend curves of the pixel to be tested and each neighboring pixel in turn, and taking the average of all DTW distances corresponding to the pixel to be tested as the abnormal factor; The step of obtaining the adjustment coefficient according to the correlation between the spectral difference and the spectral deviation coefficient of all pixels in the hyperspectral image includes: A coordinate system is constructed with the spectral difference as the horizontal axis and the spectral deviation coefficient as the vertical axis, and the spectral difference and spectral deviation coefficient of all pixels in the hyperspectral image are mapped to the coordinate system; Fitting at least two different functions to all data in the coordinate system to obtain a fitting curve; According to the goodness of fit of all fitting curves, the fitting curve with the largest goodness of fit is taken as the optimal fitting curve; The Pearson correlation coefficient between the value of the abscissa and the value of the ordinate in the best fitting curve is used as the adjustment coefficient; The step of obtaining the spectral abnormality value of the pixel to be measured according to the adjustment coefficient, the abnormality factor of the pixel to be measured and the spectral deviation coefficient comprises: The product of the abnormal factor of the pixel to be measured, the spectral deviation coefficient and the adjustment coefficient is used as the spectral abnormal value of the pixel to be measured; The step of adjusting the spectral data of the pixel to be measured according to the spectral abnormal value of the pixel to be measured to obtain the final data of the pixel to be measured includes: The spectral abnormal value of the pixel to be measured is negatively correlated and normalized to obtain a value as an adjustment weight, the adjustment weight is multiplied by each data value in the spectral data of the pixel to be measured to obtain an updated data value, and all updated data values ​​are smoothly connected to obtain the final data of the pixel to be measured; The classifying and detecting the textile samples to be tested according to the characteristic wavelengths includes: Calculating the mean square error between the characteristic wavelength and the standard characteristic wavelength of each type of textile material in sequence, and taking the normalized value of each mean square error as an evaluation index; The textile material corresponding to the minimum value of all the evaluation indicators is used as the material category of the textile sample to be tested.

2. The nondestructive testing method for textile materials based on spectral characteristics according to claim 1 is characterized in that: The step of performing data analysis on all final data in the hyperspectral image and extracting characteristic wavelengths includes: The final data of all pixels in the hyperspectral image are analyzed based on the principal component analysis method, and a preset number of principal components are used as characteristic wavelengths.

3. The nondestructive testing method for textile materials based on spectral characteristics according to claim 1, characterized in that: The preset neighborhood is 3×3.