Laser rapid marking positioning method and system

By obtaining image scale feature information and distortion correction, calculating the rotation angle and translation distance, and constructing a simulated mapping trajectory, the problem of inaccurate positioning in traditional laser marking is solved, and the positioning and marking accuracy is improved.

CN119549892BActive Publication Date: 2025-09-12JIESEN POWER TECH (GUANGDONG) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411680964.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-09-12
Estimated Expiration
2044-11-22

AI Technical Summary

Technical Problem

In existing laser marking technology, traditional manual positioning methods have problems such as inaccurate workpiece placement and low work efficiency. In addition, it is difficult to accurately determine the spatial coordinates of edge points when machine vision recognizes images, and there is distortion when the scanning galvanometer obtains image information, which affects marking accuracy.

Method used

By obtaining the image scale feature information of the target image, extracting multiple sets of effective edge point coordinates, calculating the distortion value and correcting the image rotation angle and translation distance, a simulated mapping trajectory is constructed for laser marking positioning to ensure accurate focusing of the laser beam.

Benefits of technology

The positioning accuracy and marking precision of the laser marking system are significantly improved, errors caused by inaccurate positioning are avoided, and the laser beam can be accurately focused on the target area.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119549892B_ABST
    Figure CN119549892B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of laser positioning technology, and specifically discloses a laser rapid marking positioning method and system, which obtain image scale feature information of a target image; obtain multiple groups of valid edge point coordinates based on the image scale feature information; obtain first contour information of the target image based on the multiple groups of valid edge point coordinates; obtain a distortion value of the target image based on the first contour information; calculate a rotation angle value and a translation distance value of the target image based on the distortion value; correct the first contour information based on the rotation angle value and the translation distance value, and obtain second contour information of the corrected target image; the present invention can significantly improve the positioning accuracy of a laser marking system through precise distortion correction and coordinate transformation, and can significantly improve the accuracy of positioning and marking by using distortion coefficients to correct coordinates, calculate rotation angles and translation distances, etc.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of laser positioning technology, and in particular to a laser rapid marking positioning method and system. Background Art

[0002] Laser machining is a non-contact method capable of achieving a variety of machining objectives. Traditional manual positioning methods in laser machining suffer from issues such as inaccurate workpiece placement and low efficiency. Therefore, it is necessary to improve workpiece positioning accuracy during machining. Consequently, numerous researchers have studied laser machining positioning methods, such as the laser point cloud-based method for locating power line suspension points.

[0003] In the existing technology, when positioning through machine vision image recognition, only surface information can be obtained, and it is difficult to accurately determine the spatial coordinates of edge points. In addition, when existing laser marking equipment (such as scanning galvanometers) obtains image information, there is often varying degrees of distortion in the information of the target image obtained by the scanning galvanometer, which will affect the accuracy of laser marking and thus affect the accuracy of marking. Summary of the Invention

[0004] The purpose of the present invention is to provide a laser rapid marking positioning method to solve the technical problems raised in the above background technology.

[0005] To achieve the above object, the present invention provides the following technical solutions:

[0006] A laser rapid marking positioning method, comprising:

[0007] Obtaining image scale feature information of the target image;

[0008] Obtain multiple sets of valid edge point coordinates based on image scale feature information;

[0009] Acquire first contour information of the target image according to multiple groups of valid edge point coordinates;

[0010] Obtaining a distortion value of the target image according to the first contour information;

[0011] Calculate the rotation angle value and translation distance value of the target image according to the distortion value;

[0012] Correcting the first contour information according to the rotation angle value and the translation distance value, and obtaining the corrected second contour information of the target image;

[0013] Acquire the coordinates of the contour edge points according to the second contour information, and acquire the simulated mapping trajectory according to the coordinates of the contour edge points;

[0014] Perform edge point positioning and matching on the target image based on the simulated mapping trajectory;

[0015] If they match, the target image is laser marked and positioned;

[0016] If there is no match, the second contour information is returned as the first contour information to the step of obtaining the distortion value of the target image according to the first contour information.

[0017] Preferably, the step of obtaining multiple sets of valid edge point coordinates based on image scale feature information includes:

[0018] Obtaining real-time image width and real-time image height according to image scale feature information;

[0019] Get the aspect ratio value according to the real-time image width and the real-time image height;

[0020] Acquire edge point feature information of the target image based on the optical flow method, wherein the edge point feature information includes edge point coordinate information and edge point direction information;

[0021] Obtaining the angle between the edge point and the preset horizontal axis according to the edge point coordinate information and the edge point direction information;

[0022] Divide the target image according to the angle value, the real-time image width, the real-time image height and the aspect ratio to obtain multiple image division areas;

[0023] Get the brightness value of the edge points in each image division area;

[0024] Determine whether the brightness value of the edge point is less than the preset value;

[0025] If it is less than, the corresponding edge point will be removed;

[0026] If it is greater than, the corresponding edge point is determined to be a valid edge point;

[0027] Get the valid edge point coordinates corresponding to the valid edge points in all image division areas.

[0028] Preferably, the step of obtaining first contour information of the target image according to multiple sets of valid edge point coordinates includes:

[0029] Obtain multiple horizontal coordinates and multiple vertical coordinates according to each set of edge point coordinates;

[0030] Get the edge point direction angle according to the horizontal and vertical coordinates;

[0031] The contour of each edge point coordinate is traced according to the edge point direction angle to obtain first contour information.

[0032] Preferably, the step of obtaining the distortion value of the target image according to the first contour information includes:

[0033] Acquire a maximum width value and a maximum height value of the contour according to the first contour information;

[0034] Get preset characteristic coefficients;

[0035] Get the preset outline width and preset outline height;

[0036] The contour edge variation coefficient is calculated based on the contour width, contour height and preset characteristic coefficient. The calculation formula is:

[0037]

[0038] Among them, Q is the contour edge variation coefficient, ρ is the preset feature coefficient, k x is the contour width, k y is the profile height, i is the preset profile width, and j is the preset profile height;

[0039] Obtaining a scale value of the first contour information according to the maximum contour width value and the maximum contour height value;

[0040] The distortion value is calculated based on the contour edge variation coefficient and scale value. The calculation formula is:

[0041] f (x,y) =Q*L (x,y) ;

[0042] Among them, f (x , y) is the distortion value, Q is the contour edge variation coefficient, L (x , y) is the scale value.

[0043] Preferably, the step of obtaining the rotation angle value and the translation distance value of the target image according to the distortion value includes:

[0044] Acquire a contour horizontal coordinate according to the first contour information;

