Bag body glue brushing area integrity detection method and system based on image processing

By denoising and contrast enhancement of the bag surface image, segmenting the glue-applied area, and extracting features through Gaussian pyramid decomposition, the problem of difficulty in balancing detection efficiency and accuracy in existing technologies is solved, achieving high-precision detection of the glue-applied area on the bag.

CN121661450AInactive Publication Date: 2026-03-13YIXING WELLKNIT CONTAINER-BAG CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-03
Publication Date
2026-03-13
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing technologies for detecting glued areas on bags suffer from a trade-off between efficiency and accuracy. In particular, when faced with diverse backgrounds, they struggle to effectively filter out background interference signals, resulting in insufficient precision in the segmentation of the glued area and failing to meet the high-precision requirements of industrial production.

Method used

By denoising and enhancing the contrast of the bag surface image, the glue-applied area is segmented, and Gaussian pyramid decomposition is performed to extract multi-scale texture and shape features. The threshold is dynamically adjusted in combination with historical data to achieve accurate identification of the glue-applied area.

Benefits of technology

It significantly improves the accuracy and stability of the test results, can adapt to diverse bag background scenarios, and meets the high-precision requirements of industrial production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121661450A_ABST
    Figure CN121661450A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, and discloses a bag body glue brushing area integrity detection method and system based on image processing, and the method comprises the steps: carrying out the noise reduction of a surface image, carrying out the contrast enhancement of the denoised surface image, and obtaining an original image; segmenting a glue brushing area of the bag body from the original image to obtain an area mask; performing Gaussian gold decomposition on the region mask to obtain a multi-scale image set of the bag body, and extracting texture features and shape features of the region mask from the multi-scale image set; fusing the texture features and the shape features into fused feature data; according to the historical data, the gluing integrity threshold value of the bag body under different bag body backgrounds is determined; according to the fusion feature data, judging probability distribution of completeness of a glue brushing area in the bag body, and according to a comparison result of a glue completeness threshold value and the probability distribution, outputting a glue brushing detection result of the bag body; according to the invention, the integrity detection accuracy of the gluing area of the bag body can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method and system for detecting the integrity of the glued area on a bag based on image processing. Background Technology

[0002] In the field of integrity inspection of adhesive-coated areas on bags, traditional inspection methods generally suffer from the problem of balancing efficiency and accuracy. Early manual visual inspection methods are directly affected by factors such as the subjective experience and fatigue of the inspectors. Not only is the inspection speed slow and difficult to adapt to the pace requirements of large-scale industrial production, but it is also prone to missed or incorrect detections due to human judgment bias, making it impossible to guarantee the consistency and stability of the inspection results. On the other hand, some inspection technologies based on simple image processing often only analyze a single bag background or a single feature (such as focusing only on shape or texture features). When faced with diverse background variations such as bag material and surface color, it is difficult to effectively filter out background interference signals, resulting in insufficient segmentation accuracy of the adhesive-coated area, which directly affects the accuracy of subsequent integrity judgments.

[0003] Meanwhile, existing image processing detection methods have significant shortcomings in core technologies. At the feature extraction level, most methods fail to consider the feature differences of the glued area at different scales, relying solely on a single scale for feature extraction. This results in insufficient sensitivity for identifying small defects such as minor glue gaps or breaks, which are easily masked by image noise or complex background information and cannot be effectively detected. At the threshold setting level, traditional methods often employ fixed thresholds without dynamically adjusting them to suit different bag backgrounds. When the bag background changes, fixed thresholds are difficult to adapt to new detection scenarios, either misjudging qualified glued areas as unqualified or missing actual defects, severely reducing the reliability of the detection results and failing to meet the high-precision requirements of industrial production for glued area integrity detection. Summary of the Invention

[0004] This invention provides a method and system for detecting the integrity of the glued area on a bag based on image processing, in order to solve the problems mentioned in the background art.

[0005] To achieve the above objectives, the present invention provides a method for detecting the integrity of the adhesive application area on a bag based on image processing, comprising: S1. Denoise the surface image of the bag and enhance the contrast of the denoised surface image to obtain the original image of the bag; S2. Segment the glue application area of ​​the bag body from the original image to obtain the area mask of the bag body; S3. Perform Gaussian pyramid decomposition on the region mask to obtain a multi-scale image set of the bag body, and extract the texture features and shape features of the region mask from the multi-scale image set; S4. The texture features and the shape features are fused into the fused feature data of the bag body; S5. Based on the historical data of the bag body, determine the adhesive integrity threshold of the bag body under different bag body backgrounds; S6. Determine the probability distribution of the integrity of the glue application area in the bag body based on the fusion feature data, and output the glue application detection result of the bag body based on the comparison result of the glue integrity threshold and the probability distribution.

[0006] In a preferred embodiment, the step of denoising the surface image of the bag and enhancing the contrast of the denoised surface image to obtain the original image of the bag includes: The surface image should be smoothed, and noise in the smoothed surface image should be suppressed to obtain a noise-reduced image of the bag. Adjust the brightness distribution in the denoised image to obtain a contrast-enhanced image of the bag; The contrast-enhanced image is used as the original image of the bag.

[0007] In a preferred embodiment, segmenting the adhesive application area of ​​the bag from the original image to obtain a region mask of the bag includes: The original image is converted to a color space to obtain a color model image of the bag. The color model image is segmented by thresholding based on a predefined color range to obtain a binary image of the bag body; A morphological opening operation is performed on the binary image to obtain a denoised binary image of the bag body; The region mask of the bag is obtained by extracting the largest connected region from the denoised binary image.

