Adaptive color quantization and weaving method, device and equipment for Tibetan carpets and medium
Patent Information
- Application Number
- CN202610132125.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-30
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2046-01-30
AI Technical Summary
[0003]然而,当采用上述方式时,常会存在如下技术问题:首先,固定大小的调色板无法适应图像内容的多样性
[0011]本申请的技术方案具有如下有益效果:通过本申请的一种藏毯的自适应颜色量化与编制方法,实现了从数字图案到物理藏毯的较高保真、较高效率、自适应的智能生产,有效解决了传统量化方法中调色板大小固定导致的色彩失真、细节丢失与人工依赖性强等核心问题。具体而言,现有颜色量化方法依赖于固定大小的调色板,无法根据图像内容动态调整,在应用于色彩与纹理复杂的藏毯图案时,常导致色线冗余或色彩层次缺失,且过程严重依赖工艺师经验,难以实现标准化高效生产。基于此,本申请实施例的藏毯的自适应颜色量化与编制方法,包括:首先,通过获取藏毯图案原始图像并对之进行特征提取得到特征图,构建了面向编织语义的深度特征表示。这一步骤摒弃了传统方法直接对原始像素进行聚类的方式,转而通过深度网络提取融合色彩、纹理及结构的深层特征。这为后续的自适应决策提供了富含语义信息的输入,从源头上确保了量化过程能够理解图案的视觉复杂性(如区分平缓底色与精细纹理),为克服现有技术“见色不见形”导致的量化失真奠定了基础。其次,通过基于特征图自适应生成关键特征通道集合,实现了调色板大小的智能动态决策,这是本方案的核心突破。该步骤通过分析特征图的全局与局部信息,自动筛选出对当前图案至关重要的特征通道,其数量直接决定后续调色板的大小。这彻底颠覆了现有技术必须预设固定颜色数量的范式,使得系统能够根据图案自身特点(如一幅藏毯中简洁边框与繁复中心纹样的差异)“按需分配”色线数量,在资源精简与视觉保真间实现了根本性的自适应平衡。接着,根据关键特征通道集合生成藏毯编织色线调色板,并基于此对原始图像进行颜色映射得到生产指导图像,完成了从自适应决策到可执行生产数据的精准转换。此过程确保生成的调色板颜色与图案特征强关联,且通过优化后的映射算法生成清晰的分色指导图。这不仅保证了量化图像的高视觉质量,更重要的是产出了直接驱动后续编织流程的结构化指令,实现了数字化设计到标准化生产的无缝衔接,避免了传统方法中因量化效果不理想而需人工反复修改图纸的环节。最后,根据藏毯生产指导图像进行藏毯实物的制作,并通过集成自动化编织与实时质量检验流程,形成了生产闭环。该方法将智能化的量化结果与自动化编织设备及在线视觉检测系统相结合,实现了从“数字指令”到“物理成品”的精准、高效、可控转化。综上,本申请的实施例通过“深度特征提取、自适应通道筛选、动态调色板生成、闭环生产执行”的协同技术路线,构建了一个完整的智能藏毯生产解决方案。该方法不仅攻克了固定调色板无法自适应这一根本性技术障碍,更通过端到端的系统设计,在提升艺术还原度、降低生产成本、实现生产标准化与自动化等方面带来了综合效益。
Smart Images

