Automatic sewing identification method and system based on image identification

By acquiring surface image data of the sewing object through image recognition technology, generating geometric contours, and optimizing path density and smoothness, this method solves the problems of human error and equipment versatility in traditional sewing path generation methods, and achieves efficient and accurate sewing path generation.

CN121504932APending Publication Date: 2026-02-10GUIZHOU UNIV

Patent Information

Application Number
CN202610037108.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-13
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

Traditional sewing path generation methods rely on manual operation, which is prone to errors and cannot meet the accuracy and consistency requirements of mass production. Furthermore, the preset template method cannot flexibly adapt to different specifications and types of sewing needs, resulting in poor equipment versatility, insufficient optimization of path density and smoothness, and affecting sewing quality and efficiency.

Method used

The surface image data of the sewing object is obtained by image recognition technology, and feature extraction is performed to generate geometric contour data. Combined with user parameters, the sewing path is dynamically generated, and the path density is adaptively adjusted and the smoothness is optimized to finally generate visualized graphic data.

Benefits of technology

It achieves precision and flexibility in sewing paths, reduces human error, improves production efficiency and equipment stability, and enhances the quality of sewing products and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121504932A_ABST
    Figure CN121504932A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of sewing automation, and discloses an automatic sewing identification method and system based on image identification. The method comprises the steps of obtaining surface image data of a target sewing object, and performing feature extraction on the surface image data to generate a geometric contour data set; according to sewing parameter configuration information input by a user, executing path generation operation to obtain an initial sewing path coordinate sequence; based on spatial distribution characteristics of the geometric contour data set, performing path density adaptive adjustment on the initial path, and generating a corrected sewing path coordinate sequence; performing smoothness optimization processing on the corrected path to obtain a final sewing path coordinate sequence; and converting the final path coordinate sequence into visual graphic data, and rendering and outputting the visual graphic data in real time. According to the method, the contour of the sewing object can be accurately obtained, different sewing requirements can be flexibly met, the path density and smoothness are optimized, the accuracy and efficiency of sewing path generation are improved, the defects of a traditional method are overcome, and the method is suitable for various sewing processing scenes.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of sewing automation, in particular to a sewing automatic identification method and system based on image recognition. BACKGROUND

[0002] In the field of sewing processing, the accuracy and efficiency of path planning directly affect the processing quality and production progress of products. Traditional sewing path generation methods mostly rely on manual operation. The operator needs to set the sewing path by manually drawing or inputting coordinates according to the shape, size, and other information of the sewing object. The entire process not only consumes a lot of time, but also is prone to path precision deficiencies due to human operation errors. Especially when dealing with sewing objects with complex geometric contours, the difficulty of manual planning increases significantly, making it difficult to meet the requirements of consistency and precision in batch production.

[0003] With the development of automation technology, some sewing equipment has begun to use the method of presetting templates to generate paths, that is, the path data corresponding to a specific style of sewing object is pre-stored, and the template data is directly called for sewing operation in actual processing. However, this path generation method based on preset templates has obvious limitations. When the size, shape, or surface features of the sewing object change, new template data needs to be re-created and stored, which cannot flexibly adapt to different specifications and types of sewing requirements, resulting in poor versatility and adaptability of the equipment, increasing the time and labor costs in the production preparation stage.

[0004] Some path generation methods in the prior art have low precision in feature extraction of surface images when processing sewing object image data, making it difficult to accurately obtain the geometric contour data of the sewing object, and thus causing deviations between the generated initial sewing path and the actual requirements. In addition, in the path optimization process, most lack adaptive adjustment mechanisms for path density, and cannot reasonably adjust the path density according to the spatial distribution characteristics of the sewing object geometric contour (such as the curvature change and complexity of the contour curve), which may cause path sparseness or denseness in complex contour areas, affecting the sewing quality. In terms of path smoothness optimization, existing methods often use simple linear smoothing processing, which cannot effectively eliminate the abrupt points in the path, causing unstable operation of the equipment during sewing and affecting the final sewing effect. The existence of these problems makes it difficult for traditional sewing path generation methods to meet the needs of modern sewing processing for efficiency, accuracy, and flexibility, restricting the further development and application of sewing automation technology. SUMMARY

[0005] The present application aims to provide a sewing automatic identification method and system based on image recognition to solve the problems raised in the background.

[0006] To achieve the above objectives, the present invention provides an automatic sewing identification method based on image recognition, the method comprising:

[0007] Acquire surface image data of the target sewing object;

[0008] The surface image data is processed by feature extraction to generate a set of geometric contour data of the target sewing object;

[0009] Based on the sewing parameter configuration information input by the user, a path generation operation is performed on the geometric contour data set to dynamically generate an initial sewing path coordinate sequence;

[0010] Based on the spatial distribution characteristics of the geometric contour data set, the path density of the initial sewing path coordinate sequence is adaptively adjusted to generate a corrected sewing path coordinate sequence.

[0011] The modified sewing path coordinate sequence is subjected to smoothness optimization processing to generate the final sewing path coordinate sequence;

[0012] The final sewing path coordinate sequence is converted into visual graphic data and rendered and output in real time.

[0013] Preferably, the step of performing feature extraction processing on the surface image data to generate a geometric contour data set of the target sewing object includes:

[0014] Perform grayscale conversion processing on the surface image data to generate grayscale image data;

[0015] Gaussian filtering is performed on the grayscale image data to generate denoised image data;

[0016] Adaptive threshold segmentation is performed on the denoised image data to generate binarized image data;

[0017] Detect the boundary pixel set of the target sewing object on the binarized image data;

[0018] The Douglas-Peucker algorithm is used to simplify the boundary pixel set to generate the geometric contour data set.

[0019] Preferably, the step of performing a path generation operation on the geometric contour data set based on the sewing parameter configuration information input by the user includes:

[0020] Parse the stitch type identifier in the sewing parameter configuration information;

[0021] If the routing type identifier corresponds to a straight routing pattern, a set of parallel offset path points is generated along the contour lines of the geometric contour data set at a preset interval.

[0022] If the routing type identifier corresponds to the Zigzag routing pattern, it travels along the contour line of the geometric contour data set, calculates and superimposes the amplitude offset based on the dynamic normal vector, and generates a set of periodic oscillation path points.

[0023] The generated set of path points is integrated into the initial sewing path coordinate sequence.

[0024] Preferably, the step of adaptively adjusting the path density of the initial sewing path coordinate sequence based on the spatial distribution characteristics of the geometric contour data set includes:

[0025] Calculate the local radius of curvature value of the geometric contour data set;

[0026] If the local radius of curvature is less than the preset curvature threshold, the path point encryption mechanism is triggered, and new path points are inserted in the corresponding segment according to the preset encryption ratio.

[0027] If the local radius of curvature value is greater than or equal to the preset curvature threshold, the original path point distribution density is maintained.

[0028] The corrected sewing path coordinate sequence is updated and generated based on the encryption result.

[0029] Preferably, the smoothness optimization processing of the corrected sewing path coordinate sequence includes:

[0030] Extract continuous path points from the corrected sewing path coordinate sequence;

[0031] The continuous path points are fitted using a cubic spline interpolation algorithm to generate a smoothly transitioning curved path.

[0032] The curved path is discretized into a set of equally spaced path points to generate the final sewing path coordinate sequence.

[0033] Preferably, the method further includes:

[0034] Establish a dynamic update response mechanism for user parameters to monitor in real time whether the sewing parameter configuration information input by the user has changed;

[0035] If a sewing parameter change signal is detected, the path generation operation, path density adaptive adjustment and smoothness optimization processing steps are retried.

[0036] The rendering output of the visualization data is refreshed in real time based on the updated final sewing path coordinate sequence.

[0037] Preferably, the calculation and superposition of amplitude offset based on dynamic normal vector specifically includes:

[0038] Extract path reference points sequentially along the contour lines of the geometric contour data set;

[0039] Calculate the tangent direction vector at the path reference point;

[0040] Generate orthogonal normal direction vectors based on the tangent direction vector;

[0041] Based on the amplitude parameter value in the sewing parameter configuration information input by the user, positive and negative offsets are alternately applied along the normal direction vector;

[0042] The offset coordinates are added to the set of periodic oscillation path points.

[0043] Preferably, the specific rules for determining the preset encryption ratio are as follows:

[0044] Establish an inverse mapping relationship between the radius of curvature and the encryption ratio coefficient;

[0045] When the local radius of curvature value falls within the first preset range, a first encryption ratio coefficient is assigned;

[0046] When the local radius of curvature value falls into the second preset range, a second encryption ratio coefficient is assigned;

[0047] The upper limit of the first preset interval is less than the lower limit of the second preset interval, and the first encryption ratio coefficient is greater than the second encryption ratio coefficient.

[0048] Preferably, the method further includes:

[0049] In response to the data export command, the final sewing path coordinate sequence is converted into a G-code instruction set recognizable by the target sewing device;

[0050] The G-code instruction set is output to a preset storage location.

[0051] Preferably, the present invention also includes an image recognition-based automatic sewing identification system, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor, when executing the computer program, implements the steps of the above-described image recognition-based automatic sewing identification method.

[0052] Compared with the prior art, the beneficial effects of the present invention are:

[0053] This image recognition-based automatic sewing identification method can accurately capture the geometric contour information of the sewing object by acquiring surface image data of the target sewing object and extracting features. It eliminates the reliance on operator experience in traditional manual path planning and avoids the problem of insufficient path accuracy caused by human operation errors. This allows the generated sewing path to better fit the actual shape and size requirements of the sewing object. Especially when dealing with sewing objects with complex geometric contours, it can more accurately restore contour details, ensuring the accuracy of subsequent sewing processing.

[0054] In the path generation stage, the initial sewing path coordinate sequence is dynamically generated by combining the sewing parameter configuration information input by the user. Users can flexibly set parameters according to different sewing process requirements, fabric characteristics or product design needs. This breaks the dependence of the traditional preset template method on fixed-specification sewing objects. There is no need to repeatedly make and store template data for different types of sewing objects, which significantly improves the versatility and adaptability of the method, reduces the time and manpower input in the production preparation stage, and improves the overall efficiency of sewing processing.

[0055] Based on the spatial distribution characteristics of the geometric contour dataset, the initial path density is adaptively adjusted, allowing for flexible adjustment of path density according to the actual situation of the sewing object's contour. For example, in areas with large contour curve curvature and complex structures, the path density can be automatically increased to ensure the integrity of sewing details; in areas with relatively gentle contours and simple structures, the path density is appropriately reduced to avoid resource waste. This adaptive adjustment method makes the distribution of sewing paths more reasonable, ensuring sewing quality in complex areas while avoiding unnecessary path redundancy, thus improving the resource utilization efficiency of the sewing process.

[0056] Smoothing optimization of the sewing path coordinate sequence can effectively eliminate abrupt changes and irregular line segments in the path, making the final sewing path smoother. This reduces the number of starts and stops and speed fluctuations of the sewing equipment during operation, reduces the instability of equipment operation, extends the service life of the equipment, and avoids problems such as fabric wrinkling and uneven stitches caused by uneven path, further improving the appearance quality and craftsmanship of sewing products.

[0057] The final sewing path coordinate sequence is converted into visual graphic data and rendered in real time, allowing users to intuitively observe the generated sewing path. This facilitates timely detection and adjustment of potential problems in the path, eliminating the need to wait for actual sewing operations to verify the path's rationality. This reduces rework caused by path issues, lowers production costs, and provides a more convenient way for users to interact with the equipment, thus improving the user experience. Attached Figure Description

[0058] Figure 1This is a schematic diagram illustrating the working principle of the image recognition-based automatic sewing identification method described in this invention.

[0059] Figure 2 A flowchart for generating a geometric contour dataset from surface image data features;

[0060] Figure 3 This is a flowchart of calculating and superimposing amplitude offsets based on dynamic normal vectors;

[0061] Figure 4 A flowchart for optimizing the smoothness of the sewing path coordinate sequence. Detailed Implementation

[0062] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0063] Please see Figure 1 This invention provides an automatic sewing identification method and system based on image recognition, the method comprising:

[0064] By acquiring surface image data of the target sewing object, feature extraction is performed to generate a geometric contour dataset. Combined with user-input sewing parameter configuration information, an initial sewing path coordinate sequence is dynamically generated. Based on the spatial distribution characteristics of the geometric contour, path density is adaptively adjusted and smoothness optimized, ultimately outputting visualized graphical data. This method achieves automated generation and real-time rendering of sewing paths, improving the accuracy and efficiency of path planning.

[0065] Example 1: See Figure 2 In the implementation of an image recognition-based automatic sewing identification method, feature extraction is a crucial stage in transforming raw image data into usable geometric information. This process begins with the acquisition of surface image data of the target sewing object, typically sourced from high-resolution industrial cameras or scanning equipment, which may contain color or grayscale information. When the input is a color image, the system first performs grayscale conversion using the weighted average method recommended by the International Commission on Illumination (ICI). Based on the differences in human eye sensitivity to different wavelengths of light, weight coefficients of 0.299, 0.587, and 0.114 are assigned to the red, green, and blue channels, respectively. Grayscale image data is generated by calculating the weighted sum of the brightness values ​​of each channel of the pixel. This conversion method can reduce data dimensionality while preserving the texture details and contrast information of the image to the greatest extent, laying the foundation for subsequent processing steps.

[0066] After grayscale conversion, image data may still contain various noise interferences, originating from uneven lighting, sensor noise, or transmission interference during image acquisition. To eliminate these adverse factors, the system performs Gaussian filtering noise reduction on the grayscale image data. A two-dimensional Gaussian function is used to construct the convolution kernel, and the kernel size and standard deviation parameters are adjusted to balance the denoising effect with the degree of detail preservation. During processing, the new value of each pixel is determined by the weighted average of its neighboring pixels. Neighboring pixels closer to the center pixel have higher weight coefficients. This mechanism can effectively smooth random noise while preserving edge features. The denoised image exhibits a more uniform grayscale distribution, which is beneficial for image segmentation operations.

[0067] After obtaining the denoised image data, the system performs adaptive thresholding segmentation, a step designed to convert the image into a binary image containing only black and white pixel values. Unlike global thresholding methods, adaptive thresholding considers the characteristics of local image regions, dynamically determining the segmentation threshold by calculating the average brightness or Gaussian weighted value of the neighborhood around each pixel. This method effectively handles uneven lighting conditions, ensuring accurate segmentation results in different regions of the image. In the processed binary image, the area of ​​the target sewing object is marked as the foreground (usually represented as white), while the background area is marked as black, thus forming a clear region division.

[0068] Based on binarized image data, the system begins by detecting the boundary pixel set of the target sewing object. Edge detection algorithms identify the object's contour by analyzing abrupt changes in pixel intensity, employing classic Canny operators or similar edge detection techniques. These algorithms first calculate the gradient magnitude and direction of the image, then accurately locate edge pixels through non-maximum suppression and double thresholding. The selection of the gradient threshold during detection needs to be considered to balance edge detection sensitivity and noise resistance. The obtained boundary pixel set constitutes a preliminary representation of the object's contour, but these sets often contain a large number of redundant points, requiring simplification. To generate a concise and accurate geometric contour, the system uses the Douglas-Peucker algorithm to simplify the boundary pixel set. This algorithm recursively evaluates the contribution of each point to the contour shape. First, it connects the start and end points of the contour to form a straight line, then finds the point among all intermediate points that deviates furthest from this line. If this maximum deviation distance is greater than a preset tolerance threshold, the point is retained as a key point. The algorithm repeats this process for the two segmented sub-segments. The iteration continues until the deviation of all points is less than the tolerance threshold; the final set of points retained is the simplified geometric contour. This simplification method can significantly reduce the amount of data and improve the efficiency of subsequent processing while maintaining the shape characteristics of the contour.

[0069] Throughout the feature extraction process, the system employs a modular design. Each processing stage generates intermediate result data, which can be cached and reused to support possible parameter adjustments and recalculations. Image data generated during the grayscale conversion stage is stored in matrix form, preserving the original resolution information. In Gaussian filtering, the parameters of the convolution kernel can be dynamically adjusted based on image characteristics. Smaller kernel sizes are used for textured regions to preserve details, while larger kernel sizes are used for smooth regions to enhance denoising. The selection of the neighborhood size for adaptive thresholding requires comprehensive consideration of image resolution and detail complexity, and the optimal parameter range is typically determined experimentally.

[0070] The pixel set generated during the boundary detection stage contains coordinate information and topological connectivity. This information is organized into an ordered sequence of points, maintaining the continuity of the contour. The tolerance threshold setting of the Douglas-Peucker algorithm directly affects the accuracy of the simplified contour; a smaller threshold retains more detailed features, while a larger threshold produces a more simplified contour. The system typically provides default threshold suggestions and also allows users to adjust them according to specific application needs. The final generated geometric contour dataset is stored as a coordinate sequence, with each coordinate point containing horizontal and vertical coordinate values, along with connectivity information between contour segments. The feature extraction process is fully automated, requiring no manual intervention, but the system provides visualization of intermediate results for users to monitor the processing effect. If abnormal results are found at any processing stage, the system supports parameter reconfiguration and local recalculation without having to start the entire process from scratch. This design improves processing efficiency while ensuring the accuracy and reliability of the output geometric contour data, providing high-quality input data for path generation operations.

[0071] Example 2: See Figure 4 During the path generation process, the system first receives a set of geometric contour data generated in the feature extraction stage. This data exists in the form of an ordered coordinate sequence, describing the complete contour information of the target sewing object. Users input sewing parameter configuration information through a graphical interface or configuration file, including key settings such as stitch type identifiers, stitch spacing parameters, and amplitude parameters. When parsing this configuration information, the system uses a structured data parsing method to convert the text or binary format configuration data into internally usable parameter objects. The identification of stitch type identifiers is based on a predefined pattern encoding table. The system maintains a data dictionary containing descriptions of various stitch patterns to accurately map user input to the corresponding processing logic.

[0072] When the routing type identifier corresponds to a straight routing mode, the system generates a set of parallel offset path points along the contour lines of the geometric contour data set at preset intervals. This process begins in the preprocessing stage of the contour data, where the system calculates the total length and direction of the contour lines to determine the offset direction and distance. The preset interval comes from the line spacing parameters input by the user, which are usually in millimeters or pixels. The system unifies the units to the internal coordinate system based on the conversion relationship between image resolution and actual object size. The parallel offset path is generated using an equidistant offset algorithm, which calculates the normal direction of each point on the contour line and offsets outward or inward by a specified distance along the normal direction. For closed contours, the system usually chooses to offset inward to generate an internal sewing path; for open contours, the offset direction is determined according to the lateral parameters specified by the user.

[0073] In the implementation of the straight-line stitching mode, the system employs a special strategy when handling corners and complex shapes of the contour lines. When encountering sharp corners, the algorithm automatically inserts additional path points to avoid path intersections or deformations. During the offset process, the system continuously monitors the generated path points for self-intersections. If an anomaly is detected, the offset distance is automatically adjusted or a segmented offset strategy is adopted. The generated set of parallel offset path points maintains the same point order as the original contour, ensuring the continuity of the sewing path. Each path point contains precise coordinate information and includes the tangent direction data for that point, providing geometric information for subsequent processing steps. If the stitching type identifier corresponds to the Zigzag stitching mode, the system enters the generation process of a periodic oscillating path. This mode first extracts path reference points sequentially along the contour lines of the geometric contour data set. The spacing between these reference points is determined by the total contour length and the density parameters specified by the user. The system calculates the tangent direction vector at each path reference point, determining the tangent direction by analyzing the coordinate differences between adjacent points. For a continuous sequence of points, the central difference method is used to calculate the tangent vector of each point. This method estimates the tangent direction of the current point by the positional relationship between the previous and next points, which can effectively reduce calculation errors.

[0074] After obtaining the tangent direction vector, the system generates an orthogonal normal direction vector. The calculation of the normal vector is based on a perpendicular rotation of the tangent vector, achieved by swapping vector components and adjusting their signs. The selection of the normal direction needs to consider the concavity and convexity of the contour; the system automatically determines the inward and outward directions of the normal based on the curvature sign of the contour points. The amplitude parameter value input by the user determines the magnitude of the oscillation, which is converted into the actual offset in the internal coordinate system. The system alternately applies positive and negative offsets along the normal direction vector. This alternation pattern typically employs a simple odd-even alternation strategy: applying a positive offset to odd-numbered points and a negative offset to even-numbered points.

[0075] During the application of amplitude offset, the system needs to handle some special cases. When the contour curvature changes significantly, simple normal offset may lead to path intersections or deformations. Therefore, the system monitors the quality of the offset path in real time. If a potential problem is detected, the system automatically adjusts the amplitude or uses smoothing to avoid anomalies. For feature points on the contour line, such as corner points or points with maximum curvature, the system appropriately increases the density of path points to ensure the accuracy of the oscillation path. All coordinate points after the offset are collected into a set of periodic oscillation path points. These points maintain a strict sequential relationship, forming a continuous oscillation path. When integrating the generated path point sets into the initial sewing path coordinate sequence, the system performs data fusion and optimization operations. For straight-line stitching, the parallel offset path point set directly constitutes the path sequence; for Zigzag stitching, the periodic oscillation path point set needs to be associated and matched with the contour reference point. During the integration process, the system checks the continuity of the path points.

[0076] Example 3: In the implementation of adaptive path density adjustment, the system refines the initial sewing path coordinate sequence based on the spatial distribution characteristics of the geometric contour data set. The core objective of this processing stage is to intelligently adjust the distribution density of path points according to the dynamic changes in contour curvature, so that high curvature areas obtain higher path point density to improve sewing accuracy, while maintaining appropriate point spacing in low curvature areas to ensure processing efficiency. The system first performs a traversal analysis of the geometric contour data set, calculating the curvature feature value of each local region. This process uses a calculation method based on the geometric relationship formed by three adjacent points. For three consecutive points in the contour sequence... , , The system calculates the intermediate point through vector operations. curvature eigenvalues ​​at The calculation formula is as follows:

[0077]

[0078] in: Point The curvature characteristic value at that point, , , These represent the coordinate vectors of three consecutive points in the contour sequence. This represents the vector cross product operation. This formula represents the calculation of the vector's magnitude. It effectively reflects the degree of local curvature of the contour, and its value is inversely proportional to the radius of curvature. The calculation process exhibits good numerical stability.

[0079] The calculated curvature feature value is compared with a preset curvature threshold parameter, which is typically set by the user based on specific sewing precision requirements or uses a default value built into the system. When a local curvature feature value is detected to be greater than the preset curvature threshold, it indicates that the contour of that area is highly curved, and the system automatically triggers a path point encryption mechanism. The encryption operation inserts new path points in the corresponding segments according to a preset encryption ratio. The specific value of the encryption ratio is determined based on the positive correlation between the curvature feature value and the encryption ratio coefficient. The system internally establishes a correspondence table between curvature intervals and encryption coefficients. When the curvature feature value falls into a high curvature interval, a larger encryption ratio coefficient is assigned; when it falls into a low curvature interval, a smaller encryption ratio coefficient is assigned. Furthermore, the encryption coefficient increases as the curvature feature value increases.

[0080] During pathpoint encryption, the system employs an adaptive interpolation algorithm to add new points between existing pathpoints. For relatively straight contour segments, linear interpolation is used to evenly insert new points between adjacent points; for contour segments with higher curvature, quadratic or cubic interpolation methods are used to better preserve the contour shape characteristics. The number of new points is determined by both the encryption ratio coefficient and the original point spacing. The encrypted point spacing is inversely proportional to the curvature feature value, meaning the greater the curvature, the smaller the point spacing. Simultaneously with inserting new points, the system calculates the tangent and normal vectors of these points, preserving necessary geometric information for subsequent processing steps.

[0081] When the local curvature feature value is less than or equal to the preset curvature threshold, the system maintains the original path point distribution density unchanged. In this case, the path point spacing is relatively large, but it still needs to meet the basic sewing accuracy requirements. The system checks the distribution uniformity of path points in these areas to ensure that the point spacing changes smoothly without abnormal fluctuations. For transition areas where the curvature feature value is at a critical state, the system adopts a smooth density transition strategy, adjusting the point density gradually to avoid sewing quality problems caused by sudden changes in path point density. When updating and generating the corrected sewing path coordinate sequence based on the encryption result, the system performs data recombination and optimization operations. The new path sequence maintains the original point order relationship and records the attribute information of each point, including whether it is a new point, curvature feature value, encryption ratio, and other metadata. During the sequence recombination process, the system checks the continuity and consistency of the path to ensure that there are no point overlaps or disordered orders. For the encrypted path, the system also performs a light smoothing process to eliminate minor irregularities that may be introduced by interpolation. The entire path density adaptive adjustment process adopts an iterative optimization strategy, and the system can evaluate and adjust the encryption result multiple times. After the first encryption, the system recalculates the curvature feature distribution of the encrypted region. If some areas are found to require further encryption, a second round of encryption is initiated. This iterative mechanism ensures that the final pathpoint distribution fully reflects the geometric features of the contour. Simultaneously, the system sets a maximum iteration limit to prevent over-encryption from causing an explosive increase in the number of pathpoints.

[0082] During implementation, the system also considers handling some special cases. For contours with sharp corners, the curvature feature value calculation may produce outliers. In such cases, the system employs special processing strategies, such as forcibly increasing the path point density near the corners. For nearly straight contour segments, the system appropriately relaxes the density conditions to avoid unnecessary point insertion. All these processing strategies aim to balance path accuracy and computational efficiency, ensuring that the final generated sewing path maintains both geometric accuracy and practicality.

