Laser marking methods, devices, equipment, and media based on monocular cameras

CN122322698BActive Publication Date: 2026-08-14SHENZHEN XINGHAN LASER TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-06-01
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

然而,面对复杂曲面、倾斜面或高低差较大的立体工件的加工需求时,传统平面打标技术难以满足

Benefits of technology

[0072]本申请实施例提供的基于单目相机的激光打标方法、装置、设备及介质,通过根据单目相机在Z轴方向的移动轨迹参数,驱动单目相机沿Z轴方向移动,以在多个不同高度位置采集待加工工件的多帧序列图像;基于多帧序列图像,确定待加工工件对应的深度图;基于深度图以及移动轨迹参数,生成待加工工件的三维点云数据;基于三维点云数据,对单目相机的初始打标参数进行调整,得到目标打标参数;将目标打标参数发送至激光打标装置,以使激光打标装置基于目标打标参数对待加工工件进行打标加工。本申请通过单目相机沿Z轴方向移动采集多帧序列图像,每帧图像的采集位置形成动态基线,相邻帧间的图像差异可视为视差信息,构建伪双目视图,无需额外硬件,仅依赖单目相机,显著降低设备成本与体积;对多帧序列图像进行处理,生成深度图,为工件的三维重建提供深度信息,然后,结合移动轨迹参数实现工件三维的高精度重建;进一步,通过三维点云数据动态调整打标参数,减少因固定参数导致的深浅不均或图案变形问题,提升打标质量与一致性,尤其对曲面、高低差区域的适应性更强。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122322698B_ABST
    Figure CN122322698B_ABST
Patent Text Reader

Abstract

This application provides a laser marking method, apparatus, device, and medium based on a monocular camera. The method acquires a series of multiple images by moving the monocular camera along the Z-axis. The acquisition position of each image frame forms a dynamic baseline, and the image differences between adjacent frames can be considered as parallax information, constructing a pseudo-binocular view. No additional hardware is required, significantly reducing equipment cost and size. The multi-frame image sequence is processed to generate a depth map, providing depth information for the 3D reconstruction of the workpiece. Then, combined with the movement trajectory parameters, high-precision 3D reconstruction of the workpiece is achieved. Furthermore, the initial marking parameters are adjusted using 3D point cloud data, and marking is performed on the workpiece based on the adjusted marking parameters. This reduces the problems of uneven depth or pattern deformation caused by fixed parameters, improving marking quality and consistency, especially with stronger adaptability to curved surfaces and areas with varying elevations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of laser marking, and in particular to a laser marking method, apparatus, equipment and medium based on a monocular camera. Background Technology

[0002] With the rapid development of industries such as 3C electronics, mold processing and personalized customization, laser marking technology, as a non-contact, consumable-free, and permanent marking method, has been widely used in the fields of identification, decoration and functional marking of various products.

[0003] Currently, traditional laser marking technology is mostly designed for planar processing scenarios, primarily targeting workpieces with flat surfaces. Its core relies on single-frame image positioning, using a fixed focal length and marking path to complete pattern marking, which meets basic accuracy requirements for planar workpiece processing. However, traditional planar marking technology struggles to meet the processing needs of complex curved surfaces, inclined surfaces, or three-dimensional workpieces with significant height differences. For example, in the production of mobile phone casings and automotive parts, workpiece surfaces often have irregular geometric shapes. Using traditional single-frame image positioning laser marking methods can easily lead to uneven pattern depth, focus shift, and image distortion, resulting in low marking accuracy. Laser marking solutions suitable for complex curved surfaces include binocular or multi-view vision solutions, which offer higher accuracy, but require additional hardware costs (such as multiple high-resolution cameras), and the calibration process is complex with cumbersome algorithm processing, making rapid deployment to industrial sites difficult.

[0004] Therefore, there is an urgent need for a laser marking solution that does not require binocular vision or structured light hardware and can adapt to the complex shape changes of workpieces, so as to realize the laser marking processing of workpieces with complex shapes. Summary of the Invention

[0005] The laser marking method, apparatus, equipment, and medium based on a monocular camera provided in this application are intended to achieve laser marking processing of workpieces with complex shapes in a low-cost, high-efficiency, and high-accuracy manner.

[0006] In a first aspect, embodiments of this application provide a laser marking method based on a monocular camera, comprising:

[0007] Based on the movement trajectory parameters of the monocular camera in the Z-axis direction, the monocular camera is driven to move along the Z-axis direction to acquire multi-frame sequence images of the workpiece to be processed at multiple different height positions.

[0008] Based on a multi-frame sequence of images, the depth map corresponding to the workpiece to be processed is determined; based on the depth map and the movement trajectory parameters, the three-dimensional point cloud data of the workpiece to be processed is generated.

[0009] Based on 3D point cloud data, the initial marking parameters of the monocular camera are adjusted to obtain the target marking parameters;

[0010] The target marking parameters are sent to the laser marking device so that the laser marking device can perform marking processing on the workpiece to be processed based on the target marking parameters.

[0011] In one possible implementation, the intrinsic parameters of the monocular camera include distortion coefficients and focal length; based on a multi-frame sequence of images, a depth map corresponding to the workpiece to be processed is determined, including:

[0012] Image distortion correction is performed on multi-frame image sequences based on distortion coefficients;

[0013] Feature point extraction and matching are performed on the multi-frame sequence images after distortion correction to determine the matching feature points between adjacent frame sequence images;

[0014] Based on multiple matching feature points, focal length, and baseline distance between adjacent frame sequence images, the disparity of multiple matching feature points is calculated.

[0015] Based on the disparity of multiple matching feature points, a depth map corresponding to the workpiece to be processed is generated.

[0016] In one possible implementation, based on the depth map and movement trajectory parameters, three-dimensional point cloud data of the workpiece to be processed is generated, including:

[0017] Based on the motion trajectory parameters, the baseline distance between adjacent frame sequence images is determined;

[0018] The three-dimensional coordinates of the matching feature points are calculated based on the baseline distance, the disparity of multiple matching feature points, and the focal length.

[0019] Based on the 3D coordinates and depth map of the matched feature points, 3D point cloud data of the workpiece to be processed is generated.

[0020] In one possible implementation, the movement trajectory parameters include movement step size, movement speed, and movement distance, driving the monocular camera to move along the Z-axis to acquire a multi-frame sequence of images of the workpiece to be processed at multiple different height positions, including:

[0021] The monocular camera is driven to move along the Z-axis according to the moving step size, moving speed and moving distance to acquire a series of multiple frames of images corresponding to the workpiece to be processed; wherein, the moving step size is the distance between the acquisition positions of adjacent frame images; when acquiring images, the angle between the optical axis direction of the monocular camera and the Z-axis direction is kept fixed.

[0022] In one possible implementation, the initial marking parameters include the initial height of the laser focus, the initial marking power, and the initial marking speed;

[0023] Based on 3D point cloud data, the initial marking parameters of the monocular camera are adjusted to obtain the target marking parameters, including:

[0024] Based on 3D point cloud data, the height of the workpiece to be processed is determined; based on the workpiece height and the initial height, the height offset of the laser focus on the workpiece surface is calculated.

[0025] Based on the height offset and the preset deformation mapping function, the deformation compensation amount of the marking path is obtained;

[0026] Based on the height offset and the deformation compensation of the marking path, the initial height of the laser focus is adjusted to obtain the target height of the laser focus;

[0027] Based on the preset adjustment strategy and height offset, the initial marking power and initial marking speed are adjusted to obtain the target marking power and target marking speed.

[0028] In one possible implementation, the method further includes:

[0029] Acquire the sequence images corresponding to the real-time marking pattern during the marking process, as well as the standard marking coordinates corresponding to the preset marking pattern;

[0030] Based on the sequence image corresponding to the real-time marking pattern, the marking coordinates corresponding to the real-time marking pattern are determined; the deviation between the marking coordinates and the standard marking coordinates is calculated to obtain the marking deviation between the real-time marking pattern and the preset marking pattern.

[0031] If the marking deviation exceeds the preset deviation threshold, the target marking parameters will be updated based on the marking deviation.

[0032] The workpiece to be processed will continue to be marked based on the updated target marking parameters.

[0033] In one possible implementation, before driving the monocular camera to move along the z-axis based on the monocular camera's trajectory parameters in the z-axis direction, the method further includes:

[0034] Perform intrinsic parameter calibration on the monocular camera to determine the corresponding focal length and distortion coefficient;

[0035] The movement trajectory of the monocular camera in the Z-axis direction is calibrated, and the coordinate information of the monocular camera at different movement positions is collected;

[0036] The coordinate information of different moving positions is analyzed and processed to obtain the moving step size and moving distance of the monocular camera.

[0037] Secondly, embodiments of this application provide a laser marking device based on a monocular camera, comprising:

[0038] The determination module is used to determine the movement trajectory parameters of the monocular camera in the Z-axis direction, and drive the monocular camera to move along the Z-axis direction to acquire multi-frame sequence images of the workpiece to be processed at multiple different height positions;

[0039] The processing module is used to determine the depth map corresponding to the workpiece to be processed based on a multi-frame sequence of images; and to generate three-dimensional point cloud data of the workpiece to be processed based on the depth map and the movement trajectory parameters.

[0040] The processing module is also used to adjust the initial marking parameters of the monocular camera based on 3D point cloud data to obtain the target marking parameters;

[0041] The marking module is used to send the target marking parameters to the laser marking device, so that the laser marking device can perform marking processing on the workpiece to be processed based on the target marking parameters.

[0042] In one possible implementation, the processing module is further configured to:

[0043] Image distortion correction is performed on multi-frame image sequences based on distortion coefficients;

[0044] Feature point extraction and matching are performed on the multi-frame sequence images after distortion correction to determine the matching feature points between adjacent frame sequence images;

[0045] Based on multiple matching feature points, focal length, and baseline distance between adjacent frame sequence images, the disparity of multiple matching feature points is calculated.

[0046] Based on the disparity of multiple matching feature points, a depth map corresponding to the workpiece to be processed is generated.

[0047] In one possible implementation, the processing module is further configured to:

[0048] Based on the motion trajectory parameters, the baseline distance between adjacent frame sequence images is determined;

[0049] The three-dimensional coordinates of the matching feature points are calculated based on the baseline distance, the disparity of multiple matching feature points, and the focal length.

[0050] Based on the 3D coordinates and depth map of the matched feature points, 3D point cloud data of the workpiece to be processed is generated.

[0051] In one possible implementation, the determining module is further configured to:

[0052] The monocular camera is driven to move along the Z-axis according to the moving step size and moving distance to acquire a series of multiple frames of images corresponding to the workpiece to be processed; wherein, the moving step size is the distance between the acquisition positions of adjacent frame images; when acquiring images, the angle between the optical axis direction of the monocular camera and the Z-axis direction is kept fixed.

[0053] In one possible implementation, the processing module is further configured to:

[0054] Based on 3D point cloud data, the height of the workpiece to be processed is determined; based on the workpiece height and the initial height, the height offset of the laser focus on the workpiece surface is calculated.

[0055] Based on the height offset and the preset deformation mapping function, the deformation compensation amount of the marking path is obtained;

[0056] Based on the height offset and the deformation compensation of the marking path, the initial height of the laser focus is adjusted to obtain the target height of the laser focus;

[0057] Based on the preset adjustment strategy and height offset, the initial marking power and initial marking speed are adjusted to obtain the target marking power and target marking speed.

[0058] In one possible implementation, the processing module is further configured to:

[0059] Acquire the sequence images corresponding to the real-time marking pattern during the marking process, as well as the standard marking coordinates corresponding to the preset marking pattern;

[0060] Based on the sequence image corresponding to the real-time marking pattern, the marking coordinates corresponding to the real-time marking pattern are determined; the deviation between the marking coordinates and the standard marking coordinates is calculated to obtain the marking deviation between the real-time marking pattern and the preset marking pattern.

[0061] If the marking deviation exceeds the preset deviation threshold, the target marking parameters will be updated based on the marking deviation.

[0062] The workpiece to be processed will continue to be marked based on the updated target marking parameters.

[0063] In one possible implementation, the processing module is further configured to:

[0064] Perform intrinsic parameter calibration on the monocular camera to determine the corresponding focal length and distortion coefficient;

