An automatic typesetting and drawing method and system for laser cutting of lenses

Through the automatic layout and drawing method, the problems of unreasonable cutting paths and insufficient analysis of lens profile characteristics in the existing lens laser cutting technology are solved, and efficient and accurate lens laser cutting is achieved, which improves production efficiency and product quality.

CN119918423BActive Publication Date: 2025-06-24SHEN ZHEN BLOSSOM ELECTRONIC TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510404968.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-02
Publication Date
2025-06-24
Estimated Expiration
2045-04-02

AI Technical Summary

Technical Problem

The existing lens laser cutting technology has limitations in image processing and cutting path planning. Relying on manual experience leads to unreasonable cutting paths, affecting product quality, and lacks in-depth analysis of lens profile characteristics, resulting in inefficient cutting efficiency and waste of materials.

Method used

An automatic layout drawing method is adopted. By collecting lens images, contour edge detection and continuous contour discrete direction mapping, contour direction sequence is generated, polygon fitting and three-dimensional modeling, lens contour feature data is extracted, segmentation and range-limited screening, optimize layout schemes, build cutting path direction chains, generate cutting path data, and perform settings in sequence through blank drawing templates to achieve automated layout.

Benefits of technology

It improves the automation level and accuracy of lens laser cutting, optimizes the cutting path, reduces material waste, and improves production efficiency and product quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119918423B_ABST
    Figure CN119918423B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of typesetting and drawing, and particularly relates to a method and system for automatic typesetting and drawing of lens laser cutting. The method includes the following steps: collecting an image of the lens to be cut and performing contour edge detection to generate a contour direction sequence, performing polygon fitting on the sequence, screening out valid contour data, and constructing a three-dimensional lens model, classifying and clustering the model to extract contour features, and performing segmentation to obtain a segmented contour model, performing range limitation and local typesetting processing on the model to form an accurate layout plan, constructing a cutting path direction chain according to the plan and performing path planning to generate cutting path data, performing sequential execution setting on the cutting path based on a preset blank drawing template, and finally obtaining a typesetting template for laser cutting. The present invention realizes a more efficient method for automatic typesetting and drawing of lens laser cutting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of typesetting and drawing, and in particular to an automatic typesetting and drawing method and system for laser cutting of lenses. Background Art

[0002] The laser cutting technology of lenses has been gradually widely used with the increasing demand. The traditional manual cutting method is not only inefficient, but also difficult to guarantee the cutting accuracy, resulting in an increase in production costs and time. With the improvement of consumers' requirements for lens quality and personalization, how to improve the automation level and accuracy of lens cutting has become an urgent problem to be solved. The existing laser cutting technology has certain limitations in image processing and cutting path planning. The traditional method often relies on manual experience to design the cutting path, which is easy to lead to an unreasonable cutting path, thus affecting the quality of the final product. In addition, most of the existing technologies lack in-depth analysis of the contour features of the lens and cannot fully explore the geometric features of the lens, resulting in low cutting efficiency and material waste. Summary of the Invention

[0003] Based on this, it is necessary to provide an automatic typesetting and drawing method and system for laser cutting of lenses to solve at least one of the above technical problems.

[0004] To achieve the above object, an automatic typesetting and drawing method for laser cutting of lenses includes the following steps:

[0005] Step S1: Collect the image of the lens to be cut; perform contour edge detection on the image of the lens to be cut to obtain the image edge curve; perform continuous contour discrete direction mapping on the image of the lens to be cut based on the image edge curve to generate a contour direction sequence;

[0006] Step S2: Perform polygon fitting on the contour direction sequence to obtain screened contour data; perform contour three-dimensional modeling based on the screened contour data to generate a reconstructed lens model;

[0007] Step S3: Perform contour classification and clustering processing on the reconstructed lens model to obtain lens contour feature data; perform contour segmentation on the reconstructed lens model according to the lens contour feature data to obtain a segmented lens contour model;

[0008] Step S4: Perform range limitation screening on the segmented lens contour model to obtain a compressed range contour model; perform local fine typesetting processing on the compressed range contour model to obtain an accurate layout plan;

[0009] Step S5: Construct a direction chain according to the accurate layout plan to obtain a cutting path direction chain; perform cutting path planning on the accurate layout plan based on the cutting path direction chain to generate cutting path data;

[0010] Step S6: Based on a preset blank drawing template, perform sequential execution settings on the cutting path data to obtain a cutting layout template for implementing the automatic layout drawing method for lens laser cutting.

[0011] Through the implementation of collecting the images of the lenses to be cut, the present invention can obtain accurate image information. The implementation of contour edge detection can extract clear edge curves. The generated contour direction sequence provides a basis for subsequent processing. The implementation of polygon fitting on the contour direction sequence can optimize the contour data. The obtained screened contour data provides a basis for 3D modeling. The implementation of 3D contour modeling based on the screened contour data can generate a high-precision reconstructed lens model. The implementation of classification and clustering processing on the reconstructed lens model can extract feature data. The generated lens contour feature data provides support for segmentation. The implementation of contour segmentation of the model according to the feature data can obtain a segmented contour model. The implementation of range-limited screening can ensure the applicability of the model. The generated compressed range contour model provides a basis for local layout. The implementation of local fine layout processing can optimize the layout scheme. The obtained precise layout scheme provides a clear direction for cutting path planning. The implementation of constructing a cutting path direction chain according to the layout scheme can ensure the rationality of cutting. The generated cutting path data provides a basis for subsequent layout. The implementation of sequential execution settings based on a blank drawing template can achieve automatic layout. The finally formed cutting layout template ensures the efficiency and accuracy of laser cutting.

[0012] Preferably, step S1 includes the following steps:

[0013] Step S11: Collect the images of the lenses to be cut; perform brightness equalization correction on the images of the lenses to be cut to obtain brightness-equalized images;

[0014] Step S12: Perform bilateral filtering denoising on the brightness-equalized images to generate denoised lens images; perform contour edge detection on the denoised lens images to obtain image edge curves;

[0015] Step S13: Perform eight-direction chain code encoding on the image edge curves to obtain a direction encoding sequence;

[0016] Step S14: Perform continuous contour discrete direction mapping on the images of the lenses to be cut according to the direction encoding sequence to generate a contour direction sequence.

[0017] The implementation of collecting the image of the lens to be cut in the present invention can ensure accurate data input. The implementation of brightness equalization correction can improve the overall brightness and contrast of the image. The generated brightness-equalized image provides clearer visual information for subsequent processing. The implementation of bilateral filtering for noise reduction can effectively remove the noise in the image. The generated noise-reduced lens image provides a clean basis for contour detection. The implementation of contour edge detection can extract the edge features of the lens. The obtained image edge curve provides important data for subsequent coding. The implementation of eight-direction chain code encoding can convert the edge information into a digital direction sequence. The generated direction coding sequence facilitates the analysis and processing of the contour. The implementation of continuous contour discrete direction mapping based on the direction coding sequence can extract the contour direction information of the lens. The generated contour direction sequence lays a foundation for subsequent 3D modeling and cutting path planning, and overall improves the accuracy and efficiency of the lens laser cutting process.

[0018] Preferably, step S2 includes the following steps:

[0019] Step S21: Perform density clustering analysis on the contour direction sequence to obtain key point distribution data; calculate the inter-point distance for the key point distribution data to generate an inter-point distance matrix;

[0020] Step S22: Perform threshold segmentation processing on the contour direction sequence according to the inter-point distance matrix to generate segmentation boundary data; perform polygon fitting on the contour direction sequence based on the segmentation boundary data to obtain filtered contour data;

[0021] Step S23: Extract geometric features from the filtered contour data to obtain a contour geometric feature description set; perform contour depth mapping based on the contour geometric feature description set to generate depth mapping data;

[0022] Step S24: Perform anisotropic diffusion filtering on the depth mapping data to obtain a smoothed depth map; perform 3D modeling of the contour on the filtered contour data based on the smoothed depth map to generate a reconstructed lens model.

[0023] The implementation of density clustering analysis on the contour direction sequence in the present invention can effectively identify key points in the contour. The generated key point distribution data provides a basis for subsequent processing. The implementation of calculating the distance between points can reveal the spatial relationship between key points. The generated point distance matrix provides a basis for threshold segmentation processing of the contour. The implementation of threshold segmentation processing based on the point distance matrix can divide the contour information into different segments. The generated segmentation boundary data supports polygon fitting. The implementation of polygon fitting based on the segmentation boundary data can optimize the contour data. The obtained filtered contour data lays a foundation for further analysis. The implementation of extracting contour geometric features can reveal the shape features of the contour. The generated contour geometric feature description set provides information for subsequent depth mapping. The implementation of contour depth mapping based on the contour geometric feature description set can generate richer depth information. The obtained depth mapping data provides the original data for further filtering processing. The implementation of anisotropic diffusion filtering can smooth the depth map. The generated smoothed depth map provides a clear basis for three-dimensional modeling of the contour. The implementation of three-dimensional modeling of the filtered contour data based on the smoothed depth map can generate a high-quality reconstructed lens model, which overall improves the accuracy and efficiency of lens laser cutting.

[0024] Preferably, step S22 includes the following steps:

[0025] Perform feature statistical processing on the point distance matrix to obtain distance feature data; perform dynamic threshold calculation based on the distance feature data to generate a set of threshold parameters;

[0026] Perform sliding window analysis on the contour direction sequence to obtain local feature data; perform direction change rate analysis based on the local feature data to generate a direction change rate sequence;

[0027] Perform peak detection on the direction change rate sequence to obtain a set of change rate key points; perform matching and screening on the set of change rate key points and the set of threshold parameters to generate candidate segmentation points;

