CN115201202A - Apparatus and method for detecting and measuring surface defects of products - Google Patents

Apparatus and method for detecting and measuring surface defects of products Download PDF

Info

Publication number
CN115201202A
CN115201202A CN202210757297.0A CN202210757297A CN115201202A CN 115201202 A CN115201202 A CN 115201202A CN 202210757297 A CN202210757297 A CN 202210757297A CN 115201202 A CN115201202 A CN 115201202A
Authority
CN
China
Prior art keywords
image
defect
detecting
defects
parameters
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210757297.0A
Other languages
Chinese (zh)
Inventor
陈扬
张�杰
顾宇浩
周壮壮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhongke Suzhou Intelligent Computing Technology Research Institute
Original Assignee
Zhongke Suzhou Intelligent Computing Technology Research Institute
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhongke Suzhou Intelligent Computing Technology Research Institute filed Critical Zhongke Suzhou Intelligent Computing Technology Research Institute
Priority to CN202210757297.0A priority Critical patent/CN115201202A/en
Publication of CN115201202A publication Critical patent/CN115201202A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan 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
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/01Arrangements or apparatus for facilitating the optical investigation

Abstract

The invention discloses a device and a method for detecting and measuring surface defects of products, wherein the device comprises a projector for projecting structured light to the surface of a product to be detected passing through a production line in real time, a camera for capturing the surface image of the product to be detected projected with the structured light in real time, and a computer connected with the projector and the camera through a bus, wherein the computer receives a collected image from the camera, detects and measures the surface defects of an object and quantifies the size specification through an image processing algorithm preset by the computer. The machine vision detection method for calibrating, learning parameters, setting parameters, correcting images, detecting and analyzing defects in real time improves the detection capability of three-dimensional defects on the surface of an object, especially has the improvement effects of accuracy, instantaneity, flexibility and the like in comparison with the traditional detection method, reduces the hardware requirement on a computer, and has outstanding cost performance.

Description

