CN111882541A - Defect detection method, device, equipment and computer readable storage medium - Google Patents

Defect detection method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN111882541A
CN111882541A CN202010740667.0A CN202010740667A CN111882541A CN 111882541 A CN111882541 A CN 111882541A CN 202010740667 A CN202010740667 A CN 202010740667A CN 111882541 A CN111882541 A CN 111882541A
Authority
CN
China
Prior art keywords
image
defect
area
defect detection
characteristic
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
CN202010740667.0A
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.)
Guangzhou Roushi Intelligent Technology Co ltd
Original Assignee
Guangzhou Roushi Intelligent Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Roushi Intelligent Technology Co ltd filed Critical Guangzhou Roushi Intelligent Technology Co ltd
Priority to CN202010740667.0A priority Critical patent/CN111882541A/en
Publication of CN111882541A publication Critical patent/CN111882541A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/12Edge-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30168Image quality inspection

Landscapes

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

Abstract

The invention discloses a defect detection method, a device, equipment and a computer readable storage medium, wherein the defect detection method comprises the following steps: acquiring a target image, and performing area division on the target image to acquire a plurality of area images; respectively obtaining the area feature identification of each area image in the plurality of area images, and respectively determining the defect feature corresponding to the area feature identification of each area image; based on the defect characteristics, the defect images corresponding to the region images are respectively output, and the defect detection is respectively carried out on each region image, so that various defects with different sizes possibly appearing at each position on the image can be detected, the flexibility of defect detection and the accuracy of a defect detection result are improved, and further the user experience is improved.

Description