[0008] In a preferred embodiment, performing Gaussian pyramid decomposition on the region mask to obtain a multi-scale image set of the bag includes: The region mask is used as the bottom layer image of the pyramid; The bottom layer image is downsampled to obtain the next layer image of the pyramid; When the number of downsampling operations reaches a preset number of pyramid layers, the images from the previous layer are combined to obtain a multi-scale image set of the bag body.

[0009] In a preferred embodiment, extracting the texture and shape features of the region mask from the multi-scale image set includes: The multi-scale image set is divided into multiple sub-regions of equal size; Within the sub-region, the intensity values ​​of the center pixel are compared with those of its neighboring pixels, using the center pixel as a reference. Based on the intensity value comparison results, a local binary pattern code corresponding to the sub-region is generated; The histograms of the local binary pattern encoding are concatenated to obtain the texture feature data of the region mask; The central moments of the images at each scale in the multi-scale image set are normalized to obtain the normalized central moments of the images at each scale. Construct invariant moment features of the image at each scale based on the normalized central moments; The invariant moment features are combined to obtain the shape feature data of the region mask.

[0010] In a preferred embodiment, fusing the texture features and the shape features into fused feature data for the bag body includes: The texture features are represented as a first feature vector; The shape features are represented as a second feature vector; The first feature vector and the second feature vector are concatenated to obtain the combined feature vector of the bag body; The merged feature vector is normalized to obtain the fused feature data of the bag body.

[0011] In a preferred embodiment, determining the adhesive integrity threshold of the bag body under different bag body backgrounds based on historical data of the bag body includes: Collect historical image samples of the bag containing different backgrounds to obtain the historical sample set of the bag; Perform background feature extraction on each sample in the historical sample set to obtain a background feature description of the bag; Cluster analysis is performed on the historical sample set based on the background feature description to obtain the background category of the bag; Based on the samples corresponding to the background category, the integrity judgment results corresponding to the background category are statistically analyzed to obtain the statistical threshold of the background category; The adhesive application integrity threshold corresponding to the background category is determined based on the statistical threshold.

[0012] In a preferred embodiment, the step of performing cluster analysis on the historical sample set based on the background feature description to obtain the background category of the bag includes: Based on the samples corresponding to the background category, the integrity judgment results corresponding to the background category are statistically analyzed to obtain the statistical threshold of the background category; The adhesive application integrity threshold corresponding to the background category is determined based on the statistical threshold.

[0013] In a preferred embodiment, the step of determining the probability distribution of the integrity of the glue-applied area in the bag body based on the fused feature data, and outputting the glue-applied detection result of the bag body based on the comparison result of the glue integrity threshold and the probability distribution, includes: The distance between the fused feature data and the decision hyperplane is mapped to the probability value of complete glue application; Construct the probability distribution curve of the bag based on the probability values; The peak position of the probability distribution curve is compared and analyzed with the adhesive integrity threshold. The detection results of the comparative analysis are correlated with the corresponding bag images to obtain the glue application detection results of the bag.

[0014] To address the aforementioned problems, the present invention also provides an image processing-based system for detecting the integrity of the adhesive application area on a bag, the system comprising: The image extraction module is used to reduce the noise of the surface image of the bag and enhance the contrast of the denoised surface image to obtain the original image of the bag. The mask segmentation module is used to segment the glue application area of ​​the bag body from the original image to obtain the area mask of the bag body; The feature extraction module is used to perform Gaussian pyramid decomposition on the region mask to obtain a multi-scale image set of the bag body, and extract the texture features and shape features of the region mask from the multi-scale image set; The feature fusion module is used to fuse the texture features and the shape features into fused feature data of the bag body; The adhesive application threshold determination module is used to determine the adhesive application integrity threshold of the bag body under different bag body backgrounds based on the historical data of the bag body; The glue application monitoring module is used to determine the probability distribution of the integrity of the glue application area in the bag based on the fused feature data, and output the glue application detection result of the bag based on the comparison result of the glue integrity threshold and the probability distribution.

[0015] Compared with the prior art, the present invention has the following beneficial effects: 1. This invention first performs noise reduction and smoothing on the bag surface image to suppress noise interference, and then adjusts the brightness distribution to enhance contrast, effectively improving the clarity and detail of the original image, laying a high-quality image foundation for the subsequent accurate segmentation of the glue-applied area. Simultaneously, by utilizing color space conversion, threshold segmentation, morphological opening operations, and maximum connected component extraction, the glue-applied area can be accurately segmented and a region mask generated, ensuring the accuracy of glue-applied area localization. Furthermore, Gaussian pyramid decomposition of the region mask yields a multi-scale image set, extracting texture features (based on local binary pattern coding histograms) and shape features (based on invariant moment features constructed from normalized central moments) from multiple scale dimensions. This comprehensively captures the feature information of the glue-applied area at different scales, including subtle texture changes and shape details, further improving the completeness and accuracy of feature description and providing sufficient feature support for subsequent integrity judgment.

[0016] 2. This invention fuses texture and shape features into unified fused feature data. Through feature vector concatenation and normalization, it integrates the advantages of both types of features, enabling the fused features to more comprehensively reflect the essential attributes of the glue-applied area and significantly improving the effectiveness of the feature data. Simultaneously, based on historical bag data, different background categories are determined through background feature extraction and cluster analysis. The glue integrity threshold for each background category is calculated by combining parameters such as category pass rate and result confidence, achieving dynamic adaptation of the threshold to different bag backgrounds and ensuring a high degree of matching between the threshold and the bag background characteristics. Furthermore, by mapping the fused feature data to glue integrity probability values ​​and constructing a probability distribution curve, comparing the peak value of the probability distribution with the dynamic threshold output detection results, the integrity of the glue-applied area can be accurately determined, significantly improving the accuracy and stability of the detection results. This invention is adaptable to diverse bag background scenarios and meets the high-precision requirements for glue area integrity detection in industrial production. Attached Figure Description

