A method, device, equipment and storage medium for detecting spray defects

By analyzing the detection grayscale diagram of sprayed products and calculating the defect quantification index, the problem of overly subjective judgment of sprayed products in the prior art is solved, and more accurate and objective quality control is achieved.

CN114202532BActive Publication Date: 2025-03-21ZHEJIANG JINGSI BOZHI TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111529643.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-14
Publication Date
2025-03-21
Estimated Expiration
2041-12-14

AI Technical Summary

Technical Problem

In the prior art, the quality judgment of sprayed products depends on the visual inspection of workers, and there are many interference factors, which leads to the missed inspection and judgment of defective products being too subjective, affecting the company's economic benefits and reputation.

Method used

By obtaining the spray detection grayscale map, identifying the target detection area, calculating the spray status description parameters, calculating the defect quantization index, and determining the product's qualified or unqualified based on the threshold value, the defect type is determined.

Benefits of technology

It improves the detection ability of sprayed products, reduces human interference, realizes accurate judgment of unqualified products and classification of defect types, and improves the objectivity and accuracy of product quality control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114202532B_ABST
    Figure CN114202532B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a method, device, equipment and storage medium for detecting spray defects. The method includes: obtaining a spray detection grayscale image, and identifying a target detection area that matches the target spray product in the spray detection grayscale image; calculating at least one spray state description parameter that matches the target spray product according to at least one of the spray color, the shape of the target detection area and the pixel value of each pixel point in the target detection area; calculating a defect quantification index that matches the target spray product according to each spray state description parameter; if it is determined that the defect quantification index is greater than or equal to a preset threshold value, the target spray product is determined to be an unqualified spray product, and the defect type corresponding to the target spray product is determined. The embodiment of the present invention solves the problem of judging whether a spray product is qualified, improves the detection capability of spray products, and classifies the defect types of unqualified spray products.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to computer vision and data processing technology, and in particular to a method, device, equipment and storage medium for detecting spraying defects. Background Art

[0002] During the production process of existing spray products, the viscosity and moisture content of the paint will be affected due to equipment aging, poor debugging, changes in temperature and humidity in the air, etc., which will lead to changes in the parameters of the spray products during the production process and ultimately affect the pattern quality of the spray products.

[0003] During the process of invention, the inventor discovered the defects of the prior art: visual inspection by workers is the only means for factories to solve this problem, and there are many interfering factors. For example, interfering factors may be human factors, lighting, weather and other factors, which lead to a large number of defective products being missed and outflowed, and it is impossible to trace and analyze the causes of unqualified spray products. Since the standards of spray products cannot be quantified, the determination of whether they are qualified or not is purely subjective, and it is impossible to accurately determine the quality of the products and effectively classify them. The direct impact is that due to different perceptions, there are unqualified spray products in the products delivered to customers, or the qualified rate of spray products produced by overly strict production is too low. In either case, it will have a serious impact on the company's economic benefits and reputation. Summary of the invention

[0004] The embodiments of the present invention provide a method, device, equipment and storage medium for detecting spray defects, so as to solve the problem of judging whether a spray-painted product is qualified, thereby improving the detection capability of the spray-painted product.

[0005] In a first aspect, an embodiment of the present invention provides a method for detecting spray defects, which includes:

[0006] Acquire a spraying inspection grayscale image, and identify a target inspection area matching a target spraying product in the spraying inspection grayscale image, wherein the target spraying product is obtained after the outer surface is sprayed with a single color;

[0007] Calculate at least one spray state description parameter matching the target spray product according to at least one of the spray color, the shape of the target detection area, and the pixel value of each pixel point in the target detection area;

[0008] Calculating a defect quantification index matching the target spray product according to each of the spray state description parameters;

[0009] If it is determined that the defect quantification index is greater than or equal to the preset threshold value, the target spray-painted product is determined to be an unqualified spray-painted product, and the defect type corresponding to the target spray-painted product is determined.

[0010] Furthermore, the method of acquiring a spray detection grayscale image and identifying a target detection area that matches a target spray product in the spray detection grayscale image includes: acquiring an original captured image obtained after photographing the target spray product, and binarizing the original captured image to obtain the spray detection grayscale image; identifying closed areas in the spray detection grayscale image through edge detection technology, and determining the identified closed areas as the target detection areas.

[0011] Furthermore, the spraying state description parameters matching the target spraying product are calculated according to the spraying color and the pixel value of each pixel point in the target detection area, including: forming a regional pixel matrix according to the pixel value of each pixel point in the target detection area; and forming multiple edge feature matrices according to the regional pixel matrix and multiple preset convolution kernels; wherein different convolution kernels are used to extract edge features at different positions in the target detection area; quantizing the matrix elements in each edge feature matrix according to the edge extraction threshold determined by the spraying color; and forming a cumulative value of the matrix elements corresponding to each edge feature matrix according to the quantization result as the spraying state description parameter.

[0012] Furthermore, the spraying status description parameters that match the target spray product are calculated based on the spraying color and the pixel value of each pixel point in the target detection area, including: calculating the brightness value of the target detection area as the spraying status description parameter based on the brightness threshold determined by the spraying color and the pixel value of each pixel point in the target detection area.