[0083] The generation of the corrected sewing path coordinate sequence marks the completion of the path density adaptive adjustment stage. This sequence not only contains the optimized path point coordinates but also carries rich geometric information, providing a data foundation for smoothness optimization. Throughout the process, the system maintains flexible and adjustable processing parameters, allowing users to adjust parameters such as curvature threshold and density ratio according to specific sewing needs, adapting to the requirements of different materials and sewing processes. All intermediate data generated during processing is properly stored, supporting backtracking analysis and parameter adjustment when necessary.

[0084] Example 4: See Figure 3In the smoothness optimization stage, the system receives the corrected sewing path coordinate sequence generated from the path density adaptive adjustment stage. This sequence may contain unevenly distributed points introduced by the encryption operation. Although it meets the density requirements of the curvature region, it may affect the smoothness of the final sewing path. The system first preprocesses the input coordinate sequence, including data verification and format unification, to ensure that all coordinate points use a consistent coordinate system and precision representation. During the preprocessing process, possible outliers are detected and removed, such as points whose coordinate values ​​are outside the reasonable range or too close to other points. These outliers may originate from numerical calculation errors in the previous processing stage.

[0085] After extracting continuous path points from the corrected sewing path coordinate sequence, the system uses a cubic spline interpolation algorithm for curve fitting. This algorithm is based on the principle of piecewise polynomial approximation, constructing a cubic polynomial function between each pair of adjacent points. These functions remain continuous at the connection points and have continuous first and second derivatives. During interpolation, the system automatically adjusts the length of the polynomial segments according to the distribution density of the points, using shorter segments in high-density regions and longer segments in low-density regions. Boundary conditions are handled using a natural spline approach, where the second derivative at the start and end points of the path is zero, resulting in a natural transition of the fitted curve at the endpoints.

[0086] The fitted smooth transition curve path needs to be discretized into a set of equally spaced path points to adapt to the execution requirements of the sewing equipment. The discretization process first calculates the total arc length of the curve, accumulating the lengths of each differential segment using numerical integration. The spacing between the equally spaced points is determined based on the user-defined sewing accuracy parameters; this parameter is typically in millimeters, and the system converts the units according to the device resolution. Points are sampled at equal intervals along the curve arc length, and the coordinates of each sampled point are obtained by solving parametric equations, ultimately forming a uniformly distributed final sewing path coordinate sequence. Throughout the smoothing process, the system establishes a dynamic update response mechanism for user parameters to monitor changes in sewing parameter configuration information in real time. This mechanism is based on the observer pattern; when the user modifies any sewing parameter through the interface, such as stitch type, stitch spacing, amplitude, etc., the system immediately captures the change event. The event handling module parses the changes and determines which processing stages need to be re-executed. For the smoothness optimization stage, if parameters affecting curve fitting change, such as interpolation algorithm type or discretization accuracy, the system marks the current path sequence as pending update.

[0087] When a change in sewing parameters is detected, the system re-triggers the entire processing flow starting from path generation. This means that the path generation calculation, path density adaptive adjustment, and smoothness optimization steps need to be re-executed sequentially. During the recalculation, the system retains the original geometric contour data but generates a completely new path sequence based on the new parameter settings. This comprehensive recalculation ensures consistency across all processing stages and avoids mismatches between stages caused by parameter changes. To optimize recalculation efficiency, the system employs an incremental update strategy. If only smoothness-related parameters change, while the geometric data output from previous stages remains unchanged, the system can re-execute only the smoothing stage, skipping the path generation and density adjustment stages. This optimization reduces computational overhead and improves system response speed. The system maintains a parameter change history for intelligently determining the range of processing stages that need to be re-executed.

[0088] Based on the updated final sewing path coordinate sequence, the system refreshes the rendering output of the visualization data in real time. The rendering engine converts the coordinate sequence into graphic elements and draws smooth path curves in the user interface using OpenGL or similar graphics libraries. During visualization, the system uses different colors and line styles to distinguish between the original path and the processed path, helping users intuitively understand the optimization effect. The rendering output supports scaling and panning operations, allowing users to examine the local features of the path in detail. The system records detailed parameter settings and processing results during processing, forming the path optimization record shown in Table 1.

[0089] Table 1: Record of Smoothness Optimization Processing Parameters.

[0090] Parameter category Parameter name Parameter value Influence range Last update time Interpolation parameter Spline type Cubic spline Path smoothness 2023-08-2014:32:18 Interpolation parameter Node distribution Uniform distribution Curve fitting accuracy 2023-08-2014:32:18 Discretization parameter Point spacing (mm) 0.5 Path resolution 2023-08-2014:35:42 Discretization parameter Maximum allowed error 0.01 Discretization accuracy 2023-08-2014:35:42 Rendering parameter Curve display width 2.0 Visual effect 2023-08-2014:36:15 Rendering parameter Color scheme Blue-red gradient Path curvature visualization 2023-08-2014:36:15