[0017] Figure 1 This is a flowchart illustrating a method for detecting the integrity of the glued area on a bag based on image processing, according to an embodiment of the present invention. Figure 2 This is a functional block diagram of a bag adhesive application area integrity detection system based on image processing, provided in an embodiment of the present invention. The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0018] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0019] This application provides a method for detecting the integrity of the adhesive application area on a bag based on image processing. The execution subject of this method includes, but is not limited to, at least one of the following electronic devices that can be configured to execute the method provided in this application: a server, a terminal, etc. In other words, the method for detecting the integrity of the adhesive application area on a bag based on image processing can be executed by software or hardware installed on a terminal device or a server device. The server includes, but is not limited to, a single server, a server cluster, a cloud server, or a cloud server cluster. The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0020] Reference Figure 1 The diagram shown is a flowchart illustrating a method for detecting the integrity of a bag's adhesive application area based on image processing, according to an embodiment of the present invention. In this embodiment, the method for detecting the integrity of a bag's adhesive application area based on image processing includes: S1. Denoise the surface image of the bag and enhance the contrast of the denoised surface image to obtain the original image of the bag; In this embodiment of the invention, the step of denoising the surface image of the bag and enhancing the contrast of the denoised surface image to obtain the original image of the bag includes: The surface image should be smoothed, and noise in the smoothed surface image should be suppressed to obtain a noise-reduced image of the bag. Adjust the brightness distribution in the denoised image to obtain a contrast-enhanced image of the bag; The contrast-enhanced image is used as the original image of the bag.

[0021] Specifically, for the surface image of the bag, Gaussian smoothing is used. Pixels in the surface image are selected one by one, and a certain range of neighboring pixels are determined with each pixel as the center. The gray values ​​of all pixels in the neighborhood are averaged and replaced with the average gray value, so that the gray value of the original pixel is smoothed out. At the same time, the averaging calculation of the neighboring pixels will reduce the influence of individual noisy pixels, thereby suppressing the noise after smoothing, and finally obtaining the noise-reduced image of the bag.

[0022] Furthermore, histogram equalization is performed on the denoised image of the bag. First, the occurrence frequency of different gray values ​​of all pixels in the denoised image is counted. Based on the occurrence frequency, the distribution of each gray value is determined. Then, the gray value of each pixel is adjusted according to the gray value distribution to make the distribution of pixels with different gray values ​​in the image more uniform. This adjusts the brightness distribution of the denoised image, and finally, the contrast-enhanced image of the bag is obtained.

[0023] Furthermore, the contrast-enhanced image of the bag obtained after adjusting the brightness distribution is directly determined as the original image of the bag used in subsequent related processing.

[0024] In summary, noise reduction processing of bag surface images can effectively suppress noise signals generated by equipment interference and environmental factors, prevent noise from obscuring the fine textures and edge details of the glue-applied area, improve image purity while preserving the original feature information of the glue-applied area, and provide a low-interference image data source for subsequent processing.

[0025] In summary, by enhancing contrast and optimizing the image brightness distribution, the grayscale difference between the glued area and the bag background can be significantly increased, making the outline of the glued area clearer and subtle regional morphological changes easier to capture.

[0026] In summary, these two processing steps together improve the clarity and detail of the original image, providing a high-quality image foundation for the subsequent accurate segmentation of the glue-applied area, and ensuring the integrity and recognizability of the segmented area features, thus laying a solid foundation for the final accurate judgment of the glue-applied integrity.

[0027] S2. Segment the glue application area of ​​the bag body from the original image to obtain the area mask of the bag body; In this embodiment of the invention, segmenting the adhesive application area of ​​the bag from the original image to obtain a region mask of the bag includes: The original image is converted to a color space to obtain a color model image of the bag. The color model image is segmented by thresholding based on a predefined color range to obtain a binary image of the bag body; A morphological opening operation is performed on the binary image to obtain a denoised binary image of the bag body; The region mask of the bag is obtained by extracting the largest connected region from the denoised binary image.

[0028] Specifically, the original image is converted from RGB to HSV color space. Each pixel in the original image contains three color components: red, green, and blue. Pixels in the original image are selected one by one, and the red, green, and blue components of the pixel are converted into three components: hue, saturation, and lightness according to a fixed correspondence. After each pixel is converted, an image composed of hue, saturation, and lightness components is formed, thus obtaining the color model image of the bag body.

[0029] Furthermore, the color model image is thresholded based on a predefined color range, which includes the value ranges of hue, saturation, and brightness. Each pixel in the color model image is checked one by one to determine whether the hue of the pixel is within the predefined hue range, whether the saturation is within the predefined saturation range, and whether the brightness is within the predefined brightness range. If all three components are within their respective ranges, the gray value of the pixel is set to 255. If any one component is not within its respective range, the gray value of the pixel is set to 0. After all pixels have been checked, the binary image of the bag body is obtained.

[0030] Furthermore, a morphological opening operation is performed on the binary image. The morphological opening operation first performs erosion and then dilation. A square structuring element is selected. During the erosion process, the square structuring element is used to cover each pixel of the binary image one by one. Only when all pixels within the square structuring element are 255 are the pixels at the center of the structuring element retained as 255; otherwise, the center pixel is set to 0. After the erosion process is completed, dilation is performed. Similarly, the square structuring element is used to cover each pixel of the eroded image one by one. As long as at least one pixel within the square structuring element is 255, the pixel at the center of the structuring element is set to 255; otherwise, it is retained as 0. After the dilation process is completed, the denoised binary image of the bag body is obtained.

[0031] Furthermore, the largest connected region is extracted from the denoised binary image, and the 4-connectivity criterion is used to determine pixel connectivity, that is, a pixel and pixels in the four directions (up, down, left, and right) are considered as adjacent pixels. The pixels in the denoised binary image are traversed one by one. When a pixel with a gray value of 255 and no label is encountered, the pixel and all its adjacent pixels with a gray value of 255 are labeled to form a connected region and assigned a unique label. After all pixels have been traversed, the number of pixels contained in the connected region corresponding to each label is counted, and the connected region with the largest number of pixels is found. The gray value of the pixels in this region is kept at 255, and the gray value of the pixels in the remaining regions is set to 0, thus obtaining the region mask of the bag body.

[0032] In summary, the adhesive application area is segmented from the original image to obtain a region mask. Color space conversion is then used to adapt to the color characteristics differences between the adhesive application area and the bag background, providing a color-dimensional adaptation basis for accurate differentiation and avoiding discrepancies inherent in a single color space. Threshold segmentation based on a predefined color range can quickly and initially separate the adhesive application area from the background, generating a binary image that clearly defines the approximate outline of the adhesive application area, laying the foundation for subsequent optimization processing.

[0033] In summary, morphological opening operations effectively remove minute noise regions from binary images while preserving the complete shape of the glue-painted area, avoiding misjudgments caused by noise interference and improving image purity. Extracting the maximum connected region eliminates scattered interference regions other than the glue-painted area, ensuring that the final region mask accurately corresponds to the target glue-painted area, guaranteeing the uniqueness and integrity of the glue-painted area. This process provides an accurate region carrier for subsequent Gaussian pyramid decomposition, texture, and shape feature extraction of the region mask, ensuring that subsequent feature extraction focuses on the real glue-painted area, thus laying a solid foundation for accurate region localization in glue integrity detection.

[0034] S3. Perform Gaussian pyramid decomposition on the region mask to obtain a multi-scale image set of the bag body, and extract the texture features and shape features of the region mask from the multi-scale image set; In this embodiment of the invention, the step of performing Gaussian pyramid decomposition on the region mask to obtain a multi-scale image set of the bag includes: The region mask is used as the bottom layer image of the pyramid; The bottom layer image is downsampled to obtain the next layer image of the pyramid; When the number of downsampling operations reaches a preset number of pyramid layers, the images from the previous layer are combined to obtain a multi-scale image set of the bag body.

[0035] In this embodiment of the invention, extracting the texture and shape features of the region mask from the multi-scale image set includes: The multi-scale image set is divided into multiple sub-regions of equal size; Within the sub-region, the intensity values ​​of the center pixel are compared with those of its neighboring pixels, using the center pixel as a reference. Based on the intensity value comparison results, a local binary pattern code corresponding to the sub-region is generated; The histograms of the local binary pattern encoding are concatenated to obtain the texture feature data of the region mask; The central moments of the images at each scale in the multi-scale image set are normalized to obtain the normalized central moments of the images at each scale. Construct invariant moment features of the image at each scale based on the normalized central moments; The invariant moment features are combined to obtain the shape feature data of the region mask.

[0036] Specifically, the previously obtained area mask of the bag body is directly set as the base layer image when constructing the image pyramid, which is the bottom layer image of the pyramid.

[0037] Furthermore, the underlying image is downsampled. Horizontally, the pixels of the underlying image are traversed from left to right, and the gray value of one pixel is selected as the horizontal pixel of the downsampled image at every interval. Vertically, the pixels of the underlying image are traversed from top to bottom, and the gray value of one pixel is selected as the vertical pixel of the downsampled image at every interval. The selected horizontal and vertical pixels are arranged according to their relative positions in the underlying image to form a new image, thus obtaining the upper layer image of the pyramid.

[0038] Furthermore, after each downsampling to obtain the previous layer image, the number of downsamplings is recorded and the previous layer image is saved; when the recorded number of downsamplings is exactly the same as the preset number of pyramid layers, all the saved previous layer images are integrated with the bottom layer images of the pyramid, and the set of these images is the multi-scale image set of the bag body.

[0039] Specifically, a fixed sub-region size is first determined. For each scale image in the multi-scale image set, starting from the top left corner, the images are divided sequentially along the horizontal and vertical directions according to the set sub-region size. If the remaining area at the edge of the image is less than the sub-region size, it is still divided according to the fixed size and the complete sub-region structure is preserved. Finally, all images in the multi-scale image set are split into multiple sub-regions of the same size.

[0040] Furthermore, within each sub-region, the center pixel of the sub-region is first located, a 3x3 neighborhood range centered on the center pixel is selected, and the intensity value of each pixel in the neighborhood is extracted one by one. The intensity value of each neighboring pixel is compared with the intensity value of the center pixel. If the intensity value of the neighboring pixel is greater than or equal to the intensity value of the center pixel, it is recorded as 1; if the intensity value of the neighboring pixel is less than the intensity value of the center pixel, it is recorded as 0.

[0041] Furthermore, starting from the top left pixel of the neighboring region in a clockwise direction, the 1s and 0s obtained by comparing the intensity values ​​within the sub-region are arranged sequentially to form an 8-bit binary number. This binary number is then converted into a decimal number, which is the local binary pattern code corresponding to the sub-region.

[0042] Furthermore, the local binary pattern codes of all sub-regions in the multi-scale image set are statistically analyzed. The frequency of each code is recorded in ascending order of the code value to form a local binary pattern code histogram for each sub-region. Then, the histogram values ​​of all sub-regions are sequentially concatenated according to the division order of the sub-regions in the image to obtain the texture feature data of the region mask.

