CN114235758A - Defect detection method, device, equipment and storage medium - Google Patents

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

Info

Publication number
CN114235758A
CN114235758A CN202111518451.0A CN202111518451A CN114235758A CN 114235758 A CN114235758 A CN 114235758A CN 202111518451 A CN202111518451 A CN 202111518451A CN 114235758 A CN114235758 A CN 114235758A
Authority
CN
China
Prior art keywords
image
gray
pixel point
determining
original
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
CN202111518451.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.)
Luster LightTech Co Ltd
Suzhou Luster Vision Intelligent Device Co Ltd
Original Assignee
Luster LightTech Co Ltd
Suzhou Luster Vision Intelligent Device 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 Luster LightTech Co Ltd, Suzhou Luster Vision Intelligent Device Co Ltd filed Critical Luster LightTech Co Ltd
Priority to CN202111518451.0A priority Critical patent/CN114235758A/en
Publication of CN114235758A publication Critical patent/CN114235758A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/62Systems in which the material investigated is excited whereby it emits light or causes a change in wavelength of the incident light
    • G01N21/63Systems in which the material investigated is excited whereby it emits light or causes a change in wavelength of the incident light optically excited
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/01Arrangements or apparatus for facilitating the optical investigation
    • HELECTRICITY
    • H01ELECTRIC ELEMENTS
    • H01LSEMICONDUCTOR DEVICES NOT COVERED BY CLASS H10
    • H01L22/00Testing or measuring during manufacture or treatment; Reliability measurements, i.e. testing of parts without further processing to modify the parts as such; Structural arrangements therefor
    • H01L22/10Measuring as part of the manufacturing process
    • H01L22/12Measuring as part of the manufacturing process for structural parameters, e.g. thickness, line width, refractive index, temperature, warp, bond strength, defects, optical inspection, electrical measurement of structural dimensions, metallurgic measurement of diffusions
    • HELECTRICITY
    • H01ELECTRIC ELEMENTS
    • H01LSEMICONDUCTOR DEVICES NOT COVERED BY CLASS H10
    • H01L22/00Testing or measuring during manufacture or treatment; Reliability measurements, i.e. testing of parts without further processing to modify the parts as such; Structural arrangements therefor
    • H01L22/20Sequence of activities consisting of a plurality of measurements, corrections, marking or sorting steps