[0028] Perform threshold segmentation processing on the contour direction sequence according to the candidate segmentation points to generate segmentation boundary data;

[0029] Perform feature geometric analysis on the segmentation boundary data to obtain feature geometric attributes; perform fitting constraint construction based on the feature geometric attributes to generate a set of constraint conditions;

[0030] Perform polygon fitting on the contour direction sequence to obtain an initial fitting result; perform error calculation on the initial fitting result according to the set of constraint conditions to obtain error index data;

[0031] Perform angle adjustment and optimization based on the error index data to obtain an optimized fitting result; perform contour screening on the optimized fitting result to obtain filtered contour data.

[0032] Through the implementation of feature statistical processing on the dot pitch matrix, the present invention can extract key distance features. The generated distance feature data provides an important basis for dynamic threshold calculation. The implementation of dynamic threshold calculation based on the distance feature data can generate a set of threshold parameters with strong adaptability. The implementation of sliding window analysis on the contour direction sequence can effectively capture local feature information. The obtained local feature data supports the analysis of direction changes. The implementation of direction change rate analysis based on the local feature data can reveal the dynamic changes of the contour. The generated direction change rate sequence provides a basis for subsequent peak detection. The implementation of peak detection can identify the key points of the change rate. The obtained set of change rate key points provides a basis for the screening of candidate segmentation points. The implementation of matching and screening the set of change rate key points and the set of threshold parameters can accurately generate candidate segmentation points. The implementation of threshold segmentation processing on the contour direction sequence based on the candidate segmentation points can optimize the segmentation effect of the contour. The generated segmentation boundary data provides important data for feature geometric analysis. The implementation of feature geometric analysis on the segmentation boundary data can extract the geometric attributes of the contour. The obtained feature geometric attributes provide a basis for fitting constraint construction. The implementation of fitting constraint construction based on the feature geometric attributes can generate a reasonable set of constraint conditions. The implementation of polygon fitting on the contour direction sequence can obtain a preliminary fitting result. The error calculation of the initial fitting result can evaluate the accuracy of the fitting. The generated error index data provides a basis for subsequent optimization. The implementation of angle adjustment and optimization based on the error index data can improve the fitting accuracy. The finally obtained optimized fitting result can generate high-quality screened contour data through contour screening, significantly improving the efficiency and accuracy of lens laser cutting.

[0033] Preferably, step S3 includes the following steps:

[0034] Step S31: Locate the edge points of the reconstructed lens model to obtain a set of model edge points; calculate the curvature of the set of model edge points to obtain a curvature feature vector;

[0035] Step S32: Perform principal component analysis on the reconstructed lens model according to the curvature feature vector to obtain dimension-reduced feature data; perform mean clustering processing on the dimension-reduced feature data to generate lens contour feature data;

[0036] Step S33: Locate the segmentation key points of the lens contour feature data to obtain segmentation key point data;

[0037] Step S34: Based on the segmentation key point data, perform contour segmentation on the reconstructed lens model to obtain a segmented lens contour model.

[0038] Through the implementation of edge point positioning for the reconstructed lens model, the present invention can accurately identify the edge features of the model. The generated model edge point set provides a data basis for subsequent curvature calculation. The implementation of curvature calculation can extract the curvature feature vector of the model. The generated curvature feature vector provides key data for principal component analysis. The implementation of principal component analysis based on the curvature feature vector can achieve data dimensionality reduction processing. The obtained dimensionality reduction feature data provides effective information for subsequent clustering processing. The implementation of mean clustering processing can group the dimensionality reduction feature data. The generated lens contour feature data provides a basis for segmentation. The implementation of segmentation key point positioning for the lens contour feature data can accurately locate the segmentation points. The obtained segmentation key point data provides support for contour segmentation. The implementation of contour segmentation of the reconstructed lens model based on the segmentation key point data can generate a segmented lens contour model, improving the accuracy and efficiency of lens laser cutting and ensuring high-quality output during the production process.

[0039] Preferably, step S4 includes the following steps:

[0040] Step S41: Define the envelope box range for the segmented lens contour model to obtain a set of boundary boxes; perform area optimization processing on the set of boundary boxes to generate compressed boundary data;

[0041] Step S42: Divide the feasible region according to the compressed boundary data to obtain a limited feasible region; perform range limitation screening on the segmented lens contour model based on the limited feasible region to obtain a compressed range contour model;

[0042] Step S43: Perform grid division on the compressed range contour model to obtain lens contour grid data; calculate the layout cost for the lens contour grid data to obtain a layout cost matrix;

[0043] Step S44: Perform local fine layout processing according to the layout cost matrix to obtain an accurate layout plan.

[0044] The implementation of the present invention to limit the envelope box range of the segmented lens contour model can effectively determine the boundary of the model. The generated set of boundary boxes provides a basis for subsequent area optimization. The implementation of area optimization processing can reduce unnecessary calculation areas. The generated compressed boundary data provides a basis for feasible region division. The implementation of feasible region division based on the compressed boundary data can clarify the effective cutting area. The obtained limited feasible region provides support for the screening of the contour model. The implementation of range-limited screening of the segmented lens contour model based on the limited feasible region can generate a compressed range contour model. The implementation of mesh division can convert the compressed range contour model into mesh data. The obtained lens contour mesh data provides the necessary information for layout cost calculation. The implementation of layout cost calculation can evaluate the costs of different layout schemes. The generated layout cost matrix provides a basis for subsequent fine typesetting processing. The implementation of local fine typesetting processing based on the layout cost matrix can optimize the layout effect. The finally obtained precise layout scheme provides efficient and reasonable guidance for lens laser cutting, improving the cutting efficiency and finished product quality.

[0045] Preferably, step S42 includes the following steps:

[0046] Perform grid processing on the compressed boundary data to obtain boundary grid data; perform obstacle marking on the boundary grid data to generate obstacle grid data;

[0047] Perform connected domain recognition on the boundary grid data based on the obstacle grid data to obtain a regional connection graph; perform boundary extraction on the regional connection graph to generate a limited feasible region;

[0048] Perform position mapping on the limited feasible region according to the segmented lens contour model to obtain position mapping data; perform boundary detection on the position mapping data to obtain boundary constraint data;

[0049] Perform feasibility verification based on the boundary constraint data to obtain verification result data; perform range optimization on the limited feasible region according to the verification result data to obtain a compressed feasible region;

[0050] Perform regional integration on the compressed feasible region to generate a compressed range contour model.

[0051] Through the implementation of grid processing on the compressed boundary data, the present invention can convert boundary information into structured data. The generated boundary grid data provides a basis for obstacle marking. The implementation of obstacle marking can clarify the positions of obstacles. The generated obstacle grid data provides important information for connected domain recognition. Based on the obstacle grid data, the implementation of connected domain recognition can identify feasible and infeasible regions. The obtained region connection graph provides a basis for subsequent boundary extraction. The implementation of boundary extraction can generate a defined feasible region and clarify the effective space for cutting. According to the split lens contour model, the implementation of position mapping on the defined feasible region can ensure the accurate positioning of the cutting path. The generated position mapping data provides support for boundary detection. The implementation of boundary detection can extract effective boundary constraint data. Based on the boundary constraint data, the implementation of feasibility verification can evaluate the rationality of the cutting scheme. The obtained verification result data provides a basis for optimization. According to the verification result data, the implementation of range optimization on the defined feasible region can further improve the accuracy of the cutting region. The generated compressed feasible region provides an efficient space for subsequent processing. The implementation of region integration can generate a compressed range contour model, improving the precision and efficiency of lens laser cutting.

[0052] Preferably, step S44 includes the following steps:

[0053] Optimize the objective function according to the layout cost matrix to obtain the optimized objective function; perform initial layout simulation according to the optimized objective function to obtain the initial simulation layout;

[0054] Detect conflicts in the initial simulation layout to obtain layout conflict points; perform local adjustment on the compressed range contour model based on the layout conflict points to obtain a local adjustment plan;

[0055] Evaluate the layout of the local adjustment plan based on a preset layout scoring criterion to obtain a layout score; perform high-score local search on the layout score to obtain an optimized adjustment plan;

[0056] Perform boundary fine-tuning optimization according to the optimized adjustment plan to obtain a boundary-optimized layout; perform data integration on the boundary-optimized layout to generate an accurate layout plan.

[0057] Through the implementation of optimizing the objective function according to the layout cost matrix, the optimal objective of the cutting layout can be determined. The generated objective optimization function provides guidance for the initial layout simulation. The implementation of the initial layout simulation can generate a feasible layout plan, and the obtained simulated initial layout provides a basis for subsequent conflict detection. The implementation of conflict detection can identify problems in the layout and generate layout conflict points. The implementation of locally adjusting the compression range contour model based on the layout conflict points can optimize the layout targetedly, and the obtained local adjustment plan provides a basis for layout evaluation. The implementation of layout evaluation of the local adjustment plan based on the preset layout scoring criteria can quantify the advantages and disadvantages of the layout, and the generated layout score provides data support for high-score local search. The implementation of high-score local search can deeply explore better layout plans, and the generation of the optimization adjustment plan can further improve the cutting efficiency. The implementation of boundary fine-tuning optimization according to the optimization adjustment plan can ensure the accuracy of the layout, and the obtained boundary-optimized layout provides a basis for data integration. The implementation of data integration can generate an accurate layout plan, comprehensively improving the quality and efficiency of lens laser cutting and ensuring the high-standard output of the final product.

[0058] Preferably, step S5 includes the following steps:

[0059] Step S51: Vectorize the contour of the accurate layout plan to obtain contour vector data; perform direction feature analysis based on the contour vector data to obtain direction feature data;

[0060] Step S52: Perform continuity analysis on the direction feature data to obtain a set of continuous segments; perform direction chain coding on the set of continuous segments to generate a cutting path direction chain;

[0061] Step S53: Construct a graph structure based on the cutting path direction chain to obtain an initial cutting path graph; perform optimal path search on the initial cutting path graph to obtain initial optimal path data;

[0062] Step S54: Perform collision detection based on the initial optimal path data to obtain safe path data; integrate the safe path data and the initial optimal path data to generate cutting path data.

[0063] Through the implementation of contour vectorization for the precise layout scheme, the present invention can convert layout information into processable vector data. The generated contour vector data provides a basis for direction feature analysis. The implementation of direction feature analysis can extract key direction information, and the obtained direction feature data lays a foundation for subsequent continuity analysis. The implementation of continuity analysis on the direction feature data can identify a set of continuous segments, and the generated set of continuous segments supports direction chain coding. The implementation of direction chain coding can convert contour information into a cutting path direction chain. The implementation of graph structure construction based on the cutting path direction chain provides a framework for path planning. The obtained initial cutting path graph provides a data basis for subsequent path optimization. The implementation of optimal path search on the initial cutting path graph can identify the best cutting scheme, and the generated initial optimal path data provides a basis for collision detection. The implementation of collision detection based on the initial optimal path data can ensure cutting safety, and the obtained safe path data supports the final path integration. The implementation of data integration for the safe path data and the initial optimal path data can generate the final cutting path data, comprehensively improving the safety and effectiveness of lens laser cutting and ensuring the efficiency and accuracy of the cutting process.

[0064] The present invention also provides a lens laser cutting automatic typesetting and mapping system for executing the above-mentioned lens laser cutting automatic typesetting and mapping method. The lens laser cutting automatic typesetting and mapping system includes:

[0065] An image acquisition module for acquiring an image of the lens to be cut; performing contour edge detection on the image of the lens to be cut to obtain an image edge curve; and performing continuous contour discrete direction mapping on the image of the lens to be cut based on the image edge curve to generate a contour direction sequence.

[0066] A model reconstruction module for performing polygon fitting on the contour direction sequence to obtain screened contour data; and performing three-dimensional contour modeling based on the screened contour data to generate a reconstructed lens model.

[0067] A contour segmentation module for performing contour classification and clustering processing on the reconstructed lens model to obtain lens contour feature data; and performing contour segmentation on the reconstructed lens model according to the lens contour feature data to obtain a segmented lens contour model.

[0068] A layout design module for performing range-limiting screening on the segmented lens contour model to obtain a compressed range contour model; and performing local fine typesetting processing on the compressed range contour model to obtain a precise layout scheme.

[0069] A path planning module for constructing a direction chain according to the precise layout scheme to obtain a cutting path direction chain; and performing cutting path planning on the precise layout scheme based on the cutting path direction chain to generate cutting path data.

[0070] An execution setting module, configured to perform sequential execution setting on the cutting path data based on a preset blank drawing template to obtain a cutting layout template, so as to execute an automatic layout drawing method for lens laser cutting.

[0071] Through the implementation of the image acquisition module in the present invention, the image information of the lens to be cut can be accurately obtained. The implementation of contour edge detection can extract clear edge curves. The generated contour direction sequence provides a basis for subsequent modeling and cutting path planning. The implementation of polygon fitting on the contour direction sequence can optimize data processing. The obtained screened contour data provides a basis for three-dimensional model reconstruction. The reconstructed lens model generated by the model reconstruction module can efficiently reflect the geometric features of the lens. The implementation of the contour segmentation module processing the model through classification and clustering can accurately extract the characteristic data of the lens. The obtained lens contour characteristic data provides support for segmentation. The range limitation screening of the layout design module can ensure the applicability of the model. The generated compressed range contour model provides a basis for local fine layout. The implementation of local layout processing can optimize the layout scheme. The obtained precise layout scheme provides a clear direction for subsequent path planning. The path planning module can ensure the rationality of the cutting path through direction chain construction. The generated cutting path data provides a basis for the final layout. The implementation of the execution setting module performing sequential execution setting through the blank drawing template can achieve automatic layout. The finally formed cutting layout template ensures the efficiency and accuracy of laser cutting, and improves the overall quality and efficiency of lens cutting. Description of the Drawings

[0072] Figure 1 It is a schematic diagram of the step flow of an automatic layout drawing method for lens laser cutting;

[0073] Figure 2 It is a schematic diagram of the detailed implementation step flow of step S2;

[0074] Figure 3 It is a schematic diagram of the detailed implementation step flow of step S3.

[0075] The realization, functional features and advantages of the purpose of the present invention will be further described with reference to the embodiments and the drawings. Detailed Embodiments

[0076] The technical method of the present invention will be clearly and completely described below with reference to the drawings. Obviously, the described embodiments are some of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0077] In addition, the attached drawings are only schematic illustrations of the present invention and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus repeated descriptions thereof will be omitted. Some of the block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. The functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor methods and / or microcontroller methods.

[0078] It should be understood that although terms such as "first" and "second" may be used herein to describe various units, these units should not be limited by these terms. These terms are only used to distinguish one unit from another. For example, without departing from the scope of the exemplary embodiments, the first unit may be referred to as the second unit, and similarly the second unit may be referred to as the first unit. The term "and / or" used herein includes any and all combinations of one or more of the listed associated items.

[0079] To achieve the above object, please refer to Figures 1 to 3 , a method for automatic layout and mapping of lens laser cutting, comprising the following steps:

[0080] Step S1: Collect the image of the lens to be cut; perform contour edge detection on the image of the lens to be cut to obtain the image edge curve; perform continuous contour discrete direction mapping on the image of the lens to be cut based on the image edge curve to generate a contour direction sequence;

[0081] Step S2: Perform polygon fitting on the contour direction sequence to obtain screened contour data; perform contour three-dimensional modeling based on the screened contour data to generate a reconstructed lens model;

[0082] Step S3: Perform contour classification and clustering processing on the reconstructed lens model to obtain lens contour feature data; perform contour segmentation on the reconstructed lens model according to the lens contour feature data to obtain a segmented lens contour model;

[0083] Step S4: Perform range limit screening on the segmented lens contour model to obtain a compressed range contour model; perform local fine layout processing on the compressed range contour model to obtain an accurate layout scheme;

[0084] Step S5: Construct a direction chain according to the accurate layout scheme to obtain a cutting path direction chain; perform cutting path planning on the accurate layout scheme based on the cutting path direction chain to generate cutting path data;

[0085] Step S6: Based on a preset blank drawing template, perform sequential execution settings on the cutting path data to obtain a cutting layout template for implementing the automatic layout drawing method for lens laser cutting.

[0086] Through the implementation of collecting the images of the lenses to be cut, the present invention can obtain accurate image information. The implementation of contour edge detection can extract clear edge curves. The generated contour direction sequence provides a basis for subsequent processing. The implementation of polygon fitting on the contour direction sequence can optimize the contour data. The obtained screened contour data provides a basis for 3D modeling. The implementation of 3D contour modeling based on the screened contour data can generate a high-precision reconstructed lens model. The implementation of classification and clustering processing on the reconstructed lens model can extract feature data. The generated lens contour feature data provides support for segmentation. The implementation of contour segmentation on the model according to the feature data can obtain a segmented contour model. The implementation of range-limited screening can ensure the applicability of the model. The generated compressed range contour model provides a basis for local layout. The implementation of local fine layout processing can optimize the layout scheme. The obtained precise layout scheme provides a clear direction for cutting path planning. The implementation of constructing a cutting path direction chain according to the layout scheme can ensure the rationality of cutting. The generated cutting path data provides a basis for subsequent layout. The implementation of sequential execution settings based on a blank drawing template can achieve automatic layout. The finally formed cutting layout template ensures the efficiency and accuracy of laser cutting.

[0087] In the embodiment of the present invention, refer to Figure 1 , which is a schematic diagram of the step flow of a method for automatic layout drawing of lens laser cutting according to the present invention. In this example, the method for automatic layout drawing of lens laser cutting includes the following steps:

[0088] Step S1: Collect the images of the lenses to be cut; perform contour edge detection on the images of the lenses to be cut to obtain image edge curves; perform continuous contour discrete direction mapping on the images of the lenses to be cut based on the image edge curves to generate a contour direction sequence;

[0089] In this embodiment, an image of the lens to be cut is obtained through a high-resolution industrial camera or image acquisition system, ensuring that the resolution of the image reaches at least 300 dpi or above to guarantee the accurate capture of details. Then, the Canny edge detection algorithm is used to process the image to extract the edge information of the lens image. After secondary Gaussian smoothing, a clear image edge curve is obtained. Next, the image is divided into the background and contour parts through an adaptive threshold segmentation method, and the precise contour curve is further extracted. Subsequently, the extracted contour edge curve is discretized, and the least squares method is used to fit the curve and evenly distribute the points to ensure that the interval of each discrete point remains consistent. Then, according to the edge curve of the image, the discrete direction mapping of the contour direction is performed through the normal direction method to generate a contour direction sequence containing all discrete direction angles. The formed sequence is represented by angle information, describing the direction change of each cutting point, providing basic data for subsequent path planning.

[0090] Step S2: Perform polygon fitting on the contour direction sequence to obtain screened contour data; based on the screened contour data, perform three-dimensional modeling of the contour to generate a reconstructed lens model;

