CN110533660B - Method for detecting silk-screen defect of electronic product shell - Google Patents

Method for detecting silk-screen defect of electronic product shell Download PDF

Info

Publication number
CN110533660B
CN110533660B CN201910829205.3A CN201910829205A CN110533660B CN 110533660 B CN110533660 B CN 110533660B CN 201910829205 A CN201910829205 A CN 201910829205A CN 110533660 B CN110533660 B CN 110533660B
Authority
CN
China
Prior art keywords
image
area
detected
template
binarization
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910829205.3A
Other languages
Chinese (zh)
Other versions
CN110533660A (en
Inventor
毛亮
张立兴
孟春婵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bokeshi Suzhou Technology Co ltd
Original Assignee
Bokeshi Suzhou Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bokeshi Suzhou Technology Co ltd filed Critical Bokeshi Suzhou Technology Co ltd
Priority to CN201910829205.3A priority Critical patent/CN110533660B/en
Publication of CN110533660A publication Critical patent/CN110533660A/en
Application granted granted Critical
Publication of CN110533660B publication Critical patent/CN110533660B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/155Segmentation; Edge detection involving morphological operators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30168Image quality inspection
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Quality & Reliability (AREA)
  • Geometry (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a detection method for silk-screen defects of an electronic product shell, which comprises the following steps: photographing the shell of the electronic product qualified by screen printing, and collecting a template image which can be used as a screen printing defect judging standard; opening template setting software to set, loading template images to process and store the template images as template files; photographing the shell of the electronic product to be detected, and collecting a to-be-detected image of the shell of the electronic product to be detected; loading a template file, processing an image to be detected according to a template image stored in the template file, and extracting the characteristics of a connected domain of a silk-screen region of the image to be detected; each connected domain of the to-be-detected image screen printing region and each connected domain of the corresponding template image screen printing region are mutually calculated and Euclidean distance based on position relation is matched one to one; and matching the connected domain of the screen printing region of the template image with the connected domain of the screen printing region of the image to be detected, and detecting whether the screen printing pattern corresponding to the connected domain of the image to be detected has a screen printing defect.

Description

Method for detecting silk-screen defect of electronic product shell
Technical Field
The invention relates to the field of defect detection, in particular to a method for detecting silk-screen defects of an electronic product shell, which mainly comprises the steps of detecting the quality of a shell module after a silk-screen process or detecting the quality of a finished product receiving and delivering link of the product, and replacing human eyes to detect the defects of silk-screen appearance, wherein the defects comprise: printing, offset, incomplete, sticky, fuzzy, rough edges, position offset, and chromatic aberration.
Background
At present, manual visual inspection is mainly adopted in silk screen inspection of plastic shells of electronic products, for some customers with high appearance quality requirements, AOI (optical automatic inspection) equipment which is required to be imported by manufacturing enterprises is required to replace human eyes for inspection, the factory yield of the products is ensured by double detection of human beings, along with gradual increase of labor cost and gradual increase of quality requirements of the customer products, more and more factories hopefully desire to import AOI inspection equipment to improve enterprise competitiveness, and the functions of the AOI equipment are from obvious defect detection requirements such as error mixing and the like on silk screen printing on the initial shells to finer and finer defect detection requirements such as slight defect, adhesion, blurring, color difference, position deviation and the like, and exceed the detection capability of the existing industry detection equipment
The screen printing defect detection on the shell of the existing electronic product mainly adopts a bowl light source or a coaxial light source, and is matched with a set of high-definition industrial cameras with the resolution of 500-1000 ten thousand to photograph the surface of the product, as shown in figure 1. The light paths are uniformly illuminated from top to bottom, so that the screen printing detection of the surface of the planar shell can be satisfied, but for more shells with a certain radian, the lighting effect at the side edges of the shells can be poor, and in order to adapt to the product shells with relatively large sizes, the resolution ratio of the existing camera is insufficient to clearly image fine screen printing defects. In addition, for the high-light product shell or the silk screen image and text which is relatively poor and relatively close to the shell background, the existing product cannot be judged, and still can be judged by manpower.
Because the detection function of the device is only an obvious miscibility function, the algorithm complexity is low, and the screen printing image-text is generally compared with the template image-text, and the statistical feature analysis is carried out to judge whether the screen printing has defects. Because the silk-screen difference between the silk-screen defects of obvious miscibility and template is large in statistics, the technical scheme is feasible, but the statistical difference is not obvious for small defects such as slight incomplete, fuzzy and the like, and the detection rate and the false detection rate cannot meet the production line requirement. In addition, the types of silk-screen images and texts are very rich, and the product of a production line is changed very frequently, so that an independent mathematical model cannot be established for a single pattern to perform defect analysis, the only effective information which can be used is the pattern of the template silk-screen, the fine defect is detected, the template is required to be imaged in higher resolution, and effective judgment is only possible after registration alignment is performed more accurately.
For whether the characters printed by silk screen have errors or are not printed, the existing character recognition technology has specific requirements on characters such as fonts, types of the characters and the like, and even if the characters can be recognized, whether the characters have slight blurring or incomplete defects and the like cannot be judged, and a character recognition algorithm cannot recognize various icon patterns, so that the character recognition technology cannot be suitable for detecting graphic and text defects of silk screen.
The defect judgment for the graphics and texts also has similar defect detection application in the publishing and printing industry, is similar to newspaper industry, banknote printing and other equipment in the printing industry, generally adopts a large-breadth line scanning solution, aims at standard printing graphics and texts on the surface of paper materials, is huge in equipment and high in price, and is difficult to directly apply to silk-screen defect detection of small-size electronic product shells in both structure and algorithm scheme.
Disclosure of Invention
The invention aims to provide a detection method for the silk-screen defects of the shell of an electronic product, which is capable of being suitable for the requirements of a production line and is well applied to the actual production line, because silk-screen defects on the shell of the electronic product are detected in various textures of the shell, including high smoothness, frosting and common, the color, shape and size of the shell are various, the content and the format of silk-screen with different styles are different, the requirements on the detection precision are high, and the detection method for the silk-screen defects of the shell of the electronic product is designed according to the actual application requirements.
In order to achieve the above object, the present invention is realized according to the following technical scheme:
a detection method for screen printing defects of an electronic product shell comprises the following steps:
step S1: photographing the shell of the electronic product qualified by screen printing, and collecting a template image which can be used as a screen printing defect judging standard;
step S2: opening template setting software to set, loading template images to process and store the template images as template files;
step S3: photographing the shell of the electronic product to be detected, and collecting a to-be-detected image of the shell of the electronic product to be detected;
step S4: loading a template file, processing an image to be detected according to a template image stored in the template file, and extracting the characteristics of a connected domain of a silk-screen region of the image to be detected;
step S5: each connected domain of the to-be-detected image screen printing region and each connected domain of the corresponding template image screen printing region are mutually calculated and Euclidean distance based on position relation is matched one to one;
step S6: and matching and pairing the connected domain of the template image silk-screen region and the connected domain of the to-be-detected image silk-screen region one by one, and detecting whether silk-screen defects exist in silk-screen patterns corresponding to the to-be-detected image connected domain.
In the above technical solution, step S2 specifically includes the following steps:
step S201: performing frame selection on a silk-screen region in a template image through template setting software, copying out the frame selection region, and converting the frame selection region into a gray level image;
step S202: performing binarization processing on the gray level map, and obtaining a binary map meeting the requirements by adjusting parameters of a binarization algorithm;
step S203: morphological filtering is carried out on the binarization graph to remove small block noise in the binarization graph;
step S204: extracting each connected domain in the binarization graph, and calculating basic characteristics of each connected domain;
step S205: steps, parameters, pictures and data involved in the process of processing the template images are saved into a template file.
In the above technical solution, step S4 specifically includes the following steps:
step S401: selecting the screen printing region in the image to be detected according to the frame selection position and the range of the screen printing region of the template image stored in the template file,
step S402: copying out the frame selection area of the image to be detected and converting the frame selection area into a gray level image;
step S403: binarizing the gray level map of the image to be detected according to the binarization parameters in the template file to obtain a binarization map;
step S404: performing morphological filtering on the binarization map according to morphological filtering parameters in the template file to remove small block noise in the binarization map;
step S405: each connected domain in the binarization map is extracted, and basic features of each connected domain are calculated.
In the above technical solution, in step S6, the connected domain of the screen printing region of the image to be inspected successfully matched with the connected domain of the screen printing region of the template image is detected by the following method:
step S601: taking the central point of the image communication domain to be detected as the region center, taking the length and width of the image communication domain to be detected as the basic length and width of the region, and scaling the region relative to the region center within the set step length and scaling multiple range, wherein a candidate comparison region can be obtained after scaling once;
step S602: respectively finding out an area image corresponding to each candidate comparison area on a screen printing area gray scale map of the image to be detected;
step S603: respectively normalizing each region image to the size of an image region corresponding to the template image connected domain on the template image silk-screen region gray level map, and performing difference making on the normalized image and the image in the image region to obtain a difference value map;
step S604: taking the set minimum difference threshold as a binarization threshold of each difference graph, and performing binarization operation on each difference graph to obtain a binarization graph;
step 605: counting the total foreground area of each calculated binarization map, taking the candidate comparison area corresponding to the binarization map with the minimum total foreground area as the optimal registration position, extracting each connected domain of the binarization map with the minimum total foreground area, and calculating the characteristics of each connected domain;
step S606: judging whether the extracted characteristics of each connected domain have objects exceeding the set minimum silk-screen defect characteristics; if the defects exist, the defect areas corresponding to the exceeded connected domains are marked on the silk-screen patterns corresponding to the connected domains of the image to be detected.
In the above technical solution, in step S6, the connected domain of the to-be-detected image silk-screen region that cannot be matched with the connected domain of the template image silk-screen region is detected by the following method:
step S6011: generating a search area with the same size as the area occupied by the communicating area of the image to be detected on the relative position of the screen printing area binarization map of the template image according to the position of the communicating area of the image to be detected on the screen printing area binarization map of the image to be detected;
step S6021: the search areas are respectively moved up, down, left and right once according to the set pixel distance, so that four search areas in different positions are obtained, each search area scales the area relative to the center of the area within the set step length and scaling multiple range, and each search area can obtain a candidate search area once;
step S6031: respectively finding out an area image corresponding to each candidate search area on the template image screen printing area gray level map, respectively normalizing each area image to the size of an image area corresponding to the communication area which is not successfully matched on the image to be detected on the image screen printing area gray level map, and performing difference between the normalized image area and the image in the image area to obtain a difference value map;
step S6041: taking the set minimum difference threshold as a binarization threshold of each difference graph, and performing binarization operation on each difference graph to obtain a binarization graph;
step S6051: counting the total foreground area of each calculated binarization map, taking the candidate search area corresponding to the binarization map with the minimum total foreground area as the optimal registration position, extracting each connected domain of the binarization map with the minimum total foreground area, and calculating the characteristics of each connected domain;
step S6061: judging whether the extracted characteristics of each connected domain have objects exceeding the set minimum silk-screen defect characteristics; if the defects exist, the defect areas corresponding to the exceeded connected domains are marked on the silk-screen pattern corresponding to the connected domain of the image to be detected.
In the above technical solution, in step S6, if the connected domain of the template image silk-screen region cannot be matched with any connected domain of the to-be-detected image silk-screen region, the detection is performed by the following method:
step S61: generating a search area with the same size as the area occupied by the template image connected domain on the relative position of the screen printing area binarization map of the image to be detected according to the position of the template image connected domain on the screen printing area binarization map of the template image;
step S62: the search areas are respectively moved up, down, left and right once according to the set pixel distance to obtain four search areas in different positions, each search area scales the area relative to the center of the area within the set step length and scaling multiple range, and each search area can obtain a candidate search area once;
step S63: respectively finding out an area image corresponding to each candidate search area on the screen printing area gray level map of the image to be detected, respectively normalizing each area image to the size of an image area corresponding to the communication area which is not successfully matched on the template image on the screen printing area gray level map of the template image, and performing difference between the normalized communication area and the image in the image area to obtain a difference value map;
step S64: taking the set minimum difference threshold as a binarization threshold of each difference graph, performing binarization operation on each difference graph to obtain a binarization graph,
step S65: counting the total foreground area of each calculated binarization map, taking the candidate search area corresponding to the binarization map with the minimum total foreground area as the optimal registration position, extracting each connected domain of the binarization map with the minimum total foreground area, calculating the characteristics of each connected domain,
step S66: judging whether the extracted characteristics of each connected domain have objects exceeding the set minimum silk-screen defect characteristics; if the template image silk-screen region exists, the defect regions corresponding to the exceeded connected regions are identified on the region where the connected regions of the template image silk-screen region are located at the opposite positions on the silk-screen region of the image to be detected.
Compared with the prior art, the invention has the following beneficial effects:
the invention can realize the detection of fine defects aiming at various image-text silk-screen printing, and the detection index is high. In addition, the product has quick model change, various formats and various shell textures are suitable, and the application range of the product is wide.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained from these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a prior art detection device;
FIG. 2 is a schematic diagram of the detection method of the present invention;
FIG. 3 is a schematic diagram of an overall detection flow;
FIG. 4 is a template matching flow chart;
FIG. 5 is a multi-scale search matching flow;
FIG. 6 is a schematic diagram of a detection result according to the present invention;
FIG. 7 is a schematic diagram of another detection result according to the present invention;
FIG. 8 is an example of the overall operational flow of the present invention;
FIG. 9 is a table of detection indicators according to the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention.
Referring to fig. 2 and 3, the invention provides a method for detecting a silk-screen defect of an electronic product shell, which comprises the following steps:
step S1: photographing the shell of the electronic product qualified by screen printing, and collecting a template image which can be used as a screen printing defect judging standard;
step S2: opening template setting software to set, loading template images to process and store the template images as template files;
step S3: photographing the shell of the electronic product to be detected, and collecting a to-be-detected image of the shell of the electronic product to be detected;
step S4: loading a template file, processing an image to be detected according to a template image stored in the template file, and extracting the characteristics of a connected domain of a silk-screen region of the image to be detected;
step S5: each connected domain of the to-be-detected image screen printing region and each connected domain of the corresponding template image screen printing region are mutually calculated and Euclidean distance based on position relation is matched one to one;
step S6: and matching and pairing the connected domain of the template image silk-screen region and the connected domain of the to-be-detected image silk-screen region one by one, and detecting whether silk-screen defects exist in silk-screen patterns corresponding to the to-be-detected image connected domain.
In the present invention, when all the template area settings are saved in the specified template file, the detection is ended.
The step S2 specifically comprises the following steps:
step S201: performing frame selection on a silk-screen region in a template image through template setting software, copying out the frame selection region, and converting the frame selection region into a gray level image;
step S202: performing binarization processing on the gray level map, and obtaining a binary map meeting the requirements by adjusting parameters of a binarization algorithm;
step S203: morphological filtering is carried out on the binarization graph to remove small block noise in the binarization graph; wherein the morphological filtering adopts a corrosion expansion algorithm.
Step S204: extracting each connected domain in the binarization graph, and calculating basic characteristics of each connected domain;
step S205: steps, parameters, pictures and data involved in the process of processing the template images are saved into a template file.
In the above technical solution, step S4 specifically includes the following steps:
step S401: selecting the screen printing region in the image to be detected according to the frame selection position and the range of the screen printing region of the template image stored in the template file,
step S402: copying out the frame selection area of the image to be detected and converting the frame selection area into a gray level image;
step S403: binarizing the gray level map of the image to be detected according to the binarization parameters in the template file to obtain a binarization map;
step S404: performing morphological filtering on the binarization map according to morphological filtering parameters in the template file to remove small block noise in the binarization map;
step S405: each connected domain in the binarization map is extracted, and basic features of each connected domain are calculated.
As shown in fig. 4, in step S6, the connected domain of the screen region of the image to be inspected successfully matched with the connected domain of the screen region of the template image is detected by the following method:
step S601: taking the central point of the image communication domain to be detected as the region center, taking the length and width of the image communication domain to be detected as the basic length and width of the region, and scaling the region relative to the region center within the set step length and scaling multiple range, wherein a candidate comparison region can be obtained after scaling once;
step S602: respectively finding out an area image corresponding to each candidate comparison area on a screen printing area gray scale map of the image to be detected;
step S603: respectively normalizing each region image to the size of an image region corresponding to the template image connected domain on the template image silk-screen region gray level map, and performing difference making on the normalized image and the image in the image region to obtain a difference value map;
step S604: taking the set minimum difference threshold as a binarization threshold of each difference graph, and performing binarization operation on each difference graph to obtain a binarization graph;
step 605: counting the total foreground area of each calculated binarization map, taking the candidate comparison area corresponding to the binarization map with the minimum total foreground area as the optimal registration position, extracting each connected domain of the binarization map with the minimum total foreground area, and calculating the characteristics of each connected domain;
step S606: judging whether the extracted characteristics of each connected domain have objects exceeding the set minimum silk-screen defect characteristics; if the defects exist, the defect areas corresponding to the exceeded connected domains are marked on the silk-screen patterns corresponding to the connected domains of the image to be detected.
As shown in fig. 5, in step S6, the connected domain of the screen printing region of the image to be inspected, which cannot be matched with the connected domain of the screen printing region of the template image, is detected by the following method:
step S6011: generating a search area with the same size as the area occupied by the communicating area of the image to be detected on the relative position of the screen printing area binarization map of the template image according to the position of the communicating area of the image to be detected on the screen printing area binarization map of the image to be detected;
step S6021: the search areas are respectively moved up, down, left and right once according to the set pixel distance, so that four search areas in different positions are obtained, each search area scales the area relative to the center of the area within the set step length and scaling multiple range, and each search area can obtain a candidate search area once;
step S6031: respectively finding out an area image corresponding to each candidate search area on the template image screen printing area gray level map, respectively normalizing each area image to the size of an image area corresponding to the communication area which is not successfully matched on the image to be detected on the image screen printing area gray level map, and performing difference between the normalized image area and the image in the image area to obtain a difference value map;
step S6041: taking the set minimum difference threshold as a binarization threshold of each difference graph, and performing binarization operation on each difference graph to obtain a binarization graph;
step S6051: counting the total foreground area of each calculated binarization map, taking the candidate search area corresponding to the binarization map with the minimum total foreground area as the optimal registration position, extracting each connected domain of the binarization map with the minimum total foreground area, and calculating the characteristics of each connected domain;
step S6061: judging whether the extracted characteristics of each connected domain have objects exceeding the set minimum silk-screen defect characteristics; if the defects exist, the defect areas corresponding to the exceeded connected domains are marked on the silk-screen pattern corresponding to the connected domain of the image to be detected.
As shown in fig. 5, in step S6, if the connected domain of the template image silk-screen region cannot be matched with any connected domain of the image silk-screen region to be detected, the detection is performed by the following method:
step S61: generating a search area with the same size as the area occupied by the template image connected domain on the relative position of the screen printing area binarization map of the image to be detected according to the position of the template image connected domain on the screen printing area binarization map of the template image;
step S62: the search areas are respectively moved up, down, left and right once according to the set pixel distance to obtain four search areas in different positions, each search area scales the area relative to the center of the area within the set step length and scaling multiple range, and each search area can obtain a candidate search area once;
step S63: respectively finding out an area image corresponding to each candidate search area on the screen printing area gray level map of the image to be detected, respectively normalizing each area image to the size of an image area corresponding to the communication area which is not successfully matched on the template image on the screen printing area gray level map of the template image, and performing difference between the normalized communication area and the image in the image area to obtain a difference value map;
step S64: taking the set minimum difference threshold as a binarization threshold of each difference graph, performing binarization operation on each difference graph to obtain a binarization graph,
step S65: counting the total foreground area of each calculated binarization map, taking the candidate search area corresponding to the binarization map with the minimum total foreground area as the optimal registration position, extracting each connected domain of the binarization map with the minimum total foreground area, calculating the characteristics of each connected domain,
step S66: judging whether the extracted characteristics of each connected domain have objects exceeding the set minimum silk-screen defect characteristics; if the template image silk-screen region exists, the defect regions corresponding to the exceeded connected regions are identified on the region where the connected regions of the template image silk-screen region are located at the opposite positions on the silk-screen region of the image to be detected.
In the present invention, the step size set in step S6 is 0.05, the scaling factor is set to 0.8 to 1.3, and the set pixel distance is 10 pixel distances.
The detection result is shown in fig. 6 and 7, and the slight defect on the graph is framed, so that the method can detect the slight defect on the graph.
The whole flow is shown in fig. 8, a qualified sample graph is collected as a template, a template is manufactured, an image to be detected is collected, whether the detected image is defective or not is judged, the batch test result is shown in fig. 9, 115 qualified products and 105 defective products are detected, and false alarm and missing report are not generated.
The foregoing describes specific embodiments of the present invention. It is to be understood that the invention is not limited to the particular embodiments described above, and that various changes or modifications may be made by those skilled in the art within the scope of the appended claims without affecting the spirit of the invention. The embodiments of the present application and features in the embodiments may be combined with each other arbitrarily without conflict.

Claims (5)

1. The method for detecting the silk-screen defect of the shell of the electronic product is characterized by comprising the following steps of:
step S1: photographing the shell of the electronic product qualified by screen printing, and collecting a template image which can be used as a screen printing defect judging standard;
step S2: opening template setting software to set, loading template images to process and store the template images as template files;
step S3: photographing the shell of the electronic product to be detected, and collecting a to-be-detected image of the shell of the electronic product to be detected;
step S4: loading a template file, processing an image to be detected according to a template image stored in the template file, and extracting the characteristics of a connected domain of a silk-screen region of the image to be detected;
step S5: each connected domain of the to-be-detected image screen printing region and each connected domain of the corresponding template image screen printing region are mutually calculated and Euclidean distance based on position relation is matched one to one;
step S6: matching and pairing the connected domains of the template image silk-screen region and the connected domains of the to-be-detected image silk-screen region one by one, and detecting whether silk-screen defects exist in silk-screen patterns corresponding to the to-be-detected image connected domains;
in step S6, the connected domain of the to-be-detected image silk-screen region successfully matched with the connected domain of the template image silk-screen region is detected by the following method:
step S601: taking the central point of the image communication domain to be detected as the region center, taking the length and width of the image communication domain to be detected as the basic length and width of the region, and scaling the region relative to the region center within the set step length and scaling multiple range, wherein a candidate comparison region can be obtained after scaling once;
step S602: respectively finding out an area image corresponding to each candidate comparison area on a screen printing area gray scale map of the image to be detected;
step S603: respectively normalizing each region image to the size of an image region corresponding to the template image connected domain on the template image silk-screen region gray level map, and performing difference making on the normalized image and the image in the image region to obtain a difference value map;
step S604: taking the set minimum difference threshold as a binarization threshold of each difference graph, and performing binarization operation on each difference graph to obtain a binarization graph;
step 605: counting the total foreground area of each calculated binarization map, taking the candidate comparison area corresponding to the binarization map with the minimum total foreground area as the optimal registration position, extracting each connected domain of the binarization map with the minimum total foreground area, and calculating the characteristics of each connected domain;
step S606: judging whether the extracted characteristics of each connected domain have objects exceeding the set minimum silk-screen defect characteristics; if the defects exist, the defect areas corresponding to the exceeded connected domains are marked on the silk-screen patterns corresponding to the connected domains of the image to be detected.
2. The method for detecting a silk-screen defect of an electronic product housing according to claim 1, wherein the step S2 specifically comprises the following steps:
step S201: performing frame selection on a silk-screen region in a template image through template setting software, copying out the frame selection region, and converting the frame selection region into a gray level image;
step S202: performing binarization processing on the gray level map, and obtaining a binary map meeting the requirements by adjusting parameters of a binarization algorithm;
step S203: morphological filtering is carried out on the binarization graph to remove small block noise in the binarization graph;
step S204: extracting each connected domain in the binarization graph, and calculating basic characteristics of each connected domain;
step S205: steps, parameters, pictures and data involved in the process of processing the template images are saved into a template file.
3. The method for detecting a silk-screen defect of an electronic product housing according to claim 2, wherein the step S4 specifically comprises the following steps:
step S401: selecting the screen printing region in the image to be detected according to the frame selection position and the range of the screen printing region of the template image stored in the template file,
step S402: copying out the frame selection area of the image to be detected and converting the frame selection area into a gray level image;
step S403: binarizing the gray level map of the image to be detected according to the binarization parameters in the template file to obtain a binarization map;
step S404: performing morphological filtering on the binarization map according to morphological filtering parameters in the template file to remove small block noise in the binarization map;
step S405: each connected domain in the binarization map is extracted, and basic features of each connected domain are calculated.
4. The method for detecting a silk-screen defect of an electronic product housing according to claim 1, wherein in step S6, the connected domain of the to-be-detected image silk-screen region that cannot be matched with the connected domain of the template image silk-screen region is detected by:
step S6011: generating a search area with the same size as the area occupied by the communicating area of the image to be detected on the relative position of the screen printing area binarization map of the template image according to the position of the communicating area of the image to be detected on the screen printing area binarization map of the image to be detected;
step S6021: the search areas are respectively moved up, down, left and right once according to the set pixel distance, so that four search areas in different positions are obtained, each search area scales the area relative to the center of the area within the set step length and scaling multiple range, and each search area can obtain a candidate search area once;
step S6031: respectively finding out an area image corresponding to each candidate search area on the template image screen printing area gray level map, respectively normalizing each area image to the size of an image area corresponding to the communication area which is not successfully matched on the image to be detected on the image screen printing area gray level map, and performing difference between the normalized image area and the image in the image area to obtain a difference value map;
step S6041: taking the set minimum difference threshold as a binarization threshold of each difference graph, and performing binarization operation on each difference graph to obtain a binarization graph;
step S6051: counting the total foreground area of each calculated binarization map, taking the candidate search area corresponding to the binarization map with the minimum total foreground area as the optimal registration position, extracting each connected domain of the binarization map with the minimum total foreground area, and calculating the characteristics of each connected domain;
step S6061: judging whether the extracted characteristics of each connected domain have objects exceeding the set minimum silk-screen defect characteristics; if the defects exist, the defect areas corresponding to the exceeded connected domains are marked on the silk-screen pattern corresponding to the connected domain of the image to be detected.
5. The method for detecting a silk-screen defect of an electronic product housing according to claim 1, wherein in step S6, if the connected domain of the silk-screen region of the template image cannot be matched with any connected domain of the silk-screen region of the image to be detected, the method is performed by:
step S61: generating a search area with the same size as the area occupied by the template image connected domain on the relative position of the screen printing area binarization map of the image to be detected according to the position of the template image connected domain on the screen printing area binarization map of the template image;
step S62: the search areas are respectively moved up, down, left and right once according to the set pixel distance to obtain four search areas in different positions, each search area scales the area relative to the center of the area within the set step length and scaling multiple range, and each search area can obtain a candidate search area once;
step S63: respectively finding out an area image corresponding to each candidate search area on the screen printing area gray level map of the image to be detected, respectively normalizing each area image to the size of an image area corresponding to the communication area which is not successfully matched on the template image on the screen printing area gray level map of the template image, and performing difference between the normalized communication area and the image in the image area to obtain a difference value map;
step S64: taking the set minimum difference threshold as a binarization threshold of each difference graph, performing binarization operation on each difference graph to obtain a binarization graph,
step S65: counting the total foreground area of each calculated binarization map, taking the candidate search area corresponding to the binarization map with the minimum total foreground area as the optimal registration position, extracting each connected domain of the binarization map with the minimum total foreground area, calculating the characteristics of each connected domain,
step S66: judging whether the extracted characteristics of each connected domain have objects exceeding the set minimum silk-screen defect characteristics; if the defect areas exist, the defect areas corresponding to the exceeding connected areas are identified on the areas where the connected areas of the to-be-detected image screen printing area and the template image screen printing area are located at the opposite positions.
CN201910829205.3A 2019-09-03 2019-09-03 Method for detecting silk-screen defect of electronic product shell Active CN110533660B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910829205.3A CN110533660B (en) 2019-09-03 2019-09-03 Method for detecting silk-screen defect of electronic product shell

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910829205.3A CN110533660B (en) 2019-09-03 2019-09-03 Method for detecting silk-screen defect of electronic product shell

Publications (2)

Publication Number Publication Date
CN110533660A CN110533660A (en) 2019-12-03
CN110533660B true CN110533660B (en) 2023-05-30

Family

ID=68666693

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910829205.3A Active CN110533660B (en) 2019-09-03 2019-09-03 Method for detecting silk-screen defect of electronic product shell

Country Status (1)

Country Link
CN (1) CN110533660B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111091556B (en) * 2019-12-13 2022-04-12 南京工程学院 Automatic detection method for scratches on surface of automobile instrument panel
CN112489002B (en) * 2020-11-24 2024-05-31 广东省电子技术研究所 Defect detection method, device, equipment and storage medium
CN115439476B (en) * 2022-11-07 2023-03-14 成都博视广达科技有限责任公司 Silk-screen defect detection method and device based on image analysis

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011076204A (en) * 2009-09-29 2011-04-14 Toppan Printing Co Ltd Method and apparatus for inspecting printed matter
CN104297254B (en) * 2014-10-08 2017-04-12 华南理工大学 Mixing-method-based method and system applied to defect detection of printed circuit board
CN105092598B (en) * 2015-09-28 2018-02-06 深圳大学 A kind of large format pcb board defect method for quickly identifying and system based on connected domain

Also Published As

Publication number Publication date
CN110533660A (en) 2019-12-03

Similar Documents

Publication Publication Date Title
CN110533660B (en) Method for detecting silk-screen defect of electronic product shell
CN114140679B (en) Defect fusion method, device, recognition system and storage medium
US5253306A (en) Method of matching patterns and apparatus therefor
CN112053318A (en) Two-dimensional PCB defect real-time automatic detection and classification device based on deep learning
CN109472271B (en) Printed circuit board image contour extraction method and device
CN111242896A (en) Color printing label defect detection and quality rating method
CN108469438A (en) A kind of printed matter detection method, device, equipment and storage medium
CN112233059B (en) Light guide plate defect detection method based on two-stage residual error attention network of segmentation and decision
CN106556611A (en) Chromatograp defect automatic checkout system and detection method based on machine vision
CN109886954B (en) Printed matter defect detection method
CN112419260A (en) PCB character area defect detection method
CN110569774B (en) Automatic line graph image digitalization method based on image processing and pattern recognition
CN113034488A (en) Visual detection method of ink-jet printed matter
CN108596829A (en) A kind of PCB bare boards picture method for registering and device
CN112861861B (en) Method and device for recognizing nixie tube text and electronic equipment
CN116580026B (en) Automatic optical detection method, equipment and storage medium for appearance defects of precision parts
CN117011878A (en) Intelligent visual recognition detection method and system for control cabinet
CN112446865A (en) Flaw identification method, flaw identification device, flaw identification equipment and storage medium
CN113506297B (en) Printing data identification method based on big data processing
CN115479891A (en) Automatic detection system and method for circuit board mounted components based on image recognition
Liu et al. Industrial Printing Image Defect Detection Using Multi‐Edge Feature Fusion Algorithm
CN108898584A (en) A kind of full-automatic veneering capacitor welding equipment polarity discriminating method based on image analysis
CN114638792A (en) Method for detecting polarity defect of electrolytic capacitor of plug-in circuit board
JP2008185395A (en) Mounting substrate visual inspection method
RU2249251C2 (en) Automatic recognition of symbols on structural background by combination of models of symbols and background

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant