Intelligent regulation and management method and system for packaging and printing production line
By converting packaging printing image data into HSV format, calculating Euclidean distance and cluster centers, and dividing abnormal clusters and sub-clusters, the problem of low accuracy in manual inspection is solved, and accurate identification and efficient detection of printing quality are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN HUACHENG COLOR PRINTING PAPER PACKAGING CO LTD
- Filing Date
- 2026-05-15
- Publication Date
- 2026-07-10
AI Technical Summary
In the current packaging and printing process, printing quality inspection relies on manual sampling, which results in low inspection accuracy, poor real-time performance, difficulty in covering all products, and easy omissions or errors, thus affecting product quality.
The intelligent control and management method is adopted. By converting the packaging printing image data from RGB format to HSV format, the roughness of the pixels is calculated, the cluster center point is set and the Euclidean distance is calculated, abnormal clusters and sub-clusters are divided, the degree of abnormality and membership degree are calculated, it is determined whether the coverage area meets the threshold, and an alarm is issued.
It enables accurate identification and quantitative evaluation of printing quality, improves inspection efficiency, reduces rework costs, and enhances the intelligence level of the production line.
Smart Images

Figure CN122368031A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image data processing technology, and in particular to an intelligent control and management method and system for a packaging and printing production line. Background Technology
[0002] Currently, in the packaging and printing process, the methods for detecting printing quality mostly rely on simple analysis of manual sampling, lacking precise methods for detecting anomalies.
[0003] In one existing technology, printing quality is judged by manual inspection. However, this traditional method suffers from low accuracy, poor real-time performance, and susceptibility to subjective human factors. Especially at high production speeds, manual sampling cannot cover all products, easily leading to missed or incorrect inspections, thus affecting the overall product quality.
[0004] In summary, traditional packaging and printing quality inspection methods suffer from poor accuracy and low efficiency. Summary of the Invention
[0005] This invention provides an intelligent control and management method, system, electronic device, and storage medium for packaging and printing production lines, to achieve accurate identification and quantitative assessment of abnormal areas, and to solve the problems of insufficient accuracy and low efficiency of manual inspection.
[0006] Firstly, in order to solve the above-mentioned technical problems, the present invention provides an intelligent control and management method for a packaging and printing production line, comprising:
[0007] Acquire packaging printing image data, and use an RGB color lookup table to convert the packaging printing image data from RGB format to HSV format;
[0008] The roughness of each pixel is calculated based on the packaging printing image data in HSV format, and abnormal areas are initially screened based on the roughness.
[0009] Multiple cluster centers are set within the abnormal region, and the Euclidean distance between each pixel and the cluster centers is calculated as the first similarity. Based on the first similarity, each pixel is divided into different clusters.
[0010] The Euclidean distance between the cluster centers is calculated as the second similarity. When the second similarity is greater than a preset second similarity threshold, the cluster corresponding to the cluster center is determined to be an abnormal cluster.
[0011] The anomalous cluster is divided into multiple sub-clusters. The anomalousness and membership degree of each sub-cluster are calculated. The areas of each sub-cluster are weighted and summed according to the anomalousness and membership degree to obtain the coverage area of the entire anomalous cluster.
[0012] Verify whether the coverage area meets a preset threshold. If the coverage area is less than the preset area threshold, the current product is deemed to meet the requirements. If the coverage area of the abnormal cluster is greater than the preset threshold, the current product is deemed to be defective and an alarm is issued.
[0013] In one embodiment, the step of calculating the roughness of each pixel based on HSV format packaging printing image data, and preliminarily screening out abnormal regions based on the roughness, includes:
[0014] For each pixel, a surrounding local region is selected, and the average hue, average saturation, and average brightness of all pixels within that local region are calculated in the HSV space. HSV format packaging printing image data includes the hue, saturation, and brightness of each pixel, calculated as follows:
[0015] in, The average hue value. The average saturation value. The average brightness. For the hue of each pixel, For the saturation of each pixel, For the brightness of each pixel, The number of pixels in the local region;
[0016] The hue difference, saturation difference, and brightness difference between each pixel and the local region mean are calculated using the following methods:
[0017] in, For hue difference, Due to differences in saturation, Due to differences in brightness, For pixel hue, For pixel saturation, Pixel brightness;
[0018] The formula for calculating the roughness is:
[0019] in, For roughness;
[0020] When the roughness exceeds a preset roughness threshold, the local area is determined to be an abnormal area.
[0021] In one implementation, the step of calculating the Euclidean distance between each pixel and the cluster center as a first similarity, and dividing each pixel into different clusters based on the first similarity, includes:
[0022] For each pixel within the abnormal region, the Euclidean distance between the pixel and each cluster center is calculated as the first similarity. The first similarity is calculated as follows:
[0023] in, The first similarity score, For pixel hue, For pixel saturation, For pixel brightness, The hue of the cluster center point The saturation of cluster centers. The brightness of the cluster center point;
[0024] Based on the first similarity, the pixel is assigned to the cluster to which the nearest cluster center belongs.
[0025] In one implementation, calculating the Euclidean distance between the cluster centroids as a second similarity, and determining that the cluster corresponding to the cluster centroid is an abnormal cluster when the second similarity is greater than a preset second similarity threshold, includes:
[0026] The Euclidean distance between each cluster centroid and other cluster centroids is calculated as the second similarity. The second similarity is calculated as follows:
[0027] in, For the second similarity, For the hue of a cluster center point, For the saturation of a cluster center, For the brightness of a cluster center point, For the hue of another cluster center, For the saturation of another cluster center, The brightness of another cluster center point;
[0028] If the second similarity is greater than a preset second similarity threshold, the cluster corresponding to the cluster center point is determined to be an abnormal cluster.
[0029] In one implementation, dividing the abnormal cluster into multiple sub-clusters includes:
[0030] Calculate the degree of anomalousness for each pixel within the anomaly cluster; where,
[0031] The average brightness value of pixels within the abnormal cluster is used as the reference brightness information for the abnormal cluster. The average brightness value of the abnormal cluster is calculated as follows:
[0032] in, This represents the average brightness value of the abnormal clusters. The brightness value of the abnormal cluster pixel. This represents the number of pixels in the abnormal cluster.
[0033] The difference between the brightness value of each pixel and the average brightness value is calculated as the degree of abnormality of each pixel. The method for calculating the degree of abnormality of the pixel is as follows:
[0034] in, The degree of abnormality;
[0035] Within the abnormal cluster, draw a vertical line through the pixel with the highest degree of abnormality to divide the abnormal cluster into left and right regions.
[0036] Multiple second cluster centers are set in the left and right areas according to the preset number of second cluster centers;
[0037] Calculate the Euclidean distance between each pixel and each second cluster center point, and divide the left and right regions into multiple sub-clusters based on the Euclidean distance; wherein, when the Euclidean distance is less than the preset cluster radius, the pixels are divided into the same sub-cluster.
[0038] In one implementation, the step of calculating the anomaly degree and membership degree of each sub-cluster, and then weighting and summing the areas of each sub-cluster according to the anomaly degree and membership degree to obtain the coverage area of the entire anomaly cluster, includes:
[0039] Calculate the average anomaly level of all pixels in each sub-cluster as the sub-cluster anomaly level. The sub-cluster anomaly level is calculated as follows:
[0040] in, The degree of sub-cluster anomaly The number of pixels in the sub-cluster. The degree of pixel anomaly;
[0041] Calculate the membership degree of the subclusters, wherein the membership degree is calculated as follows:
[0042] in, For membership degree, The Euclidean distance between the subcluster center and the anomaly center is given by . The maximum Euclidean distance between the center of the sub-cluster and the anomaly center;
[0043] The coverage area of the entire anomalous cluster is obtained by summing the surfaces of each sub-cluster in a weighted manner. The coverage area is calculated as follows:
[0044] in, For coverage area, It represents the membership degree of each subcluster. It refers to the degree of anomaly in each sub-cluster. It is the area of each sub-cluster. It represents the total number of subclusters within the abnormal cluster.
[0045] In one implementation, the area of each sub-cluster is calculated as follows:
[0046] in, Represents the area of the sub-cluster. It is the number of pixels contained in the sub-cluster. It represents the actual physical area corresponding to each pixel.
[0047] Secondly, the present invention provides an intelligent control and management system for a packaging and printing production line, comprising:
[0048] The image conversion module is used to acquire packaging printing image data and convert the packaging printing image data from RGB format to HSV format using an RGB color lookup table;
[0049] The roughness analysis module is used to calculate the roughness of each pixel based on the packaging printing image data in HSV format, and to preliminarily screen out abnormal areas based on the roughness.
[0050] An abnormal region clustering module is used to set multiple cluster center points within the abnormal region, calculate the Euclidean distance between each pixel and the cluster center point as a first similarity, and divide each pixel into different clusters based on the first similarity.
[0051] An abnormal cluster identification module is used to calculate the Euclidean distance between the cluster centers as a second similarity. When the second similarity is greater than a preset second similarity threshold, the cluster corresponding to the cluster center is determined to be an abnormal cluster.
[0052] The sub-cluster division and area calculation module is used to divide the abnormal cluster into multiple sub-clusters, calculate the abnormality degree and membership degree of each sub-cluster, and weight and sum the areas of each sub-cluster according to the abnormality degree and membership degree to obtain the coverage area of the entire abnormal cluster.
[0053] The quality verification module is used to verify whether the coverage area meets a preset threshold. If the coverage area is less than the preset area threshold, the current product is determined to meet the requirements. If the coverage area of the abnormal cluster is greater than the preset threshold, the current product is determined to be defective and an alarm is issued.
[0054] Thirdly, the present invention also provides an electronic device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the intelligent control and management method for the packaging and printing production line described in any one of the above.
[0055] Fourthly, the present invention also provides a computer-readable storage medium comprising a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the intelligent control and management method for the packaging and printing production line described in any one of the above-mentioned methods.
[0056] Compared with the prior art, the present invention has the following beneficial effects:
[0057] This invention discloses an intelligent control and management method for a packaging and printing production line, comprising: acquiring packaging and printing image data; converting the packaging and printing image data from RGB format to HSV format; calculating the roughness of each pixel based on the HSV format packaging and printing image data; initially screening abnormal regions based on the roughness; setting multiple cluster centers within the abnormal regions and calculating the Euclidean distance between each pixel and the cluster centers as a first similarity; dividing each pixel into different clusters based on the first similarity; calculating the Euclidean distance between the cluster centers as a second similarity; when the second similarity is greater than a preset second similarity threshold, determining that the cluster corresponding to the cluster center is an abnormal cluster; dividing the abnormal cluster into multiple sub-clusters; calculating the abnormality degree and membership degree of each sub-cluster; weighted summing the areas of each sub-cluster based on the abnormality degree and membership degree to obtain the coverage area of the entire abnormal cluster; verifying whether the coverage area meets a preset threshold; if the coverage area is less than the preset area threshold, determining that the current product meets the requirements; if the coverage area of the abnormal cluster is greater than the preset threshold, determining that the current product is defective and issuing an alarm.
[0058] This invention accurately identifies abnormal areas and clusters by introducing joint analysis of color and roughness, and further subdivides these into sub-clusters for refined judgment. This method monitors packaging printing quality in real time and dynamically adjusts detection accuracy, solving the problems of reliance on manual inspection, poor accuracy, and low efficiency in traditional printing quality inspection. While ensuring stable product quality, it improves the intelligence level and inspection efficiency of the production line, and reduces rework costs caused by quality issues during production. Attached Figure Description
[0059] Figure 1 This is a schematic diagram of the intelligent control and management method for a packaging and printing production line provided in the first embodiment of the present invention;
[0060] Figure 2 This is a schematic diagram of the intelligent control and management system for a packaging and printing production line provided in the second embodiment of the present invention. Detailed Implementation
[0061] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0062] Reference Figure 1 The first embodiment of the present invention provides an intelligent control and management method for a packaging and printing production line, comprising the following steps:
[0063] S100, acquire packaging printing image data, and use an RGB color lookup table to convert the packaging printing image data from RGB format to HSV format;
[0064] S200: The roughness of each pixel is calculated based on the packaging printing image data in HSV format, and abnormal areas are initially screened based on the roughness.
[0065] S300, set multiple cluster center points in the abnormal area, and calculate the Euclidean distance between each pixel and the cluster center point as the first similarity, and divide each pixel into different clusters according to the first similarity;
[0066] S400, calculate the Euclidean distance between the cluster centers as the second similarity. When the second similarity is greater than a preset second similarity threshold, determine that the cluster corresponding to the cluster center is an abnormal cluster.
[0067] S500, the abnormal cluster is divided into multiple sub-clusters, the abnormality degree and membership degree of each sub-cluster are calculated, and the areas of each sub-cluster are weighted and summed according to the abnormality degree and membership degree to obtain the coverage area of the entire abnormal cluster.
[0068] S600, verify whether the coverage area meets the preset threshold. If the coverage area is less than the preset area threshold, proceed to step S700 to determine that the current product meets the requirements. If the coverage area of the abnormal cluster is greater than the preset threshold, proceed to step S800 to determine that the current product is defective and issue an alarm.
[0069] In step S100, printing image data of the product surface is first acquired in real time on the packaging printing production line using an industrial camera or other image acquisition device. The printing image data is stored in RGB format, where each pixel is composed of the values of the three color channels: red (R), green (G), and blue (B). Then, using a pre-built RGB color lookup table, each pixel is color-converted to obtain HSV format printing image data. The HSV format printing image data is more suitable for subsequent roughness analysis and anomaly detection. The HSV format printing image data allows for a more intuitive analysis of color and brightness changes in the packaging printing image, thereby providing data support for subsequent image processing steps. This conversion improves the system's accuracy in identifying abnormal areas.
[0070] In an optional implementation, the conversion of the packaging printing image data from RGB format to HSV format using an RGB color lookup table further includes dynamically generating a color lookup table based on different batches or different materials of the packaging printing products, including:
[0071] Each time the production line is started, a portion of sample data is collected, and the RGB to HSV conversion parameters are automatically adjusted based on these samples;
[0072] The lookup table is optimized by training historical image data with a machine learning model, making it more suitable for real-time production environments.
[0073] In step S200, the roughness of each pixel is calculated using HSV format image data to quantify its texture features, and potential abnormal areas are filtered out by setting a threshold. The roughness calculation is based on the differences between the pixel and its surrounding local area in the three channels of hue, saturation, and brightness. By filtering out pixels that exceed the roughness threshold, areas that may have defects in the packaging and printing products can be preliminarily identified, thus providing a basis for subsequent in-depth inspection.
[0074] In one optional implementation, the step of calculating the roughness of each pixel based on HSV format packaging printing image data, and preliminarily screening out abnormal areas based on the roughness, includes:
[0075] For each pixel, a surrounding local region is selected, and the average hue, average saturation, and average brightness of all pixels within that local region are calculated in the HSV space. HSV format packaging printing image data includes the hue, saturation, and brightness of each pixel, calculated as follows:
[0076] in, The average hue value. The average saturation value. The average brightness. For the hue of each pixel, For the saturation of each pixel, For the brightness of each pixel, The number of pixels in the local region; where,
[0077] Hue mean refers to the average hue of all pixels within a local area, reflecting the dominant color of that area. By calculating the hue mean, the overall tone of the area can be determined, helping to identify color consistency or deviation. In printed materials, if the hue of a certain area is inconsistent with the overall color, it indicates a color difference or printing defect.
[0078] The saturation mean represents the average saturation of pixels within a local area, describing the color purity of that region. Areas with high saturation are vibrant, while areas with low saturation are closer to gray. Analyzing changes in the saturation mean can help determine whether the colors in a printed pattern are uniform and identify problems such as fading or oversaturation.
[0079] The average brightness is the average brightness of pixels within a local area, representing the overall brightness of that area. By analyzing the average brightness, it is possible to detect uneven gloss or shadows on the surface of printed materials.
[0080] The hue of a pixel represents its hue value in the HSV color space, reflecting the pixel's specific color attribute. By comparing the hue of a single pixel with the local hue average, we can measure whether the pixel's color deviates from the dominant hue of the area, thus identifying local anomalies.
[0081] Pixel saturation represents the saturation value of each pixel in the HSV color space, reflecting the color purity or vividness of that pixel. By comparing the saturation of a single pixel with the local saturation average, it is possible to identify whether there are variations in color purity within a region.
[0082] Pixel brightness refers to the luminance value of each pixel in the HSV color space, used to describe its lightness or darkness. Analyzing the difference between the brightness of an individual pixel and the average brightness of the local area can help identify problems such as excessively bright or dark areas on the printed surface, like light spots or shadows. These brightness anomalies are caused by printing equipment malfunctions or uneven ink distribution.
[0083] The number of pixels in a local region refers to the total number of pixels contained within the selected local window when calculating the mean values of hue, saturation, and brightness. The number of pixels directly affects the smoothness of the mean calculation and the sensitivity of anomaly detection. A larger number of pixels can reduce noise interference, but it will also reduce the ability to detect subtle anomalies.
[0084] The hue difference, saturation difference, and brightness difference between each pixel and the local region mean are calculated using the following methods:
[0085] in, For hue difference, Due to differences in saturation, Due to differences in brightness, For pixel hue, For pixel saturation, Pixel brightness; where,
[0086] Hue difference is the difference between the hue value of a pixel and the average hue value of a local area. It is used to quantify the degree to which the pixel's color deviates from the dominant hue of the area. The greater the hue difference, the more inconsistent the pixel's color is with its surroundings, reflecting color differences or uneven ink distribution in the printed material.
[0087] Saturation difference refers to the difference between the saturation value of a single pixel and the average saturation value of a local area, used to measure the fluctuation of color purity. A saturation difference greater than a preset saturation threshold indicates uneven color transition within the area, such as fading or local color anomalies.
[0088] Brightness difference is the difference between the brightness value of a pixel and the average brightness value of the local area, reflecting the deviation in brightness of that pixel relative to the local environment. A brightness difference greater than a preset brightness threshold indicates uneven reflection on the printed surface or changes in lighting conditions, requiring further inspection.
[0089] The formula for calculating the roughness is:
[0090] in, For roughness;
[0091] Roughness is a weighted sum of hue, saturation, and brightness differences, used to quantify the degree of abnormality of each pixel in its local environment. By setting a roughness threshold, problematic areas can be effectively screened out, providing clues for subsequent defect detection.
[0092] When the roughness exceeds a preset roughness threshold, the local area is determined to be an abnormal area.
[0093] In step S300, multiple cluster centers are set, and the Euclidean distance between each pixel and these centers is calculated to determine its similarity to each center. Then, based on the minimum distance principle, each pixel is assigned to a corresponding cluster, forming several clusters with similar characteristics. This method can further refine the initially screened abnormal regions, helping to identify different types of abnormal features within the region, and providing a more accurate basis for subsequent defect analysis and quality assessment.
[0094] In one optional implementation, the step of calculating the Euclidean distance between each pixel and the cluster center as a first similarity, and dividing each pixel into different clusters based on the first similarity, includes:
[0095] For each pixel within the abnormal region, the Euclidean distance between the pixel and each cluster center is calculated as the first similarity. The first similarity is calculated as follows:
[0096] in, The first similarity score, For pixel hue, For pixel saturation, For pixel brightness, The hue of the cluster center point The saturation of cluster centers. The brightness of the cluster center point; where,
[0097] The first similarity score quantifies the degree of difference in color features between a pixel and a cluster center. A smaller first similarity score indicates a closer similarity in color features between the pixel and the cluster center, thus placing them in the same cluster. By calculating the first similarity score for each pixel, pixels within anomaly regions can be effectively clustered, refining the classification of different anomaly types.
[0098] Based on the first similarity, each pixel is assigned to the cluster of its nearest cluster center. This process ensures that each pixel is appropriately classified into the cluster that best matches its color characteristics, according to its similarity to the cluster center in the HSV color space. In this way, pixels within abnormal regions can be grouped by features.
[0099] Preferably, this allocation method is adaptive, capable of progressively optimizing cluster division even in the presence of complex color and brightness variations within anomalous regions by iteratively updating cluster center points. Ultimately, the center point of each cluster gradually approaches the feature mean of all pixels within that cluster, thereby achieving efficient clustering of anomalous regions. This allocation mechanism lays a solid foundation for subsequent defect analysis; for example, the degree of anomalousness or coverage area of each cluster can be further calculated to more accurately identify different types of printing defects.
[0100] In step S400, the similarity between clusters is measured by calculating the Euclidean distance between cluster centroids, and this distance is used as a second similarity. Based on whether the second similarity value exceeds a preset threshold, it can be determined whether certain clusters deviate from the characteristics of other clusters, thus marking these clusters as anomalous clusters. Anomalous clusters represent areas in the printed material with obvious defects, such as color deviation, abnormal gloss, or uneven saturation. This step further refines the analysis of anomalous areas, helping to more accurately identify and locate printing quality problems.
[0101] In one optional implementation, calculating the Euclidean distance between the cluster centroids as a second similarity, and determining that the cluster corresponding to the cluster centroid is an abnormal cluster when the second similarity is greater than a preset second similarity threshold, includes:
[0102] The Euclidean distance between each cluster centroid and other cluster centroids is calculated as the second similarity. The second similarity is calculated as follows:
[0103] in, For the second similarity, For the hue of a cluster center point, For the saturation of a cluster center, For the brightness of a cluster center point, For the hue of another cluster center, For the saturation of another cluster center, For the brightness of another cluster center point; where,
[0104] Second similarity is an important metric for measuring the similarity between two cluster centroids, representing the degree of difference between them in the HSV color space. A second similarity value exceeding a preset threshold indicates that the clusters represented by the two centroids differ in color and brightness characteristics, corresponding to different types of abnormal regions or printing defects.
[0105] The hue of a cluster centroid refers to its dominant color tone in the HSV color space, reflecting the color attribute of pixels within that cluster. By calculating the hue differences between cluster centroids, we can determine the variations in color characteristics across different clusters.
[0106] The saturation of a cluster centroid is an indicator of the color purity of that centroid in the HSV color space, representing the vividness of the color within that cluster. Changes in saturation can reflect differences in color purity among different clusters, helping to detect fading or oversaturation in printed areas.
[0107] The brightness of a cluster center point is an indicator used to represent the overall brightness of that cluster center point in the HSV color space, describing the illumination or reflection characteristics of pixels within that cluster. Brightness differences can be used to identify areas of uneven illumination or abnormal reflection in printed materials.
[0108] The hue of another cluster center is the dominant hue of that center in the HSV color space. Compared with the hue of the previous cluster center, the similarity or difference in hue features between the two clusters can be determined.
[0109] The saturation of another cluster center point refers to the color purity of that center point in the HSV color space, which is used to analyze the difference in color vividness between it and the previous cluster center point.
[0110] The brightness of the other cluster center point represents the lightness or darkness of that center point in the HSV color space. By comparing the brightness of the two cluster center points, we can identify the differences in their light and dark distribution, thereby helping to locate abnormal areas.
[0111] If the second similarity is greater than a preset second similarity threshold, the cluster corresponding to the cluster center point is determined to be an abnormal cluster. This indicates that the cluster differs from other clusters in color and brightness characteristics, reflecting an anomaly in the printed material.
[0112] The appearance of abnormal clusters indicates a problem in that area during the printing process, such as color difference, uneven brightness, or abnormal saturation. Color difference is caused by uneven ink distribution or equipment calibration errors; uneven brightness reflects problems with lighting conditions or the surface gloss of the printing material; abnormal saturation means that the color in some areas is too bright or faded.
[0113] By identifying anomalous clusters, the initially screened anomalous areas can be further subdivided into different anomalous types. Each anomalous cluster represents a potential defective area, providing an important basis for subsequent quality control and production line adjustments.
[0114] Preferably, if the hue of an abnormal cluster has a second similarity to other clusters greater than twice the preset second similarity threshold, then the area can be examined for printing errors or color matching problems.
[0115] This second similarity-based determination method effectively improves the accuracy of identifying abnormal regions. By comparing with a preset threshold, it can quickly filter out potential defective regions that need attention.
[0116] In step S500, the abnormal cluster is divided into multiple sub-clusters, and the degree of abnormality and membership of each sub-cluster are calculated to ultimately determine the coverage area of the entire abnormal cluster. First, pixels within the abnormal cluster are divided into multiple sub-clusters based on their features, each sub-cluster representing subtle changes in different properties within the abnormal region. Next, the degree of abnormality is calculated for each sub-cluster to quantify its deviation from normal features. Simultaneously, the membership of the sub-cluster is calculated, representing the degree of association between the sub-cluster and the core region of the abnormal cluster. By comprehensively considering the area, degree of abnormality, and membership of the sub-clusters, the coverage area of the entire abnormal cluster is calculated using a weighted summation method. This coverage area can intuitively reflect the actual extent of the abnormal region on the printed material, providing accurate data support for quality assessment and subsequent production adjustments. This process ensures the comprehensiveness and accuracy of abnormal region analysis, making the location and resolution of printing quality problems more efficient.
[0117] In one optional implementation, dividing the abnormal cluster into multiple sub-clusters includes:
[0118] Calculate the degree of anomalousness of each pixel within the anomalous cluster, including:
[0119] The average brightness value of pixels within the abnormal cluster is used as the reference brightness information for the abnormal cluster. The average brightness value of the abnormal cluster is calculated as follows:
[0120] in, This represents the average brightness value of the abnormal clusters. The brightness value of the abnormal cluster pixel. This represents the number of abnormal cluster pixels; where,
[0121] The average brightness value of an anomaly cluster is an important indicator for measuring the overall brightness level of all pixels within the cluster, reflecting the overall illumination or reflection characteristics of that cluster area. By calculating the average brightness value of all pixels within the anomaly cluster, brightness reference information for that area can be determined, providing a benchmark for subsequent anomaly detection and analysis.
[0122] The brightness value of an abnormal cluster pixel represents the specific value of each pixel in the brightness channel within the abnormal cluster. This value directly reflects the brightness of a single pixel. In printing inspection, brightness abnormalities are related to uneven gloss, shadows, or reflections on the surface of printed materials.
[0123] The number of outlier cluster pixels refers to the total number of pixels that make up an outlier cluster. This parameter is used as the denominator when calculating the average brightness, ensuring that the contribution of each pixel within the outlier cluster to the average brightness is considered fairly. The size of the number of outlier cluster pixels directly affects the calculation result of the average brightness value; a larger value can better smooth local brightness fluctuations and ensure the stability and representativeness of the average value.
[0124] The difference between the brightness value of each pixel and the average brightness value is calculated as the degree of abnormality of each pixel. The method for calculating the degree of abnormality of the pixel is as follows:
[0125] in, The degree of abnormality;
[0126] Anomaly level is a key indicator used to quantify the degree to which the brightness level of each pixel deviates from the overall brightness level of the anomaly cluster, reflecting the difference between the pixel's brightness characteristics and the average brightness. The anomaly level of each pixel can be obtained by calculating the absolute difference between the brightness value of a single pixel and the average brightness value of the anomaly cluster, and then normalizing this difference to the total number of pixels in the anomaly cluster.
[0127] Within an anomaly cluster, by calculating the anomaly degree of all pixels, the pixel with the highest anomaly degree can be identified and considered the most significant anomalous feature within the cluster. Using this pixel as a reference, a vertical line perpendicular to the image's horizontal axis is drawn, dividing the anomaly cluster into left and right sub-regions. This division method helps isolate sub-regions with different features within the anomaly region, facilitating subsequent analysis and processing.
[0128] Within the anomalous cluster, a vertical line is drawn through the pixel with the highest anomalous degree, dividing the cluster into left and right sub-regions. Within each sub-region, multiple cluster centers are evenly distributed according to a preset number of second cluster centers. Cluster centers are abstract representations of the pixel features within that region; the preset number is determined by the complexity of the anomalous region and the required analysis precision. The setting of these centers ensures comprehensive coverage of the features of all pixels within the sub-regions.
[0129] Next, the Euclidean distance between each pixel and all cluster centers within its sub-region is calculated. Euclidean distance is a crucial metric for measuring the difference between a pixel and its cluster centers in the HSV color space, calculated based on differences in hue, saturation, and brightness. This calculation quantifies the similarity between each pixel and its cluster centers.
[0130] Based on the Euclidean distance calculation, each pixel is assigned to the sub-cluster belonging to the cluster center with the smallest distance. This step ensures that pixels with similar color and brightness characteristics are grouped into the same sub-cluster, thereby enhancing the consistency of features within the sub-cluster.
[0131] The cluster radius refers to the maximum allowable distance between a pixel and the cluster center. When the Euclidean distance between a pixel and the cluster center is less than the cluster radius, the pixel is included in the sub-cluster corresponding to that cluster center. This constraint prevents pixels with significantly different features from being mistakenly assigned to the same sub-cluster, thereby improving the accuracy and robustness of clustering.
[0132] This partitioning method, based on anomaly severity, Euclidean distance, and cluster radius, allows for further refinement and decomposition of features within anomaly clusters. Each sub-cluster represents a specific anomalous feature within the anomaly region, providing precise data support for subsequent anomaly severity analysis, coverage area calculation, and determination of printing defect types. This method lays a solid technical foundation for improving the efficiency and accuracy of printed material quality control.
[0133] In one optional implementation, the step of calculating the anomaly degree and membership degree of each sub-cluster, and then weighting and summing the areas of each sub-cluster according to the anomaly degree and membership degree to obtain the coverage area of the entire anomaly cluster, includes:
[0134] Calculate the average anomaly level of all pixels in each sub-cluster as the sub-cluster anomaly level. The sub-cluster anomaly level is calculated as follows:
[0135] in, The degree of sub-cluster anomaly The number of pixels in the sub-cluster. The degree of pixel anomaly;
[0136] Subcluster anomaly level is an important indicator for measuring the overall anomalous features of all pixels within a subcluster, reflecting the degree of deviation between that subcluster region and normal features. By calculating the average anomaly level of all pixels within a subcluster, the overall anomaly level of the subcluster can be quantified, providing a basis for subsequent anomaly analysis.
[0137] The number of pixels in a sub-cluster refers to the total number of pixels contained within that sub-cluster. It is used as the denominator when calculating the anomaly level of a sub-cluster, ensuring that the anomaly level of each pixel is fairly weighed in the calculation. The size of the number of pixels in a sub-cluster directly affects the calculation result of the sub-cluster anomaly level. A larger number of pixels smooths out random fluctuations, thus more accurately reflecting the overall anomaly characteristics of the sub-cluster.
[0138] Pixel anomaly level is a quantified value of the difference between each pixel and the average feature within the cluster. It measures the degree to which a pixel deviates from the overall standard in terms of brightness, hue, or saturation. A pixel anomaly level higher than a preset anomaly level threshold indicates that the pixel is abnormal, such as excessive brightness or color deviation. These anomalies indicate printing defects or other quality problems.
[0139] The overall anomaly level of a sub-cluster can be obtained by calculating the average anomaly level of all pixels within the sub-cluster. This average reflects the concentration of pixel anomalies within the sub-cluster, providing important data support for subsequent evaluation of the overall coverage area and feature contribution of the anomaly cluster. The higher the anomaly level of a sub-cluster, the more significant the feature deviation of that sub-cluster within the anomaly cluster.
[0140] Calculate the membership degree of the subclusters, wherein the membership degree is calculated as follows:
[0141] in, For membership degree, The Euclidean distance between the subcluster center and the anomaly center is given by . The maximum Euclidean distance between the center of the sub-cluster and the anomaly center;
[0142] Membership degree is an indicator used to quantify the degree of association between a subcluster and the core region of the anomalous cluster, reflecting the importance and contribution of each subcluster to the anomalous cluster. The closer the membership degree is to 1, the stronger the connection between the subcluster and the core region of the anomalous cluster; the closer the membership degree is to 0, the farther the subcluster is from the core region of the anomalous cluster, and the smaller its influence on the overall anomalous cluster.
[0143] The Euclidean distance between the subcluster center and the anomaly center is an important parameter for measuring the spatial distribution differences between the core regions of the subcluster and the anomaly cluster. The smaller the Euclidean distance, the closer the characteristics of the subcluster are to those of the core region of the anomaly cluster, indicating that it is an important component of the anomaly cluster.
[0144] The maximum Euclidean distance is the maximum distance between the centroids of all subclusters within an anomaly cluster and the anomaly centroid. It is used to normalize the distances between each subcluster and the anomaly centroid. The introduction of the maximum Euclidean distance ensures that membership calculation has a unified reference standard across anomaly clusters of different sizes and distribution characteristics.
[0145] The membership degree calculation method compares the distance between the sub-cluster and the core region of the anomaly with the maximum distance, thereby determining the importance ratio of the sub-cluster within the anomaly cluster. The membership degree value is not only used for subsequent weighted accumulation of sub-cluster areas, but also plays a key role in calculating the coverage area of the anomaly cluster, providing a scientific basis for the quantification of anomaly characteristics.
[0146] The coverage area of the entire anomalous cluster is obtained by summing the surfaces of each sub-cluster in a weighted manner. The coverage area is calculated as follows:
[0147] in, For coverage area, It represents the membership degree of each subcluster. It refers to the degree of anomaly in each sub-cluster. It is the area of each sub-cluster. It represents the total number of subclusters within the abnormal cluster.
[0148] The coverage area of anomaly clusters is an important indicator for measuring the spatial extent of the entire anomaly cluster in an image. By integrating the feature contributions of sub-clusters, it provides a quantitative description of the overall influence of the anomaly cluster. This coverage area is calculated using a weighted summation method, combining the membership degree, anomaly degree, and actual area of each sub-cluster, thus comprehensively reflecting the relative importance and spatial distribution of each sub-cluster within the anomaly cluster.
[0149] The subcluster area refers to the actual spatial extent of each subcluster in the image, reflecting the number and distribution of anomalous pixels contained within that subcluster. A larger area indicates a wider anomalous region covered by the subcluster, and a more significant impact on the overall spatial distribution of the anomalous cluster.
[0150] The total number of subclusters within an anomalous cluster refers to the total number of subclusters within the anomalous cluster, determining the number of subclusters that need to be included in the calculation. This parameter ensures that all subclusters are fully considered when calculating the coverage area.
[0151] By multiplying the membership degree, anomaly degree, and area of each subcluster, and then summing the weighted surface areas of all subclusters, the final coverage area of the anomaly cluster can be obtained. This weighted summation method can fully reflect the relative importance of different subclusters in the anomaly cluster, thus providing a reliable basis for the accurate assessment and quantification of the overall characteristics of the anomaly cluster.
[0152] In one optional implementation, the area of each sub-cluster is calculated as follows:
[0153] in, Represents the area of the sub-cluster. It is the number of pixels contained in the sub-cluster. It represents the actual physical area corresponding to each pixel.
[0154] Subcluster area is a parameter used to describe the spatial extent of a subcluster in an actual printed material or image, reflecting the degree to which the subcluster's abnormal features are covered. By calculating the subcluster area, the size of the abnormal area can be intuitively understood, providing an important basis for quality control and defect analysis.
[0155] The number of pixels contained in a subcluster refers to the total number of pixels that make up the subcluster. These pixels are grouped into the same subcluster based on their characteristics using a clustering algorithm, representing discrete units of the anomalous region contained in that subcluster. The more pixels there are, the larger the area of the subcluster, indicating that the subcluster covers a wider range of anomalous regions.
[0156] The actual physical area corresponding to each pixel refers to the size of a single pixel in the actual physical space of an image. This parameter depends on the mapping relationship between image resolution and actual physical size. For example, in printed materials, the higher the image resolution, the smaller the physical area of each pixel.
[0157] The total physical area of a sub-cluster can be calculated by multiplying the number of pixels in the sub-cluster by the actual physical area of each pixel. This area value reflects the extent of the sub-cluster in the actual printed material or physical space, providing a spatial scale basis for the quantitative analysis of anomalous features.
[0158] In step S600, the impact of the abnormal area on product quality is assessed by verifying whether the coverage area of the abnormal cluster reaches a preset threshold. If the coverage area is less than the preset area threshold, step S700 is executed to determine that the current product meets the requirements. If the coverage area of the abnormal cluster is greater than the preset threshold, step S800 is executed to determine that the current product is defective and an alarm is issued.
[0159] In step S700, the system records the current product's inspection results, including the location, characteristics, and area of abnormal clusters, to optimize the process flow in subsequent analysis. Simultaneously, the system confirms that the product meets factory standards, allowing it to proceed to the next production or packaging stage. This step ensures improved production efficiency and avoids unnecessary downtime and rework without affecting overall product quality.
[0160] In step S800, the system will immediately issue an alarm upon determining that a product is defective, prompting operators to inspect the production line or equipment. This alarm mechanism can trigger various subsequent operations, such as suspending production, recalibrating equipment, or adjusting process parameters, to prevent more defective products from being produced. Simultaneously, the system will store information about defective products in the quality control database, providing data support for subsequent defect analysis and production improvement. This step not only enables timely detection and handling of quality problems but also lays the foundation for continuous optimization of the production process through data accumulation.
[0161] To facilitate understanding of the present invention, some preferred embodiments of the present invention will be described in further detail below.
[0162] In one implementation, the intelligent control and management method for packaging and printing production lines of the present invention divides pixels into different sub-clusters by setting multiple cluster centers within abnormal clusters and calculating the Euclidean distance between each pixel and the cluster center. This method is suitable for scenarios with complex distribution of abnormal areas, such as printed products with multiple types of defects coexisting. Through refined cluster analysis, the system can accurately identify the abnormal characteristics of each sub-cluster and calculate the coverage area of the overall abnormal cluster based on the degree of abnormality and membership of the sub-clusters. When defects are concentrated in certain areas, this method can automatically improve detection sensitivity, effectively separate different abnormal types, and provide accurate data support for the optimization of subsequent quality control strategies.
[0163] In summary, this invention provides an intelligent control and management method for packaging and printing production lines. By acquiring packaging and printing image data, converting the image data from RGB to HSV format, clustering pixels into clusters by setting cluster centers in abnormal areas, determining abnormal clusters based on a second similarity, calculating the coverage area of abnormal clusters, and finally verifying whether the coverage area meets a preset threshold, this method achieves accurate detection of printing quality and optimized control of the production line. This method solves the problems of low efficiency and low accuracy in traditional manual inspection, enabling the system to achieve efficient and accurate quality monitoring in complex and ever-changing production environments. Compared with existing technologies, this invention not only improves the detection accuracy of abnormal areas but also optimizes the response speed and adaptability of the production line, making it particularly suitable for packaging production scenarios with high printing quality requirements. Through intelligent image analysis and clustering algorithms, this invention provides a reliable guarantee for improving product quality and production efficiency.
[0164] Reference Figure 2 The second embodiment of the present invention provides an intelligent control and management device for a packaging and printing production line, comprising:
[0165] The image conversion module is used to acquire packaging printing image data and convert the packaging printing image data from RGB format to HSV format using an RGB color lookup table;
[0166] The roughness analysis module is used to calculate the roughness of each pixel based on the packaging printing image data in HSV format, and to preliminarily screen out abnormal areas based on the roughness.
[0167] An abnormal region clustering module is used to set multiple cluster center points within the abnormal region, calculate the Euclidean distance between each pixel and the cluster center point as a first similarity, and divide each pixel into different clusters based on the first similarity.
[0168] An abnormal cluster identification module is used to calculate the Euclidean distance between the cluster centers as a second similarity. When the second similarity is greater than a preset second similarity threshold, the cluster corresponding to the cluster center is determined to be an abnormal cluster.
[0169] The sub-cluster division and area calculation module is used to divide the abnormal cluster into multiple sub-clusters, calculate the abnormality degree and membership degree of each sub-cluster, and weight and sum the areas of each sub-cluster according to the abnormality degree and membership degree to obtain the coverage area of the entire abnormal cluster.
[0170] The quality verification module is used to verify whether the coverage area meets a preset threshold. If the coverage area is less than the preset area threshold, the current product is determined to meet the requirements. If the coverage area of the abnormal cluster is greater than the preset threshold, the current product is determined to be defective and an alarm is issued.
[0171] It should be noted that the intelligent control and management device for a packaging and printing production line provided in this embodiment of the invention is used to execute all the process steps of the intelligent control and management method for a packaging and printing production line in the above embodiment. The working principles and beneficial effects of the two are one-to-one, so they will not be described again.
[0172] This invention also provides an electronic device. The electronic device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, such as an intelligent control and management program for a packaging and printing production line. When the processor executes the computer program, it implements the steps described in the various embodiments of the intelligent control and management method for packaging and printing production lines, for example... Figure 1 The step S100 is shown. Alternatively, when the processor executes the computer program, it implements the functions of each module / unit in the above-described device embodiments, such as the image conversion module.
[0173] For example, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the electronic device.
[0174] The electronic device may be a desktop computer, laptop, handheld computer, or smart tablet, etc. The electronic device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that the above components are merely examples of electronic devices and do not constitute a limitation on the electronic device. It may include more or fewer components than described above, or combine certain components, or different components. For example, the electronic device may also include input / output devices, network access devices, buses, etc.
[0175] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the electronic device, connecting all parts of the electronic device via various interfaces and lines.
[0176] The memory can be used to store the computer programs and / or modules. The processor implements various functions of the electronic device by running or executing the computer programs and / or modules stored in the memory and by calling data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0177] Wherein, if the modules / units integrated in the electronic device are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.
[0178] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.
[0179] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.
Claims
1. A method for intelligent control and management of a packaging and printing production line, characterized in that, Executed by a computer, including: Acquire packaging printing image data, and use an RGB color lookup table to convert the packaging printing image data from RGB format to HSV format; The roughness of each pixel is calculated based on the packaging printing image data in HSV format, and abnormal areas are initially screened based on the roughness. Multiple cluster centers are set within the abnormal region, and the Euclidean distance between each pixel and the cluster centers is calculated as the first similarity. Based on the first similarity, each pixel is divided into different clusters. The Euclidean distance between the cluster centers is calculated as the second similarity. When the second similarity is greater than a preset second similarity threshold, the cluster corresponding to the cluster center is determined to be an abnormal cluster. The anomalous cluster is divided into multiple sub-clusters. The anomalousness and membership degree of each sub-cluster are calculated. The areas of each sub-cluster are weighted and summed according to the anomalousness and membership degree to obtain the coverage area of the entire anomalous cluster. Verify whether the coverage area meets a preset threshold. If the coverage area is less than the preset area threshold, the current product is deemed to meet the requirements. If the coverage area of the abnormal cluster is greater than the preset threshold, the current product is deemed to be defective and an alarm is issued.
2. The intelligent control and management method for a packaging and printing production line according to claim 1, characterized in that, The roughness of each pixel is calculated based on the packaging printing image data in HSV format, and abnormal areas are initially screened based on the roughness, including: For each pixel, a surrounding local region is selected, and the average hue, average saturation, and average brightness of all pixels within that local region are calculated in the HSV space. HSV format packaging printing image data includes the hue, saturation, and brightness of each pixel, calculated as follows: in, The average hue value. The average saturation value. The average brightness. For the hue of each pixel, For the saturation of each pixel, For the brightness of each pixel, The number of pixels in the local region; The hue difference, saturation difference, and brightness difference between each pixel and the local region mean are calculated using the following methods: in, For hue difference, Due to differences in saturation, Due to differences in brightness, For pixel hue, For pixel saturation, Pixel brightness; The formula for calculating the roughness is: in, For roughness; When the roughness exceeds a preset roughness threshold, the local area is determined to be an abnormal area.
3. The intelligent control and management method for a packaging and printing production line according to claim 1, characterized in that, The Euclidean distance between each pixel and the cluster center is calculated as the first similarity. Based on the first similarity, each pixel is divided into different clusters, including: For each pixel within the abnormal region, the Euclidean distance between the pixel and each cluster center is calculated as the first similarity. The first similarity is calculated as follows: in, The first similarity score, For pixel hue, For pixel saturation, For pixel brightness, The hue of the cluster center point The saturation of cluster centers. The brightness of the cluster center point; Based on the first similarity, the pixel is assigned to the cluster to which the nearest cluster center belongs.
4. The intelligent control and management method for a packaging and printing production line according to claim 1, characterized in that, The calculation of the Euclidean distance between the cluster centroids as a second similarity, and the determination that the cluster corresponding to the cluster centroid is an abnormal cluster when the second similarity is greater than a preset second similarity threshold, includes: The Euclidean distance between each cluster centroid and other cluster centroids is calculated as the second similarity. The second similarity is calculated as follows: in, For the second similarity, For the hue of a cluster center point, For the saturation of a cluster center, For the brightness of a cluster center point, For the hue of another cluster center, For the saturation of another cluster center, The brightness of another cluster center point; If the second similarity is greater than a preset second similarity threshold, the cluster corresponding to the cluster center point is determined to be an abnormal cluster.
5. The intelligent control and management method for a packaging and printing production line according to claim 1, characterized in that, The step of dividing the abnormal cluster into multiple sub-clusters includes: Calculate the degree of anomalousness for each pixel within the anomalous cluster; where, The average brightness value of pixels within the abnormal cluster is used as the reference brightness information for the abnormal cluster. The average brightness value of the abnormal cluster is calculated as follows: in, This represents the average brightness value of the abnormal clusters. The brightness value of the abnormal cluster pixel. This represents the number of pixels in the abnormal cluster. The difference between the brightness value of each pixel and the average brightness value is calculated as the degree of abnormality of each pixel. The method for calculating the degree of abnormality of the pixel is as follows: in, To indicate the degree of abnormality, This represents the average brightness value of the abnormal clusters. Within the abnormal cluster, draw a vertical line through the pixel with the highest degree of abnormality to divide the abnormal cluster into left and right regions. Multiple second cluster centers are set in the left and right areas according to the preset number of second cluster centers; Calculate the Euclidean distance between each pixel and each second cluster center point, and divide the left and right regions into multiple sub-clusters based on the Euclidean distance; wherein, when the Euclidean distance is less than the preset cluster radius, the pixels are divided into the same sub-cluster.
6. The intelligent control and management method for a packaging and printing production line according to claim 5, characterized in that, The calculation of the anomaly degree and membership degree of each sub-cluster, followed by a weighted summation of the areas of each sub-cluster based on the anomaly degree and membership degree to obtain the coverage area of the entire anomaly cluster, includes: Calculate the average anomaly level of all pixels in each sub-cluster as the sub-cluster anomaly level. The sub-cluster anomaly level is calculated as follows: in, The degree of sub-cluster anomaly The number of pixels in the sub-cluster. The degree of pixel anomaly; Calculate the membership degree of the subclusters, wherein the membership degree is calculated as follows: in, For membership degree, The Euclidean distance between the subcluster center and the anomaly center is given by . The maximum Euclidean distance between the center of the sub-cluster and the anomaly center; The coverage area of the entire anomalous cluster is obtained by summing the surfaces of each sub-cluster in a weighted manner. The coverage area is calculated as follows: in, For coverage area, It represents the membership degree of each subcluster. It refers to the degree of anomaly in each sub-cluster. It is the area of each sub-cluster. It represents the total number of subclusters within the abnormal cluster.
7. The intelligent control and management method for a packaging and printing production line according to claim 6, characterized in that, The area of each sub-cluster is calculated as follows: in, Represents the area of the sub-cluster. It is the number of pixels contained in the sub-cluster. It represents the actual physical area corresponding to each pixel.
8. An intelligent control and management system for a packaging and printing production line, characterized in that, include: The image conversion module is used to acquire packaging printing image data and convert the packaging printing image data from RGB format to HSV format using an RGB color lookup table; The roughness analysis module is used to calculate the roughness of each pixel based on the packaging printing image data in HSV format, and to preliminarily screen out abnormal areas based on the roughness. An abnormal region clustering module is used to set multiple cluster center points within the abnormal region, calculate the Euclidean distance between each pixel and the cluster center point as a first similarity, and divide each pixel into different clusters based on the first similarity. An abnormal cluster identification module is used to calculate the Euclidean distance between the cluster centers as a second similarity. When the second similarity is greater than a preset second similarity threshold, the cluster corresponding to the cluster center is determined to be an abnormal cluster. The sub-cluster division and area calculation module is used to divide the abnormal cluster into multiple sub-clusters, calculate the abnormality degree and membership degree of each sub-cluster, and weight and sum the areas of each sub-cluster according to the abnormality degree and membership degree to obtain the coverage area of the entire abnormal cluster. The quality verification module is used to verify whether the coverage area meets a preset threshold. If the coverage area is less than the preset area threshold, the current product is determined to meet the requirements. If the coverage area of the abnormal cluster is greater than the preset threshold, the current product is determined to be defective and an alarm is issued.
9. An electronic device, characterized in that, The system includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the intelligent control and management method for a packaging and printing production line as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device on which the computer-readable storage medium is located to perform the intelligent control and management method for the packaging and printing production line as described in any one of claims 1 to 7.