Method and apparatus for dynamic spot center extraction of horizontal guideline reference

By combining a preset threshold method and a Gaussian convolution kernel with Hessian matrix and matrix QR decomposition, the problems of accuracy and stability in spot center extraction were solved, and high-precision and high-stability measurements of the horizontal guideline reference device were achieved.

CN123118736APending Publication Date: 2026-11-17NATIONAL INSTITUTE OF METROLOGY CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611297228.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-25
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

In the existing technology, the sub-pixel extraction method of the spot center has problems of low accuracy and poor stability, which affects the measurement accuracy and reliability of the horizontal guideline reference device.

Method used

A method based on a preset threshold and Gaussian convolution kernel is adopted. The Gaussian convolution template is used to perform convolution operation with the initial spot image. Combined with Hessian matrix and matrix QR decomposition, sub-pixel level extraction of the spot center is achieved.

Benefits of technology

It improves the extraction accuracy and stability of the light spot center, meets the high precision and high stability requirements of the horizontal alignment reference device for measurement, and achieves rapid processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123118736A_ABST
    Figure CN123118736A_ABST
Patent Text Reader

Abstract

This application relates to a method and apparatus for dynamic spot center extraction of a horizontal guideline reference. The method effectively reduces the image processing area and provides a basis for Gaussian filtering kernel calculation by extracting the initial position of the spot center and determining the initial value of the Gaussian convolution kernel. It improves image processing speed by utilizing Gaussian convolution templates for convolution calculation and algorithms such as matrix QR decomposition. By judging whether the sub-pixel coordinate calculation results of the spot center are appropriate for the Gaussian filtering kernel size, the sub-pixel extraction accuracy of the spot center is guaranteed, enabling rapid extraction of sub-pixels of the spot center while ensuring the accuracy and stability of the spot center. This meets the high precision, high stability, and rapid processing requirements of horizontal guideline reference devices for image data in measurement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of measurement technology, and more specifically, to a method and apparatus for dynamic spot center extraction of a horizontal guideline reference. Background Technology

[0002] A horizontal alignment reference device provides a horizontal alignment and is used to calibrate level instruments, leveling instruments (hanging mirrors), and other leveling work standards. It provides measurement traceability for these standard devices and uses the hanging mirror as a standard leveling instrument.

[0003] With the development of precision instruments, higher requirements have been placed on the accuracy and reliability of horizontal reference lines.

[0004] Currently, there are very few high-precision leveling instruments available in China, and in traditional calibration methods, the level calibration device mainly relies on manual operation.

[0005] Currently, the methods for establishing optical horizontal alignments typically use a suspended mirror or liquid surface as a standard reference, and the measurement principles mainly consist of autocollimation and laser interferometry.

[0006] The autocollimation method uses the vertical reflective surface of a horizontal standard instrument (hanging mirror) or the horizontal reflective surface of a liquid surface as a standard, and verifies the horizontal deviation of the collimator by utilizing the autocollimation principle of the collimator.

[0007] Laser interferometry utilizes the principle of equal inclination interference. It uses a thin film made of transparent solid, liquid, or gas sandwiched between two pieces of glass to measure the optical path difference of reflected light formed by light with the same incident angle after reflection from the two surfaces of the film, thereby achieving the measurement of the horizontal line reference deviation.

[0008] However, both of the above measurement methods require imaging the surface of the mirror or liquid surface illuminated by the laser beam.

[0009] Due to the different scattering characteristics of materials, the light spot images of different tested materials are different. The light spot is focused in the middle of the measurement range and defocused at the edge of the measurement range. The light spot intensity is different, with the strongest light at the focused position and the light intensity weakening as the defocus increases at the edge of the measurement range. Although the overall shape of the light spot images is basically the same at different times, the details and noise are not quite the same.

[0010] Therefore, the accuracy and stability of the center extraction of the light spot image are key factors in determining the deviation of the horizontal guideline.

[0011] Since the image formed by the laser beam on the image plane is generally elliptical, the following methods are currently used for sub-pixel extraction of the spot center: ellipse fitting method based on the edge extraction of the spot image, centroid method based on the gray-level distribution of the spot image, surface fitting method based on Gaussian function, center method based on Hough change, and Taylor method based on Hessian matrix.

[0012] Although the above methods are all sub-pixel level extraction algorithms, they each have limitations: the ellipse fitting method based on spot image edge extraction does not extract the pixel corresponding to the laser beam center; the centroid method based on spot image grayscale distribution is greatly affected by noise disturbance; the surface fitting method based on Gaussian function uses grayscale interpolation, which can obtain high spot center pixel accuracy, but has a large computational load and poor real-time performance; the center method based on Hough transform requires first giving the radius range of the circle, and then calculating the spot center coordinates through Hough transform, which is only suitable for ideal circle center extraction; The Taylor method based on the Hessian matrix obtains the Hessian matrix by analyzing the second-order directional derivative and autocorrelation function of the spot image and derives the determination condition for the center of the pixel-level spot image. Then, the gray-level distribution function of the image is Taylor expanded in the sub-pixel neighborhood of the pixel-level center of the spot image, and the local maxima of the gray-level distribution surface of the spot image are obtained as the center point of the sub-pixel-level spot image. However, due to the fluidity of the liquid surface itself or the swing of the hanging mirror, the microscopic changes of the spot image are drastic, which leads to the instability of the spot center extraction and seriously affects the stability of the horizontal guideline deviation calculation. Summary of the Invention

[0013] To address the aforementioned technical problems, this application provides a method and apparatus for dynamic spot center extraction of a horizontal guideline reference that can rapidly extract sub-pixel centers of spot centers while ensuring the accuracy and stability of the spot centers, thus meeting the requirements of horizontal guideline reference devices for high accuracy, high stability, and rapid processing of image data in metrology.

