A method for determining a processing track of a color carving device based on machine vision

CN122391349APending Publication Date: 2026-07-14SCHOOL OF JEWELRY WEST YUNNAN UNIV OF APPLIED TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SCHOOL OF JEWELRY WEST YUNNAN UNIV OF APPLIED TECH
Filing Date
2026-03-04
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

In existing technologies, due to the semi-transparent nature of jade materials and the complex three-dimensional spatial gradient distribution of internal colors, traditional two-dimensional image analysis methods have difficulty accurately separating the positions of color layers at different depths. Color segmentation algorithms with fixed thresholds cannot adapt to the natural gradient characteristics of the carved areas, resulting in boundary recognition offset and inaccurate carving trajectory planning.

Method used

A color depth mapping model is established by combining multi-angle polarized light imaging with spectral transmission analysis. A color segmentation algorithm based on voxelization 3D representation and region growing is used, combined with fuzzy clustering and gradient field analysis to extract accurate boundaries. A hybrid optimization strategy of improved particle swarm optimization algorithm and quasi-Newton method is used to plan the tool trajectory and perform collision interference detection.

Benefits of technology

It achieves precise three-dimensional positioning of the color boundaries within jade, improving the accuracy and efficiency of the carving trajectory, reducing boundary positioning errors, and enhancing the precision and efficiency of jade carving.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122391349A_ABST
    Figure CN122391349A_ABST
Patent Text Reader

Abstract

The application provides a kind of jade carving equipment processing track determination method based on machine vision, belongs to jade carving technical field, the application is established color depth mapping and voxel three-dimensional representation by collecting multi-angle polarized light image and carrying out spectral transmission analysis, carries out dynamic threshold region growth segmentation to three-dimensional color data, forms the color connected region, adopts fuzzy clustering and gradient field analysis to carry out multi-scale boundary extraction and obtains accurate boundary position, establishes tool path vector field along the boundary and carries out hybrid optimization calculation optimal tool axis posture by the improved particle swarm algorithm combined with quasi-newton method, generates final processing track after collision interference detection and constraint optimization, solves the technical problem that jade internal multilevel color boundary accurate three-dimensional positioning difficulty leads to inaccurate carving track planning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of jade carving technology, and more specifically, it relates to a method for determining the processing trajectory of a jade carving equipment based on machine vision. Background Technology

[0002] In the field of jade carving using natural color variations, traditional techniques rely on manual visual observation combined with experience to determine the distribution of these variations, or on single-angle optical imaging to acquire surface color information and plan the carving path. However, in current automated jade carving processes, the semi-transparent nature of jade results in complex three-dimensional color gradients. The overlapping of surface and internal color layers creates visual confusion, making it difficult for existing two-dimensional image analysis methods to accurately separate color layers of different depths. Fixed-threshold color segmentation algorithms cannot adapt to the natural gradient characteristics of the color variations, leading to misalignment in boundary recognition. Tool trajectories planned based on inaccurate boundary data cannot precisely follow the actual color transition areas, resulting in improper color utilization and suboptimal carving effects. In other words, existing technologies suffer from the difficulty of accurately 3D locating the boundaries of multi-layered color variations within the jade, leading to inaccurate carving trajectory planning. Summary of the Invention

[0003] In view of this, the present invention provides a method for determining the processing trajectory of a jade carving equipment based on machine vision, which can solve the technical problem in the prior art of inaccurate carving trajectory planning due to the difficulty in accurately 3D positioning the multi-layered color boundaries inside the jade.

[0004] This invention is implemented as follows: A machine vision-based method for determining the processing trajectory of a jade carving device includes the following steps: acquiring multi-angle polarized light images of the jade material, including polarized light images taken at 15-degree intervals within a polarization angle range of 0 to 180 degrees, and unpolarized natural light images from the front; performing spectral transmission analysis on the multi-angle polarized light images to establish a color depth mapping model, separating the surface color from the internal color layer, and then performing voxelized three-dimensional characterization to obtain three-dimensional color space distribution data of the jade material; processing the three-dimensional color space distribution data using a region-growing-based color segmentation algorithm to form three-dimensional connected region segmentation results for different jade colors; extracting the boundaries of the three-dimensional connected region segmentation results using multi-scale fuzzy clustering to obtain optimized precise boundary positions; planning a curved surface carving trajectory based on the optimized precise boundary positions, establishing an initial vector field for the tool path along the boundary surface of the optimized precise boundary positions, and using an improved particle swarm optimization algorithm combined with a quasi-Newton method to perform tool axis vector hybrid optimization to obtain optimized tool axis posture; performing collision interference detection on the optimized tool axis posture to generate the final jade carving processing trajectory data.

[0005] Among them, the multi-angle polarized light image was captured by a combination of linear polarizing filters and rotating the image. The polarized light image at each polarization angle was used to analyze the light transmission characteristics of jade material under different polarization directions.

[0006] The process of establishing a color depth mapping model through spectral transmission analysis is as follows: the spectral transmittance of each pixel in a multi-angle polarized light image is measured, the attenuation coefficient of different wavelengths of light inside the jade is calculated according to the Lambert-Beer law, and the mapping relationship function between color intensity and depth position is established by combining the polarized light intensity variation law.

[0007] Among them, the voxelized three-dimensional characterization divides the space of the jade material into cubic voxel units with side lengths ∈ [0.1, 0.5] mm. Each cubic voxel unit records the color parameters of the voxel position, including hue value, saturation value and lightness value.

[0008] Among them, the region-growing-based color segmentation algorithm selects representative color seed points in the three-dimensional color space distribution data, expands to the surrounding voxels starting from the representative color seed points and calculates the color similarity. When the color similarity exceeds the dynamic threshold, the voxels are merged into the corresponding color region.

[0009] Color similarity is calculated using the Euclidean distance metric in the HSV color space, and the dynamic threshold is automatically adjusted based on the voxel color variance within the current growth region.

[0010] Among them, the multi-scale fuzzy clustering boundary extraction uses the fuzzy C-means clustering method to perform iterative clustering analysis on the boundary voxels of each color region, and combines the edge detection gradient field to calculate the color gradient vector at the boundary. The precise boundary position of each color region is determined by adaptive threshold iteration and morphological filtering optimization is performed.

[0011] Among them, the fuzzy C-means clustering method uses the color parameters of the boundary voxels as sample vectors. It iteratively calculates the membership degree of each sample vector to each cluster center. The membership degree is calculated by normalizing the inverse of the distance between the sample vector and the cluster center. The cluster center position is iteratively updated until the change in membership degree is less than the convergence threshold, which is ∈ [0.001, 0.01].

[0012] Among them, the edge detection gradient field uses the Sobel operator or the Canny operator to calculate the gradient of the color distribution at the boundary, and obtains the boundary normal gradient vector. The direction of the boundary normal gradient vector points to the direction of the most drastic color change.

[0013] Among them, the adaptive threshold iteration automatically adjusts the boundary determination threshold according to the statistical distribution of the magnitude of the boundary normal gradient vector at the current boundary. When the magnitude of the boundary normal gradient vector is greater than the adjusted boundary determination threshold, the position is identified as the true boundary point.

[0014] Morphological filtering optimization includes morphological opening and morphological closing operations. Morphological opening is used to remove burrs and isolated noise on the boundary curve, while morphological closing is used to fill small gaps in the boundary curve.

[0015] Among them, the improved particle swarm optimization algorithm represents each cutter axis attitude as a particle in a multi-dimensional space. The position vector of the particle includes the azimuth and pitch angle parameters of the cutter axis direction. The adaptive inertia weight parameter decreases linearly from 0.9 to 0.4 as the number of iterations increases. The mutation operator applies random perturbation to some particles with a probability of ∈ [5%, 10%].

