A method and system for detecting the thickness of enameled wire paint film
Through video acquisition and color similarity calculation methods, the paint film thickness of the enameled wire is detected in real time, solving the problem that the paint film thickness detection in the existing technology cannot guarantee the overall quality, achieving efficient quality monitoring and timely detection of production accidents, reducing the problem of reducing the The cost.
Patent Information
- Application Number
- CN202210301127.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-25
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2042-03-25
AI Technical Summary
In the production of enameled wires, the paint film thickness detection cannot guarantee the overall quality, the quality monitoring is poor, and production accidents cannot be detected in a timely manner, resulting in increased costs.
Using video acquisition, identification of subject and background subject, generation of color histograms in HSV space and European distance calculation methods, the paint film thickness is detected in real time, and the color similarity between the color template and the subject is determined whether it is within the threshold range. Real-time detection of paint film thickness.
It improves the frequency and efficiency of paint film thickness detection, promptly detects production accidents, reduces the cost of production accidents, and enhances quality monitoring capabilities.
Smart Images

Figure CN114659453B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of enameled wire production, in particular to an enameled wire paint film thickness detection method and system. Background Art
[0002] In the production of enameled wire, after the copper wire is enameled, multiple sections will be selected from the enameled wire, and the paint film thickness of the enameled wire will be checked using a paint film thickness detection probe to determine whether the enameled wire meets the production paint film thickness.
[0003] However, the current inspection method is to use simple random sampling, which cannot guarantee whether the overall paint film thickness of the enameled wire meets the production requirements. There is still much room for improvement in quality monitoring. Summary of the invention
[0004] In view of the above-mentioned defects, the purpose of the present invention is to provide a method and system for detecting the thickness of the paint film of an enameled wire, so as to solve the problem that the paint film thickness cannot be guaranteed and the quality control is poor in the prior art.
[0005] To achieve this purpose, the present invention adopts the following technical solution: a method for detecting the thickness of an enameled wire film, comprising the following steps:
[0006] Step S1: The camera acquires a video of the copper wire after enameling in real time, and extracts a frame in the video as an inspection picture within a specified time threshold;
[0007] Step S2: Identify the inspection image to obtain the identified subject and the background subject;
[0008] Step S3: pre-processing the inspection image according to the brightness and saturation of the background subject, wherein the pre-processing includes adjusting the brightness and saturation of the inspection image;
[0009] Step S4: transform the identified subject into the HSV space, and generate a color histogram vector of the identified subject according to the HSV interval segmentation rule;
[0010] Step S5: performing Euclidean distance calculation based on the color histogram vector of the color template and the color histogram vector of the recognition subject to obtain the color similarity between the color template and the recognition subject, and determining whether the color similarity is within a color threshold range.
[0011] Preferably, the time threshold is set between 30 seconds and 2 minutes.
[0012] Preferably, the specific steps of step S2 are as follows:
[0013] Step S21: using the One-Stage algorithm to identify objects in the inspection image and obtain multiple identification frames;
[0014] Step S22: using the recognition template to match multiple recognition frames, the recognition subject is obtained by matching, and the area other than the recognition subject in the inspection picture is marked as the background subject.
[0015] Preferably, the following steps need to be performed before step S1:
[0016] Step S31: collecting standard white RGB component signal values through a camera, and dividing the collected white RGB component signal values by a set threshold R to obtain a minimum component resolution value of the minimum white RGB component signal value;
[0017] Step S32: setting a control ratio threshold, adjusting the camera distance and the intensity of the shooting light source, so that the resolution value of the minimum component of the minimum white RGB component signal value in the camera shooting picture falls within the control ratio threshold.
[0018] Preferably, the specific steps of step S3 are as follows:
[0019] Step S31: obtaining the brightness and saturation of the color template, obtaining the brightness and saturation of the background subject, and obtaining the brightness difference and saturation difference between the color template and the background subject;
[0020] Step S32: adding the brightness difference and saturation difference to the inspection image.
[0021] Preferably, the calculation formula for color similarity in step S5 is as follows:
[0022]
[0023] Wherein Dist(x, y) is the comprehensive Euclidean distance between the color histogram vector of the color template and the color histogram vector of the recognition subject, i is the dimension of the color histogram, β and α are adjustment coefficients, which are determined by the dimension of the color histogram;
[0024] in where x i and i They represent the vector of the i-th dimension of the color histogram of the color template and the i-th vector of the color histogram of the identified subject, respectively, and n is the total dimension.
[0025] An enameled wire paint film thickness detection system, using the above-mentioned enameled wire paint film thickness detection method, characterized in that it includes a video acquisition module, an inspection picture acquisition module, a subject recognition module, a preprocessing module, a conversion module and a color similarity calculation module;
[0026] The video acquisition module is used to acquire the video of the copper wire after enameling in real time;
[0027] The inspection picture acquisition module is used to extract a frame in the video as an inspection picture within a specified time threshold;
[0028] The subject recognition module is used to recognize the inspection picture and obtain the recognized subject and the background subject;
[0029] The preprocessing module is used to preprocess the inspection picture according to the brightness and saturation of the background subject;
[0030] The conversion module is used to convert the identified subject into the HSV space, and generate a color histogram vector of the identified subject according to the HSV interval segmentation rule;
[0031] The color similarity calculation module is used to perform Euclidean distance calculation based on the color histogram vector of the color template and the color histogram vector of the recognition subject, obtain the color similarity between the color template and the recognition subject, and determine whether the color similarity is within the color threshold range.
[0032] Preferably, the subject recognition module includes a recognition frame module and a matching module;
[0033] The recognition frame module is used to use the One-Stage algorithm to recognize objects in the inspection image to obtain multiple recognition frames;
[0034] The matching module is used to match multiple recognition frames using recognition templates, obtain the recognition subject through matching, and mark the area in the inspection picture except the recognition subject as the background subject.
[0035] Preferably, it also includes a camera adjustment module;
[0036] The camera adjustment module is used to collect standard white RGB component signal values through a camera, and divide the collected white RGB component signal values by a set threshold R to obtain a minimum component resolution value of the minimum white RGB component signal value;
[0037] A control ratio threshold is set, and the distance of the camera and the intensity of the shooting light source are adjusted so that the resolution value of the minimum component of the minimum white RGB component signal value in the camera shooting picture falls within the control ratio threshold.
[0038] Preferably, the preprocessing module includes a difference acquisition module and an addition module;
[0039] The difference acquisition module is used to acquire the brightness and saturation of the color template, acquire the brightness and saturation of the background subject, and obtain the brightness difference and saturation difference between the color template and the background subject;
[0040] The adding module is used to add the brightness difference and the saturation difference to the inspection picture.
[0041] One of the above technical solutions has the following advantages or beneficial effects: the method mentioned in the present invention can detect the thickness of the paint film in real time during the production of enameled wire, can promptly discover production accidents, avoid risks in time, and reduce the cost of production accidents. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 It is a flow chart of an embodiment of the method of the present invention.
[0043] Figure 2 It is a schematic diagram of the structure of an embodiment of the system of the present invention. DETAILED DESCRIPTION
[0044] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0045] In the description of the present invention, it is to be understood that the terms “center”, “longitudinal”, “lateral”, “length”, “width”, “thickness”, “up”, “down”, “left”, “right”, “vertical”, “horizontal”, “top”, “bottom”, “inside”, “outside”, “axial”, “radial”, “circumferential”, etc., indicating orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present invention.
[0046] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, "plurality" means two or more.
[0047] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a direct connection, or an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0048] like Figures 1-2 As shown, a method for detecting the thickness of an enameled wire paint film comprises the following steps:
[0049] Step S1: The camera acquires a video of the copper wire after enameling in real time, and extracts a frame in the video as an inspection picture within a specified time threshold;
[0050] Step S2: Identify the inspection image to obtain the identified subject and the background subject;
[0051] Step S3: pre-processing the inspection image according to the brightness and saturation of the background subject, wherein the pre-processing includes adjusting the brightness and saturation of the inspection image;
[0052] Step S4: transform the identified subject into the HSV space, and generate a color histogram vector of the identified subject according to the HSV interval segmentation rule;
[0053] Step S5: performing Euclidean distance calculation based on the color histogram vector of the color template and the color histogram vector of the recognition subject to obtain the color similarity between the color template and the recognition subject, and determining whether the color similarity is within a color threshold range.
[0054] In the present invention, the video of the copper wire in the enameling is shot by the camera, and the frame extraction operation is performed on the video within the specified time threshold to obtain the inspection picture, and the time threshold can be determined according to the production speed of the enameled wire and the production scale of the enameled wire. Generally, the time threshold is set between 30s and 2min to ensure that the state of the enameled wire can be obtained in real time. Since the paint film has not solidified after the enameling, the paint film thickness detection probe cannot be used to directly touch the enameled wire to detect the paint film thickness. Therefore, the color similarity is used in the present invention to determine whether the paint film of the enameled wire meets the production requirements. Since the colors reflected by different paint film thicknesses under light are different, it is only necessary to obtain color templates of different paint film thicknesses by shooting the template using the present invention. During production, the production specifications of the corresponding paint film thickness are known, and the corresponding facial template is selected to calculate the color similarity of the detection picture to determine whether the paint film thickness of the enameled wire meets the production requirements during the production process at this moment. The present invention can increase the frequency of sampling detection without manual spot checks, greatly improving the efficiency of detection. At the same time, the method mentioned in the present invention can detect the thickness of the paint film in real time during the production of enameled wire, and can timely discover production accidents, avoid risks in time, and reduce the cost of production accidents. It is worth mentioning that converting the identification subject into the HSV space is an existing technology, and the interval segmentation rule can be artificially set by the HSV dimension segmentation interval in the color histogram. For example, brightness 0 to 1 is one dimension, 1 to 2 is another dimension, and so on.
[0055] Preferably, the time threshold is set between 30 seconds and 2 minutes.
[0056] Preferably, the specific steps of step S2 are as follows:
[0057] Step S21: using the One-Stage algorithm to identify objects in the inspection image and obtain multiple identification frames;
[0058] Step S22: using the recognition template to match multiple recognition frames, the recognition subject is obtained by matching, and the area other than the recognition subject in the inspection picture is marked as the background subject.
[0059] The recognition template is obtained by training first. Through the image convolution technology, a copper wire model after enameling is first made, and then the model is trained to obtain the recognition template. The present invention first uses the One-Stage algorithm to inspect the image, obtains the recognition frame in the inspection image, reduces unnecessary recognition objects, and then uses the recognition template to match the content in the recognition frame to obtain the recognition subject and the background subject. The present invention will first divide the inspection image into two parts. The background subject does not exist in the color template. The brightness and saturation of the background subject can reflect the environment when the inspection image is taken. The brightness and saturation of the inspection image are adjusted by the brightness and saturation of the background subject, so that the brightness and saturation of the inspection image when it is taken can be close to the brightness and saturation of the color template. Reduce the difference in brightness and saturation that affects the matching results of the recognition subject and the color template.
[0060] Preferably, the following steps need to be performed before step S1:
[0061] Step S31: collecting standard white RGB component signal values through a camera, and dividing the collected white RGB component signal values by a set threshold R to obtain a minimum component resolution value of the minimum white RGB component signal value;
[0062] Step S32: setting a control ratio threshold, adjusting the camera distance and the intensity of the shooting light source, so that the resolution value of the minimum component of the minimum white RGB component signal value in the camera shooting picture falls within the control ratio threshold.
[0063] In this application, the threshold R is set to 255, and the minimum resolution value can be obtained by dividing the white RGB component signal value by the set threshold R. Then, the control ratio threshold is set, and the control ratio threshold can be determined according to the performance of the camera. When the camera's shooting performance is high, the control ratio threshold can be increased accordingly to improve the instructions for obtaining inspection pictures and facilitate subsequent matching work. By adjusting the camera distance and the intensity of the shooting light source, the white balance can be corrected, the interference of ambient light on shooting can be eliminated as much as possible, and the error caused by the white light in the environment between the inspection picture and the color template is reduced, thereby improving the accuracy of color recognition.
[0064] Preferably, the specific steps of step S3 are as follows:
[0065] Step S31: obtaining the brightness and saturation of the color template, obtaining the brightness and saturation of the background subject, and obtaining the brightness difference and saturation difference between the color template and the background subject;
[0066] Step S32: adding the brightness difference and saturation difference to the inspection image.
[0067] In the present invention, the brightness and saturation of the inspection image need to be adjusted before the color similarity calculation is performed. The brightness and saturation in the inspection image tend to the brightness and saturation of the color template. It is worth mentioning that before adjusting the brightness and saturation, it is also determined whether the brightness difference and saturation difference between the background subject and the identification subject are greater than 5%. If greater than, the brightness and saturation of the inspection image are not adjusted. Because when the brightness difference and saturation difference between the background subject and the identification subject are too large, directly adjusting the inspection image will affect the subsequent color similarity detection results. When this happens, it is necessary to notify the management personnel to adjust the brightness of the camera shooting length so that the brightness difference and saturation difference between the background subject and the identification subject are within a reasonable threshold.
[0068] Preferably, the calculation formula for color similarity in step S5 is as follows:
[0069]
[0070] Wherein Dist(x, y) is the comprehensive Euclidean distance between the color histogram vector of the color template and the color histogram vector of the recognition subject, i is the dimension of the color histogram, β and α are adjustment coefficients, which are determined by the dimension of the color histogram;
[0071] in where x i and i They represent the vector of the i-th dimension of the color histogram of the color template and the i-th vector of the color histogram of the identified subject, respectively, and n is the total dimension.
[0072] An enameled wire paint film thickness detection system, using the above-mentioned enameled wire paint film thickness detection method, characterized in that it includes a video acquisition module, an inspection picture acquisition module, a subject recognition module, a preprocessing module, a conversion module and a color similarity calculation module;
[0073] The video acquisition module is used to acquire the video of the copper wire after enameling in real time;
[0074] The inspection picture acquisition module is used to extract a frame in the video as an inspection picture within a specified time threshold;
[0075] The subject recognition module is used to recognize the inspection picture and obtain the recognized subject and the background subject;
[0076] The preprocessing module is used to preprocess the inspection picture according to the brightness and saturation of the background subject;
[0077] The conversion module is used to convert the identified subject into the HSV space, and generate a color histogram vector of the identified subject according to the HSV interval segmentation rule;
[0078] The color similarity calculation module is used to perform Euclidean distance calculation based on the color histogram vector of the color template and the color histogram vector of the recognition subject, obtain the color similarity between the color template and the recognition subject, and determine whether the color similarity is within the color threshold range.
[0079] Preferably, the subject recognition module includes a recognition frame module and a matching module;
[0080] The recognition frame module is used to use the One-Stage algorithm to recognize objects in the inspection image to obtain multiple recognition frames;
[0081] The matching module is used to match multiple recognition frames using recognition templates, obtain the recognition subject through matching, and mark the area in the inspection picture except the recognition subject as the background subject.
[0082] Preferably, it also includes a camera adjustment module;
[0083] The camera adjustment module is used to collect standard white RGB component signal values through a camera, and divide the collected white RGB component signal values by a set threshold R to obtain a minimum component resolution value of the minimum white RGB component signal value;
[0084] A control ratio threshold is set, and the distance of the camera and the intensity of the shooting light source are adjusted so that the resolution value of the minimum component of the minimum white RGB component signal value in the camera shooting picture falls within the control ratio threshold.
[0085] Preferably, the preprocessing module includes a difference acquisition module and an addition module;
[0086] The difference acquisition module is used to acquire the brightness and saturation of the color template, acquire the brightness and saturation of the background subject, and obtain the brightness difference and saturation difference between the color template and the background subject;
[0087] The adding module is used to add the brightness difference and the saturation difference to the inspection picture.
[0088] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0089] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
Claims
1. A method for detecting the thickness of an enameled wire film, characterized in that: The following steps are involved: Step S1: The camera acquires a video of the copper wire after enameling in real time, and extracts a frame in the video as an inspection picture within a specified time threshold; Step S2: Identify the inspection image to obtain the identified subject and the background subject; Step S3: pre-processing the inspection image according to the brightness and saturation of the background subject, wherein the pre-processing includes adjusting the brightness and saturation of the inspection image; Step S4: transform the identified subject into the HSV space, and generate a color histogram vector of the identified subject according to the HSV interval segmentation rule; Step S5: performing Euclidean distance calculation based on the color histogram vector of the color template and the color histogram vector of the recognition subject to obtain the color similarity between the color template and the recognition subject, and determining whether the color similarity is within the color threshold range; The calculation formula for color similarity in step S5 is as follows: ; in is the comprehensive Euclidean distance between the color histogram vector of the color template and the color histogram vector of the recognition subject, i is the dimension of the color histogram, is an adjustment coefficient, which is determined by the dimension of the color histogram; in ;in and They represent the vector of the i-th dimension of the color histogram of the color template and the i-th vector of the color histogram of the identified subject, respectively, and n is the total dimension.
2. The method for detecting the thickness of the enameled wire film according to claim 1, characterized in that: The time threshold is set between 30 seconds and 2 minutes.
3. The method for detecting the thickness of the enameled wire film according to claim 1, characterized in that: The specific steps of step S2 are as follows: Step S21: using the One-Stage algorithm to identify objects in the inspection image and obtain multiple identification frames; Step S22: using the recognition template to match multiple recognition frames, the recognition subject is obtained by matching, and the area other than the recognition subject in the inspection picture is marked as the background subject.
4. The method for detecting the thickness of the enameled wire film according to claim 1, characterized in that: The following steps need to be performed before step S1: Step S31: collecting standard white RGB component signal values through a camera, and dividing the collected white RGB component signal values by a set threshold R to obtain a minimum component resolution value of the minimum white RGB component signal value; Step S32: setting a control ratio threshold, adjusting the camera distance and the intensity of the shooting light source, so that the resolution value of the minimum component of the minimum white RGB component signal value in the camera shooting picture falls within the control ratio threshold.
5. The method for detecting the thickness of the enameled wire film according to claim 1, characterized in that: The specific steps of step S3 are as follows: Step S31: obtaining the brightness and saturation of the color template, obtaining the brightness and saturation of the background subject, and obtaining the brightness difference and saturation difference between the color template and the background subject; Step S32: adding the brightness difference and saturation difference to the inspection image.
6. A system for detecting the thickness of enameled wire film, characterized in that: A method for detecting the thickness of an enameled wire film as claimed in any one of claims 1 to 5 is applied, comprising a video acquisition module, an inspection picture acquisition module, a subject recognition module, a preprocessing module, a conversion module and a color similarity calculation module; The video acquisition module is used to acquire the video of the copper wire after enameling in real time; The inspection picture acquisition module is used to extract a frame in the video as an inspection picture within a specified time threshold; The subject recognition module is used to recognize the inspection picture and obtain the recognized subject and the background subject; The preprocessing module is used to preprocess the inspection picture according to the brightness and saturation of the background subject; The conversion module is used to convert the identified subject into the HSV space, and generate a color histogram vector of the identified subject according to the HSV interval segmentation rule; The color similarity calculation module is used to perform Euclidean distance calculation based on the color histogram vector of the color template and the color histogram vector of the recognition subject, obtain the color similarity between the color template and the recognition subject, and determine whether the color similarity is within the color threshold range; The preprocessing module includes a difference acquisition module and an addition module; The difference acquisition module is used to acquire the brightness and saturation of the color template, acquire the brightness and saturation of the background subject, and obtain the brightness difference and saturation difference between the color template and the background subject; The adding module is used to add the brightness difference and the saturation difference to the inspection picture.
7. The enameled wire paint film thickness detection system according to claim 6, characterized in that: The subject recognition module includes a recognition frame module and a matching module; The recognition frame module is used to use the One-Stage algorithm to recognize objects in the inspection image to obtain multiple recognition frames; The matching module is used to match multiple recognition frames using recognition templates, obtain the recognition subject through matching, and mark the area in the inspection picture except the recognition subject as the background subject.
8. The enameled wire paint film thickness detection system according to claim 7, characterized in that: Also includes a camera adjustment module; The camera adjustment module is used to collect standard white RGB component signal values through a camera, and divide the collected white RGB component signal values by a set threshold R to obtain a minimum component resolution value of the minimum white RGB component signal value; A control ratio threshold is set, and the distance of the camera and the intensity of the shooting light source are adjusted so that the resolution value of the minimum component of the minimum white RGB component signal value in the camera shooting picture falls within the control ratio threshold.