[0014] In a first aspect, this application provides a method for dynamic spot center extraction of a horizontal guideline reference, comprising: The initial spot image from the collimator is acquired, and the initial spot image is thresholded based on a preset threshold method to obtain a binary spot image. Based on the binary spot image, the initial position of the spot center and the initial value of the Gaussian convolution kernel are obtained. Based on the initial value of the Gaussian convolution kernel, a Gaussian convolution template is established, and the Gaussian convolution template is used as a fixed template parameter. The template parameter is used for image convolution calculation in each frame. Based on the initial position of the light spot center, a Hessian matrix is ​​obtained by performing a convolution operation between the initial light spot image and the Gaussian convolution template. The first and second eigenvalues ​​of the Hessian matrix are then obtained, and the pixel coordinates of the light spot center are obtained based on the first and second eigenvalues. The initial position of the spot center is processed based on the preset Gaussian surface fitting method, and the surface matrix equation is established. The surface matrix equation is then processed according to matrix QR decomposition and least squares method to obtain the sub-pixel coordinates of the spot center. When the sub-pixel coordinates of the center of the light spot and the pixel coordinates of the center of the light spot meet the preset conditions, the sub-pixel coordinates of the center of the light spot are determined as the sub-pixel coordinates of the center of the target light spot.

[0015] In one embodiment, the step of acquiring the initial spot image from the collimator includes: By adjusting the autocollimator using a horizontal alignment reference device, an initial light spot image is acquired when the light spot image is within a preset number of pixels from the image center. Before the step of thresholding the initial spot image based on a preset threshold method, the following steps are included: When the initial spot image is a color image, grayscale conversion is performed on the initial spot image to obtain the grayscale processed initial spot image.

[0016] In one embodiment, in the step of thresholding the initial spot image based on a preset threshold method to obtain a binary spot image, the preset threshold method is expressed as follows:

[0017] in, This is the initial light spot image. This is a binary image of the light spot. The preset threshold value ranges from 80 to 150.

[0018] In one embodiment, the step of obtaining the initial position of the spot center and the initial value of the Gaussian convolution kernel based on the binary image of the spot includes: Obtain the average pixel coordinates in the x and y directions of the binary image of the light spot, and determine the average value as the initial position of the center of the light spot; The maximum values ​​of the pixel regions occupied in the x and y directions of the binary image of the light spot are obtained, and these maximum values ​​are determined as the diameter of the light spot. Based on a preset formula, the light spot diameter is processed to obtain the initial value of the Gaussian convolution kernel. The preset formula is:

[0019] in, The initial value of the Gaussian convolution kernel, The diameter of the light spot. Indicates rounding down.

[0020] In one embodiment, in the step of establishing a Gaussian convolution template based on the initial value of the Gaussian convolution kernel, the Gaussian convolution template is obtained by the following formula:

[0021] in, The initial value of the Gaussian convolution kernel, This is a Gaussian convolution template.

[0022] In one embodiment, the Hessian matrix is:

[0023] in, , and These are the second-order partial derivatives of the initial light spot image with respect to the x-axis and y-axis of the image, respectively. , and It is obtained by performing a convolution operation between a Gaussian convolution template and the initial spot image.

[0024] In one embodiment, the first feature value is the maximum value of the second partial derivative of the corresponding initial spot image at the corresponding pixel; the second feature value is the minimum value of the second derivative of the image grayscale function at the corresponding pixel. The steps for obtaining the center pixel coordinates of the light spot based on the first and second eigenvalues ​​include: Within a preset window centered on the corresponding pixel, calculate the extreme value of each pixel; the extreme value is the product of the first feature value and the second feature value. The position corresponding to the pixel with the largest extreme value is determined as the center pixel coordinate of the light spot.

[0025] In one embodiment, the surface matrix equation is:

[0026] in, for vector: , ; for The matrix: , ; A vector composed of Gaussian parameters: , The amplitude is a Gaussian distribution. Let x be the standard deviation of the initial value of the Gaussian convolution kernel in the x-direction. y is the standard deviation of the initial value of the Gaussian convolution kernel in the y direction; The steps for processing the surface matrix equation using matrix QR decomposition and least squares method to obtain the sub-pixel coordinates of the spot center include: Performing QR decomposition on matrix B in the surface matrix equation yields a result containing a An orthogonal matrix and a The surface matrix equation after decomposition of the upper triangular matrix; The least squares method is used to fit the equation of the decomposed surface matrix to minimize the mean square error of the N data points of the corresponding decomposed surface matrix equation, thereby obtaining the sub-pixel coordinates of the spot center.

[0027] In one embodiment, the step of determining the sub-pixel coordinates of the spot center as the target spot center sub-pixel coordinates when the sub-pixel coordinates of the spot center and the spot center pixel coordinates satisfy a preset condition includes: When the difference between the sub-pixel coordinates of the center of the light spot and the center pixel coordinates of the light spot falls within a preset threshold range, the sub-pixel coordinates of the center of the light spot are determined as the target sub-pixel coordinates of the center of the light spot. When the difference between the sub-pixel coordinates of the center of the spot and the center pixel coordinates of the spot does not fall within the preset threshold range, the initial value of the Gaussian convolution kernel is adjusted based on the preset step value until the difference between the sub-pixel coordinates of the center of the spot and the center pixel coordinates of the spot obtained in the next processing falls within the preset threshold range.

[0028] Secondly, this application also provides a dynamic spot center extraction device for a horizontal guideline reference, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of any of the above-described dynamic spot center extraction methods for a horizontal guideline reference.

