Spraying detection method, device and storage medium

Through image acquisition and grid processing of spray points, independent detection of each spray point is achieved, and the efficiency and accuracy of spray defect monitoring in the prior art is solved, and the detection efficiency and accuracy are significantly improved.

CN119738413APending Publication Date: 2025-04-01苏州凌云光工业智能技术有限公司
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202510035629.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-09
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

The prior art is difficult to achieve accurate and timely monitoring of spray defects caused by equipment aging and wear, insufficient debugging accuracy, and changes in ambient temperature and humidity, resulting in a decrease in production efficiency and yield.

Method used

By collecting images of spray points that present a distributed arrangement in the array, rasterizing the process, and each spray point is arranged in an independent image grid area, rapid detection of spray defects is achieved.

Benefits of technology

It significantly shortens the detection time, improves the detection efficiency, can accurately locate defects at a single spray point, reduces misjudgment and misjudgment, and is suitable for large-scale and high-density array spray point detection scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119738413A_ABST
    Figure CN119738413A_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a spraying detection method, device and storage medium. The method includes: determining an image to be detected, the image to be detected is a grayscale image obtained by image acquisition for each spraying point that presents a distributed array arrangement; rasterizing the image to be detected to obtain at least two image grid areas, so that each spraying point in the image to be detected is correspondingly configured in an independent image grid area; based on at least two image grid areas, each spraying point in the image to be detected is subjected to spraying defect detection. The present application scheme can realize rapid defect detection of spraying points that present a distributed matrix arrangement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of image detection technology, and in particular to a spraying detection method, device and storage medium. Background Art

[0002] In today's industrial production field, especially in the manufacturing of various products involving spraying processes, the spraying process plays a vital role in product quality; taking the production of lithium battery diaphragms as an example, the quality control in the spraying process is directly related to the yield rate of diaphragm manufacturers and the performance of the final product. However, in the current spraying production practice, there is still a lack of accurate and efficient real-time monitoring technology for spraying defects caused by complex factors such as equipment aging and wear, insufficient debugging accuracy, and changes in environmental temperature and humidity. At this stage, problems are usually discovered by manual sampling, but this method is not only inefficient, but also has obvious lags, and it is impossible to intervene and implement adjustments and optimizations in a timely and rapid manner when defects occur, resulting in a large number of defective products, increased production costs, and reduced production efficiency and yield rates. Summary of the invention

[0003] The present invention provides a spraying detection method, device, electronic equipment and storage medium to realize rapid defect detection of spraying points that are distributed in a matrix.

[0004] In a first aspect, an embodiment of the present invention provides a spraying detection method, the method comprising:

[0005] Determine an image to be detected, where the image to be detected is a grayscale image obtained by collecting images of each spraying point that is distributed in an array;

[0006] Performing rasterization processing on the image to be detected to obtain at least two image raster areas, so that each spray point in the image to be detected is correspondingly configured in an independent image raster area;

[0007] The spraying defect detection is performed on each spraying point in the image to be detected based on at least two image grid areas.

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

[0009] A determination module, used to determine an image to be detected, wherein the image to be detected is a grayscale image obtained by collecting images of each spraying point that is distributed in an array;

[0010] A processing module, used for performing rasterization processing on the image to be detected to obtain at least two image raster areas, so that each spraying point in the image to be detected is correspondingly configured in an independent image raster area;

[0011] The detection module is used to perform spray defect detection on each spray point in the image to be detected based on at least two image grid areas.

[0012] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:

[0013] at least one processor; and

[0014] a memory communicatively connected to the at least one processor; wherein,

[0015] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the spray detection method described in any one of the above embodiments.

[0016] In a fourth aspect, an embodiment of the present invention further provides a computer-readable medium, wherein the computer-readable medium stores computer instructions, and the computer instructions are used to enable a processor to implement any one of the spray detection methods described in the above embodiments when executed.

[0017] The technical solution of the embodiment of the present invention determines an image to be detected, where the image to be detected is a grayscale image obtained by image acquisition for each spraying point that is distributed in an array. By rasterizing the image to be detected, each spraying point in the distributed array corresponds to an independent image grid area. After each spraying point is divided into an independent grid area, it is only necessary to focus on these small-scale grid areas when performing defect detection on the spraying point, without repeatedly traversing and searching the entire image, which greatly reduces the amount of data processing. Compared with the global detection method, the detection time is significantly shortened and the detection efficiency is improved. It is particularly suitable for large-scale and high-density array spraying point detection scenarios; and, each spraying point in the original image to be detected is rasterized into a detection area, each spraying point is accurately locked, and each image grid area is associated with only one spraying point. When performing defect detection on the spraying point, the grayscale features and texture changes around the point can be analyzed more carefully, without being disturbed by the complex background of other spraying points, and adjacent spraying points are prevented from interfering with each other's detection results, so that the defect positioning can be accurate to a single point, thereby reducing misjudgment and missed judgment.

[0018] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The above and other features, advantages and aspects of the embodiments of the present invention will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0020] Figure 1 It is a schematic flow chart of a spraying detection method provided by an embodiment of the present invention;

[0021] Figure 2 It is a schematic diagram of point spraying of circular spraying in a spraying detection process provided by an embodiment of the present invention;

[0022] Figure 3 It is a schematic diagram of point spraying of other types of spraying in a spraying detection process provided by an embodiment of the present invention;

[0023] Figure 4 It is a schematic diagram of grayscale projection integration in a spraying detection process provided by an embodiment of the present invention;

[0024] Figure 5 It is a schematic diagram of a dot spray feature within an image grid area during a spray detection process provided by an embodiment of the present invention;

[0025] Figure 6 is a flow chart of another spraying detection method provided by an embodiment of the present invention;

[0026] Figure 7 It is a flow chart of another spraying detection method provided by an embodiment of the present invention;

[0027] Figure 8 is a structural schematic diagram of a spraying detection device provided by an embodiment of the present invention;

[0028] Fig. 9 It is a structural schematic diagram of an electronic device for implementing a spraying detection method provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0029] Embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments of the present invention are only for exemplary purposes and are not intended to limit the scope of protection of the present invention.

[0030] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.

[0031] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0032] It should be noted that the concepts such as "first" and "second" mentioned in the present invention are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0033] It should be noted that the modifications of "one" and "plurality" mentioned in the present invention are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0034] The names of the messages or information exchanged between multiple devices in the embodiments of the present invention are only used for illustrative purposes, and are not used to limit the scope of these messages or information.

[0035] Figure 1 A flow chart of a spray detection method provided in an embodiment of the present invention is applicable to the case where spray defect detection is performed on each spray point that is distributedly arranged in an array. The spray detection method can be performed by a spray detection device, which can be implemented in the form of software and / or hardware and is generally integrated on any electronic device with network communication function, which can be a mobile terminal, a PC or a server, etc.

[0036] like Figure 1 As shown, the spraying detection method of the embodiment of the present invention may include the following process:

[0037] S110, determining an image to be detected, where the image to be detected is a grayscale image obtained by collecting images of each spraying point that is distributed in an array.

[0038] See also Figure 2Array distributed arrangement describes the layout of spray points in the spraying process, which is distributed in a regular array form, with relatively fixed spacing and row and column relationships between each spray point, similar to a matrix arrangement. For example, the spray points presenting array distributed arrangement may include but are not limited to the following: spray points presented by SPI solder paste, spray points presented by printed circuits, spray points for coating the diaphragm of the positive and negative electrodes of lithium batteries, spray points for spraying solder joints of electronic circuit boards, and spray points generated by dot-matrix spraying of automotive body trims, etc., which present matrix distributed spray points.

[0039] See also Figure 2 When performing defect detection on each spraying point that presents an array distributed arrangement, the corresponding grayscale image will be obtained after image acquisition for each spraying point that presents an array distributed arrangement, and used as the image to be detected. The grayscale image means that the image to be detected is composed of pixels with different grayscale values ​​only, discarding color information and simplifying the amount of data. In the process of defect detection on each spraying point that presents an array distributed arrangement, the focus is mainly on the light and dark contrast characteristics of the spraying point, because in the spraying quality inspection scenario, the grayscale difference can reflect common defects such as missed spraying, uneven thickness and boundary adhesion.

[0040] See also Figure 2 and Figure 3 Optionally, for the spray points arranged in a distributed array, their ideal shape should have a high degree of consistency and regularity. The expected spray shape of each spray point in the distributed array in the present application is a preset shape, and the preset shape may include but is not limited to rectangles, polygons, concentric rectangles, concentric rings and the like. Taking the circular spray point as an example, from a macroscopic perspective, each spray point should be approximately circular to ensure uniform diffusion of the paint in all directions, thereby forming a stable and regular coverage pattern on the array as a whole; from a microscopic perspective, the edges of the spray points should be as smooth as possible to avoid jagged or irregular contours, and to prevent uneven distribution of paint between adjacent spray points or defects such as overlap and vacancies due to edge abnormalities. The diameter tolerance of the circle needs to be controlled within an extremely small range. The specific value is determined according to the precision requirements of the actual spraying process. This is crucial to ensure the uniformity of the coating thickness formed by each spraying point in the array, thereby ensuring that the quality and performance of the entire sprayed surface meet the expected standards. Whether in terms of the flatness and glossiness of the appearance, or in functional properties such as wear resistance and corrosion resistance, these can be effectively guaranteed and optimized through this precisely controlled spray point shape.

[0041] S120, performing rasterization processing on the image to be detected to obtain at least two image grid areas, so that each spraying point in the image to be detected is correspondingly configured in an independent image grid area.

[0042] See also Figure 2, multiple image grid areas are obtained by rasterizing the image to be detected. Rasterization is used to divide the image to be detected into multiple grid areas using crisscross grid lines. These grid areas are image grid areas, and each image grid area has its own independent boundary and coordinate range. At least two image grid areas are used to isolate and present each spray point in the distributed array, so that each spray point is in a dedicated grid area, reducing interference between adjacent spray points and creating conditions for accurate detection.

[0043] See also Figure 2 In an optional example, based on the expected spraying size of each spraying point distributed in the array, the image to be detected can be divided horizontally and vertically according to preset horizontal and vertical intervals, and the image to be detected can be divided into multiple grids to obtain multiple image grid areas, so that the image grid area corresponding to each grid includes a spraying point, ensuring that each spraying point is exactly in an independent image grid area, avoiding cross-grid situations as much as possible, achieving precise positioning and separation of each spraying point, reducing detection complexity, converting global complex image analysis into targeted analysis of multiple small grid areas, reducing data processing volume, and improving the accuracy and speed of subsequent detection.

[0044] See also Figure 2 In a grayscale image, the grayscale value can be used to represent the brightness of each pixel in the image. Usually, the grayscale value ranges from 0 to 255, with a total of 256 levels, where 0 represents black, the darkest color; and 255 represents white, the brightest color. Based on the above situation, for each spray point that is distributed in an array, the grayscale value of each spray point is relatively small, while the grayscale value of the non-spray point area is relatively large. Therefore, the grayscale value of each spray line in the row and column directions will have a regular change trend, and there will be regular light and dark changes visually. Therefore, in an optional example, the light and dark changes in the grayscale value of each row of pixels and the light and dark changes in the grayscale value of each column of pixels can be used to find multiple segmentation points that can divide each spray point in the image to be detected, so that the image to be detected is rasterized to obtain at least two image grid areas.

[0045] By adopting the above-mentioned rasterization processing scheme for spraying points, each spraying point can be isolated. Since each spraying point is analyzed independently, there are fewer interference factors and the detection accuracy is greatly improved. At the same time, the small range of raster detection data has a small amount of calculation, which significantly improves the detection efficiency and can quickly screen out defective spraying points. Each image grid area should be independent and contain only one spraying point, which can avoid interference between adjacent spraying points during the detection process.

[0046] As an optional but non-limiting implementation scheme, rasterizing the image to be detected to obtain at least two image grid areas includes the following steps A1-A2:

[0047] Step A1, determine the row grayscale integral projection and column grayscale integral projection of the image to be detected, the image to be detected includes pixels with different grayscale values, the row grayscale integral projection is used to indicate a series of row integral values ​​obtained by accumulating the grayscale values ​​of pixels in each row direction in the image to be detected, and the column grayscale integral projection is used to indicate a series of column integral values ​​obtained by accumulating the grayscale values ​​of pixels in each column direction in the image to be detected.