[0016] Among them, the quasi-Newton method uses the first derivative information of the objective function to approximate the second derivative matrix, and obtains the search direction by iteratively solving the linear equation system. The quasi-Newton method is combined with the improved particle swarm optimization algorithm to form a hybrid optimization strategy.

[0017] Among them, the collision interference detection calculates the minimum distance between the tool and each point on the surface of the jade material. When the minimum distance is less than the safety threshold, it is marked as an interference point and the tool axis posture of the interference point is re-constrained and optimized. The safety threshold is [10%, 20% of the tool radius].

[0018] The final carving trajectory data includes the three-dimensional spatial coordinates of each trajectory point, the tool axis direction vector, the feed rate, and the spindle speed.

[0019] The present invention also provides a machine vision-based system for determining the processing trajectory of a carving equipment, specifically using a computer with a readable storage medium stored within it, which stores program instructions. When the program instructions are run on the computer, they execute the aforementioned method.

[0020] This invention establishes a color depth mapping model through multi-angle polarized light imaging combined with spectral transmission analysis, achieving spatial separation and voxelized 3D representation of the surface and internal color layers, thus solving the recognition confusion problem caused by color superposition in traditional 2D imaging. By employing a dynamic threshold adaptive segmentation algorithm based on region growing, combined with multi-scale boundary extraction methods using fuzzy clustering and gradient field analysis, precise 3D boundary positioning of jade gradient color regions is achieved, avoiding boundary misalignment caused by fixed thresholds. Through an improved hybrid optimization strategy combining particle swarm optimization and quasi-Newton methods, along with Jacobian matrix calculation and collision interference detection, an optimized tool trajectory conforming to the color distribution characteristics is generated based on precise 3D boundary data. In summary, this invention solves the technical problem mentioned in the background art of inaccurate carving trajectory planning due to the difficulty in precise 3D positioning of multi-layered color boundaries within jade. Attached Figure Description

[0021] Figure 1This is a flowchart of the method of the present invention.

[0022] Figure 2 This is a three-dimensional color space distribution diagram of the jade material in the embodiment.

[0023] Figure 3 This is a diagram illustrating the iterative process of tool axis posture optimization in the embodiment. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.

[0025] like Figure 1 The diagram shown is a flowchart of a machine vision-based method for determining the processing trajectory of a carving equipment, which includes the following steps:

[0026] S01. Collect multi-angle polarized light images of jade materials, including polarized light images taken every 15 degrees within the range of polarization angle from 0 degrees to 180 degrees, and frontal unpolarized natural light images.

[0027] S02. Perform spectral transmission analysis on the multi-angle polarized light image obtained in step S01 to establish a color depth mapping model. After separating the surface color from the internal color layer, perform voxelized three-dimensional characterization to obtain the three-dimensional color space distribution data of the jade material.

[0028] S03. Process the three-dimensional color space distribution data obtained in step S02 using a color segmentation algorithm based on region growing. Select representative color seed points in the three-dimensional color space distribution data, expand to the surrounding voxels starting from the representative color seed points and calculate the color similarity. When the color similarity exceeds the dynamic threshold, merge the voxels into the corresponding color regions to form three-dimensional connected region segmentation results of different colors.

[0029] S04. Perform multi-scale fuzzy clustering boundary extraction on the three-dimensional connected region segmentation results obtained in step S03. Use the fuzzy C-means clustering method to perform iterative clustering analysis on the boundary voxels of each color region. Combine the edge detection gradient field to calculate the color gradient vector at the boundary. Use adaptive threshold iteration to determine the precise boundary position of each color region and perform morphological filtering optimization to obtain the optimized precise boundary position.

[0030] S05. Based on the optimized precise boundary position obtained in step S04, plan the surface engraving trajectory, establish the tool path initial vector field along the boundary surface of the optimized precise boundary position, and use the improved particle swarm optimization algorithm combined with the quasi-Newton method to perform tool axis vector hybrid optimization. In the optimization process, introduce adaptive inertia weight parameters and mutation operators, calculate the local optimal tool axis posture of each path point through the Jacobian matrix, and obtain the optimized tool axis posture.

[0031] S06. Perform collision interference detection on the optimized tool axis posture obtained in step S05, calculate the minimum distance between the tool and each point on the surface of the jade material, mark the minimum distance value as an interference point when it is less than the safety threshold, and re-constrain and optimize the tool axis posture of the interference point to generate the final jade carving trajectory data.

[0032] The multi-angle polarized light image is captured using a combination of linear polarizing filters and a rotating shooting method. The polarized light image at each polarization angle is used to analyze the light transmission characteristics of the jade material under different polarization directions, and the spatial relationship between the surface layer and the internal color layer is identified by the difference in polarized light intensity.

[0033] The process of establishing a color depth mapping model through spectral transmission analysis is as follows: the spectral transmittance of each pixel in a multi-angle polarized light image is measured, the attenuation coefficient of light of different wavelengths inside the jade is calculated according to the Lambert-Beer law, and a mapping relationship function between color intensity and depth position is established by combining the polarized light intensity variation law. The mapping relationship function is used to convert the color information of the two-dimensional image into color distribution coordinates in three-dimensional space.

[0034] The voxelized 3D characterization divides the space of the jade material into cubic voxel units with side lengths in the range of [0.1, 0.5] mm. Each cubic voxel unit records the color parameters of the voxel position. The color parameters include hue value, saturation value, and lightness value. The hue value is represented by the H component in the HSV color space model, the saturation value is represented by the S component in the HSV color space model, and the lightness value is represented by the V component in the HSV color space model.

[0035] The region-growing-based color segmentation algorithm is an adaptive segmentation method for jade's gradient colors. First, representative color seed points are manually selected or automatically detected in the 3D color space distribution data. These representative seed points are located at the center of each major color region. Then, starting from the representative seed points, the color parameters of adjacent voxels are checked one by one, and the color similarity between the adjacent voxels and the current growth region is calculated. The color similarity is calculated using the Euclidean distance metric in the HSV color space. When the color similarity value is greater than a dynamic threshold, the adjacent voxel is included in the current growth region. The dynamic threshold is automatically adjusted based on the color variance of the voxels within the current growth region to accommodate different degrees of color gradient. This process is repeated. The process continues until all cubic voxel units are assigned to a certain color region or no adjacent voxels meet the growth conditions, ultimately forming multiple non-overlapping three-dimensional connected color regions. The technical effects of the region-growing-based color segmentation algorithm are as follows: Compared with the traditional binary threshold segmentation method, the region-growing-based color segmentation algorithm adapts to the natural gradient characteristics of jade colors through a dynamic threshold adjustment mechanism, avoiding the boundary misalignment problem caused by a fixed threshold. It ensures the integrity of continuous transition color regions through similarity accumulation judgment, and overcomes the recognition interference caused by color superposition in two-dimensional images through three-dimensional spatial growth. This improves the segmentation accuracy of complex gradient color regions by 15% to 30%, and reduces the boundary positioning error to within 0.2mm.

[0036] The fuzzy C-means clustering method uses the color parameters of the boundary voxels as sample vectors. It iteratively calculates the membership degree of each sample vector to each cluster center. The membership degree is calculated by normalizing the inverse of the distance between the sample vector and the cluster center. The cluster center positions are iteratively updated until the change in membership degree is less than the convergence threshold, which is in the interval [0.001, 0.01].

[0037] The edge detection gradient field uses the Sobel or Canny operator to calculate the gradient of the color distribution at the boundary, resulting in a boundary normal gradient vector. The direction of the boundary normal gradient vector points to the direction of the most drastic color change, and the magnitude of the boundary normal gradient vector represents the degree of drastic color change.

[0038] The color gradient vector and the boundary normal gradient vector are the same vector.

