Method for testing detergency of a detergent on a textile based on image processing

By extracting the diffusion image of detergent on textiles using image processing technology and calculating the detergency index k value, the problem of low efficiency and poor accuracy in textile detergency testing is solved, and efficient and accurate textile quality assessment is achieved.

CN119827486BActive Publication Date: 2026-01-02QUANJIAO NEW GUANGNING TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411826952.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2026-01-02
Estimated Expiration
2044-12-12

AI Technical Summary

Technical Problem

Existing technologies for testing the detergency of textiles are inefficient and subject to large subjective errors, leading to inaccurate assessments of textile quality.

Method used

An image processing-based method is employed to capture and process images of detergent diffusion on textiles by simultaneously controlling the dripping tube and camera. The contour of the liquid diffusion circle is extracted using OpenCV functions, and grayscale conversion, blurring, image differencing, and binarization are performed. The radius of the liquid diffusion circle and the detergency index k value are calculated to analyze the detergency of the detergent.

Benefits of technology

This improves the efficiency and accuracy of detergent detergency testing, providing solid technical support for quality control in the textile industry.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119827486B_ABST
    Figure CN119827486B_ABST
Patent Text Reader

Abstract

The embodiment of the present disclosure discloses a detergent stain removal test method for textile based on image processing, controls the liquid drop pipe and the camera to start working at the same time, controls the liquid drop pipe to drop the detergent into the stained cloth, and intercepts an original image shot by the camera every certain time, finds the outline of the liquid diffusion circle in the original image to obtain a contour image, carries out gray processing, blur processing, image difference and binarization on the contour image, obtains a black and white image, obtains the vertical and horizontal diameters of the liquid diffusion circle from the black and white image, calculates a first radius according to the vertical and horizontal diameters, determines a target radius according to the first radius, calculates a fitting straight line graph according to the square of the target radius and the time of image acquisition, calculates a stain removal index k value, analyzes the k value to obtain a test result, improves the efficiency and accuracy of testing the stain removal of the detergent for the textile, and can provide solid technical support for quality control of the textile industry.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the field of textile testing technology, in particular to a detergent stain removal ability test method for textile based on image processing. BACKGROUND

[0002] Textiles play an indispensable role in daily life, and also occupy a pivotal position in industrial production, and the quality thereof is directly related to the user's experience and the competitiveness of products in the market. In particular, in the fields of home decoration, clothing and accessories, and automotive interior, the stain removal ability of textile is considered as a crucial quality indicator. The stain removal ability of textile after being stained is determined by the binding force between the stain and the textile, which is affected by the action of detergent dissolution, cleaning, etc., so it is necessary to test the stain removal ability of detergent for textile. However, the manual detection method in the related art has low efficiency and large subjective error, which leads to inaccurate evaluation of the product quality of textiles. SUMMARY

[0003] The following is a summary of the subject matter of the detailed description of the present disclosure.

[0004] The present disclosure provides a detergent stain removal ability test method for textile based on image processing, which can improve the efficiency and accuracy of testing the stain removal ability of detergent for textile, and can provide solid technical support for quality control of the textile industry.

[0005] In an embodiment of the first aspect of the present disclosure, the detergent stain removal ability test method for textile based on image processing comprises:

[0006] controlling the dropper and the camera to start working at the same time, and controlling the dropper to drop the detergent in the dropper into the stained cloth, and taking an original image captured by the camera every certain time interval;

[0007] finding the outline of the liquid diffusion circle in the original image to obtain a contour image;

[0008] performing grayscale processing on the contour image to convert the contour image into a first grayscale image;

[0009] performing blur processing on the first grayscale image;

[0010] performing image difference on the first grayscale image after the blur processing;

[0011] binarizing the first grayscale image after the image difference to convert the first grayscale image after the image difference into a black and white image;

[0012] acquire the longitudinal and transverse diameters of the liquid diffusion circle from the black and white image, and calculate a first radius of the liquid diffusion circle according to the longitudinal and transverse diameters of the liquid diffusion circle;

[0013] determine a target radius of the liquid diffusion circle according to the first radius, calculate a fitting straight line graph according to the square of the target radius of the liquid diffusion circle and the time of image acquisition, and calculate the decontamination index k value of the detergent according to the fitting straight line graph, and analyze the decontamination index k value of the detergent to obtain a detection result.

[0014] According to certain embodiments of the first aspect of the present disclosure, the acquiring the longitudinal and transverse diameters of the liquid diffusion circle from the black and white image, and calculating a first radius of the liquid diffusion circle according to the longitudinal and transverse diameters of the liquid diffusion circle; determining a target radius of the liquid diffusion circle according to the first radius, calculating a fitting straight line graph according to the square of the target radius of the liquid diffusion circle and the time of image acquisition, comprises:

[0015] acquire the longitudinal and transverse diameters of the liquid diffusion circle from the black and white image, and calculate a first radius of the liquid diffusion circle according to the longitudinal and transverse diameters of the liquid diffusion circle;

[0016] acquire the area of the liquid diffusion circle from the black and white image, and calculate a second radius of the liquid diffusion circle according to the area of the liquid diffusion circle;

[0017] calculate the error of the first radius and the second radius;

[0018] compare the size of the error of the first radius and the second radius, determine the target radius of the liquid diffusion circle according to the first radius or the second radius with smaller error, and calculate the fitting straight line graph according to the square of the target radius of the liquid diffusion circle and the time of image acquisition.

[0019] According to certain embodiments of the first aspect of the present disclosure, the finding the contour of the liquid diffusion circle in the original image to obtain a contour image comprises:

[0020] use the findContours function of OpenCV to find the contour of the liquid diffusion circle in the original image, calculate the area of the found contour of the liquid diffusion circle, compare the size of the area of the found contour of the liquid diffusion circle, obtain the contour of the liquid diffusion circle with the largest area, and draw the contour of the liquid diffusion circle with the largest area on the original image or a blank image to obtain the contour image.

[0021] According to certain embodiments of the first aspect of the present disclosure, the blurring processing on the first grayscale image comprises:

[0022] Taking each first pixel point in the first grayscale image as a center point, the distance between each second pixel point within a certain range of the center point and the center point is calculated, the weight of each second pixel point is obtained by substituting the distance into a Gaussian function, the weights of all second pixel points are normalized, a weighted average value is calculated according to the weight of the second pixel point and the pixel value of the second pixel point, and the weighted average value is used to replace the pixel value of the center point to perform the blurring processing on the first grayscale image.

[0023] According to certain embodiments of the first aspect of the present disclosure, the obtaining of the detergency index k value of the detergent according to the fitted straight line graph comprises:

[0024] The detergency index k value of the detergent is obtained according to the fitted straight line graph by a first formula, the first formula is obtained by partial derivation of a Washburn equation, and the first formula is:

[0025] ,

[0026] In the formula, the target radius of the liquid diffusion circle, the detergency index of the detergent, the time of image acquisition.

[0027] According to certain embodiments of the first aspect of the present disclosure, the analysis according to the detergency index k value of the detergent to obtain a detection result comprises:

[0028] The greater the detergency index k value of the detergent, the stronger the detergency of the detergent on the textile, and the size of the detergency index k value of the detergent is analyzed to obtain the detection result.

[0029] According to certain embodiments of the first aspect of the present disclosure, before the finding of the contour in the original image to obtain a contour image, the detergent detergency on textile test method based on image processing further comprises:

[0030] The grayscale processing is performed on the original image to convert the original image into a second grayscale image, the pixel grayscale greater than a critical grayscale value in the second grayscale image is set as a grayscale maximum value, the pixel grayscale less than the critical grayscale value is set as a grayscale minimum value, a binary image is obtained, an erosion core is defined, and an erosion operation is used to reduce the white area in the binary image.

[0031] In an embodiment of the second aspect of the present disclosure, an electronic device comprises a memory and a processor, the memory stores a computer program, and the processor executes the computer program to implement the image processing-based detergent textile decontamination power test method as described above.

[0032] In an embodiment of the third aspect of the present disclosure, a storage medium stores a computer program, and the computer program is executed by a processor to implement the image processing-based detergent textile decontamination power test method as described above.

[0033] The embodiments of the present disclosure at least have the following beneficial effects: controlling the dropper and the camera to start working at the same time, controlling the dropper to drop the detergent in the dropper into the contaminated cloth, and taking an original image captured by the camera every certain time; finding the outline of the liquid diffusion circle in the original image to obtain a contour image; performing grayscale processing on the contour image to convert the contour image into a first grayscale image; performing blur processing on the first grayscale image; performing image difference on the first grayscale image after the blur processing; binarizing the first grayscale image after the image difference to convert the first grayscale image after the image difference into a black-and-white image; obtaining the vertical and horizontal diameters of the liquid diffusion circle from the black-and-white image, and calculating the first radius of the liquid diffusion circle according to the vertical and horizontal diameters of the liquid diffusion circle; determining the target radius of the liquid diffusion circle according to the first radius, calculating a fitting straight line graph according to the square of the target radius of the liquid diffusion circle and the time of image acquisition, and calculating the decontamination index k value of the detergent according to the fitting straight line graph; analyzing the decontamination index k value of the detergent to obtain a test result, improving the efficiency and accuracy of testing the decontamination power of the detergent on the textile, and providing solid technical support for quality control of the textile industry.

[0034] Other features and advantages of the present disclosure will be described in the following description, and some will become apparent from the description, or will be learned through implementation of the present disclosure. BRIEF DESCRIPTION OF DRAWINGS

[0035] The accompanying drawings are included to provide a further understanding of the technical solutions of the present disclosure, and constitute a part of the specification, and are used together with the embodiments of the present disclosure to explain the technical solutions of the present disclosure, and do not constitute a limitation on the technical solutions of the present disclosure.

[0036] Figure 1 An optional flowchart of the image processing-based detergent textile decontamination power test method provided by the embodiments of the present disclosure;

[0037] Figure 2 A schematic diagram of the intercepted original image provided by the embodiments of the present disclosure;

[0038] Figure 3A schematic diagram of a profile image provided by an embodiment of the present disclosure;

[0039] Figure 4 A schematic diagram of a black and white image provided by an embodiment of the present disclosure;

[0040] Figure 5 A schematic diagram of a fitted straight line graph provided by an embodiment of the present disclosure;

[0041] Figure 6 A schematic diagram of a soil removal power rapid detector interface provided by an embodiment of the present disclosure;

[0042] Figure 7 A schematic diagram of an erosion operation on an original image provided by an embodiment of the present disclosure;

[0043] Figure 8 A schematic diagram of a length change table of the longitudinal and transverse diameters of a liquid diffusion circle provided by an embodiment of the present disclosure;

[0044] Figure 9 A schematic diagram of a length change table of the first radius and the second radius provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solutions and advantages of the present disclosure clearer, the present disclosure will be further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present disclosure and do not limit the present disclosure.

[0046] In an embodiment of the present disclosure, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works with other related parts to achieve a predetermined target, and can be implemented entirely or partially by using software, hardware (such as a processing circuit or a memory) or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of an overall module or unit that includes the functions of the module or unit.

[0047] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present disclosure belongs. The terms used herein are only for the purpose of describing the embodiments of the present disclosure and are not intended to limit the present disclosure.

[0048] In order to facilitate understanding of the technical solutions provided by the embodiments of the present disclosure, some key terms used by the embodiments of the present disclosure are explained first:

[0049] Open source computer vision library (OpenCV) is composed of a series of C functions and a small amount of C++ classes, and provides interfaces of languages such as Python, Ruby and MATLAB, and realizes many general algorithms in image processing and computer vision.

[0050] The embodiments of the present disclosure are further described below with reference to the drawings.

[0051] Referring to Figure 1 , Figure 1 An optional flowchart of the image processing-based detergent textile decontamination power test method provided by the embodiments of the present disclosure is shown, which includes but is not limited to steps 101 to 108, and each step is introduced in turn below.

[0052] Step 101: control the dropper and the camera to start working at the same time, control the dropper to drop the detergent in the dropper into the contaminated cloth, and take an original image shot by the camera every certain time interval.

[0053] Specifically, the camera can be a CCD camera, a CMOS camera, or other types of cameras capable of recording videos. The actual setting can be made, and the embodiments do not make specific limitations.

[0054] Referring to Figure 2 , Figure 2 An original image interception diagram provided by the embodiments of the present disclosure is shown, in which an original image shot by the camera is automatically intercepted every 10 seconds, and the original images shot by the camera at 10s, 20s, 30s, 40s, 50s and 60s are intercepted respectively. Specifically, an original image shot by the camera can be automatically intercepted every 15 seconds, and the original images shot by the camera at 15s, 30s, 45s, 60s, 75s, 90s, 105s, 120s and 135s are intercepted respectively. Alternatively, an original image shot by the camera can be automatically intercepted every 10 seconds, and the original images shot by the camera at 10s, 20s, 30s, 40s, 50s and 60s are intercepted respectively. The interval of the original image interception and the number of the original images can be set according to the actual situation, and the embodiments do not make specific limitations.

[0055] Step 102: find the outline of the liquid diffusion circle in the original image to obtain a contour image.

[0056] Referring to Figure 3 , Figure 3A schematic diagram of a profile image is provided for the embodiments of the present disclosure. Specifically, when the detergent drops on the soiled cloth, the detergent diffuses in the capillary pores of the textile while driving the oil stains, and the diffusion trace of the detergent forms a liquid diffusion circle.

[0057] The decontamination performance of the textile is mainly determined according to the curling mechanism. Before the detergent is dropped on the soiled cloth, the interface of the textile is the oil stain-air interface. When the detergent is dropped on the soiled cloth, the surfactant first drives the air in the capillary out of the outside due to the penetration of the surfactant, and then contacts the oil stain. Therefore, the adsorption of the surfactant changes the original contact angle, and the interface changes. The contact angle is changed from the oil-air interface when the oil is immersed to the detergent solution-oil-air interface. Through the interface adsorption of the penetration front of the detergent and the oil and the pore wall, the three-phase interface energy and shape change, and the concave liquid surface on the oil side becomes a convex liquid surface, that is, the oil is curled. This is the curling mechanism. According to the Laplace equation, if the liquid surface is curved, the pressure inside the liquid and the pressure outside the liquid will be different, and a pressure difference will be generated on both sides of the liquid surface. This pressure difference makes the detergent in the capillary continuously advance and drive the oil stain liquid under the pull of the concave liquid surface, resulting in the replacement of the oil stain occupying the capillary by the detergent under the action of the curling mechanism.

[0058] In some embodiments, the profile of the liquid diffusion circle in the original image is found to obtain a profile image, including:

[0059] The profile of the liquid diffusion circle in the original image is found using the findContours function of OpenCV, the areas of the profiles of the found liquid diffusion circles are calculated, the sizes of the areas of the profiles of the found liquid diffusion circles are compared, the profile of the liquid diffusion circle with the largest area is obtained, and the profile of the liquid diffusion circle with the largest area is drawn on the original image or a blank image to obtain a profile image.

[0060] It can be understood that the profile of the liquid diffusion circle in the original image is found using the findContours function of OpenCV, the findContours function of OpenCV returns a list of the profiles of the found liquid diffusion circles and the hierarchy of the profiles. The areas of the profiles of the found liquid diffusion circles are calculated, the sizes of the areas of the profiles of the found liquid diffusion circles are compared, the profile of the liquid diffusion circle with the largest area is obtained, and the profile of the liquid diffusion circle with the largest area is drawn on the original image or a blank image to obtain a profile image. Using the findContours function of OpenCV can accurately extract the profile of the object, and improve the accuracy of extracting the profile of the liquid diffusion circle in the original image.

[0061] It can be understood that the findContours function of OpenCV provides multiple contour retrieval modes, for example, RETR_EXTERNAL, which only retrieves the outermost contour, RETR_LIST, which retrieves all contours and stores them as a list, RETR_CCOMP, which retrieves all contours and organizes them as a two-level hierarchy, and RETR_TREE, which retrieves all contours and reconstructs the contour hierarchy completely. It can be set according to actual conditions, and the embodiment does not make specific limitations. The findContours function of OpenCV provides multiple contour retrieval modes, which can be flexibly selected according to requirements to extract the contour of the liquid diffusion circle in the original image that meets the requirements, improve the accuracy of extracting the contour of the liquid diffusion circle in the original image, and increase the flexibility of extracting the contour of the liquid diffusion circle in the original image.

[0062] Step 103: Perform grayscale processing on the contour image to convert the contour image into a first grayscale image.

[0063] Specifically, the RGB value of the pixel point in the contour image is obtained, the weighted average method is used to calculate the gray value of the pixel point according to the RGB value of the pixel point, the gray value of the pixel point is used to replace the pixel value of the pixel point in the contour image, and after calculating the gray value of all pixel points to replace the pixel value of the corresponding pixel point in the contour image, the first grayscale image is obtained.

[0064] It can be understood that the first grayscale image is an image containing only brightness information, and each pixel is represented by only one numerical value. Compared with a color image, the first grayscale image has a faster processing speed and requires less computing resources. Converting the contour image into the first grayscale image simplifies the image information and speeds up the image processing.

[0065] Step 104: Perform blur processing on the first grayscale image.

[0066] In some embodiments, the blur processing on the first grayscale image includes: taking each first pixel point in the first grayscale image as a center point, calculating the distance between each second pixel point within a certain range of the center point and the center point, substituting the distance into a Gaussian function to obtain the weight of each second pixel point, normalizing the weights of all second pixel points, calculating a weighted average value according to the weight of the second pixel point and the pixel value of the second pixel point, and using the weighted average value to replace the pixel value of the center point to perform blur processing on the first grayscale image.

[0067] Specifically, the first gray-scale image is blurred to reduce noise in the first gray-scale image, so that the first gray-scale image becomes smoother. Noise can interfere with the accuracy of subsequent image processing and increase the computational complexity of subsequent image processing. Reducing noise in the first gray-scale image and making the first gray-scale image smoother can reduce the computational complexity of subsequent image processing, thereby improving the efficiency and accuracy of subsequent image processing.

[0068] In some embodiments, the first gray-scale image can also be blurred using mean filtering or median filtering. The actual setting can be made, and the present embodiment does not make specific limitations thereto.

[0069] Step 105: image difference is performed on the blurred first gray-scale image.

[0070] Specifically, the blurred first gray-scale image is subjected to image difference to calculate the image difference and retain key edge information.

[0071] In some embodiments, an original image captured by the camera is automatically intercepted every 10 seconds, and original images captured by the camera at 10s, 20s, 30s, 40s, 50s and 60s are intercepted, respectively, to obtain a total of 6 original images. The outlines of the liquid diffusion circles in the original images are found to obtain 6 outline images. The outline images are subjected to gray-scale processing to convert the outline images into first gray-scale images, and 6 first gray-scale images are obtained. The 6 first gray-scale images are subjected to blurring, and the 6 blurred first gray-scale images are subjected to image difference to calculate the image difference and retain key edge information in each blurred first gray-scale image.

