A scanning galvanometer calibration method and system
By correcting camera accuracy using calibration board images and combining array images with calibration parameters, the galvanometer calibration error is automatically calculated, solving the problem of low efficiency in scanning galvanometer calibration and achieving an efficient and accurate calibration process.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 宁波海天增材科技有限公司
- Filing Date
- 2026-03-17
- Publication Date
- 2026-07-14
AI Technical Summary
Existing technologies for scanning galvanometer calibration are inefficient and require extensive manual operation, such as the "cross" measurement method, which is time-consuming and labor-intensive.
The camera's shooting accuracy is corrected by using calibration board images. By combining array images with calibration parameters, the galvanometer calibration error is automatically calculated and a calibration file is generated. Automated calibration is achieved through the image acquisition module and the data calculation module.
It improves the efficiency and accuracy of scanning galvanometer calibration, reduces manual operation, simplifies the calibration process, and reduces the impact of errors.
Smart Images

Figure CN122385145A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of scanning galvanometers, and in particular to a scanning galvanometer calibration method and system. Background Technology
[0002] A scanning galvanometer is an optical device that uses a motor to drive a reflector to deflect at high speed, enabling a laser beam or light beam to scan rapidly in a two-dimensional plane.
[0003] In laser melting additive manufacturing, a scanning galvanometer is typically used as the core device of the optical control system in the laser apparatus. The scanning galvanometer achieves layer-by-layer melting and solidification of materials such as metal powders to construct complex three-dimensional structures through high-precision positioning and scanning of the laser beam. During laser operation, factors such as temperature fluctuations, humidity changes, mechanical vibration, and mechanical wear can cause positioning deviations in the scanning galvanometer, requiring manual calibration using a crosshair method to ensure its accuracy.
[0004] The process of manually calibrating the scanning galvanometer requires a large number of manual interventions in the "cross" measurement method, and manual operation is time-consuming and labor-intensive, resulting in low efficiency of scanning galvanometer calibration. Summary of the Invention
[0005] To improve the efficiency of scanning galvanometer calibration, this invention provides a scanning galvanometer calibration method and system.
[0006] In a first aspect, the present invention provides a scanning galvanometer calibration method, which adopts the following technical solution: A scanning galvanometer calibration method, comprising: Step 10: Set up the calibration board and use the image acquisition module to acquire images of the calibration board; Step 11: Obtain calibration parameters based on the acquired calibration board image, and use the calibration parameters to calibrate the image acquisition module; Step 12: Laser print array image, using the calibrated image acquisition module to acquire array image; Step 13: Obtain the galvanometer output coordinate set based on the acquired array image, and use the galvanometer output coordinate set to calculate the galvanometer calibration error and the galvanometer calibration file; Step 14: Compare the galvanometer calibration error with the preset maximum galvanometer calibration error, and repeat steps 12 to 13 until the galvanometer calibration error is less than the preset maximum galvanometer calibration error. Then, use the corresponding galvanometer calibration file and update the scanning galvanometer.
[0007] By adopting the above technical solution, calibration parameters are first obtained through calibration board images to correct the camera's shooting accuracy. Then, the calibrated camera is used to capture array images. Combining the array images with the calibration parameters, a galvanometer calibration file is obtained and the scanning galvanometer is updated. Using a highly adaptable logic calculation process and robust calculation software, the array output from the galvanometer is automatically processed and calculated to generate a new galvanometer calibration file. This simple and efficient method calibrates the scanning galvanometer and corrects the camera's shooting accuracy through calibration board images, reducing the impact of camera anomalies on galvanometer calibration data deviations.
[0008] Optionally, methods for calibrating the image acquisition module include: Step 10 specifically includes: before acquiring the calibration board image, adjusting the light source brightness of the light source control module and the focal length and aperture of the image acquisition module; Step 11 specifically includes: obtaining the camera's calibration error based on the calibration parameters, comparing the calibration error with the preset maximum calibration error, repeating steps 10 to 11 until the calibration error is less than the preset maximum calibration error, and then determining that the adjustment of the image acquisition module is complete.
[0009] Optionally, methods for obtaining calibration parameters include: Step 11 further includes: reading the calibration board image to calculate the camera calibration matrix, and using the camera calibration matrix to perform correction transformation on the calibration board image to obtain the detected change image; Step 110: Calculate the camera single-pixel accuracy and perspective transformation matrix based on the detected changed image, and use the perspective transformation matrix to perform a correction transformation on the detected changed image to obtain a perspective changed image; Step 111: Combine the camera's single-pixel accuracy with the perspective change image to obtain the calibration error; Step 112: Integrate the camera calibration matrix, perspective transformation matrix, camera single pixel accuracy, and calibration error into calibration parameters.
[0010] Optionally, methods for obtaining the calibration error include: Step 111 specifically includes: obtaining a set of standard points based on the camera's single-pixel accuracy and a preset standard equidistant spacing; Step 1110: Extract the set of perspective points from the perspective transformation image; Step 1111: Calculate the positional deviation between the standard point set and the perspective point set as the calibration error.
[0011] Optionally, methods for acquiring array images include: Step 12 specifically includes: initializing the scanning galvanometer using a preset initial calibration file, and performing laser printing using the initialized scanning galvanometer and a preset array template; Step 120: Use the calibrated image acquisition module to acquire the laser-printed image as an array image.
[0012] Optionally, methods for calculating galvanometer calibration error and galvanometer calibration file include: Step 13 specifically includes: processing the array image using a camera calibration matrix, a perspective transformation matrix, and a preset reference template to obtain a reference slice image; Step 130: Obtain the coordinates of the slice center and the coordinates of the slice direction points based on the array image and the reference slice image; Step 131: Obtain a feature image based on the baseline slice image and a preset feature template; Step 132: Combine the feature image and the array image to obtain the coordinates of the feature origin, the feature center, and the feature direction points; Step 133: Using the coordinates of the slice center, the coordinates of the slice direction point, the coordinates of the feature origin, the coordinates of the feature center, and the coordinates of the feature direction point, calculate the actual origin coordinates and the actual direction point coordinates; Step 134: Process the perspective transformation image using the actual origin coordinates, actual direction point coordinates, and preset reference direction to obtain the rotation transformation image; Step 135: Use the rotated image, the actual origin coordinates, and the camera's single-pixel precision to obtain the galvanometer output coordinate set.
[0013] Optionally, methods for calculating the coordinates of the feature center include: Step 132 specifically includes: magnifying the feature image by a preset magnification factor, and then using the magnified feature image and the preset reference pixel features to obtain the start position and the end position; Step 1320: Use the starting and ending positions to perform line fitting to obtain the horizontal and vertical edge lines; Step 1321: Calculate the coordinates of the feature center by calculating the horizontal and vertical edge lines.
[0014] Optionally, methods for obtaining rotationally transformed images include: Step 134 specifically includes: obtaining the rotation center and rotation angle based on the actual origin coordinates, the actual direction point coordinates, and the preset reference direction; Step 1340: Calculate the rotation transformation matrix based on the rotation center and rotation angle, and then use the rotation transformation matrix to perform a rotation transformation on the perspective image to obtain the rotation transformation image.
[0015] Optionally, methods for obtaining the galvanometer output coordinate set include: Step 135 specifically includes: obtaining a set of detection feature images and a set of detection feature coordinates based on the rotated image and a preset feature template; Step 1351: Re-execute step 132 using the detection feature image set to obtain the detection center coordinate set; Step 1352: Combine the detection feature coordinate set and the detection center coordinate set to calculate the marker center coordinate set; Step 1353: Perform coordinate transformation based on the mark center coordinate set, the actual origin coordinates, and the camera single-pixel accuracy to obtain the galvanometer output coordinate set.
[0016] Secondly, this application provides a scanning galvanometer calibration system, which applies a scanning galvanometer calibration method as described in any one of the first aspects, and adopts the following technical solution: A scanning galvanometer calibration system, comprising: Calibration plate; The image acquisition module is used to acquire images of the calibration board and the array. The calibration auxiliary module provides a calibration board to assist the image acquisition module in acquiring images of the calibration board. The light source control module assists the image acquisition module in providing controllable and uniform lighting conditions. The galvanometer mapping module is used to carry the laser array output to assist the image acquisition module in acquiring array images; The data calculation module calculates calibration parameters in response to the calibration plate image and generates a galvanometer calibration file in response to the array image to update the scanning galvanometer.
[0017] In summary, this application first obtains calibration parameters from the calibration board image to correct the camera's shooting accuracy, and then uses the calibrated camera to capture array images. Combining the array images with the calibration parameters, a galvanometer calibration file is obtained and the scanning galvanometer is updated. By using a highly adaptable logic calculation process and robust calculation software, the array printed out by the galvanometer is automatically processed and calculated to generate a new galvanometer calibration file. This method achieves the calibration of the scanning galvanometer in a simple and efficient manner. Furthermore, by correcting the camera's shooting accuracy using the calibration board image, the impact of abnormal camera factors on the calibration data deviation of the galvanometer is reduced. Attached Figure Description
[0018] Figure 1 This is a schematic diagram of the structure of a scanning galvanometer calibration system according to an embodiment of the present invention; Figure 2 This is a flowchart of a scanning galvanometer calibration method according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the calibration plate image according to an embodiment of the present invention; Figure 4This is a schematic diagram of an array image according to an embodiment of the present invention; Figure 5 This is an error diagram of the initial position of the scanning galvanometer in an embodiment of the present invention; Figure 6 This is an error diagram of the position after the scanning galvanometer is calibrated according to an embodiment of the present invention.
[0019] The parts referred to by the numbers in the above attached figures are as follows: 1. Light source control module; 2. Calibration auxiliary module; 3. Galvanometer mapping module; 4. Image acquisition module; 5. Data calculation module. Detailed Implementation
[0020] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments.
[0021] Reference Figure 1 This application discloses a scanning galvanometer calibration system, comprising: The calibration board is a high-precision checkerboard calibration board pre-set by technicians. Image acquisition module 4 is used to acquire images of the calibration board and the array; Calibration auxiliary module 2 is used to provide a calibration board to assist image acquisition module 4 in acquiring images of the calibration board; The light source control module 1 is used to assist the image acquisition module 4 in providing controllable and uniform lighting conditions; The galvanometer mapping module 3 is used to carry the laser array output to assist the image acquisition module 4 in acquiring array images; Data calculation module 5 calculates calibration parameters in response to the calibration plate image and generates a galvanometer calibration file in response to the array image to update the scanning galvanometer.
[0022] Reference Figure 2 Based on the same inventive concept, embodiments of the present invention provide a scanning galvanometer calibration method, comprising the following steps: Step 10: Set up the calibration board and use image acquisition module 4 to acquire images of the calibration board.
[0023] Reference Figure 2 and Figure 3 The calibration board image refers to the image of the high-precision checkerboard calibration board. The high-precision checkerboard calibration board provided by the calibration auxiliary module 2 is placed on the light source control module 1, and then the image acquisition module 4 is used to capture the image of the calibration board as the calibration board image.
[0024] In this embodiment, the image acquisition module 4 is a high-resolution industrial camera. The light source control module 1 includes an adjustable soft-light surface light source and a glass plate for carrying the object, with a calibration plate placed on the glass plate. The galvanometer mapping module 3 includes a glass plate and a smooth, uniform, and easily peelable black adhesive tape for acquiring the array image of the laser output.
[0025] Step 11: Obtain calibration parameters based on the acquired calibration board image, and use the calibration parameters to calibrate the image acquisition module 4.
[0026] The calibration parameters refer to the parameters required to calibrate the images acquired by the image acquisition module 4, including the camera calibration matrix, perspective transformation matrix, rotation transformation matrix, camera single pixel accuracy, and calibration error.
[0027] The camera calibration matrix refers to the parameter matrix of the core characteristics (focal length and principal point) of the image acquisition module 4. The perspective transformation matrix is the matrix required to correct the distortion caused by the shooting angle of the image acquisition module 4. The rotation transformation matrix is the matrix required to correct the distortion caused by the image rotation of the image acquisition module 4. The camera single pixel accuracy refers to the actual physical size represented by the pixel in the image after the image acquisition module 4 is calibrated. The calibration error refers to the average deviation between the actual detected coordinates and the standard coordinates after the image is corrected and transformed.
[0028] The data calculation module 5 analyzes the calibration board image to obtain the camera calibration matrix, perspective transformation matrix, single pixel accuracy, and calibration error. The camera calibration matrix, perspective transformation matrix, single pixel accuracy, and calibration error are combined to obtain calibration parameters. The calibration parameters are then used to calibrate the image acquisition module 4 to facilitate subsequent image acquisition.
[0029] Step 12: Laser print array image, use the calibrated image acquisition module 4 to acquire array image.
[0030] The array image refers to the image of the "+" array output by the laser printing received by the galvanometer mapping module 3. First, the image of the "+" array is printed by laser printing, and then the image printed by laser printing is acquired by the calibrated image acquisition module 4 as the array image.
[0031] Step 13: Obtain the galvanometer output coordinate set based on the acquired array image, and use the galvanometer output coordinate set to calculate the galvanometer calibration error and the galvanometer calibration file.
[0032] The galvanometer output coordinate set refers to the set of physical coordinates of the coordinate points actually measured in the image within the galvanometer's own coordinate system.
[0033] Galvanometer calibration error refers to the quantitative indicator of the deviation between the actual position of the laser marker point produced by the scanning galvanometer and the theoretically expected position.
[0034] A galvanometer calibration file refers to the file parameters used to calibrate a scanning galvanometer.
[0035] The data calculation module 5 analyzes the single-pixel accuracy in the array image and calibration parameters to obtain the galvanometer output coordinate set. Then, the galvanometer output coordinate set is imported into the preset scanning galvanometer special tool to calculate the corresponding galvanometer calibration error and galvanometer calibration file.
[0036] The scanning galvanometer tool is an official software tool designed by technicians to calculate and generate galvanometer calibration files. The scanning galvanometer tool corresponds to the specifications of the scanning galvanometer.
[0037] Step 14: Compare the galvanometer calibration error with the preset maximum galvanometer calibration error, and repeat steps 12 to 13 until the galvanometer calibration error is less than the preset maximum galvanometer calibration error. Then, use the corresponding galvanometer calibration file and update the scanning galvanometer.
[0038] The maximum galvanometer calibration error is the maximum quantitative indicator of the deviation between the actual laser marker position produced by the scanning galvanometer, as set by the technician, and the theoretically expected position. In this embodiment, the maximum galvanometer calibration error is 0.03 mm.
[0039] By analyzing the cases where the galvanometer calibration error exceeds the maximum galvanometer calibration error, when the galvanometer calibration error does not exceed the maximum galvanometer calibration error, the galvanometer output coordinate set is imported into a dedicated scanning galvanometer tool to calculate the galvanometer calibration file. The method for calculating the galvanometer calibration file using the dedicated scanning galvanometer tool is common knowledge to those skilled in the art and will not be elaborated here.
[0040] When the galvanometer calibration error exceeds the maximum galvanometer calibration error, repeat steps 12 to 13 until the galvanometer calibration error does not exceed the maximum galvanometer calibration error, and use the galvanometer calibration file corresponding to the galvanometer calibration error that does not exceed the maximum galvanometer calibration error to correct the scanning galvanometer.
[0041] Reference Figure 6 , Figure 6 Update the points recorded after scanning the galvanometer using the galvanometer calibration file.
[0042] The methods for calibrating the image acquisition module 4 include: Step 10 specifically includes: before acquiring the calibration board image, adjusting the light source brightness of the light source control module 1 and the focal length and aperture of the image acquisition module 4.
[0043] By placing the high-precision checkerboard calibration board provided by the calibration auxiliary module 2 on the light source control module 1, so that the high-precision checkerboard calibration board is located at the center of the light source of the light source control module 1, and adjusting the light source brightness of the light source control module 1 and the focal length and aperture of the image acquisition module 4, the edge of the calibration board image is completely within the field of view of the image acquisition module 4. In the high-precision checkerboard calibration board provided in this application, the two opposite corners of the high-precision checkerboard calibration board in the image acquisition module 4 are clearly visible.
[0044] In this embodiment, when capturing a clear and visible image of the calibration board, the light source brightness of the light source control module 1 and the focal length and aperture of the image acquisition module 4 need to be adjusted to the threshold set by the technician.
[0045] Step 11 specifically includes: obtaining the camera's calibration error based on the calibration parameters, comparing the calibration error with the preset maximum calibration error, repeating steps 10 to 11 until the calibration error is less than the preset maximum calibration error, and then determining that the adjustment of the image acquisition module 4 is complete.
[0046] The maximum calibration error is the maximum permissible deviation between the actual detected coordinates and the standard coordinates after image correction and transformation, as set by the technicians. By retrieving the calibration error from the calibration parameters and comparing it with the maximum calibration error, the image acquisition module 4 completes the correction and proceeds with subsequent array image capture when the camera calibration error does not exceed the maximum calibration error.
[0047] When the camera calibration error exceeds the maximum calibration error, repeat steps 10 to 11 until the calibration error does not exceed the maximum calibration error, then it is determined that the adjustment of the image acquisition module 4 is complete.
[0048] Methods for obtaining calibration parameters include: Step 11 further includes: reading the calibration board image to calculate the camera calibration matrix, and using the camera calibration matrix to perform correction transformation on the calibration board image to obtain the detected change image.
[0049] The calibration board image is read in the manner of reading grayscale images. Then, OpenCV library functions are used to extract the coordinate set of the intersection points of the four corners of each black square in the checkerboard pattern in the calibration board image as the detection corner point set. Finally, OpenCV library functions are used to calculate the camera calibration matrix corresponding to the detection corner point set. The method of OpenCV library functions to perform matrix calculation through coordinate set is common knowledge to those skilled in the art and will not be elaborated here.
[0050] The image for detecting changes refers to the image after the calibration board image has been corrected and transformed using the camera calibration matrix. The image formed by correcting and transforming the calibration board image using the camera calibration matrix is used as the image for detecting changes, thereby correcting the distortion of the image acquisition module 4. The method of using a matrix to correct and transform the image is common knowledge to those skilled in the art and will not be described in detail here.
[0051] Step 110: Calculate the camera single-pixel accuracy and perspective transformation matrix based on the detected changed image, and use the perspective transformation matrix to correct and transform the detected changed image to obtain the perspective changed image.
[0052] The standard equal spacing is the standard spacing between pixels set by the technicians for normal shooting by the image acquisition module 4.
[0053] The array template is a template for technicians to set parameters such as the number of rows N (10 to 40), the number of columns M (10 to 40), and the spacing L (10mm to 25mm) of each cross in the printed cross array.
[0054] First, use OpenCV library functions to extract the checkerboard corner point set of the detected change image as the marked corner point set. Then, select the marked coordinates of the four outermost corner points from the standard corner point set, and use the marked coordinates to calculate the horizontal pixel span and vertical pixel span.
[0055] The physical width and physical height are calculated by using the side length L1 of the black and white squares retrieved from the preset array template and the high-precision checkerboard calibration board.
[0056] Physical width = (Number of rows N-1) × L1, physical height = (Number of columns M-1) × L1.
[0057] Horizontal single-pixel accuracy = physical width / horizontal pixel span; vertical single-pixel accuracy = physical height / vertical pixel span; the average of the horizontal and vertical single-pixel accuracy is taken as the camera's single-pixel accuracy.
[0058] L1 / single pixel precision = theoretical pixel spacing. The coordinate set of the grid points generated using the theoretical pixel spacing in the X and Y directions is used as the reference coordinate set. The matrix between the set of marked corner points and the reference coordinate set is calculated using OpenCV library functions as the perspective transformation matrix.
[0059] Step 111: Combine the camera's single-pixel accuracy with the perspective change image to obtain the calibration error.
[0060] The calibration error is obtained by analyzing the single-pixel accuracy of the camera and the perspective change image through the data calculation module 5.
[0061] Step 112: Integrate the camera calibration matrix, perspective transformation matrix, camera single pixel accuracy, and calibration error into calibration parameters.
[0062] The camera calibration matrix, perspective transformation matrix, updated single-pixel accuracy, and camera calibration error are integrated into calibration parameters.
[0063] Methods for obtaining calibration error include: Step 111 specifically includes: obtaining a set of standard points based on the camera's single-pixel accuracy and a preset standard equidistant spacing.
[0064] The standard point set refers to the set of coordinates of the grid points generated using the theoretical pixel spacing, which is the reference coordinate set in step 110.
[0065] Step 1110: Extract the set of perspective points from the perspective change image.
[0066] The perspective point set refers to the set of coordinates of the intersection points of the four corners of each black square in a perspective-transformed image. The perspective point set can be extracted from the perspective-transformed image using OpenCV library functions.
[0067] Step 1111: Calculate the positional deviation between the standard point set and the perspective point set as the calibration error.
[0068] The calibration error is obtained by calculating the deviation of corresponding coordinate points between the set of perspective corner points and the set of reference coordinates.
[0069] Methods for acquiring array images include: Step 12 specifically includes: initializing the scanning galvanometer using a preset initial calibration file, and then using the initialized scanning galvanometer and a preset array template for laser printing.
[0070] Reference Figure 5 The initial calibration file is the file parameters set by the technician for the initial galvanometer calibration. Figure 5 This refers to the initial position recorded by the scanning galvanometer during the initial galvanometer calibration.
[0071] First, initialize the scanning galvanometer using the initial galvanometer calibration file, then clean the galvanometer mapping module 3, and evenly paste black adhesive tape onto the glass plate contained in the galvanometer mapping module 3. Use the adhesive surface to accept the "+" array output by laser printing using the array template.
[0072] Step 120: Use the calibrated image acquisition module 4 to acquire the laser-printed image as an array image.
[0073] The glass plate with the "+" array printed on it is placed face down on the glass plate of the light source control module 1, so that the glass plate is located at the center of the visible light source of the light source control module 1, and the image acquisition module 4 is used to capture the image of the "+" array as the array image.
[0074] Reference Figure 4 , Figure 4 The image shows a sample of the array image of the "+" array output by the laser printer, captured by the image acquisition module 4.
[0075] Methods for calculating galvanometer calibration error and galvanometer calibration documentation include: Step 13 specifically includes: processing the array image using a camera calibration matrix, a perspective transformation matrix, and a preset reference template to obtain a reference slice image.
[0076] The reference template is a specific cross-shaped reference template image set by technicians to find the origin and direction points of the coordinate system of the cross-shaped array.
[0077] Reference Figure 4 In this embodiment, the reference template image of the origin is Figure 4 If a circular image is marked with R1, then the coordinates of the origin are the coordinates of the cross shape selected by the circle marked with R1.
[0078] The reference template image of the direction point is Figure 4 For circular images other than the circle in R1, the coordinates of the direction point are the coordinates of the cross lines enclosed by the other circles.
[0079] A reference slice image refers to a slice image containing a reference template in an array image after correction and transformation. The array image is corrected and transformed using a camera calibration matrix and a perspective transformation matrix to obtain a new array image. The corresponding slice image is then obtained from the new array image by similarity matching using OpenCV library functions, and is used as the reference slice image.
[0080] The methods of similarity matching are common knowledge to those skilled in the art and will not be elaborated here.
[0081] Step 130: Obtain the coordinates of the slice center and the coordinates of the slice direction point based on the array image and the reference slice image.
[0082] The slice center coordinates refer to the pixel coordinates of the origin template in the array image, and the slice direction point coordinates refer to the pixel coordinates of the direction point template in the array image. The coordinates of the reference slice images corresponding to the origin template and direction point template are used as the slice center coordinates and slice direction point coordinates in the array image.
[0083] Step 131: Obtain a feature image based on the baseline slice image and the preset feature template.
[0084] The feature template is a template image containing the shape features of a cross pattern, set by the technician. The feature image is obtained by identifying the slice image corresponding to the feature template from the reference slice image.
[0085] Step 132: Combine the feature image and the array image to obtain the coordinates of the feature origin, the feature center, and the feature direction point.
[0086] The feature origin coordinates refer to the pixel coordinates of the feature image in the reference slice image located at the origin within the array image. The feature orientation point coordinates refer to the pixel coordinates of the feature image in the reference slice image located at the orientation point within the array image.
[0087] By analyzing the pixel coordinates of the feature image in the array image, and combining them with the origin (origin or direction point) of the reference slice image corresponding to the feature image, the coordinates of the feature origin and the feature direction point are obtained.
[0088] Feature center coordinates refer to the coordinates of the center point of the feature image. The feature center coordinates are obtained by analyzing and processing the feature image.
[0089] Step 133: Using the coordinates of the slice center, the coordinates of the slice direction point, the coordinates of the feature origin, the coordinates of the feature center, and the coordinates of the feature direction point, calculate the actual origin coordinates and the actual direction point coordinates.
[0090] The actual origin coordinates refer to the origin reference point that is precisely determined in the array image, while the actual direction point coordinates refer to the direction reference point that is precisely determined in the array image.
[0091] The origin deviation pixels are obtained by calculating the difference between the feature origin coordinates and the feature center coordinates. The direction point deviation pixels are obtained by calculating the difference between the feature direction point coordinates and the feature center coordinates. The pixel coordinates of the sum of the slice center coordinates, feature origin coordinates, and origin deviation pixels are used as the actual origin coordinates.
[0092] The pixel coordinates of the sum of the slice direction point coordinates, feature direction point coordinates, and direction point deviation pixels are used as the actual direction point coordinates.
[0093] Step 134: Process the perspective transformation image using the actual origin coordinates, actual direction point coordinates, and preset reference direction to obtain the rotation transformation image.
[0094] The reference direction is the direction between the origin and the direction point in the standard image coordinate axis set by the technicians.
[0095] Step 135: Use the rotated image, the actual origin coordinates, and the camera's single-pixel precision to obtain the galvanometer output coordinate set.
[0096] The data calculation module 5 analyzes the rotated image, the actual origin coordinates, and the camera's single-pixel accuracy to obtain the galvanometer output coordinate set.
[0097] Methods for calculating the coordinates of the feature center include: Step 132 specifically includes: magnifying the feature image by a preset magnification factor, and then using the magnified feature image and the preset reference pixel features to obtain the starting position and the ending position.
[0098] The magnification factor is a factor set by technicians to enlarge pixel values. For example, if the original pixel value is 20mm × 20mm, when the magnification factor is 20x, the enlarged pixel value will be 400mm × 400mm.
[0099] The baseline pixel features are the features of the pixel blocks that need to be screened, as set by the technicians.
[0100] The starting position refers to the position of the pixel block in the feature image where the reference pixel feature first appears horizontally and vertically. The starting position also refers to the position of the pixel block in the feature image where the reference pixel feature finally appears horizontally and vertically.
[0101] By finding the consecutive pixel blocks in each row and column that best match the reference pixel features in the magnified feature image, the position of the initially found consecutive pixel blocks of the reference pixel features is taken as the starting position, and the position of the finally found consecutive pixel blocks of the reference pixel features is taken as the ending position.
[0102] Step 1320: Use the starting and ending positions to perform line fitting to obtain the horizontal and vertical edge lines.
[0103] The data is cleaned using the quartile method, and the start and end positions of the continuous pixel blocks that best match the baseline pixel features in each row and column are found. The edge lines formed by fitting the coordinates of the start and end positions of each row and column are used as the horizontal and vertical edge lines.
[0104] Step 1321: Calculate the coordinates of the feature center by calculating the horizontal and vertical edge lines.
[0105] The equation line calculated by analyzing the horizontal and vertical edge lines and using the slope-intercept equation method is taken as the edge center line, and the intersection point of the edge center lines corresponding to the horizontal and vertical edge lines is taken as the feature center coordinates.
[0106] Methods for obtaining rotationally transformed images include: Step 134 specifically includes: obtaining the rotation center and rotation angle based on the actual origin coordinates, the actual direction point coordinates, and the preset reference direction.
[0107] The rotation angle refers to the angle at which the perspective-changing image needs to be rotated, and the rotation center refers to the center point of rotation of the perspective-changing image.
[0108] By taking the actual origin coordinates as the rotation center, and then calculating the vector direction between the actual origin coordinates and the actual direction point coordinates, the angle between the vector direction and the reference direction is taken as the rotation angle, based on the rotation center.
[0109] Step 1340: Calculate the rotation transformation matrix based on the rotation center and rotation angle, and then use the rotation transformation matrix to perform a rotation transformation on the perspective image to obtain the rotation transformation image.
[0110] The rotation angle of the rotation center is calculated using OpenCV library functions to obtain the rotation transformation matrix. The resulting image is then rotated using the rotation transformation matrix on the perspective image.
[0111] Methods for obtaining the galvanometer output coordinate set include: Step 135 specifically includes: obtaining a set of detection feature images and a set of detection feature coordinates based on the rotated image and the preset feature template.
[0112] The detection feature image set refers to the set of slice images containing feature templates in the perspective transformation image after rotation transformation. The detection feature coordinate set refers to the pixel coordinates of each feature template in the detection feature image set located in the rotation transformation image. Referring to step 132, the pixel coordinates corresponding to the images in the rotation transformation image that have identified feature templates are integrated into the detection feature coordinate set.
[0113] Step 1351: Re-execute step 132 using the detection feature image set to obtain the detection center coordinate set.
[0114] The detection center coordinate set refers to the coordinates of the center point of the cross in each image in the detection feature image set. The feature center coordinates obtained by re-executing step 132 in each image in the detection feature image set are integrated into the detection center coordinate set.
[0115] Step 1352: Combine the detection feature coordinate set and the detection center coordinate set to calculate the marker center coordinate set.
[0116] The mark center coordinate set refers to the set of coordinates of the center point of the cross after correction. The mark center coordinate set is obtained by calculating the sum of the detection feature coordinate set and the detection center coordinate set.
[0117] Step 1353: Perform coordinate transformation based on the mark center coordinate set, the actual origin coordinates, and the camera single-pixel accuracy to obtain the galvanometer output coordinate set.
[0118] The coordinates of the marker center are transformed using the actual origin coordinates and the camera's single-pixel precision, and the transformed coordinates are used as the galvanometer output coordinates.
[0119] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device, and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0120] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.
Claims
1. A scanning galvanometer calibration method, characterized in that, include: Step 10: Set up the calibration board and use the image acquisition module (4) to acquire images of the calibration board; Step 11: Obtain calibration parameters based on the acquired calibration board image, and use the calibration parameters to calibrate the image acquisition module (4); Step 12: Laser print array image, and use the calibrated image acquisition module (4) to acquire array image; Step 13: Obtain the galvanometer output coordinate set based on the acquired array image, and use the galvanometer output coordinate set to calculate the galvanometer calibration error and the galvanometer calibration file; Step 14: Compare the galvanometer calibration error with the preset maximum galvanometer calibration error, and repeat steps 12 to 13 until the galvanometer calibration error is less than the preset maximum galvanometer calibration error. Then, use the corresponding galvanometer calibration file and update the scanning galvanometer.
2. The scanning galvanometer calibration method according to claim 1, characterized in that, The methods for calibrating the image acquisition module (4) include: Step 10 specifically includes: before acquiring the calibration board image, adjusting the light source brightness of the light source control module (1) and the focal length and aperture of the image acquisition module (4); Step 11 specifically includes: obtaining the camera's calibration error based on the calibration parameters, comparing the calibration error with the preset maximum calibration error, repeating steps 10 to 11 until the calibration error is less than the preset maximum calibration error, and then determining that the adjustment of the image acquisition module (4) is complete.
3. The scanning galvanometer calibration method according to claim 2, characterized in that, Methods for obtaining calibration parameters include: Step 11 further includes: reading the calibration board image to calculate the camera calibration matrix, and using the camera calibration matrix to perform correction transformation on the calibration board image to obtain the detected change image; Step 110: Calculate the camera single-pixel accuracy and perspective transformation matrix based on the detected changed image, and use the perspective transformation matrix to perform a correction transformation on the detected changed image to obtain a perspective changed image; Step 111: Combine the camera's single-pixel accuracy with the perspective change image to obtain the calibration error; Step 112: Integrate the camera calibration matrix, perspective transformation matrix, camera single pixel accuracy, and calibration error into calibration parameters.
4. The scanning galvanometer calibration method according to claim 3, characterized in that, Methods for obtaining calibration error include: Step 111 specifically includes: obtaining a set of standard points based on the camera's single-pixel accuracy and a preset standard equidistant spacing; Step 1110: Extract the set of perspective points from the perspective transformation image; Step 1111: Calculate the positional deviation between the standard point set and the perspective point set as the calibration error.
5. The scanning galvanometer calibration method according to claim 4, characterized in that, Methods for acquiring array images include: Step 12 specifically includes: initializing the scanning galvanometer using a preset initial calibration file, and performing laser printing using the initialized scanning galvanometer and a preset array template; Step 120: Use the corrected image acquisition module (4) to acquire the laser-printed image as an array image.
6. The scanning galvanometer calibration method according to claim 5, characterized in that, Methods for calculating galvanometer calibration error and galvanometer calibration documentation include: Step 13 specifically includes: processing the array image using a camera calibration matrix, a perspective transformation matrix, and a preset reference template to obtain a reference slice image; Step 130: Obtain the coordinates of the slice center and the coordinates of the slice direction points based on the array image and the reference slice image; Step 131: Obtain a feature image based on the baseline slice image and a preset feature template; Step 132: Combine the feature image and the array image to obtain the coordinates of the feature origin, the feature center, and the feature direction points; Step 133: Using the coordinates of the slice center, the coordinates of the slice direction point, the coordinates of the feature origin, the coordinates of the feature center, and the coordinates of the feature direction point, calculate the actual origin coordinates and the actual direction point coordinates; Step 134: Process the perspective transformation image using the actual origin coordinates, actual direction point coordinates, and preset reference direction to obtain the rotation transformation image; Step 135: Use the rotated image, the actual origin coordinates, and the camera's single-pixel precision to obtain the galvanometer output coordinate set.
7. The scanning galvanometer calibration method according to claim 6, characterized in that, Methods for calculating the coordinates of the feature center include: Step 132 specifically includes: magnifying the feature image by a preset magnification factor, and then using the magnified feature image and the preset reference pixel features to obtain the start position and the end position; Step 1320: Use the starting and ending positions to perform line fitting to obtain the horizontal and vertical edge lines; Step 1321: Calculate the coordinates of the feature center by calculating the horizontal and vertical edge lines.
8. The scanning galvanometer calibration method according to claim 6, characterized in that, Methods for obtaining rotationally transformed images include: Step 134 specifically includes: obtaining the rotation center and rotation angle based on the actual origin coordinates, the actual direction point coordinates, and the preset reference direction; Step 1340: Calculate the rotation transformation matrix based on the rotation center and rotation angle, and then use the rotation transformation matrix to perform a rotation transformation on the perspective image to obtain the rotation transformation image.
9. A scanning galvanometer calibration method according to claim 6, characterized in that, Methods for obtaining the galvanometer output coordinate set include: Step 135 specifically includes: obtaining a set of detection feature images and a set of detection feature coordinates based on the rotated image and a preset feature template; Step 1351: Re-execute step 132 using the detection feature image set to obtain the detection center coordinate set; Step 1352: Combine the detection feature coordinate set and the detection center coordinate set to calculate the marker center coordinate set; Step 1353: Perform coordinate transformation based on the mark center coordinate set, the actual origin coordinates, and the camera single-pixel accuracy to obtain the galvanometer output coordinate set.
10. A scanning galvanometer calibration system, employing a scanning galvanometer calibration method as described in any one of claims 1 to 9, characterized in that, include: Calibration plate; Image acquisition module (4) is used to acquire calibration board images and array images; The calibration auxiliary module (2) is used to provide a calibration board to assist the image acquisition module (4) in acquiring images of the calibration board; The light source control module (1) is used to assist the image acquisition module (4) in providing controllable and uniform illumination conditions; The galvanometer mapping module (3) is used to carry the laser array output to assist the image acquisition module (4) in acquiring array images; The data calculation module (5) calculates calibration parameters in response to the calibration plate image and generates a galvanometer calibration file in response to the array image to update the scanning galvanometer.