[0091] In this embodiment, polygon fitting is performed on each direction angle data in the contour direction sequence, and it is converted into a polygon contour through the minimum error method. The redundant points are removed using the polygon simplification algorithm, and only the key points that can best represent the lens contour are retained. Based on the screened contour data, a closed polygon is generated as the basis for subsequent three-dimensional modeling. Subsequently, the polygon contour data is mapped into a three-dimensional coordinate system, and a three-dimensional modeling software (such as CAD tool) is used to convert this data into a three-dimensional model. According to parameters such as the thickness and curvature of the lens, the three-dimensional shape of the lens is accurately modeled, simulating its actual size and appearance, and completing the generation of the three-dimensional reconstructed lens model. The entire modeling process is based on standardized parameters and fitting data, and through optimizing the mesh division, the accuracy and stability of the model are guaranteed. The finally obtained three-dimensional model meets the cutting requirements and accurately represents the shape and contour of the lens.

[0092] Step S3: Perform contour classification and clustering processing on the reconstructed lens model to obtain lens contour feature data; according to the lens contour feature data, perform contour segmentation on the reconstructed lens model to obtain a segmented lens contour model;

[0093] In this embodiment, after the reconstructed lens model is generated, the K-means clustering algorithm is first used to classify each part of the contour. According to the characteristics of the lens such as size, shape, and edge curvature, the contour of the lens is divided into several categories, and statistical analysis is performed on the contour features of different categories to extract the shape features of the lens, including common contour forms such as circular, elliptical, and rectangular. Furthermore, each contour part is further normalized in size to ensure that all contour data has a consistent comparison benchmark. Then, according to the obtained contour feature data, the reconstructed lens model is segmented. Based on the contour feature values, the lens contour is divided into multiple parts suitable for laser cutting using a segmented cutting algorithm. The cutting path of each part is appropriately simplified or refined according to the complexity of its contour to reduce the phenomenon of overly long or short cutting paths. The finally obtained segmented lens contour model can effectively guide the subsequent generation of cutting paths.

[0094] Step S4: Perform range-limited screening on the segmented lens contour model to obtain a compressed range contour model; perform local fine layout processing on the compressed range contour model to obtain an accurate layout plan;

[0095] In this embodiment, for the segmented lens contour model, range-limited screening is performed. By setting a predetermined regional range parameter, the parts of the lens contour that exceed this range are screened out, and only the parts within the range suitable for the laser cutting process are retained within the lens. A computational geometry algorithm is used to determine the effective cutting area of the lens, and the irrelevant parts outside the model are excluded through a screening algorithm, thereby obtaining a compressed range contour model. This model only retains the lens area applicable to the current cutting task. Next, local fine layout processing is performed on the compressed range contour model. Using a heuristic layout algorithm, for the shape features of each lens cutting area, the relative positions of each cutting part are adjusted through local optimization methods to maximize the use of cutting materials, ensuring that the cutting paths do not overlap and have an appropriate spacing, thereby obtaining an accurate layout plan. This plan takes into account the material, thickness of the lens, and the power distribution of the laser to ensure the high efficiency and high precision of laser cutting.

[0096] Step S5: Construct a direction chain according to the accurate layout plan to obtain a cutting path direction chain; perform cutting path planning on the accurate layout plan based on the cutting path direction chain to generate cutting path data;

[0097] In this embodiment, a direction chain of the cutting path is constructed. According to the relative positions and directions of each cutting area, the cutting paths are connected in sequence to form a direction chain. The path tracking algorithm is adopted to ensure the rationality of the cutting sequence and minimize the moving time of the laser cutting machine as much as possible. The path chain of each lens cutting part is constructed through the shortest path algorithm (such as Dijkstra algorithm). Subsequently, according to the direction chain of the cutting path, the cutting path planning is carried out for each lens area. The starting point, ending point and turning points on the path of each cutting path are determined through the optimization algorithm to ensure the continuity and optimal path during the cutting process, and the cutting path data is generated. The path data includes information such as the coordinates of each cutting point, the path direction and the laser parameters, etc., to ensure that the cutting machine can accurately cut according to the planned path during execution.

[0098] Step S6: Based on a preset blank drawing template, perform sequential execution settings on the cutting path data to obtain a cutting layout template for implementing the automatic layout drawing method for lens laser cutting.

[0099] In this embodiment, a preset blank drawing template is adopted. By calibrating the blank area and the lens cutting area in the template, the cutting path data is automatically matched with the blank template to ensure that the cutting path can meet the predetermined layout requirements. The path sorting algorithm is used to perform sequential execution settings on the cutting path data to ensure that the path sequence of the cutting machine is consistent with the layout of the drawing template. Through the sequential execution settings, each cutting path is docked with the blank area in the preset template, and the starting point and ending point of the path are adjusted according to the specific size and shape of the lens. Finally, a layout template that meets the cutting requirements is generated. This template can be directly imported into the laser cutting control system to ensure that the execution of the cutting path meets the cutting requirements of the lens. Each path in the layout template has been finely optimized to ensure that the cutting machine can complete the task with the minimum time cost and the highest precision during the cutting process.

[0100] Preferably, step S1 includes the following steps:

[0101] Step S11: Collect the image of the lens to be cut; perform brightness equalization correction on the image of the lens to be cut to obtain a brightness equalized image;

[0102] Step S12: Perform bilateral filtering denoising on the brightness equalized image to generate a denoised lens image; perform contour edge detection on the denoised lens image to obtain an image edge curve;

[0103] Step S13: Perform eight-direction chain code encoding on the image edge curve to obtain a direction encoding sequence;

[0104] Step S14: Perform continuous contour discrete direction mapping on the image of the lens to be cut according to the direction encoding sequence to generate a contour direction sequence.

[0105] In this embodiment, a high-resolution industrial camera (e.g., a CCD camera with a resolution of 5000x5000) is used to capture the lens to be cut, ensuring that the lens image can cover its entire view. At the same time, a uniform light source system is adopted to avoid image quality problems caused by uneven illumination. During the shooting, the camera shutter speed is 1 / 1000 second, and the ISO value is set to 100 to reduce image noise. After obtaining the lens image, contrast limited adaptive histogram equalization (CLAHE) is used to correct the brightness of the image. During the correction process, the size of each small region (tiles) is selected to be 32x32 pixels. By adjusting the local contrast, the brightness distribution of the image is ensured to be uniform. Bilateral filtering is applied to the lens image after brightness equalization to reduce noise. The parameters of the filtering are set as the spatial neighborhood radius is 5 pixels and the standard deviation of the intensity value is 50. Bilateral filtering can effectively remove the noise in the image while retaining the edge information. The filtered image is smooth without losing details. Next, the Canny edge detection algorithm is used for edge detection. The thresholds of the Canny algorithm are set to 100 and 200. First, Gaussian filtering is performed on the image (the Gaussian kernel size is 5x5, and the standard deviation is 1.4), Remove the residual noise, then calculate the gradient value of the image, perform non-maximum suppression, and finally obtain the edge curve of the lens image through thresholding. The obtained edge curve shows the precise shape of the lens contour. Based on the edge curve of the image, encoding is performed using the eight-direction chain code. First, the edge curve is discretized into a series of pixel points, the reference direction is set to "up", each edge point is connected to its adjacent edge points, and its direction is calculated and marked. Encoding is performed using eight directions, namely: 0 degrees (right), 45 degrees (upper right), 90 degrees (up), 135 degrees (upper left), 180 degrees (left), 225 degrees (lower left), 270 degrees (down), and 315 degrees (lower right). For each edge point, an encoding value between 0 and 7 is assigned according to its positional relationship with the previous point. The generated direction encoding sequence can accurately describe the direction and turning of each edge point, forming a complete chain code sequence. Based on the direction encoding sequence, by combining the chain code sequence with the coordinate information of the image, contour discrete direction mapping is performed. First, the image area corresponding to each segment of the chain code is analyzed, the corresponding direction vector is constructed on the coordinate plane according to the encoding value, the direction change of each point relative to its previous point is determined, and combined with the spatial position of the image and the bending degree of the contour curve, each direction chain code is mapped to the continuous contour direction in sequence. In this way, a continuous contour direction sequence is obtained. The generated direction sequence presents the change trend of the lens contour in different directions, can effectively reflect the geometric shape and cutting path of the lens contour, and ensures that the subsequent laser cutting path planning can be efficiently optimized based on this data.

[0106] Preferably, step S2 includes the following steps:

[0107] Step S21: Perform density clustering analysis on the contour direction sequence to obtain key point distribution data; calculate the inter-point distance for the key point distribution data to generate an inter-point distance matrix;

[0108] Step S22: Perform threshold segmentation processing on the contour direction sequence according to the inter-point distance matrix to generate segmentation boundary data; perform polygon fitting on the contour direction sequence based on the segmentation boundary data to obtain filtered contour data;

[0109] Step S23: Extract geometric features from the filtered contour data to obtain a contour geometric feature description set; perform contour depth mapping based on the contour geometric feature description set to generate depth mapping data;

[0110] Step S24: Perform anisotropic diffusion filtering on the depth mapping data to obtain a smoothed depth map; perform contour three-dimensional modeling on the filtered contour data based on the smoothed depth map to generate a reconstructed lens model.

