A defect detection method and device, electronic equipment and storage medium

By acquiring screen printing images and calculating the distance between screen printing points and filter points, defects on the screen printing edges are automatically detected, solving the problems of slow detection speed and low accuracy caused by manual visual inspection, and achieving fast and accurate defect detection.

CN115187585BActive Publication Date: 2026-04-14GUANGDONG TOPSTAR TECH
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGDONG TOPSTAR TECH
Filing Date
2022-08-24
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

In existing technologies, edge defect detection of screen-printed products relies on manual visual inspection, resulting in slow detection speed and low accuracy.

Method used

By acquiring the screen printing image, extracting the screen printing edge, performing filtering processing, calculating the distance between the screen printing point and the filtered point, and determining whether it is a defect point, the system can automatically detect defects on the screen printing edge.

Benefits of technology

It enables rapid and accurate detection of defects on the edges of silkscreen printing, improving detection efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115187585B_ABST
    Figure CN115187585B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a defect detection method and device, electronic equipment and storage medium. The method comprises: for a silk-screen product requiring silk-screen edge detection, acquiring a silk-screen image generated after image acquisition of the silk-screen product, and extracting a silk-screen edge from the silk-screen image; filtering the silk-screen edge to obtain a filtered edge, wherein the filtered edge has filtered points corresponding to respective silk-screen points on the silk-screen edge; for each silk-screen point, determining a distance between the filtered point corresponding to the silk-screen point and the silk-screen point, and determining whether the silk-screen point is a defect point according to the distance; and detecting whether there is a defect on the silk-screen edge according to whether each silk-screen point is a defect point. The technical solution of the embodiments of the present application can automatically detect whether there is a defect on the silk-screen edge.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a defect detection method, apparatus, electronic device and storage medium. Background Technology

[0002] With the rapid development of screen printing technology, diverse and exquisite screen-printed products are becoming increasingly popular. It's important to note that because the ink used in screen printing is viscous, defects may exist at the edges, which can affect the final screen printing result.

[0003] To address this, in order to ensure the quality of screen printing, the current method mainly relies on manual visual inspection to detect defects on the edges of the screen print. However, this defect detection method suffers from slow detection speed and low accuracy. Summary of the Invention

[0004] This invention provides a defect detection method, apparatus, electronic device, and storage medium to automatically detect whether defects exist on the edges of silkscreen printing.

[0005] According to one aspect of the present invention, a defect detection method is provided, which may include:

[0006] For screen-printed products that require screen printing edge detection, obtain the screen printing image generated after image acquisition of the screen-printed product, and extract the screen printing edge from the screen printing image;

[0007] The silkscreen edge is filtered to obtain the filtered edge, where there are filter points on the filtered edge that correspond to each silkscreen point on the silkscreen edge.

[0008] For each silkscreen point, determine the distance between the corresponding filter point and the silkscreen point, and determine whether the silkscreen point is a defect point based on the distance.

[0009] Based on whether each silkscreen dot is a defect point, the presence of defects on the silkscreen edge is detected.

[0010] According to another aspect of the present invention, a defect detection device is provided, which may include:

[0011] The screen printing edge extraction module is used to acquire the screen printing image generated after image acquisition of the screen printing product for screen printing products that require screen printing edge detection, and extract the screen printing edges from the screen printing image.

[0012] The edge filtering module is used to filter the silkscreen edge to obtain the filtered edge, wherein there are filter points on the filtered edge that correspond to each silkscreen point on the silkscreen edge.

[0013] The defect point determination module is used to determine the distance between the corresponding filter point and the silkscreen point for each silkscreen point, and to determine whether the silkscreen point is a defect point based on the distance.

[0014] The defect detection module is used to detect whether there are defects on the edge of the silkscreen based on whether each silkscreen dot is a defect dot.

[0015] According to another aspect of the present invention, an electronic device is provided, which may include:

[0016] At least one processor; and

[0017] A memory that is communicatively connected to at least one processor; wherein,

[0018] The memory stores a computer program that can be executed by at least one processor, such that when the at least one processor executes the program, it implements the defect detection method provided in any embodiment of the present invention.

[0019] According to another aspect of the present invention, a computer-readable storage medium is provided having computer instructions stored thereon for causing a processor to execute and implement the defect detection method provided in any embodiment of the present invention.

[0020] The technical solution of this invention, for screen-printed products requiring edge detection, involves acquiring a screen-printed image generated after image acquisition of the screen-printed product, and extracting the screen-printed edges from the image. The screen-printed edges are then filtered to obtain filtered edges, where each filtered edge contains a filter point corresponding to a screen-printed point. For each screen-printed point, the distance between the filter point and the screen-printed point is determined, and whether the screen-printed point is a defect point is determined based on the distance. Based on whether each screen-printed point is a defect point, defects are detected on the screen-printed edge. This technical solution, by determining defect points based on the screen-printed points on the screen-printed edge and the filter points on the filtered edge, and then detecting defects on the screen-printed edge based on these defect points, can automatically detect defects on the screen-printed edge using only the screen-printed edge of the product itself, achieving a fast and accurate detection of screen-printed defects.

