Printing method and system based on Bezier curve

By using optimization methods such as the dual particle swarm optimization algorithm and the multi-constrained ant colony mosaic algorithm in printing path planning to perform global and local optimization of the Bezier curve, the problems of insufficient curve smoothness and discontinuous printing path in the existing technology are solved, high-precision fitting and continuous and smooth printing path are achieved, and printing efficiency and pattern quality are improved.

CN120669936AInactive Publication Date: 2025-09-19SHENZHEN IMAGE PRINTING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510788655.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-13
Publication Date
2025-09-19
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing technology has problems in printing path planning, such as insufficient curve smoothness, large fitting errors, and discontinuous printing paths, which affect the quality and stability of the printed patterns.

Method used

A Bezier curve-based printing method is adopted. A dual-particle swarm optimization algorithm is designed for global path optimization. The Bezier curve is locally refined by combining a multi-constrained ant colony mosaic algorithm for parameter curve structure optimization and an adaptive operator quantum behavior pigeon swarm optimization algorithm to improve the smoothness and continuity of the printing path.

Benefits of technology

It achieves high-precision fitting of complex patterns, generates a continuous and smooth printing path, improves printing efficiency, reduces printing interruptions and stitch skipping problems, and improves pattern continuity and overall printing quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120669936A_ABST
    Figure CN120669936A_ABST
Patent Text Reader

Abstract

The invention relates to the field of computer graphics, in particular to a Bezier curve-based printing method and system, and the method comprises the following steps: image input, Bezier curve fitting, global optimization, local refinement and printing path generation. The smoothness of a printing path is further improved, and the printing interruption or needle skipping problem is reduced; in order to solve the problems of local optimal trap, slow global convergence and high calculation cost of an optimization algorithm, a parameter curve structure optimization-oriented multi-constraint ant colony embedding algorithm and an adaptive operator quantum behavior pigeon inspired optimization algorithm are introduced to finely adjust and refine local path segments; the system comprises an image acquisition module, an image preprocessing module, an edge extraction module, a Bezier curve fitting module, an intelligent optimization module, a control instruction generation module and a printing execution module.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer graphics, and in particular to a Bezier curve-based printing method and system. Background Art

[0002] With the development of the textile printing and dyeing industry, printing technology is widely used in many fields such as clothing, home textiles, and handicrafts. Traditional printing path planning methods mainly rely on simple image stroking algorithms and fixed templates, which have problems of poor accuracy and adaptability and cannot meet the requirements of fine restoration and high-efficiency printing of complex patterns. The current mainstream curve fitting method has problems such as insufficient curve smoothness, large fitting errors, and discontinuous printing paths when dealing with irregular pattern boundaries, which seriously affect the quality and stability of printed patterns. Bezier curves, as a mathematical curve model with good smoothness and parameter controllability, are introduced into the image boundary fitting and path generation process. Relying solely on traditional Bezier curve fitting algorithms, it is difficult to automatically adapt to the local variation characteristics of complex patterns. The introduction of optimization algorithms has also become an important part of printing path planning. The application of optimization algorithms has problems such as local optimal traps, slow global convergence, and high computational cost. Summary of the Invention

[0003] In response to the above situation, in order to overcome the defects of the prior art, the present invention provides a printing method and system based on Bezier curves. To address the problems of insufficient curve smoothness, large fitting error and discontinuous printing path, the present invention designs a dual particle swarm optimization algorithm to perform global path optimization, further improve the smoothness of the printing path, reduce printing interruption or stitch skipping problems, and improve pattern continuity; to address the problems of local optimal traps, slow global convergence and high computational cost in the optimization algorithm, the present invention introduces a multi-constraint ant colony chimera algorithm and an adaptive operator quantum behavior pigeon swarm optimization algorithm for parameter curve structure optimization to fine-tune and refine the local path segments respectively, comprehensively taking into account the smoothness of printing, fitting error and printing cost, and constructing a multi-objective collaborative optimization mechanism to achieve high-precision fitting of complex patterns, continuous and smooth generation of printing paths and improvement of overall printing efficiency.

[0004] The technical solution adopted by the present invention is as follows: The present invention provides a printing method based on Bezier curve, which includes the following steps:

[0005] Step S1: image input, obtaining the image to be printed, and using edge detection algorithm to extract the contour features of the image to be printed;