[0065] The movement trajectory of the monocular camera in the Z-axis direction is calibrated, and the coordinate information of the monocular camera at different movement positions is collected;

[0066] The coordinate information of different moving positions is analyzed and processed to obtain the moving step size and moving distance of the monocular camera.

[0067] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor;

[0068] The memory stores instructions that the computer executes;

[0069] The processor executes computer execution instructions stored in memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.

[0070] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.

[0071] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.

[0072] The laser marking method, apparatus, device, and medium based on a monocular camera provided in this application involve driving the monocular camera to move along the Z-axis direction according to the camera's movement trajectory parameters to acquire multiple frames of images of the workpiece to be processed at multiple different height positions; determining the depth map corresponding to the workpiece based on the multiple frames of images; generating three-dimensional point cloud data of the workpiece based on the depth map and the movement trajectory parameters; adjusting the initial marking parameters of the monocular camera based on the three-dimensional point cloud data to obtain target marking parameters; and sending the target marking parameters to the laser marking device so that the laser marking device can perform marking processing on the workpiece based on the target marking parameters. This application acquires a series of multiple images by moving a monocular camera along the Z-axis. The acquisition position of each image forms a dynamic baseline, and the image differences between adjacent frames can be regarded as parallax information to construct a pseudo-binocular view. No additional hardware is required, relying only on the monocular camera, which significantly reduces the cost and size of the equipment. The multi-frame image sequence is processed to generate a depth map, providing depth information for the 3D reconstruction of the workpiece. Then, combined with the movement trajectory parameters, a high-precision 3D reconstruction of the workpiece is achieved. Furthermore, the marking parameters are dynamically adjusted through 3D point cloud data to reduce the problems of uneven depth or pattern deformation caused by fixed parameters, thereby improving the marking quality and consistency, especially with stronger adaptability to curved surfaces and areas with height differences. Attached Figure Description

[0073] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0074] Figure 1 A schematic flowchart of a laser marking method based on a monocular camera provided for this application;

[0075] Figure 2 A schematic diagram of a laser marking device based on a monocular camera provided in this application;

[0076] Figure 3This is a schematic diagram of the structure of an electronic device provided in this application.

[0077] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0078] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application.

[0079] With the rapid development of industries such as 3C electronics, mold processing and personalized customization, laser marking technology, as a non-contact, consumable-free, and permanent marking method, has been widely used in the fields of identification, decoration and functional marking of various products.

[0080] Currently, traditional laser marking technology is mostly designed for planar processing scenarios, primarily targeting workpieces with flat surfaces. Its core relies on single-frame image positioning, using a fixed focal length and marking path to complete pattern marking, which meets basic accuracy requirements for planar workpiece processing. However, traditional planar marking technology struggles to meet the processing needs of complex curved surfaces, inclined surfaces, or three-dimensional workpieces with significant height differences. For example, in the production of mobile phone casings and automotive parts, workpiece surfaces often have irregular geometric shapes. Using traditional single-frame image positioning laser marking methods can easily lead to uneven pattern depth, focus shift, and image distortion, resulting in low marking accuracy. Laser marking solutions suitable for complex curved surfaces include binocular or multi-view vision solutions, which offer higher accuracy, but require additional hardware costs (such as multiple high-resolution cameras), and the calibration process is complex with cumbersome algorithm processing, making rapid deployment to industrial sites difficult.

[0081] Therefore, there is an urgent need for a laser marking solution that does not require binocular vision or structured light hardware and can adapt to the complex shape changes of workpieces, so as to realize the laser marking processing of workpieces with complex shapes in a low-cost, high-efficiency and high-accuracy manner.

[0082] The laser marking method, apparatus, device, and medium based on a monocular camera provided in this application involve driving a monocular camera to move along the Z-axis according to its movement trajectory parameters to acquire multiple frames of images of the workpiece to be processed at multiple different height positions; determining a depth map corresponding to the workpiece based on the multiple frames of images; generating three-dimensional point cloud data of the workpiece based on the depth map and the movement trajectory parameters; adjusting the initial marking parameters of the monocular camera based on the three-dimensional point cloud data to obtain target marking parameters; and sending the target marking parameters to the laser marking device so that the laser marking device can perform marking processing on the workpiece based on the target marking parameters. This application acquires a series of multiple images by moving a monocular camera along the Z-axis. The acquisition position of each image forms a dynamic baseline, and the image differences between adjacent frames can be regarded as parallax information to construct a pseudo-binocular view. No additional hardware is required, relying only on the monocular camera, which significantly reduces the cost and size of the equipment. The multi-frame image sequence is processed to generate a depth map, providing depth information for the 3D reconstruction of the workpiece. Then, combined with the movement trajectory parameters, a high-precision 3D reconstruction of the workpiece is achieved. Furthermore, the marking parameters are dynamically adjusted through 3D point cloud data to reduce the problems of uneven depth or pattern deformation caused by fixed parameters, thereby improving the marking quality and consistency, especially with stronger adaptability to curved surfaces and areas with height differences.

[0083] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0084] For example, this application can be applied to laser marking scenarios for three-dimensional workpieces in the industrial manufacturing field, including engraving the shells of 3C electronic products, personalized marking of automotive parts, and fine engraving of medical devices. Before driving the monocular camera to acquire multiple frames of images of the corresponding workpiece, the monocular camera is first initialized and calibrated to ensure it is suitable for the current application scenario. When marking different workpieces in the same scenario, only one initialization calibration is required for the monocular camera. If there is a specific requirement in practical applications that "initialization calibration is required for each laser marking step corresponding to this application," multiple initialization calibrations can be performed based on the requirements. This application does not limit the number of initialization calibrations for the monocular camera.

[0085] In one possible implementation, the initial calibration process for the monocular camera is as follows:

[0086] Perform intrinsic parameter calibration on the monocular camera to determine the corresponding intrinsic parameter matrix, focal length, and distortion coefficients.

[0087] The movement trajectory of the monocular camera in the Z-axis direction is calibrated, and the coordinate information of the monocular camera at different movement positions is collected;

[0088] The coordinate information of different moving positions is analyzed and processed to obtain the moving step size and moving distance of the monocular camera.

