A method for extracting the centroid of a laser spot image based on laser size and grayscale.

CN120782839BActive Publication Date: 2026-09-01CHANGCHUN INST OF OPTICS FINE MECHANICS & PHYSICS CHINESE ACAD OF SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510890811.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-30
Publication Date
2026-09-01
Estimated Expiration
2045-06-30

AI Technical Summary

Technical Problem

[0008]本发明要解决现有技术中激光光束的质心位置精准测量过程中存在的技术问题,提供一种基于激光尺寸和灰度提取激光光斑图像质心的方法

Benefits of technology

[0039]本发明的基于激光尺寸和灰度提取激光光斑图像质心的方法,最大限度的获得降低噪声点、杂光等对整体测量结果的影响,同时数值图像处理过程逻辑清晰,分析合理,实际得到的结果符合预期,数据计算简单,处理过程高效快速,采用的数据处理软件也普适常见,易于推广。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120782839B_ABST
    Figure CN120782839B_ABST
Patent Text Reader

Abstract

This invention relates to a method for extracting the centroid of a laser spot image based on laser size and grayscale, relating to the fields of digital image processing, optical testing, and Matlab programming. The method includes the following steps: Step 1: Obtain a fourth grayscale image; Step 2: Process the generated fourth grayscale image to obtain the X-coordinate and Y-coordinate values ​​of the centroid of each image within the test time period; Step 3: Obtain the final centroid coordinate values. This invention's method for extracting the centroid of a laser spot image based on laser size and grayscale minimizes the impact of noise points and stray light on the overall measurement results. Simultaneously, the numerical image processing process is logically clear and the analysis is reasonable. The actual results obtained meet expectations, the data calculation is simple, the processing is efficient and fast, and the data processing software used is widely available and easy to promote.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of digital image processing, optical testing, and Matlab programming technology, and in particular to a method for extracting the centroid of a laser spot image based on laser size and grayscale. Background Technology

[0002] Lasers possess advantages such as strong penetration, concentrated energy, and good directionality. Since its invention, laser technology has been widely used in industries, medicine, communications, military, meteorology, and other fields, and has become a core component of modern high-tech instruments and equipment. Examples include gravitational wave detection technology, attosecond laser technology, laser-controlled nuclear fusion technology, directed energy weapons, lidar-driven unmanned vehicles, laser propulsion technology, non-invasive surgery, and lidar, among others.

[0003] The size and position of a laser spot directly affect the quality of the laser beam. Therefore, how to protect and manage the laser spot has become a focus of researchers. With the emergence of various laser instruments and equipment, the ability to accurately measure the centroid position of a laser beam can better reflect the characteristics of the laser beam, directly affecting the laser's positional accuracy and pointing stability. It can also indirectly reflect the performance stability, testing accuracy, and reliability of laser instruments.

[0004] There are various existing methods for testing the centroid position of a laser beam, but each method has its own technical problems during the testing process, including:

[0005] A computer vision-based method for precise measurement of thermophysical laser spot position uses computer vision technology to calculate the initial position of the thermophysical laser spot and extract position features. It then determines the center position by combining the relationship between the centroid position of the thermophysical laser spot and the calculated value. However, the average standard deviation of the azimuth deformation angle measurement results of this method is relatively high.

[0006] The high-precision positioning algorithm for the center of a laser spot improves laser spot positioning by analyzing commonly used sub-pixel positioning algorithms and using Gaussian fitting and rectangular region positioning of gray-scale centroid. However, in practical applications, the average standard deviation of the pitch angle measurement results is relatively high, resulting in poor application performance.

[0007] The laser spot center localization algorithm based on the four-quadrant detector analyzes the localization principle of the four-quadrant detector and improves the localization algorithm under the Gaussian spot model by combining the characteristics of the standard normal distribution to achieve center localization. However, the average standard deviation of the azimuth deformation angle measurement results and the average standard deviation of the pitch angle measurement results are relatively high, resulting in a large center localization deviation. Summary of the Invention

[0008] This invention aims to solve the technical problems existing in the accurate measurement of the centroid position of a laser beam in the prior art, and provides a method for extracting the centroid of a laser spot image based on laser size and grayscale.

