A vision-based method and system for laser engraving path planning of irregularly shaped materials
Patent Information
- Application Number
- CN202610710263.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-22
- Publication Date
- 2026-08-14
AI Technical Summary
[0004]一般的异形材料激光雕刻路径规划方法中,只做轮廓平移、旋转及缩放,无视木纹、石纹、皮革纹理、天然肌理,雕刻后图案割裂、破坏天然质感
[0059]本发明中通过视觉检测同步获取材料外轮廓、天然纹理走向及纹理缺陷区域,以材料自身的天然纹理特征作为核心约束条件,智能调控雕刻图形模板的摆放姿态、排布密度与缩放比例,让雕刻图案的轮廓、走向与材料天然肌理高度契合,同时自动规避缺陷区域规划激光雕刻路径,使整条雕刻路径完全贴合材料的天然形态与纹理脉络。该方案彻底打破了传统激光雕刻图案与天然材料形态割裂、适配性差的行业痛点,摒弃生硬的模板套用模式,真正实现雕刻图案与材料天然肌理、自然形态的有机美学融合,既完整保留了天然材料的原生质感与独特艺术韵味,又让激光雕刻工艺与自然美学深度结合,显著提升异形天然纹理材料雕刻成品的艺术价值、美观度与成品品质。
Smart Images