[0089] The initial calibration process for the monocular camera is divided into planar calibration and stereo calibration. The planar calibration of the monocular camera is used to calculate the focal length and distortion coefficients of the intrinsic parameter matrix corresponding to the monocular camera. The stereo calibration of the monocular camera is used to determine the movement trajectory parameters of the monocular camera.

[0090] For example, the Zhang Zhengyou calibration method can be used for the planar calibration of a monocular camera. The Zhang Zhengyou calibration method refers to calculating the intrinsic parameters of the camera, such as the intrinsic parameter matrix, focal length, and distortion coefficient, by taking pictures of the calibration board. For example, by taking pictures of multi-angle images using a checkerboard calibration board, extracting the corner coordinates, and calculating the parameters, the intrinsic parameter matrix, focal length, and distortion coefficient can be obtained.

[0091] Specifically, firstly, a fixed angle between the optical axis and the Z-axis of the monocular camera is determined from a preset angle range (0-45 degrees) to ensure that the optical axis of the monocular camera remains stable and does not deviate during the parallel movement of the monocular camera along the Z-axis direction; wherein, the technical means of determining the fixed angle from the preset angle range is common knowledge known to those skilled in the art, and this application does not limit the means of determining the fixed angle.

[0092] Then, the Zhang Zhengyou calibration method was used to calibrate the intrinsic parameters of the monocular camera. The height of the monocular camera was fixed, and images of the calibration board were captured from multiple angles by moving the calibration board to different positions; for example, 10 angle images of the calibration board were captured. The pixel coordinates (x, y) of all corner points in the 10 angle images were determined, and world coordinates were established. The plane of the calibration board image was set to Z=0, so the true coordinates of all corner points were (X, Y, 0). The corner point coordinates were mapped from 3D (X, Y, 0) to 2D (U, V). The 2D coordinates corresponding to the corner points in each calibration board image were calculated to obtain the homography matrix corresponding to each calibration board image. The homography matrices of all calibration board images were substituted into the calibration constraint equations for solving to obtain the intrinsic parameter matrix, which includes the focal length f in the x-direction. x Main point c x Focal length f in the y direction y Main point c yThe intrinsic parameter matrix, the true coordinates of the corner points, and the pixel coordinates of the corner points are substituted into the distortion model for fitting and solving to obtain the distortion coefficients, including radial distortion coefficients (k1, k2, k3, ...) and tangential distortion coefficients (p1, p2). The tangential distortion coefficients are fixed at p1 and p2, while the order of the radial distortion coefficients can be determined based on the lens type, the degree of image distortion, and the actual application scenario: a second-order radial distortion coefficient can be selected for standard lenses, a third-order radial distortion coefficient for wide-angle lenses, and higher-order radial distortion coefficients can be adapted for special lenses with severe distortion. The selection of the order of the radial distortion coefficients is a well-known and conventional technique in this field, and this application does not impose specific limitations on it.

[0093] For example, the stereo calibration of a monocular camera involves the following steps: First, the monocular camera is reset to position 0 along the Z-axis, i.e., the initial origin position. Then, from a step size range (0.1mm-10mm) and a movement speed range (0.1mm / s-10mm / s), any combination of step size and speed is randomly selected. The monocular camera is then controlled to move horizontally along the Z-axis according to this combination of step size and speed, capturing 20 consecutive images. The coordinate information of the movement position corresponding to each image sequence is recorded. Adjacent image sequences are used as binocular views to simulate a binocular camera. The system acquires a sequence of images. Based on these images, it determines whether there is a significant misalignment between adjacent images. If so, the step size is determined as the movement step size of the monocular camera. If not, the step size is changed, and the acquisition process continues until a suitable movement step size is determined. The system also determines whether there is image ghosting or blurring in the acquired images. If not, the speed is determined as the movement speed of the monocular camera. Similarly, if such issues exist, the movement speed is changed, and the acquisition process continues until a suitable movement speed is determined. The coordinates of the movement position corresponding to the 20th image are subtracted from the coordinates of the initial position to obtain the movement distance of the monocular camera. For example, based on the stereo calibration of the monocular camera, the movement trajectory parameters are determined as follows: movement step size 0.5mm, movement distance 10mm, and movement speed 1mm / s.

[0094] This step involves calibrating the intrinsic parameters of the monocular camera to determine its intrinsic parameter matrix, focal length, and distortion coefficients, ensuring the accuracy of subsequent image processing. It also involves calibrating the camera's motion trajectory parameters to determine the step size and distance, providing precise motion control for multi-frame image acquisition and ensuring that the baseline distance between adjacent frames can be calculated, thus constructing a pseudo-binocular view. Finally, the initial calibration of the monocular camera provides accurate image sequences for subsequent depth map generation and 3D reconstruction.

[0095] Figure 1 A flowchart illustrating a laser marking method based on a monocular camera provided in this application is shown below. Figure 1As shown in the embodiments of this application, the laser marking method based on a monocular camera includes:

[0096] S101. Based on the movement trajectory parameters of the monocular camera in the Z-axis direction, drive the monocular camera to move along the Z-axis direction to acquire multi-frame sequence images of the workpiece to be processed at multiple different height positions.

[0097] A monocular camera is a camera that contains only one image sensor and is used to acquire two-dimensional images. The Z-axis direction refers to the direction of movement perpendicular to the camera's optical axis, used to simulate the baseline distance of binocular vision; for example, a monocular camera moves up and down along the Z-axis to create image acquisition perspectives at different heights.

[0098] The trajectory parameters include the step size, distance, and speed of the monocular camera moving along the Z-axis; for example, the step size is 0.5 mm, the distance is 10 mm, and the speed is 1 mm / s.

[0099] In one possible implementation, the movement trajectory parameters include movement step size, movement speed, and movement distance, driving the monocular camera to move along the Z-axis to acquire multi-frame sequence images of the workpiece to be processed at multiple different height positions. The specific process is as follows:

[0100] The monocular camera is driven to move along the Z-axis according to the moving step size, moving speed and moving distance to acquire a series of multiple frames of images corresponding to the workpiece to be processed; wherein, the moving step size is the distance between the acquisition positions of adjacent frame images; when acquiring images, the angle between the optical axis direction of the monocular camera and the Z-axis direction is kept fixed.

