Method and system for automatic detection of packaging bag cover printing defects based on visual analysis

By employing image interference suppression, feature matching registration, and dynamic partitioning mapping, the problem of insufficient accuracy in detecting printing defects on the cover of flexible composite film packaging bags was solved, achieving higher detection accuracy and reliability.

CN122453750APending Publication Date: 2026-07-24SICHUAN ANPURI PHARMACEUTICAL TECHNOLOGY 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
2026-04-28
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing technologies cannot effectively adapt to the high light reflection, light transmission superimposition, and flexible deformation of flexible composite film packaging bag covers, resulting in insufficient accuracy in printing defect detection and prominent issues of false detection and missed detection.

Method used

An automatic detection method for printing defects on packaging bags based on visual analysis is adopted. By suppressing image interference, feature matching and registration, dynamic partitioning and mapping, and differential defect detection, the detection accuracy is improved.

Benefits of technology

It improves the registration deviation caused by image interference and flexible deformation, reduces false detection and missed detection, and enhances the rationality and reliability of printing defect detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122453750A_ABST
    Figure CN122453750A_ABST
Patent Text Reader

Abstract

The application discloses a packaging bag cover printing defect automatic detection method and system based on visual analysis, relates to the technical field of printing defect detection, and comprises the following steps: acquiring single-frame first image data of a packaging bag cover, generating second image data through image interference suppression processing; extracting real-time feature points from the second image, matching the real-time feature points with a standard feature point library to complete image registration, and obtaining registered image data and registration coordinate system data; performing partition feature matching and dynamic partition mapping based on the registration coordinates, generating cover partition result data; carrying out differential defect detection according to the functional properties of each partition, integrating and extracting defect features to form a defect feature dataset; combining the pre-set functional properties of the partitions to complete defect classification, and outputting the final detection result. The system is provided with matched functional modules. The application can specifically identify various printing defects, effectively reduces the false detection and missed detection probability, and improves the accuracy and compliance of packaging bag printing defect detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of printing defect detection technology, and in particular to an automatic detection method and system for printing defects on packaging bag covers based on visual analysis. Background Technology

[0002] Flexible composite film packaging bags are widely used in the outer packaging of food, daily chemical and pharmaceutical products. The printing quality of their covers directly affects the compliance of product labeling and appearance quality. Therefore, printing defect detection is a key link in the packaging bag production process.

[0003] Currently, the detection of printing defects on packaging bag covers generally adopts general planar printed matter visual inspection technology: after acquiring the image of the packaging bag cover, this type of technology directly performs image registration based on a fixed standard template, and then performs a global unified defect comparison and detection on the cover to identify the printing defects on the cover.

[0004] The aforementioned existing general detection technologies have the following problems in practical applications: the cover of flexible composite film packaging bags is prone to image interference such as high light reflection, light transmission superimposition, and substrate film texture, and the packaging bags themselves are prone to flexible deformation such as stretching and wrinkling. The existing fixed template registration method cannot adapt to such deformation and image interference, thus failing to achieve accurate dynamic partitioning of the cover. Ultimately, it is impossible to execute matching defect detection logic for different areas of the cover, resulting in insufficient accuracy in detecting printing defects on the packaging bag cover, and prominent problems of false detection and missed detection. Summary of the Invention

[0005] To address the technical problems existing in the prior art, this invention provides an automatic detection method and system for printing defects on packaging bag covers based on visual analysis.

[0006] The technical solution adopted in this invention is:

[0007] The first aspect of this application provides an automatic detection method for printing defects on packaging bag covers based on visual analysis, comprising the following steps:

[0008] Step 1: Obtain a single frame of the first image data of the packaging bag cover, perform image interference suppression processing on the single frame of the first image data, and generate the second image data;

[0009] Step 2: Extract real-time feature point data from the second image data, and at the same time construct standard template data and extract standard feature point library data. Match the real-time feature point data with the standard feature point library data to complete image registration and generate registered image data and registration coordinate system data.

[0010] Step 3: Perform partition feature matching processing on the registered image data based on the registration coordinate system data, complete dynamic partition mapping according to the partition features in the standard template data, and generate the packaging bag cover partition result data;

[0011] Step 4: Call the packaging bag cover partition result data, perform differentiated defect detection processing according to the functional attributes corresponding to each partition, extract the defect feature data of each partition and integrate them to generate a defect feature dataset;