[0013] Furthermore, the calculation of spraying state description parameters matching the target spray product according to the morphology of the target detection area includes: calculating the circumference and area corresponding to the target detection area according to the morphology of the target detection area; and dividing the circumference by the area as the ratio of the spraying state description parameters.

[0014] Furthermore, the method of calculating at least one spraying state description parameter that matches the target spray product based on the pixel value of each pixel point in the target detection area includes: obtaining a standard spraying pattern that matches the target spraying product; calculating the pixel difference value between the pixel value of each pixel point in the target detection area and the pixel value of each pixel point in the standard spraying pattern; and using the pixel difference value as the spraying state description parameter.

[0015] Furthermore, determining the defect type corresponding to the target spray-painted product includes: inputting the target detection area into a pre-trained defect classification model to obtain the defect type output by the defect classification model; wherein the defect types include: wire drawing, burrs, bottom leakage, heavy oil, deformation or skewness.

[0016] In a second aspect, an embodiment of the present invention further provides a spray defect detection device, the spray defect detection device comprising:

[0017] A target detection area recognition module is used to obtain a spray detection grayscale image and identify a target detection area matching a target spray product in the spray detection grayscale image, wherein the target spray product is obtained after the outer surface is sprayed with a single color;

[0018] A spray state description parameter calculation module, used to calculate at least one spray state description parameter matching the target spray product according to at least one of the spray color, the shape of the target detection area and the pixel value of each pixel point in the target detection area;

[0019] A defect quantification index calculation module, used to calculate a defect quantification index matching the target spray product according to each of the spray state description parameters;

[0020] The defect type determination module is used to determine that the target spray-painted product is an unqualified spray-painted product if it is determined that the defect quantification index is greater than or equal to a preset threshold value, and to determine the defect type corresponding to the target spray-painted product.

[0021] In a third aspect, an embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for detecting spray defects as described in any embodiment of the present invention is implemented.

[0022] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method for detecting spraying defects as described in any embodiment of the present invention is implemented.

[0023] The technical solution provided by the embodiment of the present invention obtains a spray detection grayscale image, and identifies a target detection area that matches the target spray product in the spray detection grayscale image; calculates at least one spray state description parameter that matches the target spray product according to at least one of the spray color, the shape of the target detection area, and the pixel value of each pixel point in the target detection area; calculates a defect quantification index that matches the target spray product according to each of the spray state description parameters; if it is determined that the defect quantification index is greater than or equal to a preset threshold value, the target spray product is determined to be an unqualified spray product, and the defect type corresponding to the target spray product is determined. The embodiment of the present invention, through the above method, solves the problem of judging whether a spray product is qualified, realizes the improvement of the detection capability of the spray product, and classifies the defect types of unqualified spray products. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 A flow chart of a method for detecting spray defects provided in Embodiment 1 of the present invention;

[0025] Figure 2 A flow chart of another method for detecting spray defects provided in Embodiment 2 of the present invention;

[0026] Figure 3 It is a structural schematic diagram of a spraying defect detection device provided in Embodiment 3 of the present invention;

[0027] Figure 4 It is a structural diagram of a computer device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION

[0028] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention.

[0029] It should also be noted that, for ease of description, only the part relevant to the present invention but not all content is shown in the accompanying drawings. It should be mentioned before discussing exemplary embodiments in more detail that some exemplary embodiments are described as processing or methods depicted as flow charts. Although the flow chart describes each operation (or step) as sequential processing, many operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. When its operation is completed, the processing can be terminated, but it can also have additional steps not included in the accompanying drawings. The processing can correspond to methods, functions, procedures, subroutines, subprograms, etc.

[0030] The terms "first" and "second" and the like in the description, claims and drawings of the embodiments of the present invention are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may include steps or units that are not listed.

[0031] Embodiment 1

[0032] Figure 1 A flow chart of a method for detecting spray defects provided in Embodiment 1 of the present invention. This embodiment can be applied to the situation where after the outer surface of a product is sprayed to obtain a sprayed product, the spray effect of the sprayed product is detected to be qualified. The method of this embodiment can be executed by a spray defect detection device, which can be implemented by software and / or hardware, and the device can be configured in a server or terminal device.

[0033] Accordingly, the method specifically comprises the following steps:

[0034] S110, obtaining a spraying detection grayscale image, and identifying a target detection area matching a target spraying product in the spraying detection grayscale image.

[0035] Among them, the target spray product is obtained by spraying the outer surface with a single color.

[0036] The spraying detection grayscale image may be an original image (generally a color image) obtained by photographing the target spraying product, and a grayscale image obtained by binarizing the original image. The spraying product may be a vehicle, aerospace device, furniture manufacturing, etc. The target detection area may be the area where the target spraying product is located in the spraying detection grayscale image.

[0037] Optionally, acquiring a spray detection grayscale image and identifying a target detection area that matches a target spray product in the spray detection grayscale image may include: acquiring an original captured image obtained after photographing the target spray product, and binarizing the original captured image to obtain the spray detection grayscale image; identifying closed areas in the spray detection grayscale image through edge detection technology, and determining the identified closed areas as the target detection area.