[0101] Understandably, based on the movement trajectory parameters, the monocular camera is driven to move at a speed of 1 mm / s, capturing a sequence of images every 0.5 mm step, until it moves a distance of 10 mm, at which point the last sequence of images is captured. Thus, a total of 20 multi-frame sequence images of the workpiece to be processed are acquired from multiple height positions. During image acquisition, the angle between the optical axis of the monocular camera and the Z-axis is kept fixed; this fixed angle is determined during the aforementioned initialization calibration process. Furthermore, uniform lighting can be used during the acquisition process to ensure consistent illumination conditions for each frame, avoiding image blurring, distortion, or feature loss.

[0102] This step acquires a series of multiple frames of images of the workpiece to be processed by calibrating the movement trajectory parameters, which ensures the integrity and clarity of the acquired sequence of images; and when subsequent adjacent images are used to simulate binocular left and right views, the parallax pattern is stable, improving the accuracy of subsequent processing steps; specifically, when the monocular camera moves along the Z-axis, the acquisition position of each frame of image forms a dynamic baseline, and the image difference between adjacent frames can be regarded as parallax information.

[0103] S102. Based on a multi-frame sequence of images, determine the depth map corresponding to the workpiece to be processed; based on the depth map and the movement trajectory parameters, generate the three-dimensional point cloud data of the workpiece to be processed.

[0104] A depth map is a two-dimensional image that represents the distance from each point on the workpiece surface to the camera in pixels; for example, a pixel value of 5mm in a depth map means that the point is 5mm away from the camera. Three-dimensional point cloud data refers to a data set composed of multiple three-dimensional coordinate points, used to describe the geometric shape of the workpiece surface.

[0105] The acquired multi-frame image sequence is processed to obtain a depth map containing the depth information of the workpiece to be processed, providing a data basis for the 3D reconstruction of the workpiece. Then, based on the processed depth map and the movement trajectory parameters, a reconstruction algorithm is used to generate the 3D point cloud data of the workpiece to be processed.

[0106] In one possible implementation, the intrinsic parameters of the monocular camera include the intrinsic parameter matrix, distortion coefficients, and focal length; based on a multi-frame sequence of images, the depth map corresponding to the workpiece to be processed is determined, and the specific process is as follows:

[0107] Image distortion correction is performed on multi-frame image sequences based on intrinsic parameter matrices and distortion coefficients.

[0108] Feature point extraction and matching are performed on the multi-frame sequence images after distortion correction to determine the matching feature points between adjacent frame sequence images;

[0109] Based on multiple matching feature points, focal length, and baseline distance between adjacent frame sequence images, the disparity of multiple matching feature points is calculated.

[0110] Based on the disparity of multiple matching feature points, a depth map corresponding to the workpiece to be processed is generated.

[0111] Image distortion correction refers to eliminating barrel or pincushion distortions in an image using intrinsic parameter matrices and distortion coefficients. For distorted image sequences across multiple frames, intrinsic parameter matrices and distortion coefficients are used to correct the distortion, resulting in a well-formed image sequence. Specifically, distortion coefficients are used for distortion correction during the image sequence correction process.

[0112] For example, for the acquired multi-frame image sequence, firstly, image distortion correction is performed on the distorted image sequence based on the distortion coefficient; then, the SIFT or ORB algorithm is used to extract feature points from the distorted multi-frame image sequence to obtain multiple feature points such as corners, edges, centers, and contours of the workpiece to be processed; further, the FLANN matching algorithm is used to match each feature point to obtain the matching result; then, the RANSAC algorithm is used to filter out incorrect matching points to obtain matching feature points between adjacent frame image sequences. For example, edge feature points of the workpiece to be processed are extracted, and adjacent frames are matched using the FLANN algorithm, that is, at least one identical edge feature point is matched from the adjacent image sequences of the image sequence of the edge feature point. Then, the RANSAC algorithm is used to filter out incorrect matching points, and the remaining correct feature points are matched to obtain matching feature points between adjacent frame image sequences. The feature point extraction algorithm, matching algorithm, and filtering algorithm are not limited to the above algorithms, and this application does not impose any limitations on them.

[0113] Baseline distance refers to the Z-axis distance between the acquisition positions of adjacent frame sequence images, which is the movement step size in the calibrated movement trajectory parameters; for example, if the acquisition position of sequence image 1 is 4.5mm and the acquisition position of sequence image 2 is 5mm, then the baseline distance between adjacent frame images (sequence image 1 and sequence image 2) is 0.5mm.

[0114] Furthermore, the pixel misalignment of the matching feature point in the x-direction in adjacent image sequences is calculated to obtain the disparity of the matching feature point; then, triangulation can be used to solve for the true distance and height between the matching feature points; the triangulation formula is as follows: .

[0115] The focal length f used to calculate the parallax is the calibrated focal length f in the x-direction. x Therefore, by using the triangulation formula, based on multiple matching feature points, focal length, and baseline distance between adjacent frame sequence images, the true distance height of multiple matching feature points can be calculated; by integrating the true distance heights of multiple matching feature points, the depth map corresponding to the workpiece to be processed can be obtained.

[0116] In addition, before performing image distortion correction on multi-frame image sequences, Gaussian filtering can be used to denoise the image sequences, and histogram equalization can be used to enhance the grayscale of the image sequences, thereby improving the clarity and feature recognition of the image sequences.

[0117] This step improves the accuracy of the depth map through distortion correction and feature point matching, making depth estimation more reliable, especially for complex curved surfaces or areas with significant elevation differences. This reduces depth errors caused by image distortion or feature point matching failures, providing more complete geometric information for 3D point cloud reconstruction and thus improving the adaptability of laser marking parameter correction.

[0118] In one possible implementation, based on the depth map and movement trajectory parameters, three-dimensional point cloud data of the workpiece to be processed is generated, and the specific process is as follows:

[0119] Based on the motion trajectory parameters, the baseline distance between adjacent frame sequence images is determined;

[0120] The three-dimensional coordinates of the matching feature points are calculated based on the baseline distance, the disparity of multiple matching feature points, and the focal length.

[0121] Based on the 3D coordinates and depth map of the matched feature points, 3D point cloud data of the workpiece to be processed is generated.

