Line Laser Quality Detection System, Method, Equipment and Storage Medium

Through scanning line laser interference image feature extraction and dual convolutional neural network analysis, the problem that existing laser detectors cannot accurately measure line laser parameters is solved, and efficient and accurate laser quality detection is achieved, reducing labor costs and improving detection consistency.

CN119832343BActive Publication Date: 2025-07-04DALIAN UNIV OF TECH +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510300431.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-14
Publication Date
2025-07-04
Estimated Expiration
2045-03-14

AI Technical Summary

Technical Problem

Existing laser detectors cannot conduct overall detection of line laser interference images, and cannot achieve accurate measurement of line width, line length, curvature and miscellaneous spots. The manual detection efficiency is low, high cost, and is harmful to the health of the detector.

Method used

The scanning linear laser interference image feature extraction method and the parallel miscellaneous spot analysis method of double convolution neural networks are used to accurately obtain and classify the linear laser parameters through image processing and neural network models, including image preprocessing, center point screening, laser line length and curvature calculation, miscellaneous spot detection and other steps.

Benefits of technology

It realizes accurate measurement and classification of wired laser parameters, improves detection efficiency and accuracy, reduces labor costs, ensures consistency and standardization of the detection process, and supports the detection of different models of lasers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119832343B_ABST
    Figure CN119832343B_ABST
Patent Text Reader

Abstract

The present invention provides a line laser quality detection system, method, device and storage medium, belonging to the technical field of laser detection. The present invention proposes a scanning line laser interference image feature extraction method and a double convolutional neural network parallel speckle analysis method, which can accurately detect various parameters of the laser without changing the original image, and the detection accuracy reaches the micron level or even higher; through the automatic processing of the image algorithm, the present invention can quickly complete the detection of a large number of laser images in a short time, and the detection efficiency is significantly improved; the present invention adopts a unified algorithm model and parameter settings, without manual intervention, realizing the standardized detection and processing of all laser images, ensuring the consistency and standardization of the detection process; in addition, the present invention is convenient for data storage and analysis, has strong adaptability, is applicable to the detection of laser images of different models and specifications, and meets the detection requirements in different scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of laser detection, and particularly relates to a line laser quality detection system, method, device, and storage medium. Background Art

[0002] A laser detector can perform real-time imaging of a laser line in the form of a "plane", enabling an operator to obtain the quality classification of a laser by analyzing the image and detection parameters displayed on a screen. Currently, the quality detection of laser lines mainly includes: line width, line length, curvature, and speckles. These detections require workers to measure by visual inspection. The main detection method is as follows: A plane mirror is placed at a distance of 3.5 m from the work station. The worker places the laser to be tested on the table, turns on the laser, and irradiates it onto the mirror. The mirror reflects the laser back to the worker. There is a target at the work station with scales on it. The worker records the line width, line length, and curvature of the laser line by referring to the scales. The worker repeatedly rotates the laser to check the speckle situation, and obtains the laser classification based on the obtained line width, line length, curvature, and speckle situation. The above manual detection method has high requirements for workers' experience, slow production efficiency, high labor costs, large deployment space, and being in a darkroom laser environment for a long time will cause irreversible damage to workers' vision.

[0003] Most existing laser detectors only have the function of detecting circular light beams and can detect the centroid, width, and energy of light spots. Specifically, existing laser detectors use CCD or CMOS to collect light spot information, and hand over the light spot information to a computer for processing through a data acquisition card. After the computer obtains the image information, it first performs gray-scale processing, then filters out stray signals, and finally can obtain the centroid, width, and energy of the laser light spot by calculating the second moment of the laser light spot intensity from the quantization value of the light spot intensity. Using existing laser detectors, only partial areas of the line laser interference image can be detected, and the whole line laser interference image cannot be detected. Moreover, the obtained parameters are limited to the above several parameters, and the detection of line width, line length, curvature, and speckles of the line laser interference image cannot be realized, and the product quality classification of line lasers cannot be achieved. Summary of the Invention

[0004] To solve the above problems in the prior art, the present invention provides a line laser quality detection system and method, and proposes a scanning line laser interference image feature extraction method and a double convolutional neural network parallel speckle analysis method, which can accurately obtain the parameters of line lasers and accurately classify the product quality of line lasers.

[0005] The first aspect of the present invention provides a line laser quality detection method, including the following steps:

[0006] S100, obtaining a laser interference image emitted by a line laser and performing preprocessing;

[0007] S200 performs image binarization on the preprocessed laser interference image, determines the longest continuous region with a gray value of 255 in each column of the binary image, and obtains the center point of this region; screens the center points to obtain a set of valid center points;

[0008] S300 calculates the length of the laser line, the divergence angle of the actual line laser, and the curvature of the laser line based on the set of valid center points;

[0009] S400 calculates the laser line width based on the weighted average of the lengths of the regions with a gray value of 255 in all columns in the middle region of the laser interference image preprocessed by S100;

[0010] S500 obtains a gradient image based on the laser interference image preprocessed by S100 and inputs the gradient image into a speckle detection model to obtain a line laser speckle detection result;

[0011] S600 classifies the laser based on the length, width, divergence angle, curvature of the laser line, and speckles.

[0012] Further, in S100, the preprocessing includes exposure fusion and cropping the region of interest. The specific process is as follows:

[0013] S101, exposure fusion

[0014] Fuses several frames of collected laser interference images to obtain an original laser interference image , the original laser interference image contains various details required for detection;