[0021] It should be understood that the description in this section is not intended to identify key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a flowchart of a defect detection method provided in Embodiment 1 of the present invention;

[0024] Figure 2 This is a flowchart of a defect detection method provided in Embodiment 2 of the present invention;

[0025] Figure 3 This is a schematic diagram of a burr defect in a defect detection method according to Embodiment 2 of the present invention;

[0026] Figure 4 This is a schematic diagram of a notch defect in a defect detection method according to Embodiment 2 of the present invention;

[0027] Figure 5 This is a flowchart of a defect detection method provided in Embodiment 3 of the present invention;

[0028] Figure 6 This is a schematic diagram illustrating the process of determining silkscreen points in a defect detection method provided in Embodiment 3 of the present invention;

[0029] Figure 7 This is a flowchart illustrating an optional example of a defect detection method provided in Embodiment 3 of the present invention;

[0030] Figure 8 This is a flowchart of another optional example of a defect detection method provided according to Embodiment 3 of the present invention;

[0031] Figure 9 This is a structural block diagram of a defect detection device according to Embodiment 4 of the present invention;

[0032] Figure 10 This is a schematic diagram of the structure of an electronic device that implements the defect detection method of this invention. Detailed Implementation

[0033] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0034] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. The same applies to "target," "original," etc., and will not be repeated here. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0035] Example 1

[0036] Figure 1 This is a flowchart of a defect detection method provided in Embodiment 1 of the present invention. This embodiment is applicable to the detection of screen printing defects. The method can be executed by the defect detection device provided in this embodiment of the present invention. The device can be implemented by software and / or hardware and can be integrated into an electronic device, which can be various user terminals or servers.

[0037] See Figure 1 The method of this invention specifically includes the following steps:

[0038] S110. For screen-printed products that require screen printing edge detection, acquire the screen printing image generated after image acquisition of the screen-printed product, and extract the screen printing edge from the screen printing image.

[0039] In this context, "screen printing edge" can be understood as the edge outline of a screen-printed product. A screen-printed product can be understood as a product whose screen printing edges require defect detection.

[0040] It is understandable that, due to the reflective properties of the surface of screen-printed products, the resulting screen-printed image may contain reflective points. Considering that a reflective point is a sudden change in the image and can cause distortion of the screen-printed edge curve, thus leading to misjudgment of screen-printed edge defects, relevant processing to remove reflective points can be performed after acquiring the screen-printed image. In this embodiment of the invention, the aforementioned processing can be preprocessing such as filtering, denoising, and morphological operations, or it can be implemented based on a pre-trained neural network model, etc., without specific limitations.

[0041] It is important to note that the extracted silkscreen edges can be considered as lines connecting the various silkscreen points extracted from the silkscreen image. Here, a silkscreen point can be understood as a point that can form the silkscreen edge.

[0042] S120. Filter the silkscreen edge to obtain a filtered edge, wherein there are filter points on the filtered edge that correspond to each silkscreen point on the silkscreen edge.

[0043] Here, the filtered edge can be understood as the edge contour after filtering the silkscreen edge. In practical applications, the filtering scheme used here can be mean filtering, median filtering, moving average filtering, or Kalman filtering, etc., without specific limitations.

[0044] It's important to note that the extracted filtered edges can be considered as lines connecting various filtered points. Furthermore, each filtered point on the filtered edge corresponds one-to-one with each silkscreen point on the silkscreen edge; that is, any silkscreen point on the filtered silkscreen edge can be understood as its corresponding filtered point. Here, a filtered point can be understood as a point that can form a filtered edge.