[0122] The baseline distance between adjacent frame sequences and the disparity of multiple matching feature points have been explained previously and will not be repeated here; the focal length used to calculate the three-dimensional coordinates is the calibrated focal length f in the y-direction. y For example, triangulation can be used to calculate the 3D coordinates of matching feature points. Specifically, the baseline distance, parallax, and focal length are substituted into the triangulation formula to calculate the Z-axis coordinates of the matching feature points. Then, the X-axis and Y-axis coordinates are calculated by combining the pixel coordinates corresponding to the matching feature points and the intrinsic parameters of the monocular camera; thus, the 3D coordinates corresponding to the matching feature points are obtained. Further, based on the obtained 3D coordinates of each matching feature point, a dense point cloud is generated by combining it with a depth map. Then, the Poisson reconstruction algorithm can be used to perform surface fitting on the dense point cloud to generate the 3D point cloud data of the workpiece to be processed.

[0123] This step improves the accuracy and completeness of 3D point clouds through triangulation and surface fitting algorithms, especially for more accurate restoration of the surface morphology of complex workpieces (such as curved surfaces and inclined surfaces); and reduces 3D reconstruction defects caused by depth map errors or sparse point clouds, providing a reliable basis for dynamic correction of laser parameters.

[0124] S103. Based on the 3D point cloud data, adjust the initial marking parameters of the monocular camera to obtain the target marking parameters;

[0125] The initial marking parameters refer to the initial settings of the laser marking device, including the initial height Z0 of the laser focus, the initial marking power P0, and the initial marking speed V0; for example, the initial focus height is Z0=5mm, the initial marking power is P0=80W, and the initial marking speed is V0=800mm / s.

[0126] In one possible implementation, the initial marking parameters of the monocular camera are adjusted based on 3D point cloud data to obtain the target marking parameters. The specific process is as follows:

[0127] Based on 3D point cloud data, the height of the workpiece to be processed is determined; based on the workpiece height and the initial height, the height offset of the laser focus on the workpiece surface is calculated.

[0128] Based on the height offset and the preset deformation mapping function, the deformation compensation amount of the marking path is obtained;

[0129] Based on the height offset and the deformation compensation of the marking path, the initial height of the laser focus is adjusted to obtain the target height of the laser focus;

[0130] Based on the preset adjustment strategy and height offset, the initial marking power and initial marking speed are adjusted to obtain the target marking power and target marking speed.

[0131] For example, considering a specific region "Region 1" of the workpiece to be processed; based on 3D point cloud data, the height of "Region 1" is determined to be Z1; then the height offset of the laser focus on the workpiece surface is... Z = Z1 - Z0; if If Z is greater than zero, it means that region 1 is convex and closer to the laser focus, then it is necessary to... If Z is less than zero, it indicates that region 1 is concave and farther from the laser focal point. For example, for... If Z is greater than zero, then the compensation amount Z of the laser focus in the Z-axis direction can be determined. 补偿 =- Z; The height of the laser focus is lowered by the Z-axis compensation. Z. Since high deformation will cause deformation in the X and Y horizontal directions, it is necessary to calculate the deformation compensation amount of the laser focus in the X and Y directions of the marking path.

[0132] The preset deformation mapping function is as follows: .

[0133] Where, k x k y This is the calibrated deformation scaling factor. Substituting the height offset into the deformation mapping function above, the deformation compensation amount X in the X and Y directions can be solved. 补偿 Y 补偿 The target height of the laser focus is obtained by summing the compensation amount in the Z-axis direction with the initial height of the laser focus; the X-axis compensation amount is obtained by summing the distance in the X direction of the laser focus; and the Y-axis compensation amount is obtained by summing the distance in the Y direction of the laser focus.

[0134] The preset adjustment strategy includes: "If the height of the protruding area of ​​the workpiece is greater than the height threshold, then increase the marking power and decrease the marking speed according to the change ratio; conversely, decrease the marking power and increase the marking speed." The change ratio is, for example, "increase power by 15W, decrease by 10W, increase speed by 50 mm / s, decrease speed by 40 mm / s." If the height offset is greater than zero and greater than the height threshold, then the initial marking power is increased by 15W to obtain a target marking power of 95W, and the initial marking speed is decreased by 40 mm / s to obtain a target marking speed of 740 mm / s.

[0135] This step dynamically adjusts the marking parameters of the laser focus based on 3D point cloud data, reducing uneven marking depth or pattern deformation caused by fixed parameters, thus improving marking quality and consistency, and is especially adaptable to curved surfaces and areas with height differences.

[0136] S104. Send the target marking parameters to the laser marking device so that the laser marking device can perform marking processing on the workpiece to be processed based on the target marking parameters.

[0137] The laser marking device performs marking according to the target parameters, ensuring that the pattern is uniform and clear on complex surfaces.

[0138] This application provides a laser marking method based on a monocular camera. The method involves driving the monocular camera to move along the Z-axis according to its movement trajectory parameters to acquire multiple frames of images of the workpiece at different heights. Based on these images, a depth map corresponding to the workpiece is determined. Based on the depth map and the movement trajectory parameters, three-dimensional point cloud data of the workpiece is generated. Based on the three-dimensional point cloud data, the initial marking parameters of the monocular camera are adjusted to obtain target marking parameters. These target marking parameters are then sent to a laser marking device, enabling the device to perform marking on the workpiece based on these parameters. This application acquires a series of multiple images by moving a monocular camera along the Z-axis. The acquisition position of each image forms a dynamic baseline, and the image differences between adjacent frames can be regarded as parallax information to construct a pseudo-binocular view. No additional hardware is required, relying only on the monocular camera, which significantly reduces the cost and size of the equipment. The multi-frame image sequence is processed to generate a depth map, providing depth information for the 3D reconstruction of the workpiece. Then, combined with the movement trajectory parameters, a high-precision 3D reconstruction of the workpiece is achieved. Furthermore, the marking parameters are dynamically adjusted through 3D point cloud data to reduce the problems of uneven depth or pattern deformation caused by fixed parameters, thereby improving the marking quality and consistency, especially with stronger adaptability to curved surfaces and areas with height differences.

[0139] In one possible implementation, the method further includes:

[0140] Acquire the sequence images corresponding to the real-time marking pattern during the marking process, as well as the standard marking coordinates corresponding to the preset marking pattern;

