CN117871530A - Surface detection method, system, device, computer equipment and storage medium - Google Patents
Surface detection method, system, device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN117871530A CN117871530A CN202311849287.0A CN202311849287A CN117871530A CN 117871530 A CN117871530 A CN 117871530A CN 202311849287 A CN202311849287 A CN 202311849287A CN 117871530 A CN117871530 A CN 117871530A
- Authority
- CN
- China
- Prior art keywords
- height
- image
- product
- defect
- gray
- 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
Links
Classifications
-
- 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/01—Arrangements or apparatus for facilitating the optical investigation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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/01—Arrangements or apparatus for facilitating the optical investigation
- G01N2021/0106—General arrangement of respective parts
- G01N2021/0112—Apparatus in one mechanical, optical or electronic block
-
- 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)
- Chemical & Material Sciences (AREA)
- Biochemistry (AREA)
- Pathology (AREA)
- Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Immunology (AREA)
- Analytical Chemistry (AREA)
- Computer Vision & Pattern Recognition (AREA)
- General Health & Medical Sciences (AREA)
- Quality & Reliability (AREA)
- Theoretical Computer Science (AREA)
- Signal Processing (AREA)
- Image Processing (AREA)
- Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
Abstract
The application discloses a surface detection method, a system, a device, computer equipment and a storage medium, wherein a 2D image and a 3D height image of the surface of a product are obtained; obtaining the average standard deviation of the height of the product surface based on the height data of the product surface in the 3D height image; processing the 2D image to obtain a 2D gray-scale image and a gray-scale energy distribution diagram, marking a region with gray-scale values meeting preset conditions in the 2D gray-scale image as a defect region, and obtaining gray-scale energy data of the defect region; acquiring the height data of the product surface corresponding to the defect area in the 3D height image, and calculating the height difference value between the height data of the product surface corresponding to the defect area and the height average standard deviation; and judging whether the defect of the defect area is dirty or defective based on the gray-scale energy data and the height difference value of the defect area. Therefore, automatic detection of product defects is realized, unified detection standards are formed, the conditions of missing detection and false detection are avoided, manual detection is replaced, and detection efficiency is improved.
Description
Technical Field
The application relates to the technical field of product surface detection, in particular to a surface detection method, a surface detection system, a surface detection device, computer equipment and a storage medium.
Background
With the development of 3C electronic products, people have increasingly higher requirements on the appearance of the electronic products. In order to make the appearance of the electronic product have a high-grade feel and improve the hand feeling, the surface of the electronic product is specially treated to make the surface of the electronic product have a relief appearance texture. In actual production, after special treatment is performed on the electronic product, it is also necessary to detect the surface of the electronic product to determine whether there is a defect on the surface of the electronic product. Currently, detection is typically performed manually. However, manual detection does not have a unified detection standard, resulting in the presence of missed detection and false detection.
Disclosure of Invention
In view of the foregoing, it is necessary to provide a surface detection method, a system, a device, a computer device and a storage medium, which are used for detecting a texture surface of a product to form a unified detection standard, so as to avoid the situations of missing detection and false detection and improve the detection efficiency.
An embodiment of the present application provides a surface detection method for detecting a product having an irregularly textured surface, including:
Acquiring a 2D image and a 3D height image of the surface of the product to be detected;
obtaining the average standard deviation of the height of the product surface based on the height data of the product surface in the 3D height image;
processing the 2D image to obtain a 2D gray-scale image and a gray-scale energy distribution diagram, marking a region with gray-scale values meeting preset conditions in the 2D gray-scale image as a defect region, and obtaining gray-scale energy data of the defect region;
acquiring the height data of the product surface corresponding to the defect area in the 3D height image, and calculating the height difference value between the height data of the product surface corresponding to the defect area and the height average standard deviation;
judging the defect type of the defect area based on the gray-scale energy data and the height difference value of the defect area, and judging that the defect in the defect area is dirty if the gray-scale energy data and the height difference value are in a preset range; and if the difference between the gray-scale energy data and the height exceeds the preset range, judging that the defect in the defect area is a defect.
In some embodiments, the surface detection method further comprises:
judging whether the roughness of the surface of the product is in compliance or not based on the height average standard deviation, if the height average standard deviation is in a preset range, judging the roughness of the surface of the product is in compliance; if the height average standard deviation exceeds the preset range, judging that the roughness of the surface of the product is not compliant;
And judging the roughness grade of the product surface based on the roughness compliance of the product surface, wherein the roughness grade of the product surface is judged to be grade one if the height average standard deviation is in a first standard value, the roughness grade of the product surface is judged to be grade two if the height average standard deviation exceeds the first standard value and is in a second standard value, the roughness grade of the product surface is judged to be grade three if the height average standard deviation exceeds the second standard value and is in a third standard value, and the values of the first standard value, the second standard value, the third standard value and the preset range are sequentially increased.
In some embodiments, the surface detection method further comprises:
obtaining a first contour image based on the height data of the product surface in the 3D height image, wherein the first contour image is an image formed by selecting a first area of the product surface containing the height data along a first direction;
determining contour features of the product surface based on the first contour image;
fitting to obtain a first slope based on the height data in the first contour image;
and determining defects of the product surface based on the first slope and a first preset slope, wherein the defects of the product surface determined based on the first slope and the first preset slope are stress marks.
In some embodiments, the surface detection method further comprises:
acquiring a junction line area based on the first contour image;
fitting a second slope based on the height data in the intersection line region;
and determining defects at the intersecting line of the product surface based on the second slope and a second preset slope.
In some embodiments, the surface detection method further comprises:
obtaining a second contour image based on the height data of the product surface in the 3D height image, wherein the second contour image is an image formed by selecting a second area of the product surface containing the height data along a second direction;
fitting to obtain a third slope based on the height data in the second contour image;
and determining the defect at the R angle of the surface of the product based on the third slope and a third preset slope.
In some embodiments, the step of acquiring a 2D image and a 3D height image of the product surface to be inspected comprises:
determining original parameters of an image of the surface of the product, wherein the original parameters comprise a light intensity parameter and an exposure value parameter;
acquiring a preliminary image of the surface of the product based on the original parameters, and determining preliminary correction parameters based on the preliminary image;
Acquiring a target image of the surface of the product based on the preliminary correction parameters, and determining target parameters based on the target image;
acquiring a verification image of the surface of the product based on the target parameter, and determining a target light wavelength parameter based on the verification image;
the 2D image and the 3D height image of the product surface are acquired based on the target parameter and the target light wavelength parameter.
The embodiment of the application also provides a surface detection system for detecting a product with an irregular texture surface, comprising:
the acquisition module is used for acquiring a 2D image and a 3D height image of the surface of the product to be detected;
the calculating module is used for obtaining the average standard deviation of the height of the product surface based on the height data of the product surface in the 3D height image;
the gray processing module is used for processing the 2D image to obtain a 2D gray image and a gray energy distribution diagram, marking a region with gray values meeting preset conditions in the 2D gray image as a defect region, and obtaining gray energy data of the defect region;
the acquisition module is further used for acquiring the height data of the product surface corresponding to the defect area in the 3D height image, and the calculation module is further used for calculating the height difference value between the height data of the product surface corresponding to the defect area and the height average standard deviation;
The judging module is used for judging the defect type of the defect area based on the gray-scale energy data and the height difference value of the defect area, and judging that the defect in the defect area is dirty if the gray-scale energy data and the height difference value are in a preset range; and if the difference between the gray-scale energy data and the height exceeds the preset range, judging that the defect in the defect area is a defect.
The embodiment of the application also provides a surface detection device for detecting a product with an irregular texture surface, comprising:
the motion mechanism is used for receiving the product to be detected and driving the product to move along a preset track;
the sensor is used for shooting the product;
a processor coupled to the sensor and the motion mechanism for performing:
controlling the sensor to acquire a 2D image and a 3D height image of the surface of the product to be detected;
obtaining the average standard deviation of the height of the product surface based on the height data of the product surface in the 3D height image;
processing the 2D image to obtain a 2D gray-scale image and a gray-scale energy distribution diagram, marking a region with gray-scale values meeting preset conditions in the 2D gray-scale image as a defect region, and obtaining gray-scale energy data of the defect region;
Acquiring the height data of the product surface corresponding to the defect area in the 3D height image, and calculating the height difference value between the height data of the product surface corresponding to the defect area and the height average standard deviation;
judging the defect type of the defect area based on the gray-scale energy data and the height difference value of the defect area, and judging that the defect in the defect area is dirty if the gray-scale energy data and the height difference value are in a preset range; and if the difference between the gray-scale energy data and the height exceeds the preset range, judging that the defect in the defect area is a defect.
The embodiment of the application also provides computer equipment, which comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the computer program to realize the steps of the surface detection method.
The embodiment of the application also provides a computer readable storage medium, which has a computer program, wherein the computer program realizes the steps of the surface detection method when being executed by a processor.
According to the surface detection method, system, device, computer equipment and storage medium, the 2D image and the 3D height image of the surface of the product to be detected are obtained, and the average standard deviation of the height of the surface of the product is obtained through the height data of the surface of the product in the 3D height image; the method comprises the steps of obtaining a 2D gray-scale image and a gray-scale energy distribution diagram through processing a 2D image, screening out a region with gray-scale values meeting preset conditions in the 2D gray-scale image, marking the region as a defect region, and obtaining gray-scale energy data of the defect region; then, the height difference value between the height data of the product surface corresponding to the defect area and the average standard deviation of the height is calculated by acquiring the height data of the product surface corresponding to the defect area in the 3D height image; judging the defect type of the defect area through the gray-scale energy data and the height difference value of the defect area, if the gray-scale energy data and the height difference value are in a preset range, judging the defect in the defect area as dirty, if the gray-scale energy data and the height difference value exceed the preset range, judging the defect in the defect area as flaw, thereby realizing detection of the defect of the texture surface of the product and judging the defect type as dirty or flaw; therefore, automatic detection of defects of the defect area on the texture surface of the product is realized, unified detection standards are formed, the conditions of missing detection and false detection are avoided, manual detection is effectively replaced, and the detection efficiency is improved.
Drawings
Fig. 1 is a flowchart of a surface detection method according to an embodiment of the present application.
Fig. 2a is a schematic diagram of a 2D gray scale map according to an embodiment of the present application.
FIG. 2b is a schematic diagram of the gray scale energy distribution diagram corresponding to the 2D gray scale diagram in FIG. 2 a.
FIG. 2c is a schematic diagram of defect feature height data corresponding to the 2D gray scale map of FIG. 2 a.
Fig. 3a is a schematic view of a first contour image according to an embodiment of the present application.
Fig. 3b is a schematic view of a first region corresponding to the first contour image in fig. 3 a.
Fig. 4a is a schematic view of a first contour image according to another embodiment of the present application.
Fig. 4b is a schematic diagram of a preset contour image corresponding to the first contour image in fig. 4 a.
Fig. 5a is a schematic view of a first contour image according to a further embodiment of the present application.
Fig. 5b is a schematic diagram of a preset contour image corresponding to the first contour image in fig. 5 a.
Fig. 6a is a schematic view of a second region according to an embodiment of the present application.
Fig. 6b is a schematic diagram of a second contour image corresponding to the second region in fig. 6 a.
Fig. 6c is a schematic diagram of a preset contour image corresponding to the second contour image in fig. 6 b.
FIG. 7 is a schematic diagram of a surface inspection system according to an embodiment of the present application.
Fig. 8 is a structural diagram of a surface inspection device according to an embodiment of the present application.
Description of the main reference signs
Surface inspection system 100
Acquisition module 101
Calculation Module 102
Gray scale processing module 103
Decision module 104
Surface detection device 200
Motion mechanism 201
Sensor 202
Processor 203
Detection platform 204
Detailed Description
Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present application.
In the description of the present application, it should be understood that the terms "orientation" or "positional relationship" as used herein are merely for convenience of description and to simplify the description, and do not indicate or imply that the apparatus or elements referred to must have, be constructed and operated in a particular orientation, and thus should not be construed as limiting the present application. Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more of the described features. In the description of the present application, it is to be noted that the meaning of "a plurality" is two or more, unless explicitly defined otherwise.
In the description of the present application, it should be noted that, unless explicitly specified and limited otherwise, the term "connected" should be construed broadly, and for example, it may be a fixed connection, a removable connection, or an integral connection; the connection may be mechanical connection, electrical connection or communication, direct connection, indirect connection via an intermediate medium, communication between two elements or interaction relationship between two elements. The specific meaning of the terms in this application will be understood by those of ordinary skill in the art as the case may be.
Some embodiments of the present application will be described in detail below with reference to the accompanying drawings.
Referring to fig. 1, in the surface detection method provided in an embodiment of the present application, the surface detection method is used for detecting irregular textures on a product surface, where the product may be a middle frame, a rear shell, or other objects, and the irregular textures may be drawn textures, and the irregular textures have undulating characteristics. The surface detection method provided by the application comprises the following steps S11 to S15.
Step S11, acquiring a 2D image and a 3D height image of the surface of the product to be detected.
And step S12, obtaining the average standard deviation of the height of the product surface based on the height data of the product surface in the 3D height image.
Step S13, processing the 2D image to obtain a 2D gray scale image and a gray scale energy distribution diagram, marking a region with gray scale values meeting preset conditions in the 2D gray scale image as a defect region, and acquiring gray scale energy data of the defect region.
Step S14, obtaining the height data of the product surface corresponding to the defect area in the 3D height image, and calculating the height difference value between the height data of the product surface corresponding to the defect area and the height average standard deviation.
Step S15, judging the defect type of the defect area based on the gray-scale energy data and the height difference value of the defect area, and judging the defect in the defect area as dirty if the gray-scale energy data and the height difference value are in a preset range; if the difference between the gray-scale energy data and the height exceeds a preset range, determining that the defect in the defect area is a defect.
Specifically, in step S11, the product surface to be detected may be photographed by the on-axis spectrum sensor to acquire a 2D image and a 3D height image of the product surface. The coaxial line type spectrum sensor is used for emitting a white light source with full spectrum, has a continuous image capturing function, is not needed to splice and is simple to debug, the coaxial line type spectrum sensor senses the height data of the surface of a product through wavelength and can obtain a 2D image and a 3D height image, the obtained 2D image and the obtained 3D height image correspond to each other, and compared with the traditional 3D line laser (delta type measurement), the coaxial line type spectrum sensor overcomes the dead angle blind area problem and the noise problem of a rough surface (the irregular texture surface of the product); in addition, the coaxial line type spectrum sensor improves the problem of signal interference on the surface of the metal structure through the characteristic of a non-coherent light source.
In order to improve the definition of the 2D image and the 3D height image, the on-axis spectral sensor may be subjected to optical parameter adjustment before acquiring the 2D image and the 3D height image of the product surface. Specifically, in step S11, the following steps S111 to S115 are specifically further included.
In step S111, original parameters of the image of the surface of the product are determined, wherein the original parameters include a light intensity parameter and an exposure value parameter.
Step S112, obtaining a preliminary image of the product surface based on the original parameters, and determining preliminary correction parameters based on the preliminary image.
Step S113, acquiring a target image of the product surface based on the preliminary correction parameters, and determining target parameters based on the target image.
Step S114, obtaining a verification image of the product surface based on the target parameters, and determining the target light wavelength parameters based on the verification image.
Step S115, acquiring a 2D image and a 3D height image of the product surface based on the target parameter and the target light wavelength parameter.
Specifically, in step S111, among the original parameters, the light intensity parameter may be adjusted to the maximum, and the exposure value parameter may be adjusted to the minimum, in which case the on-axis spectral sensor samples the fastest. It will be appreciated that the images in the original parameters that determine the image of the surface of the acquired product include a 2D image and a 3D height image.
In step S112, the product surface is photographed based on the original parameters including the maximum light intensity parameter and the minimum exposure value parameter to acquire a preliminary image of the product surface, and a preliminary correction parameter is determined based on the preliminary image. Specifically, if the obtained preliminary image meets the requirement of sharpness, the original parameters may be determined as target parameters and step S114 may be performed. If the obtained preliminary image does not meet the requirement of definition, the light intensity and the exposure value can be correspondingly adjusted, for example, the light intensity parameter is reduced, the exposure value parameter is increased, or the light intensity parameter and the exposure value parameter are simultaneously reduced, so that the preliminary correction parameter is formed.
In step S113, the product surface is photographed based on the preliminary correction parameters to obtain a target image of the product surface, wherein the target image meets the requirement of sharpness, and the preliminary correction parameters at the time of photographing are determined as target parameters based on the target image. It will be appreciated that if the target image obtained by the preliminary correction parameter does not meet the requirement of sharpness, the correction parameter may be determined continuously until the image obtained by the current correction parameter meets the requirement of sharpness, and then the current correction parameter is determined to be the target parameter.
In step S114 and step S115, after the target parameters are acquired, since the light source emitted by the coaxial line type spectrum sensor is a full spectrum white light source, and there are a plurality of wavelengths (380 nm-780 nm), it is necessary to further verify the influence of the wavelengths of different wavelength bands on the photographing effect, wherein the photographing effect acquired by the coaxial line type spectrum sensor when photographing the product surface of different materials is different due to the different reflection degrees of different materials on the wavelengths, for example, when the product is a metal material, the coaxial line type spectrum sensor achieves the optimal photographing effect in the 380nm wavelength band, and when the product is a nonmetal material, the coaxial line type spectrum sensor achieves the optimal photographing effect in the 780nm wavelength band. It should be noted that, in general, the preset relative distance between the product and the coaxial line type spectrum sensor needs to be adjusted, for example, the position of the product relative to the coaxial line type spectrum sensor in the green (approximately 550 nm) band is adjusted, so that the image data with the best shooting effect can be obtained.
In this way, by executing steps S111 to S115, before acquiring the 2D image and the 3D height image of the product surface, the on-axis spectrum sensor is optically debugged, so as to acquire the image data meeting the definition requirement. By performing optical debugging on the coaxial line type spectrum sensor, invalid characteristics can be preliminarily filtered, 30% -40% of operation resources are saved, and the detection accuracy can be improved.
In step S12, the height average standard deviation is calculated based on all the height data in the acquired 3D height image, and the calculation formula includes an average formula and a height average standard deviation formula.
Average formula:wherein->Is the average value of the height data, x i The height of the ith peak or trough is the value, and N is the number of peaks and troughs.
Height average standard deviation formula:wherein σ is the height average standard deviation.
In step S13, after the 2D image and the 3D height image of the product surface are obtained, the 2D image is processed to obtain a 2D gray-scale image and a gray-scale energy distribution diagram, that is, the 2D image is subjected to graying treatment to convert the 2D image into the gray-scale image, wherein the different heights of the textures result in different reflection degrees of the product surface to light, the different heights of the textures reflect in the gray-scale image, the corresponding gray-scale values are different, from black to white, and the corresponding gray-scale values are from 0 to 255, the characteristics of suspected defects and the corresponding areas can be screened out by adopting a mode of setting preset conditions, the gray-scale energy data corresponding to the locks of the defect areas are obtained, for example, the preset conditions are set according to experiments or experience to be determined as the suspected defects, and the gray-scale energy data corresponding to the defect areas are obtained. Referring to fig. 2a, 2b and 2c, fig. 2a is a 2D gray-scale image of a product, fig. 2b is a gray-scale energy distribution diagram corresponding to the 2D gray-scale image, fig. 2c is a defect feature height data image corresponding to the 2D gray-scale image of the product, and it can be seen from fig. 2a and 2b that black line features with suspected defects are approximately display features with width and length, and the black line features with suspected defects are marked as defect regions (as indicated by the regions outlined by the dashed boxes in fig. 2 a).
It can be understood that in step S13, if the gray scale values in the processed 2D gray scale map and the gray scale energy distribution map do not meet the preset conditions, it can be determined that the product surface is not defective.
In step S14, after obtaining the defect area with the suspected defect, since the defect includes the flaw and the dirt, further determination is required for the suspected defect in the defect area to determine the type of the defect as the flaw or the dirt. The flaws can be understood as scratches on the surface of the product, so that the texture of the surface of the product is far below the valley bottom of the texture trough, far above the peak top of the texture crest or other changes; the dirt can be understood as oil stains and the like on the surface of the product, the dirt can not cause obvious change of the texture on the surface of the product, and when the defect on the surface of the product is the dirt, the product can be wiped and cleaned by a wiping machine.
And after obtaining the defect area of the suspected defect, acquiring the height data of the product surface corresponding to the defect area in the 3D height image, namely combining the height data corresponding to the defect area in the 3D height image. The surface detection method comprises the steps of obtaining a defect area with suspected defects through a 2D image, obtaining height data of the defect area through a 3D height image, and judging the types of the defects on the surface of a product by combining the 2D image and the 3D height image.
After the defect area of the suspected defect and the height data corresponding to the defect area are obtained, the height difference between the height data of the product surface corresponding to the defect area and the height average standard deviation is calculated, and the defect type in the defect area can be determined through the height difference.
In step S15, the defect type of the defect area is determined based on the gray-scale energy data and the height difference value of the defect area. If the difference between the gray-scale energy data and the height of the defect area is within the preset range, the height data of the product surface corresponding to the defect area is consistent with the texture of the current product surface, and the defect in the defect area can be judged to be dirty. If the difference between the gray-scale energy data and the height of the defect area exceeds a preset range, indicating that the height data of the product surface corresponding to the defect area is larger, judging that the defect in the defect area is a defect.
In this way, after the defective area is acquired, the step S15 is executed, and the height data in the defective area is combined, and if the height data is normal, the defective area is determined to be dirty, and if the height data is abnormal, the defective area is determined to be defective.
The surface detection method can effectively judge defects and effectively distinguish defects of product surface textures as flaws or dirt by executing the step S15, does not need to carry out contact detection and does not have risk of collision scratch crush injury, and compared with the traditional contact type or manual detection, experiments prove that the accuracy of detecting the defects of the product surface by executing the step S15 reaches 100%. It should be noted that, in the conventional product surface inspection, it is difficult to effectively determine defects and distinguish dirt from flaws by using a 2D camera and a polishing technique due to small surface textures of the product.
In addition, the surface detection method reduces the operation resources by executing the steps S11 to S15 and by marking the defective area, filtering out the unnecessary area. The surface detection method has the advantages that the effect of automatically detecting defects on the surface of the product with irregular textures is achieved, manual detection and traditional 2D camera detection are effectively replaced, the defect depth and uniformity which cannot be detected by manual detection are replaced, manual operation is reduced, detection precision is improved, microscopic data can be provided through the detected 2D image and 3D height image, the basis for improving the production process is provided, and therefore the production yield is improved.
It will be appreciated that the surface inspection method may also be performed at an early stage by manually confirming the defective area. Because the irregular texture on the surface of the product has infinite groups of depth information, if the irregular texture is directly measured by the depth information with a standard, the real flaw position cannot be accurately converged, and a large amount of invalid data can be calculated to influence the detection efficiency. After multiple deep learning training, the product surface can be directly shot to acquire image data.
In some embodiments, the surface detection method further includes the following steps S16 to S17.
Step S16, judging whether the roughness of the surface of the product is in compliance or not based on the height average standard deviation, if the height average standard deviation is in a preset range, judging that the roughness of the surface of the product is in compliance; if the height average standard deviation exceeds a preset range, the roughness of the surface of the product is judged to be not compliant.
And S17, judging the roughness grade of the product surface based on the roughness compliance of the product surface, wherein the roughness grade of the product surface is judged to be grade one if the height average standard deviation is in a first standard value, the roughness grade of the product surface is judged to be grade two if the height average standard deviation exceeds the first standard value and is in a second standard value, and the roughness grade of the product surface is judged to be grade three if the height average standard deviation exceeds the second standard value and is in a third standard value, wherein the values of the first standard value, the second standard value, the third standard value and the preset range are sequentially increased.
Specifically, in step S16, it can be determined whether the roughness of the product surface is compliant, that is, whether the irregular texture of the product surface meets the processing requirements, by the height average standard deviation. If the height average standard deviation is within a predetermined range, for example, the value of the predetermined range is 30 μm, if the height average standard deviation is within 30 μm, the roughness compliance of the product surface is judged, and if the height average standard deviation exceeds 30 μm, for example, the height average standard deviation sigma is 39 μm, the roughness of the product surface is judged to be unqualified, and the product is an out-of-specification sample.
In step S17, the roughness grade of the product surface is further determined based on the roughness compliance of the product surface, and the grade of the product can be determined from the first standard value, the second standard value, and the third standard value. For example, the first standard value may be 15 μm, the second standard value may be 20 μm, the third standard value may be 25 μm, if the height average standard deviation σ is 14 μm, it may be determined that the texture of the product surface is uniform, the roughness grade of the product surface is grade one, if the height average standard deviation σ is 19 μm, it may be determined that the texture of the product surface is uniform, the roughness grade of the product surface is grade two, if the height average standard deviation σ is 21 μm, it may be determined that the texture of the product surface is substantially uniform, and the roughness grade of the product surface is grade three.
Therefore, by executing steps S16 to S17, whether the surface roughness of the product is compliant or not and the roughness grade is differentiated are realized, and compared with the traditional 2D camera, the microscopic data measurement cannot be achieved, and experiments prove that the product surface roughness is differentiated by executing steps S16 to S17 to achieve 100% of the yield.
In some embodiments, the surface detection method further includes the following steps S18 to S21.
Step S18, obtaining a first contour image based on the height data of the product surface in the 3D height image, wherein the first contour image is an image formed by selecting a first area containing the height data of the product surface along a first direction.
Step S19, determining contour features of the product surface based on the first contour image.
Step S20, fitting to obtain a first slope based on the height data in the first contour image.
Step S21, determining a defect of the product surface based on the first slope and the first preset slope, wherein the defect of the product surface determined based on the first slope and the first preset slope is a stress trace.
Specifically, in step S18 to step S19, referring to fig. 3a and 3b, fig. 3a is a first outline image, fig. 3b is a schematic view of a part of the product, the first direction is a Z-axis direction as in fig. 3b, the first area is approximately two cambered surfaces on the outer side surface and two sides of the outer side surface of the middle frame, it should be noted that an intersection area is also provided between the outer side surface and the cambered surface, the intersection area is approximately a chamfer, and an intersection line is generated at a transition between the intersection area and the outer side surface and the cambered surface. The first contour image formed according to the first region is substantially similar to the contour of the side face of the middle frame in the first direction. In step S19, if the obtained first contour image is approximately in an inverted U shape as shown in fig. 3b, the contour features of the product surface are determined to be satisfactory, and if not, the contour features of the product surface are determined to be unsatisfactory. Thus, the surface detection method is further expanded to have a detection function of detecting the surface profile of the product.
Referring to fig. 4a and 4b, fig. 4a is a first contour image, fig. 4b is a preset contour image corresponding to the first contour image, and in step S20, based on the obtained first contour image, a first slope of a first area of the surface of the current product may be obtained by using a least square fitting method according to height data in the first contour image. In step S21, the solid line in the figure represents a first slope, the dashed line represents a first preset slope, the first preset slope is obtained according to a test or an empirical value, the first preset slope is a reference standard of the first area of the product, the first slope is compared with the first preset slope, and if the first slope is approximately consistent with the first preset slope or the difference between the first slope and the first preset slope accords with a tolerance range, it is determined that no defect exists on the surface of the product. If not, it can be determined that the product surface has defects, and it is noted that the defects on the product surface determined based on the first slope and the first preset slope may be stress marks, and the stress marks may be understood as phenomena of distortion of peaks or troughs of the product surface texture. Therefore, the surface detection method is further expanded, and the surface detection method also has a detection function of detecting the surface stress mark defect of the product.
In some embodiments, the surface detection method further includes the following steps S22 to S24.
Step S22, acquiring a handover line area based on the first contour image.
Step S23, fitting a second slope based on the height data in the intersection line region.
Step S24, determining defects at the intersecting line of the product surface based on the second slope and the second preset slope.
Specifically, referring to fig. 5a and 5b, fig. 5a is a first contour image, fig. 5b is a preset contour image corresponding to the first contour image, and in step S22, according to the features of the first region and the first contour region, it may be determined that the region where two values in the first contour region change greatly is the intersection line region, and the number of the intersection line regions is two. In step S23, based on the already obtained intersection line region, a second slope at the intersection line of the surface of the present product may be obtained by using a least square fitting, based on the height data in the intersection line region. In step S24, the solid line in the figure represents a second slope, the dashed line represents a second preset slope, the second preset slope is obtained according to a test or an empirical value, the second preset slope is a reference standard of the product junction area, the second slope is compared with the second preset slope, and if the second slope is approximately consistent with the second preset slope or the difference between the second slope and the second preset slope accords with a tolerance range, the junction line on the product surface is determined to meet the requirement. If not, determining that the interface line of the product surface is not satisfactory. Therefore, the surface detection method is further expanded to have a detection function for detecting whether the connecting line meets the requirement.
In some embodiments, the surface detection method further comprises the following steps S25 to S27.
Step S25, obtaining a second contour image based on the height data of the product surface in the 3D height image, wherein the second contour image is an image formed by selecting a second area containing the height data of the product surface along a second direction.
Step S26, fitting to obtain a third slope based on the height data in the second contour image.
Step S27, determining the defect at the R angle of the product surface based on the third slope and the third preset slope.
Specifically, referring to fig. 6a, 6b and 6c, fig. 6a is a schematic view of a product, fig. 6b is a second contour image, fig. 6c is a preset contour image corresponding to the second contour image, in step S25, the second direction is the X-axis direction or the Y-axis direction as shown in fig. 6a, and the second area is approximately two R angles at the outer side surface and two ends of the outer side surface of the middle frame. In step S26, based on the second contour image that has been obtained, a third slope of the second region of the surface of the current product may be obtained by a least squares fit from the height data in the second contour image. In step S27, the solid line in the figure represents a third slope, the dashed line represents a third preset slope, the third preset slope is obtained according to a test or an empirical value, the third preset slope is a reference standard of the second area of the product, the third slope is compared with the third preset slope, and if the third slope is approximately consistent with the third preset slope or the difference between the third slope and the third preset slope accords with a tolerance range, it is determined that the R angle on the surface of the product accords with the requirement. If not, the defect that the R angle on the surface of the product is over-polished or under-polished can be determined. Thus, the surface detection method is further expanded to have a detection function of detecting the R angle of the product.
Referring to fig. 7, an embodiment of the present application further provides a surface inspection system 100, where the surface inspection system 100 is used for inspecting irregular textures on a product surface. The surface detection system 100 provided by the application comprises an acquisition module 101, a calculation module 102, a gray processing module 103 and a determination module 104.
Specifically, the acquiring module 101 is configured to acquire a 2D image and a 3D height image of a surface of a product to be detected.
The calculation module 102 is configured to obtain a height average standard deviation of the product surface based on the height data of the product surface in the 3D height image.
The gray processing module 103 is configured to process the 2D image to obtain a 2D gray map and a gray energy distribution map, mark a region of the 2D gray map, where the gray value meets a preset condition, as a defect region, and obtain gray energy data of the defect region. Wherein defects in the defect area include flaws and smudges.
The acquiring module 101 is further configured to acquire height data of a product surface corresponding to the defect area in the 3D height image, and the calculating module 102 is further configured to calculate a height difference between the height data of the product surface corresponding to the defect area and a height average standard deviation.
The determining module 104 is configured to determine a defect type of the defect area based on the gray-scale energy data and the height difference value of the defect area, for example, the gray-scale energy data and the height difference value are within a preset range, and determine that the defect in the defect area is dirty; if the difference between the gray-scale energy data and the height exceeds a preset range, determining that the defect in the defect area is a defect.
In some embodiments, the determining module 104 is further configured to determine whether the roughness of the product surface is compliant based on the height average standard deviation, e.g., the height average standard deviation is within a predetermined range, and determine that the roughness of the product surface is compliant; if the height average standard deviation exceeds a preset range, the roughness of the surface of the product is judged to be not compliant.
The determining module 104 is further configured to determine a roughness grade of the product surface based on the roughness compliance of the product surface, for example, the height average standard deviation is within a first standard value, determine the roughness grade of the product surface to be a grade one, for example, the height average standard deviation exceeds the first standard value and is within a second standard value, determine the roughness grade of the product surface to be a grade two, for example, the height average standard deviation exceeds the second standard value and is within a third standard value, and determine the roughness grade of the product surface to be a grade three, where the values of the first standard value, the second standard value, the third standard value, and the predetermined range are sequentially increased.
In some embodiments, the obtaining module 101 is further configured to obtain a first contour image based on the height data of the product surface in the 3D height image, where the first contour image is an image formed by selecting a first area of the product surface including the height data along the first direction.
The decision module 104 is also configured to determine contour features of the product surface based on the first contour image.
The calculation module 102 is further configured to fit a first slope based on the height data in the first contour image.
The determination module 104 is further configured to determine a defect on the surface of the product based on the first slope and the first predetermined slope. The defect on the product surface determined based on the first slope and the first preset slope may be a stress trace.
In some embodiments, the acquiring module 101 is further configured to acquire the intersection line region based on the first contour image.
The calculation module 102 is further configured to fit a second slope based on the height data in the junction region.
The decision module 104 is further configured to determine a defect at the product surface intersection line based on the second slope and the second preset slope.
In some embodiments, the obtaining module 101 is further configured to obtain a second contour image based on the height data of the product surface in the 3D height image, where the second contour image is an image formed by selecting a second area of the product surface including the height data along a second direction.
The calculation module 102 is further configured to fit a third slope based on the height data in the second contour image.
The decision module 104 is further configured to determine a defect at the R-angle of the product surface based on the third slope and the third preset slope.
In some embodiments, the decision module 104 is further configured to determine raw parameters for acquiring an image of the product surface, the raw parameters including a light intensity parameter and an exposure value parameter.
The decision module 104 is also configured to obtain a preliminary image of the surface of the product based on the original parameters and determine preliminary correction parameters based on the preliminary image.
The determination module 104 is further configured to obtain a target image of the product surface based on the preliminary correction parameters, and determine the target parameters based on the target image.
The determination module 104 is further configured to obtain a verification image of the product surface based on the target parameter, and determine the target light wavelength parameter based on the verification image.
The acquisition module 101 is further configured to acquire a 2D image and a 3D height image of the product surface based on the target parameter and the target light wavelength parameter.
Referring to fig. 8, an embodiment of the present application further provides a surface inspection apparatus 200, where the surface inspection apparatus 200 is used for inspecting irregular textures on a product surface. The surface detection device 200 provided by the application comprises a motion mechanism 201, a sensor 202, a processor 203 and a detection platform 204, wherein the motion mechanism 201, the sensor 202 and the processor 203 are all arranged on the detection platform 204, so that the surface detection device 200 is in modularized arrangement.
Specifically, the motion mechanism 201 may be formed by a dual-axis linear module and a rotary module, where the rotary module is used for receiving a product and driving the product to rotate, and the dual-axis linear module is connected with the rotary module to drive the rotary module to move along dual axes, and the dual-axis linear module and the rotary module are matched to drive the product to move along a predetermined track. The sensor 202 is used for photographing a product, and the sensor 202 may be a coaxial line type spectrum sensor. The processor 203 is coupled to the sensor 202 and the motion mechanism 201, wherein the processor 203 is configured to perform the steps of the surface detection method described above.
An embodiment of the present application further provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the surface detection method described above when the processor executes the computer program.
An embodiment of the present application further provides a computer readable storage medium, where the computer readable storage medium has a computer program, where the computer program when executed by a processor implements the steps of the surface detection method described above.
It will be evident to those skilled in the art that the present application is not limited to the details of the foregoing illustrative embodiments, and that the present application may be embodied in other specific forms without departing from the spirit or essential characteristics thereof. The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the application being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein.
Finally, it should be noted that the above embodiments are merely for illustrating the technical solution of the present application and not for limiting, and although the present application has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that the technical solution of the present application may be modified or substituted without departing from the spirit and scope of the technical solution of the present application.
Claims (10)
1. A surface inspection method for inspecting a product having an irregularly textured surface, comprising:
acquiring a 2D image and a 3D height image of the surface of the product to be detected;
obtaining the average standard deviation of the height of the product surface based on the height data of the product surface in the 3D height image;
processing the 2D image to obtain a 2D gray-scale image and a gray-scale energy distribution diagram, marking a region with gray-scale values meeting preset conditions in the 2D gray-scale image as a defect region, and obtaining gray-scale energy data of the defect region;
acquiring the height data of the product surface corresponding to the defect area in the 3D height image, and calculating the height difference value between the height data of the product surface corresponding to the defect area and the height average standard deviation;
Judging the defect type of the defect area based on the gray-scale energy data and the height difference value of the defect area, and judging that the defect in the defect area is dirty if the gray-scale energy data and the height difference value are in a preset range; and if the difference between the gray-scale energy data and the height exceeds the preset range, judging that the defect in the defect area is a defect.
2. The surface inspection method of claim 1, further comprising:
judging whether the roughness of the surface of the product is in compliance or not based on the height average standard deviation, if the height average standard deviation is in a preset range, judging the roughness of the surface of the product is in compliance; if the height average standard deviation exceeds the preset range, judging that the roughness of the surface of the product is not compliant;
and judging the roughness grade of the product surface based on the roughness compliance of the product surface, wherein the roughness grade of the product surface is judged to be grade one if the height average standard deviation is in a first standard value, the roughness grade of the product surface is judged to be grade two if the height average standard deviation exceeds the first standard value and is in a second standard value, the roughness grade of the product surface is judged to be grade three if the height average standard deviation exceeds the second standard value and is in a third standard value, and the values of the first standard value, the second standard value, the third standard value and the preset range are sequentially increased.
3. The surface inspection method of claim 1, further comprising:
obtaining a first contour image based on the height data of the product surface in the 3D height image, wherein the first contour image is an image formed by selecting a first area of the product surface containing the height data along a first direction;
determining contour features of the product surface based on the first contour image;
fitting to obtain a first slope based on the height data in the first contour image;
and determining defects of the product surface based on the first slope and a first preset slope, wherein the defects of the product surface determined based on the first slope and the first preset slope are stress marks.
4. The surface inspection method of claim 3, further comprising:
acquiring a junction line area based on the first contour image;
fitting a second slope based on the height data in the intersection line region;
and determining defects at the intersecting line of the product surface based on the second slope and a second preset slope.
5. The surface inspection method of claim 1, further comprising:
Obtaining a second contour image based on the height data of the product surface in the 3D height image, wherein the second contour image is an image formed by selecting a second area of the product surface containing the height data along a second direction;
fitting to obtain a third slope based on the height data in the second contour image;
and determining the defect at the R angle of the surface of the product based on the third slope and a third preset slope.
6. The surface inspection method of claim 1, wherein the step of acquiring a 2D image and a 3D height image of the product surface to be inspected comprises:
determining original parameters of an image of the surface of the product, wherein the original parameters comprise a light intensity parameter and an exposure value parameter;
acquiring a preliminary image of the surface of the product based on the original parameters, and determining preliminary correction parameters based on the preliminary image;
acquiring a target image of the surface of the product based on the preliminary correction parameters, and determining target parameters based on the target image;
acquiring a verification image of the surface of the product based on the target parameter, and determining a target light wavelength parameter based on the verification image;
the 2D image and the 3D height image of the product surface are acquired based on the target parameter and the target light wavelength parameter.
7. A surface inspection system for inspecting a product having an irregularly textured surface, comprising:
the acquisition module is used for acquiring a 2D image and a 3D height image of the surface of the product to be detected;
the calculating module is used for obtaining the average standard deviation of the height of the product surface based on the height data of the product surface in the 3D height image;
the gray processing module is used for processing the 2D image to obtain a 2D gray image and a gray energy distribution diagram, marking a region with gray values meeting preset conditions in the 2D gray image as a defect region, and obtaining gray energy data of the defect region;
the acquisition module is further used for acquiring the height data of the product surface corresponding to the defect area in the 3D height image, and the calculation module is further used for calculating the height difference value between the height data of the product surface corresponding to the defect area and the height average standard deviation;
the judging module is used for judging the defect type of the defect area based on the gray-scale energy data and the height difference value of the defect area, and judging that the defect in the defect area is dirty if the gray-scale energy data and the height difference value are in a preset range; and if the difference between the gray-scale energy data and the height exceeds the preset range, judging that the defect in the defect area is a defect.
8. A surface inspection apparatus for inspecting a product having an irregularly textured surface, comprising:
the motion mechanism is used for receiving the product to be detected and driving the product to move along a preset track;
the sensor is used for shooting the product;
a processor coupled to the sensor and the motion mechanism for performing:
controlling the sensor to acquire a 2D image and a 3D height image of the surface of the product to be detected;
obtaining the average standard deviation of the height of the product surface based on the height data of the product surface in the 3D height image;
processing the 2D image to obtain a 2D gray-scale image and a gray-scale energy distribution diagram, marking a region with gray-scale values meeting preset conditions in the 2D gray-scale image as a defect region, and obtaining gray-scale energy data of the defect region;
acquiring the height data of the product surface corresponding to the defect area in the 3D height image, and calculating the height difference value between the height data of the product surface corresponding to the defect area and the height average standard deviation;
judging the defect type of the defect area based on the gray-scale energy data and the height difference value of the defect area, and judging that the defect in the defect area is dirty if the gray-scale energy data and the height difference value are in a preset range; and if the difference between the gray-scale energy data and the height exceeds the preset range, judging that the defect in the defect area is a defect.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the surface detection method according to any one of claims 1 to 6 when the computer program is executed.
10. A computer readable storage medium having a computer program, characterized in that the computer program when executed by a processor implements the steps of the surface detection method according to any one of claims 1 to 6.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311849287.0A CN117871530A (en) | 2023-12-28 | 2023-12-28 | Surface detection method, system, device, computer equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311849287.0A CN117871530A (en) | 2023-12-28 | 2023-12-28 | Surface detection method, system, device, computer equipment and storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN117871530A true CN117871530A (en) | 2024-04-12 |
Family
ID=90584020
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202311849287.0A Pending CN117871530A (en) | 2023-12-28 | 2023-12-28 | Surface detection method, system, device, computer equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN117871530A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119399169A (en) * | 2024-10-30 | 2025-02-07 | 南方电网科学研究院有限责任公司 | A method and device for detecting gold spraying quality |
-
2023
- 2023-12-28 CN CN202311849287.0A patent/CN117871530A/en active Pending
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119399169A (en) * | 2024-10-30 | 2025-02-07 | 南方电网科学研究院有限责任公司 | A method and device for detecting gold spraying quality |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US7221805B1 (en) | Method for generating a focused image of an object | |
| EP0686842B1 (en) | Ophtalmic lens inspection with a double focus illumination | |
| CN108332689A (en) | A kind of optical measuring system and method for detection surface roughness and surface damage | |
| EP1959487B1 (en) | Surface roughness tester | |
| CN106248686A (en) | Glass surface defects based on machine vision detection device and method | |
| CN115791801B (en) | 3D glass online monitoring platform based on machine vision | |
| CN113888539B (en) | Defect classification method, device, equipment and storage medium | |
| CN117871530A (en) | Surface detection method, system, device, computer equipment and storage medium | |
| CN114280075A (en) | Online visual inspection system and method for surface defects of pipe parts | |
| KR20210100992A (en) | Surface inspection method using mold surface inspection device | |
| CN119880946B (en) | A method and system for detecting surface defects of optical lens based on image processing | |
| CN111879789A (en) | Metal surface defect detection method and system | |
| CN113686903A (en) | Optical element defect detection system and detection method | |
| JP4100846B2 (en) | Surface texture inspection method and surface texture inspection apparatus | |
| JP4150390B2 (en) | Appearance inspection method and appearance inspection apparatus | |
| JPH0921628A (en) | Method for detecting surface irregularity defects on a cylindrical test object | |
| CN119395039A (en) | Visual inspection system for saw blade tooth defects based on deep learning model | |
| WO2009133393A1 (en) | Locating inclusions in diamond | |
| CN117907233A (en) | Detection device, circuit board processing equipment and detection method | |
| JP3905741B2 (en) | Optical member inspection method | |
| JP3917431B2 (en) | Optical member inspection method | |
| CN114087981A (en) | Cigarette filter tip laser hole online detection method based on laser polishing method | |
| JPH09138201A (en) | Surface inspection equipment | |
| CN116523882B (en) | Vision-based optical target area accuracy detection method and system | |
| JP2003255217A (en) | Focus adjustment method and device |
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 |