[0039] The adaptive threshold iteration refers to automatically adjusting the boundary determination threshold based on the statistical distribution of the magnitude of the boundary normal gradient vector at the current boundary. When the magnitude of the boundary normal gradient vector is greater than the adjusted boundary determination threshold, the location is identified as a true boundary point. The adjusted boundary determination threshold is calculated based on the mean and standard deviation of the magnitude of the global boundary normal gradient vector.

[0040] The morphological filtering optimization includes morphological opening and morphological closing operations. The morphological opening operation is used to remove burrs and isolated noise points on the boundary curve, and the morphological closing operation is used to fill small gaps in the boundary curve. The size of the structural element of the morphological opening and morphological closing operations is automatically selected according to the surface roughness of the jade material.

[0041] The initial vector field of the tool path is determined based on the surface normal vector and the preset cutting angle range. The preset cutting angle range is the interval of [-15, 15] degrees relative to the surface normal vector. The initial vector field of the tool path provides a search starting point for subsequent optimization.

[0042] The improved particle swarm optimization algorithm is a swarm intelligence optimization method that represents each cutter axis posture as a particle in a multi-dimensional space. The position vector of the particle includes the azimuth and pitch angle parameters of the cutter axis direction. The improved particle swarm optimization algorithm finds the optimal solution by simulating the social and cognitive behavior of the particle swarm. Each particle updates its velocity and position based on its own historical best position and the global historical best position. The adaptive inertia weight parameter decreases linearly from 0.9 to 0.4 with the number of iterations to balance the global search and local search capabilities. The mutation operator applies random perturbation to some particles with a probability of belonging to the [5%, 10%] interval to escape the local optimum trap.

[0043] The quasi-Newton method is a fast-converging local optimization method that uses the first derivative information of the objective function to approximate the second derivative matrix and obtains the search direction by iteratively solving a system of linear equations. The quasi-Newton method is combined with the improved particle swarm optimization algorithm to form a hybrid optimization strategy. First, the improved particle swarm optimization algorithm performs a global search to determine the approximate region of the optimal solution, and then the quasi-Newton method performs a local fine search to obtain a high-precision local optimal tool axis posture.

[0044] The Jacobian matrix is ​​a partial derivative matrix that describes the relationship between the tool axis posture change and the cutting performance index change. By calculating the values ​​of each element of the Jacobian matrix, the gradient of the objective function near the current posture can be quickly evaluated, providing gradient information for the quasi-Newton method. The cutting performance index includes the cutting force, surface roughness, and machining efficiency.

[0045] The locally optimal tool axis posture refers to the tool axis direction and position that achieves the optimal value of cutting performance under multiple constraints such as cutting angle constraints, tool interference avoidance constraints, and machine tool kinematic constraints. The locally optimal tool axis posture is calculated independently at each trajectory path point, and the optimized tool axis posture is the set of locally optimal tool axis postures for all trajectory path points.

[0046] The collision interference detection uses a bounding box hierarchical structure to quickly filter out the regions where collisions occur, and performs accurate distance calculation on the filtered collision regions. The distance calculation is based on the shortest distance algorithm between the tool geometry model and the point cloud model of the jade surface.

[0047] The safety threshold is set according to the tool radius and machining accuracy requirements. The safety threshold belongs to the range of [10%, 20%] of the tool radius. The safety threshold is used to maintain a safe gap between the tool and the workpiece surface to prevent collision damage.

[0048] The constraint optimization refers to adding additional distance constraints to the tool axis posture search space of the interference point after detecting the interference point. It requires that the optimized tool axis posture must make the minimum distance between the tool and the workpiece greater than the safety threshold. The optimization algorithm is guided to avoid the interference region by adding a penalty function term.

[0049] The final carving trajectory data includes the three-dimensional spatial coordinates of each trajectory point, the tool axis direction vector, the feed rate, and the spindle speed. The final carving trajectory data is output in standard G-code format or CNC system format for the carving equipment to execute.

[0050] As an optional implementation, the present invention also provides a computer-based method for forming a machine vision-based color carving equipment processing trajectory determination system, wherein the computer is provided with a readable storage medium, the readable storage medium stores program instructions, and the program instructions execute the above-described method when running in the computer.

[0051] The specific implementation methods of the above steps are described in detail below.

[0052] The specific implementation of step S01 is to acquire the three-dimensional optical information of jade material through a multi-angle polarized light imaging system. First, a linear polarizing filter is installed at the front of the camera lens. The filter is rotated from 0 degrees to 180 degrees at 15-degree intervals by a stepper motor. At each polarization angle position, the camera shutter is triggered to complete the image acquisition. This rotation shooting method can capture the difference in light intensity distribution of jade under different polarization directions. Since the internal crystal structure of jade has selective transmission characteristics for light of different polarization directions, the multi-angle polarized light image can reflect the spatial positional relationship between the surface color and the internal color layer. After completing the polarized light image acquisition, the polarizing filter is removed and a frontal natural light image is taken as a color reference. During all image acquisition processes, the camera position is kept fixed and the light source intensity is kept constant to ensure data consistency. The polarization angle interval is set to 15 degrees, which is a balanced choice that takes into account both data integrity and acquisition efficiency.

[0053] The specific implementation of step S02 is to establish a three-dimensional spatial distribution model of the color inside the jade by utilizing the transmission characteristics of polarized light. First, the light intensity value of each pixel under different polarization angles is extracted. According to the Lambert-Beer law, the absorption attenuation coefficient of each wavelength of light propagating inside the jade is calculated. This law describes the relationship that the light intensity decreases exponentially with the propagation distance. By analyzing the variation law of light intensity under different polarization angles, the distribution position of the color material in the depth direction can be deduced. A mapping function from two-dimensional image coordinates to three-dimensional spatial coordinates is established. This mapping function converts the color information of the pixel into three-dimensional color distribution data with depth coordinates. Then, the three-dimensional space of the jade material is divided into voxels, and the continuous space is discretized into cubic units with a side length of 0.1 to 0.5 mm. Each voxel unit records its spatial position and the corresponding hue value, saturation value and lightness value. The HSV color space model is used to represent the color parameters because this model is more in line with the way the human eye perceives color and is convenient for subsequent color similarity calculation. The choice of voxel size needs to balance spatial resolution and computational complexity.

[0054] The specific implementation of step S03 is to use a region growing algorithm to adaptively segment the three-dimensional color space. First, representative seed points are selected at the center of each major color region. The selection of seed points can be achieved by manual calibration or automatic detection based on color clustering. Starting from each seed point, growth is extended to its six neighboring voxels. The color similarity between neighboring voxels and the current growth region is calculated. The similarity calculation adopts the Euclidean distance metric method in the HSV color space. The square root of the sum of the squares of the differences in hue, saturation and lightness between neighboring voxels and all voxels in the growth region is used as the distance value. When the distance value is less than the dynamic threshold, the neighboring voxel is included in the growth region. The dynamic threshold is automatically adjusted according to the variance statistics of the voxel colors in the current region. A larger threshold is used for regions with gentle color changes to expand the growth range, and a smaller threshold is used for regions with drastic color changes to accurately control the boundary. The neighbor detection and growth judgment are repeated until no new voxels are added or all voxels are assigned. Finally, multiple non-overlapping three-dimensional connected color regions are formed. This algorithm adapts to the natural gradient characteristics of jade color through the dynamic threshold mechanism and avoids the boundary misalignment problem caused by the fixed threshold.