Landscapes

  • Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Manufacturing & Machinery (AREA)
  • Immunology (AREA)
  • Chemical & Material Sciences (AREA)
  • Biochemistry (AREA)
  • General Health & Medical Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Pathology (AREA)
  • Analytical Chemistry (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Microelectronics & Electronic Packaging (AREA)
  • Power Engineering (AREA)
  • Nuclear Medicine, Radiotherapy & Molecular Imaging (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

The embodiment of the application discloses a defect detection method, a device, equipment and a storage medium, wherein the method comprises the following steps: acquiring an original gray image of the surface of an object to be detected; adjusting the gray value of each pixel point in the original gray image according to the gray value of the neighborhood pixel point of the pixel point to obtain a gray adjustment image; performing threshold segmentation on the gray-scale adjustment image, and determining a defect detection result of the object to be detected according to a threshold segmentation result; through the technical scheme, on the basis of effectively extracting the defects, the detection speed is improved, and the requirement for quickly detecting the object defects is met.

Description

Defect detection method, device, equipment and storage medium
Technical Field
The embodiment of the application relates to the technical field of image processing, in particular to a defect detection method, a defect detection device, defect detection equipment and a storage medium.
Background
The surface defects of the object bring adverse effects on the aesthetic degree, the comfort level, the use performance and the like, so that a production enterprise detects the surface defects of the object so as to find the surface defects in time. In the object detection process, the detection speed is a key factor influencing the economic benefit of a production enterprise.
In the prior art, when defect detection of a weak concave-convex point type is performed under a complex background, generally, fourier transform is performed on an original gray image of an object, texture information is eliminated in a frequency domain, then, an image with enhanced background smooth defects is obtained by using inverse fourier transform, and finally, defects are extracted by threshold segmentation. However, the time of one fourier transform is at least more than 20 milliseconds, and the detection cannot be completed within 10 milliseconds at all, so that the detection speed is greatly influenced, and the requirement of quickly detecting the object defects cannot be met.
Therefore, there is a need for improvement in view of the problems in the prior art.
Disclosure of Invention
The application provides a defect detection method, a defect detection device, defect detection equipment and a storage medium, which are used for improving the detection speed and meeting the requirement of quickly detecting object defects on the basis of effectively extracting the defects.
In a first aspect, an embodiment of the present application provides a defect detection method, where the method includes:
acquiring an original gray image of the surface of an object to be detected;
adjusting the gray value of each pixel point in the original gray image according to the gray value of the neighborhood pixel point of the pixel point to obtain a gray adjustment image;
and performing threshold segmentation on the gray-scale adjustment image, and determining a defect detection result of the object to be detected according to a threshold segmentation result.
In a second aspect, an embodiment of the present application further provides a defect detection apparatus, where the apparatus includes:
the gray level image acquisition module is used for acquiring an original gray level image of the surface of the object to be detected;
the gray level adjusting module is used for adjusting the gray level value of each pixel point in the original gray level image according to the gray level value of the neighborhood pixel point of the pixel point to obtain a gray level adjusting image;
and the detection result determining module is used for performing threshold segmentation on the gray level adjustment image and determining the defect detection result of the object to be detected according to the threshold segmentation result.
In a third aspect, an embodiment of the present application further provides an electronic device, where the device includes:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement any one of the defect detection methods provided in the embodiments of the first aspect.
In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements any one of the defect detection methods provided in the embodiments of the first aspect.
The method comprises the steps of obtaining an original gray image of the surface of an object to be detected; adjusting the gray value of each pixel point in the original gray image according to the gray value of the neighborhood pixel point of the pixel point to obtain a gray adjustment image; and performing threshold segmentation on the gray-scale adjustment image, and determining a defect detection result of the object to be detected according to a threshold segmentation result. Through the technical scheme, before image threshold segmentation is carried out, the gray adjustment is carried out on each pixel point in an original gray image based on the characteristic that brightness and darkness of concave-convex point defects are connected, the gray values of neighborhood pixel points are utilized, so that the concave-convex point defects can be more obvious compared with noise in the background, then threshold segmentation is carried out on the gray adjustment image, the defects can be quickly detected from the original gray image, the defect detection process is quick and effective, complex and time-consuming Fourier transform processing is not needed, the detection speed is improved on the basis of effectively extracting the defects, and the requirement for quickly detecting the object defects is met.
Drawings
Fig. 1 is a flowchart of a defect detection method according to an embodiment of the present application;
fig. 2 is a schematic diagram of an original grayscale image with a concave-convex point defect according to an embodiment of the present application;
fig. 3 is a flowchart of a defect detection method according to a second embodiment of the present application;
fig. 4 is a flowchart of a defect detection method provided in the third embodiment of the present application;
fig. 5 is a schematic diagram of a reduced image according to a third embodiment of the present application;
fig. 6 is a schematic diagram of a gray-scale adjustment image according to a third embodiment of the present application;
FIG. 7 is a diagram of a threshold segmentation image provided in the third embodiment of the present application;
FIG. 8 is a schematic diagram of a real defect area provided in the third embodiment of the present application;
fig. 9 is a schematic view of a defect detection apparatus according to a fourth embodiment of the present application;
fig. 10 is a schematic view of an electronic device provided in this application embodiment five.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting of the application. It should be further noted that, for the convenience of description, only some of the structures related to the present application are shown in the drawings, not all of the structures.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the steps as a sequential process, many of the steps can be performed in parallel, concurrently or simultaneously. In addition, the order of the steps may be rearranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Example one
Fig. 1 is a flowchart of a defect detection method according to an embodiment of the present application. The embodiment of the application is suitable for rapidly detecting concave and convex points on the surface of an object. The method may be performed by a defect detecting apparatus, which may be implemented by software and/or hardware, and is specifically configured in an electronic device, which may be a mobile terminal or a fixed terminal.
Referring to fig. 1, a defect detection method provided in an embodiment of the present application includes:
and S110, acquiring an original gray image of the surface of the object to be detected.
The object to be detected can be various metal workpieces such as steel billets, forgings, castings and the like.
In this embodiment, the shot image of the surface of the object to be detected can be obtained by the industrial camera, and the original grayscale image of the surface of the object to be detected is obtained after the grey processing is performed on the shot image.
For example, fig. 2 is a schematic diagram of an original grayscale image with a concave-convex point defect, where a concave-convex point is located in a position area near the middle of the image, and the concave-convex point is a defect area to be detected. The original gray image background has disorder and irregular texture interference, the defect size is less than 0.1 mm, and meanwhile, the defect and the background are integrated and have no clear edge boundary. If a conventional threshold segmentation method is directly adopted to perform threshold segmentation on the original gray level image, the background and the defects are mixed together, the defects are difficult to be effectively detected, and the conditions of missing detection and error detection exist.
Generally, when defect detection is performed, for an original grayscale image with a size of 600 × 600, the detection requirement of a manufacturing enterprise is that the detection time needs to be within 10 milliseconds.
S120, adjusting the gray value of each pixel point in the original gray image according to the gray value of the neighborhood pixel point of the pixel point to obtain a gray-adjusted image.
Specifically, the neighborhood pixel may set a pixel included in the region range with the pixel as a center. The set area range may be a circle, a rectangle, a polygon, or the like, the set area range may also be referred to as a mask, and the process of adjusting the gray scale value of the pixel point may also be referred to as a mask process.
In this embodiment, the adjusting the gray-scale value of the pixel point may include: taking the gray average value of each neighborhood pixel point as a reference adjustment value according to the gray value of the neighborhood pixel point of the pixel point; and adjusting the gray value of the pixel point according to the reference adjustment value. For example, the reference adjustment value can be directly substituted for the original gray value of the pixel point.
Optionally, in some embodiments, statistical data such as a gray average value, a median, a gray standard deviation, and the like of each neighborhood pixel point may also be used as a reference adjustment value; and adjusting the gray value of the pixel point according to the reference adjustment value so as to optimize the adjustment process.
Or optionally, the maximum gray difference value between the neighborhood pixels can be used as a reference adjustment value; and adjusting the gray value of the pixel point according to the reference adjustment value.
It can be understood that the concave-convex point defects can be more prominently displayed in the image by adjusting the gray value of the original gray image, thereby being beneficial to the subsequent extraction of the concave-convex point defects.
In this embodiment, there are various ways to adjust the gray value of the pixel point, which can be selected according to the actual use requirement and situation, and the method for adjusting the gray value is not limited in this embodiment.
S130, performing threshold segmentation on the gray-scale adjustment image, and determining a defect detection result of the object to be detected according to a threshold segmentation result.
Alternatively, the process of thresholding the grayscale adjusted image may include: determining an image segmentation threshold; and performing threshold segmentation on the gray-scale adjustment image according to the image segmentation threshold. Specifically, the threshold segmentation may divide the grayscale adjusted image into two parts: pixel groups greater than an image segmentation threshold and pixel groups less than the image segmentation threshold. The image segmentation threshold may be determined according to a gray average and/or a gray standard deviation of the gray-scale adjustment image.
In some embodiments, in the process of determining the image segmentation threshold, an adjustment coefficient may be added according to an empirical value to dynamically adjust the image segmentation threshold, so that the image segmentation threshold is more flexible and reasonable. For example, the calculation result of "mean value of gray scale + standard deviation of gray scale × adjustment coefficient" may be used as an image segmentation threshold, and threshold segmentation, that is, image binarization may be performed.
In this embodiment, according to the threshold segmentation result, a target region where the concave-convex point defect is located may be obtained from the binary image, where the target region is a brighter region in the binary image, and may highlight the contour of the target.
The method comprises the steps of obtaining an original gray image of the surface of an object to be detected; adjusting the gray value of each pixel point in the original gray image according to the gray value of the neighborhood pixel point of the pixel point to obtain a gray adjustment image; and performing threshold segmentation on the gray-scale adjustment image, and determining a defect detection result of the object to be detected according to a threshold segmentation result. Through the technical scheme, before image threshold segmentation is carried out, the gray adjustment is carried out on each pixel point in an original gray image based on the characteristic that brightness and darkness of concave-convex point defects are connected, the gray values of neighborhood pixel points are utilized, so that the concave-convex point defects can be more obvious compared with noise in the background, then threshold segmentation is carried out on the gray adjustment image, the defects can be quickly detected from the original gray image, the defect detection process is quick and effective, complex and time-consuming Fourier transform processing is not needed, the detection speed is improved on the basis of effectively extracting the defects, and the requirement for quickly detecting the object defects is met.
Example two
Fig. 3 is a flowchart of a defect detection method provided in the second embodiment of the present application, and the present embodiment is an optimization of the foregoing scheme based on the foregoing embodiment.
Further, the operation of adjusting the gray value of each pixel point in the original gray image according to the gray value of the neighborhood pixel point of the pixel point to obtain a gray adjustment image is refined into the step of determining the mask size, and the neighborhood pixel point in the mask area of the pixel point is determined according to the mask size; and determining the pixel value of the pixel point in the gray-scale adjustment image according to the maximum gray-scale difference value between the neighborhood pixel points in the mask region so as to clarify the determination process of the gray-scale adjustment image.
Wherein explanations of the same or corresponding terms as those of the above-described embodiments are omitted.
Referring to fig. 3, the defect detection method provided in this embodiment includes:
s210, acquiring an original gray image of the surface of the object to be detected.
S220, determining the mask size, and determining the neighborhood pixel points in the mask area of the pixel points according to the mask size aiming at each pixel point in the original gray level image.
In this embodiment, pixel-by-pixel traversal may be performed on the original grayscale image with a mask size of a fixed size, and a pixel in the mask region is determined as a neighborhood pixel of the pixel with the traversed pixel as a center.
In this embodiment, the size of the mask size affects determination of the gray-scale adjustment image, and the gray-scale adjustment image affects final detection and extraction of the defect, so that, in order to effectively extract the defect region from the original gray-scale image, optionally, the determination process of the mask size may include: estimating a defect area of the original gray image according to the pixel value of each pixel point in the original gray image; the mask size is determined based on the defective area.
Specifically, the mask size may be determined according to the size of the defect region, for example, the set proportional size of the defect size may be determined as the mask size. The set proportion may be one fourth or one half, and the specific set proportion may be selected according to actual use requirements and situations, which is not specifically limited in the embodiments of the present application.
For example, assuming the size of the defect region is 20 × 20, the mask size may be 10 × 10.
It is understood that the estimated defect area has a certain reference value, and the mask size can be determined quantitatively, rather than uniformly presetting a fixed mask size. In this embodiment, the mask size may be adaptively adjusted according to the original gray image of the surface of the object to be detected, so that the mask size is not too large or too small, and the mask size may be more reasonable and accurate.
Optionally, the pixel points in the original gray image may be preliminarily screened according to the gray characteristic of the surface defect of the object to be detected and the gray value of the typical defect pixel points, so as to estimate the defect region of the original gray image. The gray value of the typical defect pixel point can be determined according to the following modes: and analyzing historical defect detection data of the same type of object in a big data analysis processing mode, and determining the gray value of a typical defect pixel point.
Or optionally, the original grayscale image may be directly subjected to threshold segmentation according to the grayscale mean of the original grayscale image, and the defect region may be estimated from the original grayscale image.
It can be understood that there are various ways to estimate the defect area, which can be selected according to actual use requirements and situations, and this is not limited in this embodiment of the present application.
S230, determining the pixel value of the pixel point in the gray-scale adjustment image according to the maximum gray-scale difference value between the neighborhood pixel points in the mask area.
Specifically, the pixel points in the mask region can be traversed to find the maximum gray value and the minimum gray value; calculating to obtain a maximum gray difference value according to the maximum gray value and the minimum gray value; and determining the pixel value of the pixel point in the gray-scale adjustment image according to the maximum gray-scale difference value.
Typically, the maximum gray scale difference value may be directly substituted for the pixel value of the pixel point to obtain a gray scale adjustment image, and the gray scale adjustment image may also be referred to as a gray scale difference image according to the determination process of the gray scale adjustment image.
It will be appreciated that the grey scale difference image may cause the asperity defects to be highlighted in the image, effectively distinguishing them from noise in the image.
S240, performing threshold segmentation on the gray-scale adjustment image, and determining a defect detection result of the object to be detected according to a threshold segmentation result.
On the basis of the embodiment, the determination process of the gray level adjustment image is determined, and the neighborhood pixel points in the mask area of the pixel points are determined by determining the mask size and according to the mask size; and determining the pixel value of the pixel point in the gray level adjustment image according to the maximum gray level difference value between the neighborhood pixel points in the mask region. Through the technical scheme, the pixel value of the pixel point is adjusted according to the maximum gray level difference value between the adjacent pixel points in the mask area, on one hand, the defects of concave-convex points can be effectively displayed in the image, on the other hand, the noise in the image can be effectively inhibited, then, the threshold segmentation is carried out on the gray level adjustment image, the defects can be quickly detected from the original gray level image, the defect detection process is quick and effective, complex and time-consuming Fourier transform processing is not needed, the detection speed is improved, and the requirement for quickly detecting the object defects is met.
EXAMPLE III
Fig. 4 is a flowchart of a defect detection method provided in the third embodiment of the present application, and this embodiment is an optimization of the above-mentioned scheme based on the above-mentioned embodiment.
Further, before the operation of adjusting the gray value of each pixel point in the original gray image according to the gray value of the neighborhood pixel point of the pixel point to obtain a gray adjustment image, the operation of reducing the original gray image to update the original gray image is added to optimize the defect detection process.
Wherein explanations of the same or corresponding terms as those of the above-described embodiments are omitted.
Referring to fig. 4, the defect detection method provided in this embodiment includes:
s310, acquiring an original gray image of the surface of the object to be detected.
And S320, performing reduction processing on the original gray image to update the original gray image.
Optionally, considering that the original grayscale image has defects and a background mixed together, and has no clear outline, there is a certain difficulty in directly detecting, so that the original grayscale image may be reduced by using a bilinear interpolation algorithm based on a set reduction coefficient to update the original grayscale image.
Specifically, the bilinear interpolation algorithm can perform linear interpolation in two directions by using gray values of four adjacent points around to obtain gray values of sampling points, and image reduction processing is performed based on the bilinear interpolation algorithm, so that a reduced image has high quality, and the image can be ensured not to be distorted.
It can be understood that, image reduction is performed through bilinear interpolation, on one hand, smooth filtering can be performed on an original gray image, and high-frequency components in the image are weakened or eliminated; on the other hand, the image processing is carried out based on the reduced image, the effect of data dimension reduction can be achieved, and the data volume of subsequent image processing is effectively reduced.
In this embodiment, the original grayscale image is reduced to obtain a reduced image; the reduced image is used as the original gray image, and the updating process of the original gray image can be realized. For example, a schematic diagram of a reduced image may be seen in fig. 5.
Alternatively, the setting of the reduction coefficient is determined according to the following manner: determining the average pixel number of brightness noise points in the original gray level image according to the original gray level image; the reciprocal of the average number of pixels is determined as a reduction coefficient.
Specifically, the luminance noise points in the original gray level image can be found out, and the number of pixels included in each luminance noise point is respectively counted to obtain statistical data; and determining the average pixel number of the brightness noise points according to the statistical data.
For example, assuming that the average number of pixels of the luminance noise in the original grayscale image is 5, the reduction coefficient is 1/5.
It can be understood that the average pixel number of the luminance noise is used as the basis for determining the reduction coefficient, so that the noise in the image can be effectively suppressed.
S330, determining the mask size, and determining the neighborhood pixel points in the mask area of the pixel points according to the mask size aiming at each pixel point in the original gray level image.
S340, determining the pixel value of the pixel point in the gray-scale adjustment image according to the maximum gray-scale difference value between the neighborhood pixel points in the mask area.
In this embodiment, the gradation adjustment may be performed based on the reduced image, and a gradation-adjusted image may be obtained. For example, reference may be made to fig. 6, which is a schematic diagram of a gray scale adjustment image, wherein a position area near the middle in the diagram has a relatively obvious white area, and the white area is also the position area where the concave-convex point defect is located.
And S350, performing threshold segmentation on the gray-scale adjustment image, and determining a defect detection result of the object to be detected according to a threshold segmentation result.
For example, referring to fig. 7, a schematic diagram of a threshold segmentation image is exemplarily shown, in which a defect contour is drawn by using a white line, it should be noted that the defect contour in the diagram is not a real defect region and needs to be mapped into an original gray image through subsequent processing.
In this embodiment, after the original grayscale image is reduced, the defect region determined by threshold segmentation is the defect region in the reduced image, and therefore, the real position region of the defect region in the original grayscale image needs to be determined according to the threshold segmentation result.
Optionally, the determining the defect detection result of the object to be detected according to the threshold segmentation result may include: determining the central coordinate and the area size of a defect reference area in a threshold segmentation result; and determining the real area where the defect of the object to be detected is located according to the set reduction coefficient, the central coordinate and the area size.
The defect reference area refers to a defect area determined by performing threshold segmentation after the original gray level image is subjected to reduction processing.
Optionally, a minimum bounding polygon of the defect reference area may be determined according to the defect reference area; and determining the center coordinates and the area size according to the minimum circumscribed polygon so as to realize the quantification process of the defect reference area.
The external polygon can be a quadrangle, a pentagon or a hexagon, the type of the external polygon can be selected according to actual use requirements and conditions, and the embodiment of the application is not limited to this.
Typically, the minimum circumscribed circle of the defect reference area can be determined according to the defect reference area; and determining the center coordinates and the area size according to the minimum circumscribed circle.
It can be understood that, considering that the defect is a concave-convex type defect, having a fixed circular geometric feature, the defect reference area can be quantified by a circumscribed circle, so that the center coordinates and the area size can be determined simply and quickly.
It will be appreciated that the defect reference region provides data support for determining the real area in which the object to be inspected is defective.
In some embodiments, the determining of the real area of the defect may include: determining a center coordinate and the radius of a circumscribed circle according to the minimum circumscribed circle of the defect reference area; determining a corresponding amplification factor according to the set reduction factor; amplifying the central coordinate according to the amplification coefficient; amplifying the radius of the circumscribed circle according to the amplification factor; the enlarged central coordinate is placed on the original gray image, and a circular area is drawn according to the radius of the enlarged circumscribed circle, where the drawn circular area is a real area where the defect of the object to be detected is located, for example, refer to an exemplary schematic diagram of a defect real area given in fig. 8.
On the basis of the embodiment, the defect detection process is optimized, and the original gray image is reduced before gray adjustment to update the original gray image, so that smooth filtering of the original gray image can be realized, high-frequency components in the image are weakened or eliminated, and effective extraction of defects is facilitated in the subsequent image processing process; on the other hand, the image processing is carried out based on the reduced image, the effect of data dimension reduction can be achieved, the data volume of subsequent image processing is effectively reduced, the defect detection speed is further improved, the defect detection process is optimized, and the defect detection process can be more efficient.
Example four
Fig. 9 is a schematic structural diagram of a defect detection apparatus according to a fourth embodiment of the present application. Referring to fig. 9, an embodiment of the present application provides a defect detecting apparatus, which includes: a gray scale image acquisition module 410, a gray scale adjustment module 420 and a detection result determination module 430.
A gray image obtaining module 410, configured to obtain an original gray image of a surface of an object to be detected;
a gray level adjusting module 420, configured to adjust a gray level of each pixel point in the original gray level image according to a gray level of a neighboring pixel point of the pixel point, so as to obtain a gray level adjusted image;
the detection result determining module 430 is configured to perform threshold segmentation on the grayscale adjustment image, and determine a defect detection result of the object to be detected according to a threshold segmentation result.
The method comprises the steps of obtaining an original gray image of the surface of an object to be detected; adjusting the gray value of each pixel point in the original gray image according to the gray value of the neighborhood pixel point of the pixel point to obtain a gray adjustment image; and performing threshold segmentation on the gray-scale adjustment image, and determining a defect detection result of the object to be detected according to a threshold segmentation result. Through the technical scheme, before image threshold segmentation is carried out, the gray adjustment is carried out on each pixel point in an original gray image based on the characteristic that brightness and darkness of concave-convex point defects are connected, the gray values of neighborhood pixel points are utilized, so that the concave-convex point defects can be more obvious compared with noise in the background, then threshold segmentation is carried out on the gray adjustment image, the defects can be quickly detected from the original gray image, the defect detection process is quick and effective, complex and time-consuming Fourier transform processing is not needed, the detection speed is improved on the basis of effectively extracting the defects, and the requirement for quickly detecting the object defects is met.
Further, the gray scale adjustment module 420 includes:
the mask size determining unit is used for determining the mask size and determining neighborhood pixel points in the mask area of the pixel points according to the mask size;
and the adjustment value determining unit is used for determining the pixel value of the pixel point in the gray-level adjustment image according to the maximum gray-level difference value between the neighborhood pixel points in the mask region.
Further, the mask size determining unit includes:
the pre-estimation subunit is used for estimating a defect area of the original gray image according to the pixel value of each pixel point in the original gray image;
and the mask size determining subunit is used for determining the mask size according to the defect area.
Further, the apparatus further comprises:
and the image reduction processing module is used for reducing the original gray image to update the original gray image before adjusting the gray value of each pixel point in the original gray image according to the gray value of the neighborhood pixel point of the pixel point to obtain a gray-adjusted image.
Further, the image reduction processing module includes:
and the image reduction processing unit is used for carrying out reduction processing on the original gray level image by adopting a bilinear interpolation algorithm based on a set reduction coefficient so as to update the original gray level image.
Further, the image reduction processing unit includes:
the luminance noise point counting subunit is used for determining the average pixel number of the luminance noise points in the original gray level image according to the original gray level image;
a reduction coefficient determining subunit configured to determine a reciprocal of the average number of pixels as the reduction coefficient.
Further, the detection result determining module 430 includes:
the defect position determining unit is used for determining the central coordinate and the area size of the defect reference area in the threshold segmentation result;
and the real area determining unit is used for determining the real area where the defect of the object to be detected is located according to the set reduction coefficient, the central coordinate and the area size.
Determining the central coordinate and the area size of a defect reference area in a threshold segmentation result;
and determining the real area where the defect of the object to be detected is located according to the set reduction coefficient, the central coordinate and the area size.
The defect detection device provided by the embodiment of the application can execute the defect detection method provided by any embodiment of the application, and has corresponding functional modules and beneficial effects of the execution method.
EXAMPLE five
Fig. 10 is a structural diagram of an electronic device according to a fifth embodiment of the present application. FIG. 10 illustrates a block diagram of an exemplary electronic device 512 suitable for use in implementing embodiments of the present application. The electronic device 512 shown in fig. 10 is only an example and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 10, electronic device 512 is in the form of a general purpose computing device. Components of the electronic device 512 may include, but are not limited to: one or more processors or processing units 516, a system memory 528, and a bus 518 that couples the various system components including the system memory 528 and the processing unit 516.
Bus 518 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 512 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by electronic device 512 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 528 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)530 and/or cache memory 532. The electronic device 512 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 534 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 10, and commonly referred to as a "hard drive"). Although not shown in FIG. 10, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 518 through one or more data media interfaces. System memory 528 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the application.
A program/utility 540 having a set (at least one) of program modules 542 may be stored, for example, in system memory 528, such program modules 542 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. The program modules 542 generally perform the functions and/or methods of the embodiments described herein.
The electronic device 512 may also communicate with one or more external devices 514 (e.g., keyboard, pointing device, display 524, etc.), with one or more devices that enable a user to interact with the electronic device 512, and/or with any devices (e.g., network card, modem, etc.) that enable the electronic device 512 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 522. Also, the electronic device 512 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 520. As shown, the network adapter 520 communicates with the other modules of the electronic device 512 via the bus 518. It should be appreciated that although not shown in FIG. 10, other hardware and/or software modules may be used in conjunction with the electronic device 512, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 516 executes various functional applications and data processing by running at least one of other programs stored in the system memory 528, for example, to implement any one of the defect detection methods provided in the embodiments of the present application.
EXAMPLE six
An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a defect detection method provided in any embodiment of the present application, and the method includes: acquiring an original gray image of the surface of an object to be detected; adjusting the gray value of each pixel point in the original gray image according to the gray value of the neighborhood pixel point of the pixel point to obtain a gray adjustment image; and performing threshold segmentation on the gray-scale adjustment image, and determining a defect detection result of the object to be detected according to a threshold segmentation result.
From the above description of the embodiments, it is obvious for those skilled in the art that the present application can be implemented by software and necessary general hardware, and certainly can be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present application may be embodied in the form of software, which may be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods described in the embodiments of the present application.
It should be noted that, in the embodiment of the defect detection apparatus, the included units and modules are only divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only used for distinguishing one functional unit from another, and are not used for limiting the protection scope of the application.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present application and the technical principles employed. It will be understood by those skilled in the art that the present application is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the application. Therefore, although the present application has been described in more detail with reference to the above embodiments, the present application is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present application, and the scope of the present application is determined by the scope of the appended claims.

