[go: up one dir, main page]

CN117169226A - Method, device, system and storage medium for determining defect type in industrial defect detection - Google Patents

Method, device, system and storage medium for determining defect type in industrial defect detection Download PDF

Info

Publication number
CN117169226A
CN117169226A CN202311125717.4A CN202311125717A CN117169226A CN 117169226 A CN117169226 A CN 117169226A CN 202311125717 A CN202311125717 A CN 202311125717A CN 117169226 A CN117169226 A CN 117169226A
Authority
CN
China
Prior art keywords
defect
preset
image
detected
type
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.)
Pending
Application number
CN202311125717.4A
Other languages
Chinese (zh)
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.)
Zhongke Huiyuan Intelligent Equipment Guangdong Co ltd
Casi Vision Technology Luoyang Co Ltd
Original Assignee
Zhongke Huiyuan Intelligent Equipment Guangdong Co ltd
Casi Vision Technology Luoyang 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 Zhongke Huiyuan Intelligent Equipment Guangdong Co ltd, Casi Vision Technology Luoyang Co Ltd filed Critical Zhongke Huiyuan Intelligent Equipment Guangdong Co ltd
Priority to CN202311125717.4A priority Critical patent/CN117169226A/en
Publication of CN117169226A publication Critical patent/CN117169226A/en
Pending legal-status Critical Current

Links

Classifications

    • 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

  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
  • Image Processing (AREA)

Abstract

The application discloses a method, a device, a system and a storage medium for determining defect types in industrial defect detection, wherein in the method, a to-be-detected image obtained by shooting an object to be detected is obtained, the to-be-detected image is identified, a defect image is identified from the to-be-detected image, a characteristic value of the defect image corresponding to a characteristic control selected by a user is calculated, the defect types of defects on the object to be detected are determined according to the characteristic value, and finally the purpose of accurately determining the defect types is achieved through the characteristic value. The method comprises the following steps: acquiring an image to be detected, which is shot by an object to be detected in at least one lighting mode; detecting each image to be detected in the lighting mode to obtain a defect image in the image to be detected; calculating a characteristic value of the defect image corresponding to the characteristic control according to the received characteristic control selected by the user on the interface; and determining the defect type corresponding to the defect on the object to be detected according to the characteristic value of the defect image.

Description