[0091] The smoothness optimization stage pays special attention to the geometric continuity quality of the path. After interpolation, the system evaluates the quality of the generated curve, detecting potential inflection points or abrupt curvature changes. If substandard sections are found, local re-interpolation or increased control point density is automatically performed. For complex contour shapes, the system employs an adaptive interpolation strategy, using higher interpolation density in areas of significant curvature variation and maintaining lower density in flat areas, ensuring smoothness while controlling computational complexity. Finally, the output format of the sewing path coordinate sequence is carefully designed, containing complete geometric information and processing metadata. Each path point not only contains coordinate values ​​but also stores derived geometric attributes such as the tangent direction and radius of curvature. This additional information provides crucial reference for sewing equipment control, especially for advanced applications requiring adjustments to sewing speed or tension based on path curvature. The system also provides a path quality report function, generating evaluation data on indicators such as path smoothness and point distribution uniformity to help users understand the processing results.

[0092] Example 5: During the data export phase, the system responds to data export commands from the user interface or automated processes through a dedicated output processing module. These commands may be triggered directly by the user, such as clicking the export button or selecting a menu option, or they may be automatically generated by the system after path optimization. The command parsing module first verifies the validity of the export request, checks the integrity and availability of the final sewing path coordinate sequence, and confirms that the data is exportable. The system also checks the type and compatibility settings of the target sewing equipment, information that is typically configured during system initialization or obtained through the device's automatic detection function.

[0093] The core of the conversion process lies in transforming geometric path data into control instructions executable by the device. The system maintains a device driver library containing G-code dialect specifications for various common sewing machines. For each path point in the final sewing path coordinate sequence, the conversion algorithm calculates the corresponding G-code instruction. Movement instructions typically use the G01 linear interpolation command, which includes the target coordinate position and feed rate parameters. Coordinate value conversion requires considering coordinate system transformation, converting the internal calculation coordinate system to the device's working coordinate system. This process involves coordinate translation, rotation, and scaling transformations. The feed rate parameters are determined comprehensively based on the user-set sewing speed parameters and device characteristics to ensure smooth movement and compliance with process requirements.

[0094] In addition to basic movement commands, the system generates a sequence of equipment control commands, including initialization commands, coordinate system settings, unit selection, and needle start / stop control. The initialization command ensures the equipment is in a known initial state, while the coordinate system setting command defines the origin and direction of the working coordinate system. The needle start / stop control command adds needle insertion and release instructions at the required positions according to sewing process requirements. The system also generates auxiliary function commands, such as thread tension adjustment and thread trimming control; the parameters for these commands are derived from the user's process configuration database.

[0095] During the conversion process, special attention is paid to optimizing the instruction sequence. The system employs instruction compression technology to merge consecutive, similar instructions into a more concise form, reducing code size. For straight-line paths, absolute coordinate instructions are used to improve code readability; for complex curved paths, relative coordinate instructions are used to reduce data volume. Code optimization also includes motion smoothing, adding appropriate deceleration instructions at path turning points to avoid vibrations and errors caused by sudden stops and starts of the equipment. All generated instructions undergo syntax checking to ensure compliance with the G-code specifications of the target device. The output destination for the G-code instruction set can be various storage locations. Local file system output is the most common method, allowing users to choose the save path and file naming rules. Network output supports sending instructions directly to the device controller via industrial communication protocols for seamless integration. Cloud storage output provides remote access and version management capabilities. During the output process, the system generates a detailed export report, recording information such as conversion parameters, output time, and file size. The report also includes quality check results, listing potential warnings or anomalies.

[0096] File format processing is a crucial step in the output stage. The system supports various G-code file formats, including plain text, binary, and industry-standard formats. Plain text format facilitates manual reading and debugging, while binary format offers higher storage and transmission efficiency. For specific devices, the system may also generate device-specific file formats, which typically contain additional control information and checksum data. During format conversion, the system ensures the correct encoding and order of all instructions are maintained, preventing information loss or corruption caused by format conversion. The error handling mechanism in the output process can detect and respond to various anomalies. When encountering function instructions that are not supported by the device, the system will automatically convert them into an equivalent instruction sequence or issue a warning. Hardware problems such as insufficient storage space and network interruptions are also monitored in real time, and corresponding measures are taken. The system provides an output log function, recording the process and results of each export operation in detail. These logs can be used for troubleshooting and process optimization.

[0097] The user interface provides progress feedback and status display during the output phase. A real-time progress bar shows the conversion and output progress, and detailed status information includes the currently processed path segment, the number of generated instructions, and the estimated completion time. Users can pause, cancel, or adjust output parameters during the output process, and the system maintains consistency. After output is complete, the system provides an output result preview function, graphically displaying the path trajectory corresponding to the generated G-code, facilitating user verification of output quality. Quality assurance measures during the output phase include multiple verification mechanisms. Syntax verification ensures that all instructions conform to the target device specifications, semantic verification checks the logical correctness of the instruction sequence, and simulation runs verify the feasibility of path execution through software simulation. These verification measures significantly reduce the risk of device execution errors. The system also provides an output configuration template function, allowing users to save commonly used output parameter combinations, simplifying the operation process for repetitive tasks. The system maintains an output history database, storing detailed information and output files for each export operation. The history supports querying and retrieving by various conditions such as time, device type, and project name. Users can quickly re-execute past export operations or compare output results from different versions through the history. This database is also integrated with the project management system, supporting version control and traceability of output data.

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