[0045] For example, a Cartesian coordinate system can be established on the silkscreen image (or the image's own coordinate system can be directly applied), and each silkscreen point can be assigned a number. The coordinates of each silkscreen point in the Cartesian coordinate system can be obtained. The coordinates of the silkscreen point in the Cartesian coordinate system can be (X(t), Y(t)), where t = 1, 2…N is the number of the silkscreen point. For example, taking mean filtering as an example, mean filtering can be performed on the silkscreen edges according to the following formula:

[0046]

[0047] Where W is the filter width, x' is the x-coordinate of the t-th filter point on the filter edge, and y' is the y-coordinate of the t-th filter point on the filter edge. Connecting all filter points linearly yields the filter edge Q(x', y'). In this embodiment, each filter point can be assigned a number, with each silkscreen point having the same number as its corresponding filter point.

[0048] S130. For each silkscreen point, determine the distance between the corresponding filter point and the silkscreen point, and determine whether the silkscreen point is a defect point based on the distance.

[0049] Here, a defect point can be understood as a point that characterizes a defect on the silkscreen edge. It's important to note that, considering the silkscreen edge curve is usually quite smooth, burrs or gaps can cause a steep shift in the curve, resulting in a large difference in the curve's spacing between the defect location and its surrounding areas. Filtering the defect location will smooth out the curve, while other areas will show no significant change. Therefore, the characteristics of the filtered silkscreen edge curve can be used to detect the presence of defects on the silkscreen edge.

[0050] In this embodiment of the invention, for each silkscreen point, the distance between the silkscreen point and the filter point can be determined based on the position of the corresponding filter point and the position of the silkscreen point itself. This distance is then used to determine whether the silkscreen point is a defect. For example, the distance is compared with a pre-set distance range; if the distance is not within this range, the silkscreen point is identified as a defect. More specifically, the absolute value of the distance is compared with a pre-set distance threshold; if the absolute value is greater than the threshold, the silkscreen point is identified as a defect.

[0051] For example, a Cartesian coordinate system can be established on the screen-printed image (or the image's own coordinate system can be directly applied), and a serial number can be assigned to each screen-printed point and filter point, with each screen-printed point having the same serial number as its corresponding filter point. The distance between screen-printed points and filter points with the same serial number can then be calculated. The distance d is compared with a pre-set distance threshold δt. If d is greater than δt, the silkscreen point is identified as a defect point. Here, x is the x-coordinate of the silkscreen point, y is the y-coordinate of the silkscreen point, x' is the x-coordinate of the filter point with the same silkscreen point number, and y' is the y-coordinate of the filter point with the same silkscreen point number.

[0052] S140. Detect whether there are defects on the edge of the silkscreen based on whether each silkscreen dot is a defect dot.

[0053] In the case where a silkscreen dot is a defective dot, it indicates that there may be a defect at the edge of the silkscreen at the defective dot. Therefore, in this embodiment of the invention, the presence of a defect on the silkscreen edge can be detected based on whether each silkscreen dot is a defective dot. For example, if the proportion of silkscreen dots that are defective dot in the total number of silkscreen dots exceeds a preset proportion threshold, or if the candidate defect area formed by the silkscreen dots that are defective dot meets a preset defect condition, it is determined that there is a defect on the silkscreen edge.

[0054] The technical solution of this invention, for screen-printed products requiring edge detection, involves acquiring a screen-printed image generated after image acquisition of the screen-printed product, and extracting the screen-printed edges from the image. The screen-printed edges are then filtered to obtain filtered edges, where each filtered edge contains a filter point corresponding to a screen-printed point. For each screen-printed point, the distance between the filter point and the screen-printed point is determined, and whether the screen-printed point is a defect point is determined based on the distance. Based on whether each screen-printed point is a defect point, defects are detected on the screen-printed edge. This technical solution, by determining defect points based on the screen-printed points on the screen-printed edge and the filter points on the filtered edge, and then detecting defects on the screen-printed edge based on these defect points, can automatically detect defects on the screen-printed edge using only the screen-printed edge of the product itself, achieving a fast and accurate detection of screen-printed defects.

[0055] Example 2

[0056] Figure 2 This is a flowchart of another defect detection method provided in Embodiment 2 of the present invention. This embodiment is an optimization based on the above-described technical solutions. In this embodiment, optionally, detecting whether a defect exists on the silkscreen edge based on whether each silkscreen point is a defect point includes: extracting at least one defect point from each silkscreen point based on whether each silkscreen point is a defect point, and constructing at least one pseudo-defect region based on the at least one defect point; determining whether the pseudo-defect region is a real defect region based on the region area and / or region size of each pseudo-defect region; and detecting whether a defect exists on the silkscreen edge based on whether each pseudo-defect region is a real defect region. The explanations of terms that are the same as or corresponding to those in the above embodiments are not repeated here.

[0057] See Figure 2 The method in this embodiment may specifically include the following steps:

[0058] S210. For screen-printed products that require screen printing edge detection, acquire the screen printing image generated after image acquisition of the screen-printed product, and extract the screen printing edge from the screen printing image.

[0059] S220. Filter the silkscreen edge to obtain a filtered edge, wherein there are filter points on the filtered edge that correspond to each silkscreen point on the silkscreen edge.

[0060] S230. For each silkscreen point, determine the distance between the corresponding filter point and the silkscreen point, and determine whether the silkscreen point is a defect point based on the distance.

[0061] S240. Based on whether each silkscreen point is a defect point, extract at least one defect point from each silkscreen point, and construct at least one pseudo-defect region based on at least one defect point.

[0062] If a silkscreen point is a defect point, it means that there may be a defect at the edge of the silkscreen at the defect point. At least one defect point among the silkscreen points can be extracted, and at least one pseudo-defect region can be constructed based on at least one defect point. For example, a pseudo-defect region can be constructed based on all defect points; a pseudo-defect region can be constructed by connecting adjacent defect points among at least one defect point; and so on, without specific limitations.

[0063] It should be noted that since some of the pseudo-defect areas constructed from defect points are small, they may only be uneven areas caused by slight changes in the contour, and cannot be considered as real defect areas. Therefore, each pseudo-defect area constructed based on at least one defect point cannot be guaranteed to be a real defect area, but is only a defect area that may be a real defect area.

[0064] S250. For each pseudo-defect region, determine whether the pseudo-defect region is a real defect region based on the region area and / or region size.

[0065] For each pseudo-defect region, to determine whether it is a real defect region, the area and / or size of the pseudo-defect region can be calculated. Then, based on the area and / or size, it can be determined whether the pseudo-defect region is a real defect region. In practical applications, optionally, the area size can be represented by the width and / or height of the minimum bounding rectangle of the pseudo-defect region. For example, an area threshold and / or size threshold can be preset. The area and / or size of the pseudo-defect region can be calculated, and the area is compared with the area threshold and / or the size is compared with the size threshold. If the area is greater than the area threshold and / or the size is greater than the size threshold, then the pseudo-defect region is determined to be a real defect region. A real defect region can be understood as a pseudo-defect region where a defect actually exists.

[0066] S260. Detect whether there are defects on the silkscreen edge based on whether each pseudo-defect area is a real defect area.

[0067] Specifically, it can detect whether there is a defect on the silkscreen edge based on whether each pseudo-defect area is a real defect area. For example, if there is at least one real defect area in each pseudo-defect area, all pseudo-defect areas are real defect areas, or the proportion of pseudo-defect areas that are real defect areas in all defect areas exceeds a preset proportion threshold, it indicates that there is a defect on the silkscreen edge, and the real defect area can be detected as a defect.

[0068] The technical solution of this invention involves extracting at least one defect point from each silkscreen point based on whether it is a defect point, and constructing at least one pseudo-defect region based on the at least one defect point. For each pseudo-defect region, it is determined whether the pseudo-defect region is a real defect region based on its area and / or size. Based on whether each pseudo-defect region is a real defect region, the existence of defects on the silkscreen edge is detected. By determining whether a pseudo-defect region is a real defect region, the accuracy of defect detection is further improved.

[0069] An optional technical solution, a defect detection method, further includes: obtaining the serial number of each silkscreen point, wherein the serial number of the silkscreen point is used to characterize the position of the silkscreen point on the silkscreen edge; constructing at least one pseudo-defect region based on at least one defect point, including: determining at least one defect group from at least one defect point, wherein the serial numbers of each defect point in each defect group are connected; and constructing a pseudo-defect region based on each defect point in each defect group for each defect group.

[0070] After extracting the silkscreen edge, the serial number of each silkscreen point can be obtained. This serial number indicates the position of the silkscreen point on the silkscreen edge. In practical applications, optionally, if the serial numbers of the silkscreen points are arranged sequentially, only the serial number of any one silkscreen point on the silkscreen edge needs to be obtained. Based on the serial number of this silkscreen point and the arrangement direction of the serial numbers, the serial numbers of other silkscreen points can be determined along the silkscreen edge in a clockwise or counterclockwise direction. For example, if the serial number of any silkscreen point on the silkscreen edge is 3, and its serial numbers are arranged in a clockwise direction, the serial number of the next silkscreen point in the clockwise direction can be determined as 4, the serial number of the next silkscreen point in the clockwise direction is 5, and so on, thus obtaining the serial number of each silkscreen point; alternatively, the serial number of the next silkscreen point in the counterclockwise direction can be determined as 2, and so on, thus obtaining the serial number of each silkscreen point. In this embodiment of the invention, the serial number of each filter point can also be obtained. The serial number of the filter point is the same as the serial number of its corresponding silkscreen point, that is, the position of the filter point on the filter edge is the same as the position of the corresponding silkscreen point on the silkscreen edge.

[0071] At least one defect group can be formed by connecting consecutively numbered defect points. For each defect group, the defect points within it can be linearly connected according to their respective numbers, and the resulting region can be considered a pseudo-defect region. In other words, a defect group can be understood as a group containing at least two consecutively numbered defect points. Based on this, a pseudo-defect region can be constructed for each defect group.

[0072] In this embodiment of the invention, each defect point in each defect group is connected according to its own sequence number to form a pseudo-defect region. This allows the originally independent defect points to be constructed into a more holistic pseudo-defect region according to their positions, which is convenient for subsequent judgment on whether there are defects on the silkscreen edge.

[0073] Another optional technical solution, the defect detection method, further includes: when a defect is detected on the edge of the silkscreen, determining that the defect on the edge of the silkscreen is located within the actual defect area; obtaining the average gray value of the actual defect area based on the gray value of each area point within the actual defect area, and determining the defect type corresponding to the actual defect area based on the average gray value.

[0074] In this context, "region point" can be understood as the pixel within the actual defect area. "Grayscale mean" can be understood as the average grayscale value of each region point. "Defect type" can be understood as the type of defect on the silkscreen edge, such as a burr defect or a notch defect.

[0075] If a defect is detected on the silkscreen edge based on whether each pseudo-defect area is a real defect area, this indicates that the defect is located within a real defect area. Therefore, for each real defect area, the average grayscale value of the real defect area can be obtained based on the grayscale values ​​of each point within that area, and the defect type corresponding to that real defect area can be determined based on the average grayscale value.

[0076] In this embodiment of the invention, when it is necessary to reduce computational resource consumption, for each real defect region, a preset region point selection rule is established. Based on the region point selection rule, a subset of region points within the real defect region that can represent the grayscale value of the real defect region are selected. Then, the average grayscale value of the real defect region is obtained based on the grayscale value of the subset of region points, thereby determining the defect type corresponding to the real defect region based on the average grayscale value. The region point selection rule can be understood as a rule that selects a subset of region points that can represent the overall grayscale value of the real defect region. For example, the region point selection rule could be to select one region point every preset number of pixels within the real defect region.

[0077] In this embodiment of the invention, when the defect on the silkscreen edge is located within the actual defect area, the defect type corresponding to the actual defect area is determined based on the grayscale mean, which can relatively easily and quickly determine the defect type of the defect on the silkscreen edge located within the actual defect area.

[0078] Based on the above solution, another optional technical solution is to determine the defect type corresponding to the real defect area based on the gray-scale mean, including: obtaining a pre-set gray-scale threshold; if the gray-scale mean is greater than or equal to the gray-scale threshold, the defect type corresponding to the real defect area is a notch defect, otherwise it is a burr defect.

[0079] Among these, it is understandable that, see Figure 3 In screen printing, burrs that are raised are typically darker in color; see also Figure 4 The color of the recessed notch defect is brighter. Based on the above characteristics of screen printing defects, a grayscale threshold corresponding to the screen printing product can be preset according to the product category. If the grayscale mean is greater than or equal to the grayscale threshold, the defect type corresponding to the actual defect area is a notch defect; otherwise, it is a burr defect.

[0080] In this embodiment of the invention, the defect type is determined based on the comparison result of the grayscale mean and grayscale threshold, which can more accurately determine the type of defect at the screen printing edge.

[0081] Example 3

[0082] Figure 5 This is a flowchart of a defect detection method provided in Embodiment 3 of the present invention. This embodiment is based on and optimized from the above-described technical solutions. In this embodiment, optionally, extracting the silkscreen edge from the silkscreen image includes: extracting drawn lines from the silkscreen image, wherein the drawn lines include lines drawn along the silkscreen edge to be extracted from the silkscreen image after the silkscreen image is generated; for each drawn point on the drawn line, starting from the drawn point, traversing the pixels on the silkscreen image along the normal direction, and determining the silkscreen point from each pixel, wherein the normal direction is towards the silkscreen edge and perpendicular to the drawn line; the edge formed by connecting all the silkscreen points is taken as the extracted silkscreen edge. The explanations of terms that are the same as or corresponding to those in the above embodiments are not repeated here.

[0083] See Figure 5 The method in this embodiment may specifically include the following steps:

[0084] S310. For screen-printed products that require screen printing edge detection, acquire the screen printing image generated after image acquisition of the screen-printed product.

[0085] S320. Extract drawing lines from the silkscreen image, wherein the drawing lines include lines drawn along the silkscreen edge to be extracted from the silkscreen image after the silkscreen image is generated.

[0086] In this context, "drawn lines" can be understood as lines drawn on the screen-printed image that are close to the edge of the screen-printed product to be extracted from the image for defect detection. The number of drawn lines can be one or more; the position of the drawn lines can be inside or outside the screen-printed edge; the shape of the drawn lines can be straight or curved; the drawn lines can be drawn manually based on the screen-printed edge or automatically based on the position of the screen-printed product in the screen-printed image. In this embodiment of the invention, no specific limitations are made on the number, position, shape, and drawing method of the drawn lines.

[0087] S330. For each drawing point on the drawing line, starting from the drawing point, traverse the pixels on the silkscreen image along the normal direction, and determine the silkscreen point from each pixel. The normal direction is the direction towards the silkscreen edge and perpendicular to the drawing line.

[0088] Here, drawing points can be understood as points set at preset intervals on the drawing lines, and drawing points can be the pixels occupied by the drawing lines on the silkscreen image.

[0089] For example, see Figure 6 For each drawing point on the drawing line, starting from the drawing point, traverse the pixels on the silkscreen image within a preset distance range along the normal direction of the drawing line at the drawing point, and determine the silkscreen point from each pixel. The normal direction is the direction towards the silkscreen edge and perpendicular to the drawing line.

[0090] S340. The edge formed by connecting all the silkscreen dots is used as the extracted silkscreen edge.

[0091] Since the extracted silkscreen points are the points on the edge of the silkscreened product in the silkscreen image, the edge formed by connecting all the silkscreen points can be used as the extracted silkscreen edge.

[0092] S350. Filter the silkscreen edge to obtain a filtered edge, wherein there are filter points on the filtered edge that correspond to each silkscreen point on the silkscreen edge.

[0093] S360. For each silkscreen point, determine the distance between the corresponding filter point and the silkscreen point, and determine whether the silkscreen point is a defect point based on the distance.

[0094] S370. Detect whether there are defects on the edge of the silkscreen based on whether each silkscreen dot is a defect dot.

[0095] The technical solution of this invention extracts the drawing lines from the screen printing image. For each drawing point on the drawing line, starting from the drawing point, the pixels on the screen printing image are traversed along the normal direction, and the screen printing point is determined from each pixel. Then, the edge formed by connecting all the screen printing points can be used as the extracted screen printing edge, thereby improving the accuracy of the extracted screen printing edge.

[0096] An optional technical solution for determining silkscreen points from each pixel includes: for each current point in each pixel, calculating the absolute value of the grayscale difference between the grayscale value of the current point and the grayscale value of the adjacent points, wherein the adjacent points are the pixels that are traversed after the current point and are adjacent to the current point; and taking the current point corresponding to the largest absolute value as the silkscreen point.

[0097] Here, the current point can be understood as the pixel that is currently being calculated along the normal direction to determine whether it is a silkscreen point. In practical applications, optionally, the current point can also be any pixel within a preset distance range along the normal direction that is being calculated to determine whether it is a silkscreen point.

[0098] It is important to understand that, considering the characteristics of screen printing, the difference in grayscale values ​​between pixels located on the screen printing pattern (such as screen printing text and images) and pixels not located on the screen printing pattern is quite significant. Therefore, based on this characteristic, for each current point in each pixel, the absolute value of the grayscale difference between the current point and the grayscale values ​​of the adjacent points can be calculated. The absolute values ​​corresponding to each current point are compared with each other, and the current point corresponding to the largest absolute value is taken as the screen printing point.

[0099] For example, the normal direction can be used as the horizontal axis X, and the drawing line perpendicular to the normal at the drawing point can be used as the vertical axis Y. The horizontal coordinate of the pixel on the silkscreen image traversed along the normal direction is x, and the vertical coordinate is g(x). The gray value of the current point is f(x, g(x)). The absolute value of the gray value between each current point and the gray value of the adjacent points is calculated, and the largest absolute value is found, max(|f(x+1, g(x+1))-f(x, g(x))|). The current point f(x) corresponding to the largest absolute value is then used. a g(x) a ()) is used as the silkscreen point. A preset distance range can be used as the domain of x.

[0100] By taking the absolute value of the grayscale difference between the current point and its adjacent points, the current point corresponding to the largest grayscale value can be used as the silkscreen point, which can accurately determine the silkscreen point.

[0101] To better understand the technical solutions of the above embodiments of the present invention, an optional example is provided herein. For example, see... Figure 7 The process involves: acquiring images of the screen-printed product and preprocessing the acquired images to remove reflective points; extracting the screen-printed edges from the preprocessed images and filtering them to obtain filtered edges; determining the position of each screen-printed point on the screen-printed edge and the position of each filtered point on the filtered edge; then, for each screen-printed point, calculating the distance between the screen-printed point and the filtered point based on the position of the screen-printed point and its corresponding filtered point, and comparing the distance with a distance threshold to determine whether the screen-printed point is a defect point; constructing pseudo-defect regions based on the defect points and determining whether there are real defect regions in the pseudo-defect regions; if there are no real defect regions in the pseudo-defect regions, the screen-printed product is considered qualified; if there are real defect regions in the pseudo-defect regions, determining whether the average grayscale value of each real defect region is greater than a grayscale threshold; if it is greater than the grayscale threshold, the defect in the real defect region is a notch defect; if it is less than or equal to the grayscale threshold, the defect in the real defect region is a burr defect.

[0102] To better understand the technical solutions of the above embodiments of the present invention, another optional example is provided here. For example, see... Figure 8 The process involves acquiring images of screen-printed products and preprocessing the acquired images to remove reflective points. The screen-printed edges are then extracted from the preprocessed images, filtered, and analyzed to determine if defects exist. If defects are found, the actual defect areas are categorized, and the defect detection process ends upon completion of the categorization. If no defects are found, the process checks whether the screen-printed product requiring defect detection has been photographed. If photographing is complete, the defect detection process ends; otherwise, the image acquisition of the screen-printed product is repeated.

[0103] Example 4

[0104] Figure 9 This is a structural block diagram of a defect detection device provided in Embodiment 4 of the present invention. This device is used to execute the defect detection method provided in any of the above embodiments. This device and the defect detection methods of the above embodiments belong to the same inventive concept. Details not described in detail in the embodiments of the defect detection device can be found in the embodiments of the above defect detection methods. See also... Figure 9 The device may specifically include: a screen printing edge extraction module 410, a filtered edge acquisition module 420, a defect point determination module 430, and a defect detection module 440.

[0105] Among them, the screen printing edge extraction module 410 is used to acquire the screen printing image generated after image acquisition of the screen printing product for screen printing products with screen printing edge detection requirements, and extract the screen printing edge from the screen printing image.

[0106] The filtering edge module 420 is used to filter the silkscreen edge to obtain the filtered edge, wherein there are filtering points on the filtered edge that correspond to each silkscreen point on the silkscreen edge.

[0107] The defect point determination module 430 is used to determine the distance between the filter point corresponding to each silkscreen point and the silkscreen point, and to determine whether the silkscreen point is a defect point based on the distance.

[0108] The defect detection module 440 is used to detect whether there are defects on the edge of the silkscreen based on whether each silkscreen point is a defect point.

[0109] Optionally, the defect detection module 440 may include:

[0110] The pseudo-defect region is obtained by a unit, which is used to extract at least one defect point from each silkscreen point based on whether each silkscreen point is a defect point, and to construct at least one pseudo-defect region based on at least one defect point.

[0111] The real defect region determination unit is used to determine whether a pseudo-defect region is a real defect region for each pseudo-defect region based on the region area and / or region size of the pseudo-defect region.

[0112] The defect detection unit is used to detect whether there are defects on the silkscreen edge based on whether each pseudo-defect area is a real defect area.

[0113] Based on the above solution, the defect detection device may optionally include:

[0114] The serial number acquisition module is used to acquire the serial number of each silkscreen point, wherein the serial number of the silkscreen point is used to represent the position of the silkscreen point on the edge of the silkscreen.

[0115] The pseudo-defect region can be used to obtain elements, which may include:

[0116] A defect group determination subunit is used to determine at least one defect group from at least one defect point, wherein the sequence numbers of the defect points in each defect group are consecutive.

[0117] The pseudo-defect region construction sub-unit is used to construct a pseudo-defect region for each defect group based on each defect point within the defect group.

[0118] Based on the above solution, the defect detection device may optionally include:

[0119] The defect location determination module is used to determine whether the defect on the silkscreen edge is located within the actual defect area when a defect is detected on the silkscreen edge.

[0120] The defect type determination module is used to obtain the average gray value of the real defect area based on the gray value of each point in the real defect area, and to determine the defect type corresponding to the real defect area based on the average gray value.

[0121] Based on the above solution, the optional defect type determination module may include:

[0122] Grayscale threshold acquisition unit, used to acquire a pre-set grayscale threshold;

[0123] The defect type determination unit is used to determine the defect type of the actual defect area as a notch defect when the grayscale mean is greater than or equal to the grayscale threshold, and otherwise as a burr defect.

[0124] Optionally, the silkscreen edge extraction module 410 may include:

[0125] The drawing line extraction unit is used to extract drawing lines from a screen printing image, wherein the drawing lines include lines drawn along the screen printing edge to be extracted from the screen printing image after the screen printing image is generated;

[0126] The silkscreen point determination unit is used to, for each drawing point on the drawing line, traverse the pixels on the silkscreen image along the normal direction starting from the drawing point, and determine the silkscreen point from each pixel. The normal direction is the direction towards the silkscreen edge and perpendicular to the drawing line.

[0127] The screen printing edge extraction unit is used to connect all the screen printing points to form the edge, which is then extracted as the screen printing edge.

[0128] Based on the above solution, the optional screen printing dot determination unit may include:

[0129] The grayscale difference calculation subunit is used to calculate the absolute value of the grayscale difference between the current point and the grayscale value of the neighboring points for each current point in each pixel. The neighboring points are the pixels that are traversed after the current point and are adjacent to the current point.

[0130] The silkscreen point is used as a sub-unit to select the current point corresponding to the largest absolute value as the silkscreen point.

[0131] The defect detection device provided in Embodiment 4 of this invention uses a screen printing edge extraction module to acquire a screen printing image generated after image acquisition of the screen printing product for products requiring screen printing edge detection, and extracts the screen printing edges from the image. A filtering edge obtaining module then filters the screen printing edges to obtain filtered edges, where each filtered edge contains a filter point corresponding to a screen printing point on the edge. A defect point determination module then determines the distance between the filtered point and the screen printing point for each screen printing point, and determines whether the screen printing point is a defect point based on the distance. Finally, the defect detection module detects whether a defect exists on the screen printing edge based on whether each screen printing point is a defect point. This device, by determining defect points based on the screen printing points on the screen printing edge and the filter points on the filtered edge, and then detecting defects on the screen printing edge based on these defect points, can automatically detect the presence of defects on the screen printing edge using only the screen printing edge of the product itself, achieving a fast and accurate detection of screen printing defects.

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

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

[0134] Example 5

[0135] Figure 10 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0136] like Figure 10As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded into the RAM 13 from storage unit 18. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0137] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0138] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as defect detection methods.