[0048] Step A2: Based on the row grayscale integral projection and the column grayscale integral projection, the image to be detected is rasterized to obtain at least two image grid areas.

[0049] See also Figure 4 , row grayscale integral projection can be a pixel grayscale value accumulation operation performed row by row on the image to be detected, which is equivalent to treating the image to be detected as a two-dimensional matrix. For each row of pixels, starting from the first pixel in each row, the grayscale values ​​of each pixel are accumulated one by one, and finally a value representing the total grayscale of this row is obtained. In this way, each row is traversed to form a series of row integral values. Row grayscale integral projection can integrate the grayscale information of the image to be detected in the row direction, and according to the integrated grayscale value change characteristics, it can assist in judging the distribution of the spray point position in the image to be detected, and provide a basis for row-wise division for the rasterization of the image to be detected.

[0050] See also Figure 4 , similar to the row grayscale integral projection, the column grayscale integral projection can be a pixel grayscale value accumulation operation performed on the image to be detected by column, which is equivalent to treating the image to be detected as a two-dimensional matrix. For each column of pixels, starting from the first pixel in each column, the grayscale values ​​of each pixel are accumulated one by one, and finally a value representing the total grayscale of this column is obtained. In this way, each column is traversed to form a series of column integral values. The column grayscale integral projection can integrate the grayscale information of the image to be detected in the column direction, and analyze the distribution of the spray point position of the image to be detected in the column dimension through the change of the column integral value. In conjunction with the row grayscale integral projection, they serve the rasterization processing together and provide a basis for column-wise division for the rasterization of the image to be detected.

[0051] Optionally, the image to be detected is first scanned row by row, the grayscale values ​​of each row of pixels in the image to be detected are accumulated from left to right, and the row grayscale integral projection value corresponding to each row is calculated; then, the image to be detected can be scanned column by column, the grayscale values ​​of each column of pixels in the image to be detected are accumulated from top to bottom, and the column grayscale integral projection value is calculated. The whole process involves traversal access and accumulation calculation of each pixel in the image to be detected.

[0052] See also Figure 4In an optional example, according to the row grayscale integral projection and the column grayscale integral projection, the variation law of the sum of the pixel grayscale values ​​corresponding to each row in the image to be detected and the variation law of the sum of the pixel grayscale values ​​corresponding to each column in the image to be detected can be analyzed. Since the spraying points are distributed in an array, the grayscale values ​​of the rows and columns where the spraying points are located will be relatively small, while the grayscale values ​​of the rows and columns where the non-spraying points are located will be relatively large. Therefore, the row integral value indicated by the row grayscale integral projection has obvious fluctuation intervals, and the column integral value indicated by the column grayscale integral projection also has obvious fluctuation intervals. With this as a reference, rectangular image grid areas can be divided according to the grayscale fluctuation intervals in the image to be detected, ensuring that each image grid area can independently contain a spraying point.

[0053] For the above optional solutions: When rasterizing the image to be inspected, this solution cleverly uses the integral projection data to achieve accurate and adaptive division of the grid. Compared with the traditional method that needs to face the complex situation of the grayscale difference of each row and column of pixels, this solution effectively avoids this problem. Given that the various spray points in the image to be inspected are distributed in an array, this regular layout provides convenience, and the grayscale values ​​of pixels in the same row can be organically integrated for unified analysis. Compared with simply relying on a single pixel to analyze one by one to implement grid division, the speed of grid division in this solution has been greatly improved, and it can quickly prepare for the subsequent inspection process; at the same time, the accuracy of grid division is also more accurate, avoiding the inability to determine the accurate segmentation point when performing grayscale difference trend analysis on a single pixel due to the similar grayscale values ​​of adjacent pixels, ensuring that each grid area can accurately correspond to the spray point that needs attention.

[0054] As an optional but non-limiting implementation, see Figure 4 , based on the row grayscale integral projection and the column grayscale integral projection, the image to be detected is rasterized to obtain at least two image grid areas, including the following steps B1-B3:

[0055] Step B1, determine a row integral graph curve corresponding to the row grayscale integral projection and a column integral graph curve corresponding to the column grayscale integral projection, the row integral graph curve is a curve generated by sequentially connecting a series of row integral values ​​indicated by the row grayscale integral projection of the image to be detected, and the column integral graph curve is a curve generated by drawing a series of column integral values ​​indicated by the column grayscale integral projection of the image to be detected.

[0056] Step B2: determine a plurality of first maximum value points on the row integral graph curve and a plurality of second maximum value points on the column integral graph curve.

[0057] Step B3, generating grid row lines and grid column lines based on the rows corresponding to the multiple first maximum points in the image to be detected and the columns corresponding to the multiple second maximum points in the image to be detected, and rasterizing the image to be detected to obtain at least two image grid areas.

[0058] See also Figure 4 The row integral graph curve is based on a series of row integral values ​​obtained by row grayscale integral projection. The points corresponding to these values ​​are connected in sequence to draw the generated curve. The row integral graph curve can intuitively show the trend of the row integral value of each row as the row position changes. For example, if there are several rows of areas with high pixel grayscale values ​​in the image to be detected, there will be corresponding peaks on the row integral graph curve. The row integral graph curve is used to convert the discrete data of the row grayscale integral projection into a continuous curve form, so that the trend of the grayscale distribution in the row direction can be intuitively displayed, which is convenient for extracting key feature points, such as maximum points, for subsequent grid division.

[0059] See also Figure 4 The column integral graph curve is based on a series of column integral values ​​obtained by column grayscale integral projection. The points corresponding to these values ​​are connected in order to draw the generated curve. The column integral graph curve can intuitively show the trend of column integral values ​​of each row changing with column position. For example, if there are several columns with high pixel grayscale values ​​in the image to be detected, there will be corresponding peaks on the column integral graph curve. The column integral graph curve is used to convert the discrete data of column grayscale integral projection into a continuous curve form, so that the changing trend of grayscale distribution in the column direction can be intuitively displayed.

[0060] See also Figure 4 , the first maximum point is the maximum point on the row integral graph curve, which is the point on the row integral graph curve where the grayscale integral value in the local range reaches the maximum. These points represent that the grayscale cumulative value of the pixels at the corresponding position in the row direction is higher than that of its adjacent area, which often implies that the image has a prominent grayscale feature change in the row direction, which may correspond to certain key rows in the image, such as the boundary row of the object, the row with obvious texture changes, etc. The second maximum point is the maximum point on the column integral graph curve, which is the point on the column integral graph curve that meets the local maximum condition, that is, its column integral value is the largest in the surrounding neighborhood, marking the position where the peak of the pixel grayscale accumulation in the column direction appears, which is usually associated with the key structure and feature area in the column direction of the image to be detected, such as the column where the side edge of the object is located, the boundary column of different color areas, etc.

[0061] See also Figure 4, grid row lines are formed based on the rows corresponding to the multiple first maximum points on the row integral graph curve in the image to be detected. These grid row lines divide the image to be detected into different areas in the vertical direction, and constitute the horizontal boundaries of the grid. At the same time, grid column lines are formed according to the columns corresponding to the multiple second maximum points on the column integral graph curve in the image to be detected, dividing the image to be detected in the horizontal direction as the longitudinal boundaries of the grid. The multiple first maximum points on the row integral graph curve can clearly define the grid division boundaries in the row direction, and interweave with the grid column lines formed by the multiple second maximum points on the column integral graph curve, dividing the image to be detected into regular grid areas, ensuring that each grid can effectively cover specific content in the image, and reducing the complexity of data processing.

[0062] See also Figure 4 , for the row integral graph curve that has been drawn, a suitable algorithm is used to find the local maximum points on the curve, that is, those points with higher grayscale integral values ​​than the adjacent points, and they are determined as multiple first maximum points; similarly, on the column integral graph curve, a similar algorithm is used to find the local maximum points as multiple second maximum points. These algorithms are usually based on comparing the value relationship of adjacent points, for example, setting a smaller neighborhood range, and when the value of the center point is greater than the value of all points in the neighborhood, it is identified as a maximum point.

[0063] See also Figure 4 , according to the rows corresponding to the multiple first maximum points in the image to be detected, draw horizontal grid row lines; similarly, according to the columns corresponding to the multiple second maximum points in the image to be detected, draw vertical grid column lines. These criss-crossing lines divide the image to be detected into at least two image grid areas. During the drawing process, it is necessary to ensure the accuracy and continuity of the lines so that the boundaries and range of each grid area are clear.

[0064] The above scheme is adopted to realize adaptive rasterization of the image to be inspected. Compared with the traditional fixed-size raster division or division based on experience, this rasterization method based on the maximum point of the integral graph curve fully considers the grayscale distribution characteristics of the image itself. On the one hand, the generated raster area can better adapt to the content in the image, such as accurately framing the area where the spray point is located to avoid misdivision or missed division; on the other hand, it improves the efficiency of rasterization and reduces unnecessary trials and adjustments, providing a basic basis for subsequent image detection and analysis based on the raster area, and significantly improving the quality and speed of the entire spray point detection process.

[0065] For example, see Figure 4 , for the collected image to be detected Imag i,j(i∈(0,m),j∈(0,n)), grayscale integral projection is performed according to the row, and the row integral graph curve corresponding to the row grayscale integral projection and the column integral graph curve corresponding to the column grayscale integral projection are determined, where Figure 4 The left and upper curves in the middle represent the row integral graph curve corresponding to the row grayscale projection and the column integral graph curve corresponding to the column grayscale projection respectively; then, according to the formula Index=find(diff(sign(diff(data)))<0)+1, the maximum point position X of the row integral graph curve is found respectively. i (i∈(0,n)) and the maximum point position Y of the column integral graph curve i (i∈(0,m)). Find means the index of the table that satisfies the condition, and diff means forward difference, that is: diff i =data i+1 -data i , Sign is represented as: According to the maximum point position X of the line integral graph curve i (i∈(0,n)) and the maximum point position Y of the row integral graph curve i (i∈(0,m)) The image to be detected is rasterized into grids to obtain multiple image grid areas, each of which contains a spray point, such as Figure 2 The dashed lines are the grid lines.

[0066] S130, performing spraying defect detection on each spraying point in the image to be detected based on at least two image grid areas.

[0067] See also Figure 5 , taking each image grid area as a reference, spray defect detection is performed on the spray points in each image grid area in each image grid area to determine whether there are spray defects such as missed spraying, overspraying, uneven spraying, adhesion, etc. in the spray points in each image grid area. By dividing the image into at least two image grid areas, an independent analysis space is created for each spray point to improve the accuracy and efficiency of detection. Since each spray point corresponds to an independent image grid area, interference from adjacent spray points can be avoided during detection. For example, when judging whether a spray point is missed spraying, if there is no grid division, the grayscale information of the surrounding normal spray points may cover up the missed spraying characteristics of the point, resulting in misjudgment; in an independent grid, only the characteristics of the spray points in the grid need to be paid attention to, and the judgment basis is purer.

[0068] See also Figure 5In an optional example, for the spray points in each image grid area, the average grayscale value and grayscale standard deviation of each spray point can be calculated. If the average grayscale value of each spray point deviates from the grayscale range of normal spraying, it may be considered that there is a missed spraying defect (grayscale value is too low) or an overspraying defect (grayscale value is too high). If the grayscale standard deviation of a spray point exceeds a preset standard deviation threshold, resulting in a grayscale standard deviation that is too large, it indicates that the spray point has an uneven spraying defect in the image grid area. If the difference between the grayscale standard deviations corresponding to each spray point is greater than the preset difference, it is determined that the spray points in different image grid areas have uneven spraying defects.

[0069] See also Figure 5 In an optional example, for the spray points in each image grid area, the edge contour of the spray points in each image grid area can be obtained by edge detection algorithm (such as Canny edge detection), and the perimeter, area, circularity and other indicators of the spray points can be analyzed. If the circularity is much lower than the standard circular spray point, there may be adhesion or irregular spray shape problems; abnormal increase in perimeter may also indicate excess spray or adhesion with adjacent points.

[0070] See also Figure 5 , record the inspection results of the spraying points in each image grid area, mark the defective spraying points and their defect types. For example, a visual method can be used to mark the defective points on the image to be inspected, such as circling the missed spraying points with circles of different colors, marking the adhesion points with triangles, etc., so as to intuitively present the inspection results; at the same time, the inspection results are digitized, a report is generated, and fed back to the subsequent production links for quality control, process adjustment, etc., such as informing the spraying equipment to adjust the spraying parameters and rework defective products.

