A high-precision positioning method and system for laser engraving workpieces based on visual measurement
By using dynamic illumination and multi-frame image processing, high-reflectivity halos are shielded and depth defocus compensation is extracted, solving the positioning error problem caused by reflective halos and deformation in laser engraving, and achieving high-precision workpiece positioning and laser engraving operations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN RUI HONG PLASTIC METAL COATING TECH CO LTD
- Filing Date
- 2026-04-10
- Publication Date
- 2026-07-03
Smart Images

Figure CN122335985A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of laser processing and machine vision control technology, and in particular to a high-precision positioning method and system for laser engraving workpieces based on vision measurement. Background Technology
[0002] Currently, in the field of laser engraving, machine vision measurement systems are typically used to acquire surface images of the workpiece, and then extract features such as edge contours to guide the laser equipment for coordinate positioning. During clamping and transport, the workpiece often experiences pose deviations in a two-dimensional plane, thus requiring the reliance on visual features for spatial correction and positioning.
[0003] In actual production operations, some workpieces undergo polishing or vacuum coating processes, or have specific machining textures. When the light source of a coaxial vision system illuminates the surface of such workpieces, nonlinear photoelectric responses easily occur in local areas, forming high-intensity reflective halos in the acquired visual image. This optical phenomenon obscures the true physical edge contours of the workpiece, interfering with edge feature extraction based on grayscale analysis, making it difficult for conventional image analysis methods to extract stable and reliable feature benchmarks.
[0004] Due to the influence of its material properties or pre-processing internal stress, the physical surface of the workpiece often exhibits a certain degree of warping deformation. After such physical deformation, the local surface of the workpiece deviates from the reference focal plane used for visual camera calibration, resulting in a spatial displacement difference in the vertical height direction. This height difference manifests as geometric blurring and diffusion of edge features in the visual image. Existing visual positioning processing procedures mostly focus on resolving coordinate offsets in the two-dimensional plane, making it difficult to quantify and separate the defocus error variable in the height direction from the two-dimensional image. The superposition of planar feature extraction errors caused by high reflectivity and depth defocus errors caused by deformation easily leads to a deviation between the final calculated processing reference coordinates and the actual physical pose of the workpiece. The positioning requirements of high-precision laser engraving processes under complex conditions need further improvement. Summary of the Invention
[0005] The purpose of this invention is to provide a high-precision positioning method and system for laser-engraved workpieces based on vision measurement, so as to solve the problems pointed out in the background art.
[0006] In a first aspect, the present invention provides a high-precision positioning method for laser engraving workpieces based on vision measurement, comprising: acquiring an initial visual image of the workpiece to be processed; extracting reference features from the initial visual image to obtain positioning coordinates; and controlling a laser device to perform laser engraving on the workpiece to be processed according to the positioning coordinates.
[0007] The step of extracting reference features from the initial visual image to obtain positioning coordinates includes:
[0008] The lighting source is controlled to dynamically illuminate according to a preset light emission sequence, and multiple frames of stepped exposure images are acquired simultaneously.
[0009] Calculate the brightness difference of corresponding pixels between two adjacent frames of the stepped exposure image;
[0010] Pixels with brightness differences greater than a preset difference threshold are identified as highly reflective halo pixels;
[0011] The highly reflective halo pixels are masked, and stable edge contour features are extracted from the remaining unmasked pixels.
[0012] Extract the pixel gradient span data of the stable edge contour features;
[0013] A depth defocus compensation vector is generated based on the pixel gradient span data.
[0014] Calculate the initial planar coordinates based on the stable edge contour features;
[0015] The depth defocus compensation vector is fused with the initial planar coordinates to output the target positioning coordinates;
[0016] The target positioning coordinates are used as the positioning coordinates to guide the laser equipment to perform the laser engraving operation.
[0017] Optionally, acquiring the initial visual image of the workpiece to be processed includes:
[0018] Receives the arrival trigger signal sent by an external photoelectric sensor;
[0019] The coaxial vision camera is activated based on the arrival trigger signal.
[0020] The coaxial vision camera is driven to capture images of the workpiece to be processed placed on the processing platform to obtain the initial vision image.
[0021] Optionally, the laser control device performs laser engraving on the workpiece according to the positioning coordinates, including:
[0022] Obtain the trajectory of the pre-imported drawing file to be processed;
[0023] Based on the positioning coordinates, the trajectory of the drawing to be processed is spatially mapped and transformed to generate the actual processing trajectory;
[0024] The actual machining trajectory is analyzed to output multiple sets of galvanometer deflection control commands;
[0025] The movement of the deflection mirrors inside the laser device is controlled by multiple sets of galvanometer deflection control commands.
[0026] Optionally, calculating the initial planar coordinates based on the stable edge contour features includes:
[0027] Retrieve pre-stored standard laser-engraved workpiece templates;
[0028] The stable edge contour features are compared with the standard laser-engraved workpiece template by performing an affine transformation, and the translational deviation vector and rotational deviation angle are calculated.
[0029] The initial planar coordinates are constructed using the translation deviation vector and the rotation deviation angle.
[0030] Optionally, the step of comparing the stable edge contour features with the standard laser-engraved workpiece template through an affine transformation includes:
[0031] Extract the confidence weights of each feature pixel within the stable edge contour feature;
[0032] Feature pixels with confidence weights lower than a preset weight threshold are removed to obtain a set of high-confidence pixels;
[0033] The coordinate transformation matrix is solved by using the set of high-confidence pixels and the set of reference points contained inside the standard laser-engraved workpiece template.
[0034] Optionally, the masking of the highly reflective halo pixels includes:
[0035] Construct a blank mask matrix with dimensions matching the stepped exposure image;
[0036] The blank mask matrix element corresponding to the location of the highly reflective halo pixel is assigned an invalid value;
[0037] Assign a valid value to the blank mask matrix element corresponding to the location of the remaining unmasked pixel;
[0038] The blank mask matrix after assignment is used to perform a dot product operation on the stepped exposure image, and the image to be analyzed is output.
[0039] Optionally, before determining pixels with brightness differences greater than a preset difference threshold as highly reflective halo pixels, the method further includes:
[0040] Extract the thickness parameters of the vacuum coating layer on the surface of the workpiece to be processed;
[0041] The theoretical light reflectivity of the surface is determined based on the thickness parameters of the vacuum-coated layer.
[0042] The basic judgment threshold is dynamically adjusted using the theoretical light reflectivity of the surface to generate the preset difference threshold, so as to adaptively filter out the nonlinear reflective interference phenomenon generated by different batches of vacuum-coated workpieces.
[0043] Optionally, the step of extracting the pixel gradient span data of the stable edge contour features includes:
[0044] Along the contour normal direction of the stable edge contour feature, extract multiple sets of cross-sectional pixel grayscale distribution curves;
[0045] Differentiation calculations were performed on multiple sets of the aforementioned cross-sectional pixel grayscale distribution curves to obtain multiple sets of grayscale change rate curves;
[0046] Extract the horizontal span distance between the extreme points on both sides of the grayscale change rate curves that descend to a preset baseline value;
[0047] The summation and averaging of all the horizontal span distances are calculated, and the summation and averaging results are output as the pixel gradient span data.
[0048] Optionally, generating a depth defocus compensation vector based on the pixel gradient span data includes:
[0049] Obtain a pre-established gradient depth mapping relationship library, which records the mapping relationship between different pixel spans and physical height deviations;
[0050] The pixel gradient span data is input into the gradient depth mapping relationship library for internal query and retrieval.
[0051] When a matching entry is found, the corresponding target physical height deviation is retrieved.
[0052] The depth defocus compensation vector along the vertical height axis is constructed using the target physical height deviation to compensate for the visual focal length deviation caused by the warping deformation of the workpiece to be processed.
[0053] Secondly, the present invention provides a high-precision positioning system for laser-engraved workpieces based on vision measurement, which applies the high-precision positioning method for laser-engraved workpieces based on vision measurement as described in any one of the first aspects, including:
[0054] The image acquisition module is configured to acquire an initial visual image of the workpiece to be processed;
[0055] The multi-frame acquisition module is configured to control the lighting source to dynamically illuminate according to a preset light emission sequence and simultaneously acquire multiple frames of stepped exposure images.
[0056] The difference calculation module is configured to calculate the brightness difference between corresponding pixels between two adjacent frames of the stepped exposure image;
[0057] The reflectivity determination module is configured to determine pixels with brightness differences greater than a preset difference threshold as highly reflective halo pixels.
[0058] The masking extraction module is configured to mask the highly reflective halo pixels and extract stable edge contour features from the remaining unmasked pixels.
[0059] The gradient analysis module is configured to extract pixel gradient span data of the stable edge contour features;
[0060] The defocus compensation generation module is configured to generate a depth defocus compensation vector based on the pixel gradient span data.
[0061] The planar coordinate calculation module is configured to calculate the initial planar coordinates based on the stable edge contour features;
[0062] The coordinate fusion output module is configured to fuse the depth defocus compensation vector with the initial planar coordinates in spatial coordinates and output the target positioning coordinates;
[0063] The laser engraving guidance module is configured to use the target positioning coordinates as the final reference for guiding the laser device to perform laser engraving operations.
[0064] The present invention has achieved the following beneficial effects:
[0065] This invention acquires multiple frames of stepped exposure images by controlling the illumination source, calculates the brightness difference between pixels in adjacent frames, and combines this with an adaptively generated difference threshold. This accurately identifies and masks highly reflective halo pixels, extracting stable edge contour features from the remaining unmasked areas. This effectively suppresses interference from complex workpiece surface materials and coating reflections on image feature extraction, ensuring the accuracy of the initial planar coordinate calculation. Furthermore, this invention extracts pixel gradient span data of the stable edge contour features, maps it to generate a depth defocus compensation vector, and fuses it with the initial planar coordinates calculated based on this contour feature. This coordinate fusion mechanism balances two-dimensional plane position correction and three-dimensional depth defocus compensation, reducing visual focal length errors caused by workpiece warping. This invention effectively reduces the negative impact of local high reflectivity and spatial physical deformation on the positioning reference, improves the alignment accuracy of guiding laser equipment to perform laser engraving operations, and enhances the positioning system's adaptability to complex workpiece shapes.
[0066] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description and the accompanying drawings.
[0067] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0068] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0069] Figure 1 This is a flowchart illustrating the steps of the high-precision positioning method for laser-engraved workpieces based on vision measurement in an embodiment of the present invention.
[0070] Figure 2 This is a flowchart illustrating the steps of obtaining an initial visual image of the workpiece to be processed in an embodiment of the present invention.
[0071] Figure 3 This is a flowchart illustrating the steps of extracting reference features from an initial visual image to obtain positioning coordinates in an embodiment of the present invention.
[0072] Figure 4 This is a flowchart illustrating the steps of controlling a laser device to perform laser engraving operations in an embodiment of the present invention;
[0073] Figure 5 This is a structural block diagram of a high-precision positioning system for laser engraving workpieces based on vision measurement, as described in an embodiment of the present invention. Detailed Implementation
[0074] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.
[0075] This application provides a high-precision positioning method for laser engraving workpieces based on vision measurement. This method is applied to a laser processing control system with data processing and communication capabilities. The laser processing control system is connected to a coaxial vision camera, an illumination source, an external photoelectric sensor, and a laser device via a communication bus and input / output interfaces. The optical sampling path of the coaxial vision camera and the processing output optical path of the laser device are spatially coaxial, ensuring that the acquired image coordinate system and the processing coordinate system have a unified optical reference. The laser processing control system includes a processor and a memory. The processor executes the computer program stored in the memory to implement various processing steps.
[0076] For details, please refer to the appendix. Figure 1 As shown in the embodiments of this application, the high-precision positioning method for laser-engraved workpieces based on vision measurement includes the following steps:
[0077] Step S10: Obtain the initial visual image of the workpiece to be processed.
[0078] Further, refer to the appendix Figure 1 As shown, step S10 includes:
[0079] Step S11: Receive the position trigger signal sent by the external photoelectric sensor.
[0080] The workpiece to be processed is carried on a movable processing platform and moves along a transport track. An external photoelectric sensor is arranged on one side of the laser processing station. When the solid edge of the workpiece enters the detection beam area of the external photoelectric sensor, the output terminal of the external photoelectric sensor generates a level state transition. The input interface of the laser processing control system continuously scans this level state transition according to a set sampling period. The system is equipped with a time window filtering module. When the detected level state transition remains unchanged within a preset time window parameter, the system recognizes it as a position trigger signal and stores the position trigger signal in the state control variable.
[0081] Step S12: Wake up the coaxial vision camera according to the positioning trigger signal.
[0082] In response to the arrival trigger signal, the laser processing control system sends a data packet containing a wake-up command to the coaxial vision camera via the communication line. Upon receiving the data packet, the coaxial vision camera switches its image sensor from low-power sleep mode to working mode and simultaneously performs a charge reset operation on the photosensitive pixel array, clearing the dark current charge within the image sensor to zero.
[0083] Step S13: Drive the coaxial vision camera to capture images of the workpiece to be processed placed on the processing platform to obtain the initial vision image.
[0084] The laser processing control system generates a trigger signal that matches the preset exposure time parameters and transmits this signal to the trigger input port of the coaxial vision camera. Under the action of the trigger signal, the coaxial vision camera activates its global shutter. The photoelectric conversion element converts the received light signal into an analog electrical signal, which is then quantized into a two-dimensional digital grayscale matrix by an analog-to-digital converter. This two-dimensional digital grayscale matrix is written into the memory of the laser processing control system through a data transmission channel, forming an initial vision image with preset row and column resolution parameters. This initial vision image contains, in its data structure, two-dimensional morphological feature data of the workpiece in its current clamping posture.
[0085] Step S20: Extract reference features from the initial visual image to obtain the positioning coordinates.
[0086] Because the workpiece undergoes translational and rotational deviations in a two-dimensional plane on the machining platform, and its physical surface deforms due to material processing stress, and because the machining texture on the workpiece surface leads to uneven local reflectivity, step S20 specifically involves feature extraction and spatial correction calculation across multiple dimensions, as detailed in the appendix. Figure 3 As shown, it specifically includes:
[0087] Step S21: Control the lighting source to dynamically illuminate according to the preset light emission sequence, and simultaneously acquire multiple frames of stepped exposure images.
[0088] The laser processing control system stores a preset emission sequence in the form of a one-dimensional array in its storage area. This preset emission sequence contains multiple pulse width modulation duty cycle parameters arranged in time sequence, with adjacent parameters exhibiting an increasing relationship. The laser processing control system reads the pulse width modulation duty cycle parameters from the preset emission sequence sequentially according to a preset time step, generating a drive signal and outputting it to the control terminal of the illumination source. The illumination source adjusts the output current of its emission array according to this drive signal, projecting an illumination field with progressively increasing light intensity onto the surface of the workpiece.
[0089] During the stable time periods when the illumination source is at each intensity level, the laser processing control system sends image acquisition commands to the coaxial vision camera. The coaxial vision camera acquires a single digital image under the set exposure time parameters. The system processor associates and encapsulates the acquired digital image matrices, corresponding timestamps, and illuminance parameters, and stores them in memory according to the acquisition order to construct a three-dimensional image data set, which is the multi-frame stepped exposure image. The multi-frame stepped exposure image has aligned row and column coordinates in the planar dimension and contains grayscale response data of pixels as the light source illuminance increases in the depth dimension.
[0090] Step S22: Extract the thickness parameters of the vacuum coating layer on the surface of the workpiece to be processed; determine the theoretical light reflectance of the surface based on the thickness parameters of the vacuum coating layer; dynamically adjust the basic judgment threshold using the theoretical light reflectance of the surface to generate a preset difference threshold.
[0091] The laser processing control system sends a data query request, containing the traceability code identifier of the current workpiece, to the server of the manufacturing execution system via a communication interface. The server of the manufacturing execution system retrieves the thickness data of the corresponding workpiece measured in the upstream process and returns it to the laser processing control system. The system extracts the vacuum coating layer thickness parameter from the received data message.
[0092] A thin-film interference mathematical model is pre-set in the laser processing control system. This model includes a set of reflectance calculation equations with parameters such as the thickness of the vacuum-deposited layer, the refractive index of the coating material, the refractive index of the substrate material, and the center wavelength of the illumination source as independent variables. The processor substitutes the extracted vacuum-deposited layer thickness parameter into the thin-film interference mathematical model, solves it through algebraic operations, and calculates the equivalent reflectance coefficient of the workpiece surface under the specified light source illumination conditions, outputting it as the theoretical surface reflectance.
[0093] Specifically, the specific formulas for the reflectivity calculation equations included in the thin-film interference mathematical model are as follows:
[0094] First, calculate the first reflection coefficient r1 at the interface between air and the vacuum coating layer, and the second reflection coefficient r2 at the interface between the vacuum coating layer and the substrate material:
[0095] r1=(n0-n1) / (n0+n1)
[0096] r2=(n1-n2) / (n1+n2)
[0097] Next, the interference phase difference δ generated by the beam's perpendicular round-trip propagation inside the vacuum-deposited layer is calculated:
[0098] δ=(4π·n1·d) / λ
[0099] Finally, the equivalent reflectance coefficient, i.e. the theoretical light reflectance R of the surface, is obtained by algebraic solution:
[0100] R=(r1²+r2²+2·r1·r2·cosδ) / (1+r1²·r2²+2·r1·r2·cosδ)
[0101] In the formula, R is the calculated theoretical light reflectivity of the surface; n0 is the refractive index constant of the ambient air where the workpiece is located (the system default value is 1); n1 is the refractive index parameter of the coating material; n2 is the refractive index parameter of the substrate material; d is the thickness parameter of the vacuum coating layer; λ is the center wavelength parameter of the illumination source; and π is pi. Since the optical path of the coaxial vision camera is perpendicular to the workpiece surface, this set of equations is constructed based on the perpendicular incidence condition.
[0102] The system retrieves the baseline judgment threshold set in the system configuration file for the uncoated standard sample. It calculates the ratio between the theoretical surface reflectance and the theoretical reflectance of the standard sample. The baseline judgment threshold is multiplied by the ratio, and the result is rounded down to generate the preset difference threshold as an integer. This dynamic adjustment step corrects for fluctuations in overall background reflectance caused by differences in coating thickness between different batches of workpieces.
[0103] Step S23: Calculate the brightness difference of corresponding pixels between two adjacent stepped exposure images.
[0104] The processor extracts the previous and next stepped exposure images from the three-dimensional image data set of the multi-frame stepped exposure images, based on depth indexing. The system iterates through the pixels in the image according to row and column coordinates. For pixels with specific horizontal and vertical indices, a second grayscale value is read from the specific coordinates of the next stepped exposure image, and a first grayscale value is read from the same coordinates of the previous stepped exposure image. The difference between the second and first grayscale values is calculated, and an absolute value transformation operation is performed on this difference to generate the brightness difference value at that coordinate position. After the traversal is completed, the brightness differences at all coordinate positions are filled into independent two-dimensional arrays to construct a brightness difference matrix.
[0105] Step S24: Pixels with brightness differences greater than a preset difference threshold are identified as highly reflective halo pixels.
[0106] The processor reads each element of the brightness difference matrix row by row and column by column, and compares it with the preset difference threshold generated in step S22. When the brightness difference at a certain coordinate position is greater than the preset difference threshold, the processor determines that the workpiece surface area corresponding to that coordinate has generated a nonlinear photoelectric response phenomenon, and marks the pixel point corresponding to that coordinate as a highly reflective halo pixel point. The system appends the row and column coordinate data of the highly reflective halo pixel point to the coordinate index list in the system memory. When the brightness difference at a certain coordinate position is less than or equal to the preset difference threshold, the processor determines that the pixel point corresponding to that coordinate is a normal optical response point and skips the index record.
[0107] Step S25: Mask the highly reflective halo pixels and extract stable edge contour features from the remaining unmasked pixels.
[0108] Specifically, masking treatment includes:
[0109] A blank mask matrix with dimensions matching the stepped exposure image is constructed. The laser processing control system allocates a two-dimensional array region in the storage space, whose number of rows and columns is consistent with the resolution parameters of the stepped exposure image. During the initialization phase, all data bits in this two-dimensional array region are assigned the value zero, forming the blank mask matrix.
[0110] The blank mask matrix element corresponding to the location of the highly reflective halo pixel is assigned an invalid value. The system traverses the coordinate data in the coordinate index list and performs addressing and positioning in the corresponding two-dimensional address space of the blank mask matrix. The addressed element is assigned the value zero, which serves as an invalid value, indicating that the image data at that coordinate will be blocked and masked.
[0111] The blank mask matrix element corresponding to the location of the remaining unmasked pixels is assigned a valid value. For the remaining coordinates not recorded in the coordinate index list, the system classifies them as remaining unmasked pixels. The element in the blank mask matrix corresponding to the location of the remaining unmasked pixel is assigned the value one. This value one serves as a valid value, ensuring that the image data at that coordinate will be retained.
[0112] The blank mask matrix, after assignment, is used to perform a dot product operation on the stepped exposure image, outputting the image to be analyzed. The processor extracts a reference image matrix from multiple frames of stepped exposure images, ensuring the overall grayscale mean lies within the sensor's linear response range. The reference image matrix is then multiplied element-wise with the blank mask matrix. After the dot product, image grayscale data in areas overlapping with invalid values in the mask matrix are cleared and isolated, while grayscale data in areas overlapping with valid values in the mask matrix retain their original values. The resulting two-dimensional matrix is output as the image to be analyzed.
[0113] Edge contour feature extraction includes:
[0114] A two-dimensional convolution scan is performed on the image to be analyzed using a first-order spatial differential operator. The gray-space partial derivatives of each pixel node in the image are calculated along both the horizontal and vertical coordinate axes. The gradient magnitude parameter of the pixel node is calculated by summing the squares of the gray-space partial derivatives in the two orthogonal directions and taking the square root. The gradient direction angle parameter of the pixel node is calculated by calculating the arctangent function of the quotient of the gray-space partial derivatives in the two directions.
[0115] Non-maximum suppression is performed on the gradient magnitude parameter along the direction indicated by the calculated gradient direction angle parameter. The gradient magnitude parameter of the center pixel is compared with the gradient magnitude parameters of its two adjacent interpolated pixels along the gradient direction. If the gradient magnitude parameter of the center pixel is not a local maximum, it is set to zero, thus preserving the peak value of the local gradient magnitude and obtaining a single-pixel-width edge image matrix.
[0116] A dual-threshold connectivity analysis algorithm is used to track and stitch together the edge image matrix. The system sets high-gradient and low-gradient thresholds. Coordinate points with gradient magnitude parameters higher than the high-gradient threshold are marked as strong edge points. Starting from a strong edge point, a search is performed along adjacent directions in its eight-neighbor space. Adjacent pixels with gradient magnitude parameters between the high-gradient and low-gradient thresholds are marked as weak edge points and added to the current continuous edge point set. The search continues until no weak edge points are connected. Length-condition filtering is applied to each formed continuous edge point set, removing discrete point sets with fewer nodes than a preset length constant threshold. The retained continuous coordinate point sets are output as the stable edge contour features.
[0117] Step S26: Extract the pixel gradient span data of the stable edge contour features.
[0118] Due to workpiece deformation, the physical surface deviates from the camera's calibration focal plane, and the physical edges in the image appear as transition bands with a specific pixel width gradient. The steps for extracting this geometric widening scale include:
[0119] Multiple sets of cross-sectional pixel grayscale distribution curves are extracted along the contour normal direction of the stable edge contour feature. Multiple sampling reference points are extracted from the coordinate sequence of the stable edge contour feature according to preset pixel sampling step size parameters. For any extracted sampling reference point, the straight line tangent vector of its local continuous curve is calculated. The contour normal direction vector perpendicular to this straight line tangent vector is calculated based on the plane orthogonality relationship. Taking this sampling reference point as the coordinate center point, sampling cross-sectional paths with fixed pixel lengths are extended inwards and outwards along the contour normal direction vector.
[0120] Since the contour normal direction is not parallel to the row and column grid coordinate axes of the image matrix, the discrete sampling nodes on the sampling cross-section path are located in floating-point coordinates. The bilinear interpolation algorithm is invoked to locate the four nearest integer pixel grid points around the floating-point coordinate. Interpolation weights are assigned based on Euclidean distance, and the sub-pixel grayscale value of the floating-point coordinate is obtained using the interpolation formula. All sub-pixel grayscale values are extracted sequentially along the sampling cross-section path and stored in a one-dimensional array according to their spatial distance, constructing a cross-sectional pixel grayscale distribution curve. All sampling reference points are traversed to generate multiple sets of cross-sectional pixel grayscale distribution curves equal in number to the number of reference points.
[0121] Differential calculations are performed on multiple sets of cross-sectional pixel grayscale distribution curves to obtain multiple sets of grayscale change rate curves. For each set of cross-sectional pixel grayscale distribution curves in a one-dimensional array, a first-order discrete difference operator is called. The grayscale value at the address index of the next array is subtracted from the grayscale value at the address index of the previous array to obtain the grayscale change within the corresponding unit spatial distance, resulting in a derivative sequence data. This derivative sequence data characterizes the grayscale change rate and is output as the grayscale change rate curve.
[0122] Extract the horizontal span distance between the extreme points on both sides of the grayscale change rate curves and the preset baseline value. Scan the data of each grayscale change rate curve, locate the element with the largest absolute value, and mark its index position as the internal extreme point. Configure a loop search and tracking logic with this internal extreme point as the search axis. Scan backwards towards the front address of the sequence. When encountering the first element whose absolute value is less than or equal to the preset baseline value, record the first truncation index value; scan forwards towards the back address of the sequence. When encountering the first element whose absolute value is less than or equal to the preset baseline value, record the second truncation index value. Calculate the absolute difference between the second truncation index value and the first truncation index value. Perform a multiplication operation on this absolute difference and the subpixel spacing parameter of the sampling section path to generate the horizontal span distance of the edge diffusion width of the local region.
[0123] The horizontal span distances are summed and averaged, and the result is output as the pixel gradient span data. All horizontal span distance data are imported into a one-dimensional sample statistical array. The numerical elements in this one-dimensional sample statistical array are sorted in ascending order, and extreme value segments located at the two ends of a preset percentage interval are truncated and removed. The filtered main sample data are summed, and the sum is divided by the number of valid samples to perform an arithmetic mean calculation. The result is assigned to the pixel gradient span data variable.
[0124] Step S27: Generate a depth defocus compensation vector based on the pixel gradient span data.
[0125] Obtain a pre-established gradient depth mapping relationship library. This library records the mapping relationships between different pixel spans and physical height deviations. This mapping relationship library is a two-dimensional discrete data lookup table generated during the system initialization and calibration phase, where the optical lifting platform is controlled to perform discrete displacement with the calibration focal plane position as the zero point, and the edge pixel span parameters under each physical height coordinate are calculated.
[0126] The pixel gradient span data is input into the gradient depth mapping relation library for internal query retrieval. The system processor uses the pixel gradient span data output from the calculation as the primary key independent variable of the query, and calls the binary search algorithm to locate the discrete interval in which its value falls in the independent variable column of the two-dimensional discrete data query table.
[0127] When a matching entry is found, the corresponding target physical height deviation is retrieved. If the pixel gradient span data falls within the numerical interval formed by two adjacent discrete nodes in the query table, the system invokes the cubic spline interpolation algorithm. Data interpolation and smoothing calculations are performed based on the proportions of the known nodes at both ends of the positioning interval. The output includes a sign bit representing the directional state and real bits representing the deviation scale, which is defined as the target physical height deviation.
[0128] The depth defocus compensation vector along the vertical height axis is constructed using the target physical height deviation. The laser processing control system instantiates a structure variable in the storage space to store a three-dimensional spatial displacement vector. The horizontal and vertical offset components representing the two-dimensional horizontal dimension in the structure variable are assigned the constant value of zero. The interpolated real value of the target physical height deviation is written into the vector component storage unit representing the vertical height axial offset in the structure variable. This three-dimensional vector structure encapsulates and outputs the depth defocus compensation vector to compensate for the visual focal length deviation caused by the deformation of the workpiece.
[0129] Step S28: Calculate the initial planar coordinates based on the stable edge contour features.
[0130] Retrieve a pre-stored standard laser engraving workpiece template. The system processor loads the standard laser engraving workpiece template data from the file system. This template data contains a two-dimensional planar node coordinate sequence of the workpiece's theoretical outline, as well as the reference starting coordinate parameter information of the theoretical machining coordinate system.
[0131] The stable edge contour feature is compared with the standard laser-engraved workpiece template through an affine transformation to calculate the translational deviation vector and rotational deviation angle. The system extracts the confidence weights corresponding to each feature pixel within the stable edge contour feature. By calculating the curvature parameter and spatial gradient magnitude parameter of the local curve where the feature pixel is located, a confidence weight value is assigned to each feature pixel using a scoring function.
[0132] Specifically, the mathematical expression for the scoring function is as follows:
[0133] W=(G / Gmax)×exp(-μ·K²)
[0134] In the formula, W is the calculated confidence weight value assigned to the feature pixel; G is the spatial gradient magnitude parameter of the feature pixel; Gmax is the maximum value of the spatial gradient magnitude parameters of all feature pixels extracted from the stable edge contour feature; K is the curvature parameter of the local curve where the feature pixel is located; μ is a preset curvature penalty coefficient constant, and to ensure the uniformity of dimensions within the exponential term, the system limits the physical dimension of the curvature penalty coefficient constant μ to be the reciprocal of the physical dimension of the curvature parameter square K², so that -μ·K² is transformed into a dimensionless pure number parameter; exp is an exponential function with the natural constant e as its base. This scoring function positively weights clear, high-contrast physical edges through the gradient normalization term (G / Gmax), and applies a significant weight penalty to high-curvature regions (such as random sawtooth interference points caused by material deformation or processing burrs) using a non-linearly decaying exponential term, thereby improving the reliability of the high-confidence pixel set at the underlying algorithm logic.
[0135] Feature pixels with confidence weights lower than a preset weight threshold are removed to obtain a set of high-confidence pixels. The system performs filtering and comparison on the feature pixel sequence containing confidence weights, removes the coordinate node data with weight values lower than the preset weight threshold, and constructs the high-confidence pixel set from the remaining node data that meets the conditions.
[0136] The coordinate transformation matrix is solved using the high-confidence pixel set and the reference point set contained within the standard laser-engraved workpiece template. The high-confidence pixel set is set as the source point set matrix, and the corresponding reference contour nodes in the standard laser-engraved workpiece template are set as the target point set matrix. The two-dimensional planar centroid coordinates of the source and target point set matrices are calculated. The centroid coordinates of the corresponding matrix are subtracted from the coordinates of each node in the matrix to complete the decentralization preprocessing of the point set data. The matrix product of the transpose of the decentralized source point set matrix and the decentralized target point set matrix is calculated to generate a two-dimensional cross-covariance matrix. The system calls the matrix decomposition function to perform singular value decomposition on this two-dimensional cross-covariance matrix, extracting the left and right singular vector matrices, and performing matrix multiplication to obtain the two-dimensional planar rotation transformation matrix. The real components of the angle reflecting the coordinate system deflection, i.e., the rotation deviation angle, are calculated from the elements of this rotation transformation matrix using inverse trigonometric functions. By subtracting the centroid coordinates of the source point set matrix after rotation transformation from the centroid coordinates of the target point set matrix, an offset variable containing both horizontal and vertical directions is obtained, which is the translational deviation vector.
[0137] The initial planar coordinates are constructed using the translational deviation vector and the rotational deviation angle. The theoretical machining starting reference coordinate parameters recorded in the standard laser-engraved workpiece template are extracted. A two-dimensional planar rotation operator containing trigonometric functions is constructed using the analytically derived rotational deviation angle, and rotation matrix operations are performed on the theoretical machining starting reference coordinate parameters. The analytically derived translational deviation vector is substituted into the two-dimensional planar translation logic, and a superposition translation operation is performed on the coordinates after the rotation operation. The generated dataset containing the corrected horizontal and vertical coordinate values is output as the initial planar coordinates.
[0138] Step S29: Merge the depth defocus compensation vector with the initial planar coordinates to output the target positioning coordinates.
[0139] The laser processing control system allocates a contiguous region in memory and instantiates a 4x4 homogeneous transformation matrix structure variable. The top-left three-row, three-column submatrix of the homogeneous transformation matrix is filled with numerical structures describing the rotational transformation around the vertical normal axis, based on the rotational deviation angle parameters contained in the initial plane coordinates. The first and second rows of the fourth column of the matrix are assigned values to the horizontal and vertical translational deviation component parameters of the initial plane coordinates, respectively. Simultaneously, the vertical height compensation value contained in the depth defocus compensation vector is written into the third row of the fourth column. The fourth row of the homogeneous transformation matrix variable is configured as a constant sequence. After the assignment and matrix structure assembly are completed, the 4x4 homogeneous transformation matrix structure variable is encapsulated and output by the system as the target positioning coordinates.
[0140] Step S30: Control the laser equipment to perform laser engraving on the workpiece to be processed according to the positioning coordinates.
[0141] For details, please refer to the appendix. Figure 4 As shown, step S30 includes:
[0142] Step S31: Obtain the pre-imported trajectory of the drawing file to be processed.
[0143] The industrial control system software parses externally imported vector graphics data files and converts the vector graphics data into a trajectory of the drawing to be processed, consisting of continuous two-dimensional absolute coordinate nodes, in memory. This trajectory is established within a design coordinate system model based on the theoretical processing origin.
[0144] Step S32: Perform spatial mapping transformation on the trajectory of the drawing to be processed according to the positioning coordinates to generate the actual processing trajectory.
[0145] The theoretical two-dimensional node coordinates in the trajectory of the drawing to be processed are read sequentially. These coordinates are then converted into four-dimensional homogeneous coordinate vectors, and matrix multiplication is performed with the four-row, four-column homogeneous transformation matrix structure variable used as the target positioning coordinates. This multiplication transforms the theoretical two-dimensional node coordinates on the plane into three-dimensional spatial coordinates superimposed with translation correction, rotation correction, and workpiece height compensation. The three-dimensional point set generated after all nodes undergo projection transformation is output as the actual processing trajectory.
[0146] Step S33: Analyze the actual machining trajectory and output multiple sets of galvanometer deflection control commands.
[0147] The system's interpolation control module discretizes the continuous actual machining trajectory into a three-dimensional displacement control node sequence on a time scale based on preset discrete interpolation accuracy parameters and scanning linear velocity parameters. For the three-dimensional coordinates of each node in the node sequence, the laser interpolation control module loads the inverse kinematics parameter model and nonlinear distortion equations of the laser device. Through nonlinear algebraic solving, the node coordinates are inversely calculated into numerical variables controlling the rotation of the lateral deflection mirror, the rotation of the longitudinal deflection mirror, and the linear movement depth of the Z-axis beam expander lens system. These control variables are time-aligned and packaged according to the device communication protocol to generate the multiple sets of galvanometer deflection control commands.
[0148] Step S34: Use multiple sets of galvanometer deflection control commands to control the movement of the deflection mirrors contained inside the laser device.
[0149] The multiple sets of galvanometer deflection control commands are transmitted to the control circuit inside the laser equipment via a communication bus. The control circuit parses the data packet sequence and outputs control signals to drive the actuators. Under the drive of the control loop, the laser dual-axis deflection galvanometer system is regulated to generate scanning motion in the processing plane, while the Z-axis zoom lens linear mechanism is regulated to perform push-pull displacement along the optical axis. Through the multi-axis linkage control mechanism, the laser beam focus is guided to follow the actual processing trajectory after correction mapping to perform laser engraving on the surface of the workpiece.
[0150] Based on the same inventive concept, this application also provides a high-precision positioning system for laser-engraved workpieces based on vision measurement. This system is applied to the high-precision positioning method for laser-engraved workpieces based on vision measurement described in the foregoing embodiments. The system is deployed in a control computing platform. The control computing platform includes a processor, a storage unit, and a data processing and operation architecture, with each module running in the system's storage space. The interaction between image data blocks and coordinate data streams is achieved between the modules through a built-in data synchronization mechanism. (See attached figure.) Figure 5 As shown, the vision-based laser engraving workpiece high-precision positioning system includes:
[0151] The image acquisition module is configured to acquire an initial visual image of the workpiece to be processed.
[0152] The multi-frame acquisition module is configured to control the lighting source to dynamically illuminate according to a preset light emission sequence and simultaneously acquire multiple frames of stepped exposure images.
[0153] The difference calculation module is configured to calculate the brightness difference between corresponding pixels between two adjacent frames of the stepped exposure image.
[0154] The reflectivity determination module is configured to determine pixels with brightness differences greater than a preset difference threshold as highly reflective halo pixels.
[0155] The masking extraction module is configured to mask the highly reflective halo pixels and extract stable edge contour features from the remaining unmasked pixels.
[0156] The gradient analysis module is configured to extract pixel gradient span data of the stable edge contour features.
[0157] The defocus compensation generation module is configured to generate a depth defocus compensation vector based on the pixel gradient span data.
[0158] The planar coordinate calculation module is configured to calculate the initial planar coordinates based on the stable edge contour features.
[0159] The coordinate fusion output module is configured to fuse the depth defocus compensation vector with the initial planar coordinates to output the target positioning coordinates.
[0160] The laser engraving guidance module is configured to use the target positioning coordinates as the final reference for guiding the laser device to perform laser engraving operations.
[0161] In terms of specific data flow implementation:
[0162] The image acquisition module continuously monitors the status of the sensor pins. When a trigger event indicating workpiece positioning is detected, a trigger message is generated and a data packet containing wake-up and exposure parameters is sent to the coaxial vision camera via a communication protocol. The image acquisition module allocates storage space in memory, receives the digital grayscale data stream output by the camera, executes pixel alignment instructions, and generates an initial vision image matrix that conforms to specifications.
[0163] The multi-frame acquisition module converts the duty cycle value into a control command based on the emission sequence parameters read from the storage area and sends it to the illumination source. Within the set light intensity time window, it sends a trigger command to the coaxial vision camera. The multi-frame acquisition module instantiates a 3D data object in memory, extracts valid pixel blocks, adds timestamps and illumination identifier parameters, and stores them sequentially into the corresponding memory address of the 3D data object, thus constructing a multi-frame stepped exposure image dataset.
[0164] The difference calculation module extracts the two-dimensional matrix structure of two adjacent frames from the 3D data object. The module allocates a blank array of the same dimension in memory. The module sequentially subtracts the pixel values at the addresses corresponding to the high-exposure energy matrix from the pixel values at the addresses corresponding to the low-exposure energy matrix. The result sequence of the subtraction operation is processed by an absolute value function and written into the blank array to generate a brightness difference data matrix.
[0165] The reflectivity determination module requests the vacuum coating layer thickness parameters from an external server via a network communication component. The module substitutes these parameters into the equations of the thin-film optical interference mathematical model and calls the computation component to solve for the reflectivity proportionality constant. The module reads the static threshold parameter from the system configuration file and performs multiplication and rounding calculations with this proportionality constant to generate a preset difference threshold. The module iterates through the values in the brightness difference data matrix and compares them with the preset difference threshold. For coordinates with values greater than the threshold, they are marked as highly reflective halo pixels and written into a coordinate list in system memory.
[0166] The masking extraction module instantiates a blank mask matrix in memory with all data bits set to zero. It extracts data from the coordinate list, keeping the corresponding data in the mask matrix zero. Unrecorded data positions are overwritten with one. The module selects the reference image matrix and performs element-wise multiplication with the mask matrix to generate the image data matrix to be analyzed. The module performs filtering calculations on the image data matrix to obtain the gradient magnitude and gradient direction angle. Non-maximum suppression is performed along the direction angle, and a connectivity tracking algorithm is used to combine adjacent pixel nodes, eliminating point sets that do not meet the length setting conditions to generate stable edge contour features.
[0167] The gradient analysis module traverses the edge contour feature data to obtain reference nodes. It calculates the normal direction vector of each node. A sampling cross-section path is configured, extending from the reference node as the origin towards the normal direction. For floating-point coordinates, the module calls bilinear interpolation logic to calculate sub-pixel grayscale parameters, generating a one-dimensional cross-sectional pixel grayscale distribution curve. First-order difference calculation is performed on the curve to generate a grayscale change rate waveform curve. The absolute value extremum center is located, and values are read bit by bit towards the beginning and end, recording the cutoff positions where the values are below a set interval. The difference between the cutoff positions is calculated to obtain the horizontal span distance parameter. An accumulation and division operation is performed on the statistical distance parameter to generate the arithmetic mean as the pixel gradient span data.
[0168] The defocus compensation generation module reads the mapping relationship library file in the system storage component. It uses pixel gradient span data as the query parameter input for matching logic. The module uses a search algorithm to locate the data interval where the parameter is located. It calls the cubic spline interpolation polynomial solution framework to perform spatial smoothing derivation calculations and outputs the target physical height deviation. The module instantiates a three-dimensional spatial displacement structure. It assigns the target physical height deviation to the address unit corresponding to the vertical direction of the structure, generating a depth defocus compensation vector.
[0169] The planar coordinate calculation module loads a standard laser-engraved workpiece theoretical template file. It calculates the confidence score weights for the edge feature node sequence. Coordinate data with confidence scores below a preset threshold are removed, generating a high-confidence pixel set matrix. The centroid coordinates of the high-confidence pixel set matrix and the template pixel set matrix are calculated, and a decentralization operation is performed. The cross-covariance matrix between the decentralized matrices is calculated. Singular value decomposition is performed on this matrix to extract matrix feature parameters and calculate the rotation deviation angle parameters. The horizontal and vertical translation deviation vector data are calculated using the centroid coordinate parameters. The module uses the template's initial coordinates combined with the aforementioned angle and translation parameters to perform matrix superposition operations, outputting the initial planar coordinates.
[0170] The coordinate fusion output module generates a 4x4 homogeneous transformation matrix variable in memory. Trigonometric functions are calculated based on the rotation deviation angle parameters of the initial planar coordinates and filled into the rotation submatrix. Values are then assigned to the translation column of this homogeneous transformation matrix based on the displacement components in the initial planar coordinates and the vertical height compensation value in the depth defocus compensation vector. Constants are filled into the remaining addresses. This transformation matrix data is then output as the target positioning coordinates.
[0171] The laser engraving guidance module receives a vector format data file and converts it into a theoretical node linked list. It then iterates through the extracted node coordinate vectors and performs matrix multiplication with the target positioning coordinate matrix. The theoretical nodes are converted into actual processing space coordinates including 3D deviation correction parameters. The module configures a kinematics calculation engine to partition the spatial point list. It loads the device's inverse kinematics parameter model and nonlinear correction equations, converting the 3D coordinate values of the nodes into commands to drive the deflecting mirrors and lenses. Finally, it packages and generates a data stream containing multiple sets of galvanometer deflection control commands and sends it to the laser device's underlying control port.
[0172] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A high-precision positioning method for laser engraving a workpiece based on visual measurement, comprising: Obtain an initial visual image of the workpiece to be processed; The initial visual image is subjected to reference feature extraction to obtain positioning coordinates; the laser equipment is controlled to perform laser engraving on the workpiece to be processed according to the positioning coordinates. The feature is that the step of extracting reference features from the initial visual image to obtain positioning coordinates includes: The lighting source is controlled to dynamically illuminate according to a preset light emission sequence, and multiple frames of stepped exposure images are acquired simultaneously. Calculate the brightness difference of corresponding pixels between two adjacent frames of the stepped exposure image; Pixels with brightness differences greater than a preset difference threshold are identified as highly reflective halo pixels; The highly reflective halo pixels are masked, and stable edge contour features are extracted from the remaining unmasked pixels. Extract the pixel gradient span data of the stable edge contour features; A depth defocus compensation vector is generated based on the pixel gradient span data. Calculate the initial planar coordinates based on the stable edge contour features; The depth defocus compensation vector is fused with the initial planar coordinates to output the target positioning coordinates; The target positioning coordinates are used as the positioning coordinates to guide the laser equipment to perform the laser engraving operation.
2. The high-precision positioning method for laser engraving workpiece based on visual measurement according to claim 1, characterized in that, The process of acquiring the initial visual image of the workpiece to be processed includes: Receives the arrival trigger signal sent by an external photoelectric sensor; The coaxial vision camera is activated based on the arrival trigger signal. The coaxial vision camera is driven to capture images of the workpiece to be processed placed on the processing platform to obtain the initial vision image.
3. The high-precision positioning method for laser engraving workpiece based on visual measurement according to claim 1, characterized in that, The laser control device performs laser engraving on the workpiece according to the positioning coordinates, including: Obtain the trajectory of the pre-imported drawing file to be processed; Based on the positioning coordinates, the trajectory of the drawing to be processed is spatially mapped and transformed to generate the actual processing trajectory; The actual machining trajectory is analyzed to output multiple sets of galvanometer deflection control commands; The movement of the deflection mirrors inside the laser device is controlled by multiple sets of galvanometer deflection control commands.
4. The high-precision positioning method for laser engraving workpieces based on vision measurement according to claim 1, characterized in that, The step of calculating the initial planar coordinates based on the stable edge contour features includes: Retrieve pre-stored standard laser-engraved workpiece templates; The stable edge contour features are compared with the standard laser-engraved workpiece template by performing an affine transformation, and the translational deviation vector and rotational deviation angle are calculated. The initial planar coordinates are constructed using the translation deviation vector and the rotation deviation angle.
5. The high-precision positioning method for laser engraving workpieces based on vision measurement according to claim 4, characterized in that, The step of comparing the stable edge contour features with the standard laser-engraved workpiece template through an affine transformation includes: Extract the confidence weights of each feature pixel within the stable edge contour feature; Feature pixels with confidence weights lower than a preset weight threshold are removed to obtain a set of high-confidence pixels; The coordinate transformation matrix is solved by using the set of high-confidence pixels and the set of reference points contained inside the standard laser-engraved workpiece template.
6. The high-precision positioning method for laser engraving workpieces based on vision measurement according to claim 1, characterized in that, The process of masking and shielding the highly reflective halo pixels includes: Construct a blank mask matrix with dimensions matching the stepped exposure image; The blank mask matrix element corresponding to the location of the highly reflective halo pixel is assigned an invalid value; Assign a valid value to the blank mask matrix element corresponding to the location of the remaining unmasked pixel; The blank mask matrix after assignment is used to perform a dot product operation on the stepped exposure image, and the image to be analyzed is output.
7. The high-precision positioning method for laser engraving workpieces based on vision measurement according to claim 1, characterized in that, Before determining pixels with brightness differences greater than a preset difference threshold as highly reflective halo pixels, the method further includes: Extract the thickness parameters of the vacuum coating layer on the surface of the workpiece to be processed; The theoretical light reflectivity of the surface is determined based on the thickness parameters of the vacuum-coated layer. The basic judgment threshold is dynamically adjusted using the theoretical light reflectivity of the surface to generate the preset difference threshold, so as to adaptively filter out the nonlinear reflective interference phenomenon generated by different batches of vacuum-coated workpieces.
8. The high-precision positioning method for laser-engraved workpieces based on vision measurement according to claim 1, characterized in that, The extraction of pixel gradient span data of the stable edge contour features includes: Along the contour normal direction of the stable edge contour feature, extract multiple sets of cross-sectional pixel grayscale distribution curves; Differentiation calculations were performed on multiple sets of the aforementioned cross-sectional pixel grayscale distribution curves to obtain multiple sets of grayscale change rate curves; Extract the horizontal span distance between the extreme points on both sides of the grayscale change rate curves that descend to a preset baseline value; The summation and averaging of all the horizontal span distances are calculated, and the summation and averaging results are output as the pixel gradient span data.
9. The high-precision positioning method for laser engraving workpieces based on vision measurement according to claim 1, characterized in that, The step of generating a depth defocus compensation vector based on the pixel gradient span data includes: Obtain a pre-established gradient depth mapping relationship library, which records the mapping relationship between different pixel spans and physical height deviations; The pixel gradient span data is input into the gradient depth mapping relationship library for internal query and retrieval. When a matching entry is found, the corresponding target physical height deviation is retrieved. The depth defocus compensation vector along the vertical height axis is constructed using the target physical height deviation to compensate for the visual focal length deviation caused by the warping deformation of the workpiece to be processed.
10. A high-precision positioning system for laser-engraved workpieces based on vision measurement, employing the high-precision positioning method for laser-engraved workpieces based on vision measurement as described in any one of claims 1 to 9, characterized in that, include: The image acquisition module is configured to acquire an initial visual image of the workpiece to be processed; The multi-frame acquisition module is configured to control the lighting source to dynamically illuminate according to a preset light emission sequence and simultaneously acquire multiple frames of stepped exposure images. The difference calculation module is configured to calculate the brightness difference between corresponding pixels between two adjacent frames of the stepped exposure image; The reflectivity determination module is configured to determine pixels with brightness differences greater than a preset difference threshold as highly reflective halo pixels. The masking extraction module is configured to mask the highly reflective halo pixels and extract stable edge contour features from the remaining unmasked pixels. The gradient analysis module is configured to extract pixel gradient span data of the stable edge contour features; The defocus compensation generation module is configured to generate a depth defocus compensation vector based on the pixel gradient span data. The planar coordinate calculation module is configured to calculate the initial planar coordinates based on the stable edge contour features; The coordinate fusion output module is configured to fuse the depth defocus compensation vector with the initial planar coordinates in spatial coordinates and output the target positioning coordinates; The laser engraving guidance module is configured to use the target positioning coordinates as the final reference for guiding the laser device to perform laser engraving operations.