Apparatus and method for detecting and measuring surface defects of products
Technical Field
The present invention relates to industrial applications of machine vision, and more particularly, to an apparatus and method for detecting and measuring surface defects of products.
Background
Machine vision is the analysis of images to provide basic recognition and analysis capabilities to industrial equipment. With the gradual advance of industrial digitization, intelligent transformation and intelligent manufacturing, industrial machine vision gradually forms a large-scale industry, and gradually deepens into various scenes of industrial production along with the falling of artificial intelligence technology in the industrial field. The task of surface defect detection is a fundamental research topic in the field of machine vision, and the objective of the task is to automatically distinguish different object surface conditions, and the task is applied to many practical tasks, such as 3C product surface defect detection, mobile phone cover glass detection, wafer surface detection and the like.
In the course of industrial transformation and upgrading, transformation is moving from a rough machining and manufacturing model that relies excessively on low labor costs to full automation, high added value and high productivity. In the production line of the old industrial system, the defects on the surface of the product are mainly observed by human eyes, the difference of subjective will occurs in the manual detection mode, the detection efficiency is low along with the lengthening of the working time, and the method cannot be suitable for the social production rhythm of high-speed intelligence. The surface defect detection method based on machine vision is characterized in that the surface image of an object is shot through a camera, the type and the position of a defect are calculated through a vision analysis algorithm, and the process of observation by human eyes is replaced. The surface defect detection method based on machine vision has the advantages of non-contact measurement, long-time stable work, no influence of severe working environment and the like, and is favored by a plurality of enterprises.
Current industry and academia research on structured light based surface defect detection still remains in the simple task level of detecting defects on the surface of a non-textured object using conventional two-dimensional machine vision algorithms. For example, caulier et al (2007) propose a grating pattern feature algorithm with a certain universality, but the method is less robust to illumination and requires a large amount of computation. Kemao et al (2006) propose a method for detecting abnormal defects based on template matching and window Fourier transform, which is improved in real-time performance, but is sensitive to illumination changes, and the algorithm is low in universality and robustness. In addition, some research works apply abnormal feature extraction methods such as Gabor filters, wavelet transformation, attention mechanism, and the like. The advertising scheme based on structured light defect detection comprises: the patent relates to a defect detection method based on a structured light metal plate, which is applied by combined fertilizer copper crown information science and technology Limited liability company (2021), wherein a to-be-detected stripe picture is multiplied by corresponding pixel points in a standard stripe picture respectively so as to solve a phase and position the defect based on height information of the metal plate; a new technology application research institute (2020) in Beijing market provides a product light-reflecting surface defect detection method, and surface defects are positioned based on edge detection and morphological filtering methods; in addition, hunan science and technology Limited (2020) can detect and calculate the tiny deformation such as the glass rib by transmitting the grating stripe to the glass to be detected and adopting the virtual moire stripe technology to obtain the information such as the size, the position and the like of the conventional defect.
In view of the current situation of surface defect detection research at home and abroad, the following problems can be found: first, the existing machine vision inspection devices lack universality. Most defect detection methods are to acquire the image of the surface of an object by using traditional illumination modes such as diffusion illumination, directional illumination and the like, and a camera can acquire texture defects but cannot effectively capture structural defects. Although current deep learning neural networks can extract deeper features, defects cannot be detected from images in which the camera does not capture the defects. Therefore, the inefficient illumination mode for the object surface directly results in poor defect detection effect of the existing machine vision device.
Secondly, the existing machine vision detection devices are not robust enough. Most detection devices can effectively detect under ideal working environment, and when the environment changes, for example, the working distance of a camera, a clear image of an image, the illumination intensity, the reflection of light of a material, the hardware shake in a feeding process and the like cause the failure of a detection algorithm. Therefore, to ensure effectiveness under different environments, a more stable defect detection algorithm and a more stable system need to be designed.
Thirdly, the real-time performance of the existing machine vision detection device is not high. For industrial application scenarios with high detection requirements, the existing device needs a large amount of computation in the process of detecting defects, resulting in a long detection time, for example, a deep learning algorithm, which requires both a large amount of convolution computation and expensive computing equipment.
Finally, existing machine vision inspection devices lack the ability to rate and evaluate defects. The existing machine vision detection device is difficult to define a set of unified defect standards in different working environments.
Disclosure of Invention
Aiming at the defects in the prior art, the invention provides a device and a method for detecting and measuring the surface defects of products, and solves the problems of lack of universality, robustness, instantaneity, defect grading and the like in the field of industrial production in the detection of the surface defects of the products through the adjustment of devices and the reconstruction of the detection method.
The technical solution of the present invention to achieve the above object is an apparatus for detecting and measuring surface defects of a product, characterized by comprising:
the projector is used for projecting structured light to the surface of a product to be detected passing through the production line in real time;
the camera is used for capturing the surface image of the product to be detected of the projected structural light in real time;
and the computer is connected with the projector and the camera through a bus, and is used for outputting the structured light to the projector, receiving the acquired image from the camera, detecting and measuring the surface defects of the object and quantizing the size specification through an image processing algorithm preset by the computer.
Further, the projector is set to project light with blue light as structured light, and the structured light is set to be grating stripes.
The technical solution of the present invention for achieving the above another object is a method for detecting and measuring surface defects of a product, which is realized based on the apparatus of any one of claims 1 to 3 and uses a grating as structured light, characterized by comprising:
s1, calibrating a device, and mapping an inclined grating image area to an ideal coordinate system by calculating the mapping relation between an imaging area of a projector and an ideal coordinate to obtain a grating image parallel to a Y axis;
s2, learning parameters, namely projecting sinusoidal grating stripes to a scene through a projector by using samples on the surfaces of different materials through a projection and view finding range, and learning pattern characteristics including template characteristics, a noise threshold, a defect threshold, a background brightness threshold and measurement parameters;
s3, setting parameters, and setting defect parameters at least including dislocation length and size through a computer according to detection requirements;
s4, correcting the image, namely correcting the inclined grating image input by the camera into an ideal grating image which is vertical to the stripe direction of the grating by utilizing the mapping relation obtained in the step of calibrating the device in the working stage;
s5, real-time detection, namely inputting the corrected ideal grating image into a computer, segmenting an object and detecting defects of the input image by the computer based on the learning parameters and the setting parameters, outputting an image containing all defect information meeting the requirements of a user,
and S6, analyzing the defects, extracting the connected domain characteristics of the defect information by adopting a connected domain analysis algorithm, converting the connected domain characteristics into real-world defect quantitative characterization based on the measurement parameters, and filtering and outputting the defect quantitative characterization or image characterization, which is defined by a user, of the surface of the product to be detected based on the preset defect parameters.
Compared with the traditional manual detection or other machine vision detection methods, the technical solution for detecting and measuring the surface defects of the product provided by the invention has the remarkable progressive summary that: the method has the advantages that the detection capability of the three-dimensional defects on the surface of the object is improved, especially, compared with the traditional detection method, the method has the improvement effects of accuracy, instantaneity, flexibility and the like, the hardware requirement on a computer is reduced, and the cost performance is outstanding.
Drawings
FIG. 1 is a schematic view of the apparatus for detecting and measuring surface defects of products according to the present invention.
FIG. 2 is a schematic flow chart of the method for detecting and measuring the surface defects of the product according to the present invention.
FIG. 3 is a projection grating pattern for the inspection method of the present invention.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the accompanying drawings, and it is to be understood that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention. The terms "above" and "below" in the present invention are intended to include the essential numbers. Unless otherwise indicated, the technical means used in the examples are conventional means well known to those skilled in the art. It should be noted that: the calculation refers to the calculation automatically run by hardware or software after the algorithm/method provided by the invention is recorded, and does not refer to artificial calculation; when the algorithm/method provided by the invention is used for camera calibration, the finally obtained calibration result is not transferred by the will of people.
As can be seen from the schematic diagram of the hardware structure of the device shown in fig. 1, the device mainly includes three parts, namely a projector, a camera and a computer. From the function definition, the projector is used for projecting structured light to the surface of the product to be detected passing through the production line in real time; the camera is used for capturing the surface image of the product to be detected of the projected structured light in real time; the projector and the camera are integrated into a whole and fixedly connected to a portal frame through which the production line passes, and the projection angle of the projector and the shooting distance and angle of the camera are adjustable. In addition, a computer bus, not shown, is connected to the projector and the camera, and is configured to output the structured light to the projector, receive the collected image from the camera, detect and measure defects on the surface of the object, such as scratches, stains, scratches, and bruises, and quantify the dimension specification through an image processing algorithm preset by the computer.
The device solves the problem of lack of universality from the data acquisition perspective. The projector is used for projecting a grating image on the surface of the detected object, and the significance of the surface defect of the object is enhanced based on the principle that the grating generates distortion at the defect, so that the camera can effectively acquire the two-dimensional texture defect and the three-dimensional structure defect.
The device designs an effective defect detection method to solve the problem of robustness. The blue light with less existence in the nature is selected as the light projected by the structured light, and certain robustness is provided for the ambient light.
Based on the structural description of the above detection and measurement device, the realizability of the detection method thereof is further understood by the following description in conjunction with the technical route of the apparatus. The technical route of the device is shown in fig. 2, and the device needs to be learned before use, and comprises three steps of device calibration, parameter learning and parameter setting. The general description is as follows: s1, calibrating a device, and mapping an inclined grating image area to an ideal coordinate system by calculating the mapping relation between an imaging area of a projector and an ideal coordinate to obtain a grating image parallel to a Y axis; s2, learning parameters, namely projecting sinusoidal grating stripes to a scene through a projection and view-finding range by using samples on the surfaces of different materials, and learning pattern characteristics including template characteristics, noise threshold values, defect threshold values, background brightness threshold values and measurement parameters; and S3, setting parameters, and setting defect parameters at least including dislocation length and size through a computer according to detection requirements. And after the learning process is finished, outputting the defect information of the surface of the object when the system works, and mainly comprising the steps of image correction, real-time detection and defect analysis. The general description is as follows: s4, correcting the image, namely correcting the inclined grating image input by the camera into an ideal grating image which is vertical to the stripe direction of the grating by utilizing the mapping relation obtained in the step of calibrating the device in the working stage; s5, real-time detection is carried out, an ideal grating image after image correction is input into a computer, the computer divides an input image into targets and detects defects based on learning parameters and set parameters, an image containing all defect information meeting the requirements of a user is output, S6, the defects are analyzed, connected domain features of the defect information are extracted by adopting a connected domain analysis algorithm, the connected domain features are converted into defect quantitative characterization of a real world based on measurement parameters, and the defect quantitative characterization or the image characterization meeting the definition of the user on the surface of a product to be detected is filtered and output based on preset defect parameters.
From a more detailed description: firstly, calibrating the device, and acquiring the surface information of an object by adopting a mode of projecting a stripe pattern on the object by a projector and shooting by a camera. In an actual environment, the direction of the grating stripes is difficult to keep consistent with the vertical direction of the imaging of the camera, so that the direction of the grating projection pattern in the actually acquired image is variable, and the difficulty is increased for a later-stage feature extraction algorithm. Therefore, the device maps the inclined grating image area into an ideal coordinate system by calculating the mapping relation between the projector imaging area and the ideal coordinate, and obtains the grating image parallel to the Y axis. The ideal coordinate system has the knowledge and definition used by those skilled in the art, and in terms of the production line, the plane of the conveyor belt is the XY plane, the conveying direction of the product to be detected is parallel to the Y axis, and the height of the product to be detected is the Z axis.
The calibration process of the device is as follows, firstly, a checkerboard pattern is projected on the surface of an object; then extracting the position of the outermost corner point in the checkerboard image, and establishing a perspective transformation relation from the corner point position to an ideal coordinate; finally, the fringe-oblique raster image is corrected to an ideal raster image by using the perspective transformation relation.
Learning parameters, wherein when the system works, a projector projects sinusoidal grating stripes to a scene, and sinusoidal waveforms acquired by a camera have different characteristics such as period, phase, amplitude and the like in different working environments and working distances; in addition to this. The projected light is absorbed, refracted, reflected and the like on the surface of the material, and the sinusoidal pattern acquired by the camera is deformed. Before the device works, the sinusoidal pattern characteristics of the surfaces made of different materials are learned, so that the device can be flexibly applied to different environments. The features to be learned are: template features, noise thresholds, defect thresholds, background brightness thresholds, measurement related parameters, and the like.
(1) The template features are made up of a series of sinusoidal data of different phases and periods. The device acquires a flawless surface pattern of an object to be detected, extracts normalized positive selection waveforms with different phases and different periods through an image processing algorithm, and forms a template library. Each template in the template library is sinusoidal data for one cycle, as shown in FIG. 3.
(2) And the noise threshold is used for the real-time detection stage to judge whether a certain data segment is matched with the moduleAnd (3) a plate. The device uses a template matching algorithm to take each segment of data in a non-defective surface image, matches the segment of data with a template in a template library and finds the best matched template. Before template matching, normalization processing is performed on the surface image without defects. The Mean Absolute Error (MAE) between each segment of data in the defect-free surface image and all templates in the template library is calculated as a noise threshold value according to the formula
Figure 100002_DEST_PATH_IMAGE002
Wherein, in the step (A),
Figure 100002_DEST_PATH_IMAGE004
is a vector of the template, and is,
Figure 100002_DEST_PATH_IMAGE006
is an image vector. And the template with the smallest error is the matched template, and the error is the matching error.
(3) And the defect threshold is used for judging whether a certain data segment contains defects or not in the real-time detection stage. The device uses a template matching algorithm to match the surface image with the defects with the templates in the template library, calculates the matching error of all data segments in the image and sorts the data segments from small to large. And the defect threshold value is the kth value in all matching errors, wherein the k value is determined by the proportion of the defect in the image and is the value number set by user definition.
(4) And the background brightness threshold is used in a real-time detection stage and is used for segmenting a target area and a background area in the image. Because the reflection coefficients of the surfaces made of different materials for the projector light are different, for example, the surfaces made of smooth materials are generally made of glass, display screens and the like, when the pattern projector generates mirror reflection on the surface of the pattern projector, the brightness of an image captured by a camera is often low; the projected pattern of the rough material generates diffuse reflection on the surface, and the brightness of the image captured by the camera is often higher. The device projects a full-bright pattern on the background material based on the difference of the surface reflection coefficients of the target material and the background, and takes the brightness average value of the background material image as a background brightness threshold value for segmenting a target area and a background area in the image.
(5) And the measurement parameters (or parameters related to the measurement) are used for a real-time detection stage and represent the mapping relation between the image coordinates and the real world. The device can detect the shape and the position of the defect in the image, and can also measure the parameters of the actual size, the perimeter, the area and the like in the real world.
And then setting parameters, and detecting the defects meeting the requirements by setting the parameters according to the requirements of users, wherein the main parameters comprise dislocation length, defect size and the like.
(1) The defect size and the tolerance of different products to the defects are different in practical industrial application. For example, in some glass inspection items, a defect with the longest edge of 0.2mm on the surface of glass is allowed to appear, and a defect with the longest edge of 0.1mm on one surface of glass is still good. Therefore, the device can meet different requirements in practical application by setting parameters of the defect size.
(2) In practical industrial application, a set of unified judgment standards for defects in different devices is difficult to be provided due to different illumination intensities, different working distances and other imaging factors. The device provides a defect definition standard as a dislocation judgment method. The dislocation means that a certain position in the data segment is shifted to the left or the right by a certain length, and when a certain data segment of the image has a defect, a large error exists between the normalized image data segment and the matched template thereof at the defect. Assuming that the position with error is x, if the value at the position x of the data segment is equal to the value of the template shifted left or right by len pixels, the shift length is len. A dislocation threshold value is set in the dislocation judgment method, when the dislocation length is larger than the threshold value, the pixel is judged to be a defect, otherwise, the pixel is judged to be noise.
After the preparation before detection is finished, image correction is carried out, and because the direction of grating stripes is difficult to keep consistent with the vertical direction of camera imaging in the actual environment, the direction of grating projection patterns in the actually obtained image is variable, and the difficulty is increased for the real-time detection process. The device corrects the input inclined grating image into an ideal grating image with vertical stripe direction in the working stage based on the perspective transformation relation obtained in the device calibration step.
And then real-time detection is carried out, and all defects meeting the requirements of users are output based on the learning parameters and the setting parameters in the stage. The input image of the stage is an ideal raster image, and the output is the defect information in the image, including the position, width and height of the defect in the image, and the parameters of the defect in the real world, such as perimeter, area and longest edge. In this stage, the target is mainly divided and the defect is detected.
In practical industrial application, when the shape of an object to be detected is irregular or the visual field of a camera is large, the grating image is mixed with a part of background area, which affects the effectiveness of a defect detection algorithm. The device segments a target area and a background area by using a learned background brightness threshold value based on the reflection capability of different materials to different projected patterns and based on a thresholding method. In addition, the edge of the object also has a part of defects, such as edge breakage defects. The device fills the target area by fitting the edge of the target area by using methods such as a circle, an ellipse and a polygon.
And in the defect detection stage, all defects meeting the conditions of the dislocation judgment method are detected in the image based on the definition of the defects by the user. The detection method mainly comprises two parts of template matching-based anomaly detection and defect area calculation.
Specifically, all abnormal regions in the image are detected through template matching, and the abnormal regions include defect regions and noise in the image. Normalizing the image data; performing template matching on the normalized grating image based on the target area image and a template library to generate a template image; calculating the error between the template image and the normalized grating image to generate an error image, wherein the error calculation method is an absolute error; and generating a dislocation threshold image based on the template image, performing thresholding operation on the error image, and marking the region which is larger than the corresponding threshold in the error image as an abnormal region. Filling the abnormal image to obtain an ideal matching grating image; calculating an error with the normalized grating image to generate an error image; then, the error image is thresholded based on the misalignment threshold image, and a defect region image is generated. The filling method of the abnormal image is supplemented by using values around the abnormal region, for example, taking an average value of surrounding pixels.
Finally, the defect is analyzed, and all the information of the defect, such as the position, the width and the height of the defect in the image, the parameters of the defect in the real world, such as the perimeter, the area and the longest edge, and the like, are extracted based on the image of the defect region. And extracting a connected domain of the defect by adopting a connected domain analysis algorithm, converting the characteristics of the connected domain into the real world based on the measurement related parameters obtained in the learning stage, and measuring the information such as the size, the perimeter, the area and the like of the defect. In addition, the device filters the defect which does not meet the requirement based on the tolerance requirement of the user on the defect, and outputs the defect information defined by the user on the surface of the product.
The invention designs a set of effective defect detection algorithm aiming at the industrial environment of various scenes, and has accurate and stable detection capability in the environments of unfixed working distance of a camera, changed image definition, uneven illumination intensity, material reflection, hardware jitter in the feeding process and the like. The calculated amount of the method is less than one ten thousandth of the calculated amount of the existing various detection methods, and the detection speed is obviously improved on the basis of ensuring the detection performance. Meanwhile, due to the miniaturization improvement of the calculated amount, the hardware requirement on the computer is reduced, the real-time requirement of the industry can be met only by a common computer without the assistance of expensive parallel computing equipment such as a display card, an FPGA and the like, and the requirement of most industrial applications can be met.
In summary, the detailed description of the embodiments of the apparatus and method for detecting and measuring surface defects of products according to the present invention describes the significant progress of the method compared to the conventional manual inspection or other machine vision inspection methods.
(1) The universality is high: the device projects a grating pattern on the surface of an object, captures defects by using a camera, and finally detects the defects by a machine vision algorithm. The method can detect plane two-dimensional defects such as scratches and abrasion, and has good detection capability for three-dimensional defects on the surface of an object, such as bulges, depressions, bruises and the like.
(2) The accuracy is high: the device is based on a machine vision technology, overcomes the influence of an external environment on a defect detection function, and has higher robustness on complex application environments with uneven brightness and the like. In the practical application scene, the device overcomes the jitter influence of an object in the transmission process, and has the defects that the omission ratio is lower than 0.05 percent, the error detection ratio is lower than 0.5 percent, and the minimum size of one pixel can be detected.
(3) The real-time performance is high: the machine vision technology of the device provides a quick and effective defect detection algorithm. The detection speed for a 500 ten thousand pixel image is 20 milliseconds calculated on a common desktop.
(4) The flexibility is high: the device is small in size, does not need complex calibration in the installation process, can complete the calibration process only by placing a calibration plate in a specific area, and is flexible in application scene.
(5) The cost performance is high: the device has low requirement on hardware, only needs a common computer, can meet the industrial real-time requirement without the assistance of expensive parallel computing equipment such as a display card, an FPGA and the like, and simultaneously meets the accuracy requirement of most industrial applications.
(6) The device designs a set of method for grading and judging the defects, and effectively defines the defect standard to be detected in different working environments according to the requirements of customers.
Although the preferred embodiments of the present invention have been described above with reference to the accompanying drawings, the present invention is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and those skilled in the art can make various changes and modifications within the spirit and scope of the present invention without departing from the spirit and scope of the appended claims.