[0015] S102 crops the region of interest from the image after exposure fusion

[0016] First, binarize the fused image, set the binarization threshold to 200 - 254, find all connected regions with pixels of 255 according to the binarization threshold, and then calculate the centroid pixel point coordinates using the gray - level centroid method. The formula is:

[0017]

[0018] where, is the entire original laser interference image, is the pixel point coordinate in the original laser interference image, is in the original laser interference image the gray value at the location;

[0019] Obtain the centroid pixel point coordinates After that, obtain the boundary of the region of interest, mark the +500th row and the -500 rows, keep the width unchanged, intercept and save the original laser interference image The +500 rows to the -500 rows in the middle area to obtain the laser interference image .

[0020] Furthermore, the specific process of S200 is as follows:

[0021] S201, perform image binarization on the laser interference image Let the laser interference image

[0022] The grayscale value is , where is the coordinate of the pixel point; according to the grayscale threshold = 100 - 140, convert the laser interference image to a binary image , and the grayscale value of the binary image is:

[0023]

[0024] S202, determine the longest continuous region with a grayscale value of 255 in each column of the binary image and obtain the length of this region

[0025] Define R col as the set of pixel points with a grayscale value of 255 in any column of the binary image : R col = { ∣ = 255};

[0026] Determine the longest continuous region in each column R col , denoted as max(R col ); the length of the longest continuous region max(R col ) is :

[0027]

[0028] where and are the starting point ordinate and the ending point ordinate of the longest continuous region max(R col ) respectively;

[0029] S203, calculate and mark the center point of the longest continuous region max(R col ) in each column of the binary image B

[0030] The vertical coordinate of the center point of the longest continuous region max(R col ) is calculated as follows: The calculation formula is:

[0031]

[0032] After obtaining the vertical coordinate of the center point record this point as and mark this point;

[0033] S204. Check the neighborhood near the center point to determine whether it is an isolated point

[0034] Let the neighborhood near the center point be :

[0035]

[0036] If the neighborhood contains multiple points marked as center points, then this center point is not an isolated point and is retained; if the neighborhood does not contain other marked center points, then this center point is an isolated point and this point is filtered;

[0037] S205. Perform image edge denoising on the center points obtained in S204

[0038] To avoid extracting noise points at the top or bottom in the binary image limit the vertical coordinate of the valid points to be between 10% and 90% of the image height :

[0039]

[0040] Finally, form a set of valid center points from all the obtained center points.

[0041] Furthermore, in the above S300, the calculation formula for the length of the laser line is:

[0042]

[0043] where is the length of the laser line, is the pixel size, and are the coordinates of the starting point and the ending point of the valid center point respectively, and β is the magnification factor; where and β can be adjusted according to the parameters of the actual acquisition device;

[0044] The divergence angle of the actual line laser is:

[0045]

[0046] where is the divergence angle, z is the distance between the line laser and the line laser receiving device, which can be adjusted according to the actual situation;

[0047] The calculation method of the laser line curvature is as follows;

[0048] Perform polynomial fitting on the center points in the effective center point set:

[0049]

[0050] where is the order of the polynomial, and the highest order of in the fitting is 2 or 3;

[0051] Use the least squares method to determine the coefficients of the polynomial , that is:

[0052]

[0053] where is the true value, is the fitted value, is the number of center points;

[0054] The laser line curvature can be obtained according to the curve equation obtained by fitting.

[0055] Furthermore, in the S400, the calculation method of the overall width of the laser line is:

[0056] Select every column R on both sides of the central bright spot in the laser line interference image col , take 500 - 600 columns on both the left and right sides, denoted as , and calculate their pixel average width :

[0057]

[0058] where is the number of selected s, is the length of the region with a gray value of 255 in the selected columns;

[0059] Convert to the actual width :

[0060]

[0061] Among them, is the pixel size, and β is the magnification factor.

[0062] Furthermore, in the S500, based on the image preprocessed by S100, a line laser gradient image is obtained. The specific process is as follows:

[0063] Use the Sobel operator to calculate the gradient of the laser interference image in the horizontal direction ( direction) and the vertical direction ( direction) respectively for gradient calculation;

[0064] Calculate the total gradient amplitude according to the gradients in the horizontal and vertical directions. The formula is as follows:

[0065]

[0066] Among them, and are the horizontal gradient and vertical gradient of the laser interference image respectively;

[0067] Normalize the total gradient map and convert it into an integer value between 0 and 255 for convenient subsequent display and storage. The normalization formula is as follows:

[0068]

[0069] Among them, is the normalized gradient image; is the maximum value of the total gradient amplitude, is the minimum value of the total gradient amplitude.

[0070] Furthermore, in the S500, input the gradient image into the speckle detection model to obtain the line laser speckle detection result. The specific method is as follows:

[0071] The speckle detection model consists of two serial neural network models, GNGModel and GModel, which are used to detect and classify the speckle items of the laser;

[0072] The GNGModel model is based on the input gradient image The speckle terms of the laser are classified into two categories: qualified or unqualified. The GNGModel includes three consecutive convolutional layers (each followed by a ReLU activation function, and the first convolutional layer is followed by a max-pooling layer after the activation function), two fully connected layers, and one output layer; the hierarchically connected network is used to gradually extract the local features of the image and reduce the spatial dimension. Specifically, the three convolutional layers use 16, 32, and 64 channels respectively, and capture the feature patterns of the image through 3×3 convolutional kernels; each convolutional layer performs the following operations:

[0073] The size of the input gradient image is , where 、 represent the height and width of the image respectively, the number of channels is , and the two-dimensional convolution operation of the th convolutional layer( =1, 2, 3) is expressed as:

[0074]

[0075] Among them, represents the input feature map of the th convolutional layer; is the convolutional kernel weight, indicating the weight at position of the st input channel and the rd output channel of the th convolutional layer, and position represents the relative position coordinates in the convolutional kernel, ; represents the bias value of the rd output channel of the th convolutional layer; is the ReLU non-linear activation function;

[0076] After passing through the convolutional layer, the spatial resolution of the feature map is further reduced by the max-pooling layer:

[0077]

[0078] Among them, represents the value at position on the output feature map after pooling; represents all the values within the 2×2 window starting from in the input feature map; represents the pooling window range, that is, a fixed-size local area on the input feature map; represents the offset index;

[0079] After completing convolutional feature extraction through 3 convolutional layers in sequence, the feature map is flattened into a one-dimensional vector , where represents the dimension; the flattened one-dimensional vector is input into the first fully connected layer; the first fully connected layer contains 128 neurons, and the mapping relationship is:

[0080]

[0081] where represents the weight matrix; represents the bias vector; is the ReLU non-linear activation function;

[0082] After passing through the first fully connected layer, it is connected to the second fully connected layer to further extract high-dimensional features. The second fully connected layer contains only 1 neuron;

[0083] Then, through the output layer, the Sigmoid function is used to map the features of the fully connected layer to the range of [0, 1]. This value represents the probability that the input gradient image belongs to a qualified speckle item. When the output probability is greater than 0.5, the speckle item of the laser is qualified. When the output probability is less than 0.5, the speckle item of the laser is unqualified. When the output probability is equal to 0.5, since the nature of the speckle item of the laser cannot be determined, for the yield of the product, it is classified as unqualified.

[0084] When the GNGModel model detects that the speckle item of the current laser is unqualified, it proceeds to the next laser speckle item detection; if it is qualified, the GModel model is called to further classify the speckle item of this laser.

[0085] The GModel model can effectively process and classify input data through layer-by-layer feature extraction and dimensionality reduction, and determine whether the laser belongs to Class I or Class II of qualified lasers, where Class I is better than Class II. The GModel model includes 4 convolutional blocks, 2 fully connected layers, and 1 output layer connected in sequence; among them, the first convolutional block includes a convolutional layer, a batch normalization layer, a ReLU activation function, and a max pooling layer connected in sequence. The second to fourth convolutional blocks each include a convolutional layer and a ReLU activation function connected in sequence; the number of channels of the 4 convolutional layers are 16, 32, 32, and 64 respectively;

[0086] After feature extraction through the convolutional layer, the feature map is flattened into a one-dimensional vector and enters the fully connected layer;

[0087] The input dimension of the fully connected layer is the same as that of the GNGModel model. The number of neurons in the first fully connected layer is 128, and the number of neurons in the second fully connected layer is 1;

[0088] The last output layer also uses the sigmoid function to judge the input gradient image; the sigmoid function of the output layer maps the output of the second fully connected layer to the range of [0,1]. When the value given by the sigmoid function is greater than 0.5, it means that the input gradient image belongs to Class I in qualified lasers. If it is less than or equal to 0.5, it means that the input gradient image belongs to Class II in qualified lasers.

[0089] Further, in S600, the lasers are classified through comprehensive evaluation of the length, width, divergence angle of the actual line laser, laser line curvature, and speckle. The specific method is as follows:

[0090] S601, when 120° ≤ ≤ 150°, it is a laser with qualified line length;

[0091] S602, further judge the laser with qualified line length. When the curvature ≥ 100 it is a laser with qualified curvature;

[0092] S603, conduct comprehensive detection of line width and speckle on the laser with qualified curvature to obtain the specific classification of the laser. Specifically: for the products with the speckle item category of Class I in the laser in S500, when its line width mm, the final classification of this product is Class A. When its line width mm, its final classification is Class B. If its line width mm, it is a non-conforming product; for the products with the speckle item category of Class II in the laser in S500, if its line width mm, the final classification of this product is Class B. If its line width mm, it is a non-conforming product.

[0093] The second aspect of the present invention provides a line laser quality detection system, including a laser installation module, a receiving module, a collection module, and a display and processing module;

[0094] The laser installation module is used to debug and install the line laser;

[0095] The receiving module is arranged behind the laser installation module and is used to receive the line laser emitted by the line laser;

[0096] The collection module is used to collect the line laser interference image received by the receiving module and transmit it to the display and processing module;

[0097] The display and processing module is used to store the line laser interference image and perform image processing based on the above method to obtain the line laser parameters and quality detection results.

[0098] Furthermore, in the laser installation module, a laser bracket and a laser fixture are used to install the line laser in the entire system.

[0099] Furthermore, the receiving module includes a double-sided imaging curtain for receiving the light emitted by the line laser.

[0100] Furthermore, the acquisition module includes an image sensor for acquiring the line laser image and transmitting it to the display and processing module.

[0101] Furthermore, the display and processing module includes an image processing unit for receiving the line laser image and processing the line laser image to obtain a detection result.

[0102] In a third aspect of the present invention, an electronic device is further provided, which includes a storage and a processor. The storage stores a computer program, and when the processor executes the computer program, the electronic device executes the above method.