[0072] Step 106: the first gray-scale image after image difference is binarized to convert the first gray-scale image after image difference into a black-and-white image.

[0073] Referring to Figure 4 , a schematic diagram of a black-and-white image provided by the embodiments of the present disclosure is shown. Figure 4 Specifically, the gray-scale value of a pixel point on the first gray-scale image after image difference is set to 0, i.e., the pixel is set to black; the gray-scale value of a pixel point on the first gray-scale image after image difference is set to 255, i.e., the pixel is set to white. A threshold value is set, and the gray-scale value of a pixel point on the first gray-scale image after image difference is compared with the threshold value. If the gray-scale value of the pixel point is greater than the threshold value, the gray-scale value of the pixel point is set to 255; if the gray-scale value of the pixel point is less than the threshold value, the gray-scale value of the pixel point is set to 0, to obtain a black-and-white image.

[0074] Step 107: Obtain the longitudinal and transverse diameters of the liquid diffusion circle from the black and white image, and obtain the first radius of the liquid diffusion circle according to the longitudinal and transverse diameters of the liquid diffusion circle.

[0075] Specifically, the longitudinal and transverse diameters of the liquid diffusion circle are obtained from the black and white image, the longitudinal and transverse diameters of the liquid diffusion circle are averaged, and the average value is taken as the first radius of the liquid diffusion circle to obtain the first radius of the liquid diffusion circle.

[0076] Step 108: Determine the target radius of the liquid diffusion circle according to the first radius, obtain a fitting straight line graph according to the square of the target radius of the liquid diffusion circle and the time of image acquisition, and obtain the stain removal index k value of the detergent according to the fitting straight line graph, and analyze the stain removal index k value of the detergent to obtain a detection result.

[0077] Specifically, the target radius of the liquid diffusion circle is determined according to the first radius, and a fitting straight line graph is obtained according to the square of the target radius of the liquid diffusion circle and the time of image acquisition. The square of the target radius of the liquid diffusion circle and the time of image acquisition form coordinate points, and the fitting straight line graph is obtained according to the coordinate points.

[0078] In some embodiments, the stain removal index k value of the detergent is obtained according to the fitting straight line graph, including: the stain removal index k value of the detergent is obtained according to the fitting straight line graph by a first formula, the first formula is obtained by taking the partial derivative of the Washburn equation, and the first formula is:

[0079] ,

[0080] In the formula, is the target radius of the liquid diffusion circle, is the stain removal index of the detergent, is the time of image acquisition.

[0081] Specifically, in the first formula, is the stain removal index of the detergent, and the k value determined according to the first formula represents the stain removal index of the detergent. The stain removal index k value of the detergent is obtained according to the fitting straight line graph by the first formula. After obtaining the stain removal index k value of the detergent, the stain removal power of the detergent on the textile is judged according to the stain removal index k value. Compared with manually observing the stain removal power of the detergent on the textile, judging the stain removal power of the detergent on the textile according to the stain removal index k value improves the efficiency of detecting the stain removal power of the detergent on the textile, and improves the accuracy of detecting the stain removal power of the detergent on the textile.

[0082] In some embodiments, the detection result is obtained by analyzing the stain removal index k value of the detergent, including: the larger the stain removal index k value of the detergent, the stronger the stain removal power of the detergent on the textile, and the detection result is obtained by analyzing the size of the stain removal index k value of the detergent.

[0083] Specifically, the higher the detergency index (k) of a detergent, the stronger its detergency on textiles. Analyzing the test results based on the detergency index (k) of the detergent can improve the accuracy of the test results.

[0084] In some embodiments, the longitudinal and transverse diameters of the liquid diffusion circle are obtained from a black-and-white image; a first radius of the liquid diffusion circle is calculated based on the longitudinal and transverse diameters; a target radius of the liquid diffusion circle is determined based on the first radius; and a fitted straight line graph is calculated based on the square of the target radius of the liquid diffusion circle and the image acquisition time, including:

[0085] Obtain the longitudinal and transverse diameters of the liquid diffusion circle from the black and white image, and calculate the first radius of the liquid diffusion circle based on the longitudinal and transverse diameters. Obtain the area of ​​the liquid diffusion circle from the black and white image, and calculate the second radius of the liquid diffusion circle based on the area. Calculate the error between the first and second radii. Compare the magnitudes of the errors between the first and second radii, and determine the target radius of the liquid diffusion circle based on the first or second radius with the smaller error. Calculate the fitted straight line graph based on the square of the target radius of the liquid diffusion circle and the image acquisition time.