[0099] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for automatic sewing identification based on image recognition, characterized in that, include: Acquire surface image data of the target sewing object; The surface image data is processed by feature extraction to generate a set of geometric contour data of the target sewing object; Based on the sewing parameter configuration information input by the user, a path generation operation is performed on the geometric contour data set to dynamically generate an initial sewing path coordinate sequence; Based on the spatial distribution characteristics of the geometric contour data set, the path density of the initial sewing path coordinate sequence is adaptively adjusted to generate a corrected sewing path coordinate sequence. The modified sewing path coordinate sequence is subjected to smoothness optimization processing to generate the final sewing path coordinate sequence; The final sewing path coordinate sequence is converted into visual graphic data and rendered and output in real time.

2. The automatic sewing identification method based on image recognition according to claim 1, characterized in that, The step of performing feature extraction processing on the surface image data to generate a geometric contour data set of the target sewing object includes: Perform grayscale conversion processing on the surface image data to generate grayscale image data; Gaussian filtering is performed on the grayscale image data to generate denoised image data; Adaptive threshold segmentation is performed on the denoised image data to generate binarized image data; Detect the boundary pixel set of the target sewing object on the binarized image data; The Douglas-Peucker algorithm is used to simplify the boundary pixel set to generate the geometric contour data set.

3. The automatic sewing identification method based on image recognition according to claim 1, characterized in that, The step of performing path generation operations on the geometric contour data set based on the sewing parameter configuration information input by the user includes: Parse the stitch type identifier in the sewing parameter configuration information; If the routing type identifier corresponds to a straight routing pattern, a set of parallel offset path points is generated along the contour lines of the geometric contour data set at a preset interval. If the routing type identifier corresponds to the Zigzag routing pattern, it travels along the contour line of the geometric contour data set, calculates and superimposes the amplitude offset based on the dynamic normal vector, and generates a set of periodic oscillation path points. The generated set of path points is integrated into the initial sewing path coordinate sequence.

4. The automatic sewing identification method based on image recognition according to claim 1, characterized in that, The adaptive adjustment of the path density of the initial sewing path coordinate sequence based on the spatial distribution characteristics of the geometric contour data set includes: Calculate the local radius of curvature value of the geometric contour data set; If the local radius of curvature is less than the preset curvature threshold, the path point encryption mechanism is triggered, and new path points are inserted in the corresponding segment according to the preset encryption ratio. If the local radius of curvature value is greater than or equal to the preset curvature threshold, the original path point distribution density is maintained. The corrected sewing path coordinate sequence is updated and generated based on the encryption result.

5. The automatic sewing identification method based on image recognition according to claim 1, characterized in that, The smoothing optimization process for the corrected sewing path coordinate sequence includes: Extract continuous path points from the corrected sewing path coordinate sequence; The continuous path points are fitted using a cubic spline interpolation algorithm to generate a smoothly transitioning curved path. The curved path is discretized into a set of equally spaced path points to generate the final sewing path coordinate sequence.

6. The automatic sewing identification method based on image recognition according to claim 1, characterized in that, The method further includes: Establish a dynamic update response mechanism for user parameters to monitor in real time whether the sewing parameter configuration information input by the user has changed; If a sewing parameter change signal is detected, the path generation operation, path density adaptive adjustment and smoothness optimization processing steps are retried. The rendering output of the visualization data is refreshed in real time based on the updated final sewing path coordinate sequence.

7. The automatic sewing identification method based on image recognition according to claim 3, characterized in that, The calculation and superposition of amplitude offset based on dynamic normal vectors specifically includes: Extract path reference points sequentially along the contour lines of the geometric contour data set; Calculate the tangent direction vector at the path reference point; Generate orthogonal normal direction vectors based on the tangent direction vector; Based on the amplitude parameter value in the sewing parameter configuration information input by the user, positive and negative offsets are alternately applied along the normal direction vector; The offset coordinates are added to the set of periodic oscillation path points.

8. The automatic sewing identification method based on image recognition according to claim 4, characterized in that, The specific rules for determining the preset encryption ratio are as follows: Establish an inverse mapping relationship between the radius of curvature and the encryption ratio coefficient; When the local radius of curvature value falls within the first preset range, a first encryption ratio coefficient is assigned; When the local radius of curvature value falls into the second preset range, a second encryption ratio coefficient is assigned; The upper limit of the first preset interval is less than the lower limit of the second preset interval, and the first encryption ratio coefficient is greater than the second encryption ratio coefficient.

9. The automatic sewing identification method based on image recognition according to claim 1, characterized in that, The method further includes: In response to the data export command, the final sewing path coordinate sequence is converted into a G-code instruction set recognizable by the target sewing device; The G-code instruction set is output to a preset storage location.

10. An automatic sewing identification system based on image recognition, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the image recognition-based automatic sewing identification method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Weld joint ultrasonic detection parameter optimization method based on particle swarm optimization

    CN120822076A

  • Sewing stitching defect detection method and system

    KR102322546B1

Cited By

  • Sewing template design method and system based on adjustable parameters

    CN121859745A