A cloth fabric image acquisition method and a detection method based thereon

By using Gaussian random number and Gaussian random number mean as trigger reference values ​​for light source irradiation on the fabric, the acquisition strategy is generated and the image information of the fabric is obtained, which solves the problem of insufficient image acquisition quality in intelligent inspection and improves detection accuracy and manifestation of abnormal characteristics.

CN117805095BActive Publication Date: 2024-12-10JIQINGHUISHI (ZHEJIANG) INTELLIGENT TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311844071.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-28
Publication Date
2024-12-10
Estimated Expiration
2043-12-28

AI Technical Summary

Technical Problem

In the intelligent inspection of cloth fabrics in the prior art, the image acquisition quality is insufficient, resulting in low inspection accuracy, which brings troubles to product quality inspection.

Method used

By setting the shooting area on the layout mechanism, using the Gaussian random number and the Gaussian random number mean as the trigger reference value for the side light source and the front light source, a collection strategy is generated to obtain the image information of the mobile cloth fabric, and ensure the richness of the image information and The appearance of abnormal characteristics.

Benefits of technology

It improves the acquisition quality of fabric images and the accuracy of abnormal detection, ensures that the image information distribution conforms to the abnormal characteristics of fabrics, and reduces the difficulty of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117805095B_ABST
    Figure CN117805095B_ABST
Patent Text Reader

Abstract

The present invention provides a cloth fabric image acquisition method, which is used to acquire the image information of the moving cloth fabric in the shooting area set on the cloth feeding mechanism, and the acquisition method includes: S1, acquiring an acquisition signal, and generating a Gaussian random number and associating the Gaussian random number with an acquisition cycle; S2, using the acquisition signal as a trigger signal and generating an acquisition strategy corresponding to the acquisition cycle based on the Gaussian random number corresponding to the acquisition cycle and the mean of the Gaussian random number within an acquisition cycle starting from the trigger signal; S3, acquiring the cloth fabric image information of the target cloth fabric corresponding to the acquisition cycle based on the acquisition strategy corresponding to each acquisition cycle. The present invention makes the image information of the cloth fabric under different angles of illumination richer, which is helpful to improve the recognition quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of production and processing, in particular to the field of intelligent manufacturing, and specifically to a method for acquiring cloth fabric images and a method for automatically detecting cloth fabric abnormalities. Background Art

[0002] Cloth inspection is an important process in the production of cloth and fabrics, which is related to product quality and corporate reputation. Most cloth and fabric companies use manual inspection for inspection. Manual inspection has problems such as high labor costs, low efficiency, and high missed inspection rate (human labor is susceptible to fatigue, negligence, etc.). In addition, different human labor (such as inspectors) have subjective differences in their judgment of the same cloth, which affects accuracy and efficiency.

[0003] With the rapid development of intelligent technology, it has become a trend to use intelligent technology to inspect cloth. In the use of intelligent technology, the abnormality recognition process is generally carried out by collecting images of cloth fabrics. In this recognition process, images of cloth fabrics under a fixed light source are usually obtained, and then recognized by a pre-trained model. However, in this process, since the abnormal characteristics of cloth fabrics are not taken into account, the inspection accuracy of cloth fabrics in intelligent technology is not high, which brings troubles to the effect of product quality inspection.

[0004] Therefore, how to improve the inspection accuracy by improving the acquisition quality of cloth fabric images is a technical issue that needs to be considered. Summary of the invention

[0005] In view of the deficiencies in the prior art, the present invention provides a cloth fabric image acquisition method and a cloth fabric abnormality automatic detection method, which mainly solves the problem of the quality of cloth fabric image information used for detection in intelligent technology.

[0006] The objective of the present invention is achieved through the following solutions:

[0007] According to a first aspect of the present invention, a cloth fabric image acquisition method is provided, which is used to acquire image information of moving cloth fabric in a shooting area set on a cloth feeding mechanism, and the acquisition method comprises: S1, acquiring an acquisition signal, and generating a Gaussian random number and associating the Gaussian random number with an acquisition period, wherein the acquisition period is the time corresponding to the generation of adjacent acquisition signals or the distance of cloth fabric movement, and the cloth fabric passing through the shooting area between adjacent acquisition signals is used as the target cloth fabric to be acquired in one acquisition period; S2, using the acquisition signal as a trigger signal and generating an acquisition strategy corresponding to the acquisition period based on the Gaussian random number and the mean of the Gaussian random number corresponding to the acquisition period within an acquisition period starting from the trigger signal, wherein the Gaussian random number and the mean of the Gaussian random number corresponding to the acquisition period correspond to trigger reference values ​​for side light source illumination and front light source illumination, respectively; S3, acquiring cloth fabric image information of the target cloth fabric corresponding to each acquisition period based on the acquisition strategy corresponding to the acquisition period.

[0008] In some embodiments of the present invention, in step S2, a collection strategy corresponding to a collection period is generated by the following steps: S21, comparing the Gaussian random number corresponding to the collection period with the mean of the Gaussian random number to obtain a comparison result;

[0009] S22: Determine a collection strategy corresponding to the collection period based on the comparison result.

[0010] In some embodiments of the present invention, the acquisition strategy includes any one of the following strategies: triggering the side light source first and then the front light source to illuminate the shooting area within an acquisition cycle and acquiring the image of the cloth fabric in the shooting area under the illumination of the corresponding light source; triggering the front light source first and then the side light source to illuminate the shooting area within an acquisition cycle and acquiring the image of the cloth fabric in the shooting area under the illumination of the corresponding light source.

[0011] In some embodiments of the present invention, in step S22, the acquisition strategy is determined in the following manner:

[0012] When the Gaussian random number corresponding to the acquisition cycle is greater than the mean of the Gaussian random number, the side light source is triggered first and then the front light source is triggered to illuminate the shooting area within one acquisition cycle, and the image of the cloth fabric in the shooting area under the illumination of the corresponding light source is collected; when the Gaussian random number corresponding to the acquisition cycle is less than the mean of the Gaussian random number, the front light source is triggered first and then the side light source is triggered to illuminate the shooting area within one acquisition cycle, and the image of the cloth fabric in the shooting area under the illumination of the corresponding light source is collected; when the Gaussian random number corresponding to the acquisition cycle is equal to the mean of the Gaussian random number, the front light source and the side light source are triggered alternately to illuminate the shooting area within one acquisition cycle, and the image of the cloth fabric in the shooting area under the illumination of the corresponding light source is collected.

[0013] In some embodiments of the present invention, the step of first triggering the side light source and then triggering the front light source to illuminate the shooting area and collecting the cloth fabric image in the shooting area under the illumination of the corresponding light source in one acquisition cycle includes:

[0014] T1. In response to the trigger signal, a preset pulse signal is used to trigger the side light source to illuminate the shooting area and obtain the cloth fabric image corresponding to the illuminated shooting area, and the number of times the cloth fabric image is obtained is recorded and the recorded number of times is used as the first acquisition number; T2. The first acquisition number is compared with the first preset number of times. When the first acquisition number is greater than or equal to the first preset number of times, the preset pulse signal is converted to trigger the front light source to illuminate the shooting area and obtain the cloth fabric image corresponding to the illuminated shooting area, and the number of times the cloth fabric image is obtained is recorded based on the first preset number of times and the recorded number of times is used as the second acquisition number; T3. The second acquisition number is compared with the preset total number of shots. When the second acquisition number is greater than or equal to the total number of shots, the acquisition of the cloth fabric image corresponding to the illuminated shooting area is stopped and the recorded number of times is reset.

[0015] In some embodiments of the present invention, the method of first triggering the front light source and then triggering the side light source to illuminate the shooting area and collecting the cloth fabric image in the shooting area under the illumination of the corresponding light source within one acquisition cycle includes:

[0016] M1. In response to the trigger signal, a preset pulse signal is used to trigger the front light source to illuminate the shooting area and obtain the cloth fabric image corresponding to the illuminated shooting area, and the number of times the cloth fabric image is obtained is recorded and the recorded number is used as the third acquisition number; M2. The third acquisition number is compared with the first preset number. When the third acquisition number is greater than or equal to the first preset number, the preset pulse signal is converted to trigger the side light source to illuminate the shooting area and obtain the cloth fabric image corresponding to the illuminated shooting area, and the number of times the cloth fabric image is obtained is recorded on the basis of the third acquisition number and the recorded number is used as the fourth acquisition number; M3. The fourth acquisition number is compared with the preset total number of shots. When the fourth acquisition number is greater than or equal to the total number of shots, the acquisition of the cloth fabric image corresponding to the illuminated shooting area is stopped and the recorded number is reset.

[0017] In some embodiments of the present invention, the alternately triggering the front light source and the side light source to illuminate the shooting area and collecting the cloth fabric image in the shooting area under the illumination of the corresponding light source in one acquisition cycle includes:

[0018] N1. In response to the trigger signal, a preset pulse signal is used to alternately trigger the front light source and the side light source at a preset frequency to illuminate the shooting area and obtain the cloth fabric image corresponding to the illuminated shooting area, and the number of times the cloth fabric image is obtained is recorded and the recorded number is used as the fifth acquisition number; N2. The fifth acquisition number is compared with the preset total number of shootings. When the fifth acquisition number is greater than or equal to the total number of shootings, stop acquiring the cloth fabric image corresponding to the illuminated shooting area and reset the recorded number.

[0019] According to a first aspect of the present invention, a method for automatically detecting cloth fabric abnormalities is provided, and the detection method comprises the following steps: K1, obtaining cloth fabric image information by adopting any cloth fabric image acquisition method provided by the first aspect of the present invention; K2, preprocessing the fabric image information obtained in step K1, and inputting the preprocessed fabric image information into a pre-trained image recognition model to obtain an abnormality detection result.

[0020] Compared with the prior art, the present invention has the following beneficial effects: in the method for acquiring cloth fabric images of the present invention, the Gaussian random number and the mean of the Gaussian random number corresponding to the acquisition period are respectively used as trigger reference values ​​for side light source illumination and front light source illumination, so that the image information of the cloth fabric under illumination at different angles is richer, which is helpful to improve the recognition quality; in addition, the use of Gaussian random numbers and the mean of the Gaussian random numbers as trigger reference values ​​makes the image information distribution corresponding to the cloth fabric more consistent with the characteristics of cloth fabric abnormalities, and also provides data guarantee for the accuracy of subsequent image abnormality detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The embodiments of the present invention are further described below with reference to the accompanying drawings:

[0022] Figure 1 A schematic flow chart of a method for acquiring a cloth fabric image provided by an embodiment of the present invention;