[0103] In a fourth aspect of the present invention, a storage medium is further provided, on which a computer program is stored. When the computer program runs on an electronic device, the electronic device executes the above method.

[0104] The beneficial effects of the present invention are as follows:

[0105] 1) The detection efficiency is greatly improved: In the process of traditional manual detection of laser images, the inspectors need to carefully observe each image one by one, consuming a lot of time and energy. However, through the automated processing of the image algorithm in the present invention, the detection of a large number of laser images can be quickly completed in a short time. This enables timely acquisition of detection results in large-scale production or high-frequency detection scenarios, speeds up the production progress, and improves the overall work efficiency.

[0106] 2) The detection accuracy is significantly improved: When manually detecting laser images, due to various factors such as the subjective factors, fatigue level, and visual errors of the inspectors, it is easy to miss detections and misdetections, resulting in low detection accuracy. The image algorithm of the present invention is based on advanced image processing technologies and algorithm models, and can accurately analyze and identify laser images. The present invention proposes a scanning line laser interference image feature extraction method for the situation where the edges of laser images are overly smooth and there is strong edge noise, while ensuring that the original image is not distorted after processing. It can accurately detect various parameters of the laser without changing the original image, and the detection accuracy can reach the micron level or even higher.

[0107] 3) Reduce labor costs: Manual inspection of laser images requires professional inspectors, and the inspectors need to undergo long-term training and practice to master the inspection skills proficiently. In addition, due to the high intensity and repetitiveness of the inspection work, relatively high labor costs need to be paid. The inspection method of the present invention does not require manual intervention. Just input the image into the system, and the inspection task can be automatically completed.

[0108] 4) Achieve standardization and normalization of the inspection process: When manually inspecting laser images, the inspection standards and methods of different inspectors may vary, resulting in inconsistencies and incomparabilities in the inspection results. The inspection method of the present invention uses a unified algorithm model and parameter settings to perform standardized inspection processing on all laser images, ensuring the consistency and normalization of the inspection process.

[0109] 5) Facilitate data storage and analysis: After manually inspecting laser images, the inspection results are usually stored in the form of paper records or simple spreadsheets. The storage and management of data are relatively difficult, and it is not convenient for subsequent data analysis and traceability. The inspection system of the present invention can automatically store the inspection results in a database in a digital form, including detailed data such as image information, inspection time, inspection results, and defect types. These data can be conveniently queried, statistically analyzed, and provide strong data support for the quality improvement, process optimization, equipment maintenance, etc. of the enterprise.

[0110] 6) Strong adaptability and good scalability: The inspection method of the present invention has strong adaptability and can be applied to the inspection of laser images of different models and specifications, meeting the inspection requirements in different scenarios. In addition, the inspection system of the present invention also has good scalability. Description of the Drawings

[0111] Figure 1 is a schematic diagram of the line laser quality inspection system provided by an embodiment of the present invention.

[0112] Figure 2 is a schematic flow diagram of the line laser quality inspection method provided by an embodiment of the present invention.

[0113] Figure 3 is a schematic diagram for calculating the line length and divergence angle of the line laser in an embodiment of the present invention.

[0114] Figure 4 is a schematic diagram of the principle of the line laser quality inspection system provided by an embodiment of the present invention. Detailed Embodiments

[0115] The following further describes the detailed embodiments of the present invention in conjunction with the drawings and technical solutions.

[0116] Please refer to Figure 1, an embodiment of the present application provides a line laser quality detection system, including: a laser installation module 100, a receiving module 200, a collection module 300, and a display and processing module 400.

[0117] The laser installation module 100 is used to fix the laser and ensure that the laser emitted by it is vertically irradiated onto the receiving module 200. This module is precisely designed and installed using a laser bracket and a laser fixture, which can provide stable support. The module is also equipped with sensors. Based on the actual path of the laser beam monitored by the sensors, the position of the laser is finely adjusted to compensate for the laser line offset problem that may be caused by fixation or other factors.

[0118] The receiving module 200 includes a double-sided imaging curtain for receiving the laser signal from the line laser. Its surface is coated with a transmissive material to enhance the interference effect of the laser on the receiving surface, without introducing new stray light and preventing the laser from directly irradiating the camera and causing damage to the camera.

[0119] The collection module 300 is responsible for precisely collecting the line laser interference image on the receiving module 200. This module is equipped with a high-resolution image sensor. The image sensor focuses the image through an optical lens and uses a filter to filter out stray light to ensure that the collected interference image is clear and accurate, providing high-quality data for subsequent data processing.

[0120] For the convenience of people's subjective perception, the collected line laser interference image is displayed in the display and processing module 400 in a pseudo-color manner. In the laser intensity image, pixels represent specific laser intensity values. According to the numerical value, a color scale is assigned. The sensor expresses the intensity difference through color changes. By compiling a color index table, the intensity value is mapped to a color. A pixel point with an 8-bit gray value has 256 gray levels. Each level is assigned an RGB color combination. Low intensity corresponds to dark colors such as blue, and high intensity corresponds to bright colors such as red. This set of mapping relationships is called a color palette, and different mapping relationships correspond to different color palettes. Usually, cold colors are used to represent low-intensity distributions, and warm colors are used to represent high-intensity distributions. Through the change of hues, the change of laser intensity from low to high is intuitively represented, enhancing the intuitiveness and understandability of the image.