[0139] In some embodiments, the defect detection method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the defect detection method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the defect detection method by any other suitable means (e.g., by means of firmware).

[0140] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0141] Computer programs used to implement the methods of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs can be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0142] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0143] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0144] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0145] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through a communication network. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0146] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0147] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A defect detection method, characterized in that, include: For screen-printed products that require screen printing edge detection, a screen printing image is obtained after image acquisition of the screen-printed product, and the screen printing edges are extracted from the screen printing image. The silkscreen edge is filtered to obtain a filtered edge, wherein the filtered edge contains filter points that correspond to each silkscreen point on the silkscreen edge; For each silkscreen point, the distance between the corresponding filter point and the silkscreen point is determined, and whether the silkscreen point is a defect point is determined based on the distance. Based on whether each of the silkscreen dots is a defect dot, it is detected whether there is a defect on the edge of the silkscreen. Extracting the silkscreen edge from the silkscreen image includes: The drawing lines are extracted from the screen printing image, wherein the drawing lines include lines drawn along the screen printing edge to be extracted from the screen printing image after the screen printing image is generated; For each drawing point on the drawing line, starting from the drawing point, traverse the pixels on the silkscreen image along the normal direction, and determine the silkscreen point from each pixel. The normal direction is the direction towards the silkscreen edge and perpendicular to the drawing line. The drawing point is a point set at a preset distance on the drawing line, and the drawing point is the pixel occupied by the drawing line on the silkscreen image. The edge formed by connecting all the silkscreen dots is the extracted silkscreen edge.