[0086] Specifically, the average of the longitudinal and transverse diameters of the liquid diffusion circle is calculated, and this average is used as the first radius of the liquid diffusion circle. Based on the area of ​​the liquid diffusion circle, the second radius is calculated using the circle area formula. The error between the first and second radii is calculated, and the magnitude of the error is compared. The target radius of the liquid diffusion circle is determined based on the first or second radius with the smaller error. The fitted line graph is then calculated based on the square of the target radius and the image acquisition time. The magnitude of the error between the first and second radii is calculated, and the first and second radii are then complemented to reduce the error and improve the accuracy of the obtained fitted line graph.

[0087] Referring to Table 1, Table 1 is an experimental data table of the image processing-based detergent detergency testing method for textiles provided in this embodiment of the present disclosure. An original image captured by the camera is automatically captured every 10 seconds, specifically at the 10s, 20s, 30s, 40s, 50s, and 60s, which represents the image acquisition time. The time intervals are 10s, 20s, 30s, 40s, 50s, and 60s, respectively. Obtain the longitudinal diameter of the liquid diffusion circle from the black and white image. Horizontal diameter The longitudinal diameter of the liquid diffusion circle Horizontal diameter Calculate the average value and use it as the first radius of the liquid diffusion circle. , obtaining a first radius of the liquid diffusion circle . obtaining an area of the liquid diffusion circle from the black and white image , according to the area of the liquid diffusion circle obtaining a second radius of the liquid diffusion circle .

[0088] Table 1 experimental data table of the detergent textile decontamination power test method based on image processing

[0089]

[0090] In some embodiments, referring to Figure 5 , as shown, Figure 5 is a schematic diagram of a fitting straight line graph provided by the embodiments of the present disclosure. According to the first radius determining a target radius of the liquid diffusion circle , according to the target radius of the liquid diffusion circle (the first radius mentioned above) and the time of image acquisition obtaining a fitting straight line graph.

[0091] In some embodiments, before finding the contour of the liquid diffusion circle in the original image to obtain the contour image, the detergent textile decontamination power test method based on image processing further comprises:

[0092] gray processing the original image to convert the original image into a second gray image; setting the pixel gray value greater than the critical gray value in the second gray image as a gray maximum value, and setting the pixel gray value less than the critical gray value as a gray minimum value to obtain a binary image; defining an erosion kernel and using an erosion operation to reduce the white area in the binary image.

[0093] Referring to Figure 7 , as shown, Figure 7 is a schematic diagram of the erosion operation on the original image provided by the embodiments of the present disclosure. Gray processing the original image to convert the original image into a second gray image; setting the pixel gray value greater than the critical gray value in the second gray image as a gray maximum value, and setting the pixel gray value less than the critical gray value as a gray minimum value to obtain a binary image; defining an erosion kernel and using an erosion operation to reduce the white area in the binary image.

[0094] It can be understood that, first converting the original image into a second gray image, and then converting the second gray image into a binary image, can facilitate the erosion operation and reduce the white area. Using the erosion operation to reduce the white area can make the contour of the liquid diffusion circle in the original image more clear and prominent, and improve the accuracy and efficiency of subsequently finding the contour of the liquid diffusion circle in the original image to obtain the contour image.

[0095] As can be seen, the system controls the dripping tube and camera to start working simultaneously. The dripping tube drips detergent into the soiled cloth, and at regular intervals, captures an original image from the camera. The system then locates the outline of the liquid diffusion circle in the original image, obtaining a contour image. This contour image is then converted to grayscale, becoming a first grayscale image. The first grayscale image is then blurred. Image differencing is performed on the blurred first grayscale image. The first grayscale image after image differencing is binarized and converted to a black and white image. The longitudinal and transverse diameters of the liquid diffusion circle are obtained from the black and white image, and the first radius of the liquid diffusion circle is calculated based on these diameters. The target radius of the liquid diffusion circle is determined based on the first radius. A fitted line graph is calculated based on the square of the target radius and the image acquisition time. The detergency index k of the detergent is then calculated from the fitted line graph, and the detection result is obtained through analysis based on the detergency index k. Image processing-based testing of detergents' detergency against textiles eliminates the need for manual inspection, improving the efficiency and accuracy of such testing and providing robust technical support for quality control in the textile industry.

[0096] In some embodiments, refer to Figure 6 As shown, Figure 6 This is a schematic diagram of the interface of the rapid detergency testing instrument provided in an embodiment of this disclosure. The rapid detergency testing instrument includes a real-time video window, a contour window, a grayscale window, an operation button area, and a data window. The real-time video window displays the video captured by the camera, the contour window displays the contour image, the grayscale window displays the first grayscale image, the operation button area displays function buttons, and the data window displays the fitted line graph.