Defect detection method, device, equipment and computer readable storage medium
Technical Field
The present invention relates to the field of product defect detection, and in particular, to a method, an apparatus, a device and a computer readable storage medium for detecting defects.
Background
The defect imaging system mainly comprises: camera, lens and light source. The system selects a proper camera, a proper lens and a proper light source to image the defects according to the specific requirements of the customer. The automatic defect detection part is the brain of the whole visual detection system, wherein the automatic defect detection by using an image processing technology is the core of the whole system, although various detection algorithms are continuously generated at present, a certain gap is still formed between the automatic defect detection part and the brain in practical application to meet the requirements of practical application, and generally, the detection result is inaccurate and the error has the consequence due to different defect forms, different sizes and the like.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a defect detection method, a defect detection device, defect detection equipment and a computer readable storage medium, and aims to solve the technical problem that detection results are inaccurate due to different defect forms, different sizes, random positions and the like.
In order to achieve the above object, the present invention provides a defect detection method, including the steps of:
acquiring a target image, and performing area division on the target image to acquire a plurality of area images;
respectively obtaining the area feature identification of each area image in the plurality of area images, and respectively determining the defect feature corresponding to the area feature identification of each area image;
and respectively outputting a defect image corresponding to each area image based on the defect characteristics.
Preferably, when a product to be detected is placed on the defect detection platform, a target image of the product to be detected is acquired based on a camera device of the defect detection platform.
Preferably, product characteristic information of a product to be detected is acquired, and/or pixel screening is performed on the target image to acquire a pixel defect area corresponding to the target image;
and performing area division on the target image based on the product characteristic information and/or the pixel defect area corresponding to the target image to obtain a plurality of area images, and performing area characteristic identification on the plurality of area images.
Preferably, the algorithm parameters corresponding to each area image are determined respectively based on the defect characteristics corresponding to each area image;
and performing preset algorithm detection on the region image based on the algorithm parameters corresponding to the region image so as to output a defect image corresponding to the region image.
Preferably, based on the corresponding filtering parameter of the area image, the area image is pre-filtered to obtain a filtered image;
performing defect segmentation on the filtered image based on segmentation parameters corresponding to the region image to obtain a binary image;
and based on the characteristic parameters, carrying out characteristic screening on the binary image to determine a defect image corresponding to the binary image, and outputting the defect image.
Preferably, performing connected domain analysis on the binarized image to obtain a connected domain set of the binarized image;
and based on the characteristic parameters, performing characteristic screening on each connected domain of the connected domain set of the binary image one by one to determine a defect image corresponding to the binary image, and outputting the defect image.
Preferably, feature extraction is performed on each connected domain of the connected domain set of the binarized image one by one to obtain a feature set corresponding to each connected domain;
acquiring a characteristic value corresponding to each characteristic in a characteristic set corresponding to the connected domain, and comparing the characteristic value with a standard characteristic value to acquire a defect judgment result corresponding to the connected domain;
and determining a defect image corresponding to the binary image based on the defect judgment result corresponding to each connected domain of the connected domain set.
Further, to achieve the above object, the present invention also provides a defect detecting apparatus including:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a target image and dividing the target image into areas so as to acquire a plurality of area images;
the second acquisition module is used for respectively acquiring the regional characteristic identifier of each regional image in the plurality of regional images and respectively determining the defect characteristic corresponding to the regional characteristic identifier of each regional image;
and the output module is used for respectively outputting the defect image corresponding to each area image based on the defect characteristics.
Preferably, the first obtaining module is further configured to,
when a product to be detected is placed on a defect detection platform, a target image of the product to be detected is collected based on a camera device of the defect detection platform.
Preferably, the first obtaining module is further configured to,
acquiring product characteristic information of a product to be detected, and/or performing pixel screening on the target image to acquire a pixel defect area corresponding to the target image;
and performing area division on the target image based on the product characteristic information and/or the pixel defect area corresponding to the target image to obtain a plurality of area images, and performing area characteristic identification on the plurality of area images.
Preferably, the output module is further configured to,
determining algorithm parameters corresponding to the area images respectively based on the defect characteristics corresponding to each area image;
and performing preset algorithm detection on the region image based on the algorithm parameters corresponding to the region image so as to output a defect image corresponding to the region image.
Preferably, the output module is further configured to,
based on the corresponding filtering parameters of the area image, pre-filtering the area image to obtain a filtered image;
performing defect segmentation on the filtered image based on segmentation parameters corresponding to the region image to obtain a binary image;
and based on the characteristic parameters, carrying out characteristic screening on the binary image to determine a defect image corresponding to the binary image, and outputting the defect image.
Preferably, the output module is further configured to,
performing connected domain analysis on the binary image to obtain a connected domain set of the binary image;
and based on the characteristic parameters, performing characteristic screening on each connected domain of the connected domain set of the binary image one by one to determine a defect image corresponding to the binary image, and outputting the defect image.
Preferably, the output module is further configured to,
performing feature extraction on each connected domain of the connected domain set of the binary image one by one to obtain a feature set corresponding to each connected domain;
acquiring a characteristic value corresponding to each characteristic in a characteristic set corresponding to the connected domain, and comparing the characteristic value with a standard characteristic value to acquire a defect judgment result corresponding to the connected domain;
and determining a defect image corresponding to the binary image based on the defect judgment result corresponding to each connected domain of the connected domain set.
Further, to achieve the above object, the present invention also provides a defect detecting apparatus including: the system comprises a memory, a processor and a defect detection program stored on the memory and capable of running on the processor, wherein the defect detection program realizes the steps of the defect detection method when being executed by the processor.
Further, to achieve the above object, the present invention also provides a computer readable storage medium having stored thereon a defect detection program, which when executed by a processor, implements the steps of the defect detection method described above.
According to the defect detection method provided by the invention, the target image is obtained, the region of the target image is divided to obtain the plurality of region images, the region feature identifier of each region image in the plurality of region images is respectively obtained, the defect feature corresponding to the region feature identifier of each region image is respectively determined, and the defect image corresponding to each region image is respectively output based on the defect feature, so that various defects possibly appearing at each position on the image and having different sizes can be detected, the flexibility of defect detection and the accuracy of a defect detection result are improved, and further the user experience is improved.
Drawings
FIG. 1 is a schematic structural diagram of a defect detection device in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a schematic flowchart of a defect detection method according to a first embodiment of the present invention;
FIG. 3 is a schematic view of a first embodiment of a defect detection method according to the present invention;
FIG. 4 is a schematic diagram of an N-ary tree algorithm involved in the defect detection method of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 1, fig. 1 is a schematic structural diagram of a defect detection device in a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the defect detecting apparatus may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Optionally, the defect detection device may further include a camera, a Radio Frequency (RF) circuit, a sensor, an audio circuit, a WiFi module, and the like. Such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display screen according to the brightness of ambient light, and a proximity sensor that may turn off the display screen and/or the backlight when the mobile terminal is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), detect the magnitude and direction of gravity when the mobile terminal is stationary, and can be used for applications (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer and tapping) and the like for recognizing the attitude of the mobile terminal; of course, the mobile terminal may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which are not described herein again.
Those skilled in the art will appreciate that the configuration of the defect inspection apparatus shown in FIG. 1 does not constitute a limitation of the defect inspection apparatus, and may include more or fewer components than shown, or some components in combination, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a defect detection program.
In the terminal shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and processor 1001 may be used to invoke a defect detection program stored in memory 1005.
In this embodiment, the defect detecting apparatus includes: a memory 1005, a processor 1001, and a defect detection program stored in the memory 1005 and executable on the processor 1001, wherein the processor 1001, when calling the defect detection program stored in the memory 1005, performs the following operations:
acquiring a target image, and performing area division on the target image to acquire a plurality of area images;
respectively obtaining the area feature identification of each area image in the plurality of area images, and respectively determining the defect feature corresponding to the area feature identification of each area image;
and respectively outputting a defect image corresponding to each area image based on the defect characteristics.
Further, the processor 1001 may call the defect detection program stored in the memory 1005, and further perform the following operations:
when a product to be detected is placed on a defect detection platform, a target image of the product to be detected is collected based on a camera device of the defect detection platform.
Further, the processor 1001 may call the defect detection program stored in the memory 1005, and further perform the following operations:
acquiring product characteristic information of a product to be detected, and/or performing pixel screening on the target image to acquire a pixel defect area corresponding to the target image;
and performing area division on the target image based on the product characteristic information and/or the pixel defect area corresponding to the target image to obtain a plurality of area images, and performing area characteristic identification on the plurality of area images.
Further, the processor 1001 may call the defect detection program stored in the memory 1005, and further perform the following operations:
determining algorithm parameters corresponding to the area images respectively based on the defect characteristics corresponding to each area image;
and performing preset algorithm detection on the region image based on the algorithm parameters corresponding to the region image so as to output a defect image corresponding to the region image.
Further, the processor 1001 may call the defect detection program stored in the memory 1005, and further perform the following operations:
based on the corresponding filtering parameters of the area image, pre-filtering the area image to obtain a filtered image;
performing defect segmentation on the filtered image based on segmentation parameters corresponding to the region image to obtain a binary image;
and based on the characteristic parameters, carrying out characteristic screening on the binary image to determine a defect image corresponding to the binary image, and outputting the defect image.
Further, the processor 1001 may call the defect detection program stored in the memory 1005, and further perform the following operations:
performing connected domain analysis on the binary image to obtain a connected domain set of the binary image;
and based on the characteristic parameters, performing characteristic screening on each connected domain of the connected domain set of the binary image one by one to determine a defect image corresponding to the binary image, and outputting the defect image.
Further, the processor 1001 may call the defect detection program stored in the memory 1005, and further perform the following operations:
performing feature extraction on each connected domain of the connected domain set of the binary image one by one to obtain a feature set corresponding to each connected domain;
acquiring a characteristic value corresponding to each characteristic in a characteristic set corresponding to the connected domain, and comparing the characteristic value with a standard characteristic value to acquire a defect judgment result corresponding to the connected domain;
and determining a defect image corresponding to the binary image based on the defect judgment result corresponding to each connected domain of the connected domain set.
The invention also provides a defect detection method, and referring to fig. 2, fig. 2 is a schematic flow chart of a first embodiment of the defect detection method of the invention.
Step S10, acquiring a target image, and performing area division on the target image to acquire a plurality of area images;
in this embodiment, when detecting a product defect, a target image of the product is obtained, and then the obtained target image of the product is subjected to area division to obtain a plurality of area images. Because of reasons such as production process, various appearance defects including spots, scratches, cracks, dirt, pits, bulges and the like inevitably occur in the production process of products, a machine defect detection algorithm is adopted to detect areas of the products at present, however, because the product defects are of various types and the positions of the defects occurring in the products are random, the products need to be divided into a plurality of different areas for the same product, and the targeted defect detection algorithm is adopted for the plurality of different areas, specifically, a target image corresponding to the product to be detected is collected and input, and then the target image is subjected to area division according to a preset division rule to obtain a plurality of area images, wherein the preset division rule can be based on the characteristics of the product to be detected, for example, if the product to be detected is a ceramic bowl, the ceramic bowl can be divided into bowl supports, bowl supports and bowl supports, The concave area and the convex area are used for respectively carrying out bowl support image, concave image and convex image.
Further, step S10 is preceded by:
and step S11, when the product to be detected is placed on the defect detection platform, acquiring a target image of the product to be detected based on the camera device of the defect detection platform.
In this step, when detecting a product defect, a product to be detected needs to be placed on a defect detection platform, as shown in fig. 3, fig. 3 is a scene schematic diagram of an embodiment of the present invention, as shown in fig. 3, as shown in the left side of fig. 3, a rectangle below the left side represents the defect detection platform, a cylinder above the rectangle represents the product to be detected, and an upper side above the left side of the rectangle represents a light source, wherein the light source functions as a light supplement function, so as to avoid that a target image corresponding to the product to be detected and acquired by a camera device has a shadow region due to insufficient light, which affects a defect detection result of the product, specifically, for example, when detecting a concave-convex type product, a light source is used to supplement light for a concave region of the concave-convex product to acquire a non-defective target image, the camera device is arranged above the left side of fig. 3, the camera device is used, specifically, the defect detection system includes a computer and defect detection algorithm software installed on the computer, as shown in fig. 3, the camera device establishes a communication connection with the computer, the camera device transmits a target image of the device to be detected to the computer based on a communication line between the camera device and the computer after acquiring the target image, and finally, the defect detection is performed on the platform to be detected based on the defect detection algorithm software installed on the computer.
Specifically, step S10 includes the steps of,
step S12, acquiring product characteristic information of a product to be detected, and/or performing pixel screening on the target image to acquire a pixel defect area corresponding to the target image;
step S13, performing area division on the target image based on the product feature information and/or the pixel defect area corresponding to the target image to obtain a plurality of area images, and performing area feature identification on the plurality of area images.
Specifically, a product to be detected is placed on a defect detection platform, and product characteristic information of the product to be detected is obtained, specifically, such as the structure information of the product to be detected, the material characteristics of the product to be detected, and the like, then, a camera device based on a defect detection platform collects a target image of a product to be detected, and then pixel screening is carried out on the target image to obtain a pixel defect area corresponding to the target image, specifically, carrying out graying pretreatment on the target image, then acquiring a gray value set corresponding to the target image, calculating the average gray value of the gray value set, and then acquiring a target gray value with the gray value concentration lower than the average gray value, acquiring the position information of the target gray value, acquiring a pixel defect area corresponding to the target image based on the position information of the target gray value, and marking the pixel defect area with pixel defects.
In the step, understandably, inputting a target image, and performing area division on the target image to obtain a plurality of area images specifically includes inputting the target image, then obtaining product feature information of a product to be detected corresponding to the target image and/or a pixel defect area corresponding to the target image, and performing area division on the target image, specifically, if the product to be detected is paper, the paper may have a defect problem of irregular paper edge or unsmooth paper edge, for example, if the product to be detected is paper, the edge of the product to be detected may be divided according to the post information of the product to be detected, and mark an edge feature identifier after division, such as a feature identifier with irregular edge and/or unsmooth edge.
Step S20, respectively acquiring the area feature identifier of each area image in the plurality of area images, and respectively determining the defect feature corresponding to the area feature identifier of each area image;
in this embodiment, it can be understood that, in order to divide the target image into the plurality of area images, that is, to perform different detections on different areas, before the defect detection, corresponding area defect features need to be confirmed, specifically, area feature identifiers of each of the plurality of area images are obtained, where the area feature identifiers include pixel identifiers of the areas and/or defect identifiers of the areas.
Step S30, based on the defect features, outputting defect images corresponding to each area image.
In this embodiment, after determining the defect features corresponding to the region feature identifier of each region image, the algorithm parameters are set based on the defect features to obtain the customized algorithms corresponding to the respective region images, and the defect detection is performed on each region image based on the customized algorithms corresponding to the respective region images to output the corresponding defect images.
Specifically, step S30 includes the steps of,
step S301, determining algorithm parameters corresponding to each area image based on the defect characteristics corresponding to each area image,
step S302, based on the algorithm parameters corresponding to the area image, performing preset algorithm detection on the area image to output a defect image corresponding to the area image.
In this step, the preset algorithm process related to this embodiment is specifically to perform defect filtering on an input area image, then perform defect segmentation and feature screening on the filtered area image to output a corresponding defect image in each area image, so as to solve the technical problem that a defect detection result is inaccurate due to different shapes, different sizes, and random positions of defects of a product when performing defect detection on the product.
Specifically, referring to fig. 4, when detecting a region image, defect filtering is performed by using a corresponding filter based on the defect feature corresponding to the region image, for example, if the defect feature of the region image is divided based on the defect shape, and when it is detected that a point defect, a line defect, and a planar defect exist in the region image, the filter 1 corresponding to the point defect, the filter 2 corresponding to the line defect, and the filter 3 corresponding to the planar defect are used to perform defect filtering on the region image, further, the difference of the point defect, for example, the point defect 1 with the image definition being a first preset range, and the point defect 2 with the image definition being a second preset range, is explained as the point defect, and then, after performing the defect filtering on the region image by using the filter 1 corresponding to the point defect, according to the defect feature of the point defect, setting corresponding segmentation parameters to perform defect segmentation on the filtered region image, for example, performing image binarization on the filtered region image to obtain a corresponding binarized image, then performing feature screening on the binarized image based on preset feature screening parameters to output a corresponding defect image, further, before outputting the defect image, obtaining coordinate information and defect feature information (defect type, defect size, and the like) of the defect image, using the coordinate information and the defect feature information of the defect image as identification information of the defect image, and outputting the identification information of the defect image together with the defect image.
The defect detection method provided by this embodiment obtains a target image, performs area division on the target image to obtain a plurality of area images, then obtains an area feature identifier of each area image in the plurality of area images, determines a defect feature corresponding to the area feature identifier of each area image, and finally outputs a defect image corresponding to each area image based on the defect feature, so that various defects with different sizes that may appear at various positions on the image can be detected and output, the flexibility of defect detection and the accuracy of a defect detection result are improved, and further user experience is improved.
A second embodiment of the method of the present invention is provided based on the first embodiment, and in this embodiment, step S302 further includes,
step S3021, performing pre-filtering processing on the area image based on the filtering parameter corresponding to the area image to obtain a filtered image;
step S3022, performing defect segmentation on the filtered image based on the segmentation parameters corresponding to the region image to obtain a binarized image;
step S3023, based on the characteristic parameters, performing characteristic screening on the binarized image to determine a defect image corresponding to the binarized image, and outputting the defect image.
In the step, after setting algorithm parameters corresponding to defect features of each region image respectively, performing preset algorithm detection on the region images based on the algorithm parameters corresponding to the region images, wherein the detection parameters include filter parameters, segmentation parameters and feature parameters, specifically, referring to fig. 4, performing preset algorithm detection on the region images under the corresponding filter parameters, segmentation parameters and feature parameters in sequence based on an N-ary tree traversal principle, specifically, if the input target image is I (x, y), obtaining brightness distribution information corresponding to the target image I (x, y) to obtain a region image with abnormal brightness in the target image I (x, y), then filtering the region image with abnormal brightness in the target image I (x, y) based on the filter parameters corresponding to the region image, optionally, using a morphological filtering method, the method comprises the steps of enhancing a brightness abnormal area and inhibiting a background, specifically, obtaining a filter parameter of an area image with abnormal brightness in a target image I (x, y), then selecting a corresponding filter F (n) according to the filter parameter, and finally filtering the target image I (x, y) after setting the corresponding filter parameter for the filter F (n), and obtaining a filtering result image R (x, y), wherein R (x, y) is F (I (x, y)).
And then, performing defect segmentation on the filtered image R (x, y) according to the corresponding segmentation parameters, wherein the specific method can adopt an image binarization OTSU method or an adaptive binarization method, namely performing binarization preprocessing on the filtered image R (x, y) based on a corresponding binarization function to obtain a binarized image B (x, y), then performing feature screening on the segmented binarized image B (x, y) to determine a defect image corresponding to the binarized image, and outputting the defect image.
Specifically, step S3023 includes:
performing connected domain analysis on the binary image to obtain a connected domain set of the binary image;
and based on the characteristic parameters, performing characteristic screening on each connected domain of the connected domain set of the binary image one by one to determine a defect image corresponding to the binary image, and outputting the defect image.
In the step, each connected domain { C1, C2, C3, …, Cn } of the binarized image B (x, y) is extracted, and feature extraction is performed on each connected domain, wherein the features include various features such as the size, length, width, contrast, rectangularity, circularity, aspect ratio and the like of the region, that is, based on the above various features, feature screening is performed on each connected domain of the connected domain set of the binarized image one by one to determine a defect image corresponding to the binarized image, and the defect image is output.
Specifically, feature extraction is performed on each connected domain of the connected domain set of the binarized image one by one to obtain a feature set corresponding to each connected domain;
acquiring a characteristic value corresponding to each characteristic in a characteristic set corresponding to the connected domain, and comparing the characteristic value with a standard characteristic value to acquire a defect judgment result corresponding to the connected domain;
and determining a defect image corresponding to the binary image based on the defect judgment result corresponding to each connected domain of the connected domain set.
In the step, after feature extraction is performed on each connected domain, feature sets { F1, F2, F3, …, Fk } of the connected domain Cn are obtained, and finally feature screening is performed on each connected domain according to known defect features, so that a defect region is obtained finally. Further, feature screening was performed according to the following principles: when Fk is within the standard threshold, let Sk be 1; and when Fk is not in the standard threshold range, making Sk equal to 0, and finally making Dn equal to Sk, and making Sk R (x, y) equal to F (I (x, y)), when Dn is equal to 1, indicating that the region Cm is a defect region, otherwise, indicating that the region Cm is a normal region, based on the above feature screening principle, obtaining a defect image corresponding to the binary image B (x, y), namely, a defect region Cm in a connected domain { C1, C2, C3, …, Cn } corresponding to the binary image B (x, y), and then using the coordinate information and defect feature information of the defect region Cm as the identification information of the defect image, and outputting the identification information of the defect image together with the defect image.
In the defect detection method provided by this embodiment, the area image is pre-filtered based on the filtering parameters corresponding to the area image to obtain a filtered image, the filtered image is defect-segmented based on the segmentation parameters corresponding to the area image to obtain a binarized image, the binarized image is feature-screened based on the feature parameters to determine the defect image corresponding to the binarized image, and the defect image is output, so that various defects with different sizes that may occur at various positions on the image can be detected, the flexibility of defect detection and the accuracy of a defect detection result are improved, and further, the user experience is improved.
In addition, an embodiment of the present invention further provides a defect detection apparatus, where the defect detection apparatus includes:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a target image and dividing the target image into areas so as to acquire a plurality of area images;
the second acquisition module is used for respectively acquiring the regional characteristic identifier of each regional image in the plurality of regional images and respectively determining the defect characteristic corresponding to the regional characteristic identifier of each regional image;
and the output module is used for respectively outputting the defect image corresponding to each area image based on the defect characteristics.
Wherein the defect detection apparatus, when executed by a processor, implements the steps of the various embodiments of the defect detection method described above.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, where a defect detection program is stored, and when the defect detection program is executed by a processor, the steps of the above-mentioned defect detection method in each embodiment are implemented.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A defect detection method, comprising:
acquiring a target image, and performing area division on the target image to acquire a plurality of area images;
respectively obtaining the area feature identification of each area image in the plurality of area images, and respectively determining the defect feature corresponding to the area feature identification of each area image;
and respectively outputting a defect image corresponding to each area image based on the defect characteristics.
2. The defect detection method of claim 1, wherein the step of acquiring the target image comprises:
when a product to be detected is placed on a defect detection platform, a target image of the product to be detected is collected based on a camera device of the defect detection platform.
3. The defect detection method of claim 1, wherein the step of performing area division on the target image to obtain a plurality of area images comprises:
acquiring product characteristic information of a product to be detected, and/or performing pixel screening on the target image to acquire a pixel defect area corresponding to the target image;
and performing area division on the target image based on the product characteristic information and/or the pixel defect area corresponding to the target image to obtain a plurality of area images, and performing area characteristic identification on the plurality of area images.
4. The defect detection method of claim 1, wherein the step of outputting the defect image corresponding to each area image respectively based on the defect features comprises:
determining algorithm parameters corresponding to the area images respectively based on the defect characteristics corresponding to each area image;
and performing preset algorithm detection on the region image based on the algorithm parameters corresponding to the region image so as to output a defect image corresponding to the region image.
5. The defect detection method of claim 4, wherein the algorithm parameters include a filtering parameter, a segmentation parameter and a feature parameter, and the step of performing the predetermined algorithm detection on the region image based on the algorithm parameters corresponding to the region image to output the defect image corresponding to the region image comprises:
based on the corresponding filtering parameters of the area image, pre-filtering the area image to obtain a filtered image;
performing defect segmentation on the filtered image based on segmentation parameters corresponding to the region image to obtain a binary image;
and based on the characteristic parameters, carrying out characteristic screening on the binary image to determine a defect image corresponding to the binary image, and outputting the defect image.
6. The defect detection method according to claim 5, wherein the step of performing feature screening on the binarized image based on the feature parameters to determine a defect image corresponding to the binarized image comprises:
performing connected domain analysis on the binary image to obtain a connected domain set of the binary image;
and based on the characteristic parameters, performing characteristic screening on each connected domain of the connected domain set of the binary image one by one to determine a defect image corresponding to the binary image, and outputting the defect image.
7. The defect detection method as claimed in claim 6, wherein said step of performing feature screening on each connected component of the connected component set of the binarized image one by one to determine the defect image corresponding to the binarized image comprises:
performing feature extraction on each connected domain of the connected domain set of the binary image one by one to obtain a feature set corresponding to each connected domain;
acquiring a characteristic value corresponding to each characteristic in a characteristic set corresponding to the connected domain, and comparing the characteristic value with a standard characteristic value to acquire a defect judgment result corresponding to the connected domain;
and determining a defect image corresponding to the binary image based on the defect judgment result corresponding to each connected domain of the connected domain set.
8. A defect detection apparatus, characterized in that the defect detection apparatus comprises:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a target image and dividing the target image into areas so as to acquire a plurality of area images;
the second acquisition module is used for respectively acquiring the regional characteristic identifier of each regional image in the plurality of regional images and respectively determining the defect characteristic corresponding to the regional characteristic identifier of each regional image;
and the output module is used for respectively outputting the defect image corresponding to each area image based on the defect characteristics.
9. A defect detection apparatus, characterized in that the defect detection apparatus comprises: memory, a processor and a defect detection program stored on the memory and executable on the processor, the defect detection program when executed by the processor implementing the steps of the defect detection method according to any one of claims 1 to 7.
10. A computer-readable storage medium, having stored thereon a defect detection program which, when executed by a processor, implements the steps of the defect detection method of any one of claims 1 to 7.
CN202010740667.0A 2020-07-28 2020-07-28 Defect detection method, device, equipment and computer readable storage medium Pending CN111882541A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010740667.0A CN111882541A (en) 2020-07-28 2020-07-28 Defect detection method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010740667.0A CN111882541A (en) 2020-07-28 2020-07-28 Defect detection method, device, equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN111882541A true CN111882541A (en) 2020-11-03