[0023] Figure 2 The present invention provides a flow chart of a collection strategy according to an embodiment of the present invention. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below through specific embodiments in conjunction with the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0025] As mentioned in the background technology, "Under the background of rapid development of intelligent technology, it has become a trend to use intelligent technology to inspect cloth. In the use of intelligent technology, the abnormal identification process is generally carried out by collecting images of cloth fabrics. In this identification process, images of cloth fabrics under a fixed light source are usually obtained, and then identified by a pre-trained model. However, in this process, since the abnormal characteristics of cloth fabrics are not taken into account, the inspection accuracy of cloth fabrics in intelligent technology is not high, which brings troubles to the effect of product quality inspection." Therefore, the inventors of the present application analyzed the existing cloth fabric image acquisition method, in which, in the process of cloth fabric image acquisition, a fixed strategy light source with a mixed angle is often used to illuminate the cloth fabric, making it difficult to show or capture some abnormal features of the cloth fabric. Therefore, it is difficult to improve the accuracy of using such cloth fabric images for subsequent abnormality detection. The embodiment of the present invention forms an acquisition strategy based on the trigger reference values ​​corresponding to the side light source illumination and the front light source illumination, so that the cloth fabric image information obtained in the shooting area has rich abnormal features, thereby improving the acquisition quality of the cloth fabric image. In addition, the Gaussian random number and the mean of the Gaussian random number corresponding to the acquisition period are introduced as the trigger reference values ​​for the side light source illumination and the front light source illumination, respectively, so that the distribution of the cloth fabric image information is as close as possible to the normal distribution law of the processing and manufacturing, and the abnormal characteristics in the cloth fabric image information are further improved, and the difficulty of obtaining the distribution that conforms to the abnormal characteristics of the cloth fabric is reduced. According to one embodiment of the present invention, a method for acquiring cloth fabric images is provided, such as Figure 1As shown, a cloth fabric image acquisition method includes: obtaining an acquisition signal and generating a Gaussian random number, forming an acquisition strategy, and executing the acquisition strategy. Specifically, a cloth fabric image acquisition method is used to obtain moving cloth fabric image information in a shooting area set on a cloth feeding mechanism. The acquisition method includes: S1, obtaining an acquisition signal, and generating a Gaussian random number and associating the Gaussian random number with an acquisition cycle, wherein the acquisition cycle is the time corresponding to the generation of adjacent acquisition signals or the distance of cloth fabric movement, and the cloth fabric passing through the shooting area between adjacent acquisition signals is the target cloth fabric to be collected in one acquisition cycle; S2, using the acquisition signal as a trigger signal and generating an acquisition strategy corresponding to the acquisition cycle based on the Gaussian random number and the mean of the Gaussian random number corresponding to the acquisition cycle within an acquisition cycle starting from the trigger signal, wherein the Gaussian random number and the mean of the Gaussian random number corresponding to the acquisition cycle correspond to trigger reference values ​​for side light source illumination and front light source illumination, respectively; S3, acquiring cloth fabric image information of the target cloth fabric corresponding to each acquisition cycle based on the acquisition strategy corresponding to the acquisition cycle. In the embodiment of the present invention, the acquisition strategy corresponding to the acquisition cycle generated based on the Gaussian random number corresponding to the acquisition cycle and the mean of the Gaussian random number can make the acquired cloth fabric image information contain more abundant abnormal features, making the subsequent quality detection more accurate. The Gaussian random number and the mean of the Gaussian random number correspond to the trigger reference values ​​for the side light source illumination and the front light source illumination, respectively, which can make the sample image distribution used for abnormality detection as a whole close to the Gaussian distribution, and also help to improve the accuracy of cloth fabric abnormality detection.

[0026] It should be noted that the existing cloth feeding mechanism is provided with a transmission roller for conveying cloth fabrics. During the conveying process, a shooting area for the area array camera to capture the cloth fabric image is provided. The irradiation light source of the shooting area includes side light source irradiation and front light source irradiation. The side light source irradiation and the front light source irradiation can be triggered by a preset pulse signal. The acquisition signal is preferably determined by the signal generated by the encoder provided on the roller. For example, after the cloth feeding mechanism is started, the cloth feeding mechanism starts to operate. After being conveyed by the cloth feeding mechanism, the cloth to be detected first passes through the roller and drives the encoder to rotate, thereby generating the encoder measurement value. First, it is determined whether the difference between the encoder measurement value and the initial value is greater than 0. If the result is not greater than 0, it means that the fabric is not moving or the fabric detection work has ended, and the program will stop executing at this time. If the result is greater than 0, the difference between the encoder measurement value and the initial value is assigned to the initial value, and then the encoder's assigned initial value is rounded to obtain A. Then it is determined whether the quotient of A and the preset value b (it can be understood that the preset value b represents the distance the cloth moves in the acquisition cycle) is an integer. If the result is a non-integer, the encoder will continue to measure the cloth without generating a collection signal, and if the result is an integer, a collection signal will be generated. Therefore, the time corresponding to adjacent collection signals or the distance the cloth moves can be regarded as a collection cycle, which simplifies the implementation process of the embodiment of the present invention.

[0027] The embodiments of the present invention are explained in detail below with reference to the accompanying drawings.