[0045] Obtaining a first distortion coefficient of the contour horizontal coordinate according to the distortion coefficient;

[0046] Acquire the contour ordinate according to the first contour information;

[0047] Obtaining a second distortion coefficient of the contour ordinate according to the distortion coefficient;

[0048] The corrected abscissa is calculated based on the contour abscissa, the first distortion coefficient, the contour ordinate, and the second distortion coefficient. The calculation formula is:

[0049] x (u) =X+(2p1Y+p2(r 2 +2X 2 ));

[0050] Among them, x (u) is the correction horizontal coordinate, X is the profile horizontal coordinate, Y is the profile vertical coordinate, p1 is the first distortion coefficient, and p2 is the second distortion coefficient;

[0051] The corrected ordinate is calculated based on the profile abscissa, the first distortion coefficient, the profile ordinate, and the second distortion coefficient. The calculation formula is:

[0052] y (u) =Y+(p1(r 2 +2Y 2 )+2p2X);

[0053] Among them, y (u) is the correction ordinate, X is the profile abscissa, Y is the profile ordinate, p1 is the first distortion coefficient, and p2 is the second distortion coefficient;

[0054] Obtain the rotation angle value according to the correction horizontal coordinate, the correction vertical coordinate, the contour horizontal coordinate, and the contour vertical coordinate;

[0055] The translation distance value is obtained according to the corrected horizontal coordinate, the corrected vertical coordinate, the contour horizontal coordinate, and the contour vertical coordinate based on the Euclidean distance calculation method.

[0056] Preferably, the step of correcting the first contour information according to the rotation angle value and the translation distance value and obtaining the corrected second contour information of the target image includes:

[0057] Acquire contour abscissas and ordinates of a plurality of contour points according to the first contour information;

[0058] Based on the rotation angle value and the translation distance value, the contour horizontal coordinate and the contour vertical coordinate of each contour point are transformed to obtain the corresponding contour correction point;

[0059] All contour correction points are connected to obtain the second contour information.

[0060] Preferably, the step of obtaining the coordinates of the contour edge points according to the second contour information, and obtaining the simulated mapping trajectory according to the coordinates of the contour edge points includes:

[0061] Acquire a plurality of contour correction point information according to the second contour information, wherein the contour correction point information includes a contour correction horizontal coordinate and a contour correction vertical coordinate;

[0062] Get the distance value from the scanning galvanometer to the target image;

[0063] Based on the distance value, all the contour edge point coordinates are mapped into the three-dimensional space to obtain multiple three-dimensional coordinates;

[0064] Establishing a contour simulation image according to a plurality of three-dimensional coordinates;

[0065] Acquire multiple three-dimensional contour edge point coordinates according to the contour simulation image;

[0066] Obtaining a connection sequence of tracking edge points based on multiple three-dimensional contour edge point coordinates;

[0067] Mark the coordinates of all contour edge points based on the connection sequence of tracked edge points;

[0068] The simulated mapping trajectory is obtained based on the labeling process.

[0069] The present invention also discloses a laser rapid marking and positioning system, comprising:

[0070] A first acquisition module is used to acquire image scale feature information of a target image;

[0071] The second acquisition module is used to obtain multiple groups of valid edge point coordinates according to the image scale feature information;

[0072] A third acquisition module is used to acquire first contour information of the target image according to multiple groups of valid edge point coordinates;

[0073] a fourth acquisition module, configured to acquire a distortion value of the target image according to the first contour information;

[0074] A fifth acquisition module is used to calculate the rotation angle value and the translation distance value of the target image according to the distortion value;

[0075] a sixth acquisition module, configured to correct the first contour information according to the rotation angle value and the translation distance value, and obtain corrected second contour information of the target image;

[0076] a seventh acquisition module, configured to acquire the coordinates of the contour edge points according to the second contour information, and to acquire the simulated mapping trajectory according to the coordinates of the contour edge points;

[0077] A judgment module, used for locating and matching edge points of a target image based on a simulated mapping trajectory;

[0078] If they match, the target image is laser marked and positioned;

[0079] If there is no match, the second contour information is returned as the first contour information to the step of obtaining the distortion value of the target image according to the first contour information.

[0080] Preferably, the fourth acquisition module includes:

[0081] A first acquiring unit, configured to acquire a maximum outline width value and a maximum outline height value according to the first outline information;

[0082] A second acquiring unit, configured to acquire a preset characteristic coefficient;

[0083] A third obtaining unit is used to obtain a preset outline width and a preset outline height;

[0084] The first calculation unit is used to calculate the contour edge variation coefficient according to the contour width, contour height and preset characteristic coefficient. The calculation formula is:

[0085]

[0086] Among them, Q is the contour edge variation coefficient, ρ is the preset feature coefficient, k x is the contour width, k y is the profile height, i is the preset profile width, and j is the preset profile height;

[0087] a fourth acquiring unit, configured to acquire a scale value of the first contour information according to the maximum contour width value and the maximum contour height value;

[0088] The second calculation unit is used to calculate the distortion value according to the contour edge variation coefficient and the scale value. The calculation formula is:

[0089] f (x,y) =Q*L (x,y) ;

[0090] Among them, f (x,y) is the distortion value, Q is the contour edge variation coefficient, L (x,y) is the scale value.

[0091] Preferably, the fifth acquisition module includes:

[0092] a fifth acquiring unit, configured to acquire a contour horizontal coordinate according to the first contour information;

[0093] a sixth acquiring unit, configured to acquire a first distortion coefficient of a horizontal coordinate of a contour according to the distortion coefficient;

[0094] a seventh acquiring unit, configured to acquire a contour ordinate according to the first contour information;

[0095] an eighth acquiring unit, configured to acquire a second distortion coefficient of the vertical coordinate of the contour according to the distortion coefficient;

[0096] The third calculation unit is used to calculate the corrected horizontal coordinate according to the contour horizontal coordinate, the first distortion coefficient, the contour vertical coordinate and the second distortion coefficient. The calculation formula is:

[0097] x (u) =X+(2p1Y+p2(r 2 +2X 2 ));

[0098] Among them, x (u)is the correction horizontal coordinate, X is the profile horizontal coordinate, Y is the profile vertical coordinate, p1 is the first distortion coefficient, and p2 is the second distortion coefficient;

[0099] The fourth calculation unit is used to calculate the corrected ordinate according to the contour abscissa, the first distortion coefficient, the contour ordinate, and the second distortion coefficient. The calculation formula is:

[0100] y (u) =Y+(p1(r 2 +2Y 2 )+2p2X);

[0101] Among them, y (u) is the correction ordinate, X is the profile abscissa, Y is the profile ordinate, p1 is the first distortion coefficient, and p2 is the second distortion coefficient;

[0102] A ninth acquiring unit, configured to acquire a rotation angle value according to the corrected horizontal coordinate, the corrected vertical coordinate, and the contour horizontal coordinate and the contour vertical coordinate;

[0103] The tenth acquiring unit is configured to acquire a translation distance value according to the corrected horizontal coordinate, the corrected vertical coordinate, and the contour horizontal coordinate and the contour vertical coordinate based on a Euclidean distance calculation method.

[0104] The beneficial effects of the present application are as follows: the present invention can significantly improve the positioning accuracy of the laser marking system through precise distortion correction and coordinate transformation, and can significantly improve the accuracy of positioning and marking by using distortion coefficients to correct coordinates, calculate rotation angles and translation distances, etc. This ensures that during the marking process, the laser beam can be accurately focused on the target area, avoiding errors caused by inaccurate positioning, and by obtaining the scale feature information of the target image, extracting the coordinates of the effective edge points, and constructing preliminary contour information. Due to the distortion and noise that may exist during the image acquisition and transmission process, errors exist in the preliminary contour information. Therefore, by calculating the distortion value, the contour information is corrected, and the rotation angle and translation distance are obtained, thereby constructing the corrected contour information. Based on the corrected contour information, a virtual simulation mapping trajectory is constructed, which is the path that the laser marking equipment must follow. If the simulated mapping trajectory matches the actual path, the positioning is successful; otherwise, the correction and positioning operations are repeated until they match. BRIEF DESCRIPTION OF THE DRAWINGS

[0105] Figure 1 Schematic diagram of the method flow of this application.

[0106] Figure 2 This is a schematic diagram of the system structure of this application.

[0107] The realization of the objectives, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0108] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0109] like Figure 1 As shown, the present application provides a laser rapid marking positioning method, comprising:

[0110] S1. Obtain image scale feature information of the target image;

[0111] S2. Obtain multiple sets of valid edge point coordinates based on image scale feature information;

[0112] S3, obtaining first contour information of the target image according to multiple sets of valid edge point coordinates;

[0113] S4. Obtaining a distortion value of the target image according to the first contour information;

[0114] S5. Obtaining a rotation angle value and a translation distance value of the target image according to the distortion value;

[0115] S6. Correct the first contour information according to the rotation angle value and the translation distance value, and obtain corrected second contour information of the target image;

[0116] S7, obtaining the coordinates of the contour edge points according to the second contour information, and obtaining the simulated mapping trajectory according to the coordinates of the contour edge points;

[0117] S8, performing edge point positioning and matching on the target image based on the simulated mapping trajectory;

[0118] If they match, the target image is laser marked and positioned;

[0119] If there is no match, the second contour information is returned as the first contour information to the step of obtaining the distortion value of the target image according to the first contour information.

[0120] As described in the above steps S1-S8, existing laser rapid marking positioning methods, such as steps based on image scale feature information acquisition, determination of multiple sets of effective edge point coordinates, extraction and correction of contour information, have improved the positioning accuracy and efficiency of laser marking to a certain extent. However, these methods still have some defects and limitations in practical applications. First, although the image recognition technology based on machine vision can obtain the surface information and edge detection range of the target image, the reflection and energy loss of the laser on the surface of the object often lead to inaccurate marking. In addition, the distortion and distortion of the image will also affect the accuracy of edge detection, and thus affect the positioning accuracy of marking. Secondly, when dealing with workpieces with complex shapes and textures, the existing laser rapid marking positioning methods often find it difficult to obtain accurate edge point coordinates and contour information, making edge detection and contour extraction difficult. This is because complex shapes and textures can cause the edge features of the image to become blurred and difficult to identify, thereby affecting the accuracy of positioning;

[0121] The present invention obtains image scale feature information of a target image, including its basic size and edge point feature information. This information is then used to analyze the size and positional relationships of different image components, providing basic data for subsequent positioning operations. Multiple sets of valid edge point coordinates are then extracted based on this information. These edge point coordinates are key points in the image boundary or contour, and their location and number directly impact the accuracy and completeness of subsequent contour information. After obtaining these multiple sets of valid edge point coordinates, the first contour information of the target image is constructed based on this coordinate information. The first contour information is a preliminary description of the image boundary or outline, which includes basic information such as the shape and size of the outline. However, since the image may be affected by various factors during the acquisition and transmission process, such as camera lens distortion and image noise, the lens used by the laser marking equipment (such as the scanning galvanometer) may have certain distortions when acquiring the target image information, such as radial distortion (the image edge bends or expands toward the center) and tangential distortion (the image edge is distorted). These distortions will cause the image shape to be distorted. At the same time, if the optical axis of the scanning galvanometer is not precisely aligned or shifts during use, it will also cause the image to deform during the scanning process, often resulting in varying degrees of distortion. These distortions will directly affect the accuracy of the laser marking and, in turn, affect the quality of the final product, resulting in certain errors in the first contour information. To eliminate these errors, the distortion value of the target image is calculated based on the first contour information. The distortion value reflects the degree of difference between the image and the actual object. By calculating the distortion value, the first contour information can be corrected. After obtaining the distortion value, the rotation angle value and translation distance value of the target image can be calculated based on the distortion value. Finally, based on the corrected second contour information, the coordinates of the contour edge points are obtained, and a simulated mapping trajectory is constructed based on these coordinates. This simulated mapping trajectory is the path that the laser marking device will follow in actual operation. If the simulated mapping trajectory matches the actual laser marking path, positioning is successful. Otherwise, the second contour information is used as the first contour information and distortion correction and positioning operations are repeated until a matching simulated mapping trajectory is found.

[0122] In one embodiment, the step of obtaining multiple sets of valid edge point coordinates based on image scale feature information includes:

[0123] S201, obtaining real-time image width and real-time image height according to image scale feature information;

[0124] S202, obtaining an aspect ratio according to the real-time image width and the real-time image height;

[0125] S203, acquiring edge point feature information of the target image based on an optical flow method, wherein the edge point feature information includes edge point coordinate information and edge point direction information;

[0126] S204, obtaining an angle value between the edge point and a preset horizontal axis according to the edge point coordinate information and the edge point direction information;

[0127] S205, dividing the target image according to the angle value, the real-time image width, the real-time image height, and the aspect ratio to obtain a plurality of image division areas;

[0128] S206, obtaining the brightness value of the edge points in each image segmentation area;

[0129] S207, determining whether the brightness value of the edge point is less than a preset value;

[0130] If it is less than, the corresponding edge point will be removed;