[0038] Among them, the original captured image can be a color image obtained by photographing the target spray product using an electronic shooting device such as a camera and a mobile phone. Binarization processing can be to set the grayscale value of the point on the image to 0 or 255, that is, to present the entire image with an obvious black and white effect, that is, to obtain a binary image that can still reflect the overall and local features of the image by selecting the grayscale image of 256 brightness levels through an appropriate threshold. Edge detection technology can be a basic problem in image processing and computer vision. The purpose of edge detection is to identify points in digital images with obvious brightness changes. Significant changes in image attributes usually reflect important events and changes in attributes. The closed area can be a target detection area that finds a target spray product matching in the spray detection grayscale image through edge detection technology.

[0039] For example, suppose a car needs to be sprayed with red on its surface. After the car is sprayed, the effect of the spraying needs to be detected. First, the car needs to be photographed to obtain the original photographed image of the car. Further, the original photographed image needs to be binarized to obtain a spraying detection grayscale image of the original photographed image of the car. Since the original photographed image of the car is taken, it cannot be completely avoided to not shoot other environments or things. Therefore, the closed area is identified in the spraying detection grayscale image by edge detection technology, and the identified closed area is determined as the target detection area, that is, the spraying detection grayscale image of the car that needs to be detected.

[0040] In this embodiment, the target spray product is first photographed to obtain the original photographed image. Specifically, the target spray product is obtained after the outer surface is sprayed with a single color. Further, the original photographed image is binarized to obtain a spray detection grayscale image. Accordingly, the closed area is identified in the spray detection grayscale image by using edge detection technology, and the identified closed area is determined as the target detection area.

[0041] The advantage of this setting is that by binarizing the original captured image, a spray detection grayscale image is obtained. Further, the closed area is identified in the spray detection grayscale image through edge detection technology and determined as the target detection area. In this way, the target spray product area in the original captured image can be directly located, so that the target spray product can be better detected.

[0042] S120. Calculate at least one spraying state description parameter that matches the target spraying product according to at least one of the spraying color, the shape of the target detection area, and the pixel value of each pixel point in the target detection area.

[0043] The shape of the target detection area may be a description of the shape of the target detection area of ​​the target sprayed product in the captured image after the target sprayed product is captured, and may include parameter descriptions such as the perimeter of the target detection area and the area of ​​the target detection area.

[0044] Among them, the spraying state description parameter can be a description of the spraying situation of the target spraying product, which can be calculated by the pixel value of each pixel point in the target detection area, the spraying color of the target spraying product and the shape of the target detection area.

[0045] Specifically, the spraying status description parameter can be at least one item of image edge feature information corresponding to the target detection area, or image brightness description information of the target detection area, or the ratio of the circumference and area of ​​the target detection area, etc., which can reflect the spraying effect to a certain extent. This embodiment does not limit this.

[0046] In a specific example, if the whole single-color spraying is performed and the spraying is uniform enough, the pixel values ​​of each pixel in the target detection area should not be very different, and should all be white dots or all black dots. Whether it is white dots or black dots depends on the actual spraying color. Based on this, after determining the brightness value of the target detection area, by combining the spraying color, the number of pixels with poor spraying effect can be determined, and then the image brightness description information can be used as a spraying state description parameter.

[0047] S130, calculating a defect quantification index matching the target spray product according to each of the spray state description parameters.

[0048] The defect quantification index may be a value calculated by weighted summation of multiple spray state description parameters, and the defect quantification index may be used to reflect whether the target spray product is qualified.

[0049] Continuing from the previous example, the spraying state description parameters matching the target spraying product are calculated. Specifically, the spraying state description parameters are F 1 、F 2 、F 3 、F 4 and F 5 , and the spraying state description parameter F 1 The corresponding weighted value α 1 , spraying state description parameter F 2 The corresponding weighted value α 2 , spraying state description parameter F 3 The corresponding weighted value α 3 , spraying state description parameter F 4 The corresponding weighted value α 4 and spraying state description parameter F5 The corresponding weighted value α 5 Then the value of the defect quantification index can be calculated. Specifically, the defect quantification index can be calculated according to the following formula:

[0050] F=α 1 F 1 +α 2 F 2 +α 3 F 3 +α 4 F 4 +α 5 F 5

[0051] Furthermore, the value corresponding to the defect quantification index F can be used.

[0052] S140: If it is determined that the defect quantification index is greater than or equal to a preset threshold value, the target spray-painted product is determined to be an unqualified spray-painted product, and a defect type corresponding to the target spray-painted product is determined.

[0053] Among them, the defect type can be the defect type that may exist in the target spray product after spraying, which can include drawing, burrs, bottom leakage, heavy oil, deformation or skewness and other defect types.

[0054] Continuing with the previous example, when the defect quantification index F matching the target spray product is calculated based on the spray state description parameters, it is necessary to determine whether the defect quantification index F is greater than or equal to the preset threshold value. If the defect quantification index F is greater than or equal to the preset threshold value, the target spray product is an unqualified spray product; if the defect quantification index F is less than the preset threshold value, the target spray product is a qualified spray product. And the unqualified target spray product is classified into defect types.