[0028] According to one embodiment of the present invention, in the step S2, the acquisition strategy corresponding to the acquisition cycle is generated by the following steps: S21, the Gaussian random number corresponding to the acquisition cycle and the mean of the Gaussian random number are compared to obtain a comparison result; S22, the acquisition strategy corresponding to the acquisition cycle is determined based on the comparison result. It should be noted that the comparison result generated in this implementation directly determines the selection of the acquisition strategy. In other words, the selection of the acquisition strategy involves whether the side light source or the front light source is used for illumination in the shooting area, which affects the acquisition of the cloth fabric image information containing the abnormal information of the cloth fabric. Therefore, after the Gaussian random number is associated with the acquisition cycle, the acquisition probability of the cloth fabric image information containing the abnormal information of the cloth fabric is more consistent with the probability distribution in industrial production, and the acquisition of the abnormal information of the cloth fabric is further improved. Among them, the generation of Gaussian random numbers and the calculation of their averages are technologies known to those skilled in the art, and will not be repeated here.

[0029] According to an embodiment of the present invention, the acquisition strategy includes any one of the following strategies: triggering the side light source first and then the front light source to illuminate the shooting area in one acquisition cycle and collecting the cloth fabric image in the shooting area under the illumination of the corresponding light source; triggering the front light source first and then the side light source to illuminate the shooting area in one acquisition cycle and collecting the cloth fabric image in the shooting area under the illumination of the corresponding light source. According to an embodiment of the present invention, in step S22, the acquisition strategy is determined in the following manner: when the Gaussian random number corresponding to the acquisition cycle is greater than the mean value of the Gaussian random number, triggering the side light source first and then the front light source to illuminate the shooting area in one acquisition cycle and collecting the cloth fabric image in the shooting area under the illumination of the corresponding light source; when the Gaussian random number corresponding to the acquisition cycle is less than the mean value of the Gaussian random number, triggering the front light source first and then the side light source to illuminate the shooting area in one acquisition cycle and collecting the cloth fabric image in the shooting area under the illumination of the corresponding light source; when the Gaussian random number corresponding to the acquisition cycle is equal to the mean value of the Gaussian random number, triggering the front light source and the side light source alternately to illuminate the shooting area in one acquisition cycle and collecting the cloth fabric image in the shooting area under the illumination of the corresponding light source.

[0030] It should be noted that the Gaussian random number corresponding to the acquisition period is compared with the mean of the Gaussian random number, so that the abnormal information of the cloth fabric contained in the acquired cloth fabric image has better interpretability, and the distribution of abnormal samples in the samples of cloth fabric image used for abnormality detection is better consistent with the distribution probability of abnormalities in the processing field.

[0031] The following is a detailed explanation of the above three collection strategies.

[0032] According to an embodiment of the present invention, the step of first triggering the side light source and then the front light source to illuminate the shooting area and to collect the cloth fabric image in the shooting area illuminated by the corresponding light source within one acquisition cycle includes: T1, in response to the trigger signal, using a preset pulse signal to trigger the side light source to illuminate the shooting area and obtain the cloth fabric image corresponding to the illuminated shooting area, and recording the number of times the cloth fabric image is obtained and using the recorded number as the first acquisition number; T2, comparing the first acquisition number with the first preset number, when the first acquisition number is greater than or equal to the first preset number, converting the preset pulse signal to trigger the front light source to illuminate the shooting area and obtain the cloth fabric image corresponding to the illuminated shooting area, and recording the number of times the cloth fabric image is obtained based on the first preset number and using the recorded number as the second acquisition number; T3, comparing the second acquisition number with the preset total number of shootings, when the second acquisition number is greater than or equal to the total number of shootings, stopping the acquisition of the cloth fabric image corresponding to the illuminated shooting area and resetting the recorded number of times.

