A visual inspection method and system for a pull head
By automatically calculating the camera exposure time, automatically identifying the pull-head region and dynamically calculating the threshold score, the complex problems of brightness adjustment, template creation and threshold calculation in traditional visual detection methods are solved, and the efficiency and accuracy of pull-head detection are improved.
Patent Information
- Application Number
- CN202411976823.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-12-31
AI Technical Summary
Traditional visual detection methods have problems in the production of pull heads, high complexity of template creation and high complexity of threshold calculation, resulting in low detection efficiency and accuracy.
By obtaining the image information of the first slider, the camera target exposure time is automatically calculated, the AI algorithm is used to automatically identify the slider area to create a matching template, and the average score and standard deviation are calculated by continuously obtaining multiple sets of score data to determine the optimal threshold score.
It solves the problem of brightness adjustment, improves detection efficiency and accuracy, simplifies the template creation process, improves template accuracy and stability, and optimizes the threshold calculation method, enhancing the adaptability and reliability of detection.
Smart Images

Figure CN119379699B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of visual inspection technology, and in particular to a visual inspection method and system for a slider. Background Art
[0002] In the field of slider production, traditional manual inspection has obvious drawbacks such as wrong materials and mixed materials. With the advancement of science and technology, the use of vision to achieve such inspection has become an industry trend. It uses high-precision image acquisition equipment to quickly obtain slider images, and uses advanced algorithms to accurately analyze and judge. It can accurately identify multiple features of sliders and avoid manual misjudgment. It also has advantages such as repeatability and data traceability, and is being valued by more and more companies.
[0003] However, there are many problems with traditional visual inspection. For example, different colors and materials of pull heads affect their reflectivity. In practical applications, the brightness of the light source and the exposure time of the camera need to be manually adjusted, which is complex and difficult to operate. Traditional vision requires the establishment of a template image for subsequent matching. However, the manual selection of operators is complex and prone to errors. The algorithm needs to use the matching score to determine whether it is a wrong material or mixed material; however, the selection of this score is complex and requires experience.
[0004] The above three industry pain points are very inconvenient for the zipper industry, a manufacturing industry that requires frequent model changes. Therefore, a visual inspection method and system for sliders are urgently needed to solve the above problems. Summary of the invention
[0005] The object of the present invention is to provide a visual inspection method for a slider, a visual inspection method for a slider comprising:
[0006] Obtain image information of the first slider, and obtain a target exposure time of the camera according to the image information;
[0007] Obtain the secondary image information of the first slider and establish a matching template;
[0008] Acquire actual image information of subsequent products, match them with the matching template, and execute the template matching algorithm to obtain score data;
[0009] Repeat the above steps to continuously obtain multiple sets of score data;
[0010] Calculate the average score and standard deviation based on the acquired multiple groups of score data, and calculate the optimal threshold score;
[0011] Determining whether to proceed with production according to the optimal threshold score;
[0012] Determine whether the template matching algorithm score data obtained by the camera after the start of production is higher than the threshold. If it is higher than the threshold, it is judged as a defective product. If it is not higher than the threshold, it is judged as a qualified product.
[0013] Furthermore, the step of obtaining the camera target exposure time according to the image information includes:
[0014] Pre-expose the first slider to obtain image information;
[0015] Use AI algorithm to locate the slider and calculate the average brightness of the first slider;
[0016] The deviation between the average brightness and the preset brightness is compared to calculate the target exposure time of the camera, wherein the calculation formula of the target exposure time is:
[0017] T2 = T1 - T1* (X1 - X2) / X1;
[0018] Among them, T1 is the pre-exposure time, X1 is the average brightness of the slider, X2 is the target brightness of the slider, and T2 is the target exposure time.
[0019] Furthermore, the step of finding the slider area through the AI algorithm includes analyzing the slider image using a pre-trained AI model to locate the slider area.
[0020] Furthermore, the step of repeating the above steps to continuously obtain multiple sets of score data includes:
[0021] According to the production process, the next product is photographed, preprocessed, feature points extracted, matched, and scored;
[0022] After obtaining the score data each time, the data is stored in a specific data storage area;
[0023] Set a counter. Each time a set of score data is obtained, the counter is incremented by 1. When the counter reaches the preset number, the repetitive operation stops.
[0024] Furthermore, the step of calculating the optimal threshold score includes:
[0025] For the first N products, where N≤20, obtain n similarity scores based on the template;
[0026] Calculate the mean and deviation of similarity scores;
[0027] Based on the average value and the deviation, an optimal threshold score is calculated, and the optimal threshold score is used to determine whether to perform mixed production.
[0028] The present invention also discloses a visual inspection system for a slider, comprising:
[0029] A first acquisition module is used to acquire image information of the first slider and acquire a target exposure time of the camera according to the image information;
[0030] Establish a module for obtaining secondary image information of the first slider and establishing a matching template;
[0031] The second acquisition module is used to acquire the actual image information of the subsequent product, match it with the matching template, and execute the template matching algorithm to acquire the score data;
[0032] A third acquisition module is used to repeat the above steps to continuously acquire multiple sets of score data;
[0033] A calculation module, used for calculating the average score and standard deviation according to the acquired multiple groups of score data, and calculating the optimal threshold score;
[0034] A judgment module, used for judging whether to carry out production according to the optimal threshold score;
[0035] The detection module is used to determine whether the template matching algorithm score data obtained by the camera after the start of production is higher than the threshold. If it is higher than the threshold, it is judged as a defective product; if it is not higher than the threshold, it is judged as a qualified product.
[0036] Furthermore, the first acquisition module includes:
[0037] A first acquisition unit is used to pre-expose the first slider to acquire image information;
[0038] The first calculation unit is used to locate the slider through the AI algorithm and calculate the average brightness of the first slider;
[0039] The second calculation unit is used to compare the deviation between the average brightness and the preset brightness, and calculate and obtain the target exposure time of the camera.
[0040] The present application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0041] The present application also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.
[0042] The beneficial effects of this application are:
[0043] The present invention can solve the problem of brightness adjustment, improve detection efficiency and accuracy, simplify the template creation process, improve template accuracy and stability, optimize the threshold calculation method, and enhance detection adaptability and reliability. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 This is a schematic diagram of a method flow proposed in an embodiment of the present application.
[0045] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0046] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0047] like Figure 1 As shown, the present application provides a visual inspection method for a slider, comprising:
[0048] S1, obtaining image information of the first slider, and obtaining a target exposure time of the camera according to the image information;
[0049] S2, obtaining the secondary image information of the first slider and establishing a matching template;
[0050] S3, obtaining actual image information of subsequent products, matching it with the matching template, and executing the template matching algorithm to obtain score data;
[0051] S4, repeat the above steps to continuously obtain multiple sets of score data;
[0052] S5, calculating the average score and the standard deviation according to the obtained multiple groups of score data, and calculating the optimal threshold score;
[0053] S6, judging whether to proceed with production according to the optimal threshold score;
[0054] S7, judging whether the template matching algorithm score data obtained by the camera after the start of production is higher than the threshold, if it is higher than the threshold, it is judged as a defective product, if it is not higher than the threshold, it is judged as a qualified product.
[0055] As described in the above steps S1-S7, the present invention can solve the problem of brightness adjustment, improve detection efficiency and accuracy, simplify the template creation process, improve template accuracy and stability, optimize the threshold calculation method, and enhance detection adaptability and reliability.
[0056] In order to solve the problem that different colors and materials of sliders affect the reflectivity, and the light source brightness and camera exposure time need to be adjusted manually, this method can automatically obtain the image information of the first slider to determine the target exposure time of the camera. In practical applications, whether the slider is matte or highly reflective, it can adapt quickly without repeated manual attempts to adjust. For example, in the inspection of a batch of sliders containing multiple materials, traditional methods may take hours to adjust the light and exposure, but this method only needs to automatically analyze the first slider to determine the appropriate exposure parameters within a few minutes, making the image acquisition clear and accurate, avoiding feature extraction errors caused by light problems, greatly improving the detection efficiency, and ensuring the accuracy of the detection results.
[0057] In order to solve the pain point that the traditional manual selection of template images is complicated and error-prone, this method uses an AI algorithm to automatically identify the slider area to establish a matching template. In production, the operator only needs to ensure that the first slider is a qualified product for testing, and the subsequent AI algorithm can accurately locate the slider area, eliminating the tedious and error-prone manual selection process. For example, when a new style of slider is put into production, the traditional method may need to adjust the template multiple times due to inaccurate manual selection, while this method can establish an accurate template at one time, improving the efficiency and accuracy of template creation, and ensuring the stability of template matching during subsequent large-scale slider detection. The AI algorithm in the present invention includes but is not limited to Block Matching, SURF and hash algorithms. BlockMatching represents a type of image mean algorithm, SURF and SIFT represent a type of feature matching algorithm, and hash represents a type of image fingerprint comparison algorithm.
[0058] In order to solve the problem that the selection of algorithm matching score threshold is complex and requires experience, this method can continuously obtain multiple sets of score data to calculate the average score and standard deviation to determine the optimal threshold score. In the zipper industry, where frequent model changes are made, the subtle differences between different types of sliders can be accurately captured by the adaptive threshold. For example, when producing sliders of different specifications or colors, the traditional fixed threshold method may frequently make misjudgments, while this method can dynamically adjust the threshold according to the actual production data, effectively avoiding the misjudgment of qualified products as defective or mixed products, improving the reliability of detection, and reducing the increase in production costs and product quality problems caused by misjudgment.
[0059] Specifically, the step of acquiring the camera target exposure time according to the image information includes:
[0060] S8, pre-exposing the first slider to obtain image information;
[0061] S9, locates the slider through AI algorithm and calculates the average brightness of the first slider;
[0062] S10, comparing the deviation between the average brightness and the preset brightness, and calculating the target exposure time of the camera, wherein the calculation formula of the target exposure time is:
[0063] T2 = T1 - T1* (X1 - X2) / X1;
[0064] Among them, T1 is the pre-exposure time, X1 is the average brightness of the slider, X2 is the target brightness of the slider, and T2 is the target exposure time.
[0065] For example, if the pre-exposure time is 5ms, the average brightness of the slider is 150, and the target brightness of the slider is 120, then the target exposure time is 5–(150-120) / 150 * 5 = 4ms.
[0066] As described in the above steps S8-S10, the present invention can accurately control exposure, and by pre-exposing the first slider and obtaining image information, it provides basic data for subsequent brightness calculation and exposure adjustment. This method can ensure that the original image of the slider under the current lighting conditions is obtained, avoiding the loss of image information due to insufficient light or overexposure. By using the AI algorithm to locate the slider and calculate its average brightness, it is possible to accurately perform brightness analysis on the slider area without being disturbed by the surrounding environment of the slider. The application of the AI algorithm improves the accuracy and efficiency of positioning, which is more advantageous than manual operation. The target exposure time of the camera is calculated by comparing the deviation between the average brightness and the preset brightness. The camera exposure time can be accurately adjusted by a method based on data and formulas to ensure that the slider image has appropriate brightness in subsequent inspections. No matter how the color and material of the slider change, a clear and uniformly bright image can be obtained.
[0067] The whole process ensures the quality of the slider image through scientific steps and precise calculations. High-quality images are crucial for subsequent visual inspections, such as slider size measurement, shape matching, and surface defect detection. Accurate image brightness enables the detection algorithm to more effectively extract the features of the slider, reduce misjudgments caused by light problems, and thus improve the accuracy and reliability of detection.
[0068] AI algorithms and precise calculation formulas are used in the above steps to realize automated operations from image acquisition to exposure time adjustment. Compared with the traditional manual adjustment of light source brightness and camera exposure time, this automated operation greatly reduces the complexity and workload of manual operation, improves production efficiency, and also avoids the errors and instability that may be caused by manual operation. Due to the use of the target exposure time calculation method based on brightness deviation, this technology can adapt to sliders of different colors and materials. Whether it is a matte slider or a highly reflective slider, the camera exposure time can be automatically adjusted by this method, making this visual inspection method widely applicable in the production inspection of different slider products.
[0069] Specifically, the step of finding the slider area by using the AI algorithm includes:
[0070] S11, using a pre-trained AI model to analyze the slider image to locate the area where the slider is located.
[0071] As described in step S11 above, the positioning accuracy is high. By analyzing the slider image using a pre-trained AI model, the area where the slider is located can be accurately located. The AI model is trained with a large amount of data and can learn the various characteristics and forms of the slider. No matter how the shape, size, or color of the slider changes, it can be accurately identified and located, avoiding errors that may occur in manual positioning. This automated positioning method is faster than manual operation. In the production process, quickly and accurately locating the slider area is crucial for subsequent inspection steps. The AI model can complete positioning in a short time, reducing the time consumption in the inspection process, thereby improving the efficiency of the entire slider production inspection.
[0072] The pre-trained AI model is highly adaptable. The model can effectively locate sliders of different types, materials, and colors. It can work stably in different production environments and conditions, and does not require the redesign of complex positioning algorithms for each new type of slider, reducing the adjustment cost during production inspection. By using the AI model to locate the slider area, the reliance on manual operation is reduced. Manual positioning of the slider area is not only time-consuming, but also easily affected by factors such as operator fatigue and experience. The application of the AI model can ensure the consistency and stability of the positioning process and the reliability of the detection results.
[0073] Specifically, the step of repeating the above steps to continuously obtain multiple sets of score data includes:
[0074] S12, photographing, preprocessing, feature point extraction, matching and score calculation of the next product in sequence according to the production process;
[0075] S13, after each time the score data is obtained, the data is stored in a specific data storage area;
[0076] S14, setting a counter, each time a set of score data is obtained, the counter is increased by 1, and when the counter reaches a preset number, the repeated operation is stopped.
[0077] As described in the above steps S12-S14, the next product is photographed, preprocessed, feature points extracted, matched and scored according to the production process. This standardized operating process ensures that each product undergoes the same and systematic inspection steps, avoiding the randomness and instability that may be caused by manual operation. Through automated processing, the inspection efficiency is improved and the labor cost is reduced. After each scoring data is obtained, the data is stored in a specific data storage area. This enables the inspection data to be saved in an orderly manner, which is convenient for subsequent query, analysis and statistics. During the production process, if quality problems occur, the specific product inspection data can be quickly traced back, which helps to find the root cause of the problem and improve the production process.
[0078] By setting a counter, each time a set of score data is obtained, the counter is incremented by 1, and when the counter reaches the preset number, the repeated operation stops. By setting the counter, the amount of data obtained can be accurately controlled to avoid over-collection or under-collection. This helps to reasonably arrange the inspection time and resources while ensuring the accuracy of the inspection, thereby improving production efficiency.
[0079] Specifically, the step of calculating the optimal threshold score includes:
[0080] S15, for the first N products, N≤20, obtaining n similarity scores based on the template;
[0081] S16, calculating the mean and deviation of the similarity scores;
[0082] S17, calculating an optimum threshold score based on the average value and the deviation, wherein the optimum threshold score is used to determine whether to perform mixed production.
[0083] As described in the above steps S15-S17, as shown in Table 1, the optimal threshold score calculation table, taking N=10 times as an example, the average value is 9.38, the standard deviation is 0.23, K=1, and the recommended threshold is 9.38-0.23=9.15.
[0084]
[0085] Through the above method, sample data can be effectively utilized. By obtaining n similarity scores based on the template for the first N products (N≤20), the product data of the initial production can be fully utilized. In the early stage of production, product data is crucial to establish accurate testing standards. This method ensures that data collection and analysis begins early in the production process, laying the foundation for subsequent quality control. Scientific statistical methods are used to calculate the mean and deviation of the similarity scores. The mean can reflect the central trend of the similarity score, while the deviation can reflect the discreteness of the data. Through this statistical analysis, a more comprehensive understanding of the matching between the product and the template can be achieved, avoiding misjudgment caused by a single data point.
[0086] The optimal threshold score is calculated based on the average value and deviation, and adaptive threshold setting is achieved. During the production process, the characteristics of the product may change slightly due to various factors (such as changes in raw materials, fluctuations in the production environment, etc.). The adaptive threshold can be dynamically adjusted according to the actual production data, so as to more accurately determine whether to conduct mixed production and reduce the possibility of misjudgment. For example, when a slight change in the production environment causes a slight shift in the overall product similarity score, the fixed threshold may cause misjudgment, while the adaptive threshold can be adjusted in time according to the new data to ensure the accuracy of the judgment. The entire process, from collecting data to calculating the threshold, forms a systematic quality control method. With this method, product quality can be effectively monitored and controlled, quality problems such as mixing can be prevented, and the reliability of the production process and the consistency of the product can be improved.
[0087] The present invention also discloses a visual inspection system for a slider, comprising:
[0088] A first acquisition module is used to acquire image information of the first slider and acquire a target exposure time of the camera according to the image information;
[0089] Establish a module for obtaining secondary image information of the first slider and establishing a matching template;
[0090] The second acquisition module is used to acquire the actual image information of the subsequent product, match it with the matching template, and execute the template matching algorithm to acquire the score data;
[0091] A third acquisition module is used to repeat the above steps to continuously acquire multiple sets of score data;
[0092] A calculation module, used for calculating the average score and standard deviation according to the acquired multiple groups of score data, and calculating the optimal threshold score;
[0093] A judgment module, used for judging whether to carry out production according to the optimal threshold score;
[0094] The detection module is used to determine whether the template matching algorithm score data obtained by the camera after the start of production is higher than the threshold. If it is higher than the threshold, it is judged as a defective product; if it is not higher than the threshold, it is judged as a qualified product.
[0095] Furthermore, the first acquisition module includes:
[0096] A first acquisition unit is used to pre-expose the first slider to acquire image information;
[0097] The first calculation unit is used to locate the slider through the AI algorithm and calculate the average brightness of the first slider;
[0098] The second calculation unit is used to compare the deviation between the average brightness and the preset brightness, and calculate and obtain the target exposure time of the camera.
[0099] The present application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0100] The present application also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.
[0101] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, value library or other media provided in this application and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0102] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, device, article or method including the element.
[0103] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. Any equivalent results or equivalent process changes made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A visual inspection method for a slider, characterized in that: The steps include: Obtain image information of the first slider, and obtain a target exposure time of the camera according to the image information; The step of obtaining the camera target exposure time according to the image information comprises: Pre-expose the first slider to obtain image information; Use AI algorithm to locate the slider and calculate the average brightness of the first slider; The deviation between the average brightness and the preset brightness is compared to calculate the target exposure time of the camera, wherein the calculation formula of the target exposure time is: T2 = T1 - T1* (X1 - X2) / X1; Among them, T1 is the pre-exposure time, X1 is the average brightness of the slider, X2 is the target brightness of the slider, and T2 is the target exposure time; Obtain the secondary image information of the first slider and establish a matching template; Acquire actual image information of subsequent products, match them with the matching template, and execute the template matching algorithm to obtain score data; Repeat the template matching algorithm and continuously obtain multiple sets of score data; Calculate the average score and standard deviation based on the acquired multiple groups of score data, and calculate the optimal threshold score; Determining whether to produce according to the optimal threshold score; Determine whether the template matching algorithm score data obtained by the camera after the start of production is higher than the threshold. If it is higher than the threshold, it is judged as a defective product. If it is not higher than the threshold, it is judged as a qualified product.
2. A visual inspection method for a slider according to claim 1, characterized in that: The step of finding the slider area by using an AI algorithm includes analyzing the slider image by using a pre-trained AI model to locate the slider area.
3. The visual inspection method of a slider according to claim 1, characterized in that: The step of repeatedly executing the template matching algorithm and continuously acquiring multiple sets of score data comprises: According to the production process, the next product is photographed, preprocessed, feature points extracted, matched, and scored; After obtaining the score data each time, the data is stored in a specific data storage area; Set a counter. Every time a set of score data is obtained, the counter is increased by 1. When the counter reaches the preset number, the repetitive operation stops.
4. The visual inspection method of a slider according to claim 1, characterized in that: The step of calculating the optimal threshold score comprises: For the first N products, where N≤20, obtain n similarity scores based on the template; Calculate the mean and deviation of similarity scores; Based on the average value and the deviation, an optimal threshold score is calculated, and the optimal threshold score is used to determine whether to perform mixed production.
5. A visual inspection system for a slider, characterized in that: include: A first acquisition module is used to acquire image information of the first slider and acquire a target exposure time of the camera according to the image information; The first acquisition module includes: A first acquisition unit is used to pre-expose the first slider to acquire image information; The first calculation unit is used to locate the slider through the AI algorithm and calculate the average brightness of the first slider; A second calculation unit is used to compare the deviation between the average brightness and the preset brightness, and calculate and obtain the target exposure time of the camera; Establish a module for obtaining secondary image information of the first slider and establishing a matching template; The second acquisition module is used to acquire the actual image information of the subsequent product, match it with the matching template, and execute the template matching algorithm to acquire the score data; A third acquisition module is used to repeatedly execute the template matching algorithm and continuously acquire multiple groups of score data; A calculation module, used for calculating the average score and standard deviation according to the acquired multiple groups of score data, and calculating the optimal threshold score; A judgment module, used for judging whether to carry out production according to the optimal threshold score; The detection module is used to determine whether the template matching algorithm score data obtained by the camera after the start of production is higher than the threshold. If it is higher than the threshold, it is judged as a defective product; if it is not higher than the threshold, it is judged as a qualified product.
6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the visual inspection method for a slider according to any one of claims 1 to 4 are implemented.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the visual inspection method for a slider according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Method for detecting defects of chain belts of zipper on basis of digital image processing
CN102495069A
Detection system and method for zip fastener defects
CN108802052A