Claims (8)

1. Apparatus for detecting and measuring surface defects of a product, comprising:
the projector is used for projecting structured light to the surface of a product to be detected passing through the production line in real time;
the camera is used for capturing the surface image of the to-be-detected product of the projected structured light in real time;
and the computer is connected with the projector and the camera through a bus and used for outputting the structured light to the projector, receiving the collected image from the camera, detecting and measuring the surface defect of the object and quantifying the size specification through an image processing algorithm preset by the computer.
2. The apparatus for detecting and measuring surface defects of a product according to claim 1, wherein: the projector is set to be light projected by taking blue light as structured light, and the structured light is set to be grating stripes.
3. The apparatus for detecting and measuring surface defects of products according to claim 1, wherein: the projector and
the cameras are integrated into a whole and fixedly connected to a portal frame through which the production line passes, and the projection angle of the projector and the shooting distance and angle of the cameras are adjustable.
4. Method for detecting and measuring surface defects of products, based on the device of any one of claims 1 to 3, with a grating as structured light, characterized in that it comprises:
s1, calibrating a device, and mapping an inclined grating image area to an ideal coordinate system by calculating the mapping relation between an imaging area of a projector and an ideal coordinate to obtain a grating image parallel to a Y axis;
s2, learning parameters, namely projecting sinusoidal grating stripes to a scene through a projection and view-finding range by using samples on the surfaces of different materials, and learning pattern characteristics including template characteristics, noise threshold values, defect threshold values, background brightness threshold values and measurement parameters;
s3, setting parameters, namely setting defect parameters at least comprising dislocation length and size through a computer according to detection requirements;
s4, correcting the image, namely correcting the inclined grating image input by the camera into an ideal grating image which is vertical to the stripe direction of the grating by utilizing the mapping relation obtained in the step of calibrating the device in the working stage;
s5, real-time detection, namely inputting the corrected ideal raster image into a computer, dividing the target of the input image and detecting defects by the computer based on the learning parameters and the setting parameters, outputting an image containing all defect information meeting the requirements of a user,
and S6, analyzing the defects, extracting the connected domain characteristics of the defect information by adopting a connected domain analysis algorithm, converting the connected domain characteristics into the defect quantitative characterization of the real world based on the measurement parameters, and filtering and outputting the defect quantitative characterization or the image characterization, which accords with the user definition, of the surface of the product to be detected based on the preset defect parameters.
5. The method for detecting and measuring surface defects of a product according to claim 4, wherein: the template characteristics in the learning parameters are to obtain a flawless surface pattern of the object to be detected, normalized positive selection waveforms with different phases and different periods are extracted through an image processing algorithm, and a template library is formed;
the noise threshold is the average absolute error of all templates in the template library of each piece of data in the calculated defect-free surface image
Figure DEST_PATH_IMAGE002
Wherein
Figure DEST_PATH_IMAGE004
Is a vector of the template, and is,
Figure DEST_PATH_IMAGE006
is an image vector;
the defect threshold is obtained by matching the surface image with the defects with the templates in the template library, and calculating the matching errors of all data sections in the image and the number of values which are set in a user-defined manner after the data sections are sorted from small to large;
the background brightness threshold is obtained by projecting a full-bright pattern on the background material of the product to be detected and taking the brightness average value of the background material image;
the measurement parameters represent the correspondence of the image coordinates to the real world.
6. Method for detecting and measuring surface defects of products according to claim 4, characterized in that: and defining a dislocation judgment method in the set parameters, and judging whether an error exists at a corresponding position with the matching template after the image data segment is normalized according to the phase deviation at a certain position in the data segment.
7. Method for detecting and measuring surface defects of products according to claim 4, characterized in that: and in the real-time detection, the segmentation target is a target area extracted based on a background brightness threshold, and edge fitting is carried out on the target area.
8. The method for detecting and measuring surface defects of a product according to claim 4, wherein: the detecting defects in the real-time detection comprises the following steps: the method comprises the steps of firstly, detecting abnormality based on template matching, obtaining an abnormal region containing a defect region and image noise through a template matching and dislocation judging method, and then obtaining a defect region image through defect region calculation.
CN202210757297.0A 2022-06-30 2022-06-30 Apparatus and method for detecting and measuring surface defects of products Pending CN115201202A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210757297.0A CN115201202A (en) 2022-06-30 2022-06-30 Apparatus and method for detecting and measuring surface defects of products

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210757297.0A CN115201202A (en) 2022-06-30 2022-06-30 Apparatus and method for detecting and measuring surface defects of products