[0131] If it is greater than, the corresponding edge point is determined to be a valid edge point;

[0132] S208 : Obtain the valid edge point coordinates corresponding to the valid edge points in all image division areas.

[0133] As described in the above steps S201-S208, the present invention obtains the size information of the image in real time through image acquisition, which can ensure that subsequent processing is based on the accurate image size. Then, the aspect ratio is obtained according to the real-time image width and the real-time image height, which avoids the inaccurate positioning caused by the change of the image shape. The image of the object to be marked can be captured in real time or on demand. Then, the edge point feature information of the target image is obtained based on the optical flow method, and the key features in the image (such as edges, corners, etc.) are extracted. The angle value between the edge point and the preset horizontal coordinate axis is obtained according to the edge point coordinate information and the edge point direction information. First, the edge points of the image to be processed are obtained by image processing technology (such as edge detection algorithm). These edge points usually contain position information (i.e., edge point coordinate information) and edge point direction information. The edge point direction information can be obtained by the gradient direction, which represents the trend of image brightness change at the edge point. For example: a pair of adjacent edge points A(x A ,y A ) and B(x B ,y B ), calculate the vector between them, the vector calculation formula is: v = (x2-x1, y2-y1), calculate the vector of edge point A (v A ) and the vector of edge point B (v B ), then according to The calculated θ is the angle value between adjacent edge points. The angle value of the edge point reflects the local direction and trend of the edge in the image. Then, according to the real-time image width and real-time image height, the actual size of the image is obtained. The edge point direction information is used as a guide to perform region division along the main edge direction. The angle value is used to determine whether the edge points are in the same range, and the points in the same range are divided into the same region. Ensure that the divided regions are consistent with the main feature direction of the image, which can more accurately describe the spatial distribution and shape characteristics of the edge points. Then, the brightness values ​​of all edge points in each divided region are obtained, and all edge points therein are obtained. Their brightness values ​​in the image are assumed to be 100. For each edge point, if its brightness value is less than 100, it is considered that this edge point may be caused by noise or shadow and needs to be removed.

[0134] In one embodiment, the step of acquiring first contour information of the target image according to multiple sets of valid edge point coordinates includes:

[0135] S301, obtaining multiple horizontal coordinates and multiple vertical coordinates according to each group of edge point coordinates;

[0136] S302, obtaining the edge point direction angle according to the horizontal coordinate and the vertical coordinate;

[0137] S303: Tracing the contour of each edge point coordinate according to the edge point direction angle to obtain first contour information.