[0009] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows:

[0010] A method for extracting the centroid of a laser spot image based on laser size and grayscale includes the following steps:

[0011] Step 1: Obtain the fourth grayscale image;

[0012] Read in and display the color spot image, and separate the three primary color images;

[0013] Calculate the grayscale values ​​of all pixels in the R, G, and B images respectively;

[0014] Sum the gray values ​​of the first, second, and third gray images at the same pixel in the R, G, and B images respectively; then calculate the average gray value, and use the average gray value of all pixels to generate the fourth gray image;

[0015] Step 2: Process the generated fourth grayscale image to obtain the X-coordinate and Y-coordinate values ​​of the centroid of each image within the test time period;

[0016] Step 3: Obtain the final centroid coordinates;

[0017] Sum the X and Y coordinates of all centroids within the test period, then take the average value of each. Use the average X of the centroid row coordinates and the average Y of the centroid column coordinates as the final centroid coordinate values.

[0018] In the above technical solution, step 2 specifically includes:

[0019] Step 2.1: Extract the Y-coordinate value of the laser spot centroid;

[0020] The fourth grayscale image is binarized; the average grayscale value of this fourth grayscale image is calculated, and the average grayscale value is used as a threshold. Pixels with grayscale values ​​greater than or equal to the threshold are marked as 1, and pixels with grayscale values ​​lower than the threshold are marked as 0, thus obtaining the binarized image;

[0021] Use the judgment instruction to record the row and column coordinates of the pixels in the i-th row that are equal to 1;

[0022] To calculate the weight of a pixel's contribution to the centroid position, subtract the minimum value of the non-zero column coordinates of the row from the maximum value of the column coordinates of the non-zero elements in that row. This value is used as the weight of the element's contribution when calculating the centroid coordinates.

[0023] Use half the weight value plus the column coordinate of the first non-zero element in the row as the center coordinate value of the position of all pixels in the row;

[0024] Find the light intensity value of each non-zero pixel, and multiply the gray value of each pixel in the obtained fourth grayscale image with the gray value of the pixel at the same position in the binarized image to obtain the fifth grayscale image.

[0025] Calculate the average value of the non-zero pixels in the i-th row of the fifth grayscale image, and use it as the calculated value of the grayscale value of the pixels in that row.

[0026] The calculated grayscale value of the pixel in the i-th row is multiplied by the weight value of that row and the initially determined center coordinates of the pixel in that row, and denoted as K. i Use a traversal method to find the product of the three values ​​in all rows, and sum them, denoted as .

[0027] Calculate the average grayscale value of the light intensity of each row of pixels and the weighted contribution value of each row to the centroid. The product of these two values ​​is denoted as L. i Use a traversal method to find the product of the two in all rows, and sum them, denoted as . The obtained value and The quotient is used as the column coordinate of this image.

[0028] In the above technical solution, step 2 specifically includes:

[0029] Step 2.2: Extract the X-coordinate value of the laser spot centroid;

[0030] The fourth grayscale image is binarized; the average grayscale value of this fourth grayscale image is calculated, and the average grayscale value is used as a threshold. Pixels with grayscale values ​​greater than or equal to the threshold are marked as 1, and pixels with grayscale values ​​lower than the threshold are marked as 0, thus obtaining the binarized image;

[0031] Use the judgment instruction to record the row and column coordinates of the pixel in column j that is equal to 1;

[0032] To determine the weight of a pixel's contribution to the centroid position, subtract the minimum value from the maximum value of the non-zero row coordinates of that column. This value represents the weight of the column's contribution when determining the centroid coordinates.

[0033] Use half the weight value plus the row coordinate of the first non-zero element in the column to determine the center coordinate of the position of all pixels in the column;

[0034] Find the light intensity value of each non-zero pixel, and multiply the gray value of each pixel in the obtained fourth grayscale image with the gray value of the pixel at the same position in the binarized image to obtain the fifth grayscale image.

[0035] Calculate the average value of the non-zero pixels in the j-th column of the fifth grayscale image, and use it as the calculated value of the grayscale value of the pixels in that column.

