CN112446865A - Flaw identification method, flaw identification device, flaw identification equipment and storage medium - Google Patents

Flaw identification method, flaw identification device, flaw identification equipment and storage medium Download PDF

Info

Publication number
CN112446865A
CN112446865A CN202011335994.4A CN202011335994A CN112446865A CN 112446865 A CN112446865 A CN 112446865A CN 202011335994 A CN202011335994 A CN 202011335994A CN 112446865 A CN112446865 A CN 112446865A
Authority
CN
China
Prior art keywords
template
image
image information
information
pixel point
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.)
Granted
Application number
CN202011335994.4A
Other languages
Chinese (zh)
Other versions
CN112446865B (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.)
Alnnovation Guangzhou Technology Co ltd
Original Assignee
Alnnovation Guangzhou 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 Alnnovation Guangzhou Technology Co ltd filed Critical Alnnovation Guangzhou Technology Co ltd
Priority to CN202011335994.4A priority Critical patent/CN112446865B/en
Publication of CN112446865A publication Critical patent/CN112446865A/en
Application granted granted Critical
Publication of CN112446865B publication Critical patent/CN112446865B/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
    • 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
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/30Determination of transform parameters for the alignment of images, i.e. image registration
    • G06T7/33Determination of transform parameters for the alignment of images, i.e. image registration using feature-based methods
    • G06T7/337Determination of transform parameters for the alignment of images, i.e. image registration using feature-based methods involving reference images or patches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging
    • 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/30108Industrial image inspection
    • G06T2207/30144Printing quality
    • 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/30204Marker

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Quality & Reliability (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

The application provides a flaw identification method, a flaw identification device, flaw identification equipment and a storage medium, wherein the method comprises the following steps: acquiring at least one piece of image information of an object to be detected; analyzing the image information to generate color information of each pixel point to be detected in the image information; based on the color information of each pixel point to be detected, performing color comparison on the image information and a template image in a template library to obtain a defective pixel point in the image information; and outputting the information of the defective pixel points. This application has realized carrying out the high accuracy to multiple package material printing flaw and has detected, has improved the efficiency of modelling greatly, has reduced manual work volume, has adapted to present package material printing flaw kind various, and package material kind is various, changes frequent characteristics, effectively promotes printing quality inspection efficiency.

Description

Flaw identification method, flaw identification device, flaw identification equipment and storage medium
Technical Field
The present application relates to the field of image processing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for identifying a flaw.
Background
With the rapid development of economy, various commodities pay more and more attention to outer packaging, and the requirements on the printing content and the printing quality of packaging materials are higher and higher. How to ensure the printing quality becomes an important issue.
The existing printed matter has complicated and various problems, such as scratches, missing printing, multi-printing, misprinting, dirt, overprinting, color difference and the like, in an actual scene, the content of printed patterns of a packaging material is rich and frequently updated, and great challenges are provided for the modeling speed and the detection effect of printing defect detection.
Disclosure of Invention
An object of the embodiment of the application is to provide a flaw identification method, a flaw identification device, flaw identification equipment and a storage medium, which can be used for carrying out rapid automatic modeling according to a standard packing material sample to form a template library and realizing high-precision detection on various packing material printing flaws, greatly improve modeling efficiency, reduce manual workload, adapt to the characteristics of various current packing material printing flaws, various packing material types and frequent change, and effectively improve printing quality inspection efficiency.
The first aspect of the embodiments of the present application provides a flaw identification method, including: acquiring at least one piece of image information of an object to be detected; analyzing the image information to generate color information of each pixel point to be detected in the image information; based on the color information of each pixel point to be detected, performing color comparison on the image information and a template image in a template library to obtain a defective pixel point in the image information; and outputting the information of the defective pixel points.
In an embodiment, before analyzing the image information and generating color information of each pixel point to be detected in the image information, the method further includes: aligning the image information with the template image.
In an embodiment, the analyzing the image information to generate color information of each pixel point to be detected in the image information includes: and converting each pixel point to be detected in the image information into a preset color space, and generating color information of each pixel point to be detected.
In an embodiment, the comparing, based on the color information of each pixel point to be detected, the color of the image information with the color of the template image in the template library to obtain a defective pixel point in the image information includes: based on the aligned image information, respectively carrying out color comparison on each pixel to be detected and a template pixel point at an aligned position in the template image, and judging whether a candidate pixel point which is inconsistent with the template color of the template pixel point exists in the image information; if the candidate pixel points with the template color inconsistent with that of the template pixel points exist in the image information, unstable pixel points in the candidate pixel points are filtered out based on preset marking information, and the remaining candidate pixel points generate the defective pixel points.
In an embodiment, the color comparing the image information with a template image in a template library based on the color information of each pixel point to be detected to obtain a defective pixel point in the image information further includes: and if the candidate pixel point which is inconsistent with the template color of the template pixel point does not exist in the image information, updating the image information into the template library.
In an embodiment, before the color information based on each pixel point to be detected, performing color comparison between the image information and a template image in a template library to obtain a defective pixel point in the image information, the method further includes: sequentially acquiring a plurality of sample images of a preset area of a sample object, wherein the sample object is a standard sample of the object to be detected; optionally selecting one sample image as a reference image, and aligning the rest sample images with the reference image to generate a plurality of template images; converting all the aligned template images into a gray level image, and counting the gray level variance of each template pixel point in the gray level image; and selecting effective pixels of which the gray variance is within a preset variance range from the template pixels, marking the position information of the effective pixels, and generating the preset marking information.
In an embodiment, after the optionally selecting one of the sample images as a reference image, and aligning the remaining sample images with the reference image to generate a plurality of template images, the method further includes: and converting all the aligned template images into the preset color space, and calculating the template color of each template pixel point in the template images.
A second aspect of the embodiments of the present application provides a defect identification apparatus, including: the first acquisition module is used for acquiring at least one piece of image information of the object to be detected; the analysis module is used for analyzing the image information and generating color information of each pixel point to be detected in the image information; the comparison module is used for comparing the color of the image information with that of a template image in a template library based on the color information of each pixel point to be detected to obtain a defective pixel point in the image information; and the output module is used for outputting the information of the defective pixel points.
In one embodiment, the method further comprises: and the first alignment module is used for aligning the image information with the template image before analyzing the image information and generating the color information of each pixel point to be detected in the image information.
In one embodiment, the parsing module is configured to: and converting each pixel point to be detected in the image information into a preset color space, and generating the color information of each pixel point to be detected.
In one embodiment, the alignment module is configured to: based on the aligned image information, respectively carrying out color comparison on each pixel to be detected and a template pixel point at an aligned position in the template image, and judging whether a candidate pixel point which is inconsistent with the template color of the template pixel point exists in the image information; if the candidate pixel points with the template color inconsistent with that of the template pixel points exist in the image information, unstable pixel points in the candidate pixel points are filtered out based on preset marking information, and the remaining candidate pixel points generate the defective pixel points.
In one embodiment, the alignment module is further configured to: and if the candidate pixel point which is inconsistent with the template color of the template pixel point does not exist in the image information, updating the image information into the template library.
In one embodiment, the method further comprises: the second obtaining module is used for sequentially obtaining a plurality of sample images of a preset area of a sample object before the color information of each pixel point in the image information is compared with the color of the template image in the template library to obtain a defective pixel point in the image information, wherein the sample object is a standard sample of the object to be detected; a second alignment module, configured to select one of the sample images as a reference image, align the remaining sample images with the reference image, and generate a plurality of template images; the gray module is used for converting all the aligned template images into a gray image and counting the gray variance of each template pixel point in the gray image; and the marking module is used for selecting effective pixels of the gray variance within a preset variance range from the template pixels, marking the position information of the effective pixels and generating the preset marking information.
In one embodiment, the method further comprises: and the calculation module is used for aligning the rest of the sample images with the reference image to generate a plurality of template images after the optional sample image is taken as the reference image, converting all the aligned template images into the preset color space, and calculating the template color of each template pixel point in the template images.
A third aspect of the embodiments of the present application provides an image capturing apparatus, including: a base; the bracket is arranged on the base; an imager slidably disposed on the support; the light source is arranged on the bracket and synchronously moves with the imager, and a lampshade is arranged outside the light source; the test bench is arranged on the bracket and is within the imaging range of the imager; the test board is used for placing an object to be tested, and the imager is used for collecting image information of the object to be tested.
A fourth aspect of the embodiments of the present application provides an electronic device, including: a memory to store a computer program; the processor is configured to execute the method of the first aspect and any embodiment thereof to identify defect information of the object to be tested.
A fifth aspect of embodiments of the present application provides a non-transitory electronic device-readable storage medium, including: a program which, when run by an electronic device, causes the electronic device to perform the method of the first aspect of an embodiment of the present application and any embodiment thereof.
The application provides a flaw identification method, device, equipment and storage medium, through obtaining many image information of the object that awaits measuring, calculate the color information of every pixel that awaits measuring in the image information, then carry out the color comparison with the template image with the image information, and then extract out the flaw pixel that does not accord with template image color scope from the image information, then export the information of flaw pixel as the flaw information of the object that awaits measuring, realized carrying out high accuracy to multiple package material printing flaw and detecting, the efficiency of modeling is greatly improved, the manual work load has been reduced, it is various to have adapted to present package material printing flaw kind, package material kind is various, change frequent characteristics, effectively promote printing quality testing efficiency.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 2A is a schematic diagram of an image capturing device according to an embodiment of the present application;
fig. 2B is a schematic diagram of an image capturing device according to an embodiment of the present application;
fig. 2C is a schematic diagram of an image capturing device according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating a method for defect identification according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating a method for defect identification according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a defect identification apparatus according to an embodiment of the present application.
Reference numerals:
20-image acquisition device, 21-base, 22-bracket, 23-imager, 231-lampshade, 24-light source, 25-test table, 251-pressing bar and 252-object to be tested.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. In the description of the present application, the terms "first," "second," and the like are used solely to distinguish one from another and are not to be construed as indicating or implying relative importance.
As shown in fig. 1, the present embodiment provides an electronic apparatus 1 including: at least one processor 11 and a memory 12, one processor being exemplified in fig. 1. The processor 11 and the memory 12 are connected by a bus 10. The memory 12 stores instructions executable by the processor 11, and the instructions are executed by the processor 11, so that the electronic device 1 can execute all or part of the processes of the methods in the embodiments described below to identify the defect information of the object to be tested.
In an embodiment, the electronic device 1 may be a mobile phone, a tablet computer, a notebook computer, a desktop computer, or the like.
Please refer to fig. 2A, which is an embodiment of an image capturing apparatus 20 according to the present application, the apparatus comprising: base 21, support 22, imager 23, light source 24 and test bench 25, wherein:
and a bracket 22 disposed on the base 21.
And an imager 23 slidably disposed on the support 22. The imager 23 may be an industrial camera with a dual-axis translation stage.
And a light source 24 disposed on the bracket 22 and capable of moving synchronously with the imager 23, as shown in fig. 2B, which is a bottom view of the optical imaging area, wherein a lamp cover 231 is mounted outside the light source 24, and the light source 24 may be a white light source 24. The lampshade 231 and the light source 24 move along with the camera, so that the influence of the external light source 24 can be greatly reduced, and the imaging stability is improved.
And a test station 25 disposed on the bracket 22, as shown in fig. 2C, which is a top view of the test station 25, wherein the test station 25 is within the imaging range of the imager 23, and the test station 25 is provided with beads 251 at both sides.
In an actual scene, the test platform 25 is used for placing the object 252 to be measured, and the imager 23 is used for acquiring image information of the object 252 to be measured. The object 252 to be measured can be made of a packaging material, the light source 24 and the lamp shade 231 move together with the camera under the driving of the biaxial translation stage, so that the packaging material (packaging material for short) flatly placed on the test stage 25 can be scanned and photographed block by block, the electronic device 1 can be connected with the device to obtain image information of the packaging material, and further flaw information of the packaging material can be obtained based on the image information.
Please refer to fig. 3, which is a defect identification method according to an embodiment of the present application, the method may be executed by the electronic device 1 shown in fig. 1, and may be applied to the package inspection scene shown in fig. 2A to 2C to identify defect information of the object 252 to be inspected. The method comprises the following steps:
step 301: at least one image of the object 252 is acquired.
In this step, taking the object 252 to be measured as a packaging material as an example, the image acquisition device 20 shown in fig. 2A to 2C may be used to acquire image information of a packaging material, and in an actual scene, a plurality of printing areas may exist in one packaging material and defect detection is required, so that the image information of each printing area may be acquired, and the number of pictures taken in the same area each time may be one or more, and the more the pictures are taken, the more the effect is stable.
In an embodiment, the model of the to-be-measured packing material is selected firstly, then the to-be-measured packing material is placed on the workbench, the placement position of the to-be-measured packing material is the same as the placement position of a preset standard sample during modeling, at this moment, the image acquisition device 20 is started, the to-be-measured packing material is scanned and photographed block by block under the driving of the double-shaft translation table, two pictures are continuously photographed in the same area each time, and the pictures are transmitted to the electronic device 1 to serve as the image information of the to-be-measured packing material.
Step 302: and analyzing the image information to generate color information of each pixel point to be detected in the image information.
In this step, the obtained image information of the printing area to be tested is subjected to image processing, and the color information of each pixel point to be tested in the image information is calculated.
Step 303: and comparing the color of the image information with the color of the template image in the template library based on the color information of each pixel point to be detected to obtain the defective pixel point in the image information.
In this step, a template image of a standard sample of the packing material is prestored in the template library, the template image contains standard color information of each printing area, and defective pixel points which do not meet the standard in the image information of the printing area to be detected can be obtained by comparing the image information of the printing area to be detected with the template image in color.
Step 304: and outputting the information of the defective pixel points.
In this step, the defective pixel points in the image information may represent the defective information of the printing area to be tested, so that the information of the defective pixel points may be output as the defective information of the object 252 to be tested.
In an embodiment, the defective pixel point can be highlighted, and by calculating the position of the defective pixel point, the defective pixel point is taken as 255 on the image information, and other pixel points are taken as 0, so that the image information is converted into a form of a black-and-white image, and further, the position area with the defect abnormality is highlighted.
According to the flaw identification method, through acquiring a plurality of pieces of image information of the packing material, the color information of each pixel point to be detected in the image information is calculated, then the image information is compared with the color of the template image, and then the flaw pixel points which do not accord with the color range of the template image are extracted from the image information, and then the information of the flaw pixel points is output as the flaw information of the packing material, so that the high-precision detection of various packing material printing flaws is realized, the modeling efficiency is greatly improved, the manual workload is reduced, the method is suitable for the characteristics that the current packing material printing flaws are various in types, the packing material types are various, and the change is frequent, and the printing quality inspection efficiency is effectively improved.
Please refer to fig. 4, which is a method for defect identification according to an embodiment of the present application, further including a step of creating a template library, where the method can be executed by the electronic device 1 shown in fig. 1 and can be applied to the package inspection scenes shown in fig. 2A to 2C to identify defect information of the object 252 to be inspected. The method comprises the following steps:
step 401: a plurality of sample images of a preset area of a sample object are sequentially acquired, the sample object being a standard sample of the object 252 to be measured.
In this step, the sample object may be a standard sample of a packaging material requiring defect detection, the standard sample has standard printing, no defects such as scratch, missing print, multiple prints, misprint, dirt, overprint, color difference and the like, when a template library is established, firstly, the sample determines the sample model of the standard packaging material, then, the sample object is flatly placed on a test platform 25 of an image acquisition device 20, at this time, the image acquisition device 20 is started, under the driving of a biaxial translation platform, a light source 24 and a lampshade 231 will start to scan and photograph the standard sample block by block along with a camera according to a fixed step length distance, a plurality of regions possibly exist on the sample object and the template library needs to be established, image acquisition can be carried out in regions, two pictures can be continuously taken in the same region each time, in order to increase robustness, a small part of repeated overlapping regions can exist between adjacent photographing regions, thus, several photographing cycles are performed block by block, so that several sample images of the standard sample are obtained in each area.
Step 402: and optionally selecting one sample image as a reference image, and aligning the rest sample images with the reference image to generate a plurality of template images.
In this step, in an actual scene, when the image capturing device 20 is used to capture a sample image of a sample object, the photos of the same photographing area are not necessarily identical due to the influence of mechanical arm errors, shaking and other factors. Therefore, a reference image is determined, and one of the sample images in step 401 may be selected as the reference image. For example, a first shot picture of the region to be measured is used as a reference image, and other pictures of the region to be measured need to be aligned with the reference image.
In one embodiment, the alignment process may be processed as follows: first, ORB (organized Fast and rotaed Brief, an algorithm for Fast feature point extraction and description, abbreviated as "ORB") features of a sample image to be aligned with a reference image are extracted. Then, matching is carried out based on Surf (Speeded Up Robust Feature) features of the images, a Feature point pair which is the most matched between the sample image and the reference image is found, coordinates of the optimal matching point pair are extracted, a perspective transformation matrix is generated, and finally, the sample image to be aligned is subjected to perspective transformation to generate the aligned sample image.
In an embodiment, for each aligned sample image, three channel values of RGB (Red, Green, Blue, Red, Green, and Blue color mode) may be calculated for each sample image, and then the three channel values of RGB are sorted, and a value in the middle is found as a median, and the sample image with the three channel values of RGB as the median is used as a more stable final template image, so as to reduce the influence of pixel value fluctuation caused by imaging jitter. The purpose of taking the median is to obtain the most stable data and avoid the influence of accidental data.
Step 403: and converting all the aligned template images into a gray level image, and counting the gray level variance of each template pixel point in the gray level image.
In this step, for each aligned template image, all the aligned template images are converted into gray-scale images, and then the gray-scale variance of each pixel position is counted for all the gray-scale images.
Step 404: and selecting effective pixel points with gray variance within a preset variance range from the template pixel points, marking the position information of the effective pixel points, and generating preset marking information.
In this step, in the actual scene, the camera is at the imaging process, because of the interference of factors such as shooting angle, illumination brightness, sensor error, external light source 24 stroboscopic, every pixel that the camera was imaged actually exists certain undulant, especially the characters edge on the package material, can have imaging fluctuation of great amplitude, consequently, need pass through grey variance, mark little effective pixel point of grey scale change, filter out those redundant pixel points that just have unstable formation of image itself, thereby remain the effective pixel point of stable formation of image, with the stability that improves the template image. And then observing the change of the pixels at the corresponding positions of the packing material to be detected by the pixels with stable imaging in the subsequent process to judge whether the defects exist.
In an embodiment, the predetermined variance range may be obtained from statistics of sample data of multiple tests, for example, the predetermined variance range may be set to 20 to 40, and in actual use, a fixed value of 20 to 40 may be selected as a threshold for determining whether the selected value is an effective pixel.
Step 405: and converting all the aligned template images into a preset color space, and calculating the template color of each template pixel point in the template images.
In this step, for each aligned template image, all the aligned template images are converted into a preset color space map, and a color value corresponding to each pixel is calculated. Then, the color value range of each pixel position is counted to be used as template color information of the template pixel, and pixel points with little color value change are marked.
In one embodiment, the template image may be converted from RGB (Red, Green, Blue, Red, Green, and Blue color mode) color space to HSV (Hue, Saturation, and brightness) color space using opencv (a BSD (Berkeley software distribution) -based protocol licensed (open source) distributed cross-platform computer vision and machine learning software library), wherein H, S, V has three components with values ranging from 0 to 255, and the values and colors are divided as in table 1 below:
TABLE 1
Figure BDA0002797159460000101
In an actual scene, a plurality of aligned template images are shot at the same shooting position at different times. That is, at the same pixel location, there are now multiple imaging values. Due to imaging fluctuation, the color imaged by each pixel point may have slight change to a certain degree. For the same position area, each pixel point of each photo can be divided into color labels according to the method in table 1, then the pixels of all the images of the same printing area of the sample object are counted, and the color labels of each pixel on different images are obtained. For example, ten pictures are taken at the same pixel position of the sample object, each picture has color labels divided according to the standard in table 1 at the same pixel position, wherein the color label of the pixel position in 9 pictures is black, and the template color of the pixel position is considered to be black.
In an embodiment, when filtering the unstable redundant pixel, the color value change may be directly referred to in addition to the variation degree of the reference gray value, so as to filter the interference caused by the impurities indicated by different samples and the camera itself shaking.
In one embodiment, the grayscale map, the color value range, and the median standard picture of the template image are saved as template files and stored in a template library.
Step 406: at least one image of the object 252 is acquired. See the description of step 301 in the above embodiments for details.
Step 407: the image information is aligned with the template image.
In this step, in an actual scene, due to factors such as a mechanical translation error of the image capturing device 20, after each turn of the image capturing device 20, a certain translation error exists in the same position region, and corresponding pixel points of each photo are not completely matched in each time of taking a photo in the same region, so that the images need to be aligned. Other photographs of the object 252 to be measured may be registered in pixel alignment with the reference image, referenced to the reference image selected in step 402. The detailed alignment is too long, and reference may be made to the detailed description of step 402.
Step 408: and converting each pixel point to be detected in the image information into a preset color space, and generating the color information of each pixel point to be detected.
In this step, for the image information after the image alignment, each pixel to be measured needs to be divided into colors for more stably expressing the pixel characteristics. The RGB value of each pixel point to be detected may be converted into an HSV spatial value, and then the color value of each pixel point to be detected is divided based on the color division method in table 1 above, so as to obtain the color information represented by each pixel to be detected in the image information.
Step 409: based on the aligned image information, color comparison is respectively carried out on each pixel to be detected and the template pixel points at the aligned positions in the template image, and whether candidate pixel points inconsistent with the template color of the template pixel points exist in the image information is judged. Step 410 is entered if any, otherwise step 411 is entered.
In this step, the color value of each pixel point to be measured in the aligned image information is compared with the color value of the template pixel point at the corresponding position in the template image, if different, step 410 is performed, otherwise step 411 is performed.
Step 410: based on the preset marking information, unstable pixel points in the candidate pixel points are filtered out, and the remaining candidate pixel points generate defective pixel points.
In this step, if a candidate pixel point inconsistent with the template color of the template pixel point exists in the image information, for example, the template color of the template pixel point is black, and the color label of the to-be-detected wrapping material at the to-be-detected pixel point is not black, it indicates that the candidate pixel point is abnormal, and in an actual scene, the positions of the abnormal pixels may be places with large fluctuation in the imaging process on the wrapping material, such as the text edge of a printing area, the interference of the abnormal pixel points is eliminated, only other candidate pixel points with stable imaging are reserved, and a defective pixel point is a candidate pixel point with stable imaging.
In an embodiment, two pieces of image information continuously shot by the packaging material to be detected may be processed as described above, and then the processing results of the two pieces of image information are merged, and only the defective pixel points marked as abnormal at the same time are retained.
Step 411: and updating the image information into a template library.
In this step, if there is no candidate pixel point in the image information that is inconsistent with the template color of the template pixel point, it indicates that there is no flaw in the package to be tested corresponding to the image information, and the package to be tested can be used as a template for subsequent detection, a picture in which no abnormality is detected is automatically added to the standard sample template library corresponding to the printing area, and the standard template information corresponding to the printing area of the package to be tested can be updated by the method in steps 401 to 405.
Step 412: and outputting the information of the defective pixel points. See the description of step 304 in the above embodiments for details.
The flaw identification method comprises the steps of aligning the image information of each printing area with the template image of the corresponding area, performing color space conversion on the image information, calculating the color value of each pixel to be detected, and comparing the color value with the color of a standard template. If the color range of the template is exceeded, the pixel is marked to be abnormal. After the color of all pixels to be detected is checked, only effective pixel points marked when the gray level of the samples is not changed greatly are reserved, two continuously shot pictures are processed in the same way, then fusion is carried out, only defect pixel points marked as abnormal simultaneously are reserved, and finally the defect pixel points with the abnormal existence are highlighted. Therefore, in the modeling process, the redundant pixel points with different standard sample picture gray values and large color value variation amplitude are eliminated, and the interference of dust or other impurities can be effectively filtered. And adding the images with no detected abnormality into the template library, and continuously improving the robustness of the template.
Please refer to fig. 5, which is a defect identification apparatus 500 according to an embodiment of the present application, the apparatus is applied to the electronic device 1 shown in fig. 1, and can be applied to the package inspection scene shown in fig. 2A to 2C to identify the defect information of the object 252. The device includes: the first obtaining module 501, the analyzing module 502, the comparing module 503 and the outputting module 504, the principle relationship of each module is as follows:
the first obtaining module 501 is configured to obtain at least one piece of image information of the object 252 to be measured. See the description of step 301 in the above embodiments for details.
The analyzing module 502 is configured to analyze the image information and generate color information of each pixel point to be detected in the image information. See the description of step 302 in the above embodiments for details.
The comparison module 503 is configured to perform color comparison between the image information and the template image in the template library based on the color information of each pixel point to be detected, so as to obtain a defective pixel point in the image information. See the description of step 303 in the above embodiments for details.
The output module 504 is configured to output information of defective pixels. See the description of step 304 in the above embodiments for details.
In one embodiment, the method further comprises: the first aligning module 505 is configured to align the image information with the template image before analyzing the image information and generating color information of each pixel point to be detected in the image information. See the description of step 407 in the above embodiments for details.
In one embodiment, the parsing module 502 is configured to: and converting each pixel point to be detected in the image information into a preset color space, and generating the color information of each pixel point to be detected. See the description of step 408 in the above embodiments for details.
In one embodiment, the comparison module 503 is configured to: based on the aligned image information, color comparison is respectively carried out on each pixel to be detected and the template pixel points at the aligned positions in the template image, and whether candidate pixel points inconsistent with the template color of the template pixel points exist in the image information is judged. If candidate pixel points which are inconsistent with the template color of the template pixel points exist in the image information, unstable pixel points in the candidate pixel points are filtered out based on preset marking information, and the remaining candidate pixel points generate defective pixel points. See the description of steps 409 through 410 in the above embodiments for details.
In an embodiment, the comparing module 503 is further configured to: and if the candidate pixel points which are inconsistent with the template color of the template pixel points do not exist in the image information, updating the image information into the template library. See the description of step 411 in the above embodiments for details.
In one embodiment, the method further comprises: the second obtaining module 506 is configured to sequentially obtain a plurality of sample images of a preset region of a sample object before color information of each pixel point in the image information is compared with a template image in the template library to obtain a defective pixel point in the image information, where the sample object is a standard sample of the object to be detected 252. The second alignment module 507 is configured to select one sample image as a reference image, align the remaining sample images with the reference image, and generate a plurality of template images. And the gray module 508 is configured to convert all the aligned template images into a gray map, and count a gray variance of each template pixel point in the gray map. The marking module 509 is configured to select, from the template pixels, effective pixels with a gray variance within a preset variance range, mark position information of the effective pixels, and generate preset marking information. Refer to the description of steps 401 to 404 in the above embodiments in detail.
In one embodiment, the method further comprises: a calculating module 510, configured to, after one sample image is selected as a reference image, align the remaining sample images with the reference image to generate a plurality of template images, convert all aligned template images into a preset color space, and calculate a template color of each template pixel point in the template image. See the description of step 405 in the above embodiments for details.
For a detailed description of the defect detection apparatus 500, please refer to the description of the related method steps in the above embodiments.
An embodiment of the present invention further provides a non-transitory electronic device readable storage medium, including: a program that, when run on an electronic device, causes the electronic device to perform all or part of the procedures of the methods in the above-described embodiments. The storage medium may be a magnetic Disk, an optical Disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Hard Disk (Hard Disk Drive, abbreviated as HDD), a Solid State Drive (SSD), or the like. The storage medium may also comprise a combination of memories of the kind described above.
Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope defined by the appended claims.

Claims (17)

1. A method for identifying defects, comprising:
acquiring at least one piece of image information of an object to be detected;
analyzing the image information to generate color information of each pixel point to be detected in the image information;
based on the color information of each pixel point to be detected, performing color comparison on the image information and a template image in a template library to obtain a defective pixel point in the image information;
and outputting the information of the defective pixel points.
2. The method according to claim 1, wherein before the analyzing the image information and generating the color information of each pixel point to be measured in the image information, the method further comprises:
aligning the image information with the template image.
3. The method according to claim 2, wherein the analyzing the image information to generate color information of each pixel point to be detected in the image information comprises:
and converting each pixel point to be detected in the image information into a preset color space, and generating color information of each pixel point to be detected.
4. The method of claim 3, wherein the comparing the image information with a template image in a template library to obtain defective pixels in the image information based on the color information of each pixel to be tested comprises:
based on the aligned image information, respectively carrying out color comparison on each pixel to be detected and a template pixel point at an aligned position in the template image, and judging whether a candidate pixel point which is inconsistent with the template color of the template pixel point exists in the image information;
if the candidate pixel points with the template color inconsistent with that of the template pixel points exist in the image information, unstable pixel points in the candidate pixel points are filtered out based on preset marking information, and the remaining candidate pixel points generate the defective pixel points.
5. The method of claim 4, wherein the comparing the image information with the template image in the template library to obtain defective pixels based on the color information of each pixel to be tested, further comprises:
and if the candidate pixel point which is inconsistent with the template color of the template pixel point does not exist in the image information, updating the image information into the template library.
6. The method of claim 4, wherein before the comparing the image information with the template image in the template library to obtain the defective pixel point in the image information based on the color information of each pixel point to be tested, the method further comprises:
sequentially acquiring a plurality of sample images of a preset area of a sample object, wherein the sample object is a standard sample of the object to be detected;
optionally selecting one sample image as a reference image, and aligning the rest sample images with the reference image to generate a plurality of template images;
converting all the aligned template images into a gray level image, and counting the gray level variance of each template pixel point in the gray level image;
and selecting effective pixels of which the gray variance is within a preset variance range from the template pixels, marking the position information of the effective pixels, and generating the preset marking information.
7. The method according to claim 6, further comprising, after the optionally selecting one of the sample images as a reference image, aligning the remaining sample images with the reference image, and generating a plurality of the template images:
and converting all the aligned template images into the preset color space, and calculating the template color of each template pixel point in the template images.
8. A defect recognition apparatus, comprising:
the first acquisition module is used for acquiring at least one piece of image information of the object to be detected;
the analysis module is used for analyzing the image information and generating color information of each pixel point to be detected in the image information;
the comparison module is used for comparing the color of the image information with that of a template image in a template library based on the color information of each pixel point to be detected to obtain a defective pixel point in the image information;
and the output module is used for outputting the information of the defective pixel points.
9. The apparatus of claim 8, further comprising:
and the first alignment module is used for aligning the image information with the template image before analyzing the image information and generating the color information of each pixel point to be detected in the image information.
10. The apparatus of claim 9, wherein the parsing module is configured to:
and converting each pixel point to be detected in the image information into a preset color space, and generating the color information of each pixel point to be detected.
11. The apparatus of claim 10, wherein the alignment module is configured to:
based on the aligned image information, respectively carrying out color comparison on each pixel to be detected and a template pixel point at an aligned position in the template image, and judging whether a candidate pixel point which is inconsistent with the template color of the template pixel point exists in the image information;
if the candidate pixel points with the template color inconsistent with that of the template pixel points exist in the image information, unstable pixel points in the candidate pixel points are filtered out based on preset marking information, and the remaining candidate pixel points generate the defective pixel points.
12. The apparatus of claim 11, wherein the alignment module is further configured to:
and if the candidate pixel point which is inconsistent with the template color of the template pixel point does not exist in the image information, updating the image information into the template library.
13. The apparatus of claim 11, further comprising:
the second obtaining module is used for sequentially obtaining a plurality of sample images of a preset area of a sample object before the color information of each pixel point in the image information is compared with the color of the template image in the template library to obtain a defective pixel point in the image information, wherein the sample object is a standard sample of the object to be detected;
a second alignment module, configured to select one of the sample images as a reference image, align the remaining sample images with the reference image, and generate a plurality of template images;
the gray module is used for converting all the aligned template images into a gray image and counting the gray variance of each template pixel point in the gray image;
and the marking module is used for selecting effective pixels of the gray variance within a preset variance range from the template pixels, marking the position information of the effective pixels and generating the preset marking information.
14. The apparatus of claim 13, further comprising:
and the calculation module is used for aligning the rest of the sample images with the reference image to generate a plurality of template images after the optional sample image is taken as the reference image, converting all the aligned template images into the preset color space, and calculating the template color of each template pixel point in the template images.
15. An image acquisition apparatus, comprising:
a base;
the bracket is arranged on the base;
an imager slidably disposed on the support;
the light source is arranged on the bracket and synchronously moves with the imager, and a lampshade is arranged outside the light source;
the test bench is arranged on the bracket and is within the imaging range of the imager;
the test board is used for placing an object to be tested, and the imager is used for collecting image information of the object to be tested.
16. An electronic device, comprising:
a memory to store a computer program;
a processor configured to perform the method of any one of claims 1 to 7 to identify fault information of an object under test.
17. A non-transitory electronic device readable storage medium, comprising: program which, when run by an electronic device, causes the electronic device to perform the method of any one of claims 1 to 7.
CN202011335994.4A 2020-11-25 2020-11-25 Flaw identification method, apparatus, device and storage medium Active CN112446865B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011335994.4A CN112446865B (en) 2020-11-25 2020-11-25 Flaw identification method, apparatus, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011335994.4A CN112446865B (en) 2020-11-25 2020-11-25 Flaw identification method, apparatus, device and storage medium

Publications (2)

Publication Number Publication Date
CN112446865A true CN112446865A (en) 2021-03-05
CN112446865B CN112446865B (en) 2024-08-06

Family

ID=74737323

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011335994.4A Active CN112446865B (en) 2020-11-25 2020-11-25 Flaw identification method, apparatus, device and storage medium

Country Status (1)

Country Link
CN (1) CN112446865B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112884071A (en) * 2021-03-22 2021-06-01 广东拓斯达科技股份有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN113160145A (en) * 2021-03-29 2021-07-23 深圳中科飞测科技股份有限公司 Detection method, detection device, detection equipment and computer readable storage medium

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102221554A (en) * 2011-04-06 2011-10-19 天津科技大学 Presswork quality and flaw inspection method
TW201425917A (en) * 2012-12-27 2014-07-01 Hon Hai Prec Ind Co Ltd Checking system
WO2017092431A1 (en) * 2015-12-01 2017-06-08 乐视控股(北京)有限公司 Human hand detection method and device based on skin colour
CN108596903A (en) * 2017-09-27 2018-09-28 广东产品质量监督检验研究院(国家质量技术监督局广州电气安全检验所、广东省试验认证研究院、华安实验室) A kind of defect inspection method of the black surround and fragment of solar battery sheet
CN108648168A (en) * 2018-03-15 2018-10-12 北京京仪仪器仪表研究总院有限公司 IC wafer surface defects detection methods
CN110246129A (en) * 2019-06-18 2019-09-17 深圳市腾讯网域计算机网络有限公司 Image detecting method, device, computer readable storage medium and computer equipment
CN110415237A (en) * 2019-07-31 2019-11-05 Oppo广东移动通信有限公司 Skin blemishes detection method, detection device, terminal device and readable storage medium storing program for executing
CN110930352A (en) * 2019-02-25 2020-03-27 研祥智能科技股份有限公司 Object color difference defect detection method and device, computer equipment and storage medium
CN111242896A (en) * 2019-12-31 2020-06-05 电子科技大学 Color printing label defect detection and quality rating method
CN111768387A (en) * 2020-06-30 2020-10-13 创新奇智(青岛)科技有限公司 Flaw detection method, twin neural network training method and device and electronic equipment
CN111986178A (en) * 2020-08-21 2020-11-24 北京百度网讯科技有限公司 Product defect detection method and device, electronic equipment and storage medium
CN112446864A (en) * 2020-11-25 2021-03-05 创新奇智(合肥)科技有限公司 Flaw detection method, flaw detection device, flaw detection equipment and storage medium

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102221554A (en) * 2011-04-06 2011-10-19 天津科技大学 Presswork quality and flaw inspection method
TW201425917A (en) * 2012-12-27 2014-07-01 Hon Hai Prec Ind Co Ltd Checking system
WO2017092431A1 (en) * 2015-12-01 2017-06-08 乐视控股(北京)有限公司 Human hand detection method and device based on skin colour
CN108596903A (en) * 2017-09-27 2018-09-28 广东产品质量监督检验研究院(国家质量技术监督局广州电气安全检验所、广东省试验认证研究院、华安实验室) A kind of defect inspection method of the black surround and fragment of solar battery sheet
CN108648168A (en) * 2018-03-15 2018-10-12 北京京仪仪器仪表研究总院有限公司 IC wafer surface defects detection methods
CN110930352A (en) * 2019-02-25 2020-03-27 研祥智能科技股份有限公司 Object color difference defect detection method and device, computer equipment and storage medium
CN110246129A (en) * 2019-06-18 2019-09-17 深圳市腾讯网域计算机网络有限公司 Image detecting method, device, computer readable storage medium and computer equipment
CN110415237A (en) * 2019-07-31 2019-11-05 Oppo广东移动通信有限公司 Skin blemishes detection method, detection device, terminal device and readable storage medium storing program for executing
CN111242896A (en) * 2019-12-31 2020-06-05 电子科技大学 Color printing label defect detection and quality rating method
CN111768387A (en) * 2020-06-30 2020-10-13 创新奇智(青岛)科技有限公司 Flaw detection method, twin neural network training method and device and electronic equipment
CN111986178A (en) * 2020-08-21 2020-11-24 北京百度网讯科技有限公司 Product defect detection method and device, electronic equipment and storage medium
CN112446864A (en) * 2020-11-25 2021-03-05 创新奇智(合肥)科技有限公司 Flaw detection method, flaw detection device, flaw detection equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
黄平: "低成本视觉检测平台及视觉检测关键技术研究", 《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑》, pages 2 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112884071A (en) * 2021-03-22 2021-06-01 广东拓斯达科技股份有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN113160145A (en) * 2021-03-29 2021-07-23 深圳中科飞测科技股份有限公司 Detection method, detection device, detection equipment and computer readable storage medium
CN113160145B (en) * 2021-03-29 2024-04-02 深圳中科飞测科技股份有限公司 Detection method, detection device, detection apparatus, and computer-readable storage medium

Also Published As

Publication number Publication date
CN112446865B (en) 2024-08-06

Similar Documents

Publication Publication Date Title
CN110044405B (en) Automatic automobile instrument detection device and method based on machine vision
CN109472271B (en) Printed circuit board image contour extraction method and device
JP6348289B2 (en) Inspection apparatus and inspection method
CN112446864A (en) Flaw detection method, flaw detection device, flaw detection equipment and storage medium
CN106651857B (en) A kind of printed circuit board patch defect inspection method
CN112446865B (en) Flaw identification method, apparatus, device and storage medium
CN113034488B (en) Visual inspection method for ink-jet printed matter
CN112687231B (en) Brightness and chrominance data extraction method, equipment and computer readable storage medium
CN110533660B (en) Method for detecting silk-screen defect of electronic product shell
CN115375610A (en) Detection method and device, detection equipment and storage medium
CN110596118A (en) Print pattern detection method and print pattern detection device
KR100827906B1 (en) Substrate inspection device
CN116580026B (en) Automatic optical detection method, equipment and storage medium for appearance defects of precision parts
CN117433966A (en) Non-contact measurement method and system for particle size of grinding particles
JP2009080004A (en) Inspection device
US11763445B2 (en) Inspection of a target object using a comparison with a master image and a strictness of a quality evaluation threshold value
KR101126759B1 (en) Method of teaching for electronic parts information in chip mounter
CN115115596A (en) Electronic component detection method and device and automatic quality inspection equipment
CN211697573U (en) Automatic printing detection system
JP2001024321A (en) Method for generating inspection data
TWI852571B (en) Circuit image inspection method and automatic optical inspection system comprising thereof
CN106996911B (en) The localization method of two-dimensional detection paste solder printing
WO2024062854A1 (en) Image processing device and image processing method
Paulo et al. Automatic visual inspection system for solder paste deposition in PCBs
JPH0781962B2 (en) Foreign object detection method

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