[0138] As described in the above steps S301-S303, the present invention obtains multiple horizontal coordinates and multiple vertical coordinates based on each group of edge point coordinates, locates the edge points in the image through edge detection algorithms (such as Canny, Sobel, etc.), and these edge points have specific horizontal coordinates (x) and vertical coordinates (y). Then, the two adjacent edge points are regarded as the starting point and end point of the vector, and the vector can be calculated through the coordinates of these two points. For example, if the coordinates of the first edge point are (x1, y1) and the coordinates of the second edge point are (x2, y2), then the vector between the two points can be expressed as (x2-x1, y2-y1). By calculating the angle between two adjacent vectors (the angle between adjacent vectors can be calculated using the angle calculation formula (such as the dot product formula, the cosine theorem, etc.), the direction change of the edge point can be determined. This angle can reflect the degree of curvature or direction change of the edge line. The horizontal and vertical coordinates can be directly obtained through the edge point coordinates, which can clearly indicate the position of the edge point in two-dimensional space. According to the calculated edge point direction angle, each edge point is tracked to construct the outline of the image. By calculating the direction angle, the relative direction between the edge points can be understood and tracked. The process usually starts from a selected starting edge point, and then moves to the next edge point along the direction of the edge line (that is, the indicated direction of the edge point direction angle). When moving to the next edge point, the coordinates and direction angle information of the current edge point, as well as the expected position of the next edge point (obtained by prediction or search) are used to determine the tracking path. The above process is repeated until all edge points are tracked or the tracking path meets certain termination conditions (such as returning to the starting point, reaching the maximum tracking length, etc.), so as to understand the trend of the edge. The change in the direction angle of adjacent edge points can reflect the continuity and smoothness of the edge. By tracking the coordinates of the edge points, the contour information of the image can be fully obtained. Tracking based on the direction angle can more accurately depict the shape of the contour.

[0139] In one embodiment, the step of obtaining the distortion value of the target image according to the first contour information includes:

[0140] S401, obtaining a maximum outline width value and a maximum outline height value according to first outline information;

[0141] S402, obtaining a preset characteristic coefficient;

[0142] S403, obtaining a preset outline width and a preset outline height;

[0143] S404: Calculate the contour edge variation coefficient based on the contour width, contour height, and preset characteristic coefficients. The calculation formula is:

[0144]

[0145] Among them, Q is the contour edge variation coefficient, ρ is the preset feature coefficient, k x is the contour width, k y is the profile height, i is the preset profile width, and j is the preset profile height;

[0146] S405 , obtaining a scale value of the first contour information according to the maximum contour width value and the maximum contour height value;

[0147] S406: Calculate the distortion value based on the contour edge variation coefficient and the scale value. The calculation formula is:

[0148] f (x,y) =Q*L(x,y);

[0149] Among them, f (x,y) is the distortion value, Q is the contour edge variation coefficient, and L(x, y) is the scale value.

[0150] As described in steps S401-S406 above, the present invention can accurately obtain the maximum width value of the contour (the maximum width value of the contour refers to the distance between the two farthest points in the horizontal direction on the projection (or simplified representation) of the contour. Each point of the contour is projected onto the horizontal axis (x-axis) to obtain a series of horizontal coordinate values. Among these horizontal coordinate values, the minimum value and the maximum value are found. They correspond to the leftmost and rightmost points of the contour in the horizontal direction, respectively. The difference between the maximum value and the minimum value is the maximum width value of the contour) and the maximum height value (the maximum height value of the contour refers to the distance between the two farthest points in the vertical direction on the projection (or simplified representation) of the contour. Each point of the contour is projected onto the vertical axis (y-axis) to obtain a series of vertical coordinate values. Among these vertical coordinate values, the minimum value and the maximum value are found. They correspond to the topmost and bottommost points of the contour in the vertical direction, respectively. The difference between the maximum value and the minimum value is the maximum height value of the contour) by directly analyzing the boundary of the contour, and then obtain the preset feature coefficient. The preset feature coefficient can be used according to different application scenarios. For example, when evaluating whether a product's contour meets preset quality standards, preset feature coefficients can be adjusted based on the product's design specifications and allowable error range. Contour points are projected onto the horizontal (x-axis) and vertical (y-axis) axes. The minimum and maximum values ​​of the horizontal and vertical coordinates are found, respectively. The difference between the maximum and minimum values ​​is the maximum width or height of the contour in that direction. The minimum rectangle (bounding box) containing the contour is then calculated, and its width and height are the maximum width and maximum height of the contour. The scale value is then calculated by combining the contour's area, perimeter, and the ratio of the maximum width to the maximum height. If small changes in the product's contour have little impact on performance, the feature coefficient can be set to a lower value to reduce sensitivity to contour distortion. Conversely, if the accuracy of the product's contour is critical to performance (such as in precision instruments or medical devices), the feature coefficient should be set to a higher value to more accurately detect any possible distortion. In shape recognition applications, preset feature coefficients can be used to adjust the algorithm's emphasis on different shape features. For example, when recognizing handwritten digits, certain stroke features (such as curvature and length) may be more important than others. By adjusting the feature coefficients, the algorithm can be made to pay more attention to these key features, thereby improving the accuracy of recognition. Assuming that the contour width k obtained from the first contour information is x is 100 units, the contour height k y is 50 units, ρ is 0.01, i is 150 units, j is 75 units, L(x, y) is 75 (preset constant), according to The calculated Q is 0.05, according to Q*L (x,y) Calculate f (x,y) is 3.75.

[0151] In one embodiment, the step of obtaining a rotation angle value and a translation distance value of the target image according to the distortion value includes:

[0152] S501, obtaining a contour horizontal coordinate according to first contour information;

[0153] S502, obtaining a first distortion coefficient of the contour horizontal coordinate according to the distortion coefficient;

[0154] S503, obtaining the contour ordinate according to the first contour information;

[0155] S504, obtaining a second distortion coefficient of the vertical coordinate of the contour according to the distortion coefficient;

[0156] S505: Calculate the corrected abscissa according to the contour abscissa, the first distortion coefficient, the contour ordinate, and the second distortion coefficient. The calculation formula is:

[0157] x (u) =X+(2p1Y+p2(r 2 +2X 2 ));

[0158] Among them, x (u) is the correction horizontal coordinate, X is the profile horizontal coordinate, Y is the profile vertical coordinate, p1 is the first distortion coefficient, and p2 is the second distortion coefficient;

[0159] S506: Calculate the corrected ordinate according to the contour abscissa, the first distortion coefficient, the contour ordinate, and the second distortion coefficient. The calculation formula is:

[0160] y (u) =Y+(p1(r 2 +2Y 2 )+2p2X);

[0161] Among them, y (u) is the correction ordinate, X is the profile abscissa, Y is the profile ordinate, p1 is the first distortion coefficient, and p2 is the second distortion coefficient;

[0162] S507, obtaining a rotation angle value according to the corrected horizontal coordinate, the corrected vertical coordinate, and the contour horizontal coordinate and the contour vertical coordinate;

[0163] S508 , obtaining a translation distance value according to the corrected horizontal coordinate, the corrected vertical coordinate, and the contour horizontal coordinate and the contour vertical coordinate based on the Euclidean distance calculation method.

[0164] As described in the above steps S501-S508, the present invention obtains the contour horizontal coordinate based on the first contour information. In image processing, the image is first subjected to edge detection or contour extraction to obtain the contour information of the target object. Then, we can traverse these contour points to obtain the horizontal coordinate (X) and vertical coordinate (Y) of each point, and then obtain the first distortion coefficient of the contour horizontal coordinate based on the distortion coefficient. The distortion coefficient is usually obtained by camera calibration. For radial distortion, we usually have two coefficients: k1 (the first radial distortion coefficient, the corresponding first distortion coefficient is found by a table lookup method based on the contour horizontal coordinate (i.e., the X coordinate of the point)) and k2 (the second radial distortion coefficient, the corresponding second distortion coefficient is found by a table lookup method based on the contour horizontal coordinate (i.e., the Y coordinate of the point), and the second distortion coefficient is obtained by X+(2p1Y+p2(r 2 +2X 2 )) and Y+(p1(r 2 +2Y 2 )+2p2X) to obtain the corrected coordinates, and then for each contour point, calculate the offset between its corrected coordinates and the original coordinates, which includes the offset of the horizontal coordinate (corrected horizontal coordinate-contour horizontal coordinate) and the offset of the vertical coordinate (corrected vertical coordinate-contour vertical coordinate), and obtain the translation distance. If the offset of the entire contour has a consistent tendency in the horizontal coordinate direction (for example, all offset to the right), it may mean that the image needs to be rotated to the left by a certain angle for correction, and vice versa. After that, the coordinate changes of all points on the contour can be considered through least squares method, principal component analysis (PCA) or other optimization algorithms, and the best fitting rotation angle can be calculated. After the rotation angle is calculated, it can be applied to the transformation of the contour coordinates to eliminate the positioning error caused by image rotation distortion, and the rotation angle and translation distance can be obtained. For example, we have the values ​​of p1 and p2, and a point (X1, Y1) on the contour. We use the correction formula y(u) = Y1 + (p1*(r2+2Y1^2)+2p2*X1) to calculate the corrected vertical coordinate y(u), where r is the distance from the point to the center of the image. Comparing the contours before and after correction, we find that the contour has a small rotation on the image plane. By calculating the direction change of the main axis, we get the rotation angle θ. The coordinates of all points in the horizontal and vertical coordinates of the original contour are (X1, Y1), (X2, Y2), ..., (Xn, Yn). For each point (Xi, Yi), the transformation of rotation θ and translation d is applied to obtain the new coordinates (Xi', Yi'). Connect (X1', Y1'), (X2', Y2'), ..., (Xn', Yn') to form the corrected contour.

[0165] In one embodiment, the step of correcting the first contour information according to the rotation angle value and the translation distance value and obtaining the corrected second contour information of the target image includes:

[0166] S601, obtaining contour abscissas and ordinates of a plurality of contour points according to first contour information;

[0167] S602, transforming the contour abscissa and contour ordinate of each contour point based on the rotation angle value and the translation distance value to obtain a corresponding contour correction point;

[0168] S603: Connect all contour correction points to obtain second contour information.

[0169] As described in the above steps S601-S603, the present invention obtains the scale feature information of the image, so that the system can more accurately identify the key elements in the image, and then obtains multiple groups of valid edge point coordinates based on the image scale feature information. By extracting these coordinates, the contour of the target image can be constructed for subsequent distortion correction and positioning. Then, the first contour information of the target image is obtained based on the multiple groups of valid edge point coordinates. By obtaining the first contour information, the basic shape and position of the target image can be understood. Then, the distortion value of the target image is obtained based on the first contour information. By obtaining the distortion value, the distortion of the image can be understood for subsequent distortion correction. By obtaining the rotation angle value and the translation distance value, the corrected image position can be calculated. The corrected contour information is more accurate and can better reflect the actual position of the target image.

[0170] In one embodiment, the step of obtaining the coordinates of the contour edge points according to the second contour information and obtaining the simulated mapping trajectory according to the coordinates of the contour edge points includes:

[0171] S701, acquiring a plurality of contour correction point information according to the second contour information, wherein the contour correction point information includes a contour correction horizontal coordinate and a contour correction vertical coordinate;

[0172] S702, obtaining the distance value between the scanning galvanometer and the target image;

[0173] S703, mapping all the contour edge point coordinates to a three-dimensional space based on the distance value to obtain a plurality of three-dimensional coordinates;

[0174] S704, establishing a contour simulation image according to the multiple three-dimensional coordinates;

[0175] S705, obtaining coordinates of multiple 3D contour edge points according to the contour simulation image;

[0176] S706 , obtaining a connection sequence of tracking edge points based on the coordinates of multiple 3D contour edge points;

[0177] S707, marking the coordinates of all contour edge points based on the connection sequence of the tracked edge points;

[0178] S708 : Obtain a simulated mapping trajectory based on the marking process.

[0179] As described in steps S701-S708 above, the present invention obtains the coordinates of the contour edge points based on the second contour information and obtains a simulated mapping trajectory based on the contour edge point coordinates. The simulated mapping trajectory is the actual path of the laser marking. By obtaining this trajectory, it is possible to ensure that the laser marks along the correct path, thereby improving the accuracy and efficiency of the marking. Multiple contour edge point coordinates are obtained based on the second contour information. The edge point coordinates are extracted from the corrected second contour information. These coordinates represent the precise boundary of the marking area, avoiding the inaccurate positioning caused by directly using the original contour information, which may contain distortion. The distance value between the scanning galvanometer and the target image is then obtained. The distance value is a key parameter in the laser marking system, which determines the position where the laser beam is focused on the object. Obtaining this value ensures that the laser beam is correctly focused on the target area. The distance value is mapped into three-dimensional space to establish a three-dimensional coordinate system. The origin of this three-dimensional coordinate system can be set at the position of the scanning galvanometer. The z-axis is perpendicular to the image plane and points to the object to be marked. For each contour edge point (x, y) on the two-dimensional image plane, the x and y coordinates of its three-dimensional coordinates remain unchanged, while the z coordinate is set to the distance value from the galvanometer to the target image. Therefore, each two-dimensional coordinate (x, y) is mapped to a three-dimensional coordinate (x, y, z), where z is a fixed distance value. Entering the two-dimensional coordinates into three-dimensional space can then provide more complete spatial information, helping to more accurately control the motion path of the laser beam. Two-dimensional coordinates only provide planar information and cannot reflect the actual position of the object in three-dimensional space, while three-dimensional coordinates can more accurately reflect the actual situation. The simulated image can help operators more intuitively understand the shape and position of the marking area in three-dimensional space, which helps to perform more precise marking operations. Extracting the coordinates of the contour edge points from the simulated image again can ensure that these coordinates are based on the latest, corrected simulated image. Tracking the time series of edge points can help the system understand the movement of edge points in real time during the marking process, thereby ensuring that the laser beam always follows the target edge. The marking process can help the system distinguish the coordinates of edge points at different time points, thereby more accurately controlling the motion path of the laser beam. The simulated mapping trajectory is the final path of the laser marking. It is based on the data and calculations of all previous steps and has a high degree of accuracy and reliability. Assume that after distortion correction, we obtain the second contour information, which describes the shape of the metal part. From this contour information, multiple contour edge point coordinates are extracted, such as (x1, y1), (x2, y2), ..., (xn, yn). In the laser marking equipment, the scanning galvanometer is responsible for controlling the direction of the laser beam. A sensor or measuring tool is used to obtain the distance value from the scanning galvanometer to the surface of the metal part, such as 50 mm. The two-dimensional contour edge point coordinates are then mapped into three-dimensional space.Assuming our marking system is a simple vertical marking system, the 3D coordinates simply add the z-axis value, for example, (x1, y1, 50), (x2, y2, 50), ..., (xn, yn, 50). Using these 3D coordinates, we can construct a 3D contour image on a computer. This image will show the shape and position of the metal part in 3D space. During the marking process, it may be necessary to track the position changes of edge points to ensure that the laser beam consistently follows the edge of the part. Assuming our marking process is continuous, we can record the edge point coordinates at each time point, forming a time series, for example, t1: (x1_t1, y1_t1, 50), t2: (x2_t2, y2_t2, 50), .... Finally, based on these marked coordinates, we can simulate the laser beam's trajectory on a computer. This simulated trajectory will serve as a reference path for the actual marking process, ensuring that the laser beam consistently follows the intended path.

[0180] like Figure 2 As shown, the present invention also discloses a laser rapid marking and positioning system, which is characterized by comprising:

[0181] The first acquisition module 1 is used to obtain image scale feature information of the target image;

[0182] The second acquisition module 2 is used to obtain multiple groups of valid edge point coordinates according to the image scale feature information;

[0183] A third acquisition module 3 is used to acquire first contour information of the target image according to multiple sets of valid edge point coordinates;

[0184] A fourth acquisition module 4 is configured to acquire a distortion value of the target image according to the first contour information;

[0185] A fifth acquisition module 5 is used to calculate the rotation angle value and the translation distance value of the target image according to the distortion value;

[0186] A sixth acquisition module 6 is configured to correct the first contour information according to the rotation angle value and the translation distance value, and obtain corrected second contour information of the target image;

[0187] A seventh acquisition module 7 is configured to acquire the coordinates of the contour edge points according to the second contour information, and to acquire a simulated mapping trajectory according to the coordinates of the contour edge points;

[0188] A judgment module 8 is used to locate and match edge points of the target image based on the simulated mapping trajectory;

[0189] If they match, the target image is laser marked and positioned;

[0190] If there is no match, the second contour information is returned as the first contour information to the step of obtaining the distortion value of the target image according to the first contour information.

[0191] In one embodiment, the fourth acquisition module 4 includes:

[0192] A first acquiring unit, configured to acquire a maximum outline width value and a maximum outline height value according to the first outline information;

[0193] A second acquiring unit, configured to acquire a preset characteristic coefficient;

[0194] A third obtaining unit is used to obtain a preset outline width and a preset outline height;

[0195] The first calculation unit is used to calculate the contour edge variation coefficient according to the contour width, contour height and preset characteristic coefficient. The calculation formula is:

[0196]

[0197] Among them, Q is the contour edge variation coefficient, ρ is the preset feature coefficient, k x is the contour width, k y is the profile height, i is the preset profile width, and j is the preset profile height;

[0198] a fourth acquiring unit, configured to acquire a scale value of the first contour information according to the maximum contour width value and the maximum contour height value;

[0199] The second calculation unit is used to calculate the distortion value according to the contour edge variation coefficient and the scale value. The calculation formula is:

[0200] f (x,y) =Q*L (x,y) ;

[0201] Among them, f (x,y) is the distortion value, Q is the contour edge variation coefficient, L (x,y) is the scale value.

[0202] In one embodiment, the fifth acquisition module 5 includes:

[0203] a fifth acquiring unit, configured to acquire a contour horizontal coordinate according to the first contour information;

[0204] a sixth acquiring unit, configured to acquire a first distortion coefficient of a horizontal coordinate of a contour according to the distortion coefficient;

[0205] a seventh acquiring unit, configured to acquire a contour ordinate according to the first contour information;

[0206] an eighth acquiring unit, configured to acquire a second distortion coefficient of the vertical coordinate of the contour according to the distortion coefficient;

[0207] The third calculation unit is used to calculate the corrected horizontal coordinate according to the contour horizontal coordinate, the first distortion coefficient, the contour vertical coordinate and the second distortion coefficient. The calculation formula is:

[0208] x (u) =X+(2p1Y+p2(r 2 +2X 2 ));

[0209] Among them, x (u) is the correction horizontal coordinate, X is the profile horizontal coordinate, Y is the profile vertical coordinate, p1 is the first distortion coefficient, and p2 is the second distortion coefficient;

[0210] The fourth calculation unit is used to calculate the corrected ordinate according to the contour abscissa, the first distortion coefficient, the contour ordinate, and the second distortion coefficient. The calculation formula is:

[0211] y (u) =Y+(p1(r 2 +2Y 2 )+2p2X);

[0212] Among them, y (u) is the correction ordinate, X is the profile abscissa, Y is the profile ordinate, p1 is the first distortion coefficient, and p2 is the second distortion coefficient;

[0213] A ninth acquiring unit, configured to acquire a rotation angle value according to the corrected horizontal coordinate, the corrected vertical coordinate, and the contour horizontal coordinate and the contour vertical coordinate;

[0214] The tenth acquiring unit is configured to acquire a translation distance value according to the corrected horizontal coordinate, the corrected vertical coordinate, and the contour horizontal coordinate and the contour vertical coordinate based on a Euclidean distance calculation method.

[0215] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in this application and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct RAMbus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM).

[0216] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, apparatus, article, or method comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, apparatus, article, or method. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, apparatus, article, or method comprising the element.

[0217] The above description is only a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A laser rapid marking and positioning method, characterized in that: include: Obtaining image scale feature information of the target image; Obtain multiple sets of valid edge point coordinates based on image scale feature information; Acquire first contour information of the target image according to multiple groups of valid edge point coordinates; Obtaining a distortion value of the target image according to the first contour information; Calculate the rotation angle value and translation distance value of the target image according to the distortion value; Correcting the first contour information according to the rotation angle value and the translation distance value, and obtaining the corrected second contour information of the target image; Acquire the coordinates of the contour edge points according to the second contour information, and acquire the simulated mapping trajectory according to the coordinates of the contour edge points; Perform edge point positioning and matching on the target image based on the simulated mapping trajectory; If they match, the target image is laser marked and positioned; If there is no match, the second contour information is returned as the first contour information to the step of obtaining the distortion value of the target image according to the first contour information; The step of obtaining the distortion value of the target image according to the first contour information includes: Acquire a maximum width value and a maximum height value of the contour according to the first contour information; Get preset characteristic coefficients; Get the preset outline width and preset outline height; The contour edge variation coefficient is calculated based on the contour width, contour height and preset characteristic coefficient. The calculation formula is: ; Among them, Q is the contour edge variation coefficient, ρ is the preset feature coefficient, k x is the contour width, k y is the profile height, i is the preset profile width, and j is the preset profile height; Obtaining a scale value of the first contour information according to the maximum contour width value and the maximum contour height value; The distortion value is calculated based on the contour edge variation coefficient and scale value. The calculation formula is: f (x, y) =Q * L (x, y) ; Among them, f (x, y) is the distortion value, Q is the contour edge variation coefficient, L (x, y) is the scale value; The step of obtaining a rotation angle value and a translation distance value of the target image according to the distortion value comprises: Acquire a contour horizontal coordinate according to the first contour information; Obtaining a first distortion coefficient of the contour horizontal coordinate according to the distortion coefficient; Acquire the contour ordinate according to the first contour information; Obtaining a second distortion coefficient of the contour ordinate according to the distortion coefficient; The corrected abscissa is calculated based on the contour abscissa, the first distortion coefficient, the contour ordinate, and the second distortion coefficient. The calculation formula is: x (u) =X+(2p1Y+p2 (r 2 +2X 2 )); Among them, x (u) is the correction horizontal coordinate, X is the profile horizontal coordinate, Y is the profile vertical coordinate, p1 is the first distortion coefficient, and p2 is the second distortion coefficient; The corrected ordinate is calculated based on the profile abscissa, the first distortion coefficient, the profile ordinate, and the second distortion coefficient. The calculation formula is: <h2 style=";text-align:left;direction:ltr">y<h2 style=";text-align:left;direction:ltr"> (u) <h2 style=";text-align:left;direction:ltr"> =Y+(p1(r<h2 style=";text-align:left;direction:ltr"> 2 <h2 style=";text-align:left;direction:ltr"> +2Y<h2 style=";text-align:left;direction:ltr"> 2 <h2 style=";text-align:left;direction:ltr"> )+2p2X); Among them, y (u) is the correction ordinate, X is the profile abscissa, Y is the profile ordinate, p1 is the first distortion coefficient, and p2 is the second distortion coefficient; Obtain the rotation angle value according to the correction horizontal coordinate, the correction vertical coordinate, the contour horizontal coordinate, and the contour vertical coordinate; The translation distance value is obtained according to the corrected horizontal coordinate, the corrected vertical coordinate, the contour horizontal coordinate, and the contour vertical coordinate based on the Euclidean distance calculation method.

2. The laser rapid marking and positioning method according to claim 1, characterized in that: The step of obtaining multiple sets of valid edge point coordinates based on image scale feature information includes: Obtaining real-time image width and real-time image height according to image scale feature information; Get the aspect ratio value according to the real-time image width and the real-time image height; Acquire edge point feature information of the target image based on the optical flow method, wherein the edge point feature information includes edge point coordinate information and edge point direction information; Obtaining the angle between the edge point and the preset horizontal axis according to the edge point coordinate information and the edge point direction information; Divide the target image according to the angle value, the real-time image width, the real-time image height and the aspect ratio to obtain multiple image division areas; Get the brightness value of the edge points in each image division area; Determine whether the brightness value of the edge point is less than the preset value; If it is less than, the corresponding edge point will be removed; If it is greater than, the corresponding edge point is determined to be a valid edge point; Get the valid edge point coordinates corresponding to the valid edge points in all image division areas.

3. The laser rapid marking and positioning method according to claim 1, characterized in that: The step of obtaining first contour information of the target image according to multiple sets of valid edge point coordinates includes: Obtain multiple horizontal coordinates and multiple vertical coordinates according to each set of edge point coordinates; Get the edge point direction angle according to the horizontal and vertical coordinates; The contour of each edge point coordinate is traced according to the edge point direction angle to obtain first contour information.

4. The laser rapid marking and positioning method according to claim 1, characterized in that: The step of correcting the first contour information according to the rotation angle value and the translation distance value, and obtaining the corrected second contour information of the target image, comprises: Acquire contour abscissas and ordinates of a plurality of contour points according to the first contour information; Based on the rotation angle value and the translation distance value, the contour horizontal coordinate and the contour vertical coordinate of each contour point are transformed to obtain the corresponding contour correction point; All contour correction points are connected to obtain the second contour information.

5. The laser rapid marking and positioning method according to claim 1, characterized in that: The step of obtaining the coordinates of the contour edge points according to the second contour information and obtaining the simulated mapping trajectory according to the coordinates of the contour edge points includes: Acquire a plurality of contour correction point information according to the second contour information, wherein the contour correction point information includes a contour correction horizontal coordinate and a contour correction vertical coordinate; Get the distance value from the scanning galvanometer to the target image; Based on the distance value, all the contour edge point coordinates are mapped into the three-dimensional space to obtain multiple three-dimensional coordinates; Establishing a contour simulation image according to a plurality of three-dimensional coordinates; Acquire multiple three-dimensional contour edge point coordinates according to the contour simulation image; Obtaining a connection sequence of tracking edge points based on multiple three-dimensional contour edge point coordinates; Mark the coordinates of all contour edge points based on the connection sequence of tracked edge points; The simulated mapping trajectory is obtained based on the labeling process.

6. A laser rapid marking and positioning system, characterized in that: include: A first acquisition module is used to acquire image scale feature information of a target image; The second acquisition module is used to obtain multiple groups of valid edge point coordinates according to the image scale feature information; A third acquisition module is used to acquire first contour information of the target image according to multiple groups of valid edge point coordinates; a fourth acquisition module, configured to acquire a distortion value of the target image according to the first contour information; A fifth acquisition module is used to calculate the rotation angle value and the translation distance value of the target image according to the distortion value; a sixth acquisition module, configured to correct the first contour information according to the rotation angle value and the translation distance value, and obtain corrected second contour information of the target image; a seventh acquisition module, configured to acquire the coordinates of the contour edge points according to the second contour information, and to acquire the simulated mapping trajectory according to the coordinates of the contour edge points; A judgment module, used for locating and matching edge points of a target image based on a simulated mapping trajectory; If they match, the target image is laser marked and positioned; If there is no match, the second contour information is returned as the first contour information to the step of obtaining the distortion value of the target image according to the first contour information; The step of obtaining the distortion value of the target image according to the first contour information includes: Acquire a maximum width value and a maximum height value of the contour according to the first contour information; Get the preset characteristic coefficient; Get the preset outline width and preset outline height; The contour edge variation coefficient is calculated based on the contour width, contour height and preset characteristic coefficient. The calculation formula is: ; Among them, Q is the contour edge variation coefficient, ρ is the preset feature coefficient, k x is the contour width, k y is the profile height, i is the preset profile width, and j is the preset profile height; Obtaining a scale value of the first contour information according to the maximum contour width value and the maximum contour height value; The distortion value is calculated based on the contour edge variation coefficient and scale value. The calculation formula is: f (x, y) =Q * L (x, y) ; Among them, f (x, y) is the distortion value, Q is the contour edge variation coefficient, L (x, y) is the scale value; The step of obtaining a rotation angle value and a translation distance value of the target image according to the distortion value comprises: Acquire a contour horizontal coordinate according to the first contour information; Obtaining a first distortion coefficient of the contour horizontal coordinate according to the distortion coefficient; Acquire the contour ordinate according to the first contour information; Obtaining a second distortion coefficient of the contour ordinate according to the distortion coefficient; The corrected abscissa is calculated based on the contour abscissa, the first distortion coefficient, the contour ordinate, and the second distortion coefficient. The calculation formula is: x (u) =X+(2p1Y+p2 (r 2 +2X 2 )); Among them, x (u) is the correction horizontal coordinate, X is the profile horizontal coordinate, Y is the profile vertical coordinate, p1 is the first distortion coefficient, and p2 is the second distortion coefficient; The corrected ordinate is calculated based on the profile abscissa, the first distortion coefficient, the profile ordinate, and the second distortion coefficient. The calculation formula is: <h2 style=";text-align:left;direction:ltr">y<h2 style=";text-align:left;direction:ltr"> (u) <h2 style=";text-align:left;direction:ltr"> =Y+(p1(r<h2 style=";text-align:left;direction:ltr"> 2 <h2 style=";text-align:left;direction:ltr"> +2Y<h2 style=";text-align:left;direction:ltr"> 2 <h2 style=";text-align:left;direction:ltr"> )+2p2X); Among them, y (u) is the correction ordinate, X is the profile abscissa, Y is the profile ordinate, p1 is the first distortion coefficient, and p2 is the second distortion coefficient; Obtain the rotation angle value according to the correction horizontal coordinate, the correction vertical coordinate, the contour horizontal coordinate, and the contour vertical coordinate; The translation distance value is obtained according to the corrected horizontal coordinate, the corrected vertical coordinate, the contour horizontal coordinate, and the contour vertical coordinate based on the Euclidean distance calculation method.

Citation Information

Patent Citations

  • Calibration method and device used for laser processing system

    CN104439698A

  • Circular workpiece plane coordinate high-precision positioning method based on machine vision

    CN113592955A