A method for detecting raw material quality of foreign fiber machine
By combining the multi-angle reflection characteristics and the method of changing the gradient value of multi-band, the abnormal index is calculated and fused, and the problem of indistinguishability of transparent or translucent heterofibers is solved, and high-accurate heterofiber detection is achieved.
Patent Information
- Application Number
- CN202510727754.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-03
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2045-06-03
AI Technical Summary
The prior art is difficult to effectively distinguish transparent or translucent fibers from cotton, resulting in missed or mis-checked during the detection process, reducing detection accuracy.
By obtaining the multi-angle reflection characteristics and the changes in the multi-band gradient value, the first and second anomalies of each pixel point are calculated, and the weighted average method is used to fuse the anomaly index to construct the anomaly area and evaluate the quality of the raw material.
It improves the detection accuracy and adaptability of transparent or translucent fibers, reduces missed and missed detection, and improves the overall performance of raw material quality inspection.
Smart Images

Figure CN120235886B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and in particular to a raw material quality detection method for a foreign fiber machine. Background Art
[0002] During the production, processing and storage of cotton, various foreign fibers (referred to as foreign fibers) are easily mixed in. The presence of these foreign fibers will seriously affect the quality of cotton and cause defects in textiles, such as uneven dyeing, yarn breakage, holes, etc., thereby reducing the quality of textiles. Foreign fibers in cotton need to be detected and removed through a foreign fiber machine.
[0003] A Chinese patent application, published under the publication number CN117439822A, discloses a method and system for detecting the fiber strength of textiles. This system is an artificial intelligence-optimized operating system capable of implementing AI middleware, function libraries, and other functions. The method can be used in the development of application software such as computer vision software. This method collects surface images of the textile before and after a force is applied, analyzes the texture features of the surface images to obtain texture quality characteristic values for the textile before and after the force is applied, and simultaneously analyzes the color features of the surface images to obtain color quality characteristic values for the textile before and after the force is applied. The fiber strength of the textile is determined by combining these texture and color quality characteristic values.
[0004] The above method accurately measures the fiber strength of textiles by analyzing their texture and color changes before and after stress. Currently, using machine vision to capture cotton images is challenging due to the wide variety of foreign fibers, particularly thin-film foreign fibers. These fibers are typically transparent or translucent, making them difficult to distinguish from cotton in color and texture. Most thin-film foreign fibers can only be identified by a small amount of reflected light, leading to missed or false detections. Summary of the Invention
[0005] In order to solve the problem that film-like foreign fibers are similar in color and texture to cotton and are difficult to distinguish, resulting in missed detection or false detection during the detection process and reduced 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 machine comprises: obtaining a raw material surface image at a preset angle, forming an image set , obtain the raw material surface image under the preset band and form an image set , and respectively for the image set and image collections Perform preprocessing; according to the preprocessed image set The reflection characteristics of the raw material surface image are calculated and the image set is The first abnormality degree of each pixel point of all raw material surface images in the image; according to the preprocessed image set The gradient value changes of each pixel in the raw material surface image are obtained, and the fluctuation degree of each pixel in the raw material surface image is calculated using the fluctuation degree. The method comprises the following steps: calculating the second abnormality degree of each pixel point in all raw material surface images; using a weighted average method, fusing the first abnormality degree and the second abnormality degree to obtain a comprehensive abnormality index corresponding to the position of each pixel point; determining abnormal pixels based on the comprehensive abnormality index and constructing an abnormal area, and determining a quality assessment result of the raw material surface image based on characteristic parameters of the abnormal area.
[0007] The present invention effectively improves the detection accuracy of transparent or translucent foreign fibers by combining multi-angle reflection characteristics and multi-band gradient value changes. Specifically, through preprocessing steps, including filtering, graying and image alignment, the image quality is significantly improved, providing a high-quality data foundation. When calculating the first degree of abnormality, the angle weight is introduced, and the influence of different angles on the reflection characteristics is taken into account, making the detection method more adaptable. When calculating the second degree of abnormality, the ability to identify abnormal features is further enhanced by analyzing the gradient value changes and introducing band weights. By weighted fusion of the first and second degrees of abnormality, a comprehensive abnormality index is obtained, which realizes a comprehensive assessment of the degree of abnormality of each pixel. By constructing abnormal areas through connected domain analysis, and quantitatively evaluating the quality of raw materials based on the characteristic parameters of the abnormal areas, not only the accuracy of detection is improved, but also the adaptability to different types of foreign fibers is enhanced, the possibility of missed detection and false detection is reduced, and the overall performance of raw material quality detection is significantly improved.
[0008] Preferably, the pretreatment includes:
[0009] The raw material surface image is filtered and converted into a grayscale image. The raw material surface images are aligned using a feature point matching algorithm. The pixel point in the lower left corner of each raw material surface image is used as the coordinate center, and the horizontal right direction is recorded as Axis, vertical upward direction is recorded as Axis, obtain the coordinates of each pixel position in the raw material surface image.
[0010] By filtering and gray-scaling the raw material surface image, and matching and aligning feature points, we can effectively reduce image noise, enhance the clarity of image features, and ensure precise spatial alignment of pixels between different images. At the same time, a unified coordinate system is established to facilitate accurate positioning and analysis of each pixel point.
[0011] Preferably, the first abnormality level includes:
[0012] Image Collection Any raw material surface image in the image is the focus image, and any pixel point in the focus image is the focus pixel point. The corresponding position of the focus pixel point in the image set is obtained. The grayscale value in is extremely poor and is normalized;
[0013] Calculate the grayscale average value of the pixel in the neighborhood of the pixel of interest, and take the absolute difference between the grayscale value of the pixel of interest and the grayscale average value as the local outlier; obtain the image set If the grayscale value of the pixel of the focused image is greater than the maximum grayscale value of the preset grayscale, the absolute difference between the grayscale value of the focused pixel and the maximum grayscale value is taken as the global outlier; the product of the ratio between the local outlier value and the global outlier value and the normalized grayscale value range is taken as the first outlier degree of the corresponding position of the focused pixel.
[0014] Through the image collection The grayscale value of each pixel in the image is analyzed in multiple dimensions, including grayscale value extremes, local outliers, and global outliers. It not only considers the grayscale changes of the pixel in the local neighborhood, but also combines the comparison of the global grayscale value, so that it can more accurately detect abnormal areas caused by reflective characteristics and improve the accuracy of transparent or translucent foreign fiber detection.
[0015] Preferably, the first abnormality level further includes:
[0016] Image Collection Any raw material surface image in the image is the focus image, and any pixel point in the focus image is the focus pixel point. The corresponding position of the focus pixel point in the image set is obtained. The grayscale value in is extremely poor and is normalized;
[0017] Calculate the grayscale average value of the pixel in the neighborhood of the pixel of interest, and take the absolute difference between the grayscale value of the pixel of interest and the grayscale average value as the local outlier; obtain the image set The grayscale value of the pixel of the focused image is greater than the maximum grayscale value of the preset grayscale, the absolute difference between the grayscale value of the focused pixel and the maximum grayscale value is taken as the global outlier, and the ratio between the local outlier and the global outlier is taken as the relative outlier;
[0018] A negative exponential function is used 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;
[0019] The product of the normalized grayscale value range, relative outlier value and angle weight is taken as the first outlier degree of the corresponding position of the focus pixel.
[0020] By introducing the angle weight, the influence of the acquisition angle on anomaly detection is taken into account, so that the detection method can more accurately identify the abnormal areas caused by the reflection characteristics and improve the detection accuracy.
[0021] Preferably, obtaining the fluctuation degree of each pixel point in the raw material surface image includes:
[0022] Image Collection Any raw material surface image in the target image is taken as the target image, and any pixel point in the target image is taken as the target pixel point. The absolute difference between the gradient value at the corresponding position of the target pixel point and the gradient average value of all pixels in the neighborhood of the target pixel point is taken as the local gradient difference;
[0023] Calculate the corresponding position of the target pixel in the image set The global gradient variance of all pixel points in the corresponding position;
[0024] The product of the global gradient variance and the local gradient difference is taken as the degree of fluctuation of the corresponding position of the target pixel in the target image.
[0025] Through the image collection By analyzing the gradient values of each pixel at the local gradient difference and global gradient variance, we can comprehensively assess the degree of anomaly at the corresponding pixel location. Local gradient differences can identify anomalies caused by texture complexity or edge features. Global gradient variance reflects the fluctuations of pixels in different wavelengths. Combining local gradient differences with global gradient variance can more accurately identify anomalies caused by the optical properties of transparent or translucent foreign fibers.
[0026] Preferably, the step of obtaining the fluctuation degree of each pixel point in the raw material surface image further includes:
[0027] Image Collection Any raw material surface image is taken as the target image, and any pixel point in the target image is taken as the target pixel point. The absolute difference between the acquisition band corresponding to the target image and the preset band is calculated, and the negative exponential function is used for exponential decay to obtain the band weight.
[0028] The absolute difference between the gradient value at the position corresponding to the target pixel and the gradient average of all pixels in the neighborhood of the target pixel is taken as the local gradient difference;
[0029] Calculate the corresponding position of the target pixel in the image set The global gradient variance of all pixel points in the corresponding position;
[0030] The product of the band weight, local gradient difference and global gradient variance is taken as the fluctuation degree of the corresponding position of the target pixel in the target image.
[0031] The difference between the acquired band and the preset band is attenuated by a negative exponential function to obtain the band weight, which can highlight the more sensitive abnormal features in a specific band.
[0032] Preferably, the second abnormality level includes:
[0033] Get image collection The fluctuation degree of each pixel point corresponding to each raw material surface image is calculated, and the average value of all fluctuation degrees is used as the second abnormality degree of each pixel point.
[0034] Preferably, the comprehensive abnormality index includes:
[0035] Weights are set for the first abnormality degree and the second abnormality degree respectively, and weighted summation is performed to obtain a comprehensive abnormality index corresponding to the position of each pixel point.
[0036] Preferably, the step of comparing the comprehensive abnormality index with the abnormality threshold, determining abnormal pixels, and constructing abnormal areas comprises:
[0037] In response to the comprehensive abnormality index being greater than or equal to the abnormality threshold, the pixel is marked as an abnormal pixel, otherwise it is marked as a normal pixel. A connected domain analysis is performed on the abnormal pixel, and adjacent abnormal pixels are divided into an abnormal area.
[0038] Preferably, determining the quality assessment result of the raw material surface image based on the characteristic parameters of the abnormal area includes:
[0039] The number of pixels contained in each abnormal area is taken as the area of the abnormal area, and the total area of all abnormal areas is obtained. The ratio of the total area to the area of the raw material surface image is calculated. In response to the ratio being greater than a preset threshold, the quality assessment result of the raw material surface image is poor, and a foreign fiber machine is used to remove impurity fibers from the raw material.
[0040] The present invention has the following effects:
[0041] 1. By utilizing the reflection characteristics at different angles and the changes in gradient values at different wavelengths, the present invention can identify abnormal features due to angle changes and abnormal features due to wavelength changes, and weightedly fuse the first abnormality degree and the second abnormality degree to more comprehensively evaluate the abnormality degree of the corresponding position of each pixel point, thereby improving the accuracy of detection.
[0042] 2. By introducing angle weights and band weights, the present invention can dynamically adjust the detection sensitivity according to the importance of different angles and bands. Through connected domain analysis, adjacent abnormal pixel points can be divided into abnormal areas. By analyzing the total area of the abnormal areas and their proportion of the image area, the quality of the raw material surface image can be further evaluated, transparent or translucent foreign fibers can be effectively identified, and the accuracy and adaptability of detection can be significantly improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 This is a method flow chart of steps S1 to S4 in a method for detecting raw material quality of a foreign fiber machine according to an embodiment of the present invention. DETAILED DESCRIPTION
[0044] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, but not all of the embodiments.
[0045] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0046] Reference Figure 1 A method for detecting raw material quality of a foreign matter fiber machine includes steps S1 to S4, which are specifically as follows:
[0047] S1: Obtain the raw material surface image at a preset angle to form an image set , obtain the raw material surface image under the preset band and form an image set , and respectively for the image set and image collections Perform preprocessing.
[0048] For example, a single high-definition camera is placed at a certain height from the surface of the raw material to provide a uniform light source, with a preset angle of Between, every interval Capture images of the raw material surface and use a rotatable bracket to fix the camera and ensure that it can accurately arrive Considering that the raw material may have a certain thickness, if you choose and Shooting may result in poor shooting effect, so the HD camera and the raw material are at the right angles. 、 、 、…、 Collect images at the same time, a total of 35 images are collected, and the 35 raw material surface images are formed into an image set .
[0049] When the angle between the HD camera and the raw material is When selecting the preset band According to the existing paper: "[1] Cai Xiaoxia, Wu Lingling, Liang Haifeng, et al. Cotton foreign fiber detection based on near-infrared imaging technology [J]. Cotton Textile Technology, 2021, 49(04): 6-10." It can be seen that the near-infrared band has a better effect on detecting white or transparent foreign fibers, mainly concentrated around 905nm. Therefore, the band is selected at Analyze between. Collect the raw material surface images once, and collect a total of 201 images. The 201 raw material surface images are formed into an image set. .
[0050] Specifically, the preprocessing includes the following steps:
[0051] The raw material surface image is filtered and converted into a grayscale image. The raw material surface images are aligned using a feature point matching algorithm. The pixel point in the lower left corner of each raw material surface image is used as the coordinate center, and the horizontal right direction is recorded as Axis, vertical upward direction is Axis, obtain the coordinates of each pixel position in the raw material surface image.
[0052] To further illustrate, each raw material surface image undergoes adaptive filtering to smooth the image and reduce noise, and adaptive histogram equalization is used to correct for uneven lighting. A feature point matching algorithm is used to ensure that all pixels in the image are aligned, meaning that each pixel corresponds to the same physical location in images from different angles. The adaptive filtering, adaptive histogram equalization, image grayscale processing, and feature point matching algorithm are all existing technologies and will not be further described here.
[0053] It should be noted that foreign fibers can be roughly divided into transparent or translucent foreign fibers, colored foreign fibers and opaque foreign fibers according to their physical properties. Among them, transparent or translucent foreign fibers, such as ground films and plastic ropes, show obvious mirror reflection characteristics in optical detection, and the grayscale value changes significantly. The mirror reflection characteristics specifically refer to: the reflection intensity of light is different at different angles. For colored foreign fibers, diffuse reflection will occur when light is irradiated, and they are mainly identified by color and texture characteristics. The present invention does not analyze opaque foreign fibers. Since opaque foreign fibers are relatively easy to detect, the existing technology can already perform good identification and detection.
[0054] Therefore, it can be known that through the image collection The reflective characteristics in the (multi-angle image) can effectively identify transparent or semi-transparent foreign fibers. The specific steps are as follows:
[0055] S2: Based on the preprocessed image collection The reflection characteristics of the raw material surface image are calculated and the image set is The first abnormality degree of each pixel point in all raw material surface images.
[0056] Image Collection Any raw material surface image in the image is the focus image, and any pixel point in the focus image is the focus pixel point. The corresponding position of the focus pixel point in the image set is obtained. The grayscale value in is extremely poor and is normalized;
[0057] Calculate the grayscale average value of the pixel in the neighborhood of the pixel of interest, and take the absolute difference between the grayscale value of the pixel of interest and the grayscale average value as the local outlier; obtain the image set If the grayscale value of the pixel of the focused image is greater than the maximum grayscale value of the preset grayscale, the absolute difference between the grayscale value of the focused pixel and the maximum grayscale value is taken as the global outlier; the product of the ratio between the local outlier value and the global outlier value and the normalized grayscale value range is taken as the first outlier degree of the corresponding position of the focused pixel.
[0058] Further explanation, get the image collection The grayscale value of each pixel point at different angles in the raw material surface is extracted to obtain the grayscale value of the raw material surface in 35 images. The pixel points at , which need to be explained is that the corresponding position of each pixel point is The description methods are different, but the physical meanings are the same, which refers to the pixel points at a specific position in the image.
[0059] Location The gray value of the pixel point at 35 raw material surface images is recorded as ,in , Indicates the sequence number of the image, and the position is obtained The average gray value of the pixel point in the 8 neighborhoods in the 35 raw material surface images is recorded as ,in , Indicates the sequence number of the image, and the position is obtained The extreme difference of the gray value of the pixel point in 35 raw material surface images is recorded as , with the first Take the image as an example, and get the The grayscale values of all pixels in the image are obtained The maximum grayscale value in the image whose grayscale value is greater than the preset grayscale is recorded as .
[0060] Specifically, the abnormality degree satisfies the following relationship:
[0061] ;
[0062] Where, Indicates in The position in the image is The first abnormality degree of the pixel at Indicates the location The pixel point at The extreme difference in grayscale values, Indicates the The position in the image is The gray value of the pixel at , Indicates the The position in the image is The average grayscale value of the pixel in the neighborhood of the pixel at Indicates the The maximum value of the grayscale values corresponding to all peaks in the image whose grayscale values are greater than the preset grayscale.
[0063] Further explanation: the preset grayscale is 155. The preset grayscale is an example value and can be adjusted according to the characteristics of foreign fibers. The neighborhood refers to the 8-neighborhood. The purpose of obtaining a grayscale greater than the preset grayscale is to find the pixel position that best represents the reflection phenomenon, that is, the grayscale value corresponding to the most obvious reflection area. Reflects the location The pixel at The difference between the maximum grayscale values of the pixels in the image, and the position is The greater the difference in grayscale value between the pixel at the location and the pixel in the neighborhood, the greater the difference in grayscale value between the pixel at the location and the pixel in the neighborhood. The pixel at The greater the abnormality in the image, the greater the abnormality in the image, and vice versa.
[0064] The smaller it is, the closer the grayscale value of the current pixel is to the maximum grayscale value in the image, indicating that the pixel has a strong reflection. The larger the value, the more significant the difference between the grayscale value of the current pixel and the grayscale value of its surrounding neighborhood, indicating that the pixel is abnormal in the local area; when these two conditions are met at the same time, it means that the pixel is abnormal not only in the global range compared with the maximum grayscale value, but also in the local range compared with the neighborhood, so the abnormality of the current pixel will increase significantly; if the two conditions are not met at the same time, if Larger, but Still large, indicating that although there is no significant reflection, but the local difference is still significant, in this case further analysis is needed, on the contrary if Smaller, but If the value is small, it means that although there is reflection, the local difference is not significant. In this case, further analysis is also needed.
[0065] on the contrary The larger the value, the greater the difference between the grayscale value of the current pixel and the maximum grayscale value in the image, indicating that the pixel has no significant reflective properties. The smaller the value, the smaller the difference between the grayscale value of the current pixel and the grayscale value of the surrounding neighborhood is, indicating that the pixel performs normally in the local range. When these two conditions are met at the same time, it means that the pixel has no significant reflective characteristics in the global range, and the grayscale value is similar to that of the surrounding pixels in the local range, so the abnormality of the pixel is low. If the two conditions are not met at the same time, it means that the pixel may perform abnormally.
[0066] In addition, another embodiment further includes:
[0067] Image Collection Any raw material surface image in the image is the focus image, and any pixel point in the focus image is the focus pixel point. The corresponding position of the focus pixel point in the image set is obtained. The grayscale value in is extremely poor and is normalized;
[0068] Calculate the grayscale average value of the pixel in the neighborhood of the pixel of interest, and take the absolute difference between the grayscale value of the pixel of interest and the grayscale average value as the local outlier; obtain the image set The grayscale value of the pixel of the focused image is greater than the maximum grayscale value of the preset grayscale, the absolute difference between the grayscale value of the focused pixel and the maximum grayscale value is taken as the global outlier, and the ratio between the local outlier and the global outlier is taken as the relative outlier;
[0069] A negative exponential function is used 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;
[0070] The product of the normalized grayscale value range, relative outlier value and angle weight is taken as the first outlier degree of the corresponding position of the focus pixel.
[0071] Further explanation: Due to the reflective characteristics of foreign fibers, images at different angles have different influence weights on the detection of the first abnormality degree. Therefore, considering that when the incident angle is close to When , the light is incident vertically and the reflection characteristics are most significant, so the acquisition angle is introduced as the weight of images at different angles.
[0072] Specifically, the abnormality degree satisfies the following relationship:
[0073] ;
[0074] Where, Indicates in The position in the image is The first abnormality degree of the pixel at Indicates the The acquisition angle corresponding to the image, Indicates the location The pixel point at The extreme difference in grayscale values, Indicates the The position in the image is The gray value of the pixel at , Indicates the The position in the image is The average grayscale value of the pixel in the neighborhood of the pixel at Indicates the The maximum value of the grayscale values corresponding to all peaks with grayscale values greater than the preset grayscale in the image. Indicates An exponential function with base .
[0075] That is to say, Reflect the The position of the pixel in the image is The angle between the pixel point at The smaller the difference, the better the image can reflect the true state of the pixel, because It is a vertical incident angle, and the characteristics of light reflection and absorption are most obvious. The pixel point at The larger the range of the gray value, the greater the fluctuation of the gray value of the pixel at that position in all images; so that the closer the acquisition angle is When the weight is close to 1, it means that the angle has the least impact on the degree of anomaly, and the calculation result of the degree of anomaly is more accurate. When , the smaller the weight is, the greater the influence of the angle on the degree of abnormality is, and the calculation result of the degree of abnormality is more affected by the angle.
[0076] It should be noted that the optical properties of transparent and semi-transparent fibers at different wavelengths (such as interference and diffraction) will lead to changes in the gradient value. Transparent and semi-transparent foreign fibers are identified by analyzing the gradient values in the image (multi-band image). The edges and surface characteristics of transparent and semi-transparent foreign fibers usually result in higher gradient values. Therefore, by analyzing the changes in gradient values, the texture characteristics of transparent and semi-transparent foreign fibers can be identified. The specific steps are as follows:
[0077] S3: Based on the preprocessed image collection The gradient value changes of each pixel in the raw material surface image are obtained, and the fluctuation degree of each pixel in the raw material surface image is calculated using the fluctuation degree. The second abnormality degree of each pixel point in all raw material surface images.
[0078] Specifically, obtaining the volatility includes the following steps:
[0079] Image Collection Any raw material surface image in the target image is taken as the target image, and any pixel point in the target image is taken as the target pixel point. The absolute difference between the gradient value at the corresponding position of the target pixel point and the gradient average value of all pixels in the neighborhood of the target pixel point is taken as the local gradient difference;
[0080] Calculate the corresponding position of the target pixel in the image set The global gradient variance of all pixel points in the corresponding position;
[0081] The product of the global gradient variance and the local gradient difference is taken as the degree of fluctuation of the corresponding position of the target pixel in the target image.
[0082] Further explanation, to obtain the image set In the image, the gradient value of each pixel at different wavelengths is extracted. That is, for each pixel position, its gradient value in all 201 images is extracted. Analyze the pixel points at:
[0083] Location The gradient value of the pixel point at 201 raw material surface images is recorded as ,in , Indicates the sequence number of the image, and the position is obtained The average value of the gradient values of all pixels in the 201 raw material surface images is recorded as ,in , Indicates the sequence number of the image, and the position is obtained The global gradient variance of the pixel point at 201 raw material surface images is recorded as , with the first For example, the position of the image The pixel at The gradient value in the image is recorded as , located in The pixel at The average gradient of the neighboring pixels in the image is recorded as .
[0084] Specifically, the degree of fluctuation satisfies the following relationship:
[0085] ;
[0086] Where, Indicates the location The pixel at The degree of fluctuation in the image, Indicates the location The pixel point at The global gradient variance of all pixels in , Indicates the location The pixel at The gradient value in the image, Indicates the location The pixel at The average gradient of the neighboring pixels in the image.
[0087] In other words, the larger the global gradient variance, the more it indicates that the position is The pixel point at The amplitude of the gradient value fluctuation is large. The gradient value of the pixel at The greater the difference between the average gradient values of neighboring pixels in an image, the greater the possibility that the gradient value increases due to reflection at the pixel point at that location, and the greater the possibility of increased texture complexity and the greater the degree of fluctuation.
[0088] In addition, another embodiment further includes:
[0089] Image Collection Any raw material surface image is taken as the target image, and any pixel point in the target image is taken as the target pixel point. The absolute difference between the acquisition band corresponding to the target image and the preset band is calculated, and the negative exponential function is used for exponential decay to obtain the band weight.
[0090] The absolute difference between the gradient value at the position corresponding to the target pixel and the gradient average of all pixels in the neighborhood of the target pixel is taken as the local gradient difference;
[0091] Calculate the corresponding position of the target pixel in the image set The global gradient variance of all pixel points in the corresponding position;
[0092] The product of the band weight, local gradient difference and global gradient variance is taken as the fluctuation degree of the corresponding position of the target pixel in the target image.
[0093] Raw material surface images in different wavelength bands have different influence weights on the detection of fluctuation degree. The main reason is that the optical properties of foreign fibers will change significantly with the change of wavelength. By reasonably allocating weights, the abnormal characteristics of transparent or translucent foreign fibers can be detected more accurately, thereby improving the accuracy and reliability of detection.
[0094] Specifically, the degree of fluctuation satisfies the following relationship:
[0095] ;
[0096] Where, Indicates the location The pixel at The degree of fluctuation in the image, Indicates the The acquisition band corresponding to the image, Indicates the location The pixel point at The global gradient variance of all pixels in , Indicates the location The pixel at The gradient value in the image, Indicates the location The pixel at The average gradient of the neighboring pixels in the image, Expressed that The exponential function of the base.
[0097] That is to say, according to the existing paper: "[1] Cai Xiaoxia, Wu Lingling, Liang Haifeng, et al. Cotton foreign fiber detection based on near-infrared imaging technology [J]. Cotton Textile Technology, 2021, 49(04): 6-10." It can be seen that white paper, white sewing thread, cotton strips, plastic ropes and white woven bag silk are all in The difference between the band and the background is the largest, and the ground film and foam plastic are The wavelength at which the difference with the background is the largest.
[0098] By determining the optimal detection band of foreign fibers at a specific wavelength, and the optimal detection band of each pixel in the image collection The fluctuation degree of the gradient value determines the change of optical characteristics in the preset wavelength band.
[0099] When the position The pixel at The corresponding acquisition bands in the image are The smaller the difference is; at the same time, the position The pixel point at The larger the variance of the gradient value in (201 images), the greater the position The greater the difference between the gradient value of the pixel at and the average gradient value of the pixels in the image, the greater the difference between the gradient value of the pixel at The pixel at The greater the abnormality in the image, the greater the abnormality, and vice versa.
[0100] The second degree of abnormality includes:
[0101] Get image collection The fluctuation degree of each pixel point corresponding to each raw material surface image is calculated, and the average value of all fluctuation degrees is used as the second abnormality degree of each pixel point.
[0102] S4: Using a weighted average method, the first abnormality degree and the second abnormality degree are merged to obtain a comprehensive abnormality index corresponding to the position of each pixel point; the abnormal pixel point is determined by comparing the comprehensive abnormality index with the abnormal threshold, and an abnormal area is constructed. According to the characteristic parameters of the abnormal area, the quality assessment result of the raw material surface image is determined.
[0103] Comprehensive abnormality index, including:
[0104] Weights are set for the first abnormality degree and the second abnormality degree respectively, and weighted summation is performed to obtain a comprehensive abnormality index corresponding to the position of each pixel point.
[0105] Specifically, the comprehensive anomaly index satisfies the following relationship:
[0106] ;
[0107] Where, Indicates The comprehensive abnormal index of the pixel point at 、 are the weights of the first abnormality degree and the second abnormality degree, Indicates The first abnormality degree of the pixel at Indicates The second abnormality degree of the pixel at .
[0108] That is, the location The first abnormality degree of the pixel at The larger the second abnormality The larger the The comprehensive abnormal index of the pixel point at The smaller the size, the bigger it is, and vice versa. They are located in The first abnormality degree of the pixel at , Second abnormality level The weights, for example, , .
[0109] In response to the comprehensive abnormality index being greater than or equal to the abnormality threshold, the pixel is marked as an abnormal pixel, otherwise it is marked as a normal pixel. A connected domain analysis is performed on the abnormal pixel, and adjacent abnormal pixels are divided into an abnormal area.
[0110] For example, the abnormality threshold is 0.6, and implementers can adjust it according to the required quality level of the textile.
[0111] In addition, clustering can be performed based on the comprehensive anomaly index and gradient value of each pixel in the image. The K-means clustering method can be used to obtain multiple clusters. A binary mask is created based on the clustering results, where the pixel points corresponding to the anomaly degree greater than the anomaly threshold are marked as 1, otherwise they are marked as 0, and the abnormal area corresponding to each cluster is determined.
[0112] The number of pixels contained in each abnormal area is taken as the area of the abnormal area, and the total area of all abnormal areas is obtained. The ratio of the total area to the area of the raw material surface image is calculated. In response to the ratio being greater than a preset threshold, the quality assessment result of the raw material surface image is poor, and a foreign fiber machine is used to remove impurity fibers from the raw material.
[0113] For example, the preset threshold is 0.4, and the implementer may adjust it according to the quality level of the required textile.
[0114] It should be noted that those skilled in the art may make various modifications and improvements without departing from the scope of the present invention, and these modifications and improvements fall within the scope of protection of the present invention. Therefore, the scope of protection of the patent for this invention shall be based on the appended claims.
Claims
1. A method for detecting the quality of raw materials for a foreign matter fiber machine, characterized in that: include: Obtain the raw material surface image at a preset angle to form an image set , obtain the raw material surface image under the preset band and form an image set , and respectively for the image set and image collections Perform pretreatment; According to the preprocessed image collection The reflection characteristics of the raw material surface image are calculated and the image set is The first abnormality degree of each pixel point of all raw material surface images in the image set Any raw material surface image in the image is the focus image, and any pixel point in the focus image is the focus pixel point. The corresponding position of the focus pixel point in the image set is obtained. The grayscale value in is extremely poor and is normalized; Calculate the grayscale average value of the pixel in the neighborhood of the pixel of interest, and take the absolute difference between the grayscale value of the pixel of interest and the grayscale average value as the local outlier; obtain the image set The grayscale value of the pixel of the focused image is greater than the maximum grayscale value of the preset grayscale, the absolute difference between the grayscale value of the focused pixel and the maximum grayscale value is taken as the global outlier, and the ratio between the local outlier and the global outlier is taken as the relative outlier; The absolute difference between the acquisition angle of the image of interest and the vertical incident angle is attenuated using a negative exponential function to obtain the angle weight of the image of interest. The product of the normalized grayscale value range, the relative outlier value, and the angle weight is used as the first abnormality degree of the corresponding position of the pixel of interest. The first abnormality degree satisfies: ; Where, Indicates in The position in the image is The first abnormality degree of the pixel at Indicates the The acquisition angle corresponding to the image, Indicates the location The pixel point at The extreme difference in grayscale values, Indicates the The position in the image is The gray value of the pixel at , Indicates the The position in the image is The average grayscale value of the pixel in the neighborhood of the pixel at Indicates the The maximum value of the grayscale values corresponding to all peaks with grayscale values greater than the preset grayscale in the image. Indicates An exponential function with base ; According to the preprocessed image collection The gradient value changes of each pixel in the raw material surface image are obtained, and the fluctuation degree of each pixel in the raw material surface image is calculated using the fluctuation degree. The second abnormality degree of each pixel point of all raw material surface images; The first abnormality degree and the second abnormality degree are fused using a weighted average method to obtain a comprehensive abnormality index for the corresponding position of each pixel point. The abnormal pixel point is determined by comparing the comprehensive abnormality index with the abnormal threshold, and an abnormal area is constructed. The quality assessment result of the raw material surface image is determined based on the characteristic parameters of the abnormal area.
2. A method for detecting raw material quality of a foreign matter fiber machine according to claim 1, characterized in that: The pretreatment includes: The raw material surface image is filtered and converted into a grayscale image. The raw material surface images are aligned using a feature point matching algorithm. The pixel point in the lower left corner of each raw material surface image is used as the coordinate center, and the horizontal right direction is recorded as Axis, vertical upward direction is Axis, obtain the coordinates of each pixel position in the raw material surface image.
3. The method for detecting raw material quality of a foreign matter fiber machine according to claim 1, characterized in that: The first abnormality degree is obtained in another way: Image Collection Any raw material surface image in the image is the focus image, and any pixel point in the focus image is the focus pixel point. The corresponding position of the focus pixel point in the image set is obtained. The grayscale value in is extremely poor and is normalized; Calculate the grayscale average value of the pixel in the neighborhood of the pixel of interest, and take the absolute difference between the grayscale value of the pixel of interest and the grayscale average value as the local outlier; obtain the image set If the grayscale value of the pixel of the focused image is greater than the maximum grayscale value of the preset grayscale, the absolute difference between the grayscale value of the focused pixel and the maximum grayscale value is taken as the global outlier; the product of the ratio between the local outlier value and the global outlier value and the normalized grayscale value range is taken as the first outlier degree of the corresponding position of the focused pixel.
4. The method for detecting raw material quality of a foreign matter fiber machine according to claim 1, characterized in that: The obtaining of the fluctuation degree of each pixel point in the raw material surface image includes: Image Collection Any raw material surface image in the target image is taken as the target image, and any pixel point in the target image is taken as the target pixel point. The absolute difference between the gradient value at the corresponding position of the target pixel point and the gradient average value of all pixels in the neighborhood of the target pixel point is taken as the local gradient difference; Calculate the corresponding position of the target pixel in the image set The global gradient variance of all pixel points in the corresponding position; The product of the global gradient variance and the local gradient difference is taken as the degree of fluctuation of the corresponding position of the target pixel in the target image.
5. The method for detecting raw material quality of a foreign matter fiber machine according to claim 1, characterized in that: The obtaining of the fluctuation degree of each pixel point in the raw material surface image further includes: Image Collection Any raw material surface image is taken as the target image, and any pixel point in the target image is taken as the target pixel point. The absolute difference between the acquisition band corresponding to the target image and the preset band is calculated, and the negative exponential function is used for exponential decay to obtain the band weight. The absolute difference between the gradient value at the position corresponding to the target pixel and the gradient average of all pixels in the neighborhood of the target pixel is taken as the local gradient difference; Calculate the corresponding position of the target pixel in the image set The global gradient variance of all pixel points in the corresponding position; The product of the band weight, local gradient difference and global gradient variance is taken as the fluctuation degree of the corresponding position of the target pixel in the target image.
6. The method for detecting raw material quality of a foreign matter fiber machine according to claim 1, characterized in that: The second abnormality level includes: Get image collection The fluctuation degree of each pixel point corresponding to each raw material surface image is calculated, and the average value of all fluctuation degrees is used as the second abnormality degree of each pixel point.
7. The method for detecting raw material quality of a foreign matter fiber machine according to claim 1, characterized in that: The comprehensive abnormality index includes: Weights are set for the first abnormality degree and the second abnormality degree respectively, and weighted summation is performed to obtain a comprehensive abnormality index corresponding to the position of each pixel point.
8. The method for detecting raw material quality of a foreign matter fiber machine according to claim 1, characterized in that: The method of comparing the comprehensive anomaly index with the anomaly threshold, determining the abnormal pixel points, and constructing the abnormal area includes: In response to the comprehensive abnormality index being greater than or equal to the abnormality threshold, the pixel is marked as an abnormal pixel, otherwise it is marked as a normal pixel. A connected domain analysis is performed on the abnormal pixel, and adjacent abnormal pixels are divided into an abnormal area.
9. The method for detecting raw material quality of a foreign matter fiber machine according to claim 1, characterized in that: Determining the quality assessment result of the raw material surface image based on the characteristic parameters of the abnormal area includes: The number of pixels contained in each abnormal area is taken as the area of the abnormal area, and the total area of all abnormal areas is obtained. The ratio of the total area to the area of the raw material surface image is calculated. In response to the ratio being greater than a preset threshold, the quality assessment result of the raw material surface image is poor, and a foreign fiber machine is used 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
Decomposition furnace operation state detection method
CN118823027A