[0055] Optionally, determining the defect type corresponding to the target spray product includes: inputting the target detection area into a pre-trained defect classification model, and obtaining the defect type output by the defect classification model; wherein the defect types include: wire drawing, burrs, bottom leakage, heavy oil, deformation or skewness.

[0056] The defect classification model may be a model that can classify the target detection area corresponding to the unqualified target spray-painted product. Specifically, the defect types output by the defect classification model may include wire drawing, burrs, bottom leakage, heavy oil, deformation or skewness.

[0057] The advantage of this setting is that by inputting the target detection area into the pre-trained defect classification model, the defect type output by the defect classification model can be obtained. Therefore, it can be further reflected to the staff according to the defect type, so that unqualified spray products can be processed in time.

[0058] The technical solution provided by the embodiment of the present invention obtains a spray detection grayscale image, and identifies a target detection area that matches the target spray product in the spray detection grayscale image; calculates at least one spray state description parameter that matches the target spray product according to at least one of the spray color, the shape of the target detection area, and the pixel value of each pixel point in the target detection area; calculates a defect quantification index that matches the target spray product according to each of the spray state description parameters; if it is determined that the defect quantification index is greater than or equal to a preset threshold value, the target spray product is determined to be an unqualified spray product, and the defect type corresponding to the target spray product is determined. The embodiment of the present invention, through the above method, solves the problem of judging whether a spray product is qualified, realizes the improvement of the detection capability of the spray product, and classifies the defect types of unqualified spray products.

[0059] Embodiment 2

[0060] Figure 2 A flow chart of another method for detecting spray defects provided in Example 1 of the present invention. This embodiment is refined based on the above embodiments. In this embodiment, at least one spray state description parameter that matches the target spray product is calculated based on at least one of the spray color, the shape of the target detection area, and the pixel value of each pixel point in the target detection area, and is further refined.

[0061] Accordingly, the method specifically comprises the following steps:

[0062] S210, obtaining a spraying detection grayscale image, and identifying a target detection area matching the target spraying product in the spraying detection grayscale image.

[0063] S220. Calculate at least one spraying state description parameter that matches the target spraying product according to at least one of the spraying color, the shape of the target detection area, and the pixel value of each pixel point in the target detection area.

[0064] Specifically, S2201-S2203, S2211, S2221-S2222 and S2231-S2233 respectively describe the calculation of four types of spray state description parameters. In practical applications, one, multiple or all of the above four types of spray state description parameters can be calculated, and based on the calculation results, the defect quantification index matching the target spray product can be calculated.

[0065] S2201, forming a regional pixel matrix according to the pixel value of each pixel point in the target detection area; and forming multiple edge feature matrices according to the regional pixel matrix and multiple preset convolution kernels;

[0066] Wherein, different convolution kernels are used to extract edge features at different positions within the target detection area;

[0067] Among them, different pixel points correspond to different two-dimensional image coordinates, and a regional pixel matrix can be formed by establishing a mapping between the two-dimensional image coordinates and the matrix row and column positions. The regional pixel matrix can be a matrix composed of pixel values ​​of each pixel point in the target detection area to represent the target detection area. The preset multiple convolution kernels can be used to extract different features of the target detection area according to different convolution kernels. An edge feature matrix can be obtained by convolution based on the regional pixel matrix and a convolution kernel, and is used to describe an edge feature set obtained after processing by the convolution kernel.

[0068] Specifically, the above calculation formula is as follows: Among them, I is the spray detection grayscale image that identifies the target detection area; I(x, y) is the pixel value corresponding to the pixel point at the x, y position in the target detection area; K is the convolution kernel, K(a, b) is the corresponding value in the convolution kernel; A and B are the length and width of the convolution kernel; X and Y are the sizes of the spray detection grayscale image that identifies the target detection area; G is the sum of all features after convolution kernel processing.

[0069] Specifically, convolution is performed based on the pixel value I(x,y) corresponding to the pixel point at the x,y position in the target detection area and the corresponding value K(a,b) in the convolution kernel, and the edge feature value corresponding to the x,y position in the edge feature matrix is ​​solved as G(x,y). All edge feature values ​​in the target detection area are added together to obtain the sum G of all features after the corresponding convolution kernel processing. In the above formula, different convolution kernels can be selected for convolution to extract different image features.

[0070] For example, assume that the convolution kernels are K 1 , K 2 , K 3 and K 4 , using the above convolution formula, we can get the corresponding G 1 , G 2 , G 3 and G 4 .

[0071] S2202: quantize the matrix elements in each edge feature matrix according to the edge extraction threshold determined by the spray color.

[0072] The edge extraction threshold may be a threshold set when determining black and white for matrix elements in the edge feature matrix, and may further perform quantization processing on the matrix elements in each edge feature matrix.

