A method and system for detecting defects on various types of metal surfaces
Through multi-angle lighting and camera combination technology, the problem of unclear imaging of metal surface defects is solved, clear imaging and accurate identification of complex surface defects are achieved, and detection accuracy is improved.
Patent Information
- Application Number
- CN202210859993.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-21
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2042-07-21
AI Technical Summary
When detecting metal surface defects, existing technologies are easily affected by factors such as high reflectivity and shadows on the metal surface, resulting in unclear imaging and difficulty in capturing surface defects such as complex and irregular surfaces, non-fixed directions, slight changes, and concave and convex features.
Using multi-angle lighting and camera combination technology, by collecting pictures under different lighting directions, constructing gradient vector maps and albedo maps, combined with automatic focus adjustment and deep learning algorithms, clear imaging and identification of defects can be achieved.
It effectively eliminates the influence of high reflections and shadows, enables clear imaging and accurate identification of complex surface defects, reduces interference from processing textures and tool cutting lines, and improves detection accuracy.
Smart Images

Figure CN115308223B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of mechanical manufacturing and optical recognition vision technology, in particular to a detection method and system suitable for various types of metal surface defects. BACKGROUND
[0002] During the process of machining or forming from the forging or casting blank to the finished product of the mechanical parts, surface defects such as black skin, lack of meat, holes, shrinkage, spongy, bumps, scratches, indentation, foreign matter and rust spots will inevitably occur. For these surface quality defects, the traditional detection method on most production lines is optical imaging detection, which detects whether there are defects by taking pictures with a camera. However, this detection method has the problem that the part surface defect imaging is not clear due to the influence of the production line environment, such as ambient light, the high reflectivity of the metal material surface and the complex geometry, shadow and the like. The part surface defect features are complex and irregular, in multiple directions and affected by the lighting direction, causing imaging difficulties. In addition, the picture clarity is subjectively judged by humans and the industrial camera focal length is manually adjusted, resulting in a large error. SUMMARY
[0003] Therefore, the present application provides a detection method suitable for various types of metal surface defects, which can clearly image the surface defects of the detection part, and has the following advantages:
[0004] 1. Eliminates the problem of unclear imaging of part surface defects caused by high reflectivity of the metal material surface and shadow and the like;
[0005] 2. Solves the problem of complex irregular, unfixed direction, small changes and concave-convex features of surface defects that are sensitive to illumination layout and affected by the lighting direction, which are difficult to capture;
[0006] 3. Weakens the imaging interference caused by processing texture background and complex tool cutting lines.
[0007] To achieve the above purpose, the present application provides the following technical scheme:
[0008] A detection method suitable for various types of metal surface defects, comprising the following steps:
[0009] S1, picture acquisition: sequentially light and collect pictures of the detection part under different lighting directions according to the picture acquisition rule, to obtain an array of pictures of the detection part under different lighting directions; wherein the lighting direction includes an inclination angle and a rotation angle, the inclination angle is the included angle between the light source beam and the central axis of the camera, and the rotation angle is the included angle between the projection of the light source beam center line and the horizontal right axis of the detection part center;
[0010] S2. Image synthesis: A gradient vector map and albedo map are synthesized from an image array obtained in step S1.
[0011] Preferably, in step S1, sequentially lighting in different lighting directions according to the image acquisition rule and acquiring images of the inspection part includes:
[0012] Light the test piece in different lighting directions in a clockwise or counterclockwise order and collect pictures of the test piece.
[0013] Preferably, the step of sequentially lighting in different lighting directions in a clockwise or counterclockwise order and collecting images of the inspection part includes:
[0014] Lighting was performed in eight lighting directions in a counterclockwise order and eight images of the test piece were collected. The tilt angle of the lighting direction was 30°-60°, and the rotation angle of the lighting direction was [0°, 45°, 90°, 135°, 180°, 225°, 270°, 315°].
[0015] Preferably, in step S2, constructing a gradient vector map and an albedo map from an array of images obtained in step S1 includes:
[0016] According to the tilt angle and rotation angle of the lighting direction and the grayscale value of the image collected under different lighting directions, the pixel value t is generated based on the light source j irradiating the i-th point on the surface of the detection part. ij Diffuse reflection formula: t ij =p i (N i ·L j )l j Find N i Surface unit normal vector, p i Reflectivity, get the gradient vector and albedo of each pixel in the image; where t ij is the pixel value, L j is the unit vector of the light source direction, l j is the light source intensity.
[0017] Preferably, before step S1, the method further includes:
[0018] S0, automatic judgment and adjustment of image clarity.
[0019] Preferably, in step S0, automatically determining and adjusting the image clarity includes:
[0020] S01, controlling the camera focal length to change, within the adjustable range of the focal length, capturing a picture every 0.5 degree step, so that a series of pictures are captured that change from blurry to clear and then blurry again;
[0021] S02, a plurality of definition algorithm functions are used to operate on the series of pictures of step S01 respectively, to obtain the maximum value obtained by each definition algorithm function, i.e. the pointer points to the best picture, and then five results are output by using a voting system rule, and finally a unique clearest picture is output;
[0022] S03, the focal length position of the camera when the picture is collected is obtained reversely according to the pointer of the clearest picture of step S02, and the camera is controlled to run to the focal length position.
[0023] Preferably, after the step S2, further comprising:
[0024] S3, defect detection: for the output albedo map, a threshold segmentation algorithm or a deep learning target detection, image segmentation and adversarial neural network algorithm is used to identify, evaluate and judge the surface defects of the detection piece; and / or for the gradient vector map, a threshold setting method is used to extract the defect feature information of the surface of the detection piece.
[0025] A detection system suitable for various types of metal surface defects, which uses the detection method suitable for various types of metal surface defects as described above for detection, and comprises an optical imaging device, a control system and a photo synthesis system;
[0026] The optical imaging device comprises a camera and a sub-regional multi-angle lighting unit;
[0027] The control system can control the sub-regional multi-angle lighting unit to light in different lighting directions in turn according to the picture collection rule, and control the camera to collect pictures of the detection piece when the sub-regional multi-angle lighting unit lights each time; the photo synthesis system is used to construct and synthesize a gradient vector map and an albedo map from an array of pictures collected by the camera in turn.
[0028] Preferably, the sub-regional multi-angle lighting unit comprises a separate array lamp, a spotlight or an LED lamp; the light source of the sub-regional multi-angle lighting is a polygonal light source or a ring light source, and the ring light source surrounds the camera.
[0029] Preferably, it further comprises a mechanical arm, a movable base and a detection piece positioning clamp;
[0030] The optical imaging device is arranged at the end of the mechanical arm;
[0031] The detection piece positioning clamp is arranged at the movable end of the movable base;
[0032] The control system can control the movement of the mechanical arm and the movable base.
[0033] From the above technical solutions can be seen, the detection method suitable for various types of metal surface defects provided by the application aims to make the surface defects of the detection piece be clearly imaged, which has the following beneficial effects:
[0034] 1. The problem of unclear imaging of the surface defects of the parts caused by high light reflection and shadow of the metal material surface is eliminated;
[0035] 2. The surface defects of the parts, such as complex irregular, direction-unfixed, small change and concave-convex features, which are difficult to capture due to the sensitivity of the part surface to the layout of the illumination and the great influence of the light direction, are solved;
[0036] 3. The imaging interference caused by the machining texture background and complex tool cutting lines is weakened. BRIEF DESCRIPTION OF DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced as follows. Obviously, the drawings in the following description only some embodiments of the application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.
[0038] Figure 1 The flow chart of the detection method suitable for various types of metal surface defects provided by the embodiment of the application;
[0039] Figure 2 The structural schematic diagram of the detection system suitable for various types of metal surface defects provided by the embodiment of the application;
[0040] Figure 3 The structural schematic diagram of the sub-regional multi-angle illumination unit provided by the embodiment of the application;
[0041] Figure 4 The inclination angle schematic diagram provided by the embodiment of the application;
[0042] Figure 5 The rotation angle schematic diagram provided by the embodiment of the application;
[0043] Figures 6a to 6h The pictures collected by the camera in eight light directions in turn provided by the embodiment of the application;
[0044] Figure 6i The finally synthesized picture provided by the embodiment of the application;
[0045] Figure 7 The gradient vector diagram provided by the embodiment of the application. DETAILED DESCRIPTION
[0046] The technical solutions in the embodiments of the present application will be clearly and completely described with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of the present application.
[0047] The detection method suitable for various types of metal surface defects provided by the embodiments of the present application can be used for detecting defects on the surface of various types of metal parts, such as Figure 1 as shown, comprising the following steps:
[0048] S1, picture acquisition: sequentially light and acquire pictures of the detection piece under different lighting directions according to picture acquisition rules to obtain an array of pictures of the detection piece under different lighting directions; wherein the lighting direction includes an inclination angle and a rotation angle, the inclination angle is an included angle between a light beam of a light source and a central axis of a camera, and the rotation angle is an included angle between a projection of a central line of the light beam and a horizontal right axis of the detection piece center;
[0049] S2, picture synthesis: constructing and synthesizing one gradient vector diagram and albedo diagram from the array of pictures obtained in the step S1. Wherein the gradient vector diagram can be seen as shown in Figure 7 .
[0050] It should be noted that the step S1 acquires an array of pictures, and the relative positions of the camera lens and the detection piece are kept fixed when the array of pictures is acquired. One corresponding picture is acquired under different lighting directions every time the light is turned on, and then an array of pictures is obtained by combination. In addition, the lighting direction includes two angle parameters of the inclination angle and the rotation angle, and the lighting direction is the illumination angle of the light source relative to the current position.
[0051] As shown in Figure 4 , the inclination angle is generally selected to be 30-60 degrees.
[0052] As shown in Figure 5 , the rotation angle is usually uniformly distributed around the detection piece, for example, 3 lighting directions are lighted, and the rotation angle should be [0, 120, 240] or [0, 120, -120]. 4 lighting directions are lighted, and the rotation angle should be [0, 90, 180, -90]. It should be noted that the lighting directions of the present scheme cannot be the same, otherwise the reconstructed image result cannot reach the expected effect, and at least three pictures are acquired under different lighting directions. For the surface of some special parts, because of the shadow, three lighting directions cannot well represent the defect characteristics, causing the reconstructed image characteristics to be not obvious. At this time, the lighting direction needs to be increased on the basis of the original, to avoid dead angles. Generally, 4-6 different lighting directions can meet most applications.
[0053] Further, step S2 is to construct a gradient vector map and an albedo map from one picture array, wherein the gradient vector map represents the rate of change vector feature information of the object surface, and the albedo map is not affected by the surface reflection coefficient, thereby creating an image with enhanced contrast and reduced surface noise.
[0054] From the above technical solution, the detection method suitable for various types of metal surface defects provided by the embodiment of the application aims to make the surface defects of the detection piece be clearly imaged, and has the following beneficial effects:
[0055] 1. The problem of unclear imaging of the surface defects of the part caused by high light reflection and shadows on the surface of the metal material is eliminated.
[0056] 2. The surface defects of the part, such as complex irregularities, unfixed direction, small changes and concave-convex features, which are difficult to capture due to the sensitivity of the part surface to the layout of the illumination and the great influence of the direction of the light, are solved.
[0057] 3. The imaging interference caused by the machining texture background and complex tool cutting lines is weakened.
[0058] In the present solution, in order to better eliminate the problem of unclear imaging of the surface defects of the part caused by high light reflection and shadows on the surface of the metal material, in step S1, the pictures of the detection piece are sequentially illuminated and collected in different light directions according to the picture collection rule, which includes:
[0059] The pictures of the detection piece are sequentially illuminated and collected in different light directions in a clockwise or counterclockwise order.
[0060] Further, in order to better represent the defect features of some special part surfaces in different light directions, so that the features of the synthesized pictures are more obvious to achieve the expected effect. As a preferred, the pictures of the detection piece are sequentially illuminated and collected in different light directions in a clockwise or counterclockwise order, which includes:
[0061] Eight pictures of the detection piece are sequentially illuminated and collected in eight light directions in a counterclockwise order; wherein the inclination angle of the light direction is 30°-60°, and the rotation angle of the light direction is [0°, 45°, 90°, 135°, 180°, 225°, 270°, 315°].
[0062] In the present solution, in step S2, the one picture array obtained in step S1 is constructed to synthesize a gradient vector map and an albedo map, which includes:
[0063] According to the inclination angle and rotation angle of the light direction and the gray scale values of the pictures collected in different light directions, based on the diffuse reflection formula of the pixel value t ij generated by the light source j illuminating the i-th point on the surface of the detection piece: tij = p i (N i · L j )l j N i surface unit normal vector, p i albedo, so that the gradient vector and albedo of each pixel in the picture are obtained, that is, a gradient vector diagram and an albedo diagram are constructed from a picture array, as shown in Figure 6i ; wherein t ij is a pixel value, L j is a light source direction unit vector, and l j is light intensity.
[0064] Further, in order to obtain a clearer picture, before the step S1, the method further comprises:
[0065] S0, automatic picture clarity judgment and adjustment.
[0066] Specifically, in the step S0, the automatic picture clarity judgment and adjustment comprises:
[0067] S01, controlling the focal length of the camera to change, and in the adjustable range of the focal length, a picture is collected every 0.5 degrees, so that a series of pictures from blur to clear to blur are collected;
[0068] It should be noted that, under the premise that the distance and position of the camera and the detection piece are unchanged, the small servo motor in the optical imaging device is controlled by the industrial computer to rotate, the focal length of the industrial camera is changed through the gear mechanism, and a picture is taken every 0.5 degrees in the adjustable range of the focal length, so that a series of pictures from blur to clear to blur can be collected at the same position;
[0069] S02, a plurality of clarity algorithm functions are used to operate on the series of pictures of the step S01 respectively, the maximum value obtained by each clarity algorithm function is obtained, that is, the best picture is pointed by the pointer, and finally one clear picture is output by using the voting system rule;
[0070] It should be noted that the plurality of clarity algorithm functions are respectively ① variance algorithm function, ② Laplacian energy function, ③ energy gradient function, ④ Brenner function, and ⑤ Tenegrad function;
[0071] S03, the focal length position of the camera when the picture is collected is obtained in reverse according to the pointer of the clearest picture of the step S02, and the camera is controlled to run to the focal length position.
[0072] Need to explain, according to the pointer of the clearest picture, the focus position of the industrial camera when the picture is taken is obtained reversely, the small servo motor is driven to run to the record position, and the automatic judgment and adjustment of the picture clarity are completed.
[0073] In order to further optimize the above technical scheme, after the step S2, further comprising:
[0074] S3, defect detection: for the output albedo map, the surface defects of the detection piece are identified, evaluated and judged through threshold segmentation algorithm or deep learning target detection, image segmentation and adversarial neural network algorithm; and / or, for the gradient vector map, the defect feature information of the surface of the detection piece is extracted through the threshold setting method.
[0075] The present scheme will be further introduced in combination with specific embodiments:
[0076] The detection method suitable for various types of metal surface defects provided by the present application comprises the following steps:
[0077] 1, shooting preparation
[0078] Picture clarity automatic judgment and adjustment: under the premise that the distance and position of the camera and the shooting object are unchanged, the small servo motor in the optical imaging device is controlled by the industrial computer to rotate, the focal length on the industrial camera is driven through the gear mechanism, in the adjustable range of the focal length, one picture is shot every 0.5 degrees of step, so a series of pictures from blur to clear to blur can be collected at the same position.
[0079] The present embodiment adopts five clarity algorithm functions: ① variance algorithm function ② Laplace energy function ③ energy gradient function ④ Brenner function ⑤ Tenegrad function, which are respectively used to operate the above series of pictures, so that the maximum value obtained by each function can be obtained, that is, the pointer points to the best picture; then the voting system rule is adopted for the five results, and finally only one clearest picture is output.
[0080] According to the pointer of the clearest picture, the focus position of the industrial camera when the picture is taken is obtained reversely, the small servo motor is driven to run to the record position, and the automatic judgment and adjustment of the picture clarity are completed.
[0081] 2, picture acquisition
[0082] The collected picture is a picture array, and the relative position of the camera lens and the object is kept fixed when the picture array is collected, and the shooting image thereof is obtained by changing the light direction clockwise or counterclockwise.
[0083] Lighting direction description: for each picture in the picture array, the lighting direction must specify two angle parameters, the tilt angle and the rotation angle, which describe the lighting angle relative to the current position.
[0084] ① Tilt angle: the angle between the light beam direction and the camera central axis, as shown in Figure 4 , generally selected between 30 degrees and 60 degrees.
[0085] ② Rotation angle: the angle between the projection of the light beam center line and the horizontal right principal axis of the captured image center, as shown in Figure 5 . The rotation angle is usually uniformly distributed around the measured object, such as 3 directions of lighting, the rotation angle should be [0, 120, 240] or [0, 120, -120], 4 directions of lighting is [0, 90, 180, -90]. Note that the lighting direction cannot be the same, otherwise the reconstructed image result will not meet the expected effect. At least three pictures with different lighting directions need to be captured, for some special part surfaces, three directions of lighting cannot well represent the defect features due to shadows, causing the reconstructed image features to be not obvious, at this time, the lighting direction needs to be increased based on the original, to avoid dead angles. Generally, 4-6 different directions of lighting can meet most applications.
[0086] In this embodiment, the tilt angle is set to 30 degrees, and the rotation angle is set to eight directions uniformly distributed, with angles of [0, 45, 90, 135, 180, 225, 270, 315]. At one picture capture position, light from eight rotation angle directions in a counterclockwise direction and capture 8 pictures, the pictures can be seen as shown in Figures 6a to 6h , then combined into a picture array.
[0087] 3. Picture synthesis
[0088] The input picture is a picture array obtained by the above picture capture method, each picture in the picture array is captured under different lighting directions according to the picture capture rule, and the picture attribute requirement is a single channel picture.
[0089] Given the tilt angle and rotation angle of the set lighting direction, the gray value of the captured picture under different lighting directions, based on the diffuse reflection formula of the light source j illuminating the surface of the object i to produce pixel value t ij : t ij = p i (N i · L j )l j , where t ij is the pixel value, L j is the light source direction unit vector, l j is the light source intensity, N i is the surface unit normal vector, and p iReflectivity.
[0090] Thus, the gradient vector and the albedo of each pixel point in the picture are obtained, that is, a gradient vector map and an albedo map are constructed by one picture array, as shown in Figure 6i .
[0091] The gradient vector map represents the rate of change vector feature information of the surface of the object. The albedo map is not affected by the surface reflection coefficient, thereby creating an image with enhanced contrast and reduced surface noise.
[0092] 4. Defect detection
[0093] In this embodiment, the albedo map and the gradient vector map constructed by the above picture synthesis method can be selectively used according to the actual effect.
[0094] ① The albedo map is used to identify, evaluate and judge the surface defects of the measured part through threshold segmentation algorithm or deep learning target detection, image segmentation and adversarial neural network algorithm.
[0095] ② The gradient vector map is used to extract the defect feature information of the surface of the part by setting a threshold method to achieve the purpose of defect detection.
[0096] The embodiment of the present application also provides a detection system suitable for various types of metal surface defects, which uses the detection method suitable for various types of metal surface defects as described above, as shown in Figure 2 , and includes an optical imaging device 20, a control system and a photo synthesis system.
[0097] The optical imaging device 20 includes a camera 21 and a sub-region multi-angle lighting unit 22.
[0098] The control system can control the sub-region multi-angle lighting unit 22 to light in different lighting directions in turn according to the picture acquisition rule, and control the camera 21 to acquire the picture of the detection piece when the sub-region multi-angle lighting unit 22 lights each time; the photo synthesis system is used to construct and synthesize a gradient vector map and an albedo map from one picture array acquired by the camera 21 in turn.
[0099] It should be noted that the optical imaging device 20 is composed of a camera 21 (area array camera), a telecentric lens, a sub-region multi-angle lighting unit 22 and a motor. The area array camera is matched and connected with the telecentric lens, and the area array camera is connected with the image acquisition card configured on the industrial computer mainboard through TCP / IP protocol for image data transmission. The telecentric lens adjusts the focal length through the motor, so that the imaging on the surface of the detection piece is clearer, that is, the problem of large error caused by manual adjustment of the focal length of the industrial camera for the clarity of the picture is solved.
[0100] The camera 21 is a non-distortion imaging, and the camera must be installed perpendicularly to the surface of the detection piece. The camera precision is improved as much as possible according to the actual situation, such as using the full dynamic range of the camera, using images with higher than 8-bit depth (gray scale range 0-65535 instead of 0-255 type images).
[0101] The light source of the sub-regional multi-angle lighting unit 22 requires that the light beams emitted by the light source are parallel and uniform, such as a telecentric lighting light source with uniform intensity, or a point light source at a long distance.
[0102] In addition, since the scheme adopts the above-mentioned detection method suitable for various types of metal surface defects, it also has corresponding beneficial effects, which can be referred to in the foregoing description, and will not be repeated here.
[0103] Specifically, the sub-regional multi-angle lighting unit 22 includes a separate array lamp, a spotlight or an LED lamp; the light source of the sub-regional multi-angle lighting 22 is a polygonal light source or a ring light source, as shown in Figure 2 , and the ring light source surrounds the camera 21. As preferred, as shown in Figure 3 , the light source of the sub-regional multi-angle lighting 22 is a ring light source, and can be independently divided into a plurality of light sources uniformly distributed in the circumferential direction (the direction around the camera 21), which simplifies the light source and lighting layout. Among them, the ring light source is divided into 8 light sources of 45 degrees, and the light source surface forms a certain inclination angle with the horizontal plane, and the inclination angle is preferably 30°. In addition, the sub-regional multi-angle lighting unit 22 adjusts the partition switch node and brightness through the light source controller, which is used to provide light compensation for the surface of the detection piece when collecting images.
[0104] Further, as shown in Figure 2 , the detection system suitable for various types of metal surface defects provided by the embodiment of the application further comprises a mechanical arm 10, a movable base 30 and a detection piece positioning clamp 40;
[0105] The optical imaging device 20 is arranged at the end of the mechanical arm 10;
[0106] The detection piece positioning clamp 40 is arranged at the movable end of the movable base 30;
[0107] The control system can control the movement of the mechanical arm 10 and the movable base 30.
[0108] It should be noted that the movable base 30 is a three-axis base, and the top part of the movable base 30 is provided with a bolt hole for fixing different detection piece positioning clamps 40, and has XYZ three-direction movable slide rails for realizing the position adjustment of the detection piece.
[0109] The mechanical arm 10 is a six-axis mechanical arm connected with a three-axis base, and a clamp is arranged at the top of the mechanical arm for fixing the optical imaging device 20, so as to control the movement of the optical imaging device 20 and realize the position adjustment of the optical imaging device 20 and the detection piece.
[0110] The detection piece positioning clamp 40 is used for fixing the detection piece on the three-axis base and maintaining the fixed position of the optical imaging device 20.
[0111] The control system can control the movement of the mechanical arm 10, the switching node and brightness of the regional multi-angle lighting unit, the position adjustment of the telecentric lens, and the linkage before the acquisition node of the area array camera.
[0112] The following will be further introduced in combination with specific embodiments:
[0113] The detection system suitable for various types of metal surface defects provided by the embodiment has the following operation steps:
[0114] 1. Part positioning: the defect surface of the detection piece is placed on the positioning clamp with the defect surface facing upward.
[0115] 2. Platform positioning: according to the corresponding program selected according to the part to be detected, the XY direction position of the moving platform is automatically adjusted to the scale, and the six-axis mechanical arm loads the optical imaging device and automatically runs to the initial detection position.
[0116] 3. Preparation for shooting: start the motion control linkage system, select the appropriate program according to different detection pieces, and move the six-axis mechanical arm to the upper side of the detection piece through the safety zero position. The optical imaging device confronts the surface of the detection piece at a certain height position and angle posture, and then automatically adjusts the focal length of the camera and judges the image definition until the image definition is adjusted to the optimum.
[0117] 4. Picture acquisition: the detection piece surface is divided into multiple regions and is shot respectively through the profiling operation of the moving platform and the mechanical arm until the entire detected surface is covered. In the shooting process of each region, the relative position between the camera lens and the object is kept fixed, the regional multi-angle lighting unit is sequentially lighted from eight light directions in a counterclockwise direction and 8 pictures are acquired, and the 8 pictures are combined into a picture array.
[0118] 5. Picture synthesis: the picture array acquired through the shooting of each region is constructed into a gradient vector diagram and an albedo diagram of each region through a picture synthesis method and is correspondingly output.
[0119] 6. Defect detection: The gradient vector map and albedo map output for each region are respectively segmented by threshold segmentation method and model obtained by deep learning training, and the defect features of the part surface are extracted. Then according to the defect standard, such as size, quantity and position, etc. Requirements are evaluated, and finally whether the surface defects of the detected part are qualified is judged. The industrial computer outputs the results of whether qualified or not, defect pictures and defect feature information on the display screen.
[0120] 7. The motion platform and the mechanical arm return to the safety zero position and wait for the next detection.
[0121] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0122] The above description of the disclosed embodiments enables a person skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to these embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for detecting defects on various types of metal surfaces, characterized by, It comprises the following steps: S0, automatic judgment and adjustment of picture definition, comprising: S01, controlling the camera focal length to produce changes, in the adjustable range of focal length, collecting a picture every 0.5 degrees of step, so that a series of pictures from blur to clear to blur are collected; S02, using a variety of definition algorithm functions to operate on the series of pictures of step S01 respectively, obtaining the maximum value of each definition algorithm function, that is, the pointer points to the best picture, and then using the voting system rule on the five results, finally outputting only one clearest picture; S03, obtaining the focal length position of the camera when the picture is collected according to the pointer of the clearest picture of step S02, and controlling the camera to run to the focal length position; S1, picture collection: lighting and collecting the pictures of the detection piece in different lighting directions according to the picture collection rule to obtain an array of pictures of the detection piece under different lighting directions; wherein the lighting direction includes an inclination angle and a rotation angle, the inclination angle is the included angle between the light beam of the light source and the central axis of the camera, and the rotation angle is the included angle between the projection of the light beam center line and the horizontal right axis of the detection piece center; S2, picture synthesis: one picture array obtained in S1 is constructed to synthesize a gradient vector map and an albedo map, including: based on the inclination angle and the rotation angle of the light direction, the pixel value t produced by the light source j irradiating the i-th point on the surface of the detection member, and the gray value of the picture collected under different light directions, the diffuse reflection formula: t = p (N · L) l is solved to obtain the surface unit normal vector N, the reflectivity p, and the gradient vector and the albedo of each pixel point in the picture; wherein t is the pixel value, L is the light source direction unit vector, and l is the light source intensity. ij ij i i j j i i ij j j S3, defect detection: for the output albedo map, the threshold segmentation algorithm or the target detection, image segmentation and adversarial neural network algorithm of deep learning are used to identify, evaluate and judge the surface defects of the detection piece; and / or, for the gradient vector map, the threshold setting method is used to extract the defect feature information of the detection piece surface.
2. The method for detecting defects on various types of metal surfaces according to claim 1, wherein In step S1, the lighting and collecting the pictures of the detection piece in different lighting directions according to the picture collection rule comprises: Lighting and collecting the pictures of the detection piece in different lighting directions according to the clockwise or counterclockwise order.
3. The method for detecting defects on various types of metal surfaces according to claim 2, wherein The lighting and collecting the pictures of the detection piece in different lighting directions according to the clockwise or counterclockwise order comprises: Lighting and collecting eight pictures of the detection piece in eight lighting directions in counterclockwise order; wherein the inclination angle of the lighting direction is 30°-60°, and the rotation angle of the lighting direction is [0°, 45°, 90°, 135°, 180°, 225°, 270°, 315°].
4. A system for detecting defects on various types of metal surfaces, characterized by, The detection method is suitable for detecting various types of metal surface defects, and comprises an optical imaging device (20), a control system and a photo synthesis system; The optical imaging device (20) comprises a camera (21) and a split-area multi-angle lighting unit (22); The control system can control the split-area multi-angle lighting unit (22) to light in different lighting directions according to the picture collection rule, and control the camera (21) to collect the pictures of the detection piece when the split-area multi-angle lighting unit (22) lights each time; the photo synthesis system is used to construct and synthesize a gradient vector map and an albedo map from an array of pictures collected by the camera (21) in sequence.
5. The system for detecting defects on various types of metal surfaces according to claim 4, wherein The split-area multi-angle lighting unit (22) comprises a split array lamp, a spotlight or an LED lamp; the light source of the split-area multi-angle lighting unit (22) is a polygonal light source or a ring light source, and the ring light source surrounds the camera (21).
6. The system for detecting defects on various types of metal surfaces according to claim 4, wherein Also include a mechanical arm (10), a movable base (30) and a detection piece positioning clamp (40); The optical imaging device (20) is arranged at the end of the mechanical arm (10); The detection piece positioning clamp (40) is arranged at the movable end of the movable base (30); The control system can control the movement of the mechanical arm (10) and the movable base (30).
Citation Information
Patent Citations
Human-machine interaction equipment and method and computer readable storage medium
CN111741225A
Defect detection device for mirror-like object and detection method thereof
CN112798617A
Inspection apparatus
JP2021004864A
Image Inspection Apparatus, Image Inspection Method, Image Inspection Program, Computer-Readable Recording Medium And Recording Device
US20150355101A1