Milling cutter defect automatic detection method and system based on liquid lens, computer readable storage medium and computer program product
Through the automatic detection method based on liquid lenses, combined with multi-position multi-angle imaging and depth of field fusion technology, a panoramic depth of field is generated and a computer vision detection model is used for defect detection, which solves the problems of low milling cutter defect detection efficiency and blurred imaging in the existing technology, and achieves high-precision and efficient defect recognition.
Patent Information
- Application Number
- CN202411908332.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-04-18
AI Technical Summary
Existing milling cutter defect detection methods are inefficient and cannot achieve comprehensive defect detection on milling cutter surfaces of complex geometric shapes, especially milling cutters of multiple depths and complex shapes are difficult to achieve clear imaging and efficient defect recognition.
The automatic detection method based on liquid lens is adopted, by controlling the camera and liquid lens to take images of the milling cutter surface at different diopters, sequence images of different depths of field are obtained, and clarity evaluation, depth of field fusion and alignment are performed to generate panoramic depth of field pictures, and finally defect detection and identification are used using a computer vision detection model.
The defect detection accuracy and detection efficiency of complex shape milling cutters are improved, and comprehensive clear imaging and efficient defect recognition are achieved on milling cutter surfaces of multiple depths and complex geometric shapes.
Smart Images

Figure CN119850542A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of surface defect detection, and in particular to a method, system, computer-readable storage medium and computer program product for automatic detection of milling cutter defects based on a liquid lens. Background Art
[0002] With the development of CNC machining technology, milling cutters are one of the commonly used tools in the machining process. Their machining performance and service life have a direct impact on product quality and production efficiency. Since milling cutters are often subjected to high cutting forces and thermal stresses during use, their blades and cutter bodies are prone to wear, chipping, cracks and other defects. These defects will lead to reduced cutting stability, increased surface roughness, and may even cause the workpiece to be scrapped. Therefore, it is of great industrial significance to effectively detect the defects of milling cutters before they are put into use or during use.
[0003] At present, the detection methods of milling cutter defects in industry are mainly divided into the following categories:
[0004] 1) Manual visual inspection: The operator directly observes the surface of the tool with the help of a magnifying glass or microscope to find defects such as wear, notches or cracks on the blade. This method is highly flexible, but it relies on the operator's experience and subjective judgment, and is easily affected by factors such as visual fatigue and ambient light. Therefore, manual inspection has the disadvantages of strong subjectivity, low efficiency, high misjudgment rate, and difficulty in achieving rapid screening of large quantities of milling cutters.
[0005] 2) Inspection system based on traditional optical imaging: Use an optical lens with a fixed focal length to shoot the surface of the milling cutter, and analyze the image through an image processing algorithm to identify surface defects. Although the traditional optical inspection system can replace manual inspection to a certain extent, due to the complex geometry of the milling cutter and the presence of blades and grooves at different heights on the surface, the focal length needs to be adjusted frequently during the shooting process, and it is impossible to clearly image features at multiple heights at the same time. Therefore, when ordinary optical imaging systems are used to inspect milling cutters with complex geometries, the image is easily blurred due to the limited depth of field, and all details of the blade cannot be fully and clearly observed.
[0006] 3) 3D profile detection and microscopic imaging system: The 3D profile and microscopic details of the milling cutter surface are obtained through laser scanning or 3D microscopy technology. Such systems usually provide high detection accuracy, but due to their complex equipment structure, high hardware cost and low imaging speed, they are difficult to adapt to the needs of large-scale, online detection.
[0007] In general, existing detection methods are either inefficient or limited by the depth of field of the optical system, and cannot achieve comprehensive defect detection on milling cutter surfaces with multiple depths and complex geometries. Therefore, there is an urgent need for an automatic detection method and system that can take into account both multi-depth clear imaging and efficient defect recognition. Summary of the invention
[0008] The object of the present invention is to provide a method, system, computer-readable storage medium and computer program product for automatic detection of milling cutter defects based on liquid lens, so as to solve or at least partially solve the technical problems mentioned in the above background technology.
[0009] To achieve this object, the present invention adopts the following technical solutions:
[0010] In a first aspect, the present invention provides a method for automatic detection of milling cutter defects based on a liquid lens, comprising:
[0011] Position the detection position and measured angle of the milling cutter;
[0012] Control the camera and the liquid lens to capture images of the milling cutter surface with different diopters to obtain sequential images with different depths of field;
[0013] Calculating the clarity evaluation scores of the sequence images of different depths of field and drawing a clarity evaluation curve;
[0014] Based on the clarity evaluation curve, the upper and lower limits of the depth of field are determined to form the depth range of the foreground and the distance for clear imaging;
[0015] intercepting a portion of the images in the sequence of images with different depths of field within the depth range;
[0016] Performing alignment processing on the captured partial images to ensure that the same regions of all images in the partial images are aligned;
[0017] Performing depth of field fusion processing on the partial images after the alignment processing to obtain a full depth of field image of the milling cutter;
[0018] The panoramic depth image is input into a pre-trained computer vision detection model for detection to identify defects on the milling cutter surface.
[0019] Optionally, the calculating the clarity evaluation scores of the sequence images of different depths of field and drawing a clarity evaluation curve specifically includes:
[0020] For each pixel I(x, y) of the captured image, a 3×3 area in its neighborhood is taken as the calculation window;
[0021] Let the pixel value in the neighborhood be:
[0022]
[0023] The horizontal gradient G x For: G x =-I 11 +I 13 -2*I 21 +2*I 23 -I 31 +I 33 ;
[0024] The vertical gradient G y For: G y =-I 11 +2*I 12 -I 13 +I 31 +2*I 32 +I 33 ;
[0025] The gradient magnitude G of pixel I(x, y) is:
[0026]
[0027] The clarity evaluation score S is expressed as the mean value of the gradient amplitude G, that is:
[0028]
[0029] Where N is the total number of pixels in the captured image, G a is the gradient magnitude of the a-th pixel;
[0030] The clarity evaluation curve is a curve drawn according to the obtained clarity evaluation scores.
[0031] Optionally, the method for determining the upper and lower limit focal points of the depth of field specifically includes:
[0032] Assume that the clarity score sequence is S = {s0, s1, ..., s n}, where s i ∈S represents the clarity score of the i-th image;
[0033] For each score s 1≤i≤n-1 i , define the derivative: D before =s i -s i-1 , ,D after =s i+1 -s i ;
[0034] The maximum point is determined according to the maximum judgment condition, and the index record of the maximum point is obtained as a set M, where M = {m1, m2, ..., m k}; Among them, the maximum value judgment condition is set as: D before >0,D after <0 and s i >T, T is:
[0035]
[0036] Divide the upper limit array U and the lower limit array L; U contains the scores of all positions less than the first maximum point m1, and L contains all positions greater than the last maximum point m k The score of U and L is expressed as: U = {s i |0≤i<m1},L={s i |m k <i≤n-1};
[0037] When calculating the upper and lower focal points, the second-order derivative is used to estimate the point where the score changes sharply, as follows:
[0038] By using the finite difference method, the upper limit array U = {u0, u1, ..., u p} Calculate the second-order derivative, implemented as:
[0039] D 2,b =|u b+1 -2u b +u b-1 |, 1≤b≤p-1;
[0040] D 2,b Sort the values and find the threshold T for the top 10% of the largest values upper :
[0041] T upper =Top 10% of {D 2,b};
[0042] Find the first one that satisfies D 2,b ≥T upper The index b of , the corresponding focus position is:
[0043] UpperFocus=startPos+(b+1)×step;
[0044] By using the finite difference method, the lower limit array L = {l0, l1, ..., l q} Calculate the second-order derivative, implemented as:
[0045] D 2,c =|l c+1 -2l c +l c-1 |, 1≤c≤q-1;
[0046] D2,c Sort the values and find the threshold T for the top 10% of the largest values lower :
[0047] T lower =Top 10% of {D 2,c};
[0048] Find the last one that satisfies D 2,c ≥T lower The index c corresponds to the focus position:
[0049] LowerFocus=startPos+(nc)×step.
[0050] Optionally, intercepting a portion of the images in the sequence of images with different depths of field within the depth range specifically includes:
[0051] Assume that the depth index set of the sequence images of different depths of field is D = {d0, d1, ..., d n}, where d i Indicates the depth value corresponding to the i-th image;
[0052] According to the determined upper and lower limits of the depth of field, the depth range of the sequence images with different depths of field is limited to:
[0053] D focus ={d i |UpperFocus≤d i ≤LowerFocus};
[0054] According to the above depth range D focus , intercept part of the images in the sequence of images with different depths of field, and obtain the image set S focus ,Right now:
[0055] S focus ={s i ∣d i ∈D focus}.
[0056] Optionally, the performing alignment processing on the captured partial images to ensure that the same regions of all images in the partial images are aligned, specifically includes:
[0057] Select image set S focus The middle image is used as the reference image I r ; Image set S focus The other images in are collectively referred to as images to be aligned;
[0058] For the image set S focus All images are preprocessed:
[0059] Using the affine matrix, each image to be aligned and the reference image I r Perform image registration to obtain the optimal transformation matrix T for each image to be aligned e ;
[0060] Sequentially align each image to be aligned with the corresponding transformation matrix T e Perform convolution calculation and crop the edges to obtain the aligned image set S focuse .
[0061] Optionally, performing depth of field fusion processing on the partial images after the alignment processing to obtain a full depth of field image of the milling cutter specifically includes:
[0062] The Laplace panoramic deep fusion algorithm is used to align the image set S focuse The images are fused to generate a full-depth image containing information from all focal planes.
[0063] Optionally, the computer vision detection model is a YOLOv5 model, which is used to automatically identify defects, defect types and defect locations on the surface of the milling cutter based on a panoramic depth image of the milling cutter.
[0064] Optionally, the controlling the camera and the liquid lens to capture images of the surface of the milling cutter with different diopters to obtain sequence images with different depths of field specifically includes:
[0065] A plurality of focus adjustment signals are correspondingly set according to a plurality of depths of the milling cutter surface to be photographed; the focus adjustment signals are used to adjust the diopter of the liquid lens;
[0066] Different focal length adjustment signals are transmitted to the liquid lens in sequence, and the camera is controlled to clearly image the surface of the milling cutter at different depths, so as to obtain the sequence images with different depths of field.
[0067] Optionally, before the detection position and the measured angle of the pre-positioning milling cutter, the method further comprises:
[0068] A plurality of detection positions of the milling cutter and a plurality of measured angles at each detection position are preset.
[0069] Optionally, after the panoramic depth image is put into a pre-trained computer vision detection model for detection and the defects on the surface of the milling cutter are identified, the method further includes:
[0070] Determine whether the milling cutter is qualified based on the defect detection results of all measured angles of the milling cutter at all detection positions;
[0071] If there are no defects at all the measured angles of the milling cutter at all the detection positions, the milling cutter is judged to be qualified;
[0072] If the milling cutter is found to have defects, the milling cutter is judged to be unqualified and defect detection information is output;
[0073] The defect detection information includes: the location of each defect and the defect type of each defect.
[0074] In a second aspect, the present invention provides a system for automatic detection of milling cutter defects based on a liquid lens, comprising:
[0075] A rotating table and a milling cutter rotating device arranged on the rotating table;
[0076] A camera and a liquid lens matched with the camera;
[0077] A controller, electrically connected to the rotating table, the milling cutter rotating device, the camera and the liquid lens;
[0078] The controller is used to control the rotation of the rotating table to locate the detection position of the milling cutter; it is also used to control the rotation of the milling cutter rotating device to locate the measured angle of the milling cutter; it is also used to send a focus adjustment signal to the liquid lens to change the diopter of the liquid lens, and control the camera to capture images of the milling cutter surface with different diopters to obtain sequence images with different depths of field;
[0079] A data processing terminal with a trained computer vision detection model;
[0080] The data processing terminal is electrically connected to the camera, and is used to calculate the clarity evaluation scores of the sequence images of different depths of field and draw a clarity evaluation curve; it is also used to determine the upper and lower limit focal points of the depth of field based on the clarity evaluation curve to form the depth range of the foreground and the farthest view of clear imaging; it is also used to intercept partial images in the sequence images of different depths of field within the depth range; it is also used to align the intercepted partial images to ensure that the same areas of all images in the partial images are aligned; it is also used to perform depth of field fusion processing on the partial images after alignment processing to obtain a full depth picture of the milling cutter; it is also used to put the full depth picture into a pre-trained computer vision detection model for detection to identify defects on the surface of the milling cutter.
[0081] Optionally, the calculating the clarity evaluation scores of the sequence images of different depths of field and drawing a clarity evaluation curve specifically includes:
[0082] For each pixel I(x, y) of the captured image, a 3×3 area in its neighborhood is taken as the calculation window;
[0083] Let the pixel value in the neighborhood be:
[0084]
[0085] The horizontal gradient G x For: G x =-I 11 +I 13 -2*I 21 +2*I 23 -I 31 +I 33 ;
[0086] The vertical gradient G y For: G y =-I 11 +2*I 12 -I 13 +I 31 +2*I 32 +I 33 ;
[0087] The gradient magnitude G of pixel I(x, y) is:
[0088]
[0089] The clarity evaluation score S is expressed as the mean value of the gradient amplitude G, that is:
[0090]
[0091] Where N is the total number of pixels in the captured image, G a is the gradient magnitude of the a-th pixel;
[0092] The clarity evaluation curve is a curve drawn according to the obtained clarity evaluation scores.
[0093] Optionally, the method for determining the upper and lower limit focal points of the depth of field specifically includes:
[0094] Assume that the clarity score sequence is S = {s0, s1, ..., s n}, where s i ∈S represents the clarity score of the i-th image;
[0095] For each score s 1≤i≤n-1 i , define the derivative: D before =s i -s i-1 , ,D after =s i+1 -s i ;
[0096] The maximum point is determined according to the maximum judgment condition, and the index record of the maximum point is obtained as a set M, where M = {m1, m2, ..., m k}; Among them, the maximum value judgment condition is set as: D before >0,Dafter <0 and s i >T, T is:
[0097]
[0098] Divide the upper limit array U and the lower limit array L; U contains the scores of all positions less than the first maximum point m1, and L contains all positions greater than the last maximum point m k The score of; U and L are expressed as:
[0099] U={s i |0≤i<m1},L={s i |m k <i≤n-1};
[0100] When calculating the upper and lower focal points, the second-order derivative is used to estimate the point where the score changes sharply, as follows:
[0101] By using the finite difference method, the upper limit array U = {u0, u1, ..., u p} Calculate the second-order derivative, implemented as:
[0102] D 2,b =|u b+1 -2u b +u b-1 |, 1≤b≤p-1;
[0103] D 2,b Sort the values and find the threshold T for the top 10% of the largest values upper :
[0104] T upper =Top 10% of {D 2,b};
[0105] Find the first one that satisfies D 2,b ≥T upper The index b of , the corresponding focus position is:
[0106] UpperFocus=startPos+(b+1)×step;
[0107] By using the finite difference method, the lower limit array L = {l0, l1, ..., l q} Calculate the second-order derivative, implemented as:
[0108] D 2,c =|l c+1 -2l c +l c-1 |, 1≤c≤q-1;
[0109] D 2,cSort the values and find the threshold T for the top 10% of the largest values lower :
[0110] T lower =Top 10% of {D 2,c};
[0111] Find the last one that satisfies D 2,c ≥T lower The index c corresponds to the focus position:
[0112] LowerFocus=startPos+(nc)×step.
[0113] Optionally, intercepting a portion of the images in the sequence of images with different depths of field within the depth range specifically includes:
[0114] Assume that the depth index set of the sequence images of different depths of field is D = {d0, d1, ..., d n}, where d i Indicates the depth value corresponding to the i-th image;
[0115] According to the determined upper and lower limits of the depth of field, the depth range of the sequence images with different depths of field is limited to:
[0116] D focus ={d i |UpperFocus≤d i ≤LowerFocus};
[0117] According to the above depth range D focus , intercept part of the images in the sequence of images with different depths of field, and obtain the image set S focus ,Right now:
[0118] S focus ={s i ∣d i ∈D focus}.
[0119] Optionally, the performing alignment processing on the captured partial images to ensure that the same regions of all images in the partial images are aligned, specifically includes:
[0120] Select image set S focus The middle image is used as the reference image I r ; Image set S focus The other images in are collectively referred to as images to be aligned;
[0121] For the image set S focus All images are preprocessed:
[0122] Using the affine matrix, each image to be aligned and the reference image I r Perform image registration to obtain the optimal transformation matrix T for each image to be aligned e ;
[0123] Sequentially align each image to be aligned with the corresponding transformation matrix T e Perform convolution calculation and crop the edges to obtain the aligned image set S focuse .
[0124] Optionally, performing depth of field fusion processing on the partial images after the alignment processing to obtain a full depth of field image of the milling cutter specifically includes:
[0125] The Laplace panoramic deep fusion algorithm is used to align the image set S focuse The images are fused to generate a full-depth image containing information from all focal planes.
[0126] Optionally, the computer vision detection model is a YOLOv5 model, which is used to automatically identify defects, defect types and defect locations on the surface of the milling cutter based on a panoramic depth image of the milling cutter.
[0127] Optionally, the controlling the camera and the liquid lens to capture images of the surface of the milling cutter with different diopters to obtain sequence images with different depths of field specifically includes:
[0128] A plurality of focus adjustment signals are correspondingly set according to a plurality of depths of the milling cutter surface to be photographed; the focus adjustment signals are used to adjust the diopter of the liquid lens;
[0129] Different focal length adjustment signals are transmitted to the liquid lens in sequence, and the camera is controlled to clearly image the surface of the milling cutter at different depths, so as to obtain the sequence images with different depths of field.
[0130] Optionally, before the detection position and the measured angle of the pre-positioning milling cutter, the method further comprises:
[0131] A plurality of detection positions of the milling cutter and a plurality of measured angles at each detection position are preset.
[0132] Optionally, the data processing terminal is further used to, after inputting the panoramic depth image into a pre-trained computer vision detection model for detection and identifying defects on the surface of the milling cutter, determine whether the milling cutter is qualified according to defect detection results of all measured angles of the milling cutter at all detection positions, including:
[0133] If there are no defects at all the measured angles of the milling cutter at all the detection positions, the milling cutter is judged to be qualified;
[0134] If the milling cutter is found to have defects, the milling cutter is judged to be unqualified and defect detection information is output;
[0135] The defect detection information includes: the location of each defect and the defect type of each defect.
[0136] In a third aspect, the present invention further provides a computer-readable storage medium, in which at least one instruction is stored, and the instruction is loaded and executed by a processor to implement the method for automatic detection of milling cutter defects based on a liquid lens as described above.
[0137] In a fourth aspect, the present invention further provides a computer program product, comprising a computer program / instructions, characterized in that when the computer program / instructions are executed by a processor, the above-mentioned method for automatic detection of milling cutter defects based on a liquid lens is implemented.
[0138] Compared with the prior art, the present invention has the following beneficial effects:
[0139] The liquid lens-based automatic milling cutter defect detection method proposed in the present invention utilizes the dynamic focusing capability of the liquid lens, combines multi-position and multi-angle imaging, collects sequential images of different depths of field and performs depth of field fusion to generate a full depth of field picture, and then uses a computer vision detection model to perform defect detection and identification, thereby improving the defect detection accuracy and detection efficiency of milling cutters with complex shapes. BRIEF DESCRIPTION OF THE DRAWINGS
[0140] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0141] Figure 1 A flow chart of a method for automatic detection of milling cutter defects based on a liquid lens provided in an embodiment of the present invention.
[0142] Figure 2 A system architecture diagram for automatic detection of milling cutter defects based on liquid lenses provided in an embodiment of the present invention.
[0143] Figure 3 A schematic diagram of depth of field fusion processing of an image provided by an embodiment of the present invention.
[0144] Figure 4 A milling cutter and an image of a surface to be inspected thereof are provided in an embodiment of the present invention.
[0145] Figure 5 A sequence of images with different depths of field taken by a milling cutter provided in an embodiment of the present invention.
[0146] Figure 6 The captured image set S provided by the embodiment of the present invention focus .
[0147] Figure 7 The aligned image set S provided in the embodiment of the present invention focuse .
[0148] Figure 8 The image set S provided in the embodiment of the present invention focuse The full depth image of the milling cutter obtained after depth of field fusion processing.
[0149] Fig. 9 This is a schematic diagram of the defect detection information of the milling cutter output after detection by the computer vision detection model.
[0150] Fig.10 A schematic diagram comparing several methods for calculating clarity evaluation scores provided in embodiments of the present invention.
[0151] In the figure:
[0152] 10. Controller; 20. Rotating table; 30. Milling cutter rotating device; 40. Liquid lens; 50. Camera; 60. Data processing terminal. DETAILED DESCRIPTION
[0153] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described below are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0154] Embodiment 1:
[0155] Please refer to Figure 1 , Figure 1 A flow chart of a method for automatic detection of milling cutter defects based on a liquid lens provided in an embodiment of the present invention, the method specifically comprising:
[0156] Step 110, determining the detection position and the measured angle of the positioning milling cutter.
[0157] Exemplarily, in this embodiment, the milling cutter is installed on a milling cutter rotating device, which can be controlled to rotate the milling cutter by itself, thereby adjusting the measured angle of the milling cutter; and the milling cutter rotating device is installed on a rotating table, which can be controlled to drive the milling cutter rotating device to rotate, thereby positioning the milling cutter at a predetermined detection position.
[0158] Therefore, in this embodiment, step 110 also includes a preset step, that is, according to specific requirements of the detection (such as the detection position, part, etc.), a number of detection positions of the milling cutter and a number of measured angles at each detection position are pre-set.
[0159] Step 120 , controlling the camera and the liquid lens to capture images of the surface of the milling cutter with different diopters to obtain sequence images with different depths of field.
[0160] Please refer to Figure 4 and Figure 5 , Figure 4 A milling cutter and an image of a surface to be inspected thereof provided by an embodiment of the present invention, Figure 5 A sequence of images with different depths of field taken by a milling cutter provided by an embodiment of the present invention;
[0161] Exemplarily, in this embodiment, the liquid lens is controlled by a controller; the controller is used to send a preset focal length adjustment signal to the liquid lens to adjust the diopter of the liquid lens; similarly, before step 120, a plurality of focal length adjustment signals need to be set correspondingly according to a plurality of depths of the milling cutter surface to be photographed; the focal length adjustment signal is used to adjust the diopter of the liquid lens;
[0162] Step 120 is specifically implemented as follows: transmitting different focal length adjustment signals to the liquid lens in sequence, controlling the camera to clearly image the surface of the milling cutter at different depths, and obtaining a sequence of images with different depths of field.
[0163] Step 130: Calculate the clarity evaluation scores of the sequence images of different depths of field and draw a clarity evaluation curve.
[0164] Specifically, Fig.10 As shown, Fig.10 A schematic diagram comparing several methods for calculating clarity evaluation scores provided in an embodiment of the present invention;
[0165] The clarity evaluation score is obtained by a clarity calculation algorithm, which includes: variance method, point sharpness method, difference method, gradient method, etc.; illustratively, the present embodiment uses the gradient method to calculate the clarity evaluation score;
[0166] The clarity of an image is closely related to the clarity of the edges and details in the image, and these edges and details appear as areas with larger gradients in the grayscale value changes of the image. Therefore, by calculating the gradient strength of the image, the clarity of the image can be evaluated. Common gradient calculation methods include the Sobel operator, the Laplacian operator, etc. The following is the principle of calculating the clarity evaluation curve using the Sobel gradient method:
[0167] For each pixel I(x, y) of the captured image, a 3×3 area in its neighborhood is taken as the calculation window;
[0168] Let the pixel value in the neighborhood be:
[0169]
[0170] The horizontal gradient G x For: G x =-I 11 +I 13 -2*I 21 +2*I 23 -I 31 +I 33 ;
[0171] The vertical gradient G y For: G y =-I 11 +2*I 12 -I 13 +I 31 +2*I 32 +I 33 ;
[0172] The gradient magnitude G of pixel I(x, y) is:
[0173]
[0174] The clarity evaluation score S is expressed as the mean value of the gradient amplitude G, that is:
[0175]
[0176] Where N is the total number of pixels in the captured image, G a is the gradient magnitude of the a-th pixel;
[0177] The clarity evaluation curve is a curve drawn according to the obtained clarity evaluation scores.
[0178] Step 140: Based on the clarity evaluation curve, determine the upper and lower limits of the depth of field to form the depth range of the foreground and the background for clear imaging.
[0179] The method for determining the upper and lower limits of depth of field is as follows:
[0180] Assume that the clarity score sequence is S = {s0, s1, ..., s n}, where s i ∈S represents the clarity score of the i-th image;
[0181] For each score s 1≤i≤n-1 i , define the derivative: D before =s i -si-1 , ,D after =s i+1 -s i ;
[0182] The maximum point is determined according to the maximum judgment condition, and the index record of the maximum point is obtained as a set M, where M = {m1, m2, ..., m k}; Among them, the maximum value judgment condition is set as: D before >0,D after <0 and s i >T, T is:
[0183]
[0184] Divide the upper limit array U and the lower limit array L; U contains the scores of all positions less than the first maximum point m1, and L contains all positions greater than the last maximum point m k The score of U and L is expressed as: U = {s i |0≤i<m1},L={s i |m k <i≤n-1};
[0185] When calculating the upper and lower focal points, the second-order derivative is used to estimate the point where the score changes sharply, as follows:
[0186] By using the finite difference method, the upper limit array U = {u0, u1, ..., u p} Calculate the second-order derivative, implemented as:
[0187] D 2,b =|u b+1 -2u b +u b-1 |, 1≤b≤p-1;
[0188] D 2,b Sort the values and find the threshold T for the top 10% of the largest values upper :
[0189] T upper =Top 10% of {D 2,b};
[0190] Find the first one that satisfies D 2,b ≥T upper The index b of , the corresponding focus position is:
[0191] UpperFocus=startPos+(b+1)×step;
[0192] By using the finite difference method, the lower limit array L = {l0, l1, ..., l q} Calculate the second-order derivative, implemented as:
[0193] D 2,c =|l c+1 -2l c +l c-1 |, 1≤c≤q-1;
[0194] D 2,c Sort the values and find the threshold T for the top 10% of the largest values lower :
[0195] T lower =Top 10% of {D 2,c};
[0196] Find the last one that satisfies D 2,c ≥T lower The index c corresponds to the focus position:
[0197] LowerFocus=startPos+(nc)×step.
[0198] Step 150: intercepting a portion of the images in the sequence of images with different depths of field within the depth range.
[0199] Please refer to Figure 6 , Figure 6 The captured image set S provided by the embodiment of the present invention focus ;
[0200] Assume that the depth index set of the sequence images of different depths of field is D = {d0, d1, ..., d n}, where d i Indicates the depth value corresponding to the i-th image;
[0201] According to the determined upper and lower limits of the depth of field, the depth range of the sequence images with different depths of field is limited to:
[0202] D focus ={d i |UpperFocus≤d i ≤LowerFocus};
[0203] According to the above depth range D focus , intercept part of the images in the sequence of images with different depths of field, and obtain the image set S focus ,Right now:
[0204] S focus ={s i ∣d i ∈D focus}.
[0205] Step 160: perform alignment processing on the captured partial images to ensure that the same regions of all images in the partial images are aligned.
[0206] Please refer to Figure 7 , Figure 7 The aligned image set S provided in the embodiment of the present invention focuse ;
[0207] Step 170 specifically includes:
[0208] Select image set S focus The middle image is used as the reference image I r ; Image set S focus The other images in are collectively referred to as images to be aligned;
[0209] For the image set S focus Preprocess all images in the image processing: Specifically, perform necessary preprocessing on all depth of field images to ensure that the image quality is suitable for registration: if the image is in color, convert the image to a grayscale image first; adjust the brightness, contrast or histogram of the image as needed to reduce the impact of uneven illumination on the registration result; if the image is noisy, use filtering or denoising methods (such as Gaussian blur) to reduce noise interference;
[0210] Using the affine matrix, each image to be aligned and the reference image I r Perform image registration to obtain the optimal transformation matrix T for each image to be aligned e ;
[0211] Sequentially align each image to be aligned with the corresponding transformation matrix T e Perform convolution calculation and crop the edges to obtain the aligned image set S focuse .
[0212] Step 170: Perform depth of field fusion processing on the partial images after the alignment processing to obtain a full depth of field image of the milling cutter.
[0213] Please refer to Figure 3 and Figure 8 , Figure 3 A schematic diagram of depth of field fusion processing of an image provided by an embodiment of the present invention, Figure 8 The image set S provided in the embodiment of the present invention focuse The full depth image of the milling cutter obtained after depth of field fusion processing;
[0214] Specifically, this embodiment adopts the Laplace panoramic deep fusion algorithm to align the image set S focuse Fusion is performed to generate a panoramic depth image containing all focal plane information; the specific method is:
[0215] like Figure 3 As shown, Figure 3 A schematic diagram of depth of field fusion processing of an image provided by an embodiment of the present invention;
[0216] According to the aligned sequence image S focuse Calculate the corresponding Laplacian image sequence S respectively lap Based on S lap The gray value sequence I(i) of the point (x, y) in the sequence image is used to establish the initial height map D(x, y). The height value of D(x, y) is determined according to the obtained peak position of I(i). Finally, the sequence image S corresponding to the depth is indexed according to the height value k of the initial height map D(x, y). focuse , fill the (x, y) pixels of the k-th image corresponding to height k into the fusion image F(x, y).
[0217] Step 180: Put the panoramic depth image into a pre-trained computer vision detection model for detection to identify defects on the surface of the milling cutter.
[0218] As an optional implementation, the computer vision detection model is a YOLOv5 model, which is used to automatically identify defects, defect types and defect locations on the surface of the milling cutter according to a panoramic depth image of the milling cutter;
[0219] It should be noted that when training the YOLOv5 model, it is necessary to ensure that the full depth of field image contains various defects such as wear, chipping, and cracks; then, use annotation tools (such as LabelImg) to manually annotate the defective area in the image and save it as a label file in YOLO format (including category and center coordinates). Then, organize the annotated images and labels in YOLO format and put them into the training set and validation set respectively; next, configure the YOLOv5 model, modify the number of categories (for example, there are three categories of defects: wear, cracks, and chipping), and create a data.yaml file to specify the training set, validation set path, and category information. Train the model and set the appropriate image size, batch size, and training rounds during the training process. After training, use the test set to evaluate the performance of the model and adjust the hyperparameters as needed to optimize the accuracy. Finally, use the trained model to infer the new image, detect defects on the milling cutter surface, and automatically identify and mark the defective parts.
[0220] It can be understood that the YOLOv5 model is a known deep learning model, so its construction structure and principle are not described in detail in this embodiment.
[0221] Specifically, after step 180, the method further includes:
[0222] Step 190 , judging whether the milling cutter is qualified according to the defect detection results of all measured angles of the milling cutter at all detection positions; if so, executing step 191 ; if not, executing step 192 .
[0223] Step 191: If there are no defects in all the measured angles of the milling cutter at all the detection positions, the milling cutter is determined to be qualified.
[0224] Step 192: If the milling cutter is detected to have defects, the milling cutter is determined to be unqualified and defect detection information is output.
[0225] In step 192, the defect detection information includes: the location of each defect and the defect type of each defect.
[0226] The liquid lens-based automatic milling cutter defect detection method proposed in the present invention utilizes the dynamic focusing capability of the liquid lens, combines multi-position and multi-angle imaging, collects sequential images of different depths of field and performs depth of field fusion to generate a full depth of field picture, and then uses a computer vision detection model to perform defect detection and identification, thereby improving the defect detection accuracy and detection efficiency of milling cutters with complex shapes.
[0227] Embodiment 2:
[0228] Please refer to Figure 2 , Figure 2 The schematic diagram of the structure of a system for automatic detection of milling cutter defects based on a liquid lens provided in an embodiment of the present invention; the system specifically comprises:
[0229] A rotating table 20 and a milling cutter rotating device 30 disposed on the rotating table 20;
[0230] A camera 50 and a liquid lens 40 matched with the camera 50;
[0231] The controller 10 is electrically connected to the rotating table 20, the milling cutter rotating device 30, the camera 50 and the liquid lens 40 respectively;
[0232] The controller 10 is used to control the rotation of the rotating table 20 to locate the detection position of the milling cutter; it is also used to control the rotation of the milling cutter rotating device 30 to locate the measured angle of the milling cutter; it is also used to send a focus adjustment signal to the liquid lens 40 to change the diopter of the liquid lens 40, and control the camera 50 to capture images of the surface of the milling cutter with different diopters to obtain sequence images with different depths of field;
[0233] A data processing terminal 60 having a trained computer vision detection model thereon; in this embodiment, the computer vision detection model adopts a YOLOv5 model;
[0234] The data processing terminal 60 is electrically connected to the camera 50, and is used to calculate the clarity evaluation scores of the sequence images of different depths of field and draw a clarity evaluation curve; it is also used to determine the upper and lower limit focal points of the depth of field based on the clarity evaluation curve to form the depth range of the foreground and the farthest view of clear imaging; it is also used to intercept partial images in the sequence images of different depths of field within the depth range; it is also used to align the intercepted partial images to ensure that the same areas of all images in the partial images are aligned; it is also used to perform depth of field fusion processing on the partial images after alignment processing to obtain a full depth picture of the milling cutter; it is also used to input the full depth picture into a pre-trained computer vision detection model for detection to identify defects on the surface of the milling cutter.
[0235] Since the first embodiment has provided a relatively detailed description of the method for automatic detection of milling cutter defects based on a liquid lens, this part of the content will not be repeated in this embodiment.
[0236] In summary, the system for automatic detection of milling cutter defects based on liquid lenses provided in this embodiment utilizes the advantages of rapid zoom and precise control of focal length of liquid lenses to generate a full-view depth image containing complete depth information of the milling cutter surface, achieves clear imaging without blur, and provides high-quality images for defect detection;
[0237] The milling cutter surface can be inspected in all directions through the multi-angle and multi-viewing angles of the rotating table and the milling cutter rotating device; the image acquisition and depth of field fusion can be completed quickly through automatic calculation of the depth of field range and image alignment, which can greatly improve the inspection efficiency;
[0238] The deep learning model is used to automatically identify defects, reducing the risk of manual misjudgment and missed judgment, and ensuring the accuracy and consistency of detection;
[0239] Therefore, the method of automatic detection of milling cutter defects has significantly improved detection accuracy, imaging quality and operating efficiency, meeting the needs of industrial automation detection.
[0240] Embodiment three:
[0241] This embodiment further provides a computer-readable storage medium, in which at least one instruction is stored. The instruction is loaded and executed by a processor to implement a method for automatic detection of milling cutter defects based on a liquid lens as described in the first embodiment.
[0242] Since the method for automatic detection of milling cutter defects based on liquid lens has been described in detail in the first embodiment, it will not be repeated in this embodiment.
[0243] Embodiment 4:
[0244] The present invention also provides a computer program product, including a computer program / instruction, characterized in that when the computer program / instruction is executed by a processor, a method for automatic detection of milling cutter defects based on a liquid lens as described in Example 1 is implemented.
[0245] Since the method for automatic detection of milling cutter defects based on liquid lens has been described in detail in the first embodiment, it will not be repeated in this embodiment.
[0246] Those skilled in the art can understand that all or part of the steps of the above embodiments can be completed by hardware, or by a program to instruct the relevant hardware to complete, and the program can be stored in a computer-readable storage medium, and the storage medium mentioned above can be a read-only memory, a disk or an optical disk, etc. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0247] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for automatic detection of milling cutter defects based on liquid lens, characterized in that: include: Position the detection position and measured angle of the milling cutter; Control the camera and the liquid lens to capture images of the milling cutter surface with different diopters to obtain sequential images with different depths of field; Calculating the clarity evaluation scores of the sequence images of different depths of field and drawing a clarity evaluation curve; Based on the clarity evaluation curve, the upper and lower limits of the depth of field are determined to form the depth range of the foreground and the distance for clear imaging; intercepting a portion of the images in the sequence of images with different depths of field within the depth range; Performing alignment processing on the captured partial images to ensure that the same regions of all images in the partial images are aligned; Performing depth of field fusion processing on the partial images after the alignment processing to obtain a full depth of field image of the milling cutter; The panoramic depth image is input into a pre-trained computer vision detection model for detection to identify defects on the milling cutter surface.
2. The method for automatic detection of milling cutter defects based on liquid lens according to claim 1, characterized in that: The calculating the clarity evaluation scores of the sequence images of different depths of field and drawing the clarity evaluation curve specifically includes: For each pixel I(x, y) of the captured image, a 3×3 area in its neighborhood is taken as the calculation window; Let the pixel value in the neighborhood be: The horizontal gradient G x For: G x =-I 11 +I 13 -2*I 21 +2*I 23 -I 31 +I 33 ; The vertical gradient G y For: G y =-I 11 +2*I 12 -I 13 +I 31 +2*I 32 +I 33 ; The gradient magnitude G of pixel I(x, y) is: The clarity evaluation score S is expressed as the mean value of the gradient amplitude G, that is: Where N is the total number of pixels in the captured image, G a is the gradient magnitude of the a-th pixel; The clarity evaluation curve is a curve drawn according to the obtained clarity evaluation scores.
3. The method for automatic detection of milling cutter defects based on liquid lens according to claim 1, characterized in that: The method for determining the upper and lower limits of the depth of field specifically includes: Assume that the clarity score sequence is S = {s0, s1, ..., s n }, where si∈S represents the clarity score of the i-th image; For each score s 1≤i≤n-1 i , define the derivative: D before =s i -s i-1 , D after =s i+1 -s i ; The maximum point is determined according to the maximum judgment condition, and the index record of the maximum point is obtained as a set M, where M = {m1, m2, ..., m k }; Among them, the maximum value judgment condition is set as: D before >0,D after <0 and s i >T, T is: Divide the upper limit array U and the lower limit array L; U contains the scores of all positions less than the first maximum point m1, and L contains all positions greater than the last maximum point m k The score of; U and L are expressed as: U={s i |0≤i<m1},L={s i |m k <i≤n-1}; When calculating the upper and lower focal points, the second-order derivative is used to estimate the point where the score changes sharply, as follows: By using the finite difference method, the upper limit array U = {u0, u1, ..., u p } Calculate the second-order derivative, implemented as: D 2,b =|in b+1 -2u b +in b-1 |,1≤b≤p-1; D 2,b Sort the values and find the threshold T for the top 10% of the largest values upper : T upper =Top 10%of{D 2,b }; Find the first one that satisfies D 2,b ≥T upper The index b of , the corresponding focus position is: UpperFocus=startPos+(b+1)×step; By finite difference method, the second-order derivative is calculated for the lower limit array L = {l0, l1, ..., lq}, which is implemented as: D 2,c =|l c+1 -2l c +l c-1 |,1≤c≤q-1; D 2,c Sort the values and find the threshold T for the top 10% of the largest values lower : T lower =Top 10%of{D 2,c }; Find the last one that satisfies D 2,c ≥T lower The index c corresponds to the focus position: LowerFocus=startPos+(nc)×step.
4. The method for automatic detection of milling cutter defects based on liquid lens according to claim 3, characterized in that: The intercepting of a portion of the images in the sequence of images with different depths of field within the depth range specifically includes: Assume that the depth index set of the sequence images of different depths of field is D = {d0, d1, ..., d n }, where d i Indicates the depth value corresponding to the i-th image; According to the determined upper and lower limits of the depth of field, the depth range of the sequence images with different depths of field is limited to: D focus ={d i |UpperFocus≤d i ≤LowerFocus}; According to the above depth range D focus , intercept part of the images in the sequence of images with different depths of field, and obtain the image set S focus ,Right now: S focus ={s i |d i ∈D focus }。 5. The method for automatic detection of milling cutter defects based on liquid lens according to claim 4, characterized in that: The aligning process of the captured partial images to ensure that the same regions of all images in the partial images are aligned includes: Select image set S focus The middle image is used as the reference image I r ; Image set S focus The other images in are collectively referred to as images to be aligned; For the image set S focus All images are preprocessed: Using the affine matrix, each image to be aligned and the reference image I r Perform image registration to obtain the optimal transformation matrix T for each image to be aligned e ; Sequentially align each image to be aligned with the corresponding transformation matrix T e Perform convolution calculation and crop the edges to obtain the aligned image set S focuse .
6. The method for automatic detection of milling cutter defects based on liquid lens according to claim 3, characterized in that: The depth of field fusion processing is performed on the partial images after the alignment processing to obtain a full depth of field picture of the milling cutter, specifically including: The Laplace panoramic deep fusion algorithm is used to align the image set S focuse The images are fused to generate a full-depth image containing information from all focal planes.
7. The method for automatic detection of milling cutter defects based on liquid lens according to claim 1, characterized in that: The computer vision detection model is a YOLOv5 model, which is used to automatically identify defects, defect types and defect locations on the surface of the milling cutter based on a full-depth image of the milling cutter.
8. The method for automatic detection of milling cutter defects based on liquid lens according to claim 1, characterized in that: The controlling camera and the liquid lens to capture images of the surface of the milling cutter with different diopters to obtain sequence images with different depths of field specifically includes: A plurality of focus adjustment signals are correspondingly set according to a plurality of depths of the milling cutter surface to be photographed; the focus adjustment signals are used to adjust the diopter of the liquid lens; Different focal length adjustment signals are transmitted to the liquid lens in sequence, and the camera is controlled to clearly image the surface of the milling cutter at different depths, so as to obtain the sequence images with different depths of field.
9. The method for automatic detection of milling cutter defects based on liquid lens according to claim 1, characterized in that: Before the detection position and the measured angle of the milling cutter are pre-positioned, the method further comprises: A plurality of detection positions of the milling cutter and a plurality of measured angles at each detection position are preset.
10. The method for automatic detection of milling cutter defects based on liquid lens according to claim 9, characterized in that: After the panoramic depth image is input into a pre-trained computer vision detection model for detection and the defects on the surface of the milling cutter are identified, the method further includes: Determine whether the milling cutter is qualified based on the defect detection results of all measured angles of the milling cutter at all detection positions; If there are no defects at all the measured angles of the milling cutter at all the detection positions, the milling cutter is judged to be qualified; If the milling cutter is found to have defects, the milling cutter is judged to be unqualified and defect detection information is output; The defect detection information includes: the location of each defect and the defect type of each defect.
11. A system for automatic detection of milling cutter defects based on liquid lens, characterized in that: include: A rotating table and a milling cutter rotating device arranged on the rotating table; A camera and a liquid lens matched with the camera; A controller, electrically connected to the rotating table, the milling cutter rotating device, the camera and the liquid lens; The controller is used to control the rotation of the rotating table to locate the detection position of the milling cutter; it is also used to control the rotation of the milling cutter rotating device to locate the measured angle of the milling cutter; it is also used to send a focus adjustment signal to the liquid lens to change the diopter of the liquid lens, and control the camera to capture images of the milling cutter surface with different diopters to obtain sequence images with different depths of field; A data processing terminal with a trained computer vision detection model; The data processing terminal is electrically connected to the camera, and is used to calculate the clarity evaluation scores of the sequence images of different depths of field and draw a clarity evaluation curve; it is also used to determine the upper and lower limit focal points of the depth of field based on the clarity evaluation curve to form the depth range of the foreground and the farthest view of clear imaging; it is also used to intercept partial images in the sequence images of different depths of field within the depth range; it is also used to align the intercepted partial images to ensure that the same areas of all images in the partial images are aligned; it is also used to perform depth of field fusion processing on the partial images after alignment processing to obtain a full depth picture of the milling cutter; it is also used to put the full depth picture into a pre-trained computer vision detection model for detection to identify defects on the surface of the milling cutter.
12. The system for automatic detection of milling cutter defects based on liquid lens according to claim 11, characterized in that: The calculating the clarity evaluation scores of the sequence images of different depths of field and drawing the clarity evaluation curve specifically includes: For each pixel I(x, y) of the captured image, a 3×3 area in its neighborhood is taken as the calculation window; Let the pixel value in the neighborhood be: The horizontal gradient G x For: G x =-I 11 +I 13 -2*I 21 +2*I 23 -I 31 +I 33 ; The vertical gradient G y For: G y =-I 11 +2*I 12 -I 13 +I 31 +2*I 32 +I 33 ; The gradient magnitude G of pixel I(x, y) is: The clarity evaluation score S is expressed as the mean value of the gradient amplitude G, that is: Where N is the total number of pixels in the captured image, G a is the gradient magnitude of the a-th pixel; The clarity evaluation curve is a curve drawn according to the obtained clarity evaluation scores.
13. The system for automatic detection of milling cutter defects based on liquid lens according to claim 11, characterized in that: The method for determining the upper and lower limits of the depth of field specifically includes: Assume that the clarity score sequence is S = {s0, s1, ..., s n }, where Si∈S represents the clarity score of the i-th image; For each score s 1≤i≤n-1 i , define the derivative: D before =s i -s i-1 , D after =s i+1 -s i ; The maximum point is determined according to the maximum judgment condition, and the index record of the maximum point is obtained as a set M, M = {m1, m2, ..., m k }; Among them, the maximum value judgment condition is set as: D before >0,D after <0 and s i >T, T is: Divide the upper limit array U and the lower limit array L; U contains the scores of all positions less than the first maximum point m1, and L contains all positions greater than the last maximum point m k The score of; U and L are expressed as: U={s i |0≤i<m1},L={s i |m k <i≤n-1}; When calculating the upper and lower focal points, the second-order derivative is used to estimate the point where the score changes sharply, as follows: By using the finite difference method, the upper limit array U = {u0, u1, ..., u p } Calculate the second-order derivative, implemented as: D 2,b =|in b+1 -2u b +in b-1 |,1≤b≤p-1; D 2,b Sort the values and find the threshold T for the top 10% of the largest values upper : T upper =Top 10%of{D 2,b }; Find the first one that satisfies D 2,b ≥T upper The index b of , the corresponding focus position is: UpperFocus=startPos+(b+1)×step; By using the finite difference method, the lower limit array L = {l0, l1, ..., l q } Calculate the second-order derivative, implemented as: D 2,c =|l c+1 -2l c +l c-1 |,1≤c≤q-1; D 2,c Sort the values and find the threshold T for the top 10% of the largest values lower : T lower =Top 10%of{D 2,c }; Find the last one that satisfies D 2,c ≥T lower The index c corresponds to the focus position: LowerFocus=startPos+(nc)×step.
14. The system for automatic detection of milling cutter defects based on liquid lens according to claim 13, characterized in that: The intercepting of a portion of the images in the sequence of images with different depths of field within the depth range specifically includes: Assume that the depth index set of the sequence images of different depths of field is D = {d0, d1, ..., d n }, where d i Indicates the depth value corresponding to the i-th image; According to the determined upper and lower limits of the depth of field, the depth range of the sequence images with different depths of field is limited to: D focus ={d i |UpperFocus≤d i ≤LowerFocus}; According to the above depth range D focus , intercept part of the images in the sequence of images with different depths of field, and obtain the image set S focus ,Right now: S focus ={s i |d i ∈D focus }。 15. The system for automatic detection of milling cutter defects based on liquid lens according to claim 14, characterized in that: The aligning process of the captured partial images to ensure that the same regions of all images in the partial images are aligned includes: Select image set S focus The middle image is used as the reference image I r ; Image set S focus The other images in are collectively referred to as images to be aligned; For the image set S focus All images are preprocessed: Using the affine matrix, each image to be aligned and the reference image I r Perform image registration to obtain the optimal transformation matrix T for each image to be aligned e ; Sequentially align each image to be aligned with the corresponding transformation matrix T e Perform convolution calculation and crop the edges to obtain the aligned image set S focuse .
16. The system for automatic detection of milling cutter defects based on liquid lens according to claim 13, characterized in that: The depth of field fusion processing is performed on the partial images after the alignment processing to obtain a full depth of field picture of the milling cutter, specifically including: The Laplace panoramic deep fusion algorithm is used to align the image set S focuse The images are fused to generate a full-depth image containing information from all focal planes.
17. The system for automatic detection of milling cutter defects based on liquid lens according to claim 11, characterized in that: The computer vision detection model is a YOLOv5 model, which is used to automatically identify defects, defect types and defect locations on the surface of the milling cutter based on a full-depth image of the milling cutter.
18. The system for automatic detection of milling cutter defects based on liquid lens according to claim 11, characterized in that: The controlling camera and the liquid lens to capture images of the surface of the milling cutter with different diopters to obtain sequence images with different depths of field specifically includes: A plurality of focus adjustment signals are correspondingly set according to a plurality of depths of the milling cutter surface to be photographed; the focus adjustment signals are used to adjust the diopter of the liquid lens; Different focal length adjustment signals are transmitted to the liquid lens in sequence, and the camera is controlled to clearly image the surface of the milling cutter at different depths, so as to obtain the sequence images with different depths of field.
19. The system for automatic detection of milling cutter defects based on liquid lens according to claim 11, characterized in that: Before the detection position and the measured angle of the milling cutter are pre-positioned, the method further comprises: A plurality of detection positions of the milling cutter and a plurality of measured angles at each detection position are preset.
20. The system for automatic detection of milling cutter defects based on liquid lens according to claim 19, characterized in that: The data processing terminal is also used to, after inputting the panoramic depth image into a pre-trained computer vision detection model for detection and identifying the defects on the surface of the milling cutter, determine whether the milling cutter is qualified according to the defect detection results of all measured angles of the milling cutter at all detection positions, including: If there are no defects at all the measured angles of the milling cutter at all the detection positions, the milling cutter is judged to be qualified; If the milling cutter is found to have defects, the milling cutter is judged to be unqualified and defect detection information is output; The defect detection information includes: the location of each defect and the defect type of each defect.
21. A computer-readable storage medium, wherein at least one instruction is stored in the storage medium, characterized in that: The instructions are loaded and executed by the processor to implement a method for automatic detection of milling cutter defects based on a liquid lens as described in any one of claims 1 to 10.
22. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by the processor, the method for automatic detection of milling cutter defects based on a liquid lens as described in any one of claims 1 to 10 is implemented.
Citation Information
Cited By
Wafer defect detection method, wafer defect detection device, wafer defect detection equipment and storage medium
CN121258957A
Depth-of-field fusion method of mold protector
CN121259064A