[0033] According to one embodiment of the present invention, the method of first triggering the front light source and then triggering the side light source to illuminate the shooting area and acquiring the cloth fabric image in the shooting area under the illumination of the corresponding light source within one acquisition cycle includes: M1, in response to the trigger signal, using a preset pulse signal to trigger the front light source to illuminate the shooting area and acquire the cloth fabric image corresponding to the illuminated shooting area, and recording the number of times the cloth fabric image is acquired and using the recorded number as the third acquisition number; M2, comparing the third acquisition number with the first preset number, when the third acquisition number is greater than or equal to the first preset number, converting the preset pulse signal to trigger the side light source to illuminate the shooting area and acquire the cloth fabric image corresponding to the illuminated shooting area, and recording the number of times the cloth fabric image is acquired based on the third acquisition number and using the recorded number as the fourth acquisition number; M3, comparing the fourth acquisition number with the preset total number of shots, when the fourth acquisition number is greater than or equal to the total number of shots, stopping acquiring the cloth fabric image corresponding to the illuminated shooting area and resetting the recorded number of times.

[0034] According to an embodiment of the present invention, the alternately triggering the front light source and the side light source to illuminate the shooting area and collecting the cloth fabric image in the shooting area under the illumination of the corresponding light source in one acquisition cycle includes:

[0035] N1. In response to the trigger signal, a preset pulse signal is used to alternately trigger the front light source and the side light source at a preset frequency to illuminate the shooting area and obtain the cloth fabric image corresponding to the illuminated shooting area, and the number of times the cloth fabric image is obtained is recorded and the recorded number is used as the fifth acquisition number; N2. The fifth acquisition number is compared with the preset total number of shootings. When the fifth acquisition number is greater than or equal to the total number of shootings, stop acquiring the cloth fabric image corresponding to the illuminated shooting area and reset the recorded number.

[0036] It should be noted that in the above three acquisition strategies, within one acquisition cycle, or in other words, the cloth and fabrics passing through the shooting area within one acquisition cycle are illuminated by light sources at different angles, making it easier to capture abnormal features on the cloth and fabrics. It should be noted that the acquisition strategy adopts a completely random mode with a greater randomness of the detection results. The introduction of trigger reference values ​​for side light source illumination and front light source illumination (Gaussian random numbers and Gaussian random number means corresponding to the acquisition cycle) can greatly improve or constrain the correctness of the detection results.

[0037] In order to better illustrate the collection strategy in the embodiment of the present invention, the following is a detailed description of the collection strategy adopted when the Gaussian random number corresponding to the collection period is less than the mean value of the Gaussian random number, with reference to the accompanying drawings.

[0038] like Figure 2As shown, in the process of generating the acquisition signal, after the cloth feeding mechanism is started, the cloth feeding mechanism starts to operate. After being transported by the cloth feeding mechanism, the cloth to be detected first passes through the roller on the cloth feeding mechanism, and drives the encoder to rotate, thereby generating the encoder measurement value a'. First, determine whether the difference a" between the value a' measured by the encoder minus the initial value a is greater than 0. If the result is not greater than 0, it means that the fabric is not moving or the fabric detection work has been completed, and the program will stop executing. If the result is greater than 0, the system assigns the value of a" to a, and then rounds the encoder value a to obtain A. Then determine whether the quotient of A and the preset value b is an integer. If the result is not an integer, the encoder will continue to measure the cloth and will not generate an acquisition signal.