[0012] Step 5: Perform defect classification processing on the defect feature dataset according to the preset functional attributes of each partition, and generate detection result data.

[0013] The second aspect of this application provides an automatic detection system for printing defects on packaging bag covers based on visual analysis, which applies the aforementioned automatic detection method for printing defects on packaging bag covers based on visual analysis, including:

[0014] An image acquisition and interference suppression module is used to acquire a single frame of first image data of the packaging bag cover, perform image interference suppression processing on the single frame of first image data, and generate second image data.

[0015] The feature extraction and image registration module extracts real-time feature point data from the second image data, constructs standard template data and extracts standard feature point library data, matches the real-time feature point data with the standard feature point library data to complete image registration, and generates registered image data and registration coordinate system data.

[0016] The partition feature matching and dynamic mapping module performs partition feature matching processing on the registered image data based on the registration coordinate system data, completes dynamic partition mapping according to the partition features in the standard template data, and generates packaging bag cover partition result data.

[0017] The differential defect detection and feature integration module calls the packaging bag cover partition result data, performs differential defect detection processing according to the functional attributes corresponding to each partition, extracts the defect feature data of each partition and integrates them to generate a defect feature dataset.

[0018] The defect classification and result generation module performs defect classification processing on the defect feature dataset according to the preset functional attributes of each partition, and generates detection result data.

[0019] The beneficial effects of this invention are: by implementing image interference suppression, feature matching registration, dynamic partition mapping, differentiated defect detection, and defect grading processing, it can improve the registration deviation problem caused by image interference and flexible deformation in existing detection technologies, improve the accuracy of packaging bag cover partitioning, make the defect detection method compatible with the functional attributes of each partition of the cover, help reduce false detection and missed detection in the printing defect detection process, and improve the overall rationality and reliability of packaging bag cover printing defect detection. Attached Figure Description

[0020] Figure 1 This is a schematic flowchart of the method of the present invention;

[0021] Figure 2 This is a schematic diagram of the system architecture of the present invention. Detailed Implementation

[0022] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0023] Example 1

[0024] To address the shortcomings of existing visual inspection solutions for printing defects in flexible composite film packaging bags, which rely solely on rigid registration with a fixed template and global unified detection, failing to adapt to the optical interference and flexible deformation issues of packaging bag covers, and ultimately leading to registration deviations, misalignment of zones, false detections, and missed detections, this embodiment provides an automatic detection method for printing defects on packaging bag covers based on visual analysis. Figure 1 As shown, it includes the following steps:

[0025] Step 1: Obtain a single frame of the first image data of the packaging bag cover, perform image interference suppression processing on the single frame of the first image data, and generate the second image data.

[0026] It should be noted that the first image data refers to the original single-frame image data of the cover of the flexible composite film packaging bag directly acquired by the industrial image acquisition equipment. It has not undergone any image processing and contains the original printing information and optical interference signals.

[0027] Because the substrate characteristics of flexible composite film packaging bags will generate three types of interference signals during imaging, the interference signals will disguise as defect features or cover up the real defects. Direct registration and detection will significantly reduce the recognition accuracy. At the same time, the bubble defects in the heat-sealed pressing area are low-contrast features, and their contour features need to be enhanced through gradient compensation preprocessing. Therefore, it is necessary to first purify the image and enhance the weak defect features through interference suppression processing.

[0028] In the specific implementation process, the first single-frame image data of the packaging bag cover is acquired by an industrial camera, and gradient compensation processing of the high-brightness reflection area is performed on the first single-frame image data. The pixel signal of the high-brightness area is repaired based on the specular reflection gradient features.

[0029] Specifically, firstly, the pixel grayscale values ​​of the first image data are traversed, highlight areas with grayscale values ​​exceeding a set threshold are located, and the gradient values ​​of the highlight areas are calculated. The gradient calculation formula is:

[0030]

[0031] In the formula: Coordinates in the first image data The pixel grayscale value at that location; The pixel grayscale value is incremented by 1 on the horizontal axis and remains unchanged on the vertical axis. The pixel grayscale value is the x-coordinate minus 1, while the y-coordinate remains unchanged. The pixel grayscale value is incremented by 1 on the ordinate and remains unchanged on the x-coordinate. The pixel grayscale value is obtained by subtracting 1 from the vertical coordinate and keeping the horizontal coordinate unchanged.

[0032] The pixels in the highlight area are then weighted and repaired based on the gradient value. The repaired pixel values ​​are... The calculation formula is:

[0033]