Figure CN122574080A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of laser engraving technology, specifically a method and system for laser engraving path planning of irregularly shaped materials based on visual inspection. Background Technology
[0002] Laser engraving technology originated after the invention of the laser in the 1960s. It is an advanced manufacturing technology that utilizes the interaction between a high-energy-density laser beam and materials to achieve non-contact processing. Its development has spanned from laboratory to industrial applications: early applications primarily used carbon dioxide lasers for industrial marking and cutting; breakthroughs in fiber laser technology in the mid-to-late 1990s significantly improved engraving precision and efficiency, driving the technology's adoption in civilian sectors; since the 21st century, the emergence of femtosecond / picosecond ultrafast lasers has enabled a "cold processing" mode, solving the problem of large heat-affected zones in traditional lasers and making sub-micron precision engraving possible. This technology is based on the principles of melting, vaporization, or photochemical reactions between lasers and materials. It uses an optical system to focus energy and coordinates motion control to achieve precise engraving of complex patterns. Today, laser engraving is widely used in decoration, printing and packaging, electronic communications, automotive manufacturing, and medical devices. With its advantages of being non-contact, consumable-free, highly precise, and environmentally friendly, it has become one of the core technologies of modern manufacturing and personalized customization, and is continuously evolving towards three-dimensional engraving and intelligent adaptive processing.
[0003] Laser engraving path planning, as a core component of laser processing, is closely related to the development of laser engraving equipment, the upgrading of manufacturing demands, and the advancement of algorithm theory. Early path planning primarily employed simple linear scanning and fixed interpolation strategies, based on the G-code interpreter of traditional CNC systems, which struggled to meet the demands of complex patterns and high-efficiency processing. With the increasing demands for processing efficiency, quality, and cost from personalized customization and precision manufacturing, path planning has gradually focused on three core objectives: shortest travel distance, minimal overlapping engraving, and optimal energy distribution, to address issues such as long processing times, material overheating, and edge burrs.
[0004] In general laser engraving path planning methods for irregularly shaped materials, only contour translation, rotation, and scaling are performed, ignoring wood grain, stone grain, leather texture, and natural texture. As a result, the engraved pattern is fragmented and the natural texture is destroyed. Summary of the Invention
[0005] To overcome the shortcomings of existing technologies, the present invention proposes a vision-based laser engraving path planning method and system for irregularly shaped materials. This method is mainly used to solve the problem that general laser engraving path planning methods for irregularly shaped materials only perform contour translation, rotation, and scaling, ignoring wood grain, stone grain, leather texture, and natural texture.
[0006] The technical solution adopted by this invention to solve its technical problem is:
[0007] A vision-based laser engraving path planning method for irregularly shaped materials includes:
[0008] S1: Visual image acquisition and preprocessing of irregularly shaped materials to obtain standardized texture visual images;
[0009] S2: Based on standardized texture visual images, extract material outer contour features, natural texture features, and defect area features to construct a material feature dataset;
[0010] S3: Construct matching rules based on natural texture features, complete the adaptive alignment of the sculpted graphic template and the irregular material, and output the alignment result;
[0011] S4: Combine the alignment results with the material's outer contour features to plan and generate the initial laser engraving path;
[0012] S5: Verify and optimize the initial laser engraving path, output the final laser engraving path, and execute the engraving.
[0013] According to the vision-based laser engraving path planning method for irregularly shaped materials provided by the present invention, step S1, the step of obtaining a standardized texture visual image includes:
[0014] S11: Capture images of the irregularly shaped material from multiple angles to obtain multiple frames of original texture images;
[0015] S12: Preprocess the original texture image by sequentially performing denoising, grayscale conversion, size normalization, and image enhancement, and output the enhanced texture image.
[0016] S13: The enhanced texture image is fused, and an image stitching algorithm is used to eliminate overlapping areas of images acquired from multiple angles, generating a complete and clear standardized texture visual image.
[0017] According to the vision-based detection-based laser engraving path planning method for irregularly shaped materials provided by the present invention, step S2, the step of constructing a material feature dataset, includes:
[0018] S21: Based on the edge detection algorithm, the standardized texture visual image is edge extracted. After removing false edges, the contour tracking algorithm is used to obtain the coordinates of continuous pixels of the material's outer contour. The perimeter, area, curvature and feature corner points of the outer contour are calculated to obtain the outer contour feature vector.
[0019] S22: Extract the texture roughness, texture direction, texture contrast and texture uniformity of the natural texture on the surface of the irregular material respectively, and construct a multi-dimensional natural texture feature vector;
[0020] S23: Segment the standardized texture visual image, identify defect areas on the material surface containing scratches, dents, and color differences, extract the location coordinates, area, shape, and defect level of the defect areas, and construct a defect feature vector;
[0021] S24: Normalize the outer contour feature vector, natural texture feature vector, and defect feature vector to obtain the material feature dataset.
[0022] According to the vision-based laser engraving path planning method for irregularly shaped materials provided by the present invention, step S23, the step of constructing the defect feature vector, includes:
[0023] S231: An adaptive threshold segmentation algorithm is used to segment the standardized texture visual image into regions, dividing the image into background regions, normal material regions, and defect candidate regions. Background regions and normal material regions are excluded, while defect candidate regions are retained.
[0024] S232: Perform morphological filtering on the candidate defect regions to remove pseudo-defect regions formed by noise interference, retain the real defect regions, and obtain the contour boundaries of each real defect region.
[0025] S233: Based on the contour boundary of the actual defect area, calculate the location coordinates, actual area and shape parameters of the defect area;
[0026] S234: Determine the defect level based on the area, depth, and scope of influence of the defective region;
[0027] S235: Integrate the location coordinates, area, shape parameters and defect level of each defect region to construct a single defect feature vector.
[0028] According to the vision-based laser engraving path planning method for irregularly shaped materials provided by the present invention, step S3, the step of constructing matching rules based on natural texture features, includes:
[0029] S31: Based on natural texture features, extract LBP and GLCM features from the sculpted graphic template and construct a template texture feature vector;
[0030] S32: Calculate the similarity between the multidimensional natural texture feature vector and the template texture feature vector, use the cosine similarity algorithm to calculate the matching degree between the two, set the matching degree threshold, when the matching degree is higher than the matching degree threshold, it is determined that the preliminary matching is successful, and the preliminary matching result is output.
[0031] S33: Correct the preliminary matching results, align the feature points of the material's outer contour with the feature points of the engraved graphic template, and output the alignment results.
[0032] According to the vision-based laser engraving path planning method for irregularly shaped materials provided by the present invention, step S32, which involves calculating the matching degree between the two materials using a cosine similarity algorithm, includes:
[0033] S321: Normalize the multidimensional natural texture feature vector and the template texture feature vector;
[0034] S322: Calculate the dot product of the multidimensional natural texture feature vector and the template texture feature vector to obtain the dot product result;
[0035] S323: The magnitudes of the multidimensional natural texture feature vector and the template texture feature vector, respectively;
[0036] S324: Divide the dot product result by the product of the magnitudes of the multidimensional natural texture feature vector and the template texture feature vector to obtain the cosine similarity value;
[0037] S325: Based on the texture complexity and engraving precision requirements of the irregular material, a matching threshold is set. When the cosine similarity value is higher than the matching threshold, it is determined that the initial matching is successful. Otherwise, the template feature vector is re-extracted and the cosine similarity value is recalculated.
[0038] According to the vision-based laser engraving path planning method for irregularly shaped materials provided by the present invention, step S4, the step of generating the initial laser engraving path, includes:
[0039] S41: Based on the alignment results, the engraved graphic template is mapped to the standardized texture visual image of the irregular material to determine the actual position and size of the engraved graphic on the material surface;
[0040] S42: Delineate the boundaries of the carving area based on the material's outer contour features;
[0041] S43: Based on the boundary of the engraving area, plan the initial laser engraving path and generate the initial laser engraving path according to the path sorting principle from the inside to the outside and from the left to the right.
[0042] According to the vision-based laser engraving path planning method for irregularly shaped materials provided by the present invention, step S42, the step of delineating the boundary of the engraving area, includes:
[0043] S421: Based on the outer contour feature vector, determine the coordinates of the outermost boundary pixel of the material's outer contour, and use this outermost boundary as a reference to offset inward within a preset range as the carving safety boundary.
[0044] S422: Based on the actual position and size of the engraved graphic on the material surface, extract the outline boundary of the engraved graphic, compare the outline boundary of the engraved graphic with the material engraving safety boundary, and remove the engraved graphic part that exceeds the safety boundary to obtain the standard engraved graphic outline boundary.
[0045] S423: Based on the defect feature vector, identify the severe defect area within the engraved graphic range, and use the boundary of the severe defect area as the boundary of the engraving restricted area.
[0046] S424: Based on the material carving safety boundary, the standard carving graphic outline boundary, and the carving forbidden zone boundary, determine the final carving area boundary, and clarify the range, starting boundary, and ending boundary of the carving area.
[0047] According to the vision-based laser engraving path planning method for irregularly shaped materials provided by the present invention, step S5, the step of verifying and optimizing the initial laser engraving path, includes:
[0048] S51: Perform continuity verification on the initial laser engraving path, check for breakpoints, overlapping points and intersections in the path. If there are breakpoints, add path nodes. If there are overlapping points or intersections, delete redundant nodes. At the same time, check whether the path exceeds the outer contour of the material and whether it passes through defect areas. If there are non-compliant paths, correct them.
[0049] S52: Smooth the initial engraving path, and optimize the engraving speed and laser power according to the material thickness and hardness. Reduce the engraving speed and increase the laser power in areas with thicker and harder materials, and increase the engraving speed and reduce the laser power in areas with thinner and lower materials.
[0050] S53: Calculate the deviation between the optimized engraving path and the ideal path. If the deviation is greater than the preset accuracy threshold, return to step S52 to re-optimize. If the deviation is less than or equal to the preset accuracy threshold, the optimization is deemed qualified, and the final laser engraving path is output.
[0051] S54: Controls the laser engraving equipment to perform engraving operations according to the final laser engraving path, while simultaneously acquiring images of the engraving process in real time to monitor the engraving quality.
[0052] This invention also provides a vision-based laser engraving path planning system for irregularly shaped materials, comprising:
[0053] The image acquisition and processing module is used to acquire and preprocess visual images of irregularly shaped materials to obtain standardized texture visual images.
[0054] The feature extraction module is used to extract material contour features, natural texture features, and defect region features based on standardized texture visual images, and to construct a material feature dataset.
[0055] The template adaptive alignment module is used to construct matching rules based on natural texture features, complete the adaptive alignment of the sculpted graphic template with the irregular material, and output the alignment result.
[0056] The initial path planning module is used to plan and generate the initial laser engraving path by combining the alignment results with the material's outer contour features.
[0057] The path optimization module is used to verify and optimize the initial laser engraving path and output the final laser engraving path.
[0058] The engraving execution module is used to perform engraving based on the final laser engraving path.
[0059] This invention uses visual inspection to simultaneously acquire the material's outer contour, natural texture direction, and texture defect areas. Using the material's own natural texture characteristics as the core constraint, it intelligently controls the placement, density, and scaling ratio of the engraved graphic template. This ensures the engraved pattern's outline and direction highly match the material's natural texture, while automatically avoiding defect areas and planning the laser engraving path. The entire engraving path perfectly conforms to the material's natural shape and texture. This solution completely breaks through the industry pain point of traditional laser engraving patterns being disconnected from natural material forms and having poor adaptability. It abandons the rigid template application model and truly achieves an organic aesthetic fusion of the engraved pattern and the material's natural texture and form. It fully preserves the original texture and unique artistic charm of the natural material while deeply integrating laser engraving technology with natural aesthetics, significantly improving the artistic value, aesthetics, and quality of the finished product carved from irregularly shaped natural textured materials. Attached Figure Description
[0060] The invention will now be further described with reference to the accompanying drawings.
[0061] Figure 1 This is a flowchart of a vision-based laser engraving path planning method for irregularly shaped materials in an embodiment of the present invention;
[0062] Figure 2 This is a flowchart of constructing a material feature dataset in an embodiment of the present invention;
[0063] Figure 3 This is a flowchart illustrating the process of defining the boundary of the carving area in an embodiment of the present invention;
[0064] Figure 4 This is a schematic diagram of the structure of the laser engraving path planning system for irregularly shaped materials based on visual detection in an embodiment of the present invention. Detailed Implementation
[0065] To make the technical means, creative features, objectives and effects of this invention easier to understand, the invention will be further described below in conjunction with specific embodiments.
[0066] Example:
[0067] like Figures 1 to 4As shown, this embodiment provides a vision-based laser engraving path planning method for irregularly shaped materials, including:
[0068] S1: Visual image acquisition and preprocessing of irregularly shaped materials to obtain standardized texture visual images. The steps include:
[0069] S11: Image acquisition of irregularly shaped materials from multiple angles to obtain multiple frames of original texture images. An industrial CCD camera and a line laser profilometer are used as the image acquisition equipment. The irregularly shaped material is fixed on a flexible adjustable stage (rotation angle accuracy ±0.1°, rotation range 0-360°). During acquisition, the stage rotates in steps at intervals of 5°-15°. For each rotation, the CCD camera captures one frame of original texture image, ensuring that the overlap area between adjacent frames is 20%-40%. The acquisition angle covers the entire surface of the material, ultimately obtaining multiple frames of original texture images, with a frame count ≥ 8. The number of frames is adjusted according to the material size; the larger the size, the higher the frame count. A ring polarization supplementary lighting module is incorporated to eliminate light spot interference from highly reflective materials.
[0070] S12: Preprocess the original texture image by sequentially performing denoising, grayscale conversion, size normalization, and image enhancement, and output the enhanced texture image.
[0071] An adaptive σ-value Gaussian filtering algorithm is used for denoising. Gaussian filtering has a good noise suppression effect and can preserve image edge details to the greatest extent, making it suitable for denoising images of irregularly shaped material textures. Assuming the gray value of a pixel (i,j) in the image is f(i,j), the gray value g(i,j) of that pixel after Gaussian filtering is the sum of the products of the gray values of all its neighboring pixels and their corresponding Gaussian weights. An adaptive-size filtering kernel (3×3 / 5×5) is selected. The weight of each position (x,y) in the filtering kernel (with the center of the filtering kernel as the origin) is calculated by the aforementioned Gaussian function. Then, the filtering kernel is normalized, and the final filtering formula is expressed as:
[0072]
[0073]
[0074] In the formula, g(i,j) is the gray value of pixel (i,j) in the denoised image, with a value range of [0,255]; G(x,y) is the weight value of position (x,y) in the Gaussian filter kernel; f(i,j) is the gray value of pixel (i,j) in the original image before denoising, with a value range of [0,255] (8-bit grayscale image); x,y are the relative coordinates within the Gaussian filter kernel, with the center of the filter kernel as the origin, and a value range of [-k,k], where k is adaptively adjusted according to the noise intensity; in this embodiment, x,y∈{-1,0,1}; k is the half-side length of the filter kernel; σ is the standard deviation of the Gaussian function, which is automatically calculated according to the image noise density. The larger σ is, the stronger the denoising effect, but the higher the degree of image blurring; the smaller σ is, the weaker the denoising effect and the more noise residue.
[0075] A weighted average method is used for grayscale conversion, assigning different weights to ensure that the grayscale image accurately reflects the brightness distribution of the original image. The formula is as follows:
[0076]
[0077] In the formula, Gray is the grayscale value of the pixel after grayscale conversion, with a value range of [0, 255], where 0 represents black and 255 represents white; R is the red channel value of the pixel in the RGB color image, with a value range of [0, 255]; G is the green channel value of the pixel in the RGB color image, with a value range of [0, 255]; B is the blue channel value of the pixel in the RGB color image, with a value range of [0, 255]; 0.299, 0.587, and 0.114 are weighting coefficients, which are fixed coefficients determined according to the characteristics of human vision. The green channel is assigned the highest weight of 0.587, the red channel is assigned the second highest weight of 0.299, and the blue channel is assigned the lowest weight of 0.114. The sum of the three weights is 1, ensuring that the grayscale value range is still [0, 255] and avoiding brightness distortion.
[0078] The Lanczos interpolation algorithm is used for scaling to ensure that the normalized image has no obvious distortion while preserving texture details. Let the original image size be W0×H0, the target normalized size be W×H, and the scaling ratios be the width scaling ratios. Height scaling ratio For any pixel (x, y) in the normalized image, its corresponding coordinates in the original image are: If the coordinate is not an integer, its grayscale value is calculated using bilinear interpolation, expressed by the formula:
[0079]
[0080] In the formula, W0×H0 represents the width and height of the original grayscale image, W and H represent the width and height of the target normalized image, and (x,y) represents the coordinates of a pixel in the normalized image. These are the normalized pixel coordinates (x, y) mapped to the original image. pixels in the original image The gray value of f(x,y) is in the range of [0,255]; f(x,y) is the gray value of pixel (x,y) in the normalized image, in the range of [0,255].
[0081] After denoising, grayscale conversion, and normalization, the image texture details may not be clear enough, requiring image enhancement to improve texture contrast and highlight the texture features and defect details of the material surface. The CLAHE histogram equalization algorithm is used for image enhancement. The core of histogram equalization is to adjust the image's grayscale histogram to achieve a uniform distribution of grayscale values, thereby improving image contrast. Let the image's grayscale level be L, and the grayscale values be... The number of pixels is n k The total number of pixels in the image is Then the grayscale value The probability density function is After histogram equalization, the new grayscale value s k The calculation formula is expressed as:
[0082]
[0083] In the formula, This is a rounding function used to convert the calculation result into an integer.
[0084] After the above four preprocessing steps, N frames of enhanced texture images are output. Each frame is an 8-bit grayscale image with 1920×1080 pixels, with clear textures, low noise, and uniform specifications.
[0085] S13: The enhanced texture image is fused, and an image stitching algorithm is used to eliminate overlapping areas of images acquired from multiple angles, generating a complete and clear standardized texture visual image.
[0086] The SIFT (Scale Invariant Feature Transform) algorithm is used to extract feature points from each frame of the enhanced texture image. Feature point matching is performed using FLANN (Fast Nearest Neighbor Search) algorithm to select matching feature point pairs from adjacent frames. The homography matrix between adjacent frames is calculated to achieve image registration. Then, a weighted fusion algorithm is used to eliminate the stitching traces in the overlapping areas of the registered images. All frames are stitched and fused to obtain a complete, clear, and standardized texture visual image covering the entire surface of the irregular material.
[0087] The homography matrix is used to describe the spatial mapping relationship between two adjacent image frames. Let the two adjacent image frames be image A (reference image) and image B (image to be registered). The mapping relationship between any pixel (x_B, y_B) in image B and the corresponding pixel (x_A, y_A) in image A is represented by the homography matrix H (3×3 matrix), and the formula is as follows:
[0088]
[0089] After unfolding, we get:
[0090]
[0091]
[0092] In the formula, H is the homography matrix, a 3×3 real matrix that describes the spatial mapping relationship between two adjacent frames; h is an element of the homography matrix H. The coordinates of the pixel in reference image A; The coordinates of the pixels in the image B to be registered are given.
[0093] To eliminate brightness differences and stitching artifacts in the overlapping areas after stitching, a linear weighted fusion algorithm is used to perform a weighted average of the pixel grayscale values within the overlapping areas. The formula is as follows:
[0094]
[0095] In the formula, Let be the gray value of pixel (x,y) in image A, with a value range of [0,255]. f(x,y) is the gray value of pixel (x,y) in image B, with a value range of [0,255]; f(x,y) is the gray value of pixel (x,y) in the fused image, with a value range of [0,255]. represents the weighting coefficients for pixels (x, y) within the overlapping region. .
[0096] For non-overlapping regions of images A and B, the corresponding pixel grayscale values are directly retained; for overlapping regions, weights are assigned based on the distance of each pixel to the boundaries of images A and B, with closer pixels to the boundary of image A receiving higher weights. The larger the value, the closer it is to the boundary of image B. The larger the value, the more the weight is biased towards image B, thus achieving a smooth transition in the overlapping regions. The calculation formula is:
[0097]
[0098] in, Let be the distance from pixel (x, y) to the boundary of image A. y is the distance from pixel (x,y) to the boundary of image B.
[0099] After fusion, a standardized textured visual image is output, which covers the entire surface of the irregular material, with no splicing marks, clear texture, and uniform size.
[0100] S2: Based on standardized texture visual images, extract material contour features, natural texture features, and defect region features to construct a material feature dataset. The steps include:
[0101] S21: Based on the Canny edge detection algorithm, edge extraction is performed on the standardized texture visual image. After removing false edges, the contour tracking algorithm is used to obtain the coordinates of continuous pixel points of the material's outer contour. The perimeter, area, curvature, and feature corner points of the outer contour are calculated to obtain the outer contour feature vector.
[0102] First, the Canny edge detection algorithm is used for edge extraction. The low threshold is set to 50 and the high threshold is set to 150. The standardized texture visual image is first smoothed by Gaussian, and then the image gradient is calculated. Strong edges with gradients greater than the high threshold and weak edges with gradients between the low and high thresholds and connected to strong edges are selected. Isolated weak edges are removed to obtain the preliminary edge image.
[0103] Secondly, morphological opening operations are used to remove false edges in the edge image, preserving the true edges of the material's outer contour. Then, an eight-neighbor contour tracking algorithm is used to track adjacent edge pixels sequentially, starting from the first edge pixel in the upper left corner of the edge image, recording the coordinates (x, y) of each pixel to form a continuous sequence of outer contour pixels, ensuring the integrity of the contour.
[0104] Finally, based on the pixel sequence of the outer contour, the key parameters of the outer contour are calculated: the perimeter is calculated by accumulating the Euclidean distance between adjacent pixels, the area is calculated by the scan line method, the curvature is calculated by the second derivative method, and the feature corners are extracted by the Harris corner detection algorithm. The turning points, inflection points and other key corners of the contour are selected. The perimeter, area, mean curvature, variance of curvature and the coordinates of each feature corner are integrated to construct a 1×N-dimensional outer contour feature vector.
[0105] S22: Extract the texture roughness, texture direction, texture contrast and texture uniformity of the natural texture on the surface of the irregular material, and construct a multi-dimensional natural texture feature vector.
[0106] Texture roughness is determined using the Gray-Level Co-occurrence Matrix (GLCM) algorithm. Multiple window sizes are set (5×5 / 11×11 / 17×17), multiple distances d=1 / 2, and multiple directions θ=0° / 45° / 90° / 135°. The contrast parameter of the GLCM is calculated. The larger the contrast value, the higher the texture roughness. This parameter is used as the texture roughness feature value.
[0107] The texture direction is determined using the gradient histogram method. The gradient direction of each pixel in the image is calculated and divided into 8 intervals. The number of pixels in each interval is counted, and the direction corresponding to the interval with the most pixels is taken as the main texture direction. At the same time, the variance of the main direction is calculated to reflect the consistency of the texture direction. The main direction and variance are used as texture direction features.
[0108] Calculate the standard deviation of gray values within the texture region. The larger the standard deviation, the stronger the texture contrast. Combine this with the peak difference of the gray-level histogram as a feature value for texture contrast.
[0109] The energy parameter of the gray-level co-occurrence matrix is calculated. The larger the energy value, the more uniform the texture. At the same time, the mean value of gray-level values in the texture region is calculated to help reflect the texture uniformity. The energy parameter and the mean gray-level value are used as texture uniformity features.
[0110] By integrating the texture feature values of the above four dimensions, a 1×4-dimensional multidimensional natural texture feature vector is constructed.
[0111] S23: Segment the standardized texture visual image, identify defect areas on the material surface containing scratches, dents, and color differences, extract the location coordinates, area, shape, and defect level of the defect areas, and construct a defect feature vector. The steps include:
[0112] S231: An adaptive threshold segmentation algorithm is used to segment the standardized texture visual image into regions, dividing the image into background regions, normal material regions, and defect candidate regions. Background regions and normal material regions are excluded, while defect candidate regions are retained.
[0113] The Otsu adaptive thresholding segmentation algorithm is used, eliminating the need for manual threshold setting. The algorithm automatically calculates the optimal segmentation threshold and divides the standardized texture visual image into three regions, specifically:
[0114] First, through grayscale analysis, areas with grayscale values below 20 are identified as background areas;
[0115] Secondly, based on the natural texture features extracted by S22, the gray-level similarity between each pixel in the image and the normal texture area is calculated, and the area with a similarity higher than 0.9 is determined to be the normal material area;
[0116] Finally, the remaining areas are identified as defect candidate areas, which include possible defects such as scratches, dents, and color differences. After excluding the background area and the normal material area, only the defect candidate areas are retained for subsequent processing.
[0117] S232: Morphological filtering is performed on the defect candidate regions to remove pseudo-defect regions caused by noise interference, retain the real defect regions, and obtain the contour boundaries of each real defect region. Morphological closing operation is used to process the defect candidate regions to fill the small holes within the defect candidate regions; then, morphological opening operation is used to remove small protrusions and noise points at the edges of the defect candidate regions, further eliminating pseudo-defect regions; finally, a contour tracking algorithm is used to extract the contours of the processed defect candidate regions, obtain the complete contour boundaries of each real defect region, and record the pixel coordinates of the contour boundaries to ensure accurate positioning of the defect regions.
[0118] S233: Based on the contour boundary of the actual defect region, calculate the position coordinates, actual area, and shape parameters of the defect region. A two-dimensional coordinate system is established with the top-left corner of the standardized texture visual image as the origin. The coordinates of the center point of the defect region's contour boundary are calculated, along with the coordinates of the minimum bounding rectangle of the defect region, serving as the location identifier. Next, based on the camera calibration parameters, the pixel area of the defect region is converted into its actual physical area. Finally, shape parameters, including the roundness and rectangularity of the defect region, are calculated to describe the shape characteristics of the defect.
[0119] S234: Defect levels are determined based on the area, depth, and scope of influence of the defective region. The specific classification criteria are as follows:
[0120] Minor defects: actual area < 1mm², depth < 0.1mm, no obvious protrusions or depressions, do not affect the carving effect and material strength, and do not need to be avoided.
[0121] Moderate defects: 1mm²≤actual area<5mm², 0.1mm≤depth<0.3mm, with slight protrusions or depressions. If the carving path passes through this area, it may affect the flatness of the carving. It is necessary to flexibly avoid it according to the position of the carving graphic.
[0122] Serious defects: The actual area is ≥5mm², the depth is ≥0.3mm, and there are obvious protrusions, depressions or large areas of color difference. If the carving path passes through this area, it will cause problems such as carving breakage and blurred texture. It must be strictly avoided as a carving no-go zone.
[0123] The defect depth is calculated by the difference in grayscale values. The greater the difference between the grayscale value and the normal area, the greater the defect depth. The grayscale difference is converted into the actual depth value by combining the camera focal length and light refraction parameters.
[0124] S235: Integrate the location coordinates, area, shape parameters, and defect level of each defect region to construct a single defect feature vector. If multiple defects exist on the material surface, construct a single defect feature vector for each defect separately, forming a set of defect feature vectors.
[0125] S24: The Min-Max normalization algorithm is used to normalize the outer contour feature vector, natural texture feature vector, and defect feature vector to obtain the material feature dataset.
[0126] S3: Based on natural texture features, construct matching rules to complete the adaptive alignment of the sculpted graphic template and the irregular material, and output the alignment result.
[0127] In step S3, the steps for constructing the matching rules include:
[0128] S31: Based on natural texture features, extract LBP and GLCM features from the sculpted graphic template and construct the template texture feature vector.
[0129] First, obtain the engraved graphic template and then perform grayscale processing on the template;
[0130] Secondly, the LBP neighborhood radius is set to 3 and the number of neighborhood pixels is 8. The LBP value of each pixel is calculated, the histogram of LBP values is plotted, and 16 feature values of the histogram are extracted as LBP features.
[0131] Then, extract the GLCM features of the template: set the same parameters as S22, and calculate the four parameters of GLCM: contrast, energy, correlation, and entropy, as GLCM features;
[0132] Finally, the LBP features and GLCM features are integrated to construct a 1×20-dimensional template texture feature vector, ensuring that the template features are dimensionally compatible with the material's natural texture features.
[0133] S32: Calculate the similarity between the multidimensional natural texture feature vector and the template texture feature vector. Use the cosine similarity algorithm to calculate the matching degree between the two. Set a matching degree threshold. When the matching degree is higher than the matching degree threshold, it is determined that the preliminary matching is successful and the preliminary matching result is output.
[0134] Step S32, the step of calculating the matching degree between the two includes:
[0135] S321: The Min-Max normalization algorithm is also used to normalize the multidimensional natural texture feature vector and the template texture feature vector.
[0136] S322: Calculate the dot product of the multidimensional natural texture feature vector and the template texture feature vector to obtain the dot product result. Since the two have different dimensions (4D and 20D), feature dimension alignment is used: the multidimensional natural texture feature vector is expanded in dimension by linear interpolation from 4D to 20D to ensure consistency with the dimension of the template texture feature vector; then, the dot product of the expanded natural texture feature vector and the template texture feature vector is calculated using the following formula:
[0137]
[0138]
[0139]
[0140] in, This is the normalized feature vector of the material's natural texture. This is the normalized template texture feature vector. Normalized material natural texture feature vector The i-th element takes values in the range [0,1]. Normalized template texture feature vector The i-th element takes values in the range [0,1]. The result of the dot product of two vectors, is unitless, and takes values in the range [0, 20].
[0141] S323: The magnitudes of the multidimensional natural texture feature vector and the template texture feature vector, respectively. Length of the module The formula is expressed as:
[0142]
[0143] Length of the module The formula is expressed as:
[0144]
[0145] For an n-dimensional vector, its magnitude is equal to the square root of the sum of the squares of its elements. This calculation method accurately reflects the size of the vector. Since both vectors have been normalized, the values of each element range from [0,1], therefore the range of the magnitude is... (Approximately 0~4.47) to avoid the magnitude being too large or too small due to differences in vector element values, which would affect the calculation results of cosine similarity.
[0146] S324: Divide the dot product result by the product of the magnitudes of the multidimensional natural texture feature vector and the template texture feature vector to obtain the cosine similarity value. Cosine similarity measures the angle between two vectors; the smaller the angle, the closer the cosine similarity value is to 1, and the higher the similarity between the two vectors. Combining the dot product result and vector magnitudes calculated above, the cosine similarity between the two is calculated, which is the matching degree between the material's natural texture and the template texture. The matching degree ranges from [0,1]. The formula for calculating cosine similarity (matching degree) Sim is:
[0147]
[0148] In the formula, Sim represents the matching degree between the material's natural texture and the template texture, with a value range of [0,1]. The closer the value is to 1, the higher the texture matching degree.
[0149] S325: Based on the texture complexity and engraving precision requirements of the irregularly shaped material, a matching threshold is set. When the cosine similarity value is higher than the matching threshold, a preliminary match is considered successful; otherwise, the template feature vector is re-extracted and the cosine similarity value is recalculated. When the material texture complexity is high and the engraving precision requirement is ±0.05mm, the matching threshold is set to 0.85; when the material texture complexity is low and the engraving precision requirement is ±0.1mm, the matching threshold is set to 0.75. If the calculated cosine similarity value is higher than the corresponding matching threshold, a preliminary match is considered successful, and the coordinate offset of the preliminary match is recorded. If the cosine similarity value is lower than the matching threshold, the LBP and GLCM feature extraction parameters of the template are readjusted, the template texture feature vector is re-extracted, and steps S321-S324 are executed again until the matching degree meets the requirements. If three consecutive matches fail, manual intervention is prompted to check whether the template is suitable or whether there are serious texture anomalies in the material.
[0150] S33: Correct the preliminary matching results, align the feature points of the material's outer contour with the feature points of the engraved graphic template, and output the alignment results.
[0151] First, extract the feature points of the engraved graphic template and obtain the coordinates of the template feature points; second, call the material outer contour feature corner points extracted in step S21, match the template feature points with the material outer contour feature corner points one by one, and use the least squares method to calculate the coordinate correction matrix to eliminate the positional and angular deviations in the initial matching.
[0152] Then, based on the correction matrix, the engraved graphic template is translated and rotated to ensure that the fit error between the template outline and the outer outline of the material is ≤0.03mm, and the alignment error between the template texture and the natural texture of the material is ≤0.05mm.
[0153] Finally, the alignment results are output, including parameters such as the coordinate offset between the template and the material, the rotation angle, and the alignment error.
[0154] S4: Combining the alignment results with the material's outer contour features, plan and generate the initial laser engraving path. The steps include:
[0155] S41: Based on the alignment results, the engraved graphic template is mapped onto the standardized texture visual image of the irregularly shaped material to determine the actual position and size of the engraved graphic on the material surface. According to the alignment results, a coordinate transformation algorithm is used to convert the pixel coordinates of the engraved graphic template into the actual physical coordinates of the irregularly shaped material surface, determining the actual start and end coordinates of the engraved graphic on the material surface. Simultaneously, based on the ratio of the material's actual size to the image size, the actual size of the engraved graphic is adjusted to ensure that the size of the engraved graphic matches the available area of the material surface, preventing the engraved graphic from exceeding the material's boundaries. The size adjustment ratio of the engraved graphic is consistent with the scaling ratio of the material's outer contour to ensure that the graphic is not distorted.
[0156] S42: Based on the material's outer contour features, define the boundaries of the carving area. The steps include:
[0157] S421: Based on the outer contour feature vector, determine the coordinates of the outermost boundary pixel of the material's outer contour. Using this outermost boundary as a reference, offset inward by a preset range to form the engraving safety boundary. Extract the coordinates of the outermost boundary pixel of the material's outer contour (i.e., the pixel on the contour farthest from the material's center) from the outer contour feature vector and convert them into actual physical coordinates. Then, according to the diameter of the laser engraving head (preset to 0.1mm) and the engraving precision requirements, set the preset inward offset range to 0.2mm to ensure that the engraving head does not exceed the material boundary, avoiding engraving idle strokes or equipment damage. Using the outermost boundary as a reference, offset inward by 0.2mm to form the engraving safety boundary, record the actual coordinates of the safety boundary, and delineate the maximum engraving range on the material surface.
[0158] S422: Based on the actual position and size of the engraved graphic on the material surface, extract the outline boundary of the engraved graphic. Compare the outline boundary of the engraved graphic with the material's engraving safety boundary, and remove the parts of the engraved graphic that exceed the safety boundary to obtain the standard engraved graphic outline boundary. The same outline extraction algorithm as in step S21 is used to extract the outline boundary after mapping the engraved graphic, and the actual physical coordinates of the outline boundary are recorded. Next, outline intersection operation is used to compare the outline boundary of the engraved graphic with the engraving safety boundary to identify the parts of the engraved graphic that exceed the safety boundary. Then, a trimming algorithm is used to remove the parts of the engraved graphic that exceed the safety boundary, retaining the graphic parts located within the safety boundary. Finally, the trimmed graphic outline is smoothed to eliminate burrs, obtaining the standard engraved graphic outline boundary and ensuring the continuity and smoothness of the outline.
[0159] S423: Based on defect feature vectors, identify severe defect areas within the engraving graphic range, and use the boundaries of these severe defect areas as engraving restricted area boundaries. Select defect areas with a severe defect level and extract their contour boundaries. Then, determine whether each severe defect area is within the standard engraving graphic contour boundary. If it is, use that boundary as the engraving restricted area boundary, prohibiting the laser engraving head from passing through that area. If the severe defect area is outside the standard engraving graphic contour boundary, no processing is required. Simultaneously, record the coordinates of all engraving restricted area boundaries to form a restricted area list for subsequent path planning and avoidance.
[0160] S424: Based on the material carving safety boundary, the standard carving graphic outline boundary, and the carving forbidden zone boundary, determine the final carving area boundary, clarifying the range, starting boundary, and ending boundary of the carving area. The final carving area boundary is determined using region intersection and difference operations: First, take the intersection area of the carving safety boundary and the standard carving graphic outline boundary as the initial carving area; then, subtract the area corresponding to the carving forbidden zone boundary from the initial carving area to obtain the final carving area; finally, clarify the range, starting boundary, and ending boundary of the final carving area, and mark the moderately defective areas within the carving area.
[0161] S43: Based on the boundary of the engraving area, plan the initial laser engraving path and generate the initial laser engraving path according to the path sorting principle from the inside to the outside and from the left to the right.
[0162] First, the final engraving area is divided into several parallel scanning lines (the direction of the scanning lines is consistent with the main direction of the material texture to avoid conflict between the engraved texture and the natural texture of the material), and the spacing between the scanning lines is set to 0.05mm.
[0163] Then, following the order of the scan lines from inside to outside and from left to right, the scanning sequence is planned: first scan the internal area of the engraving area, and then gradually expand outwards. The same layer is scanned sequentially from left to right to avoid path intersections and redundancy.
[0164] Finally, the starting and ending coordinates of each scan line are recorded to form a continuous initial laser engraving path. The node spacing of the path is set to 0.01mm to ensure the smoothness and accuracy of the path, while marking the moderate defect areas that need to be avoided in the path.
[0165] S5: Verify and optimize the initial laser engraving path, output the final laser engraving path, and execute the engraving.
[0166] Step S5, the step of verifying and optimizing the initial laser engraving path, includes:
[0167] S51: Perform continuity verification on the initial laser engraving path, checking for breakpoints, overlaps, and intersections in the path. If breakpoints exist, add path nodes; if overlaps or intersections exist, delete redundant nodes. Simultaneously verify whether the path exceeds the material's outer contour and whether it passes through defect areas; if any non-compliant paths are found, correct them.
[0168] S52: Smooth the initial engraving path. Simultaneously, optimize the engraving speed and laser power based on material thickness and hardness. Reduce the engraving speed and increase the laser power in areas with thicker, harder material, and increase the engraving speed and decrease the laser power in areas with thinner, lower material. Specifically: Obtain the material thickness distribution through visual inspection and combine it with the material's hardness parameters (preset in a database, such as wood hardness HB50, stone hardness HB100) to optimize the engraving parameters: When the material thickness is ≥3mm and hardness is ≥HB80, set the engraving speed to 50-80mm / s and the laser power to 30-50W; when the material thickness is 1-3mm and hardness is HB50-HB80, set the engraving speed to 80-150mm / s and the laser power to 15-30W; when the material thickness is <1mm and hardness is <HB50, set the engraving speed to 150-200mm / s and the laser power to 10-15W. Simultaneously, in areas with moderate defects, appropriately reduce the engraving speed and increase the laser power to ensure the clarity of the engraving in defective areas and avoid incomplete engraving.
[0169] S53: Calculate the deviation between the optimized engraving path and the ideal path (the theoretically unbiased path based on the engraving graphic template and alignment results). If the deviation is greater than the preset accuracy threshold (0.03mm), return to step S52 for re-optimization. If the deviation is less than or equal to the preset accuracy threshold, the optimization is deemed successful, and the final laser engraving path is output.
[0170] S54: Controls the laser engraving equipment to perform engraving operations according to the final laser engraving path, while simultaneously acquiring images of the engraving process in real time to monitor the engraving quality.
[0171] This invention also provides a vision-based laser engraving path planning system for irregularly shaped materials, comprising:
[0172] The image acquisition and processing module is used to acquire and preprocess visual images of irregularly shaped materials to obtain standardized texture visual images.
[0173] The feature extraction module is used to extract material contour features, natural texture features, and defect region features based on standardized texture visual images, and to construct a material feature dataset.
[0174] The template adaptive alignment module is used to construct matching rules based on natural texture features, complete the adaptive alignment of the sculpted graphic template with the irregular material, and output the alignment result.
[0175] The initial path planning module is used to plan and generate the initial laser engraving path by combining the alignment results with the material's outer contour features.
[0176] The path optimization module is used to verify and optimize the initial laser engraving path and output the final laser engraving path.
[0177] The engraving execution module is used to perform engraving based on the final laser engraving path.
[0178] In summary, the vision-based laser engraving path planning method and system for irregularly shaped materials provided by this invention simultaneously acquires the material's outer contour, natural texture direction, and texture defect areas through visual detection. Using the material's own natural texture characteristics as the core constraint, it intelligently controls the placement, density, and scaling ratio of the engraved graphic template, ensuring that the outline and direction of the engraved pattern highly match the material's natural texture. Simultaneously, it automatically avoids defect areas when planning the laser engraving path, making the entire engraving path perfectly conform to the material's natural shape and texture. This solution completely breaks through the industry pain point of traditional laser engraving patterns being disconnected from the natural material's form and having poor adaptability. It abandons the rigid template application model and truly achieves an organic aesthetic fusion of the engraved pattern and the material's natural texture and form. It not only fully preserves the original texture and unique artistic charm of the natural material but also deeply integrates laser engraving technology with natural aesthetics, significantly improving the artistic value, aesthetics, and quality of the finished product carved from irregularly shaped natural textured materials.
[0179] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0180] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for laser engraving path planning of irregularly shaped materials based on visual inspection, characterized in that, include: S1: Visual image acquisition and preprocessing of irregularly shaped materials to obtain standardized texture visual images; S2: Based on the standardized texture visual image, extract the material's outer contour features, natural texture features, and defect area features to construct a material feature dataset; S3: Based on the natural texture features, construct matching rules to complete the adaptive alignment of the sculpted graphic template and the irregular material, and output the alignment result; S4: Combine the alignment results with the material's outer contour features to plan and generate an initial laser engraving path; S5: Verify and optimize the initial laser engraving path, output the final laser engraving path, and execute the engraving.
2. The method for laser engraving path planning of irregularly shaped materials based on visual inspection according to claim 1, characterized in that, Step S1, the steps for obtaining the standardized texture visual image include: S11: Capture images of the irregularly shaped material from multiple angles to obtain multiple frames of original texture images; S12: Preprocess the original texture image by sequentially performing denoising, grayscale conversion, size normalization, and image enhancement, and output an enhanced texture image; S13: The enhanced texture image is fused, and an image stitching algorithm is used to eliminate the overlapping areas of images acquired from multiple angles, generating a complete and clear standardized texture visual image.
3. The method for laser engraving path planning of irregularly shaped materials based on visual inspection according to claim 1, characterized in that, Step S2, the steps for constructing the material feature dataset, include: S21: Based on the edge detection algorithm, the standardized texture visual image is subjected to edge extraction. After removing false edges, the contour tracking algorithm is used to obtain the coordinates of continuous pixel points of the material's outer contour. The perimeter, area, curvature and feature corner points of the outer contour are calculated to obtain the outer contour feature vector. S22: Extract the texture roughness, texture direction, texture contrast and texture uniformity of the natural texture on the surface of the irregular material respectively, and construct a multi-dimensional natural texture feature vector; S23: Segment the standardized texture visual image, identify defect areas on the material surface containing scratches, dents, and color differences, extract the location coordinates, area, shape, and defect level of the defect areas, and construct a defect feature vector; S24: Normalize the outer contour feature vector, natural texture feature vector and defect feature vector to obtain a material feature dataset.
4. The method for laser engraving path planning of irregularly shaped materials based on visual inspection according to claim 3, characterized in that, In step S23, the steps for constructing the defect feature vector include: S231: An adaptive threshold segmentation algorithm is used to segment the standardized texture visual image into regions, dividing the image into background regions, normal material regions, and defect candidate regions. Background regions and normal material regions are excluded, while defect candidate regions are retained. S232: Perform morphological filtering on the candidate defect regions to remove pseudo-defect regions formed by noise interference, retain the real defect regions, and obtain the contour boundaries of each real defect region. S233: Based on the contour boundary of the actual defect area, calculate the location coordinates, actual area and shape parameters of the defect area; S234: Determine the defect level based on the area, depth, and scope of influence of the defective region; S235: Integrate the location coordinates, area, shape parameters and defect level of each defect region to construct a single defect feature vector.
5. The method for laser engraving path planning of irregularly shaped materials based on visual inspection according to claim 3, characterized in that, Step S3, the step of constructing matching rules based on the natural texture features, includes: S31: Based on the natural texture features, extract the LBP and GLCM features of the sculpted graphic template and construct the template texture feature vector; S32: Calculate the similarity between the multidimensional natural texture feature vector and the template texture feature vector, use the cosine similarity algorithm to calculate the matching degree between the two, set a matching degree threshold, and when the matching degree is higher than the matching degree threshold, it is determined that the preliminary matching is successful and the preliminary matching result is output. S33: Correct the preliminary matching result, align the feature points of the material's outer contour with the feature points of the engraved graphic template, and output the alignment result.
6. The method for laser engraving path planning of irregularly shaped materials based on vision detection according to claim 5, characterized in that, Step S32, which involves calculating the matching degree between the two using the cosine similarity algorithm, includes: S321: Normalize the multidimensional natural texture feature vector and the template texture feature vector; S322: Calculate the dot product of the multidimensional natural texture feature vector and the template texture feature vector to obtain the dot product result; S323: The magnitudes of the multidimensional natural texture feature vector and the template texture feature vector, respectively; S324: Divide the dot product result by the product of the magnitudes of the multidimensional natural texture feature vector and the template texture feature vector to obtain the cosine similarity value; S325: Based on the texture complexity and engraving precision requirements of the irregular material, a matching degree threshold is set. When the cosine similarity value is higher than the matching degree threshold, it is determined that the initial matching is successful. Otherwise, the template feature vector is re-extracted and the cosine similarity value is recalculated.
7. The method for laser engraving path planning of irregularly shaped materials based on visual inspection according to claim 3, characterized in that, Step S4, the step of generating the initial laser engraving path, includes: S41: Based on the alignment results, the engraved graphic template is mapped onto the standardized texture visual image of the irregular material to determine the actual position and size of the engraved graphic on the material surface; S42: Delineate the boundary of the carving area based on the outer contour features of the material; S43: Based on the boundary of the engraving area, plan the initial laser engraving path and generate the initial laser engraving path according to the path sorting principle from the inside to the outside and from the left to the right.
8. The method for laser engraving path planning of irregularly shaped materials based on visual inspection according to claim 7, characterized in that, Step S42, the step of defining the boundary of the carving area includes: S421: Based on the outer contour feature vector, determine the coordinates of the outermost boundary pixel of the material's outer contour, and use the outermost boundary as a reference to offset inward within a preset range as the carving safety boundary. S422: Based on the actual position and size of the engraved graphic on the material surface, extract the outline boundary of the engraved graphic, compare the outline boundary of the engraved graphic with the material engraving safety boundary, and remove the engraved graphic part that exceeds the safety boundary to obtain the standard engraved graphic outline boundary. S423: Based on the defect feature vector, identify the severe defect area within the engraved graphic range, and use the boundary of the severe defect area as the engraving restricted area boundary; S424: Based on the material carving safety boundary, the standard carving graphic outline boundary, and the carving forbidden zone boundary, determine the final carving area boundary, and clarify the range, starting boundary, and ending boundary of the carving area.
9. The method for laser engraving path planning of irregularly shaped materials based on visual inspection according to claim 1, characterized in that, Step S5, the step of verifying and optimizing the initial laser engraving path, includes: S51: Perform continuity verification on the initial laser engraving path, check for breakpoints, overlapping points and intersections in the path. If there are breakpoints, add path nodes. If there are overlapping points or intersections, delete redundant nodes. At the same time, check whether the path exceeds the outer contour of the material and whether it passes through defect areas. If there are non-compliant paths, correct them. S52: Smooth the initial engraving path, and optimize the engraving speed and laser power according to the material thickness and hardness. Reduce the engraving speed and increase the laser power in areas with thicker and harder materials, and increase the engraving speed and reduce the laser power in areas with thinner and lower materials. S53: Calculate the deviation between the optimized engraving path and the ideal path. If the deviation is greater than the preset accuracy threshold, return to step S52 to re-optimize. If the deviation is less than or equal to the preset accuracy threshold, the optimization is deemed qualified, and the final laser engraving path is output. S54: Control the laser engraving equipment to perform the engraving operation according to the final laser engraving path, and at the same time collect images of the engraving process in real time to monitor the engraving quality.
10. A vision-based laser engraving path planning system for irregularly shaped materials, comprising the vision-based laser engraving path planning method for irregularly shaped materials as described in any one of claims 1 to 9, characterized in that, include: The image acquisition and processing module is used to acquire and preprocess visual images of irregularly shaped materials to obtain standardized texture visual images. The feature extraction module is used to extract material outline features, natural texture features, and defect region features based on the standardized texture visual image, and to construct a material feature dataset. The template adaptive alignment module is used to construct matching rules based on the natural texture features, complete the adaptive alignment of the engraved graphic template and the irregular material, and output the alignment result. The initial path planning module is used to plan and generate an initial laser engraving path by combining the alignment results with the material's outer contour features; The path optimization module is used to verify and optimize the initial laser engraving path and output the final laser engraving path. The engraving execution module is used to perform engraving based on the final laser engraving path.