[0055] The specific implementation of step S04 involves precise positioning and optimization of the color region boundaries. First, the boundary voxel set of each color region is extracted. The color parameters of these boundary voxels are then used as samples input into a fuzzy C-means clustering algorithm. This algorithm achieves flexible classification by iteratively calculating the membership degree of each sample to each cluster center. The membership degree value is obtained by normalizing the inverse of the distance between the sample and the cluster center; the closer the distance, the higher the membership degree. The cluster center positions are iteratively updated until the change in membership degree is less than a convergence threshold of 0.001 to 0.01. Fuzzy clustering can handle the continuous transition characteristics of colors at the boundaries. Then, the Sobel operator or Canny operator is used to perform gradient gradation on the boundary regions. In degree field calculation, the Sobel operator calculates the rate of change of color in the horizontal and vertical directions through convolution operations. The Canny operator adds non-maximum suppression and double threshold detection to obtain more accurate edges. The calculated gradient vector points to the direction of the most dramatic color change, and the magnitude value represents the intensity of the change. The boundary judgment threshold is adaptively adjusted according to the mean and standard deviation of the global gradient magnitude value. When the gradient magnitude value at a certain position is greater than the threshold, it is identified as a true boundary point. Finally, morphological filtering is performed on the extracted boundary curve. Opening operations are used to remove burrs and noise, and closing operations are used to fill small gaps. The size of the structural element is automatically selected according to the surface roughness of the jade to adapt to different material properties.

[0056] The specific implementation of step S05 involves planning the tool motion trajectory along the boundary surface and optimizing the tool axis attitude. First, an initial vector field for the tool path is established based on the normal vector of the boundary surface. The tool axis direction is allowed a deflection range of -15 degrees to +15 degrees based on the normal vector. This range is set to consider the balance between the cutting force direction and surface quality. Then, an improved particle swarm optimization algorithm is used for global search. The tool axis attitude of each path point is represented as a particle position vector containing azimuth and pitch angles. Particles update their velocity and position based on their own historical best position and the swarm's global best position. The inertia weight parameter is linearly decreased from 0.9 to 0.4 to maintain a large search range in the early stages of iteration and enhance local convergence capability in the later stages. The mutation operator is set at 5%. To avoid getting trapped in local optima, random perturbations are applied to some particles with a probability of up to 10%. After the particle swarm optimization algorithm determines the approximate region of the optimal solution, a quasi-Newton method is introduced for local fine optimization. The quasi-Newton method uses the first-order gradient information of the objective function to construct an approximate second-order derivative matrix. The search direction is quickly obtained by solving a system of linear equations. The Jacobian matrix is ​​calculated to describe the influence of small changes in the tool axis posture on performance indicators such as cutting force, surface roughness, and machining efficiency, providing partial derivative information for gradient calculation. Under the premise of satisfying the cutting angle constraint, tool interference constraint, and machine tool kinematic constraint, the tool axis direction and position that optimize the cutting performance indicators are iteratively solved. This optimization process is performed independently for each trajectory path point to obtain a set of locally optimal tool axis postures.

[0057] The specific implementation of step S06 involves detecting and correcting collision interference in the optimized trajectory. First, a multi-level spatial index is established for the tool model and the jade surface model using a bounding box hierarchy. Local areas that may collide are quickly filtered out by the bounding box intersection judgment. For the filtered areas, the shortest distance between the tool geometry model and the surface point cloud model is calculated. This distance calculation is based on the projection algorithm from a spatial point to a curved surface. When the shortest distance is less than a safety threshold, the point is marked as an interference point. The safety threshold is set to 10% to 20% of the tool radius to retain a necessary safety gap between the tool and the workpiece. The detected interference points are re-constrained and optimized. A penalty term for distance constraint is added to the original optimization objective function. This penalty term increases rapidly as the distance between the tool and the workpiece decreases, guiding the optimization algorithm to adjust the tool axis posture so that the minimum distance is greater than the safety threshold. After optimization, the final machining trajectory data is generated. This data includes parameters such as the three-dimensional coordinates of each trajectory point, the tool axis direction vector, the feed rate, and the spindle speed. It is output in standard G-code format or CNC system format for the engraving equipment to perform machining operations.

[0058] It should be noted that the key technical concepts of this invention include multi-angle polarized light imaging and three-dimensional color reconstruction technology. This technology utilizes the selective transmission characteristics of polarized light to the crystal structure of jade, and establishes a color depth mapping model by combining multi-angle polarized images with spectral transmission analysis. This achieves accurate conversion from two-dimensional images to three-dimensional color space. Compared with traditional single-view imaging methods, this technology can penetrate the surface layer to identify the distribution of internal color layers, solving the technical problem of accurately locating the color variations in the depth direction of jade. This provides a reliable three-dimensional data foundation for subsequent precise boundary extraction and trajectory planning. The adaptive color segmentation technology based on region growing employs a dynamic threshold adjustment mechanism designed for the natural gradation characteristics of jade colors. By monitoring the color variance within the growth area, it automatically adjusts the similarity judgment standard. Compared with traditional segmentation methods with fixed thresholds, this technology can adapt to different degrees of color transition, avoiding boundary misalignment and region fragmentation problems. Three-dimensional spatial growth overcomes the recognition interference caused by color superposition in two-dimensional images, significantly improving the segmentation accuracy of complex gradient color regions. The tool axis attitude hybrid optimization technology combines the global search capability of particle swarm optimization with the local convergence speed of the quasi-Newton method. It enhances the robustness of the algorithm through adaptive inertia weights and mutation operators, and uses the Jacobian matrix to quickly evaluate the impact of attitude adjustment on cutting performance. Compared to a single optimization algorithm, this hybrid strategy avoids getting trapped in local optima while ensuring convergence speed, achieving an optimal balance between cutting performance and machining efficiency under multiple constraints. The synergistic effect of these technologies is reflected in the complete closed-loop optimization from data acquisition to trajectory generation. Multi-angle polarization imaging provides high-quality 3D input data for color segmentation, the adaptive segmentation algorithm provides accurate color region division for boundary positioning, and the precise boundary position determines a clear target surface for tool axis optimization. The hybrid optimization algorithm generates high-quality machining trajectories under complex constraints. Compared to traditional experience-dependent machining methods, this collaborative technology system achieves intelligent and automated processing from raw material analysis to machining path planning, significantly reducing reliance on operator experience, improving the machining accuracy and efficiency of multi-colored jade carving, and making the fine processing of complex multi-colored jade possible.

[0059] It should be noted that this invention also solves the following technical problem: In the trajectory optimization process of jade carving, traditional single optimization algorithms are prone to getting stuck in local optima, leading to unreasonable tool axis posture, or the low efficiency of global search results in excessively long computation time, which cannot meet the actual production requirements. This invention solves this problem by improving the hybrid optimization strategy of particle swarm optimization algorithm and quasi-Newton method. First, the global search capability of particle swarm optimization algorithm is used to quickly locate the approximate region where the optimal solution is located. An adaptive inertia weight parameter is introduced, which decreases with the number of iterations to achieve a smooth transition from global exploration to local development. Random perturbation is applied by mutation operator to avoid premature convergence. Then, the fast local convergence characteristic of quasi-Newton method is used to perform a fine search in the optimal region. Combined with the gradient information provided by the Jacobian matrix, the convergence process is accelerated. This two-stage hybrid strategy not only ensures the probability of finding the global optimal solution, but also significantly improves the optimization efficiency, so that the tool axis posture of each trajectory point can reach the optimal value of cutting performance index under various constraints.

[0060] Furthermore, this invention addresses the technical problem that fixed threshold methods in jade gradient color region segmentation cannot adapt to varying degrees of color transition characteristics. Traditional threshold segmentation methods employ a globally uniform judgment standard, which may lead to over-segmentation in areas with drastic color changes and under-segmentation in areas with slow color transitions, resulting in inaccurate boundary positioning. This invention solves this problem through a dynamic threshold adjustment mechanism based on region growth. It calculates and adjusts the similarity judgment threshold in real time based on the voxel color variance within the current growth region. In areas with drastic color changes, the threshold is automatically tightened to accurately capture boundaries; in areas with smooth color transitions, the threshold is automatically widened to maintain regional continuity. Three-dimensional similarity calculation is achieved using Euclidean distance metric in the HSV color space, and combined with three-dimensional connectivity judgment, it overcomes the interference of color superposition in two-dimensional images, enabling the segmentation results to accurately reflect the true spatial distribution characteristics of jade's color variations.