Family

ID=73201865

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010740667.0A Pending CN111882541A (en) 2020-07-28 2020-07-28 Defect detection method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111882541A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112991268A (en) * 2021-02-09 2021-06-18 上海众壹云计算科技有限公司 Rapid screening method for target defects on wafer, device and system thereof, storage medium and electronic equipment
CN112986259A (en) * 2021-02-09 2021-06-18 清华大学 Defect detection method and device for manufacturing process of intelligent terminal OLED panel
CN113643233A (en) * 2021-07-01 2021-11-12 深圳市格灵精睿视觉有限公司 Oily coating detection method, system and equipment and computer readable storage medium
CN113808087A (en) * 2021-09-02 2021-12-17 上汽通用五菱汽车股份有限公司 Defect management and control method and device for surface of steel plate and computer readable storage medium
CN113947613A (en) * 2021-12-21 2022-01-18 腾讯科技(深圳)有限公司 Target area detection method, device, equipment and storage medium
CN116452598A (en) * 2023-06-20 2023-07-18 曼德惟尔(山东)智能制造有限公司 Axle production quality rapid detection method and system based on computer vision

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060067571A1 (en) * 2004-09-29 2006-03-30 Dainippon Screen Mfg. Co., Ltd. Defect detection apparatus and defect detection method
CN110021012A (en) * 2019-03-27 2019-07-16 安徽皓视光电科技有限公司 Mobile lens sight glass defect inspection method based on machine vision technique
CN110687119A (en) * 2018-07-04 2020-01-14 东腾投资集团有限公司 Defect detection method, system and device and computer readable storage medium
CN111179243A (en) * 2019-12-25 2020-05-19 武汉昕竺科技服务有限公司 Small-size chip crack detection method and system based on computer vision

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060067571A1 (en) * 2004-09-29 2006-03-30 Dainippon Screen Mfg. Co., Ltd. Defect detection apparatus and defect detection method
CN110687119A (en) * 2018-07-04 2020-01-14 东腾投资集团有限公司 Defect detection method, system and device and computer readable storage medium
CN110021012A (en) * 2019-03-27 2019-07-16 安徽皓视光电科技有限公司 Mobile lens sight glass defect inspection method based on machine vision technique
CN111179243A (en) * 2019-12-25 2020-05-19 武汉昕竺科技服务有限公司 Small-size chip crack detection method and system based on computer vision

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李俊峰 等: "基于机器视觉的导光板缺陷检测方法研究", 光电子・激光, vol. 30, no. 03, 15 March 2019 (2019-03-15), pages 256 - 265 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112991268A (en) * 2021-02-09 2021-06-18 上海众壹云计算科技有限公司 Rapid screening method for target defects on wafer, device and system thereof, storage medium and electronic equipment
CN112986259A (en) * 2021-02-09 2021-06-18 清华大学 Defect detection method and device for manufacturing process of intelligent terminal OLED panel
CN113643233A (en) * 2021-07-01 2021-11-12 深圳市格灵精睿视觉有限公司 Oily coating detection method, system and equipment and computer readable storage medium
CN113643233B (en) * 2021-07-01 2024-05-24 深圳市格灵精睿视觉有限公司 Oily coating detection method, system and equipment, and computer readable storage medium
CN113808087A (en) * 2021-09-02 2021-12-17 上汽通用五菱汽车股份有限公司 Defect management and control method and device for surface of steel plate and computer readable storage medium
CN113947613A (en) * 2021-12-21 2022-01-18 腾讯科技(深圳)有限公司 Target area detection method, device, equipment and storage medium
CN116452598A (en) * 2023-06-20 2023-07-18 曼德惟尔(山东)智能制造有限公司 Axle production quality rapid detection method and system based on computer vision
CN116452598B (en) * 2023-06-20 2023-08-29 曼德惟尔(山东)智能制造有限公司 Axle production quality rapid detection method and system based on computer vision