[0073] When the selected spray color is darker, but the color of the target spray product is lighter than the spray color, the larger the selected threshold is, that is, when it is greater than the edge extraction threshold, the quantization value F is 1, which is judged as white; otherwise, the quantization value F is 0, which is judged as black. Therefore, the spray state description parameters are calculated based on the quantization value obtained by the quantization process.

[0074] Furthermore, when the selected spray color is lighter, but the color of the target spray product is darker than the spray color, the smaller the selected threshold is, that is, when it is greater than the edge extraction threshold, the quantization value F is 0, which is judged as black; otherwise, the quantization value F is 1, which is judged as white. Thus, the spray state description parameters are calculated based on the quantization value obtained by the quantization process.

[0075] Specifically, when the selected spray color is darker, but the color of the target spray product is lighter than the spray color, quantification can be performed according to the following formula:

[0076]

[0077] When the matrix element in the edge feature matrix is ​​greater than the edge extraction threshold 127, the quantization value F is 1, that is, it is judged as white. When the matrix element in the edge feature matrix is ​​less than or equal to the edge extraction threshold, the quantization value F is 0, that is, it is judged as black.

[0078] For example, assuming that the edge feature matrix The edge extraction threshold is set to 127. Specifically, when the matrix element in the edge feature matrix is ​​greater than the edge extraction threshold, the quantization value F is 1, that is, it is judged as white. When the matrix element in the edge feature matrix is ​​less than or equal to the edge extraction threshold, the quantization value F is 0, that is, it is judged as black. Further, according to the quantization process, the edge feature matrix

[0079] Furthermore, when the selected spray color is lighter, but the color of the target spray product is darker than the spray color, quantification can be performed according to the following formula:

[0080]

[0081] When the matrix element in the edge feature matrix is ​​greater than the edge extraction threshold 127, the quantization value F is 0, that is, it is judged as black. When the matrix element in the edge feature matrix is ​​less than or equal to the edge extraction threshold, the quantization value F is 1, that is, it is judged as white.

[0082] For example, assuming that the edge feature matrix The edge extraction threshold is set to 127. Specifically, when the matrix element in the edge feature matrix is ​​greater than the edge extraction threshold, the quantization value F is 0, that is, it is judged as black. When the matrix element in the edge feature matrix is ​​less than or equal to the edge extraction threshold, the quantization value F is 1, that is, it is judged as white. Further, according to the quantization process, the edge feature matrix

[0083] S2203. According to the quantization processing result, a matrix element cumulative value corresponding to each edge feature matrix is ​​formed as the spraying state description parameter.

[0084] Continuing from the previous example, after calculating the edge feature matrix After that, the quantization processing result is obtained, and further, the accumulated value of the matrix elements corresponding to each edge feature matrix is ​​calculated as the spraying state description parameter. 1 =3. Similarly, the corresponding F can be calculated 2 、F 3 and F 4 Furthermore, since the selected spray color is darker, the color of the target spray product is lighter than the spray color. 1 、F 2 、F 3 and F 4 The larger the quantitative value of is, the more quantitative values ​​judged as white are. This means that the probability of the target sprayed product being unqualified after spraying is greater. Specifically, the defect type corresponding to the target sprayed product may include bottom leakage, etc.

[0085] Similarly, when calculating the edge feature matrix After that, the quantization processing result is obtained, and further, the accumulated value of the matrix elements corresponding to each edge feature matrix is ​​calculated as the spraying state description parameter. 1 =6. Similarly, the corresponding F can be calculated 2 、F 3 and F 4 Furthermore, since the selected spray color is lighter, the color of the target spray product is darker than the spray color. 1 、F 2 、F 3 and F 4 The larger the quantitative value of is, the more quantitative values ​​are judged as black. This means that the probability of the target sprayed product being unqualified after spraying is greater. Specifically, the defect type corresponding to the target sprayed product may include bottom leakage, etc.

[0086] S2211. According to the brightness threshold value determined by the spraying color and the pixel value of each pixel point in the target detection area, the brightness value of the target detection area is calculated as the spraying state description parameter.

[0087] The brightness threshold may be a threshold set for the brightness value of the target detection area.

[0088] Specifically, when the brightness value of the target detection area is greater than the brightness threshold, it is necessary to accumulate the pixel values ​​of each pixel in the corresponding target detection area to calculate the spray state description parameter. Exemplarily, when the selected spray color is darker and the color of the target spray product is lighter than the spray color, it can be determined that the brightness of the spray color is lower, but the brightness of the color of the target spray product is higher. Furthermore, the brightness threshold determined by the spray color will be larger. According to the formula F=sum[I(x,y)>190], the larger the calculated spray state description parameter F value, the greater the probability that the target spray product after spraying will be unqualified. Conversely, the smaller the calculated spray state description parameter F value, the smaller the probability that the target spray product after spraying will be unqualified.

[0089] Similarly, when the selected spray color is lighter and the color of the target spray product is darker than the spray color, it can be determined that the brightness of the spray color is higher, but the brightness of the color of the target spray product is lighter. Furthermore, the brightness threshold determined by the spray color will be smaller. Thus, the spray state description parameter F can be calculated to further determine the pass rate of the spray of the target spray product.