[0061] Specifically, the principle of this invention is as follows: This invention solves the aforementioned technical problems by overcoming the limitations of traditional single-view imaging. It utilizes the differentiated transmission characteristics of multi-angle polarized light to penetrate the translucent structure of jade, and quantifies the optical attenuation laws of different depth color layers using the Lambert-Beer law, reconstructing two-dimensional image information into a three-dimensional spatial color distribution coordinate system. The dynamic threshold region growing algorithm automatically adjusts the judgment criteria based on local color variance, enabling the algorithm to continuously grow following the natural gradation characteristics of the jade, ensuring the complete identification of the gradation transition region. Fuzzy clustering handles the uncertainty of boundary voxels through membership degree calculation, gradient field analysis locates the position of the most drastic color change, morphological filtering eliminates noise interference, and a multi-level boundary extraction mechanism ensures the accuracy of boundary positioning. The hybrid optimization algorithm first uses particle swarm optimization for global search to lock the optimal region, and then uses a quasi-Newton method for local fine optimization. The introduction of adaptive inertia weights and mutation operators enhances the algorithm's convergence performance and ability to escape local optima. Combined with collision detection constraint optimization, it ensures the executability of the trajectory. Therefore, the technical solution of this invention is logically sound and effectively solves the core technical problems.

[0062] The following provides a specific embodiment 1 of the present invention, and the specific implementation of each step in this embodiment 1 is described in detail below.

[0063] The specific implementation of step S01 is to acquire the three-dimensional optical information of jade material through a multi-angle polarized light imaging system. First, a linear polarizing filter is installed at the front of the camera lens. The filter is rotated from 0 degrees to 180 degrees at 15-degree intervals by a stepper motor. At each polarization angle position, the camera shutter is triggered to complete the image acquisition. This rotation shooting method can capture the difference in light intensity distribution of jade under different polarization directions. Since the internal crystal structure of jade has selective transmission characteristics for light of different polarization directions, the multi-angle polarized light image can reflect the spatial positional relationship between the surface color and the internal color layer. After completing the polarized light image acquisition, the polarizing filter is removed and a frontal natural light image is taken as a color reference. During all image acquisition processes, the camera position is kept fixed and the light source intensity is kept constant to ensure data consistency. The polarization angle interval is set to 15 degrees, which is a balanced choice that takes into account both data integrity and acquisition efficiency.

[0064] The specific implementation of step S02 involves establishing a three-dimensional spatial distribution model of the colors inside the jade using the transmission characteristics of polarized light. First, the light intensity value of each pixel at different polarization angles is extracted. Then, the absorption attenuation coefficient of each wavelength of light propagating inside the jade is calculated according to the Lambert-Beer law. The mathematical expression of this law is as follows:

[0065] ;

[0066] In the formula, wavelength The light at depth The light intensity at a given location, measured in units of ; wavelength The intensity of the incident light, in units of ; wavelength The corresponding absorption attenuation coefficient, in units of ; The depth to which light travels within the jade, measured in units of 1 / 2 oz. .

[0067] By analyzing different polarization angles The variation pattern of light intensity can be used to deduce the distribution of color substances in the depth direction, whereby... For the first Given a polarization angle value in degrees, establish a mapping function from two-dimensional image coordinates to three-dimensional spatial coordinates. This mapping function is expressed as follows:

[0068] ;

[0069] In the formula, pixel coordinates The corresponding depth position, in units of ; and These are the horizontal and vertical pixel coordinates of the image plane, respectively, in pixels; This is the number of polarization angle samples; the default value is 13. For the first The weighting coefficient for each polarization angle is dimensionless and determined based on the rate of change of polarized light intensity. The specific calculation method is as follows: ,in Polarization angle The change in light intensity at a point relative to the average light intensity, expressed in units of The calculation method is as follows , This is the average light intensity across all angles, in units of... The calculation method is as follows ; Polarization angle The incident light intensity is expressed in units of . ; For pixels At polarization angle The actual measured light intensity is given in units of [missing information]. ; Polarization angle The corresponding equivalent attenuation coefficient, in units of The calibration was obtained through experimental calibration. The calibration steps included: Step 1, selecting a known thickness as... Standard jade sample, unit: Step 2, at each polarization angle Measuring transmitted light intensity The unit is Step 3: Fit the result according to Lambert-Beer's law. .

[0070] Then, the three-dimensional space of the jade material is divided into voxels, discretizing the continuous space into edge lengths. belong The interval is a cubic unit, and each voxel unit records its spatial position coordinates. and the corresponding hue value saturation value and brightness value ,in , , These represent the coordinates of a voxel in three-dimensional space, in units of . The HSV color space model is used to represent color parameters because it better matches how the human eye perceives color and facilitates subsequent color similarity calculations.

[0071] The specific implementation of step S03 is to use a region growing algorithm to adaptively segment the three-dimensional color space. First, representative seed points are selected at the center of each major color region. Starting from each seed point, growth is extended to its six neighboring voxels. The color similarity between the neighboring voxels and the current grown region is calculated. The similarity is calculated using the Euclidean distance metric in the HSV color space. The specific formula is as follows:

[0072] ;

[0073] In the formula, voxels With growth area Normalized color similarity distance, dimensionless; Indicates the first Individual factors; Indicates the first One growth region; voxels The hue value ranges from 0 to 360 degrees; voxels The saturation value is dimensionless and ranges from 0 to 1; voxels The brightness value is dimensionless and ranges from 0 to 1; For growth area The mean hue value of all voxels, in degrees, calculated as follows: ,in For the region The number of voxels inside, For the first in the region Hue value of a single element; For growth area The mean of the saturation values ​​of all voxels, dimensionless, calculated as follows: ,in For the first in the region The saturation value of individual pixels; For growth area The mean value of the brightness of all voxels within the range, dimensionless, calculated as follows: ,in For the first in the region The brightness value of the individual element; the denominator This is a normalization factor to ensure that the distance value is dimensionless.

[0074] When the distance value is less than the dynamic threshold Adjacent voxels are included in the growth region, and the dynamic threshold is automatically adjusted based on the variance statistics of the voxel colors in the current region, as shown below:

[0075] ;

[0076] In the formula, For growth area The dynamic threshold is dimensionless. This is the base threshold, dimensionless, with a default value of 0.15. This is an adjustment coefficient, dimensionless, with an empirical value of 0.25; For growth area The standard deviation of the color of the intrinsic voxel is dimensionless and is calculated as follows: ,in For the region Inner Individual factors; This represents the maximum value of the color standard deviation across all regions, dimensionless, used for normalization, and calculated as follows: ,in This represents the total number of regions that have been formed so far.

[0077] The process of neighborhood detection and growth judgment is repeated until no new voxels are added or all voxels are assigned, ultimately forming multiple non-overlapping three-dimensional connected color regions.

[0078] The specific implementation of step S04 involves precise positioning and optimization of the color region boundaries. First, the boundary voxel set of each color region is extracted. The color parameters of the boundary voxels are then used as samples to input the fuzzy C-means clustering algorithm. This algorithm achieves flexible classification by iteratively calculating the membership degree of each sample to each cluster center. The membership degree calculation formula is as follows:

[0079] ;