[0006] Step S2: Bezier curve fitting, using a segmentation strategy to divide the contour features into curve segments, constructing a corresponding Bezier curve for each curve segment, and determining the control point parameters. All Bezier curves and corresponding control points constitute a path representation;

[0007] Step S3: global optimization, designing a dual particle swarm optimization algorithm to optimize the Bezier curve in the path representation;

[0008] Step S4: local refinement, designing a multi-constraint ant colony mosaic algorithm for parameter curve structure optimization, and combining it with the adaptive operator quantum behavior pigeon colony optimization algorithm to locally refine the optimized Bezier curve;

[0009] Step S5: generating a printing path, generating a printing path according to the locally refined Bezier curve.

[0010] Furthermore, step S3 specifically includes the following steps:

[0011] Step S31: Population initialization. The control points corresponding to the Bezier curves are combined into a solution vector. Each solution vector contains a control point corresponding to a Bezier curve. All solution vectors are combined into a population. Half of the individuals in the population are used as PSO particles, and half of the individuals are used as PSO' particles.

[0012] Step S32: Individual evaluation, setting the fitness function, and calculating the fitness values ​​of the PSO particles and PSO' particles respectively;

[0013] Step S33: Update the PSO particles. For the PSO particles, update the position and speed according to the PSO algorithm to obtain the optimal PSO particles.

[0014] Step S34: Update the PSO' particles. For the PSO' particles, the positions are updated by exchanging information with particles with higher fitness. Each particle updates its position using a weighted average method. The formula used is as follows:

[0015] ;

[0016] in, is the new position of the PSO' particle, is the optimal particle position of the PSO' particle, is the old position of the PSO' particle, and They are inertia weight and learning factor respectively;

[0017] After updating, the optimal PSO' particle is obtained;

[0018] Step S35: Control point merging: extracting control points from the solution vectors of the optimal PSO particle and the optimal PSO' particle, and merging the control points to generate the optimized Bezier curve.

[0019] Furthermore, step S4 specifically includes the following steps:

[0020] Step S41: Optimizing subdomain division, segmenting the optimized Bezier curve obtained in step S3 according to the curvature change rate to obtain local curve segments and extracting control point sets, with each local curve segment serving as an optimized subdomain;

[0021] Step S42: Initialize the pigeon population. Initialize a pigeon population for each optimized subdomain in step S41, perform local perturbation update, and obtain the control point set after the first refinement.

[0022] Step S43: using the improved ACO algorithm, the control point set after the first refinement is optimized by fitting, obtaining the control point set after the second refinement, and merging them to generate the Bezier curve after the local refinement.

[0023] Furthermore, step S42 specifically includes the following steps:

[0024] Step S421: Population initialization: initialize a pigeon population for each optimization subdomain, where each individual pigeon is encoded as a set of local control point solution vectors, initialize the velocity vector for each individual pigeon, and set the maximum number of iterations;

[0025] Step S422: Define the fitness function. The formula used is as follows:

[0026] ;

[0027] in, , is the smoothness evaluation item, is the distance error evaluation item, To calculate printing cost items;

[0028] Step S423: Local perturbation update, introducing an adaptive quantum perturbation mechanism to update the position of the individual pigeon to obtain the updated position of the individual pigeon. The formula used is as follows:

[0029] ;

[0030] ;

[0031] in, It is Pigeon individuals in the The speed of iterations, is a random function with a value range of [0,1], For the first The current position of each individual pigeon, is the quantum perturbation scaling factor, is the updated speed, is the position of the individual pigeon after the update;

[0032] Step S424: Calculate the fitness value, calculate the fitness value of all updated individual pigeon positions, compare the individual pigeon with the smallest fitness value with the global optimal solution, and if it is better than the current global optimal solution, update the global optimal solution to the individual with the highest fitness value;

[0033] Step S425: When the iteration converges, repeat steps S423 and S424. When the maximum number of iterations is reached, the iteration ends. The global optimal solution obtained in each iteration is concatenated to obtain the control point set after the first refinement.

[0034] Furthermore, step S43 specifically includes the following steps:

[0035] Step S431: Constructing an ant colony search space, establishing a path graph required for ant colony optimization based on the control point set after the first refinement, initializing the locations of the control points after the first refinement as nodes in the graph, generating all possible control point pair connection combinations as edges in the path graph by enumeration, and randomly selecting a control point in the control point set as the starting control point for the ant colony search;

[0036] Step S432: Initialize the pheromone concentration on each path in the graph and set the initial pheromone concentration to , set the maximum number of iterations of the ant colony, initialize the number of ant individuals to N, and each ant individual independently constructs a path access sequence;

[0037] Step S433: Path solution construction. Each ant individual starts from the starting control point and traverses all control points in the path graph according to the probability transition rule to obtain N path visit sequences. The probability transition formula used is as follows:

[0038] P ij t = [ τ ij (t)] α · [ η ij ] β ∑ k∈allowed [ τ ik (t)] α · [ η ik ] β ;

[0039] in, 、 For nodes, When the ant individual from the node To Node The transition probability, For path The pheromone concentration, is the heuristic function value between nodes, and are pheromone weight and heuristic function weight respectively;

[0040] Step S434: Fitness evaluation: define the same fitness function as in step S422, calculate the fitness of the path access sequence constructed by each individual ant, and record the path access sequence with the smallest fitness value as the optimal path in the current iteration;

[0041] Step S435: Pheromone update: update the edges in the path graph. The formula used is as follows:

[0042] ;

[0043] ;

[0044] in, is the pheromone volatility coefficient, It is a pheromone enhancing factor. is the fitness value of the current optimal path, path When it belongs to the optimal path in the current iteration, , otherwise 0;

[0045] Step S436: Output the result, iterate steps S433 to S435 until the maximum number of ant colony iterations is reached, and output the control point sequence corresponding to the path access sequence with the smallest fitness value during the entire iteration as the secondary refined control point set.

[0046] The present invention provides a Bezier curve-based printing system, which includes an image acquisition module, an image preprocessing module, an edge extraction module, a Bezier curve fitting module, an intelligent optimization module, a control instruction generation module, and a printing execution module. Specifically, it includes the following contents:

[0047] The image acquisition module acquires the image to be printed;

[0048] The image preprocessing module preprocesses the image to be printed, including grayscale processing, noise removal and image enhancement;

[0049] The edge extraction module uses an edge detection algorithm to extract the contour features of the pre-processed image to be printed;

[0050] The Bezier curve fitting module divides the contour features into curve segments using a segmentation strategy, and constructs a corresponding Bezier curve for each curve segment;

[0051] The intelligent optimization module uses a particle swarm optimization algorithm combined with a symbiotic biological search algorithm to design a multi-constraint ant colony chimera algorithm for parameter curve structure optimization, and combines it with an adaptive operator quantum behavior pigeon colony optimization algorithm to optimize the optimized Bezier curve;

[0052] The control instruction generation module generates a printing path according to the locally refined Bezier curve, discretizes the printing path and converts it into a control instruction that can be recognized by the printing execution module;

[0053] The printing execution module receives and executes the control instruction to complete the physical output of the printed pattern.

[0054] The beneficial effects achieved by the present invention using the above scheme are as follows:

[0055] (1) The present invention designs a dual particle swarm optimization algorithm to perform global path optimization, further improving the smoothness of the printing path, reducing printing interruptions or needle skipping problems, and improving pattern continuity;

[0056] (2) To address the problems of local optimal traps, slow global convergence and high computational cost in the optimization algorithm, the present invention introduces a multi-constraint ant colony mosaic algorithm and an adaptive operator quantum behavior pigeon colony optimization algorithm for parameter curve structure optimization, respectively fine-tuning and refining the local path segments, comprehensively considering the smoothness of printing, fitting error and printing cost, and constructing a multi-objective collaborative optimization mechanism to achieve high-precision fitting of complex patterns, continuous and smooth generation of printing paths and improvement of overall printing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 A schematic diagram of a process flow of a Bezier curve-based printing method provided by the present invention;

[0058] Figure 2 Schematic diagram of the process of step S3;

[0059] Figure 3 A schematic diagram of a module of a Bezier curve-based printing system provided by the present invention.

[0060] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention. DETAILED DESCRIPTION

[0061] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments; based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0062] In the description of the present invention, it should be understood that terms such as "upper", "lower", "front", "back", "left", "right", "top", "bottom", "inside" and "outside" indicating directions or positional relationships are based on the directions or positional relationships shown in the accompanying drawings. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction. Therefore, they should not be understood as limiting the present invention.

[0063] Example 1, see Figure 1 The present invention provides a printing method based on Bezier curve, which includes the following steps:

[0064] Step S1: image input, obtaining the image to be printed, and using edge detection algorithm to extract the contour features of the image to be printed;

[0065] Step S2: Bezier curve fitting, using a segmentation strategy to divide the contour features into curve segments, constructing a corresponding Bezier curve for each curve segment, and determining the control point parameters. All Bezier curves and corresponding control points constitute a path representation;

[0066] Step S3: global optimization, designing a dual particle swarm optimization algorithm to optimize the Bezier curve in the path representation;

[0067] Step S4: local refinement, designing a multi-constraint ant colony mosaic algorithm for parameter curve structure optimization, and combining it with the adaptive operator quantum behavior pigeon colony optimization algorithm to locally refine the optimized Bezier curve;

[0068] Step S5: generating a printing path, generating a printing path according to the locally refined Bezier curve.

[0069] Example 2, see Figure 2 This embodiment is based on the above embodiment, and step S3 specifically includes the following steps:

[0070] Step S31: Population initialization. The control points corresponding to the Bezier curves are combined into a solution vector. Each solution vector contains a control point corresponding to a Bezier curve. All solution vectors are combined into a population. Half of the individuals in the population are used as PSO particles, and half of the individuals are used as PSO' particles.

[0071] Step S32: Individual evaluation, setting the fitness function, and calculating the fitness values ​​of the PSO particles and PSO' particles respectively;

[0072] Step S33: Update the PSO particles. For the PSO particles, update the position and speed according to the PSO algorithm to obtain the optimal PSO particles.

[0073] Step S34: Update the PSO' particles. For the PSO' particles, the positions are updated by exchanging information with particles with higher fitness. Each particle updates its position using a weighted average method. The formula used is as follows:

[0074] ;

[0075] in, is the new position of the PSO' particle, is the optimal particle position of the PSO' particle, is the old position of the PSO' particle, and They are inertia weight and learning factor respectively;

[0076] After updating, the optimal PSO' particle is obtained;

[0077] Step S35: Control point merging: extracting control points from the solution vectors of the optimal PSO particle and the optimal PSO' particle, and merging the control points to generate the optimized Bezier curve.

[0078] In this example, a two-dimensional path is fitted and a third-order Bezier curve (4 control points) is used to represent this path. We fix the starting point and end point , only for the two middle control points and The position of is optimized, the population size is set to 4, 2 PSO particles and 2 PSO' particles, and the maximum number of iterations is 3;

[0079] Round 0: Population initialization

[0080] individual type Control Point#timg# Control Point#timg# A PSO (2.0,1.0) (8.0,1.0) B PSO (3.0,2.5) (7.0,2.5) C PSO' (1.5,2.0) (8.5,2.0) D PSO' (2.5,3.5) (7.5,3.5)

[0081] Round 0: Fitness evaluation

[0082] individual Fitness A 4.2 B 1.8 C 2.6 D 1.6

[0083] First iteration:

[0084] Particles A and B are updated, A is updated, , the first dimension of A:

[0085] Old position: 2.0, initial speed is 0;

[0086] Individual optimality: 2.0, group optimality (B): 3.0;

[0087] The update speed is 0.6, so the new position is 2.6;

[0088] Repeat the process to update the 4-dimensional vector of A. After the update, A' is (2.6, 1.4), (7.5, 1.8);

[0089] B is already optimal and remains unchanged;

[0090] Update PSO' particles: Update C particles;

[0091] Old value: 1.5, optimal value: 2.5, updated C' is (1.75, 2.75), (8.0, 2.75);

[0092] D is already optimal and remains unchanged;

[0093] Control point merging:

[0094] The optimal PSO particle is B: (3.0, 2.5), (7.0, 2.5);

[0095] The optimal PSO' particles are D: (2.5, 3.5), (7.5, 3.5);

