A laser calibration method and apparatus
By calibrating the laser spot using calibration and image tracking methods, the problem of the laser spot not accurately landing on the target point was solved, thus improving the precision and accuracy of the laser system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BRIGHTVIEW MEDICAL TECHNOLOGIES (NANJING) CO LTD
- Filing Date
- 2024-05-27
- Publication Date
- 2026-07-21
AI Technical Summary
In laser measurement, processing, imaging, or treatment systems, the calibrated laser spot cannot accurately fall on the target point, resulting in a decrease in system accuracy.
By calibrating the correspondence between the target point position and the scanning galvanometer parameters, the offset of the scanning galvanometer parameters and the corresponding laser spot displacement data are obtained. The laser spot image is acquired using the image tracking method, the displacement of the spot relative to the target point position is calculated, and the scanning galvanometer parameters are adjusted according to the displacement and calibration coefficient to ensure that the spot is accurately calibrated to the target point.
It enables precise calibration of the laser spot, improves the accuracy of system measurement, processing, imaging, or treatment, simplifies the calibration process and reduces time, while also enhancing calibration precision.
Smart Images

Figure CN121017783B_ABST
Abstract
Description
Technical Field
[0001] This application relates to image processing technology, and more particularly to a laser calibration method and apparatus. Background Technology
[0002] In laser measurement, processing, imaging, or treatment systems, scanning galvanometers are typically used to adjust the laser's exit position so that it precisely lands on the target point. Generally, calibration is performed to establish the correspondence between the galvanometer's deflection angle parameters and the target point's coordinates. However, during actual system operation, the laser's focal plane during calibration may differ from its working focal plane. This can cause the laser beam emitted from the galvanometer to not accurately land on the target point even after the galvanometer's deflection angle has been adjusted according to the calibration.
[0003] Therefore, there is an urgent need for a laser calibration method to calibrate the emitted laser so that it accurately lands at the target point. Summary of the Invention
[0004] In view of this, the purpose of this application is to provide a laser calibration method and apparatus that can calibrate emitted lasers.
[0005] In a first aspect, this application provides a laser calibration method, the method comprising:
[0006] The correspondence between the calibrated target point position and the scanning galvanometer parameters;
[0007] The offset of multiple sets of scanning galvanometer parameters and their corresponding laser spot displacement data are obtained to obtain calibration coefficients;
[0008] According to the scanning galvanometer parameters, the laser spot image is acquired using an image tracking method to obtain the position of the laser spot in the image, and the displacement between the laser spot and the target point position corresponding to the scanning galvanometer parameters is calculated.
[0009] The adjustment offset of the scanning galvanometer parameters is determined based on the displacement and the calibration coefficient.
[0010] Adjust the scanning galvanometer parameters according to the adjusted offset to calibrate the laser spot position to the target point position.
[0011] Furthermore, the acquisition of laser spot images includes: for two consecutive frames of acquired laser spot images, determining whether the two frames satisfy the frame difference condition; if so, obtaining the position of the laser spot in the image; the frame difference condition is: a laser spot exists in one frame and a laser spot does not exist in the other frame.
[0012] Furthermore, determining whether two frames satisfy the frame difference condition includes:
[0013] Calculate the pixel value difference between the two frames to obtain the frame difference image;
[0014] The frame difference image is filtered to obtain a filtered image;
[0015] Obtain the maximum pixel value and the average pixel value of the frame difference image;
[0016] The pixel values of the frame difference image after background removal are obtained based on the average pixel value of the pixels in the frame difference image and the pixel value of the filtered image.
[0017] In the frame difference image after background removal, the number of pixels with pixel values greater than or equal to the first standard pixel value and the percentage of the number of pixels in the frame difference image after background removal are obtained.
[0018] If the maximum pixel value of the pixel in the frame difference image is greater than or equal to the second standard pixel value, and the percentage is greater than or equal to a preset ratio, then the two frames are determined to satisfy the frame difference condition.
[0019] Furthermore, before determining whether two frames of images meet the frame difference condition, it is first determined whether the displacement of the two frames of images meets the preset condition. If it does, then it is determined whether the two frames of images meet the frame difference condition.
[0020] Furthermore, determining whether the displacement of the two frames of images meets the preset conditions includes: selecting the local region where the target point is located in the two frames of images, calculating the Euclidean distance between the target point position in the tracked image of the next frame and the target point position in the previous frame of images, and if the Euclidean distance is less than or equal to a certain threshold, then determining that the displacement of the two frames of images meets the preset conditions.
[0021] Furthermore, obtaining the position of the laser spot in the image includes: calculating the centroid coordinates of the laser spot as its position in the image.
[0022] Furthermore, the calculation of the centroid coordinates of the laser spot includes:
[0023] Obtain the initial spot size of the laser beam;
[0024] Based on the initial spot size, calculate the centroid coordinates within the initial spot area;
[0025] The initial spot size is reduced by a preset ratio, and the centroid coordinates are recalculated within the reduced spot area. This step is repeated, and after a preset number of iterations, the final centroid coordinates of the laser spot are obtained.
[0026] Furthermore, obtaining the position of the laser spot in the image includes: verifying the currently obtained laser spot position, specifically:
[0027] The current scanning galvanometer parameters are randomly adjusted to obtain the offset of the scanning galvanometer parameters. Based on the offset and the calibration coefficient, the displacement corresponding to the laser spot is calculated, and the actual position of the laser spot after adjustment is detected. It is determined whether the detected spot displacement is within a certain difference range from the calculated spot displacement. If it is within a certain difference range, it means that the currently acquired laser spot position is accurate. If it is not within a certain difference range, the previously determined accurate laser spot position is used as the current laser spot position in the image.
[0028] Furthermore, the image tracking method specifically includes:
[0029] Obtain the reference frame image and the current frame image;
[0030] Obtain N image blocks from the current frame image, where N≥2 and N is a positive integer;
[0031] The displacement and registration confidence of each image block relative to the reference frame image are calculated using image registration methods.
[0032] Calculate the spatial confidence and / or temporal confidence of each image block in the current frame; wherein, the spatial confidence of the i-th image block among N image blocks is calculated based on the registration confidence of the j-th image block and its spatial weight, and the spatial weight of the j-th image block represents the difference between the displacement of the i-th image block relative to the reference frame image and the displacement of the j-th image block relative to the reference frame image, i, j≤N;
[0033] The temporal confidence of the i-th image block among N image blocks is calculated based on the registration confidence of the i-th image block and its temporal weight; the temporal weight represents the difference between the displacement of the i-th image block relative to the reference frame image and the displacement of the image block relative to the reference frame image in the previous frame or the two previous frames.
[0034] From N image patches, select M image patches whose spatial confidence and / or temporal confidence meet the first preset condition. Then, perform image tracking of the current frame based on the position of the M image patches in the current frame and their displacement relative to the reference frame.
[0035] On the other hand, this application also includes a laser calibration device, characterized in that the device comprises:
[0036] The calibration unit is used to calibrate the correspondence between the target point position and the scanning galvanometer parameters, and to obtain the offset of multiple sets of scanning galvanometer parameters and the corresponding displacement data of the laser spot, so as to obtain the calibration coefficients.
[0037] The acquisition unit is used to acquire laser spot images according to the scanning galvanometer parameters using an image tracking method;
[0038] The acquisition unit is used to acquire the position of the laser spot in the image and calculate the displacement between the laser spot and the target point.
[0039] The determining unit is used to determine the adjustment offset of the scanning galvanometer parameters based on the displacement calculated by the acquiring unit and the calibration coefficients obtained by the calibration unit.
[0040] The calibration unit is used to adjust the scanning galvanometer parameters according to the adjustment offset, and to calibrate the laser spot position to the target point position.
[0041] Therefore, this application has the following beneficial effects:
[0042] This application obtains the offset parameter of the scanning galvanometer based on the displacement of the laser spot, and adjusts the deflection angle of the galvanometer according to this parameter, thereby calibrating the laser emission position. This ensures that the laser spot accurately falls on the target point, guaranteeing the accuracy of the laser system during measurement, processing, imaging, or treatment. The calibration method of this application is simple and time-saving, and the use of image tracking further improves the accuracy of laser position calibration. Attached Figure Description
[0043] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0044] Figure 1 This is a flowchart illustrating a laser calibration method provided in an embodiment of this application;
[0045] Figure 2 This is an example diagram of the device structure of a laser calibration apparatus provided in an embodiment of this application. Detailed Implementation
[0046] To facilitate understanding and explanation of the technical solutions provided in the embodiments of this application, the following will first describe the terms that may be involved in the embodiments of this application and the background technology of this application.
[0047] In a laser scanning system, calibration yields the conversion relationship between the deflection angle of the scanning galvanometer and the coordinates of the target point. Based on this calibration result, the scanning galvanometer parameters are set to ensure the emitted laser spot reaches the target point. However, changes in the working environment or adjustments to the system's optical components can cause the focal plane of the laser during calibration to differ from the actual working focal plane. In such cases, the calibration result may not accurately pinpoint the target point. Therefore, further laser calibration is necessary. To facilitate understanding of the technical solutions provided in this application's embodiments, a laser calibration method and apparatus are described below with reference to the accompanying drawings.
[0048] This embodiment takes a laser scanning imaging system as an example. It is applicable to laser systems that perform point scanning, line scanning, or area scanning. Moreover, the laser being calibrated is not limited to illumination light, aiming light, or treatment light, but can also be a laser with other functions.
[0049] First, see Figure 1 The figure is a schematic flowchart of the laser calibration method provided in the embodiment of this application, which specifically includes S101-S105.
[0050] S101. The correspondence between the calibrated target point position and the scanning galvanometer parameters.
[0051] An image of a laser spot reflected from the eye is captured using a camera. The coordinates of the spot's center in the image are calculated, and this coordinate point and its corresponding scanning galvanometer parameters are used as the calibration result for that point. The scanning galvanometer parameters are adjusted to change the spot's position in the image, thus obtaining the transformation relationship between the scanning galvanometer parameters and the coordinates of the target point in the image. More preferably, each coordinate point and its corresponding galvanometer parameters are converted into a homography matrix using the least squares method, which serves as the calibration result and improves the calibration accuracy.
[0052] S102. Obtain a set of offset values for scanning galvanometer parameters and their corresponding laser spot displacement data to obtain calibration coefficients.
[0053] Specifically, let dm represent the offset angle of the scanning galvanometer in the x direction, dn represent the offset angle of the scanning galvanometer in the y direction, and dx and dy represent the displacements of the laser spot in the x and y directions, respectively. By applying two different parameters to the scanning galvanometer, the offset angles (dm, dn) between the scanning galvanometer parameters can be calculated; at the same time, under the two scanning galvanometer parameters, the position of the laser spot is measured respectively, and the displacements (dx, dy) between the spots are calculated. Thus, a set of offset values of the scanning galvanometer parameters and their corresponding laser spot displacement data can be obtained. By changing the parameters of the scanning galvanometer, multiple sets of offset angles of the scanning galvanometer and their corresponding laser spot displacements are obtained, and then the two-dimensional transformation matrix [a, b, c, d], i.e., the calibration coefficients of the two, can be obtained according to the relationship (1).
[0054]
[0055] Where a, b, c, and d are matrix parameters. Using these calibration coefficients, the offset (dm, dn) to be applied to the galvanometer can be obtained from the displacement (dx, dy) of the light spot.
[0056] S103 acquires a laser spot image using an image tracking method according to the scanning galvanometer parameters, obtains the position of the laser spot in the image, and calculates the displacement between the laser spot and the target point.
[0057] Specifically, a target point is selected, and the corresponding scanning galvanometer parameters are set according to the calibration results of step S101. Multiple frames of laser spot images are acquired; these multiple frames are tracked images obtained using an image tracking method. This embodiment provides an example of an image tracking method that can improve the accuracy and reliability of image tracking. The specific steps include:
[0058] (1) Obtain the reference frame image and the current frame image. The reference frame refers to the image used as a reference in image tracking, and the current frame image is the image that needs to be tracked.
[0059] (2) Obtain N image blocks in the current frame image. The size of the image blocks is generally about one-tenth of the overall image size, and only small structural features that can contain the effective content of the image are needed.
[0060] (3) The displacement of each image block relative to the reference frame image and the registration confidence are calculated using the image registration method. The registration confidence is used to characterize the difference between the image block and the reference frame image and reflect the reliability of the registration.
[0061] (4) Calculate the spatial confidence and / or temporal confidence of each image block in the current frame. The spatial confidence of the i-th image block among the N image blocks is calculated based on the registration confidence and spatial weight of the j-th image block. The spatial weight of the j-th image block represents the difference between the displacement of the i-th image block relative to the reference frame image and the displacement of the j-th image block relative to the reference frame image, i, j≤N.
[0062] It is understood that the spatial confidence of the i-th image block in this application is calculated from the registration confidence of all image blocks and their respective spatial weights. The smaller the difference between the displacement of the i-th image block relative to the reference frame and the displacement of the j-th image block relative to the reference frame, the larger the spatial weight of the j-th image block. A larger spatial weight results in a higher calculated spatial confidence. That is, when the displacement of the j-th image block relative to the reference frame is close to the displacement of the i-th image block relative to the reference frame, the spatial confidence of the i-th image block will be increased.
[0063] In addition, the temporal confidence of the i-th image block among the N image blocks is calculated based on the registration confidence of the i-th image block and its temporal weight; the temporal weight represents the difference between the displacement of the i-th image block relative to the reference frame image and the displacement of the image block relative to the reference frame image in the previous frame or the two previous frames.
[0064] Both spatial and temporal weights are calculated using probability distribution functions. These functions are not specifically limited and can include neural network models, Gaussian distributions, binomial distributions, Poisson distributions, geometric distributions, etc., depending on the specific application environment. Using probability distribution functions allows for more accurate calculation of spatial and temporal weights.
[0065] As an example, spatial confidence is calculated using the following formula:
[0066]
[0067] in, It is the spatial confidence of the i-th image patch at time t, where time t is the current frame time. Let f1 represent the registration confidence of the j-th image patch at time t, and f1 be the spatial weight parameter assignment function. It is the displacement of the i-th image block at time t, expressed in vector form. The displacement of the j-th image patch at time t is represented in vector form, σ x It is a parameter related to distance.
[0068] As an example, the time confidence score is specifically calculated using the following formula:
[0069]
[0070] in, It is the time confidence of the i-th image patch at time t, where time t is the current frame time. f1 is the registration confidence score of the i-th image block at time t, and f2 is the first-time weight parameter assignment function. It is the displacement of the i-th image block at time t, expressed in vector form. The displacement of the i-th image block at time t-1 is represented in vector form, σ t It is a parameter related to speed.
[0071] (5) Select M image blocks from N image blocks that meet the first preset conditions in terms of spatial confidence and / or temporal confidence, and perform image tracking of the current frame based on the position of the M image blocks in the current frame image and their displacement relative to the reference frame image.
[0072] As one possible implementation, another approach is to select M image blocks from N image blocks whose cumulative temporal confidence and / or cumulative spatial confidence from the current frame and preceding image frames meet a first preset condition. This application can perform cumulative calculation only on temporal confidence, only on spatial confidence, or a combination of both. Furthermore, the calculation method allows for not only addition of temporal and spatial confidence, but also multiplication or other combinations to characterize the confidence of the current image block. Besides cumulative addition, weighted addition can also be used, with attenuation weights set, where image frames older than the current frame have smaller weights. This application further improves the accuracy and reliability of image tracking by selecting image blocks based on the cumulative calculation results of temporal and / or spatial confidence.
[0073] For the laser spot image acquired using the tracking method described above in this application, it can be first determined whether the tracking displacement of two consecutive frames meets the preset conditions. If it does, the following calibration steps can be performed. Here, the Euclidean distance can be calculated for the local area to determine this. Specifically, the local area where the target point is located in two consecutive frames is selected. The position of the target point in the previous frame is denoted as spotPos, with coordinates (sx, sy). The position of the target point in the next frame after tracking is denoted as spotPos1, with coordinates (sx1, sy1). These are the new target point coordinates calculated based on the image tracking. Then, the Euclidean distance between spotPos and spotPos1 is calculated. If the Euclidean distance is greater than a certain threshold, it indicates that the tracking displacement between these two frames is relatively large and is not suitable for laser calibration. If the Euclidean distance is less than or equal to a certain threshold, it is determined that the displacement of the two frames meets the preset conditions.
[0074] In one possible implementation, the offset distance between spotPos and spotPos1 can be directly obtained through an image tracking algorithm, thereby determining whether the displacement of the two frames meets the preset conditions.
[0075] If the displacement of two consecutive frames meets a preset condition, then the two frames are further checked to see if they satisfy a frame difference condition. If they do, the position of the laser spot in the image is obtained. The frame difference condition is: a laser spot exists in one frame, but not in the other. The method of obtaining these two frames is not limited. This embodiment provides an implementation method: because the pulse frequency of the laser spot is different from the acquisition frequency, the acquired laser spot is a flickering spot. That is, during the acquisition process, there may be two consecutive frames where one frame has a laser spot and the other does not. By utilizing the difference between these two frames, the position of the laser spot can be accurately determined, the displacement between the laser spot and the target point can be calculated, and the image can be calibrated.
[0076] In one possible implementation, the specific steps for determining whether two frames satisfy the frame difference condition include:
[0077] Calculate the pixel value difference between two frames to obtain the frame difference image;
[0078] To reduce the impact of some discrete bright pixels in the image background on the image, the frame difference image is filtered to obtain a filtered image. The filter kernel can be set as needed; in this embodiment, a 9*9 size can be used.
[0079] Obtain the maximum pixel value and the average pixel value of the frame difference image;
[0080] The pixel values of the frame difference image after background removal are obtained by subtracting the average pixel value of the frame difference image from the pixel value of the filtered image.
[0081] In the frame difference image after background removal, the number of pixels with a pixel value greater than or equal to the first standard pixel value and the percentage of the number of pixels in the frame difference image after background removal are obtained. It should be noted that the first standard pixel value can be set to 10, and the specific value of the first standard pixel value is not limited here.
[0082] The system determines whether the maximum pixel value of the pixels in the frame difference image is greater than or equal to the second standard pixel value, and whether the percentage obtained above is greater than or equal to a preset ratio. If both conditions are met, then the two consecutive frames are considered to satisfy the frame difference condition. It should be noted that in this embodiment, the second standard pixel value can be 15, and the preset ratio can be 1%. The specific values of the second standard pixel value and the preset ratio are not limited here.
[0083] In one possible implementation, calculating the pixel value difference between two frames of images includes: calculating the pixel value difference between a first local region of the previous frame and a second local region of the subsequent frame to obtain a frame difference image; for example, cropping a 100*100 first local region image centered on the target point spotPos from the previous frame and a 100*100 second local region image centered on the target point spotPos1 from the subsequent frame, and using the first local region image and the second local region image to calculate the frame difference image can reduce computational effort and improve computational speed.
[0084] It should be noted that the background effect can be removed and the laser spot can be enhanced by calculating the frame difference.
[0085] For an image that meets the frame difference condition, the position of the laser spot in the image is obtained. In one possible implementation, the specific steps include: calculating the centroid coordinates of the laser spot as its position in the image. In this embodiment, calculating the centroid coordinates of the laser spot specifically includes: obtaining the initial spot size and calculating the centroid coordinates within the initial spot area; reducing the initial spot size by a preset ratio and recalculating the centroid coordinates within the reduced spot area; repeating this step for a preset number of iterations to obtain the final centroid coordinates of the laser spot, which is then used as its position in the image.
[0086] Specifically, the initial laser spot is obtained from the image, and its size is spotsize. A preset number of iterations and a preset ratio k are set.
[0087] Solve for the centroid coordinates within the spotsize range, then reduce the spotsize by a preset ratio:
[0088] Spotsize=spotsize*k, k<1,
[0089] spotsize is the initial spot size, k is the preset ratio, and Spotsize is the reduced spot size; the centroid coordinates are recalculated within the reduced spot size.
[0090] Repeat the above process to continuously reduce the range of the laser spot until the preset number of iterations is reached. Once the iteration is complete, the final centroid coordinates (r, c) of the laser spot are obtained, which serve as the position of the laser spot in the image.
[0091] If the calculation is performed using a local region of the image, then the coordinates of the local region (such as the coordinates of the upper left corner of the region in the entire image) need to be added to the final centroid coordinates to obtain the coordinates of the laser spot (ax, ay).
[0092] Using the coordinates (ax, ay) of the laser spot and the coordinates of the target point spotPos1 in the laser spot image, calculate the displacement (dx, dy) between them, where dx = ax - sx1 and dy = ay - sy1.
[0093] S104 determines the adjustment offset of the scanning galvanometer parameters based on the displacement and calibration coefficient between the laser spot and the target point.
[0094] Substituting the displacements (dx, dy) and calibration coefficients into equation (1), the adjustment offsets dm and dn of the scanning galvanometer are obtained.
[0095] S105. Adjust the scanning galvanometer according to the adjustment offset to calibrate the laser spot position to the target point position.
[0096] The calculated offsets dm and dn are applied to the galvanometer so that the laser spot falls on the target point.
[0097] Considering that in some special cases, stray light may accompany the laser beam for unknown reasons, a large area of stray light in the image can cause a deviation between the calculated centroid position of the laser spot and its actual centroid position. Therefore, to avoid this situation, the position of the laser spot can be verified. In one possible implementation, the verification steps are as follows:
[0098] The parameters of the current scanning galvanometer are randomly adjusted to obtain the offsets dm and dn of the scanning galvanometer parameters. Based on the offset and calibration coefficients [a, b, c, d], the displacement of the laser spot is calculated using formula (1). The actual position of the laser spot after the galvanometer is adjusted is detected to determine whether the detected spot displacement is within a certain difference range from the calculated spot displacement. If it is within a certain difference range, it means that the current laser spot position is accurate. If it is not within a certain difference range, the position of the laser spot that was previously determined to be accurate is used as the position of the current laser spot in the image. Specifically, the offset (dx, dy) of the laser spot that was previously verified to be accurate is directly used. The offset that the current scanning galvanometer needs to move is calculated using the calibration coefficients [a, b, c, d] and formula (1) to calibrate the laser.
[0099] The calibration method in this application can be performed by calibrating the laser spot once every time it moves, i.e., calibrating all laser spots, or by setting calibration conditions and calibration intervals as needed, such as calibrating the first laser spot in each row, or selecting the first laser spot in a group of closely spaced laser spots for calibration.
[0100] and Figure 1Corresponding to the method described above, embodiments of this application also provide a laser calibration device for calibrating lasers. Figure 1 The specific implementation of the method is described in the embodiments of this application. A laser calibration device can be applied to computer terminals or various mobile devices, and its structural schematic diagram is shown below. Figure 2 As shown, the laser calibration device specifically includes:
[0101] The calibration unit 201 is used to calibrate the correspondence between the target point position and the scanning galvanometer parameters, and to obtain the offset of multiple sets of scanning galvanometer parameters and the corresponding offset data of the laser spot, so as to obtain the calibration coefficient.
[0102] Acquisition unit 202 is used to acquire laser spot images using an image tracking method according to the scanning galvanometer parameters;
[0103] The acquisition unit 203 is used to acquire the position of the laser spot in the image and calculate the displacement between the laser spot and the target point.
[0104] The determining unit 204 is used to determine the adjustment offset of the scanning galvanometer parameters based on the displacement calculated by the acquiring unit and the calibration coefficients obtained by the calibration unit.
[0105] The calibration unit 205 is used to adjust the scanning galvanometer parameters according to the adjustment offset, and to calibrate the laser spot position to the target point position.
[0106] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0107] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A laser calibration method, characterized in that, The method includes: The correspondence between the calibrated target point position and the scanning galvanometer parameters; The offset of multiple sets of scanning galvanometer parameters and their corresponding laser spot displacement data are obtained to obtain calibration coefficients; According to the scanning galvanometer parameters, an image tracking method is used to acquire laser spot images, obtain the position of the laser spot in the image, and calculate the displacement between the laser spot and the target point position corresponding to the scanning galvanometer parameters; the acquisition of laser spot images includes: for two consecutive acquired laser spot images, determining whether the two images satisfy the frame difference condition; if so, obtaining the position of the laser spot in the image; the frame difference condition is: a laser spot exists in one image and a laser spot does not exist in the other image; The step of determining whether two frames of images satisfy the frame difference condition includes: calculating the pixel value difference between the two frames of images to obtain a frame difference image; filtering the frame difference image to obtain a filtered image; obtaining the maximum pixel value and the average pixel value of the pixels in the frame difference image; obtaining the pixel values of the frame difference image after background removal based on the average pixel value of the pixels in the frame difference image and the pixel values of the filtered image; obtaining the number of pixels with pixel values greater than or equal to a first standard pixel value and the percentage of such pixels in the frame difference image after background removal; if the maximum pixel value of the pixels in the frame difference image is greater than or equal to a second standard pixel value and the percentage is greater than or equal to a preset ratio, then the two frames of images are determined to satisfy the frame difference condition. The adjustment offset of the scanning galvanometer parameters is determined based on the displacement and the calibration coefficient. Adjust the scanning galvanometer parameters according to the adjusted offset to calibrate the laser spot position to the target point position.
2. The laser calibration method according to claim 1, characterized in that, Before determining whether two frames of images meet the frame difference condition, it is first determined whether the displacement of the two frames of images meets the preset condition. If it does, then it is determined whether the two frames of images meet the frame difference condition.
3. The laser calibration method according to claim 2, characterized in that, The step of determining whether the displacement of two frames of images meets the preset conditions includes: selecting the local region where the target point is located in the two frames of images, calculating the Euclidean distance between the target point position in the tracked image of the next frame and the target point position in the previous frame, and if the Euclidean distance is less than or equal to a certain threshold, then determining that the displacement of the two frames of images meets the preset conditions.
4. The laser calibration method according to claim 1, characterized in that, The step of obtaining the position of the laser spot in the image includes: calculating the centroid coordinates of the laser spot as the position of the laser spot in the image.
5. A laser calibration method according to claim 4, characterized in that, The calculation of the centroid coordinates of the laser spot includes: Obtain the initial spot size of the laser beam; Based on the initial spot size, calculate the centroid coordinates within the initial spot area; The initial spot size is reduced by a preset ratio, and the centroid coordinates are recalculated within the reduced spot area. The following steps are repeated: the initial spot size is reduced by a preset ratio, and the centroid coordinates are recalculated within the reduced spot area. After a preset number of iterations, the final centroid coordinates of the laser spot are obtained.
6. The laser calibration method according to claim 1, characterized in that, The step of obtaining the position of the laser spot in the image includes: verifying the currently obtained laser spot position, specifically: The current scanning galvanometer parameters are randomly adjusted to obtain the offset of the scanning galvanometer parameters. Based on the offset and the calibration coefficient, the displacement corresponding to the laser spot is calculated, and the actual position of the laser spot after adjustment is detected. It is determined whether the detected spot displacement is within a certain difference range from the calculated spot displacement. If it is within a certain difference range, it means that the currently acquired laser spot position is accurate. If it is not within a certain difference range, the previously determined accurate laser spot position is used as the current laser spot position in the image.
7. The laser calibration method according to claim 1, characterized in that, The image tracking method specifically includes: Obtain the reference frame image and the current frame image; Obtain N image blocks from the current frame image, where N≥2 and N is a positive integer; The displacement and registration confidence of each image block relative to the reference frame image are calculated using image registration methods. Calculate the spatial confidence and / or temporal confidence of each image block in the current frame; wherein, the spatial confidence of the i-th image block among N image blocks is calculated based on the registration confidence of the j-th image block and its spatial weight, and the spatial weight of the j-th image block represents the difference between the displacement of the i-th image block relative to the reference frame image and the displacement of the j-th image block relative to the reference frame image, i, j≤N; The temporal confidence of the i-th image block among N image blocks is calculated based on the registration confidence of the i-th image block and its temporal weight; the temporal weight represents the difference between the displacement of the i-th image block relative to the reference frame image and the displacement of the image block relative to the reference frame image in the previous frame or the two previous frames. From N image patches, select M image patches whose spatial confidence and / or temporal confidence meet the first preset condition. Then, perform image tracking of the current frame based on the position of the M image patches in the current frame and their displacement relative to the reference frame.
8. A laser calibration device, characterized in that, The device includes: The calibration unit is used to calibrate the correspondence between the target point position and the scanning galvanometer parameters, and to obtain the offset of multiple sets of scanning galvanometer parameters and the corresponding displacement data of the laser spot, so as to obtain the calibration coefficients. The acquisition unit is used to acquire laser spot images according to the scanning galvanometer parameters using an image tracking method; the acquisition of laser spot images includes: for two consecutive frames of acquired laser spot images, determining whether the two frames satisfy the frame difference condition; if they satisfy the frame difference condition, then obtaining the position of the laser spot in the image; the frame difference condition is: a laser spot exists in one frame of the image, and a laser spot does not exist in the other frame of the image. The step of determining whether two frames of images satisfy the frame difference condition includes: calculating the pixel value difference between the two frames of images to obtain a frame difference image; filtering the frame difference image to obtain a filtered image; obtaining the maximum pixel value and the average pixel value of the pixels in the frame difference image; obtaining the pixel values of the frame difference image after background removal based on the average pixel value of the pixels in the frame difference image and the pixel values of the filtered image; obtaining the number of pixels with pixel values greater than or equal to a first standard pixel value and the percentage of such pixels in the frame difference image after background removal; if the maximum pixel value of the pixels in the frame difference image is greater than or equal to a second standard pixel value and the percentage is greater than or equal to a preset ratio, then the two frames of images are determined to satisfy the frame difference condition. The acquisition unit is used to acquire the position of the laser spot in the image and calculate the displacement between the laser spot and the target point. The determining unit is used to determine the adjustment offset of the scanning galvanometer parameters based on the displacement calculated by the acquiring unit and the calibration coefficients obtained by the calibration unit. The calibration unit is used to adjust the scanning galvanometer parameters according to the adjustment offset, and to calibrate the laser spot position to the target point position.