Figure CN122049086B_ABST
Abstract
Description
Technical Field
[0001] The embodiments disclosed herein relate to the field of computer technology, and specifically to adaptive color quantization and weaving methods, apparatus, devices, and media for Tibetan carpets. Background Technology
[0002] Color quantization technology is a core component of image processing and digital production, playing a crucial role, especially in the digital design and production of handcrafted items such as Tibetan carpets. This technology aims to convert a richly colored original image into a palette composed of a limited number of colors, facilitating storage, transmission, or guiding physical production (e.g., selecting corresponding color lines). Currently, mainstream color quantization methods (such as median stripping, K-means clustering, and octree algorithms) all share a common premise: the size of the palette (i.e., the number of colors) must be pre-defined. This method is particularly valuable in practical applications, especially in scenarios like Tibetan carpets where high color fidelity and texture detail are critical.
[0003] However, the above methods often present the following technical problems: First, a fixed-size color palette cannot adapt to the diversity of image content. For simple, flat pattern areas, too many colors lead to resource waste and increased production complexity; while for areas with rich color gradients and fine textures, too few colors result in color banding and blurred details, severely damaging the artistic effect. Second, the quantization process relies on manual experience and repeated adjustments. To achieve a balance between visual quality and cost in different patterns, technicians must preset and adjust the number of colors multiple times based on experience, which is inefficient and makes standardization and large-scale production difficult. Finally, the limitations of existing algorithms further restrict the stability and reliability of the quantization effect. For example, the K-means algorithm is sensitive to initial values and easily gets trapped in local optima, leading to inconsistent results from repeated processing; the median cut algorithm is prone to producing unnatural color block boundaries when the color distribution is uneven.
[0004] The information disclosed in this background section is only intended to enhance the understanding of the background of the inventive concept, and therefore may contain information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0005] The summary portion of this disclosure is intended to provide a brief overview of the concepts, which will be described in detail in the detailed description portion. This summary portion is not intended to identify key or essential features of the claimed technical solutions, nor is it intended to limit the scope of the claimed technical solutions.
[0006] Some embodiments of this disclosure propose adaptive color quantization and weaving methods, apparatuses, devices, and media for Tibetan carpets to solve one or more of the technical problems mentioned in the background section above.
[0007] In a first aspect, some embodiments of this disclosure provide an adaptive color quantization and weaving method for Tibetan carpets, including: acquiring an original image of a Tibetan carpet pattern; extracting features from the original image of the Tibetan carpet pattern to obtain a feature map; adaptively generating a set of key feature channels based on the feature map; generating a Tibetan carpet weaving color palette according to the set of key feature channels, wherein the number of colors in the Tibetan carpet weaving color palette corresponds to the number of key feature channels in the set of key feature channels; performing color mapping on the original image of the Tibetan carpet pattern based on the Tibetan carpet weaving color palette to obtain a Tibetan carpet production guidance image; and producing a physical Tibetan carpet according to the Tibetan carpet production guidance image.
[0008] Secondly, some embodiments of this disclosure provide an adaptive color quantization and weaving apparatus for Tibetan carpets, comprising: an acquisition unit configured to acquire an original image of a Tibetan carpet pattern; a feature extraction unit configured to extract features from the original image of the Tibetan carpet pattern to obtain a feature map; a first generation unit configured to adaptively generate a set of key feature channels based on the feature map; a second generation unit configured to generate a Tibetan carpet weaving color palette based on the set of key feature channels, wherein the number of colors in the Tibetan carpet weaving color palette corresponds to the number of key feature channels in the set of key feature channels; a mapping unit configured to perform color mapping on the original image of the Tibetan carpet pattern based on the Tibetan carpet weaving color palette to obtain a Tibetan carpet production guidance image; and a production unit configured to produce a physical Tibetan carpet based on the Tibetan carpet production guidance image.
[0009] Thirdly, some embodiments of this disclosure provide an electronic device, including: one or more processors; and a storage device having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation of the first aspect above.
[0010] Fourthly, some embodiments of this disclosure provide a computer-readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method described in any of the implementations of the first aspect above.
[0011] The technical solution of this application has the following beneficial effects: Through the adaptive color quantization and weaving method for Tibetan carpets proposed in this application, high-fidelity, high-efficiency, and adaptive intelligent production from digital patterns to physical Tibetan carpets is achieved, effectively solving the core problems of color distortion, loss of detail, and strong reliance on manual labor caused by the fixed size of the color palette in traditional quantization methods. Specifically, existing color quantization methods rely on a fixed-size color palette, which cannot be dynamically adjusted according to the image content. When applied to Tibetan carpet patterns with complex colors and textures, this often leads to redundant color lines or missing color levels, and the process heavily relies on the experience of craftsmen, making it difficult to achieve standardized and efficient production. Based on this, the adaptive color quantization and weaving method for Tibetan carpets in this application includes: First, obtaining the original image of the Tibetan carpet pattern and extracting features from it to obtain a feature map, constructing a deep feature representation oriented towards weaving semantics. This step abandons the traditional method of directly clustering the original pixels, and instead extracts and integrates deep features of color, texture, and structure through a deep network. This provides semantically rich input for subsequent adaptive decision-making, ensuring from the source that the quantization process can understand the visual complexity of the pattern (such as distinguishing between a smooth background color and a fine texture), laying the foundation for overcoming the quantization distortion caused by the "seeing color but not form" problem in existing technologies. Secondly, the core breakthrough of this solution is the intelligent dynamic decision-making for the color palette size achieved by adaptively generating a set of key feature channels based on feature maps. This step automatically filters out the feature channels crucial to the current pattern by analyzing the global and local information of the feature maps, and their quantity directly determines the size of the subsequent color palette. This completely overturns the paradigm of existing technologies that must preset a fixed number of colors, enabling the system to "allocate" the number of color lines "on demand" according to the characteristics of the pattern itself (such as the difference between a simple border and a complex central pattern in a Tibetan carpet), achieving a fundamental adaptive balance between resource simplification and visual fidelity. Next, a Tibetan carpet weaving color palette is generated based on the set of key feature channels, and based on this, a color mapping is performed on the original image to obtain a production guidance image, completing the precise conversion from adaptive decision-making to executable production data. This process ensures a strong correlation between the generated palette colors and pattern features, and generates clear color separation guidelines through an optimized mapping algorithm. This not only guarantees high visual quality of the quantified images, but more importantly, it produces structured instructions that directly drive subsequent weaving processes, achieving a seamless transition from digital design to standardized production. This avoids the need for repeated manual modifications to the drawings due to unsatisfactory quantification results, a common practice in traditional methods. Finally, the actual Tibetan carpets are produced based on the production guidelines, and a closed-loop production process is formed by integrating automated weaving and real-time quality inspection. This method combines intelligent quantification results with automated weaving equipment and an online visual inspection system, achieving a precise, efficient, and controllable transformation from "digital instructions" to "physical finished products."In summary, the embodiments of this application construct a complete intelligent Tibetan carpet production solution through a collaborative technical approach of "deep feature extraction, adaptive channel filtering, dynamic color palette generation, and closed-loop production execution." This method not only overcomes the fundamental technical obstacle of a fixed color palette's inability to adapt, but also brings comprehensive benefits in terms of improving artistic fidelity, reducing production costs, and achieving production standardization and automation through end-to-end system design. Attached Figure Description
[0012] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and elements are not necessarily drawn to scale.
[0013] Figure 1 This is a flowchart of some embodiments of the adaptive color quantization and weaving method for Tibetan carpets according to the present disclosure; Figure 2 These are schematic diagrams of some embodiments of the adaptive color quantization and weaving apparatus for Tibetan carpets according to the present disclosure; Figure 3 This is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. Detailed Implementation
[0014] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0015] It should also be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings. Unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other.
[0016] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0017] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0018] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0019] This disclosure will now be described in detail with reference to the accompanying drawings and embodiments.
[0020] Figure 1 A flowchart 100 is shown, illustrating some embodiments of the adaptive color quantization and weaving method for Tibetan carpets according to this disclosure. The adaptive color quantization and weaving method for Tibetan carpets includes the following steps: Step 101: Obtain the original image of the Tibetan carpet pattern.
[0021] In some embodiments, the executing entity (e.g., a computing device) of the adaptive color quantization and weaving method for Tibetan carpets can acquire original images of Tibetan carpet patterns. These original images refer to the digital representation of the Tibetan carpet design or physical sample image to be digitally color-quantized and woven. They are typically color digital images containing R, G, and B channels, carrying complete color, texture, and pattern structure information of the Tibetan carpet design, and serve as the input source and data foundation for all subsequent adaptive processing steps in this method. Image sources include, but are not limited to: scanning the design draft or physical sample carpet using a high-definition scanner, direct generation by computer-aided design (CAD) software, or retrieval from an existing digital image library. In practice, the executing entity can read pre-stored or real-time acquired digital image files from a specified storage location (such as a local hard drive, database, network storage, or connected scanning device) by calling an image input interface. The system first verifies the format and integrity of the image file, and then decodes it into standard three-dimensional tensor data that can be processed by subsequent modules. For example, the executing entity reads a file named "Traditional Auspicious Pattern_001.png" from the database. The image is in RGB format with a spatial resolution of 256 pixels × 256 pixels. Its content is a colored design drawing containing a complex floral border and a central geometric pattern. The system loads the image into memory and normalizes its pixel values to a floating-point range of [0, 1], forming tensor data that can be processed in subsequent steps.
[0022] Step 102: Extract features from the original image of the Tibetan carpet pattern to obtain a feature map.
[0023] In some embodiments, the aforementioned execution entity may perform feature extraction on the original image of the Tibetan carpet pattern to obtain a feature map.
[0024] In some optional implementations of certain embodiments, the aforementioned execution entity may extract features from the original image of the Tibetan carpet pattern using the following steps to obtain a feature map: Step 1: Perform primary feature extraction processing on the original image to obtain a primary feature map. This primary feature extraction processing refers to the initial feature transformation operation performed on the input image through the first convolutional layer. The primary feature map is the feature representation output after this initial convolutional processing, where the number of channels increases but the spatial size remains unchanged; it encodes the image's basic color and edge information. In practice, this step can be accomplished by constructing and running the first convolutional layer of a convolutional neural network (CNN). This layer can be configured with 3 input channels (corresponding to RGB), 64 output channels, a 3×3 kernel size, padding to maintain size, and a ReLU activation function. The processing unit inputs the preprocessed original image tensor into this layer, performs convolution calculations and activation, thereby generating the primary feature map. For example, for a 256 pixel × 256 pixel input image, this step yields a primary feature map with dimensions [256, 256, 64]. Each of the 64 channels in this tensor can be viewed as a response map to a certain fundamental pattern in the image, such as edges or color gradients in a specific direction.
[0025] Step two involves downsampling the primary feature map to obtain an intermediate feature map. This downsampling specifically refers to reducing the spatial resolution of the feature map through pooling. The intermediate feature map is the feature representation obtained after the initial downsampling, with its spatial size halved and the number of channels unchanged. It aggregates local information and has stronger robustness. In practice, the execution entity can implement this step by connecting a max pooling layer after the primary feature extraction process. This pooling layer can use a 2×2 pooling window and a stride of 2. The execution entity inputs the primary feature map into this pooling layer and outputs the intermediate feature map with its spatial dimensions halved. For example, inputting a primary feature map with dimensions [256, 256, 64] into the pooling layer will output an intermediate feature map with dimensions [128, 128, 64]. Each feature value represents the most significant feature response within the corresponding 2×2 region of the original image.
[0026] Step three involves performing deep feature extraction on the intermediate feature map to obtain a new feature map. This deep feature extraction process refers to the complete process of further abstracting and compressing the features through multiple concatenated convolutional and pooling layers. The final feature map obtained is the output of this step and the entire feature extraction process. It is a highly abstracted, spatially smaller, and configurable deep feature tensor. Each channel corresponds to a certain abstract and interpretable local feature pattern (such as a specific texture or structural component) in the input image. In practice, the aforementioned execution entity can achieve this processing by performing the following steps sequentially: First, process the intermediate feature map using a second convolutional layer (e.g., 64 input channels, 128 output channels, 3×3 convolutional kernel, ReLU activation); then, perform a second feature downsampling (e.g., 2×2 max pooling, stride 2); next, process it using a third convolutional layer (e.g., 128 input channels, configurable FEATURE_CHANNELS channel count such as 32, 3×3 convolutional kernel, ReLU activation); finally, perform a final downsampling to fix the output size. The purpose of this series of operations is to condense high-level semantic information. For example, after processing the intermediate feature map with dimensions [128, 128, 64] through the aforementioned second convolutional layer, pooling layer, third convolutional layer, and final pooling layer, a feature map with dimensions [64, 64, 32] may be obtained. This feature map serves as the input to the subsequent adaptive channel filtering module, with each of its 32 channels representing a type of visual feature in the Tibetan carpet pattern that needs to be evaluated.
[0027] Step 103: Based on the feature map, adaptively generate a set of key feature channels.
[0028] In some embodiments, the execution entity may adaptively generate a set of key feature channels based on the feature map.
[0029] In some optional implementations of certain embodiments, the aforementioned execution entity may adaptively generate a set of key feature channels based on the aforementioned feature map through the following steps: Step one involves performing global and local feature analysis on the aforementioned feature map to obtain a channel importance assessment. This global and local feature analysis refers to extracting the statistical summary information (global features) of each channel within the entire image and its response or importance distribution information at different spatial locations (local features) for each channel of the feature map, and then fusing these components. The channel importance assessment is the final output of this step; it is a comprehensive assessment data set comprising two parts: 1) Global feature representation: a condensed, typically one-dimensional vector, representing the importance or activation intensity of each feature channel from a global image perspective; 2) Local feature representation: a typically two-dimensional or three-dimensional data set (such as a weight matrix) related to the spatial size of the input feature map, representing the relative importance or contribution distribution of each feature channel at different spatial locations. In practice, this step can be implemented using a dual-processing module. For generating global feature representations, the execution agent performs a global average pooling operation on the input feature map. This involves calculating the arithmetic mean of the feature values at all spatial locations (H×W) for each channel, thus compressing each channel into a single scalar value, resulting in a global feature vector. This vector can then be further transformed through a small fully connected network to enhance its representational power. For generating local feature representations, the execution agent performs a 1×1 convolution operation on the input feature map. This operation linearly combines all channels at each spatial location, outputting a new feature map (local feature response map) with the same spatial size as the input feature map. Typically, to obtain the spatial weight distribution, a Softmax function is applied along the channel dimension to the response map, generating a local channel weight matrix, where the value at each spatial location represents the relative importance of that channel at that location. The global feature vector and the local channel weight matrix together constitute the "channel importance evaluation". For example, for a feature map with dimensions [64,64,32], after this step, the global feature representation may be a vector with shape
[32] , while the local feature representation may be a local channel weight matrix with dimensions [64,64,32].
[0030] Step two involves channel decision processing based on the aforementioned channel importance assessment to obtain the channel selection results. This channel decision processing refers to using the channel importance assessment obtained in Step one (especially the global feature representation) to generate a discrete "retain" or "prune" decision for each channel through a learnable and differentiable decision mechanism. The channel selection result is the output of this step; it is a deterministic binary mask (e.g., a vector of 0s and 1s) of equal length to the number of channels, where "1" represents a channel deemed critical and retained, and "0" represents a channel deemed redundant and pruned.
[0031] Step 3: Based on the channel filtering results described above, generate a key feature channel set. This key feature channel set refers to a new feature representation consisting of a subset of channels physically selected from all channels of the original feature map based on the channel filtering results. The number of channels in this set is dynamic, entirely determined by the content of the input image, and directly affects the size of the subsequent color palette. In practice, the execution entity performs a mask-based filtering operation. Specifically, the channel filtering results (binary mask) obtained in Step 2 are expanded in the channel dimension to align with the original feature map in the channel dimension (e.g., expanded from [C] to [1,1,C]). Then, the expanded mask is multiplied (dot product) channel-by-channel with the original feature map. For channels with a value of 0 in the mask, their feature maps are completely suppressed (all spatial locations are set to zero); for channels with a value of 1, their feature maps are fully preserved. All preserved, non-zero channel data together constitute a new feature tensor, namely the aforementioned key feature channel set. For example, suppose the original feature map has 32 channels, and the channel filtering result indicates that channels 1, 3, 10, 15, and 28 should be retained. Then, after the above channel-by-channel multiplication and filtering operation, the resulting new feature tensor contains only the effective information of these 5 channels, and its dimensions become [64, 64, 5]. This set of 5 channels is the "key feature channel set", and its number "5" is an adaptive result.
[0032] In some optional implementations of certain embodiments, the aforementioned execution entity can perform channel decision processing based on the aforementioned channel importance assessment through the following steps to obtain channel selection results: Step one involves performing a nonlinear feature transformation on the global feature representation used in the channel importance assessment to obtain an intermediate global feature representation. This nonlinear feature transformation refers to the operation of transforming the dimensions and enhancing the features of the input global feature vector using one or more fully connected layers (or linear layers) combined with a nonlinear activation function. The aforementioned intermediate global feature representation is the output of this step. It is a feature vector that has undergone dimensionality increase or transformation, possessing stronger representational capabilities and providing richer input for subsequent two-branch decisions. In practice, the aforementioned execution entity can construct a small multilayer perceptron (MLP) to implement this processing. This MLP can contain a fully connected layer followed by a ReLU (Rectified Linear Unit) activation function. The execution entity inputs the global feature representation obtained in step one of step 103 (e.g., a vector of shape [C], where C is the number of channels) into the MLP. The fully connected layer maps the input vector to a higher-dimensional space (e.g., to a dimension of [2C] or another intermediate dimension), and then introduces nonlinearity through the ReLU function, finally outputting the aforementioned intermediate global feature representation. For example, assuming the number of channels C=32, the global feature representation is a 32-dimensional vector. After passing through a fully connected layer that maps the 32-dimensional input to a 64-dimensional dimension, and then through ReLU activation, a 64-dimensional intermediate global feature representation vector is obtained.
[0033] Step two involves performing a dual-logic-branch mapping process on the aforementioned intermediate global feature representation to obtain channel retention and pruning logistic values. This dual-logic-branch mapping process uses a fully connected layer to simultaneously map the intermediate global feature representation to two different logistic spaces, corresponding to the initial unnormalized scores of the two mutually exclusive decisions: "channel retention" and "channel pruning." The channel retention and pruning logistic values are the outputs of this step; they are two vectors of identical shape, each element representing the original propensity score (logits) for the corresponding channel to be retained or pruned. In practice, this process can be implemented using a fully connected layer with an output dimension of 2C. This layer takes the intermediate global feature representation as input and outputs a 2C-dimensional vector. The execution entity then evenly splits this output vector along the channel dimension into two parts: the first C elements serve as the channel retention logistic value, and the last C elements serve as the channel pruning logistic value. These two logistic value vectors form the direct basis for subsequent probability calculations. For example, continuing from the previous example, inputting the 64-dimensional intermediate global feature representation into a fully connected layer with an output dimension of 64 (2*32) yields a 64-dimensional vector. This vector is then split into two 32-dimensional vectors: the former represents the channel-preserved logical values, and the latter represents the channel-pruned logical values.
[0034] Step 3 involves performing spatial attention normalization on the local feature representations in the channel importance assessment to obtain local channel attention weights. This spatial attention normalization refers to normalizing the local feature representations (i.e., the local feature response map) in the spatial dimension, ensuring that the sum of the weights of all channels at each spatial location is 1, thus transforming it into a spatial attention map. The local channel attention weights are the output of this step; they are a three-dimensional tensor where the value at each position (h, w, c) represents the relative importance of the c-th channel at spatial position (h, w). In practice, the executing entity can achieve this by applying the Softmax function along the channel dimension. Specifically, for the local feature representations obtained in Step 1 of Step 103 (a tensor with dimensions [H, W, C]), the executing entity calculates Softmax along the last dimension (i.e., the channel dimension C). This means that for each pixel (h, w) in space, the Softmax calculation is performed on the feature values of its corresponding C channels, resulting in a probability distribution whose sum is 1. This resulting tensor is the local channel attention weight. For example, for a local feature representation of dimension [64, 64, 32], applying Softmax to the channel dimension (the second dimension) yields a local channel attention weight tensor of the same dimension. At position (10, 10), the sum of the 32 weight values is 1, where the channel corresponding to the larger weight value is considered more important at that position.
[0035] Step four involves applying a decision-driven random perturbation to the channel-preserved and pruned logic values to obtain the perturbed logic values. This decision-driven random perturbation refers to adding random noise following a specific distribution to the deterministic logic values during the training phase. This aims to introduce exploratory elements into the subsequent discrete sampling process and make the entire decision-making process differentiable. This is a crucial step in implementing the Gumbel-Softmax technique. The perturbed logic value is the output of this step; it is the result of adding the original logic value to the random noise. In practice, the executing agent can implement this processing using a noise generation function. Typically, independent and identically distributed Gumbel noise samples with the same shape as the channel-preserved and pruned logic values are generated. Gumbel noise can be obtained by sampling from a uniform distribution U(0,1) and then transforming it G = -log(-log(U)). Subsequently, the executing agent adds the generated Gumbel noise to the original preserved and pruned logic values respectively to obtain the perturbed preserved and pruned logic values. For example, for a retained logic value vector of shape
[32] , a Gumbel noise vector of the same shape is generated, and the two are added element by element to obtain the perturbed retained logic value. The same operation is performed on the pruned logic value.
[0036] Step 5 involves softening the probability distribution of the perturbed logic values to obtain a soft decision probability distribution. This softening process transforms the two perturbed logic values into a continuous, differentiable probability distribution using a temperature-controlled Softmax function. This soft decision probability distribution is the output of this step; it's a vector where each element represents a continuous probability value (between 0 and 1) for the corresponding channel to be retained, rather than a discrete 0 or 1. In practice, the execution entity concatenates the perturbed retained logic values and the perturbed pruned logic values along the channel dimension to form a [2, C] tensor (or processes it as two [C] vectors). Then, the Softmax function is applied to this tensor along the first dimension (the retention / pruning dimension). This Softmax function has a temperature coefficient τ (tau, e.g., τ=0.1). The calculation is: softmax(logits / τ). The temperature coefficient τ controls the sharpness of the output distribution: the smaller τ is, the closer the distribution is to one-hot (discrete); the larger τ is, the smoother the distribution. The output of this step is the "retention probability" for each channel, i.e., the soft decision probability distribution. For example, for two perturbed 32-dimensional logistic values, calculating softmax([perturbed_keep_logits, perturbed_drop_logits] / 0.1, dim=0) yields a 32-dimensional soft decision probability distribution vector, where the first component (the retention component) is a single, undifferentiated component.
[0037] Step six involves performing decision binarization on the aforementioned soft decision probability distribution to obtain a hard decision mask. This decision binarization process involves converting continuous soft decision probability values into discrete binary values (0 or 1) based on a threshold (usually 0.5), resulting in a definite, non-differentiable decision outcome. The hard decision mask is the output of this step; it is a vector of 0s and 1s that directly indicates the "preserve" (1) or "prune" (0) state of each channel in this forward propagation. In practice, the executing entity applies a condition to each probability value in the soft decision probability distribution: if the probability value is greater than 0.5, the corresponding position is output as 1; otherwise, 0 is output. This operation is typically performed using the argmax function on the preserve / prune dimension, or by directly comparing thresholds. This operation is mathematically non-differentiable. For example, a soft decision probability distribution of [0.8, 0.2, 0.9, …], after binarization (threshold 0.5), yields a hard decision mask of [1, 0, 1, …].
[0038] Step 7: Perform gradient linking on the hard decision mask and the soft decision probability distribution to obtain the final decision probability. This gradient linking is a technique used in deep learning training (often called the "pass-through estimator" or "detach" technique). Its purpose is to bypass the non-differentiable hard decision operation during backpropagation, allowing the gradient to be transmitted through the differentiable soft decision probability distribution, thus achieving efficient updates to the decision network parameters. The final decision probability is the output of this step; it is numerically equal to the hard decision mask, but retains the gradient path from the soft decision probability distribution in the computational graph. In practice, this is achieved through the following operations: First, the hard decision mask is detached from the current computational graph using the `.detach()` method or a similar operation (i.e., its gradient backtracking path is broken). Then, an operation is performed: Final decision probability = Hard decision mask - Soft decision probability distribution.detach() + Soft decision probability distribution. The first two terms of this formula, `hard decision mask - soft decision probability distribution.detach()`, are constants (without gradients). Adding the soft decision probability distribution ensures that the final decision probability takes the exact same value as the hard decision mask during forward propagation, but during backward propagation, the gradient only propagates through the soft decision probability distribution. For example, in the PyTorch framework, this operation can be written as: `y_hard - y_soft.detach() + y_soft`, where `y_hard` is the hard decision mask and `y_soft` is the soft decision probability distribution.
[0039] Step eight involves performing a weight fusion process on the aforementioned final decision probability and the aforementioned local channel attention weights to obtain a weighted decision weight. This weight fusion process combines the channel-level final decision probability with the spatial dimension's local channel attention weights to generate a comprehensive weight that considers both the global importance and spatial local importance of the channel. The weighted decision weight is the output of this step; it is a three-dimensional tensor where the value at each position is determined by the decision probability of the corresponding channel and the attention weight at that position. In practice, the executing entity first expands the one-dimensional final decision probability vector spatially to [1, 1, C] so that it can be multiplied element-wise with the local channel attention weight tensor of dimension [H, W, C] (broadcasting mechanism). Then, the expanded final decision probability is multiplied element-wise with the local channel attention weights. This operation ensures that at any point in space, the weight of a channel depends not only on its local importance at that point but also on whether the channel as a whole is decided as a critical channel. For example, the final decision probability is a 32-dimensional vector, expanded to [1, 1, 32]. The local channel attention weights are [64, 64, 32]. Multiplying them element-wise yields a weighted decision weight tensor of dimension [64, 64, 32]. If the final decision probability of a channel is 0 (i.e., it is pruned), then its weighted weights at all spatial locations will be 0.
[0040] Step nine involves performing channel importance aggregation on the weighted decision weights to obtain a channel-level importance score. This aggregation process involves reducing the weighted decision weights along spatial dimensions (height and width), aggregating the spatial weight information of each channel into a single scalar score representing the final overall importance of that channel. The channel-level importance score is the output of this step; it is a one-dimensional vector with a length equal to the number of channels C, where each element is the aggregated importance score for the corresponding channel. In practice, the execution entity typically calculates a global average of the weighted decision weight tensor along the height (H) and width (W) dimensions. That is, for each channel c, the average of the weighted weights at all H×W spatial locations is calculated. This average is the channel-level importance score for that channel. Average pooling is a simple and effective aggregation method. For example, the mean of the weighted decision weight tensor with dimensions [64, 64, 32] is calculated on dimensions 0 and 1 (H and W) to obtain a 32-dimensional vector, which is the channel-level importance score.
[0041] Step 10: Perform importance filtering on the channel-level importance scores to obtain the channel filtering results. This importance filtering is the final step in the channel decision-making process, aiming to determine which channels are ultimately retained based on the aggregated channel-level importance scores. This typically involves sorting and threshold selection. The channel filtering result is the final output of this step and the entire channel decision-making process. It is a binary mask, consistent with the hard decision mask in Step 6 in terms of training purpose, but can be directly generated from this step during inference to ensure determinism. In practice, the executing entity can employ various filtering strategies. A common strategy is the dynamic threshold method: for example, sorting all channels' channel-level importance scores in descending order and selecting the top K channels, where K can be a dynamically determined number based on the score distribution (e.g., the number of channels whose total score exceeds a certain threshold). Another simpler strategy is the fixed threshold method: setting an absolute threshold (e.g., 0.01), channels with scores higher than this threshold are retained. During the inference phase, the executing entity uses this filtering strategy to directly obtain the final channel filtering result (binary mask). During the training phase, this result may be consistent with or serve as the target of the hard decision mask in step six. For example, for a 32-dimensional channel-level importance score, a threshold of 0.05 is set. All channels with scores greater than 0.05 are set to 1, and the rest to 0, resulting in the final channel selection vector, such as [1, 0, 1, 1, 0, ..., 1]. This result will be directly used in step three of step 103 to generate the key feature channel set.
[0042] Step 104: Generate a color palette for Tibetan carpet weaving threads based on the set of key feature channels.
[0043] In some embodiments, the executing entity can generate a Tibetan carpet weaving color palette based on the aforementioned key feature channel set. The number of colors in the Tibetan carpet weaving color palette corresponds to the number of key feature channels in the aforementioned key feature channel set.
[0044] In some optional implementations of certain embodiments, the aforementioned execution entity can generate a Tibetan carpet weaving color palette based on the aforementioned key feature channel set through the following steps: Step one involves color-weighting the aforementioned key feature channel set to obtain a weighted color set. This color-weighting process involves using the feature map of each channel in the key feature channel set as spatial weights to calculate a weighted average of the corresponding pixel colors in the original input image. The weighted color set is the output of this step; it is a list of colors, where each color corresponds to a key feature channel and is the weighting center or representative color of the visual features represented by that channel in the original image's color space. In practice, the execution entity can iterate through each channel in the key feature channel set. For the i-th channel, the execution entity obtains its corresponding two-dimensional feature map (or weight map) and normalizes it spatially using the Softmax function to ensure that the sum of all weights is 1, obtaining the normalized spatial weight matrix for that channel. Subsequently, the execution entity multiplies the RGB color value of each pixel in the original Tibetan carpet pattern image with the corresponding weight value in the normalized spatial weight matrix for that channel, and sums the weighted results for all pixels to calculate a weighted average color. This color represents the contribution of the image features (such as a specific texture or color pattern) captured by that channel to the overall color. This process is repeated for all C' channels in the set (C' being the number of key feature channels), resulting in C' weighted average colors, which together constitute the aforementioned weighted color set. For example, suppose the key feature channel set contains 5 channels. For the first channel, its normalized weight map size is [64, 64], and the original image size is [256, 256, 3]. The execution entity upsamples the weight map or aligns it with the original image through a mapping relationship, then calculates the sum of the products of the RGB values of each pixel in the original image and their corresponding weight values, ultimately obtaining an RGB triplet, such as [0.8, 0.2, 0.1]. Performing this operation on all 5 channels yields a weighted color set containing 5 RGB colors.
[0045] Step two involves normalizing the weighted color set to obtain a candidate color set. This normalization specifically refers to adjusting the numerical range of each color in the weighted color set obtained in Step one to conform to standard color representation specifications or the input requirements of subsequent processing modules. The candidate color set is the output of this step; it is a list of numerically normalized colors and serves as the direct basis for generating the final color palette. In practice, the execution entity processes the data according to the color space specification adopted by the entire quantization system. For example, if the system internally uses floating-point numbers in the range [0, 1] to represent RGB colors, and the weighted average color calculated in Step one may exceed this range due to the original image data format (e.g., integers 0-255) and the calculation process, normalization is required. Typically, this can be achieved through linear scaling. Another common normalization method is to ensure that the norm or luminance component of the color vector (RGB values) conforms to a specific distribution to improve the stability of subsequent processing. The execution entity performs corresponding numerical transformations on each color vector in the weighted color set, outputting a normalized candidate color set. For example, suppose a color in the weighted color set obtained in step one is [185, 40, 30] (range 0-255). The execution entity divides each of its components by 255.0 to obtain the normalized color [0.725, 0.157, 0.118]. This operation is performed on all colors to obtain the candidate color set.
[0046] Step 3: Based on the aforementioned candidate color set, generate a Tibetan carpet weaving color palette. This generation of the Tibetan carpet weaving color palette refers to the process of directly determining the candidate color set as the final color palette used to guide production. This Tibetan carpet weaving color palette is the final output of this step and the entire step 104; it is an ordered set containing a specific number of colors. Its core feature is that the number of colors in this palette is exactly equal to the number of channels (C') in the key feature channel set input to this step, thus achieving dynamic adaptation of the palette size. In practice, the executing entity directly uses the candidate color set obtained in Step 2 as the final color palette output. Each candidate color corresponds to one color in the palette. The executing entity can organize the order of colors in the palette according to the channel order, or it can reorder them according to certain color attributes (such as brightness and hue) for easier use. This palette will be directly used in the subsequent step 105 (color mapping) to generate a production guidance image. During the training phase, this palette will also participate in "soft reconstruction" calculations to optimize network parameters. For example, suppose the candidate color set contains five normalized RGB colors: [[0.8, 0.2, 0.1], [0.1, 0.7, 0.3], [0.9, 0.9, 0.2], [0.4, 0.5, 0.6], [0.2, 0.1, 0.8]]. The execution entity defines this set as the final Tibetan carpet weaving color palette. This palette explicitly contains five colors, which are derived from five key feature channels adaptively selected. This palette is then fed into the next step to quantize the original Tibetan carpet pattern, which has millions of colors, into an image composed only of these five colors while striving for visual fidelity, thus significantly simplifying the subsequent physical weaving color matching.
[0047] Step 105: Based on the Tibetan carpet weaving color palette, perform color mapping on the original image of the Tibetan carpet pattern to obtain a Tibetan carpet production guidance image.
[0048] In some embodiments, the aforementioned executing entity may perform color mapping on the original image of the Tibetan carpet pattern based on the aforementioned Tibetan carpet weaving color palette to obtain a Tibetan carpet production guidance image.
[0049] In some optional implementations of certain embodiments, the aforementioned executing entity may perform color mapping on the original image of the Tibetan carpet pattern based on the aforementioned Tibetan carpet weaving color palette to obtain a Tibetan carpet production guidance image through the following steps: Step one involves performing distance calculations on the original image of the Tibetan carpet pattern and the aforementioned Tibetan carpet weaving color palette to obtain a distance matrix. This distance calculation process involves determining the difference between the color of each pixel in the original image and each color in the palette. The distance matrix is the output of this step; it is a three-dimensional data set (or a two-dimensional unfolded form) with dimensions [H, W, K], where H and W are the height and width of the image, and K is the number of colors in the palette. The value at position (h, w, k) in the matrix represents the "distance" between the color at pixel (h, w) in the original image and the k-th color in the palette. This distance is typically calculated using Euclidean distance to measure color similarity. In practice, the execution entity iterates through every pixel of the original image. For each pixel's RGB color vector (e.g., [R_p, G_p, B_p]), the execution entity calculates its Euclidean distance to all K colors in the palette (each color is also an RGB vector, e.g., [R_k, G_k, B_k]). The calculation formula is: Distance = sqrt((R_p - R_k)^2 + (G_p - G_k)^2 + (B_p - B_k)^2). The calculated K distance values are then sequentially filled into the K positions corresponding to the pixel, thus constructing an H×W×K distance matrix for the entire image. This matrix quantifies the degree of matching between each pixel and all candidate production color lines. For example, for a 256x256 original image and a palette containing 5 colors, this processing will result in a distance matrix with dimensions [256, 256, 5]. The five values at position (100, 100) in the matrix represent the differences between the color of the pixel at position (100, 100) in the original image and the five colors in the palette.
[0050] Step two involves color assignment processing of the distance matrix to obtain a color index map. This color assignment process involves assigning a suitable palette color index to each pixel of the original image based on the distance matrix. Different strategies are employed during model training and model inference (application) to achieve different goals. The color index map is the output of this step; it is a two-dimensional matrix (H×W) where each position stores an integer index value (ranging from 0 to K-1), indicating which color in the palette the pixel should be replaced with in the final quantized image. In practice, the execution entity distinguishes between two modes: First, during the training phase (soft assignment): To maintain the differentiability of the entire network for end-to-end training, the execution entity performs a differentiable "soft" assignment of the distance matrix. Specifically, the execution entity first negatives the distance matrix (because smaller distances represent greater similarity), and then processes it through a Softmax function (usually combined with a temperature parameter τ) to transform the distance into a probability distribution of each pixel's association with K colors. This probability distribution is continuous and differentiable. Although integer indices are not directly generated, gradient propagation is supported through subsequent weighted calculations (soft reconstruction). In this mode, the "color index mapping" can be understood as this soft probability distribution, or, for conceptual coherence, as an intermediate reference using hard indices obtained from this distribution via argmax, but the gradient is not broken from this. Secondly, in the inference or application phase (hard assignment): In a production environment, deterministic, discrete assignment results are required. For each pixel, the execution entity finds the index corresponding to the minimum value among the K distance values in the distance matrix. That is, each pixel is assigned to the palette color with the smallest Euclidean distance. This operation is implemented through the argmin function, directly generating a deterministic color index mapping composed of integer indices. For example, in the inference phase, for pixel (100, 100), its distances to the 5 colors are [15.2, 8.7, 120.5, 45.3, 10.1]. The minimum value is 8.7, corresponding to index 1 (counting from 0). Therefore, the integer 1 will be stored at position (100, 100) in the color index map.
[0051] Step three involves performing pixel replacement processing on the aforementioned color index mapping to obtain the Tibetan carpet production guidance image. This pixel replacement processing refers to replacing the original RGB color of each pixel in the original image with its assigned palette color based on the color index mapping. This Tibetan carpet production guidance image is the final image output of this step and the entire color quantization process. It is an indexed image or pseudo-color image that visually approximates the original image but contains only the K colors from the palette in its color space. It can be directly used to guide the selection of color threads and region positioning in Tibetan carpet weaving. In practice, the executing entity performs a lookup and replacement operation based on the color index mapping (two-dimensional integer matrix) obtained in step two and the Tibetan carpet weaving color thread palette (a list of K RGB colors). The executing entity creates an empty output image with the same dimensions (H×W) as the original image. Then, iterate through each pixel position (h, w) of the output image, read the corresponding index value idx in the color index map, and then retrieve the corresponding RGB color [R_idx, G_idx, B_idx] from the color palette based on the index value idx, and fill the (h, w) position of the output image with this color. After the traversal is completed, the final Tibetan carpet production guidance image is obtained. During the training phase, if soft assignment is used, the "replacement" is achieved by weighted summation of the palette colors and the soft probability distribution (soft reconstruction) to produce a continuous, differentiable "soft" image for loss calculation. For example, during the inference phase, the color index map indicates that pixel (100, 100) should use the color with index 1 in the color palette. Assume that the color with index 1 in the color palette is [0.1, 0.7, 0.3] (normalized RGB). The execution entity sets the pixel value at position (100, 100) of the output image to [0.1, 0.7, 0.3]. After performing this operation on all pixels, the resulting image is the Tibetan carpet production guide image. The color of each pixel is strictly derived from the color palette, achieving color simplification and standardization, which facilitates subsequent analysis and execution by the production system.
[0052] Step 106: Produce the actual Tibetan carpet according to the Tibetan carpet production guide images.
[0053] In some embodiments, the aforementioned implementing entity may produce actual Tibetan carpets based on the aforementioned Tibetan carpet production guidance images.
[0054] In some optional implementations of certain embodiments, the aforementioned executing entity may produce a physical Tibetan carpet based on the aforementioned Tibetan carpet production guidance image through the following steps: The first step involves performing color-partition-based region segmentation on the aforementioned Tibetan carpet production guidance image to obtain individual weaving regions. This color-partition-based region segmentation refers to dividing the image into several continuous and uniformly colored connected regions based on the color index or RGB values of the pixels in the production guidance image. Each region consists of pixels with the same or highly similar colors, corresponding to an independent color block or weaving unit in Tibetan carpet weaving. The output of this step is the independent weaving region, which is a set of polygonal contours or region masks. Each contour or mask defines the boundary of the region that needs to be filled with the same color thread during weaving. In practice, this process can be implemented using connected component analysis algorithms or watershed algorithms from image processing. The execution unit first converts the production guidance image into a color index map (if it is already in index format) or a palette-based pseudo-color map. Then, by scanning pixels, pixels with the same color value and spatial adjacency are aggregated into the same region. For cases where noise or color gradient transitions may exist, morphological operations (such as erosion and dilation) can be combined for region smoothing and merging. Finally, a unique identifier and its boundary point sequence or region mask are generated for each connected region, forming a set of independent woven regions. For example, a 256x256 pixel production guide image might be segmented into 150 independent woven regions after this processing. Each region is defined by a set of polygon vertex coordinates; for example, region #1 might be a section of a complex floral pattern enclosed by 50 vertices.
[0055] The second step involves analyzing the primary and boundary colors of each independent weaving region to obtain the color formula for each region. This primary and boundary color analysis process involves analyzing the primary color within each independent weaving region and the color composition at its boundaries with adjacent regions to create a detailed color scheme guiding the weaving of that region. The resulting region color formula is the output of this step; it is structured data containing at least two parts: 1) Primary color: the most representative color or the color with the largest area used within the region (usually the color of that region in the guidance image); 2) Boundary color: a list and location information of colors that may mix with adjacent regions or require special processing at the region's edge, used to handle edge transitions during weaving or prevent color bleeding. In practice, the execution entity traverses each independent weaving region. For each region, the execution entity first calculates the color histogram of all pixels within the region and determines the most frequently occurring color as the primary color of that region. Subsequently, the execution entity extracts the boundary pixels of the region (i.e., pixels adjacent to different color regions) and records the colors of these boundary pixels and their adjacent regions, forming boundary color information. This information may include the boundary line color, the colors of adjacent areas, and the direction of the boundary line (used to guide the direction of stitching during weaving). For example, for area #1, most of its internal pixels correspond to color index 2 (dark red) in the color palette, so its main color is determined to be "dark red". Among its boundary pixels, some are adjacent to area #2 (blue) and some are adjacent to area #3 (yellow), so the boundary color information is recorded as follows: the boundary line adjacent to the blue area uses dark red, but the boundary with the blue area may need to be woven tightly; the boundary line adjacent to the yellow area also uses dark red, but it is recommended to add a yellow outline to highlight the pattern.
[0056] The third step involves physical matching and calibration of the color formulas for each region with the aforementioned Tibetan carpet weaving color thread palette, resulting in a calibrated set of physical color threads. This physical matching and calibration process involves matching the colors in the digitized regional color formulas with a library of available physical color threads, and fine-tuning and confirming the results based on the physical properties of the actual color threads, such as material, gloss, and colorfastness. The calibrated set of physical color threads is the output of this step; it is a collection of actual physical color thread samples or their unique identifiers (such as color codes or batch numbers), ensuring that digital colors are accurately mapped to specific production materials. In practice, the executing entity can access a database containing information on all available physical color threads. This database stores the standard RGB reference values, color codes, materials, and suppliers for each color thread. The executing entity calculates the similarity in color space (such as ΔE distance in the CIELAB color space) between the RGB values of the main and boundary colors in each regional color formula and the reference values in the database, selecting the physical color thread with the smallest ΔE distance as the matching result. Considering screen color differences and the perceived appearance of physical objects, a manual verification process or a colorimeter can be used to measure and calibrate physical color line samples. This ultimately determines a unique physical color line identifier for each digital color, forming a calibrated set of physical color lines. For example, the RGB value of the primary digital color "deep red" is (200, 0, 50). The closest physical color line in the database is "Brand A's color code #CR-202, cashmere yarn." After colorimeter measurement, the ΔE between this physical color line and the digital value is 1.2 (within an acceptable range), so it is determined as the physical match for this color. Ultimately, the calibrated set of physical color lines may contain specific color line information such as "Brand A #CR-202, Brand B #BL-405, ...".
[0057] The fourth step involves generating weaving execution instructions based on the color formulas for each region and the calibrated set of physical color threads. These instructions are a set of low-level control commands that drive automated weaving equipment (such as a CNC Tibetan carpet weaving machine). They precisely describe the weaving sequence, the timing of changing each color thread, the movement path of the weaving head, and the weaving density (number of knots) for each row. These instructions serve as a bridge between digital design and physical action. In practice, the execution entity can be a computer-aided manufacturing (CAM) software module. This module receives the contour data of individual weaving regions, the region color formulas, and the set of physical color threads. First, it performs process planning: determining the weaving sequence (e.g., weaving row by row from the bottom, or weaving by region color grouping to reduce the number of thread changes). Then, it performs path planning: converting the contour of each region into the specific movement trajectory of the weaving head and calculating the knot (knot) positions to be woven in each row. Next, control codes are generated: Based on the planning results, G-code or proprietary control language recognizable by the specific weaving equipment is generated. The instructions precisely include information such as when to load which color yarn (based on the identifier in the physical color yarn set), where the weaving head is moved, and what weaving action to perform (such as knotting or passing the weft yarn). For example, the generated weaving execution instructions might be a text file with the following content fragment: "LOAD YARN spool_CR-202; MOVETO X100 Y200; START ROW; KNOT TYPE=1COUNT=150; ...
[0058] The fifth step involves performing row-by-row weaving on the weaving equipment based on the aforementioned weaving execution instructions, resulting in a preliminary woven product. This row-by-row weaving process refers to the automated weaving equipment receiving and parsing the weaving execution instructions, controlling the mechanical mechanism to perform actions such as color thread changing, thread introduction, knotting, and compaction according to the instruction sequence, gradually forming a physical fabric corresponding to the design pattern on the base fabric. The preliminary woven product is the output of this step; it is a semi-finished Tibetan carpet that has just completed its main weaving but has not yet undergone post-processing (such as shearing or washing). In practice, the execution entity is the control system of the automated weaving equipment. This system reads the weaving execution instructions and decodes them into real-time control signals for various actuators (such as servo motors, pneumatic valves, and color selectors). The specific process includes: 1) Color thread preparation and loading: According to the instructions, the specified physical color thread roll is selected from the yarn rack and guided to the weaving head. 2) Weaving head positioning and movement: The weaving head is controlled to move precisely to the coordinates specified by the instructions in a two-dimensional plane. 3) Node Formation: At designated locations, specific knotting actions are performed using hooks, knotters, or other mechanisms to fix the colored yarn onto the base fabric. 4) Row Transition and Compaction: After completing one row, the machine moves to the starting point of the next row and uses tools such as reeds to compact the woven weft threads. This process is repeated until all instructions are executed, ultimately forming a basic woven product. For example, after receiving the above instructions, a CNC Tibetan carpet weaving machine automatically selects "Brand A #CR-202" colored yarn from the yarn rack, guides it to the weaving head, and then moves to coordinates (100, 200) to begin weaving the first row. After weaving 150 nodes, the machine changes yarn or moves to the next row according to instructions until the entire pattern is woven, resulting in a basic woven product corresponding to the design drawing, composed of nodes made of different colored yarns.
[0059] The sixth step involves performing color and texture comparison and verification processing on the aforementioned primary woven fabric and the aforementioned Tibetan carpet production guidance image to obtain the comparison and verification results. This color and texture comparison and verification processing refers to acquiring a surface image of the primary woven fabric using an image acquisition device and registering it with the digital original—the Tibetan carpet production guidance image—and performing difference analysis. The comparison and verification results are the output of this step; they are a quantitative quality report identifying areas in the primary woven fabric that deviate from the design in terms of color, pattern shape, or texture density, and the degree of deviation. In practice, this can be performed by a machine vision inspection system. This system first uses a high-resolution industrial camera to take multi-angle photos of the primary woven fabric under standard lighting conditions and then stitches or corrects the images to obtain a complete top-view planar image. Then, using methods such as feature point matching, the captured images are registered pixel-level with the Tibetan carpet production guidance image. Subsequently, based on the registration, color values are compared by region (possibly comparing ΔE in a specific color space such as LAB), and the clarity of pattern edges and the uniformity of texture are analyzed. The system calculates the deviation score for each region and marks regions that exceed the preset tolerance threshold, generating a comparison and verification result report that includes the location, type, and degree of deviation. For example, the comparison and verification result may indicate that: in region #15 (corresponding to a green leaf in the design drawing), the average ΔE of the actual color is 5.2 (exceeding the threshold of 3.0), which is judged as "color difference exceeding the limit"; at the edge of region #78, a pattern outline of 3 consecutive pixels is found to be blurred, which is judged as "texture boundary blur".
[0060] Step 7: Based on the comparison and verification results above, corrective processing is performed on local areas with color differences or texture deviations by replacing or repairing the colored threads, resulting in the final Tibetan carpet. The aforementioned color thread replacement or repair refers to the process of repairing the defective areas identified in the comparison and verification results using specific physical means. This may include: removing the incorrectly colored yarn knots and re-weaving (color thread replacement), or adding extra yarn knots in sparse or missing areas (repair). The final Tibetan carpet is the output of this step and the entire production process; it is a finished Tibetan carpet that meets the design requirements after quality verification and correction. In practice, the above-mentioned entities can use manual or automated correction methods depending on the type and severity of the deviation. For small-scale color differences or defects, skilled craftsmen can perform manual corrections based on the verification report: using special tools to cut and remove the incorrect knots, and then manually re-knotting them with the correct colored thread. For automated equipment capable of fine-tuning modifications, local correction instructions can be automatically generated. Based on the location of the deviation area and the color to be replaced, the system plans a minimal reweaving path, controlling the weaving head to perform unraveling and reweaving operations only within that specific area. After correction, a local image verification can be performed again to ensure the problem is resolved. Finally, the corrected Tibetan carpet undergoes post-processing steps such as washing, shearing, and finishing to obtain a qualified final Tibetan carpet. For example, regarding the color difference issue in area #15, the system generates a micro-weaving instruction specific to that area. The automated weaving head locates the area, first removing the incorrectly colored yarn nodes, and then reweaving the area using calibrated, correct green yarn. After correction, the local image ΔE for that area is reduced to within 1.5, meeting the standard. Thus, a final Tibetan carpet, from digital design to physical finished product and subject to closed-loop quality control, is completed.
[0061] The steps one through seven described above constitute a technical solution of this disclosure, solving the technical problem of "the difficulty in balancing color distortion and production efficiency during the digitalization and automation of Tibetan carpet production." The reasons why existing technologies struggle to achieve high-fidelity and high-efficiency production are as follows: traditional color quantification methods use fixed-size color palettes, which cannot adaptively simplify colors according to the complexity of the pattern, leading to redundant resources in simple patterns or loss of details in complex patterns; the conversion from digital design to physical production heavily relies on artisans' experience and manual drawing, resulting in low efficiency and poor consistency; the production process lacks closed-loop calibration for precise matching of physical color lines and digital colors, easily leading to "what you see is not what you get" color differences; after weaving, only manual sampling inspection is possible, failing to achieve comprehensive and objective quality assessment, and lacking precise defect location and automated repair capabilities. If these factors can be eliminated, a complete intelligent manufacturing system can be constructed, encompassing intelligent color adaptation, automatic design and process analysis, precise material matching, and closed-loop quality control. To this end, this disclosure addresses the following: First, by using color-based region segmentation, the production guidance image is automatically deconstructed into independent weaving areas, achieving for the first time a structured and automated conversion of complex patterns into executable weaving units, replacing inefficient and error-prone manual interpretation and tracing. Second, by analyzing the main color and boundary color of each independent area, a region color formula rich in process knowledge is generated, elevating planar color information into three-dimensional process instructions containing boundary transition strategies, solving the core difficulties of boundary color mixing and abrupt transitions in automated weaving. Third, by matching and calibrating the region color formula with the physical color thread library based on color difference (ΔE), a high-fidelity and traceable mapping relationship is established between digital color and physical materials, eliminating systematic color differences caused by screen display or material batches. Fourth, based on the region outline, color formula, and physical color thread information, weaving execution instructions for driving the equipment are automatically generated, completing the ultimate translation from "design description" to "machine language," and realizing intelligent optimization of production planning and process paths. The fifth step involves row-by-row weaving controlled by the weaving execution command equipment. The machine's high precision and consistency transform the digital blueprint into a physical entity, achieving perfect reproduction of complex patterns and a leap in production efficiency. The sixth step uses machine vision to compare and verify the color and texture of the initial woven product across the entire area, constructing an objective, quantitative, and comprehensive online quality inspection node. This enables precise location and type diagnosis of defects, replacing subjective and incomplete manual sampling. The seventh step, based on the verification results, automatically disassembles and re-weaves the defective areas, forming a closed-loop quality control system of "detection-location-repair." This ensures precise correction of defects rather than overall scrapping, guaranteeing zero-defect delivery of the final product. Thus, by organically combining five key technological elements—intelligent adaptive quantification, automatic analysis of design processes, precise digital-physical mapping, automated execution, and closed-loop quality control—a complete intelligent manufacturing technology system for Tibetan carpets has been constructed.Furthermore, the design structure analysis based on region segmentation, the process formula generation combined with boundary color processing, and the online verification and automatic repair based on machine vision provide a deep process integration solution for the digital production of traditional handicrafts that goes beyond simple "image printing" logic. This constructs a complete production chain from "intelligent design" to "precise execution" and then to "quality closed loop," realizing the transformation of Tibetan carpet production from "human experience-driven" to "data and algorithm-driven intelligent" production. While improving production efficiency and scale, it also ensures, to a certain extent, the high degree of reproduction of artistic details and the consistency of product quality.
[0062] After generating high-fidelity production guidance images using the aforementioned adaptive color quantization scheme, the following technical problems often arise in the high-speed, continuous production process of automated Tibetan carpet weaving lines: When the system drives the mechanical mechanism to perform high-speed, precise row-by-row weaving according to digital instructions, tension fluctuations in the colored threads during dynamic transport, timing deviations in the coordinated actions of multiple mechanisms, and idle waiting due to frequent inter-row shifts are intertwined. This leads to micro-quality defects in the woven carpet surface, such as uneven pile size, blurred pattern outlines, and misaligned textures. Simultaneously, overall production efficiency is limited by the sequential waiting of mechanical actions, making it difficult to improve efficiency. It is impossible to meet the stringent requirements of efficiency, consistency, and reliability for large-scale production while ensuring extremely high artistic fidelity. To address the following requirements for this application scenario—achieving high-precision, high-consistency, high-efficiency, and high-reliability automated weaving execution—we have decided to adopt the following solution: In some optional implementations of certain embodiments, the aforementioned execution entity may perform row-by-row weaving on a weaving device based on the aforementioned weaving execution instructions through the following steps to obtain a primary woven product: The first step involves parsing the aforementioned knitting execution instructions line by line to obtain the color thread sequence for the current knitting row. This line-by-line parsing process involves reading and decoding the data segment associated with a specific row number in the knitting execution instruction file, extracting all the control information required for that row's knitting. The color thread sequence for the current knitting row is the output of this step; it is an ordered list where each element explicitly specifies the identifier (such as color thread ID or color number) of the specific color thread to be used at each knitting position from left to right (or right to left) in the current knitting row. In practice, the execution entity (usually the CNC system of the knitting machine) reads the knitting execution instruction file from memory or storage media. Following the instruction syntax rules, the system locates the data segment describing the knitting of "row N". By parsing this data segment, key parameters are extracted, one of the core parameters being the color thread sequence. This sequence may be stored as an array, such as [Yarn_ID_1, Yarn_ID_1, Yarn_ID_3, ...], indicating that the first weaving point in the row uses the color thread with ID 1, the second point also uses the color thread with ID 1, the third point uses the color thread with ID 3, and so on. Simultaneously, the parsing process also extracts other weaving parameters for the row, such as weaving speed and node type. For example, the parsing instruction "ROW 105: YARN_SEQ [A05, A05, B12,A05, C01, ...]; SPEED 50;" yields the color thread sequence for the current 105th row as ['A05', 'A05','B12', 'A05', 'C01', …].
[0063] The second step involves selecting the appropriate yarn from the current yarn sequence in the weaving process to obtain a ready yarn set. This selection process involves controlling an automated yarn selector to accurately select and prepare the corresponding yarn from multiple physical yarn reels based on the real-time requirements of the yarn sequence. The ready yarn set is the output of this step; it's a physical description of a group of yarns (possibly one or more, depending on the sequence requirements) that has been guided by the yarn selector to a preparatory position near the weaving head and is ready for immediate use. In practice, the execution unit controls the yarn selector on the weaving equipment (such as a rotary yarn rack or a linear motor-driven yarn selector). The yarn selector has dozens to hundreds of individual yarn spools. The execution unit drives the yarn selector to rotate or move according to the ID of the first (or next) yarn to be used in the yarn sequence, bringing the corresponding yarn spool to its "working position." Then, the end of the thread of that color is drawn from the bobbin using air suction or mechanical clamping and conveyed along the threading path to the lead-in mechanism of the braiding head, putting it in a "ready" state. If the same color thread is used continuously in the sequence, the color thread remains in a ready state; if a color thread needs to be switched, the color selector will perform the next selection action. For example, if the current color thread sequence initially requires color thread 'A05', the main body drives the color selector, rotates the bobbin marked 'A05' to the thread pick-up position, the suction nozzle picks up the thread end and sends it to the lead-in clamp, at which point the 'A05' color thread becomes the currently valid color thread in the ready color thread group.
[0064] The third step involves real-time tension monitoring of the prepared yarn group to obtain real-time tension data. This real-time tension monitoring refers to the process of measuring and reading the tension value of the yarn being pulled into the weaving area using sensors. The real-time tension data is the output of this step; it is a continuous or high-frequency sampled electrical signal or digital value that accurately reflects the instantaneous tension of the yarn during its movement, typically measured in centinenewtons (cN) or grams per second (gf). In practice, the actuator uses tension sensors (such as strain gauge or piezoelectric sensors) installed along the yarn path for monitoring. As the yarn is pulled from the bobbin past the sensor, the sensor converts the yarn tension into an analog voltage signal. This signal is sampled via an analog-to-digital converter (ADC) and read in real-time by the control system software, forming a real-time tension data stream. This data is crucial feedback for subsequent tension adjustment and ensuring uniform weaving quality. For example, along the path of the 'A05' colored line, the tension sensor continuously samples, and the control system reads the tension value 100 times per second to obtain a real-time tension data sequence such as [23.4, 22.9, 24.1, …] cN.
[0065] The fourth step involves dynamic tension adjustment based on the aforementioned real-time tension data to obtain stable tension yarn. This dynamic tension adjustment refers to comparing the real-time monitored tension data with a preset target tension value and adjusting the operating state of the yarn delivery mechanism (such as the speed of the yarn feeding motor and the damping of the brake) through control actuators to stabilize the actual tension within the target range. The stable tension yarn described in this step represents the yarn whose tension fluctuations are controlled within the allowable deviation range after adjustment. In practice, the aforementioned actuator implements a closed-loop control circuit (such as PID control). The control system compares the real-time tension data with the preset target tension value (e.g., 25 cN) and calculates the error. Based on the magnitude and direction of the error, the controller outputs a control signal to adjust the speed of the yarn feeding servo motor or the current of the electromagnetic brake. If the measured tension is too high, the yarn feeding is accelerated or the braking is reduced; if the measured tension is too low, the yarn feeding is slowed or the braking is increased. Through continuous feedback and adjustment, the yarn maintains constant tension during the weaving process, ensuring uniform size of each pile (node) and a flat carpet surface. For example, the system detects that the real-time tension of the 'A05' colored thread is 24.1 cN, slightly lower than the target value of 25 cN. The PID controller calculates that the speed of the thread feeding motor needs to be slightly reduced and issues a corresponding command. After adjustment, the tension value read at the next moment stabilizes at 24.9 cN, achieving a stable tension for the colored thread.
[0066] The fifth step involves performing a color thread interlacing process based on the weaving parameters in the aforementioned weaving execution instructions and the aforementioned stable tension color threads, forming the initial weaving row. This color thread interlacing process refers to the weaving head guiding the stable tension color threads, following the basic principles of warp and weft interlacing, to systematically thread the color threads between the warp threads (or base fabric) in a "one up, one down, one" pattern. This is the foundation for forming the weft layer. The initial weaving row is the physical state output from this step, representing a row of color threads that has been systematically threaded between the warp threads but has not yet been firmly bonded to the warp threads or base fabric through knotting or other methods; it is a preliminary positioning of the weft threads. In practice, the aforementioned execution entity controls the weaving head to perform specific actions. The weaving head carries the stable tension color threads from the lead-in mechanism and moves within the weft gaps of the warp array or base fabric according to the "weave diagram" (i.e., interlacing pattern, such as plain weave or twill weave) and row width defined in the weaving parameters. It guides the color threads from one side to the other using tools such as hooks and yarn guides, completing one weft insertion. For Tibetan carpet weaving, this is typically the step of laying the pile weft (the colored thread segments that will form the pile) on the base fabric (backing weft). For example, the weaving parameters are specified as a "plain weave". The weaving head guides the 'A05' stabilizing tension colored thread, starting from the left, passing between the first and second warp threads (from the back of the fabric to the front), and then back between the second and third warp threads (from the front to the back), repeating this process until the end of the row, forming an initial weave row (pile weft) laid flat on the base fabric.
[0067] Step 6 involves performing a color thread interlacing process on the initial knitting row to obtain the current knitting row. This color thread interlacing process refers to the process of using specific mechanical actions (such as striking with a reed or introducing interlacing threads) to make the color threads more tightly interwoven with the warp system or base fabric, initially fixing their position. This step enhances the initial stability of the structure, preparing for subsequent node formation. The current knitting row is the physical state output of this step, representing a row of color threads that has completed its initial interlacing and fixing. In practice, the specific operation of the executing entity depends on the knitting process. In some CNC carpet knitting machines, this step may be performed by the weft-beating mechanism. After the color threads are inserted (weft insertion), the weft-beating mechanism (such as a reed) swings towards the weft inlet, pushing the newly introduced color thread (pile weft) towards the already knitted fabric, making it tightly interlaced with the warp threads. In other machines employing "U-shaped pile head" technology, this step may involve bending the color thread into a U-shape and clamping it with the warp threads or a special fixing thread. For example, after the 'A05' colored thread completes its interlacing to form the initial weave row, the reed swings forward rapidly, pushing the colored thread tightly towards the completed weave point, so that it is firmly interwoven with the warp threads, forming a more stable fabric structure, which is the current weave row.
[0068] The seventh step involves shaping the intersections of colored threads in the current weaving row into nodes, resulting in structurally stable nodes. This node shaping process is a core step in the weaving of handmade Tibetan carpets or imitation handmade Tibetan carpets. It involves securing the weft (colored thread) to the warp threads of the base fabric (usually a warp-weft interwoven fabric) through knotting, forming individual pile ends that can withstand subsequent wear and tear. These structurally stable nodes are the output of this step, representing specific physical structures on the woven product. Each node represents a firmly bound loop of colored thread or pile end, forming the basic unit of the Tibetan carpet's pile surface. In practice, the executing entity controls the node shaping mechanism (such as a knotting knife and hook combination) for precise operation. Taking the "figure-eight knot" as an example: at a specific intersection of the warp threads, the mechanism uses a hook to hook a section of colored weft thread to form a loop. The knotting knife carries another end of the thread or uses the weft itself to wrap around the warp thread, finally tightening and cutting to form a secure "8"-shaped knot. The entire process requires precise control of the hook length, the number of wraps, and the tightening force to ensure that each node is of consistent size and meets the required strength. Only after the node is formed does the section of yarn truly transform from "interwoven weft" into a "three-dimensional pile." For example, on the current weave row, the node forming mechanism hooks the 'A05' yarn at the first pair of warp threads, ties a figure-eight knot around the warp, and cuts it, forming the first pile node. This process is repeated, knotting at all designated positions in the row to obtain a row of evenly arranged, structurally stable nodes.
[0069] Step 8: In response to obtaining the aforementioned stable nodes, coordinate shifting of the weaving mechanism is performed. This coordinate shifting refers to the process of controlling the weaving head, weft insertion mechanism, and other actuators to move within the weaving plane after all preset nodes in a row have been formed, precisely positioning them to the starting position of the next row. This coordinate shifting ensures the continuity of the weaving action in the two-dimensional plane and the accuracy of the pattern. In practice, the actuator controls the servo motor system driving the weaving head frame or worktable. Based on the pre-programmed path or the starting coordinate data of the next row (usually also included in the weaving parameters), the control system sends pulse commands to the X-axis and Y-axis servo motors, driving the weaving head to move smoothly and quickly from its current position (e.g., the rightmost end of the Nth row) to the starting position of the next row (e.g., the leftmost end of the N+1th row). Acceleration curves may need to be considered during the displacement process to avoid vibration and ensure positioning accuracy within millimeters or even smaller. For example, after all nodes in row 105 are formed, the control system instructs the X-axis motor to move in the opposite direction and the Y-axis motor to move down one row spacing, so that the weaving head is precisely positioned at the leftmost weaving start point of row 106.
[0070] Step nine involves initializing the next knitting row in response to the completed coordinate shift. This initialization process refers to the preparatory work done after the knitting mechanism has shifted into position, in preparation for starting a new row. This includes resetting certain mechanism states, reading the instruction data for the new row, and preparing the yarn colors, ensuring the system is in a "ready" state to begin knitting a new row. In practice, the execution entity may perform a series of operations: 1) State reset: For example, resetting the weft insertion mechanism to the back stop point and resetting the hook of the node forming mechanism to its initial position. 2) Instruction pre-reading: Pre-reading the yarn color sequence and knitting parameters for the next row (row N+1) from the knitting execution instructions and loading them into the cache. 3) Yarn pre-selection: Based on the starting requirements of the next row's yarn color sequence, initiating the yarn selection process (step two) in advance, allowing the required yarn colors to enter the preparation state ahead of time, reducing inter-row waiting time. This step optimizes the continuity of the knitting process. For example, after the braiding head moves to the starting point of row 106, the system immediately reads the instruction for row 106 and displays that the first required color thread is 'B12'. At the same time, the color selector starts to rotate, sending the 'B12' color thread spool to the working position and starting the thread preparation, while resetting all actuators.
[0071] Step 10: Repeat the steps from the above line-by-line parsing process to the above initialization process until all weaving areas are completed, resulting in a semi-finished woven product. This semi-finished product refers to the main body of the fabric that has completed the weaving of all pattern area pile nodes according to the weaving execution instructions, but has not yet undergone final finishing processes such as edge sealing and thread fixing. It has presented a complete pattern, but the structure is not yet fully stable, and the edges are loose. In practice, the execution body (control system) cyclically executes steps one through nine. Each cycle processes one line of weaving. The system uses an internal counter or a line end marker in the instructions to determine whether all lines in the instruction file have been completed. When the last line is woven and the weaving mechanism moves out of the working area, the system determines that the weaving body is complete and removes the machine to obtain the semi-finished woven product. At this point, the front pattern of the Tibetan carpet is fully displayed, but the back may have a large number of unprocessed thread ends, and the four sides are not sealed. For example, the system weaves from line 1 to line 1500 (assuming a total of 1500 lines). When the node formation, coordinate shifting, and initialization judgment of line 1500 are completed, the cycle ends. What was taken off the loom was a half-finished woven blanket with a complete pattern but rough edges and floating threads on the back.
[0072] Step 11: Edge binding treatment is performed on the aforementioned semi-finished woven product. This edge binding treatment refers to the process of firmly binding and securing the outermost warp and weft threads, as well as the roots of the pile, around the perimeter of the semi-finished woven product using specific weaving techniques (such as wrapping or knotting) or specialized equipment, forming a strong, neat, and non-fraying edge. This greatly enhances the abrasion resistance of the Tibetan carpet's edges and the overall structural stability. In practice, this process can be performed using a dedicated edge binding machine or with manual assistance. For highly automated systems, it may be performed by switching the weaving equipment. During the treatment, a strong edge binding thread (usually the same material as the warp threads or stronger) is repeatedly passed through the warp threads and the roots of the first row of pile at high density around the perimeter of the carpet, and pulled taut to form a strong binding. This process must ensure that the edge binding thread has uniform tension and that the edges are straight. For example, place the semi-finished knitted product on the overlock machine's workbench. The machine guides the overlock thread along the left side of the blanket, passing through the edge warp and pile root at a density of 3-4 stitches per centimeter, tying knots and tightening them in a loop to complete the overlock of one side. The remaining three sides are processed in the same way.
[0073] Step 12 involves securing the loose threads on the woven semi-finished product after locking the threads, resulting in a preliminary woven product. This thread-secured process involves removing loose threads from the back (or interior) of the semi-finished product caused by color changes, thread breaks, or starting / ending of the weaving process. This is done through trimming, concealing, gluing, or re-knotting to ensure the back is neat, aesthetically pleasing, and free from the risk of unraveling. This preliminary woven product is the final output of this step and the entire row-by-row weaving process. It is a Tibetan rug product that has completed all major weaving processes and basic finishing touches, ready for further finishing (such as shearing and washing). In practice, this can be done using a backing glue machine, a hot melt gun, or manually using a crochet hook. A common automated method is hot melt gluing: a layer of low-temperature hot melt adhesive is sprayed or rolled onto the back of the semi-finished product, and then a heated roller is used to adhere the loose threads to the base fabric, while simultaneously trimming excess threads. For high-end products requiring a strong handcrafted feel, a manual "thread-concealing" method may be used, where a crochet hook is used to tuck the threads back into the roots of adjacent pile roots. For example, the semi-finished product after overlocking is evenly coated with hot melt adhesive powder on its back using a back-side gluing machine. It then passes through a low-temperature heating zone to melt the adhesive powder, followed by pressure setting using cooling rollers. Finally, an automatic trimming machine trims any excessively long threads, resulting in a primary woven fabric with a smooth back and firmly secured threads. This completes the automated conversion process from weaving instructions to the actual fabric.
[0074] The above-described steps one through twelve, as a technical solution of this disclosure embodiment, solve the core technical problem of "how to convert digital weaving instructions into physical entities with high fidelity, high efficiency, and high reliability during automated Tibetan carpet weaving." The reasons why existing automated weaving struggles to balance efficiency, quality, and complex pattern reproduction are as follows: Traditional automated weaving treats instruction parsing and execution as a black box, lacking detailed analysis of each line of instructions and material preparation, easily leading to machine stoppages due to instruction errors or unprepared materials; tension fluctuations in colored threads during transport cannot be perceived and controlled in real time, resulting in inconsistent pile sizes and uneven carpet surfaces; the precision and consistency of weaving actions (interlacing, weaving, knotting) rely on the static precision of the mechanical mechanism, lacking dynamic compensation for process states; if inter-row shifting and preparation are performed sequentially with the weaving actions, it introduces a large amount of idle travel time, severely restricting production efficiency; edge reinforcement and thread end processing after weaving are usually completed manually offline, disrupting production continuity and resulting in poor quality consistency. If the shortcomings in the above-mentioned links can be systematically addressed, a complete automated execution system can be constructed, encompassing precise instruction interpretation, intelligent material preparation, precise process control, and automatic finishing. To this end, this disclosure addresses the following: First, by parsing the weaving execution instructions line by line, the color thread sequence and weaving parameters of the current line are extracted in real time. This achieves precise and real-time decoding of high-level instructions, providing a unique and definite execution basis for each subsequent mechanical action, eliminating misoperation at the source. Second, based on the parsed color thread sequence, the color selector is driven to select and prepare physical color threads, resulting in a ready color thread group. The digitized color thread ID instruction is instantly converted into ready materials in the physical world, ensuring seamless connection and zero waiting time between "instruction and material." Third and fourth, by monitoring the tension of the ready color threads in real time and dynamically adjusting it using algorithms such as PID, stable tension color threads are obtained. This introduces a real-time force control feedback loop into automated weaving for the first time, fundamentally solving the problem of uneven pile size caused by changes in yarn feeding resistance, ensuring the ultimate flatness of the carpet surface. Steps five and six, based on stable tension threads and weaving parameters, sequentially perform high-precision thread interlacing and weaving processes. With sub-millimeter positioning accuracy, the machine replicates the core actions of "weft insertion" and "beating-the-weft" in hand weaving, laying a precise geometric foundation for a robust fabric structure. Step seven, building upon the interlaced fabric, uses a node-forming mechanism to simulate hand-tying (such as a figure-eight knot), resulting in structurally stable nodes. This represents a crucial leap from "two-dimensional interlacing" to "three-dimensional pile," ensuring each node is a robust structure with consistent size and strength, guaranteeing the Tibetan carpet's durability and handcrafted texture. Steps eight and nine, after completing a row of nodes, immediately control the weaving mechanism for high-precision coordinate shifting and simultaneously execute initialization operations such as pre-reading the next row's instructions and pre-selecting threads. Through the overlapping optimization of "action" and "pre-preparation," inter-row waiting time is eliminated, maximizing the speed potential of the machinery and significantly improving weaving efficiency.Step 10 involves cyclically executing steps 1 through 9 until the entire pattern area is completed, resulting in a semi-finished woven product. This highly disciplined and consistent process, involving tens of thousands of nodes, achieves a complete and accurate reproduction of the complex pattern from digital to physical form. Steps 11 and 12 respectively automate the edge-locking process and the securing of loose threads on the back of the semi-finished product. This integrates the traditionally manual finishing processes into an automated production line, improving production efficiency and ensuring consistent edge-locking strength and a clean, aesthetically pleasing back surface through machine control, thus enhancing the overall quality and durability of the product. This process deeply integrates six key technologies: precise instruction analysis, intelligent material preparation, closed-loop tension control, precise action execution, parallel process optimization, and automated finishing, constructing a complete automated Tibetan carpet weaving execution system. Furthermore, the dynamic adjustment mechanism based on real-time tension data and the parallel process of "action + preparation" provide a core solution that transcends traditional sequential control paradigms for high-precision, high-efficiency automated textile production. Thus, an unmanned, continuous, and intelligent production closed loop was constructed, from "instruction input" to "finished product output," realizing a fundamental transformation of Tibetan carpet weaving from "intermittent production relying on craftsmen's touch and experience" to "continuous intelligent manufacturing based on data and control." While reproducing the artistic design, it also achieved high efficiency and high consistency in industrial production.
[0075] In addressing the technical challenges of "traditional color quantization methods relying on fixed-size palettes leading to color distortion and detail loss in Tibetan carpet patterns, and production depending on manual experience," the aforementioned adaptive color quantization and weaving methods for Tibetan carpets, particularly in the continuous and automated production of intelligent Tibetan carpet weaving lines, present another technical challenge: When weaving equipment operates at high speed and continuously based on quantified production guidance images, minute differences in yarn physical properties (such as luster and colorfastness), high-frequency fluctuations in equipment mechanical precision, and dynamic changes in the production environment (such as light, temperature, and humidity) can all cause subtle deviations in color saturation, pattern outline clarity, and texture uniformity between the woven fabric and the "digitally perfect" design image. These deviations are difficult to detect in real-time. Without real-time, precise quality perception and closed-loop control embedded in the production process, these deviations will accumulate until they are exposed during the final product inspection stage, resulting in significant waste of materials and time, and making it difficult to achieve high standards in terms of reliability, consistency, and intelligence of the production system. To meet the following requirements for this application scenario: real-time, precise, and measurable quality monitoring of the entire production process, with automated, minimally invasive, and adaptive online correction capabilities, we have decided to adopt the following solution: Optionally, the aforementioned implementing entity may also perform the following steps: The first step involves simultaneously acquiring multi-angle images of the woven fabric during the row-by-row weaving process, resulting in a real-time image sequence. This multi-angle image acquisition refers to simultaneously capturing images of the fabric surface from different perspectives and orientations during the weaving process to obtain a set of images covering the entire area while minimizing occlusion and reflection. The resulting real-time image sequence is the output of this step; it consists of a set of images captured by multiple industrial cameras at the same moment or within a very short time interval, collectively reflecting the overall state of the woven fabric at that current moment. In practice, the execution entity can deploy an image acquisition system composed of multiple industrial cameras. These cameras are installed at pre-calibrated locations above, to the side, or other key points on the weaving machine to ensure coverage of the entire effective area of the woven fabric. All cameras are synchronized with the movement of the weaving machine via trigger signals (such as photoelectric sensor or encoder signals), triggering simultaneous or sequential capture when the weaving machine completes a row or moves to a specific position. The captured images are transmitted in real-time to a processing computer via an image acquisition card or gigabit Ethernet, and organized by timestamp and camera ID to form the real-time image sequence. For example, when the knitting equipment pauses to perform row shifting, three cameras installed directly above, at a 45-degree angle to the left front, and at a 45-degree angle to the right front are triggered to simultaneously capture three images of the knitted fabric at different angles at the same time, forming a set of real-time knitted fabric image sequences.
[0076] The second step involves performing illumination normalization processing on the aforementioned real-time woven fabric image sequence to obtain a uniformly illuminated image. Illumination normalization refers to the process of eliminating or reducing differences in image brightness and color caused by uneven illumination, shadows, and highlights, using digital image processing techniques to ensure consistent illumination across different regions and time points. The uniformly illuminated image is the output of this step; it is the processed image whose pixel values primarily reflect the color and texture of the object itself, rather than the influence of lighting conditions. In practice, this process can be implemented using algorithms based on Retinex theory (such as MSRCR), homomorphic filtering, or a simple combination of white balance and histogram equalization. First, the system may estimate the illumination components from the image (e.g., obtaining low-frequency information through Gaussian blur), and then separate the reflection components (i.e., the object's inherent properties) from the original image. For color images, operations may need to be performed in a specific color space (such as the V channel of HSV or the L channel of Lab) to avoid color distortion. The processing aims to achieve overall uniform brightness in the image and enhance details in dark areas. For example, in a woven fabric image that is darker on the left and brighter on the right due to side lighting, after processing with the MSRCR algorithm, the brightness difference between the left and right sides is significantly reduced, and the woven texture is clearly visible throughout the image, resulting in a uniformly illuminated image.
[0077] The third step involves performing perspective correction on the uniformly illuminated images to obtain standardized woven fabric images. Perspective correction refers to the process of restoring images with trapezoidal distortion (perspective distortion) caused by camera tilt to a rectangular image from a frontal, parallel viewpoint through geometric transformation. The standardized woven fabric image is the output of this step; it is a corrected image that appears to have been taken vertically from directly above, with a known, linear mapping between its pixel coordinates and the actual physical coordinates of the woven fabric, facilitating subsequent precise registration and comparison. In practice, the execution entity needs to pre-calibrate the image acquisition system to obtain the intrinsic parameters (focal length, principal point, distortion coefficients) and extrinsic parameters (rotation matrix and translation vector) for each camera. For each uniformly illuminated image, the execution entity calculates a homography matrix using the known calibration parameters and the pre-defined position of the woven fabric plane in the world coordinate system. Then, the original image is resampled and corrected to a uniform, perspective-free top view through perspective transformation (using this homography matrix). Images from all angles are ultimately corrected to the same "standardized" coordinate system. For example, an image of a woven fabric taken from an oblique angle, presenting a trapezoidal shape, is corrected into a standard rectangular image after perspective transformation based on the homography matrix, as if taken from directly above, with the warp and weft yarns forming an orthogonal grid in the image. This is the standardized woven fabric image.
[0078] The fourth step involves pixel-level registration of the standardized woven fabric image and the Tibetan carpet production guidance image to obtain aligned comparison image pairs. This pixel-level registration process involves finding the optimal geometric alignment transformation (such as translation, rotation, or scaling) between the two images using feature matching, template matching, or mutual information-based methods, ensuring that every design pixel in the production guidance image is precisely aligned with its corresponding actual weaving position in the standardized woven fabric image. The aligned comparison image pairs are the output of this step, consisting of the aligned standardized woven fabric image and the Tibetan carpet production guidance image after undergoing the same spatial transformation; the two images correspond perfectly in pixel coordinates. In practice, the above execution can employ a feature-based registration method. First, robust feature points (such as SIFT, ORB, or deep learning-based features) are extracted from the two images. Then, feature point matching is performed, and the RANSAC algorithm is used to estimate the affine or projective transformation matrix between the two images. Finally, the estimated transformation matrix is used to resample the Tibetan carpet production guidance image (e.g., bilinear interpolation) to align it with the standardized woven fabric image at the pixel level. To ensure accuracy, known markers on the fabric (such as deliberately woven positioning crosses) may be used as aids. For example, an affine transformation matrix is calculated by matching extracted SIFT feature points. This matrix is then used to transform the production guide image so that the pattern outlines therein completely overlap with the actual woven outlines in the standardized fabric image, resulting in a precisely aligned pair of comparison images.
[0079] The fifth step involves performing regional color difference calculations on the aligned comparison image pairs to obtain a color difference matrix. This regional color difference calculation process involves dividing the aligned image pairs into several small regions (such as fixed-size blocks or natural partitions based on the design pattern) and quantifying the average difference between the actual woven color and the design color within each region. The color difference matrix is the output of this step; it is a two-dimensional array (matrix) where each element corresponds to an image sub-region. The value of each element represents the degree of color difference within that region, typically using a distance metric in color space (such as CIELAB ΔE). In practice, the execution entity first divides the aligned comparison image pairs into a spatial grid, for example, into 32x32 pixel non-overlapping blocks. For each block, the average color of the standardized woven image block (in the Lab color space) and the average color of the production guide image block (with known Lab values corresponding to their index colors) are calculated. Then, the CIEDE2000 color difference (ΔE) between the two average colors is calculated as the color difference value for that block. Arranging the difference values of all blocks according to their spatial location constitutes the color difference matrix. This matrix visually displays the spatial distribution of color deviation. For example, a 1024x1024 image can be divided into a 32x32 grid, resulting in 1024 blocks. The ΔE between the actual color and the designed color of each block is calculated, yielding a 32x32 color difference matrix, where higher values indicate larger color deviations at those locations.
[0080] Step 6 involves performing regional texture feature difference calculations on the aligned comparison image pairs to obtain a texture difference matrix. This regional texture feature difference calculation refers to quantifying the difference between the actual woven texture and the intended design texture, based on regional segmentation. Texture features can include directionality, roughness, contrast, uniformity, etc. The texture difference matrix is the output of this step; it is a two-dimensional array of the same size as the color difference matrix, where each element represents the degree of texture feature difference in the corresponding image sub-region. In practice, the execution entity can calculate the texture descriptor for each image block and compare their differences. A common approach is to use a Gray-Level Co-occurrence Matrix (GLCM) to extract features such as contrast, energy, homogeneity, and correlation. For each block, GLCM feature vectors are calculated from the standardized woven image block and the production guidance image block (which may need to be converted to grayscale or use a single channel). Then, the Euclidean or cosine distance between the two feature vectors is calculated as the texture difference value. Another more modern approach is to use a pre-trained convolutional neural network (such as VGG) to extract deep texture features for calculation. For example, for each 32x32 image patch, the contrast and energy features of its gray-level co-occurrence matrix are calculated to form a 2D feature vector. The Euclidean distance between the feature vectors of the actual image patch and the designed image patch is calculated to obtain a 32x32 texture difference matrix.
[0081] Step 7 involves fusing the aforementioned color difference matrix and texture difference matrix to obtain the region difference matrix. This fusion process combines information from two different dimensions—color difference and texture difference—into a single comprehensive difference index. The region difference matrix is the output of this step; it is a comprehensive matrix where each element reflects the overall deviation of the corresponding region from the design standards in both color and texture. In practice, this can be achieved using a weighted summation method. First, the color difference matrix and texture difference matrix are normalized (e.g., scaled to the [0,1] range). Then, weights are assigned to both (e.g., color weight 0.7, texture weight 0.3, adjustable according to process importance), and the weighted sum is calculated: Region Difference Matrix = w_color * Color Difference Matrix + w_texture * Texture Difference Matrix. Alternatively, more complex fusion methods can be used, such as rule-based decision-making (e.g., considering either exceeding a threshold as abnormal) or machine learning models for fusion judgment. For example, after normalizing the 32x32 color difference matrix, multiply it by 0.7, and after normalizing the texture difference matrix, multiply it by 0.3. Add them element by element to get a 32x32 region difference matrix with values between 0 and 1. The larger the value, the greater the overall difference in the region.
[0082] Step 8 involves performing anomaly detection processing on the aforementioned regional difference matrix using an adaptive threshold, resulting in a candidate anomaly region set. This adaptive threshold-based anomaly detection process refers to dynamically determining a threshold based on the overall statistical characteristics of the regional difference matrix (such as mean, standard deviation, and distribution shape) rather than relying on a fixed threshold, to distinguish between normal regions and potentially anomalous regions. The candidate anomaly region set is the output of this step; it is a collection of connected regions (or individual blocks) in the regional difference matrix whose values exceed the adaptive threshold, with each region labeled as a candidate anomaly. In practice, the execution entity can use statistical methods to determine the threshold. For example, the mean μ and standard deviation σ of the regional difference matrix can be calculated, and the threshold can be set to T = μ + k * σ, where k is an adjustable parameter (e.g., 2 or 3). Then, the regional difference matrix is thresholded to obtain a binary image (1 for values greater than T, 0 for others). Connectivity component analysis is performed on this binary image, identifying each connected region as a candidate anomaly region and recording its location and contour. For example, if the mean μ of the calculated regional difference matrix is 0.1 and the standard deviation σ is 0.05, and k=2 is chosen, then the threshold T=0.2. All pixels in the matrix with a value greater than 0.2 are set to 1, and then 8-connectivity analysis is performed, identifying 5 connected regions. These 5 regions constitute a set of candidate anomaly regions.
[0083] Step nine involves performing morphological post-processing on the aforementioned set of candidate anomaly regions to obtain post-processed candidate anomaly regions. This morphological post-processing refers to using mathematical morphological operations (such as dilation, erosion, opening, and closing) to process the binary mask of the candidate anomaly regions. This process eliminates noise (such as isolated false positives), smooths region boundaries, and fills small holes within the regions. This makes the detected regions more consistent with the actual shape of the anomalies and reduces interference in subsequent processing. The post-processed candidate anomaly regions are the output of this step; they are a cleaner and more coherent set of regions after morphological processing. In practice, the execution body can sequentially perform erosion and dilation operations (i.e., opening) to remove small noise points, and then perform dilation and erosion (i.e., closing) to fill small holes and smooth boundaries. The size of the structuring element can be set according to the image resolution and the minimum expected size of the anomaly. For example, a 3x3 rectangular structuring element can be used for one opening operation, followed by a closing operation using the same structuring element. For example, the initially detected candidate anomaly regions may contain some scattered points and a large region with internal holes. After opening operations (erosion followed by dilation) to remove scattered points, closing operations (dilation followed by erosion) were performed to fill the voids inside the large area, resulting in a post-processed candidate anomaly region with smooth boundaries and a full interior.
[0084] Step 10 involves merging the candidate anomaly regions from the post-processing steps to obtain the deviation regions. This merging process combines multiple spatially adjacent or very close candidate anomaly regions that may belong to the same actual defect into a larger region. This helps to understand and process a coherent defect holistically, avoiding fragmented processing of the same defect into multiple small parts. The deviation regions are the output of this step; they are the final determined physical regions that need correction, with each deviation region corresponding to an independent defect. In practice, the execution entity can merge regions based on Euclidean distance or overlap. For example, a distance threshold d (e.g., 10 pixels) can be set. If the center distance between the bounding rectangles of two regions is less than d, or their bounding boxes overlap, these two regions are merged (by taking the union of their convex hulls or bounding boxes). The merging process can be iterative until no more regions meet the merging criteria. Finally, each merged region is labeled as a deviation region. For example, two post-processing candidate anomaly regions, one near (100, 100) and the other near (108, 105), are less than a threshold distance. The system merges these two regions into a large rectangular region, which is defined as an aberration region.
[0085] Step 11 involves statistically processing the pixel differences within the aforementioned deviation region to obtain the quantization deviation value. This quantization deviation value is a comprehensive scalar that summarizes the severity of the entire deviation region with a single number, used to determine whether to trigger a correction process. This value is typically calculated based on the values of all pixels within the deviation region in the region difference matrix, such as the maximum, average, or weighted sum. In practice, the execution entity extracts all values corresponding to each deviation region from the region difference matrix. Then, it calculates the average (or maximum, or sum) of these values as the quantization deviation value for that region. The average reflects the overall deviation level of the region, while the maximum focuses on the worst-case scenario. To compare with a preset dynamic tolerance threshold, further processing of the calculated value may be necessary (e.g., multiplying by a weight related to the region area). For example, a deviation region covers 50 pixels in the region difference matrix, with values [0.25, 0.30, 0.28, …]. Calculating its average value to 0.27 yields a quantization deviation value of 0.27 for this deviation region.
[0086] Step 12: In response to the aforementioned quantified deviation value exceeding the preset dynamic tolerance threshold, a production anomaly is identified, and the following anomaly handling process is executed. The aforementioned dynamic tolerance threshold is not a fixed value, but rather a threshold that can be dynamically adjusted based on factors such as product quality level, current weaving stage, and historical yield. For example, the threshold is lower for high-grade products; for the initial weaving stage, the threshold can be slightly higher. A "production anomaly" determination means that the deviation area has exceeded the acceptable range and must be corrected. In practice, the executing entity compares the calculated quantified deviation value with the dynamic tolerance threshold obtained from the process database or real-time quality strategy module. If the quantified deviation value is greater than the threshold, the system determines that the weaving portion corresponding to the deviation area has a production anomaly and immediately triggers the anomaly handling process. The system records the location, type (based primarily on color / texture differences), and severity of the anomaly, and suspends the normal weaving process (or marks the area as pending processing). For example, the quantified deviation value is 0.27, while the dynamic tolerance threshold corresponding to the current product level is 0.25. Since 0.27 > 0.25, the system determines it as an anomaly and triggers a correction sub-process.
[0087] Sub-step one involves automated dismantling of the aforementioned deviation area. This automated dismantling process refers to the controlled knitting equipment or specialized dismantling tools that safely and precisely remove the woven, substandard pile ends or colored threads within the deviation area, preparing a clean base for re-knitting. In practice, the executing entity can control the knitting head to switch to "dismantling mode." The knitting head moves to the starting position of the deviation area and, using a special hook or cutting tool, hooks and cuts the pile ends one by one in the reverse order of the original knitting, or unravels the colored threads from the warp. The removed waste thread is sucked away by a suction nozzle. The system must precisely control the dismantling range to ensure no damage is done to the surrounding acceptable areas and the base fabric. For larger areas, a zoned dismantling strategy may be used. For example, for a 5cm x 5cm square deviation area located near (200, 300), position the knitting head at the upper left corner of the area, and then hook and cut the pile one by one in each row from right to left until all the pile in the area is removed, revealing a clean base fabric.
[0088] Sub-step two involves re-weaving the disassembled area to obtain a repaired woven area. This re-weaving process refers to re-executing the weaving steps (steps one through twelve) within the cleaned area, following the original design (extracting the pattern and color information from the production guidance image), using the correct color threads and weaving parameters. The repaired woven area is the output of this step; it is the area where the pattern and color match the design after re-weaving. In practice, the execution entity first extracts the original pattern information (color index sequence) corresponding to the deviation area from the Tibetan carpet production guidance image. Then, based on the calibrated physical color thread set, the correct color threads are prepared. Next, the system generates micro-weaving execution instructions for this local area, controlling the weaving head to perform row-by-row weaving only within this area (including color thread interlacing, weaving, and node formation). During re-weaving, special attention must be paid to the boundary connection with the surrounding original woven areas to ensure a natural transition. For example, the system generates a miniature weaving instruction covering only a 5cm x 5cm deviation area, controlling the weaving head to use the correct colored thread to re-weave within that area according to the original pattern. Once completed, the appearance of this area seamlessly blends with the surrounding acceptable area, forming the repaired woven area.
[0089] Sub-step three involves performing secondary image acquisition processing on the repaired knitted area to obtain a secondary acquired image. This secondary image acquisition processing refers to the process of acquiring images of the repaired area and its surroundings again after re-knitting to obtain the actual state after repair. This image is used to verify the correction effect. The secondary acquired image is the output of this step; it is a high-resolution image of the repaired area and may have undergone multi-angle acquisition and preprocessing. In practice, the executing entity can control the image acquisition system (possibly a dedicated high-resolution local camera) to focus on capturing images of the repaired area. The capturing process may include multi-angle synchronous acquisition similar to the first step and subsequent preprocessing such as illumination normalization and perspective correction to ensure that the image quality is comparable to the standardized knitted product images used for comparison. Ultimately, one or more secondary acquired images focused on the repaired area are obtained. For example, after re-knitting, a macro camera mounted above the knitting head is triggered to capture a close-up image of the repaired area, resulting in a high-resolution secondary acquired image.
[0090] Sub-step four involves comparing and verifying the re-acquired image with the Tibetan carpet production guidance image to obtain a verification result. This comparison and verification process involves comparing the re-acquired image (after registration) with the original design image within the repair area, calculating a new difference value to assess the success of the repair. The verification result is the output of this step; it is a simple binary conclusion ("pass" or "fail"), or it may include a detailed difference report. In practice, the executing entity repeats steps four through eleven, but only within the repair area. Specifically, the re-acquired image and the Tibetan carpet production guidance image are registered within the repair area, a new regional difference matrix is calculated, and the quantized deviation value (or maximum difference value) of the repair area is obtained. This new quantized deviation value is then compared with a stricter "repair acceptance threshold" (usually lower than the dynamic tolerance threshold of the initial test). If it is lower than the acceptance threshold, the verification is considered passed; otherwise, it is considered failed. For example, the new quantized deviation value calculated after repair is 0.08, while the repair acceptance threshold is 0.10. Since 0.08 < 0.10, the verification result is "pass".
[0091] Sub-step five: In response to the above verification result indicating a pass, the row-by-row knitting process continues. This step signifies successful correction and the system resuming normal production flow. In practice, after receiving the "pass" verification result, the executing entity controls the knitting equipment to switch from the abnormal handling mode back to the normal row-by-row knitting mode. The knitting head moves to the position before the pause (or the next row to be knitted) and continues executing the interrupted knitting instructions to knit subsequent patterns. For example, after passing the verification, the system controls the knitting head to move away from the repair area and return to the starting point of row 520 in the original knitting flow (assuming the interruption occurred here), continuing to knit row 520 and subsequent rows.
[0092] Sub-step six: In response to the above verification result indicating failure, the row-by-row knitting process is stopped, and the verification result is sent to the human interaction terminal. This step indicates that automatic correction has failed and manual intervention is required. In practice, upon receiving the "failed" verification result, the executing entity immediately stops all automatic knitting operations and puts the equipment into a safe pause state. Simultaneously, a detailed anomaly report (including the location of the deviation area, the initial deviation value, the deviation value after repair, and the repair process log) is sent via the network or on-site display screen to the human interaction terminal (such as the workshop supervisor's computer or mobile device), notifying technicians to conduct manual inspection and intervention. The system awaits manual confirmation or instructions. For example, if the verification fails, the knitting machine stops completely. Simultaneously, an alarm message along with a detailed repair failure report is pushed to the tablet, indicating "Verification failed after repair of area (200,300), requesting manual intervention."
[0093] The above-mentioned steps one through twelve and subsequent sub-steps, as a technical solution of this disclosure embodiment, solve the technical problem that "traditional Tibetan carpet weaving quality inspection relies on manual labor, is subjective and lagging, and the error correction process is highly destructive and costly, making it difficult to achieve refined online quality control." The reasons why existing technologies struggle to achieve a high-precision, high-efficiency quality closed loop are as follows: traditional manual visual inspection cannot objectively and quantitatively assess color and texture deviations, leading to inconsistent standards and easy omissions; after discovering defects, it is impossible to accurately locate the physical boundaries and severity of the defects, resulting in rough subsequent correction actions; correction methods usually involve complete removal or large-area coverage, damaging surrounding qualified areas and causing significant waste of materials and time; the entire "inspection-correction" process lacks an immediate verification link, failing to ensure the effectiveness of the correction actions themselves, making the quality closed loop unreliable. If the above factors can be eliminated, a complete intelligent quality assurance system can be constructed, from "pixel-level quantitative perception" to "regional-level precise positioning" and then to "minimally invasive closed-loop correction." Therefore, this disclosure: steps one through four construct an objective and accurate digital perception base. Through multi-angle image synchronous acquisition, illumination normalization, perspective correction, and pixel-level registration, the complex physical weaving surface is transformed into a standardized digital image strictly aligned with the design drawings. This eliminates interference from ambient lighting, perspective distortion, and positional offset, achieving for the first time an objective, stable, and repeatable digital mapping of the woven fabric's state, laying the foundation for subsequent quantitative analysis. Steps five through eight achieve quantitative assessment and anomaly localization from macro to micro levels. By calculating color difference matrices and texture difference matrices by region and fusing them to generate a regional difference matrix, the subjective judgment of "aesthetics" is transformed into an objective measure of "ΔE color difference and feature distance." Furthermore, through adaptive threshold detection, candidate anomaly regions exceeding statistical norms are automatically identified from the global data, achieving datafication and preliminary spatial localization of quality issues. Steps nine through eleven complete the refined post-processing and severity quantification of the anomaly regions. Through morphological post-processing and region merging, discrete detection points are aggregated into coherent deviation regions that conform to the actual physical defect shape, and their quantitative deviation values are calculated. This process clarifies the precise outline and severity level of each area to be corrected, transforming the vague description of "a problematic area" into a precise instruction of "a specific area located at (X,Y), with an area of S and a severity of V." Step 12 and subsequent sub-steps establish a minimally invasive and reliable online closed-loop correction mechanism. When the quantified deviation value exceeds the limit, the system does not simply issue an alarm but automatically triggers a complete correction sub-process including "automated disassembly - reweaving - secondary verification." This process first precisely disassembles the deviation area, minimizing damage to the qualified areas; then, it performs local reweaving based on the original design data; finally, it verifies the repair effect through secondary image acquisition and comparison, ensuring that production can continue only after the repair effect meets the standards.This transforms quality control from "post-production rejection of defective products" to "in-process online repair," forming a reliable self-healing closed loop for production quality. It organically combines four key technological elements—high-fidelity digital sensing, multi-dimensional quantitative assessment, adaptive precise positioning, and minimally invasive closed-loop correction—to construct a complete intelligent control system for weaving quality. Furthermore, a decision-making mechanism based on dynamic tolerance thresholds and repair acceptance thresholds provide flexible quality control strategies for different product grades and process stages. This constructs an intelligent production closed loop from "synchronous sensing" to "analysis and decision-making" to "execution and verification," achieving a fundamental improvement in Tibetan carpet weaving quality control from "offline, sampling, experience-based judgment, and destructive rework" to "online, full inspection, data-driven, and minimally invasive self-correction." While ensuring excellent product consistency, it also improves production efficiency and material utilization, enhancing the overall robustness and intelligence of the manufacturing system.
[0094] The technical solution of this application has the following beneficial effects: Through the adaptive color quantization and weaving method for Tibetan carpets proposed in this application, high-fidelity, high-efficiency, and adaptive intelligent production from digital patterns to physical Tibetan carpets is achieved, effectively solving the core problems of color distortion, loss of detail, and strong reliance on manual labor caused by the fixed size of the color palette in traditional quantization methods. Specifically, existing color quantization methods rely on a fixed-size color palette, which cannot be dynamically adjusted according to the image content. When applied to Tibetan carpet patterns with complex colors and textures, this often leads to redundant color lines or missing color levels, and the process heavily relies on the experience of craftsmen, making it difficult to achieve standardized and efficient production. Based on this, the adaptive color quantization and weaving method for Tibetan carpets in this application includes: First, obtaining the original image of the Tibetan carpet pattern and extracting features from it to obtain a feature map, constructing a deep feature representation oriented towards weaving semantics. This step abandons the traditional method of directly clustering the original pixels, and instead extracts and integrates deep features of color, texture, and structure through a deep network. This provides semantically rich input for subsequent adaptive decision-making, ensuring from the source that the quantization process can understand the visual complexity of the pattern (such as distinguishing between a smooth background color and a fine texture), laying the foundation for overcoming the quantization distortion caused by the "seeing color but not form" problem in existing technologies. Secondly, the core breakthrough of this solution is the intelligent dynamic decision-making for the color palette size achieved by adaptively generating a set of key feature channels based on feature maps. This step automatically filters out the feature channels crucial to the current pattern by analyzing the global and local information of the feature maps, and their quantity directly determines the size of the subsequent color palette. This completely overturns the paradigm of existing technologies that must preset a fixed number of colors, enabling the system to "allocate" the number of color lines "on demand" according to the characteristics of the pattern itself (such as the difference between a simple border and a complex central pattern in a Tibetan carpet), achieving a fundamental adaptive balance between resource simplification and visual fidelity. Next, a Tibetan carpet weaving color palette is generated based on the set of key feature channels, and based on this, a color mapping is performed on the original image to obtain a production guidance image, completing the precise conversion from adaptive decision-making to executable production data. This process ensures a strong correlation between the generated palette colors and pattern features, and generates clear color separation guidelines through an optimized mapping algorithm. This not only guarantees high visual quality of the quantified images, but more importantly, it produces structured instructions that directly drive subsequent weaving processes, achieving a seamless transition from digital design to standardized production. This avoids the need for repeated manual modifications to the drawings due to unsatisfactory quantification results, a common practice in traditional methods. Finally, the actual Tibetan carpets are produced based on the production guidelines, and a closed-loop production process is formed by integrating automated weaving and real-time quality inspection. This method combines intelligent quantification results with automated weaving equipment and an online visual inspection system, achieving a precise, efficient, and controllable transformation from "digital instructions" to "physical finished products."In summary, the embodiments of this application construct a complete intelligent Tibetan carpet production solution through a collaborative technical approach of "deep feature extraction, adaptive channel filtering, dynamic color palette generation, and closed-loop production execution." This method not only overcomes the fundamental technical obstacle of a fixed color palette's inability to adapt, but also brings comprehensive benefits in terms of improving artistic fidelity, reducing production costs, and achieving production standardization and automation through end-to-end system design.
[0095] Further reference Figure 2 As an implementation of the methods shown in the above figures, this disclosure provides some embodiments of an adaptive color quantization and weaving device for Tibetan carpets. These device embodiments are similar to... Figure 1 Corresponding to the method embodiments shown, the device can be specifically applied to various electronic devices.
[0096] like Figure 2 As shown, the adaptive color quantization and weaving apparatus 200 for Tibetan carpets in some embodiments includes: an acquisition unit 201, a feature extraction unit 202, a first generation unit 203, a second generation unit 204, a mapping unit 205, and a production unit 206. The acquisition unit 201 is configured to acquire an original image of a Tibetan carpet pattern; the feature extraction unit 202 is configured to extract features from the original image of the Tibetan carpet pattern to obtain a feature map; the first generation unit 203 is configured to adaptively generate a set of key feature channels based on the feature map; the second generation unit 204 is configured to generate a Tibetan carpet weaving color palette based on the set of key feature channels, wherein the number of colors in the Tibetan carpet weaving color palette corresponds to the number of key feature channels in the set of key feature channels; the mapping unit 205 is configured to perform color mapping on the original image of the Tibetan carpet pattern based on the Tibetan carpet weaving color palette to obtain a Tibetan carpet production guidance image; and the production unit 206 is configured to produce a physical Tibetan carpet based on the Tibetan carpet production guidance image.
[0097] It is understandable that the units described in the device 200 are related to the reference. Figure 1 The steps in the described method correspond to each other. Therefore, the operations, features, and beneficial effects described above for the method also apply to the device 200 and the units contained therein, and will not be repeated here.
[0098] The following is for reference. Figure 3 It shows a schematic diagram of the structure of an electronic device 300 suitable for implementing some embodiments of the present disclosure. Figure 3 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of this disclosure.
[0099] like Figure 3As shown, the electronic device 300 may include a processing unit 301 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage device 308 into a random access memory (RAM) 303. The RAM 303 also stores various programs and data required for the operation of the electronic device 300. The processing unit 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0100] Typically, the following devices can be connected to I / O interface 305: input devices 306 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 307 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; and communication devices 309. Communication device 309 allows electronic device 300 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 3 An electronic device 300 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively. Figure 3 Each box shown can represent a device or multiple devices as needed.
[0101] In particular, according to some embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, some embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 309, or installed from storage device 308, or installed from ROM 302. When the computer program is executed by processing device 301, it performs the functions defined in the methods of some embodiments of this disclosure.
[0102] It should be noted that, in some embodiments of this disclosure, the computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In some embodiments of this disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In some embodiments of this disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0103] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0104] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device. The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: acquire an original image of a Tibetan carpet pattern; extract features from the original image of the Tibetan carpet pattern to obtain a feature map; adaptively generate a set of key feature channels based on the feature map; generate a Tibetan carpet weaving color palette according to the set of key feature channels, wherein the number of colors in the Tibetan carpet weaving color palette corresponds to the number of key feature channels in the set of key feature channels; perform color mapping on the original image of the Tibetan carpet pattern based on the Tibetan carpet weaving color palette to obtain a Tibetan carpet production guidance image; and produce a physical Tibetan carpet according to the Tibetan carpet production guidance image.
[0105] Computer program code for performing operations of some embodiments of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0106] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0107] The units described in some embodiments of this disclosure can be implemented in software or hardware. The described units can also be housed in a processor; for example, a processor may be described as including an acquisition unit, a feature extraction unit, a first generation unit, a second generation unit, a mapping unit, and a production unit. The names of these units do not necessarily limit the specific unit; for example, the acquisition unit may also be described as "a unit for acquiring the original image of a Tibetan carpet pattern."
[0108] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.
[0109] Some embodiments of this disclosure also provide a computer program product, including a computer program that, when executed by a processor, implements any of the above-described adaptive color quantization and compilation methods for Tibetan carpets.
[0110] The above description is merely a selection of preferred embodiments of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in the embodiments of this disclosure.
Claims
1. An adaptive color quantization and weaving method for Tibetan carpets, comprising: Obtain the original image of the Tibetan carpet pattern; Feature extraction is performed on the original image of the Tibetan carpet pattern to obtain a feature map; Based on the feature map, an adaptive set of key feature channels is generated, including: The feature map is subjected to global and local feature analysis to obtain a channel importance assessment; The global feature representation in the channel importance assessment is subjected to nonlinear feature transformation to obtain an intermediate global feature representation; The intermediate global feature representation is subjected to dual logical branch mapping to obtain channel retention and pruning logical values; Spatial attention normalization is performed on the local feature representations in the channel importance assessment to obtain local channel attention weights; The channel retention and pruning logic values are subjected to decision random perturbation processing to obtain the perturbed logic values; The perturbed logic values are subjected to probability distribution softening processing to obtain a soft decision probability distribution; The soft decision probability distribution is binarized to obtain the hard decision mask; Gradient linking is performed on the hard decision mask and the soft decision probability distribution to obtain the final decision probability; The final decision probability and the local channel attention weight are fused to obtain a weighted decision weight. The weighted decision weights are aggregated based on channel importance to obtain channel-level importance scores; The channel-level importance scores are subjected to importance filtering to obtain the channel filtering results; Based on the channel filtering results, a set of key feature channels is generated; A Tibetan carpet weaving color palette is generated based on the set of key feature channels, wherein the number of colors in the Tibetan carpet weaving color palette corresponds to the number of key feature channels in the set of key feature channels; Based on the Tibetan carpet weaving color palette, the original image of the Tibetan carpet pattern is color-mapped to obtain a Tibetan carpet production guidance image. Based on the aforementioned Tibetan carpet production guidance images, the actual Tibetan carpets are made.
2. The method according to claim 1, wherein, The step of extracting features from the original image of the Tibetan carpet pattern to obtain a feature map includes: The original image is subjected to primary feature extraction processing to obtain a primary feature map; The primary feature map is subjected to feature downsampling to obtain the intermediate feature map; Deep feature extraction is performed on the intermediate feature map to obtain a new feature map.
3. The method according to claim 1, wherein, The step of generating a color palette for Tibetan carpet weaving threads based on the set of key feature channels includes: The key feature channel set is subjected to color weighting processing to obtain a weighted color set; The weighted color set is normalized to obtain the candidate color set; A color palette for Tibetan carpet weaving threads is generated based on the candidate color set.
4. The method according to claim 1, wherein, The process of color mapping the original image of the Tibetan carpet pattern based on the Tibetan carpet weaving color palette to obtain a Tibetan carpet production guidance image includes: The distance between the original image of the Tibetan carpet pattern and the color palette of the Tibetan carpet weaving threads is calculated to obtain a distance matrix. The distance matrix is subjected to color assignment processing to obtain a color index mapping; The color index map is subjected to pixel replacement processing to obtain a Tibetan carpet production guidance image.
5. An adaptive color quantization and weaving device for Tibetan carpets, comprising: The acquisition unit is configured to acquire the original image of the Tibetan carpet pattern; The feature extraction unit is configured to extract features from the original image of the Tibetan carpet pattern to obtain a feature map. The first generation unit is configured to adaptively generate a set of key feature channels based on the feature map, including: The feature map is subjected to global and local feature analysis to obtain a channel importance assessment; The global feature representation in the channel importance assessment is subjected to nonlinear feature transformation to obtain an intermediate global feature representation; The intermediate global feature representation is subjected to dual logical branch mapping to obtain channel retention and pruning logical values; Spatial attention normalization is performed on the local feature representations in the channel importance assessment to obtain local channel attention weights; The channel retention and pruning logic values are subjected to decision random perturbation processing to obtain the perturbed logic values; The perturbed logic values are subjected to probability distribution softening processing to obtain a soft decision probability distribution; The soft decision probability distribution is binarized to obtain the hard decision mask; Gradient linking is performed on the hard decision mask and the soft decision probability distribution to obtain the final decision probability; The final decision probability and the local channel attention weight are fused to obtain a weighted decision weight. The weighted decision weights are aggregated based on channel importance to obtain channel-level importance scores; The channel-level importance scores are subjected to importance filtering to obtain the channel filtering results; Based on the channel filtering results, a set of key feature channels is generated; The second generation unit is configured to generate a Tibetan carpet weaving color palette based on the set of key feature channels, wherein the number of colors in the Tibetan carpet weaving color palette corresponds to the number of key feature channels in the set of key feature channels. The mapping unit is configured to perform color mapping on the original image of the Tibetan carpet pattern based on the color palette of the Tibetan carpet weaving color thread to obtain a Tibetan carpet production guidance image. The production unit is configured to produce actual Tibetan carpets based on the Tibetan carpet production guidance images.
6. An electronic device, comprising: One or more processors; A storage device on which one or more programs are stored; When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1 to 4.
7. A computer-readable medium having a computer program stored thereon, wherein, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Carpet printing quality detection and automatic correction method based on machine vision
CN120525861A
Colored spun yarn color characterization method fusing spatial features
CN120655737A