[0029] One of the above technical solutions has the following advantages and beneficial effects: In the above-described method for dynamic spot center extraction based on the horizontal alignment reference, an initial spot image from the collimator is acquired. This initial spot image is then thresholded using a preset threshold method to obtain a binary spot image. Based on this binary image, the initial position of the spot center and the initial value of the Gaussian convolution kernel are obtained. A Gaussian convolution template is established based on the initial value of the Gaussian convolution kernel, and this template is used as a defined template parameter for image convolution calculation in each frame. Based on the initial position of the spot center, a convolution operation is performed between the Gaussian convolution template and the initial spot image to obtain the Hessian matrix. The Hessian matrix is ​​then obtained. The first and second eigenvalues ​​of the SSIA matrix are used to obtain the center pixel coordinates of the light spot. The initial position of the light spot center is processed based on a preset Gaussian surface fitting method to establish a surface matrix equation. The surface matrix equation is then processed using matrix QR decomposition and least squares method to obtain the sub-pixel coordinates of the light spot center. When the sub-pixel coordinates of the light spot center and the center pixel coordinates of the light spot center satisfy preset conditions, the sub-pixel coordinates of the light spot center are determined as the target sub-pixel coordinates of the light spot center, thereby achieving rapid extraction of the sub-pixel coordinates of the light spot center while ensuring the accuracy and stability of the light spot center.

[0030] This application effectively reduces the image processing area and provides a basis for Gaussian filtering kernel calculation by extracting the initial position of the light spot center and determining the initial value of the Gaussian convolution kernel. By using Gaussian convolution templates to participate in convolution calculations and algorithms such as matrix QR decomposition, the image processing speed is improved. The application also determines whether the size of the Gaussian filter kernel is appropriate by judging the calculation results of the sub-pixel coordinates of the light spot center, ensuring the accuracy of sub-pixel extraction of the light spot center and meeting the requirements of the horizontal guideline reference device for high precision, high stability and fast processing of image data in measurement. Attached Figure Description

[0031] Figure 1 This is a schematic diagram of the dynamic spot center extraction device for the horizontal guideline reference in the embodiments of this application; Figure 2 This is a flowchart illustrating the dynamic spot center extraction method for the horizontal guideline reference in this application embodiment; Figure 3 This is a flowchart illustrating the sub-pixel coordinate determination step of the target spot center in an embodiment of this application. Figure 4 This is a magnified schematic diagram of the center of the initial light spot image in an embodiment of this application; Figure 5 This is a magnified schematic diagram of the center of the light spot in the binary image of the light spot in the embodiment of this application. Detailed Implementation

[0032] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments.

[0033] Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application.

[0034] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0035] It should be understood that the data used in this way can be interchanged where appropriate, so as to the embodiments of this application described herein.

[0036] Furthermore, the terms “comprising” and “having”, and any variations thereof, are intended to cover non-exclusive inclusion, such that a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such process, method, product, or apparatus.

[0037] In addition, the term "multiple" should mean two or more.

[0038] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other.

[0039] The present application will now be described in detail with reference to the accompanying drawings and embodiments.

[0040] The dynamic spot center extraction method for the horizontal guideline reference provided in this application can be applied to, for example... Figure 1 The application environment shown.

[0041] The dynamic spot center extraction device for the horizontal guideline reference includes a memory 10 and a processor 20. The memory 10 is connected to the processor 20. The memory 10 is used to store data such as the initial spot image, the binary spot image, the initial position of the spot center, the initial value of the Gaussian convolution kernel, the Gaussian convolution template, the Hessian matrix, the pixel coordinates of the spot center, the surface matrix equation, the sub-pixel coordinates of the spot center, and the sub-pixel coordinates of the target spot center.

[0042] The processor 20 is used to acquire the initial spot image from the collimator, threshold the initial spot image based on a preset threshold method to obtain a binary spot image, and obtain the initial position of the spot center and the initial value of the Gaussian convolution kernel based on the binary spot image; establish a Gaussian convolution template based on the initial value of the Gaussian convolution kernel, and use the Gaussian convolution template as a determined template parameter, which is used for image convolution calculation in each frame; based on the initial position of the spot center, perform convolution operation with the initial spot image through the Gaussian convolution template to obtain a Hessian matrix, and obtain the first and second eigenvalues ​​of the Hessian matrix, and obtain the pixel coordinates of the spot center based on the first and second eigenvalues; establish a surface matrix equation based on a preset Gaussian surface fitting method, process the surface matrix equation according to matrix QR decomposition and least squares method to obtain the sub-pixel coordinates of the spot center; when the sub-pixel coordinates of the spot center meet the preset conditions, the sub-pixel coordinates of the spot center are determined as the sub-pixel coordinates of the target spot center.

[0043] In one example, the dynamic spot center extraction device for the horizontal guideline reference also includes a display connected to the processor 20. The display is used to display data such as the initial spot image, the binary spot image, the initial position of the spot center, the initial value of the Gaussian convolution kernel, the Gaussian convolution template, the Hessian matrix, the pixel coordinates of the spot center, the sub-pixel coordinates of the spot center, and the sub-pixel coordinates of the target spot center. It should be noted that the dynamic spot center extraction device for the horizontal guideline reference can be used within a horizontal guideline reference device.

[0044] In one embodiment, such as Figure 2 As shown, a method for dynamic spot center extraction based on a horizontal guideline is also provided, applicable to applications such as... Figure 1 The device for extracting the center of a dynamic spot of a horizontal guideline reference, as shown, includes the following methods: Step S210: Obtain the initial spot image from the collimator, perform thresholding processing on the initial spot image based on the preset threshold method to obtain a binary image of the spot, and obtain the initial position of the spot center and the initial value of the Gaussian convolution kernel based on the binary image of the spot.

[0045] Among them, the autocollimator is an optical metrology instrument that uses the principle of light self-collimation to convert minute angular changes into linear displacement for high-precision measurement.

[0046] The initial spot image is obtained from the autocollimator. It should be noted that the initial spot image is a grayscale image.

[0047] The preset threshold method is used to convert the initial spot image into a black and white binary spot image.

[0048] By processing the binary image of the light spot obtained through thresholding, the initial position of the light spot center and the initial value of the Gaussian convolution kernel are obtained.