[0071] The technical solution of the embodiment of the present invention determines an image to be detected, where the image to be detected is a grayscale image obtained by image acquisition for each spraying point that is distributed in an array. By rasterizing the image to be detected, each spraying point in the distributed array corresponds to an independent image grid area. After each spraying point is divided into an independent grid area, it is only necessary to focus on these small-scale grid areas when performing defect detection on the spraying point, without repeatedly traversing and searching the entire image, which greatly reduces the amount of data processing. Compared with the global detection method, the detection time is significantly shortened and the detection efficiency is improved. It is particularly suitable for large-scale and high-density array spraying point detection scenarios; and, each spraying point in the original image to be detected is rasterized into a detection area, each spraying point is accurately locked, and each image grid area is associated with only one spraying point. When performing defect detection on the spraying point, the grayscale features and texture changes around the point can be analyzed more carefully, without being disturbed by the complex background of other spraying points, and adjacent spraying points are prevented from interfering with each other's detection results, so that the defect positioning can be accurate to a single point, thereby reducing misjudgment and missed judgment.

[0072] Figure 6 A flow chart of another spray inspection method provided for an embodiment of the present invention. The technical solution of this embodiment further optimizes the process of performing spray defect detection on each spray point in the image to be inspected based on at least two image grid areas in the aforementioned embodiment on the basis of the technical solution of the aforementioned embodiment. This embodiment can be combined with each optional solution in one or more of the aforementioned embodiments.

[0073] like Figure 6 As shown, the spraying detection method of the embodiment of the present invention may include the following process:

[0074] S610, determining an image to be detected, where the image to be detected is a grayscale image obtained by collecting images of each spraying point that is distributed in an array.

[0075] S620, performing rasterization processing on the image to be detected to obtain at least two image grid areas, so that each spraying point in the image to be detected is correspondingly configured in an independent image grid area.

[0076] S630. For each current image grid region in at least two image grid regions, determine grid attribute information associated with the current image grid region, the grid attribute information including first feature information of the image grid region and / or second feature information corresponding to the third type of segmented region in the image grid region, the first feature information being used to describe the grayscale difference between the first type of segmented region and the second type of segmented region in the image grid region, the second type of segmented region being a rectangular region formed by indenting a preset distance from a boundary of the image grid region toward the center of a spray point in the image grid region, the first type of segmented region being the remaining region in the image grid region except the second type of segmented region, the preset distance being used to make the rectangular region formed by indenting the preset distance constitute a circumscribed rectangle of the spray point, the second feature information being used to describe the grayscale difference between the third type of segmented region and the second type of segmented region in the image grid region, the third type of segmented region being an adjacent rectangular region configured in the image grid region that is adjacent to and shares a rectangular edge with the second type of segmented region in the image grid region.

[0077] See also Figure 5 , by rasterizing the image to be inspected to obtain numerous grid areas, the complex image to be inspected is divided into multiple relatively independent image grid areas that are easy to analyze, so that each spray point can be placed in a dedicated image grid area, reducing the mutual interference between different spray points. The grid attribute information of the image grid area covers various types of data used to describe the key features of the image grid area, specifically including the first feature information and / or the second feature information, which reflects the grayscale distribution and changes in the image grid area from different angles, and is an important basis for judging whether there are defects in the spray points.

[0078] See also Figure 5 The second segmentation area can be a rectangular area determined by shrinking a preset distance from the image grid area to the center of the spraying point based on the image grid area. This area closely surrounds the spraying point to reflect the grayscale situation of the spraying point, such as Figure 5 The rectangular area formed by the coordinates of the dividing line in the upper left corner (m00, n00) and the coordinates of the lower right corner (m11, n11). The first type of segmentation area can be the remaining part of the image grid area after subtracting the second type of segmentation area, covering the other areas in the image grid area except the small circle next to the spraying point. The first type of segmentation area and the second type of segmentation area jointly divide the entire image grid area. The third type of segmentation area can be in the image grid area, surrounding the adjacent rectangular area outside the second type of segmentation area, closely connected with it, and sharing the rectangular edge. The third type of segmentation area serves as an intermediate transition area, connecting the second type of segmentation area and the outer part of the image grid area, providing an intermediate area for analyzing the impact of the spraying point on a larger surrounding area, such as Figure 5The rectangular areas corresponding to DL, DR, DU and DD.

[0079] The first type of segmented area provides a grayscale comparison area related to the spray point from a broader perspective. By comparing the grayscale difference with the second type of segmented area, it can judge the impact of the spray point on the surrounding environment and its own spraying performance in the context of a large area as a whole, and assist in detecting problems such as whether the spray diffusion range is reasonable. As a reference area, the second type of segmented area cooperates with the first type of segmented area to jointly build a grayscale comparison system that reflects the state of the spray point. Its unique position setting enables it to focus on the grayscale features of the nearest range of the spray point, providing local and detailed information for defect detection. The third type of segmented area is an analysis of the grayscale levels of the image grid area. Combined with the second type of segmented area, by comparing the grayscale differences between the two, it can more carefully judge problems that may occur during the spraying process, such as edge adhesion and unnatural transitions, and assist in improving the detection of spray defects.

[0080] See also Figure 5 , the first feature information describes the grayscale difference state of the first type of segmented area in the image grid area compared to the second type of segmented area. Among them, the first type of segmented area is the remaining part of the image grid area after removing the second type of segmented area, and the second type of segmented area is a rectangular area formed by shrinking a preset distance from the center of the spraying point with the boundary of the image grid area as the starting point. The setting of the preset distance is intended to construct a circumscribed rectangle that just surrounds the spraying point, so as to more accurately compare the grayscale differences between different areas. The first feature information is used to capture the relative relationship between the spraying point and the surrounding area in grayscale by comparing the grayscale difference of the first type of segmented area relative to the second type of segmented area in the same image grid area, such as whether there are defects due to missed spraying or overspraying. At the same time, by comparing the first feature information of different image grid areas, it is also possible to determine whether there is an uneven spraying defect between the spraying points in the two image grid areas.

[0081] See also Figure 5 For each image grid area obtained after rasterization, we must first accurately locate and identify the first type segmentation area, the second type segmentation area, and the third type segmentation area based on the preset distance. Then, use a suitable image processing algorithm to calculate the grayscale difference between the first type segmentation area and the second type segmentation area to obtain the first feature information; similarly, calculate the grayscale difference between the third type segmentation area and the second type segmentation area to obtain the second feature information, and finally integrate to form the grid attribute information associated with the image grid area. This process involves a detailed traversal of image pixels, area division, and statistical calculation of grayscale values, which requires efficient and accurate algorithm support. For example, the integral map can be used to quickly calculate the total grayscale of the area to obtain the grayscale difference.

[0082] Using the above method, through detailed area division and grayscale contrast calculation, the complex grayscale information in each image grid area is refined into targeted and quantifiable grid attribute information, and the originally intuitive but difficult to directly judge image content is converted into clear feature data, which provides a strong analysis basis for subsequent defect detection, greatly simplifies the process from image to defect judgment, and improves the efficiency and accuracy of information extraction.

[0083] S640, performing spray defect detection on the spray points in the current image grid area in the image to be detected according to the grid attribute information associated with the current image grid area, so as to realize spray defect detection on each spray point in the image to be detected.

[0084] See also Figure 5 After obtaining the grid attribute information of the current image grid area, the grid attribute information including the first feature information and the second feature information are threshold-compared according to the pre-set defect judgment standard. For example, if the grayscale difference in the first feature information exceeds a threshold, it may indicate that there is a missing spray or overspray defect at the spray point; if the second feature information shows that the grayscale difference between the third segmentation area and the second segmentation area is abnormal, it may indicate that there are problems such as uneven edge spraying and edge adhesion. By analogy, all image grid areas are traversed to achieve comprehensive spray defect detection of each spray point in the image to be detected.

[0085] The above scheme makes full use of the grid attribute information extracted in the previous steps to realize the defect detection of spraying points in an accurate and quantitative way, avoiding the subjectivity and uncertainty of traditional manual detection, and greatly improving the accuracy of detection. At the same time, because it is based on targeted detection of small areas, compared with blind search of the entire image, it greatly reduces the amount of data processing and speeds up the detection speed, which can meet the needs of fast and efficient detection of spraying quality on industrial production lines.

[0086] The technical solution of the embodiment of the present invention, in addition to achieving the technical effects of the aforementioned embodiment, can also divide the image to be detected into at least two image grid areas, and deeply analyze the associated grid attribute information for each current image grid area, thereby realizing accurate positioning detection of the spray point. Since the first feature information focuses on the grayscale difference comparison between the first type of segmented area (i.e., the part except the area adjacent to the spray point) and the second type of segmented area (the circumscribed rectangular neighborhood of the spray point) in the image grid area, it can keenly capture the integrity problem of the spray point itself, such as missed spraying will cause the grayscale of the first type of segmented area relative to the second type of segmented area to suddenly change, and overspraying may cause the opposite effect, thereby accurately locating the defects of the spray point itself. At the same time, the second feature information is developed around the grayscale difference between the third type of segmented area (the adjacent area adjacent to the circumscribed rectangle of the spray point) and the second type of segmented area, which is effective in detecting edge spray defects, such as edge blurring, unnatural transition, etc., which will be fully exposed in the abnormal grayscale difference between the two, ensuring that no subtle edge defects will be missed. Abandoning the traditional extensive inspection relying on manual visual observation or simple global image analysis, the quantitative grid attribute information is used as the basis for judgment. The defect judgment standard obtained based on the statistical analysis of a large number of samples is closely combined with the first feature information and the second feature information. Whether it is judging the gray uniformity inside the spray point or the spray continuity of the edge area, there are accurate numerical references, which greatly reduces the probability of misjudgment and missed judgment, making the spray defect detection results more reliable.

[0087] Figure 7 A flow chart of another spray detection method provided for an embodiment of the present invention. The technical solution of this embodiment further optimizes the process of determining the grid attribute information associated with the current image grid area in the aforementioned embodiment on the basis of the technical solution of the aforementioned embodiment. This embodiment can be combined with various optional solutions in one or more of the aforementioned embodiments.

[0088] like Figure 7 As shown, the spraying detection method of the embodiment of the present invention may include the following process:

[0089] S710, determining an image to be detected, where the image to be detected is a grayscale image obtained by collecting images of each spraying point that is distributed in an array.

[0090] S720, performing rasterization processing on the image to be detected to obtain at least two image grid areas, so that each spraying point in the image to be detected is correspondingly configured in an independent image grid area.

[0091] S730. For each current image grid area in at least two image grid areas, determine the integral image of the image to be detected and the vertex position of the current image grid area in the image to be detected, wherein the value of each point in the integral image of the image to be detected refers to the sum of the grayscale values ​​of all points in the rectangular area formed from the upper left corner of the image to be detected to each point.

[0092] S740: Determine grid attribute information associated with the current image grid region based on the integral image corresponding to the image to be detected and the vertex positions of the current image grid region in the image to be detected.

[0093] Among them, the grid attribute information includes the first feature information of the image grid area and / or the second feature information corresponding to the third type of segmentation area in the image grid area, the first feature information is used to describe the grayscale difference between the first type of segmentation area and the second type of segmentation area in the image grid area, the second type of segmentation area is a rectangular area formed by shrinking a preset distance from the boundary of the image grid area to the center of the spray point in the image grid area, the first type of segmentation area is the remaining area in the image grid area except the second type of segmentation area, the preset distance is used to make the rectangular area formed by shrinking the preset distance constitute the circumscribed rectangle of the spray point, the second feature information is used to describe the grayscale difference between the third type of segmentation area and the second type of segmentation area in the image grid area, the third type of segmentation area is an adjacent rectangular area configured in the image grid area that is adjacent to and shares the rectangular edge of the second type of segmentation area in the image grid area.

