Raw material quality detection method for foreign fiber machine
Through multi-angle and multi-band image processing, combining reflection characteristics and gradient value changes, the degree of abnormality of each pixel point is calculated, which solves the problem of difficulty in detecting transparent or translucent fibers in the prior art, and achieves higher detection accuracy and adaptability.
Patent Information
- Application Number
- CN202510727754.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-03
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2045-06-03
AI Technical Summary
The prior art is difficult to accurately detect transparent or translucent fibers, resulting in missed or mis-checked during the detection process, reducing detection accuracy.
By obtaining the raw material surface images at multiple angles and multiple bands, combining reflection characteristics and gradient value changes, the first and second anomalies of each pixel point are calculated, and the comprehensive anomaly index is fused through the weighted average method to determine the abnormal pixel point and construct the abnormal area.
It improves the accuracy of detection of transparent or translucent fibers, reduces the possibility of missed and missed detection, and significantly improves the overall performance of raw material quality inspection.
Smart Images

Figure CN120235886A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing. In particular, it relates to a method for detecting the quality of raw materials for a foreign fiber detector. Background Art
[0002] During the production, processing, and storage of cotton, various foreign fibers (abbreviated as foreign fibers) are easily mixed in. The presence of these foreign fibers will seriously affect the quality of cotton, resulting in defects in textiles, such as uneven dyeing, broken yarns, holes, etc., thus reducing the quality of textiles. It is necessary to detect and remove foreign fibers in cotton through a foreign fiber detector.
[0003] The existing Chinese patent application document with the publication number CN117439822A discloses a method and system for detecting the fiber strength of textiles. The system is an artificial intelligence optimized operating system that can realize functions such as artificial intelligence middleware and function libraries. This method can be used for the development of application software such as computer vision software. This method obtains the surface images of textiles before and after being stressed, analyzes the difference in texture features of the surface images to obtain the texture quality feature values of the textiles before and after being stressed, and at the same time analyzes the difference in color features of the surface images to obtain the color quality feature values of the textiles before and after being stressed, and combines the texture quality feature values and color quality feature values to obtain the fiber strength of the textiles.
[0004] The above method can accurately obtain the fiber strength of textiles by analyzing the texture change features and color change features of the textile images before and after being stressed. Currently, image acquisition of cotton is carried out through machine vision technology. Due to the variety of foreign fibers, the detection of film-like foreign fibers is particularly difficult. Film-like foreign fibers usually have the characteristics of being transparent or semi-transparent, making the color and texture differences from cotton small in machine vision and difficult to distinguish. Most film-like foreign fibers can only reflect a small part of light, and only part of the film-like foreign fibers can be identified, resulting in missed detections or false detections during the detection process. Summary of the Invention
[0005] To solve the problem that film-like foreign fibers are similar in color and texture to cotton, difficult to distinguish, resulting in missed detections or false detections during the detection process and reducing the detection accuracy, the present invention provides solutions in the following aspects.
[0006] A method for detecting the quality of raw materials for a foreign fiber detector, comprising: obtaining the surface images of the raw materials at a preset angle to form an image set , obtaining the surface images of the raw materials in a preset wavelength band to form an image set , and respectively preprocessing the image set and the image set ; calculating the reflection characteristics of the surface images of the raw materials in the preprocessed image set to calculate the image set The first degree of abnormality of each pixel point in the surface images of all raw materials; according to the preprocessed image set Based on the change in the gradient value of each pixel point in the image set, obtain the fluctuation degree of each pixel point in the surface image of the raw material, and use the fluctuation degree to calculate the second degree of abnormality of each pixel point in all the surface images of the raw material in the image set; use the weighted average method to fuse the first degree of abnormality and the second degree of abnormality to obtain the comprehensive abnormality index corresponding to the position of each pixel point; compare the comprehensive abnormality index with the abnormality threshold to determine the abnormal pixel points, and construct an abnormal area, and determine the quality evaluation result of the surface image of the raw material according to the characteristic parameters of the abnormal area.
[0007] The present invention effectively improves the detection accuracy of transparent or semi-transparent foreign fibers by combining multi-angle reflection characteristics and multi-band gradient value changes. Specifically, through the preprocessing steps, including filtering, grayscale conversion, and image alignment, the image quality is significantly improved, providing a high-quality data basis. When calculating the first degree of abnormality, the included angle weight is introduced, considering the influence of different angles on the reflection characteristics, making the detection method more adaptable. When calculating the second degree of abnormality, by analyzing the change in the gradient value and introducing the band weight, the ability to identify abnormal features is further enhanced. By weighted fusion of the first and second degrees of abnormality, the comprehensive abnormality index is obtained, realizing a comprehensive evaluation of the degree of abnormality of each pixel point. By connected domain analysis to construct an abnormal area and quantifying and evaluating the raw material quality according to the characteristic parameters of the abnormal area, not only the detection accuracy is improved, but also the adaptability to different foreign fiber types is enhanced, reducing the possibility of missed detection and false detection, and significantly improving the overall performance of the raw material quality detection.
[0008] Preferably, the preprocessing includes: Perform filtering on the surface image of the raw material and convert it into a grayscale image. Use the feature point matching algorithm to align the surface image of the raw material. Take the pixel point at the lower left corner of each surface image of the raw material as the coordinate center, and record the horizontal right direction as the x-axis, and record the vertical upward direction as the y-axis to obtain the coordinates of the positions of each pixel point in the surface image of the raw material.
[0009] By performing filtering, grayscale processing, and feature point matching alignment on the surface image of the raw material, the image noise can be effectively reduced, the clarity of the image features can be enhanced, and the pixel points between different images can be accurately aligned in space. At the same time, a unified coordinate system is established, which is convenient for accurately positioning and analyzing the positions of each pixel point.
[0010] Preferably, the first degree of abnormality includes: Taking the image set The surface image of any raw material is the image of interest. Taking any pixel point in the image of interest as the pixel point of interest, obtain the range of gray values at the corresponding position of the pixel point of interest in the image set and perform normalization processing; Calculate the average gray value of the pixel points in the neighborhood of the pixel point of interest, and take the absolute difference between the gray value of the pixel point of interest and the average gray value as the local outlier; obtain the image set The maximum gray value of the pixel points in the image of interest in the image set that is greater than the preset gray value. Take the absolute difference between the gray value of the pixel point of interest and the maximum gray value as the global outlier; take the product of the ratio between the local outlier and the global outlier and the normalized range of gray values as the first degree of abnormality at the corresponding position of the pixel point of interest.
[0011] By performing multi-dimensional analysis on the gray values of each pixel point in the image set , including the range of gray values, local outliers, and global outliers, not only considers the gray value changes of pixel points in the local neighborhood but also combines the comparison of global gray values, so as to more accurately detect abnormal areas caused by reflection characteristics and improve the accuracy of detecting transparent or semi-transparent foreign fibers.
[0012] Preferably, the first degree of abnormality further includes: Taking the surface image of any raw material in the image set as the image of interest, taking any pixel point in the image of interest as the pixel point of interest, obtaining the range of gray values at the corresponding position of the pixel point of interest in the image set and performing normalization processing; Calculate the average gray value of the pixel points in the neighborhood of the pixel point of interest, and take the absolute difference between the gray value of the pixel point of interest and the average gray value as the local outlier; obtain the maximum gray value of the pixel points in the image of interest in the image set that is greater than the preset gray value, take the absolute difference between the gray value of the pixel point of interest and the maximum gray value as the global outlier, and take the ratio between the local outlier and the global outlier as the relative outlier; Use the negative exponential function to attenuate the absolute difference between the acquisition angle of the image of interest and the vertical incident angle to obtain the angle weight of the image of interest; Take the product of the normalized range of gray values, the relative outlier, and the angle weight as the first degree of abnormality at the corresponding position of the pixel point of interest.
[0013] By introducing the angle weight, considering the influence of the acquisition angle on anomaly detection, enables the detection method to more accurately identify abnormal areas caused by reflection characteristics and improves the detection accuracy.
[0014] Preferably, obtaining the fluctuation degree of each pixel point in the raw material surface image includes: Taking any raw material surface image in the image set as the target image, taking any pixel point in the target image as the target pixel point, and taking the absolute difference between the gradient value at the corresponding position of the target pixel point and the average gradient value of all pixel points in the neighborhood of the target pixel point as the local gradient difference; Calculating the global gradient variance of the corresponding positions of all pixel points in the image set at the corresponding positions of all pixel points; Taking the product of the global gradient variance and the local gradient difference as the fluctuation degree of the corresponding position of the target pixel point in the target image.
[0015] By analyzing the local gradient difference and the global gradient variance of the gradient values of each pixel point in the image set it is possible to comprehensively evaluate the abnormality degree of the corresponding position of the pixel point. The local gradient difference can identify abnormal areas caused by texture complexity or edge features. The global gradient variance can reflect the fluctuation of pixel points in different bands. Combining the local gradient difference with the global gradient variance can more accurately identify abnormal areas caused by the optical properties of transparent or semi-transparent foreign fibers.
[0016] Preferably, obtaining the fluctuation degree of each pixel point in the raw material surface image further includes: Taking any raw material surface image in the image set as the target image, taking any pixel point in the target image as the target pixel point, calculating the absolute difference between the acquisition band corresponding to the target image and the preset band, and performing exponential decay using the negative exponential function to obtain the band weight; Taking the absolute difference between the gradient value at the corresponding position of the target pixel point and the average gradient value of all pixel points in the neighborhood of the target pixel point as the local gradient difference; Calculating the global gradient variance of the corresponding positions of all pixel points in the image set at the corresponding positions of all pixel points; Taking the product of the band weight, the local gradient difference and the global gradient variance as the fluctuation degree of the corresponding position of the target pixel point in the target image.
[0017] By attenuating the difference between the acquisition band and the preset band through the negative exponential function to obtain the band weight, it is possible to highlight abnormal features that are more sensitive in a specific band.
[0018] Preferably, the second abnormality degree includes: Obtaining the image set The degree of fluctuation at the corresponding position of each pixel point in each raw material surface image is used, and the average value of all degrees of fluctuation is used as the second degree of abnormality of each pixel point.
[0019] Preferably, the comprehensive abnormality index includes: Weights are respectively set for the first degree of abnormality and the second degree of abnormality, and weighted summation is performed to obtain the comprehensive abnormality index of the position corresponding to each pixel point.
[0020] Preferably, the comparison of the comprehensive abnormality index with the abnormality threshold is used to determine abnormal pixel points and construct an abnormal area, including: In response to the comprehensive abnormality index being greater than or equal to the abnormality threshold, it is marked as an abnormal pixel point, otherwise it is marked as a normal pixel point. Connected component analysis is performed on the abnormal pixel points, and adjacent abnormal pixel points are divided into an abnormal area.
[0021] Preferably, determining the quality evaluation result of the raw material surface image according to the characteristic parameters of the abnormal area includes: The number of pixel points included in each abnormal area is used as the area of the abnormal area, and the total area of all abnormal areas is obtained. The proportion of the total area in the area of the raw material surface image is calculated. In response to the proportion being greater than the preset threshold, the quality evaluation result of the raw material surface image is poor, and a foreign fiber removal machine is used to remove impurity fibers from the raw material.
[0022] The present invention has the following effects: 1. By utilizing the reflection characteristics at different angles and the gradient value changes in different bands, the present invention can identify the abnormal characteristics manifested due to angle changes and the abnormal characteristics manifested due to wavelength changes. The weighted fusion of the first degree of abnormality and the second degree of abnormality can more comprehensively evaluate the degree of abnormality of the position corresponding to each pixel point, thereby improving the detection accuracy.
[0023] 2. By introducing the included angle weight and the band weight, the present invention can dynamically adjust the detection sensitivity according to the importance of different angles and bands. Through connected component analysis, adjacent abnormal pixel points can be divided into an abnormal area. By analyzing the total area of the abnormal area and its proportion in the image area, the quality of the raw material surface image can be further evaluated, effectively identifying transparent or semi-transparent foreign fibers, and significantly improving the detection accuracy and adaptability. Description of the Drawings
[0024] Figure 1 is a flowchart of the method of steps S1 - S4 in a method for detecting the quality of raw materials for a foreign fiber removal machine according to an embodiment of the present invention. Detailed Embodiment
[0025] 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 part of the embodiments of the present invention, rather than all of the embodiments.
[0026] Next, the specific implementation manners of the present invention will be described in detail with reference to the accompanying drawings.
[0027] Refer to Figure 1 , a raw material quality detection method for a foreign fiber separator includes steps S1 - S4, specifically as follows: S1: Obtain the raw material surface images at a preset angle to form an image set , obtain the raw material surface images in a preset wavelength band to form an image set , and preprocess the image set and the image set respectively.
[0028] Exemplarily, place a single high - definition camera at a certain height from the raw material surface for uniform light source. The preset angle is between , and image acquisition of the raw material surface is performed every . Use a rotatable bracket to fix the camera and ensure that it can accurately rotate between and . Considering that the raw material may have a certain thickness, if and are selected for shooting, the shooting effect may be poor. Therefore, images are collected when the included angle between the high - definition camera and the raw material is at , , , …, . A total of 35 images are collected, and the 35 raw material surface images form an image set .
[0029] When the included angle between the high - definition camera and the raw material is , select the preset wavelength band to be between . According to the existing paper: "[1] Cai Xiaoxia, Wu Lingling, Liang Haifeng, et al. Detection of foreign fibers in cotton based on near - infrared imaging technology [J]. Cotton Textile Technology, 2021, 49(04): 6 - 10.", it can be known that the range where the near - infrared wavelength band has a better effect on detecting white or transparent foreign fibers mainly focuses around 905nm. Therefore, the wavelength band between is selected for analysis. Raw material surface images are collected every . A total of 201 images are collected, and the 201 raw material surface images form an image set .
[0030] Specifically, the preprocessing includes the following steps: Filter the surface image of the raw material and convert it into a grayscale image. Use the feature point matching algorithm to align the surface images of the raw materials. Taking the pixel point at the lower left corner of each surface image of the raw material as the coordinate center, the horizontal right direction is denoted as axis, and the vertical upward direction is denoted as axis to obtain the coordinates of the positions of each pixel point in the surface image of the raw material.
[0031] Furthermore, perform adaptive filtering on each surface image of the raw material to smooth the image and reduce noise, and use adaptive histogram equalization to correct uneven illumination. Use the feature point matching algorithm to ensure that all pixel points in the image are aligned, that is, each pixel point corresponds to the same physical position in images at different angles. Among them, adaptive filtering, adaptive histogram equalization, image grayscale processing, and feature point matching algorithm are all existing technologies and will not be elaborated here.
[0032] It should be noted that foreign fibers can be roughly classified according to their physical properties into: transparent or semi-transparent foreign fibers, colored foreign fibers, and opaque foreign fibers. Among them, transparent or semi-transparent foreign fibers: such as plastic films, plastic ropes, etc., show obvious specular reflection characteristics in optical detection, and the gray value changes significantly. The specular reflection characteristics specifically refer to: caused by different reflection intensities of light at different angles. For colored foreign fibers, diffuse reflection occurs when light irradiates, and they are mainly identified through color and texture characteristics. The present invention does not analyze opaque foreign fibers because the detection of opaque foreign fibers is relatively easy, and existing technologies can already identify and detect them well.
[0033] Therefore, it can be known that through the reflection characteristics in the image set (multi-angle images), transparent or semi-transparent foreign fibers can be effectively identified. The specific steps are as follows: S2: According to the reflection characteristics of the surface images of the raw materials in the preprocessed image set calculate the first degree of abnormality of each pixel point of all surface images of the raw materials in the image set .
[0034] Taking any surface image of the raw material in the image set as the concerned image, and taking any pixel point in the concerned image as the concerned pixel point, obtain the gray value range of the corresponding position of the concerned pixel point in the image set and perform normalization processing; Calculate the average gray value of the pixel points in the neighborhood of the concerned pixel point, and take the absolute difference between the gray value of the concerned pixel point and the average gray value as the local outlier value; obtain the image set Focus on the maximum gray value of the gray values of the image pixels greater than the preset gray value, and take the absolute difference between the gray value of the focused pixel and the maximum gray value as the global outlier; take the product of the ratio between the local outlier and the global outlier and the normalized gray value range as the first anomaly degree corresponding to the position of the focused pixel.
[0035] For further explanation, obtain the image set The gray values of the pixels at each position in different angles, so as to extract the gray values in 35 raw material surface images, and analyze the pixels at the position It should be noted that the corresponding positions of each pixel and the pixels at the position are described differently, but have the same physical meaning, both referring to the pixels at a specific position in the image.
[0036] The position The gray value of the pixel at the position in 35 raw material surface images is denoted as where , represents the image serial number, obtain the average value of the gray values of the pixels in the 8-neighborhood where the pixel at the position is located in 35 raw material surface images, denoted as where , represents the image serial number, obtain the range of the gray values of the pixels at the position in 35 raw material surface images, denoted as Taking the th image as an example, obtain the gray values of all the pixels in the th image, and then obtain the maximum gray value greater than the preset gray value in the th image, denoted as .
[0037] Specifically, the anomaly degree satisfies the following relational expression: ; In the formula, represents the first anomaly degree of the pixel at the position in the th image, represents the range of the gray values of the pixels at the position in the image set , represents the gray value of the pixel at the position in the th image, represents the th image, and The average gray value of the pixels in the neighborhood of the pixel at denotes the maximum value of the gray values corresponding to all the peaks with gray values greater than a preset gray value in the
[0038] For further illustration, the preset gray value is 155. The preset gray value is an exemplary value and can be adjusted according to the characteristics of foreign fibers. The neighborhood refers to the 8-neighborhood. The purpose of obtaining the values greater than the preset gray value is to find the position of the pixel points that can best represent the reflection phenomenon, that is, the gray value corresponding to the area with the most obvious reflection. It reflects the difference between the pixel at and the maximum gray value of the pixel in the th image. And when the difference between the pixel at and the gray values of the pixels in its neighborhood is greater, the degree of abnormality of the pixel at in the th image is greater, and vice versa.
[0039] The smaller it is, the closer the gray value of the current pixel is to the maximum gray value in the image, indicating that the pixel has strong reflection. The larger it is, the more significant the difference between the gray value of the current pixel and the gray values of its surrounding neighborhood, indicating that the pixel shows abnormality in the local area; when both of these two conditions are met, it means that the pixel shows abnormality not only in comparison with the maximum gray value in the global range but also in comparison with the neighborhood in the local range. Therefore, the degree of abnormality of the current pixel will increase significantly; if the two conditions do not hold simultaneously, if is larger, but is still larger, it means that although there is no significant reflection, the local difference is still significant. In this case, further analysis is required. On the contrary, if is smaller, but is smaller, it means that although there is reflection, the local difference is not significant. In this case, further analysis is also required.
[0040] On the contrary the larger it is, the greater the gap between the gray value of the current pixel and the maximum gray value in the image, indicating that the pixel does not have significant reflection characteristics. The smaller it is, the smaller the difference between the gray value of the current pixel and the gray values of its surrounding neighborhood, indicating that the pixel shows normal performance in the local range; when both of these two conditions are met, it means that the pixel does not have significant reflection characteristics in the global range and is similar to the gray values of the surrounding pixels in the local range. Therefore, the degree of abnormality of this pixel is relatively low; if the two conditions do not hold simultaneously, it means that the pixel may show abnormality.
[0041] In addition, in another embodiment, it further includes: Using an image set Take any surface image of a raw material in the set as the target image, and take any pixel point in the target image as the target pixel point. Obtain the range of gray values at the corresponding position of the target pixel point in the image set and perform normalization processing; Calculate the average gray value of the pixel points in the neighborhood of the target pixel point, and take the absolute difference between the gray value of the target pixel point and the average gray value as the local outlier; Obtain the maximum gray value of the gray values of the pixel points in the target image in the image set that are greater than the preset gray value, take the absolute difference between the gray value of the target pixel point and the maximum gray value as the global outlier, and take the ratio between the local outlier and the global outlier as the relative outlier; Use a negative exponential function to attenuate the absolute difference between the acquisition angle of the target image and the vertical incident angle to obtain the angle weight of the target image; Take the product of the normalized gray value range, relative outlier, and angle weight as the first degree of abnormality at the corresponding position of the target pixel point.
[0042] For further explanation, due to the reflection characteristics of foreign fibers, images at different angles have different influence weights on the detection of the first degree of abnormality. Therefore, considering that when the incident angle is close to , the light is vertically incident and the reflection characteristics are the most significant. Therefore, the acquisition angle is introduced as the weight of images at different angles.
[0043] Specifically, the degree of abnormality satisfies the following relational expression: ; In the formula, represents the first degree of abnormality of the pixel point at the position in the th image, represents the acquisition angle corresponding to the th image, represents the range of gray values of the pixel point at the position in the image set , represents the gray value of the pixel point at the position in the th image, represents the average gray value of the pixel points in the neighborhood of the pixel point at the position in the th image, represents the maximum gray value corresponding to all peaks with gray values greater than the preset gray value in the th image, represents an exponential function with as the base.
[0044] That is to say, reflecting the angle difference between the pixel points at the position in the th image and The smaller the difference, the more the image can reflect the true state of the pixel points. Because is the vertical incident angle, and the characteristics of light reflection and absorption are the most obvious. And the pixel points at the position in have a greater range of gray values in the image set , which indicates that the pixel points at this position have a larger amplitude of gray value fluctuation in all images; so that when the acquisition angle is closer to , the weight is close to 1, indicating that the influence of the angle on the degree of abnormality is the smallest, and the calculation result of the degree of abnormality is more accurate. When the acquisition angle is far from , the weight is smaller, indicating that the influence of the angle on the degree of abnormality is greater, and the calculation result of the degree of abnormality is more affected by the angle.
[0045] It should be noted that the optical properties (such as interference, diffraction) of transparent and translucent foreign fibers at different wavelengths will cause changes in the gradient values. It can be identified by analyzing the gradient values in the image set (multi-band images). The edge and surface characteristics of transparent and translucent foreign fibers usually result in higher gradient values. Therefore, by analyzing the changes in the gradient values, the texture characteristics of transparent and translucent foreign fibers can be identified. The specific steps are as follows: S3: According to the changes in the gradient values of each pixel point in the preprocessed image set , obtain the fluctuation degree of each pixel point in the raw material surface image, and calculate the second degree of abnormality of each pixel point in all raw material surface images in the image set .
[0046] Specifically, obtaining the fluctuation degree includes the following steps: Taking any raw material surface image in the image set as the target image, taking any pixel point in the target image as the target pixel point, and taking the absolute difference between the gradient value at the corresponding position of the target pixel point and the average gradient value of all pixel points in the neighborhood of the target pixel point as the local gradient difference; Calculating the global gradient variance of the corresponding positions of all pixel points in the image set at the corresponding position of the target pixel point; Taking the product of the global gradient variance and the local gradient difference as the fluctuation degree of the corresponding position of the target pixel point in the target image.
[0047] For further explanation, for the obtained image set Among them, the gradient values of the pixel points at each position at different wavelengths, that is, for each pixel position, the gradient values in all 201 images are extracted. Taking the pixel point at the position of as an example for analysis: The pixel point at the position of in the 201 raw material surface images is denoted as , where , represents the image serial number. The average value of the gradient values of all pixel points of the pixel point at the position of in the 201 raw material surface images is denoted as , where , represents the image serial number. The global gradient variance of all pixel points of the pixel point at the position of in the 201 raw material surface images is denoted as . Taking the th image as an example, the gradient value of the pixel point at the position of in the th image is denoted as , and the average gradient value of the neighboring pixel points of the pixel point at the position of in the th image is denoted as .
[0048] Specifically, the fluctuation degree satisfies the following relational expression: ; In the formula, represents the fluctuation degree of the pixel point at the position of in the th image, represents the global gradient variance of all pixel points of the pixel point at the position of in the image set , represents the gradient value of the pixel point at the position of in the th image, represents the average gradient value of the neighboring pixel points of the pixel point at the position of in the th image.
[0049] That is to say, the larger the global gradient variance, the more it can indicate that the amplitude of the gradient value fluctuation of the pixel point at the position of in the image set is larger. The gradient value of the pixel point at the position of and the The greater the difference between the average gradients of neighboring pixel points in the multiple images, the more likely it is that the reflection at the pixel point at this position causes an increase in the gradient value and a greater increase in texture complexity, resulting in a greater degree of fluctuation.
[0050] In addition, in another embodiment, it further includes: Taking any raw material surface image in the image set as the target image, taking any pixel point in the target image as the target pixel point, calculating the absolute difference between the acquisition band corresponding to the target image and the preset band, and using the negative exponential function for exponential decay to obtain the band weight; Taking the absolute difference between the gradient value at the position corresponding to the target pixel point and the average gradient of all pixel points in the neighborhood of the target pixel point as the local gradient difference; Calculating the global gradient variance of the positions corresponding to all pixel points in the image set for the position corresponding to the target pixel point; Taking the product of the band weight, the local gradient difference, and the global gradient variance as the degree of fluctuation at the position corresponding to the target pixel point in the target image.
[0051] Raw material surface images of different bands have different influence weights on the detection of the degree of fluctuation. The main reason is that the optical properties of foreign fibers change significantly with the change of wavelength. By reasonably allocating weights, the abnormal features of transparent or semi-transparent foreign fibers can be detected more accurately, improving the accuracy and reliability of detection.
[0052] Specifically, the degree of fluctuation satisfies the following relational expression: ; In the formula, represents the degree of fluctuation of the pixel point at the position of in the th image, represents the acquisition band corresponding to the th image, represents the global gradient variance of all pixel points in the image set for the position of the pixel point at the position of , represents the gradient value of the pixel point at the position of in the th image, represents the average gradient of neighboring pixel points of the pixel point at in the th image, represents the exponential function with as the base.
[0053] That is to say, according to the existing paper: "[1] Cai Xiaoxia, Wu Lingling, Liang Haifeng, et al. Detection of foreign fibers in cotton based on near-infrared imaging technology [J]. Cotton Textile Technology, 2021, 49(04): 6-10.", it can be known that white paper, white sewing thread, cotton strip, plastic rope, and white woven bag silk all have the largest difference from the background in band, and plastic film and foam plastic have the largest difference from the background in wavelength.
[0054] By determining the optimal detection band of foreign fibers at a specific wavelength and the fluctuation degree of the gradient value of each pixel point in the image set the change of optical properties under the preset band is determined.
[0055] When the difference between the acquisition band corresponding to the pixel point at in the th image and is smaller; at the same time, the larger the variance value of the gradient value of the pixel point at in the image set (201 images); and the greater the difference between the gradient value of the pixel point at and the average gradient value of the pixel points in the image, the greater the degree of abnormality of the pixel point at in the th image, and vice versa.
[0056] The second degree of abnormality includes: Obtain the fluctuation degree of the corresponding positions of each pixel point of each raw material surface image in the image set and take the average value of all fluctuation degrees as the second degree of abnormality of each pixel point.
[0057] S4: Use the weighted average method to fuse the first degree of abnormality and the second degree of abnormality to obtain the comprehensive abnormality index corresponding to the position of each pixel point; compare the comprehensive abnormality index with the abnormality threshold to determine the abnormal pixel points, construct the abnormal area, and determine the quality evaluation result of the raw material surface image according to the characteristic parameters of the abnormal area.
[0058] The comprehensive abnormality index includes: Weights are set for the first degree of abnormality and the second degree of abnormality respectively, and weighted summation is performed to obtain the comprehensive abnormality index corresponding to the position of each pixel point.
[0059] Specifically, the comprehensive abnormality index satisfies the following relational expression: ; In the formula, represents the comprehensive abnormality index of the pixel point at , , are the weights of the first abnormal degree and the second abnormal degree respectively, indicating the first abnormal degree of the pixel at , indicating the second abnormal degree of the pixel at .
[0060] That is to say, the larger the first abnormal degree of the pixel at the position, and the larger the second abnormal degree , the larger the comprehensive abnormality index of the pixel at the position, and vice versa. are the weights of the first abnormal degree and the second abnormal degree of the pixel at the position respectively. Exemplarily, , .
[0061] In response to the comprehensive abnormality index being greater than or equal to the abnormality threshold, it is marked as an abnormal pixel, otherwise it is marked as a normal pixel. Perform connected component analysis on the abnormal pixels and divide adjacent abnormal pixels into an abnormal area.
[0062] Exemplarily, the abnormality threshold is 0.6, and the implementer can adjust it according to the quality grade of the required textile.
[0063] In addition, clustering can be performed according to the comprehensive abnormality index and gradient value of each pixel in the image. Using the K-means clustering method, multiple clustering clusters are obtained. Create a binary mask according to the clustering result, where the pixels corresponding to the abnormal degree greater than the abnormality threshold are marked as 1, otherwise 0, and determine the abnormal area corresponding to each clustering cluster.
[0064] Take the number of pixels included in each abnormal area as the area of the abnormal area, and obtain the sum of the areas of all abnormal areas. Calculate the ratio of the sum of the areas to the area of the raw material surface image. In response to the ratio being greater than the preset threshold, the quality evaluation result of the raw material surface image is poor, and use a foreign fiber machine to remove impurity fibers from the raw material.
[0065] Exemplarily, the preset threshold is 0.4, and the implementer can adjust it according to the quality grade of the required textile.
[0066] It should be noted that for those of ordinary skill in the art, without departing from the concept of the present invention, several modifications and improvements can still be made, and these all belong to the protection scope of the present invention. Therefore, the protection scope of this invention patent shall be subject to the appended claims.
Claims
1. A raw material quality detection method for a foreign fiber machine, characterized in that, Including: Obtain the raw material surface images at a preset angle to form an image set Obtain the raw material surface images in a preset wavelength band to form an image set And preprocess the image set And the image set respectively; Based on the reflection characteristics of the raw material surface images in the preprocessed image set calculate the first anomaly degree of each pixel point of all the raw material surface images in the image set ; Based on the gradient value changes of each pixel in the preprocessed image set obtain the fluctuation degree of each pixel in the raw material surface image, and calculate the second abnormal degree of each pixel of all the raw material surface images in the image set ; Using a weighted average method, fuse the first anomaly degree and the second anomaly degree to obtain a comprehensive anomaly index corresponding to each pixel position; compare the comprehensive anomaly index with an anomaly threshold to determine anomaly pixels, construct an anomaly region, and determine the quality evaluation result of the raw material surface image according to the characteristic parameters of the anomaly region.
2. The raw material quality detection method for a foreign fiber machine according to claim 1, wherein The preprocessing includes: Filter the surface image of the raw material and convert it into a grayscale image. Use the feature point matching algorithm to align the surface images of the raw materials. Take the pixel point at the lower left corner of each surface image of the raw material as the coordinate center, and record the horizontal right direction as axis, and record the vertical upward direction as axis to obtain the coordinates of the positions of each pixel point in the surface image of the raw material.
3. A raw material quality detection method for a foreign fiber separator according to claim 1, characterized in that, The first anomaly degree includes: Taking any surface image of a raw material in the image set as the concerned image, taking any pixel point in the concerned image as the concerned pixel point, obtaining the range of gray values at the corresponding position of the concerned pixel point in the image set and performing normalization processing; Calculate the gray - scale average value of the pixels in the neighborhood of the concerned pixel, and take the absolute difference between the gray - scale value of the concerned pixel and the gray - scale average value as the local outlier; obtain the image set The maximum gray - scale value of the gray - scale values of the concerned image pixels in that is greater than the preset gray - scale value is obtained, and the absolute difference between the gray - scale value of the concerned pixel and the maximum gray - scale value is taken as the global outlier; the product of the ratio between the local outlier and the global outlier and the normalized gray - scale value range is taken as the first degree of abnormality corresponding to the position of the concerned pixel.
4. The raw material quality detection method for a foreign fiber machine according to claim 1, characterized in that, The first anomaly degree further includes: Taking any surface image of a raw material in the image set as the concerned image, taking any pixel point in the concerned image as the concerned pixel point, obtaining the range of gray values at the corresponding position of the concerned pixel point in the image set , and performing normalization processing; calculating the average gray value of the pixel points in the neighborhood of the concerned pixel point, and taking the absolute difference between the gray value of the concerned pixel point and the average gray value as the local outlier; obtaining the maximum gray value of the gray values of the pixel points of the concerned image in the image set that is greater than the preset gray value, taking the absolute difference between the gray value of the concerned pixel point and the maximum gray value as the global outlier, and taking the ratio between the local outlier and the global outlier as the relative outlier; using the negative exponential function to attenuate the absolute difference between the acquisition angle of the concerned image and the vertical incident angle, and obtaining the angle weight of the concerned image; taking the product of the normalized range of gray values, the relative outlier, and the angle weight as the first degree of abnormality at the corresponding position of the concerned pixel point.
5. A raw material quality detection method for a foreign fiber machine according to claim 1, characterized in that, The obtaining of the fluctuation degree of each pixel in the raw material surface image includes: Taking any surface image of a raw material in the image set as the target image, taking any pixel point in the target image as the target pixel point, and taking the absolute difference between the gradient value at the corresponding position of the target pixel point and the average gradient value of all pixel points in the neighborhood of the target pixel point as the local gradient difference; Calculate the global gradient variance of the corresponding positions of all pixel points in the image set where the corresponding position of the target pixel point is located among all pixel points Taking the product of the global gradient variance and the local gradient difference as the fluctuation degree of the corresponding position of the target pixel in the target image.
6. A raw material quality detection method for a foreign fiber machine according to claim 1, characterized in that, The obtaining of the fluctuation degree of each pixel in the raw material surface image further includes: With an image set Take any surface image of a raw material in the set as the target image, take any pixel point in the target image as the target pixel point, calculate the absolute difference between the acquisition band corresponding to the target image and the preset band, and use the negative exponential function for exponential decay to obtain the band weight; Taking the absolute difference between the gradient value of the corresponding position of the target pixel and the average gradient value of all pixels in the neighborhood of the target pixel as the local gradient difference; Calculate the global gradient variance of the corresponding positions of all pixel points in the image set corresponding to the target pixel point ; Taking the product of the band weight, the local gradient difference and the global gradient variance as the fluctuation degree of the corresponding position of the target pixel in the target image.
7. A raw material quality detection method for a foreign fiber machine according to claim 1, characterized in that, The second anomaly degree includes: Obtain an image set For each pixel position corresponding to the surface image of each raw material in , the fluctuation degree of each pixel position is obtained, and the average value of all fluctuation degrees is used as the second abnormal degree of each pixel point.
8. A raw material quality detection method for a foreign fiber separator according to claim 1, characterized in that The comprehensive anomaly index includes: Set weights for the first anomaly degree and the second anomaly degree respectively, and perform weighted summation to obtain the comprehensive anomaly index corresponding to each pixel position.
9. A raw material quality detection method for a foreign fiber detector according to claim 1, characterized in that, The comparing the comprehensive anomaly index with the anomaly threshold to determine anomaly pixels and construct an anomaly region includes: In response to the comprehensive anomaly index being greater than or equal to the anomaly threshold, mark it as an anomaly pixel, otherwise mark it as a normal pixel, perform connected component analysis on the anomaly pixels, and divide adjacent anomaly pixels into an anomaly region.
10. The raw material quality detection method for a foreign fiber machine according to claim 1, characterized in that, The determining the quality evaluation result of the raw material surface image according to the characteristic parameters of the anomaly region includes: Taking the number of pixels included in each anomaly region as the area of the anomaly region, obtaining the total area sum of all anomaly regions, calculating the proportion of the area sum to the area of the raw material surface image, and in response to the proportion being greater than a preset threshold, the quality evaluation result of the raw material surface image is poor, and use a foreign fiber removing machine to remove impurity fibers from the raw material.
Citation Information
Patent Citations
Network security data management system and method based on Internet of Things
CN117439822A
Polarization detection method and device for white and colorless foreign matters in cotton
CN101968453A
Light-colored or transparent foreign fiber detection system
CN105951415A
Raw cotton defect and impurity detection-identification method and system
CN108961251A
Automatic detection and identification method and system for grey green fine foreign fibers
CN111882549A
Cited By
Textile production quality control method
CN120634381A
Textile production quality management method
CN120634381B