2. The method according to claim 1, characterized in that, The step of detecting whether there is a defect on the edge of the silkscreen based on whether each silkscreen dot is a defect dot includes: Based on whether each silkscreen point is a defect point, at least one defect point is extracted from each silkscreen point, and at least one pseudo-defect region is constructed based on the at least one defect point; For each of the pseudo-defect regions, determine whether the pseudo-defect region is a real defect region based on the region area and / or region size. Based on whether each of the pseudo-defect areas is a real defect area, the presence of defects on the silkscreen edge is detected.

3. The method according to claim 2, characterized in that, Also includes: The serial number of each silkscreen point is obtained, wherein the serial number of the silkscreen point is used to characterize the position of the silkscreen point on the edge of the silkscreen. The process of constructing at least one pseudo-defect region based on the at least one defect point includes: At least one defect group is determined from the at least one defect point, wherein the defect points in each defect group are sequentially numbered; For each defect group, a pseudo-defect region is constructed based on each defect point within the defect group.

4. The method according to claim 2, characterized in that, Also includes: If a defect is detected on the edge of the silkscreen, it is determined that the defect on the edge of the silkscreen is located within the actual defect area; Based on the gray values ​​of each point within the actual defect area, the average gray value of the actual defect area is obtained, and the defect type corresponding to the actual defect area is determined based on the average gray value.