[0036] The calculated grayscale value of the pixel in column j is multiplied by the weight value of that column and the preliminary row coordinates of the center position of the pixel in that column, and denoted as G. j Use a traversal method to find the product of the three terms in all columns, and sum them, denoted as .

[0037] Calculate the average grayscale value of the light intensity of each column of pixels and the weight contribution value of each column to the centroid. The product of these two values ​​is denoted as Q. j Use a traversal method to find the product of the two in all columns, and sum them, denoted as . The obtained value and The quotient is used as the row coordinate of this image.

[0038] The present invention has the following beneficial effects:

[0039] The method of extracting the centroid of a laser spot image based on laser size and grayscale of the present invention minimizes the impact of noise points and stray light on the overall measurement results. At the same time, the numerical image processing process is logically clear and the analysis is reasonable. The actual results obtained meet expectations. The data calculation is simple, the processing is efficient and fast, and the data processing software used is also universal and common, making it easy to promote. Attached Figure Description

[0040] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.

[0041] Figure 1 This is a schematic diagram of the preliminary image processing flow of the method for extracting the centroid of a laser spot image based on laser size and grayscale according to the present invention.

[0042] Figure 2 This is a detailed flowchart illustrating the extraction of the Y-coordinate value of the laser beam centroid using the method for extracting the centroid of a laser spot image based on laser size and grayscale according to the present invention.

[0043] Figure 3 This is a detailed flowchart illustrating the extraction of the X-coordinate value of the laser beam centroid using the method for extracting the centroid of a laser spot image based on laser size and grayscale according to the present invention. Detailed Implementation

[0044] The inventive concept of this invention is as follows:

[0045] To address the needs of existing technologies, this invention proposes a method for extracting the centroid of a laser spot image based on laser size and grayscale. Its direct purpose is to detect the centroid position of a laser spot image, and it relates to fields such as digital image processing, optical testing, and MATLAB programming.

[0046] The intensity of an ideal laser beam approximates a Gaussian function distribution, with the strongest intensity at the center of the beam and decreasing energy with distance from the center. Furthermore, the beam diameter is largest at the center. A higher grayscale value in the beam image indicates stronger energy and closer proximity to the beam center; similarly, a larger beam diameter also indicates proximity to the center. By assigning greater weight to both position and intensity information, the centroid of the beam can be accurately determined.

[0047] The present invention will now be described in detail with reference to the accompanying drawings.

[0048] The preprocessing flow of the method for extracting the centroid of a laser spot image based on laser size and grayscale according to the present invention is as follows: Figure 1 As shown, the steps include:

[0049] Step 1: Obtain the fourth grayscale image;

[0050] Read in the image; display the colored light spot image in the program, and separate it into three primary color images (R image, G image, and B image);

[0051] Calculate the grayscale values ​​of all pixels in the R image (red image), G image (green image), and B image (blue image) respectively;

[0052] Sum the gray values ​​of the three images (first grayscale image, second grayscale image, and third grayscale image) at the same pixel in the R image, G image, and B image respectively; then calculate the average grayscale value, and use the average grayscale value of all pixels to generate a new fourth grayscale image.

[0053] Step 2: Process the generated fourth grayscale image to obtain the X-coordinate and Y-coordinate values ​​of the centroid;

[0054] Step 2.1: Extract the Y-coordinate value of the laser spot centroid; such as Figure 2 As shown, the detailed process for extracting the Y-coordinate value of the laser spot centroid is as follows:

[0055] The fourth grayscale image is binarized; the average grayscale value of this fourth grayscale image is calculated, and the average grayscale value is used as a threshold. Pixels with grayscale values ​​greater than or equal to the threshold are marked as 1, and pixels with grayscale values ​​lower than the threshold are marked as 0, thus obtaining the binarized image;

[0056] Use the judgment instruction to record the row and column coordinates of the pixels in the i-th row that are equal to 1;

[0057] To calculate the weight of a pixel's contribution to the centroid position, subtract the minimum value of the non-zero column coordinates of the row from the maximum value of the column coordinates of the non-zero elements in that row. This value is used as the weight of the element's contribution when calculating the centroid coordinates.