[0034] After gradient compensation, the image data is subjected to foreground-background difference and grayscale normalization processing to separate the light transmission superimposed ghost image signal and calculate the grayscale difference between the foreground printing area and the foreground substrate area. The formula for calculating the grayscale difference is:

[0035]

[0036] In the formula: The grayscale value of the pixels in the foreground printing area; The image represents the grayscale value of the foreground substrate region. After separating the image signal based on the grayscale difference, grayscale normalization is performed on the entire image. The normalized pixel values ​​are... The calculation formula is:

[0037]

[0038] In the formula: The minimum grayscale value of the image; This represents the maximum grayscale value of the image.

[0039] Two-dimensional frequency domain bandstop filtering is performed on the image data after ghost image separation to filter out the periodic frequency domain components corresponding to the substrate film texture and retain the frequency domain components corresponding to the defects.

[0040] For example, a two-dimensional Fourier transform is performed on the image to obtain the frequency domain matrix. Locate the periodic frequency domain points corresponding to the film texture of the substrate. Eliminated by band-stop filtering Preserve the frequency domain components corresponding to the defects. The image data after inverse Fourier transform is obtained by filtering out membrane texture.

[0041] Edge feature enhancement processing is performed on the filtered image data to generate a second image data. For example, the Sobel operator is used to extract image edges, and the enhanced pixel values ​​are... The calculation formula is:

[0042]

[0043] In the formula: This is the edge enhancement coefficient; The edge gradient values ​​extracted by the Sobel operator.

[0044] For example, for medical sterile dressing composite film packaging bags, the first image data acquired contains three types of interference: overexposure of highlights in the center of the cover, light transmission shadows at the film edges, and periodic transverse film textures on the substrate. First, gradient compensation is used to repair pixels in the overexposure areas to restore them to normal printing grayscale, while simultaneously enhancing the gradient features of low-contrast bubbles in the heat-sealed area. Then, the light transmission shadow signal is separated by foreground and background difference analysis to prevent the shadow from being identified as printing lines. The periodic frequency domain components of the transverse film textures are filtered out by frequency domain band-stop filtering, while retaining the frequency domain features of ink dots, knife lines, and bubbles. Edge enhancement is used to strengthen the edge contours of the medical batch number, production date, and sterile label, ultimately generating interference-free second image data with complete defect features.

[0045] This step specifically eliminates the unique optical interference and substrate texture interference of flexible composite film packaging bags, purifying image information while fully preserving the characteristics of subtle defects, and simultaneously enhancing the contour features of low-contrast bubbles in the heat-sealed area to reduce the negative impact of interference signals on subsequent registration and inspection.

[0046] Step 2: Extract real-time feature point data from the second image data, simultaneously construct standard template data and extract standard feature point library data, match the real-time feature point data with the standard feature point library data to complete image registration, and generate registered image data and registration coordinate system data.

[0047] It should be noted that real-time feature point data refers to the set of feature points such as corner points and geometric inflection points extracted from the second image data for spatial alignment. Standard template data refers to the reference image data constructed using images of qualified packaging bag covers that are free of defects and stretching deformation.

[0048] Standard feature point library data refers to a set of rigid geometric feature points extracted from standard template data, without positional offset or deformation. Image registration refers to the process of spatially aligning the real-time acquired packaging bag image with the standard template data. Registered image data refers to the image data after completing global coarse registration and local fine registration. Registration coordinate system data refers to the spatial coordinate reference data established after registration, used for subsequent dynamic partitioning mapping. Deformation residual refers to the remaining local deformation offset between the real-time image and the standard template after global coarse registration, used to characterize the deformation distribution of the membrane material.

[0049] Because flexible composite film packaging bags are prone to non-rigid deformations such as stretching and wrinkling, general rigid registration can only correct overall offset and cannot adapt to local deformations. By obtaining deformation residuals through global coarse registration, the deformation distribution of the film material can be determined. In this way, a non-uniform grid can be constructed to achieve local fine registration, which can eliminate local deformation deviations.

[0050] In one possible implementation, step 2 includes the following sub-steps:

[0051] Sub-step 2.1: Collect images of packaging bag covers without defects or tensile deformation to construct standard template data, extract rigid geometric features from the standard template data, and generate standard feature point library data.

[0052] For example, rigid features such as the four corners of the packaging bag, the heat-sealed corners, and the outline of the anti-counterfeiting label are extracted from the standard template to form a standard feature point library. .