Claims (10)

1. A method of defect detection, comprising:
acquiring an original gray image of the surface of an object to be detected;
adjusting the gray value of each pixel point in the original gray image according to the gray value of the neighborhood pixel point of the pixel point to obtain a gray adjustment image;
and performing threshold segmentation on the gray-scale adjustment image, and determining a defect detection result of the object to be detected according to a threshold segmentation result.
2. The method according to claim 1, wherein the adjusting the gray value of the pixel point according to the gray value of the neighboring pixel point of the pixel point to obtain a gray-adjusted image comprises:
determining the mask size, and determining a neighborhood pixel point in the mask area of the pixel point according to the mask size;
and determining the pixel value of the pixel point in the gray level adjustment image according to the maximum gray level difference value between the neighborhood pixel points in the mask region.
3. The method of claim 2, wherein determining the mask size comprises:
estimating a defect area of the original gray image according to the pixel value of each pixel point in the original gray image;
and determining the mask size according to the defect area.
4. The method according to claim 1, wherein before adjusting the gray value of each pixel point in the original gray image according to the gray value of a neighboring pixel point of the pixel point to obtain a gray-adjusted image, the method further comprises:
and performing reduction processing on the original gray image to update the original gray image.
5. The method of claim 4, wherein the reducing the original grayscale image to update the original grayscale image comprises:
and based on the set reduction coefficient, carrying out reduction processing on the original gray image by adopting a bilinear interpolation algorithm so as to update the original gray image.
6. The method of claim 5, wherein the set reduction factor is determined according to the following:
determining the average pixel number of brightness noise points in the original gray level image according to the original gray level image;
determining the inverse of the average number of pixels as the reduction coefficient.
7. The method according to claim 5, wherein determining the defect detection result of the object to be detected according to the threshold segmentation result comprises:
determining the central coordinate and the area size of a defect reference area in a threshold segmentation result;
and determining the real area where the defect of the object to be detected is located according to the set reduction coefficient, the central coordinate and the area size.
8. A defect detection apparatus, comprising:
the gray level image acquisition module is used for acquiring an original gray level image of the surface of the object to be detected;
the gray level adjusting module is used for adjusting the gray level value of each pixel point in the original gray level image according to the gray level value of the neighborhood pixel point of the pixel point to obtain a gray level adjusting image;
and the detection result determining module is used for performing threshold segmentation on the gray level adjustment image and determining the defect detection result of the object to be detected according to the threshold segmentation result.
9. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a defect detection method as claimed in any one of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out a method for defect detection as claimed in any one of claims 1 to 7.
CN202111518451.0A 2021-12-10 2021-12-10 Defect detection method, device, equipment and storage medium Pending CN114235758A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111518451.0A CN114235758A (en) 2021-12-10 2021-12-10 Defect detection method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111518451.0A CN114235758A (en) 2021-12-10 2021-12-10 Defect detection method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114235758A true CN114235758A (en) 2022-03-25