[0080] In the formula, Boundary voxels Cluster centers The membership degree is dimensionless and ranges from 0 to 1; Boundary voxels The color parameter vector contains , , Three components; For the first The color parameter vector of each cluster center contains , , Three components; For the first The color parameter vector of each cluster center; voxels With cluster center The Euclidean distance between them is calculated as follows: Dimensionless; The number of cluster centers; It is the ambiguity index, which is dimensionless and usually takes a value of 2.

[0081] Iteratively update the cluster center positions until the change in membership degree is less than the convergence threshold. The convergence threshold is dimensionless and belongs to The boundary region is then divided into intervals, and the Sobel or Canny operator is used to calculate the gradient field. The calculated boundary normal gradient vector is represented as follows:

[0082] ;

[0083] In the formula, voxel position The boundary normal gradient vector at the location; voxel position The overall color intensity value at the location is dimensionless and is obtained through... The calculation yielded, where , , These are the normalized intensity values ​​for the red, green, and blue channels, respectively. They are dimensionless, ranging from 0 to 1, and are obtained by dividing the RGB color value of the voxel by 255. , , ,in , , These are the original color values ​​of the red, green, and blue channels of the voxel, ranging from 0 to 255; , , The color intensity is respectively at , , Partial derivatives in the direction, in units of .

[0084] The magnitude of the gradient vector is expressed as:

[0085] ;

[0086] In the formula, The normalized gradient magnitude is dimensionless. The voxel side length is expressed in units of 1. Used to convert gradient units Convert to dimensionless.

[0087] Based on the mean of the global gradient magnitude and standard deviation Adaptive adjustment of boundary determination threshold, where Dimensionless The total number of all boundary voxels. For the first The gradient vector of each boundary voxel. The dimensionless boundary determination threshold is expressed as follows:

[0088] ;

[0089] In the formula, The boundary determination threshold is dimensionless. This is an adjustment coefficient, dimensionless, with an empirical value of 1.5 to 2.5.

[0090] When the gradient magnitude at a certain location is greater than the threshold, it is identified as a true boundary point. Finally, morphological filtering optimization is performed on the extracted boundary curve.

[0091] The specific implementation of step S05 involves planning the tool motion trajectory along the boundary surface and optimizing the tool axis posture. First, an initial vector field for the tool path is established based on the normal vector of the boundary surface. The tool axis direction is allowed to deflect by an angle based on the normal vector. belong The degree interval is determined, and then an improved particle swarm optimization algorithm is used for global search. The particle position update formula is as follows:

[0092] ;

[0093] ;

[0094] In the formula, For the first The particle in the first The velocity vector of the next iteration; The particle is numbered, with a value ranging from 1 to... ,in This represents the total number of particles in the swarm, with a default value of 30 to 50. This represents the current iteration number; The adaptive inertia weight parameter is dimensionless and is calculated as follows: ,in This represents the maximum number of iterations, typically ranging from 100 to 200. For the first The particle in the first The velocity vector of the next iteration; and The learning factor is dimensionless and typically takes a value of 2. and A random number between 0 and 1, dimensionless; For the first The historical optimal position vector of each particle; For the first The particle in the first The position vector of the next iteration includes the tool axis azimuth angle. and pitch angle Two components, in degrees; This is the global historical optimal position vector.

[0095] After the particle swarm optimization algorithm determines the approximate region of the optimal solution, a quasi-Newton method is introduced for local fine-tuning. The search direction is calculated as follows:

[0096] ;

[0097] In the formula, For the first The search direction vector for each iteration contains two components: the azimuth search direction and the pitch search direction, in degrees. The iteration number of the quasi-Newton method; The matrix is ​​an approximate second derivative matrix, dimensionless, and is updated using the BFGS method. The update formula is as follows: ,in , for transpose, for Transpose of; for The inverse matrix; For the objective function at position The gradient vector at that point; The comprehensive evaluation function for cutting performance is dimensionless and is expressed as follows: ,in , , These are normalized weight coefficients, dimensionless, and satisfy... The default values ​​are 0.4, 0.3, and 0.3. Current tool axis posture The cutting force is expressed in units of , For reference cutting force, the unit is... The value is usually taken as the average cutting force measured experimentally. The surface roughness at the current attitude, in units of , For reference surface roughness, the unit is . The value is usually taken as the average surface roughness measured experimentally. The processing time under the current posture, in units of , For reference processing time, the unit is... The value is usually taken as the average processing time determined experimentally.

[0098] The Jacobian matrix is ​​calculated to describe the impact of minute changes in tool axis posture on cutting performance indicators. The Jacobian matrix is ​​expressed as follows:

[0099] ;

[0100] In the formula, This is a Jacobian matrix, and all its elements are dimensionless. This is the azimuth angle of the tool axis, in degrees; The pitch angle of the tool axis is expressed in degrees.

[0101] The optimization process is performed independently for each trajectory path point to obtain a set of locally optimal tool axis postures.

[0102] The specific implementation of step S06 involves detecting and correcting collision interference in the optimized trajectory. First, a multi-level spatial index is established for the tool model and the jade surface model using a bounding box hierarchy. Then, the shortest distance between the tool geometry model and the surface point cloud model is calculated for the selected regions. The shortest distance is calculated as follows:

[0103] ;

[0104] In the formula, This is the shortest distance value, in units of ; The tool model point number, with a value range of 1 to ,in This represents the total number of points in the tool model. This refers to the number of the model point on the jade surface, with a value ranging from 1 to... ,in This represents the total number of model points on the jade surface. For the tool model The three-dimensional coordinates of each point, including Three components, in units of ; For the first on the surface model of jade The three-dimensional coordinates of each point, including Three components, in units of ; The Euclidean distance between two points, in units of 1. The calculation method is as follows .

[0105] When the shortest distance is less than the safety threshold Mark this point as an interference point, and set the safety threshold to the tool radius. 10% to 20%, that is ,in The safety factor is dimensionless and ranges from 0.1 to 0.2. The tool radius is given in units of 1. The detected interference points are then re-optimized by adding a distance constraint penalty term to the original objective function. The objective function is expressed as follows:

[0106] ;

[0107] In the formula, To optimize the objective function, it is dimensionless; , , The weighting coefficients are dimensionless and satisfy the following conditions: The default values ​​are 0.4, 0.3, and 0.3. The current cutting force, in units of ; Maximum cutting force, in units of This value is typically taken as the maximum cutting force allowed by the tool material. The current surface roughness, in units of ; Maximum permissible surface roughness, in units of The setting is based on the required machining accuracy. Maximum processing time, in units of It is set according to production efficiency requirements; The current processing time is expressed in units of 1. ; This is the penalty coefficient, dimensionless, and defaults to 100; Let be the distance penalty function, which is dimensionless and denoted as: .

[0108] After optimization, the final machining trajectory data is generated. This data includes parameters such as the three-dimensional coordinates of each trajectory point, the tool axis direction vector, the feed rate, and the spindle speed. It is output in standard G-code format or CNC system format for the engraving equipment to perform machining operations.

[0109] It should be explained that the color depth mapping function established in step S02 uses the exponential decay characteristic of the Lambert-Beer law to infer the spatial distribution depth of the color material by integrating multi-angle polarized light intensity information.

[0110] ;

[0111] This function introduces a weighted summation mechanism for multiple polarization angles. The weight coefficients are dynamically allocated according to the rate of change of light intensity at each angle, so that angles with significant changes in light intensity receive greater weight. This can effectively reduce the random error of single angle measurement, improve the depth estimation accuracy to the sub-millimeter level, and provide reliable depth reference data for subsequent 3D color space reconstruction.

[0112] The dynamic threshold adjustment formula designed in step S03 adaptively adjusts the segmentation threshold based on the color variance of the current growth region.

[0113] ;