[0094] See also Figure 2 The integral map of the image to be detected is a data structure used to quickly calculate the grayscale sum of the rectangular area in the image. For the image to be detected, the value of each point in the integral map corresponding to the image to be detected refers to the sum of the grayscale values ​​of all pixels in the rectangular area formed from the upper left corner of the image to be detected to the point. For example, if the coordinates of a point in the integral map of the image to be detected are (x, y), then the value of the point is the cumulative result of the grayscale values ​​of all pixels in the rectangular range from the upper left corner vertex (0,0) to (x, y) of the image to be detected. The integral map of the image to be detected simplifies the calculation process of the grayscale sum of the area. When determining the raster attribute information later, there is no need to repeatedly traverse all the pixels in each rectangular area to sum. It only needs to take the values ​​of several key positions in the integral map to quickly and accurately obtain the grayscale information of the required area, which greatly improves the calculation efficiency and provides strong support for real-time and fast image processing.

[0095] See also Figure 5, the vertex position of the current image grid area refers to the coordinate position of the four corner points of the current image grid area in the image to be detected, usually expressed in the form of two-dimensional coordinates, such as the upper left vertex coordinates (m0, n0), the upper right vertex coordinates (m0, n1), the lower right vertex coordinates (m1, n1), and the lower left vertex coordinates (m1, n0). These coordinates accurately define the range and orientation of the image grid area in the image to be detected. In this way, combined with the integral image of the image to be detected, the vertex position information can be used to accurately locate the relevant area in the integral image corresponding to the current image grid area, and then the integral image can be used to quickly obtain the grayscale sum of the grid area and the surrounding area, and then the grid attribute information associated with the current image grid area can be determined.

[0096] See also Figure 5 First, the integral map of the image to be detected is constructed according to the established algorithm. This process needs to start from the upper left corner of the image to be detected, and traverse pixel by pixel in the order from left to right and from top to bottom. According to the gray value relationship of adjacent pixels, the integral map value of each point is calculated to complete the construction of the integral map. Then, in the rasterized image to be detected, the vertex position of each current image grid area is determined. This step can be obtained by recording the coordinate information when the grid is divided or traversing the grid area boundary again after division. The coordinates of the vertex. Using the integral map corresponding to the image to be detected and the vertex position of the current image grid area, the corresponding starting point and end point coordinates are found in the integral map corresponding to the image to be detected. Through a simple subtraction operation (similar to the principle of subtracting the gray sum of redundant small areas from the gray sum of the large rectangular area), the gray sum of the pixels included in each segmented area in the current image grid area is quickly obtained, and then the gray difference between different segmented areas in the image grid area is calculated, and then the grid attribute information is obtained.

[0097] The above optional scheme provides an efficient tool for the subsequent rapid acquisition of the regional grayscale sum by constructing an integral graph, which simplifies the originally complex and time-consuming regional grayscale accumulation operation into a simple integral graph value operation, greatly saving computing resources and time. Taking full advantage of the integral graph and vertex position information, compared with the traditional method that requires repeated traversal of image pixels to calculate regional grayscale features, this scheme greatly improves the efficiency of information extraction by taking advantage of the fast calculation characteristics of the integral graph and combining it with the precise positioning of the vertex position, so that the grid attribute information can timely and accurately reflect the actual spraying situation in the image grid area, providing strong support for efficient spraying defect detection.

[0098] As an optional but non-limiting implementation scheme, based on the integral image of the image to be detected and the vertex positions of the current image grid area in the image to be detected, determining the grid attribute information associated with the current image grid area includes steps G1-G4:

[0099] Step G1: based on the integral image of the image to be detected and the vertex positions of the current image grid area in the image to be detected, determine the sum of the pixel grayscales of the current image grid area and the number of pixels in the current image grid area.

[0100] Step G2: based on the vertex positions of the current image grid region in the image to be detected and the preset distance, determine the vertex positions of the second type of segmented region in the current image grid region.

[0101] Step G3: Determine the sum of the pixel grayscales of the second type of segmented areas and the number of pixels in the second type of segmented areas based on the integral image of the image to be detected and the vertex positions of the second type of segmented areas in the current image grid area.

[0102] Step G4, determining the first feature information associated with the current image grid area based on the sum of the pixel grayscales of the current image grid area and the number of pixels in the current image grid area, and the sum of the pixel grayscales of the second type of segmented area and the number of pixels in the second type of segmented area.

[0103] See also Figure 5 , the sum of the pixel grayscales of the current image grid area is the cumulative result of the grayscale values ​​of all pixels in the current image grid area, reflecting the overall grayscale intensity of the area. The number of pixels in the current image grid area is the total number of pixels contained in the current image grid area, which is used to measure the size of the current image grid area. The sum of the pixel grayscales of the current image grid area is combined with the number of pixels to calculate some feature quantities that describe the average grayscale level of the current image grid area, such as average grayscale value = sum of pixel grayscales / number of pixels.

[0104] See also Figure 5 , the second type of segmentation area in the current image grid area is a rectangular area formed by shrinking the preset distance inward toward the center of the spray point in the current image grid area with the boundary of the current image grid area as the starting point. The preset distance is statistically pre-set, and the purpose is to construct a circumscribed rectangle that just surrounds the spray point of the desired size, so as to more accurately analyze the grayscale features around the spray point, contrast with other areas, and thus detect spray defects. The second type of segmentation area in the current image grid area also represents the position of the four corner points of the second type of segmentation area in the image to be detected in the form of two-dimensional coordinates. Since the second type of segmentation area is determined based on the vertex position and the preset distance of the current image grid area, its coordinate calculation involves adjusting the horizontal and vertical coordinates of the vertex position of the current image grid area according to the preset distance. For example, if the coordinates of the upper left corner vertex are (m0, n0), and the preset distances are Δm and Δn in the horizontal and vertical directions respectively, then the coordinates of the upper left corner vertex of the second type of segmentation area may become (m0-Δm, n0-Δn), and the specific calculation should be determined according to the shrinking direction and the coordinate system.

[0105] See also Figure 5 , after the sum of the pixel grayscales of the current image grid area and the sum of the pixel grayscales of the second type of segmented areas, the difference between the sum of the pixel grayscales of the current image grid area and the sum of the pixel grayscales of the second type of segmented areas can be determined as the sum of the pixel grayscales of the first type of segmented areas in the current image grid area. And, the difference between the number of pixels in the current image grid area and the number of pixels in the second type of segmented areas is used as the number of pixels in the first type of segmented areas in the current image grid area. Furthermore, the sum of the pixel grayscales of the first type of segmented areas in the current image grid area can be combined with the number of pixels to calculate some feature quantities describing the average grayscale level of the first type of segmented areas in the current image grid area, such as average grayscale value = sum of pixel grayscales / number of pixels. Similarly, the sum of the pixel grayscales of the second type of segmented areas in the current image grid area can be combined with the number of pixels to calculate some feature quantities describing the average grayscale level of the second type of segmented areas in the current image grid area.

[0106] See also Figure 5 The first feature information is used to describe the grayscale change of the first segmentation area relative to the second segmentation area in the current image grid area. The first segmentation area refers to the remaining part of the current image grid area excluding the second segmentation area. By comparing the grayscale changes of these two areas, such as grayscale difference, grayscale change rate, etc., it can reflect the prominence, integrity and integration of the spray point in the current image grid area with the surrounding environment, which is an important indicator for judging whether there are defects in the spray point.

[0107] See also Figure 5 For example, based on the integral image of the image to be detected and the vertex position of the current image grid area in the image to be detected, the first feature information Dn of the spray point in the current image grid area can be calculated. i,j (i∈0,y; j∈0,x), and the second feature information corresponding to the third type of segmentation area in the current image grid area (the four directional feature values ​​DL, DR, DU, DD in sequence, with the same size as Dn); where y means there are y rows of spray points, and x means there are x columns of spray points.

[0108] See also Figure 5 , take the image grid area in the middle of the image to be detected as the current image grid area, and take a spray point in the current image grid area as an example, the coordinates of the upper left corner dividing line are (m0, n0), and the coordinates of the lower right corner are (m1, n1); then the grayscale and effective pixel area of ​​the middle dotted grid can be expressed as:

[0109] Sum All =Integ m0,n0 +Integm1,n1 -Integ m0,n1 -Integ m1,n0 ;

[0110] Area All =(m1-m0+1)*(n1-n0+1);

[0111] Where Integ is the calculated integral graph;

[0112] The second type of segmentation area is formed by shrinking the current image grid area corresponding to the coordinate points (m0, n0) and (m1, n1) by a fixed distance Gap to obtain new coordinate points (m00, n00) and (m11, n11), such as Figure 5 The second type of segmentation area shown by the solid rectangular box outside the central black mark, calculate the grayscale and effective pixel area of ​​this second type of segmentation area:

[0113] Sum In =Integ m00,n00 +Integ m11,n11 -Integ m00,n11 -Integ m11,n11 ;

[0114] Area In =(m11-m00+1)*(n11-n00+1);

[0115] The grayscale mean of the first segmented area defines the spray background DN as:

[0116] The grayscale mean of the second segmented area defines the spray foreground DN as:

[0117] The grayscale difference between the first segmentation area and the second segmentation area indicated by the first feature information associated with the current image grid area, that is, the first feature information is defined as: Dn = Dn Out -Dn In .

[0118] As an optional but non-limiting implementation scheme, based on the integral image of the image to be detected and the vertex positions of the current image grid area in the image to be detected, determining the grid attribute information associated with the current image grid area includes steps E1-E3:

[0119] Step H1, determining the vertex positions of the third type of segmented regions based on the vertex positions of the current image grid region in the image to be detected and the vertex positions of the second type of segmented regions in the current image grid region.

[0120] Step H2: based on the integral image of the image to be detected and the vertex positions of the third type of segmented areas, determine the sum of the pixel grayscales of the third type of segmented areas and the number of pixels in the third type of segmented areas.

[0121] Step H3: Determine the second feature information associated with the current image grid region based on the sum of the pixel grayscales of the third type segmented region and the number of pixels in the third type segmented region.

[0122] See also Figure 5 The third type of segmentation area in the current image grid area is a special rectangular area configured in the current image grid area, which is adjacent to and shares the rectangular edge of the second type of segmentation area in the current image grid area. In simple terms, it is a circle of rectangular areas located next to and outside the second type of segmentation area in the current image grid area. Its significance lies in expanding the detection range of grayscale changes around the spraying point, extending outward from the second type of segmentation area adjacent to the spraying point, and capturing the continuity and changes of the spraying effect in a wider surrounding environment. The third type of segmentation area cooperates with the second type of segmentation area. By comparing the grayscale change and other features of the two, it can be detected whether there are problems such as abnormal grayscale gradient, edge adhesion, and unnatural transition in adjacent areas due to unstable spraying process.

[0123] See also Figure 5 , the vertex position of the third type of segmentation area in the current image grid area also uses two-dimensional coordinates to clearly indicate the positions of the four corner points of the area in the image to be detected. The determination process is based on the vertex position of the current image grid area and the vertex position of the second type of segmentation area, and is derived according to the relative position relationship between the two and the preset adjacent rules. For example, if the coordinate of the upper left corner vertex of the second type of segmentation area is, and it is known that the adjacent width between the third type of segmentation area and the second type of segmentation area in the horizontal and vertical directions is pixels (this is also a parameter preset according to the detection requirements), then the coordinate of the upper left corner vertex of the third type of segmentation area may be, and the specific calculation should comprehensively consider the adjacent direction, coordinate system and preset parameter details.

[0124] The sum of the pixel grayscales of the third-type segmented area in the current image grid area is the cumulative result of the grayscale values ​​of all pixels in the third-type segmented area, reflecting the overall grayscale intensity of the area; the sum of the pixel grayscales of the third-type segmented area and the number of pixels refer to the total number of pixels contained in this area, which is used to measure the size of the area. The second feature information in the current image grid area is used to describe the grayscale change of the third-type segmented area relative to the second-type segmented area in the current image grid area, covering a series of quantitative indicators that can reflect the grayscale difference between the two areas, such as grayscale difference, grayscale change rate, grayscale standard deviation comparison, etc. These indicators combined can accurately capture the changing trend of the spraying effect in the process of expanding from the second-type segmented area adjacent to the spraying point to the third-type segmented area.

[0125] See also Figure 5 , obtain the vertex position of the current image grid area and the vertex position of the determined second-type segmentation area, and perform fine coordinate calculation in a two-dimensional coordinate system according to the preset adjacent rules and parameters of the third-type segmentation area and the second-type segmentation area. Considering the relationship between the two adjacent and shared rectangular edges, as well as the possible preset expansion width, direction and other factors, for example, if it is known that the third-type segmentation area expands pixels outward around the second-type segmentation area, for the upper left corner vertex coordinate of the second-type segmentation area, the upper left corner vertex coordinate of the third-type segmentation area is calculated as, and the other three vertex coordinates can be calculated in the same way, so as to accurately determine the vertex position of the third-type segmentation area.