[0049] Step S220: Based on the initial value of the Gaussian convolution kernel, establish a Gaussian convolution template and use the Gaussian convolution template as a determined template parameter. The template parameter is used for image convolution calculation in each frame.

[0050] The Gaussian convolution template, specifically the weighted matrix (convolution kernel) generated based on a two-dimensional Gaussian distribution function, is used for image smoothing and denoising.

[0051] By processing the initial value of the Gaussian convolution kernel, a Gaussian convolution template is constructed, and this Gaussian convolution template is used as a determined template parameter to participate in the convolution calculation of each subsequent frame of the image.

[0052] In one example, the step of establishing the Gaussian convolution template based on the initial value of the Gaussian convolution kernel is achieved using the following formula:

[0053] in, The initial value of the Gaussian convolution kernel, This is a Gaussian convolution template.

[0054] The two-dimensional width range of the convolution kernel is , , The larger the value, the smoother the image, but the more blurred the image will be, and the greater the computational load. In this embodiment... The two-dimensional width of the convolution kernel ranges from 100 to 1000. .

[0055] Step S230: Based on the initial position of the light spot center, perform convolution operation with the initial light spot image through a Gaussian convolution template to obtain a Hessian matrix, and obtain the first and second eigenvalues ​​of the Hessian matrix. Based on the first and second eigenvalues, obtain the pixel coordinates of the light spot center.

[0056] The Hessian matrix is ​​a symmetric square matrix composed of the second-order partial derivatives of a multivariate function, used to describe the local curvature characteristics of the function at a certain point.

[0057] Within the region corresponding to the initial position of the spot center, a Hessian matrix is ​​obtained by performing a convolution operation with the initial spot image using a Gaussian convolution template. The first and second eigenvalues ​​of the Hessian matrix are then calculated based on the Hessian matrix, and the pixel coordinates of the spot center are calculated using the first and second eigenvalues.

[0058] That is, within the region at the initial position of the light spot center, a Gaussian convolution template is applied. Compared with the initial spot image The convolution operation yields the Hessian matrix, which is essentially equivalent to Gaussian filtering the spot image. The pixel position at the center of the circular spot can be determined based on the first and second eigenvalues ​​of the Hessian matrix.

[0059] In one example, the Hessian matrix is: .

[0060] in, , and These are the second-order partial derivatives of the initial light spot image with respect to the x-axis and y-axis of the image, respectively. , and It is obtained by performing a convolution operation between a Gaussian convolution template and the initial spot image.

[0061] For example, using a Gaussian convolution template Compared with the initial spot image Perform convolution operations: ,in, , , , The second-order differentially discrete Gaussian convolution kernel is calculated using the following formula: .

[0062] In one example, the first characteristic value is the maximum value of the second partial derivative of the corresponding initial spot image at the corresponding pixel; the second characteristic value is the minimum value of the second derivative of the image grayscale function at the corresponding pixel.

[0063] Step S240: The initial position of the light spot center is processed based on the preset Gaussian surface fitting method to establish the surface matrix equation. The surface matrix equation is then processed according to matrix QR decomposition and least squares method to obtain the sub-pixel coordinates of the light spot center.

[0064] Among them, the preset Gaussian surface fitting method is a mathematical processing method that uses a two-dimensional Gaussian function model and optimization algorithms such as the least squares method to fit discrete three-dimensional data points in order to accurately extract peak positions, amplitudes and distribution parameters (such as standard deviation).

[0065] QR decomposition is a linear algebraic method that decomposes a matrix into the product of an orthogonal matrix Q and an upper triangular matrix R.

[0066] The least squares method is a method for finding the optimal approximate solution to an overdetermined system of equations by minimizing the sum of squared errors.

[0067] The initial position of the spot center is processed by Gaussian surface fitting method, and the surface matrix equation is established. The surface matrix equation is then processed by matrix QR decomposition and least squares method to calculate the sub-pixel coordinates of the spot center.

[0068] Step S250: When the sub-pixel coordinates of the light spot center and the pixel coordinates of the light spot center meet the preset conditions, determine the sub-pixel coordinates of the light spot center as the target light spot center sub-pixel coordinates.

[0069] For example, the sub-pixel coordinates of the center of the light spot are compared with the center pixel coordinates of the light spot. If the comparison result meets the preset conditions, the sub-pixel coordinates of the center of the light spot are determined to be valid coordinates, and then the sub-pixel coordinates of the center of the light spot are used as the target sub-pixel coordinates of the center of the light spot.

[0070] In the above embodiments, an initial spot image from the collimator is acquired. The initial spot image is then thresholded using a preset threshold method to obtain a binary spot image. Based on the binary spot image, the initial position of the spot center and the initial value of the Gaussian convolution kernel are obtained. A Gaussian convolution template is established based on the initial value of the Gaussian convolution kernel, and this template is used as a defined template parameter for image convolution calculation in each frame. Based on the initial position of the spot center, a convolution operation is performed between the Gaussian convolution template and the initial spot image to obtain a Hessian matrix. The first and second eigenvalues ​​are used to obtain the center pixel coordinates of the light spot. The initial position of the light spot center is processed based on the preset Gaussian surface fitting method to establish the surface matrix equation. The surface matrix equation is then processed according to matrix QR decomposition and least squares method to obtain the sub-pixel coordinates of the light spot center. When the sub-pixel coordinates of the light spot center and the center pixel coordinates of the light spot center satisfy the preset conditions, the sub-pixel coordinates of the light spot center are determined as the target sub-pixel coordinates of the light spot center, so as to realize the rapid extraction of the sub-pixel of the light spot center while ensuring the accuracy and stability of the light spot center.