Similar Documents

Publication Publication Date Title
CN111882541A (en) Defect detection method, device, equipment and computer readable storage medium
CN111640091B (en) Product defect detection method and computer storage medium
CN113688807B (en) Self-adaptive defect detection method, device, recognition system and storage medium
CN109766779B (en) Loitering person identification method and related product
CN111507324B (en) Card frame recognition method, device, equipment and computer storage medium
CN112767366A (en) Image recognition method, device and equipment based on deep learning and storage medium
CN115908269A (en) Visual defect detection method and device, storage medium and computer equipment
CN112700440B (en) Object defect detection method and device, computer equipment and storage medium
CN110047083B (en) Image noise point identification method, server and storage medium
CN109635700B (en) Obstacle recognition method, device, system and storage medium
CN108022219B (en) Two-dimensional image gray level correction method
CN116542975A (en) Defect classification method, device, equipment and medium for glass panel
CN113269769A (en) Defect detection method, system and equipment based on image registration
CN116503388A (en) Defect detection method, device and storage medium
CN111598084A (en) Defect segmentation network training method, device and equipment and readable storage medium
CN111080665A (en) Image frame identification method, device and equipment and computer storage medium
CN108647570B (en) Zebra crossing detection method and device and computer readable storage medium
CN116091503B (en) Method, device, equipment and medium for discriminating panel foreign matter defects
CN115311237A (en) Image detection method and device and electronic equipment
CN111046878B (en) Data processing method and device, computer storage medium and computer
CN114549346A (en) Blurred image recognition method, device, equipment and storage medium
CN111678673A (en) Lens detection method, lens detection device and readable storage medium
CN114048539A (en) CAD file analysis and rule judgment method and related device
CN112967226A (en) High-reflectivity product detection system, method and medium based on artificial intelligence
CN112967223A (en) Artificial intelligence-based textile detection system, method and 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