[0121] The display and processing module 400 includes an image processing unit for storing the line laser interference image collected by the collection module 300 and performing image processing; the resolution of the display and processing module 400 is the same as that of the line laser interference image, and its purpose is to be able to completely display the line laser interference image. When the display and processing module 400 obtains the line laser interference image, the line laser interference image is displayed through the display and processing module 400, and the user can customize subsequent processing operations in this module.

[0122] Please refer to Figures 1 - 2, in an environment with illumination of 50 - 100 LUX, the acquisition module acquires a number of line laser interference images. Each line laser interference image is transmitted and stored in the image processing unit, and the image processing unit processes the image to obtain the line laser parameters and quality inspection results. The specific implementation method is as follows:

[0123] S100, preprocess the laser interference image, including exposure fusion and cropping the region of interest;

[0124] Take the laser interference images of 100 microseconds, 5000 microseconds, 60000 microseconds, 70000 microseconds, 90000 microseconds, 100000 microseconds, 150000 microseconds, 200000 microseconds, and 640000 microseconds respectively, and fuse them to obtain the original laser interference image , the image contains various details required for detection.

[0125] Crop the region of interest from the image after exposure fusion: First, binarize the original laser interference image with a binarization threshold of 254 to find all connected regions with pixel value 255, and then calculate their centroids using the gray - level centroid method. The gray - level centroid method is as follows:

[0126]

[0127] Among them, is the entire original laser interference image, is the pixel coordinate in the original laser interference image, is in the original laser interference image the gray - level value at the position;

[0128] After calculating the centroid pixel coordinate points, obtain the boundary of the region of interest, mark the +500th row and the -500th row, keep the image width unchanged, crop and save the original laser interference image the +500th row to the -500th row middle region to obtain the laser interference image .

[0129] S200, perform image binarization processing on the pre - processed laser interference image, determine the longest continuous region with gray - level value 255 in each column of the binary image and obtain the center point of this region, and screen the center points to obtain a set of effective center points; the specific process is as follows:

[0130] S201, perform image binarization processing on the laser interference image

[0131] Set reasonable binarization parameters according to the specific requirements of the industrial site, that is, determine the upper threshold and the lower threshold. In this binarization process, all pixels with gray values lower than the lower threshold will be set to 0 (black), while all pixels with gray values higher than the upper threshold will be set to 255 (white). In one instance, the gray threshold is set to 140, and all pixels higher than 140 are 255, and all pixels lower than 140 are 0. Such a processing method helps to clearly distinguish the foreground and background in the image, enhance the contrast of the image, and make subsequent image analysis and processing more accurate and efficient.

[0132] S202. Determine the longest continuous region with a gray value of 255 in each column of the binary image and obtain the length and center point of this region; this step aims to locate the concentrated regions of significant features or objects in the image, as follows:

[0133] Define R col as the binary image the set of pixel points with a gray value of 255 in any column: R col ={ ∣ = 255};

[0134] Determine the longest continuous region of each column R col and denote it as max(R col ), indicating that this region is the brightest or most important part; the ordinate of the center point of the longest continuous region max(R col ) is calculated by the formula:

[0135]

[0136] where, and are the starting point ordinate and the ending point ordinate of max(R col ) respectively;

[0137] After obtaining the ordinate of the center point , denote this point as and mark this point.

[0138] S203. Detect whether there are other points with a pixel value of 255 near the center point to avoid misidentifying isolated pixels as important features in the image; by checking the neighborhood around the center point, it can be confirmed whether this point belongs to a larger, continuous bright region. If there are also points with a pixel value of 255 near the center point , this indicates that this region may be an important feature in the image rather than an isolated pixel caused by noise or errors in the image processing process; as follows:

[0139] Set the center point The nearby neighborhood is :

[0140] ;

[0141] If the neighborhood contains multiple points marked as the center point, then this center point is not an isolated point and is retained; if there are no other marked center points in the neighborhood , then this center point is an isolated point and this point is filtered out.

[0142] S204. Perform image edge denoising on the center points obtained in S203

[0143] To avoid extracting noise points at the top or bottom in the binary image , limit the ordinate of the valid points to be between 10% and 90% of the image height :

[0144]

[0145] Finally, form a set of valid center points from all the obtained center points.

[0146] S300. Calculate the length of the laser line, the divergence angle of the actual line laser, and the curvature of the laser line based on the set of valid center points; specifically including:

[0147] The calculation formula for the length of the laser line is:

[0148]

[0149] where is the length of the laser line, is the pixel size, and are the starting point and ending point coordinates of the valid center point respectively, and β is the magnification factor; where and β can be adjusted according to the parameters of the actual acquisition device.

[0150] The divergence angle of the actual line laser is:

[0151]

[0152] where is the divergence angle and z is the distance between the laser installation module and the receiving module.

[0153] The calculation method of the laser line curvature is as follows;

[0154] Perform polynomial fitting on the center points in the effective center point set:

[0155]

[0156] Among them, is the order of the polynomial, and the highest order of in the fitting is 2 or 3;

[0157] Use the least squares method to determine the coefficients of the polynomial , that is:

[0158]

[0159] Among them, is the true value, is the fitted value, is the number of center points;

[0160] The laser line curvature can be obtained according to the curve equation obtained by fitting:

[0161]

[0162] S400. Based on the weighted average of the lengths of the regions with a gray value of 255 in all columns in the middle region of the laser line interference image , calculate the laser line width;

[0163] Select each column R on both sides of the central bright spot in the laser line interference image col , take 500 - 600 columns on both the left and right sides, denoted as , and calculate their pixel average width :

[0164]