[0111] In this embodiment, according to the characteristics of the contour direction sequence, the DBSCAN (Density-Based Spatial Clustering of Applications with Noise) algorithm is used for density clustering. The minimum number of samples is set to 4, and the distance threshold is set to 0.1 pixel. Density clustering can group adjacent direction points into the same class based on the distance relationship between points, and obtain the key points of each cluster. The key points are the center points in the cluster, representing the significant features of the contour change. Then, based on the key point positions, the inter-point distance is calculated, and the Euclidean distance between each pair of key points is calculated to generate a point-spacing matrix. This matrix reflects the relative position relationship between the key points. The size of the matrix is the square of the number of key points, and each element in the matrix represents the distance between the corresponding key point pair. A distance threshold (for example, 0.3 pixel) is set to determine whether each element in the point-spacing matrix exceeds this threshold. If the distance is greater than the threshold, it is regarded as the segmentation boundary of the contour, and the start and end points of the segmentation are recorded to obtain the segmentation boundary data. Based on these segmentation boundaries, the least squares method is used to perform polygon fitting on each segment of the contour direction sequence. The degree of the fitted polygon is selected as 3 (i.e., a triangle), and polygon fitting is performed on each segment of the contour to obtain the fitted point set. Subsequently, according to the fitting results, the contour data that meet the requirements are screened. The screening criterion is that the fitting error is less than 0.05 pixel, and the data that do not conform to the contour characteristics with too large fitting errors are excluded to obtain the screened contour data. The edge detection algorithm is used to extract the boundary points of each contour, and geometric features such as the perimeter, area, compactness, and curvature of each contour are calculated. Among them, the perimeter is calculated as the total length of the line segments between the points of the contour, the area is calculated as the total number of pixel points inside the contour, the compactness is represented by the ratio of the perimeter to the area of the contour, and the curvature is measured by calculating the curvature change of each point of the contour to obtain a series of geometric feature data, forming a contour geometric feature description set. Then, based on these geometric features, contour depth mapping is performed, and a deep learning algorithm is used for spatial mapping of the contour features. The input of the network is set as the geometric feature description set, and the output is the depth mapping data. The depth mapping data is the depth information of each contour point in the three-dimensional space, which can accurately describe the spatial position and shape of each point. The diffusion coefficient is set to 0.5. Adjust the diffusion intensity of each point in different directions, perform smoothing processing in the direction based on the gradient information of the pixel points. The diffusion filter can effectively suppress noise according to the edge information while retaining the details of the contour. By setting the number of iterations to 20 times and performing multiple diffusion processes, a smooth depth map is finally obtained. Next, based on the smooth depth map, a 3D reconstruction algorithm (such as the Marching Cubes algorithm) is used for 3D modeling. By combining the contour data with the depth information, a 3D lens model is generated. During 3D modeling, first convert the depth map data into a mesh model. The mesh is subdivided into multiple small triangles, and the accuracy is set to 1 pixel. On this basis, by solving the normal vector, the reconstruction of the 3D contour is completed, and finally a high-precision 3D lens model is generated, providing accurate geometric data for the subsequent laser cutting path planning.

[0112] Preferably, step S22 includes the following steps:

[0113] Perform feature statistical processing on the point spacing matrix to obtain distance feature data; perform dynamic threshold calculation based on the distance feature data to generate a set of threshold parameters;

[0114] Perform sliding window analysis on the contour direction sequence to obtain local feature data; perform direction change rate analysis based on the local feature data to generate a direction change rate sequence;

[0115] Perform peak detection on the direction change rate sequence to obtain a set of change rate key points; perform matching and screening on the set of change rate key points and the set of threshold parameters to generate candidate segmentation points;

[0116] Perform threshold segmentation processing on the contour direction sequence according to the candidate segmentation points to generate segmentation boundary data;

[0117] Perform feature geometric analysis on the segmentation boundary data to obtain feature geometric attributes; perform fitting constraint construction based on the feature geometric attributes to generate a set of constraint conditions;

[0118] Perform polygon fitting on the contour direction sequence to obtain an initial fitting result; perform error calculation on the initial fitting result according to the set of constraint conditions to obtain error index data;

[0119] Perform angle adjustment and optimization based on the error index data to obtain an optimized fitting result; perform contour screening on the optimized fitting result to obtain screened contour data.

[0120] In this embodiment, the sum and standard deviation of each distance value in the dot pitch matrix are calculated to statistically obtain the average distance and standard deviation between each pair of points, resulting in distance feature data. The average distance value reflects the typical distance between contour points, while the standard deviation reflects the degree of dispersion of the distances between points. Based on these data, an adaptive algorithm is used to calculate the dynamic threshold. The threshold parameter calculation rule is that if the average distance is greater than twice the standard deviation, then this distance value is considered as the effective segmentation threshold. Through analysis, a series of threshold parameter sets are obtained. The window size of the sliding window is set to 5 data points. The contour direction sequence is gradually scanned through the sliding window. At each slide, the direction difference of the data points within the window is calculated, and its local feature data is extracted. The local feature data includes the average direction value and standard deviation within the current window. Through these feature data, the local change information of the contour can be captured. Then, based on the local feature data, the direction change rate analysis is carried out. The direction change rate is defined as the ratio of the maximum direction change to the minimum direction change within the window. In this way, a direction change rate sequence is obtained, which reflects the degree of change of the contour direction in different intervals. The parts with larger changes are identified as important contour features. Peak detection is performed on the direction change rate sequence. The peak detection algorithm (such as the second-order difference method) is used to process the direction change rate sequence. By detecting the peak points in the sequence, a set of change rate key points is obtained. These key points represent the regions with drastic direction changes and indicate the important turning points of the contour change. Then, the set of change rate key points is matched and screened with the previously calculated threshold parameter sets. During the matching process, for each change rate key point, it is checked whether it exceeds the corresponding threshold parameter. If it meets the conditions, it is used as a candidate segmentation point. If it does not meet the conditions, it is excluded, resulting in candidate segmentation points. According to the positions of each candidate segmentation point, the contour direction sequence is cut. The original sequence is divided into multiple subsequences according to the segmentation point positions. Within each subsequence, the local direction change situation is calculated. If the direction change within the subsequence exceeds the set threshold, then this subsequence is considered as an effective segmentation. Finally, the segmentation boundary data of the contour direction sequence is obtained. The segmentation boundary data contains the start and end positions of each subsequence, identifying different regions of the contour. Local geometric features are extracted for each segmented region. Features such as the perimeter, area, compactness, and curvature of each segment are calculated. The perimeter is the total length of the connection lines of the boundary points of each segment. The area is the total number of pixel points within the segment. The compactness is the ratio of the perimeter to the area. The curvature is calculated through the angular change of the segmentation boundary. Through these geometric features, the characteristic geometric attributes of each segment are obtained. Then, based on these geometric attributes, fitting constraints are constructed. A set of constraint conditions is set. For example, it is required that the ratio of the perimeter to the area of the segment does not exceed a certain threshold, and the curvature does not exceed a specific range. The least squares method is selected for fitting, and the degree of the fitted polygon is set to 3 (i.e., a triangle). Polygon fitting is performed on each segment of data to obtain the initial fitting result of each segment.The initial fitting result is the polygon vertex coordinates for each segment. Through this process, a rough contour shape is obtained. Then, based on the previously constructed set of constraints, error calculation is performed on the initial fitting result, calculating the error between the fitting result and the actual contour. By calculating error metrics (such as mean square error, maximum error, etc.), error metric data is obtained. The optimization goal is set to minimize the fitting error. Through an optimization algorithm (such as the gradient descent method), the vertex angles of the polygon are adjusted. During the optimization process, the angle parameters of the fitting polygon are gradually changed to minimize the error metric, obtaining an optimized fitting result. The optimized fitting result has higher accuracy and can more accurately represent the contour shape. Then, the optimized fitting result is subjected to contour screening, and the screening criterion is that the fitting error is less than 0.05 pixels. Through this screening step, the fitting results that do not meet the accuracy requirements are eliminated, and finally, the screened contour data is obtained, providing accurate contour information for subsequent depth mapping and 3D modeling.

[0121] Preferably, step S3 includes the following steps:

[0122] Step S31: Locate the edge points of the reconstructed lens model to obtain the model edge point set; calculate the curvature of the model edge point set to obtain the curvature feature vector;

[0123] Step S32: Perform principal component analysis on the reconstructed lens model according to the curvature feature vector to obtain the dimensionality-reduced feature data; perform mean clustering processing on the dimensionality-reduced feature data to generate the lens contour feature data;

[0124] Step S33: Locate the segmentation key points of the lens contour feature data to obtain the segmentation key point data;

[0125] Step S34: Based on the segmentation key point data, segment the contour of the reconstructed lens model to obtain the segmented lens contour model.

[0126] In this embodiment, edge point data is extracted from the reconstructed model, and the Canny edge detection algorithm is used to process the two-dimensional image of the lens model. The thresholds for edge detection are set to 0.3 and 0.6 to ensure accurate edge points are detected, obtaining a complete model edge point set. Then, the curvature of the model edge point set is calculated, and the discrete second derivative method is used to calculate the curvature value of each edge point. The curvature calculation formula is:

[0127] ;

[0128] where is the curvature value of the th point, is the The coordinates of the points. The curvature feature vector calculated using this formula includes the curvature information of each edge point. The curvature feature vector reflects the degree of curvature of the lens edge. By analyzing this vector, the shape and structural characteristics of the lens model can be identified. Matrixize the curvature feature vector and apply the PCA algorithm to reduce its dimension. The goal of PCA is to reduce the high-dimensional curvature feature data to two dimensions, reduce the feature dimension, and improve the data processing efficiency. During the PCA process, select the first two principal components (the directions of maximum variance) as the feature data after dimension reduction. The obtained dimension-reduced feature data contains the main geometric information of the lens model. Then, perform mean clustering on the dimension-reduced feature data. Use the K-means clustering algorithm to perform clustering analysis on the dimension-reduced data. Set the number of clusters to 3. By iteratively updating the means of the data points, finally obtain the lens contour feature data. The feature data contains the contour information of each part of the lens. Scan the feature data of the lens contour. Use the dynamic programming algorithm to determine the positions of the key segmentation points according to the geometric characteristics of the contour. The algorithm determines each segmentation point by minimizing the difference in contour curvature change and length. Set the threshold to 5 pixel units. When the curvature change between two adjacent points is greater than the set threshold, mark it as a key point. The calculation process uses the following formula:

[0129] ;

[0130] where, represents the curvature change between the current point and the previous key point. When the change is greater than the threshold, the position is the segmentation point. After completing this step, obtain the segmentation key point data of the lens contour. These key points represent the significant turning positions of the lens contour and can effectively divide different regions of the lens contour. According to the positions of the segmentation key points, draw segmentation lines on the edge point set of the lens model. Use the polynomial fitting method to segment each contour. The specific steps are as follows: Take the contour points between every two adjacent key points and use quadratic or cubic spline interpolation to fit these points to obtain accurate contour segmentation lines. Each segmented contour is a local area of the lens. Then, arrange the segmented local areas in order to obtain the segmented lens contour model. Each local area represents a part of the lens. The finally generated segmented lens contour model contains the complete geometric shape and characteristics of the lens, providing accurate contour data for subsequent laser cutting path planning.

[0131] Preferably, step S4 includes the following steps:

[0132] Step S41: Limit the envelope box range of the segmented lens contour model to obtain a set of boundary boxes; perform area optimization processing on the set of boundary boxes to generate compressed boundary data;

[0133] Step S42: Divide the feasible region according to the compression boundary data to obtain a limited feasible region; based on the limited feasible region, perform range-limited screening on the segmented lens contour model to obtain a compressed range contour model;

[0134] Step S43: Perform mesh division on the compressed range contour model to obtain lens contour mesh data; calculate the layout cost for the lens contour mesh data to obtain a layout cost matrix;

[0135] Step S44: Perform local fine layout processing according to the layout cost matrix to obtain an accurate layout plan.

[0136] In this embodiment, when performing envelope box range limitation on the segmented lens contour model, first identify the minimum bounding rectangle of the contour. The four sides of this rectangle are parallel to the farthest boundary points of the contour and tightly enclose the contour. The size of the boundary box is determined by extracting the set of boundary points of the contour. The generation of the boundary box depends on the envelope algorithm. For example, use the Convex Hull Algorithm to calculate the circumscribed rectangle, and the calculation formula is:

[0137] ;

[0138] Among them, are the four boundary values of the boundary box. The generated set of envelope boxes is the set of rectangular boxes containing all the contours. Then, perform area optimization on the boundary boxes. The goal is to reduce redundant regions. The optimization process includes minimizing the area of each envelope box, removing unnecessary blank regions, and adjusting by calculating the ratio of the area of each box to the actual size of the lens. The obtained compression boundary data reflects the optimized minimum range. Use a two-dimensional space division algorithm to divide the region. A common method is grid-based space segmentation, which divides the entire space into multiple grid cells, and the size of each cell is adjusted according to the compression boundary data to ensure that the divided regions meet the actual requirements. The feasible region for division is determined by screening the overlapping parts between the boundary boxes. Finally, a limited feasible region is obtained. Then, perform range-limited screening on the segmented lens contour model according to this region, select the valid contours within the limited region, and remove the parts that exceed or do not meet the size requirements. The compressed range contour model is thus generated. This model only contains the screened contour parts. According to the physical size of the lens and the required cutting accuracy, the model is divided into several uniform small grid cells. By defining the side length of the grid as to achieve mesh division. The calculation of the number of grids is:

[0139] ;

[0140] Among them, is the total area of the lens model, is the side length of each grid cell. After grid division, the lens contour grid data is obtained. Next, the layout cost calculation is performed on the grid data. The cost calculation formula considers factors such as the distance between grids, cutting efficiency, and material waste. Among them, the cost matrix is calculated as follows:

[0141] ;

[0142] Among them, is the layout cost between grid and grid, is the distance between grids, is the material waste, and are weight factors. According to the cost matrix, the layout is optimized to obtain the best layout plan. The heuristic optimization algorithm, such as the Genetic Algorithm or the Simulated Annealing Algorithm, is used to locally adjust the grids. The optimized layout plan reduces the overall cost of the cost matrix by adjusting the grid positions. The adjustment process considers the reasonable layout of the cutting area, the optimization of the edges, and the minimization of the equipment cutting time. The parameters in the calculation process include the cutting time of each grid cell, the equipment accuracy, and the floor area of each grid. The finally generated precise layout plan is obtained through a continuous optimization process in the shortest time. By calculating the final layout cost and efficiency, the feasibility of the precise layout plan is confirmed to achieve the final laser cutting layout design.

[0143] Preferably, step S42 includes the following steps:

[0144] Perform grid processing on the compressed boundary data to obtain boundary grid data; perform obstacle marking on the boundary grid data to generate obstacle grid data;

[0145] Based on the obstacle grid data, perform connected component identification on the boundary grid data to obtain a region connection graph; perform boundary extraction on the region connection graph to generate a limited feasible region;

[0146] According to the split lens contour model, perform position mapping on the limited feasible region to obtain position mapping data; perform boundary detection on the position mapping data to obtain boundary constraint data;

[0147] Based on the boundary constraint data, perform feasibility verification to obtain verification result data; optimize the range of the limited feasible region according to the verification result data to obtain a compressed feasible region;

[0148] Integrate regions of the compression feasible region to generate a compression range contour model.

[0149] In this embodiment, the compressed boundary data is mapped to a two-dimensional grid space, and a suitable grid cell size is selected, for example, set to l×l. This size needs to be determined according to the actual situation, and usually a size that can balance the calculation accuracy and calculation time is chosen. Then, the boundary region is divided into multiple grid cells, and those grid cells containing the boundary are marked. Then, according to the characteristics of the actual boundary region, using image recognition technology, the boundary is subdivided, and the positions of obstacles are gradually identified, such as irregular defects on the lens or parts that are discontinuous with the surrounding area. The grid cells corresponding to these regions are marked as obstacle grids, and the accuracy of the obstacle marking is optimized through image processing technology. Finally, obstacle grid data is obtained. After obtaining the obstacle grid data, connected component identification is performed. By using the adjacency rule (such as the 8-neighborhood rule), it is checked whether the neighborhood of each grid cell is connected, and then all connected regions are identified. To achieve this, a depth-first search (DFS) or breadth-first search (BFS) algorithm is used to traverse all grid cells, and all grid cells belonging to the same region are merged to form a region connectivity graph. Each node in the connectivity graph represents a connected region, and the edges represent the connection relationships between regions. When constructing the connectivity graph, the boundary positions, shapes, and areas of each region are recorded in detail. Then, boundary extraction is performed on the connectivity graph. With the help of image contour extraction technology, the actual boundary information is extracted from each region to obtain a defined feasible region. The contour data of the lens is converted into the grid coordinate system, and the Affine Transformation method is used to perform position mapping according to the key points (such as contour corner points or center points) in the model. This mapping process ensures the accurate spatial position relationship between the lens contour and the grid, and position mapping data is obtained. Then, boundary detection is performed on the mapped data. By using algorithms such as the Sobel operator or the Canny edge detection algorithm, the distance between the lens contour and the grid boundary is calculated, and boundary constraint data is generated. By calculating the shortest distance of the cutting path and matching it with the meshed region, it is checked whether the cutting path will cross obstacles or exceed the boundary of the feasible region. Ray-polygon intersection detection algorithm is used for collision detection to determine the interaction relationship between the path and obstacles or boundaries. If the path is valid, it means that the feasibility verification passes; otherwise, the path is readjusted. According to the verification result data, the range of the defined feasible region is optimized. Through the Particle Swarm Optimization (PSO) algorithm, the boundary of the feasible region is optimized, the shortest distance of the path is precisely adjusted, unnecessary blank regions are removed, and the cutting path is gathered into the available region as much as possible, so as to generate a compressed feasible region. The Minimum Spanning Tree (MST) algorithm is used to merge adjacent compressed regions into an overall region to ensure the continuity and obstacle-free nature after region integration. At this time, multiple originally independent regions are merged into a large region, and redundant space is removed.The finally generated compressed range contour model provides an accurate geometry for subsequent laser cutting path planning, ensuring that the cutting process can be carried out efficiently and accurately.

[0150] Preferably, step S44 includes the following steps:

[0151] Optimize the objective function according to the layout cost matrix to obtain the objective optimization function; perform initial layout simulation according to the objective optimization function to obtain the simulated initial layout;

[0152] Perform conflict detection on the simulated initial layout to obtain layout conflict points; perform local adjustment on the compressed range contour model based on the layout conflict points to obtain a local adjustment plan;

[0153] Perform layout evaluation on the local adjustment plan based on a preset layout scoring criterion to obtain a layout score; perform high-score local search on the layout score to obtain an optimized adjustment plan;

[0154] Perform boundary fine-tuning optimization according to the optimized adjustment plan to obtain a boundary-optimized layout; perform data integration on the boundary-optimized layout to generate an accurate layout plan.