[0071] This application effectively reduces the image processing area and provides a basis for Gaussian filtering kernel calculation by extracting the initial position of the light spot center and determining the initial value of the Gaussian convolution kernel. By using Gaussian convolution templates to participate in convolution calculations and algorithms such as matrix QR decomposition, the image processing speed is improved. The application also determines whether the size of the Gaussian filter kernel is appropriate by judging the calculation results of the sub-pixel coordinates of the light spot center, ensuring the accuracy of sub-pixel extraction of the light spot center and meeting the requirements of the horizontal guideline reference device for high precision, high stability and fast processing of image data in measurement.

[0072] In one embodiment, the step of acquiring the initial spot image of the autocollimator includes: adjusting the autocollimator using a horizontal alignment reference device, and acquiring the initial spot image when the spot image is within a preset number of pixels from the center of the image.

[0073] For example, by adjusting the autocollimator through the horizontal alignment reference device, when the spot image is within a preset number of pixels (within 100 pixels) from the center of the image, it is determined that the spot image is near the center of the image, and the autocollimator acquires the initial spot image, and then obtains the initial spot image through the autocollimator.

[0074] like Figure 4 The image shown is a magnified view of the center of the initial light spot image, with an image pixel size of [missing information]. .

[0075] In one example, before the step of thresholding the initial spot image based on a preset threshold method, the method includes: when the initial spot image is a color image, performing grayscale conversion on the initial spot image to obtain the grayscale-processed initial spot image.

[0076] For example, color recognition processing is performed on the acquired initial spot image. If the initial spot image is a color image, grayscale conversion processing is performed on the initial spot image to obtain the grayscale processed initial spot image.

[0077] It should be noted that if the initial spot image acquired by the autocollimator is a grayscale image, then grayscale conversion is not required.

[0078] In one embodiment, in the step of thresholding the initial spot image based on a preset threshold method to obtain a binary spot image, the preset threshold method is expressed as follows:

[0079] in, This is the initial light spot image. This is a binary image of the light spot. The preset threshold is set to a value between 80 and 150. In this embodiment, the preset threshold is 150.

[0080] The initial spot image is thresholded using a preset threshold method to eliminate stray light nucleus noise interference in the initial spot image and to determine the pixel center coordinates of the spot.

[0081] In one embodiment, the steps of obtaining the initial position of the spot center and the initial value of the Gaussian convolution kernel based on the binary image of the spot include: The average pixel coordinates in the x and y directions of the binary image of the light spot are obtained, and this average value is used as the initial position of the light spot center. The maximum pixel values ​​in the x and y directions of the binary image of the light spot are obtained, and these maximum values ​​are used as the light spot diameter. Based on a preset formula, the light spot diameter is processed to obtain the initial value of the Gaussian convolution kernel. The preset formula is: .

[0082] in, The initial value of the Gaussian convolution kernel, The diameter of the light spot. Indicates rounding down.

[0083] For example, take a binary image of the light spot. The average pixel coordinates occupied in the x and y directions (non-zero pixels in the binary image) are used as the initial position of the spot center; the binary image of the spot is taken as... The maximum value of the pixel region occupied in the x and y directions (non-zero pixels in the binary image) is used as the spot diameter. And based on the diameter of the light spot The initial value of the Gaussian convolution kernel is calculated using the above-mentioned preset formula. .

[0084] For example, the initial position of the light spot center is (580, 831). The initial value of the Gaussian convolution kernel calculated based on the light spot diameter is rounded down. =2. For example... Figure 5 The image shown is a magnified schematic diagram of the center of the light spot in a binary image.

[0085] In one example, the steps for obtaining the center pixel coordinates of the light spot based on the first and second feature values ​​include: Within a preset window centered on the corresponding pixel, calculate the extreme value of each pixel; the extreme value is the product of the first feature value and the second feature value; the position corresponding to the pixel with the largest extreme value is determined as the center pixel coordinate of the light spot.

[0086] For example, the first eigenvalue is The second eigenvalue is ,extremum In pixels Within the preset window centered on the pixel, calculate the value of each pixel. Extreme values, making The pixel with the largest extreme value These are the pixel coordinates of the center of the light spot.

[0087] In this embodiment, the pixel position at the center of the light spot is (580, 831).

[0088] In one embodiment, the surface matrix equation is:

[0089] in, for vector: , ; for The matrix: , ; A vector composed of Gaussian parameters: , The amplitude is a Gaussian distribution. Let x be the standard deviation of the initial value of the Gaussian convolution kernel in the x-direction. y is the standard deviation of the initial value of the Gaussian convolution kernel in the y direction.

[0090] For example, the process of establishing the surface matrix equation is as follows: Assume the pixel distribution within the rectangular window approximately conforms to a two-dimensional Gaussian function: .

[0091] in, The amplitude is a Gaussian distribution. , for , The standard deviation in the direction, after taking the logarithm of both sides of the above equation, is: .

[0092] The data points involved in the fitting are Then this The data points are written in matrix form.

[0093] in, for vector: , ; for The matrix: , ; A vector consisting of Gaussian parameters: .

[0094] Then establish The surface matrix equation for the error of each data point: .

[0095] In one example, the steps to obtain the sub-pixel coordinates of the spot center by processing the surface matrix equation according to matrix QR decomposition and least squares method include: Performing QR decomposition on matrix B in the surface matrix equation yields a result containing a An orthogonal matrix and a The surface matrix equation after decomposition of the upper triangular matrix is ​​obtained; the least squares method is used to fit the surface matrix equation after decomposition to minimize the mean square error of the N data points corresponding to the surface matrix equation after decomposition, and the sub-pixel coordinates of the spot center are obtained.

[0096] For example, in image data processing, the data volume is relatively large. To reduce the computational load, the matrix is... conduct Decomposition, that is: After decomposition For one orthogonal matrix, For one An upper triangular matrix. For The following derivation is performed: Multiply by both sides of the equation: .

[0097] because Since it is an orthogonal matrix, we can obtain:

[0098] make , ,in, It is a 5-dimensional column vector. For one 3D column vector, For one Given an upper triangular matrix, then: .