[0126] See also Figure 5 , with the help of the vertex position of the third-type segmentation area in the current image grid area, the corresponding area is quickly located in the integral map of the image to be detected. Since the integral map of the image to be detected stores the grayscale values ​​and grayscale sum information of all points in the rectangular area formed from the upper left corner of the image to be detected to each point, the grayscale sum of the rectangular area formed from the upper left corner of the image to be detected to the vertex of the lower right corner of the third-type segmentation area can be quickly obtained, that is, the sum of the pixel grayscale of the third-type segmentation area. At the same time, according to the vertex coordinates of the third-type segmentation area, combined with the basic pixel structure of the image to be detected, the number of pixels in the area is determined in a similar way to the method of calculating the number of pixels in the image grid area. The above process once again gives full play to the powerful advantages of the integral map, efficiently obtains the sum of the pixel grayscale and the number of pixels in the third-type segmentation area, avoids the cumbersome pixel traversal accumulation process, and saves a lot of computing resources and time.

[0127] See also Figure 5 For example, Figure 5 Take DL as an example, the coordinates of its upper left corner are (m00,n0), and the coordinates of its lower right corner are (m11,n00). Calculate the grayscale and effective pixel area of ​​the third type of segmentation area:

[0128] Sum DL =Integ m00,n0 +Integ m11,n00 -Integ m00,n00 -Integ m11,n0 ;

[0129] Area DL =(m11-m00+1)*(n00-n0+1);

[0130] The grayscale difference between the third segmentation area indicated by the second feature information associated with the current image grid area and the second segmentation area is defined as the directional feature value DL:

[0131] Similarly, the other three directional eigenvalues ​​DR, DU and DD can also be determined.

[0132] S750. Perform spray defect detection on the spray points in the current image grid area in the image to be detected according to the grid attribute information associated with the current image grid area, so as to realize spray defect detection on each spray point in the image to be detected.

[0133] As an optional but non-limiting implementation scheme, spray defect detection is performed on spray points in the current image grid area in the image to be detected according to grid attribute information associated with the current image grid area, including the following steps C1-C2:

[0134] Step C1: if the first characteristic information in the grid attribute information associated with the current image grid area indicates that the grayscale difference between the first type of segmented area and the second type of segmented area in the current image grid area is greater than a first preset threshold, it is determined that there is no missing spray defect in the spraying points of the current image grid area.

[0135] Step C2: if the first characteristic information in the grid attribute information associated with the current image grid area indicates that the grayscale difference between the first type of segmented area and the second type of segmented area in the current image grid area is not greater than a first preset threshold, it is determined that there is a missing spray defect in the spraying points of the current image grid area.

[0136] The first preset threshold is a pre-set numerical standard with key judgment significance, which is obtained based on the statistical analysis of a large number of samples of spray points without defects and known defects. When judging whether the spray points in the current image grid area are missed, the first preset threshold is used to measure whether the grayscale difference between the first type of segmented area and the second type of segmented area is within a reasonable range. The first preset threshold is used to classify the quantitative results of the grayscale difference. When the grayscale difference is greater than the first preset threshold, it indicates that the spraying condition of the spray point meets the normal expected spraying process and there is no missed spraying defect; when the grayscale difference is not greater than the first preset threshold, it indicates that there may be a missed spraying problem.

[0137] See also Figure 5 , after obtaining the grid attribute information associated with the current image grid area, the first feature information is extracted from it, that is, the grayscale difference value of the first type of segmented area relative to the second type of segmented area. Then, this grayscale difference value is compared with the first preset threshold value that has been set in advance. If the grayscale difference value is greater than the first preset threshold value, this means that from the perspective of grayscale features, the grayscale changes in the area around the spray point (the first type of segmented area) and the area where the spray point itself is located (the second type of segmented area) present a state that conforms to the normal spraying process. Because in the normal spraying process, the spray point is fully covered, its grayscale value will be greatly different from the surrounding area that is not affected by the sprayed material (the first type of segmented area). After a large number of sample verifications, this difference is determined to be greater than the first preset threshold value, and it can be determined that there is no leakage defect.

[0138] Similarly, the first feature information is first extracted from the grid attribute information associated with the current image grid area, and the grayscale difference value of the first type of segmented area relative to the second type of segmented area is obtained, and then compared with the first preset threshold. When it is found that the grayscale difference value is not greater than the first preset threshold, this indicates that the grayscale change of the area around the spray point and the area where the spray point itself is located does not conform to the difference state that should be in a normal spraying process. Since missed spraying will cause the grayscale value of the spray point area to approach the grayscale value of the surrounding area, making the grayscale difference smaller, when this smaller grayscale difference does not exceed the first preset threshold, it can be determined that there is a missed spray defect in the spray point in the current image grid area.

[0139] For example,: locate the rasterized segmentation result bw i,j (i∈(0,y),j∈(0,x)), when there is no defect, it is defined as 0, and when there is a defect, it is greater than 0; segment the feature map Dn according to the following rules: Use the following formula to perform global segmentation on Dn:

[0140]

[0141] As an optional but non-limiting implementation scheme, spray defect detection is performed on the spray points in the current image grid area in the image to be detected according to the grid attribute information associated with the current image grid area, including steps D1-D2:

[0142] Step D1, determining at least two reference image grid regions associated with the current image grid region and grid attribute information associated with the reference image grid region, wherein the reference image grid region is an image grid region adjacent to the current image grid region among at least two image grid regions of the image to be detected.

[0143] Step D2: based on the first feature information in the grid attribute information associated with the current image grid area and the first feature information in the grid attribute information associated with at least two reference image grid areas, determine whether the spraying points in the current image grid area have uneven spraying defects relative to the spraying points in the reference image grid area.

[0144] See also Figure 5 , the reference image grid area refers to the image grid area adjacent to the current image grid area in at least two image grid areas of the image to be detected. The reference image grid area is closely connected to the current image grid area in space, and shares a boundary or part of the boundary. Since the adjacent areas are usually affected by similar process conditions during the spraying process, their spraying states have certain correlation and comparability, which can provide an auxiliary reference for judging the quality of the spraying points in the current image grid area. The reference image grid area can be used as an important comparison benchmark to judge whether there is uneven spraying defect in the spraying points of the current image grid area. The reference image grid area can reflect the performance of other spraying points in a similar spraying environment. By comparing the feature information of different areas, the difference in spraying effect between the current image grid area and the surrounding normal areas can be found, and then the problem of uneven spraying can be accurately captured, which expands the field of vision of detection and avoids misjudgment or missed judgment caused by viewing a single area in isolation.

[0145] See also Figure 5, in the image to be detected that has completed the rasterization processing, with the current image grid area as the center, at least two reference image grid areas adjacent to it are quickly located and determined through the pre-set adjacent relationship judgment rules. These rules are usually based on the coordinate position relationship of the image grid area. For example, if the coordinate of the upper left corner vertex of the current image grid area is , the adjacent area can be set as other areas whose coordinates meet a certain range of conditions, such as, etc. The corresponding areas. After determining the reference image grid area, for each reference image grid area, the same method as the method for calculating the grid attribute information of the current image grid area is used to extract and calculate its associated grid attribute information, focusing on the first feature information, that is, calculating the grayscale difference value of the first type of segmentation area relative to the second type of segmentation area in each reference image grid area. This process involves a detailed traversal of image pixels, area division, and statistical calculation of grayscale values, which requires efficient and accurate algorithm support.

[0146] See also Figure 5 , after obtaining the first feature information in the grid attribute information associated with the current image grid area and the first feature information in the grid attribute information associated with at least two reference image grid areas, a pairwise comparison analysis is performed. Specifically, the size, change trend and other characteristics of the grayscale difference value of the first type of segmented area relative to the second type of segmented area of ​​the current image grid area and each reference image grid area are compared. If it is found that the grayscale difference value of the current image grid area is significantly different from the grayscale difference value of the reference image grid area, for example, the grayscale difference value of the current image grid area is obviously smaller or larger, and the degree of deviation exceeds the allowable fluctuation range obtained based on a large number of sample statistical analysis, this implies that the spraying point of the current image grid area has an uneven spraying defect relative to the spraying point of the reference image grid area. Because under normal spraying process, adjacent areas are affected by similar conditions, and their grayscale difference characteristics should be relatively consistent. A large deviation indicates that there is an abnormality in the spraying process of the current image grid area.

[0147] As an optional but non-limiting implementation scheme, based on the first feature information in the grid attribute information associated with the current image grid area and the first feature information in the grid attribute information associated with at least two reference image grid areas, determining whether the spraying points of the current image grid area have uneven spraying defects relative to the spraying points of the reference image grid area includes the following steps D21-D22:

[0148] Step D21: If the difference between the grayscale difference between the first type of segmented area and the second type of segmented area in the current image grid area indicated by the first feature information in the grid attribute information associated with the current image grid area and the average grayscale difference between the first type of segmented area and the second type of segmented area in the reference image grid area indicated by the first feature information in the grid attribute information associated with at least two reference image grid areas is greater than a second preset threshold, it is determined that the spray points in the current image grid area have an uneven spraying defect relative to the spray points in the reference image grid area.

[0149] Step D22: If the difference between the grayscale difference between the first type of segmented area and the second type of segmented area in the current image grid area indicated by the first feature information in the grid attribute information associated with the current image grid area and the average grayscale difference between the first type of segmented area and the second type of segmented area in the reference image grid area indicated by the first feature information in the grid attribute information associated with at least two reference image grid areas is not greater than a second preset threshold, it is determined that the spray points in the current image grid area do not have uneven spraying defects relative to the spray points in the reference image grid area.

[0150] The second preset threshold is a key value obtained in advance based on the statistical analysis of a large number of defect-free and known defective spraying samples, which is used to measure whether the difference in the first feature information between the current image grid area and the reference image grid area is within a reasonable fluctuation range. The second preset threshold clearly defines the boundary between normal and abnormal when judging uneven spraying defects. If the difference between the grayscale difference means is greater than the second preset threshold, it is determined that uneven spraying defects have occurred; if the difference between the grayscale difference means is not greater than the second preset threshold, it is considered that uneven spraying defects have not occurred, making the detection results standardized, objective and accurate.

[0151] See also Figure 5 First, the first feature information is accurately extracted from the grid attribute information associated with the current image grid area, and the grayscale difference value of the first type of segmented area relative to the second type of segmented area in the current image grid area is obtained; then, the average of the grayscale difference values ​​corresponding to the first feature information in the grid attribute information associated with at least two reference image grid areas is calculated. Subsequently, the difference between the two values ​​is calculated, and then the difference is compared with a pre-set second preset threshold. If the difference is greater than the second preset threshold, it means that the grayscale difference of the current image grid area and the average grayscale difference of the surrounding adjacent areas deviate too much. Since the grayscale difference of adjacent areas should be relatively stable under normal spraying process, the occurrence of such a large deviation indicates that the spraying points of the current image grid area have uneven spraying defects relative to the spraying points of the reference image grid area.

[0152] See also Figure 5, similarly, first obtain the relevant first feature information of the current image grid area, calculate the grayscale difference mean of the first feature information of the reference image grid area, find the difference between the two, and then compare the difference with the second preset threshold. When the difference is not greater than the second preset threshold, it means that the grayscale difference of the current image grid area and the surrounding adjacent areas are in a reasonable similarity range. Based on the similarity that adjacent areas should have under normal spraying process, it can be judged that the spraying points of the current image grid area do not have uneven spraying defects relative to the spraying points of the reference image grid area.

[0153] See also Figure 5 , exemplarily, positioning the rasterized segmentation result bw i,j (i∈(0,y),j∈(0,x)), when there is no defect, it is defined as 0, when there is a defect, it is greater than 0, and the following formula is used to locally segment Dn:

[0154]

[0155] As an optional but non-limiting implementation scheme, spray defect detection is performed on spray points in the current image grid area in the image to be detected according to grid attribute information associated with the current image grid area, including steps E1-E2:

[0156] Step E1, determining at least two reference image grid regions associated with the current image grid region and grid attribute information associated with the reference image grid region, wherein the reference image grid region is an image grid region adjacent to the current image grid region among at least two image grid regions of the image to be detected.