Publications (1)

Publication Number Publication Date
CN115201202A true CN115201202A (en) 2022-10-18

Family

ID=83578375

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210757297.0A Pending CN115201202A (en) 2022-06-30 2022-06-30 Apparatus and method for detecting and measuring surface defects of products

Country Status (1)

Country Link
CN (1) CN115201202A (en)

Similar Documents

Publication Publication Date Title
CN109816678B (en) Automatic nozzle atomization angle detection system and method based on vision
CN108921176B (en) Pointer instrument positioning and identifying method based on machine vision
Di Leo et al. A vision system for the online quality monitoring of industrial manufacturing
Rege et al. 2D geometric shape and color recognition using digital image processing
CN107945184A (en) A kind of mount components detection method positioned based on color images and gradient projection
CN108596880A (en) Weld defect feature extraction based on image procossing and welding quality analysis method
CN106501272B (en) Machine vision soldering tin positioning detection system
CN110517265A (en) A kind of detection method of surface defects of products, device and storage medium
US8315457B2 (en) System and method for performing multi-image training for pattern recognition and registration
CN113847881A (en) Free-form surface profile tolerance detection method based on machine vision
CN111539927A (en) Detection process and algorithm of automobile plastic assembly fastening buckle lack-assembly detection device
CN110189375A (en) A kind of images steganalysis method based on monocular vision measurement
EP4226225A1 (en) A line clearance system
CN114280075A (en) Online visual inspection system and method for surface defects of pipe parts
CN112304957A (en) Machine vision-based intelligent detection method and system for appearance defects
CN108109154A (en) A kind of new positioning of workpiece and data capture method
CN109671084B (en) Method for measuring shape of workpiece
CN108805854B (en) Method for rapidly counting tablets and detecting completeness of tablets in complex environment
CN115184362A (en) Rapid defect detection method based on structured light projection
CN111344553B (en) Method and system for detecting defects of curved object
CN111833350A (en) Machine vision detection method and system
CN115201202A (en) Apparatus and method for detecting and measuring surface defects of products
Di Leo et al. Online visual inspection of defects in the assembly of electromechanical parts
CN115343313A (en) Visual identification method based on artificial intelligence
CN109087278B (en) Condom front and back recognition method based on improved Canny operator

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