[0053] Sub-step 2.2: Perform ORB feature extraction processing on the second image data, supplement rigid geometric anchor point data in the solid color area, and generate effective real-time feature point data.

[0054] For example, ORB feature points are extracted from the second image data. For solid-color, featureless regions, add geometric anchor points. Effective real-time feature point data .

[0055] Sub-step 2.3: Perform feature matching and mismatch removal processing on the valid real-time feature point data and the standard feature point library data, calculate the homography matrix, and complete global coarse registration. The Hamming distance is used to calculate the feature point matching degree. The Hamming distance calculation formula is:

[0056]

[0057] In the formula: For the first standard feature point database data One feature descriptor; For effective real-time feature point data, the first Each feature descriptor.

[0058] False matching points are removed using the RANSAC algorithm, and the homography matrix is ​​calculated. Complete global coarse registration.

[0059] Sub-step 2.4: Calculate the deformation residual after global coarse registration to obtain the deformation distribution of the membrane material. Construct a non-uniform mesh based on the deformation distribution of the membrane material. Perform local affine transformation and thin plate spline interpolation on the image data after global coarse registration to complete the local fine registration.

[0060] First, calculate the deformation residual between the real-time image after global coarse registration and the standard template. The calculation formula is:

[0061]

[0062] In the formula: These are the image pixel values ​​after global coarse registration. These are the pixel values ​​for the standard template;

[0063] Deformation levels are classified according to the magnitude of the deformation residuals. Regions with residuals greater than a threshold are classified as high-deformation regions and are divided into dense meshes; regions with residuals less than a threshold are classified as low-deformation regions and are divided into sparse meshes, thus completing the construction of a non-uniform mesh.

[0064] Perform an affine transformation on each grid to obtain the transformation matrix. Thin plate spline interpolation is used to smooth the mesh boundaries and eliminate registration faults.

[0065] Sub-step 2.5: Calculate local mutual information for each region of the registered image data, complete the local registration validity verification, and determine the registration coordinate system data.

[0066] The formula for calculating local mutual information is:

[0067]

[0068] In the formula: For the registered image data; Standard template data; for and The joint probability density; for The marginal probability density; for The marginal probability density.

[0069] When the local mutual information exceeds the set threshold, the registration is deemed valid, and the registration coordinate system data is determined.

[0070] For example, for medical sterile dressing composite film packaging bags with local lateral stretching, firstly, qualified product images are collected to construct a standard template, and rigid feature points at the four corners and heat-sealed corners are extracted to form a feature library; geometric anchor points are added to the solid-color medical brand area of ​​the real-time second image data to solve the problem of missing feature points; after matching feature points by Hamming distance, mismatched points are eliminated to complete the overall offset correction; the deformation residual after coarse registration is calculated, and dense mesh is divided for the stretching area with large residual, and sparse mesh is divided for the normal area. Local affine transformation and interpolation smoothing are performed on the stretching area; finally, mutual information is calculated by region to verify the registration effect and determine the registration coordinate system data suitable for deformation.

[0071] This step accurately obtains the deformation distribution of the membrane material through deformation residuals, adapts to the non-uniform stretching and wrinkling deformation of medical sterile dressing composite membranes, solves the registration failure problem in solid color areas, realizes local registration effect verification, and provides accurate spatial coordinate reference for subsequent dynamic zoning.

[0072] Step 3: Perform partition feature matching processing on the registered image data based on the registration coordinate system data, complete dynamic partition mapping according to the partition features in the standard template data, and generate the packaging bag cover partition result data.

[0073] It should be noted that the partition feature matching process refers to the operation of matching the partition features of the registered image with the partition features of the standard template based on the registration coordinate system data established in step 2. The image registration is not repeated; only the partition positioning is completed.

[0074] Dynamic partitioning mapping refers to the operation of adaptively mapping the partition range of a standard template to the registered image based on feature matching results. The partitioning result data for the packaging bag cover refers to the coordinate data of the divided character function area, main pattern area, heat-sealing area, and structural shielding area.

[0075] Partition feature topology coding refers to coded data that digitally represents the geometric position, relative distance, and contour features of each partition.

[0076] Because different packaging bags have different partition positions, fixed coordinate partitioning cannot adapt to product changes and printing position drifts; under the unified coordinate system completed in step 2, adaptive dynamic partitioning can be achieved through topological coding matching, which only performs positioning matching on partition features, does not repeat image registration operations, and ensures that the partitioning is consistent with the actual structure of the product.