Method, device, system and storage medium for determining defect type in industrial defect detection
Technical Field
The present application relates to the field of industrial defect detection, and in particular, to a method, an apparatus, a system, and a storage medium for determining a defect type in industrial defect detection.
Background
AOI (Automated Optical Inspection) is an automatic optical detection device, and is widely applied to industrial detection, for example, the automatic optical detection device can be used for carrying out appearance inspection on products such as middle frames, rear covers, glass, plates, circuit board assembly in the electronic industry and the like.
Currently, when appearance inspection is performed on a product by AOI equipment, the defect type of the defect on the product cannot be accurately determined, so that whether the product belongs to a qualified product cannot be accurately judged by using the defect type. Since defects of certain defect types on the product are acceptable, i.e. products carrying an acceptable defect type may be considered acceptable products. Thus, if the AOI device cannot accurately determine the defect type of the defect on the product, misjudgment may occur when judging whether the product belongs to a qualified product.
Therefore, how to accurately determine the defect type of the defect on the product is a technical problem to be solved by those skilled in the art.
Disclosure of Invention
The application provides a method for determining a defect type in industrial defect detection, which aims to solve the problem that the defect type of defects on products cannot be accurately determined.
In a first aspect, an embodiment of the present application provides a method for determining a defect type in industrial defect detection, including:
acquiring an image to be detected, which is shot by an object to be detected in at least one lighting mode;
detecting the images to be detected in each lighting mode to obtain a defect image in the images to be detected;
calculating a characteristic value of the defect image corresponding to the characteristic control according to the received characteristic control selected by the user on the interface;
and determining the defect type corresponding to the defect on the object to be detected according to the characteristic value of the defect image.
In some embodiments, the step of detecting the image to be detected in each lighting mode to obtain a defect image in the image to be detected includes:
Dividing the image to be detected to obtain a region of interest;
dividing the region of interest to obtain a first detection region;
and detecting the first detection area to obtain a defect image in the image to be detected.
In some embodiments, the step of detecting the first detection area to obtain a defect image in the image to be detected includes:
inputting the first detection area into a preset neural network model to output a defect image; the preset neural network model is obtained by training with sample data, the sample data comprises a plurality of groups of input samples and output samples corresponding to the input samples, the input samples are second detection areas, and the output samples are defect images in the second detection areas.
In some embodiments, the step of determining a defect type corresponding to a defect on the object to be detected according to the feature value of the defect image includes:
judging whether the characteristic value of the defect image accords with a preset rule corresponding to a preset defect type or not, wherein the preset rule is a logic rule determined according to the characteristic value;
And if the preset rule of the preset defect type is met, determining that the defect type is the preset defect type.
In some embodiments, the step of determining whether the feature value of the defect image meets a preset rule corresponding to a preset defect type includes:
screening out defect images with the same center point coordinates from the defect images detected in all the polishing modes, and combining the defect images with the same center point into a defect image set;
judging whether the characteristic values of the defect images in each group of defect image combinations accord with preset rules corresponding to preset independent defect types; and/or judging whether the characteristic values of the defect images in all the defect image sets accord with preset rules corresponding to preset integral defect types; the preset rules corresponding to the preset independent defect types are logic rules determined according to the characteristic values of the defect images in the group of defect image sets; the overall defect type is a logic rule determined according to the characteristic values of the defect images in all the defect image sets.
In some embodiments, the step of determining whether the feature values of the defect images in each group of defect image combinations conform to a preset rule corresponding to a preset independent defect type includes:
Judging whether the characteristic value of the defect image accords with a preset rule of a preset independent defect type corresponding to the false defect;
if the preset rule of the preset independent defect type corresponding to the false defect is met, determining that the defect type comprises the preset independent defect type corresponding to the false defect;
if the preset rule of the preset independent defect type corresponding to the false defect is not met, judging whether the characteristic value of the defect image meets the preset rule of the preset independent defect type corresponding to the true defect;
if the preset rule of the preset independent defect type corresponding to the true defect is met, determining that the defect type comprises the preset independent defect type corresponding to the true defect.
In some embodiments, the preset independent defect type corresponding to the true defect includes a scratch type, and the characteristic value includes linearity and an aspect ratio; the step of judging whether the characteristic value of the defect image accords with a preset rule of a preset independent defect type corresponding to the true defect comprises the following steps:
judging whether the linearity of the defect image is larger than a preset linearity and whether the length-width ratio of the defect image is larger than a preset length-width ratio;
and if the linearity of the defect image is larger than the preset linearity and the length-to-width ratio of the defect image is larger than the preset length-to-width ratio, determining that the characteristic value of the defect image accords with the preset rule of the preset independent defect type corresponding to the true defect.
In some embodiments, the preset independent defect type corresponding to the true defect includes a crush defect, and the characteristic value includes roundness; the step of judging whether the characteristic value of the defect image accords with a preset rule of a preset independent defect type corresponding to the true defect comprises the following steps:
judging whether the roundness of the defect image is larger than a preset roundness or not;
if the roundness of the defect image is larger than the preset roundness, determining that the characteristic value of the defect image accords with a preset rule of a preset independent defect type corresponding to the true defect.
In some embodiments, the preset independent defect type corresponding to the true defect includes a heterochromatic type, and the characteristic value includes absolute values of a defect gray average value and a background gray average value in the defect image acquired in all lighting modes; the step of judging whether the characteristic value of the defect image accords with a preset rule of a preset independent defect type corresponding to the true defect comprises the following steps:
judging whether the absolute value of the defect gray average value and the background gray average value in all the defect images obtained in the lighting mode is larger than the first defect image number of a preset absolute value or not;
if the number of the defect images is larger than the number of the preset defect images, determining that the characteristic values of the defect images accord with the preset rule of the preset independent defect types corresponding to the true defects. In some embodiments, the preset independent defect type corresponding to the false defect includes a dirty type, and the characteristic value includes absolute values of a defect gray average value and a background gray average value in the defect image acquired in all lighting modes; the step of judging whether the characteristic value of the defect image accords with a preset rule of a preset independent defect type corresponding to the false defect comprises the following steps:
Judging whether absolute values of a defect gray average value and a background gray average value in the defect images obtained in all the lighting modes are smaller than a preset absolute value or not;
if the characteristic value of the defect image is smaller than the preset absolute value, determining that the characteristic value of the defect image accords with a preset rule of a preset independent defect type corresponding to the false defect.
In some embodiments, the preset independent defect type corresponding to the false defect includes a bright line type, and the characteristic value includes a minimum circumscribed rectangle angle; the step of judging whether the characteristic value of the defect image accords with a preset rule of a preset independent defect type corresponding to the false defect comprises the following steps:
judging whether the minimum circumscribed rectangle angle of the defect image is equal to a preset angle or not;
and if the minimum circumscribed rectangle angle of the defect image is equal to the preset angle, determining that the characteristic value of the defect image accords with a preset rule of a preset independent defect type corresponding to the false defect.
In some embodiments, the global defect type includes a non-occurrence of a fixed black hole type, and the feature value includes a gray variance; the step of judging whether the feature values of the defect images in all the defect image sets accord with the preset rules corresponding to the preset integral defect types comprises the following steps:
Counting the number of second defect images with the gray variance of the defect areas larger than the preset gray variance in all the first detection areas;
judging whether the number of the second defect images is equal to the number of preset black holes or not;
and if the number of the second defect images is equal to the number of the preset black holes, determining that the defect type comprises a preset integral defect type.
In some embodiments, further comprising:
judging whether the defect type comprises a defect type corresponding to a true defect;
if the defect type corresponding to the true defect is included, determining that the object to be detected is a disqualified product;
and if the defect type corresponding to the true defect is not included, determining that the object to be detected is a qualified product.
In a second aspect, an embodiment of the present application provides an apparatus for determining a defect type in industrial defect detection, including:
the acquisition unit is used for acquiring an image to be detected, which is shot by an object to be detected in at least one lighting mode;
the first detection unit is used for detecting the images to be detected in each lighting mode to obtain defect images in the images to be detected;
the computing unit is used for computing the characteristic value of the defect image corresponding to the characteristic control according to the received characteristic control selected by the user on the interface;
And the first determining unit is used for determining the defect type corresponding to the defect on the object to be detected according to the characteristic value of the defect image.
In some embodiments, the detection unit comprises:
the first segmentation unit is used for segmenting the image to be detected to obtain a region of interest;
the second segmentation unit is used for segmenting the region of interest to obtain a first detection region;
and the second detection unit is used for detecting the first detection area to obtain a defect image in the image to be detected.
In some embodiments, the determining unit comprises:
the first judging unit is used for judging whether the characteristic value of the defect image accords with a preset rule corresponding to a preset defect type, wherein the preset rule is a logic rule determined according to the characteristic value;
and the second determining unit is used for determining that the defect type is the preset defect type if the defect type accords with the preset rule of the preset defect type.
In some embodiments, the determining unit includes:
the screening unit is used for screening out defect images with the same center point coordinates from all defect images detected in the lighting mode, and combining the defect images with the same center point into a defect image set;
The second judging unit is used for judging whether the characteristic value of the defect image in each group of defect image combination accords with a preset rule corresponding to a preset independent defect type; and/or a third judging unit, configured to judge whether feature values of defect images in all the defect image sets conform to preset rules corresponding to preset overall defect types; the preset rules corresponding to the preset independent defect types are logic rules determined according to the characteristic values of the defect images in the group of defect image sets; the overall defect type is a logic rule determined according to the characteristic values of the defect images in all the defect image sets.
In some embodiments, the apparatus further comprises:
a fourth judging unit, configured to judge whether the defect type includes a defect type corresponding to a true defect;
a third determining unit, configured to determine that the object to be detected is a non-qualified product if the defect type corresponding to the true defect is included;
and the fourth determining unit is used for determining that the object to be detected is a qualified product if the defect type corresponding to the true defect is not included.
In a third aspect, an embodiment of the present application provides a detection system, including a processor and a memory;
The memory is used for storing operation instructions;
the processor is configured to execute the steps of the method for determining a defect type in the industrial defect detection according to any one of the above-mentioned claims by calling the operation instruction.
In a fourth aspect, an embodiment of the present application provides a computer readable storage medium having stored thereon a computer program, wherein the program when executed by a processor performs the steps of the method for determining a defect type in industrial defect detection as described in any of the preceding claims.
In the above embodiment, the method for determining the defect type in the industrial defect detection is provided, in which a to-be-detected image obtained by photographing an object to be detected is obtained, the defect image is identified from the to-be-detected image, a feature value of the defect image corresponding to a feature control selected by a user is calculated, the defect type of the defect on the object to be detected is determined according to the feature value, and finally, the purpose of accurately determining the defect type is achieved through the feature value. The method comprises the following steps: acquiring an image to be detected, which is shot by an object to be detected in at least one lighting mode; detecting the images to be detected in each lighting mode to obtain a defect image in the images to be detected; calculating a characteristic value of the defect image corresponding to the characteristic control according to the received characteristic control selected by the user on the interface; and determining the defect type corresponding to the defect on the object to be detected according to the characteristic value of the defect image.
Drawings
FIG. 1 illustrates a flow chart providing a method of determining a defect type in industrial defect detection, according to some embodiments;
FIG. 2 schematically illustrates providing a representation of an image to be detected acquired in three lighting modes according to some embodiments;
FIG. 3 illustrates a flow chart providing another method of determining a defect type in industrial defect detection, according to some embodiments;
FIG. 4 schematically illustrates a schematic diagram of a defect image distribution provided in accordance with some embodiments;
FIG. 5 schematically illustrates a defect image and a background surrounding the defect image provided in accordance with some embodiments;
FIG. 6 illustrates a schematic diagram of a scratch defect and bending interference line provided in accordance with some embodiments;
FIG. 7 schematically illustrates a schematic of a crush defect and a smudge defect provided in accordance with some embodiments;
FIG. 8 schematically illustrates a schematic diagram of a different color defect and a smudge defect corresponding to defect areas obtained under different lighting modes, provided according to some embodiments;
FIG. 9 schematically illustrates a configuration of an apparatus for determining a type of defect in an industrial defect inspection, according to some embodiments.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a more thorough understanding of the present application. It will be apparent, however, to one skilled in the art that the application may be practiced without one or more of these details. In other instances, well-known features have not been described in detail in order to avoid obscuring the application.
It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of exemplary embodiments according to the present application. As used herein, the singular is intended to include the plural unless the context clearly indicates otherwise. Furthermore, it will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
Exemplary embodiments according to the present application will now be described in more detail with reference to the accompanying drawings. These exemplary embodiments may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. It should be appreciated that these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of these exemplary embodiments to those skilled in the art.
AOI (Automated Optical Inspection) is an automatic optical detection device, and is widely applied to industrial detection, for example, the automatic optical detection device can be used for carrying out appearance inspection on products such as middle frames, rear covers, glass, plates, circuit board assembly in the electronic industry and the like.
Currently, when appearance inspection is performed on a product by AOI equipment, the defect type of the defect on the product cannot be accurately determined, so that whether the product belongs to a qualified product cannot be accurately judged by using the defect type. Since defects of certain defect types on the product are acceptable, i.e. products carrying an acceptable defect type may be considered acceptable products. Thus, if the AOI device cannot accurately determine the defect type of the defect on the product, misjudgment may occur when judging whether the product belongs to a qualified product.
For example, when the defect type is a dirty type and there is no defect of other defect types on the product, the product may be judged to be a qualified product, but the defect type of the defect on the product cannot be accurately judged currently, and a situation that the product is determined to be a disqualified product may occur.
Therefore, how to accurately determine the defect type of the defect on the product is a technical problem to be solved by those skilled in the art.
In order to solve the technical problems, an embodiment of the application provides a method for determining a defect type in industrial defect detection, wherein a to-be-detected image obtained by shooting an object to be detected is obtained, the to-be-detected image is identified, a feature value of the to-be-detected image corresponding to a feature control selected by a user is calculated, the defect type of the defect on the object to be detected is determined according to the feature value, and finally the purpose of accurately determining the defect type is achieved through the feature value.
FIG. 1 illustrates a flow chart providing a method of determining a defect type in industrial defect detection, according to some embodiments. The method includes S100-S400.
S100, acquiring an image to be detected of an object to be detected, wherein the image to be detected is shot in at least one lighting mode.
In the embodiment of the application, the object to be detected can be a product such as a mobile phone middle frame, a rear cover, glass, a plate, and circuit board assembly in the electronic industry.
In the embodiment of the application, the image to be detected can be acquired by the AOI equipment on line in real time, and can also be acquired by off-line loading of the image acquired by the AOI equipment.
In some embodiments, an AOI device includes a camera and a light source. The AOI device may provide one or more ways of lighting by a combination of different light sources or by adjusting parameters in the light sources. The camera can shoot the object to be detected in different lighting modes to obtain the image to be detected corresponding to each lighting mode.
In some embodiments, the strobe channels corresponding to different light sources in the AOI device are different, and different lighting modes can be formed by using the combination of different light sources. As shown in fig. 2, three images to be detected in fig. 2 are taken under different lighting modes, and the uppermost image in fig. 2 is a captured image to be detected under a bright field formed by one lighting mode; the intermediate image is an image to be detected which is shot under a dark field formed by another lighting mode; the lowermost image is an image to be detected which is shot in a bright field formed by another lighting mode, wherein the lowermost image is different from a light source used in the lighting mode corresponding to the uppermost image.
In the embodiment of the application, because possible defects on the object to be detected are different, the polishing mode can be selected according to actual conditions.
In one example, all defects on the object to be detected can be displayed on the image to be detected corresponding to the lighting mode only by one lighting mode, and at this time, the object to be detected can be shot by using only one lighting mode.
In another example, all defects on the object to be detected cannot be displayed on the image to be detected corresponding to the lighting mode by one lighting mode, at this time, the object to be detected can be shot by adopting multiple lighting modes, and all the defects on the object to be detected can be covered by the image to be detected shot by adopting multiple lighting modes.
And S200, detecting the images to be detected in each lighting mode to obtain defect images in the images to be detected.
In some embodiments, the image to be detected obtained by photographing in each lighting mode may show different defects, so that the image to be detected obtained by photographing in each lighting mode is detected.
Since the image to be detected includes, in addition to the image of the object to be detected, possibly a background image of the background where the object to be detected is located, and since the background image of the background where the object to be detected is located may interfere with defect detection, in order to more accurately detect a defect on the object to be detected from the image to be detected, in some embodiments, the image to be detected is segmented to obtain a region of interest, where the region of interest includes a defect image corresponding to the defect. Thus, defects can be detected more accurately by utilizing the region of interest, and background interference is eliminated.
FIG. 3 illustrates a flow chart providing another method of determining a defect type in industrial defect detection, according to some embodiments. Step S200 may include the following steps S201-S203.
S201, segmenting an image to be detected to obtain a region of interest.
The embodiment of the application does not limit the specific mode of dividing the image to be detected to obtain the region of interest. In one example, the image to be detected may be segmented using thresholding to yield the region of interest.
S202, segmenting the region of interest to obtain a first detection region.
In some embodiments, the region of interest is segmented using the characteristic that the gray values of the pixels in the defect image in the region of interest and the pixels in other regions in the region of interest are different. In the embodiment of the application, the region of interest can be segmented by adopting a fixed threshold method and an adaptive threshold method to obtain the first detection region. It should be noted that the number of the first detection areas may be plural.
In some embodiments, the specific step of the fixed threshold method is to select an appropriate threshold. The region of interest is divided into two parts, one part being pixels below the threshold and the other part being pixels above the threshold. The first detection area may be a connected area formed by pixels below a threshold value or a connected area formed by pixels above the threshold value, specifically according to the brightness of the defect image.
In some embodiments, the adaptive threshold segmentation divides the region of interest into a plurality of small blocks, calculates the threshold value of each small block separately, and then segments the small block with the calculated threshold value, so that even if a certain block is darker or lighter, a reasonable threshold value of the certain block can be calculated separately for segmentation, in other words, the threshold value corresponding to the bright small block is larger, and the threshold value corresponding to the dark small block is smaller, thereby achieving a good segmentation effect. The self-adaptive threshold method is more suitable for the situation that the pixel points of the region of interest are uneven or the gray values of the pixel points are more.
S203, detecting the first detection area to obtain a defect image in the image to be detected.
In the embodiment of the application, the first detection area is detected, and various methods for obtaining the defect image in the image to be detected are available, including a self-adaptive threshold method, a fixed threshold method, a neural network model utilizing method and the like.
The process of detecting the first detection region by using the self-adaptive threshold method and the fixed threshold method to obtain the defect image in the image to be detected is approximately the same as the process of dividing the region of interest by using the self-adaptive threshold method and the fixed threshold method to obtain the first detection region. Since the adaptive thresholding method and the fixed thresholding method have been described in detail above, they are not described in detail herein.
In the embodiment of the present application, the step of detecting the first detection area by using the neural network model to obtain the defect image in the image to be detected S203 may include:
inputting the first detection area into a preset neural network model to output a defect image, wherein the preset neural network model is obtained by training by using sample data, the sample data comprises a plurality of groups of input samples and output samples corresponding to the input samples, the input samples are the second detection area, and the output samples are the defect images in the second detection area.
In the embodiment of the application, the neural network model obtained by training the sample data can accurately output the defect image in the first detection area.
In some embodiments, it is detected whether the defective image is empty, and if so, an error message is returned. If not, the process continues with step S200.
In the embodiment of the application, the image to be detected is divided into the interested areas with smaller areas and the background interference removed, then the interested areas are continuously divided to obtain the first detection areas with smaller areas, and finally the first detection areas are detected to obtain the defect image. Therefore, by continuously narrowing the detection range, the defect image can be accurately detected from the image to be detected.
And S300, calculating the characteristic value of the defect image corresponding to the characteristic control according to the received characteristic control selected by the user on the interface.
In the embodiment of the application, the defect type is determined by utilizing the characteristic value, so that the aim of accurately determining the defect type can be fulfilled. However, since the feature values corresponding to the different defect types are different and the number of feature values of the defect image is numerous, if all the feature values are calculated on the defect image, a great amount of waste of data processing resources is caused, so in the embodiment of the application, the calculation amount can be reduced and the defect type of the defect can be accurately identified by receiving the feature control selected by the user on the interface and calculating the feature value corresponding to the selected feature control of the defect image.
In some embodiments, feature controls corresponding to all feature values are displayed on the interface, and the feature controls may be set to selectable states. Specifically, the user can know the possible defects of the object to be detected by observing the object to be detected or by other ways, and select a feature control corresponding to the feature value for judging the defect type on the interface. In the embodiment of the application, the defect type of the defect can be more accurately determined by utilizing the characteristic value of the defect image corresponding to the characteristic control, and the calculated amount is smaller.
The following describes the feature values for determining the defect type, and it should be noted that the feature values are only some examples, and other feature values of the defect image may be calculated according to the actual situation of the object to be detected.
1) Linearity of
The linearity can be used for judging the linear degree of the defect image, the center second step of all pixel points in the defect image is used for calculation, and the calculation can be specifically performed through the following formula:
wherein F is the area of the defect image; (Z) 0 ,S 0 ) The coordinates of the center point of the defect image; (Z, S) is the coordinates of each point in the defect image;
wherein L is linearity, and the range of L is (0, 1); m20 is a central second moment in the vertical direction calculated by the moment Mij formula when i=2, j=0; m02 is the center second step in the horizontal direction calculated by the moment Mij formula when i=0, j=2; m11 is the integrated central second moment in the horizontal and vertical directions calculated by the moment Mij formula when i=1, j=1.
2) Roundness of
The roundness may describe the approximation of the detected defect image to a circle, which may be calculated by the following formula:
wherein D is the average distance; f is the area of the defect image; p is the center point coordinate of the defect image; p_i is the coordinates of each point in the defect image; dsigma is the deviation of the average distance; roundness; the range of Roundness is (0, 1).
3) Number of independent areas
The number of independent areas is the number of defect images with the same characteristics contained in the first detection area. For example, the feature may be that the roundness is greater than the preset roundness, and the number of independent areas may be the number of defect images in the first detection area, where the roundness is greater than the preset roundness. The distribution of the defect image when the number of independent areas is 1, 2 and 3 is shown in fig. 4.
4) Average gray level and variance of gray level
The calculation formula of the gray average value is as follows:
wherein Mean is the gray average; r is the target region; p is the pixel point from the target region; the gray value of the pixel point in the target area is g (p); w is the area of the target area;
the gray variance represents the gray distribution range of the target area, the larger the gray variance is, and the smaller the gray variance is, the smaller the gray variance is; the gray variance is calculated as:
Wherein, the displacement is gray variance; r is the target region; p is the pixel point from the target region; the gray value of the pixel point in the target area is g (p); mean is the gray average; w is the area of the target area.
5) Absolute and standard deviation of defect gray mean and background gray mean
The absolute values of the defect gray average value and the background gray average value represent the difference between the gray average values of the defect image and the background surrounding the defect image, and the calculation formula of the absolute values of the defect gray average value and the background gray average value is as follows:
abs is the absolute value of the defect gray average value and the background gray average value;the gray average value representing the defect image can be specifically calculated by using the gray average value formula, wherein the target area is the defect image; />The background gray average value may be specifically calculated by using the gray average value formula above, where the target area is a surrounding background of the defect image, and the surrounding background of the defect image may be an image within a preset neighborhood radius from the defect image, and the preset region radius may be 10 pixels, as shown in fig. 5, and the defective image 51 and the surrounding background of the defect image 52 are shown in fig. 5.
The standard deviation of the defect gray average value and the background gray average value also represents the difference between the gray average values of the defect image and the background surrounding the defect image, and the calculation formula of the standard deviation of the defect gray average value and the background gray average value is as follows:
wherein Dev is the standard deviation of the defect gray average value and the background gray average value; n represents the number of pixel points in the defect image; i d Gray values representing respective pixel points in the defective image;representing the background gray level mean.
6) Minimum circumscribed rectangle angle
The minimum circumscribed rectangle angle is the angle of the included angle between the long side of the minimum circumscribed rectangle of the defect image and the horizontal line, and the range of the minimum circumscribed rectangle angle is [0,180].
7) The number of low gradient difference pixel points and the number of high gradient difference pixel points
The number of low gradient difference pixels and the number of high gradient difference pixels may represent a degree of distinction between the defect image and a background surrounding the defect image. The larger the distinction is, the more the number of low gradient difference pixels or the number of high gradient difference pixels will be.
The low gradient difference pixel points refer to the number of pixel points with gray values of the pixel points in the defect image being lower than the gray average value of the background around the defect image by more than a first preset gray difference value; the high gradient difference pixel points refer to the number of pixel points with gray values of the pixel points in the defect image higher than the average gray value of the background around the defect image by more than a second preset gray difference value.
8) A first proportion of the low gradient difference area n1 to the defect image area, and a second proportion of the high gradient difference area n2 to the defect image area
The larger the first ratio, the darker the defect image overall, and the larger the second ratio, the brighter the defect image overall.
The first ratio and the second ratio may be calculated using the following formula:
wherein L1 is a first ratio; n1 is the area of low gradient difference; f is the area of the defect image; l2 is a second ratio; n2 is the area of the high gradient difference. In some embodiments, n1 may be represented by a low gradient difference pixel count, n2 may be represented by a high gradient difference pixel count, and F may be represented by a defective image pixel count.
In the embodiment of the application, the coordinates of the pixel points in the defect image are needed to be utilized when the characteristic value is determined. In some embodiments, the object to be detected may need to be photographed in different lighting modes to obtain an image to be detected, but mechanical shake may occur in the process of photographing the object to be detected by using different lighting modes, which causes different positions of the image of the object to be detected displayed on different images to be detected. In one example, the coordinate system may be established using the upper left corner of the image of the object to be detected as the origin of coordinates. In this way, even if mechanical jitter and the like occur, the coordinates of the same defect in different images to be detected are the same, so that defect images corresponding to the same defect can be conveniently identified in a plurality of images to be detected, and the defect type of the defect can be conveniently determined.
In addition, when the feature controls are displayed on the interface, the feature controls corresponding to the above feature values can be displayed on the interface as all feature controls, in some embodiments, the feature controls corresponding to the above feature values can be displayed only as part of the feature controls, and feature controls corresponding to feature values not related to the above can be displayed; and the feature controls corresponding to the partial feature values can be displayed on the interface as all feature controls.
In some embodiments, since the number of low gradient difference pixels and the number of high gradient difference pixels need to use a first preset gray difference value and a second preset gray difference value in statistics, the first preset gray difference value and the second preset gray difference value can be set to be multiple, and therefore, when feature controls corresponding to the number of low gradient difference pixels and the number of high gradient difference pixels are displayed on an interface, the feature controls can be displayed as multiple feature controls.
The first preset gray level difference value may be 10, 20, 30, 40 or 50, and when the feature control corresponding to the number of the low gradient difference pixels is displayed on the interface, the feature control may be displayed as a low gradient difference pixel 1 control, a low gradient difference pixel 2 control, a low gradient difference pixel 3 control, a low gradient difference pixel 4 control and a low gradient difference pixel 5 control, where the low gradient difference pixel 1 control corresponds to the low gradient difference pixel when the first preset gray level difference value is more than 10, the low gradient difference pixel 2 control corresponds to the low gradient difference pixel when the first preset gray level difference value is more than 20, and so on. When an instruction of selecting the control with the number of 1 low gradient difference pixels is received, the number of the low gradient difference pixels when the first preset gray difference value is more than 10, namely the number of pixels with gray values of the pixels in the defect image lower than the gray average value of the background around the defect image by 10, is calculated.
The second preset gray level difference value can be 10, 20, 30, 40 or 50, when the feature control corresponding to the number of the high gradient difference pixels is displayed on the interface, the feature control can be displayed as a high gradient difference pixel 1 control, a high gradient difference pixel 2 control, a high gradient difference pixel 3 control, a high gradient difference pixel 4 control and a high gradient difference pixel 5 control, wherein the high gradient difference pixel 1 control corresponds to the high gradient difference pixel when the second preset gray level difference value is more than 10, the high gradient difference pixel 2 control corresponds to the high gradient difference pixel when the second preset gray level difference value is more than 20, and so on. When an instruction of selecting the number 2 control of the high gradient difference pixel points is received, the number of the high gradient difference pixel points when the second preset gray level difference value is more than 20, namely the number of the pixel points, of which the gray level value of the pixel points in the defect image is 20 higher than the gray level average value of the background around the defect image, is calculated.
S400, determining the defect type corresponding to the defect on the object to be detected according to the characteristic value of the defect image.
In some embodiments, the step of determining the defect type corresponding to the defect on the object to be detected based on the feature value of the defect image comprises:
judging whether the characteristic value of the defect image accords with a preset rule corresponding to a preset defect type, wherein the preset rule is a logic rule determined according to the characteristic value;
if the preset rule of the preset defect type is met, determining that the defect type is the preset defect type.
In the embodiment of the application, the preset rule corresponding to the preset defect type is prestored, and when the calculated characteristic value accords with the preset rule of the preset type, the defect type is determined to be the preset defect type. The preset rule is to determine the defect type by using a logic relation for the characteristic value, wherein the logic relation comprises logic OR, logic AND and/or logic NOT.
In some embodiments, the step of determining whether the feature value of the defect image meets a preset rule corresponding to a preset defect type includes:
and screening out defect images with the same center point coordinates from the defect images detected in all the polishing modes, and combining the defect images with the same center point into a defect image set.
In the embodiment of the application, the number of the defect areas on the image to be detected can be multiple, and different defect areas can be caused by different defects. Since some defect types cannot be determined by the feature values of the defect images acquired in one polishing mode, the feature values of the defect images at the same position acquired in multiple polishing modes are required to be determined, in the embodiment of the application, the defect images with the same center point coordinates are screened out from the defect images detected in all polishing modes, and the defect images with the same center point are combined into a defect image set, so that the follow-up determination of some defect types is facilitated. In addition, the defect area on the image to be detected may be due to product technology requirements, for example, a fixed black hole needs to be arranged on the object to be detected, and accordingly, the defect area corresponding to the black hole is identified due to the existence of the fixed black hole, if the defect area corresponding to the black hole does not exist on the image to be detected, the defect on the object to be detected is still determined to exist, the defect may be referred to as an overall defect, and defect images in all defect image sets need to be utilized when the overall defect type corresponding to the overall defect is identified.
Illustratively, the center point coordinates of the defect images obtained in one lighting mode are (1, 1), then the defect images with the center point coordinates of (1, 1) are searched from the defect images obtained in other lighting modes, and the defect images with the center point coordinates of (1, 1) are combined to form a defect image set.
In some embodiments, the preset defect types may include a preset independent defect type and a preset overall defect type. The preset rules corresponding to the preset independent defect types are logic rules determined according to the characteristic values of the defect images in the group of defect image sets; the overall defect type is a logic rule determined according to the feature values of the defect images in all defect image sets. The preset independent defect type may include scratch type, crush type, dirt type, bright line type, heterochromatic type, etc. The preset overall defect type includes a type in which no black hole occurs, and the like.
In the embodiment of the application, judging whether the characteristic value of the defect image in each group of defect image combination accords with a preset rule corresponding to a preset independent defect type; and/or judging whether the characteristic values of the defect images in all the defect image sets accord with preset rules corresponding to the preset integral defect types.
In the embodiment of the present application, according to the actual requirement, only the step of whether the preset rule corresponding to the preset independent defect type is met or not, or only the step of whether the preset rule corresponding to the preset integral defect type is met or not is executed, or the step of whether the preset rule corresponding to the preset independent defect type is met or not and the step of whether the preset rule corresponding to the preset integral defect type is met or not is executed simultaneously.
In the embodiment of the application, a plurality of defect images detected in one image to be detected may be detected, and a plurality of groups of defect image sets are obtained at the moment. When there are multiple groups of defect image combinations, a step of judging whether the defect images in the defect image combinations conform to preset rules corresponding to preset independent defect types is required to be executed for each group of defect image combinations.
Because the preset independent defect types have a plurality of types, the preset rules corresponding to each preset independent defect type are different, when the characteristic value accords with the preset rule corresponding to a certain preset independent defect type, the defect type can be determined to comprise the preset independent defect type at the moment, and meanwhile, whether the characteristic value accords with the preset rule corresponding to the next preset independent defect type is not continuously judged. If the preset rule corresponding to the preset independent defect type is not met, continuing to judge whether the preset rule corresponding to the next preset independent defect type is met.
In one example, the defect image set includes a defect image set a, and the preset independent defect type includes a preset independent defect type a and a preset independent defect type B. Firstly, judging whether the characteristic value of the defect image in the defect image set A accords with a preset condition corresponding to the preset independent defect type A, if so, determining that the defect type is the preset independent type A, and if not, continuously judging whether the characteristic value of the defect image in the defect image set A accords with the preset condition corresponding to the preset independent defect type B.
In some embodiments, some of the preset independent defect types correspond to defects belonging to false defects. A false defect is a defect on an object to be inspected that has no substantial damage. The true defect is a defect with substantial damage or unsatisfactory defects on the object to be detected. In order to avoid interference when the false defect matches the preset rule of the independent defect type corresponding to the true defect, in the embodiment of the present application, the step of judging whether the characteristic value of each defect image accords with the preset rule corresponding to the preset independent defect type includes:
judging whether the characteristic value of the defect image accords with a preset rule of a preset independent defect type corresponding to the false defect.
In the embodiment of the application, the characteristic values of the defect images in the defect image set are matched with the preset rules of the preset independent defect types corresponding to the false defects, so that if the preset rules of the preset independent defect types corresponding to the false defects are met, the preset rules of the preset independent defect types corresponding to the true defects can not be continuously matched, various characteristic values generated by the false defects are avoided, and interference is generated when the preset rules of the preset independent defect types corresponding to the true defects are matched.
If the preset rule of the preset independent defect type corresponding to the false defect is met, determining that the defect type comprises the preset independent defect type corresponding to the false defect.
If the preset rule of the preset independent defect type corresponding to the false defect is not met, judging whether the characteristic value of the defect image meets the preset rule of the preset independent defect type corresponding to the true defect.
Since the false defects can be multiple, when the characteristic value is matched with the preset rule of the preset independent defect type corresponding to one false defect and does not accord with the preset rule, the characteristic value is required to be continuously matched with the preset rules of the preset independent defect types corresponding to other false defects until the characteristic value is matched with the preset rules of the preset independent defect types corresponding to all the false defects, and if the characteristic value does not accord with the preset rules of the preset independent defect types corresponding to the false defects, whether the characteristic value of the defect image accords with the preset rules of the preset independent defect types corresponding to the true defects is judged.
As the true defects can be multiple, and the characteristic value does not accord with the preset rule of the preset independent defect type corresponding to one true defect, the preset rule of the preset independent defect type corresponding to other true defects is continuously matched.
In the embodiment of the application, when judging whether the characteristic values of the defect images in a group of defect image combinations accord with the preset rules corresponding to the preset independent defect types, the characteristic values need to be matched with the preset rules of the preset independent defect types corresponding to the false defects, and then the characteristic values are matched with the preset rules of the preset independent defect types corresponding to the true defects. It should be noted that, in the embodiment of the present application, the matching sequence when the characteristic value matches with the preset rule of the preset independent defect type corresponding to the plurality of false defects is not limited, and the matching sequence when the characteristic value matches with the preset rule of the preset independent defect type corresponding to the plurality of true defects is also not limited.
If the preset rule of the preset independent defect type corresponding to the true defect is met, determining that the defect type comprises the preset independent defect type corresponding to the true defect.
In one example, the dummy defects include a dummy defect a and a dummy defect B, and the real defects include a real defect a, a real defect B, and a real defect C. The step of judging whether the characteristic values of the defect images in the group of defect image combinations accord with preset rules corresponding to preset independent defect types comprises the following steps: judging whether the characteristic value of the defect image accords with the preset rule of the preset independent defect type corresponding to the false defect A, if not, judging whether the characteristic value of the defect image accords with the preset rule of the preset independent defect type corresponding to the false defect B, if not, judging whether the characteristic value of the defect image accords with the preset rule of the preset independent defect type corresponding to the true defect A, if not, continuously judging whether the characteristic value of the defect image accords with the preset rule of the preset independent defect type corresponding to the true defect B, and if so, determining that the independent defect type is the independent defect type of the true defect B.
The following description of the preset rules is specific, and it should be noted that the preset rules are only a partial example, and other preset rules may be used according to practical situations.
In some embodiments, a scratch defect may occur in the object to be detected, the scratch defect being a true defect. In the embodiment of the application, the scratch type can be preset as a preset independent defect type and a preset rule corresponding to the scratch type.
Since the scratch defect is characterized by being elongated and straight, when determining the scratch type from the feature values, linearity and aspect ratio may be used as the feature values, and the preset rule of the scratch type may include determining that the defect type is the scratch type when a condition that the linearity is greater than the preset linearity and the aspect ratio is greater than the preset aspect ratio is satisfied.
In the embodiment of the application, the preset linearity and the preset length-width ratio can be set in advance. For example, as shown in fig. 6, the linearity of the scratch defect in fig. 6 (a) is 0.992, and the linearity of the bending interference line in fig. 6 (b) is 0.813, so the preset linearity may be set to 0.95, and the defect type may be the scratch defect when the condition that the linearity is greater than 0.95 is satisfied. In addition, the defects with the length-width ratio of 5-10 are short scratches, and the defects with the length-width ratio of more than 10 are long scratches, and in the embodiment of the application, only the long scratches are set as scratch defects, so that the defect type may be the scratch defects when the condition with the length-width ratio of more than 10 is satisfied. The predetermined rule includes determining that the defect type is a scratch type when the linearity is greater than 0.95 and the aspect ratio is greater than 10.
It is understood that in the present example, only the defect type when the long scratch condition is satisfied is determined as the scratch type, and in another example, the defect type when both the long scratch and the short scratch conditions are satisfied may be determined as the scratch type, and the specific preset aspect ratio may be set according to actual needs.
In some embodiments, since the values of the linearity and the aspect ratio calculated by the defect images obtained by different polishing methods are generally the same, the linearity and the aspect ratio corresponding to any one defect image can be selected in the defect image combination to match with a preset rule, so that whether the defect type is a scratch type can be accurately determined.
In some embodiments, the preset independent defect type corresponding to the true defect includes a scratch type, and the characteristic value includes linearity and aspect ratio; the step of judging whether the characteristic value of the defect image accords with a preset rule of a preset independent defect type corresponding to the true defect comprises the following steps:
judging whether the linearity of the defect image is larger than a preset linearity and whether the length-width ratio of the defect image is larger than a preset length-width ratio;
if the linearity of the defect image is greater than the preset linearity and the length-to-width ratio of the defect image is greater than the preset length-to-width ratio, determining that the characteristic value of the defect image accords with a preset rule of a preset independent defect type corresponding to the true defect.
In the embodiment of the application, the judging sequence for judging whether the linearity of the defect image is greater than the preset linearity and whether the length-to-width ratio of the defect image is greater than the preset length-to-width ratio is not limited, and when one judging condition is not met, the other judging condition is not executed any more, and at the moment, the characteristic value is determined to be not met with the preset rule of the scratch type.
In some embodiments, since a difference needs to exist between the gray average value of the defect image corresponding to the scratch defect and the gray average value of the background surrounding the defect image, the preset rule of the scratch type includes that the linearity is greater than the preset linearity and the aspect ratio is greater than the preset aspect ratio, and may further include that the absolute value of the defect gray average value and the background gray average value is greater than the first preset absolute value, or the standard deviation of the defect gray average value and the background gray average value is greater than the first preset standard deviation. The first preset absolute value and the first preset standard deviation can be set according to actual needs.
In some embodiments, a crush defect may occur in the object to be inspected, the crush defect being a true defect. In the embodiment of the application, the crush type can be preset as a preset independent defect type and a preset rule corresponding to the crush type.
Since the crush defect and the dirt defect are easy to be misjudged, and the dirt defect is not a true defect but a false defect, the possibility that the defect is the dirt defect needs to be eliminated when the crush defect is judged. Considering that the general roundness of the crush defect is large and the possible roundness of the dirty defect is small, the roundness may be used as a characteristic value when determining the defect type according to the roundness, and the preset rule of the crush defect may include determining that the defect type is a crush defect when the condition that the roundness is greater than the preset roundness is satisfied.
In the embodiment of the application, the preset roundness can be set in advance. As shown in fig. 7, for example, the roundness of the crush defect in fig. 7 (a) is 0.931, and the roundness of the dirty defect in fig. 7 (b) is 0.764, so the preset roundness may be set to 0.9, and the defect type may be a crush defect when the condition that the roundness is greater than 0.9 is satisfied.
In some embodiments, the step of determining whether the feature value of the defect image meets a preset rule of a preset independent defect type corresponding to the true defect comprises:
judging whether the roundness of the defect image is larger than a preset roundness or not;
if the roundness of the defect image is larger than the preset roundness, determining that the characteristic value of the defect image accords with a preset rule of a preset independent defect type corresponding to the true defect.
In some embodiments, in an actual industrial scenario, when the roundness is greater than the preset roundness, there may be a plurality of defect images with roundness greater than the preset roundness, that is, the number of defect images with roundness greater than the preset roundness in the first detection area where the defect is located is required to be greater than the number threshold, so that the defect type is determined to be a crush injury type. And determining that the defect type is a crush type when the number of the independent areas is larger than the number threshold. The preset rule corresponding to the crush type may include determining that the defect type is a crush type when a condition that the roundness is greater than the preset roundness and the number of independent areas is greater than a number threshold is satisfied.
In some embodiments, when determining whether the defect is of the crush injury type, the preset rule further needs to ensure that the defect image area is larger, and the degree of distinction between the defect image and the background around the defect image is larger, where the preset rule of crush injury defects may include that the degree of roundness is larger than a preset degree of roundness, the number of defects of all preset degrees of roundness in a first detection area where the defect is located is larger than a number threshold, the defect area is larger than a first preset area, the number of low gradient difference pixels is larger than a first preset number, and the first ratio is higher than a first preset ratio, or the preset rule of crush injury defects may include that the degree of roundness is larger than a preset degree of roundness, the number of defects of all preset degrees of roundness in the first detection area where the defect is located is larger than a number threshold, the number of high gradient difference pixels is larger than a second preset number, and the second ratio is higher than a second preset ratio.
In some embodiments, the roundness calculated by the defect images acquired in different polishing modes, the number of independent areas and the numerical value of the area of the defect area are generally the same, so that the roundness, the number of independent areas and the area of the defect area corresponding to one defect image can be selected in the defect image combination to be matched with a preset rule, and whether the defect type is a crush injury type can be accurately determined.
In some embodiments, there may be a different color defect or a dirty defect in the object to be detected, where the different color defect is a true defect and the dirty defect is a false defect. In the embodiment of the application, the different color type and the dirt type can be preset as preset independent defect types, and preset rules corresponding to the different color type and the dirt type.
The defects are obviously imaged in most polishing modes, namely images to be detected which are shot in most polishing modes are obviously displayed, the defects with different colors are only imaged in the images to be detected which are shot in part of polishing modes and are not obviously displayed, in addition, the absolute values of the defect gray average value and the background gray average value can show the difference between the defect image and the gray average value of the background around the defect image, the larger the difference is, the larger the absolute values of the defect gray average value and the background gray average value are, the more obvious the images are, and therefore the defect type can be determined by comparing the absolute values of the defect gray average value and the background gray average value with preset absolute values. At this time, the preset rule corresponding to the heterochromatic type may include that the absolute values of the N defect gray average values and the background gray average values calculated in the N polishing manners are satisfied, and when the absolute values of at least M defect gray average values and the background gray average values are greater than the preset absolute value, the defect type is determined to be a dirty defect, where M is less than or equal to N. The preset rule corresponding to the dirt type further comprises determining that the defect type of the defect is a heterochromatic defect when the absolute value of the gray average value of all defects and the absolute value of the background gray average value calculated in all the polishing modes are smaller than the preset absolute value.
In one example, as shown in fig. 8, in fig. 8 (a), the dirt defect is imaged in the images to be detected photographed in three different lighting modes, the absolute value of the defect gray average value and the background gray average value in the first image to be detected is 28, the absolute value of the defect gray average value and the background gray average value in the second image to be detected and the third image to be detected are both greater than 100, so that the absolute values of the defect gray average value and the background gray average value in the three images to be detected are both greater, and in fig. 8 (B), the abnormal defect is imaged only in the first image to be detected relatively significantly. The absolute value of the defect gray average value and the background gray average value in the first image to be detected is 15, and the absolute value of the defect gray average value and the background gray average value in the second image to be detected and the third image to be detected is smaller than 5. It can be seen that if the dirt defect is a defect, the absolute values of the defect gray average value and the background gray average value calculated in most polishing modes are larger, and if the dirt defect is a different color defect, the absolute values of the defect gray average value and the background gray average value calculated in any polishing mode are relatively smaller. According to the data in this example, the preset absolute value in the embodiment of the present application may be set to 50.
In some embodiments, the step of determining whether the feature value of the defect image meets a preset rule of a preset independent defect type corresponding to the true defect comprises:
judging whether the absolute value of the defect gray average value and the background gray average value in all the defect images obtained in the lighting mode is larger than the first defect image number of a preset absolute value or not;
if the number of the defect images is larger than the number of the preset defect images, determining that the characteristic values of the defect images accord with the preset rule of the preset independent defect types corresponding to the true defects.
In some embodiments, when determining the heterochromatic type, the preset rule also needs to ensure that the area of the defect image is large, and the degree of distinction between the defect image and the background surrounding the defect image is large.
The preset rule corresponding to the heterochromatic type may include that the absolute values of the defect gray average value and the background gray average value calculated in the N polishing modes are satisfied, and the absolute values of at least M defect gray average values and background gray average values are greater than the preset absolute value; the defect image area is larger than the second preset area, the number of the low gradient difference pixel points is larger than the third preset number, the first proportion is higher than the third preset proportion, or the number of the high gradient difference pixel points is larger than the fourth preset number, and the second proportion is higher than the fourth preset proportion.
In some embodiments, the preset independent defect types corresponding to the false defects include dirt types, and the characteristic values include absolute values of defect gray average values and background gray average values in the defect images acquired in all lighting modes; the step of judging whether the characteristic value of the defect image accords with a preset rule of a preset independent defect type corresponding to the false defect comprises the following steps:
judging whether absolute values of a defect gray average value and a background gray average value in the defect images obtained in all the lighting modes are smaller than a preset absolute value or not;
if the characteristic value of the defect image is smaller than the preset absolute value, determining that the characteristic value of the defect image accords with a preset rule of a preset independent defect type corresponding to the false defect.
In some embodiments, there may be a bright line defect in the object to be detected, which is a false defect. In the embodiment of the application, the bright line type can be preset as the preset independent defect type.
Due to the lighting mode, the object to be detected possibly has the light reflection condition, and the shot image to be detected can have a defect image generated by the light reflection. Since the angle between the defective image generated by reflection of light and the horizontal line on the image to be detected is related to the angle of the light emitted from the light source, the defect type can be determined by the relationship between the minimum circumscribed rectangle angle and the angle of the light emitted from the light source. The angle of the light emitted from the light source is expressed as an angle between the light and the horizontal line, and the angle is set to a preset angle. The preset rule may include determining that the defect type is a bright line defect if a condition that the minimum circumscribed rectangle angle is equal to the preset angle is satisfied.
For example, if the angle of the light emitted by the light source, that is, the preset angle is 0 degrees, the preset rule corresponding to the bright line defect may include determining that the defect type is the bright line type if the minimum circumscribed rectangle angle is equal to 0 °.
In the embodiment of the present application, the step of determining whether the feature value of the defect image meets the preset rule of the preset independent defect type corresponding to the false defect includes:
judging whether the minimum circumscribed rectangle angle of the defect image is equal to a preset angle or not;
if the minimum circumscribed rectangle angle of the defect image is equal to the preset angle, determining that the characteristic value of the defect image accords with the preset rule of the preset independent defect type corresponding to the false defect.
In some embodiments, since the values of the minimum circumscribed rectangle angles calculated by the defect images obtained in different lighting modes are generally the same, the minimum circumscribed rectangle angle corresponding to one defect image can be selected for matching with a preset rule in the defect image combination, and whether the defect type is a bright line type can be accurately determined.
In some embodiments, there may be a solid black hole defect that does not occur in the object to be detected, and the solid black hole defect is an overall defect. In the embodiment of the application, the defects without the fixed black hole type are preset as the preset integral defect type, and the preset rule corresponding to the non-black hole type is preset.
Due to the process requirement of the object to be detected, a fixed black hole may need to be arranged in the object to be detected, and due to the fact that the gray level distribution range is smaller when the image of the black hole is displayed on the image to be detected, the gray level average value and the gray level variance of the defect image need to be utilized, and when the defect image with the gray level variance smaller than the preset gray level variance exists, the black hole in the object to be detected is determined. The preset rule that the fixed black hole defect type does not occur at this time may include that the number of defect images satisfying that the gray variance of the defect area is greater than the preset gray variance in all the first detection areas is equal to the preset black hole number, and the defect type is determined as the fixed black hole type does not occur.
For example, the to-be-detected object needs to set two black holes due to process requirements, and the preset rule that the fixed black hole defect type does not appear may include that the number of defect image defects satisfying that the gray variance of the defect area is smaller than the preset gray variance in all the first detection areas is not equal to 2, and then determining that the defect type is the type that the fixed black hole does not appear.
In the embodiment of the present application, the step of determining whether the feature values of the defect images in all the defect image sets conform to the preset rules corresponding to the preset overall defect types includes:
Counting the number of second defect images with the gray variance of the defect areas smaller than the preset gray variance in all the first detection areas;
judging whether the number of the second defect images is equal to the preset defect number or not;
if the second defect image number is equal to the preset defect number, determining that the defect type includes a preset overall defect type.
In some embodiments, since the values of the gray variances calculated by the defect images obtained by different lighting modes are generally the same, the gray variances corresponding to one defect image can be selected for matching with a preset rule in the defect image combination, so as to accurately determine whether the defect type is a type in which no fixed black hole is present.
In some embodiments, a filter may be used to determine the defect type of the defect, and the filter determines the defect type corresponding to the defect on the object to be detected according to the feature value of the defect image.
The method in the embodiment of the application further comprises the following steps:
judging whether the defect type comprises a defect type corresponding to the true defect;
if the defect type corresponding to the true defect is included, determining that the object to be detected is a non-qualified product;
and if the defect type corresponding to the true defect is not included, determining that the object to be detected is a qualified product.
And when the object to be detected has only false defects, determining that the object to be detected is a qualified product. And when the true defect exists on the object to be detected, determining that the object to be detected is a disqualified product.
Since various defects possibly exist in the object to be detected, various defect types are determined and obtained by utilizing preset rules. Since some defects of the defect type belong to false defects, i.e. there is no defect with substantial damage to the object to be detected in practice, the object to be detected is still a good product although there is a false defect to the object to be detected. For example, bright line defects, dirt defects, and the like are all false defects. And if the defect type comprises the defect type corresponding to the true defect, determining that the object to be detected is a disqualified product.
In the embodiment of the application, the preset rule not only can determine the defect type according to the characteristic value, but also can continuously judge whether the object to be detected is a qualified product by utilizing the defect type. The preset rules include, in addition to the above logic rules for determining the defect type, logic rules for determining whether the object to be inspected is a good product. In some embodiments, in order to quickly identify whether the object to be detected is a qualified product, the preset rule may include directly outputting a conclusion that the object to be detected is a non-qualified product when identifying that a defect type corresponding to a certain defect image in the image to be detected is a defect type corresponding to a true defect, and detecting other defect images on the image to be detected to determine the corresponding defect type.
In some embodiments, the OK flag is output when the object to be detected is a good product, and the NG flag is output when the object to be detected is a bad product.
In the above embodiment, the method for determining the defect type in the industrial defect detection is provided, in which a to-be-detected image obtained by photographing an object to be detected is obtained, the defect image is identified from the to-be-detected image, a feature value of the defect image corresponding to a feature control selected by a user is calculated, the defect type of the defect on the object to be detected is determined according to the feature value, and finally, the purpose of accurately determining the defect type is achieved through the feature value. The method comprises the following steps: acquiring an image to be detected, which is shot by an object to be detected in at least one lighting mode; detecting the images to be detected in each lighting mode to obtain defect images in the images to be detected; calculating a characteristic value of the defect image corresponding to the characteristic control according to the received characteristic control selected by the user on the interface; and determining the defect type corresponding to the defect on the object to be detected according to the characteristic value of the defect image.
As a specific implementation of the method of fig. 1 to 8, as shown in fig. 9, a second aspect of the present application provides a schematic structural diagram of an apparatus for determining a defect type in industrial defect detection, where the apparatus includes:
An acquiring unit 901, configured to acquire an image to be detected captured by an object to be detected in at least one lighting manner;
the first detecting unit 902 is configured to detect an image to be detected in each lighting mode, so as to obtain a defect image in the image to be detected;
the calculating unit 903 is configured to calculate, according to the received feature control selected by the user on the interface, a feature value of the defect image corresponding to the feature control;
a first determining unit 904, configured to determine a defect type corresponding to a defect on the object to be detected according to the feature value of the defect image.
For specific limitations regarding the apparatus 900 for determining a defect type in industrial defect detection, reference may be made to the above limitations regarding the method for determining a defect type in industrial defect detection, and will not be described in detail herein.
As an alternative example, the detection unit includes:
the first segmentation unit is used for segmenting the image to be detected to obtain a region of interest;
the second segmentation unit is used for segmenting the region of interest to obtain a first detection region;
the second detection unit is used for detecting the first detection area to obtain a defect image in the image to be detected.
As an alternative example, the determining unit includes:
The first judging unit is used for judging whether the characteristic value of the defect image accords with a preset rule corresponding to a preset defect type, wherein the preset rule is a logic rule determined according to the characteristic value;
and the second determining unit is used for determining that the defect type is the preset defect type if the defect type accords with the preset rule of the preset defect type.
As an alternative example, the judging unit includes:
the screening unit is used for screening out defect images with the same center point coordinates from all defect images detected in the lighting mode, and combining the defect images with the same center point into a defect image set;
the second judging unit is used for judging whether the characteristic value of the defect image in each group of defect image combination accords with a preset rule corresponding to a preset independent defect type; and/or a third judging unit, configured to judge whether feature values of defect images in all defect image sets conform to preset rules corresponding to preset overall defect types; the preset rules corresponding to the preset independent defect types are logic rules determined according to the characteristic values of the defect images in the group of defect image sets; the overall defect type is a logic rule determined according to the feature values of the defect images in all defect image sets.
As an alternative example, the apparatus further comprises:
a fourth judging unit, configured to judge whether the defect type includes a defect type corresponding to a true defect;
a third determining unit, configured to determine that the object to be detected is a non-qualified product if the defect type corresponding to the true defect is included;
and the fourth determining unit is used for determining that the object to be detected is a qualified product if the defect type corresponding to the true defect is not included.
Based on the method shown in fig. 1 and the device embodiment shown in fig. 9, in order to achieve the above objective, the embodiment of the present application further provides a detection system, and specifically, the detection system may be an AOI detection system or another detection system. The detection system includes a storage medium and a processor; a storage medium storing a computer program; a processor for executing a computer program to implement the method of determining a defect type in the industrial defect detection as described above and shown in fig. 1.
Optionally, the detection system may also include a user interface, a camera, radio Frequency (RF) circuitry, sensors, audio circuitry, WI-FI modules, and the like. The user interface may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), etc., and the optional user interface may also include a USB interface, a card reader interface, etc.
It will be appreciated by those skilled in the art that the structure of a detection system provided in this embodiment is not limiting of the detection system, and may include more or fewer components, or may be a combination of certain components, or may be a different arrangement of components.
The storage medium may also include an operating system, a network communication module. An operating system is a program that manages and saves computer device hardware and software resources, supporting the execution of information handling programs and other software and/or programs. The network communication module is used for realizing communication among all components in the storage medium and communication with other hardware and software in the entity equipment.
Based on the above method shown in fig. 1, correspondingly, the embodiment of the present application further provides a storage medium, on which a computer program is stored, which when executed by a processor, implements the above method for determining a defect type in industrial defect detection shown in fig. 1.
Based on such understanding, the technical solution of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.), and includes several instructions for causing a computer device (may be a personal computer, a server, or a network device, etc.) to execute the method of each implementation scenario of the present application.
Based on the above method shown in fig. 1, correspondingly, the embodiment of the present application further provides a storage medium, on which a computer program is stored, which when executed by a processor, implements the above method for determining a defect type in industrial defect detection shown in fig. 1.
Based on such understanding, the technical solution of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.), and includes several instructions for causing a computer device (may be a personal computer, a server, or a network device, etc.) to execute the method of each implementation scenario of the present application.
Those skilled in the art will appreciate that the drawing is merely a schematic illustration of a preferred implementation scenario and that the modules or flows in the drawing are not necessarily required to practice the application. Those skilled in the art will appreciate that modules in an apparatus in an implementation scenario may be distributed in an apparatus in an implementation scenario according to an implementation scenario description, or that corresponding changes may be located in one or more apparatuses different from the implementation scenario. The modules of the implementation scenario may be combined into one module, or may be further split into a plurality of sub-modules.
The above-mentioned inventive sequence numbers are merely for description and do not represent advantages or disadvantages of the implementation scenario. The foregoing disclosure is merely illustrative of some embodiments of the application, and the application is not limited thereto, as modifications may be made by those skilled in the art without departing from the scope of the application.