[0090] S2221. Calculate the perimeter and area corresponding to the target detection area according to the shape of the target detection area.

[0091] S2222. Divide the perimeter by the area to obtain a ratio as the spraying state description parameter.

[0092] The area corresponding to the target detection region may be calculated based on the shape of the target detection region. Specifically, the area may be calculated using the pixel value of each pixel point within the target detection region.

[0093] For example, the spraying state description parameters can be calculated according to the shape of the target detection area. When the calculated F 6The larger the value, the longer the perimeter of the target detection area is relative to the area of ​​the target detection area, which is unreasonable. It can be said that the probability of the target sprayed product being unqualified after spraying is greater. Specifically, the defect types corresponding to the target sprayed product may include burrs or deformation. On the contrary, it means that the probability of the target sprayed product being unqualified after spraying is smaller.

[0094] S2231. Obtain a standard spray pattern that matches the target spray product.

[0095] The standard spraying pattern may be a spraying template pattern corresponding to the target spraying product.

[0096] S2232, calculating the pixel difference value between the pixel value of each pixel point in the target detection area and the pixel value of each pixel point in the standard spray pattern.

[0097] The pixel difference value may be a difference between the pixel value of each pixel point in the target detection area and the pixel value of each pixel point in the standard spray pattern, to obtain the pixel difference value.

[0098] S2233. Use the pixel difference value as the spraying state description parameter.

[0099] Specifically, the spraying state description parameter F can be further calculated according to the pixel difference value. 7 When the calculated F 7 The larger the value is, the greater the pixel difference between the pixel value of each pixel point in the target detection area and the pixel value of each pixel point in the standard spray pattern is, which further indicates that the probability of the target spray product being unqualified after spraying is greater. 7 The smaller it is, the smaller the pixel difference between the pixel value of each pixel point in the target detection area and the pixel value of each pixel point in the standard spray pattern is, which further indicates that the probability of the target spray product being unqualified after spraying is smaller.

[0100] Furthermore, the spraying state description parameter F 7 It can mainly reflect whether there is a large area of ​​missing between the image of the target spray product after spraying and the standard spray pattern. 7 Compared with other spraying state description parameters, F 7 The corresponding weighted value is larger and accounts for a higher proportion.

[0101] S230: Calculate a defect quantification index matching the target spray product according to each of the spray state description parameters.

[0102] S240: Determine whether the defect quantization index is greater than or equal to a preset threshold value. If yes, execute S250; if not, execute S260.

[0103] S250: Determine that the target spray-painted product is an unqualified spray-painted product, and determine a defect type corresponding to the target spray-painted product.

[0104] S260: Determine that the target spray-painted product is a qualified spray-painted product.

[0105] Continuing from the previous example, the calculated spraying state description parameter F 1 、F 2 、F 3 、F 4 、F 5 、F 6 and F 7 Different weights are assigned to different spraying state description parameters, so we can set F 1 、F 2 、F 3 、F 4 、F 5 、F 6 and F 7 The corresponding weight values ​​are α 1 , α 2 , α 3 , α 4 , α 5 , α 6 and α 7 , the defect quantification index matching the target spraying product can be calculated according to the following formula:

[0106] F=α 1 (F 1 -β 1 )+α 2 (F 2 -β 1 )+α 3 (F 3 -β 1 )+α 4 (F 4 -β 1 )+α 5 (F 5 -β 2 )+α 6 F 6 +α 7 F 7

[0107] Furthermore, it is possible to judge whether the target spraying product is qualified.

[0108] The technical solution provided by the embodiment of the present invention obtains a spray detection grayscale image, and identifies a target detection area matching the target spray product in the spray detection grayscale image; calculates at least one spray state description parameter matching the target spray product according to at least one of the spray color, the shape of the target detection area, and the pixel value of each pixel in the target detection area; calculates a defect quantification index matching the target spray product according to each of the spray state description parameters; if it is determined that the defect quantification index is greater than or equal to a preset threshold value, the target spray product is determined to be an unqualified spray product, and the defect type corresponding to the target spray product is determined. In the embodiment of the present invention, the spray state description parameters are calculated by the above method through various factors, so that the calculated spray state description parameters are more accurate. Further, the defect quantification index is calculated according to the spray state description parameters, so as to judge whether the target spray product is qualified, thereby realizing the improvement of the detection capability of the spray product, and the defect types of unqualified spray products can be classified, and better feedback is given to the staff for processing.

[0109] Embodiment 3

[0110] Figure 3 : is a schematic diagram of the structure of a spray defect detection device provided in the third embodiment of the present invention. The spray defect detection device provided in this embodiment can be implemented by software and / or hardware, and can be configured in a server or terminal device to implement a spray defect detection method in the embodiment of the present invention. Figure 3 As shown, the device may specifically include: a target detection area recognition module 310, a spraying state description parameter calculation module 320, a defect quantification index calculation module 330 and a defect type determination module 340.

[0111] The target detection area identification module 310 is used to obtain a spray detection grayscale image and identify a target detection area matching a target spray product in the spray detection grayscale image, wherein the target spray product is obtained after the outer surface is sprayed with a single color;

