CN114782451A - Workpiece defect detection method and device, electronic equipment and readable storage medium - Google Patents
Workpiece defect detection method and device, electronic equipment and readable storage medium Download PDFInfo
- Publication number
- CN114782451A CN114782451A CN202210715388.8A CN202210715388A CN114782451A CN 114782451 A CN114782451 A CN 114782451A CN 202210715388 A CN202210715388 A CN 202210715388A CN 114782451 A CN114782451 A CN 114782451A
- Authority
- CN
- China
- Prior art keywords
- workpiece
- polarization
- information
- light intensity
- defect detection
- 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
Links
- 230000007547 defect Effects 0.000 title claims abstract description 153
- 238000001514 detection method Methods 0.000 title claims abstract description 146
- 238000003860 storage Methods 0.000 title claims abstract description 24
- 230000010287 polarization Effects 0.000 claims abstract description 336
- 238000006116 polymerization reaction Methods 0.000 claims abstract description 8
- 239000000463 material Substances 0.000 claims description 59
- 238000000034 method Methods 0.000 claims description 41
- 238000001914 filtration Methods 0.000 claims description 14
- 238000012545 processing Methods 0.000 claims description 10
- 230000001629 suppression Effects 0.000 claims description 10
- 230000035945 sensitivity Effects 0.000 claims description 8
- 230000002776 aggregation Effects 0.000 claims description 5
- 238000004220 aggregation Methods 0.000 claims description 5
- 230000000379 polymerizing effect Effects 0.000 claims description 5
- 230000009467 reduction Effects 0.000 claims description 5
- 239000011159 matrix material Substances 0.000 description 15
- 238000004590 computer program Methods 0.000 description 13
- 230000006870 function Effects 0.000 description 13
- 230000014509 gene expression Effects 0.000 description 12
- 238000012549 training Methods 0.000 description 11
- 230000009286 beneficial effect Effects 0.000 description 7
- 238000010586 diagram Methods 0.000 description 7
- 230000008569 process Effects 0.000 description 7
- 239000013598 vector Substances 0.000 description 7
- 230000005540 biological transmission Effects 0.000 description 6
- 230000008859 change Effects 0.000 description 6
- 230000003287 optical effect Effects 0.000 description 5
- 239000000110 cooling liquid Substances 0.000 description 4
- 239000007788 liquid Substances 0.000 description 4
- 238000005259 measurement Methods 0.000 description 4
- 239000010705 motor oil Substances 0.000 description 4
- 238000004422 calculation algorithm Methods 0.000 description 3
- 238000004891 communication Methods 0.000 description 3
- 238000003708 edge detection Methods 0.000 description 3
- 238000003754 machining Methods 0.000 description 3
- 230000004931 aggregating effect Effects 0.000 description 2
- 230000003749 cleanliness Effects 0.000 description 2
- 238000009795 derivation Methods 0.000 description 2
- 238000011156 evaluation Methods 0.000 description 2
- 238000003384 imaging method Methods 0.000 description 2
- 238000013507 mapping Methods 0.000 description 2
- 238000000513 principal component analysis Methods 0.000 description 2
- 238000007790 scraping Methods 0.000 description 2
- 241000699670 Mus sp. Species 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000011478 gradient descent method Methods 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01N—INVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
- G01N21/00—Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
- G01N21/17—Systems in which incident light is modified in accordance with the properties of the material investigated
- G01N21/21—Polarisation-affecting properties
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01N—INVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
- G01N21/00—Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
- G01N21/84—Systems specially adapted for particular applications
- G01N21/88—Investigating the presence of flaws or contamination
- G01N21/8851—Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01N—INVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
- G01N21/00—Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
- G01N21/84—Systems specially adapted for particular applications
- G01N21/88—Investigating the presence of flaws or contamination
- G01N21/8851—Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
- G01N2021/8887—Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges based on image processing techniques
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Biochemistry (AREA)
- Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Chemical & Material Sciences (AREA)
- Analytical Chemistry (AREA)
- General Health & Medical Sciences (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Immunology (AREA)
- Pathology (AREA)
- Signal Processing (AREA)
- Quality & Reliability (AREA)
- Theoretical Computer Science (AREA)
- Image Analysis (AREA)
Abstract
The application discloses a workpiece defect detection method, a device, an electronic device and a readable storage medium, wherein the workpiece defect detection method comprises the following steps: acquiring polarized light intensity information of a workpiece to be detected, and determining total light intensity information, corresponding polarization degree information and corresponding polarization angle information corresponding to the workpiece to be detected according to the polarized light intensity information; carrying out weighting polymerization on the total light intensity information, the polarization degree information and the polarization angle information to obtain a polarization characteristic image of the workpiece; carrying out workpiece edge contour detection on the workpiece polarization characteristic image to obtain edge contour characteristic information; and carrying out workpiece defect detection on the workpiece to be detected according to the edge profile characteristic information to obtain a workpiece defect detection result. The technical problem that the workpiece defect detection accuracy is low is solved.
Description
Technical Field
The present disclosure relates to the field of industrial inspection, and in particular, to a method and an apparatus for detecting defects of a workpiece, an electronic device and a readable storage medium.
Background
With the continuous development of industrial detection, the application of workpiece defect detection technology is more and more extensive, various defects are generated due to collision and scraping, the process and other reasons when a mechanical workpiece is processed, and the defects of the workpiece can influence the use of some precision machines, so that the defects of the workpiece need to be detected. At present, the method for detecting the defects in the factory is mainly photoelectric non-contact detection, for example, an industrial camera and an intelligent algorithm are adopted to cooperate to identify the defects of the workpiece, but the cleanliness of the factory is low, and the workpiece is polluted by liquids such as processing cooling liquid and engine oil, so that stains and defects on the surface of the workpiece cannot be distinguished in the image, and the detection accuracy of the defects of the workpiece is low.
Disclosure of Invention
The present application mainly aims to provide a method, an apparatus, an electronic device and a readable storage medium for detecting a workpiece defect, and aims to solve the technical problem of low accuracy of detecting a workpiece defect.
In order to achieve the above object, the present application provides a workpiece defect detecting method, including:
acquiring polarized light intensity information of a workpiece to be detected, and determining total light intensity information, corresponding polarization degree information and corresponding polarization angle information corresponding to the workpiece to be detected according to the polarized light intensity information;
carrying out weighting polymerization on the total light intensity information, the polarization degree information and the polarization angle information to obtain a workpiece polarization characteristic image;
performing workpiece edge contour detection on the workpiece polarization characteristic image to obtain edge contour characteristic information;
and carrying out workpiece defect detection on the workpiece to be detected according to the edge profile characteristic information to obtain a workpiece defect detection result.
The present application further provides a workpiece defect detecting device, workpiece defect detecting device is applied to workpiece defect detecting equipment, workpiece defect detecting device includes:
the light intensity acquisition module is used for acquiring polarized light intensity information of the workpiece to be detected, and determining total light intensity information, corresponding polarization degree information and corresponding polarization angle information corresponding to the workpiece to be detected according to the polarized light intensity information;
the weighting and polymerizing module is used for weighting and polymerizing the total light intensity information, the polarization degree information and the polarization angle information to obtain a polarization characteristic image of the workpiece;
the contour detection module is used for carrying out contour detection on a characteristic image matrix in the polarization image information of the workpiece to be detected to obtain edge contour characteristic information;
and the defect detection module is used for detecting the defects of the workpiece to be detected according to the edge profile characteristic information to obtain a workpiece defect detection result.
The present application further provides an electronic device, which is an entity device, the electronic device including: a memory, a processor and a program of the workpiece defect detection method stored on the memory and executable on the processor, the program of the workpiece defect detection method being executable by the processor to implement the steps of the workpiece defect detection method as described above.
The present application also provides a computer-readable storage medium having stored thereon a program for implementing a method of workpiece defect detection, which program, when executed by a processor, implements the steps of the method of workpiece defect detection as described above.
The present application also provides a computer program product comprising a computer program which, when executed by a processor, performs the steps of the workpiece defect detection method as described above.
The application provides a workpiece defect detection method, a device, an electronic device and a readable storage medium, firstly obtaining polarization light intensity information of a workpiece to be detected, determining total light intensity information, corresponding polarization degree information and corresponding polarization angle information corresponding to the workpiece to be detected according to the polarization light intensity information, and then conducting weighting polymerization on the total light intensity information, the polarization degree information and the polarization angle information to obtain a workpiece polarization characteristic image, wherein the total light intensity information, the polarization degree information and the polarization angle information are optical polarization information and are not interfered by stains on the surface of the workpiece, so that the workpiece polarization characteristic image can reflect real surface profile information which is not interfered by the stains on the surface of the workpiece, thereby carrying out workpiece edge profile detection on the workpiece polarization characteristic image according to the workpiece polarization characteristic image, the method comprises the steps of obtaining edge profile characteristic information, carrying out workpiece defect detection on the workpiece to be detected according to the edge profile characteristic information to obtain a workpiece defect detection result, and achieving the purpose of carrying out workpiece defect detection according to real surface profile information which is not interfered by stains on the surface of the workpiece, so that the technical defect that the stains and defects on the surface of the workpiece are not distinguished in an image and the workpiece defect detection accuracy is low due to the fact that the workpiece is polluted by machining liquid such as cooling liquid and engine oil is overcome, and the accuracy of workpiece defect detection is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and, together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings without inventive labor.
FIG. 1 is a schematic flow chart of a first embodiment of a method for detecting defects in a workpiece according to the present application;
FIG. 2 is a schematic diagram of a partial derivative operator in step S30 according to a first embodiment of the present invention;
fig. 3 is a schematic structural diagram of a hardware operating environment related to a workpiece defect detection method in an embodiment of the present application.
The objectives, features, and advantages of the present application will be further described with reference to the accompanying drawings.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be obtained by a person skilled in the art without inventive step based on the embodiments of the present invention, are within the scope of protection of the present invention.
Example one
When a mechanical workpiece is machined, various defects are generated due to collision, scraping, a process and the like, and the defects of the workpiece influence the use of some precision machines, so that the workpiece needs to be detected. At present, when workpiece defects are detected, an industrial camera and an intelligent algorithm are mainly adopted to be matched with each other to identify the workpiece defects, but due to the fact that the cleanliness of a factory is low, machining liquid such as cooling liquid and engine oil can pollute the workpiece, stains and defects on the surface of the workpiece cannot be distinguished in an image, and the workpiece defect detection accuracy is low.
In a first embodiment of the workpiece defect detection method of the present application, referring to fig. 1, the workpiece defect detection method includes:
step S10, obtaining polarized light intensity information of the workpiece to be measured, and determining total light intensity information, corresponding polarization degree information and corresponding polarization angle information corresponding to the workpiece to be measured according to the polarized light intensity information;
in this embodiment, it should be noted that the polarized light intensity information at least includes one of light intensity components in horizontal, oblique and vertical directions, and the method for determining the total light intensity information, the polarization degree information and the polarization angle information may be calculated by a stokes parameter expression and a definition expression corresponding to the polarization degree and the polarization angle, where the total light intensity information includes the total light intensity of the workpiece, the polarization degree information includes the polarization degree of the workpiece, and the polarization angle information includes the polarization angle of the workpiece.
As an example, step S10 includes: acquiring light intensity in a horizontal polarization direction, light intensity in an inclined polarization direction and light intensity in a vertical polarization direction by a polarization imaging system; calculating to obtain the total light intensity of the workpiece, the light intensity component in the horizontal polarization direction and the light intensity component in the inclined linear polarization direction according to a Stokes parameter expression, the light intensity in the horizontal polarization direction, the light intensity in the inclined polarization direction and the light intensity in the vertical polarization direction; and calculating the polarization degree and the polarization angle of the workpiece according to the total light intensity of the workpiece, the light intensity component in the horizontal line polarization direction and the light intensity component in the inclined line polarization direction.
In this embodiment, it should be noted that the horizontal polarization direction light intensity component, the oblique polarization direction light intensity component, and the vertical polarization direction light intensity component are light intensity vectors of the linear polarization directions, the horizontal polarization direction light intensity component is a light intensity vector in which a vibration plane of light is limited to the horizontal direction, the oblique polarization direction light intensity component is a light intensity vector in which a vibration plane of light is limited to the oblique direction, and the vertical polarization direction light intensity component is a light intensity vector in which a vibration plane of light is limited to the vertical direction.
Wherein, according to the polarized light intensity information, the step of confirming total light intensity information, the corresponding polarization degree information and the corresponding polarization angle information that the work piece that awaits measuring corresponds includes:
step S11, determining total light intensity information, a light intensity component in a horizontal line polarization direction and a light intensity component in an inclined line polarization direction corresponding to the workpiece to be detected according to the light intensity of each preset polarization direction;
step S12, determining the polarization degree information and the polarization angle information according to the horizontal line polarization direction light intensity component and the oblique line polarization direction light intensity component.
In this embodiment, as an example, the preset polarization direction may be one or more of horizontal, oblique, reverse oblique, and vertical directions, and the light intensity of each preset polarization direction is the transmission light intensity of the transmission axis of the polarizer of each preset polarization direction.
As one example, steps S11 to S12 include: calculating the sum of the light intensity in the horizontal polarization direction and the light intensity in the vertical polarization direction in the light intensity components to obtain the total light intensity of the workpiece; calculating the difference between the light intensity in the horizontal polarization direction and the light intensity in the vertical polarization direction in the light intensity components to obtain the light intensity components in the horizontal polarization direction;Through simplification of an expression of the light intensity component in the oblique linear polarization direction, the light intensity evaluation according to the oblique polarization direction, the horizontal direction polarization light intensity and the vertical polarization direction in the light intensity component can be converted into an evaluation according to the oblique polarization direction light intensity and the reverse oblique polarization direction light intensity, and the difference between the oblique polarization direction light intensity and the reverse oblique polarization direction light intensity is calculated to obtain the light intensity component in the oblique linear polarization direction; according to the light intensity component of the horizontal line polarization direction、Calculating the polarization degree of the workpiece according to the light intensity component in the inclined linear polarization direction and the total light intensity of the workpiece; and calculating to obtain the polarization angle of the workpiece according to the light intensity component in the horizontal line polarization direction and the light intensity component in the inclined line polarization direction.
In this embodiment, it should be noted that the horizontal polarization direction may be a 0 ° polarization direction, the vertical polarization direction may be a 90 ° polarization direction, the oblique polarization direction may be a 45 ° polarization direction, and the anti-oblique polarization direction may be a-45 ° polarization direction.
As an example, the light intensity component according to the horizontal line polarization direction、The step of calculating the degree of polarization of the workpiece by the light intensity component in the oblique linear polarization direction and the total light intensity of the workpiece comprises the following steps: and calculating the square sum of the light intensity component in the horizontal line polarization direction and the light intensity component in the inclined line polarization direction, calculating the arithmetic square root of the square sum, and calculating the ratio of the arithmetic square root to the total light intensity to obtain the polarization degree of the workpiece.
As an example, the step of calculating the polarization angle of the workpiece according to the horizontal line polarization direction light intensity component and the oblique line polarization direction light intensity component includes: and calculating the ratio of the light intensity component in the inclined linear polarization direction to the light intensity component in the horizontal linear polarization direction, taking the arc tangent function value of the ratio, and calculating half of the arc tangent function value to obtain the polarization angle of the workpiece.
As an example, the expressions relating the total light intensity, the horizontally linearly polarized light intensity component, and the obliquely linearly polarized light intensity component are calculated as follows:
wherein,Ias a result of the total light intensity,Qthe light intensity component being the horizontally polarized direction,Ufor the light intensity component of the oblique linear polarization direction,the transmission axis of the polarizer in the horizontal direction transmits light intensity,the transmission axis of the polarizer in the oblique direction transmits the light intensity,the transmission light intensity of the transmission axis of the polaroid in the vertical direction can be written as follows by simplifying the following formula:
as an example, the polarization degree and the polarization angle correlation expression are calculated as follows:
Step S20, carrying out weighting aggregation on the total light intensity information, the polarization degree information and the polarization angle information to obtain a workpiece polarization characteristic image;
in this embodiment, it should be noted that the workpiece polarization feature image is a pseudo-color image used for characterizing surface feature information of the workpiece to be measured.
As an example, step S20 includes: and weighting and polymerizing the total light intensity of the workpiece, the polarization degree of the workpiece and the polarization angle of the workpiece by corresponding weights respectively to obtain information contained in the polarization characteristic image of the workpiece.
The step of performing weighting aggregation on the total light intensity information, the polarization degree information and the polarization angle information to obtain a polarization characteristic image of the workpiece comprises;
step S21, obtaining a weight coefficient, wherein the weight coefficient is determined according to the material type of the workpiece to be measured;
and step S22, carrying out weighting polymerization on the total light intensity information, the polarization degree information and the polarization angle information according to the weight coefficient to obtain a polarization characteristic image of the workpiece.
As one example, steps S21 to S22 include: determining a weight coefficient according to the material type of the workpiece to be detected, wherein the weight coefficient comprises weight coefficients respectively corresponding to the total light intensity of the workpiece, the polarization degree of the workpiece and the polarization angle of the workpiece, taking the product of the total light intensity of the workpiece, the polarization degree of the workpiece and the polarization angle of the workpiece and the corresponding weight coefficient as elements of the characteristic image matrix to form a workpiece polarization characteristic image matrix, and obtaining the workpiece polarization characteristic image according to the workpiece polarization characteristic image matrix.
As an example, the expression for the workpiece polarization feature image matrix is calculated as follows:
wherein,is a matrix corresponding to the polarization characteristic image of the workpiece,respectively the total light intensityDegree of polarization of the workpieceAnd the polarization angle of the workpieceIs a dot-by-symbol.
Before the step of performing weighting aggregation on the total light intensity information, the polarization degree information and the polarization angle information to obtain a workpiece polarization characteristic image, the method further comprises the following steps of:
step A10, obtaining material polarization light intensity information corresponding to a target measuring body, and determining total material light intensity information, material polarization degree information and material polarization angle information according to the material polarization light intensity information, wherein the target measuring body and the workpiece to be measured belong to the same material type;
step A20, analyzing the sensitivity of the total light intensity information of the material, the polarization degree information of the material and the polarization angle information of the material to the surface characteristics of the target measuring body respectively;
step A30, determining the weight coefficients corresponding to the total light intensity information of the material, the polarization degree information of the material and the polarization angle information of the material according to the sensitivities.
In this embodiment, it should be noted that the target measurement body may be a planar plate, or may be a workpiece having a certain shape and profile, the sensitivity is a change sensitivity of a change of characteristics such as a material, a texture, a deformation, and a flatness of the surface of the target measurement body to the total light intensity information of the material, the polarization degree information of the material, and the polarization angle information of the material, and the total light intensity information of the material, the polarization degree information of the material, and the polarization angle information of the material are used to characterize the surface characteristics of the target measurement body.
As an example, the steps a10 to a30 include: acquiring polarized light intensity information corresponding to the target measurement body through a polarization imaging system, and determining corresponding material total light intensity information, material polarization degree information and material polarization angle information, wherein the specific steps are similar to those in step S10, and are not repeated herein; and acquiring material polarization light intensity information corresponding to at least one measuring body which is made of the same material as the target measuring body and has different surface characteristics, and determining corresponding reference total light intensity information, reference polarization degree information and reference polarization angle information. Calculating the change amplitudes of the reference total light intensity information, the reference polarization degree information and the reference polarization angle information relative to the corresponding material total light intensity information, the material polarization degree information and the material polarization angle information, obtaining a change proportion according to the calculated ratio of each change amplitude to the corresponding material total light intensity information, the material polarization degree information and the material polarization angle information, and calculating the ratio of the material total light intensity information, the material polarization degree information and the change proportion corresponding to the material polarization angle information to obtain each weight coefficient, wherein the sum of the weight coefficients is 1.
Step S30, carrying out workpiece edge contour detection on the workpiece polarization characteristic image to obtain edge contour characteristic information;
in this embodiment, it should be noted that a canny edge detection algorithm may be specifically used for the method for detecting the profile of the polarization feature image of the workpiece, and the edge profile feature information may be a gray image with edge enhancement completed.
As an example, step S30 includes: graying the polarization characteristic image of the workpiece to obtain a first polarization comprehensive image, and filtering the first polarization comprehensive image to obtain a second polarization comprehensive image; extracting the gradient amplitude and the direction of each pixel point in the second polarization comprehensive image to obtain the gradient value and the direction of each pixel point; according to image gradient information corresponding to the second polarization comprehensive image, carrying out non-maximum suppression on the second polarization comprehensive image so as to eliminate stray response caused by edge detection and obtain a third polarization comprehensive image; and carrying out double-threshold detection on the third polarization comprehensive image, and completing edge fitting in the third polarization comprehensive image to obtain the edge contour characteristic information so as to complete the edge enhancement of the polarization comprehensive image.
The step of detecting the edge profile of the workpiece to obtain the edge profile characteristic information of the polarization characteristic image of the workpiece comprises:
step S31, carrying out gray processing on the polarization characteristic image of the workpiece to obtain a first polarization comprehensive image;
step S32, filtering the first polarization comprehensive image to obtain a second polarization comprehensive image;
step S33, according to the image gradient information corresponding to the second polarization comprehensive image, carrying out non-maximum suppression on the second polarization comprehensive image to obtain a third polarization comprehensive image;
step S34, carrying out double-threshold detection on the third polarization comprehensive image to obtain a double-threshold detection result;
and step S35, fitting the edge profile of the workpiece to be detected in the third polarization comprehensive image according to the double-threshold detection result to obtain the edge profile characteristic information.
In this embodiment, it should be noted that the graying processing is to convert a pseudo color image formed by multiple color pixels into a grayscale image in which each pixel has only one value for representing color depth, the filtering may use a gaussian filter to smooth the image and filter noise, the gradient amplitude of the pixel refers to the color depth difference between each pixel and its neighboring pixels in each direction, the non-maximum suppression refers to finding the local maximum of the pixel, that is, eliminating the non-maximum, and is used to eliminate the non-filterable noise caused by edge detection, and the dual-threshold detection result refers to a determined high threshold and a determined low threshold.
As one example, steps S31 to S34 include: obtaining a gray value corresponding to each pixel point in the characteristic image matrix pseudo-color image according to the mapping relation between each pixel point and each parameter in the workpiece polarization characteristic image so as to convert the workpiece polarization characteristic image into the first polarization comprehensive image, wherein the first polarization comprehensive image is a gray image; filtering the first polarization comprehensive image through a Gaussian filter to finish filtering and denoising to obtain a Gaussian filtering result, and obtaining the second polarization comprehensive image according to the Gaussian filtering result; according to the gradient amplitude and the direction of each pixel point, carrying out maximum suppression on the second polarization comprehensive image to obtain a third polarization comprehensive image; and carrying out double-threshold detection on the third polarization comprehensive image, selecting a gradient amplitude from the gradient amplitudes of all the pixel points as a high threshold value, obtaining a preset proportion, and obtaining a low threshold value according to the preset proportion and the high threshold value.
As an example, the step of obtaining a gray value corresponding to each pixel point in the pseudo-color image of the feature image matrix according to the mapping relationship between each pixel point and each parameter in the polarization feature image of the workpiece includes: and respectively substituting the total light intensity of the workpiece, the polarization degree of the workpiece and the polarization angle of the workpiece with the integrals of the corresponding weight coefficients into a graying formula to obtain the gray value of each pixel point, thereby obtaining the first polarization comprehensive image.
As an example, each of the pixel points may beWherein ". mark" is a dot-by-dot symbol, and the expression for calculating the gray value of each pixel point is as follows:
whereinIs a gray value ofThree channels, respectively, of a color imageRespectively substituted into said graying formulaeAnd calculating to obtain the gray value of each pixel point in the first polarization comprehensive image.
As an example, the step of filtering the first polarization integrated image through a gaussian filter to perform filtering and denoising to obtain a gaussian filtering result includes selecting a rectangular region, which is a3 × 3 pixel point map in this embodiment, calculating a square value of a difference between a horizontal ordinate and a vertical coordinate of each pixel point and a horizontal ordinate of the origin point with a central point of the pixel point map as an origin, calculating a squared double value of a variance of the horizontal ordinate and the vertical coordinate of each pixel point, calculating a ratio of the square value corresponding to the horizontal ordinate and the vertical coordinate of each pixel point to a corresponding double value to obtain a sum of ratios corresponding to the horizontal ordinate and the vertical coordinate of each pixel point, taking an opposite number of the sum of ratios, obtaining weight values of each pixel point by using the opposite number as an index of a natural constant, calculating a product of the weight values of the pixel points and gray values of the pixel points, and obtaining the Gaussian filtering result, and further obtaining the second polarization comprehensive image according to the Gaussian filtering result.
As an example, the two-dimensional gaussian function is expressed as follows:
wherein,the gray-scale values of the pixels are obtained,is an exponential function with a natural constant e as a base number,is the coordinate of the origin point, and the coordinate of the origin point,andthe variance of the pixel point is taken as the variance,are pixel point coordinates.
As an example, the step of performing maximum suppression on the second polarization integrated image according to the gradient magnitude and direction of each pixel point to obtain the third polarization integrated image includes: extracting the gradient amplitude and direction of each pixel point in the second polarization integrated image, taking the second polarization integrated image as a two-dimensional discrete function in the process of solving the gradient amplitude of each pixel point, wherein the process of solving the gradient amplitude of the image is to solve the derivation of the two-dimensional discrete function to obtain a derivation result, calculating the inverse number of the difference between the gray value of the pixel point and the gray value of the next pixel point in the horizontal direction and the inverse number of the difference between the gray value of the pixel point and the gray value of the next pixel point in the vertical direction, solving the sum of the inverse number of the difference in the horizontal direction and the inverse number of the difference in the vertical direction to obtain the gradient amplitude of the image of each pixel point, and taking the arc tangent function value of the gradient amplitude of the image to obtain the direction of the gradient amplitude of the image of each pixel point; and according to the pixel point image gradient amplitude and the direction of the image gradient amplitude, carrying out maximum suppression on the second polarization comprehensive image to obtain a third polarization comprehensive image.
As an example, the expression for calculating the gradient magnitude of the grayscale image is as follows:
wherein,is the image gradient magnitude, i.e. the derivative of the two-dimensional discrete function,is the gray value of an image pixel,Is the coordinate of the pixel point and is,representing the coordinates of a pixel point asGray value of。
Dividing the normal direction of the image edge into current pixelsOf a neighbourhood windowDirection, 45-degree direction,The gradient direction of each pixel point belongs to one of four directions in the directions of direction and 135 degrees, the product of four-direction partial derivative operators and the gradient amplitude of the pixel point corresponding to each direction is calculated, first-order partial derivatives of the gradient amplitude of each pixel point in the four directions are obtained, the first-order partial derivative with the maximum absolute value is selected from the first-order partial derivatives of each pixel point in the four directions, the maximum gradient amplitude of each pixel point is obtained, the maximum gradient amplitude is used as the gradient amplitude of the pixel point, and the direction of the maximum gradient amplitude is taken as the gradient direction of the pixel point.
As an example, an expression of the first-order partial derivative of the gradient amplitude of the pixel point in each direction is calculated as follows:
the expression for calculating the maximum gradient amplitude of each pixel point is as follows:
the expression for calculating the gradient direction of each pixel point is as follows:
wherein,is a partial derivative operator in each direction, wherein "" is a dot-by-dot sign, and max is an absolute value of the gradient amplitude in each directionThe maximum value of (a) is,for the gradient amplitude of the pixel point, the partial derivative operator is selected as shown in FIG. 2, wherein (a) isOperator, (b) is a 45 DEG operator, and (c) isOperator, (d) is 135 ° operator.The direction corresponding to the max value. After the gradient direction of each pixel point is determined, the gradient amplitude is determinedComparing with the gradient amplitude of the adjacent pixel in the gradient direction, and if the gradient amplitude is not the local maximum value, comparing the gradient value of the current pixel pointSet to 0; and otherwise, the gradient value is reserved, and the second polarization comprehensive image after non-maximum suppression is a third polarization comprehensive image.
As an example, the step of performing dual-threshold detection on the third polarization integrated image, selecting a gradient amplitude as a high threshold, obtaining a preset proportion, and obtaining a low threshold according to the preset proportion and the high threshold includes: the second polarization synthetic image after non-maximum suppression is represented by a gradient amplitude histogram, wherein the histogram has a peak of gradient amplitude in a corresponding area near a zero point, and a series of peaks of gradient amplitude are formed on the right side of the zero point.
Selecting a gradient amplitude with the highest ratio from a series of gradient amplitudes on the right side of the zero point of the gradient amplitude histogram as a high threshold value to obtain a preset ratio, wherein the preset ratio can be 1/2, and calculating the product of the high threshold value and the preset ratio to obtain a low threshold value.
As an example, step S35 includes: and dividing each pixel point in the third polarization comprehensive image into a strong edge point and a weak edge point through the high threshold and the low threshold, and fitting the strong edge point and the weak edge point in the third polarization comprehensive image to enhance the edge of the third polarization comprehensive image, so as to obtain the edge contour feature information.
The step of performing double-threshold detection and fitting on the third polarization comprehensive image to obtain the edge profile feature information includes:
step S351, dividing each pixel point in the third polarization comprehensive image into a strong edge point and a weak edge point according to the double-threshold detection result;
step S352, the strong edge points and the continuous weak edge points are connected in the third polarization comprehensive image, and the edge profile of the workpiece to be detected is fitted in the third polarization comprehensive image, so that the edge profile characteristic information is obtained.
In this embodiment, it should be noted that the strong edge point is a point determined as an edge of the third polarization integrated image, the weak edge point is a point that may be an edge of the third polarization integrated image, and the edge profile feature information is used to characterize defect feature information of the workpiece to be measured.
As an example, step S351 to step S352 include: judging the magnitude relation between the gradient amplitude of each pixel point in the third polarization comprehensive image and the high threshold and the low threshold, and if the gradient amplitude of the pixel point is not smaller than the high threshold, marking the pixel point as a strong edge point; if the gradient amplitude of the pixel point is larger than the low threshold and smaller than the high threshold, marking the pixel point as a weak edge point; and connecting the strong edge points and the continuous weak edge points in the third polarization comprehensive image, and eliminating isolated weak edge points to fit the edge profile of the workpiece to be detected in the third polarization comprehensive image to obtain the edge profile characteristic information.
And step S40, performing workpiece defect detection on the workpiece to be detected according to the edge profile characteristic information to obtain a workpiece defect detection result.
In this embodiment, it should be noted that the workpiece defect detection may be implemented by a deep learning network, and the workpiece defect detection result is used to represent defect information of the workpiece to be detected.
As an example, step S40 includes: and performing feature dimension reduction on the edge profile feature information to obtain edge profile feature information in a one-dimensional vector format, and inputting the edge profile feature information in the one-dimensional vector format into a workpiece defect detection model to complete workpiece defect detection of the workpiece to be detected to obtain a workpiece defect detection result.
The step of detecting the workpiece defects of the workpiece to be detected according to the edge profile characteristic information to obtain a workpiece defect detection result comprises the following steps:
step S41, performing feature dimension reduction on the edge contour feature information to obtain an edge contour feature information sample;
and step S42, inputting the edge profile characteristic information sample into a workpiece defect detection model, and carrying out workpiece defect detection on the workpiece to be detected to obtain a workpiece defect detection result.
In this embodiment, it should be noted that the workpiece defect detection model may be a deep belief network model.
As one example, steps S41 to S42 include: performing Principal Component Analysis (PCA) dimension reduction processing on the edge contour feature information, specifically, the edge contour feature information includes an edge contour image matrix, and a covariance matrix corresponding to the edge contour image matrix is obtained; obtaining each eigenvector and each eigenvalue corresponding to the covariance matrix according to the covariance matrix; arranging the eigenvectors into a one-dimensional matrix from left to right according to the sizes of the corresponding eigenvalues to obtain edge contour characteristic information samples, wherein the edge contour characteristic information samples are used for representing edge contour characteristic information in a one-dimensional vector format; inputting the edge profile characteristic information sample into the deep belief network model, and completing workpiece defect detection on the workpiece to be detected to obtain a workpiece defect detection result.
Before the step of inputting the edge profile characteristic information sample into the workpiece defect detection model, performing workpiece defect detection on the workpiece to be detected to obtain a workpiece defect detection result, the method further comprises the following steps:
step B10, acquiring a defect detection model of the workpiece to be trained, and extracting training edge contour characteristic information corresponding to the training workpiece and a real defect label corresponding to the training workpiece;
and B20, performing iterative training optimization on the workpiece defect detection model to be trained based on the training edge contour characteristic information and the real defect label to obtain the workpiece defect detection model.
In this embodiment, it should be noted that the workpiece defect detection model to be trained is an untrained workpiece defect detection model, and the real defect label is information such as a defect type and a defect degree of a training workpiece.
As an example, step B10 through step B20 include: acquiring an untrained workpiece defect detection model, and extracting edge contour characteristic information corresponding to at least one training workpiece and a corresponding real defect label; inputting the edge contour characteristic information into a workpiece defect detection model to be trained, carrying out defect detection on the training workpiece to obtain a defect detection result, further calculating the model loss of the workpiece defect detection model to be trained based on the difference between the defect detection result and the real defect label, further judging whether the model loss is converged, if the model loss is converged, using the workpiece defect detection model to be trained as the workpiece defect detection model, and if the model loss is not converged, updating the workpiece defect detection model to be trained by a preset model updating method based on the gradient of the model loss calculation, and returning to the execution step: the method comprises the steps of extracting training edge contour characteristic information corresponding to a training workpiece and a real defect label corresponding to the training workpiece, wherein the preset model updating method comprises a gradient descent method, a gradient ascent method and the like, and further achieves the purpose of constructing a workpiece defect detection model based on the edge contour characteristic information, so that the workpiece defect detection model can accurately detect the workpiece defect based on the edge contour characteristic information, and the accuracy of workpiece defect detection is improved.
The embodiment of the application provides a workpiece defect detection method, a device, an electronic device and a readable storage medium, firstly obtaining polarization light intensity information of a workpiece to be detected, determining total light intensity information, corresponding polarization degree information and corresponding polarization angle information corresponding to the workpiece to be detected according to the polarization light intensity information, and then conducting weighting polymerization on the total light intensity information, the polarization degree information and the polarization angle information to obtain a workpiece polarization characteristic image, wherein the total light intensity information, the polarization degree information and the polarization angle information are optical polarization information and are not interfered by stains on the surface of the workpiece, so that the workpiece polarization characteristic image can reflect real surface profile information which is not interfered by the stains on the surface of the workpiece, and further, the workpiece edge profile detection is carried out on the workpiece polarization characteristic image according to the workpiece polarization characteristic image, the method comprises the steps of obtaining edge profile characteristic information, carrying out workpiece defect detection on the workpiece to be detected according to the edge profile characteristic information to obtain a workpiece defect detection result, and achieving the purpose of carrying out workpiece defect detection according to real surface profile information which is not interfered by stains on the surface of the workpiece, so that the technical defect that the stains and defects on the surface of the workpiece are not distinguished in an image due to the fact that the workpiece is polluted by machining liquid such as cooling liquid and engine oil is overcome, the workpiece defect detection accuracy is low, and the workpiece defect detection accuracy is improved.
Example two
The embodiment of this application still provides a work piece defect detection device, work piece defect detection device is applied to work piece defect detection equipment, work piece defect detection device includes:
the light intensity acquisition module is used for acquiring polarized light intensity information of the workpiece to be detected and determining total light intensity information, corresponding polarization degree information and corresponding polarization angle information corresponding to the workpiece to be detected according to the polarized light intensity information;
the weighting and aggregating module is used for weighting and aggregating the total light intensity information, the polarization degree information and the polarization angle information to obtain a workpiece polarization characteristic image;
the contour detection module is used for carrying out contour detection on a characteristic image matrix in the polarization image information of the workpiece to be detected to obtain edge contour characteristic information;
and the defect detection module is used for detecting the defects of the workpiece to be detected according to the edge profile characteristic information to obtain a workpiece defect detection result.
Optionally, the light intensity obtaining module is further configured to:
determining total light intensity information, a light intensity component in a horizontal line polarization direction and a light intensity component in an inclined line polarization direction corresponding to the workpiece to be detected according to the light intensity of each preset polarization direction;
and determining the polarization degree information and the polarization angle information of the workpiece according to the light intensity component in the horizontal line polarization direction and the light intensity component in the inclined line polarization direction.
Optionally, the light intensity obtaining module is further configured to:
obtaining a weight coefficient, wherein the weight coefficient is determined according to the material type of the workpiece to be measured;
and according to the weight coefficient, carrying out weighting polymerization on the total light intensity information, the polarization degree information and the polarization angle information to obtain a polarization characteristic image of the workpiece.
Optionally, the light intensity obtaining module is further configured to:
obtaining material polarization light intensity information corresponding to a target measuring body, and determining total material light intensity information, material polarization degree information and material polarization angle information according to the material polarization light intensity information, wherein the target measuring body and the workpiece to be measured belong to the same material type;
analyzing the sensitivity of the total material light intensity information, the polarization degree information and the polarization angle information of the material and the surface characteristics of the target measuring body respectively;
and determining weight coefficients corresponding to the total material light intensity information, the polarization degree information and the polarization angle information according to the sensitivities.
Optionally, the contour detection module is further configured to:
carrying out gray processing on the polarization characteristic image of the workpiece to obtain a first polarization comprehensive image;
filtering the first polarization comprehensive image to obtain a second polarization comprehensive image;
according to image gradient information corresponding to the second polarization comprehensive image, carrying out non-maximum suppression on the second polarization comprehensive image to obtain a third polarization comprehensive image;
carrying out double-threshold detection on the third polarization comprehensive image to obtain a double-threshold detection result;
and fitting the edge profile of the workpiece to be detected in the third polarization comprehensive image according to the double-threshold detection result to obtain the edge profile characteristic information.
Optionally, the contour detection module is further configured to;
dividing each pixel point in the third polarization comprehensive image into a strong edge point and a weak edge point according to the double-threshold detection result;
and fitting the edge profile of the workpiece to be detected in the third polarization comprehensive image by connecting the strong edge points and the continuous weak edge points in the third polarization comprehensive image to obtain the edge profile characteristic information.
Optionally, the defect detection module is further configured to:
performing feature dimension reduction on the edge profile feature information to obtain an edge profile feature information sample;
and inputting the edge profile characteristic information sample into a workpiece defect detection model, and performing workpiece defect detection on the workpiece to be detected to obtain a workpiece defect detection result.
The workpiece defect detection device provided by the invention adopts the workpiece defect detection method in the embodiment, and solves the technical problem of low workpiece defect detection accuracy. Compared with the prior art, the workpiece defect detection device provided by the embodiment of the invention has the same beneficial effects as the workpiece defect detection method provided by the embodiment, and other technical characteristics of the workpiece defect detection device are the same as those disclosed by the method of the previous embodiment, which are not repeated herein.
EXAMPLE III
An embodiment of the present invention provides an electronic device, including: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method for detecting defects in a workpiece according to the first embodiment.
Referring now to FIG. 3, shown is a block diagram of an electronic device suitable for use in implementing embodiments of the present disclosure. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., car navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 3 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 3, the electronic device may include a processing means (e.g., a central processing unit, a graphic processor, etc.) that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) or a program loaded from a storage means into a Random Access Memory (RAM). In the RAM, various programs and data necessary for the operation of the electronic apparatus are also stored. The processing device, the ROM, and the RAM are connected to each other through a bus. An input/output (I/O) interface is also connected to the bus.
Generally, the following systems may be connected to the I/O interface: input devices including, for example, touch screens, touch pads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, and the like; output devices including, for example, Liquid Crystal Displays (LCDs), speakers, vibrators, and the like; storage devices including, for example, magnetic tape, hard disk, and the like; and a communication device. The communication means may allow the electronic device to communicate wirelessly or by wire with other devices to exchange data. While the figures illustrate an electronic device with various systems, it is to be understood that not all illustrated systems are required to be implemented or provided. More or fewer systems may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means, or installed from a storage means, or installed from a ROM. The computer program, when executed by a processing device, performs the functions defined in the methods of the embodiments of the present disclosure.
By adopting the workpiece defect detection method in the embodiment, the electronic equipment provided by the invention solves the technical problem of low workpiece defect detection accuracy. Compared with the prior art, the beneficial effects of the electronic device provided by the embodiment of the invention are the same as the beneficial effects of the workpiece defect detection method provided by the first embodiment, and other technical features of the electronic device are the same as those disclosed in the method of the previous embodiment, which are not repeated herein.
It should be understood that portions of the present disclosure may be implemented in hardware, software, firmware, or a combination thereof. In the foregoing description of embodiments, the particular features, structures, materials, or characteristics may be combined in any suitable manner in any one or more embodiments or examples.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of the changes or substitutions within the technical scope of the present invention, and shall cover the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Example four
The present embodiment provides a computer-readable storage medium having computer-readable program instructions stored thereon for performing the method of workpiece defect detection in the first embodiment.
The computer readable storage medium provided by the embodiments of the present invention may be, for example, a USB flash disk, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, or device, or any combination thereof. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present embodiment, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, or device. Program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer-readable storage medium may be embodied in an electronic device; or may be separate and not incorporated into the electronic device.
The computer-readable storage medium carries one or more programs which, when executed by an electronic device, cause the electronic device to: acquiring polarized light intensity information of a workpiece to be detected, and determining total light intensity information, corresponding polarization degree information and corresponding polarization angle information corresponding to the workpiece to be detected according to the polarized light intensity information; carrying out weighting polymerization on the total light intensity information, the polarization degree information and the polarization angle information to obtain a workpiece polarization characteristic image; performing workpiece edge contour detection on the workpiece polarization characteristic image to obtain edge contour characteristic information; and carrying out workpiece defect detection on the workpiece to be detected according to the edge profile characteristic information to obtain a workpiece defect detection result.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present disclosure may be implemented by software or hardware. Wherein the names of the modules do not in some cases constitute a limitation of the unit itself.
The computer-readable storage medium provided by the invention stores computer-readable program instructions for executing the workpiece defect detection method, and solves the technical problem of low workpiece defect detection accuracy. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the embodiment of the invention are the same as the beneficial effects of the workpiece defect detection method provided by the embodiment, and details are not repeated herein.
EXAMPLE five
The present application also provides a computer program product comprising a computer program which, when executed by a processor, performs the steps of the method for workpiece defect detection as described above.
The computer program product provided by the application solves the technical problem of low workpiece defect detection accuracy. Compared with the prior art, the beneficial effects of the computer program product provided by the embodiment of the invention are the same as the beneficial effects of the workpiece defect detection method provided by the embodiment, and are not described herein again.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all equivalent structures or equivalent processes, which are directly or indirectly applied to other related technical fields, and which are not limited by the present application, are also included in the scope of the present application.
Claims (10)
1. A method of workpiece defect detection, the method comprising:
acquiring polarized light intensity information of a workpiece to be detected, and determining total light intensity information, corresponding polarization degree information and corresponding polarization angle information corresponding to the workpiece to be detected according to the polarized light intensity information;
carrying out weighting polymerization on the total light intensity information, the polarization degree information and the polarization angle information to obtain a workpiece polarization characteristic image;
performing workpiece edge contour detection on the workpiece polarization characteristic image to obtain edge contour characteristic information;
and carrying out workpiece defect detection on the workpiece to be detected according to the edge profile characteristic information to obtain a workpiece defect detection result.
2. The method according to claim 1, wherein the polarized light intensity information comprises at least one light intensity with a predetermined polarization direction, and the step of determining the total light intensity information, the corresponding polarization degree information, and the corresponding polarization angle information of the workpiece to be measured according to the polarized light intensity information comprises:
determining total light intensity information, a light intensity component in a horizontal line polarization direction and a light intensity component in an inclined line polarization direction corresponding to the workpiece to be detected according to the light intensity of each preset polarization direction;
and determining the polarization degree information and the polarization angle information according to the light intensity component in the horizontal line polarization direction and the light intensity component in the inclined line polarization direction.
3. The method of claim 1, wherein the step of performing a weighted aggregation of the total intensity information, the polarization degree information, and the polarization angle information to obtain a polarization feature image of the workpiece comprises:
obtaining a weight coefficient, wherein the weight coefficient is determined according to the material type of the workpiece to be measured;
and carrying out weighted aggregation on the total light intensity information, the polarization degree information and the polarization angle information according to the weight coefficient to obtain a workpiece polarization characteristic image.
4. The method of claim 3, wherein prior to the step of obtaining the weighting factors, further comprising:
obtaining material polarization light intensity information corresponding to a target measuring body, and determining total material light intensity information, material polarization degree information and material polarization angle information according to the material polarization light intensity information, wherein the target measuring body and the workpiece to be measured belong to the same material type;
analyzing the sensitivity of the total light intensity information of the material, the polarization degree information of the material and the polarization angle information of the material and the surface characteristics of the target measuring body respectively;
and determining weight coefficients corresponding to the total material light intensity information, the material polarization degree information and the material polarization angle information respectively according to the sensitivities.
5. The method for detecting defects in a workpiece according to claim 1, wherein the step of detecting the edge profile of the workpiece from the polarization feature image of the workpiece to obtain the edge profile feature information comprises:
carrying out gray processing on the polarization characteristic image of the workpiece to obtain a first polarization comprehensive image;
filtering the first polarization comprehensive image to obtain a second polarization comprehensive image;
according to image gradient information corresponding to the second polarization comprehensive image, carrying out non-maximum suppression on the second polarization comprehensive image to obtain a third polarization comprehensive image;
carrying out double-threshold detection on the third polarization comprehensive image to obtain a double-threshold detection result;
and fitting the edge profile of the workpiece to be detected in the third polarization comprehensive image according to the double-threshold detection result to obtain the edge profile characteristic information.
6. The method according to claim 5, wherein the step of fitting the edge profile of the workpiece to be detected in the third polarization-integrated image according to the dual-threshold detection result to obtain the edge profile feature information comprises:
dividing each pixel point in the third polarization comprehensive image into a strong edge point and a weak edge point according to the double-threshold detection result;
and fitting the edge profile of the workpiece to be detected in the third polarization comprehensive image by connecting the strong edge points and the continuous weak edge points in the third polarization comprehensive image to obtain the edge profile characteristic information.
7. The workpiece defect detection method of claim 1, wherein the step of performing workpiece defect detection on the workpiece to be detected according to the edge profile feature information to obtain a workpiece defect detection result comprises:
performing feature dimension reduction on the edge profile feature information to obtain an edge profile feature information sample;
and inputting the edge profile characteristic information sample into a workpiece defect detection model, and performing workpiece defect detection on the workpiece to be detected to obtain a workpiece defect detection result.
8. A workpiece defect detecting apparatus, comprising:
the acquisition module is used for acquiring polarized light intensity information of the workpiece to be detected, and determining total light intensity information, corresponding polarization degree information and corresponding polarization angle information corresponding to the workpiece to be detected according to the polarized light intensity information;
the weighting and polymerizing module is used for weighting and polymerizing the total light intensity information, the polarization degree information and the polarization angle information to obtain a polarization characteristic image of the workpiece;
the contour detection module is used for carrying out workpiece edge contour detection on the workpiece polarization characteristic image to obtain edge contour characteristic information;
and the defect detection module is used for detecting the defects of the workpiece to be detected according to the edge profile characteristic information to obtain a workpiece defect detection result.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and (c) a second step of,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the steps of the workpiece defect detection method of any of claims 1 to 7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a program for implementing a method for workpiece defect detection, the program being executable by a processor for implementing the steps of the method for workpiece defect detection according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210715388.8A CN114782451B (en) | 2022-06-23 | 2022-06-23 | Workpiece defect detection method and device, electronic equipment and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210715388.8A CN114782451B (en) | 2022-06-23 | 2022-06-23 | Workpiece defect detection method and device, electronic equipment and readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114782451A true CN114782451A (en) | 2022-07-22 |
CN114782451B CN114782451B (en) | 2022-09-16 |
Family
ID=82422230
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210715388.8A Active CN114782451B (en) | 2022-06-23 | 2022-06-23 | Workpiece defect detection method and device, electronic equipment and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114782451B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114943739A (en) * | 2022-07-26 | 2022-08-26 | 山东三微新材料有限公司 | Aluminum pipe quality detection method |
CN115753791A (en) * | 2022-11-10 | 2023-03-07 | 哈尔滨耐是智能科技有限公司 | Defect detection method, device and system based on machine vision |
CN117237747A (en) * | 2023-11-14 | 2023-12-15 | 深圳市明鸿五金制品有限公司 | Hardware defect classification and identification method based on artificial intelligence |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105447833A (en) * | 2015-12-24 | 2016-03-30 | 合肥工业大学 | Foggy weather image reconstruction method based on polarization |
CN107340546A (en) * | 2017-07-24 | 2017-11-10 | 南京信息工程大学 | A kind of undersea detection divides the double CCD real-time polarizations imaging devices in aperture and method |
US20180005012A1 (en) * | 2014-01-22 | 2018-01-04 | Polaris Sensor Technologies, Inc. | Polarization-Based Detection and Mapping Method and System |
CN111369545A (en) * | 2020-03-10 | 2020-07-03 | 创新奇智(重庆)科技有限公司 | Edge defect detection method, device, model, equipment and readable storage medium |
CN111583223A (en) * | 2020-05-07 | 2020-08-25 | 上海闻泰信息技术有限公司 | Defect detection method, defect detection device, computer equipment and computer readable storage medium |
-
2022
- 2022-06-23 CN CN202210715388.8A patent/CN114782451B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180005012A1 (en) * | 2014-01-22 | 2018-01-04 | Polaris Sensor Technologies, Inc. | Polarization-Based Detection and Mapping Method and System |
CN105447833A (en) * | 2015-12-24 | 2016-03-30 | 合肥工业大学 | Foggy weather image reconstruction method based on polarization |
CN107340546A (en) * | 2017-07-24 | 2017-11-10 | 南京信息工程大学 | A kind of undersea detection divides the double CCD real-time polarizations imaging devices in aperture and method |
CN111369545A (en) * | 2020-03-10 | 2020-07-03 | 创新奇智(重庆)科技有限公司 | Edge defect detection method, device, model, equipment and readable storage medium |
CN111583223A (en) * | 2020-05-07 | 2020-08-25 | 上海闻泰信息技术有限公司 | Defect detection method, defect detection device, computer equipment and computer readable storage medium |
Non-Patent Citations (3)
Title |
---|
YIFAN HE ET AL.: "Polarized image enhancement based on biological vision", 《FOURTH INTERNATIONAL CONFERENCE ON PHOTONICS AND OPTICAL ENGINEERING》 * |
杨威: "基于Stokes矢量的双相机偏振成像技术研究", 《中国优秀博硕士学位论文全文数据库(硕士) 信息科技辑》 * |
黄广俊 等: "偏光片细微外观缺陷偏振成像检测方法", 《电子与信息学报》 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114943739A (en) * | 2022-07-26 | 2022-08-26 | 山东三微新材料有限公司 | Aluminum pipe quality detection method |
CN114943739B (en) * | 2022-07-26 | 2022-10-21 | 山东三微新材料有限公司 | Aluminum pipe quality detection method |
CN115753791A (en) * | 2022-11-10 | 2023-03-07 | 哈尔滨耐是智能科技有限公司 | Defect detection method, device and system based on machine vision |
CN115753791B (en) * | 2022-11-10 | 2024-03-01 | 哈尔滨耐是智能科技有限公司 | Defect detection method, device and system based on machine vision |
CN117237747A (en) * | 2023-11-14 | 2023-12-15 | 深圳市明鸿五金制品有限公司 | Hardware defect classification and identification method based on artificial intelligence |
Also Published As
Publication number | Publication date |
---|---|
CN114782451B (en) | 2022-09-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114782451B (en) | Workpiece defect detection method and device, electronic equipment and readable storage medium | |
Hoang et al. | Metaheuristic optimized edge detection for recognition of concrete wall cracks: a comparative study on the performances of roberts, prewitt, canny, and sobel algorithms | |
US20200007855A1 (en) | Stereo Correspondence and Depth Sensors | |
CN109883533B (en) | Low-frequency vibration measurement method based on machine vision | |
US9135710B2 (en) | Depth map stereo correspondence techniques | |
Deb et al. | Automatic detection and analysis of discontinuity geometry of rock mass from digital images | |
CN104966089B (en) | A kind of method and device of image in 2 D code edge detection | |
RU2766420C2 (en) | Device and method for damage analysis | |
CN114993452B (en) | Structure micro-vibration measurement method and system based on broadband phase motion amplification | |
KR20170001648A (en) | Using 3d vision for automated industrial inspection | |
CN108156452B (en) | Method, device and equipment for detecting sensor and storage medium | |
CN106530271A (en) | Infrared image significance detection method | |
CN116958145B (en) | Image processing method and device, visual detection system and electronic equipment | |
CN114445404A (en) | Automatic structural vibration response identification method and system based on sub-pixel edge detection | |
CN108447092B (en) | Method and device for visually positioning marker | |
CN106529548A (en) | Sub-pixel level multi-scale Harris corner detection algorithm | |
CN115683431A (en) | Method, device and equipment for determining cable force of inhaul cable based on linear tracking algorithm | |
Zheng et al. | Research on edge detection algorithm in digital image processing | |
CN114066795A (en) | DF-SAS high-low frequency sonar image fine registration fusion method | |
Prasad et al. | Robust and efficient feature-based method for structural health monitoring of large structures | |
CN110532725B (en) | Engineering structure mechanical parameter identification method and system based on digital image | |
CN114549613A (en) | Structural displacement measuring method and device based on deep super-resolution network | |
Zamani et al. | Ellipse recovery from blurred binary images | |
CN109360289B (en) | Power meter detection method fusing inspection robot positioning information | |
Yang et al. | Completely blind image quality assessment based on gray-scale fluctuations |
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 |