Claims (10)

1. A method for determining a defect type in an industrial defect inspection, comprising:
acquiring an image to be detected, which is shot by an object to be detected in at least one lighting mode;
detecting the images to be detected in each lighting mode to obtain a defect image in the images to be detected;
calculating a characteristic value of the defect image corresponding to the characteristic control according to the received characteristic control selected by the user on the interface;
and determining the defect type corresponding to the defect on the object to be detected according to the characteristic value of the defect image.
2. The method according to claim 1, wherein the step of detecting the image to be detected in each lighting mode to obtain a defect image in the image to be detected comprises:
dividing the image to be detected to obtain a region of interest;
Dividing the region of interest to obtain a first detection region;
and detecting the first detection area to obtain a defect image in the image to be detected.
3. The method according to claim 2, wherein the step of detecting the first detection area to obtain a defect image in the image to be detected includes:
inputting the first detection area into a preset neural network model to output a defect image; the preset neural network model is obtained by training with sample data, the sample data comprises a plurality of groups of input samples and output samples corresponding to the input samples, the input samples are second detection areas, and the output samples are defect images in the second detection areas.
4. The method according to claim 1, wherein the step of determining a defect type corresponding to a defect on the object to be detected based on the feature value of the defect image comprises:
judging whether the characteristic value of the defect image accords with a preset rule corresponding to a preset defect type or not, wherein the preset rule is a logic rule determined according to the characteristic value;
And if the preset rule of the preset defect type is met, determining that the defect type is the preset defect type.
5. The method of claim 4, wherein the step of determining whether the feature value of the defect image meets a preset rule corresponding to a preset defect type comprises:
screening out defect images with the same center point coordinates from the defect images detected in all the polishing modes, and combining the defect images with the same center point into a defect image set;
judging whether the characteristic values of the defect images in each group of defect image combinations accord with preset rules corresponding to preset independent defect types; and/or judging whether the characteristic values of the defect images in all the defect image sets accord with preset rules corresponding to preset integral defect types; the preset rules corresponding to the preset independent defect types are logic rules determined according to the characteristic values of the defect images in the group of defect image sets; the overall defect type is a logic rule determined according to the characteristic values of the defect images in all the defect image sets.
6. The method of claim 5, wherein the step of determining whether the feature values of the defect images in each group of defect image combinations meet a preset rule corresponding to a preset independent defect type comprises:
Judging whether the characteristic value of the defect image accords with a preset rule of a preset independent defect type corresponding to the false defect;
if the preset rule of the preset independent defect type corresponding to the false defect is met, determining that the defect type comprises the preset independent defect type corresponding to the false defect;
if the preset rule of the preset independent defect type corresponding to the false defect is not met, judging whether the characteristic value of the defect image meets the preset rule of the preset independent defect type corresponding to the true defect;
if the preset rule of the preset independent defect type corresponding to the true defect is met, determining that the defect type comprises the preset independent defect type corresponding to the true defect.
7. The method of claim 6, wherein the predetermined independent defect type corresponding to the true defect comprises a scratch type, and the characteristic value comprises linearity and aspect ratio; the step of judging whether the characteristic value of the defect image accords with a preset rule of a preset independent defect type corresponding to the true defect comprises the following steps:
judging whether the linearity of the defect image is larger than a preset linearity and whether the length-width ratio of the defect image is larger than a preset length-width ratio;
And if the linearity of the defect image is larger than the preset linearity and the length-to-width ratio of the defect image is larger than the preset length-to-width ratio, determining that the characteristic value of the defect image accords with the preset rule of the preset independent defect type corresponding to the true defect.
8. An apparatus for determining a defect type in an industrial defect inspection, comprising:
the acquisition unit is used for acquiring an image to be detected, which is shot by an object to be detected in at least one lighting mode;
the first detection unit is used for detecting the images to be detected in each lighting mode to obtain defect images in the images to be detected;
the computing unit is used for computing the characteristic value of the defect image corresponding to the characteristic control according to the received characteristic control selected by the user on the interface;
and the first determining unit is used for determining the defect type corresponding to the defect on the object to be detected according to the characteristic value of the defect image.
9. A detection system comprising a processor and a memory;
the memory is used for storing operation instructions;
the processor is configured to execute the steps of the method for determining a defect type in the industrial defect detection according to any one of the preceding claims 1 to 7 by invoking the operation instruction.
10. A computer readable storage medium having stored thereon a computer program, characterized in that the program when executed by a processor carries out the steps of the method of determining a defect type in industrial defect detection according to any of the preceding claims 1 to 7.
CN202311125717.4A 2023-09-01 2023-09-01 Method, device, system and storage medium for determining defect type in industrial defect detection Pending CN117169226A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311125717.4A CN117169226A (en) 2023-09-01 2023-09-01 Method, device, system and storage medium for determining defect type in industrial defect detection

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311125717.4A CN117169226A (en) 2023-09-01 2023-09-01 Method, device, system and storage medium for determining defect type in industrial defect detection