[0099] In the above formula, when When the minimum value is obtained, solve for it. , then it can be calculated In , , , .

[0100] in, , , , , , , .

[0101] In this embodiment, the sub-pixel coordinates of the center of the light spot are calculated to be (580.48, 831.46).

[0102] In one embodiment, such as Figure 3 As shown, the steps for determining the sub-pixel coordinates of the spot center as the target spot center sub-pixel coordinates when the sub-pixel coordinates of the spot center and the spot center pixel coordinates satisfy preset conditions include: Step S310: When the difference between the sub-pixel coordinates of the center of the light spot and the pixel coordinates of the center of the light spot falls within a preset threshold range, the sub-pixel coordinates of the center of the light spot are determined as the target sub-pixel coordinates of the center of the light spot.

[0103] The preset threshold range is set to between -0.5 and 0.5.

[0104] For example, when the difference between the x-axis coordinates of the sub-pixel coordinates and the center pixel coordinates of the spot falls between -0.5 and 0.5, and the difference between the y-axis coordinates of the sub-pixel coordinates and the center pixel coordinates of the spot falls between -0.5 and 0.5, the sub-pixel coordinates of the spot center are determined to be... The result is valid, which indicates that the Gaussian convolution template selection is effective. This convolution filtering operation can reduce the impact of noise on the image signal without reducing the details of the image signal, and realize the extraction of sub-pixel coordinates of the center of the target spot.

[0105] Step S320: When the difference between the sub-pixel coordinates of the center of the spot and the center pixel coordinates of the spot does not fall within the preset threshold range, adjust the initial value of the Gaussian convolution kernel based on the preset step value until the difference between the sub-pixel coordinates of the center of the spot and the center pixel coordinates of the spot obtained in the next processing falls within the preset threshold range.

[0106] The preset step value can be obtained from the system preset; for example, the preset step value can be set to 0.1.

[0107] For example, the difference between the sub-pixel coordinates and the center pixel coordinates of the spot is compared with a preset threshold range. Based on the comparison result, if the difference between the x-axis coordinates and the y-axis coordinates of the sub-pixel coordinates and the center pixel coordinates of the spot does not fall within the preset threshold range, the initial value of the Gaussian convolution kernel is increased or decreased based on a preset step value. Based on the adjusted initial value of the Gaussian convolution kernel, the sub-pixel coordinates and the center pixel coordinates of the spot obtained in the next processing are obtained. The difference between the sub-pixel coordinates and the center pixel coordinates of the spot obtained in the next processing is compared with the preset threshold range. This process continues until the difference between the sub-pixel coordinates and the center pixel coordinates of the spot obtained in the next processing falls within the preset threshold range. If so, the result of the sub-pixel coordinates of the spot obtained in the next processing is deemed valid, thus achieving the extraction of the sub-pixel coordinates of the target spot center.

[0108] In one embodiment, the ellipse fitting method based on spot image edge extraction, the centroid method based on spot image gray-level distribution, the surface fitting method based on Gaussian function, the Taylor method based on Hessian matrix, and the method of this application are respectively used to compare the center coordinates of the spot in 5 consecutive frames of images, as shown in the table below: Different methods Ellipse Fitting Method Based on Spot Image Edge Extraction Centroid method based on gray-level distribution of spot images Gaussian function-based surface fitting method Taylor Method Based on Hessian Matrix This application method Frame 1 (580.33,831.36) (580.37,831.41) (580.44,831.37) (580.47,831.45) (580.48,831.46) Frame 2 (580.23,831.26) (580.29,831.34) (580.33,831.31) (580.35,831.33) (580.43,831.41) Frame 3 (580.21,831.16) (580.25,831.21) (580.30,831.23) (580.31,831.27) (580.42,831.36) Frame 4 (580.24,831.16) (580.27,831.21) (580.36,831.31) (580.39,831.38) (580.41,831.34) Frame 5 (580.26,831.36) (580.31,831.31) (580.39,831.36) (580.42,831.41) (580.43,831.43)

[0109] The above comparison results show that the extraction accuracy of the method in this application is higher than that of surface fitting based on Gaussian function, ellipse fitting method based on edge extraction of spot image, and centroid method based on gray-level distribution of spot image.

[0110] The method proposed in this application is more stable than the Taylor method based on the Hessian matrix.

[0111] In the above embodiments, by pre-extracting the center of the light spot and determining the initial value of the Gaussian convolution kernel, the image processing area can be effectively reduced and the basis for calculating the convolution kernel for Gaussian filtering can be provided. Using Gaussian convolution to filter the light spot image effectively reduces the impact of noise on the image signal and enhances the stability of the extracted light spot center. Using a fixed Gaussian convolution template for convolution calculation, as well as algorithms such as matrix QR decomposition, improves the image processing speed. Judging whether the size of the convolution kernel provided by Gaussian filtering is appropriate based on the sub-pixel coordinate calculation result of the light spot center ensures the accuracy of the sub-pixel extraction of the light spot center, meeting the requirements of the horizontal guideline reference device for high precision, high stability, and fast processing of image data in measurement.

[0112] It should be understood that, although Figures 2 to 3 The steps in the flowchart are shown sequentially according to the arrows, but these steps are not necessarily executed in the order indicated by the arrows.

[0113] Unless otherwise specified in this document, there is no strict order in which these steps are performed, and they may be performed in any other order.

[0114] and, Figures 2 to 3 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0115] In one embodiment, this application also provides a dynamic spot center extraction module for a horizontal guideline reference, comprising: The light spot image processing unit is used to acquire the initial light spot image from the collimator, perform thresholding processing on the initial light spot image based on the preset threshold method to obtain the binary image of the light spot, and obtain the initial position of the light spot center and the initial value of the Gaussian convolution kernel based on the binary image of the light spot.