[0043] Further, the central moments of the images at each scale in the multi-scale image set are calculated, the maximum value among all central moments of the image at that scale is found, and the value of each central moment at that scale is divided by this maximum value to make the value of each central moment between 0 and 1, thus obtaining the normalized central moments of the images at each scale.

[0044] Furthermore, different normalized central moments of the image at each scale are selected, and combined through multiplication and division operations between the normalized central moments to generate values ​​that are unaffected by image scale and rotation. These values ​​together constitute the invariant moment features of the image at each scale.

[0045] Furthermore, according to the order of scales in the multi-scale image set, all values ​​of the invariant moment features of the image at each scale are sequentially arranged and integrated to form a complete feature set, thereby obtaining the shape feature data of the region mask.

[0046] In summary, Gaussian pyramid decomposition of the region mask yields a multi-scale image set that can cover feature information at different scales of the adhesive-coated area. This avoids missing minute details or ignoring the overall shape at a single scale, providing a more comprehensive image foundation for subsequent feature extraction and ensuring that the characteristics of the adhesive-coated area can be fully captured from macroscopic to microscopic levels.

[0047] In summary, when extracting texture features from multi-scale image sets, by dividing sub-regions, comparing pixel intensities to generate local binary pattern codes, and connecting histograms, the texture changes of the glue-applied area can be accurately captured, reflecting the subtle properties of the surface. When extracting shape features, normalizing the central moments and constructing invariant moment features can eliminate interference from factors such as scale and rotation, and stably describe the shape contour of the glue-applied area.

[0048] In summary, the extraction of these two types of features, combined with the advantages of multi-scale images, can comprehensively and accurately reflect the essential attributes of the glue-applied area, providing high-quality, multi-dimensional feature support for subsequent feature fusion and glue-applied integrity judgment, and ensuring that subsequent detection steps can make accurate judgments based on sufficient feature information.

[0049] S4. The texture features and the shape features are fused into the fused feature data of the bag body; In this embodiment of the invention, fusing the texture features and the shape features into fused feature data for the bag body includes: The texture features are represented as a first feature vector; The shape features are represented as a second feature vector; The first feature vector and the second feature vector are concatenated to obtain the combined feature vector of the bag body; The merged feature vector is normalized to obtain the fused feature data of the bag body.

[0050] Specifically, the texture feature data of the previously obtained region mask is arranged in the order of its numerical values ​​when it was generated, with each value being used as an element of a vector, forming a one-dimensional vector. This one-dimensional vector is the first feature vector representing the texture features.

[0051] Furthermore, the shape feature data of the previously obtained region mask is used to form a one-dimensional vector by taking each value as an element of the vector in the order in which the shape feature data was generated. This one-dimensional vector is the second feature vector representing the shape feature.

[0052] Furthermore, all elements of the first feature vector are retained in their original order. Then, all elements of the second feature vector are directly appended to the last element of the first feature vector in their original order, so that the elements of the two vectors together form a new one-dimensional vector, which is the combined feature vector of the bag body.

[0053] Furthermore, first find the maximum and minimum values ​​of all elements in the merged feature vector. Then, select each element in the merged feature vector one by one, subtract the minimum value from the value of the element to obtain the difference between the element and the minimum value, and then divide this difference by the difference between the maximum and the minimum value to obtain the normalized value of the element. After all elements have undergone such calculations, the new vector formed is the fusion feature data of the bag body.

[0054] In summary, fusing texture features and shape features into fused feature data can fully integrate the core advantages of both types of features. Texture features can accurately reflect the surface details of the glue application area, while shape features can stably describe the contour structure of the glue application area. This avoids the limitation that a single feature can only cover local attributes, and makes the fused data more comprehensively match the essential attributes of the glue application area.

[0055] In summary, by representing the two types of features as feature vectors and performing a concatenation operation, we can effectively aggregate feature information and ensure that no information in the texture and shape dimensions is missed. Subsequent normalization processing can eliminate interference caused by differences in the dimensions and numerical ranges of the two types of features, prevent one type of feature from dominating the judgment due to its excessive numerical proportion, and ensure that the two types of features play a balanced role in detection.

[0056] In summary, the final generated fusion feature data provides more accurate and comprehensive feature support for subsequent judgment of the probability distribution of the integrity of the glue application area and comparison of the glue application integrity threshold. This effectively improves the accuracy of the glue application integrity judgment in subsequent detection steps and avoids misjudgment or omission due to one-sided features.

[0057] S5. Based on the historical data of the bag body, determine the adhesive integrity threshold of the bag body under different bag body backgrounds; In this embodiment of the invention, determining the adhesive integrity threshold of the bag body under different bag body backgrounds based on the historical data of the bag body includes: Collect historical image samples of the bag containing different backgrounds to obtain the historical sample set of the bag; Perform background feature extraction on each sample in the historical sample set to obtain a background feature description of the bag; Cluster analysis is performed on the historical sample set based on the background feature description to obtain the background category of the bag; Based on the samples corresponding to the background category, the integrity judgment results corresponding to the background category are statistically analyzed to obtain the statistical threshold of the background category; The adhesive application integrity threshold corresponding to the background category is determined based on the statistical threshold.

[0058] In this embodiment of the invention, the calculation formula for the statistical threshold is as follows: ; In the formula, The statistical threshold is... The preset pass rate factor, The category pass rate corresponding to the background category. The confidence level of the result corresponding to the background category. The preset category stability factor, The result stability index corresponding to the background category. The sample time decay factor corresponding to the background category. The preset credibility factor, The smallest positive number to prevent division by zero errors.

[0059] Specifically, historical image samples of bags with different background types, such as solid color background, textured background, and background containing clutter, are collected. A certain number of bag images are collected under each background type. All historical image samples of bags with different backgrounds are summarized together to obtain the historical sample set of the bags.