[0077] In one possible implementation, step 3 includes the following sub-steps:

[0078] Sub-step 3.1: Under the original coordinate system of the standard template data, perform partition feature topology coding on the standard template to generate partition feature topology coded data. .

[0079] For example, the geometric center coordinates and relative distance parameters of the four partitions in the standard template are extracted to generate topology codes. The encoding includes partition location, outline, and relative relationship features.

[0080] Sub-step 3.2: Based on the registration coordinate system data from step 2, extract real-time partition features from the registered image data, perform real-time feature topology coding processing, and generate real-time topology coded data. .

[0081] Sub-step 3.3: Perform a fast matching mapping between the real-time topology code and the standard topology code to generate packaging bag cover partitioning result data containing the character function area, main pattern area, heat sealing and pressing area, and structural shielding area.

[0082] The formula for calculating the topology coding matching degree is:

[0083]

[0084] In the formula: The first standard topology coding Bit-coded value; The first for real-time topology coding Bit-coded value; This represents the total number of bits in the encoding. When the matching degree exceeds a set threshold, the partition mapping is completed, generating partition result data containing four functional areas.

[0085] For example, for different batches of medical sterile dressing composite film packaging bags, the character functional area, main pattern area, heat-sealing and pressing area, and structural shielding area of ​​the standard template are first topologically encoded to record the relative position and contour features of each partition; under the unified coordinate system after registration in step 2, the corresponding partition features of the real-time image are extracted and real-time topological codes are generated; dynamic mapping is completed through code matching degree calculation, and the cover area of ​​different batches of the medical packaging bag can be accurately divided without adjusting the coordinate parameters.

[0086] Step 4: Call the packaging bag cover partition result data, perform differentiated defect detection processing according to the functional attributes corresponding to each partition, extract the defect feature data of each partition and integrate them to generate a defect feature dataset.

[0087] Because the types and importance of defects in different sections of the packaging bag are different, global unified detection cannot meet the detection requirements of compliance in the character area and defects specific to the heat seal area; deformation in the character area is prone to skeleton breakage, so topological reconstruction must be completed before similarity comparison; bubbles in the heat seal area are low-contrast features, and after gradient compensation enhancement in step 1, bubbles and creases can be distinguished through gradient and texture analysis.

[0088] In one possible implementation, the step of calling the packaging bag cover partition result data and performing differentiated defect detection processing based on the functional attributes corresponding to each partition, and extracting the defect feature data of each partition, includes the following:

[0089] Perform character topological skeleton reconstruction on the character functional area image, extract the character thin skeleton, detect skeleton break nodes, perform topological completion and connection on the break nodes, and repair the skeleton break data caused by deformation.

[0090] The reconstructed complete character skeleton is compared with the character skeleton in the standard template data using a weighted structural similarity calculation formula:

[0091]

[0092] In the formula: , , These are weighting coefficients; Brightness contrast factor; Contrast factor; For structural contrast factors;

[0093] After performing light transmission compensation on the character area and converting it to the LAB color space, the color difference calculation formula is as follows:

[0094]

[0095] In the formula: , , The color parameters of the real-time image in the LAB color space; , , The color parameters of the standard template in the LAB color space; The color difference value between the real-time image and the standard template is used to identify pinholes, dirt spots, and blurred characters based on the color difference, and generate the first defect feature data.

[0096] In one possible implementation, the step of calling the packaging bag cover partition result data and performing differentiated defect detection processing based on the functional attributes corresponding to each partition, and extracting the defect feature data of each partition, includes the following:

[0097] Based on the registration deformation data, a deformation adaptive size template is generated. Template difference processing is performed on the registered image data and the deformation adaptive size template to extract the difference region data. Halftone noise filtering and clustering processing are performed on the difference region data to distinguish between speckled defects and normal printing halftone dots. Curve line feature extraction processing is performed to identify straight and curved burr defects and generate corresponding second defect feature data.

[0098] For example, a deformation adaptive size template is generated based on the registration deformation data, and differential processing is performed to extract the difference regions; dot noise is filtered out in the difference regions, and the clustering calculation formula is as follows:

[0099]

[0100] In the formula: Pixel clustering distance; , The pixel coordinates of the difference region are used to identify straight and curved blades and generate second defect feature data.

[0101] In one possible implementation, the step of calling the packaging bag cover partition result data and performing differentiated defect detection processing based on the functional attributes corresponding to each partition, and extracting the defect feature data of each partition, includes the following:

[0102] Edge morphology removal processing is performed on the heat-sealed pressing area image data to remove heat-sealing burr interference signals; gray-level gradient and texture feature joint analysis processing is performed to distinguish bubble defects from film crease signals; spot color ink difference comparison processing is performed to identify ink peeling and knife scratch defects, and generate corresponding third defect feature data.

[0103] For example, the detection of the heat-sealed pressing area relies on the bubble contour features enhanced by the gradient compensation preprocessing in step 1. Edge morphological culling is performed on the heat-sealed pressing area image data to remove heat-sealing burr interference signals. Joint analysis of grayscale gradient and texture is performed: the comprehensive image gradient is calculated to distinguish linear creases, and a texture threshold is used to distinguish circular low-contrast bubbles. The gradient calculation formula is as follows:

[0104]

[0105] In the formula: For the horizontal gradient; For the vertical gradient; To synthesize the gradient, spot color ink difference comparison processing is performed to identify ink peeling and knife scratch defects, generating third defect feature data.

[0106] In one possible implementation, the step of calling the packaging bag cover partition result data and performing differentiated defect detection processing based on the functional attributes corresponding to each partition, and extracting the defect feature data of each partition, includes the following:

[0107] Online structural feature adaptive learning processing is performed on the structural shielding area to generate dynamically adapted detection rules; indentation feature normalization processing is performed on the image data of the structural shielding area to distinguish between structural indentations and real printing defects, and the corresponding fourth defect feature data is extracted.

[0108] For example, the structural shielding area detection performs online adaptive learning of structural features to generate dynamic detection rules; the indentation features are normalized using the following formula:

[0109]

[0110] In the formula: Indentation characteristic value; It is the smallest eigenvalue; It is the largest eigenvalue; These are the normalized feature values; indentations and defects are distinguished to generate the fourth defect feature data.

[0111] Integrate the four types of defect feature data to generate a defect feature dataset.

[0112] For example, in the character functional area of ​​the medical sterile dressing composite film packaging bag, the deformed and broken medical batch number stroke skeleton is first repaired, and then the defects are identified by weighted structural similarity, and pinholes and dirt spots are identified by color difference calculation; in the main pattern area, printing dots and speckle defects are distinguished, and bent scalpel wires are identified; in the heat-sealing and pressing area, relying on the gradient enhancement features of step 1, gradient and texture analysis is used to distinguish overflow glue, sterilization sealing bubbles and creases; in the structural shielding area, indentations and printing omissions are segmented, and finally all defect features are integrated into a complete defect feature dataset.

[0113] Step 5: Perform defect classification processing on the defect feature dataset according to the preset functional attributes of each partition, and generate detection result data.

[0114] Because the defect feature dataset contains adhesion defects, grading based solely on partition attributes lacks objectivity. Therefore, it is necessary to first separate the adhesion defects and then combine multiple criteria to complete the grading, ensuring the reasonableness of the detection results.

[0115] In one possible implementation, step 5 includes the following sub-steps:

[0116] Sub-step 5.1: Perform watershed segmentation on the defect feature dataset to separate the adhesion defect signals and determine the defect type and defect location data.

[0117] The minimum point of the defect region is determined by distance transformation, and watershed segmentation is performed based on the minimum point to separate the adhered defect regions.

[0118] Sub-step 5.2: Combine defect morphological characteristics with partition functional attributes to perform joint grading processing and generate defect grading data. The grading determination formula is:

[0119]

[0120] In the formula The final defect level; Assigning functional levels to different zones; Defect morphology level; , These are the weighting coefficients.

[0121] Sub-step 5.3: Generate inspection result data containing pass and fail indicators based on the defect classification data.

[0122] For example, multiple ink spot defects adhering to the main pattern area of ​​the medical sterile dressing composite film packaging bag are independently separated by watershed segmentation; combined with the medical compliance attributes of the character function area, incomplete medical batch number and production date are classified as high-level defects, and tiny ink spots in the main pattern area are classified as low-level defects; according to the classification results, a non-compliance mark is generated when a high-level defect exists, and a compliance mark is generated when there is no high-level defect.

[0123] In summary, this embodiment effectively solves the problem of medical packaging bag detection failure caused by optical interference and flexible deformation in existing technologies by image interference suppression, deformation adaptive registration, dynamic partition mapping, differentiated defect detection and joint grading, thereby improving the accuracy and compliance of printing defect detection for medical sterile dressing composite film packaging bags.