[0114] The regional color standard deviation reflects the dispersion of color distribution within a region. For gradual color changes, the standard deviation is small, causing the dynamic threshold to approach the base threshold. The threshold is automatically widened to ensure regional integrity. For boundary regions with abrupt color changes, the standard deviation is large, causing the dynamic threshold to increase. The threshold is automatically tightened to improve boundary positioning accuracy. This mechanism enables the algorithm to adapt to both uniform color regions and gradual transition regions in jade materials. Compared with the fixed threshold method, it improves the segmentation accuracy by 15% to 30%.

[0115] The hybrid optimization strategy used in step S05 combines the global search capability of the improved particle swarm optimization algorithm with the local fast convergence characteristic of the quasi-Newton method.

[0116] ;

[0117] The linearly decreasing design of the adaptive inertia weight parameter in the particle velocity update equation enables the algorithm to have a strong global exploration capability in the early stage of iteration to escape local optima, and a strong local exploitation capability in the later stage of iteration to accurately approximate the optimal solution. The introduction of the mutation operator further enhances the population diversity. The calculation of the Jacobian matrix provides sensitivity information on the impact of small adjustments to the tool axis posture on cutting performance for gradient optimization. The approximate second derivative matrix updated by BFGS avoids the high computational cost of directly calculating the Hessian matrix. This hybrid optimization method improves the convergence speed of tool axis posture optimization by about 40% while ensuring the global optimality of the optimization results.

[0118] The distance penalty function designed in step S06 takes the form of a squared term.

[0119] ;

[0120] When the distance between the tool and the workpiece approaches the safety threshold, the penalty value increases rapidly, effectively guiding the optimization algorithm away from the interference region. The quadratic growth characteristic of this function ensures the smoothness and numerical stability of the optimization process. By introducing the product term of the penalty coefficient and the distance penalty function into the objective function, the success rate of collision interference correction reaches more than 99%, providing a guarantee for the safety and reliability of the carving process.

[0121] To better understand and implement this invention, a specific application scenario is provided below as Example 2: A certain jade material has a white main body with natural brownish-red skin and localized bluish-green layers distributed inside. The color transition is natural and has a clear sense of layering, making it suitable for clever color carving. Traditional hand carving methods struggle to accurately grasp the spatial distribution of the internal color layers, easily leading to deviations in color boundary positioning and affecting the artistic expression of the final work. The technical team decided to adopt a machine vision-based method for determining the processing trajectory of clever color carving equipment, using digital analysis to achieve accurate identification of color areas and automatic planning of processing paths.

[0122] The technical team first built a multi-angle polarized light image acquisition system, equipped with an industrial camera and a linear polarizing filter array. The jade material was fixed on a rotating platform, maintaining a 420mm vertical distance between the camera and the jade surface. A 5500K color temperature LED surface light source was used, with an illuminance of 3200 lx. The polarizing filter was rotated sequentially at 13 polarization angles: 0°, 15°, 30°, 45°, 60°, 75°, 90°, 105°, 120°, 135°, 150°, 165°, and 180°, capturing a 4096×3072 pixel polarized light image at each angle. An additional unpolarized natural light image was captured as a reference. The entire shooting process was conducted in a darkroom environment with the temperature controlled at 22°C and the relative humidity at 45% to ensure stable and reliable image quality.

[0123] After acquiring multi-angle polarized light images, the technical team performed spectral transmittance analysis. By measuring the light intensity changes of each pixel at different polarization angles, they calculated the transmittance distribution of Hetian jade material in the wavelength range of 400nm to 700nm. Based on Lambert-Beer's law, they obtained the attenuation coefficients of different wavelengths of light within the jade, with the attenuation coefficient for 550nm being... The attenuation coefficient for a wavelength of 630nm is By combining the exponential decay law of polarized light intensity with depth, a mapping function between color intensity and depth position was established. This function converts RGB color values ​​in a two-dimensional image into HSV color distribution coordinates in three-dimensional space, achieving effective separation of surface color and internal color layers.

[0124] Based on the color depth mapping model, the technical team performed voxel-based 3D characterization of the jade material. The entire jade space was divided into cubic voxel units with sides of 0.25mm, generating a total of 340×248×152 voxels, totaling approximately [missing information]. Voxel unit. Each voxel records the color parameters of its spatial location, including hue value H, saturation value S, and lightness value V. Typical parameters for a white main area are H=28 degrees, S=0.12, and V=0.89; typical parameters for a reddish-brown skin tone area are H=15 degrees, S=0.67, and V=0.54; and typical parameters for a cyan color layer area are H=178 degrees, S=0.43, and V=0.61. For example... Figure 2 As shown, the three-dimensional color space distribution data clearly demonstrates the spatial relationship and gradual transition characteristics of different color areas within the jade.

[0125] The technical team employed a region-growing-based color segmentation algorithm to process the 3D color space distribution data. Representative color seed points were selected in the white main region, the reddish-brown skin region, and the cyan color layer region, with the seed point locations automatically determined through color clustering analysis. Starting from these seed points, the algorithm expanded outwards to surrounding voxels, calculating the color similarity between adjacent voxels and the current growth region. Color similarity was calculated using the Euclidean distance metric in the HSV color space; voxels with a color Euclidean distance less than a dynamic threshold were included in the current growth region. The dynamic threshold was automatically adjusted based on the color variance of the voxels within the current growth region, initially set at 18 and gradually increased to 25 as the growth region expanded to accommodate natural color transitions. After 8600 iterations, three non-overlapping 3D connected color regions were ultimately formed, with the white main region containing... Individual pigments, brownish-red skin area contains Individual elements, cyan chromatic regions contain Individual factors.

[0126] After obtaining the 3D connected component segmentation results, the technical team precisely extracted the boundaries of each color region. Fuzzy C-means clustering was used to perform iterative clustering analysis on the boundary voxels, using the HSV color parameters of the boundary voxels as sample vectors. The number of cluster centers was set to 5, and the fuzzy weighting exponent was 2.1. After 42 iterations, the membership change decreased to 0.0035, satisfying the convergence condition. Simultaneously, the Sobel operator was used to calculate the gradient of the color distribution at the boundaries, obtaining the boundary normal gradient vector. The magnitude distribution of the boundary normal gradient vector is shown in Table 1: the average gradient magnitude of the boundary region between white and reddish-brown is 0.76, the average gradient magnitude of the boundary region between reddish-brown and cyan is 0.58, and the average gradient magnitude of the boundary region between white and cyan is 0.62.

[0127] Table 1. Statistical table of gradient magnitudes in different boundary regions

[0128]

[0129] Based on the statistical distribution of the magnitude of the boundary normal gradient vector, the technical team used an adaptive threshold iteration method to determine the precise boundary location. The mean of the magnitude of the global boundary normal gradient vector is 0.65, and the standard deviation is 0.17. Based on this, the adjusted boundary determination threshold was calculated to be 0.48. When the gradient magnitude at a certain location is greater than 0.48, that location is considered a true boundary point. Morphological filtering was further used to optimize the boundary curve. The morphological opening operation used a spherical structural element with a radius of 0.5 mm to remove burrs and isolated noise points on the boundary, and the morphological closing operation used a spherical structural element with a radius of 0.3 mm to fill small gaps in the boundary. The optimized precise boundary location forms a smooth and continuous surface in 3D space, with the boundary positioning error controlled within 0.18 mm.