[0039] If the result is an integer, a capture signal is generated. Figure 2The process of generating the acquisition strategy and the process of the Gaussian random number are not shown. When the progressive length is determined to be an integer multiple of the preset value b, an acquisition signal will be generated. After the acquisition signal is generated, the acquisition strategy is determined. In this embodiment, the acquisition strategy of triggering the front light source first and then the side light source to illuminate the shooting area and collect the cloth fabric image in the shooting area under the illumination of the corresponding light source is selected in one acquisition cycle for schematic explanation. Specifically, a preset pulse signal is used to trigger the front light source to illuminate the shooting area and obtain the cloth fabric image corresponding to the irradiated shooting area, and the number of times the cloth fabric image is obtained is recorded (recorded once for each shooting, i.e., c'+1) and the recorded number of times is used as the third acquisition number (triggering number c'); the third acquisition number (triggering number c') is compared with the first preset number (preset value C), and when the third acquisition number is greater than or equal to the first preset number, the preset pulse signal is converted to trigger the side light source to illuminate the shooting area and obtain the cloth fabric image corresponding to the irradiated shooting area, and the number of times the cloth fabric image is obtained is recorded based on the third acquisition number and the recorded number of times is used as the fourth acquisition number; the fourth acquisition number is compared with the preset total number of shots, and when the fourth acquisition number is greater than or equal to the total number of shots, the acquisition of the cloth fabric image corresponding to the irradiated shooting area is stopped and the recorded number of times is reset (triggering number c' is reset to zero) and then returned to the next cycle or acquisition cycle. It should be noted that the setting of the first preset number and the total number of shots is specifically determined according to the specific movement speed of the cloth and the acquisition cycle, which will not be repeated here. According to the first aspect of the present invention, there is provided a method for automatically detecting cloth fabric anomalies, and the detection method comprises the following steps: K1, obtaining cloth fabric image information by adopting any cloth fabric image acquisition method provided in the first aspect of the present invention; K2, preprocessing the fabric image information obtained in step K1, and inputting the preprocessed fabric image information into a pre-trained image recognition model to obtain anomaly detection results. It should be noted that the process of selecting an image recognition model and pre-training the image recognition model using cloth anomaly detection training data is a technology known to those skilled in the art and will not be repeated here. Among them, the method for automatically detecting cloth fabric anomalies obtains samples containing more abnormal features on the basis of a cloth fabric image acquisition method provided by the present invention, thereby improving the accuracy of the detection results.

[0040] It should be noted that although the above describes the various steps in a specific order, it does not mean that the steps must be executed in the above specific order. In fact, some of these steps can be executed concurrently or even in a different order as long as the required functions can be achieved.

[0041] The present invention may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present invention.

[0042] Computer readable storage medium can be a tangible device that holds and stores instructions used by an instruction execution device. Computer readable storage medium can include, for example, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a protruding structure in a groove on which instructions are stored, and any suitable combination thereof.

[0043] The embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A method for acquiring image information of cloth fabrics, for acquiring image information of moving cloth fabrics in a shooting area set on a cloth feeding mechanism, characterized in that: The acquisition method comprises: S1, obtaining a collection signal, generating a Gaussian random number and associating the Gaussian random number with a collection period, wherein the collection period is the time corresponding to the generation of adjacent collection signals or the distance the cloth fabric moves, and the cloth fabric passing through the shooting area between adjacent collection signals is taken as the target cloth fabric to be collected in one collection period; S2. Using the acquisition signal as a trigger signal and generating an acquisition strategy corresponding to the acquisition cycle based on the Gaussian random number corresponding to the acquisition cycle and the mean of the Gaussian random number within an acquisition cycle starting from the trigger signal. In step S2, the acquisition strategy corresponding to the acquisition cycle is generated by the following steps: S21, comparing the Gaussian random number corresponding to the acquisition period with the mean of the Gaussian random number to obtain a comparison result; S22, determining a collection strategy corresponding to the collection period based on the comparison result; The acquisition strategy includes any one of the following strategies: triggering the side light source first and then the front light source to illuminate the shooting area and collect the cloth fabric image in the shooting area under the illumination of the corresponding light source within a collection cycle; triggering the front light source first and then the side light source to illuminate the shooting area and collect the cloth fabric image in the shooting area under the illumination of the corresponding light source within a collection cycle; in step S22, the acquisition strategy is determined in the following manner: When the Gaussian random number corresponding to the acquisition cycle is greater than the mean value of the Gaussian random number, the side light source is triggered first and then the front light source is triggered to illuminate the shooting area within one acquisition cycle, and the cloth fabric image in the shooting area under the illumination of the corresponding light source is collected; When the Gaussian random number corresponding to the acquisition cycle is less than the mean value of the Gaussian random number, the front light source is triggered first and then the side light source is triggered to illuminate the shooting area within one acquisition cycle, and the cloth fabric image in the shooting area under the illumination of the corresponding light source is collected; When the Gaussian random number corresponding to the acquisition cycle is equal to the mean value of the Gaussian random number, the front light source and the side light source are alternately triggered to illuminate the shooting area within one acquisition cycle and the cloth fabric image in the shooting area under the illumination of the corresponding light source is collected; S3. Acquire the cloth fabric image information of the target cloth fabric corresponding to each acquisition cycle based on the acquisition strategy corresponding to the acquisition cycle.