[0141] Based on the sequence image corresponding to the real-time marking pattern, the marking coordinates corresponding to the real-time marking pattern are determined; the deviation between the marking coordinates and the standard marking coordinates is calculated to obtain the marking deviation between the real-time marking pattern and the preset marking pattern.

[0142] If the marking deviation exceeds the preset deviation threshold, the target marking parameters will be updated based on the marking deviation.

[0143] The workpiece to be processed will continue to be marked based on the updated target marking parameters.

[0144] The sequence of images corresponding to the real-time marking pattern refers to the sequence of images of the marked pattern dynamically acquired during the laser marking process. Deviation calculation refers to comparing the coordinate differences between the real-time marking pattern and the standard pattern.

[0145] For example, based on the sequence of images of real-time marking pattern pairs, the marking coordinates corresponding to the real-time marking pattern are determined; the deviation between the marking coordinates and the standard marking coordinates is calculated to obtain the marking deviation between the real-time marking pattern and the preset marking pattern; if the marking deviation exceeds the preset deviation threshold of 0.01mm, the target marking parameters are updated based on the marking deviation using the aforementioned steps for calculating the deformation compensation amount of the marking path; then, the workpiece to be processed is marked again based on the updated target marking parameters.

[0146] This step dynamically adjusts the marking parameters through a real-time feedback mechanism, quickly responding to minute changes on the workpiece surface (such as undulations caused by vibration) to improve the uniformity and consistency of the marking pattern and reduce the defect rate caused by dynamic changes in morphology.

[0147] Figure 2 A schematic diagram of a laser marking device based on a monocular camera provided in this application is shown below. Figure 2 As shown, the laser marking device 200 based on a monocular camera provided in this embodiment includes:

[0148] The determination module 201 is used to determine the movement trajectory parameters of the monocular camera in the Z-axis direction, and drive the monocular camera to move along the Z-axis direction to acquire multi-frame sequence images of the workpiece to be processed at multiple different height positions.

[0149] The processing module 202 is used to determine the depth map corresponding to the workpiece to be processed based on a multi-frame sequence of images; and to generate three-dimensional point cloud data of the workpiece to be processed based on the depth map and the movement trajectory parameters.

[0150] The processing module 202 is also used to adjust the initial marking parameters of the monocular camera based on the 3D point cloud data to obtain the target marking parameters;

[0151] The marking module 203 is used to send the target marking parameters to the laser marking device so that the laser marking device can perform marking processing on the workpiece to be processed based on the target marking parameters.

[0152] In one possible implementation, the processing module 202 is further configured to:

[0153] Image distortion correction is performed on multi-frame image sequences based on distortion coefficients;

[0154] Feature point extraction and matching are performed on the multi-frame sequence images after distortion correction to determine the matching feature points between adjacent frame sequence images;

[0155] Based on multiple matching feature points, focal length, and baseline distance between adjacent frame sequence images, the disparity of multiple matching feature points is calculated.

[0156] Based on the disparity of multiple matching feature points, a depth map corresponding to the workpiece to be processed is generated.

[0157] In one possible implementation, the processing module 202 is further configured to:

[0158] Based on the motion trajectory parameters, the baseline distance between adjacent frame sequence images is determined;

[0159] The three-dimensional coordinates of the matching feature points are calculated based on the baseline distance, the disparity of multiple matching feature points, and the focal length.

[0160] Based on the 3D coordinates and depth map of the matched feature points, 3D point cloud data of the workpiece to be processed is generated.

[0161] In one possible implementation, the determining module 201 is further configured to:

[0162] The monocular camera is driven to move along the Z-axis according to the moving step size and moving distance to acquire a series of multiple frames of images corresponding to the workpiece to be processed; wherein, the moving step size is the distance between the acquisition positions of adjacent frame images; when acquiring images, the angle between the optical axis direction of the monocular camera and the Z-axis direction is kept fixed.

[0163] In one possible implementation, the processing module 202 is further configured to:

[0164] Based on 3D point cloud data, the height of the workpiece to be processed is determined; based on the workpiece height and the initial height, the height offset of the laser focus on the workpiece surface is calculated.

[0165] Based on the height offset and the preset deformation mapping function, the deformation compensation amount of the marking path is obtained;

[0166] Based on the height offset and the deformation compensation of the marking path, the initial height of the laser focus is adjusted to obtain the target height of the laser focus;

[0167] Based on the preset adjustment strategy and height offset, the initial marking power and initial marking speed are adjusted to obtain the target marking power and target marking speed.

[0168] In one possible implementation, the processing module 202 is further configured to:

[0169] Acquire the sequence images corresponding to the real-time marking pattern during the marking process, as well as the standard marking coordinates corresponding to the preset marking pattern;

[0170] Based on the sequence image corresponding to the real-time marking pattern, the marking coordinates corresponding to the real-time marking pattern are determined; the deviation between the marking coordinates and the standard marking coordinates is calculated to obtain the marking deviation between the real-time marking pattern and the preset marking pattern.

[0171] If the marking deviation exceeds the preset deviation threshold, the target marking parameters will be updated based on the marking deviation.

[0172] The workpiece to be processed will continue to be marked based on the updated target marking parameters.

[0173] In one possible implementation, the processing module 202 is further configured to:

[0174] Perform intrinsic parameter calibration on the monocular camera to determine the corresponding intrinsic parameter matrix, focal length, and distortion coefficients.

[0175] The movement trajectory of the monocular camera in the Z-axis direction is calibrated, and the coordinate information of the monocular camera at different movement positions is collected;

[0176] The coordinate information of different moving positions is analyzed and processed to obtain the moving step size and moving distance of the monocular camera.

[0177] The laser marking device based on a monocular camera provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.

[0178] Figure 3 This is a schematic diagram of the structure of an electronic device provided in this application. Figure 3 As shown, the electronic device 30 provided in this embodiment includes at least one processor 301 and a memory 302. Optionally, the device 30 further includes a communication component 303. The processor 301, memory 302, and communication component 303 are connected via a bus 304.

[0179] In a specific implementation, at least one processor 301 executes computer execution instructions stored in memory 302, causing at least one processor 301 to perform the above-described method.

[0180] The specific implementation process of processor 301 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.

[0181] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.

[0182] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.

[0183] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0184] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0185] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.

