Raw silk inspection and evaluation method, device and equipment based on image processing and medium
Through image processing-based methods, the raw silk is grayscale conversion, rectangular area of interest extraction and binary processing, and defects are identified and classified, solving the problem of low accuracy in the detection of raw silk in the prior art, and achieving more efficient and accurate raw silk quality evaluation.
Patent Information
- Application Number
- CN202510093522.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-21
- Publication Date
- 2025-05-16
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, the accuracy of raw silk detection is not high, and the traditional inspection is highly subjective. Electronic inspection cannot accurately determine the dry uniformity of raw silk strips and identify filaments and ring defects.
The raw silk inspection and evaluation method based on image processing is adopted, and by obtaining the raw silk images to be processed, grayscale conversion, rectangular area of interest extraction, image binarization processing, defect classification and raw silk quality evaluation are carried out, including determination of cleanliness, cleanliness and uniformity levels.
The accuracy of raw silk detection is improved, the calculation amount is reduced, the calculation efficiency is improved, the influence of light sources is avoided, and more accurate measurement is achieved. Compared with the prior art, the processing efficiency is high and the detection results are more accurate.
Smart Images

Figure CN120014347A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of raw silk detection, and in particular to a raw silk inspection and evaluation method, device, equipment and medium based on image processing. Background Art
[0002] Raw silk refers to natural fibers extracted from silkworm cocoons that have undergone preliminary processing but have not been further chemically treated or refined. Raw silk consists of fibroin secreted by the silkworm, as well as sericin. When the silkworm has completed its larval stage and is ready to pupate, it spins a continuous string of thin threads to build a protective cocoon. The cocoons can be collected and the threads of a single cocoon can be combined with threads from other cocoons into a continuous filament, raw silk, through the process of reeling.
[0003] The quality inspection of raw silk includes electronic inspection, traditional inspection and photoelectric inspection. However, traditional inspection is mainly done by manual inspection, which is highly subjective and the test results are not reliable. The photoelectric method of electronic inspection cannot accurately measure the uniformity of raw silk, and the capacitance inspection cannot identify cracked silk and loop defects caused by poor bonding. The standard certainty of electronic inspection is not high. Therefore, it is urgent to propose a more accurate raw silk inspection and evaluation method. Summary of the invention
[0004] The present invention solves the technical problem of low raw silk detection accuracy in the prior art by providing a raw silk inspection and evaluation method, device, equipment and medium based on image processing, and achieves a technical effect of improving the accuracy of raw silk detection.
[0005] In a first aspect, the present invention provides a raw silk inspection and evaluation method based on image processing, the method comprising:
[0006] Acquire a raw silk image to be processed, and perform grayscale conversion on the raw silk image to obtain a grayscale image;
[0007] Extracting a rectangular region of interest twice from the grayscale image, wherein the size of the rectangular region of interest extracted for the first time is larger than the size of the rectangular region of interest extracted for the second time;
[0008] Perform image binarization processing on the rectangular region of interest in the grayscale image to obtain a binary image;
[0009] Obtain several defects in the binary image and classify the defects;
[0010] Based on a number of defects and the types of each defect, the cleanliness and purity of the raw silk, as well as the uniformity grade of the raw silk are determined.
[0011] Further, the raw silk image to be processed is obtained, and grayscale conversion is performed on the raw silk image to be processed to obtain a grayscale image, including:
[0012] Determine the grayscale value of the raw silk image to be processed, including:
[0013]
[0014] Wherein, gray is the gray value of the raw silk image to be processed, R is the intensity value of the red channel in the raw silk image to be processed, G is the intensity value of the green channel in the raw silk image to be processed, and B is the intensity value of the blue channel in the raw silk image to be processed;
[0015] Based on the grayscale value of the raw silk image to be processed, pixels in the raw silk image to be processed are replaced to obtain a grayscale image.
[0016] Furthermore, the grayscale image is subjected to two rectangular regions of interest extractions, including:
[0017] Determine the size of the first preset rectangular area, perform a first extraction on the grayscale image using the first preset rectangular area, and obtain a first rectangular region of interest image;
[0018] The size of the second preset rectangular area is determined, and the first rectangular region of interest image is extracted again using the second preset rectangular area, wherein the size of the second preset rectangular area is smaller than the size of the first preset rectangular area.
[0019] Furthermore, the rectangular region of interest in the grayscale image is subjected to image binarization processing to obtain a binary image, including:
[0020] Determine the grayscale threshold based on the maximum inter-class variance method;
[0021] In the rectangular region of interest of the grayscale image, all pixels greater than the grayscale threshold are replaced with 255, and all pixels less than or equal to the grayscale threshold are replaced with 0, and a binary image is obtained.
[0022] Furthermore, the defects are classified into:
[0023] Determining a preset partition threshold;
[0024] Classify defects among a number of defects that are larger than a preset classification threshold as clean defects;
[0025] Among several defects, defects that are less than or equal to a preset classification threshold are classified as clean defects.
[0026] Furthermore, the cleanliness of the raw silk is determined based on a number of defects and the types of each defect, including:
[0027] Among the cleaning defects, the cleaning defects are divided into major defects, minor defects and common defects according to their area;
[0028] The cleanliness of raw silk is determined based on the number of major defects, the number of minor defects and the number of common defects, including:
[0029] CL=1-(0.1×A+0.4×B+C)
[0030] Among them, CL is the cleanliness of raw silk, A is the number of common defects, B is the number of minor defects, and C is the number of major defects.
[0031] Furthermore, the evenness grade of raw silk is determined, including:
[0032] Determine the contrast of raw silk, including:
[0033]
[0034] Among them, CJ is the contrast of raw silk, gray1 is the average gray value of stripes in raw silk, and gray0 is the average gray value of raw silk;
[0035] The evenness grade of the raw silk is determined based on the contrast of the raw silk.
[0036] In a second aspect, the present invention provides a raw silk inspection and evaluation device based on image processing, the device comprising:
[0037] An acquisition module is used to acquire the raw silk image to be processed and perform grayscale conversion on the raw silk image to be processed to obtain a grayscale image;
[0038] A double extraction module, used for performing two rectangular region of interest extractions on the grayscale image, wherein the size of the rectangular region of interest extracted for the first time is larger than the size of the rectangular region of interest extracted for the second time;
[0039] A binarization processing module is used to perform image binarization processing on a rectangular region of interest in a grayscale image to obtain a binarized image;
[0040] A classification module is used to obtain a number of defects in the binary image and classify the defects;
[0041] The inspection and evaluation module is used to determine the cleanliness and purity of the raw silk according to a number of defects and the types of each defect, as well as to determine the uniformity grade of the raw silk.
[0042] In a third aspect, the present invention provides an electronic device, comprising:
[0043] processor;
[0044] a memory for storing processor-executable instructions;
[0045] The processor is configured to execute to implement the raw silk inspection and evaluation method based on image processing as provided in the first aspect.
[0046] In a fourth aspect, the present invention provides a non-temporary computer-readable storage medium. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to implement any one of the raw silk inspection and evaluation methods based on image processing provided in the first aspect.
[0047] One or more technical solutions provided in the present invention have at least the following technical effects or advantages:
[0048] The present invention provides a raw silk inspection and evaluation method based on image processing, the method comprising: obtaining a raw silk image to be processed, and performing grayscale conversion on the raw silk image to obtain a grayscale image; performing rectangular region of interest extraction twice on the grayscale image, wherein the size of the rectangular region of interest extracted for the first time is larger than the size of the rectangular region of interest extracted for the second time; performing image binarization processing on the rectangular region of interest in the grayscale image to obtain a binary image; obtaining a plurality of defects in the binary image, and classifying the defects; determining the cleanliness and cleanliness of the raw silk according to the plurality of defects and the types of each defect, and determining the uniformity grade of the raw silk. The present invention uses a rectangular region to extract a region of interest from a grayscale image, which can reduce the amount of calculation and improve the calculation efficiency. In order to avoid the influence of the light source and improve the accuracy of detection, the present invention performs a rectangular region of interest extraction again on the basis of the rectangular region of interest extracted for the first time. Based on the rectangular region of interest extracted for the first time, the present invention further divides the first rectangular region of interest image with a second preset rectangular region, further reduces the demarcated rectangular region, and thereby reduces the extracted image, so that the regional light source illumination within the obtained rectangular region of interest image is approximately uniform, thereby improving the accuracy of binarization and defect recognition in subsequent image processing, thereby achieving more accurate measurement. Compared with the prior art methods such as eye detection and manual counting, which not only make the inspection personnel labor-intensive, but also have low inspection accuracy, the present invention combines image processing, which not only has high processing efficiency, but also has more accurate inspection results. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0050] Figure 1 A schematic flow chart of the raw silk inspection and evaluation method based on image processing provided by the present invention. DETAILED DESCRIPTION
[0051] The embodiment of the present invention solves the technical problem of low raw silk detection accuracy in the prior art by providing a raw silk inspection and evaluation method based on image processing.
[0052] The technical solution of the present invention is to solve the above technical problems, and the overall idea is as follows:
[0053] A raw silk inspection and evaluation method based on image processing comprises: obtaining a raw silk image to be processed, and performing grayscale conversion on the raw silk image to obtain a grayscale image; performing rectangular region of interest extraction twice on the grayscale image, wherein the size of the rectangular region of interest extracted for the first time is larger than the size of the rectangular region of interest extracted for the second time; performing image binarization processing on the rectangular region of interest in the grayscale image to obtain a binary image; obtaining a plurality of defects in the binary image, and classifying the defects; determining the cleanliness and cleanliness of the raw silk according to the plurality of defects and the types of the defects, and determining the uniformity grade of the raw silk.
[0054] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0055] First of all, the term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0056] The present invention provides Figure 1 The raw silk inspection and evaluation method based on image processing shown includes steps S11-S15.
[0057] Step S11, obtaining a raw silk image to be processed, and performing grayscale conversion on the raw silk image to be processed to obtain a grayscale image.
[0058] After connecting the camera to the computer via a USB cable, the corresponding connected camera can be found in the NI MAX application in the computer. After the camera takes the raw silk photo, the raw silk image to be processed is obtained. The raw silk image to be processed can be saved in a designated folder on the computer for subsequent image processing. It can be understood that the initial raw silk image to be processed is a color image.
[0059] Grayscale conversion refers to converting a color image into a grayscale image, so that the image only contains its brightness information but not other color information. The principle of grayscale conversion is actually to convert the grayscale level of each pixel in the image, so that the entire image becomes a grayscale image.
[0060] Wherein, determining the grayscale value of the raw silk image to be processed includes:
[0061]
[0062] Wherein, gray is the gray value of the raw silk image to be processed, R is the intensity value of the red channel in the raw silk image to be processed, G is the intensity value of the green channel in the raw silk image to be processed, and B is the intensity value of the blue channel in the raw silk image to be processed;
[0063] Based on the grayscale value of the raw silk image to be processed, pixels in the raw silk image to be processed are replaced to obtain a grayscale image.
[0064] After the grayscale value of the raw silk image to be processed is determined by the above formula, the pixels of the raw silk image to be processed are replaced to obtain a new grayscale image.
[0065] Step S12, extracting rectangular regions of interest twice from the grayscale image, wherein the size of the rectangular regions of interest extracted for the first time is larger than the size of the rectangular regions of interest extracted for the second time.
[0066] The method performs two rectangular region of interest extractions on a grayscale image, specifically comprising: determining the size of a first preset rectangular region, performing a first extraction on the grayscale image using the first preset rectangular region to obtain a first rectangular region of interest picture; determining the size of a second preset rectangular region, and performing another extraction on the first rectangular region of interest picture using the second preset rectangular region, wherein the size of the second preset rectangular region is smaller than that of the first preset rectangular region.
[0067] The region of interest refers to the area in an image that the user or the algorithm is interested in. Region of interest extraction can avoid processing too large an image area and causing the loss of some important image information. It can also reduce the amount of computation of the image algorithm, thereby improving detection efficiency.
[0068] In order to further reduce the amount of calculation and improve the calculation efficiency, the region of interest can be extracted in a rectangular shape.
[0069] After analyzing the raw silk, each piece of raw silk is a relatively regular rectangle. Extracting the region of interest of the grayscale image using the rectangular region can reduce the amount of calculation and improve the calculation efficiency.
[0070] In order to avoid the influence of light source and improve the accuracy of detection, the present invention extracts the rectangular region of interest again based on the rectangular region of interest extracted for the first time.
[0071] Based on the rectangular region of interest extracted for the first time, the first rectangular region of interest image is further divided by a second preset rectangular region, and the demarcated rectangular region is further reduced, thereby reducing the extracted image, so that the regional light source illumination within the obtained rectangular region of interest image is approximately uniform, thereby improving the accuracy of binarization and defect recognition in subsequent image processing, thereby achieving more accurate measurement.
[0072] For example, the size of the first preset rectangular area is 800×900 pixels, and the first preset rectangular area is used to extract the region of interest of a grayscale image to obtain several first rectangular region of interest images; the size of the first preset rectangular area is 80×90 pixels, and the first preset rectangular area is used to extract the region of interest again for several first rectangular region of interest images to obtain several second rectangular region of interest images, and the following steps are performed on each second rectangular region of interest image in turn, and the sum is performed to finally obtain the inspection and evaluation result.
[0073] Step S13, performing image binarization processing on the rectangular region of interest in the grayscale image to obtain a binary image.
[0074] Specifically, the method includes: determining the grayscale threshold based on the maximum inter-class variance method; replacing all pixels greater than the grayscale threshold in the rectangular region of interest of the grayscale image with 255, and replacing all pixels less than or equal to the grayscale threshold with 0, and obtaining a binary image.
[0075] The purpose of image binarization is to separate the detection target from other backgrounds, so that only the required target is retained. The present invention processes images based on the threshold segmentation method, which sets the grayscale values of all pixels on the image to 0 or 255, so that the image presents an obvious black and white effect, highlighting the outline of the detection target.
[0076] Maximum inter-class variance method: First, set a preset threshold t to divide the image into two parts, and determine the pixel ratio and grayscale average of each part, which can be represented by w and u respectively. The pixel ratio of the first part of the image is w0, and the grayscale average is u0, while the pixel ratio of the second part of the image is w1, and the grayscale average is u1. The total average grayscale value can be determined and used as the grayscale threshold.
[0077] Step S14, obtaining a number of defects in the binary image and classifying the defects.
[0078] The defects are classified, including: determining a preset classification threshold; classifying defects greater than the preset classification threshold among a number of defects as clean defects; and classifying defects less than or equal to the preset classification threshold among a number of defects as clean defects.
[0079] The principle of defect recognition and statistics is based on the size of the defect. By distinguishing the number of pixels contained in different objects and defects, the defects can be identified. Since there are no large image objects in the raw silk image after binarization, only small particles, so the particles in the image are all defects. The preset division threshold can be determined according to the actual situation and is not limited here.
[0080] Step S15, determining the cleanliness and purity of the raw silk according to the plurality of defects and the types of the defects, and determining the evenness grade of the raw silk.
[0081] Cleanliness
[0082] Specifically, among the cleaning defects, the cleaning defects are divided into major defects, minor defects and common defects according to their area;
[0083] The cleanliness of raw silk is determined based on the number of major defects, the number of minor defects and the number of common defects, including:
[0084] CL=1-(0.1×A+0.4×B+C)
[0085] Among them, CL is the cleanliness of raw silk, A is the number of common defects, B is the number of minor defects, and C is the number of major defects. The area for dividing clean defects can be set according to actual conditions and is not limited here. According to the above formula, the cleanliness of raw silk can be obtained.
[0086]
Cleanliness
[0087] The cleanliness can be determined by the number of cleanliness defects. Specifically, several quantity intervals can be set in advance, and each interval corresponds to a cleanliness. The cleanliness of each interval is different. The cleanliness defects are compared with the quantity intervals. According to the number of cleanliness defects, the quantity interval is determined and the corresponding cleanliness is obtained.
[0088] [Evenness grade]
[0089] Determine the evenness grade of raw silk, including:
[0090] Determine the contrast of raw silk, including:
[0091]
[0092] Among them, CJ is the contrast of raw silk, gray1 is the average gray value of stripes in raw silk, and gray0 is the average gray value of raw silk;
[0093] The evenness grade of the raw silk is determined based on the contrast of the raw silk.
[0094] Specifically, the contrast of several standard samples can be calculated in advance. For example, the contrast of the standard samples is V0, V1, V2, and their uniformity levels are L1, L2, and L3 respectively. The contrast of each raw silk is compared with the standard samples to obtain the uniformity level of the raw silk. Table 1 is the data of a certain implementation, which is as follows:
[0095] Table 1
[0096]
[0097] In summary, the present invention provides a raw silk inspection and evaluation method based on image processing, the method comprising: obtaining a raw silk image to be processed, and performing grayscale conversion on the raw silk image to obtain a grayscale image; performing rectangular region of interest extraction twice on the grayscale image, wherein the size of the rectangular region of interest extracted for the first time is larger than the size of the rectangular region of interest extracted for the second time; performing image binarization processing on the rectangular region of interest in the grayscale image to obtain a binary image; obtaining a number of defects in the binary image, and classifying the defects; determining the cleanliness and cleanliness of the raw silk according to the number of defects and the types of each defect, and determining the uniformity level of the raw silk. The present invention uses a rectangular region to extract the region of interest of the grayscale image, which can reduce the amount of calculation and improve the calculation efficiency. In order to avoid the influence of the light source and improve the accuracy of detection, the present invention performs a rectangular region of interest extraction again on the basis of the rectangular region of interest extracted for the first time. Based on the rectangular region of interest extracted for the first time, the present invention further divides the first rectangular region of interest image with a second preset rectangular region, further reduces the demarcated rectangular region, and thereby reduces the extracted image, so that the regional light source illumination within the obtained rectangular region of interest image is approximately uniform, thereby improving the accuracy of binarization and defect recognition in subsequent image processing, thereby achieving more accurate measurement. Compared with the prior art methods such as eye detection and manual counting, which not only make the inspection personnel labor-intensive, but also have low inspection accuracy, the present invention combines image processing, which not only has high processing efficiency, but also has more accurate inspection results.
[0098] Based on the same inventive concept, the present invention provides a raw silk inspection and evaluation device based on image processing, the device comprising:
[0099] An acquisition module is used to acquire the raw silk image to be processed and perform grayscale conversion on the raw silk image to be processed to obtain a grayscale image;
[0100] A double extraction module, used for performing two rectangular region of interest extractions on the grayscale image, wherein the size of the rectangular region of interest extracted for the first time is larger than the size of the rectangular region of interest extracted for the second time;
[0101] A binarization processing module is used to perform image binarization processing on a rectangular region of interest in a grayscale image to obtain a binarized image;
[0102] A classification module is used to obtain a number of defects in the binary image and classify the defects;
[0103] The inspection and evaluation module is used to determine the cleanliness and purity of the raw silk according to a number of defects and the types of each defect, as well as to determine the uniformity grade of the raw silk.
[0104] Based on the same inventive concept, the present invention also provides an electronic device as shown, including:
[0105] processor;
[0106] a memory for storing processor-executable instructions;
[0107] The processor is configured to execute to implement the raw silk inspection and evaluation method based on image processing as provided above.
[0108] Based on the same inventive concept, the present invention also provides a non-temporary computer-readable storage medium. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can implement the raw silk inspection and evaluation method based on image processing as provided above.
[0109] Since the electronic device introduced in this embodiment is an electronic device used to implement the information processing method in the embodiment of the present invention, based on the information processing method introduced in the embodiment of the present invention, a person skilled in the art can understand the specific implementation of the electronic device of this embodiment and its various variations, so how the electronic device implements the method in the embodiment of the present invention is not described in detail here. As long as the electronic device used by a person skilled in the art to implement the information processing method in the embodiment of the present invention, it belongs to the scope of protection of the present invention.
[0110] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0111] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0112] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0113] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0114] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0115] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A raw silk inspection and evaluation method based on image processing, characterized in that: The method comprises: Acquiring a raw silk image to be processed, and performing grayscale conversion on the raw silk image to be processed to obtain a grayscale image; Extracting a rectangular region of interest twice from the grayscale image, wherein the size of the rectangular region of interest extracted for the first time is larger than the size of the rectangular region of interest extracted for the second time; Performing image binarization processing on the rectangular region of interest in the grayscale image to obtain a binary image; Acquire a plurality of defects in the binary image and classify the defects; Based on a number of defects and the types of each defect, the cleanliness and purity of the raw silk, as well as the uniformity grade of the raw silk are determined.
2. The raw silk inspection and evaluation method based on image processing according to claim 1, characterized in that: Acquiring a raw silk image to be processed and performing grayscale conversion on the raw silk image to be processed to obtain a grayscale image, comprising: Determining the grayscale value of the raw silk image to be processed comprises: Wherein, gray is the gray value of the raw silk image to be processed, R is the intensity value of the red channel in the raw silk image to be processed, G is the intensity value of the green channel in the raw silk image to be processed, and B is the intensity value of the blue channel in the raw silk image to be processed; Based on the grayscale value of the raw silk image to be processed, pixels in the raw silk image to be processed are replaced to obtain the grayscale image.
3. The raw silk inspection and evaluation method based on image processing according to claim 1, characterized in that: Extracting the rectangular region of interest twice from the grayscale image includes: Determine the size of a first preset rectangular area, and perform a first extraction on the grayscale image using the first preset rectangular area to obtain a first rectangular region of interest image; The size of a second preset rectangular area is determined, and the first rectangular region of interest image is extracted again using the second preset rectangular area, wherein the size of the second preset rectangular area is smaller than the size of the first preset rectangular area.
4. The raw silk inspection and evaluation method based on image processing according to claim 1, characterized in that: Performing image binarization processing on the rectangular region of interest in the grayscale image to obtain a binary image includes: Determine the grayscale threshold based on the maximum inter-class variance method; In the rectangular region of interest of the grayscale image, all pixels greater than the grayscale threshold are replaced with 255, and all pixels less than or equal to the grayscale threshold are replaced with 0, to obtain the binary image.
5. The raw silk inspection and evaluation method based on image processing according to claim 1, characterized in that: Classify defects, including: Determining a preset partition threshold; Classify defects among the plurality of defects that are greater than the preset classification threshold as cleaning defects; Among a plurality of defects, defects that are less than or equal to the preset classification threshold are classified as clean defects.
6. The raw silk inspection and evaluation method based on image processing according to claim 5, characterized in that: The cleanliness of raw silk is determined based on a number of defects and their types, including: Among the cleaning defects, the cleaning defects are divided into major defects, minor defects and common defects according to their area; The cleanliness of raw silk is determined based on the number of major defects, the number of minor defects and the number of common defects, including: CL=1-(0.1×A+0.4×B+C) Among them, CL is the cleanliness of raw silk, A is the number of common defects, B is the number of minor defects, and C is the number of major defects.
7. The raw silk inspection and evaluation method based on image processing according to claim 1, characterized in that: Determine the evenness grade of raw silk, including: Determine the contrast of raw silk, including: Among them, CJ is the contrast of raw silk, gray1 is the average gray value of stripes in raw silk, and gray0 is the average gray value of raw silk; The evenness grade of the raw silk is determined according to the contrast of the raw silk.
8. A raw silk inspection and evaluation device based on image processing, characterized in that: The device comprises: An acquisition module is used to acquire the raw silk image to be processed, and perform grayscale conversion on the raw silk image to be processed to obtain a grayscale image; A double extraction module, used for performing two rectangular region of interest extractions on the grayscale image, wherein the size of the rectangular region of interest extracted for the first time is larger than the size of the rectangular region of interest extracted for the second time; A binarization processing module, used for performing image binarization processing on the rectangular region of interest in the grayscale image to obtain a binary image; A classification module, used for acquiring a number of defects in the binary image and classifying the defects; The inspection and evaluation module is used to determine the cleanliness and purity of the raw silk according to a number of defects and the types of each defect, as well as to determine the uniformity grade of the raw silk.
9. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute to implement the raw silk inspection and evaluation method based on image processing as claimed in any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to implement the raw silk inspection and evaluation method based on image processing as claimed in any one of claims 1 to 7.
Citation Information
Patent Citations
Defect point detection method on basis of self structure of fabric
CN105261003A
Raw silk quality detection device and method
CN109297979A
A method for detect raw silk quality
CN109461155A
Fabric defect detection method in warp knitting process
CN112365448A