2. The acquisition method according to claim 1, characterized in that: The method of first triggering the side light source and then triggering the front light source to illuminate the shooting area and collecting the cloth fabric image in the shooting area under the illumination of the corresponding light source in one acquisition cycle includes: T1, in response to the trigger signal, using a preset pulse signal to trigger the side light source to illuminate the shooting area and obtain a cloth fabric image corresponding to the illuminated shooting area, and recording the number of times the cloth fabric image is obtained and using the recorded number as a first acquisition number; T2, comparing the first acquisition number with the first preset number, when the first acquisition number is greater than or equal to the first preset number, converting the preset pulse signal to trigger the front light source to illuminate the shooting area and acquire the cloth fabric image corresponding to the illuminated shooting area, and recording the number of times the cloth fabric image is acquired based on the first preset number and using the recorded number as the second acquisition number; T3. Compare the second acquisition times with the preset total shooting times. When the second acquisition times is greater than or equal to the total shooting times, stop acquiring the cloth fabric image corresponding to the irradiated shooting area and reset the recorded times.

3. The acquisition method according to claim 1, characterized in that: The method of first triggering the front light source and then triggering the side light source to illuminate the shooting area and collecting the cloth fabric image in the shooting area under the illumination of the corresponding light source in one acquisition cycle comprises: M1. In response to the trigger signal, a preset pulse signal is used to trigger the front light source to illuminate the shooting area and obtain a cloth fabric image corresponding to the illuminated shooting area, and the number of times the cloth fabric image is obtained is recorded and the recorded number is used as a third acquisition number; M2. Compare the third acquisition number with the first preset number, and when the third acquisition number is greater than or equal to the first preset number, convert the preset pulse signal to trigger the side light source to illuminate the shooting area and acquire the cloth fabric image corresponding to the illuminated shooting area, and record the number of times the cloth fabric image is acquired based on the third acquisition number and use the recorded number as the fourth acquisition number; M3. Compare the fourth acquisition number with the preset total shooting number. When the fourth acquisition number is greater than or equal to the total shooting number, stop acquiring the cloth fabric image corresponding to the irradiated shooting area and reset the recorded number.

4. The acquisition method according to claim 1, characterized in that: The method of alternately triggering the front light source and the side light source to illuminate the shooting area and collecting the cloth fabric image in the shooting area under the illumination of the corresponding light source in one acquisition cycle includes: N1. In response to the trigger signal, a preset pulse signal is used to alternately trigger the front light source and the side light source at a preset frequency to illuminate the shooting area and obtain a cloth fabric image corresponding to the illuminated shooting area, and the number of times the cloth fabric image is obtained is recorded and the recorded number is used as the fifth acquisition number; N2. Compare the fifth acquisition number with the preset total shooting number. When the fifth acquisition number is greater than or equal to the total shooting number, stop acquiring the cloth fabric image corresponding to the irradiated shooting area and reset the recorded number.

5. A method for automatically detecting abnormalities in cloth fabrics, characterized in that: The detection method comprises the following steps: K1. Obtaining cloth fabric image information by using any acquisition method as described in claims 1-4; K2, preprocessing the fabric image information obtained in step K1, and inputting the preprocessed fabric image information into a pre-trained image recognition model to obtain anomaly detection results.

6. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program can be executed by a processor to implement the steps of any method described in claims 1-5.

7. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the electronic device to implement the steps of the method as described in any one of claims 1-5.