[0157] Step E2: based on the second feature information in the grid attribute information associated with the current image grid area and the second feature information in the grid attribute information associated with at least two reference image grid areas, determine whether there is a boundary adhesion defect between the spraying points of the current image grid area and the spraying points of the reference image grid area.

[0158] See also Figure 5, after obtaining the second feature information in the grid attribute information associated with the current image grid area, and the second feature information in the reference grid attribute information associated with at least two reference image grid areas, a comparative analysis is carried out. Focus on observing the size, change trend and other characteristics of the grayscale difference value of the third type of segmentation area relative to the second type of segmentation area of ​​the current image grid area and each reference image grid area. If it is found that the grayscale difference value of the current image grid area and the grayscale difference value of the reference image grid area are significantly different, for example, the grayscale difference value of the current image grid area is far higher or lower than the average grayscale difference value of the reference image grid area, and exceeds the normal fluctuation range based on a large number of sample statistical analysis, it indicates that there is a boundary adhesion defect between the spraying point of the current image grid area and the spraying point of the reference image grid area. Because during normal spraying, adjacent areas are affected by similar processes, this type of grayscale difference should be relatively stable, and a large deviation means an abnormal situation. By adopting the above method, relying on the contrast advantage between adjacent areas and with the help of precise feature information comparison, the boundary adhesion defects in the current image grid area can be quickly and accurately found out. This quantitative comparison detection method can greatly reduce the probability of misjudgment and improve the accuracy of spray defect detection.

[0159] As an optional but non-limiting implementation scheme, based on the second feature information in the grid attribute information associated with the current image grid area and the second feature information in the grid attribute information associated with at least two reference image grid areas, determining whether a boundary adhesion defect occurs between the spraying points of the current image grid area and the spraying points of the reference image grid area includes the following steps F1-F4:

[0160] Step F1, taking each third-category segmented area in the current image grid area as the first area to be compared in turn, and determining the second area to be compared associated with the first area to be compared from the third-category segmented areas included in the reference image grid area, the second area to be compared, the first area to be compared and the second-category segmented area in the current image grid area are adjacent to each other in the row direction or the column direction in the image to be detected, and the second area to be compared is located on the side of the first area to be compared away from the second-category segmented area in the current image grid area.

[0161] Step F2, based on the second feature information corresponding to the third type of segmentation area in the image raster area included in the raster attribute information associated with the current image raster area, determine the second feature information corresponding to the first area to be compared, and the second feature information corresponding to the first area to be compared is used to describe the grayscale difference between the first area to be compared and the second type of segmentation area in the current image raster area.

[0162] Step F3, based on the second feature information corresponding to the third type of segmentation area in the image raster area included in the raster attribute information associated with the reference image raster area, determine the second feature information corresponding to the second area to be compared, and the second feature information corresponding to the second area to be compared is used to describe the grayscale difference between the second area to be compared and the second type of segmentation area in the reference image raster area.

[0163] Step F4, based on the second feature information corresponding to the first area to be compared and the second feature information corresponding to the second area to be compared, determine whether the spraying points in the current image grid area and the spraying points in the reference image grid area have boundary adhesion defects in the first area to be compared and the second area to be compared.

[0164] See also Figure 5 , the first area to be compared is selected from each third-category segmented area in the current image grid area in turn, as the object for subsequent comparison with the relevant part of the reference image grid area. By setting the third-category segmented areas as the first area to be compared one by one, a detailed investigation of different directions and positions around the current image grid area is achieved, and no corners that may have defects are missed. The second area to be compared is selected from the third-category segmented area contained in the reference image grid area, and is closely related to the first area to be compared. The second area to be compared and the second-category segmented area in the current image grid area are adjacent to each other in the row direction or column direction in the image to be detected, and are located on the side of the first area to be compared that is far away from the second-category segmented area. Such a position setting makes the two correspond in spatial layout, which is convenient for comparing the grayscale change difference caused by boundary adhesion. By cooperating with the first area to be compared, an accurate comparison relationship is established. Since the two are adjacent in position and have corresponding layout, the grayscale changes should be similar under normal circumstances. Once adhesion occurs, the difference will appear, thus becoming a key comparison element for judging boundary adhesion defects.

[0165] See also Figure 5, in the current image grid area, mark the third-category segmented areas as the first area to be compared one by one. Subsequently, according to the row and column coordinate system of the image to be detected and the adjacent relationship rules, accurately locate the corresponding second area to be compared from the third-category segmented area of ​​the reference image grid area adjacent to it. Specifically, according to the row direction or column direction, find the area that is adjacent to the first area to be compared and the second-category segmented area in sequence, and is located on the side of the first area to be compared away from the second-category segmented area. This requires accurate interpretation of image coordinates and familiarity with regional layout to ensure the accuracy of matching. Using the grid attribute information associated with the current image grid area that has been acquired, accurately extract the second feature information corresponding to the third-category segmented area, and after calculation, determine the grayscale difference of the third-category segmented area currently serving as the first area to be compared relative to the second-category segmented area, and obtain the second feature information corresponding to the first area to be compared. This involves accurate query and application of previously calculated and stored grid attribute data.

[0166] See also Figure 5 , compare the second feature information corresponding to the first area to be compared with the second feature information corresponding to the second area to be compared, and focus on observing the key features such as the grayscale difference value and change trend between the two. If the difference between the two exceeds the normal fluctuation range based on statistical analysis of a large number of samples, it means that in the first area to be compared and the second area to be compared, the spray points in the current image grid area and the spray points in the reference image grid area have boundary adhesion defects. Because under normal spraying conditions, the grayscale changes in the corresponding positions of adjacent areas should be relatively stable.

[0167] By using the above method, with the help of precise comparison, the grayscale anomaly caused by boundary adhesion can be keenly captured, and the specific position of the boundary adhesion defect can be accurately located. This refined and quantitative detection method greatly reduces misjudgment, improves the accuracy of spray defect detection, ensures product spraying quality, and reduces the defective rate.

[0168] As an optional but non-limiting implementation scheme, based on the second feature information corresponding to the first area to be compared and the second feature information corresponding to the second area to be compared, determining whether the spraying points in the current image grid area and the spraying points in the reference image grid area have boundary adhesion defects in the first area to be compared and the second area to be compared, including steps F41-F42:

[0169] Step F41: If the grayscale difference between the first area to be compared and the second type of segmented area in the current image grid area indicated by the second feature information corresponding to the first area to be compared is less than the third preset threshold, and the grayscale difference between the second area to be compared and the second type of segmented area in the reference image grid area indicated by the second feature information corresponding to the second area to be compared is less than the third preset threshold, it is determined that the spray points in the current image grid area and the spray points in the reference image grid area have boundary adhesion defects in the first area to be compared and the second area to be compared.

[0170] Step F42: If the grayscale difference between the first area to be compared and the second type of segmented area in the current image grid area indicated by the second feature information corresponding to the first area to be compared is not less than the third preset threshold, or the grayscale difference between the second area to be compared and the second type of segmented area in the reference image grid area indicated by the second feature information corresponding to the second area to be compared is not less than the third preset threshold, then it is determined that the spray points in the current image grid area and the spray points in the reference image grid area do not have boundary adhesion defects in the first area to be compared and the second area to be compared.

[0171] The third preset threshold is a number determined in advance through statistical analysis of a large number of defect-free and known defect samples. It is used to measure whether the grayscale difference between the first area to be compared and the second area to be compared relative to their respective second-type segmented areas is within a reasonable range when judging boundary adhesion defects. It is the key boundary to distinguish between normal and abnormal. When the grayscale difference between the two areas is less than the third preset threshold, it indicates that there may be a boundary adhesion defect; when the grayscale difference between the two areas is not less than the third preset threshold, it is considered normal.

[0172] See also Figure 5, extract the grayscale difference value of the first area to be compared in the current image grid area relative to the second type of segmented area from the second feature information corresponding to the first area to be compared, and then obtain the grayscale difference value of the second area to be compared in the reference image grid area relative to the second type of segmented area from the second feature information corresponding to the second area to be compared. Subsequently, compare these two grayscale difference values ​​with the third preset threshold value respectively. If both are less than the third preset threshold value, it means that the grayscale change of the outer layer corresponding to the current image grid area and the reference image grid area is smaller than the normal state. Since the boundary adhesion will make the third type of segmented area affected by the adjacent spray points, the grayscale becomes closer to the second type of segmented area, so this situation is likely to mean that in the first area to be compared and the second area to be compared, the spray points of the current image grid area and the spray points of the reference image grid area have boundary adhesion defects. Similarly, first obtain the grayscale difference value corresponding to the two areas, and then compare it with the third preset threshold value. As long as one of the grayscale difference values ​​is not less than the third preset threshold, it means that the grayscale change of at least one area is within the normal fluctuation range, and there is no situation where the grayscale difference on both sides is too small due to boundary adhesion. Therefore, it is determined that the spray points in the current image grid area and the spray points in the reference image grid area do not have boundary adhesion defects in the first area to be compared and the second area to be compared.

[0173] See also Figure 5 , exemplarily, positioning the rasterized segmentation result bw i,j (i∈(0,y),j∈(0,x)), when there is no defect, it is defined as 0, when there is a defect, it is greater than 0, and the following formula is used to segment Dn by boundary adhesion (the following comma is the relationship between and, and both are satisfied):

[0174]

[0175] The technical solution of the embodiment of the present invention, in addition to achieving the technical effects of the aforementioned embodiments, predetermines the integral graph of the image to be detected, and subsequently, when obtaining various attribute information of the current image grid area, there is no need to repeatedly traverse each pixel in the area to accumulate the grayscale value. The integral graph has stored the grayscale sum of the rectangular area from the upper left corner of the image to each point. It is only necessary to quickly locate the relevant rectangular area based on the vertex position of the current image grid area, and obtain the corresponding grayscale value and through simple coordinate calculation, which greatly reduces the amount of calculation, so that the detection process can be promoted more quickly, especially suitable for large-scale, high-resolution images to be detected. The scheme obtains grid attribute information based on rigorous integral graphs and precise regional positioning, rather than relying on empirical, fuzzy visual judgment. This quantization method has high repeatability. Different detection scenarios and different operators use this method. As long as the integral graph is constructed correctly and the vertex position is accurate, stable and consistent grid attribute information can be obtained, thereby ensuring the reliability of the final spray defect detection result and reducing the risk of misjudgment and missed judgment. The scheme is not limited by a specific image type, can flexibly adapt to various industrial spray detection needs, and can also play a stable role in a complex and changeable production environment.

[0176] Figure 8 A structural schematic diagram of a spray detection device provided in an embodiment of the present invention. The embodiment of the present invention is suitable for performing spray defect detection on each spray point that is distributedly arranged in an array. The spray detection device can be implemented in the form of software and / or hardware, and is generally integrated on any electronic device with network communication function, which can be a mobile terminal, PC or server, etc.

[0177] like Figure 8 As shown, the spray detection device of the embodiment of the present invention may include the following:

[0178] A determination module 810 is used to determine an image to be detected, where the image to be detected is a grayscale image obtained by collecting images of each spraying point that is distributed in an array;

[0179] The processing module 820 is used to perform rasterization processing on the image to be detected to obtain at least two image raster areas, so that each spray point in the image to be detected is correspondingly configured in an independent image raster area.

[0180] The detection module 830 is used to perform spray defect detection on each spray point in the image to be detected based on at least two image grid areas.

[0181] On the basis of the above embodiment, optionally, the image to be detected is subjected to rasterization processing to obtain at least two image raster regions, including:

[0182] Determine a row grayscale integral projection and a column grayscale integral projection of the image to be detected, wherein the image to be detected includes pixels of different grayscale values, the row grayscale integral projection is used to indicate a series of row integral values ​​obtained by cumulatively adding up the grayscale values ​​of pixels in each row direction of the image to be detected, and the column grayscale integral projection is used to indicate a series of column integral values ​​obtained by cumulatively adding up the grayscale values ​​of pixels in each column direction of the image to be detected;

[0183] Based on the row grayscale integral projection and the column grayscale integral projection, the image to be detected is rasterized to obtain at least two image grid areas.

[0184] On the basis of the above embodiment, optionally, based on the row grayscale integral projection and the column grayscale integral projection, the image to be detected is subjected to rasterization processing to obtain at least two image grid regions, including:

[0185] Determine a row integral graph curve corresponding to the row grayscale integral projection and a column integral graph curve corresponding to the column grayscale integral projection, wherein the row integral graph curve is a curve generated by sequentially connecting and drawing a series of row integral values ​​indicated by the row grayscale integral projection of the image to be detected, and the column integral graph curve is a curve generated by drawing and drawing a series of column integral values ​​indicated by the column grayscale integral projection of the image to be detected;

[0186] Determine a plurality of first maximum value points on the row integral graph curve and a plurality of second maximum value points on the column integral graph curve;

[0187] Grid row lines and grid column lines are generated based on the rows corresponding to the multiple first maximum points in the image to be detected and the columns corresponding to the multiple second maximum points in the image to be detected, and the image to be detected is rasterized to obtain at least two image grid areas.

[0188] Based on the above embodiment, optionally, performing spray defect detection on each spray point in the image to be detected based on at least two image grid areas includes:

[0189] For each current image grid region of at least two image grid regions, grid attribute information associated with the current image grid region is determined, the grid attribute information including first feature information of the image grid region and / or second feature information corresponding to the third type segmentation region in the image grid region, the first feature information is used to describe the grayscale difference between the first type segmentation region and the second type segmentation region in the image grid region, the second type segmentation region is a rectangular region formed by shrinking a preset distance from a boundary of the image grid region to a center of a spraying point in the image grid region, the first type segmentation region is the remaining region in the image grid region except the second type segmentation region, the preset distance is used to make the rectangular region formed by shrinking the preset distance constitute a circumscribed rectangle of the spraying point, the second feature information is used to describe the grayscale difference between the third type segmentation region and the second type segmentation region in the image grid region, the third type segmentation region is an adjacent rectangular region configured in the image grid region that is adjacent to and shares a rectangular edge with the second type segmentation region in the image grid region;

[0190] According to the grid attribute information associated with the current image grid area, spray defect detection is performed on the spray points in the current image grid area in the image to be detected.

[0191] Based on the above embodiment, optionally, determining the grid attribute information associated with the current image grid region includes:

[0192] Determine the vertex positions of the integral image of the image to be detected and the current image grid area in the image to be detected, wherein the value of each point in the integral image of the image to be detected refers to the sum of the grayscale values ​​of all points in the rectangular area formed from the upper left corner of the image to be detected to each point;

[0193] Based on the integral image corresponding to the image to be detected and the vertex positions of the current image grid region in the image to be detected, grid attribute information associated with the current image grid region is determined.

[0194] On the basis of the above embodiment, optionally, determining grid attribute information associated with the current image grid area based on the integral image of the image to be detected and the vertex positions of the current image grid area in the image to be detected includes:

[0195] Determine the sum of the pixel grayscales of the current image grid area and the number of pixels in the current image grid area based on the integral image of the image to be detected and the vertex positions of the current image grid area in the image to be detected;

[0196] Determining the vertex positions of the second type of segmented area in the current image grid area based on the vertex positions of the current image grid area in the image to be detected and the preset distance;

[0197] Determine the sum of the pixel grayscales of the second type of segmented areas and the number of pixels in the second type of segmented areas based on the integral image of the image to be detected and the vertex positions of the second type of segmented areas in the current image grid area;

[0198] Based on the sum of the pixel grayscales of the current image grid area and the number of pixels in the current image grid area, and the sum of the pixel grayscales of the second type of segmented areas and the number of pixels in the second type of segmented areas, the first feature information associated with the current image grid area is determined.

[0199] On the basis of the above embodiment, optionally, determining grid attribute information associated with the current image grid area based on the integral image of the image to be detected and the vertex positions of the current image grid area in the image to be detected includes:

[0200] Determine the vertex position of the third type of segmentation area based on the vertex position of the current image grid area in the image to be detected and the vertex position of the second type of segmentation area in the current image grid area;

[0201] Determine the sum of the pixel grayscales of the third type of segmented area and the number of pixels in the third type of segmented area based on the integral image of the image to be detected and the vertex positions of the third type of segmented area;

[0202] Based on the sum of the pixel gray levels of the third type segmented area and the number of pixels in the third type segmented area, second feature information associated with the current image grid area is determined.

[0203] On the basis of the above embodiment, optionally, performing spray defect detection on the spray points in the current image grid area in the image to be detected according to the grid attribute information associated with the current image grid area includes:

[0204] If the first characteristic information in the grid attribute information associated with the current image grid area indicates that the grayscale difference between the first type of segmented area and the second type of segmented area in the current image grid area is greater than a first preset threshold, it is determined that there is no missing spray defect at the spraying point in the current image grid area;

[0205] If the first characteristic information in the grid attribute information associated with the current image grid area indicates that the grayscale difference between the first type of segmented area and the second type of segmented area in the current image grid area is not greater than the first preset threshold, it is determined that there is a missing spray defect in the spraying points of the current image grid area.

[0206] On the basis of the above embodiment, optionally, performing spray defect detection on the spray points in the current image grid area in the image to be detected according to the grid attribute information associated with the current image grid area includes:

[0207] Determine at least two reference image grid regions associated with the current image grid region and grid attribute information associated with the reference image grid region, wherein the reference image grid region is an image grid region adjacent to the current image grid region among the at least two image grid regions of the image to be detected;

[0208] Determine whether a spraying point in the current image grid area has an uneven spraying defect relative to a spraying point in the reference image grid area based on first feature information in the grid attribute information associated with the current image grid area and first feature information in the grid attribute information associated with at least two reference image grid areas;

[0209] Based on the second characteristic information in the grid attribute information associated with the current image grid area and the second characteristic information in the grid attribute information associated with at least two reference image grid areas, determine whether a boundary adhesion defect occurs between the spraying points of the current image grid area and the spraying points of the reference image grid area.

[0210] On the basis of the above embodiment, optionally, based on the first feature information in the grid attribute information associated with the current image grid area and the first feature information in the grid attribute information associated with at least two reference image grid areas, determining whether the spraying points of the current image grid area have uneven spraying defects relative to the spraying points of the reference image grid area includes:

[0211] If the difference between the grayscale difference between the first type of segmented area and the second type of segmented area in the current image grid area indicated by the first feature information in the grid attribute information associated with the current image grid area and the average grayscale difference between the first type of segmented area and the second type of segmented area in the reference image grid area indicated by the first feature information in the grid attribute information associated with at least two reference image grid areas is greater than a second preset threshold, it is determined that the spraying points in the current image grid area have an uneven spraying defect relative to the spraying points in the reference image grid area;

[0212] If the difference between the grayscale difference between the first type of segmented area and the second type of segmented area in the current image grid area indicated by the first characteristic information in the grid attribute information associated with the current image grid area and the average grayscale difference between the first type of segmented area and the second type of segmented area in the reference image grid area indicated by the first characteristic information in the grid attribute information associated with at least two reference image grid areas is not greater than a second preset threshold, it is determined that the spray points of the current image grid area do not have uneven spraying defects relative to the spray points of the reference image grid area.

[0213] On the basis of the above embodiment, optionally, based on the second feature information in the grid attribute information associated with the current image grid area and the second feature information in the grid attribute information associated with at least two reference image grid areas, determining whether a boundary adhesion defect occurs between the spraying points of the current image grid area and the spraying points of the reference image grid area includes:

[0214] Taking each third-category segmented area in the current image grid area as a first area to be compared in sequence, and determining a second area to be compared associated with the first area to be compared from the third-category segmented areas included in the reference image grid area, wherein the second area to be compared, the first area to be compared and the second-category segmented area in the current image grid area are sequentially adjacent to each other in a row direction or a column direction in the image to be detected, and the second area to be compared is located on a side of the first area to be compared away from the second-category segmented area in the current image grid area;

[0215] Determine the second feature information corresponding to the first area to be compared based on the second feature information corresponding to the third type of segmented area in the image grid area included in the grid attribute information associated with the current image grid area, wherein the second feature information corresponding to the first area to be compared is used to describe the grayscale difference between the first area to be compared and the second type of segmented area in the current image grid area;

[0216] Determine the second feature information corresponding to the second area to be compared based on the second feature information corresponding to the third type of segmented area in the image grid area included in the grid attribute information associated with the reference image grid area, wherein the second feature information corresponding to the second area to be compared is used to describe the grayscale difference between the second area to be compared and the second type of segmented area in the reference image grid area;

[0217] Based on the second feature information corresponding to the first area to be compared and the second feature information corresponding to the second area to be compared, determine whether the spraying points in the current image grid area and the spraying points in the reference image grid area have boundary adhesion defects in the first area to be compared and the second area to be compared.

[0218] On the basis of the above embodiment, optionally, based on the second feature information corresponding to the first area to be compared and the second feature information corresponding to the second area to be compared, determining whether the spraying points in the current image grid area and the spraying points in the reference image grid area have boundary adhesion defects in the first area to be compared and the second area to be compared, includes:

[0219] If the grayscale difference between the first area to be compared and the second type of segmented area in the current image grid area indicated by the second feature information corresponding to the first area to be compared is less than a third preset threshold, and the grayscale difference between the second area to be compared and the second type of segmented area in the reference image grid area indicated by the second feature information corresponding to the second area to be compared is less than a third preset threshold, it is determined that the spraying points in the current image grid area and the spraying points in the reference image grid area have boundary adhesion defects in the first area to be compared and the second area to be compared;

[0220] If the grayscale difference between the first area to be compared and the second type of segmented area in the current image grid area indicated by the second feature information corresponding to the first area to be compared is not less than the third preset threshold, or the grayscale difference between the second area to be compared and the second type of segmented area in the reference image grid area indicated by the second feature information corresponding to the second area to be compared is not less than the third preset threshold, it is determined that the spray points in the current image grid area and the spray points in the reference image grid area do not have boundary adhesion defects in the first area to be compared and the second area to be compared.

[0221] The technical solution of the embodiment of the present invention determines an image to be detected, where the image to be detected is a grayscale image obtained by image acquisition for each spraying point that is distributed in an array. By rasterizing the image to be detected, each spraying point in the distributed array corresponds to an independent image grid area. After each spraying point is divided into an independent grid area, it is only necessary to focus on these small-scale grid areas when performing defect detection on the spraying point, without repeatedly traversing and searching the entire image, which greatly reduces the amount of data processing. Compared with the global detection method, the detection time is significantly shortened and the detection efficiency is improved. It is particularly suitable for large-scale and high-density array spraying point detection scenarios; and, each spraying point in the original image to be detected is rasterized into a detection area, each spraying point is accurately locked, and each image grid area is associated with only one spraying point. When performing defect detection on the spraying point, the grayscale features and texture changes around the point can be analyzed more carefully, without being disturbed by the complex background of other spraying points, and adjacent spraying points are prevented from interfering with each other's detection results, so that the defect positioning can be accurate to a single point, thereby reducing misjudgment and missed judgment.

[0222] The spray detection device provided in the embodiment of the present invention can execute the spray detection method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the spray detection method.

[0223] It is worth noting that the various units and modules included in the above-mentioned device 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 protection scope of the embodiments of the present invention.

[0224] Fig. 9 A schematic diagram of the structure of an electronic device for implementing a spray detection method provided by an embodiment of the present invention. Fig. 9 , which shows an electronic device (eg Fig. 9 The terminal device in the embodiment of the present invention may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig. 9 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0225] like Fig. 9 As shown, the electronic device 900 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the electronic device 900 are also stored. The processing device 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An edit / output (I / O) interface 905 is also connected to the bus 904.

[0226] Typically, the following devices may be connected to the I / O interface 905: an input device 906 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 908 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 909. The communication device 909 may allow the electronic device 900 to communicate with other devices wirelessly or by wire to exchange data. Although Fig. 9 The electronic device 900 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0227] In particular, according to an embodiment of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a non-transient computer-readable medium, and the computer program contains a program code for executing the spray detection method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 909, or installed from the storage device 908, or installed from the ROM 902. When the computer program is executed by the processing device 901, the above-mentioned functions defined in the spray detection method of the embodiment of the present invention are executed.

[0228] The names of the messages or information exchanged between multiple devices in the embodiments of the present invention are only used for illustrative purposes, and are not used to limit the scope of these messages or information.

[0229] The electronic device provided in the embodiment of the present invention and the spray detection method provided in the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0230] An embodiment of the present invention provides a computer storage medium on which a computer program is stored. When the program is executed by a processor, the spray detection method provided by the above embodiment is implemented.

