Line laser quality detection system, method and equipment and storage medium
Through the scanning linear laser interference image feature extraction method and the parallel miscellaneous spot analysis method of double convolutional neural network, the problem that the existing technology cannot conduct comprehensive quality detection of linear lasers is solved, and the accurate acquisition of linear laser parameters and the precise classification of product quality is achieved, which improves detection efficiency and accuracy.
Patent Information
- Application Number
- CN202510300431.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-14
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2045-03-14
AI Technical Summary
Existing laser detectors cannot perform overall detection of line laser interference images, cannot achieve line width, line length, curvature and miscellaneous spot detection of line lasers, and cannot classify product quality of line lasers.
Scanned line laser interference image feature extraction method and double convolution neural network parallel miscellaneous spot analysis method are used to obtain and preprocess the laser interference image, and the length, width, divergence angle and curvature of the laser line are extracted, and the neural network model is used to detect and classify miscellaneous spots.
It realizes accurate acquisition of wired laser parameters and precise classification of product quality, improves detection efficiency and accuracy, reduces labor costs, and realizes standardization of the detection process and convenient storage and analysis of data.
Smart Images

Figure CN119832343A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of laser detection, and in particular relates to a line laser quality detection system, method, equipment and storage medium. Background Art
[0002] The laser detector can image the laser line in real time in the form of a "surface", allowing the operator to obtain the quality classification of the laser through the image and detection parameters displayed on the screen, and then analyze them. At present, the quality detection of laser lines mainly includes: line width, line length, curvature and spots. These tests require workers to measure visually. The main detection method is: place a plane reflector 3.5m away from the workstation, the worker places the laser to be tested on the table, lights up the laser to illuminate the reflector, and the reflector reflects the laser back to the worker. There is a target at the workstation with a scale on the target. The worker records the line width, line length and curvature of the laser line against the scale. The worker repeatedly turns the laser to check the laser spots, and the laser classification is obtained based on the obtained line width, line length, curvature and spots. The above manual detection method requires high experience of workers, slow production efficiency, high labor costs, large deployment space, and long-term exposure to darkroom laser environment will cause irreversible damage to workers' eyesight.
[0003] Most of the existing laser detectors only have the function of detecting circular light beams, and can detect the centroid, width and energy of the light spot. Specifically, the existing laser detector uses CCD or CMOS to collect light spot information, and the light spot information is handed over to the computer for processing through a data acquisition card. After the computer obtains the image information, it first performs grayscale processing, and then filters the stray signal. Finally, the second-order moment of the laser spot intensity can be obtained by quantifying the light spot intensity to obtain the centroid, width and energy of the laser spot. The existing laser detector can only detect partial areas of the line laser interference image, and cannot detect the line laser interference image as a whole. The parameters obtained are limited to the above-mentioned parameters, and the line width, line length, curvature and stray spot detection of the line laser interference image cannot be realized, and the product quality classification of the line laser cannot be achieved. Summary of the invention
[0004] In order 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 dual convolutional neural network parallel speckle analysis method, which can realize the accurate acquisition of line laser parameters and the accurate classification of line laser product quality.
[0005] A first aspect of the present invention provides a line laser quality detection method, comprising the following steps: S100, acquiring a laser interference image emitted by a line laser and performing preprocessing; S200, performing image binarization processing on the pre-processed 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 the region; screening the center points to obtain a collection of valid center points; S300, calculating the length of the laser line, the divergence angle of the actual line laser, and the curvature of the laser line based on the collection of valid center points; S400, calculating the laser line width based on the weighted average of the lengths of regions with gray values of 255 in all columns of the middle region of the laser interference image preprocessed in S100; S500, acquiring a gradient image based on the laser interference image preprocessed in S100 and inputting the gradient image into a speckle detection model to obtain a line laser speckle detection result; S600, classifies lasers according to the length, width, divergence angle, curvature and speckle of the laser line.
[0006] Furthermore, in S100, the preprocessing includes exposure fusion and cropping of the region of interest, and the specific process is as follows: S101, Exposure Fusion The collected laser interference images are fused to obtain the original laser interference image. , original laser interference image Contains various details needed for testing; S102, extracting a region of interest from the image after exposure fusion First, the fused image is binarized, and the binarization threshold is set to 200~254. According to the binarization threshold, all connected areas with pixels of 255 are found, and then the coordinates of the centroid pixel point are calculated using the grayscale centroid method. The formula is: in, is the entire original laser interference image, is the pixel coordinate in the original laser interference image, is the original laser interference image The gray value at ; Get the centroid pixel coordinates After that, get the boundary of the region of interest and mark the +500 lines and -500 lines, width unchanged, capture and save the original laser interference image No. +500 lines to -500 lines in the middle area to get the laser interference image .
[0007] Furthermore, the specific process of S200 is as follows: S201, the laser interference image Perform image binarization Assume that the laser interference image The gray value is ,in is the coordinate of the pixel; according to the grayscale threshold =100~140 will be the laser interference image Convert to binary image , binary image gray value for: S202, determine the binary image The longest continuous region with a grayscale value of 255 in each column and the length of the region Define R col For binary images The set of pixels with a grayscale value of 255 in any column: R col ={ ∣ =255}; Determine each column R col The longest continuous region is denoted as max(R col ); the longest continuous region max(R col ) length : in, and They are the longest continuous region max(R col )’s starting point ordinate and ending point ordinate; S203, calculate and mark the longest continuous region max(R col ) The longest continuous region max(R col )'s center point ordinate The calculation formula is: Get the vertical coordinate of the center point Then, record this point as and mark the point; S204, check the center point Neighborhood, judgement Is it an isolated point? Set center point The nearby neighborhood is : If the neighborhood If there are multiple points marked as center points, then the center point Not an isolated point, continue to retain; if the neighborhood If there is no other marked center point, then the center point For isolated points, filter the point; S205, performing image edge denoising processing on the center point obtained in S204 In order to avoid the binary image Extract the noise points at the top or bottom and limit the vertical coordinates of the valid points At image height Between 10% and 90% of: Finally, all the obtained center points are combined into a valid center point set.
[0008] Furthermore, in S300, the length of the laser line is calculated as follows: in, is the length of the laser line, is the pixel size, and are the starting and ending coordinates of the effective center point, and β is the magnification; where and β can be adjusted according to the parameters of the actual acquisition equipment; The divergence angle of an actual line laser is: in, is the divergence angle, z is the distance between the line laser and the line laser receiving device, which can be adjusted according to actual conditions; The curvature of the laser line is calculated as follows; Fit a polynomial to the center points in the set of valid center points: in, is the order of the polynomial, in the fitting The highest order of is 2 or 3; Determine the coefficients of a polynomial using the least squares method ,Right now: in, Be real value, It is fitting value, is the number of center points; The curvature of the laser line can be obtained from the curve equation obtained by fitting .
[0009] Furthermore, in S400, the overall width of the laser line is calculated as follows: Select the laser line interference pattern Each column R on both sides of the center bright spot col , take 500~600 columns on each side, recorded as , calculate their average pixel width : in, It is a choice quantity, It is the length of the area with gray value of 255 in the selected column; Will Convert to actual width : in, is the pixel size and β is the magnification.
[0010] Furthermore, in S500, based on the image pre-processed in S100, a line laser gradient image is obtained, and the specific process is as follows: Using Sobel operator to calculate laser interference image The gradients are in the horizontal direction ( direction) and vertical direction ( Direction) to calculate the gradient; The total gradient amplitude is calculated based on the gradients in the horizontal and vertical directions. The formula is as follows: in, and They are laser interference images. Horizontal and vertical gradients; Normalize the total gradient map and convert it into an integer value between 0 and 255 to facilitate subsequent display and storage; the normalization formula is as follows: in, is the normalized gradient image; is the maximum value of the total gradient amplitude, is the minimum value of the total gradient amplitude.
[0011] Furthermore, in S500, the gradient image Input the speckle detection model to obtain the line laser speckle detection results. The specific method is as follows: 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; The GNGModel model is based on the input gradient image The laser's speckle items are classified into two categories: qualified or unqualified. The GNGModel model consists of three sequentially connected convolutional layers (each convolutional layer is connected to a ReLU activation function, and the first convolutional layer is connected to a maximum pooling layer after the activation function), two fully connected layers, and one output layer; the hierarchically connected network is used to gradually extract 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 characteristic patterns of the image through a 3×3 convolution kernel; each convolutional layer performs the following operations: The size of the input gradient image is ,in , Represent the height and width of the image respectively, and the number of channels is , No. Convolutional layer ( =1,2,3) is expressed as: in, Indicates Input feature map of the convolutional layer; is the convolution kernel weight, indicating the The convolutional layer is input channels and On each output channel, position The weight, position Represents the relative position coordinates in the convolution kernel, ; Indicates The convolutional layer The offset value of each output channel; is the ReLU nonlinear activation function; After passing through the convolutional layer, the spatial resolution of the feature map is further reduced by the maximum pooling layer: in, The position on the feature map after pooling is The value of Indicates that the input feature map is All values within the 2×2 window starting from the starting point; Represents the pooling window range, that is, a local area of a fixed size on the input feature map; Indicates the offset index; After the convolution feature extraction is completed through three convolution layers in sequence, the feature map is flattened into a one-dimensional vector ,in Represents dimension; flattened one-dimensional vector Input to the first fully connected layer; the first fully connected layer contains 128 neurons, and the mapping relationship is: in, , represents the weight matrix; , represents the bias vector; is the ReLU nonlinear activation function; After 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 one neuron. After passing 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, it is classified as unqualified for the sake of product yield.
[0012] When the GNGModel model detects that the speckle item of the current laser is unqualified, the next laser speckle item detection is entered; if it is qualified, the GModel model is called to further classify the speckle item of the laser.
[0013] The GModel model can effectively process and classify input data through layer-by-layer feature extraction and dimensionality reduction, and judge whether the laser belongs to Class I or Class II among qualified lasers, where Class I is better than Class II. The GModel model includes 4 convolution blocks connected in sequence, 2 fully connected layers and 1 output layer; wherein the first convolution block includes a convolution layer, a batch normalization layer, a ReLU activation function and a maximum pooling layer connected in sequence, and the second to fourth convolution blocks all include a convolution layer and a ReLU activation function connected in sequence; the number of channels of the 4 convolution layers are 16, 32, 32, and 64 respectively; 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 consistent with 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 means that the input gradient image belongs to Class I among qualified lasers. If it is less than or equal to 0.5, it means that the input gradient image belongs to Class II among qualified lasers.
[0014] Furthermore, in S600, the lasers are classified by comprehensively evaluating the length and width of the laser line, the divergence angle of the actual line laser, the curvature of the laser line, and the spots. The specific method is as follows: S601, when 120°≤ When ≤150°, it is a laser with qualified line length; S602, further judge the qualified laser line length, when the curvature ≥100 When , it is a laser with qualified curvature; S603, perform comprehensive line width and speckle detection on the curvature qualified laser to obtain the specific classification of the laser. Specifically: for the product whose laser speckle item category is Class I in S500, when its line width mm, the product is finally classified as Class A. mm, then it is finally classified as Class B. If its line width mm is a defective product; for products with laser spot item category II in S500, if its line width is mm, the product is finally classified as Class B. If its line width mm is a defective product.
[0015] A second aspect of the present invention provides a line laser quality detection system, comprising 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 acquisition module is used to acquire 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 based on the above method to obtain line laser parameters and quality detection results.
[0016] Furthermore, in the laser installation module, a laser bracket and a laser clamp are used to install the line laser in the entire system.
[0017] Furthermore, the receiving module includes a double-sided imaging screen for receiving the light emitted by the line laser.
[0018] Furthermore, the acquisition module includes an image sensor for acquiring the line laser image and transmitting it to the display and processing module.
[0019] Furthermore, the display and processing module includes an image processing unit for receiving a line laser image and processing the line laser image to obtain a detection result.
[0020] The third aspect of the present invention further provides an electronic device, comprising a storage device and a processor, wherein the storage device stores a computer program, and when the processor executes the computer program, the electronic device executes the above method.
[0021] A fourth aspect of the present invention further provides a storage medium on which a computer program is stored. When the computer program is run on an electronic device, the electronic device executes the above method.
[0022] The beneficial effects of the present invention are as follows: 1) Significantly improved detection efficiency: In the traditional manual detection of laser images, the inspectors need to carefully observe the images one by one, which consumes a lot of time and energy. However, the present invention can quickly complete the detection of a large number of laser images in a short time through the automated processing of image algorithms. This enables timely acquisition of detection results in large-scale production or high-frequency detection scenarios, speeding up production progress and improving overall work efficiency.
[0023] 2) Significantly improved detection accuracy: When manually detecting laser images, due to the influence of various factors such as subjective factors of the inspector, fatigue level, visual errors, etc., missed detection and false detection are prone to occur, resulting in low detection accuracy. The image algorithm of the present invention is based on advanced image processing technology and algorithm models, and can accurately analyze and identify laser images. In view of the excessively flat edges and strong edge noise of laser images, while ensuring that they are not distorted after processing, the present invention proposes a scanning line laser interference image feature extraction method, which 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.
[0024] 3) Reduce labor costs: Manual inspection of laser images requires professional inspection personnel, and the inspection personnel need to undergo long-term training and practice to master the inspection skills. In addition, due to the high intensity and high repetitiveness of the inspection work, high labor costs are also required. The inspection method of the present invention does not require manual intervention, and only needs to input the image into the system to automatically complete the inspection task.
[0025] 4) Standardization and normalization of the detection process: When manually detecting laser images, different inspectors may have different detection standards and methods, resulting in inconsistency and incomparability of the detection results. The detection method of the present invention adopts a unified algorithm model and parameter settings to perform standardized detection processing on all laser images, ensuring the consistency and standardization of the detection process.
[0026] 5) Convenient for data storage and analysis: After the laser image is manually inspected, the inspection results are usually saved in the form of paper records or simple spreadsheets. The storage and management of data is difficult and inconvenient for subsequent data analysis and tracing. The inspection system of the present invention can automatically store the inspection results in a digital form in the database, including image information, inspection time, inspection results, defect type and other detailed data. These data can be easily queried, counted and analyzed, providing strong data support for the company's quality improvement, process optimization, equipment maintenance, etc.
[0027] 6) Strong adaptability and good scalability: The detection method of the present invention has strong adaptability and can be applied to laser image detection of different models and specifications, and can meet the detection requirements in different scenarios. In addition, the detection system of the present invention also has good scalability. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 Schematic diagram of a line laser quality detection system provided by an embodiment of the present invention.
[0029] Figure 2 It is a flow chart of a line laser quality detection method provided in an embodiment of the present invention.
[0030] Figure 3 Schematic diagram of calculating the line length and divergence angle of a line laser in an embodiment of the present invention.
[0031] Figure 4 This is a schematic diagram of a line laser quality detection system provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0032] The specific implementation of the present invention is further described below in conjunction with the accompanying drawings and technical solutions.
[0033] See also Figure 1 The 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.
[0034] 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. The module is precisely designed and installed using a laser bracket and a laser fixture to provide stable support. The module is also equipped with a sensor to fine-tune the position of the laser based on the actual path of the laser beam monitored by the sensor to compensate for the laser line deviation problem that may be caused by fixation or other factors.
[0035] The receiving module 200 includes a double-sided imaging screen for receiving laser signals from a line laser, the surface of which 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 hitting the camera and causing damage to the camera.
[0036] The acquisition module 300 is responsible for accurately acquiring the line laser interference image on the receiving module 200. The module is equipped with a high-resolution image sensor, which focuses the image through an optical lens and uses a filter to filter stray light to ensure that the collected interference image is clear and accurate, providing high-quality data for subsequent data processing.
[0037] In order to facilitate people's subjective feelings, 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. Color levels are assigned according to numerical values, and the sensor expresses intensity differences through color changes. By compiling a color index table, the intensity value is mapped to color, and the pixel point of the 8-bit grayscale value has 256 grayscale 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 palette, and different mapping relationships correspond to different palettes. Usually, cold tones are used to represent low-intensity distributions, and warm tones are used to represent high-intensity distributions. Through the change of color tone, the change of laser intensity from low to high is intuitively represented, which enhances the intuitiveness and comprehensibility of the image.
[0038] The display and processing module 400 includes an image processing unit for storing the line laser interference image acquired by the acquisition module 300 and performing image processing; the resolution of the display and processing module 400 is the same as the resolution of the line laser interference image, and its purpose is to be able to fully display the line laser interference image. After the display and processing module 400 acquires the line laser interference image, the line laser interference image is displayed through the display and processing module 400, and the user can customize the subsequent processing operations in the module.
[0039] See also Figure 1~2 In an environment with an illumination of 50~100 LUX, the acquisition module acquires several 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 detection results. The specific implementation method is as follows: S100, preprocessing the laser interference image, including exposure fusion and cropping of the region of interest; The laser interference images of 100 microseconds, 5000 microseconds, 60000 microseconds, 70000 microseconds, 90000 microseconds, 100000 microseconds, 150000 microseconds, 200000 microseconds and 640000 microseconds are taken respectively and fused to obtain the original laser interference image. ,image Contains all the details needed for testing.
[0040] Extract the region of interest from the exposure-fused image: First, convert the original laser interference image Binarization, the binarization threshold is 254 to find all connected areas with pixels of 255, and then use the grayscale centroid method to calculate its centroid. The grayscale centroid method is as follows: in, is the entire original laser interference image, is the pixel coordinate in the original laser interference image, is the original laser interference image The gray value at ; After calculating the centroid pixel coordinates, obtain the boundary of the region of interest and mark the +500 lines and -500 lines, image width unchanged, capture and save the original laser interference image No. +500 lines to -500 lines in the middle area to get the laser interference image .
[0041] S200, performing image binarization processing on the pre-processed 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 the region, and screening the center points to obtain a collection of valid center points; the specific process is as follows: S201, the laser interference image Perform image binarization and convert it into a binary image Reasonable binarization parameters are set according to the specific needs of the industrial site, that is, the upper and lower thresholds are determined. In this binarization process, all pixels with grayscale values below the lower threshold will be set to 0 (black), and all pixels with grayscale values above the upper threshold will be set to 255 (white). In one example, the grayscale threshold is set to 140, all pixels above 140 are 255, and all pixels below 140 are 0. This 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.
[0042] S202, determining the longest continuous region with a gray value of 255 in each column of the binary image and obtaining the length and center point of the region; this step is intended to locate the concentrated area of the salient features or objects in the image, as follows: Define R col For binary images The set of pixels with a grayscale value of 255 in any column: R col ={ ∣ =255}; Determine each column R col The longest continuous region is denoted as max(R col ), indicating that the area is the brightest or most important part; the longest continuous area max(R col )'s center point ordinate The calculation formula is: in, and They are max(R col )’s starting point ordinate and ending point ordinate; Get the vertical coordinate of the center point Then, record this point as And mark the point.
[0043] S203, detection center point Check whether there are other points with a pixel value of 255 nearby to avoid mistaking isolated pixels for important features in the image; by checking the neighborhood around the center point, you can confirm whether the point belongs to a larger, continuous bright area. If the center point There are also points with a pixel value of 255 nearby, which indicates that this area 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: Set center point The nearby neighborhood is : ; If the neighborhood If there are multiple points marked as center points, then the center point Not an isolated point, continue to retain; if the neighborhood If there is no other marked center point, then the center point It is an isolated point and is filtered out.
[0044] S204, performing image edge denoising processing on the center point obtained in S203 In order to avoid the binary image Extract the noise points at the top or bottom and limit the vertical coordinates of the valid points At image height Between 10% and 90% of: Finally, all the obtained center points are combined into a valid center point set.
[0045] S300, calculating the length of the laser line, the divergence angle of the actual line laser and the curvature of the laser line based on the effective center point collection; specifically comprising: The formula for calculating the length of the laser line is: in, is the length of the laser line, is the pixel size, and are the starting and ending coordinates of the effective center point, and β is the magnification; where and β can be adjusted according to the parameters of the actual acquisition equipment.
[0046] The divergence angle of an actual line laser is: in, is the divergence angle, and z is the distance between the laser mounting module and the receiving module.
[0047] The curvature of the laser line is calculated as follows; Fit a polynomial to the center points in the set of valid center points: in, is the order of the polynomial, in the fitting The highest order of is 2 or 3; Determine the coefficients of a polynomial using the least squares method ,Right now: in, Be real value, It is fitting value, is the number of center points; The curvature of the laser line can be obtained from the curve equation obtained by fitting : S400, based on laser line interferometry The weighted average of the lengths of the regions with a grayscale value of 255 in all columns of the middle region is used to calculate the laser line width; Select the laser line interference pattern Each column R on both sides of the center bright spot col , take 500~600 columns on each side, recorded as , calculate their average pixel width : in, It is a choice quantity, It is the length of the area with gray value of 255 in the selected column; Will Convert to actual width L real : in, is the pixel size and β is the magnification.
[0048] S500, based on the image preprocessed in S100, a line laser gradient image is obtained, and the line laser gradient image is input into a speckle detection model to obtain line laser speckle parameters; specifically as follows: Using Sobel operator to calculate laser interference image The gradients are in the horizontal direction ( direction) and vertical direction ( Direction) to calculate the gradient; The total gradient amplitude is calculated based on the gradients in the horizontal and vertical directions. The formula is as follows: in, and They are laser interference images. Horizontal and vertical gradients; Normalize the total gradient map and convert it into an integer value between 0 and 255 to facilitate subsequent display and storage; the normalization formula is as follows: in, is the normalized gradient image; is the maximum value of the total gradient amplitude, is the minimum value of the total gradient amplitude.
[0049] The gradient image Input 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; The GNGModel model includes three sequentially connected convolutional layers (each convolutional layer is connected to a ReLU activation function, and the first convolutional layer is connected to a maximum pooling layer after the activation function), two fully connected layers, and an output layer; the hierarchically connected network is used to gradually extract 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 characteristic patterns of the image through a 3×3 convolution kernel; each convolutional layer performs the following operations: The size of the input gradient image is ,in , Represent the height and width of the image respectively, and the number of channels is , No. Convolutional layer ( =1,2,3) is expressed as: in, Indicates Input feature map of the convolutional layer; is the convolution kernel weight, indicating the The convolutional layer is input channels and On each output channel, position The weight, position Represents the relative position coordinates in the convolution kernel, ; Indicates The convolutional layer The offset value of each output channel; is the ReLU nonlinear activation function; After passing through the convolutional layer, the spatial resolution of the feature map is further reduced by the maximum pooling layer: in, The position on the feature map after pooling is The value of Indicates that the input feature map is All values within the 2×2 window starting from the starting point; Represents the pooling window range, that is, a local area of a fixed size on the input feature map; Indicates the offset index; After the convolution feature extraction is completed through three convolution layers in sequence, the feature map is flattened into a one-dimensional vector ,in Represents dimension; flattened one-dimensional vector Input to the first fully connected layer; the first fully connected layer contains 128 neurons, and the mapping relationship is: in, , represents the weight matrix; , represents the bias vector; is the ReLU nonlinear activation function; After 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 one neuron. After passing 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, it is classified as unqualified for the sake of product yield.
[0050] When the GNGModel model detects that the speckle item of the current laser is unqualified, the next laser speckle item detection is entered; if it is qualified, the GModel model is called to further classify the speckle item of the laser.
[0051] The GModel model includes 4 convolution blocks, 2 fully connected layers and 1 output layer connected in sequence; wherein the first convolution block includes a convolution layer, a batch normalization layer, a ReLU activation function and a maximum pooling layer connected in sequence, and the second to fourth convolution blocks all include convolution layers and ReLU activation functions connected in sequence; the number of channels of the four convolution layers are 16, 32, 32 and 64 respectively; 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 consistent with that of 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; 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 among qualified lasers. If it is less than or equal to 0.5, it means that the input gradient image belongs to Class II among qualified lasers.
[0052] S600 classifies lasers based on the length, width, divergence angle of the actual line laser, laser line curvature, and speckle parameters of the laser line; the details are as follows: S601, when 120°≤ When ≤150°, it is a laser with qualified line length; S602, further judge the qualified laser line length, when the curvature ≥100 When , it is a laser with qualified curvature; S603, perform comprehensive line width and speckle detection on the curvature qualified laser to obtain the specific classification of the laser. Specifically: for the product whose laser speckle item category is Class I in S500, when its line width mm, the product is finally classified as Class A. mm, then it is finally classified as Class B. If its line width mm is a defective product; for products with laser spot item category II in S500, if its line width is mm, the product is finally classified as Class B. If its line width mm is a defective product.
[0053] For three lasers, the parameters of the three lasers are detected respectively according to the above method, and the parameters of the three lasers are detected respectively by the manual detection method. 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, which verifies the reliability of the method of the present invention.
[0054] This embodiment provides an electronic device, which may be a server, including a processor, a memory, a network interface, and a database connected via a system bus. 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, and 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.
[0055] This embodiment further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by an electronic device, the electronic device executes the method provided in the above embodiment.
[0056] The above is only a preferred embodiment of the present invention, and does not limit the present invention in any form. Any technician familiar with the art can make many possible changes and modifications to the technical solution of the present invention by using the above disclosed methods and technical contents without departing from the scope of the technical solution of the present invention, or modify it into an equivalent embodiment of equivalent changes. 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 should be included in the protection scope of the present invention.
Claims
1. A line laser quality detection method, characterized in that: The following steps are involved: S100, acquiring a laser interference image emitted by a line laser and performing preprocessing; S200, performing image binarization processing 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 the region; Screening the center points to obtain a collection of valid center points; S300, calculating the length of the laser line, the divergence angle of the actual line laser, and the curvature of the laser line based on the collection of valid center points; S400, calculating the laser line width based on a weighted average of the lengths of regions with a grayscale value of 255 in all columns of the middle region of the preprocessed laser interference image; S500, acquiring a gradient image based on the preprocessed laser interference image and inputting the gradient image into a speckle detection model to obtain a line laser speckle detection result; S600, classifies lasers according to the length, width, divergence angle, curvature and speckle of the laser line.
2. A line laser quality detection method according to claim 1, characterized in that: In S100, the preprocessing includes: S101, fusing several frames of collected laser interference images to obtain an original laser interference image ; S102, the original laser interference image Binarization, find all connected areas with pixels of 255 according to the binarization threshold, and then use the grayscale centroid method to calculate the coordinates of its centroid pixel point. The formula is: in, is the entire original laser interference image, is the pixel coordinate in the original laser interference image, is the original laser interference image The gray value at ; Get the centroid pixel coordinates After that, get the boundary of the region of interest and mark the +500 lines and -500 lines, width unchanged, capture and save the original laser interference image No. +500 lines to -500 lines in the middle area to get the laser interference image .
3. A line laser quality detection method according to claim 1, characterized in that: The specific process of S200 is: S201, the laser interference image obtained after preprocessing Perform image binarization Assume that the laser interference image The gray value is ,in is the coordinate of the pixel point; according to the grayscale threshold Laser interference imaging Convert to binary image , binary image gray value for: S202, determine the binary image The longest continuous region with a grayscale value of 255 in each column Define R col For binary images The set of pixels with a grayscale value of 255 in any column: R col ={ ∣ =255}; Determine each column R col The longest continuous region is denoted as max(R col ); S203, calculate and mark the binary image The longest continuous area of each column max(R col ) The longest continuous region max(R col )'s center point ordinate The calculation formula is: in, and They are max(R col )’s starting point ordinate and ending point ordinate; Get the vertical coordinate of the center point Then, record this point as and mark the point; S204, check the center point Neighborhood, judgement Is it an isolated point? Set center point The nearby neighborhood is : If the neighborhood If there are multiple points marked as center points, then the center point Not an isolated point, continue to retain; if the neighborhood If there is no other marked center point, then the center point For isolated points, filter the point; S205, performing image edge denoising processing on the center point obtained in S204 In order to avoid the binary image Extract the noise points at the top or bottom and limit the vertical coordinates of the valid points At image height Between 10% and 90% of: Finally, all the obtained center points are combined into a valid center point set.
4. A line laser quality detection method according to claim 1, characterized in that: In S300, the length of the laser line is calculated as follows: in, is the length of the laser line, is the pixel size, and are the starting and ending point coordinates of the effective center point, and β is the magnification; The divergence angle of an actual line laser is: in, is the divergence angle, z is the distance between the line laser and the line laser receiving device; The curvature of the laser line is calculated as follows; Fit a polynomial to the center points in the set of valid center points: in, is the order of the polynomial, in the fitting The highest order of is 2 or 3; Determine the coefficients of a polynomial using the least squares method ,Right now: in, Be real value, It is fitting value, is the number of center points; The curvature of the laser line is obtained from the curve equation obtained by fitting .
5. A line laser quality detection method according to claim 1, characterized in that: In S400, the calculation method of the overall width of the laser line is: Select the laser line interference pattern Each column R on both sides of the center bright spot col , take 500~600 columns on each side, recorded as , calculate their average pixel width : in, It is a choice quantity, It is the length of the area with gray value of 255 in the selected column; Will Convert to actual width : in, is the pixel size and β is the magnification.
6. A line laser quality detection method according to claim 1, characterized in that: In S500, the pre-processed laser interference image is first calculated. The gradient is calculated in the horizontal and vertical directions respectively; the total gradient amplitude is calculated according to the gradient in the horizontal and vertical directions; the total gradient map is normalized and converted into an integer value between 0 and 255 ; Then Input the speckle detection model, which is composed of two serial neural network models GNGModel and GModel, where: The GNGModel model includes three convolutional layers, two fully connected layers and one output layer connected in sequence; each convolutional layer is connected to a ReLU activation function, and the first convolutional layer is connected to a maximum pooling layer after the activation function; each convolutional layer performs the following operations: The size of the input gradient image is ,in , Represent the height and width of the image respectively, and the number of channels is , No. The two-dimensional convolution operation of the convolution layer is expressed as: in, Indicates Input feature map of the convolutional layer; is the convolution kernel weight, indicating the The convolutional layer is input channels and On each output channel, position The weight, position Represents the relative position coordinates in the convolution kernel, ; Indicates The convolutional layer The offset value of each output channel; is the ReLU nonlinear activation function; After passing through the convolutional layer, the spatial resolution of the feature map is further reduced by the maximum pooling layer: in, The position on the feature map after pooling is The value of Indicates that the input feature map is All values within the 2×2 window starting from the starting point; Represents the pooling window range, that is, a local area of a fixed size on the input feature map; Indicates the offset index; After the convolution feature extraction is completed through three convolution layers in sequence, the feature map is flattened into a one-dimensional vector ,in Represents dimension; flattened one-dimensional vector Input to the first fully connected layer; the first fully connected layer contains 128 neurons, and the mapping relationship is: in, , represents the weight matrix; , represents the bias vector; is the ReLU nonlinear activation function; After the first fully connected layer, the second fully connected layer is connected to further extract high-dimensional features. The second fully connected layer contains only one neuron. After the output layer, the features of the fully connected layer are mapped to the range of [0,1] using the Sigmoid function. 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, the next laser speckle item detection is performed; if it is qualified, the GModel model is called to further classify the speckle item of the laser into Class I or Class II, where Class I is better than Class II; The GModel model includes 4 convolution blocks, 2 fully connected layers and 1 output layer connected in sequence; wherein the first convolution block includes a convolution layer, a batch normalization layer, a ReLU activation function and a maximum pooling layer connected in sequence, and the second to fourth convolution blocks all include convolution layers and ReLU activation functions 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 consistent with 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 among qualified lasers, otherwise, it belongs to Class II among qualified lasers.
7. A line laser quality detection method according to claim 6, characterized in that: The method of S600 is as follows: S601, when 120°≤ When ≤150°, it is a laser with qualified line length; S602, further judge the qualified laser line length, when the curvature ≥100 When , it is a laser with qualified curvature; S603, conduct comprehensive line width and spot detection on the curvature qualified laser to obtain the specific classification of the laser. Specifically: for products with laser spot item category I, when the line width mm, the product is finally classified as Class A. mm, then it is finally classified as Class B. If its line width mm is considered unqualified; for products with laser spot category II, if the line width mm, the product is finally classified as Class B. If its line width mm is a defective product.
8. A line laser quality detection system, characterized in that: It includes a laser installation module, a receiving module, an acquisition 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 acquisition module is used to acquire 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 to 7 to obtain line laser parameters and quality detection results.
9. An electronic device, characterized in that: The electronic device comprises a storage device and a processor, wherein the storage device stores a computer program, and when the processor executes the computer program, the electronic device executes the detection method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: A computer program is stored thereon, and when the computer program is run on an electronic device, the electronic device executes the detection method according to any one of claims 1 to 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
Semiconductor laser light spot quality detection device and detection method
CN116858502A
Device and method for improving beam quality of large-aperture laser
CN117977356A
Wavelength-controlled tunable chip-scale laser
US20230072680A1