5. The method according to claim 4, characterized in that, Determining the defect type corresponding to the actual defect region based on the grayscale mean includes: Obtain the pre-set grayscale threshold; If the average grayscale value is greater than or equal to the grayscale threshold, the defect type corresponding to the actual defect area is a notch defect; otherwise, it is a burr defect.

6. The method according to claim 1, characterized in that, Determining the silkscreen point from each of the pixels includes: For each current point among the pixels, calculate the absolute value of the gray value difference between the gray value of the current point and the gray value of the neighboring points, wherein the neighboring points are the pixels that are traversed after the current point and are adjacent to the current point. The current point corresponding to the largest absolute value is taken as the silkscreen point.

7. A defect detection device, characterized in that, include: The screen printing edge extraction module is used to acquire a screen printing image generated after image acquisition of the screen printing product for screen printing products that require screen printing edge detection, and to extract the screen printing edges from the screen printing image. The filtering edge obtaining module is used to filter the silkscreen edge to obtain a filtered edge, wherein the filtered edge has filtering points corresponding to each silkscreen point on the silkscreen edge; The defect point determination module is used to determine the distance between the filter point corresponding to the silkscreen point and the silkscreen point for each silkscreen point, and determine whether the silkscreen point is a defect point based on the distance. The defect detection module is used to detect whether there are defects on the edge of the silkscreen based on whether each silkscreen point is a defect point; The screen printing edge extraction module includes: A line extraction unit is used to extract drawing lines from the screen printing image, wherein the drawing lines include lines drawn along the screen printing edge to be extracted from the screen printing image after the screen printing image is generated; A screen printing point determination unit is used to, for each drawing point on the drawing line, traverse the pixels on the screen printing image along the normal direction starting from the drawing point, and determine the screen printing point from each pixel, wherein the normal direction is a direction towards the edge of the screen printing and perpendicular to the drawing line; wherein the drawing point is a point set at a preset distance on the drawing line, and the drawing point is a pixel occupied by the drawing line on the screen printing image; The screen printing edge extraction unit is used to connect all the screen printing points to form an edge, which is then extracted as the screen printing edge.

8. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to cause the at least one processor to perform the defect detection method as described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the defect detection method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Screen printing positioning method, screen printing defect detection method and related device

    CN109584220A

  • Silk printing line detecting method and device, storage medium and processor

    CN110018169A

  • Edge defect detection method and detection device

    JP2008014831A