A non-woven fabric foreign fiber detection method and device based on Lab color space
By using Lab color space conversion and edge detection algorithms, the problem of identifying foreign fiber types in nonwoven fabrics has been solved, achieving high-precision and low-cost foreign fiber detection, which is suitable for real-time detection in nonwoven fabric production lines.
Patent Information
- Application Number
- CN202511316533.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-16
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2045-09-16
AI Technical Summary
Existing technologies cannot efficiently and accurately identify and distinguish the three types of foreign fibers (white cotton clumps, scorched cotton, and impurities) in nonwoven fabrics, resulting in crude processing methods, waste of raw materials, and risks of chemical pollution. Furthermore, traditional detection methods are inefficient and have poor accuracy.
A detection method based on the Lab color space is adopted. Foreign fiber regions are initially identified through RGB images, converted to Lab color space, and cotton block defects are judged by L component. The b component is combined to analyze scorched cotton and impurity defects. Edge detection algorithm and morphological operations are used for accurate classification.
It achieves high-precision detection of foreign fibers in non-woven fabrics, with a cotton block recognition rate of 100% and a scorched cotton/impurity classification accuracy of over 98%, reducing raw material loss and chemical pollution risks. It is suitable for real-time detection on production lines and has low hardware costs.
Smart Images

Figure CN120823203B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of non-woven fabric anomaly detection, and in particular to a non-woven fabric foreign fiber detection method and device based on a Lab color space. BACKGROUND
[0002] Non-woven fabrics have excellent air permeability, moisture absorption and tear resistance, and are widely used in disposable products such as masks, sanitary napkins, medical dressings, etc. With the increasing market demand, the production scale of non-woven fabrics is gradually expanding, and the requirements are becoming higher and higher.
[0003] As a substrate that directly contacts the skin, the cleanliness and safety of non-woven fabrics directly affect product quality and consumer health. In the production process, the mixing of three typical foreign fibers constitutes a core quality risk: white cotton blocks are formed due to local accumulation of cotton layers, which destroys material uniformity, as shown in Figure 1(a); charred cotton is caused by carbonized glue residues produced by high-temperature filament hanging of viscose raw material production equipment, which carries chemical contaminants, as shown in Figure 1(b); impurities (such as hair, small stones) are introduced due to environmental control omissions, which can pierce the fabric structure, as shown in Figures 1(c) and 1(d). Traditional detection techniques can only identify the presence of foreign objects, but cannot distinguish between foreign fiber types, resulting in a rough handling approach, such as treating harmless white cotton blocks the same as high-risk charred cotton, causing excessive scrap of raw materials, or failing to accurately trace the process defects of charred cotton, allowing chemical contamination risks to continue to permeate the supply chain.
[0004] Foreign fibers in non-woven fabrics not only affect their appearance, but also reduce their functionality (such as filtration effect, air permeability, moisture absorption, etc.). Through accurate foreign fiber classification, the differences in causes and hazards of the three types of foreign fibers can be accurately identified, enabling graded control: for white cotton blocks, locate the pressure abnormalities in the laying process, reduce whole roll scrap through local cutting and rework, and reduce raw material loss; rapid identification of charred cotton can be linked to spectral composition analysis, forcing the removal of contaminated sections containing carbonized particles to ensure compliance with national standards for chemical residue limits, while tracing back to viscose equipment temperature control defects to drive process improvements; microscopic capture and classification of impurities can be linked to workshop environmental management gaps (such as lack of personal protection), triggering cleaning procedure upgrades. This classification mechanism not only improves quality control efficiency, but also builds a "detection-cause-optimization" closed loop to reduce foreign fiber occurrence rates from the root cause.
[0005] Traditional manual detection methods are inefficient, inaccurate, and prone to errors. With the complexity of the production environment and the diversification of foreign fiber types, how to efficiently and accurately classify foreign fiber defects has become an important challenge in non-woven mask fabric production.
[0006] The patent CN115861261A provides a defect recognition method for medical non-woven fabric, which includes: collecting the gray-scale image of the medical non-woven fabric and obtaining the air-permeable hole area and other areas in the gray-scale image; obtaining abnormal pixel points in the other areas; selecting an arbitrary abnormal pixel point as a seed point and extending from the seed point to obtain multiple abnormal line segments composed of abnormal pixel points; regarding the abnormal line segments that do not intersect with the air-permeable hole area boundary as the final abnormal lines; merging the abnormal line segments that intersect with the air-permeable hole area boundary according to the extension direction of the abnormal lines to obtain multiple final abnormal lines; calculating the direction diversity of each final abnormal line according to the slope of the line connecting multiple pairs of pixel points on each final abnormal line; calculating the gray-scale abnormality of each final abnormal line using the gray-scale values of all pixel points contained in each final abnormal line; determining the gray-scale gradualness of each final abnormal line according to the gray-scale value difference of adjacent pixel points on each final abnormal line; calculating the credibility of each final abnormal line being a scratch using the direction diversity, gray-scale abnormality, and gray-scale gradualness of each final abnormal line; and judging whether each final abnormal line is a scratch defect according to the credibility of each final abnormal line being a scratch. This method recognizes defects based on the detection of abnormal line segments, but this scheme can only recognize scratch defects and cannot recognize other types of defects.
[0007] The patent CN119723538A provides a foreign fiber recognition method, which includes: obtaining a raw cotton image, the raw cotton image being obtained by photographing a target raw cotton, the target raw cotton being obtained by screening impurities from initial raw cotton, wherein the target impurities in the initial raw cotton are screened by a raw cotton impurity analysis machine, and the target impurities include branches and leaves, mud stones, and broken seeds; obtaining a raw cotton spectral image, the raw cotton spectral image being obtained by a spectral camera; performing correction processing on the raw cotton spectral image to obtain a raw cotton corrected image; performing image fusion on the raw cotton image and the raw cotton corrected image to obtain a target raw cotton image; inputting the target raw cotton image into a target recognition network to enable the target recognition network to recognize the target raw cotton image to output class information of foreign fibers corresponding to the target raw cotton image, wherein the target recognition network is obtained by updating a residual network of an original ResNet18 convolutional neural network, the residual network includes a first residual module and a second residual module, the convolutional layer of the first residual module is a pyramid convolutional layer, the convolutional layer of the second residual module is a 1x1 convolutional layer, the convolutional kernels of the pyramid convolutional layer are 9, 7, 5, and 3 from bottom to top, and the pyramid convolutional layer is filled based on half of the convolutional kernels. However, this method has the following problems: first, it can only detect cotton shells, cotton seeds, plastics, hair, synthetic fibers, and paper sheets, but cannot detect foreign fibers caused by cotton blocks and coking cotton; second, a spectral camera is needed in this method, and a target recognition network needs to be trained, which will cause high costs of materials, computing power, and time. SUMMARY
[0008] The application provides a non-woven fabric foreign fiber detection method and device based on a Lab color space, to more finely identify foreign fibers of non-woven fabric and reduce the calculation cost.
[0009] A non-woven fabric foreign fiber detection method based on a Lab color space, comprising:
[0010] Collecting an RGB image of a non-woven fabric to be detected, performing preliminary identification on the RGB image, determining the location of foreign fibers and performing region extraction to obtain a foreign fiber region image;
[0011] Converting the foreign fiber region image to a Lab color space to obtain L component, a component and b component of the foreign fiber region image;
[0012] Processing and edge mean calculation based on the L component, and determining whether the foreign fiber is a cotton block defect according to the edge mean calculation result of the L component;
[0013] After determining that the foreign fiber is not a cotton block defect, processing and defect area calculation based on the b component, and determining a focus cotton defect and a foreign matter defect according to the defect area calculation result.
[0014] Further, the preliminary identification of the RGB image, the determination of the location of foreign fibers and the region extraction to obtain a foreign fiber region image, comprises:
[0015] Identifying abnormal pixels in the RGB image as a foreign fiber region by using an edge detection algorithm, extracting pixels from the center position of the foreign fiber region to the surrounding area until normal pixels are obtained, and taking the extracted region as the foreign fiber region image.
[0016] Further, the processing and edge mean calculation based on the L component, and determining whether the foreign fiber is a cotton block defect according to the edge mean calculation result of the L component, comprises:
[0017] Normalizing the L component to obtain a normalized L component;
[0018] Calculating the edge brightness mean of the foreign fiber region image based on the normalized L component;
[0019] Comparing the edge brightness mean with a preset brightness threshold, if the edge brightness mean is less than the preset brightness threshold, determining that the foreign fiber in the foreign fiber region image is a cotton block defect, and if the edge brightness mean is greater than or equal to the preset brightness threshold, determining that the foreign fiber in the foreign fiber region image is not a cotton block defect.
[0020] Further, based on the b component, processing and defect area calculation are performed, and based on the defect area calculation result, the foreign fiber defects and the impurity defects are determined, including:
[0021] Based on the b component, normalization processing, blurring processing and binarization processing are performed, and an open operation is performed on the processed b component to obtain an open operation image;
[0022] The total defect area and the center position defect area are calculated according to the open operation image, if the center position defect area is 0, or the total defect area is less than a preset impurity determination threshold, then the foreign fiber in the foreign fiber area image is determined as an impurity defect;
[0023] If the center position defect area is not 0 and the total defect area is greater than or equal to the preset impurity determination threshold, then the total defect area is compared with a preset foreign fiber determination threshold, if the total defect area is greater than the foreign fiber determination threshold, then the foreign fiber in the foreign fiber area image is determined as an impurity defect and a foreign fiber defect; if the total defect area is less than or equal to the foreign fiber determination threshold, then the darkest point in the center area is found based on the L component, and based on the finding result, the foreign fiber defect and the impurity defect are determined.
[0024] Further, based on the b component, normalization processing, blurring processing and binarization processing are performed, and an open operation is performed on the processed b component to obtain an open operation image, including:
[0025] The b component is normalized to obtain a first normalized b component;
[0026] The first normalized b component is subjected to median filtering processing according to a preset first convolution kernel to obtain a blurred component;
[0027] The blurred component is normalized to obtain a second normalized b component;
[0028] Based on the second normalized b component, binarization processing is performed to obtain a binarization image;
[0029] According to a preset second convolution kernel, an open operation is performed on the binarization image to obtain an open operation image.
[0030] Further, based on the open operation image, the total defect area is calculated, including:
[0031] The value of the total defect area is initialized to 0;
[0032] The pixel values in the open operation image are traversed, if the pixel values in the open operation image meet a preset condition, then the value of the total defect area is increased by 1, and after the traversal is completed, the total defect area is obtained.
[0033] Further, calculating a center position defect area according to the opening operation image, comprising:
[0034] Initializing a value of the center position defect area as 0, and setting a center area;
[0035] Traversing pixel values in the opening operation image, if a pixel in the opening operation image is in the center area and the pixel value meets a preset condition, adding 1 to the value of the center position defect area, and obtaining the center position defect area after the traversal is completed.
[0036] Further, searching for a darkest point in the center area based on the L component, and determining a focus cotton defect and an impurity defect according to a search result, comprising:
[0037] Setting a dark point search radius, and initializing a minimum value point set as empty;
[0038] Taking the center of the foreign fiber area image as a circle center, and taking a region in the center area with the dark point search radius as a radius, searching for a preset number of pixel points with minimum L components in the region, and storing coordinates of the searched preset number of pixel points in the minimum value point set;
[0039] Setting a b component negative point number threshold value and a gray value sum threshold value;
[0040] Calculating a sum of gray values of all pixel points in the minimum value point set and a b component negative point number, comparing the b component negative point number and the sum of gray values with the b component negative point number threshold value and the gray value sum threshold value respectively, and determining a focus cotton defect and an impurity defect in the foreign fiber area image according to a comparison result.
[0041] Further, comparing the b component negative point number and the sum of gray values with the b component negative point number threshold value and the gray value sum threshold value respectively, and determining a focus cotton defect and an impurity defect in the foreign fiber area image according to a comparison result, comprising:
[0042] If the b component negative point number is greater than the b component negative point number threshold value, or the sum of gray values is less than the gray value sum threshold value, determining that a foreign fiber in the foreign fiber area image is an impurity defect;
[0043] If the b component negative point number is less than or equal to the b component negative point number threshold value, and the sum of gray values is greater than or equal to the gray value sum threshold value, determining that the foreign fiber in the foreign fiber area image is a focus cotton defect.
[0044] A non-woven fabric foreign fiber detection device based on a Lab color space, comprising:
[0045] An image extraction module, configured to collect an RGB image of a non-woven fabric to be detected, perform preliminary identification on the RGB image, determine a position of a foreign fiber and perform region extraction, and obtain a foreign fiber area image;
[0046] a conversion module, configured to perform Lab color space conversion on the foreign fiber area image to obtain an L component, an a component and a b component of the foreign fiber area image;
[0047] a first judgment module, configured to perform processing and edge mean value calculation based on the L component, and determine whether the foreign fiber is a cotton block defect according to the edge mean value calculation result of the L component;
[0048] a second judgment module, configured to, after determining that the foreign fiber is not the cotton block defect, perform processing and defect area calculation based on the b component, and determine a coking cotton defect and a foreign matter defect according to the defect area calculation result.
[0049] Further, the image extraction module performs preliminary identification on the RGB image, determines the position of the foreign fiber and performs area extraction to obtain a foreign fiber area image, including:
[0050] an edge detection algorithm is used to identify abnormal pixels in the RGB image as a foreign fiber area, and pixel extraction is performed from the center position of the foreign fiber area to the surrounding area until normal pixels are obtained, and the extracted area is taken as the foreign fiber area image.
[0051] Further, the first judgment module performs processing and edge mean value calculation based on the L component, and determines whether the foreign fiber is a cotton block defect according to the edge mean value calculation result of the L component, including:
[0052] the L component is normalized to obtain a normalized L component;
[0053] the edge brightness mean value of the foreign fiber area image is calculated based on the normalized L component;
[0054] the edge brightness mean value is compared with a preset brightness threshold value, if the edge brightness mean value is less than the preset brightness threshold value, it is determined that the foreign fiber in the foreign fiber area image is a cotton block defect, and if the edge brightness mean value is greater than or equal to the preset brightness threshold value, it is determined that the foreign fiber in the foreign fiber area image is not a cotton block defect.
[0055] Further, the second judgment module performs processing and defect area calculation based on the b component, and determines a coking cotton defect and a foreign matter defect according to the defect area calculation result, including:
[0056] the b component is normalized, blurred and binarized, and an open operation is performed on the processed b component to obtain an open operation image;
[0057] According to the open operation image, a total defect area and a center position defect area are calculated, if the center position defect area is 0 or the total defect area is less than a preset impurity judgment threshold, then the foreign fiber in the foreign fiber area image is determined as an impurity defect;
[0058] If the center position defect area is not 0 and the total defect area is greater than or equal to the preset impurity judgment threshold, then the total defect area is compared with a preset focus cotton judgment threshold, if the total defect area is greater than the focus cotton judgment threshold, then the foreign fiber in the foreign fiber area image is determined as an impurity defect as a focus cotton defect, if the total defect area is less than or equal to the focus cotton judgment threshold, then the darkest point of the center area is found based on the L component, and the focus cotton defect and the impurity defect are determined according to the finding result.
[0059] Further, the second judging module performs normalization processing, fuzzy processing and binary processing based on the b component, and performs open operation on the processed b component to obtain an open operation image, comprising:
[0060] The b component is normalized to obtain a first normalized b component;
[0061] The first normalized b component is median filtered according to a preset first convolution kernel to obtain a fuzzy component;
[0062] The fuzzy component is normalized to obtain a second normalized b component;
[0063] The second normalized b component is binary processed to obtain a binary image;
[0064] The binary image is open operated according to a preset second convolution kernel to obtain an open operation image.
[0065] Further, the second judging module calculates a total defect area according to the open operation image, comprising:
[0066] The value of the total defect area is initialized as 0;
[0067] The pixel value in the open operation image is traversed, if the pixel value in the open operation image meets a preset condition, then the value of the total defect area is added by 1, and the total defect area is obtained after the traversal is completed.
[0068] Further, the second judging module calculates a center position defect area according to the open operation image, comprising:
[0069] The value of the center position defect area is initialized as 0, and a center area is set;
[0070] Traverse the pixel value in the opening operation image, if the pixel in the opening operation image is in the center region and the pixel value meets the preset condition, then add 1 to the value of the center position defect area, and obtain the center position defect area after the traversal is completed.
[0071] Further, the second judging module finds the darkest point in the center region based on the L component, and determines the focal cotton defect and the impurity defect according to the finding result, comprising:
[0072] Set the dark point finding radius, and initialize the minimum value point set as empty;
[0073] Take the center of the foreign fiber region image as the center of a circle, and find the preset number of pixel points with the smallest L component in the region with the dark point finding radius as the radius, and store the coordinates of the found preset number of pixel points in the minimum value point set;
[0074] Set the b component negative point number threshold value and the gray value sum threshold value;
[0075] Calculate the sum of the gray values of all pixel points in the minimum value point set and the b component negative point number, compare the b component negative point number and the sum of the gray values with the b component negative point number threshold value and the gray value sum threshold value respectively, and determine the focal cotton defect and the impurity defect in the foreign fiber region image according to the comparison result.
[0076] Further, the second judging module compares the b component negative point number and the sum of the gray values with the b component negative point number threshold value and the gray value sum threshold value respectively, and determines the focal cotton defect and the impurity defect in the foreign fiber region image according to the comparison result, comprising:
[0077] If the b component negative point number is greater than the b component negative point number threshold value, or the sum of the gray values is less than the gray value sum threshold value, then determine that the foreign fiber in the foreign fiber region image is an impurity defect;
[0078] If the b component negative point number is less than or equal to the b component negative point number threshold value, and the sum of the gray values is greater than or equal to the gray value sum threshold value, then determine that the foreign fiber in the foreign fiber region image is a focal cotton defect.
[0079] The non-woven fabric foreign fiber detection method and device based on the Lab color space provided by the application have at least the following beneficial effects:
[0080] (1) The light weight classification algorithm based on the Lab color space significantly improves the accuracy and practicability of non-woven fabric foreign fiber detection, breaks through the recognition bottleneck of the three types of foreign fibers, i.e. white cotton block, focal cotton and impurity, quickly locks the white cotton block formed by the accumulation of cotton layer by using the L component brightness difference, accurately distinguishes the focal cotton and impurity by combining the b component yellow domain analysis and dark point set gray joint criterion, and has high classification accuracy.
[0081] (2) Compared with the existing high-cost scheme relying on spectral cameras and deep learning models, the method provided by the application only needs an ordinary industrial camera and a lower computer, the single-frame processing time is short, the computing power requirement is small, the hardware cost is low, and the method can be deployed without massive training data, can adapt to production line real-time detection scenes, and has high real-time performance;
[0082] (3) The Lab space separates luminance and chrominance, and combined with median filtering and morphological operation, can resist light fluctuation, batch color difference and slight noise interference, stably capture fine impurities, has high robustness, and can effectively cope with complex industrial environment challenges; through 684 production line images, the cotton block recognition rate is 100%, and the classification accuracy of the coking cotton / impurity is greater than 98%;
[0083] (4) A lightweight framework is constructed by combining Lab space conversion and layered decision logic (luminance→chrominance→local feature) fusion, which can accurately identify cotton blocks, impurities and coking cotton in non-woven fabrics, and provide basis for subsequent processing methods for different defect types, for example, for white cotton blocks, locate the pressure abnormality of the laying cotton process, reduce the whole roll scrap through local cutting and rework, reduce raw material loss, and save production cost; the rapid identification of coking cotton can be linked to spectral composition analysis, and the contaminated section containing carbonized particles is forced to be removed, to ensure that the limit value of chemical residues meets the national standard, and at the same time, the defect of viscose equipment temperature control is traced to drive process improvement; microscopic capture and classification of impurities can be associated with workshop environment management loopholes (such as lack of personnel protection), to trigger cleaning procedure upgrade. BRIEF DESCRIPTION OF DRAWINGS
[0084] FIG. 1 (a) is a schematic diagram of one embodiment of a cotton block defect in non-woven fabric.
[0085] FIG. 1 (b) is a schematic diagram of one embodiment of a coking cotton defect in non-woven fabric.
[0086] FIG. 1 (c) and FIG. 1 (d) are schematic diagrams of one embodiment of an impurity defect in non-woven fabric.
[0087] Figure 2 FIG. 2 is a flow chart of one embodiment of the non-woven fabric foreign fiber detection method based on the Lab color space provided by the application.
[0088] Figure 3 FIG. 3 is a flow chart of another embodiment of the non-woven fabric foreign fiber detection method based on the Lab color space provided by the application.
[0089] FIG. 4 (a) is a result graph after L component normalization of an image containing a cotton block defect.
[0090] FIG. 4 (b) is a result graph after L component normalization of an image containing a coking cotton defect.
[0091] Fig. 4(c) and Fig. 4(d) are the result images of L component normalization of the image containing the impurity defect.
[0092] Fig. 5(a) is the result image of b component secondary normalization of the image containing the focus cotton defect.
[0093] Fig. 5(b) and Fig. 5(c) are the result images of b component secondary normalization of the image containing the impurity defect.
[0094] Fig. 6(a) is the result image of binarization of the image containing the focus cotton defect.
[0095] Fig. 6(b) and Fig. 6(c) are the result images of binarization of the image containing the impurity defect.
[0096] Fig. 7(a) is the result image of open operation of the image containing the focus cotton defect.
[0097] Fig. 7(b) and Fig. 7(c) are the result images of open operation of the image containing the impurity defect.
[0098] Figure 8 Fig. 1 is a structural schematic diagram of an embodiment of the non-woven fabric foreign fiber detection device based on the Lab color space provided by the present application. DETAILED DESCRIPTION
[0099] In order to better understand the above technical solutions, the above technical solutions will be described in detail below in combination with the drawings of the specification and specific embodiments.
[0100] REFERENCE Figure 2 and Figure 3 In some embodiments, a non-woven fabric foreign fiber detection method based on the Lab color space is provided, comprising:
[0101] S1, acquiring an RGB image of a non-woven fabric to be detected, preliminarily identifying the RGB image, determining the position of the foreign fiber and performing region extraction to obtain a foreign fiber region image;
[0102] S2, performing Lab color space conversion on the foreign fiber region image to obtain L component, a component and b component of the foreign fiber region image;
[0103] S3, performing processing and edge mean calculation based on the L component, and determining whether the foreign fiber is a cotton block defect according to the edge mean calculation result of the L component;
[0104] S4, after determining that the foreign fiber is not a cotton block defect, performing processing and defect area calculation based on the b component, and determining a focus cotton defect and an impurity defect according to the defect area calculation result.
[0105] Specifically, in step S1, the RGB image is preliminarily identified to determine the location of the foreign fiber and extract the region, and a foreign fiber region image is obtained, including:
[0106] An edge detection algorithm is used to identify abnormal pixels in the RGB image as a foreign fiber region, and pixel extraction is performed from the center position of the foreign fiber region to the surrounding area until a normal pixel is obtained, and the extracted region is taken as the foreign fiber region image.
[0107] Specifically, the gray scale, size, shape and position of the foreign fiber are different, and an edge detection algorithm can be used to find abnormal pixels with obvious pixel value changes as the foreign fiber region, and then the center position of this region is taken as the starting point to expand this region to the surrounding area until a normal pixel is obtained, so that an image containing the entire foreign fiber region can be obtained. The foreign fiber is basically located in the middle region of the image, that is, the edge of each foreign fiber region image is normal.
[0108] Specifically, the non-woven fabric image containing foreign fibers has the following characteristics:
[0109] 1. The color of the foreign fiber is different from the color and brightness of the normal non-woven fabric. For example, foreign matters such as plastic, metal particles and hair adsorbed on the non-woven fabric often appear black, and the brightness is less than that of the normal non-woven fabric. In this embodiment, such defects are classified as "impurities". During the production of non-woven fabric, if the proportion of cotton block in a certain region is too high, the region will be whiter than the normal non-woven fabric, and the closer to the center, the whiter the color, and the closer to the outside, the closer to the normal non-woven fabric, and the brightness is greater than that of the normal non-woven fabric. In this embodiment, such defects are classified as "cotton block". During the production of non-woven fabric, if there is a focus cotton in a certain region, the region will be darker yellow than the normal non-woven fabric, and the closer to the center, the darker the color, and the closer to the outside, the color will present yellow, and the brightness is less than that of the normal non-woven fabric. In this embodiment, such defects are classified as "focus cotton".
[0110] 2. The region occupied by the foreign fiber is usually small, and is usually irregular in shape, such as point, line or flocculation.
[0111] 3. The color difference between the foreign fiber and the normal non-woven fabric may be small; the color difference between the foreign fiber caused by impurities and the foreign fiber caused by focus cotton may also be small, and the difference between some impurities and focus cotton is almost indistinguishable by the naked eye.
[0112] 4. Due to the influence of light or production process, the color or brightness of non-woven fabric in different regions or different batches may be different, which is also a challenge for the classification of foreign fibers on non-woven fabric.
[0113] Further, in step S2, the foreign fiber region image is converted to Lab color space to obtain L component, a component and b component of the foreign fiber region image, specifically including:
[0114] Read the color of the foreign fiber area image imgFiber, assuming that the foreign fiber area image imgFiber size is M rows N columns, the pixel value of the i row j column is [r(i, j), g(i, j), b(i, j)]. The pixels of the foreign fiber area image imgFiber are normalized to [0, 1], converted from RGB three channels to XYZ space, and then converted from XYZ space to Lab color space. The L component represents the brightness of the pixel, with a value range of [0, 100], indicating from black to white; the a component represents the range from red to green, with a value range of [127, -128]; and the b component represents the range from yellow to blue, with a value range of [127, -128].
[0115] The specific conversion formula is as follows:
[0116] ; (1)
[0117] ; (2)
[0118] ; (3)
[0119] ; (4)
[0120] ; (5)
[0121] ; (6)
[0122] wherein R, G, B represent the values of the RGB three channels of the foreign fiber area image, X, Y, Z represent the values converted from the RGB three channels to XYZ space, L represents the L component, a represents the a component, and b represents the b component, f (t) represents a nonlinear correction function for RGB to Lab space conversion, and Xn, Yn, Zn represent the values of the reference white point in XYZ space.
[0123] Further, in step S3, based on the L component, processing and edge mean calculation are performed, and whether the foreign fiber is a cotton block defect is determined according to the edge mean calculation result of the L component, including:
[0124] S31, normalize the L component to obtain a normalized L component;
[0125] S32, calculate the edge brightness mean of the foreign fiber area image based on the normalized L component;
[0126] S33, comparing the edge brightness mean value with a preset brightness threshold value, if the edge brightness mean value is less than the preset brightness threshold value, determining that the foreign fiber in the foreign fiber area image is a cotton block defect, if the edge brightness mean value is greater than or equal to the preset brightness threshold value, determining that the foreign fiber in the foreign fiber area image is not a cotton block defect.
[0127] Specifically, in step S31, the L component is normalized to L_nor, and the normalized L component L_nor ∈ [0, 255], and the specific method is to calculate the maximum value maxL and the minimum value minL of the L component, and the calculation formula of the normalized L component L_nor is:
[0128] ; (7)
[0129] Wherein, L(i,j) represents the L component of the i-th row and j-th column pixel, and L_nor(i,j) represents the normalized L component of the i-th row and j-th column pixel.
[0130] Further, in step S32, since the image background and foreign fiber area cannot be accurately segmented at present, the average value of the brightness of the upper, lower, left and right four edges of the foreign fiber area image is calculated, and the specific calculation formula is:
[0131] ; (8)
[0132] Wherein, evenLEdge represents the edge brightness mean value of the foreign fiber area image, M represents the number of row pixels of the foreign fiber area image, N represents the number of column pixels of the foreign fiber area image, and L_nor(i,j) represents the normalized L component of the i-th row and j-th column pixel.
[0133] Further, in step S33, the edge brightness mean value evenLEdge is compared with the preset brightness threshold value, since the L component is normalized, if the edge brightness mean value evenLEdge is less than the preset brightness threshold value, it is indicated that the brightness value of the center region of the foreign fiber area image is higher than that of the edge region, then it is determined that the foreign fiber in the foreign fiber area image is a cotton block defect, if the edge brightness mean value is greater than or equal to the preset brightness threshold value, it is indicated that the brightness value of the center region of the foreign fiber area image is lower than that of the edge region, then it is determined that the foreign fiber in the foreign fiber area image is not a cotton block defect.
[0134] Further, in step S4, after determining that the foreign fiber in the foreign fiber area image is not a cotton block defect, the next step is continued, since the b component represents the range from yellow to blue, the b component can be used to distinguish the "focal cotton" which is yellowish and the "impurities" which are blackish.
[0135] Based on the processing and defect area calculation of the b component, the focal cotton defect and the impurity defect are determined according to the defect area calculation result, comprising:
[0136] S41, performing normalization processing, blurring processing and binarization processing based on the b component, and performing an OR operation on the processed b component to obtain an OR operation image;
[0137] S42, calculating a total defect area and a center position defect area according to the OR operation image, and determining that the foreign fiber in the foreign fiber area image is a foreign matter defect if the center position defect area is 0 or the total defect area is less than a preset foreign matter determination threshold;
[0138] S43, if the center position defect area is not 0 and the total defect area is greater than or equal to the preset foreign matter determination threshold, comparing the total defect area with a preset focus cotton determination threshold, determining that the foreign fiber in the foreign fiber area image is a foreign matter defect if the total defect area is greater than the focus cotton determination threshold, and determining the focus cotton defect and the foreign matter defect based on the L component if the total defect area is less than or equal to the focus cotton determination threshold.
[0139] Further, in step S41, the normalization processing, blurring processing and binarization processing are performed based on the b component, and an OR operation is performed on the processed b component to obtain an OR operation image, including:
[0140] The b component is normalized to obtain a first normalized b component;
[0141] The first normalized b component is median filtered according to a preset first convolution kernel to obtain a blurred component;
[0142] The blurred component is normalized to obtain a second normalized b component;
[0143] The second normalized b component is binarized to obtain a binarized image;
[0144] The binarized image is OR operated according to a preset second convolution kernel to obtain an OR operation image.
[0145] Specifically, a first convolution kernel k_median is set, the value of the b component is normalized to obtain a first normalized b component b_nor1, and the first normalized b component b_nor1 is in the range of [0, 255], then the first normalized b component b_nor1 is median filtered with a convolution kernel size of k_median to obtain a blurred component b_blur, and the blurred component b_blur is normalized to obtain a second normalized b component b_nor2, and the second normalized b component b_nor2 is in the range of [0, 255].
[0146] The mean value of the secondary normalized b component b_nor2 is calculated as mean_b, and a proper threshold value thres is set to binarize the secondary normalized b component b_nor2 to obtain a binary image b_binary, wherein:
[0147] (9)
[0148] A second kernel size of kernel*kernel is set, and a morphological opening operation is performed on the binary image b_binary using the second kernel to obtain an opening image b_open. At this time, the region with a pixel value of 255 on the opening image b_open is basically the region with a yellow color on the foreign fiber region image, and the region with a pixel value of 0 is basically the region without a yellow color on the foreign fiber region image.
[0149] Further, in step S42, the total defect area is calculated according to the opening image, including:
[0150] The value of the total defect area is initialized to 0;
[0151] The pixel value in the opening image is traversed, and if the pixel value in the opening image meets a preset condition, the value of the total defect area is increased by 1. After the traversal is completed, the total defect area is obtained.
[0152] Specifically, the total defect area numDefect is initialized to 0, and the pixel value of the opening image b_open is traversed. If the pixel point (i, j) in the opening image meets b_open(i, j)=255, then numDefect=numDefect+1, that is, the total defect area numDefect is the number of pixel points with a pixel value of 255 (meeting the preset condition) on the opening image b_open. The preset condition is that the pixel value is 255.
[0153] Further, in step S42, the center position defect area is calculated according to the opening image, including:
[0154] The value of the center position defect area is initialized to 0, and a center region is set.
[0155] The pixel value in the opening image is traversed, and if the pixel in the opening image is in the center region and the pixel value meets a preset condition, the value of the center position defect area is increased by 1. After the traversal is completed, the center position defect area is obtained.
[0156] Specifically, a center area radius rad1 is set, a center position defect area numDefectCenter is initialized as 0, and the pixel value of the opening operation image b_open is traversed. If the pixel point (i, j) in the opening operation image satisfies (i-M / 2) 2 +(j-N / 2) 2 <rad1 2 that is, the pixel is in the center area, and the pixel value b_open(i, j)=255, that is, the preset condition is met, the center position defect area numDefectCenter = numDefectCenter+1. The center position defect area numDefectCenter is the number of pixel points with a pixel value of 255 (satisfying the preset condition) in the center area with the center of the opening operation image as the center and rad1 as the radius on the opening operation image b_open.
[0157] Further, in step S42, if the center position defect area is 0 or the total defect area is less than the preset impurity judgment threshold, it is determined that the foreign fiber in the foreign fiber area image is an impurity defect.
[0158] Specifically, if the center position defect area numDefectCenter=0, it indicates that there is no color yellow area in the center of the opening operation image, and it is considered that the defect on the foreign fiber area image is “impurity”.
[0159] If the center position defect area numDefectCenter≠0 and the total defect area numDefect is less than the preset impurity judgment threshold thres_zz, it indicates that although there is a color yellow area in the center of the opening operation image, the yellow area is small, and it is considered that the defect on the foreign fiber area image is “impurity”.
[0160] Further, in step S43, if the center position defect area is not 0 and the total defect area is greater than or equal to the preset impurity judgment threshold, the total defect area is compared with the preset focus cotton judgment threshold. If the total defect area is greater than the focus cotton judgment threshold, it is determined that the foreign fiber in the foreign fiber area image is an impurity defect and a focus cotton defect. If the total defect area is less than or equal to the focus cotton judgment threshold, the darkest point in the center area is searched based on the L component, and the focus cotton defect and the impurity defect are determined according to the search result.
[0161] Specifically, if the center position defect area numDefectCenter≠0, and the total defect area numDefect is greater than or equal to the preset impurity determination threshold thres_zz, the total defect area numDefect is compared with the preset focus cotton determination threshold thres_jm, if numDefect>thres_jm, it means that the center of the opening operation image not only has a yellowish area, but also has a lot of yellowish area, that is, the defect on the foreign fiber area image is considered as "focus cotton".
[0162] Wherein, the impurity determination threshold thres_zz is less than the focus cotton determination threshold thres_jm.
[0163] If the center position defect area numDefectCenter≠0, and the total defect area numDefect is greater than or equal to the preset impurity determination threshold thres_zz, and the total defect area numDefect is less than or equal to the focus cotton determination threshold thres_jm, it is necessary to find the center area darkest point based on the L component, and determine the focus cotton defect and impurity defect according to the search result.
[0164] Specifically, further, based on the L component to find the center area darkest point, and determine the focus cotton defect and impurity defect according to the search result, comprising:
[0165] Setting the dark point search radius, initializing the minimum value point set to empty;
[0166] Taking the center of the foreign fiber area image as the center of the circle, and the dark point search radius as the radius, finding the preset number of pixel points with the minimum L component in the area, and storing the coordinates of the found preset number of pixel points in the minimum value point set;
[0167] Setting the b component negative point number threshold and the gray value sum threshold;
[0168] According to the pixel point coordinates in the minimum value point set, obtaining the b component negative point number and calculating the gray value sum of the corresponding pixel points, comparing the b component negative point number and the gray value sum with the b component negative point number threshold and the gray value sum threshold respectively, and judging the focus cotton defect and impurity defect in the foreign fiber area image according to the comparison result.
[0169] Specifically, setting the dark point search radius rad2 and the preset number num, setting the minimum value point set set to empty, taking the center of the foreign fiber area image as the center of the circle, finding the num pixel points with the minimum L component in the area with the radius rad2, and then saving the coordinates of these pixel points to the minimum value point set set. The specific method is: setting the two-dimensional array pixels to empty, traversing the pixel points of the foreign fiber area image, if the pixel point (i, j) satisfies (i-M / 2)2 + (j - N / 2) 2 <rad2 2 Then, [L(i, j), i, j] is saved to the two-dimensional array pixels as a one-dimensional array. After the traversal ends, the data in the two-dimensional array pixels is sorted in ascending order according to L(i, j), and then the point coordinates [i, j] in the first num groups of one-dimensional arrays after sorting are saved to the minimum point set set.
[0170] Further, a b-component negative point number threshold numB_thres and a gray value sum threshold sumG_thres are set.
[0171] Further, according to the pixel point coordinates in the minimum point set set, the b-component negative point number numB of the corresponding pixel points and the sum of gray values sumG are obtained, where the b-component negative point number is the number of pixel points with a negative b-component, and the sum of gray values is the sum of gray values of the pixels in the minimum point set set. The specific calculation method of the b-component negative point number is as follows: the b-component negative point number numB is initialized to 0, and the minimum point set set is traversed. For each point coordinate [i, j] in the set, if the b-component value b[i, j] of the point is less than 0, then numB=numB+1. The calculation method of the sum of gray values sumG is as follows: the sum of gray values sumG is initialized to 0, and the minimum point set set is traversed. For each pixel point coordinate [i, j] in the set, Gray[i, j]= R[i, j] *0.299 + G[i, j]* 0.587 + B[i, j] * 0.114 is set, and sumG=sumG+Gray[i, j] is set.
[0172] Further, the b-component negative point number and the sum of gray values are compared with the b-component negative point number threshold and the gray value sum threshold respectively, and the foreign fiber area image is judged according to the comparison result. The method comprises the following steps:
[0173] If the b-component negative point number is greater than the b-component negative point number threshold, or the sum of gray values is less than the gray value sum threshold, then the foreign fiber in the foreign fiber area image is determined to be a foreign impurity defect.
[0174] If the b-component negative point number is less than or equal to the b-component negative point number threshold, and the sum of gray values is greater than or equal to the gray value sum threshold, then the foreign fiber in the foreign fiber area image is determined to be a foreign cotton defect.
[0175] The method provided in the embodiment is further described below through a specific application scenario.
[0176] Taking the four non-woven fabric pictures shown in FIG. 1(a) to FIG. 1(d) as examples, the foreign fiber defects in each of the pictures are classified. In this embodiment, the size of the first convolution kernel k_median is set to 9, the size of the threshold thres of the binarization operation is set to 80, the size of the second convolution kernel kernel is set to 3, the size of the center region radius rad1 is set to 30, the size of the impurity judgment threshold thres_zz is set to 50, the size of the focus cotton judgment threshold thres_jm is set to 160, the size of the dark spot search radius rad2 is set to 40, the size of the preset number num is set to 30, the size of the b component negative point threshold numB_thres is set to 3, and the size of the gray value and threshold sumG_thres is set to 2500.
[0177] FIG. 4(a) to FIG. 4(d) respectively represent the result pictures after L component normalization based on FIG. 1(a) to FIG. 1(d), FIG. 5(a) to FIG. 5(c) are the result pictures after b component secondary normalization, FIG. 6(a) to FIG. 6(c) are the obtained binarization pictures, and FIG. 7(a) to FIG. 7(c) are the obtained open operation pictures. The “cotton block” in FIG. 1(a) is screened out before the b component secondary normalization.
[0178] Reference Figure 8 In some embodiments, a non-woven fabric foreign fiber detection device based on Lab color space is also provided, comprising:
[0179] An image extraction module 201 is configured to collect an RGB image of a non-woven fabric to be detected, perform preliminary identification on the RGB image, determine the location of foreign fibers and perform region extraction, and obtain a foreign fiber region image.
[0180] A conversion module 202 is configured to perform Lab color space conversion on the foreign fiber region image, and obtain L component, a component and b component of the foreign fiber region image.
[0181] A first judgment module 203 is configured to perform processing and edge mean calculation based on the L component, and determine whether the foreign fiber is a cotton block defect according to the edge mean calculation result of the L component.
[0182] A second judgment module 204 is configured to, after determining that the foreign fiber is not a cotton block defect, perform processing and defect area calculation based on the b component, and determine a focus cotton defect and an impurity defect according to the defect area calculation result.
[0183] Further, the image extraction module 201 performs preliminary identification on the RGB image, determines the location of foreign fibers and performs region extraction, and obtains a foreign fiber region image, comprising:
[0184] An edge detection algorithm is used to identify abnormal pixels in the RGB image as a foreign fiber area, and a center position of the foreign fiber area is taken as a starting point to extract pixels in all directions until a normal pixel is obtained, and the extracted area is taken as the foreign fiber area image.
[0185] Further, the first judging module 203 performs processing and edge mean calculation based on the L component, and judges whether the foreign fiber is a cotton block defect according to the edge mean calculation result of the L component, including:
[0186] The L component is normalized to obtain a normalized L component;
[0187] The edge brightness mean of the foreign fiber area image is calculated based on the normalized L component;
[0188] The edge brightness mean is compared with a preset brightness threshold, if the edge brightness mean is less than the preset brightness threshold, it is determined that the foreign fiber in the foreign fiber area image is a cotton block defect, if the edge brightness mean is greater than or equal to the preset brightness threshold, it is determined that the foreign fiber in the foreign fiber area image is not a cotton block defect.
[0189] Further, the second judging module 204 performs processing and defect area calculation based on the b component, and determines the focus cotton defect and the impurity defect according to the defect area calculation result, including:
[0190] The b component is normalized, blurred and binarized, and an open operation is performed on the processed b component to obtain an open operation image;
[0191] The total defect area and the center position defect area are calculated according to the open operation image, if the center position defect area is 0, or the total defect area is less than a preset impurity determination threshold, it is determined that the foreign fiber in the foreign fiber area image is an impurity defect;
[0192] If the center position defect area is not 0 and the total defect area is greater than or equal to the preset impurity determination threshold, the total defect area is compared with a preset focus cotton determination threshold, if the total defect area is greater than the focus cotton determination threshold, it is determined that the foreign fiber in the foreign fiber area image is an impurity defect and a focus cotton defect; if the total defect area is less than or equal to the focus cotton determination threshold, the darkest point in the center area is found based on the L component, and the focus cotton defect and the impurity defect are determined according to the finding result.
[0193] Further, the second judging module 204 performs normalization, blurring and binarization on the b component, and performs an open operation on the processed b component to obtain an open operation image, including:
[0194] The b component is normalized to obtain a first normalized b component;
[0195] performing median filtering on the first normalized b component according to a preset first convolution kernel to obtain a blurred component;
[0196] performing normalization processing on the blurred component to obtain a second normalized b component;
[0197] performing binarization processing on the second normalized b component to obtain a binarization image;
[0198] performing an opening operation on the binarization image according to a preset second convolution kernel to obtain an opening operation image.
[0199] Further, the second judging module calculates a total defect area according to the opening operation image, including:
[0200] initializing a value of the total defect area as 0;
[0201] traversing pixel values in the opening operation image, if a pixel value in the opening operation image meets a preset condition, the value of the total defect area is added by 1, and after the traversal is completed, the total defect area is obtained.
[0202] Further, the second judging module 204 calculates a center position defect area according to the opening operation image, including:
[0203] initializing a value of the center position defect area as 0, and setting a center region;
[0204] traversing pixel values in the opening operation image, if a pixel in the opening operation image is in the center region and a pixel value meets a preset condition, the value of the center position defect area is added by 1, and after the traversal is completed, the center position defect area is obtained.
[0205] Further, the second judging module 204 finds a darkest point in the center region based on the L component, and determines a focus cotton defect and an impurity defect according to a finding result, including:
[0206] setting a dark point finding radius, and initializing a minimum value point set as empty;
[0207] taking the center of the foreign fiber region image as a center and a region in the dark point finding radius as a radius, finding a preset number of pixel points with minimum L components in the region, and storing coordinates of the found preset number of pixel points in the minimum value point set;
[0208] setting a b component negative point threshold and a gray value and threshold;
[0209] Calculate the sum of gray values of all pixels in the minimum value point set and the number of negative points of the b component. Compare the number of negative points of the b component and the sum of gray values with the threshold of the number of negative points of the b component and the gray value and threshold, respectively. Based on the comparison results, determine the scorched cotton defects and impurity defects in the foreign fiber region image.
[0210] Further, the second judgment module 204 compares the number of negative points in the b-component and the sum of the gray values with the threshold for the number of negative points in the b-component and the sum of the gray values and the threshold, respectively, and judges the scorched cotton defects and impurity defects in the foreign fiber region image based on the comparison results, including:
[0211] If the number of negative points in the b component is greater than the threshold for the number of negative points in the b component, or the sum of gray values is less than the sum of gray values and the threshold, then the foreign fibers in the foreign fiber region image are determined to be impurities or defects.
[0212] If the number of negative points in the b component is less than or equal to the threshold for the number of negative points in the b component, and the sum of the gray values is greater than or equal to the sum of the gray values and the threshold, then the foreign fibers in the foreign fiber region image are determined to be scorched cotton defects.
[0213] The nonwoven fabric foreign fiber detection method and apparatus based on Lab color space provided in the above embodiments have at least the following beneficial effects:
[0214] (1) The lightweight classification algorithm based on Lab color space significantly improves the accuracy and practicality of nonwoven fabric foreign fiber detection, breaks through the bottleneck of traditional technology in identifying three types of foreign fibers: white cotton blocks, scorched cotton and impurities. It uses the brightness difference of L component to quickly lock the white cotton blocks formed by cotton layer accumulation, and combines b component yellow domain analysis and dark point set gray scale joint criterion to accurately distinguish scorched cotton and impurities, with high classification accuracy.
[0215] (2) Compared with the existing high-cost solutions that rely on spectral cameras and deep learning models, the method provided in the above embodiments only requires ordinary industrial cameras and lower-level machines, has a short processing time per frame, low computing power requirements, low hardware costs, and can be deployed without massive training data. It can be adapted to real-time detection scenarios on production lines and has high real-time performance.
[0216] (3) The characteristics of separating brightness and chromaticity in Lab space, combined with median filtering and morphological operations, can resist light fluctuations, batch color differences and small noise interference, stably capture fine impurities, and have high robustness, which can effectively cope with the challenges of complex industrial environments; after actual testing on 684 production line images, the cotton block recognition rate reached 100%, and the accuracy of scorched cotton / impurity classification was greater than 98%;
[0217] (4) Construct a lightweight framework of Lab space conversion and hierarchical decision logic (brightness->chrominance->local feature) fusion, accurately identify the cotton block, impurities and coke cotton in non-woven fabric, and provide basis for subsequent processing methods for different defect types. For example, for white cotton block, locate the abnormal pressure in the laying process, reduce the whole roll rejection through local cutting and rework, reduce raw material loss and save production cost; the rapid identification of coke cotton can be linked to spectral composition analysis, forcibly remove the contaminated section containing carbon particles, ensure that the limit value of chemical residues meets the national standard, and trace back to the temperature control defect of viscose equipment to drive process improvement; microscopic capture and classification of impurities can be associated with workshop environmental management loopholes (such as lack of personnel protection), triggering cleaning procedure upgrade.
[0218] While the preferred embodiments of the application have been described, additional alternatives, modifications, and variations can become apparent to those skilled in the art once given the benefit of the foregoing description. Accordingly, it is intended that the appended claims shall embrace any such alternatives, modifications, and variations as falling within the scope of the application. It will be apparent to those skilled in the art that various modifications and variations can be made to the present application without departing from the spirit or scope of the application. Thus, it is intended that the present application cover modifications and variations of this application provided they come within the scope of the appended claims and their equivalents.
Claims
1. A nonwoven fabric foreign fiber detection method based on Lab color space, characterized by, The method comprises the following steps: Collecting an RGB image of a non-woven fabric to be detected, performing preliminary identification on the RGB image, determining the location of foreign fibers and performing region extraction, and obtaining a foreign fiber region image; Converting the foreign fiber region image to Lab color space to obtain L component, a component and b component of the foreign fiber region image; Processing based on the L component, performing edge mean calculation on the foreign fiber region image according to the processed L component, and determining whether the foreign fiber is a cotton block defect according to the edge mean calculation result of the L component; After determining that the foreign fiber is not a cotton block defect, processing based on the b component and calculating the defect area, and determining the focus cotton defect and the impurity defect according to the defect area calculation result.
2. The method of claim 1, wherein, The method comprises the following steps: Using an edge detection algorithm to identify abnormal pixels in the RGB image as a foreign fiber region, taking the center position of the foreign fiber region as the starting point to extract pixels around it, and obtaining normal pixels until the extraction area is obtained as the foreign fiber region image.
3. The method of claim 1, wherein, Processing based on the L component, performing edge mean calculation on the foreign fiber region image according to the processed L component, and determining whether the foreign fiber is a cotton block defect according to the edge mean calculation result of the L component, comprising: Normalizing the L component to obtain a normalized L component; Based on the normalized L component, the edge brightness mean of the foreign fiber region image is calculated; Comparing the edge brightness mean with the preset brightness threshold value, if the edge brightness mean is less than the preset brightness threshold value, it is determined that the foreign fiber in the foreign fiber region image is a cotton block defect, if the edge brightness mean is greater than or equal to the preset brightness threshold value, it is determined that the foreign fiber in the foreign fiber region image is not a cotton block defect.
4. The method according to claim 1 or 3, characterized in that, Based on the b component, processing and defect area calculation are performed, and the focus cotton defect and the impurity defect are determined according to the defect area calculation result, comprising: Based on the b component, the b component is normalized, blurred and binarized, and an opening operation is performed on the processed b component to obtain an opening operation image; According to the opening operation image, the total defect area and the center position defect area of the opening operation image are calculated, if the center position defect area is 0, or the total defect area is less than the preset impurity judgment threshold value, it is determined that the foreign fiber in the foreign fiber region image is an impurity defect; If the center position defect area is not 0 and the total defect area is greater than or equal to the preset impurity judgment threshold value, the total defect area is compared with the preset focus cotton judgment threshold value, if the total defect area is greater than the focus cotton judgment threshold value, it is determined that the foreign fiber in the foreign fiber region image is an impurity defect and a focus cotton defect; if the total defect area is less than or equal to the focus cotton judgment threshold value, the darkest point in the center region is found based on the L component, and the focus cotton defect and the impurity defect are determined according to the finding result.
5. The method of claim 4, wherein, Based on the b component, the b component is normalized, blurred and binarized, and an opening operation is performed on the processed b component to obtain an opening operation image, comprising: The b component is normalized to obtain a normalized b component; According to a preset first convolution kernel, the first normalized b component is subjected to median filtering processing to obtain a blurred component; The blurred component is subjected to normalization processing to obtain a second normalized b component; The second normalized b component is subjected to binarization processing to obtain a binarization image; According to a preset second convolution kernel, the binarization image is subjected to open operation to obtain an open operation image.
6. The method of claim 4, wherein, According to the open operation image, a total defect area is calculated, including: Initializing the value of the total defect area as 0; Iterating through the pixel values in the open operation image, if the pixel value in the open operation image meets a preset condition, the value of the total defect area is incremented by 1, and after the iteration is completed, the total defect area is obtained.
7. The method of claim 4, wherein, According to the open operation image, a center position defect area is calculated, including: Initializing the value of the center position defect area as 0, and setting a center region; Iterating through the pixel values in the open operation image, if the pixel in the open operation image is within the center region and the pixel value meets a preset condition, the value of the center position defect area is incremented by 1, and after the iteration is completed, the center position defect area is obtained.
8. The method of claim 4, wherein, Based on the L component, the darkest point in the center region is found, and according to the finding result, the cotton defect and the impurity defect are determined, including: Setting a dark point finding radius, and initializing a minimum value point set as empty; Taking the center of the foreign fiber region image as the center and the region within the dark point finding radius as the radius, a preset number of pixel points with the smallest L component are found, and the coordinates of the found pixel points are stored in the minimum value point set; Setting a b component negative point number threshold and a gray value sum threshold; Calculating the sum of the gray values of all pixel points in the minimum value point set and the b component negative point number, and comparing the b component negative point number and the gray value sum with the b component negative point number threshold and the gray value sum threshold respectively, and according to the comparison result, the cotton defect and the impurity defect in the foreign fiber region image are determined.
9. The method of claim 8, wherein, Comparing the b component negative point number and the gray value sum with the b component negative point number threshold and the gray value sum threshold respectively, and according to the comparison result, the cotton defect and the impurity defect in the foreign fiber region image are determined, including: If the b component negative point number is greater than the b component negative point number threshold, or the gray value sum is less than the gray value sum threshold, it is determined that the foreign fiber in the foreign fiber region image is an impurity defect; If the b component negative point number is less than or equal to the b component negative point number threshold, and the gray value sum is greater than or equal to the gray value sum threshold, it is determined that the foreign fiber in the foreign fiber region image is a cotton defect.
10. A nonwoven fabric foreign fiber detection device based on Lab color space, characterized by, Including: An image extraction module is configured to collect an RGB image of a non-woven fabric to be detected, perform preliminary identification on the RGB image, determine the position of foreign fibers and perform region extraction to obtain a foreign fiber region image; A conversion module is configured to perform Lab color space conversion on the foreign fiber region image to obtain an L component, an a component and a b component of the foreign fiber region image; A first judgment module is configured to process the L component, perform edge mean calculation on the foreign fiber region image according to the processed L component, and determine whether the foreign fiber is a cotton block defect according to the edge mean calculation result of the L component; The second judging module is used for determining the impurity defect and the foreign fiber defect according to the calculation result of the defect area.
Citation Information
Patent Citations
Defect identification method for medical non-woven fabric
CN115861261A
Foreign fiber identification method and device, equipment and storage medium
CN119723538A
Battery detection method and battery detection device
CN110146509A
Dyeing defect identification method for dyed textile
CN115311286A