[0130] Based on the optimized and precise boundary positions, the technical team planned the surface engraving trajectory. An initial vector field for the toolpath was established along the white and brownish-red boundary surfaces, with the tool axis direction deflected relative to the surface normal vector within a range of ±12 degrees. An improved particle swarm optimization algorithm combined with a quasi-Newton method was used for hybrid optimization of the tool axis vector. The particle swarm size was set to 50 particles, and each particle's position vector included two parameters: tool axis azimuth and pitch angle. The adaptive inertia weight parameter was linearly decreased from 0.9 to 0.4, and the mutation operator applied random perturbations to some particles with a 7% probability. After 120 iterations, the particle swarm converged to the optimal solution region, and then a local fine-tuning search was performed using the quasi-Newton method. Figure 3 As shown, the local optimal tool axis posture at each path point was calculated using the Jacobian matrix, generating a total of 2348 trajectory path points. The tool axis posture at each path point satisfies both cutting angle constraints and machine tool kinematic constraints. The optimization process comprehensively considered three cutting performance indicators: cutting force magnitude, surface roughness, and machining efficiency. Ultimately, the average cutting force was reduced to 8.3 N, the surface roughness was controlled within 0.4 μm, and the machining efficiency was improved by approximately 35%.

[0131] After obtaining the optimized tool axis posture, the technical team performed collision interference detection. A bounding box hierarchy was used to quickly filter areas prone to collisions, and precise distance calculations were performed on the 186 candidate collision areas. The tool geometry model was a 6mm diameter ball end mill, and the safety threshold was set to 15% of the tool radius, or 0.45mm. The detection results showed that the minimum distance between the tool and the jade surface at 23 path points was less than the safety threshold, and these were marked as interference points. The tool axis posture at these interference points was re-constrained and optimized. A distance constraint penalty term was added to the optimization objective function to guide the optimization algorithm to adjust the tool axis direction so that the minimum distance between the tool and the workpiece was greater than the safety threshold. After local re-optimization, all interference points were effectively handled, ultimately generating collision-free jade carving trajectory data.

[0132] The final generated jade carving trajectory data contains 2348 trajectory points, each recording complete processing parameters such as three-dimensional spatial coordinates, tool axis direction vector, feed rate, and spindle speed. The feed rate is adaptively adjusted according to the material hardness of different areas: 180 mm / min for the white main area, 150 mm / min for the brownish-red skin area, and 165 mm / min for the cyan layer area. The spindle speed is uniformly set to 24000 r / min to ensure surface quality. The trajectory data is output in ISO standard G-code format, generating a total of 68,000 lines of G-code instructions for execution by the five-axis CNC carving equipment. The technical team imported the generated G-code into the carving equipment control system, completing the automated jade carving of the entire piece in 7.5 hours. The finished product exhibits natural color boundary transitions and significantly enhanced artistic expression.

[0133] Compared to traditional hand-carving methods, this invention achieves a visual representation of the spatial distribution of color layers within jade through multi-angle polarized light image acquisition and spectral transmission analysis, overcoming the limitations of relying solely on experience to determine color layer positions. A region-growing-based color segmentation algorithm adapts to the natural gradation characteristics of jade's colors through a dynamic threshold adjustment mechanism, solving the boundary misalignment problem caused by traditional fixed-threshold segmentation methods. Multi-scale fuzzy clustering boundary extraction combined with adaptive threshold iteration achieves sub-millimeter precision positioning in complex boundary regions with dramatic color gradations, overcoming the subjectivity and uncertainty of manual boundary identification. An improved hybrid optimization strategy combining particle swarm optimization and quasi-Newton methods achieves a balance between global search and local fine-grained search, enabling tool axis posture optimization to both escape local optima and quickly converge to a high-precision solution. The introduction of collision interference detection and constraint optimization mechanisms ensures the safety and reliability of the generated processing trajectory during actual execution, avoiding damage and rework caused by tool-workpiece collisions. The entire technical solution transforms the traditional handicraft of jade carving into a digital and automated processing flow, significantly improving processing accuracy and production efficiency while retaining the flexibility of artistic creation.

[0134] It should be noted that the variables involved in this invention are explained in detail in Tables 2, 3, and 4.

[0135] Table 2. Variable Explanation Table (Part 1)

[0136]

[0137] Table 3. Variable Explanation Table (Part Two)

[0138]

[0139] Table 4. Variable Explanation Table (Part 3)

[0140]

[0141] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for determining the processing trajectory of a color-carving and engraving equipment based on machine vision, characterized in that, Includes the following steps: Collect multi-angle polarized light images of jade materials. These images include polarized light images taken at 15-degree intervals within a polarization angle range of 0 to 180 degrees, as well as unpolarized natural light images from the front. A color depth mapping model is established by performing spectral transmission analysis on multi-angle polarized light images. After separating the surface color from the internal color layer, voxelized 3D characterization is performed to obtain the 3D color space distribution data of the jade material. The 3D color space distribution data is processed by a color segmentation algorithm based on region growing to form 3D connected region segmentation results for different colors. Multi-scale fuzzy clustering boundary extraction is performed on the 3D connected region segmentation results to obtain the optimized precise boundary position. Based on the optimized precise boundary position, a curved surface carving trajectory is planned. An initial vector field of the tool path is established along the boundary surface of the optimized precise boundary position. An improved particle swarm optimization algorithm combined with the quasi-Newton method is used to perform tool axis vector hybrid optimization to obtain the optimized tool axis posture. Collision interference detection is performed on the optimized tool axis posture to generate the final carving trajectory data.

2. The method according to claim 1, characterized in that, Multi-angle polarized light images are captured using a combination of linear polarizing filters and rotating the image. The polarized light images at each polarization angle are used to analyze the light transmission characteristics of jade materials under different polarization directions.

3. The method according to claim 2, characterized in that, The process of establishing a color depth mapping model through spectral transmittance analysis is as follows: the spectral transmittance of each pixel in a multi-angle polarized light image is measured, the attenuation coefficient of light of different wavelengths inside the jade is calculated according to the Lambert-Beer law, and the mapping relationship function between color intensity and depth position is established by combining the polarized light intensity variation law.

4. The method according to claim 3, characterized in that, Voxelized 3D characterization divides the space of jade material into cubic voxel units with side lengths ∈ [0.1, 0.5] mm. Each cubic voxel unit records the color parameters of the voxel position, including hue value, saturation value, and lightness value.

5. The method according to claim 4, characterized in that, The region-growing-based color segmentation algorithm selects representative color seed points in the 3D color space distribution data, expands to the surrounding voxels starting from the representative color seed points and calculates the color similarity. When the color similarity exceeds the dynamic threshold, the voxels are merged into the corresponding color region.

6. The method according to claim 5, characterized in that, Color similarity is calculated using the Euclidean distance metric in the HSV color space, and the dynamic threshold is automatically adjusted based on the voxel color variance within the current growth region.

7. The method according to claim 6, characterized in that, Multi-scale fuzzy clustering boundary extraction uses fuzzy C-means clustering to iteratively cluster voxels of each color region. Combined with edge detection gradient field calculation, the color gradient vector at the boundary is calculated. The precise boundary position of each color region is determined by adaptive threshold iteration and morphological filtering optimization is performed.

8. The method according to claim 7, characterized in that, The fuzzy C-means clustering method uses the color parameters of the boundary voxels as sample vectors. It iteratively calculates the membership degree of each sample vector to each cluster center. The membership degree is calculated by normalizing the inverse of the distance between the sample vector and the cluster center. The cluster center positions are iteratively updated until the change in membership degree is less than the convergence threshold, which is ∈ [0.001, 0.01].

9. The method according to claim 8, characterized in that, The edge detection gradient field uses the Sobel or Canny operator to calculate the gradient of the color distribution at the boundary, and obtains the boundary normal gradient vector. The direction of the boundary normal gradient vector points to the direction of the most drastic color change.

10. The method according to claim 9, characterized in that, The adaptive threshold iteration automatically adjusts the boundary determination threshold based on the statistical distribution of the magnitude of the boundary normal gradient vector at the current boundary. When the magnitude of the boundary normal gradient vector is greater than the adjusted boundary determination threshold, the location is identified as a true boundary point.