CN116245848A - Product defect detection method and related equipment - Google Patents

Product defect detection method and related equipment Download PDF

Info

Publication number
CN116245848A
CN116245848A CN202310226390.3A CN202310226390A CN116245848A CN 116245848 A CN116245848 A CN 116245848A CN 202310226390 A CN202310226390 A CN 202310226390A CN 116245848 A CN116245848 A CN 116245848A
Authority
CN
China
Prior art keywords
image
detected
gray
value
pixel point
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202310226390.3A
Other languages
Chinese (zh)
Other versions
CN116245848B (en
Inventor
张殿斌
王�锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sino Mv Technologies Co ltd
Original Assignee
Beijing Sino Mv Technologies 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 Beijing Sino Mv Technologies Co ltd filed Critical Beijing Sino Mv Technologies Co ltd
Priority to CN202310226390.3A priority Critical patent/CN116245848B/en
Publication of CN116245848A publication Critical patent/CN116245848A/en
Application granted granted Critical
Publication of CN116245848B publication Critical patent/CN116245848B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • G06T7/0008Industrial image inspection checking presence/absence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/25Determination of region of interest [ROI] or a volume of interest [VOI]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/42Global feature extraction by analysis of the whole pattern, e.g. using frequency domain transformations or autocorrelation
    • G06V10/422Global feature extraction by analysis of the whole pattern, e.g. using frequency domain transformations or autocorrelation for representing the structure of the pattern or shape of an object therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/56Extraction of image or video features relating to colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30144Printing quality
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

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

Abstract

The invention provides a product defect detection method and related equipment, wherein the method comprises the following steps: processing the image to be detected based on the target ROI area and the reference image to obtain a processed image to be detected; detecting whether pixel points meeting the defect point conditions exist in the processed image to be detected; if the processed image to be detected has pixel points meeting the defect point condition, determining that a product to which the image to be detected belongs has defects; if the processed image to be detected does not have the pixel points meeting the defect point condition, determining that the product to which the image to be detected belongs has no defects. Through the embodiment, the efficiency and the accuracy of the detection result are improved, and the problems of high labor cost and lower accuracy in the existing product defect detection are solved.

Description

Product defect detection method and related equipment
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a product defect detection method and related devices.
Background
Various defects such as ink dots, foreign matters, text defects, or missing marks may be generated in the production process of the printed matter. These defects, once present in the product packaging, can significantly compromise the visual look and feel of the product, severely impacting the branding and customer satisfaction of the product.
At present, printing enterprises mainly carry out product defect detection in a strobe lighting and manual local spot inspection mode, so that the cost is high, and the accuracy of a detection result is low, and therefore, a scheme for reducing the cost and improving the accuracy of the product defect detection result is needed.
Disclosure of Invention
The invention mainly aims to provide a product defect detection method and related equipment, and aims to solve the problems of high cost and low accuracy of the existing product defect detection.
In a first aspect, the present invention provides a product defect detection method, the product defect detection method comprising:
obtaining a reference image through an Intel MKL function library based on the characteristic value and the characteristic vector matrix corresponding to each ROI area contained in the image to be detected and the target sample image;
determining a target ROI (region of interest) from each ROI contained in the target sample image based on the region to be detected in the image to be detected, wherein the position of the target ROI in the target sample image is the same as the position of the region to be detected in the image to be detected;
processing the image to be detected based on the target ROI area and the reference image to obtain a processed image to be detected;
Detecting whether pixel points meeting the defect point conditions exist in the processed image to be detected;
if the processed image to be detected has pixel points meeting the defect point condition, determining that a product to which the image to be detected belongs has defects;
if the processed image to be detected does not have the pixel points meeting the defect point condition, determining that the product to which the image to be detected belongs has no defects.
Optionally, before the step of reconstructing the reference image by using the intel MKL function library based on the feature value and the feature vector matrix corresponding to each ROI area included in the image to be detected and the target sample image, the method includes:
acquiring an initial sample image;
preprocessing an initial sample image to obtain a target sample image;
acquiring a plurality of images corresponding to each ROI (region of interest) in a target sample image, wherein the number of the images corresponding to each ROI corresponds to the number of the minimum repeating units in the target sample image one by one;
based on a plurality of images corresponding to each ROI region, obtaining a characteristic value and a characteristic vector matrix corresponding to each ROI region through a principal component analysis method;
and obtaining a first median map, a peak map and a valley map corresponding to each ROI region by a multi-scale golden template detection method based on a plurality of images corresponding to each ROI region.
Optionally, the step of obtaining the first median map, the peak map and the valley map corresponding to each ROI area through a multi-scale golden template detection method based on the multiple images corresponding to each ROI area includes:
acquiring a gray value of each pixel point in each image corresponding to the ith ROI area;
determining a gray median value of the same position corresponding to each pixel point based on the gray value of each pixel point in each image;
obtaining a first median map corresponding to an ith ROI region based on the gray median value of the same position corresponding to each pixel point;
respectively obtaining a maximum gray value and a minimum gray value from gray values of pixel points at the same position of each image corresponding to an ith ROI region, and obtaining the maximum gray value and the minimum gray value corresponding to the pixel points at each position in each image corresponding to the ith ROI region;
obtaining a peak value diagram corresponding to the ith ROI based on the maximum gray value corresponding to each position pixel point, obtaining a valley value diagram corresponding to the ith ROI based on the minimum gray value corresponding to each position pixel point, and the like, and obtaining a first median diagram, a peak value diagram and a valley value diagram corresponding to each ROI.
Optionally, the step of processing the image to be detected based on the target ROI area and the reference image to obtain a processed image to be detected includes:
Acquiring a first median map, a peak map and a valley map corresponding to a target ROI region;
obtaining a second median map based on the gray values of the pixels in the image to be detected, the gray values of the pixels in the reference image and the gray values of the pixels in the first median map;
subtracting the gray value of each pixel point at the corresponding position in the second median map from the gray value of each pixel point in the image to be detected to obtain a first difference map;
subtracting the gray value of each pixel point at the corresponding position in the image to be detected from the gray value of each pixel point in the second median map to obtain a second difference map;
subtracting the gray value of each pixel point at the corresponding position in the peak value graph from the gray value of each pixel point in the first difference graph to obtain a third difference graph;
subtracting the gray value of each pixel point at the corresponding position in the second difference value graph from the gray value of each pixel point in the valley value graph to obtain a fourth difference value graph;
and obtaining the processed image to be detected by adding the gray value of each pixel point in the third difference value diagram to the gray value of each pixel point in the corresponding position in the fourth difference value diagram.
Optionally, the step of detecting whether the pixel points meeting the defect point condition exist in the processed image to be detected includes:
Detecting whether pixel points with gray values different from zero exist in the processed image to be detected;
if the pixel points with the gray values not being zero exist, calculating the geometric shape characteristics and the gray characteristics of the areas where the pixel points with the gray values not being zero are located;
detecting whether the geometric feature and the gray feature of the region where the pixel point with the gray value not being zero is located meet the defect point condition;
if the geometric feature and the gray feature of the region where the pixel point with the gray value not being zero is located meet the defect point condition, determining that the pixel point meeting the defect point condition exists in the processed image to be detected;
if the geometric feature and the gray feature of the region where the pixel point with the gray value not being zero is located do not meet the defect point condition, determining that the pixel point meeting the defect point condition does not exist in the processed image to be detected;
if the pixel points with the gray values not being zero do not exist, determining that the pixel points meeting the defect point conditions do not exist in the processed image to be detected.
In a second aspect, the present invention also provides a product defect detection apparatus, the product defect detection apparatus comprising:
the reconstruction module is used for reconstructing through an Intel MKL function library based on the feature value and the feature vector matrix corresponding to each ROI region contained in the image to be detected and the target sample image to obtain a reference image;
The selecting module is used for selecting a target ROI region from each ROI region contained in the target sample image based on the region to be detected in the image to be detected, wherein the position of the target ROI region in the target sample image is the same as the position of the region to be detected in the image to be detected;
the processing module is used for processing the image to be detected based on the target ROI area and the reference image to obtain a processed image to be detected;
the detection module is used for detecting whether pixel points meeting the defect point conditions exist in the processed image to be detected;
the first determining module is used for determining that a product to which the image to be detected belongs is defective if pixel points meeting the defect point condition exist in the processed image to be detected;
and the second determining module is used for determining that the product to which the image to be detected belongs has no defects if the processed image to be detected does not have the pixel points meeting the defect point condition.
Optionally, the processing module is configured to:
acquiring a first median map, a peak map and a valley map corresponding to a target ROI region;
obtaining a second median map based on the gray values of the pixels in the image to be detected, the gray values of the pixels in the reference image and the gray values of the pixels in the first median map;
Subtracting the gray value of each pixel point at the corresponding position in the second median map from the gray value of each pixel point in the image to be detected to obtain a first difference map;
subtracting the gray value of each pixel point at the corresponding position in the image to be detected from the gray value of each pixel point in the second median map to obtain a second difference map;
subtracting the gray value of each pixel point at the corresponding position in the peak value graph from the gray value of each pixel point in the first difference graph to obtain a third difference graph;
subtracting the gray value of each pixel point at the corresponding position in the second difference value graph from the gray value of each pixel point in the valley value graph to obtain a fourth difference value graph;
and obtaining the processed image to be detected by adding the gray value of each pixel point in the third difference value diagram to the gray value of each pixel point in the corresponding position in the fourth difference value diagram.
Optionally, the detection module is configured to:
detecting whether pixel points with gray values different from zero exist in the processed image to be detected;
if the pixel points with the gray values not being zero exist, calculating the geometric shape characteristics and the gray characteristics of the areas where the pixel points with the gray values not being zero are located;
detecting whether the geometric feature and the gray feature of the region where the pixel point with the gray value not being zero is located meet the defect point condition;
If the geometric feature and the gray feature of the region where the pixel point with the gray value not being zero is located meet the defect point condition, determining that the pixel point meeting the defect point condition exists in the processed image to be detected;
if the geometric feature and the gray feature of the region where the pixel point with the gray value not being zero is located do not meet the defect point condition, determining that the pixel point meeting the defect point condition does not exist in the processed image to be detected;
if the pixel points with the gray values not being zero do not exist, determining that the pixel points meeting the defect point conditions do not exist in the processed image to be detected.
In a third aspect, the present invention also provides a product defect detection apparatus comprising a processor, a memory, and a product defect detection program stored on the memory and executable by the processor, wherein the product defect detection program, when executed by the processor, implements the steps of the product defect detection method as described above.
In a fourth aspect, the present invention also provides a readable storage medium having stored thereon a product defect detection program, wherein the product defect detection program, when executed by a processor, implements the steps of the product defect detection method as described above.
According to the invention, a reference image is obtained through an Intel MKL function library based on the characteristic value and the characteristic vector matrix corresponding to each ROI region contained in the image to be detected and the target sample image; determining a target ROI (region of interest) from each ROI contained in the target sample image based on the region to be detected in the image to be detected, wherein the position of the target ROI in the target sample image is the same as the position of the region to be detected in the image to be detected; processing the image to be detected based on the target ROI area and the reference image to obtain a processed image to be detected; detecting whether pixel points meeting the defect point conditions exist in the processed image to be detected; if the processed image to be detected has pixel points meeting the defect point condition, determining that a product to which the image to be detected belongs has defects; if the processed image to be detected does not have the pixel points meeting the defect point condition, determining that the product to which the image to be detected belongs has no defects. According to the invention, after the reference image and the target ROI area are obtained based on the to-be-detected area in the to-be-detected image and each ROI area contained in the target sample image, the to-be-detected image is processed based on the target ROI area and the reference image, so that non-zero pixel points in the processed to-be-detected image are pixel points in which the gray value in the to-be-detected image is larger than the gray value in the corresponding position in the peak value image, or pixel points in the to-be-detected image in which the gray value is smaller than the gray value in the corresponding position in the valley value image, so that defect detection is carried out on the processed to-be-detected image, whether defects exist in a product to which the to-be-detected image belongs can be accurately known based on the detection result, the efficiency and the accuracy of the detection result are improved, and the problems of high labor cost and low accuracy of the defect detection of the existing product are solved.
Drawings
FIG. 1 is a schematic diagram of a hardware configuration of a product defect detection apparatus according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating an embodiment of a method for detecting defects in a product according to the present invention;
FIG. 3 is a schematic diagram of a refinement flow chart of step S30 in FIG. 2;
FIG. 4 is a schematic diagram of a refinement flow chart of step S40 in FIG. 2;
FIG. 5 is a schematic diagram illustrating functional blocks of an embodiment of a defect detecting device for products according to the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
In a first aspect, an embodiment of the present invention provides a product defect detection apparatus.
Referring to fig. 1, fig. 1 is a schematic hardware structure of a product defect detecting apparatus according to an embodiment of the present invention. In an embodiment of the present invention, the product defect detection apparatus may include a processor 1001 (e.g., central processing unit Central Processing Unit, CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein the communication bus 1002 is used to enable connected communications between these components; the user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard); the network interface 1004 may optionally include a standard wired interface, a WIreless interface (e.g., WIreless-FIdelity, WI-FI interface); the memory 1005 may be a high-speed random access memory (random access memory, RAM) or a stable memory (non-volatile memory), such as a disk memory, and the memory 1005 may alternatively be a storage device independent of the processor 1001. Those skilled in the art will appreciate that the hardware configuration shown in fig. 1 is not limiting of the invention and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
With continued reference to FIG. 1, an operating system, a network communication module, a user interface module, and a product defect detection program may be included in memory 1005, which is one type of computer storage medium in FIG. 1. The processor 1001 may call a product defect detection program stored in the memory 1005, and execute the product defect detection method provided by the embodiment of the present invention.
In a second aspect, an embodiment of the present invention provides a method for detecting a product defect.
In an embodiment, referring to fig. 2, fig. 2 is a flow chart illustrating an embodiment of a method for detecting defects in a product according to the present invention. As shown in fig. 2, the product defect detection method includes:
step S10, obtaining a reference image through an Intel MKL function library based on the feature value and the feature vector matrix corresponding to each ROI area contained in the image to be detected and the target sample image;
in this embodiment, the feature value and the feature vector matrix corresponding to each ROI area included in the image to be detected and the target sample image are input into the intel MKL function library, and the intel MKL function library reconstructs the image to be detected based on the feature value and the feature vector matrix corresponding to each ROI area included in the target sample image, so as to obtain an image data matrix output by the intel MKL function library, and uses the image data matrix as a reference image. The Intel mathematical core function library (Intel Math Kernel Library, MKL) is a set of highly optimized and widely threaded mathematical routines, is specially designed for the application in the fields of science, engineering, finance and the like which need extreme performance, and is a set of highly optimized and threaded function library.
Step S20, determining a target ROI area from each ROI area contained in the target sample image based on the to-be-detected area in the to-be-detected image, wherein the position of the target ROI area in the target sample image is the same as the position of the to-be-detected area in the to-be-detected image;
in this embodiment, a target ROI area is determined from each ROI area contained in the target sample image based on the position of the region to be detected in the image to be detected, wherein the position of the target ROI area in the target sample image is the same as the position of the region to be detected in the image to be detected.
Step S30, processing the image to be detected based on the target ROI area and the reference image to obtain a processed image to be detected;
in this embodiment, after determining the target ROI area, a first median map, a peak map and a valley map corresponding to the target ROI area are obtained, and the image to be detected is processed based on the first median map, the peak map and the valley map corresponding to the target ROI area and the reference image, so as to obtain the processed image to be detected.
Further, in an embodiment, referring to fig. 3, fig. 3 is a schematic diagram of a refinement process of step S30 in fig. 2. As shown in fig. 3, step S30 includes:
Step S301, a first median map, a peak map and a valley map corresponding to a target ROI area are obtained;
step S302, a second median map is obtained based on the gray values of all the pixel points in the image to be detected, the gray values of all the pixel points in the reference image and the gray values of all the pixel points in the first median map;
step S303, subtracting the gray value of each pixel point at the corresponding position in the second median map from the gray value of each pixel point in the image to be detected to obtain a first difference map;
step S304, subtracting the gray value of each pixel point at the corresponding position in the image to be detected from the gray value of each pixel point in the second median map to obtain a second difference map;
step S305, the gray value of each pixel point at the corresponding position in the peak value graph is subtracted by the gray value of each pixel point in the first difference value graph to obtain a third difference value graph;
step S306, the gray value of each pixel point in the corresponding position in the second difference value graph is subtracted by the gray value of each pixel point in the valley value graph to obtain a fourth difference value graph;
step S307, the gray value of each pixel in the third difference map is added to the gray value of each pixel in the corresponding position in the fourth difference map, so as to obtain the processed image to be detected.
In this embodiment, a first median map, a peak map and a valley map corresponding to a target ROI area are obtained, and a second median map is obtained based on the gray values of each pixel in the image to be detected, the gray values of each pixel in the reference image, and the gray values of each pixel in the first median map corresponding to the target ROI area. Specifically, the gray median value 120 of the gray value 130 of the pixel point of the 1 st row and the 1 st column in the first median map corresponding to the target ROI area is used as the gray value of the pixel point of the 1 st row and the 1 st column in the image, wherein the gray value 100 of the pixel point of the 1 st row and the 1 st column in the image to be detected, the gray value 120 of the pixel point of the 1 st row and the 1 st column in the reference image; the gray value 140 of the pixel point of the 1 st row and the 2 nd column in the image to be detected, the gray value 145 of the pixel point of the 1 st row and the 2 nd column in the reference image, and the gray value 150 of the pixel point of the 1 st row and the 2 nd column in the first median map corresponding to the target ROI area are used as the gray values of the pixel point of the 1 st row and the 2 nd column in the image. And the like, obtaining the gray value of each pixel point in an image, wherein the image is the second median map.
And subtracting the gray value of each pixel point at the corresponding position in the second median value graph from the gray value of each pixel point in the image to be detected to obtain a first difference value graph, wherein the non-zero pixel points in the first difference value graph are the pixel points with the gray value larger than the median value of the gray value in the image to be detected, and the pixel points with the gray value smaller than or equal to the median value of the gray value in the image to be detected are zero in the first difference value graph.
And subtracting the gray value of each pixel point at the corresponding position in the image to be detected from the gray value of each pixel point in the second median value image to obtain a second difference value image, wherein the non-zero pixel points in the second difference value image are the pixel points with the gray value smaller than the gray value median at the corresponding position in the image to be detected, and the pixel points with the gray value larger than or equal to the gray value median at the corresponding position in the image to be detected are zero in the first difference value image.
And subtracting the gray value of each pixel point at the corresponding position in the peak value graph from the gray value of each pixel point in the first difference value graph to obtain a third difference value graph, wherein the non-zero pixel point in the third difference value graph is the pixel point with the gray value larger than the corresponding position in the peak value graph in the first difference value graph, and the gray value of the pixel point with the gray value smaller than or equal to the gray value at the corresponding position in the peak value graph in the first difference value graph is zero in the third difference value graph.
And subtracting the gray value of each pixel point in the corresponding position in the second difference value graph from the gray value of each pixel point in the valley value graph to obtain a fourth difference value graph, wherein the non-zero pixel point in the fourth difference value graph is the pixel point of which the gray value is smaller than the corresponding position in the valley value graph in the second difference value graph, and the gray value of the pixel point of which the gray value is larger than or equal to the gray value of the corresponding position in the valley value graph in the second difference value graph is zero in the third difference value graph.
The processed image to be detected can be obtained by adding the gray value of each pixel point in the third difference value graph to the gray value of each pixel point in the corresponding position in the fourth difference value graph, and it is easy to think that the non-zero pixel point in the processed image to be detected is the pixel point of which the gray value in the image to be detected is larger than the gray value in the corresponding position in the peak value graph or the pixel point of which the gray value in the image to be detected is smaller than the gray value in the corresponding position in the valley value graph.
Step S40, detecting whether pixel points meeting the defect point conditions exist in the processed image to be detected;
in this embodiment, since the non-zero pixel point in the processed image to be detected is a pixel point in the image to be detected, where the gray value is greater than the gray value at the corresponding position in the peak value map, or a pixel point in the image to be detected, where the gray value is less than the gray value at the corresponding position in the valley value map, based on the gray values of the pixel points in the processed image to be detected, whether the pixel point satisfying the defect point condition exists in the processed image to be detected is detected, and then based on the detection result, whether the product to which the image to be detected belongs has a defect can be determined.
Further, in an embodiment, referring to fig. 4, fig. 4 is a schematic diagram of a refinement process of step S40 in fig. 2. As shown in fig. 4, step S40 includes:
Step S401, detecting whether pixel points with gray values different from zero exist in the processed image to be detected;
step S402, if there is a pixel point with a gray value not being zero, calculating the geometric feature and gray feature of the region where the pixel point with a gray value not being zero is located;
step S403, detecting whether the geometric feature and the gray feature of the region where the pixel point with the gray value not being zero is located meet the defect point condition;
step S404, if the geometric feature and the gray feature of the region where the pixel point with the gray value not being zero is located meet the defect point condition, determining that the pixel point meeting the defect point condition exists in the processed image to be detected;
step S405, if the geometric feature and the gray feature of the region where the pixel point with the gray value not being zero is located do not meet the defect point condition, determining that the pixel point meeting the defect point condition does not exist in the processed image to be detected;
in step S406, if there is no pixel point with a gray value different from zero, it is determined that there is no pixel point satisfying the defect point condition in the processed image to be detected.
In this embodiment, whether pixel points with gray values different from zero exist in each pixel point of the processed image to be detected is detected. If the pixel points with the gray values not being zero exist, calculating the geometric shape feature and the gray feature of the region where the pixel points with the gray values not being zero are located. The geometric shape characteristic parameters comprise perimeter, area, roundness, minimum circumscribed rectangle, duty ratio and skeleton, and the gray characteristic parameters comprise gray mean value, gray variance, entropy and corner points.
The geometrical characteristic parameter-perimeter extraction method comprises the following steps: counting the number of pixel points on the outer contour line of the W area, wherein the number of pixel points on the outer contour line of the W area represents the perimeter of the defect of the W area; the extraction method of the geometric feature parameter-area is as follows: counting the number of all the pixel points in the W area, wherein the number of all the pixel points in the W area is the defect area of the W area; the geometrical characteristic parameter-roundness extraction method is as follows:
Figure BDA0004118595760000101
wherein R represents the defect roundness of the W region, A represents the defect area of the W region, and P represents the defect perimeter of the W region; the extraction method of the geometric feature parameter, namely the minimum circumscribed rectangle, comprises the following steps: obtaining the minimum circumscribed rectangle of the convex hull of the W area; the extraction method of the geometric feature parameter-duty ratio is as follows: />
Figure BDA0004118595760000102
Wherein eta represents the defect duty ratio of the W region, and MABR represents the minimum circumscribed rectangle of the defect of the W region; the extraction method of the geometric shape characteristic parameter-skeleton is to extract the skeleton of the W region defect by a zhang rapid parallel refinement algorithm.
The extraction method of the gray characteristic parameter-gray average value comprises the following steps:
Figure BDA0004118595760000103
wherein M represents the defect gray average value of the W' region, f i The pixel value of the ith pixel point is represented, and N represents the number of the pixel points in the W' area; the extraction method of gray characteristic parameters-variance is as follows: / >
Figure BDA0004118595760000104
Wherein s is 2 Representing the defect variance of the W' region; the extraction method of gray characteristic parameters-entropy is as follows: />
Figure BDA0004118595760000105
Wherein P is i The probability of occurrence of the ith pixel point in the detection image is represented, and H represents the defect entropy of the W' region; gray scale characteristic parameter-corner pointThe extraction method of (2) is as follows: and extracting corner points of the defects of the W' region by using a FAST corner point detection algorithm.
If the defect condition is that whether the defect perimeter is larger than a defect perimeter threshold value, whether the defect roundness is larger than a preset defect roundness threshold value and whether the defect gray average value is larger than a preset defect gray average value threshold value are judged, if the defect perimeter is larger than the preset defect perimeter threshold value and the defect roundness is larger than the preset defect roundness threshold value, the geometric shape characteristic parameters meet the defect condition, and if the defect gray average value is larger than the preset defect gray average value threshold value, the gray characteristic parameters meet the defect condition. If the defect perimeter is smaller than or equal to a preset defect perimeter threshold or the defect roundness is smaller than or equal to a preset defect roundness threshold, the geometric shape characteristic parameters do not meet the defect conditions, and if the defect gray average value is smaller than or equal to a preset defect gray average value threshold, the gray characteristic parameters do not meet the defect conditions. The defect conditions are customized according to the requirements of the user, and it is easy to think that the defect conditions in the embodiment are only used as reference, and are not limited herein, and the defect conditions can be any one or more of geometric feature parameters and/or gray feature parameters.
If the geometric feature and the gray feature of the region where the pixel point with the gray value not being zero meet the defect point condition, determining that the pixel point meeting the defect point condition exists in the processed image to be detected, and if the geometric feature and the gray feature of the region where the pixel point with the gray value not being zero do not meet the defect point condition, determining that the pixel point meeting the defect point condition does not exist in the processed image to be detected.
If no pixel point with gray value not being zero exists in each pixel point of the processed image to be detected, namely, the gray values of the pixel points in the processed image to be detected are all zero, the pixel points which meet the defect point condition do not exist in the processed image to be detected.
Step S50, if the processed image to be detected has pixel points meeting the defect point condition, determining that the product to which the image to be detected belongs is defective;
in this embodiment, if there are pixel points in the processed image to be detected that satisfy the defect point condition, it indicates that there are pixel points in the image to be detected that have gray values that are not within a reasonable range, and it is determined that the product to which the image to be detected belongs is defective.
Step S60, if the processed image to be detected does not have the pixel points meeting the defect point condition, determining that the product to which the image to be detected belongs is defect-free.
In this embodiment, if no pixel points satisfying the defect point condition exist in the processed image to be detected, the gray values of the pixel points in the image to be detected are all within a reasonable range, and it is determined that the product to which the image to be detected belongs is defect-free.
In the embodiment, a reference image is obtained through an Intel MKL function library based on a feature value and a feature vector matrix corresponding to each ROI area contained in an image to be detected and a target sample image; determining a target ROI (region of interest) from each ROI contained in the target sample image based on the region to be detected in the image to be detected, wherein the position of the target ROI in the target sample image is the same as the position of the region to be detected in the image to be detected; processing the image to be detected based on the target ROI area and the reference image to obtain a processed image to be detected; detecting whether pixel points meeting the defect point conditions exist in the processed image to be detected; if the processed image to be detected has pixel points meeting the defect point condition, determining that a product to which the image to be detected belongs has defects; if the processed image to be detected does not have the pixel points meeting the defect point condition, determining that the product to which the image to be detected belongs has no defects. According to the embodiment, after the reference image and the target ROI area are obtained based on the to-be-detected area in the to-be-detected image and each ROI area contained in the target sample image, the to-be-detected image is processed based on the target ROI area and the reference image, so that non-zero pixel points in the processed to-be-detected image are pixel points in which the gray value in the to-be-detected image is larger than the gray value in the corresponding position in the peak value image, or pixel points in the to-be-detected image in which the gray value is smaller than the gray value in the corresponding position in the valley value image, defect detection is carried out on the processed to-be-detected image, whether defects exist in a product to which the to-be-detected image belongs can be accurately obtained based on the detection result, the efficiency and the accuracy of the detection result are improved, and the problems that the existing product defect detection is high in labor cost and low in accuracy are solved.
Further, in an embodiment, before step S10, the method includes:
acquiring an initial sample image;
preprocessing an initial sample image to obtain a target sample image;
acquiring a plurality of images corresponding to each ROI (region of interest) in a target sample image, wherein the number of the images corresponding to each ROI corresponds to the number of the minimum repeating units in the target sample image one by one;
based on a plurality of images corresponding to each ROI region, obtaining a characteristic value and a characteristic vector matrix corresponding to each ROI region through a principal component analysis method;
and obtaining a first median map, a peak map and a valley map corresponding to each ROI region by a multi-scale golden template detection method based on a plurality of images corresponding to each ROI region.
In this embodiment, an initial sample image is obtained, median filtering operation is performed on the initial sample image, and image noise points are filtered out to obtain a target sample image.
And acquiring a plurality of images corresponding to each ROI area in the target sample image, wherein the number of the images corresponding to each ROI area corresponds to the number of the minimum repeating units in the target sample image one by one. Specifically, if the target sample image includes 9 minimum repeating units, each ROI area corresponds to 9 images.
Based on a plurality of images corresponding to each ROI region, obtaining a characteristic value and a characteristic vector matrix corresponding to each ROI region through a principal component analysis method. Specifically, (1) each image corresponding to the ROI region is noted as a data set X, where x= { X 1, x 2 …x n-1 ,x n };
(2) Zero-equalizing each image of the data set X, namely subtracting the respective average value of each image of the data set X;
(3) Calculating a covariance matrix of each image of the data set X;
(4) Calculating the eigenvalue and eigenvector corresponding to the eigenvalue of the covariance matrix of each image of the data set X;
(5) And arranging the eigenvectors into a matrix according to the size of eigenvalues corresponding to the eigenvectors from large to small, and taking the eigenvectors corresponding to the eigenvalues of the previous k rows to form an eigenvector matrix.
And obtaining a first median map, a peak map and a valley map corresponding to each ROI region by a multi-scale golden template detection method based on a plurality of images corresponding to each ROI region.
Further, in an embodiment, the step of obtaining the first median map, the peak map and the valley map corresponding to each ROI region by using a multi-scale golden template detection method based on the multiple images corresponding to each ROI region includes:
acquiring a gray value of each pixel point in each image corresponding to the ith ROI area;
Determining a gray median value of the same position corresponding to each pixel point based on the gray value of each pixel point in each image;
obtaining a first median map corresponding to an ith ROI region based on the gray median value of the same position corresponding to each pixel point;
respectively obtaining a maximum gray value and a minimum gray value from gray values of pixel points at the same position of each image corresponding to an ith ROI region, and obtaining the maximum gray value and the minimum gray value corresponding to the pixel points at each position in each image corresponding to the ith ROI region;
obtaining a peak value diagram corresponding to the ith ROI based on the maximum gray value corresponding to each position pixel point, obtaining a valley value diagram corresponding to the ith ROI based on the minimum gray value corresponding to each position pixel point, and the like, and obtaining a first median diagram, a peak value diagram and a valley value diagram corresponding to each ROI.
In this embodiment, if the 9 images corresponding to the ith ROI area are obtained, the median gray value of the pixel point corresponding to the same position of each pixel point is determined based on the gray value of the pixel point of the first row and the first column of the 9 images corresponding to the ith ROI area. Specifically, if the gray values of the pixels in the first row and the first column of the 9 images corresponding to the ith ROI area are 150, 160, 165, 155, 163, 170, 180, 175 and 156, respectively, the median gray value of the 9 pixels in the first row and the first column is determined to be 163, where 163 is the gray value of the pixel in the first row and the first column of the first median map corresponding to the ith ROI area. And by analogy, determining the gray median value of the same position corresponding to each pixel point based on the gray value of each pixel point in each image corresponding to the ith ROI area, wherein the gray median value of the same position corresponding to each pixel point is the gray value of each pixel point in the first median map corresponding to the ith ROI area.
If the 9 images corresponding to the ith ROI area and the gray values of the pixels in the first row and the first column of the 9 images corresponding to the ith ROI area are 150, 160, 165, 155, 163, 170, 180, 175 and 156, respectively, then the maximum gray value 180 and the minimum gray value 150 are obtained. And by analogy, obtaining a maximum gray value and a minimum gray value corresponding to each position pixel point in each image corresponding to the ith ROI area.
And obtaining a peak value map corresponding to the ith ROI area based on the maximum gray value corresponding to each position pixel point, and obtaining a valley value map corresponding to the ith ROI area based on the minimum gray value corresponding to each position pixel point. It is easy to think that the maximum gray value 180 is the gray value of the pixel point in the first row and the first column of the peak value map corresponding to the ith ROI area, and the minimum gray value 150 is the gray value of the pixel point in the first row and the first column of the valley value map corresponding to the ith ROI area.
Based on the step of obtaining the first median map, the peak map and the valley map corresponding to the ith ROI region, and the like, the first median map, the peak map and the valley map corresponding to each ROI region can be obtained.
In a third aspect, the embodiment of the invention further provides a product defect detection device.
In an embodiment, referring to fig. 5, fig. 5 is a schematic functional block diagram of a product defect detecting device according to an embodiment of the invention. As shown in fig. 5, the product defect detecting apparatus includes:
the reconstruction module 10 is configured to reconstruct through an intel MKL function library based on the feature value and the feature vector matrix corresponding to each ROI area included in the image to be detected and the target sample image, so as to obtain a reference image;
a selection module 20, configured to select a target ROI area from each ROI area included in the target sample image based on the to-be-detected area in the to-be-detected image, where a position of the target ROI area in the target sample image is the same as a position of the to-be-detected area in the to-be-detected image;
the processing module 30 is configured to process the image to be detected based on the target ROI area and the reference image, and obtain a processed image to be detected;
a detection module 40, configured to detect whether a pixel point satisfying a defect point condition exists in the processed image to be detected;
the first determining module 50 is configured to determine that a product to which the image to be detected belongs is defective if the processed image to be detected has pixel points that satisfy a defect point condition;
the second determining module 60 is configured to determine that the product to which the image to be detected belongs is defect-free if no pixel points satisfying the defect point condition exist in the processed image to be detected.
Further, in an embodiment, the product defect detecting device further includes an obtaining module, configured to:
acquiring an initial sample image;
preprocessing an initial sample image to obtain a target sample image;
acquiring a plurality of images corresponding to each ROI (region of interest) in a target sample image, wherein the number of the images corresponding to each ROI corresponds to the number of the minimum repeating units in the target sample image one by one;
based on a plurality of images corresponding to each ROI region, obtaining a characteristic value and a characteristic vector matrix corresponding to each ROI region through a principal component analysis method;
and obtaining a first median map, a peak map and a valley map corresponding to each ROI region by a multi-scale golden template detection method based on a plurality of images corresponding to each ROI region.
Further, in an embodiment, the obtaining module is further configured to:
acquiring a gray value of each pixel point in each image corresponding to the ith ROI area;
determining a gray median value of the same position corresponding to each pixel point based on the gray value of each pixel point in each image;
obtaining a first median map corresponding to an ith ROI region based on the gray median value of the same position corresponding to each pixel point;
respectively obtaining a maximum gray value and a minimum gray value from gray values of pixel points at the same position of each image corresponding to an ith ROI region, and obtaining the maximum gray value and the minimum gray value corresponding to the pixel points at each position in each image corresponding to the ith ROI region;
Obtaining a peak value diagram corresponding to the ith ROI based on the maximum gray value corresponding to each position pixel point, obtaining a valley value diagram corresponding to the ith ROI based on the minimum gray value corresponding to each position pixel point, and the like, and obtaining a first median diagram, a peak value diagram and a valley value diagram corresponding to each ROI.
Further, in an embodiment, the processing module 30 is configured to:
acquiring a first median map, a peak map and a valley map corresponding to a target ROI region;
obtaining a second median map based on the gray values of the pixels in the image to be detected, the gray values of the pixels in the reference image and the gray values of the pixels in the first median map;
subtracting the gray value of each pixel point at the corresponding position in the second median map from the gray value of each pixel point in the image to be detected to obtain a first difference map;
subtracting the gray value of each pixel point at the corresponding position in the image to be detected from the gray value of each pixel point in the second median map to obtain a second difference map;
subtracting the gray value of each pixel point at the corresponding position in the peak value graph from the gray value of each pixel point in the first difference graph to obtain a third difference graph;
subtracting the gray value of each pixel point at the corresponding position in the second difference value graph from the gray value of each pixel point in the valley value graph to obtain a fourth difference value graph;
And obtaining the processed image to be detected by adding the gray value of each pixel point in the third difference value diagram to the gray value of each pixel point in the corresponding position in the fourth difference value diagram.
Further, in an embodiment, the detection module 40 is configured to:
detecting whether pixel points with gray values different from zero exist in the processed image to be detected;
if the pixel points with the gray values not being zero exist, calculating the geometric shape characteristics and the gray characteristics of the areas where the pixel points with the gray values not being zero are located;
detecting whether the geometric feature and the gray feature of the region where the pixel point with the gray value not being zero is located meet the defect point condition;
if the geometric feature and the gray feature of the region where the pixel point with the gray value not being zero is located meet the defect point condition, determining that the pixel point meeting the defect point condition exists in the processed image to be detected;
if the geometric feature and the gray feature of the region where the pixel point with the gray value not being zero is located do not meet the defect point condition, determining that the pixel point meeting the defect point condition does not exist in the processed image to be detected;
if the pixel points with the gray values not being zero do not exist, determining that the pixel points meeting the defect point conditions do not exist in the processed image to be detected.
The function implementation of each module in the product defect detection device corresponds to each step in the product defect detection method embodiment, and the function and implementation process of each module are not described here again.
In a fourth aspect, embodiments of the present invention also provide a readable storage medium.
The readable storage medium of the present invention stores a product defect detection program, wherein the product defect detection program, when executed by a processor, implements the steps of the product defect detection method as described above.
The method implemented when the product defect detection program is executed may refer to various embodiments of the product defect detection method of the present invention, and will not be described herein.
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 one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising several instructions for causing a terminal device to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (10)

1. A method for detecting a product defect, the method comprising:
Obtaining a reference image through an Intel MKL function library based on the characteristic value and the characteristic vector matrix corresponding to each ROI area contained in the image to be detected and the target sample image;
determining a target ROI (region of interest) from each ROI contained in the target sample image based on a region to be detected in the image to be detected, wherein the position of the target ROI in the target sample image is the same as the position of the region to be detected in the image to be detected;
processing the image to be detected based on the target ROI area and the reference image to obtain a processed image to be detected;
detecting whether pixel points meeting the defect point conditions exist in the processed image to be detected;
if the processed image to be detected has pixel points meeting the defect point condition, determining that a product to which the image to be detected belongs has defects;
and if the processed image to be detected does not have the pixel points meeting the defect point condition, determining that the product to which the image to be detected belongs has no defects.
2. The product defect detection method according to claim 1, wherein before obtaining the reference image by using the intel MKL function library based on the feature value and the feature vector matrix corresponding to each ROI area included in the image to be detected and the target sample image, the method comprises:
Acquiring an initial sample image;
preprocessing the initial sample image to obtain a target sample image;
acquiring a plurality of images corresponding to each ROI (region of interest) in the target sample image, wherein the number of the images corresponding to each ROI corresponds to the number of the minimum repeating units in the target sample image one by one;
based on a plurality of images corresponding to each ROI region, obtaining a characteristic value and a characteristic vector matrix corresponding to each ROI region through a principal component analysis method;
and obtaining a first median map, a peak map and a valley map corresponding to each ROI region by a multi-scale golden template detection method based on a plurality of images corresponding to each ROI region.
3. The method for detecting product defects according to claim 2, wherein the obtaining the first median map, the peak map and the valley map corresponding to each ROI region by a multi-scale golden template detection method based on the plurality of images corresponding to each ROI region comprises:
acquiring a gray value of each pixel point in each image corresponding to the ith ROI area;
determining a gray median value of the same position corresponding to each pixel point based on the gray value of each pixel point in each image;
Obtaining a first median map corresponding to the ith ROI area based on the gray median value of the same position corresponding to each pixel point;
respectively obtaining a maximum gray value and a minimum gray value from gray values of pixel points at the same position of each image corresponding to the ith ROI area, and obtaining the maximum gray value and the minimum gray value corresponding to the pixel points at each position in each image corresponding to the ith ROI area;
and obtaining a peak value diagram corresponding to the ith ROI based on the maximum gray value corresponding to each position pixel point, obtaining a valley value diagram corresponding to the ith ROI based on the minimum gray value corresponding to each position pixel point, and so on, and obtaining a first median diagram, a peak value diagram and a valley value diagram corresponding to each ROI.
4. The method for detecting a product defect according to claim 1, wherein the processing the image to be detected based on the target ROI area and the reference image to obtain a processed image to be detected includes:
acquiring a first median map, a peak map and a valley map corresponding to the target ROI region;
obtaining a second median map based on the gray values of all the pixel points in the image to be detected, the gray values of all the pixel points in the reference image and the gray values of all the pixel points in the first median map corresponding to the target ROI area;
Subtracting the gray value of each pixel point at the corresponding position in the second median map from the gray value of each pixel point in the image to be detected to obtain a first difference map;
subtracting the gray value of each pixel point at the corresponding position in the image to be detected from the gray value of each pixel point in the second median map to obtain a second difference map;
subtracting the gray value of each pixel point at the corresponding position in the peak value diagram corresponding to the target ROI region from the gray value of each pixel point in the first difference diagram to obtain a third difference diagram;
subtracting the gray value of each pixel point at the corresponding position in the second difference value graph by using the gray value of each pixel point in the valley value graph corresponding to the target ROI region to obtain a fourth difference value graph;
and adding the gray value of each pixel point in the third difference value graph to the gray value of each pixel point in the corresponding position in the fourth difference value graph to obtain the processed image to be detected.
5. The method for detecting a product defect according to claim 1, wherein detecting whether a pixel satisfying a defect point condition exists in the processed image to be detected comprises:
detecting whether pixel points with gray values different from zero exist in the processed image to be detected;
If the pixel points with the gray values not being zero exist, calculating the geometric shape characteristics and the gray characteristics of the area where the pixel points with the gray values not being zero are located;
detecting whether the geometric feature and the gray feature of the region where the pixel point with the gray value not being zero is located meet the defect point condition;
if the geometric feature and the gray feature of the region where the pixel point with the gray value not being zero is located meet the defect point condition, determining that the pixel point meeting the defect point condition exists in the processed image to be detected;
if the geometric feature and the gray feature of the region where the pixel point with the gray value not being zero is located do not meet the defect point condition, determining that the pixel point meeting the defect point condition does not exist in the processed image to be detected;
and if the pixel points with the gray values not being zero do not exist, determining that the pixel points meeting the defect point conditions do not exist in the processed image to be detected.
6. A product defect detection apparatus, characterized in that the product defect detection apparatus comprises:
the reconstruction module is used for reconstructing through an Intel MKL function library based on the feature value and the feature vector matrix corresponding to each ROI region contained in the image to be detected and the target sample image to obtain a reference image;
A selection module, configured to select a target ROI area from each ROI area included in the target sample image based on a region to be detected in the image to be detected, where a position of the target ROI area in the target sample image is the same as a position of the region to be detected in the image to be detected;
the processing module is used for processing the image to be detected based on the target ROI area and the reference image to obtain a processed image to be detected;
the detection module is used for detecting whether pixel points meeting the defect point conditions exist in the processed image to be detected;
the first determining module is used for determining that a product to which the image to be detected belongs is defective if the processed image to be detected has pixel points meeting the defect point condition;
and the second determining module is used for determining that the product to which the image to be detected belongs has no defects if the processed image to be detected does not have the pixel points meeting the defect point condition.
7. The product defect detection apparatus of claim 6, wherein the processing module is configured to:
acquiring a first median map, a peak map and a valley map corresponding to the target ROI region;
Obtaining a second median map based on the gray values of all the pixel points in the image to be detected, the gray values of all the pixel points in the reference image and the gray values of all the pixel points in the first median map corresponding to the target ROI area;
subtracting the gray value of each pixel point at the corresponding position in the second median map from the gray value of each pixel point in the image to be detected to obtain a first difference map;
subtracting the gray value of each pixel point at the corresponding position in the image to be detected from the gray value of each pixel point in the second median map to obtain a second difference map;
subtracting the gray value of each pixel point at the corresponding position in the peak value diagram corresponding to the target ROI region from the gray value of each pixel point in the first difference diagram to obtain a third difference diagram;
subtracting the gray value of each pixel point at the corresponding position in the second difference value graph by using the gray value of each pixel point in the valley value graph corresponding to the target ROI region to obtain a fourth difference value graph;
and adding the gray value of each pixel point in the third difference value graph to the gray value of each pixel point in the corresponding position in the fourth difference value graph to obtain the processed image to be detected.
8. The product defect detection apparatus of claim 6, wherein the detection module is configured to:
detecting whether pixel points with gray values different from zero exist in the processed image to be detected;
if the pixel points with the gray values not being zero exist, calculating the geometric shape characteristics and the gray characteristics of the area where the pixel points with the gray values not being zero are located;
detecting whether the geometric feature and the gray feature of the region where the pixel point with the gray value not being zero is located meet the defect point condition;
if the geometric feature and the gray feature of the region where the pixel point with the gray value not being zero is located meet the defect point condition, determining that the pixel point meeting the defect point condition exists in the processed image to be detected;
if the geometric feature and the gray feature of the region where the pixel point with the gray value not being zero is located do not meet the defect point condition, determining that the pixel point meeting the defect point condition does not exist in the processed image to be detected;
and if the pixel points with the gray values not being zero do not exist, determining that the pixel points meeting the defect point conditions do not exist in the processed image to be detected.
9. A product defect detection apparatus comprising a processor, a memory, and a product defect detection program stored on the memory and executable by the processor, wherein the product defect detection program, when executed by the processor, implements the steps of the product defect detection method according to any one of claims 1 to 5.
10. A readable storage medium, wherein a product defect detection program is stored on the readable storage medium, wherein the product defect detection program, when executed by a processor, implements the steps of the product defect detection method according to any one of claims 1 to 5.
CN202310226390.3A 2023-03-09 2023-03-09 Product defect detection method and related equipment Active CN116245848B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310226390.3A CN116245848B (en) 2023-03-09 2023-03-09 Product defect detection method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310226390.3A CN116245848B (en) 2023-03-09 2023-03-09 Product defect detection method and related equipment

Publications (2)

Publication Number Publication Date
CN116245848A true CN116245848A (en) 2023-06-09
CN116245848B CN116245848B (en) 2023-09-19

Family

ID=86632916

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310226390.3A Active CN116245848B (en) 2023-03-09 2023-03-09 Product defect detection method and related equipment

Country Status (1)

Country Link
CN (1) CN116245848B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109544506A (en) * 2018-10-17 2019-03-29 潍坊路加精工有限公司 The detection method and device of workpiece appearance defects
US20190228515A1 (en) * 2018-01-22 2019-07-25 Boe Technology Group Co., Ltd. Method and apparatus for detecting defects, and computer readable storage medium
CN114612469A (en) * 2022-05-09 2022-06-10 武汉中导光电设备有限公司 Product defect detection method, device and equipment and readable storage medium
CN114723677A (en) * 2022-03-18 2022-07-08 珠海格力电器股份有限公司 Image defect detection method, image defect detection device, image defect detection equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190228515A1 (en) * 2018-01-22 2019-07-25 Boe Technology Group Co., Ltd. Method and apparatus for detecting defects, and computer readable storage medium
CN109544506A (en) * 2018-10-17 2019-03-29 潍坊路加精工有限公司 The detection method and device of workpiece appearance defects
CN114723677A (en) * 2022-03-18 2022-07-08 珠海格力电器股份有限公司 Image defect detection method, image defect detection device, image defect detection equipment and storage medium
CN114612469A (en) * 2022-05-09 2022-06-10 武汉中导光电设备有限公司 Product defect detection method, device and equipment and readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
乔湘洋;王海芳;祁超飞;李新庆;: "基于机器视觉的线缆表面缺陷检测系统设计与算法研究", 机床与液压, no. 05, pages 54 - 58 *

Also Published As

Publication number Publication date
CN116245848B (en) 2023-09-19

Similar Documents

Publication Publication Date Title
CN114612469B (en) Product defect detection method, device and equipment and readable storage medium
CN114266773B (en) Display panel defect positioning method, device, equipment and storage medium
CN112183038A (en) Form identification and typing method, computer equipment and computer readable storage medium
CN110197180B (en) Character defect detection method, device and equipment
CN108108753A (en) A kind of recognition methods of check box selection state based on support vector machines and device
CN113538603B (en) Optical detection method and system based on array product and readable storage medium
CN112906794A (en) Target detection method, device, storage medium and terminal
CN109389110B (en) Region determination method and device
CN115302963A (en) Bar code printing control method, system and medium based on machine vision
CN111489344A (en) Method, system and related device for determining image definition
CN110276759B (en) Mobile phone screen bad line defect diagnosis method based on machine vision
CN113468905B (en) Graphic code identification method, graphic code identification device, computer equipment and storage medium
CN110570418A (en) Woven label defect detection method and device
CN112200789B (en) Image recognition method and device, electronic equipment and storage medium
CN116245848B (en) Product defect detection method and related equipment
CN116542963A (en) Float glass defect detection system and detection method based on machine learning
Ramírez-Ortegón et al. An analysis of the transition proportion for binarization in handwritten historical documents
CN114897797A (en) Method, device and equipment for detecting defects of printed circuit board and storage medium
CN115937095A (en) Printing defect detection method and system integrating image processing algorithm and deep learning
CN115049713A (en) Image registration method, device, equipment and readable storage medium
CN113554024A (en) Method and device for determining cleanliness of vehicle and computer equipment
CN114529742A (en) Image similarity determining method, device and equipment and computer readable storage medium
CN106934814B (en) Background information identification method and device based on image
CN116433671B (en) Colloidal gold detection method, system and storage medium based on image recognition
Badoiu et al. OCR quality improvement using image preprocessing

Legal Events

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