[0112] A spray state description parameter calculation module 320, for calculating at least one spray state description parameter matching a target spray product according to at least one of the spray color, the shape of the target detection area, and the pixel value of each pixel point in the target detection area;

[0113] A defect quantification index calculation module 330, for calculating a defect quantification index matching the target spray product according to each of the spray state description parameters;

[0114] The defect type determination module 340 is used to determine that the target spray-painted product is an unqualified spray-painted product if it is determined that the defect quantification index is greater than or equal to a preset threshold value, and to determine the defect type corresponding to the target spray-painted product.

[0115] The technical solution provided by the embodiment of the present invention obtains a spray detection grayscale image, and identifies a target detection area that matches the target spray product in the spray detection grayscale image; calculates at least one spray state description parameter that matches the target spray product according to at least one of the spray color, the shape of the target detection area, and the pixel value of each pixel point in the target detection area; calculates a defect quantification index that matches the target spray product according to each of the spray state description parameters; if it is determined that the defect quantification index is greater than or equal to a preset threshold value, the target spray product is determined to be an unqualified spray product, and the defect type corresponding to the target spray product is determined. The embodiment of the present invention, through the above method, solves the problem of judging whether a spray product is qualified, realizes the improvement of the detection capability of the spray product, and classifies the defect types of unqualified spray products.

[0116] Based on the above embodiments, the target detection area identification module 310 can be specifically used to: obtain the original captured image obtained after shooting the target spray product, and binarize the original captured image to obtain the spray detection grayscale image; identify the closed area in the spray detection grayscale image through edge detection technology, and determine the identified closed area as the target detection area.

[0117] On the basis of the above-mentioned embodiments, the spray state description parameter calculation module 320 can be specifically used to: form a regional pixel matrix according to the pixel value of each pixel point in the target detection area; and form multiple edge feature matrices according to the regional pixel matrix and multiple preset convolution kernels; wherein different convolution kernels are used to extract edge features at different positions in the target detection area; according to the edge extraction threshold determined by the spray color, the matrix elements in each edge feature matrix are quantized; according to the quantization processing result, the accumulated value of the matrix elements corresponding to each edge feature matrix is ​​formed as the spray state description parameter.

[0118] Based on the above embodiments, the spray state description parameter calculation module 320 can be specifically used to: calculate the brightness value of the target detection area as the spray state description parameter based on the brightness threshold determined by the spray color and the pixel value of each pixel point in the target detection area.

[0119] Based on the above embodiments, the spray state description parameter calculation module 320 can be specifically used to: calculate the perimeter and area corresponding to the target detection area according to the shape of the target detection area; and divide the perimeter by the area as the spray state description parameter.

[0120] Based on the above embodiments, the spray state description parameter calculation module 320 can be specifically used to: obtain a standard spray pattern that matches the target spray product; calculate the pixel value of each pixel point in the target detection area and the pixel difference value between the pixel value of each pixel point in the standard spray pattern; and use the pixel difference value as the spray state description parameter.

[0121] Based on the above embodiments, the defect type determination module 340 can be specifically used to: input the target detection area into a pre-trained defect classification model to obtain the defect type output by the defect classification model; wherein the defect type includes: wire drawing, burrs, bottom leakage, heavy oil, deformation or skewness.

[0122] The above-mentioned spray defect detection device can execute the spray defect detection method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0123] Embodiment 4

[0124] Figure 4 is a structural diagram of a computer device provided by Embodiment 4 of the present invention. Figure 4 As shown, the device includes a processor 410, a memory 420, an input device 430, and an output device 440; the number of processors 410 in the device can be one or more. Figure 4 A processor 410 is taken as an example; the processor 410, memory 420, input device 430 and output device 440 in the device can be connected via a bus or other means. Figure 4 The example of connecting through bus is taken in the following.

[0125] The memory 420, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the method for detecting spray defects in an embodiment of the present invention (for example, a target detection area identification module 310, a spray state description parameter calculation module 320, a defect quantification index calculation module 330 and a defect type determination module 340). The processor 410 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 420, that is, implements the above-mentioned spray defect detection method, which includes: obtaining a spray detection grayscale image, and identifying a target detection area matching the target spray product in the spray detection grayscale image; calculating at least one spray state description parameter matching the target spray product according to at least one of the spray color, the shape of the target detection area and the pixel value of each pixel point in the target detection area; calculating a defect quantification index matching the target spray product according to each of the spray state description parameters; if it is determined that the defect quantification index is greater than or equal to a preset threshold value, the target spray product is determined to be an unqualified spray product, and the defect type corresponding to the target spray product is determined.

[0126] The memory 420 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 420 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 420 may further include a memory remotely arranged relative to the processor 410, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0127] The input device 430 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the device. The output device 440 may include a display device such as a display screen.

[0128] Embodiment 5