[0116] The template establishment unit is used to establish a Gaussian convolution template based on the initial value of the Gaussian convolution kernel, and to use the Gaussian convolution template as a defined template parameter. The template parameter is used for image convolution calculation in each frame.

[0117] The spot center pixel coordinate calculation unit is used to perform convolution operation with the initial spot image through a Gaussian convolution template based on the initial position of the spot center to obtain the Hessian matrix, and obtain the first and second eigenvalues ​​of the Hessian matrix, and obtain the spot center pixel coordinates based on the first and second eigenvalues.

[0118] The sub-pixel coordinate calculation unit at the center of the light spot is used to process the initial position of the center of the light spot based on a preset Gaussian surface fitting method, establish a surface matrix equation, and process the surface matrix equation according to matrix QR decomposition and least squares method to obtain the sub-pixel coordinates of the center of the light spot.

[0119] The coordinate determination unit is used to determine the sub-pixel coordinates of the light spot center as the target light spot center sub-pixel coordinates when the sub-pixel coordinates of the light spot center and the pixel coordinates of the light spot center meet the preset conditions.

[0120] For specific limitations on the dynamic spot center extraction module for the horizontal guideline reference, please refer to the limitations on the dynamic spot center extraction method for the horizontal guideline reference mentioned above, which will not be repeated here.

[0121] Each module in the aforementioned dynamic spot center extraction module for the horizontal alignment reference can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware within or independently of the processor in the dynamic spot center extraction device for the horizontal alignment reference, or stored in software within the memory of the dynamic spot center extraction device for the horizontal alignment reference, so that the processor can call and execute the corresponding operations of each module.

[0122] In one embodiment, such as Figure 1 As shown, a dynamic spot center extraction device for a horizontal guideline reference is also provided, including a memory 10 and a processor 20. The memory 10 stores a computer program, and the processor 20 executes the computer program to implement the steps of any of the above-described dynamic spot center extraction methods for a horizontal guideline reference.

[0123] For a detailed description of the memory 10 and the processor 20, please refer to the descriptions of the memory 10 and the processor 20 in the above embodiments, which will not be repeated here.

[0124] The processor 20 acquires the initial spot image from the collimator, performs thresholding processing on the initial spot image based on a preset threshold method to obtain a binary spot image, and obtains the initial position of the spot center and the initial value of the Gaussian convolution kernel based on the binary spot image; a Gaussian convolution template is established based on the initial value of the Gaussian convolution kernel, and the Gaussian convolution template is used as a determined template parameter, which is used for image convolution calculation in each frame; based on the initial position of the spot center, a convolution operation is performed between the Gaussian convolution template and the initial spot image to obtain the Hessian matrix, and the Hessian matrix is ​​obtained. The first and second eigenvalues ​​are used to obtain the center pixel coordinates of the light spot. The initial position of the light spot center is processed based on the preset Gaussian surface fitting method to establish the surface matrix equation. The surface matrix equation is then processed using matrix QR decomposition and least squares method to obtain the sub-pixel coordinates of the light spot center. When the sub-pixel coordinates of the light spot center and the center pixel coordinates of the light spot center satisfy the preset conditions, the sub-pixel coordinates of the light spot center are determined as the target sub-pixel coordinates of the light spot center, thereby realizing the rapid extraction of the sub-pixel of the light spot center while ensuring the accuracy and stability of the light spot center.

[0125] In the above embodiments, the processor 20 can effectively reduce the image processing area and provide a basis for Gaussian filtering kernel calculation by extracting the initial position of the light spot center and determining the initial value of the Gaussian convolution kernel; by using Gaussian convolution templates to participate in convolution calculations and algorithms such as matrix QR decomposition, the image processing speed is improved; by judging whether the sub-pixel coordinate calculation result of the light spot center is appropriate for the convolution kernel size provided by Gaussian filtering, the sub-pixel extraction accuracy of the light spot center is guaranteed, which meets the requirements of the horizontal guideline reference device for high precision, high stability and fast processing of image data in measurement.

[0126] In one embodiment, a computer storage medium is also provided, on which a computer program is stored, which, when executed by a processor, implements the steps of the dynamic spot center extraction method for the horizontal guideline reference described above.

[0127] For example, when a computer program is executed by a processor, it performs the following steps: An initial spot image from a collimator is acquired. This initial spot image is then thresholded using a preset thresholding method to obtain a binary spot image. Based on this binary image, the initial position of the spot center and the initial value of the Gaussian convolution kernel are determined. A Gaussian convolution template is established based on the initial Gaussian convolution kernel value, and this template is used as a defined template parameter for convolution calculation in each frame. Based on the initial spot center position, a convolution operation is performed between the Gaussian convolution template and the initial spot image to obtain a Hessian matrix. The first and second eigenvalues ​​of the Hessian matrix are then obtained, and the pixel coordinates of the spot center are derived from these eigenvalues. The initial spot center position is then processed using a preset Gaussian surface fitting method to establish a surface matrix equation. This equation is then processed using matrix QR decomposition and least squares to obtain the sub-pixel coordinates of the spot center. When the sub-pixel coordinates of the spot center satisfy a preset condition, these sub-pixel coordinates are determined as the target spot center sub-pixel coordinates.

[0128] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the division operation methods described above.

[0129] Any references to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory.

[0130] Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.

[0131] Volatile memory may include random access memory (RAM) or external cache memory.

[0132] By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), direct memory bus RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0133] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0134] The above-described embodiments are merely examples of several implementation methods of this application. They are described in a relatively specific and detailed manner, but should not be construed as limiting the scope of the patent application.

[0135] It should be noted that, for those skilled in the art, several modifications and improvements can be made without departing from the concept of this application, and these all fall within the scope of protection of this application.

[0136] Therefore, the scope of protection of this patent application shall be determined by the appended claims.

Claims