[0058] Use half the weight value plus the column coordinate of the first non-zero element in the row as the center coordinate value of the position of all pixels in the row;

[0059] Find the light intensity value of each non-zero pixel, and multiply the gray value of each pixel in the obtained fourth grayscale image with the gray value of the pixel at the same position in the binarized image to obtain the fifth grayscale image.

[0060] Calculate the average value of the non-zero pixels in the i-th row of the fifth grayscale image, and use it as the calculated value of the grayscale value of the pixels in that row.

[0061] The calculated grayscale value of the pixel in the i-th row is multiplied by the weight value of that row and the initially determined center coordinates of the pixel in that row, and denoted as K. i Use a traversal method to find the product of the three values ​​in all rows, and sum them, denoted as .

[0062] Calculate the average grayscale value of the light intensity of each row of pixels and the weighted contribution value of each row to the centroid. The product of these two values ​​is denoted as L. i Use a traversal method to find the product of the two in all rows, and sum them, denoted as . The obtained value and The quotient is calculated, and the result is used as the column coordinate (Y coordinate value) of this image.

[0063] Step 2.2: Extract the X-coordinate value of the laser spot centroid; such as Figure 3 As shown, the detailed process for extracting the X-coordinate value of the laser spot centroid is as follows:

[0064] The fourth grayscale image is binarized; the average grayscale value of this fourth grayscale image is calculated, and the average grayscale value is used as a threshold. Pixels with grayscale values ​​greater than or equal to the threshold are marked as 1, and pixels with grayscale values ​​lower than the threshold are marked as 0, thus obtaining the binarized image;

[0065] Use the judgment instruction to record the row and column coordinates of the pixel in column j that is equal to 1;

[0066] To determine the weight of a pixel's contribution to the centroid position, subtract the minimum value from the maximum value of the non-zero row coordinates of that column. This value represents the weight of the column's contribution when determining the centroid coordinates.

[0067] Use half the weight value plus the row coordinate of the first non-zero element in the column to determine the center coordinate of the position of all pixels in the column;

[0068] Find the light intensity value of each non-zero pixel, and multiply the gray value of each pixel in the obtained fourth grayscale image with the gray value of the pixel at the same position in the binarized image to obtain the fifth grayscale image.

[0069] Calculate the average value of the non-zero pixels in the j-th column of the fifth grayscale image, and use it as the calculated value of the grayscale value of the pixels in that column.

[0070] The calculated grayscale value of the pixel in column j is multiplied by the weight value of that column and the preliminary row coordinates of the center position of the pixel in that column, and denoted as G. j Use a traversal method to find the product of the three terms in all columns, and sum them, denoted as .

[0071] Calculate the average grayscale value of the light intensity of each column of pixels and the weight contribution value of each column to the centroid. The product of these two values ​​is denoted as Q. j Use a traversal method to find the product of the two in all columns, and sum them, denoted as . The obtained value and The quotient is calculated, and the result is used as the row coordinate (X coordinate value) of this image.

[0072] Step 3: Obtain the final centroid coordinates;

[0073] After obtaining the X and Y coordinates of the centroid for each image within the test period, sum all the X and Y coordinates of the centroid within this test period, and then take the average value. Calculate the average value of the centroid row coordinates. and the average value of column coordinates of the centroid Will As the final centroid coordinate value.

[0074] The method of extracting the centroid of a laser spot image based on laser size and grayscale of the present invention minimizes the impact of noise points and stray light on the overall measurement results. At the same time, the numerical image processing process is logically clear and the analysis is reasonable. The actual results obtained meet expectations. The data calculation is simple, the processing is efficient and fast, and the data processing software used is also universal and common, making it easy to promote.

[0075] Obviously, the above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.

Claims