[0129] Embodiment 5 of the present invention also provides a computer-readable storage medium, wherein the computer-executable instructions are used to execute a method for detecting spray defects when executed by a computer processor, the method comprising: obtaining a spray detection grayscale image, and identifying a target detection area that matches a target spray product in the spray detection grayscale image; calculating at least one spray state description parameter that matches the target spray product based on at least one of the spray color, the shape of the target detection area, and the pixel value of each pixel point in the target detection area; calculating a defect quantification index that matches the target spray product based on each of the spray state description parameters; if it is determined that the defect quantification index is greater than or equal to a preset threshold value, determining that the target spray product is an unqualified spray product, and determining the defect type corresponding to the target spray product.

[0130] Of course, the computer-readable storage medium provided in the embodiment of the present invention has computer-executable instructions that are not limited to the method operations described above, and can also execute related operations in the spraying defect detection method provided in any embodiment of the present invention.

[0131] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, a read-only memory (ROM), a random access memory (RAM), a flash memory (FLASH), a hard disk or an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0132] It is worth noting that in the embodiment of the above-mentioned spray defect detection device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0133] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A method for detecting spray defects, characterized in that: include: Acquire a spraying inspection grayscale image, and identify a target inspection area matching a target spraying product in the spraying inspection grayscale image, wherein the target spraying product is obtained after the outer surface is sprayed with a single color; According to the pixel value of each pixel point in the target detection area, a regional pixel matrix is ​​formed; and according to the regional pixel matrix and a plurality of preset convolution kernels, a plurality of edge feature matrices are formed; Wherein, different convolution kernels are used to extract edge features at different positions within the target detection area; According to the edge extraction threshold determined by the spray color, the matrix elements in each edge feature matrix are quantized; According to the quantization processing result, the accumulated values ​​of the matrix elements corresponding to each edge feature matrix are formed as the spraying state description parameters; According to the brightness threshold value determined by the spraying color and the pixel value of each pixel point in the target detection area, the brightness value of the target detection area is calculated as a spraying state description parameter; Calculating the perimeter and area corresponding to the target detection area according to the shape of the target detection area; The ratio of the perimeter divided by the area is used as a spraying state description parameter; Acquire a standard spray pattern matching the target spray product; Calculating the pixel difference between the pixel value of each pixel point in the target detection area and the pixel value of each pixel point in the standard spray pattern; Using the pixel difference value as a spraying state description parameter; Calculating a defect quantification index matching the target spray product according to each of the spray state description parameters; If it is determined that the defect quantification index is greater than or equal to the preset threshold value, the target spray-painted product is determined to be an unqualified spray-painted product, and the defect type corresponding to the target spray-painted product is determined.

2. The method according to claim 1, characterized in that The step of acquiring a spraying detection grayscale image and identifying a target detection area matching a target spraying product in the spraying detection grayscale image includes: Acquire an original photographed image obtained after photographing the target spray-painted product, and perform binarization processing on the original photographed image to obtain the spray-painted inspection grayscale image; The closed area is identified in the spray detection grayscale image by edge detection technology, and the identified closed area is determined as the target detection area.

3. The method according to claim 1, characterized in that The determining of the defect type corresponding to the target spray-painted product includes: Inputting the target detection area into a pre-trained defect classification model to obtain the defect type output by the defect classification model; The defect types include: wire drawing, burrs, bottom leakage, heavy oil, deformation or skewness.

4. A spray defect detection device, characterized in that: include: A target detection area recognition module is used to obtain a spray detection grayscale image and identify a target detection area matching a target spray product in the spray detection grayscale image, wherein the target spray product is obtained after the outer surface is sprayed with a single color; A spraying state description parameter calculation module is used to form a regional pixel matrix according to the pixel value of each pixel point in the target detection area; and to form multiple edge feature matrices according to the regional pixel matrix and multiple preset convolution kernels; Wherein, different convolution kernels are used to extract edge features at different positions within the target detection area; According to the edge extraction threshold determined by the spray color, the matrix elements in each edge feature matrix are quantized; According to the quantization processing result, the accumulated values ​​of the matrix elements corresponding to each edge feature matrix are formed as the spraying state description parameters; According to the brightness threshold value determined by the spraying color and the pixel value of each pixel point in the target detection area, the brightness value of the target detection area is calculated as a spraying state description parameter; Calculating the perimeter and area corresponding to the target detection area according to the shape of the target detection area; The ratio of the perimeter divided by the area is used as a spraying state description parameter; Acquire a standard spray pattern matching the target spray product; Calculating the pixel difference between the pixel value of each pixel point in the target detection area and the pixel value of each pixel point in the standard spray pattern; Using the pixel difference value as a spraying state description parameter; A defect quantification index calculation module, used to calculate a defect quantification index matching the target spray product according to each of the spray state description parameters; The defect type determination module is used to determine that the target spray-painted product is an unqualified spray-painted product if it is determined that the defect quantification index is greater than or equal to a preset threshold value, and to determine the defect type corresponding to the target spray-painted product.

5. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for detecting spraying defects according to any one of claims 1 to 3 is implemented.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for detecting spraying defects as described in any one of claims 1 to 3 is implemented.

Citation Information

Patent Citations

  • Joint feature-based defect detection method and device, equipment and storage medium

    CN110751623A

  • Visual inspection method for surface defects of paint spraying panel

    CN112991305A