1. A method for extracting the center of a dynamic light spot from a horizontal guideline reference, characterized in that, include: The initial spot image from the collimator is acquired, and the initial spot image is thresholded based on a preset threshold method to obtain a binary spot image. Based on the binary spot image, the initial position of the spot center and the initial value of the Gaussian convolution kernel are obtained. Based on the initial value of the Gaussian convolution kernel, a Gaussian convolution template is established, and the Gaussian convolution template is used as a determined template parameter. The template parameter is used for image convolution calculation in each frame. Based on the initial position of the light spot center, the Gaussian convolution template is used to perform a convolution operation with the initial light spot image to obtain a Hessian matrix, and the first and second eigenvalues ​​of the Hessian matrix are obtained. Based on the first and second eigenvalues, the pixel coordinates of the light spot center are obtained. The initial position of the light spot center is processed based on the preset Gaussian surface fitting method to establish the surface matrix equation. The surface matrix equation is then processed according to matrix QR decomposition and least squares method to obtain the sub-pixel coordinates of the light spot center. When the sub-pixel coordinates of the light spot center and the pixel coordinates of the light spot center satisfy a preset condition, the sub-pixel coordinates of the light spot center are determined as the sub-pixel coordinates of the target light spot center.

2. The method for dynamic spot center extraction of a horizontal guideline reference according to claim 1, characterized in that, The step of acquiring the initial spot image from the collimator includes: The autocollimator is adjusted by a horizontal alignment reference device, and the initial spot image is acquired when the spot image is within a preset number of pixels from the center of the image. Before the step of thresholding the initial spot image based on a preset threshold method, the following steps are included: When the initial spot image is a color image, the initial spot image is subjected to grayscale conversion processing to obtain a grayscale-processed initial spot image.

3. The method for extracting the dynamic spot center of a horizontal guideline reference according to claim 2, characterized in that, In the step of thresholding the initial spot image based on a preset threshold method to obtain a binary spot image, the preset threshold method is expressed as: in, The initial light spot image, The binary image of the light spot. The preset threshold value is 80-150.

4. The method for dynamic spot center extraction of the horizontal guideline reference according to claim 3, characterized in that, The step of obtaining the initial position of the spot center and the initial value of the Gaussian convolution kernel based on the binary image of the spot includes: The average value of the pixel coordinates in the x and y directions of the binary image of the light spot is obtained, and the average value is determined as the initial position of the center of the light spot; The maximum values ​​of the pixel regions occupied in the x and y directions of the binary image of the light spot are obtained, and these maximum values ​​are determined as the diameter of the light spot. Based on a preset formula, the diameter of the light spot is processed to obtain the initial value of the Gaussian convolution kernel; the preset formula is: in, The initial value of the Gaussian convolution kernel is... The diameter of the light spot is... Indicates rounding down.

5. The method for dynamic spot center extraction of a horizontal guideline reference according to claim 1, characterized in that, In the step of establishing a Gaussian convolution template based on the initial value of the Gaussian convolution kernel, the Gaussian convolution template is obtained by the following formula: in, The initial value of the Gaussian convolution kernel is... This is the Gaussian convolution template.

6. The method for dynamic spot center extraction of a horizontal guideline reference according to claim 1, characterized in that, The Hessian matrix is: in, , and These are the second-order partial derivatives of the initial light spot image with respect to the x-axis and y-axis directions of the image, respectively. , and The image is obtained by performing a convolution operation between the Gaussian convolution template and the initial spot image.

7. The method for dynamic spot center extraction of a horizontal guideline reference according to claim 6, characterized in that, The first feature value is the maximum value of the second partial derivative of the initial spot image at the corresponding pixel; the second feature value is the minimum value of the second derivative of the image grayscale function at the corresponding pixel. The step of obtaining the center pixel coordinates of the light spot based on the first feature value and the second feature value includes: Within a preset window centered on the corresponding pixel, the extreme value of each pixel is calculated; the extreme value is the product of the first feature value and the second feature value. The position corresponding to the pixel with the largest extreme value is determined as the center pixel coordinate of the light spot.

8. The method for dynamic spot center extraction of a horizontal guideline reference according to claim 1, characterized in that, The equation of the surface matrix is: in, for vector: , ; for The matrix: , ; A vector composed of Gaussian parameters: , The amplitude is a Gaussian distribution. Let x be the standard deviation of the initial value of the Gaussian convolution kernel in the x-direction. y is the standard deviation of the initial value of the Gaussian convolution kernel in the y direction; The step of processing the surface matrix equation according to matrix QR decomposition and least squares method to obtain the sub-pixel coordinates of the spot center includes: Performing QR decomposition on matrix B in the surface matrix equation yields a result containing a an orthogonal matrix and a The surface matrix equation after decomposition of the upper triangular matrix; The least squares method is used to fit the decomposed surface matrix equation to minimize the mean square error of the N data points corresponding to the decomposed surface matrix equation, thereby obtaining the sub-pixel coordinates of the light spot center.

9. The method for extracting the dynamic spot center of a horizontal guideline reference according to claim 1, characterized in that, The step of determining the sub-pixel coordinates of the light spot center as the target light spot center sub-pixel coordinates when the sub-pixel coordinates of the light spot center and the light spot center pixel coordinates satisfy a preset condition includes: When the difference between the sub-pixel coordinates of the light spot center and the pixel coordinates of the light spot center falls within a preset threshold range, the sub-pixel coordinates of the light spot center are determined as the target sub-pixel coordinates of the light spot center. When the difference between the sub-pixel coordinates of the center of the light spot and the center pixel coordinates of the light spot does not fall within the preset threshold range, the initial value of the Gaussian convolution kernel is adjusted based on the preset step value until the difference between the sub-pixel coordinates of the center of the light spot and the center pixel coordinates of the light spot obtained in the next processing falls within the preset threshold range.

10. A dynamic spot center extraction device based on a horizontal guideline, characterized in that, It includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the dynamic spot center extraction method for the horizontal guideline reference as described in any one of claims 1 to 9.