[0231] It should be noted that the computer-readable medium of the present invention can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal can take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0232] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0233] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0234] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: determines an image to be detected, which is a grayscale image obtained by image acquisition of each spraying point arranged in an array distributed manner; rasterizes the image to be detected to obtain at least two image grid areas, so that each spraying point in the image to be detected is correspondingly configured in an independent image grid area; and performs spraying defect detection on each spraying point in the image to be detected based on at least two image grid areas.

[0235] Computer program code for performing the operations of the present invention may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0236] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0237] The units involved in the embodiments of the present invention may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".

[0238] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0239] In the context of the present invention, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0240] The above description is only a preferred embodiment of the present invention and an explanation of the technical principles used. Those skilled in the art should understand that the disclosure scope involved in the present invention is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present invention (but not limited to) by each other.

[0241] In addition, although each operation is described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present invention. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0242] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A spraying detection method, characterized in that: The method comprises: Determine an image to be detected, where the image to be detected is a grayscale image obtained by collecting images of each spraying point that is distributed in an array; Performing rasterization processing on the image to be detected to obtain at least two image raster areas, so that each spray point in the image to be detected is correspondingly configured in an independent image raster area; The spraying defect detection is performed on each spraying point in the image to be detected based on at least two image grid areas.

2. The method according to claim 1, characterized in that The image to be detected is subjected to rasterization processing to obtain at least two image raster regions, including: Determine a row grayscale integral projection and a column grayscale integral projection of the image to be detected, wherein the image to be detected includes pixels of different grayscale values, the row grayscale integral projection is used to indicate a series of row integral values ​​obtained by cumulatively adding up the grayscale values ​​of pixels in each row direction of the image to be detected, and the column grayscale integral projection is used to indicate a series of column integral values ​​obtained by cumulatively adding up the grayscale values ​​of pixels in each column direction of the image to be detected; Based on the row grayscale integral projection and the column grayscale integral projection, the image to be detected is rasterized to obtain at least two image grid areas.

3. The method according to claim 2, characterized in that Based on the row grayscale integral projection and the column grayscale integral projection, the image to be detected is subjected to rasterization processing to obtain at least two image grid regions, including: Determine a row integral graph curve corresponding to the row grayscale integral projection and a column integral graph curve corresponding to the column grayscale integral projection, wherein the row integral graph curve is a curve generated by sequentially connecting and drawing a series of row integral values ​​indicated by the row grayscale integral projection of the image to be detected, and the column integral graph curve is a curve generated by drawing and drawing a series of column integral values ​​indicated by the column grayscale integral projection of the image to be detected; Determine a plurality of first maximum value points on the row integral graph curve and a plurality of second maximum value points on the column integral graph curve; Grid row lines and grid column lines are generated based on the rows corresponding to the multiple first maximum points in the image to be detected and the columns corresponding to the multiple second maximum points in the image to be detected, and the image to be detected is rasterized to obtain at least two image grid areas.

4. The method according to claim 1, characterized in that: Performing spray defect detection on each spray point in the image to be detected based on at least two image grid areas includes: For each current image grid region of at least two image grid regions, grid attribute information associated with the current image grid region is determined, the grid attribute information including first feature information of the image grid region and / or second feature information corresponding to the third type segmentation region in the image grid region, the first feature information is used to describe the grayscale difference between the first type segmentation region and the second type segmentation region in the image grid region, the second type segmentation region is a rectangular region formed by shrinking a preset distance from a boundary of the image grid region to a center of a spraying point in the image grid region, the first type segmentation region is the remaining region in the image grid region except the second type segmentation region, the preset distance is used to make the rectangular region formed by shrinking the preset distance constitute a circumscribed rectangle of the spraying point, the second feature information is used to describe the grayscale difference between the third type segmentation region and the second type segmentation region in the image grid region, the third type segmentation region is an adjacent rectangular region configured in the image grid region that is adjacent to and shares a rectangular edge with the second type segmentation region in the image grid region; According to the grid attribute information associated with the current image grid area, spray defect detection is performed on the spray points in the current image grid area in the image to be detected.

5. The method according to claim 4, characterized in that Determining grid attribute information associated with the current image grid region includes: Determine the vertex positions of the integral image of the image to be detected and the current image grid area in the image to be detected, wherein the value of each point in the integral image of the image to be detected refers to the sum of the grayscale values ​​of all points in the rectangular area formed from the upper left corner of the image to be detected to each point; Based on the integral image corresponding to the image to be detected and the vertex positions of the current image grid region in the image to be detected, grid attribute information associated with the current image grid region is determined.

6. The method according to claim 5, characterized in that Determining grid attribute information associated with the current image grid region based on the integral image of the image to be detected and the vertex positions of the current image grid region in the image to be detected includes: Determine the sum of the pixel grayscales of the current image grid area and the number of pixels in the current image grid area based on the integral image of the image to be detected and the vertex positions of the current image grid area in the image to be detected; Determining the vertex positions of the second type of segmented area in the current image grid area based on the vertex positions of the current image grid area in the image to be detected and the preset distance; Determine the sum of the pixel grayscales of the second type of segmented areas and the number of pixels in the second type of segmented areas based on the integral image of the image to be detected and the vertex positions of the second type of segmented areas in the current image grid area; Based on the sum of the pixel grayscales of the current image grid area and the number of pixels in the current image grid area, and the sum of the pixel grayscales of the second type of segmented areas and the number of pixels in the second type of segmented areas, the first feature information associated with the current image grid area is determined.

7. The method according to claim 6, characterized in that Determining grid attribute information associated with the current image grid region based on the integral image of the image to be detected and the vertex positions of the current image grid region in the image to be detected includes: Determine the vertex position of the third type of segmentation area based on the vertex position of the current image grid area in the image to be detected and the vertex position of the second type of segmentation area in the current image grid area; Determine the sum of the pixel grayscales of the third type of segmented area and the number of pixels in the third type of segmented area based on the integral image of the image to be detected and the vertex positions of the third type of segmented area; Based on the sum of the pixel gray levels of the third type segmented area and the number of pixels in the third type segmented area, second feature information associated with the current image grid area is determined.

8. The method according to claim 4, characterized in that According to the grid attribute information associated with the current image grid area, spray defect detection is performed on the spray points in the current image grid area in the image to be detected, including: If the first characteristic information in the grid attribute information associated with the current image grid area indicates that the grayscale difference between the first type of segmented area and the second type of segmented area in the current image grid area is greater than a first preset threshold, it is determined that there is no missing spray defect at the spraying point in the current image grid area; If the first characteristic information in the grid attribute information associated with the current image grid area indicates that the grayscale difference between the first type of segmented area and the second type of segmented area in the current image grid area is not greater than the first preset threshold, it is determined that there is a missing spray defect in the spraying points of the current image grid area.

9. The method according to claim 4, characterized in that According to the grid attribute information associated with the current image grid area, spray defect detection is performed on the spray points in the current image grid area in the image to be detected, including: Determine at least two reference image grid regions associated with the current image grid region and grid attribute information associated with the reference image grid region, wherein the reference image grid region is an image grid region adjacent to the current image grid region among the at least two image grid regions of the image to be detected; Determine whether a spraying point in the current image grid area has an uneven spraying defect relative to a spraying point in the reference image grid area based on first feature information in the grid attribute information associated with the current image grid area and first feature information in the grid attribute information associated with at least two reference image grid areas; Based on the second characteristic information in the grid attribute information associated with the current image grid area and the second characteristic information in the grid attribute information associated with at least two reference image grid areas, determine whether a boundary adhesion defect occurs between the spraying points of the current image grid area and the spraying points of the reference image grid area.

10. The method according to claim 9, characterized in that Based on first feature information in grid attribute information associated with the current image grid region and first feature information in grid attribute information associated with at least two reference image grid regions, determining whether a spraying point in the current image grid region has an uneven spraying defect relative to a spraying point in the reference image grid region, including: If the difference between the grayscale difference between the first type of segmented area and the second type of segmented area in the current image grid area indicated by the first feature information in the grid attribute information associated with the current image grid area and the average grayscale difference between the first type of segmented area and the second type of segmented area in the reference image grid area indicated by the first feature information in the grid attribute information associated with at least two reference image grid areas is greater than a second preset threshold, it is determined that the spraying points in the current image grid area have an uneven spraying defect relative to the spraying points in the reference image grid area; If the difference between the grayscale difference between the first type of segmented area and the second type of segmented area in the current image grid area indicated by the first characteristic information in the grid attribute information associated with the current image grid area and the average grayscale difference between the first type of segmented area and the second type of segmented area in the reference image grid area indicated by the first characteristic information in the grid attribute information associated with at least two reference image grid areas is not greater than a second preset threshold, it is determined that the spray points of the current image grid area do not have uneven spraying defects relative to the spray points of the reference image grid area.

11. The method according to claim 9, characterized in that Based on the second feature information in the grid attribute information associated with the current image grid area and the second feature information in the grid attribute information associated with at least two reference image grid areas, determining whether a boundary adhesion defect occurs between the spraying points of the current image grid area and the spraying points of the reference image grid area, including: Taking each third-category segmented area in the current image grid area as a first area to be compared in sequence, and determining a second area to be compared associated with the first area to be compared from the third-category segmented areas included in the reference image grid area, wherein the second area to be compared, the first area to be compared and the second-category segmented area in the current image grid area are sequentially adjacent to each other in a row direction or a column direction in the image to be detected, and the second area to be compared is located on a side of the first area to be compared away from the second-category segmented area in the current image grid area; Determine the second feature information corresponding to the first area to be compared based on the second feature information corresponding to the third type of segmented area in the image grid area included in the grid attribute information associated with the current image grid area, wherein the second feature information corresponding to the first area to be compared is used to describe the grayscale difference between the first area to be compared and the second type of segmented area in the current image grid area; Determine the second feature information corresponding to the second area to be compared based on the second feature information corresponding to the third type of segmented area in the image grid area included in the grid attribute information associated with the reference image grid area, wherein the second feature information corresponding to the second area to be compared is used to describe the grayscale difference between the second area to be compared and the second type of segmented area in the reference image grid area; Based on the second feature information corresponding to the first area to be compared and the second feature information corresponding to the second area to be compared, determine whether the spraying points in the current image grid area and the spraying points in the reference image grid area have boundary adhesion defects in the first area to be compared and the second area to be compared.

12. The method according to claim 11, characterized in that Based on the second feature information corresponding to the first area to be compared and the second feature information corresponding to the second area to be compared, determining whether the spraying points in the current image grid area and the spraying points in the reference image grid area have boundary adhesion defects in the first area to be compared and the second area to be compared, including: If the grayscale difference between the first area to be compared and the second type of segmented area in the current image grid area indicated by the second feature information corresponding to the first area to be compared is less than a third preset threshold, and the grayscale difference between the second area to be compared and the second type of segmented area in the reference image grid area indicated by the second feature information corresponding to the second area to be compared is less than a third preset threshold, it is determined that the spraying points in the current image grid area and the spraying points in the reference image grid area have boundary adhesion defects in the first area to be compared and the second area to be compared; If the grayscale difference between the first area to be compared and the second type of segmented area in the current image grid area indicated by the second feature information corresponding to the first area to be compared is not less than the third preset threshold, or the grayscale difference between the second area to be compared and the second type of segmented area in the reference image grid area indicated by the second feature information corresponding to the second area to be compared is not less than the third preset threshold, it is determined that the spray points in the current image grid area and the spray points in the reference image grid area do not have boundary adhesion defects in the first area to be compared and the second area to be compared.

13. A spraying detection device, characterized in that: The device comprises: A determination module, used to determine an image to be detected, wherein the image to be detected is a grayscale image obtained by collecting images of each spraying point that is distributed in an array; A processing module, used for performing rasterization processing on the image to be detected to obtain at least two image raster areas, so that each spray point in the image to be detected is correspondingly configured in an independent image raster area; The detection module is used to perform spray defect detection on each spray point in the image to be detected based on at least two image grid areas.

14. A storage medium containing computer executable instructions, characterized in that: The computer executable instructions are used to execute the spray detection method described in any one of claims 1-12 when executed by a computer processor.

Citation Information

Cited By

  • Image-based automatic food counting method and device

    CN120219427A

  • Image-based automatic food counting method and device

    CN120219427B

  • Surface paint spraying defect detection method for furniture production quality inspection

    CN121324373A