[0155] In this embodiment, the objective function is optimized according to the layout cost matrix. Using the mathematical programming method, each element of the layout cost matrix is set to represent the cost of the cutting path or component position in the layout scheme. An optimization algorithm, such as the genetic algorithm (GA) or the particle swarm optimization algorithm (PSO), is adopted to find the optimal layout scheme. The objective optimization function aims to minimize the total value of the cost matrix or achieve optimization objectives such as the shortest path and the minimum cutting loss. After multiple iterations, the objective optimization function is obtained. Then, based on this objective optimization function, an initial layout simulation is carried out. By preliminarily arranging each lens profile, a preliminary layout is simulated. Usually, the simulated annealing algorithm is used to generate the initial layout. The initial temperature and the cooling rate are set. According to the objective optimization function, the position of each lens profile is gradually adjusted, and finally, the simulated initial layout is generated. The steps of the simulated initial layout include preliminarily arranging the lens profiles according to the generated objective optimization function in accordance with the space constraints, and calculating the simulated initial layout result. Conflict detection is performed on the simulated initial layout. Using a collision detection algorithm, such as the axis-aligned bounding box (AABB) collision detection, the lens profiles in the simulated initial layout are detected to find out which arrangements of the lens profiles have overlaps or inappropriate contacts. The specific steps include detecting the distance between every two lens profiles and calculating their boundary intersection situations, identifying all conflict points and recording them to obtain the layout conflict point data. Then, based on the layout conflict points, the compressed range contour model is locally adjusted. The generation of the local adjustment scheme is achieved by moving and rotating the lens profiles around the conflict area. A heuristic algorithm, such as the local search method, is used to adjust the layout around each conflict point to eliminate conflicts and optimize the space utilization rate, and a local adjustment scheme is obtained. The specific adjustment methods can be swapping positions, rotating angles, or scaling ratios to ensure that the lens profiles do not overlap and the gaps are minimized. The layout of the local adjustment scheme is evaluated based on a preset layout scoring criterion. The layout scoring criterion can include space utilization rate, cutting path length, lens gap size, etc. A weighted scoring algorithm is used to combine these factors to obtain the layout score. Specifically, in implementation, by combining the position, shape, and gap data of each lens, the score of the current layout is calculated. A layout with a high score indicates good space utilization rate, a shorter cutting path, and no conflicts. Then, a high-score local search is performed on the layout score. A local search strategy (such as simulated annealing or local optimal search) is adopted to further optimize the scheme with a higher layout score. During the search process, by repeatedly adjusting the local area and increasing the details of the local adjustment, the layout score is continuously improved, and finally, an optimized adjustment scheme is obtained. During the optimization process, the optimal solution is approximated through multiple simulations and evaluations. According to the optimized adjustment scheme, boundary fine-tuning optimization is carried out.Boundary fine-tuning mainly involves the refined adjustment of the boundaries of the profiles of each lens in the layout to ensure the smallest gap between each lens and a reasonable distance from the cutting path. The fine-tuning is minimized through a mathematical model such as Quadratic Programming. During the optimization process, the geometric characteristics of each lens profile and the distance constraints with surrounding lenses are considered to further improve the space utilization rate and optimize the cutting path without introducing new conflicts. The fine-tuned boundary data forms a new layout model after careful adjustment to ensure it meets the cutting requirements and process standards. Finally, data integration is performed on the boundary-optimized layout, and all optimized layout information is uniformly encoded to form a complete dataset for easy reading and execution by the subsequent laser cutting control system, ultimately generating an accurate layout plan that can be directly input into the laser cutting equipment.

[0156] Preferably, step S5 includes the following steps:

[0157] Step S51: Vectorize the profile of the accurate layout plan to obtain profile vector data; analyze the direction features based on the profile vector data to obtain direction feature data;

[0158] Step S52: Analyze the continuity of the direction feature data to obtain a set of continuous segments; perform direction chain coding on the set of continuous segments to generate a cutting path direction chain;

[0159] Step S53: Construct a graph structure based on the cutting path direction chain to obtain an initial cutting path graph; search for the optimal path in the initial cutting path graph to obtain initial optimal path data;

[0160] Step S54: Perform collision detection based on the initial optimal path data to obtain safe path data; integrate the safe path data and the initial optimal path data to generate cutting path data.

[0161] In this embodiment, the contour of the precise layout scheme is vectorized to extract the cutting contour of the lens. The boundary of each contour is converted into a vector representation. The Bezier Curve or Spline Curve is used to fit each part of the contour, and the boundary of the contour is represented by a set of vector points. Line segments are used to connect these points to ensure accuracy and smoothness, obtaining the complete contour vector data. Then, based on the contour vector data, direction feature analysis is performed. By calculating the angle between the direction of each vector segment and the adjacent segment, the direction feature data is obtained. Specifically, the vector calculation formula is used to analyze each pair of adjacent line segments, calculate the angle value, and judge its direction change to obtain the direction feature of each cutting path segment. The generation of direction feature data includes calibrating the angle of each line segment. By calculating the change trend of the angle between adjacent line segments, the direction information of the continuous cutting path is obtained. Continuity analysis is performed on the direction feature data to check whether there is a continuous change between each direction feature data. The sliding window technique is used to analyze the direction data. First, a threshold is set to determine the continuity of the direction. If the angle change between two adjacent direction features is less than the preset threshold, it is considered that these two direction features belong to the same continuous segment; otherwise, it indicates a direction change, further obtaining the continuous segment set. Then, direction chain coding is performed on the continuous segment set to generate the cutting path direction chain. Direction chain coding forms the identifier of the continuous direction by mapping each continuous segment to a unique coding value. Specifically, in implementation, the hash algorithm-based method is used to code the direction change of each continuous segment. The path segments are numbered according to the direction chain based on the direction change, so that all the direction chains on each cutting path are connected in sequence to form the complete cutting path direction chain. Based on the cutting path direction chain, a graph structure is constructed. Each cutting path is regarded as a node, and the connection relationship of the direction chain is regarded as an edge to construct a directed graph. In this graph, each node represents a cutting path segment, and the edge represents the connection between path segments. The connection order of the nodes in the graph is set according to the actual arrangement of the cutting paths, obtaining the initial cutting path graph. Then, an optimal path search is performed on the initial cutting path graph. The shortest path algorithm (such as Dijkstra algorithm) is used to optimize the path selection. By calculating the cost of each path (such as time, distance, cutting complexity, etc.), the path with the lowest cost is selected as the optimal path data. Specifically, in implementation, first, the cost of each path in the graph is calculated. The cost calculation formula is:

[0162] ;

[0163] wherein, represents the length of the path segment, represents the time consumption of the path segment, and is the weight coefficient. The total cost of the path is obtained through this formula, and the path with the minimum cost is selected for further processing to obtain the initial preferred path data. Through a geometric collision detection algorithm, such as AABB (Axis-Aligned Bounding Box) or spherical collision detection, it is checked whether there is a collision with other cutting paths or lens profiles in the path. The cutting path and the lens profile are divided into multiple small units in a grid-like manner, and it is checked whether there is an intersection in each unit. By detecting the relative position relationship between path segments, the safe path data is obtained. Then, the safe path data and the initial preferred path data are integrated. The preferred path and the safe path are combined for the final optimization process. Specifically, when implementing, the path segments are combined in sequence to form complete cutting path data. At the same time, according to the actual cutting requirements, the path order is adjusted and the path bending angle is optimized to ensure that while ensuring path safety, unnecessary movements are reduced. Finally, the cutting path data is generated and output in a format that the cutting machine can recognize, such as G-code (G-code).

[0164] The present invention also provides a system for automatic layout and drawing of lens laser cutting, which is used to execute the method for automatic layout and drawing of lens laser cutting as described above. The system for automatic layout and drawing of lens laser cutting includes:

[0165] An image acquisition module, which is used to acquire the image of the lens to be cut; perform contour edge detection on the image of the lens to be cut to obtain the image edge curve; and generate a contour direction sequence based on the image edge curve for the image of the lens to be cut through continuous contour discrete direction mapping.

[0166] A model reconstruction module, which is used to perform polygon fitting on the contour direction sequence to obtain the screened contour data; and generate a reconstructed lens model based on the screened contour data through contour three-dimensional modeling.

[0167] A contour segmentation module, which is used to perform contour classification and clustering processing on the reconstructed lens model to obtain the lens contour feature data; and perform contour segmentation on the reconstructed lens model according to the lens contour feature data to obtain the segmented lens contour model.

[0168] A layout design module, which is used to perform range limit screening on the segmented lens contour model to obtain the compressed range contour model; and perform local fine layout processing on the compressed range contour model to obtain an accurate layout plan.

[0169] A path planning module, which is used to construct a cutting path direction chain according to the accurate layout plan to obtain the cutting path direction chain; and perform cutting path planning on the accurate layout plan based on the cutting path direction chain to generate cutting path data.

[0170] An execution setting module is used to perform sequential execution settings on the cutting path data based on a preset blank drawing template to obtain a cutting layout template for implementing an automatic layout drawing method for lens laser cutting.

[0171] Through the implementation of the image acquisition module in the present invention, the image information of the lens to be cut can be accurately obtained. The implementation of contour edge detection can extract clear edge curves. The generated contour direction sequence provides a basis for subsequent modeling and cutting path planning. The implementation of polygon fitting on the contour direction sequence can optimize data processing, and the obtained screened contour data provides a basis for three-dimensional model reconstruction. The reconstructed lens model generated by the model reconstruction module can efficiently reflect the geometric characteristics of the lens. The implementation of the contour segmentation module to process the model through classification and clustering can accurately extract the feature data of the lens, and the obtained lens contour feature data provides support for segmentation. The range-limited screening of the layout design module can ensure the applicability of the model, and the generated compressed range contour model provides a basis for local fine layout. The implementation of local layout processing can optimize the layout scheme, and the obtained precise layout scheme provides a clear direction for subsequent path planning. The path planning module can ensure the rationality of the cutting path through the construction of a direction chain, and the generated cutting path data provides a basis for the final layout. The implementation of the execution setting module to perform sequential execution settings through a blank drawing template can achieve automatic layout. The finally formed cutting layout template ensures the efficiency and accuracy of laser cutting, improving the overall quality and efficiency of lens cutting.