[0096] Weighted average control point merging (weights: 0.6 for PSO and 0.4 for PSO'):

[0097] :(2.8,2.9);

[0098] :(7.2,2.9);

[0099] Final merge control points:

[0100] ;

[0101] ;

[0102] ;

[0103] ;

[0104] Generates an optimized Bezier curve.

[0105] Embodiment 3: This embodiment is based on the above embodiment, and step S4 specifically includes the following steps:

[0106] Step S41: Optimizing subdomain division, segmenting the optimized Bezier curve obtained in step S3 according to the curvature change rate to obtain local curve segments and extracting control point sets, with each local curve segment serving as an optimized subdomain;

[0107] Step S42: Initialize the pigeon population. Initialize a pigeon population for each optimized subdomain in step S41, perform local perturbation update, and obtain the control point set after the first refinement.

[0108] Step S42 specifically includes the following steps:

[0109] Step S421: Population initialization: initialize a pigeon population for each optimization subdomain, where each individual pigeon is encoded as a set of local control point solution vectors, initialize the velocity vector for each individual pigeon, and set the maximum number of iterations;

[0110] Step S422: Define the fitness function. The formula used is as follows:

[0111] ;

[0112] in, , is the smoothness evaluation item, is the distance error evaluation item, To calculate printing cost items;

[0113] Step S423: Local perturbation update, introducing an adaptive quantum perturbation mechanism to update the position of the individual pigeon to obtain the updated position of the individual pigeon. The formula used is as follows:

[0114] ;

[0115] ;

[0116] in, It is Pigeon individuals in the The speed of iterations, is a random function with a value range of [0,1], For the first The current position of each individual pigeon, is the quantum perturbation scaling factor, is the updated speed, is the position of the individual pigeon after the update;

[0117] Step S424: Calculate the fitness value, calculate the fitness value of all updated individual pigeon positions, compare the individual pigeon with the smallest fitness value with the global optimal solution, and if it is better than the current global optimal solution, update the global optimal solution to the individual with the highest fitness value;

[0118] Step S425: When the iteration converges, repeat steps S423 and S424. When the maximum number of iterations is reached, the iteration ends. The global optimal solution obtained in each iteration is concatenated to obtain the control point set after the first refinement.

[0119] Step S43: using the improved ACO algorithm, the control point set after the first refinement is optimized by fitting, obtaining the control point set after the second refinement, and merging them to generate the Bezier curve after the local refinement.

[0120] In this embodiment, the codes used are as follows:

[0121] import numpy as np

[0122] import matplotlib.pyplot as plt

[0123] # Initial Bezier curve control points (obtained after step S3)

[0124] P0 = np.array([[0, 0], [2.8, 2.9], [7.2, 2.9], [10, 0]])

[0125] def bezier_curve(points, n=100):

[0126] t = np.linspace(0, 1, n)

[0127] curve = np.zeros((n, 2))

[0128] n_points = len(points) - 1

[0129] for i in range(n_points + 1):

[0130] binomial = np.math.comb(n_points, i)

[0131] curve += binomial * ((1 - t) ** (n_points - i))[:, None] * (t** i)[:, None] * points[i]

[0132] return curve

[0133] # Simple subdomain division: divided into two sections

[0134] subdomains = [

[0135] P0[:2] + [P0[1]], # first paragraph

[0136] [P0[1]] + P0[2:] # Second paragraph

[0138] def pigeon_inspired_optimization(ctrl_pts, max_iter=30, theta=0.3):

[0139] num_pigeons = 10

[0140] pigeons = np.array([ctrl_pts + np.random.uniform(-0.5, 0.5, ctrl_pts.shape) for _ in range(num_pigeons)])

[0141] velocities = np.random.uniform(-0.1, 0.1, pigeons.shape)

[0142] best_pigeon = pigeons[0]

[0143] best_score = float('inf')

[0144] def fitness(x):

[0145] smoothness = np.sum(np.diff(x, axis=0)**2)

[0146] fitting = np.linalg.norm(bezier_curve(x) - bezier_curve(ctrl_pts))

[0147] print_cost = np.sum(np.linalg.norm(np.diff(x, axis=0), axis=1))

[0148] return 0.3 * smoothness + 0.5 * fitting + 0.2 * print_cost

[0149] for _ in range(max_iter):

[0150] for i in range(num_pigeons):

[0151] velocities[i] = velocities[i] * theta * (np.random.rand(*ctrl_pts.shape) - 0.5)

[0152] pigeons[i] += velocities[i]

[0153] scores = [fitness(p) for p in pigeons]

[0154] min_idx = np.argmin(scores)

[0155] if scores[min_idx] < best_score:

[0156] best_score = scores[min_idx]

[0157] best_pigeon = pigeons[min_idx]

[0158] return best_pigeon

[0159] # Optimize for each sub - domain

[0160] refined_ctrl_pts = []

[0161] for domain in subdomains:

[0162] domain_np = np.array(domain)

[0163] optimized = pigeon_inspired_optimization(domain_np)

[0164] refined_ctrl_pts.extend(optimized.tolist())

[0165] refined_ctrl_pts = np.array(refined_ctrl_pts)

[0166] # Visualization

[0167] original_curve = bezier_curve(P0)

[0168] refined_curve = bezier_curve(refined_ctrl_pts)

[0169] plt.figure(figsize=(10, 6))

[0170] plt.plot(original_curve[:, 0], original_curve[:, 1], 'k--', label="Original Bezier")

[0171] plt.plot(refined_curve[:, 0], refined_curve[:, 1], 'b-', label="Refined Bezier")

[0172] plt.scatter(refined_ctrl_pts[:, 0], refined_ctrl_pts[:, 1], color='red', label="Refined Control Points")

[0173] plt.legend()

[0174] plt.title("Bezier Curve Refinement using PIO")

[0175] plt.grid(True)

[0176] plt.axis("equal")

[0177] plt.show().

[0178] Embodiment 4: This embodiment is based on the above embodiment, and step S43 specifically includes the following steps:

[0179] Step S431: Constructing an ant colony search space, establishing a path graph required for ant colony optimization based on the control point set after the first refinement, initializing the locations of the control points after the first refinement as nodes in the graph, generating all possible control point pair connection combinations as edges in the path graph by enumeration, and randomly selecting a control point in the control point set as the starting control point for the ant colony search;

[0180] Step S432: Initialize the pheromone concentration on each path in the graph and set the initial pheromone concentration to , set the maximum number of iterations of the ant colony, initialize the number of ant individuals to N, and each ant individual independently constructs a path access sequence;

[0181] Step S433: Path solution construction. Each ant individual starts from the starting control point and traverses all control points in the path graph according to the probability transition rule to obtain N path visit sequences. The probability transition formula used is as follows:

[0182] P ij t = [ τ ij (t)] α · [ η ij ] β ∑ k∈allowed [ τ ik (t)] α · [ η ik ] β ;

[0183] in, 、 For nodes, When the ant individual from the node To Node The transition probability, For path The pheromone concentration, is the heuristic function value between nodes, and are pheromone weight and heuristic function weight respectively;

[0184] Step S434: Fitness evaluation: define the same fitness function as in step S422, calculate the fitness of the path access sequence constructed by each individual ant, and record the path access sequence with the smallest fitness value as the optimal path in the current iteration;

[0185] Step S435: Pheromone update: update the edges in the path graph. The formula used is as follows:

[0186] ;

[0187] ;

[0188] in, is the pheromone volatility coefficient, It is a pheromone enhancing factor. is the fitness value of the current optimal path, path When it belongs to the optimal path in the current iteration, , otherwise 0;

[0189] Step S436: Output the result, iterate steps S433 to S435 until the maximum number of ant colony iterations is reached, and output the control point sequence corresponding to the path access sequence with the smallest fitness value during the entire iteration as the secondary refined control point set.

[0190] Example 5, see Figure 3 The present invention provides a Bezier curve-based printing system, which includes an image acquisition module, an image preprocessing module, an edge extraction module, a Bezier curve fitting module, an intelligent optimization module, a control instruction generation module, and a printing execution module, specifically including the following contents:

[0191] The image acquisition module acquires the image to be printed;

[0192] The image preprocessing module preprocesses the image to be printed, including grayscale processing, noise removal and image enhancement;

[0193] The edge extraction module uses an edge detection algorithm to extract the contour features of the pre-processed image to be printed;

[0194] The Bezier curve fitting module divides the contour features into curve segments using a segmentation strategy, and constructs a corresponding Bezier curve for each curve segment;

[0195] The intelligent optimization module uses a particle swarm optimization algorithm combined with a symbiotic biological search algorithm to design a multi-constraint ant colony chimera algorithm for parameter curve structure optimization, and combines it with an adaptive operator quantum behavior pigeon colony optimization algorithm to optimize the optimized Bezier curve;

[0196] The control instruction generation module generates a printing path according to the locally refined Bezier curve, discretizes the printing path and converts it into a control instruction that can be recognized by the printing execution module;

[0197] The printing execution module receives and executes the control instruction to complete the physical output of the printed pattern.

[0198] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus.

[0199] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.

[0200] The present invention and its embodiments are described above. This description is not restrictive. The drawings show only one embodiment of the present invention, and the actual structure is not limited thereto. In short, if a person skilled in the art is inspired by this and, without departing from the purpose of the present invention, designs structures and embodiments similar to this technical solution without inventiveness, they shall fall within the scope of protection of the present invention.

Claims

1. A printing method based on Bezier curves, characterized in that: The method comprises the following steps: Step S1: image input, obtaining the image to be printed, and using edge detection algorithm to extract the contour features of the image to be printed; Step S2: Bezier curve fitting, using a segmentation strategy to divide the contour features into curve segments, constructing a corresponding Bezier curve for each curve segment, and determining the control point parameters. All Bezier curves and corresponding control points constitute a path representation; Step S3: global optimization, designing a dual particle swarm optimization algorithm to optimize the Bezier curve in the path representation; Step S4: local refinement, designing a multi-constraint ant colony mosaic algorithm for parameter curve structure optimization, and combining it with the adaptive operator quantum behavior pigeon colony optimization algorithm to locally refine the optimized Bezier curve; Step S5: generating a printing path, generating a printing path according to the locally refined Bezier curve.

2. The method for printing a print based on a Bezier curve according to claim 1, characterized in that: Step S3 specifically includes the following steps: Step S31: Population initialization. The control points corresponding to the Bezier curves are combined into a solution vector. Each solution vector contains a control point corresponding to a Bezier curve. All solution vectors are combined into a population. Half of the individuals in the population are used as PSO particles, and half of the individuals are used as PSO' particles. Step S32: Individual evaluation, setting the fitness function, and calculating the fitness values ​​of the PSO particles and PSO' particles respectively; Step S33: Update the PSO particles. For the PSO particles, update the position and speed according to the PSO algorithm to obtain the optimal PSO particles. Step S34: Update the PSO' particles. For the PSO' particles, the positions are updated by exchanging information with particles with higher fitness. Each particle updates its position using a weighted average method. The formula used is as follows: ; in, is the new position of the PSO' particle, is the optimal particle position of the PSO' particle, is the old position of the PSO' particle, and They are inertia weight and learning factor respectively; After updating, the optimal PSO' particle is obtained; Step S35: Control point merging: extracting control points from the solution vectors of the optimal PSO particle and the optimal PSO' particle, and merging the control points to generate the optimized Bezier curve.

3. The method for printing a print based on a Bezier curve according to claim 1, wherein: Step S4 specifically includes the following steps: Step S41: Optimizing subdomain division, segmenting the optimized Bezier curve obtained in step S3 according to the curvature change rate to obtain local curve segments and extracting control point sets, with each local curve segment serving as an optimized subdomain; Step S42: Initialize the pigeon population. Initialize a pigeon population for each optimized subdomain in step S41, perform local perturbation update, and obtain the control point set after the first refinement. Step S43: using the improved ACO algorithm, the control point set after the first refinement is optimized by fitting, obtaining the control point set after the second refinement, and merging them to generate the Bezier curve after the local refinement.

4. A Bezier curve-based printing system according to any one of claims 1 to 3, characterized in that: It includes image acquisition module, image preprocessing module, edge extraction module, Bezier curve fitting module, intelligent optimization module, control instruction generation module and print execution module, specifically including the following contents: The image acquisition module acquires the image to be printed; The image preprocessing module preprocesses the image to be printed, including grayscale processing, noise removal and image enhancement; The edge extraction module uses an edge detection algorithm to extract the contour features of the pre-processed image to be printed; The Bezier curve fitting module divides the contour features into curve segments using a segmentation strategy, and constructs a corresponding Bezier curve for each curve segment; The intelligent optimization module uses a particle swarm optimization algorithm combined with a symbiotic biological search algorithm to design a multi-constraint ant colony chimera algorithm for parameter curve structure optimization, and combines it with an adaptive operator quantum behavior pigeon colony optimization algorithm to optimize the optimized Bezier curve; The control instruction generation module generates a printing path according to the locally refined Bezier curve, discretizes the printing path and converts it into a control instruction that can be recognized by the printing execution module; The printing execution module receives and executes the control instruction to complete the physical output of the printed pattern.