[0165] Among them, is the number of selected columns, is the length of the region with a gray value of 255 in the selected columns;

[0166] Convert to the actual width L real :

[0167]

[0168] Among them, is the pixel size, and β is the magnification factor.

[0169] S500 obtains a line laser gradient image based on the preprocessed image of S100, and inputs the line laser gradient image into a speckle detection model to obtain line laser speckle parameters; specifically as follows:

[0170] Use the Sobel operator to calculate the gradient of the laser interference image in the horizontal direction ( direction) and the vertical direction ( direction) respectively for gradient calculation;

[0171] Calculate the total gradient amplitude according to the gradients in the horizontal and vertical directions. The formula is as follows:

[0172]

[0173] where, and are the horizontal gradient and vertical gradient of the laser interference image respectively;

[0174] Normalize the total gradient map and convert it into an integer value between 0 and 255 for convenient subsequent display and saving. The normalization formula is as follows:

[0175]

[0176] where, is the normalized gradient image; is the maximum value of the total gradient amplitude, is the minimum value of the total gradient amplitude.

[0177] Input the gradient image into the speckle detection model to obtain the line laser speckle detection result; the speckle detection model is composed of two serial neural network models, GNGModel and GModel, which detect and classify the speckle items of the laser;

[0178] The GNGModel model includes three consecutive convolutional layers (each convolutional layer is connected to a ReLU activation function, and the first convolutional layer is connected to a max pooling layer after the activation function), two fully connected layers, and one output layer; the hierarchically connected network is used to gradually extract the local features of the image and reduce the spatial dimension. Specifically, the three convolutional layers use 16, 32, and 64 channels respectively, and capture the feature patterns of the image through 3×3 convolutional kernels; each convolutional layer performs the following operations:

[0179] The size of the input gradient image is where , represent the height and width of the image respectively, and the number of channels is , the -D convolutional operation of the th convolutional layer ([[]]

[0180]

[0181] where represents the input feature map of the th convolutional layer; is the convolutional kernel weight, representing the weight at position in the th input channel and the th output channel of the th convolutional layer, where position represents the relative position coordinates in the convolutional kernel, ; represents the bias value of the th output channel of the th convolutional layer; is the ReLU non-linear activation function;

[0182] After passing through the convolutional layer, the spatial resolution of the feature map is further reduced by the max pooling layer:

[0183]

[0184] where represents the value at position in the output feature map after pooling; represents all the values within the 2×2 window starting from in the input feature map; represents the pooling window range, i.e., a fixed-size local region on the input feature map; represents the offset index;

[0185] After completing the convolutional feature extraction through 3 convolutional layers in sequence, the feature map is flattened into a one-dimensional vector , where represents the dimension; the flattened one-dimensional vector is input into the first fully connected layer; the first fully connected layer contains 128 neurons, and the mapping relationship is:

[0186]

[0187] where , represents the weight matrix; , represents the bias vector; is the ReLU non-linear activation function;

[0188] After passing through the first fully connected layer, it is connected to the second fully connected layer to further extract high-dimensional features. The second fully connected layer contains only 1 neuron;

[0189] Then, through the output layer, the Sigmoid function is used to map the features of the fully connected layer to the range of [0, 1]. This value represents the probability that the input gradient image belongs to a qualified speckle item. When the output probability is greater than 0.5, the speckle item of the laser is qualified; when the output probability is less than 0.5, the speckle item of the laser is unqualified; when the output probability is equal to 0.5, since the nature of the speckle item of the laser cannot be determined, for the yield of the product, it is classified as unqualified.

[0190] When the GNGModel model detects that the speckle item of the current laser is unqualified, it proceeds to the detection of the next laser speckle item; if it is qualified, the GModel model is called to further classify the speckle item of this laser.

[0191] The GModel model includes 4 consecutive convolutional blocks, 2 fully connected layers, and 1 output layer connected in sequence; among them, the first convolutional block includes a convolutional layer, a batch normalization layer, a ReLU activation function, and a max pooling layer connected in sequence, and the second to fourth convolutional blocks each include a convolutional layer and a ReLU activation function connected in sequence; the number of channels of the 4 convolutional layers are 16, 32, 32, and 64 respectively;

[0192] After feature extraction through the convolutional layer, the feature map is flattened into a one-dimensional vector and enters the fully connected layer;

[0193] The input dimension of the fully connected layer is the same as that of the GNGModel. The number of neurons in the first fully connected layer is 128, and the number of neurons in the second fully connected layer is 1;

[0194] Finally, the output layer also uses the sigmoid function to judge the input gradient image; the sigmoid function of the output layer maps the output of the second fully connected layer to the range of [0, 1]. When the value given by the sigmoid function is greater than 0.5, it means that the input gradient image belongs to Class I of qualified lasers; if it is less than or equal to 0.5, it means that the input gradient image belongs to Class II of qualified lasers.

[0195] S600, classify the laser based on the length, width, divergence angle of the actual line laser, laser line curvature, and speckle parameters; specifically as follows:

[0196] S601, when 120° ≤ ≤ 150°, then it is a laser with qualified line length;

[0197] S602, further judge the laser with qualified line length. When the curvature ≥ 100 When it is, it is a laser with qualified curvature;

[0198] S603. Perform comprehensive detection of line width and speckle on the laser with qualified curvature to obtain the specific classification of the laser. Specifically: for the products in the S500 with the speckle item category of Class I for the laser, when its line width mm, then the final classification of this product is Class A. When its line width mm, then its final classification is Class B. If its line width mm, it is a non-conforming product; for the products in the S500 with the speckle item category of Class II for the laser, if its line width mm, then the final classification of this product is Class B. If its line width mm, it is a non-conforming product.

[0199] For 3 lasers, detect the parameters of these 3 lasers respectively according to the above method, and use the manual detection method to detect the parameters of these 3 lasers respectively. The error between the laser line length measured by the method of the present invention and the laser line length measured by the manual detection method, and the error between the laser line width measured by the method of the present invention and the laser line width measured by the manual detection method are shown in Table 1; according to the detection results of line length and line width, the error between the method of the present invention and the manual detection method is small, verifying the reliability of the method of the present invention.

[0200]

[0201] This embodiment provides an electronic device. The electronic device can be a server, including a processor, a memory, a network interface, and a database connected through a system bus. Among them, the processor is used to provide computing and control capabilities; the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the electronic device executes the method provided in the above embodiment.

[0202] This embodiment also provides a computer-readable storage medium. A computer program is stored in the computer-readable storage medium. When the computer program is executed by the electronic device, the electronic device executes the method provided in the above embodiment.

[0203] The above are only the preferred embodiments of the present invention, and do not impose any form of limitation on the present invention. Any person skilled in the art can make many possible changes and modifications to the technical solution of the present invention, or modify it into an equivalent embodiment with equivalent changes, without departing from the scope of the technical solution of the present invention. Therefore, all equivalent changes made according to the shape, structure and principle of the present invention without departing from the content of the technical solution of the present invention shall be covered by the protection scope of the present invention.

Claims

1. A method for detecting the quality of a line laser, characterized in that, It includes the following steps: S100, obtaining the laser interference image emitted by the line laser and performing preprocessing; S200, performing image binarization on the preprocessed laser interference image, determining the longest continuous region with a gray value of 255 in each column of the binary image, and obtaining the center point of this region; Screening the center points to obtain a set of effective center points; S300, calculating the length of the laser line, the divergence angle of the actual line laser, and the laser line curvature based on the set of effective center points; The divergence angle of the actual line laser , is the divergence angle, is the length of the laser line, and z is the distance between the line laser and the line laser receiving device; S400, calculating the laser line width based on the weighted average of the lengths of the regions with a gray value of 255 in all columns in the middle region of the preprocessed laser interference image; S500, obtaining a gradient image based on the preprocessed laser interference image and inputting the gradient image into a speckle detection model to obtain the line laser speckle detection result; S600, classifying the laser based on the width, divergence angle, laser line curvature, and speckles of the laser line.

2. The quality inspection method of a line laser according to claim 1, wherein In S100, the preprocessing includes: S101, fuse several frames of collected laser interference images to obtain an original laser interference image ; S102, binarize the original laser interference image Find all connected regions with pixel value 255 according to the binarization threshold, and then calculate the centroid pixel coordinates using the gray centroid method. The formula is as follows: Among them, is the entire original laser interference image, is the pixel point coordinates in the original laser interference image, in the original laser interference image is the gray value at the position; Obtain the coordinates of the centroid pixel After that, obtain the boundary of the region of interest and mark the +500th row and the -500th row, keep the width unchanged, intercept and save the original laser interference image The +500th row to the -500th row middle area to obtain the laser interference image .

3. A method for detecting the quality of a line laser according to claim 1, characterized in that, The specific process of S200 is: S201, perform image binarization on the laser interference image obtained after preprocessing ​ Set the laser interference image The gray value is , where is the coordinate of the pixel point; According to the gray threshold Convert the laser interference image into a binary image , the gray value of the binary image is: S202, determine the binary image The longest continuous region with a gray value of 255 in each column Define R col as a binary image The set of pixels with a gray value of 255 in any column: R col ={ | = 255}; Determine each column R col The longest continuous region, denoted as max(R col ); S203, calculate and mark the binary image The center point of the longest continuous region max(R col ) in each column The ordinate of the center point of the longest continuous region max(R col ) The calculation formula is as follows: Among them, and are the starting point ordinate and the ending point ordinate of max(R col ), respectively; Obtain the ordinate of the center point After that, denote this point as and mark this point; S204, Check the center point The nearby neighborhood, judge Whether it is an isolated point Set the center point The nearby neighborhood is : If the neighborhood contains multiple points marked as the center point, then this center point is not an isolated point and is retained; if there are no other marked center points in the neighborhood , then this center point is an isolated point and this point is filtered out; S205, performing image edge denoising on the center points obtained in S204 To avoid extracting noise points at the top or bottom in the binary image the ordinate of the valid points is restricted to be between 10% and 90% of the image height : Finally, all the obtained center points are combined into a set of effective center points.

4. A method for detecting the quality of a line laser according to claim 1, characterized in that, In S300, the calculation formula for the length of the laser line is: Among them, is the length of the laser line, is the pixel size, and are the starting point and ending point coordinates of the effective center point respectively, and β is the magnification factor; The calculation method of the laser line curvature is as follows; Performing polynomial fitting on the center points in the set of effective center points: Among them, is the order of the polynomial, and in the fitting the highest order is 2 or 3; Determine the coefficients of the polynomial using the least squares method , that is: Among them, is the real value, is the fitted value, is the number of center points; Obtain the laser line curvature according to the curve equation obtained by fitting .

5. A method for detecting the quality of a line laser according to claim 1, characterized in that In S400, the calculation method for the overall width of the laser line is: Select each column R on both sides of the central bright spot in the laser line interference image Take 500 - 600 columns on each of the left and right sides, denoted as col Calculate their average pixel width : Among them, is the selected quantity, is the length of the region with a gray value of 255 in the selected column; Convert to the actual width : Wherein, is the pixel size, and β is the magnification factor.

6. The quality inspection method of a line laser according to claim 1, characterized in that In the S500, first, calculate the gradient of the preprocessed laser interference image respectively in the horizontal and vertical directions; calculate the total gradient magnitude based on the gradients in the horizontal and vertical directions; perform normalization on the total gradient map and convert it into an integer value between 0 and 255 ; Then input it into the input noise detection model, which is composed of two serial neural network models, namely the GNGModel and the GModel. Among them, The GNGModel model includes 3 convolutional layers, 2 fully connected layers, and 1 output layer connected in sequence; among them, each convolutional layer is connected to a ReLU activation function, and the first convolutional layer is connected to a max pooling layer after the activation function; each convolutional layer performs the following operations: The size of the input gradient image is , where , represent the height and width of the image respectively, and the number of channels is . The two-dimensional convolution operation of the th convolutional layer is expressed as: Among them, represents the input feature map of the th convolutional layer; is the convolutional kernel weight, representing the th convolutional layer at the th input channel and the th output channel, the weight at position , and position represents the relative position coordinates in the convolutional kernel, ; represents the bias value of the th output channel of the th convolutional layer; is the ReLU non-linear activation function; After passing through the convolutional layer, the spatial resolution of the feature map is further reduced by the max pooling layer: Among them, represents the value at position on the feature map output after pooling; represents all the values within the 2×2 window starting from in the input feature map; represents the pooling window range, that is, a fixed-size local area on the input feature map; represents the offset index; After the convolutional feature extraction is completed through 3 convolutional layers in sequence, the feature map is flattened into a one-dimensional vector , where represents the dimension; the flattened one-dimensional vector is input into the first fully connected layer; the first fully connected layer contains 128 neurons, and the mapping relationship is: Among them, represents the weight matrix; represents the bias vector; is the ReLU non-linear activation function; After passing through the first fully connected layer, it is connected to the second fully connected layer to further extract high-dimensional features. The second fully connected layer only contains 1 neuron; then, after passing through the output layer, the Sigmoid function is used to map the features of the fully connected layer to the range [0,1]. This value represents the probability that the input gradient image belongs to a qualified speckle item; when the output probability is greater than 0.5, the speckle item of the laser is qualified, otherwise, the speckle item of the laser is unqualified; When the GNGModel model detects that the speckle item of the current laser is unqualified, it proceeds to the next laser speckle item detection; if it is qualified, the GModel model is called to further classify the speckle item of this laser into Class I or Class II, where Class I is better than Class II; The GModel model includes 4 convolutional blocks, 2 fully connected layers, and 1 output layer connected in sequence; among them, the first convolutional block includes a convolutional layer, a batch normalization layer, a ReLU activation function, and a max pooling layer connected in sequence, and the second to fourth convolutional blocks each include a convolutional layer and a ReLU activation function connected in sequence; After feature extraction through the convolutional layer, the feature map is flattened into a one-dimensional vector and enters the fully connected layer; the input dimension of the fully connected layer is the same as that of the GNGModel model, the number of neurons in the first fully connected layer is 128, and the number of neurons in the second fully connected layer is 1; finally, the output layer also uses the sigmoid function to judge the input gradient image; the sigmoid function of the output layer maps the output of the second fully connected layer to the range of [0,1]. When the value given by the sigmoid function is greater than 0.5, it belongs to Class I of qualified lasers, otherwise, it belongs to Class II of qualified lasers.

7. A method for detecting the quality of a line laser according to claim 6, characterized in that, The method of S600 is as follows: S601, when 120° ≤ ≤ 150°, it is a laser with qualified wire length; S602, further judge the laser with qualified line length. When the curvature ≥100 is reached, it is a laser with qualified curvature; S603, comprehensively detect the line width and speckle of the lasers with qualified curvature to obtain the specific classification of the lasers. Specifically: for the products with the speckle item category of Class I for the lasers, when its line width mm, the final classification of this product is Class A; when its line width mm, its final classification is Class B; if its line width mm, it is a non-conforming product. For the products with the speckle item category of Class II for the lasers, if its line width mm, the final classification of this product is Class B; if its line width mm, it is a non-conforming product.

8. A line laser quality detection system, characterized in that, It includes a laser installation module, a receiving module, a collection module, and a display and processing module; The laser installation module is used to debug and install the line laser; The receiving module is arranged behind the laser installation module and is used to receive the line laser emitted by the line laser; The collection module is used to collect the line laser interference image received by the receiving module and transmit it to the display and processing module; The display and processing module is used to store the line laser interference image and perform image processing using the detection method described in any one of claims 1-7 to obtain the line laser parameters and quality detection results.

9. An electronic device, characterized in that, It includes a storage and a processor. The storage stores a computer program. When the processor executes the computer program, the electronic device executes the detection method described in any one of claims 1-7.

10. A storage medium, characterized in that, A computer program is stored thereon. When the computer program runs on an electronic device, the electronic device executes the detection method described in any one of claims 1-7.

Citation Information

Patent Citations

  • Ultra narrow line-width semiconductor laser with folded outer cavity

    CN105406356A

  • Three-dimensional scanning intelligent guiding method and system

    CN111486801A