Family

ID=80755192

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111518451.0A Pending CN114235758A (en) 2021-12-10 2021-12-10 Defect detection method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114235758A (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114972348A (en) * 2022-08-01 2022-08-30 山东尚雅建材有限公司 Seam beautifying effect detection method based on image processing
CN115274486A (en) * 2022-09-27 2022-11-01 南通睿禧智能科技有限公司 Semiconductor surface defect identification method
CN115314634A (en) * 2022-06-28 2022-11-08 上海艾为电子技术股份有限公司 Anti-shake detection method and device, terminal equipment and readable storage medium
CN115661054A (en) * 2022-10-14 2023-01-31 蓝思系统集成有限公司 Method and device for detecting seal, electronic device and storage medium
CN115984863A (en) * 2023-03-17 2023-04-18 中化现代农业有限公司 Image processing method, device, equipment and storage medium
CN116012330A (en) * 2022-12-28 2023-04-25 广州市易鸿智能装备有限公司 Pole piece defect detection method, device, equipment and computer storage medium
CN116823924A (en) * 2023-08-24 2023-09-29 杭州百子尖科技股份有限公司 Determination method and device for defect area, electronic equipment and storage medium
CN116843678A (en) * 2023-08-28 2023-10-03 青岛冠宝林活性炭有限公司 Hard carbon electrode production quality detection method
CN116973311A (en) * 2023-09-22 2023-10-31 成都中嘉微视科技有限公司 Detection device and detection method for foreign matters on film and under film
CN117636077A (en) * 2024-01-25 2024-03-01 高视科技(苏州)股份有限公司 Defect detection parameter adjustment method, electronic device and storage medium
CN117690142A (en) * 2024-02-01 2024-03-12 深圳中科精工科技有限公司 Wafer character preprocessing method, device and storage medium
CN118096732A (en) * 2024-04-22 2024-05-28 高视科技(苏州)股份有限公司 Display screen light leakage detection method, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090208050A1 (en) * 2008-02-19 2009-08-20 Keyence Corporation Defect Detection Apparatus, Defect Detection Method and Computer Program
JP2013149055A (en) * 2012-01-19 2013-08-01 Panasonic Corp Image processing device and document reading system including the same
CN103440654A (en) * 2013-08-27 2013-12-11 南京大学 LCD foreign body defect detection method
CN104364636A (en) * 2012-06-22 2015-02-18 霍夫曼-拉罗奇有限公司 Visually inspecting optical fibers
CN108230321A (en) * 2018-01-19 2018-06-29 深圳市亿图视觉自动化技术有限公司 Defect inspection method and device
CN109166109A (en) * 2018-08-14 2019-01-08 珠海格力智能装备有限公司 Defect inspection method, device, storage medium and processor
US20200412940A1 (en) * 2019-06-28 2020-12-31 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Method and device for image processing, method for training object detection model

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090208050A1 (en) * 2008-02-19 2009-08-20 Keyence Corporation Defect Detection Apparatus, Defect Detection Method and Computer Program
JP2013149055A (en) * 2012-01-19 2013-08-01 Panasonic Corp Image processing device and document reading system including the same
CN104364636A (en) * 2012-06-22 2015-02-18 霍夫曼-拉罗奇有限公司 Visually inspecting optical fibers
CN103440654A (en) * 2013-08-27 2013-12-11 南京大学 LCD foreign body defect detection method
CN108230321A (en) * 2018-01-19 2018-06-29 深圳市亿图视觉自动化技术有限公司 Defect inspection method and device
CN109166109A (en) * 2018-08-14 2019-01-08 珠海格力智能装备有限公司 Defect inspection method, device, storage medium and processor
US20200412940A1 (en) * 2019-06-28 2020-12-31 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Method and device for image processing, method for training object detection model

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
杨丹丹;王卫星;廖一鹏;: "基于多尺度分析及图论归一化割的矿岩颗粒图像分割及应用", 四川大学学报(工程科学版) *

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115314634A (en) * 2022-06-28 2022-11-08 上海艾为电子技术股份有限公司 Anti-shake detection method and device, terminal equipment and readable storage medium
CN115314634B (en) * 2022-06-28 2024-05-31 上海艾为电子技术股份有限公司 Anti-shake detection method, device, terminal equipment and readable storage medium
CN114972348A (en) * 2022-08-01 2022-08-30 山东尚雅建材有限公司 Seam beautifying effect detection method based on image processing
CN114972348B (en) * 2022-08-01 2022-09-30 山东尚雅建材有限公司 Seam beautifying effect detection method based on image processing
CN115274486A (en) * 2022-09-27 2022-11-01 南通睿禧智能科技有限公司 Semiconductor surface defect identification method
CN115661054A (en) * 2022-10-14 2023-01-31 蓝思系统集成有限公司 Method and device for detecting seal, electronic device and storage medium
CN115661054B (en) * 2022-10-14 2024-05-31 蓝思系统集成有限公司 Seal detection method and device, electronic equipment and storage medium
CN116012330A (en) * 2022-12-28 2023-04-25 广州市易鸿智能装备有限公司 Pole piece defect detection method, device, equipment and computer storage medium
CN116012330B (en) * 2022-12-28 2023-10-20 广州市易鸿智能装备有限公司 Pole piece defect detection method, device, equipment and computer storage medium
CN115984863A (en) * 2023-03-17 2023-04-18 中化现代农业有限公司 Image processing method, device, equipment and storage medium
CN116823924A (en) * 2023-08-24 2023-09-29 杭州百子尖科技股份有限公司 Determination method and device for defect area, electronic equipment and storage medium
CN116823924B (en) * 2023-08-24 2023-12-12 杭州百子尖科技股份有限公司 Determination method and device for defect area, electronic equipment and storage medium
CN116843678A (en) * 2023-08-28 2023-10-03 青岛冠宝林活性炭有限公司 Hard carbon electrode production quality detection method
CN116843678B (en) * 2023-08-28 2023-11-21 青岛冠宝林活性炭有限公司 Hard carbon electrode production quality detection method
CN116973311A (en) * 2023-09-22 2023-10-31 成都中嘉微视科技有限公司 Detection device and detection method for foreign matters on film and under film
CN116973311B (en) * 2023-09-22 2023-12-12 成都中嘉微视科技有限公司 Detection device and detection method for foreign matters on film and under film
CN117636077B (en) * 2024-01-25 2024-04-02 高视科技(苏州)股份有限公司 Defect detection parameter adjustment method, electronic device and storage medium
CN117636077A (en) * 2024-01-25 2024-03-01 高视科技(苏州)股份有限公司 Defect detection parameter adjustment method, electronic device and storage medium
CN117690142A (en) * 2024-02-01 2024-03-12 深圳中科精工科技有限公司 Wafer character preprocessing method, device and storage medium
CN117690142B (en) * 2024-02-01 2024-05-28 深圳中科精工科技有限公司 Wafer character preprocessing method, device and storage medium
CN118096732A (en) * 2024-04-22 2024-05-28 高视科技(苏州)股份有限公司 Display screen light leakage detection method, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN114235758A (en) Defect detection method, device, equipment and storage medium
US8345063B2 (en) Filtering method and apparatus for anti-aliasing
CN113781406B (en) Scratch detection method and device for electronic component and computer equipment
CN110969046B (en) Face recognition method, face recognition device and computer-readable storage medium
CN111539238B (en) Two-dimensional code image restoration method and device, computer equipment and storage medium
CN115294099B (en) Method and system for detecting hairline defect in steel plate rolling process
CN113592776A (en) Image processing method and device, electronic device and storage medium
CN111369570B (en) Multi-target detection tracking method for video image
CN112037287A (en) Camera calibration method, electronic device and storage medium
CN112464829B (en) Pupil positioning method, pupil positioning equipment, storage medium and sight tracking system
CN114298985B (en) Defect detection method, device, equipment and storage medium
CN112200826A (en) Industrial weak defect segmentation method
CN116883408A (en) Integrating instrument shell defect detection method based on artificial intelligence
CN111898610A (en) Card unfilled corner detection method and device, computer equipment and storage medium
CN110751156A (en) Method, system, device and medium for table line bulk interference removal
CN113591507A (en) Robust two-dimensional code DataMatrix positioning method and system
CN111524152B (en) Depth estimation-based method and system for improving calculation efficiency of underwater image restoration
CN114998186A (en) Image processing-based method and system for detecting surface scab defect of copper starting sheet
CN111160358B (en) Image binarization method, device, equipment and medium
CN113947588A (en) Coal rock identification method and device and storage medium
CN112330553B (en) Crack image denoising method, device and storage medium
US20240020846A1 (en) Corner point detection method and apparatus
CN109271986B (en) Digital identification method based on Second-Confirm
CN118096698A (en) Visual detection method and device, electronic equipment and storage medium
CN117764913A (en) Image detection method, device, electronic equipment and storage medium

Legal Events

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