[0060] Furthermore, for each sample in the historical sample set, the background color mean, texture roughness, and background debris distribution density features are extracted. Each sample is processed individually. First, all pixels in the background area of ​​the sample are obtained, and the average value of the color components of these pixels is calculated to obtain the color mean. The texture roughness is obtained by statistically analyzing the frequency of change of the grayscale values ​​of the background pixels. The number of debris in the background area is counted and combined with the area of ​​the background area to obtain the debris distribution density. The color mean, texture roughness, and debris distribution density of each sample are organized into information in a unified format to obtain the background feature description of the bag.

[0061] Furthermore, based on the background feature description, cluster analysis is performed on the historical sample set. Samples in the historical sample set are selected one by one, and the background feature description of the sample is compared with the background feature description of other samples. If the difference in the mean color, the difference in texture roughness, and the difference in the density of debris distribution between the two samples are small, then the two samples are grouped into the same group. The comparison and grouping are completed for all samples in turn. After all samples are grouped, each group is the background category of the bag.

[0062] Furthermore, based on the samples corresponding to the background category, the pre-labeled glue application integrity judgment result for each sample is first determined. The judgment result includes two categories: complete and incomplete. The proportion of the glue application area corresponding to the sample judged as complete in all samples under the background category to the pre-set glue application area of ​​the bag is calculated, and the average of these proportions is the statistical threshold of the background category.

[0063] Furthermore, the statistical threshold of the background category is directly determined as the glue application integrity threshold corresponding to the background category. When the bag body under the background category is subsequently detected, if the proportion of the glue application area of ​​the bag body to the preset glue application area is not less than the statistical threshold, it is determined to be glue application complete. The statistical threshold is the glue application integrity threshold corresponding to the background category.

[0064] Specifically, the preset pass rate factor It is a fixed value set in advance based on the glue application quality standards of the bag manufacturing industry and the experience data summarized from the glue application qualification of different background types of bags in historical production.

[0065] Furthermore, the category pass rate corresponding to the background category. The pass rate is calculated by dividing the number of samples with complete adhesive application in that background category by the total number of samples in that background category. .

[0066] Furthermore, the confidence level of the results corresponding to the background category. The confidence level of the background category is determined by the consistency of the glue application integrity assessment results across all samples in that category. The percentage of samples with identical assessment results within that category is calculated as the proportion of the total number of samples in that category. .

[0067] Furthermore, the preset category stability factor It is a fixed value set in advance based on the historical fluctuations of bag test results under different background categories and the industry's requirements for the stability of test results.

[0068] Furthermore, the stability index of the results corresponding to the background category. This was determined by statistically analyzing the fluctuations in the integrity assessment results of adhesive application for samples under this background category at different testing times and under different operator conditions. The difference in the proportion of samples deemed complete under different conditions was calculated; a smaller difference resulted in a larger stability index S, and a larger difference resulted in a smaller stability index S. The smaller.

[0069] Furthermore, the sample time decay factor β corresponding to the background category is determined based on the time elapsed between the sample collection time and the current detection time for that background category. The closer the sample collection time is to the current detection time, the higher the sample time decay factor. The larger the value, the further the sample collection time is from the current detection time; the larger the value, the greater the sample time decay factor. The smaller.

[0070] Furthermore, the preset credibility factor It is a fixed value that is preset based on the accuracy of the background feature description, the reliability of the cluster analysis results, and the industry's requirements for feature credibility.

[0071] Furthermore, the smallest positive number ε that prevents division by zero errors is a measure of the stability of the results. A division error occurs when the value is 0. A very small, fixed positive number is preset, and this value does not change with other parameters.

[0072] Furthermore, the formula calculates the statistical threshold for the background category by combining multiple factors related to the adhesive application quality of the background category and a preset factor. ,in It combines the glue application pass rate of the background category itself, the confidence level of the judgment result, and the preset pass rate factor to reflect the basic contribution of the glue application pass level under the background category. This takes into account the stability of the background category determination result and the influence of sample time decay. The worse the stability of the determination result or the longer the sample time, the larger this part is, and the stronger the adjustment effect on the statistical threshold T. This further combines confidence level, pass rate, and stability, using division to balance the impact of stability on the results, ensuring that this part reflects the actual role of confidence level and pass rate under stable conditions; the three parts are added together to form the statistical threshold. ,make It can comprehensively reflect the characteristics of background categories in terms of pass rate, confidence level, stability, and sample timeliness, and accurately correspond to the requirements for determining the integrity of adhesive application for background categories.

[0073] In summary, determining the adhesive integrity threshold under different backgrounds based on historical bag data can make full use of the sample information and judgment experience accumulated from historical testing, cover diverse bag background scenarios, avoid the limitations caused by relying on a small number of samples or subjectively setting thresholds, and provide a judgment benchmark that fits the actual production scenario for subsequent testing.

[0074] In summary, by collecting historical image samples with different backgrounds, extracting background features, and performing cluster analysis, bag-like backgrounds with similar characteristics can be grouped into a unified category. This ensures that the threshold setting accurately matches the attributes of the same type of background, avoiding threshold adaptation bias caused by background differences. Furthermore, by combining the integrity judgment results of samples from each category with statistical thresholds, and incorporating key parameters such as category pass rate and result confidence, the threshold calculation is based on real detection data rather than subjective assumptions, significantly improving the scientific rigor and reliability of the threshold.

[0075] In summary, by setting thresholds for different background categories, dynamic adaptation of thresholds is achieved, avoiding misjudgment problems that occur with fixed thresholds in diverse backgrounds. This ensures the accuracy and consistency of the glue integrity judgment in different bag background scenarios, laying a solid foundation for accurate judgment of subsequent comparison probability distribution output detection results.