[0172] Therefore, from any perspective, the embodiments should be regarded as exemplary and non-restrictive. The scope of the present invention is defined by the appended claims rather than the above description. Therefore, it is intended to encompass all changes within the meaning and scope of the equivalent elements of the application documents in the present invention.

[0173] The above are only specific implementation manners of the present invention, enabling those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be obvious to those skilled in the art. The general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to these embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features invented herein.

Claims

1. A method for automatic layout and drawing for lens laser cutting, characterized in that: The following steps are involved: Step S1: collecting an image of a lens to be cut; performing contour edge detection on the image of the lens to be cut to obtain an image edge curve; performing continuous contour discrete direction mapping on the image of the lens to be cut based on the image edge curve to generate a contour direction sequence; Step S2: polygon fitting is performed on the contour direction sequence to obtain screening contour data; three-dimensional contour modeling is performed based on the screening contour data to generate a reconstructed lens model; Step S3: performing contour classification and clustering processing on the reconstructed lens model to obtain lens contour feature data; performing contour segmentation on the reconstructed lens model according to the lens contour feature data to obtain a segmented lens contour model; Step S4: performing range-limited screening on the segmented lens contour model to obtain a compressed range contour model; performing local fine layout processing on the compressed range contour model to obtain an accurate layout solution, wherein step S4 includes the following steps: Step S41: limiting the scope of the segmented lens contour model by an envelope frame to obtain a collection of boundary frames; performing area optimization processing on the collection of boundary frames to generate compressed boundary data; Step S42: dividing the feasible area according to the compressed boundary data to obtain a limited feasible area; performing range-limited screening on the segmented lens contour model based on the limited feasible area to obtain a compressed range contour model; Step S43: meshing the compressed range contour model to obtain lens contour mesh data; performing layout cost calculation on the lens contour mesh data to obtain a layout cost matrix; Step S44: Perform local fine layout processing according to the layout cost matrix to obtain an accurate layout solution, wherein step S44 includes the following steps: Optimize the objective function according to the layout cost matrix to obtain the objective optimization function; perform initial layout simulation according to the objective optimization function to obtain a simulated initial layout; Perform conflict detection on the simulated initial layout to obtain layout conflict points; perform local adjustment on the compressed range contour model based on the layout conflict points to obtain a local adjustment plan; Based on the preset layout scoring standard, the local adjustment plan is evaluated for layout to obtain a layout score; the layout score is searched locally for high scores to obtain an optimized adjustment plan; Perform boundary fine-tuning optimization according to the optimization adjustment plan to obtain boundary optimization layout; integrate data of boundary optimization layout to generate accurate layout plan; Step S5: constructing a direction chain according to the precise layout scheme to obtain a cutting path direction chain; planning a cutting path for the precise layout scheme based on the cutting path direction chain to generate cutting path data; Step S6: sequentially executing and setting the cutting path data based on a preset blank drawing template to obtain a cutting layout template to execute the automatic layout and drawing method for lens laser cutting.

2. The automatic layout and drawing method for lens laser cutting according to claim 1, characterized in that: Step S1 includes the following steps: Step S11: collecting an image of the lens to be cut; performing brightness balance correction on the image of the lens to be cut to obtain a brightness balanced image; Step S12: performing bilateral filtering to reduce noise on the brightness-balanced image to generate a reduced-noise lens image; performing contour edge detection on the reduced-noise lens image to obtain an image edge curve; Step S13: Encode the edge curve of the image using eight-direction chain codes to obtain a direction code sequence; Step S14: performing continuous contour discrete direction mapping on the image of the lens to be cut according to the direction coding sequence to generate a contour direction sequence.

3. The automatic layout and drawing method for lens laser cutting according to claim 1, characterized in that: Step S2 includes the following steps: Step S21: performing density cluster analysis on the contour direction sequence to obtain key point distribution data; performing point distance calculation on the key point distribution data to generate a point spacing matrix; Step S22: performing threshold segmentation processing on the contour direction sequence according to the point spacing matrix to generate segment boundary data; performing polygon fitting on the contour direction sequence based on the segment boundary data to obtain filtered contour data; Step S23: extracting geometric features from the screened contour data to obtain a contour geometric feature description set; performing contour depth mapping based on the contour geometric feature description set to generate depth mapping data; Step S24: performing anisotropic diffusion filtering on the depth mapping data to obtain a smooth depth map; performing contour three-dimensional modeling on the screened contour data based on the smooth depth map to generate a reconstructed lens model.

4. The automatic layout and drawing method for lens laser cutting according to claim 3, characterized in that: Step S22 includes the following steps: Perform feature statistics processing on the point spacing matrix to obtain distance feature data; perform dynamic threshold calculation based on the distance feature data to generate a threshold parameter set; Perform sliding window analysis on the contour direction sequence to obtain local feature data; perform direction change rate analysis based on the local feature data to generate a direction change rate sequence; Perform peak detection on the direction change rate sequence to obtain a set of change rate key points; perform matching and screening on the set of change rate key points and the set of threshold parameters to generate candidate segmentation points; Perform threshold segmentation processing on the contour direction sequence according to the candidate segmentation points to generate segmentation boundary data; Perform feature geometry analysis on segmented boundary data to obtain feature geometry attributes; construct fitting constraints based on the feature geometry attributes to generate a constraint condition set; Perform polygon fitting on the contour direction sequence to obtain an initial fitting result; perform error calculation on the initial fitting result according to the constraint condition set to obtain error index data; Angle adjustment optimization is performed based on the error index data to obtain an optimized fitting result; and contour screening is performed on the optimized fitting result to obtain screened contour data.

5. The automatic layout and drawing method for lens laser cutting according to claim 1, characterized in that: Step S3 includes the following steps: Step S31: locating edge points of the reconstructed lens model to obtain a model edge point set; calculating the curvature of the model edge point set to obtain a curvature feature vector; Step S32: performing principal component analysis on the reconstructed lens model according to the curvature feature vector to obtain dimension-reduced feature data; performing mean clustering processing on the dimension-reduced feature data to generate lens profile feature data; Step S33: positioning the segmentation key points of the lens profile feature data to obtain segmentation key point data; Step S34: Perform contour segmentation on the reconstructed lens model based on the segmentation key point data to obtain a segmented lens contour model.

6. The automatic layout and drawing method for lens laser cutting according to claim 1, characterized in that: Step S42 includes the following steps: Gridding the compressed boundary data to obtain boundary grid data; marking obstacles on the boundary grid data to generate obstacle grid data; Based on the obstacle grid data, the connected domain of the boundary grid data is identified to obtain a regional connected graph; the boundary of the regional connected graph is extracted to generate a limited feasible area; Performing position mapping on the limited feasible area according to the segmented lens contour model to obtain position mapping data; performing boundary detection on the position mapping data to obtain boundary constraint data; Perform feasibility verification based on boundary constraint data to obtain verification result data; optimize the range of the limited feasible area based on the verification result data to obtain a compressed feasible area; The compression feasible area is regionally integrated to generate a compression range contour model.

7. The automatic layout and drawing method for lens laser cutting according to claim 1, characterized in that: Step S5 includes the following steps: Step S51: performing contour vectorization on the precise layout scheme to obtain contour vector data; performing directional feature analysis based on the contour vector data to obtain directional feature data; Step S52: Analyze the continuity of the directional feature data to obtain a continuous segment set; perform direction chain encoding on the continuous segment set to generate a cutting path direction chain; Step S53: constructing a graph structure based on the cutting path direction chain to obtain an initial cutting path graph; searching for an optimal path on the initial cutting path graph to obtain initial optimal path data; Step S54: performing collision detection based on the initial preferred path data to obtain safe path data; integrating the safe path data and the initial preferred path data to generate cutting path data.

8. An automatic layout and drawing system for lens laser cutting, characterized in that: Used to execute the automatic layout and drawing method for lens laser cutting as claimed in claim 1, the automatic layout and drawing system for lens laser cutting comprises: An image acquisition module is used to acquire an image of a lens to be cut; perform contour edge detection on the image of the lens to be cut to obtain an image edge curve; perform continuous contour discrete direction mapping on the image of the lens to be cut based on the image edge curve to generate a contour direction sequence; The model reconstruction module is used to perform polygon fitting on the contour direction sequence to obtain the screening contour data; perform contour three-dimensional modeling based on the screening contour data to generate a reconstructed lens model; The contour segmentation module is used to perform contour classification and clustering processing on the reconstructed lens model to obtain lens contour feature data; and to perform contour segmentation on the reconstructed lens model according to the lens contour feature data to obtain a segmented lens contour model; The layout design module is used to perform range-limited screening on the segmented lens contour model to obtain a compressed range contour model; perform local fine layout processing on the compressed range contour model to obtain an accurate layout solution; The path planning module is used to construct a direction chain according to the precise layout plan to obtain a cutting path direction chain; based on the cutting path direction chain, the cutting path is planned for the precise layout plan to generate cutting path data; The execution setting module is used to sequentially execute the setting of the cutting path data based on a preset blank drawing template to obtain a cutting layout template to execute the automatic layout drawing method for lens laser cutting.

Citation Information

Patent Citations

  • Method for visual inspection and laser cutting track planning of low-gray-level rubber cushion

    CN111299815A

  • Laser cutting control system and method for lens assembly

    CN119596842A