[0186] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.

[0187] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.

[0188] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

[0189] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0190] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0191] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0192] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0193] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope.

Claims

1. A laser marking method based on a monocular camera, characterized in that, include: Based on the movement trajectory parameters of the monocular camera in the Z-axis direction, the monocular camera is driven to move along the Z-axis direction to acquire multi-frame sequence images of the workpiece to be processed at multiple different height positions. Based on the intrinsic parameter matrix and distortion coefficients of the monocular camera, feature points are extracted and matched on the multi-frame sequence images to determine the matching feature points between adjacent frame sequence images. Based on the multiple matching feature points, the baseline distance between adjacent frame sequence images, and the focal length of the monocular camera, the disparity of the multiple matching feature points is calculated; Based on the disparity of the plurality of matching feature points, a depth map corresponding to the workpiece to be processed is generated. Based on the depth map and the movement trajectory parameters, generate three-dimensional point cloud data of the workpiece to be processed; Based on the three-dimensional point cloud data, the height offset of the laser focus on the workpiece surface is determined. Based on the height offset, the initial marking parameters of the laser marking device are adjusted to obtain the target marking parameters. The target marking parameters are sent to the laser marking device so that the laser marking device can perform marking processing on the workpiece to be processed based on the target marking parameters. The initial marking parameters include the initial height of the laser focus, the initial marking power, and the initial marking speed. Adjusting the initial marking parameters of the laser marking device based on the height offset to obtain the target marking parameters includes: determining the workpiece height based on the three-dimensional point cloud data; calculating the height offset of the laser focus on the workpiece surface based on the workpiece height and the initial height; obtaining the deformation compensation amount of the marking path based on the height offset and a preset deformation mapping function; adjusting the initial height of the laser focus based on the height offset and the deformation compensation amount of the marking path to obtain the target height of the laser focus; and adjusting the initial marking power and initial marking speed based on a preset adjustment strategy and the height offset to obtain the target marking power and target marking speed.

2. The method according to claim 1, characterized in that, The step of generating 3D point cloud data of the workpiece to be processed based on the depth map and the movement trajectory parameters includes: Based on the movement trajectory parameters, the baseline distance between adjacent frame sequence images is determined; Based on the baseline distance, the disparity of the plurality of matching feature points, and the focal length, calculate the three-dimensional coordinates of the matching feature points; Based on the three-dimensional coordinates of the matched feature points and the depth map, three-dimensional point cloud data of the workpiece to be processed is generated.

3. The method according to claim 1, characterized in that, The movement trajectory parameters include movement step size, movement speed, and movement distance. Driving the monocular camera to move along the Z-axis to acquire multi-frame sequences of images of the workpiece at multiple different height positions includes: The monocular camera is driven to move along the Z-axis according to the moving step size, the moving speed, and the moving distance to acquire a series of multiple frames of images corresponding to the workpiece to be processed; wherein, the moving step size is the distance between the acquisition positions of adjacent frame images; when acquiring images, the angle between the optical axis direction of the monocular camera and the Z-axis direction is kept fixed.

4. The method according to any one of claims 1-3, characterized in that, The method further includes: Acquire the sequence images corresponding to the real-time marking pattern during the marking process, as well as the standard marking coordinates corresponding to the preset marking pattern; Based on the sequence image corresponding to the real-time marking pattern, the marking coordinates corresponding to the real-time marking pattern are determined; the deviation between the marking coordinates and the standard marking coordinates is calculated to obtain the marking deviation between the real-time marking pattern and the preset marking pattern. If the marking deviation exceeds a preset deviation threshold, the target marking parameters are updated based on the marking deviation. The workpiece to be processed is marked again based on the updated target marking parameters.

5. The method according to claim 1, characterized in that, Before driving the monocular camera to move along the z-axis based on the movement trajectory parameters of the monocular camera in the z-axis direction, the method further includes: The monocular camera is calibrated to determine its focal length and distortion coefficient. The movement trajectory of the monocular camera in the Z-axis direction is calibrated, and the coordinate information of the monocular camera at different movement positions is collected; The coordinate information of the different moving positions is analyzed and processed to obtain the moving step size and moving distance of the monocular camera.

6. A laser marking device based on a monocular camera, characterized in that, include: The determination module is used to determine the movement trajectory parameters of the monocular camera in the Z-axis direction, and drive the monocular camera to move along the Z-axis direction to acquire multi-frame sequence images of the workpiece to be processed at multiple different height positions; The processing module is used to extract and match feature points of the multi-frame sequence images based on the intrinsic parameter matrix and distortion coefficients of the monocular camera, and to determine the matching feature points between adjacent frame sequence images. The processing module is also used to calculate the disparity of the multiple matching feature points based on the multiple matching feature points, the baseline distance between adjacent frame sequence images, and the focal length of the monocular camera; The processing module is further configured to generate a depth map corresponding to the workpiece to be processed based on the disparity of the plurality of matching feature points; and to generate three-dimensional point cloud data of the workpiece to be processed based on the depth map and the movement trajectory parameters. The processing module is also used to determine the height offset of the laser focus on the workpiece surface based on the three-dimensional point cloud data, and adjust the initial marking parameters of the laser marking device based on the height offset to obtain the target marking parameters. The marking module is used to send the target marking parameters to the laser marking device, so that the laser marking device can perform marking processing on the workpiece to be processed based on the target marking parameters. The initial marking parameters include the initial height of the laser focus, the initial marking power, and the initial marking speed. Adjusting the initial marking parameters of the laser marking device based on the height offset to obtain the target marking parameters includes: determining the workpiece height based on the three-dimensional point cloud data; calculating the height offset of the laser focus on the workpiece surface based on the workpiece height and the initial height; obtaining the deformation compensation amount of the marking path based on the height offset and a preset deformation mapping function; adjusting the initial height of the laser focus based on the height offset and the deformation compensation amount of the marking path to obtain the target height of the laser focus; and adjusting the initial marking power and initial marking speed based on a preset adjustment strategy and the height offset to obtain the target marking power and target marking speed.

7. An electronic device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Three-dimensional reconstruction method and device for monocular endoscope image and terminal equipment

    CN111145238A

  • Height measurement method, marking method and system, storage medium and program product

    CN121163386A