[0076] S6. Determine the probability distribution of the integrity of the glue application area in the bag body based on the fusion feature data, and output the glue application detection result of the bag body based on the comparison result of the glue integrity threshold and the probability distribution.

[0077] In this embodiment of the invention, the step of determining the probability distribution of the integrity of the glue-applied area in the bag body based on the fused feature data, and outputting the glue-applied detection result of the bag body based on the comparison result of the glue integrity threshold and the probability distribution, includes: The distance between the fused feature data and the decision hyperplane is mapped to the probability value of complete glue application; Construct the probability distribution curve of the bag based on the probability values; The peak position of the probability distribution curve is compared and analyzed with the adhesive integrity threshold. The detection results of the comparative analysis are correlated with the corresponding bag images to obtain the glue application detection results of the bag.

[0078] Specifically, first determine the maximum and minimum possible range of the distance between the fused feature data and the decision hyperplane. Set the probability value of complete glue application to 1 when the distance value is in the minimum range and set the probability value of complete glue application to 0 when the distance value is in the maximum range. For distance values ​​between the maximum and minimum ranges, linearly reduce the probability value from 1 to 0 according to the change of distance value from minimum to maximum. In this correspondence, the distance value between each fused feature data and the decision hyperplane is converted into the corresponding probability value of complete glue application.

[0079] Furthermore, with the probability value of complete glue application on the horizontal axis, each point on the horizontal axis represents a possible probability value, and the frequency of each probability value is taken as the vertical axis, the probability values ​​obtained by mapping all fused feature data are statistically analyzed, and the number of times each probability value occurs is recorded as the frequency corresponding to that probability value. The smooth curve formed by connecting each probability value point on the horizontal axis with the corresponding frequency point on the vertical axis is the probability distribution curve of the bag.

[0080] Furthermore, observe the probability distribution curve and find the point with the highest frequency on the vertical axis. The probability value corresponding to this point on the horizontal axis is the peak position of the probability distribution curve. Compare the probability value corresponding to this peak position with the glue integrity threshold corresponding to the background category. If the probability value at the peak position is greater than or equal to the glue integrity threshold, the detection result is determined to be glue integrity. If the probability value at the peak position is less than the glue integrity threshold, the detection result is determined to be glue incomplete.

[0081] Furthermore, an association record table is created, which includes a bag image identifier column and a glue application detection result column. The image file name or unique number of each bag is filled into the bag image identifier column, and the glue application detection result (complete or incomplete glue application) obtained from the comparative analysis of the bag is filled into the corresponding glue application detection result column. By establishing the correspondence between the detection results and the bag image through this table recording method, the glue application detection result of the bag is finally obtained.

[0082] In summary, mapping fused feature data to probability values ​​of complete glue application and constructing probability distribution curves can transform abstract feature information into intuitive and quantifiable probability indicators, clearly presenting the probability distribution of complete glue application areas, avoiding the ambiguity of directly relying on feature data for judgment, and providing a more concrete analytical basis for integrity determination.

[0083] In summary, by comparing the peak position of the probability distribution curve with the glue application integrity threshold, we can focus on the core indicator with the highest probability of glue application integrity for judgment, reduce the randomness of single probability value judgment, improve the accuracy of threshold comparison, and effectively reduce the risk of misjudgment caused by local feature fluctuations.

[0084] In summary, linking the test results with the corresponding bag images enables traceability matching between the test results and the original images, facilitating subsequent verification and review of the test results, further ensuring the traceability and reliability of the testing process, and providing more rigorous result output support for industrial adhesive application testing.

[0085] like Figure 2 The diagram shown is a functional block diagram of a bag adhesive application area integrity detection system based on image processing, provided in an embodiment of the present invention.

[0086] The image processing-based bag adhesive application area integrity detection system 100 of this invention can be installed in an electronic device. Depending on the functions implemented, the image processing-based bag adhesive application area integrity detection system 100 may include an image extraction module 101, a mask segmentation module 102, a feature extraction module 103, a feature fusion module 104, an adhesive application threshold determination module 105, and an adhesive application monitoring module 106. The module described in this invention can also be referred to as a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can perform a fixed function, stored in the memory of the electronic device.

[0087] In this embodiment, the functions of each module / unit are as follows: The image extraction module 101 is used to reduce the noise of the surface image of the bag and enhance the contrast of the denoised surface image to obtain the original image of the bag. The mask segmentation module 102 is used to segment the glue application area of ​​the bag body from the original image to obtain the area mask of the bag body; The feature extraction module 103 is used to perform Gaussian pyramid decomposition on the region mask to obtain a multi-scale image set of the bag body, and extract the texture features and shape features of the region mask from the multi-scale image set; The feature fusion module 104 is used to fuse the texture features and the shape features into fused feature data of the bag body; The glue application threshold determination module 105 is used to determine the glue application integrity threshold of the bag body under different bag body backgrounds based on the historical data of the bag body. The glue application monitoring module 106 is used to determine the probability distribution of the integrity of the glue application area in the bag body based on the fusion feature data, and output the glue application detection result of the bag body based on the comparison result of the glue integrity threshold and the probability distribution.

[0088] In the several embodiments provided by this invention, it should be understood that the disclosed methods and systems can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and other division methods may be used in actual implementation.

[0089] The modules described as separate components may or may not be physically separate. The components shown as modules 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.

[0090] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.

[0091] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0092] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.