Publications (1)

Publication Number Publication Date
CN117169226A true CN117169226A (en) 2023-12-05

Family

ID=88946405

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311125717.4A Pending CN117169226A (en) 2023-09-01 2023-09-01 Method, device, system and storage medium for determining defect type in industrial defect detection

Country Status (1)

Country Link
CN (1) CN117169226A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119359712A (en) * 2024-12-24 2025-01-24 四川航天川南火工技术有限公司 Visual detection method, device and system for surface defects of explosion-propagation surface sealing part

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119359712A (en) * 2024-12-24 2025-01-24 四川航天川南火工技术有限公司 Visual detection method, device and system for surface defects of explosion-propagation surface sealing part

Similar Documents

Publication Publication Date Title
CN111246204B (en) Relative brightness deviation-based dirt detection method and device
CN115908269B (en) Visual defect detection method, visual defect detection device, storage medium and computer equipment
CN110766679B (en) Lens contamination detection method and device and terminal equipment
KR100371470B1 (en) A New Perceptual Thresholding for Gradient-Based Local Edge Detection
CN108896278B (en) Optical filter silk-screen defect detection method and device and terminal equipment
CN113240630B (en) Speckle image quality evaluation method and device, terminal equipment and readable storage medium
US20080131026A1 (en) Method and system for object recognition using fractal maps
CN113781396B (en) Screen defect detection method, device, equipment and storage medium
CN114937003B (en) A multi-type defect detection system and method for glass panels
CN108918093B (en) Optical filter mirror surface defect detection method and device and terminal equipment
CN113409271B (en) Method, device and equipment for detecting oil stain on lens
CN107103865B (en) Method and device for detecting display area in display screen
CN111368587A (en) Scene detection method and device, terminal equipment and computer readable storage medium
CN111062984A (en) Method, device and equipment for measuring area of video image region and storage medium
CN117169226A (en) Method, device, system and storage medium for determining defect type in industrial defect detection
CN117745552A (en) Self-adaptive image enhancement method and device and electronic equipment
CN115619783B (en) Method and device for detecting product processing defects, storage medium and terminal
CN111524153B (en) Image analysis force determination method and device and computer storage medium
CN113781393A (en) Screen defect detection method, device, equipment and storage medium
CN110310341B (en) Method, device, equipment and storage medium for generating default parameters in color algorithm
CN119540205A (en) Method and system for inspecting residual film on IC substrate
CN114841946A (en) Defect detection method, defect detection device, electronic equipment and storage medium
CN111768357A (en) Image detection method and device
CN111563869B (en) Stain test method for quality inspection of camera module
US20240320806A1 (en) Image processing method and apparatus, electronic device and computer readable storage medium

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