[0097] Specifically, by controlling a rapid detergency testing device, the dripping tube and camera work simultaneously. The dripping tube drips detergent into the soiled cloth, and a raw image captured by the camera is taken at regular intervals. The `findContours` function of OpenCV is used to find the contour of the liquid diffusion circle in the raw image. The contour of the liquid diffusion circle with the largest area is selected and drawn, resulting in a contour image. The contour image is then converted to grayscale, becoming a first grayscale image. This first grayscale image is then blurred. Image differencing is performed on the blurred first grayscale image. The first grayscale image after image differencing is binarized and then converted to a black and white image. Partial derivatives of the Washburn equation are used to obtain the first formula. The longitudinal and transverse diameters of the liquid diffusion circle are obtained from the black and white image, and the first radius of the liquid diffusion circle is calculated based on these diameters. The target radius of the liquid diffusion circle is determined based on the first radius. A fitted straight line is calculated using the square of the target radius and the image acquisition time. The detergency index k of the detergent is then determined from the fitted straight line using the first formula. The first formula is: In the formula, The target radius of the liquid diffusion circle. The detergency index of a detergent. This refers to the image acquisition time. Finally, a test report is obtained and displayed on the rapid detergency tester. The test results are obtained through analysis of the test report. The test report includes an experimental data table, a fitted line graph, a table showing the length changes of the longitudinal and transverse diameters of the liquid diffusion circle, and a table showing the length changes of the first and second radii. The experimental data table is shown in Table 1, and the fitted line graph is shown in Table 2. Figure 5 As shown. (Refer to...) Figure 8 As shown, Figure 8 This is a schematic diagram of the length variation table of the longitudinal and transverse diameters of the liquid diffusion circle provided in the embodiments of this disclosure, as... Figure 8 Mid-Time (i.e., the time of image acquisition mentioned above) The longitudinal diameter of the liquid diffusion circle changes. Horizontal diameter The length also changes. (Refer to...) Figure 9 As shown, Figure 9 A schematic diagram of the length variation table of the first and second radii provided in the embodiments of this disclosure, as... Figure 9 Mid-Time (i.e., the time of image acquisition mentioned above) The first radius changes. Second radius The length of the liquid diffusion circle also changes. According to the length change table of the longitudinal and transverse diameters of the liquid diffusion circle, the length change table of the first radius and the second radius, the difference degree of the longitudinal and transverse diameters of the liquid diffusion circle, the difference degree of the first radius and the second radius can be judged, and the change degree of the longitudinal and transverse diameters of the liquid diffusion circle, the change degree of the first radius and the second radius can also be judged.

[0098] Before the contour image is obtained by using the findContours function of OpenCV to find the contour of the liquid diffusion circle in the original image, selecting the contour of the largest area liquid diffusion circle and drawing the contour of the largest area liquid diffusion circle, it further includes: performing a grayscale processing on the original image, and converting the original image into a second grayscale image; setting the pixel grayscale greater than the critical grayscale value in the second grayscale image as a grayscale maximum value, and setting the pixel grayscale less than the critical grayscale value as a grayscale minimum value, to obtain a binary image; defining an erosion kernel, and using an erosion operation to reduce the white area in the binary image.

[0099] The disclosure also provides an electronic device, which includes a memory and a processor, the memory stores a computer program, and the processor executes the computer program to implement the above-mentioned image processing-based detergent textile decontamination power test method. The electronic device can be any intelligent terminal including a computer.

[0100] The disclosure also provides a storage medium, which stores a computer program, and the computer program is executed by a processor to implement the above-mentioned image processing-based detergent textile decontamination power test method.

[0101] The terms "first", "second", "third", "fourth" and the like (if any) in the specification of the disclosure and the above drawings are used to distinguish similar objects, and do not necessarily have to describe a particular order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances to describe the embodiments of the disclosure, for example, it can be implemented in an order other than those illustrated or described here. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0102] It should be understood that in the present disclosure, "at least one" refers to one or more, and "multiple" refers to two or more. The "and / or" used to describe the association relationship between the associated objects indicates that there can be three relationships, for example, "A and / or B" can represent three cases of only A, only B, and A and B existing at the same time, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after it. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or multiple items. For example, at least one of a, b or c can represent a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0103] It should be understood that in the description of the embodiments of the present disclosure, the meaning of "multiple" (or "multiple items") is two or more, and greater than, less than, more than, etc. are not included in the number, and above, below, etc. are included in the number.

[0104] It should also be understood that the various embodiments provided by the embodiments of the present disclosure can be combined in any way to achieve different technical effects.

[0105] The above is a specific description of the preferred embodiments of the present disclosure, but the present disclosure is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or replacements without departing from the spirit of the present disclosure, and these equivalent modifications or replacements are all included in the scope defined by the claims of the present disclosure.

Claims

1. A method for testing the soil removal power of a detergent on a textile based on image processing, characterized in that, The method comprises the following steps: controlling the droplet tube and the camera to start working at the same time, controlling the droplet tube to drop the detergent in the droplet tube into the contaminated cloth, and taking an original image every certain time interval; finding the outline of the liquid diffusion circle in the original image to obtain a contour image; graying the contour image to convert the contour image into a first gray image; fuzzy processing the first gray image; image difference processing the first gray image after fuzzy processing; binarizing the first gray image after image difference processing to convert the first gray image after image difference processing into a black and white image; obtaining the vertical and horizontal diameters of the liquid diffusion circle from the black and white image, and calculating the first radius of the liquid diffusion circle according to the vertical and horizontal diameters of the liquid diffusion circle; determining the target radius of the liquid diffusion circle according to the first radius, calculating a fitting straight line graph according to the square of the target radius of the liquid diffusion circle and the time of image acquisition, and calculating the decontamination index k value of the detergent according to the fitting straight line graph, and analyzing the decontamination index k value of the detergent to obtain a detection result; the method for obtaining the vertical and horizontal diameters of the liquid diffusion circle from the black and white image, and calculating the first radius of the liquid diffusion circle according to the vertical and horizontal diameters of the liquid diffusion circle; determining the target radius of the liquid diffusion circle according to the first radius, calculating a fitting straight line graph according to the square of the target radius of the liquid diffusion circle and the time of image acquisition, comprises: obtaining the vertical and horizontal diameters of the liquid diffusion circle from the black and white image, and calculating the first radius of the liquid diffusion circle according to the vertical and horizontal diameters of the liquid diffusion circle; obtaining the area of the liquid diffusion circle from the black and white image, and calculating the second radius of the liquid diffusion circle according to the area of the liquid diffusion circle; calculating the error of the first radius and the second radius; comparing the error of the first radius and the second radius, and determining the target radius of the liquid diffusion circle according to the first radius or the second radius with smaller error, and calculating the fitting straight line graph according to the square of the target radius of the liquid diffusion circle and the time of image acquisition; the fuzzy processing of the first gray image comprises: taking each first pixel point in the first gray image as a center point, calculating the distance between each second pixel point within a certain range of the center point and the center point, substituting the distance into a Gaussian function to obtain the weight of each second pixel point, normalizing the weights of all second pixel points, calculating a weighted average value according to the weight of the second pixel point and the pixel value of the second pixel point, and using the weighted average value to replace the pixel value of the center point to perform the fuzzy processing on the first gray image; the calculation of the decontamination index k value of the detergent according to the fitting straight line graph comprises: The detergent k value is obtained according to the fitting straight line graph by a first formula, the first formula is obtained by partial derivation of the Washburn equation, and the first formula is: , wherein is the target radius of the liquid diffusion circle, is the detergency index of the detergent, is the time of the image acquisition.

2. The image processing-based detergent textile-stain removal power test method according to claim 1, characterized in that, The profile of the liquid diffusion circle in the original image is searched to obtain a profile image, and the profile searching method comprises the following steps: The profile of the liquid diffusion circle in the original image is searched using the findContours function of OpenCV, the area of the profile of the liquid diffusion circle searched is calculated, the size of the area of the profile of the liquid diffusion circle searched is compared, the profile of the liquid diffusion circle with the largest area is obtained, and the profile of the liquid diffusion circle with the largest area is drawn on the original image or a blank image to obtain the profile image.

3. The image processing-based detergent textile-stain removal power test method according to claim 1, characterized in that, The detection result is obtained by analyzing the k value of the detergent, and the detection result comprises the following steps: The greater the k value of the detergent is, the stronger the detergency of the detergent on the textile is, and the detection result is obtained by analyzing the size of the k value of the detergent.

4. The image processing-based detergent textile-stain removal power test method according to claim 1, characterized in that, Before the profile of the liquid diffusion circle in the original image is searched to obtain a profile image, the detergent detergency on textile testing method based on image processing further comprises the following steps: The original image is subjected to the gray scale processing, and the original image is converted into a second gray scale image; the pixel gray scale greater than a critical gray scale value in the second gray scale image is set as a gray scale maximum value, and the pixel gray scale less than the critical gray scale value is set as a gray scale minimum value to obtain a binary image; a corrosion core is defined, and a corrosion operation is used to reduce the white area in the binary image.

5. An electronic device, comprising: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor realizes the detergent detergency on textile testing method based on image processing in any one of claims 1 to 4 when executing the computer program.

6. A storage medium storing a computer program, characterized by The computer program is executed by the processor to realize the detergent detergency on textile testing method based on image processing in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Rapid measuring method of detergency of washing agents on fabric, and measuring device thereof

    CN105628563A

  • Visual-perception-based objective evaluation apparatus and method for washing detergency

    CN106485257A