[0093] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A method for detecting the integrity of the adhesive application area on a bag based on image processing, characterized in that, The method includes: S1. Denoise the surface image of the bag and enhance the contrast of the denoised surface image to obtain the original image of the bag; S2. Segment the glue application area of ​​the bag body from the original image to obtain the area mask of the bag body; S3. Perform Gaussian pyramid decomposition on the region mask to obtain a multi-scale image set of the bag body, and extract the texture features and shape features of the region mask from the multi-scale image set; S4. The texture features and the shape features are fused into the fused feature data of the bag body; S5. Based on the historical data of the bag body, determine the adhesive integrity threshold of the bag body under different bag body backgrounds; S6. Determine the probability distribution of the integrity of the glue application area in the bag body based on the fusion feature data, and output the glue application detection result of the bag body based on the comparison result of the glue integrity threshold and the probability distribution.

2. The method for detecting the integrity of the adhesive application area on a bag based on image processing as described in claim 1, characterized in that, The process of denoising the surface image of the bag and enhancing the contrast of the denoised surface image to obtain the original image of the bag includes: The surface image should be smoothed, and noise in the smoothed surface image should be suppressed to obtain a noise-reduced image of the bag. Adjust the brightness distribution in the denoised image to obtain a contrast-enhanced image of the bag; The contrast-enhanced image is used as the original image of the bag.

3. The method for detecting the integrity of the adhesive application area on a bag based on image processing as described in claim 1, characterized in that, The step of segmenting the adhesive application area of ​​the bag body from the original image to obtain the area mask of the bag body includes: The original image is converted to a color space to obtain a color model image of the bag. The color model image is segmented by thresholding based on a predefined color range to obtain a binary image of the bag body; A morphological opening operation is performed on the binary image to obtain a denoised binary image of the bag body; The region mask of the bag is obtained by extracting the largest connected region from the denoised binary image.

4. The method for detecting the integrity of the adhesive application area of ​​a bag based on image processing as described in claim 1, characterized in that, The Gaussian pyramid decomposition of the region mask yields a multi-scale image set of the bag, including: The region mask is used as the bottom layer image of the pyramid; The bottom layer image is downsampled to obtain the next layer image of the pyramid; When the number of downsampling operations reaches a preset number of pyramid layers, the images from the previous layer are combined to obtain a multi-scale image set of the bag body.

5. The method for detecting the integrity of the adhesive application area on a bag based on image processing as described in claim 4, characterized in that, The extraction of texture and shape features of the region mask from the multi-scale image set includes: The multi-scale image set is divided into multiple sub-regions of equal size; Within the sub-region, the intensity values ​​of the center pixel are compared with those of its neighboring pixels, using the center pixel as a reference. Based on the intensity value comparison results, a local binary pattern code corresponding to the sub-region is generated; The histograms of the local binary pattern encoding are concatenated to obtain the texture feature data of the region mask; The central moments of the images at each scale in the multi-scale image set are normalized to obtain the normalized central moments of the images at each scale. Construct invariant moment features of the image at each scale based on the normalized central moments; The invariant moment features are combined to obtain the shape feature data of the region mask.

6. The method for detecting the integrity of the adhesive application area of ​​a bag based on image processing as described in claim 1, characterized in that, The process of fusing the texture features and the shape features into the fused feature data of the bag body includes: The texture features are represented as a first feature vector; The shape features are represented as a second feature vector; The first feature vector and the second feature vector are concatenated to obtain the combined feature vector of the bag body. The merged feature vector is normalized to obtain the fused feature data of the bag body.

7. The method for detecting the integrity of the adhesive application area of ​​a bag based on image processing as described in claim 1, characterized in that, The step of determining the adhesive integrity threshold of the bag body under different bag body backgrounds based on the historical data of the bag body includes: Collect historical image samples of the bag containing different backgrounds to obtain the historical sample set of the bag; Perform background feature extraction on each sample in the historical sample set to obtain a background feature description of the bag; Cluster analysis is performed on the historical sample set based on the background feature description to obtain the background category of the bag.

8. The method for detecting the integrity of the adhesive application area of ​​a bag based on image processing as described in claim 7, characterized in that, The step of performing cluster analysis on the historical sample set based on the background feature description to obtain the background category of the bag includes: Based on the samples corresponding to the background category, the integrity judgment results corresponding to the background category are statistically analyzed to obtain the statistical threshold of the background category; The adhesive application integrity threshold corresponding to the background category is determined based on the statistical threshold.

9. The method for detecting the integrity of the adhesive application area of ​​a bag based on image processing as described in claim 1, characterized in that, The step of determining the probability distribution of the integrity of the glue-applied area in the bag body based on the fused feature data, and outputting the glue-applied detection result of the bag body based on the comparison result of the glue integrity threshold and the probability distribution, includes: The distance between the fused feature data and the decision hyperplane is mapped to the probability value of complete glue application; Construct the probability distribution curve of the bag based on the probability values; The peak position of the probability distribution curve is compared and analyzed with the adhesive integrity threshold. The detection results of the comparative analysis are correlated with the corresponding bag images to obtain the glue application detection results of the bag.

10. A bag body adhesive application area integrity detection system based on image processing, characterized in that, The system includes: The image extraction module is used to reduce the noise of the surface image of the bag and enhance the contrast of the denoised surface image to obtain the original image of the bag. The mask segmentation module is used to segment the glue application area of ​​the bag body from the original image to obtain the area mask of the bag body; The feature extraction module is used to perform Gaussian pyramid decomposition on the region mask to obtain a multi-scale image set of the bag body, and extract the texture features and shape features of the region mask from the multi-scale image set; The feature fusion module is used to fuse the texture features and the shape features into fused feature data of the bag body; The adhesive application threshold determination module is used to determine the adhesive application integrity threshold of the bag body under different bag body backgrounds based on the historical data of the bag body; The glue application monitoring module is used to determine the probability distribution of the integrity of the glue application area in the bag based on the fused feature data, and output the glue application detection result of the bag based on the comparison result of the glue integrity threshold and the probability distribution.