1.A method for extracting a centroid of a laser spot image based on a laser size and a gray scale, characterized in that, Includes the following steps: Step 1: Obtain the fourth grayscale image; Read in and display the color spot image, and separate the three primary color images; Calculate the grayscale values ​​of all pixels in the R, G, and B images respectively; Sum the gray values ​​of the first, second, and third gray images at the same pixel in the R, G, and B images respectively; then calculate the average gray value, and use the average gray value of all pixels to generate the fourth gray image; Step 2: Process the generated fourth grayscale image to obtain the Y-coordinate and X-coordinate values ​​of the centroid of each image within the test time period; Step 2.1: Extract the Y-coordinate value of the laser spot centroid; The fourth grayscale image is binarized; the average grayscale value of this fourth grayscale image is calculated, and the average grayscale value is used as a threshold; pixels with grayscale values ​​greater than or equal to the threshold are recorded as 1, and pixels with grayscale values ​​lower than the threshold are recorded as 0, thus obtaining the binarized image; Use the judgment instruction to record the row and column coordinates of the pixels in the i-th row that are equal to 1; Calculate the weight of the contribution of pixels in a given row to the centroid position; The maximum value of the column coordinates of the non-zero elements in that row minus the minimum value of the column coordinates of the non-zero elements in that row is used as the weight of the element in that row when calculating the centroid coordinates. Use half the weight value plus the column coordinate of the first non-zero element in the row as the center coordinate value of the position of all pixels in the row; Find the light intensity value of each non-zero pixel, and multiply the gray value of each pixel in the obtained fourth grayscale image with the gray value of the pixel at the same position in the binarized image to obtain the fifth grayscale image. Calculate the average value of the non-zero pixels in the i-th row of the fifth grayscale image, and use it as the calculated value of the grayscale value of the pixels in that row. The calculated value of the size of the gray value of the i-th row of pixels is multiplied by the weight value occupied by the row and the center position coordinate value preliminarily determined for the row of pixels, and is recorded as ; Using a traversal method, find the product of the three values ​​in all rows, and sum them, denoted as . ; Calculate the average grayscale value of the light intensity of each row of pixels and the weighted contribution value of each row to the centroid. The product of these two values ​​is denoted as... Use a traversal method to find the product of the two in all rows, and sum them, denoted as . The obtained value and The quotient is used as the column coordinate of this image, that is, the Y coordinate value of the centroid; Step 2.2: Extract the X-coordinate value of the laser spot centroid; The fourth grayscale image is binarized; the average grayscale value of this fourth grayscale image is calculated, and the average grayscale value is used as a threshold; pixels with grayscale values ​​greater than or equal to the threshold are recorded as 1, and pixels with grayscale values ​​lower than the threshold are recorded as 0, thus obtaining the binarized image; Use the judgment instruction to record the row and column coordinates of the pixel in column j that is equal to 1; To determine the weight of a pixel's contribution to the centroid position, subtract the minimum value from the maximum value of the non-zero row coordinates of that column. This value represents the weight of the column's contribution when determining the centroid coordinates. Use half the weight value plus the row coordinate of the first non-zero element in the column to determine the center coordinate of the position of all pixels in the column; Find the light intensity value of each non-zero pixel, and multiply the gray value of each pixel in the obtained fourth grayscale image with the gray value of the pixel at the same position in the binarized image to obtain the fifth grayscale image. Calculate the average value of the non-zero pixels in the j-th column of the fifth grayscale image, and use it as the calculated value of the grayscale value of the pixels in that column. The calculated grayscale value of the pixel in column j is multiplied by the weight value of that column and the preliminary row coordinates of the center position of the pixel in that column, denoted as . ; Using a traversal method, calculate the product of the three terms in all columns and sum them, denoted as . ; Calculate the average grayscale value of the light intensity of each column of pixels and the weighted contribution value of each column to the centroid. The product of these two values ​​is denoted as... Use a traversal method to find the product of the two in all columns, and sum them, denoted as . The obtained value and The result of the quotient is used as the row coordinate of this image, that is, the X coordinate value of the centroid; Step 3: Obtain the final centroid coordinates; Sum the X and Y coordinates of all centroids within the test period, then average them separately. Calculate the average of the resulting centroid row coordinates. and the average value of the column coordinates of the centroid ,Will , As the final centroid coordinate value.

Citation Information

Patent Citations

  • Method for detecting position of invisible laser spot near 850nm

    CN112950511A

  • Light spot centroid positioning method based on block threshold

    CN113808193A