[0124] Example 2

[0125] The automatic detection system for printing defects on packaging bags based on visual analysis applies the aforementioned automatic detection method for printing defects on packaging bags based on visual analysis, such as... Figure 2 As shown, it includes:

[0126] An image acquisition and interference suppression module is used to acquire a single frame of first image data of the packaging bag cover, perform image interference suppression processing on the single frame of first image data, and generate second image data.

[0127] The feature extraction and image registration module extracts real-time feature point data from the second image data, constructs standard template data and extracts standard feature point library data, matches the real-time feature point data with the standard feature point library data to complete image registration, and generates registered image data and registration coordinate system data.

[0128] The partition feature matching and dynamic mapping module performs partition feature matching processing on the registered image data based on the registration coordinate system data, completes dynamic partition mapping according to the partition features in the standard template data, and generates packaging bag cover partition result data.

[0129] The differential defect detection and feature integration module calls the packaging bag cover partition result data, performs differential defect detection processing according to the functional attributes corresponding to each partition, extracts the defect feature data of each partition and integrates them to generate a defect feature dataset.

[0130] The defect classification and result generation module performs defect classification processing on the defect feature dataset according to the preset functional attributes of each partition, and generates detection result data.

[0131] The embodiments described above are merely illustrative of specific implementations of the present invention, and while the descriptions are detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention.

Claims

1. An automatic detection method for printing defects on packaging bag covers based on visual analysis, characterized in that, Includes the following steps: Step 1: Obtain a single frame of the first image data of the packaging bag cover, perform image interference suppression processing on the single frame of the first image data, and generate the second image data; Step 2: Extract real-time feature point data from the second image data, and at the same time construct standard template data and extract standard feature point library data. Match the real-time feature point data with the standard feature point library data to complete image registration and generate registered image data and registration coordinate system data. Step 3: Perform partition feature matching processing on the registered image data based on the registration coordinate system data, complete dynamic partition mapping according to the partition features in the standard template data, and generate the packaging bag cover partition result data; Step 4: Call the packaging bag cover partition result data, perform differentiated defect detection processing according to the functional attributes corresponding to each partition, extract the defect feature data of each partition and integrate them to generate a defect feature dataset; Step 5: Perform defect classification processing on the defect feature dataset according to the preset functional attributes of each partition, and generate detection result data.

2. The automatic detection method for printing defects on packaging bag covers based on visual analysis according to claim 1, characterized in that, The image interference suppression process includes the following: Sub-step 1.1: Perform gradient compensation processing on the first image data of a single frame for the highlight reflection region, and repair the pixel signal of the highlight region based on the specular reflection gradient features; Sub-step 1.2: Perform foreground and background difference and grayscale normalization processing on the image data after gradient compensation to separate the light transmission superimposed ghost image signal; Sub-step 1.3: Perform local frequency domain band-stop filtering on the image data after ghost image separation to filter out the periodic frequency domain components corresponding to the substrate film texture and retain the frequency domain components corresponding to the defects; Sub-step 1.4: Perform edge feature enhancement processing on the filtered image data to generate the second image data.

3. The automatic detection method for printing defects on packaging bag covers based on visual analysis according to claim 1, characterized in that, Step 2 includes the following sub-steps: Sub-step 2.1: Collect images of packaging bag covers without defects or tensile deformation to construct standard template data, extract rigid geometric features from the standard template data, and generate standard feature point library data; Sub-step 2.2: Perform ORB feature extraction processing on the second image data, supplement rigid geometric anchor point data in the solid color area, and generate effective real-time feature point data; Sub-step 2.3: Perform feature matching and mismatch removal processing on the effective real-time feature point data and the standard feature point library data, calculate the homography matrix and complete the global coarse registration; Sub-step 2.4: Construct a non-uniform mesh based on the deformation distribution of the membrane material, and perform local affine transformation and thin plate spline interpolation on the image data after global coarse registration to complete local fine registration; Sub-step 2.5: Calculate local mutual information for each region of the registered image data, complete the local registration validity verification, and determine the registration coordinate system data.

4. The automatic detection method for printing defects on packaging bag covers based on visual analysis according to claim 1, characterized in that, Step 3 includes the following sub-steps: Sub-step 3.1: Perform partition feature topology coding on the standard template data to generate partition feature topology coded data; Sub-step 3.2: Extract real-time partition features from the registered image data and perform real-time feature topology coding processing; Sub-step 3.3: Perform a fast matching mapping between the real-time topology code and the standard topology code to generate packaging bag cover partitioning result data containing the character function area, main pattern area, heat sealing and pressing area, and structural shielding area.

5. The automatic detection method for printing defects on packaging bag covers based on visual analysis according to claim 4, characterized in that, The process involves calling the packaging bag cover partitioning results data, performing differentiated defect detection processing based on the functional attributes corresponding to each partition, and extracting the defect feature data of each partition, including the following: Perform character topology skeleton reconstruction processing on the character function area image data to repair the skeleton breakage data caused by deformation; The reconstructed character skeleton is compared with the character skeleton in the standard template data using a weighted structural similarity comparison to identify text incompleteness and missing text defects. After performing light transmission compensation processing on the character function area image data, it is converted to the LAB color space, and the color difference is calculated to identify pinholes, dirt spots and character blur defects, generating the corresponding first defect feature data.

6. The automatic detection method for printing defects on packaging bag covers based on visual analysis according to claim 4, characterized in that, The process involves calling the packaging bag cover partitioning results data, performing differentiated defect detection processing based on the functional attributes corresponding to each partition, and extracting the defect feature data of each partition, including the following: A deformation adaptive size template is generated based on the registration deformation data. Template difference processing is performed on the registered image data and the deformation adaptive size template to extract the difference region data. Perform dot noise filtering and clustering on the data in the difference areas to distinguish between speckled defects and normal printing dots; Perform curve line feature extraction processing to identify knife wire defects with straight and curved shapes, and generate corresponding second defect feature data.

7. The automatic detection method for printing defects on packaging bag covers based on visual analysis according to claim 4, characterized in that, The process involves calling the packaging bag cover partitioning results data, performing differentiated defect detection processing based on the functional attributes corresponding to each partition, and extracting the defect feature data of each partition, including the following: Edge morphological culling is performed on the image data of the heat-sealed pressing area to remove interference signals from heat-sealed burrs. Perform joint analysis of grayscale gradient and texture features to distinguish between bubble defects and membrane crease signals; Perform spot color ink difference comparison processing to identify ink peeling and knife scratch defects, and generate corresponding third defect feature data.

8. The automatic detection method for printing defects on packaging bag covers based on visual analysis according to claim 4, characterized in that, The process involves calling the packaging bag cover partitioning results data, performing differentiated defect detection processing based on the functional attributes corresponding to each partition, and extracting the defect feature data of each partition, including the following: Online structural feature adaptive learning processing is performed on the structural shielding area to generate dynamically adapted detection rules; Indentation feature normalization processing is performed on the image data of the structural shielding area to distinguish between structural indentations and actual printing defects, and the corresponding fourth defect feature data is extracted.

9. The automatic detection method for printing defects on packaging bag covers based on visual analysis according to claim 1, characterized in that, Step 5 includes the following sub-steps: Sub-step 5.1: Perform watershed segmentation on the defect feature dataset to separate the adhesion defect signals and determine the defect type and defect location data; Sub-step 5.2: Combine defect morphological characteristics with partition functional attributes to perform joint hierarchical processing and generate defect hierarchical data; Sub-step 5.3: Generate inspection result data containing pass and fail indicators based on the defect classification data.

10. An automatic detection system for printing defects on packaging bag covers based on visual analysis, characterized in that, The automatic detection method for printing defects on packaging bag covers based on visual analysis according to any one of claims 1-9 includes: An image acquisition and interference suppression module is used to acquire a single frame of first image data of the packaging bag cover, perform image interference suppression processing on the single frame of first image data, and generate second image data. The feature extraction and image registration module extracts real-time feature point data from the second image data, constructs standard template data and extracts standard feature point library data, matches the real-time feature point data with the standard feature point library data to complete image registration, and generates registered image data and registration coordinate system data. The partition feature matching and dynamic mapping module performs partition feature matching processing on the registered image data based on the registration coordinate system data, completes dynamic partition mapping according to the partition features in the standard template data, and generates packaging bag cover partition result data. The differential defect detection and feature integration module calls the packaging bag cover partition result data, performs differential defect detection processing according to the functional attributes corresponding to each partition, extracts the defect feature data of each partition and integrates them to generate a defect feature dataset. The defect classification and result generation module performs defect classification processing on the defect feature dataset according to the preset functional attributes of each partition, and generates detection result data.