An intelligent blister box defect detection method based on image processing
By processing images of blister packs, constructing a stress-tensile response index and combining it with the confidence level of isolated defects, the problem of distinguishing between the complex curved surface structure of blister packs and whitening defects was solved, achieving high-precision defect detection and ensuring product quality.
Patent Information
- Application Number
- CN202610439751.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-03
- Publication Date
- 2026-11-06
- Estimated Expiration
- 2046-04-03
AI Technical Summary
Existing detection methods struggle to distinguish between normal structural reflections and whitening defect areas caused by the complex curved surface of blister packs, making it impossible to accurately extract defects during production line defect detection.
An image processing-based method is adopted to obtain the original grayscale image of the blister box, perform local contrast enhancement processing, divide it into superpixel blocks, calculate the basic brightness, enhanced brightness and angular dispersion, construct the stress tensile response index, and combine it with the confidence of isolated defects for judgment, and output defect signals to achieve intelligent detection.
It significantly improves the accuracy and stability of defect detection for transparent plastic blister boxes, effectively suppresses structural high-gloss interference, reduces the risk of false detection and missed detection, and ensures product packaging quality.
Smart Images

Figure CN122312583B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology. More specifically, this invention relates to an intelligent defect detection method for blister packs based on image processing. Background Technology
[0002] In the fruit packaging industry, transparent blister packs made of polyethylene terephthalate (PET) and polypropylene are widely used in fruit product packaging due to the inherent properties of these materials. However, in the vacuum forming process, uneven heating temperature distribution in the four corners of the mold's bottom stretching area, or excessively high vacuum rates, can easily cause localized overstretching of the sheet material. This can lead to microstructural damage within the material, resulting in tensile stress whitening defects or localized thinning defects. These defects directly reduce the overall load-bearing capacity of the blister pack, making it prone to physical breakage when carrying heavy fruit, thus affecting the product packaging quality.
[0003] Due to the high transparency of plastics such as polyethylene terephthalate (PET) and polypropylene, traditional machine vision inspection techniques suffer from severe detection interference in the defect detection of blister packs. To extract the low-contrast whitening feature caused by tensile stress, existing industrial inspection methods typically first use multi-scale contrast enhancement algorithms to locally enhance the contrast of the image, and then combine this with a simple linear iterative clustering segmentation algorithm to complete image region merging and feature parsing, thereby achieving the separation of the faintly whitening defect area from the background area.
[0004] However, while the aforementioned multi-scale contrast enhancement algorithm improves the visibility of subtle whitening features caused by tensile stress, it indiscriminately amplifies the normal structural reflections formed by the complex curved surface of the blister pack. Because conventional algorithms lack a mechanism to distinguish between the scattering characteristics of microcracks in the material and structural highlight interference in terms of optical properties and spatial topology, relying solely on set grayscale thresholds or local texture features for classification, the algorithms cannot accurately distinguish between the normal highlight areas of the complex curved surface of the blister pack and the subtle whitening defect areas at structural corners in actual production lines, easily leading to false positives and false negatives. Summary of the Invention
[0005] The present invention aims to solve the technical problem that existing detection methods are unable to distinguish between normal structural reflective and whitening defect areas caused by the complex curved surface structure of blister boxes, resulting in the inability to accurately extract defects in production line defect detection.
[0006] This invention provides an intelligent defect detection method for blister packs based on image processing, comprising: acquiring the original grayscale image of the blister pack and performing local contrast enhancement processing to obtain an enhanced grayscale image; dividing the original grayscale image into several superpixel blocks; calculating the base brightness, enhanced brightness, and angular dispersion for each superpixel block, and constructing a stress tensile response index based on the base brightness, enhanced brightness, and angular dispersion; extracting all directly adjacent superpixel blocks in the spatial topology of each superpixel block to form an adjacent superpixel set, and calculating the isolated defect confidence of each superpixel block by combining the adjacent superpixel set; comparing the isolated defect confidence with a preset industrial tolerance threshold to determine whether the blister pack has a tensile stress whitening defect, and outputting a corresponding defect judgment signal to achieve intelligent detection of defects in the blister pack.
[0007] This invention first acquires the original grayscale image of the blister pack and then performs local contrast enhancement processing to obtain an enhanced grayscale image. Next, it divides the image into multiple region units through superpixel segmentation. Based on dimensionless normalized base brightness, enhanced brightness, and angular dispersion, a stress-tensile response index is constructed. Finally, the confidence level of isolated defects is calculated by combining the spatial topological adjacency relationship of the superpixel blocks. This method accurately distinguishes and effectively suppresses structural highlight interference on the surface of the blister pack from two levels: optical scattering, mechanical texture features, and spatial topological continuity. It reliably exposes minute, true defects caused by tensile stress whitening, significantly improving the accuracy, stability, and automation of defect detection in transparent plastic blister packs, effectively ensuring product packaging quality.
[0008] Preferably, the calculation method for the base brightness, enhanced brightness, and angular dispersion includes: calculating the average brightness of all pixels within each superpixel block in the original grayscale image, and dividing it by the maximum grayscale level to obtain the base brightness normalized to the dimensionless interval [0,1]; calculating the average brightness of all pixels within each superpixel block in the enhanced grayscale image, and performing normalization processing to obtain the enhanced brightness normalized to the dimensionless interval [0,1]; calculating the standard deviation of the gradient direction angle of all pixels within each superpixel block, and processing the standard deviation according to a preset angle range normalization coefficient to obtain the angular dispersion normalized to the dimensionless interval [0,1]; wherein, the normalization coefficient is determined based on the upper limit of the value range of the gradient direction angle.
[0009] The physical quantities of each dimension feature are uniformly normalized to the dimensionless interval to ensure that the dimensions of the core relational expressions are strictly consistent during multiplication and exponentiation operations, and to avoid the imbalance of evaluation weights due to differences in magnitude of different features.
[0010] Preferably, the relationship of the stress-tensile response index is:
[0011] In the formula, Indicates the first The stress-tensile response index of each superpixel block Indicates the first Enhanced brightness of each superpixel block Indicates the first The base brightness of each superpixel block Indicates the first angular dispersion of each superpixel block It represents the base constant of the natural logarithm.
[0012] By introducing an exponential decay term constructed with the natural logarithm base, specular reflection interference can be effectively suppressed in the brightness dimension based on the original image's baseline brightness. At the same time, by leveraging the exponentially monotonically decreasing characteristic of angular dispersion, consistent microcracks formed by tensile stress can be accurately screened out, significantly improving the feature extraction process's ability to resist interference from complex lighting conditions.
[0013] Preferably, the step of extracting all directly adjacent superpixel blocks in the spatial topology of each superpixel block to form an adjacent superpixel set includes: traversing the spatial boundary of each superpixel block, extracting all surrounding superpixel blocks that share boundary pixels with the current superpixel block, forming the adjacent superpixel set corresponding to the current superpixel block; counting the total number of adjacent superpixel blocks contained in the adjacent superpixel set, and setting boundary conditions to ensure that the total number is always greater than or equal to 1.
[0014] Preferably, the relationship for the confidence level of the isolated defect is as follows:
[0015] In the formula, Indicates the first confidence level of isolated defects in a superpixel block Indicates the first The stress-tensile response index of each superpixel block Indicates the first The total number of neighboring superpixel blocks contained in the set of adjacent superpixel blocks corresponding to each superpixel block. Indicates the first The set of adjacent superpixels corresponding to each superpixel block. Indicates the first superpixel in the set of adjacent superpixels The stress-tension response index of adjacent superpixel blocks.
[0016] By constructing a nonlinear evaluation denominator using a local neighborhood comparison mechanism, and combining the characteristic pattern of the reinforcing ribs extending continuously in the spatial topology, continuous linear structural reflections are filtered out in the spatial dimension, while avoiding the risk of data overflow from division by zero, significantly improving the numerical prominence of isolated block-shaped real defects.
[0017] Preferably, the method for obtaining the preset industrial tolerance threshold includes: acquiring a historical good product dataset, calculating the confidence level of isolated defects for all test samples in the historical good product dataset; extracting the maximum value of the confidence level of isolated defects in the test samples, multiplying the maximum value by a preset multiplier as a benchmark reference value, and dynamically compensating the benchmark reference value in conjunction with the real-time imaging fluctuation of the current production environment, and setting it as the preset industrial tolerance threshold.
[0018] Preferably, acquiring the original grayscale image of the blister box includes: setting up a dark field lighting system at the inspection station of the production line; and acquiring the blister box placed flat on the conveyor belt vertically downwards using an image acquisition device.
[0019] Preferably, before calculating the base brightness, enhanced brightness, and angular dispersion, the method further includes: calculating the horizontal and vertical gradients of each pixel within the superpixel block using operators; obtaining the gradient direction angle of each pixel using the arctangent function based on the horizontal and vertical gradients, and mapping the gradient direction angle to the [0, 1.57] radian range.
[0020] Preferably, the local contrast enhancement processing is implemented using a multi-scale contrast enhancement algorithm, which is a local contrast enhancement algorithm for the retina and cerebral cortex.
[0021] Preferably, the output of the corresponding defect determination signal includes: when it is determined that the blister box has a tensile stress whitening defect, generating abnormal identification data containing the defect location characteristics, and outputting a level trigger signal or alarm command to the external control system for use by downstream sorting equipment.
[0022] This solution uses a level-triggered signal as the command medium based on the defect judgment result, linking the production line's programmable logic controller and pneumatic rejection mechanism to form an automated connection process from detection to handling. When a defective blister box is judged, the defective product can be quickly removed from the production line to prevent unqualified products from entering subsequent processes. The test results can be directly implemented as production line actions to ensure the packaging quality of the products leaving the factory.
[0023] The technical solution of the present invention has the following beneficial technical effects: This invention utilizes multi-scale contrast enhancement and superpixel segmentation techniques, combined with brightness variations and gradient direction dispersion to construct a stress-tensile response index, and introduces an isolated defect confidence evaluation mechanism based on spatial topological relationships. This scheme deeply integrates optical scattering characteristics and mechanical texture features, significantly improving the contrast of subtle whitening defects while effectively suppressing continuous linear structural highlights generated in areas such as the reinforcing ribs of blister packs using spatial neighborhood correlation. This addresses the challenge of traditional visual inspection methods in distinguishing between normal reflections on complex curved surfaces and subtle whitening defects at structural corners. It achieves precise separation of defect areas from background interference at the fundamental level of physical characteristics, significantly reducing the risk of false positives and false negatives in production line inspection, and effectively ensuring the finished product quality of transparent packaging products. Attached Figure Description
[0024] Figure 1 This is a flowchart of an intelligent defect detection method for blister packs based on image processing according to the present invention; Figure 2 These are comparison images of the surface defect detection results of plastic fruit boxes, where a is the original dark field illumination image, b is the result processed by the traditional machine vision detection method, and c is the result processed by the method of this invention. Detailed Implementation
[0025] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.
[0026] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0027] This invention discloses an intelligent defect detection method for blister packs based on image processing, referring to... Figure 1 This includes the following steps: S1. Obtain the original grayscale image of the blister box, apply a multi-scale contrast enhancement algorithm to perform local contrast enhancement processing on the original grayscale image to obtain an enhanced grayscale image, and apply a simple linear iterative clustering segmentation algorithm to divide the original grayscale image into several compact superpixel blocks.
[0028] First, a dark-field illumination system is set up at the inspection station on the production line. Using industrial cameras and other image acquisition devices, images of the blister packs placed flat on the conveyor belt are captured at a vertically downward shooting angle, obtaining the original grayscale image of the blister pack. The dark-field illumination environment is suitable for the optical characteristics of transparent plastic materials, reducing interference from ambient stray light on imaging and ensuring the effective acquisition of low-contrast defect features.
[0029] Subsequently, a multi-scale contrast enhancement algorithm is applied to locally enhance the contrast of the original grayscale image, resulting in an enhanced grayscale image. In this embodiment, the multi-scale contrast enhancement algorithm is specifically a retinal-cortical local contrast enhancement algorithm. This step is used to amplify the visibility of low-contrast tensile stress whitening features, providing an image basis for subsequent defect feature extraction. Finally, a simple linear iterative clustering segmentation algorithm is applied to divide the original grayscale image into several compact superpixel blocks.
[0030] This step transforms the image analysis dimension from isolated pixel level to region level with local optical consistency, so that subsequent feature analysis corresponds to optical micro-elements with actual physical area. This can effectively reduce the interference of local burst noise and lay a solid image foundation for subsequent feature extraction.
[0031] S2. For each superpixel block, calculate the base brightness, enhanced brightness, and angular dispersion, and construct the stress-tensile response index based on the base brightness, enhanced brightness, and angular dispersion.
[0032] Before performing feature analysis and parameter calculation for superpixel blocks, it is necessary to clarify two core inherent characteristics that distinguish tensile stress whitening defects from normal transparent areas and structural specular interference. These characteristics will serve as the core design basis for feature parameter selection and index construction: Optical scattering characteristics: Normal transparent areas and specular reflective areas of reinforcing ribs inherently possess high brightness in the original grayscale image, and their brightness improvement after contrast enhancement is limited. However, tensile stress whitening areas, due to microcracks caused by the breakage of molecular chains within the material, exhibit diffuse reflection characteristics optically. Their brightness is extremely low in the original grayscale image, and after contrast enhancement, their brightness will show a significant non-linear amplification. Mechanical texture characteristics: Tensile stress whitening defects are caused by unidirectional tensile stress during vacuum forming. The microcracks present regular parallel fine textures, and the gradient direction of pixels within the corresponding area is highly consistent. In contrast, in defect-free normal areas, the pixel gradient direction is randomly and irregularly distributed.
[0033] For each superpixel block obtained from segmentation, the horizontal and vertical gradients of each pixel within the superpixel block are first calculated using the gradient operator. Based on the horizontal and vertical gradients, the gradient direction angle of each pixel is obtained using the arctangent function, and the gradient direction angle is mapped to the [0, 1.57] radian interval to provide basic data for subsequent angle dispersion calculation. The relationship between basic brightness, enhanced brightness, and angle dispersion is as follows: Base brightness: Calculate the first The average brightness of all pixels within a superpixel block in the original grayscale image is divided by the maximum grayscale level of the image, 255, and normalized to the dimensionless interval [0,1] to obtain the first superpixel block. The base brightness of each superpixel block This parameter is used to characterize the inherent brightness level of the corresponding region of the superpixel block under the original acquisition conditions, and can distinguish between structural highlight regions with high original brightness and whitening defect regions with low original brightness.
[0034] Enhanced brightness: Calculate the first The average brightness of all pixels within a superpixel block in the enhanced grayscale image is normalized to the dimensionless interval [0,1] to obtain the th superpixel block. Enhanced brightness of each superpixel block This parameter characterizes the brightness enhancement effect of the corresponding area of the superpixel block after contrast enhancement. The brightness of the whitening defect area due to tensile stress will show a significant non-linear increase after enhancement due to the diffuse reflection characteristics, thereby distinguishing the defect area from the normal transparent area.
[0035] Angular dispersion: Calculate the first The standard deviation of the gradient direction angles of all pixels within a superpixel block is divided by 1.57 for range normalization, normalized to the dimensionless interval [0,1], to obtain the i-th superpixel block. angular dispersion of each superpixel block This parameter characterizes the consistency of pixel gradient directions within a superpixel block. Microcracks in tensile stress-induced whitening defects exhibit highly consistent parallel textures due to unidirectional tensile stress, resulting in extremely low angular dispersion values. This distinguishes defect areas from normal areas with chaotic gradient directions. It should be noted that in this embodiment, since the gradient direction angle is mapped to the [0, 1.57] radian range, 1.57 is preferably used as the normalization coefficient. However, in practical applications, this coefficient can be adaptively adjusted according to changes in the angular domain and is not limited to 1.57.
[0036] Based on the normalized base brightness, enhanced brightness, and angular dispersion, a stress-tensile response index is constructed to characterize the degree of defect response, and the corresponding relationship is: ; In the formula, For the first The stress-tensile response index of each superpixel block is used to characterize the degree of response of the corresponding region of the superpixel block to the whitening defect of tensile stress. The higher the value, the greater the possibility that the corresponding region is a whitening defect. For the first Enhanced brightness of each superpixel block; It is the base of the natural logarithm, a constant. For the first The base brightness of each superpixel block; For the first The angular dispersion of each superpixel block.
[0037] The aforementioned stress-tensile response index is constructed by deeply coupling the optical physics scattering model with the local contrast normalization theory in machine vision. This index provides a precise physical model of the diffuse reflection characteristics of microcracks in polymer thermoforming materials: the exponential term in the formula... It effectively constructs a non-linear penalty barrier against highlights on transparent backgrounds, suppressing bright backgrounds on a large scale; while the exponential term By utilizing the anisotropic texture features derived from the stress on microcracks, interference from local cluttered backgrounds is precisely suppressed.
[0038] To facilitate understanding of the above relationship, a specific numerical example is provided for further explanation: Consider a superpixel block corresponding to a real microcrack defect, whose base brightness is extremely low due to diffuse reflection. The calculated value is... The enhanced brightness is prominent, as calculated. Because the microcracks are highly consistent in direction, the calculated angular dispersion is extremely small. Substituting the above parameters into the relational expression, we get: , ; ; Conversely, if it is a superpixel block corresponding to a normal structural highlight area, the base brightness is calculated. The remaining parameters are consistent with the aforementioned defective superpixel blocks. After substituting them into the relational formula, This exponential decay term significantly reduces the final response value, effectively suppressing the highlight area.
[0039] Thus, by integrating optical and mechanical texture features and constructing a relational formula based on dimensional uniformity, structural specular interference can be suppressed at the essential level of physical features, while highlighting the high response value of tensile stress whitening defects, laying a good foundation for subsequent steps.
[0040] S3. Extract all directly adjacent superpixel blocks in the spatial topology of each superpixel block to form an adjacent superpixel set, and calculate the isolated defect confidence of each superpixel block by combining the adjacent superpixel set.
[0041] The above steps can suppress most conventional reflections, but structural reflections with high strength and fixed orientation at the edges of the reinforcing ribs of the blister pack can still result in medium to high response values after the above calculations. Based on geometric topological feature analysis, the reinforcing ribs exhibit a continuous linear distribution on the surface of the blister pack, and adjacent superpixel blocks along their extension direction usually have similar high response values; while real tensile stress whitening defects are mostly concentrated in local areas such as deep stretching corners of the mold, exhibiting isolated block-like distribution characteristics, and the response values of the surrounding background areas are significantly lower.
[0042] Traversing the spatial boundaries of each superpixel block, and comparing it with the current... Extract all surrounding superpixel blocks of a superpixel block that share a boundary pixel to form the current superpixel block. The set of adjacent superpixels corresponding to each superpixel block The total number of adjacent superpixel blocks in the adjacent superpixel set is denoted as . And set boundary conditions to limit To prevent data overflow errors, this step is used to construct the spatial neighborhood relationship of the target superpixel block, providing a foundation for subsequent differentiation between continuous linear structural highlights and isolated blocky defects based on spatial topological features. The specific implementation of the boundary conditions is as follows: For superpixel blocks at image edges, if the number of their adjacent superpixel blocks is 0, they are merged with their nearest neighboring superpixel block, ensuring that the number of adjacent superpixel blocks in the merged superpixel block is ≥1; for non-edge superpixel blocks, the number of their directly adjacent superpixel blocks is directly counted, ensuring that the number is ≥1 and always holds true.
[0043] By combining the set of adjacent superpixels, the confidence score of isolated defects in each superpixel block is calculated, and the corresponding relationship is as follows: ; In the formula, For the first The confidence score of isolated defects in each superpixel block is used to characterize the confidence level of the corresponding region of the superpixel block as an isolated tensile stress whitening defect. The higher the value, the higher the confidence level of the corresponding region as a real defect. For the first Stress-tensile response index of each superpixel block; For the first The total number of adjacent superpixel blocks in the set of adjacent superpixel blocks corresponding to each superpixel block; For the first The set of adjacent superpixels corresponding to each superpixel block; For adjacent superpixel sets The Middle The stress-tensile response index of each adjacent superpixel block; the constant 1 in the denominator is a dimensionless smoothing base, used to prevent the risk of division by zero when the mean of the neighborhood response index is 0, and to ensure the stability of the continuous detection process in the industrial field.
[0044] The derivation of the confidence score for isolated defects incorporates a classic mathematical model of antagonistic receptive fields around the center in biomimetic vision. The denominator includes the sum of the mean of the neighborhood response and a dimensionless smoothing constant 1, essentially performing adaptive lateral suppression filtering within the spatial topological domain. This underlying logic ensures that the highlight interference from reinforcing ribs, exhibiting large-area linear extensions, is significantly weakened by the high response of the surrounding neighborhood, while the true whitening defect features with localized abrupt changes are preserved with a high signal-to-noise ratio due to the lower response of the surrounding area.
[0045] To facilitate understanding of the above relationship, a specific numerical example is provided below for further explanation: Assume the current superpixel block is a real defect, and its stress-tensile response index... Its adjacent superpixel set contains 4 adjacent superpixel blocks, that is The stress-tension response indices of the four adjacent superpixel blocks are 0.02, 0.03, 0.01, and 0.04, respectively. Substituting these indices into the equation, we obtain: The average response index within the neighborhood: ; confidence level of isolated defects .
[0046] For the superpixel block corresponding to the structural highlights of the reinforcing ribs, its stress-tensile response index Its adjacent superpixel blocks are all reinforcement rib highlight regions, and the average response index in the neighborhood is 0.45. Substituting into the relational formula, we get: .
[0047] The above calculations show that this relationship can numerically suppress continuous linear structural highlight regions based on spatial topological features, while retaining high-confidence values for isolated blocky defect regions, providing reliable support for the effective separation of structural highlight interference from real defects.
[0048] S4. Compare the confidence level of isolated defects with the preset industrial tolerance threshold to determine whether the blister box has a tensile stress whitening defect, and output the corresponding defect judgment signal to realize intelligent detection of defects in the blister box.
[0049] In an optional embodiment, the preset industrial tolerance threshold is determined as follows: A historical dataset of good blister packs is pre-acquired, and the confidence level of isolated defects for all test samples in the historical dataset is calculated. The maximum value of the confidence level of isolated defects in the test samples is extracted, and this maximum value is multiplied by a preset multiplier to obtain a benchmark reference value. This benchmark reference value is then set as the preset industrial tolerance threshold. During the specific judgment process, the system acquires the imaging background statistics of the current production batch in real time. If the ambient light intensity decreases slowly, the system automatically triggers a compensation procedure to fine-tune the preset industrial tolerance threshold in the same direction. This dynamic threshold strategy based on real-time compensation using historical benchmarks effectively avoids the risk of systemic false alarms caused by environmental optical drift, ensuring the accuracy of complex surface defect extraction.
[0050] Defect judgment logic: The confidence level of isolated defects of all superpixel blocks is calculated and compared with the preset industrial tolerance threshold. If the confidence level of isolated defects of any superpixel block is greater than the preset industrial tolerance threshold, the blister box is judged to have a tensile stress whitening defect. If the confidence level of isolated defects of all superpixel blocks is less than or equal to the preset industrial tolerance threshold, the blister box is judged to be a qualified product.
[0051] Based on the defect determination results, the system outputs corresponding defect determination signals to trigger the corresponding production line execution mechanism. Specifically, when the blister pack is determined to have a tensile stress whitening defect, the system generates abnormal identification data containing the defect location characteristics and outputs a level trigger signal or alarm command to the external control system (such as the production line programmable logic controller, etc.) for downstream sorting equipment (such as pneumatic rejection mechanism, sorting robotic arm, or manual prompt terminal, etc.) to remove the defective blister pack from the production line; when the blister pack is determined to be a qualified product, the abnormal command is not triggered and the product is released to enter the next process.
[0052] Verification was performed using the actual testing results shown in the attached diagram: like Figure 2As shown in the figure, this figure intuitively presents the difference in performance between the method of the present invention and the traditional machine vision inspection method in detecting the whitening defect due to tensile stress in transparent blister boxes. Image a clearly shows a large, continuous area of high-gloss reflection formed by the reinforcing ribs and molding holes of the blister pack. An arrow marks the actual tensile stress whitening defect in the lower left corner of the image; this defect area is weak in brightness and small in size, creating a strong contrast with the surrounding strong structural highlights. Image b shows that the traditional method, while amplifying the weak defect features, indiscriminately amplifies the normal structural highlights formed by the complex curved surface of the blister pack, resulting in a large area of false positives and false negatives: the reflections from the reinforcing ribs and the highlights at the structural edges of the blister pack are incorrectly marked as defect foregrounds, making it difficult to distinguish between normal structural highlights and the actual stress whitening defect. Image c shows that the processed image suppresses the background highlight interference from the blister pack structure, resulting in a clean background without stray false positives. Only the actual tensile stress whitening defect signal marked by the arrow is retained, achieving accurate removal of structural highlight interference and accurate extraction of weak whitening defects. This verifies that the present invention can effectively solve the false positive and false negative problems of the prior art.
[0053] In summary, by combining the dual suppression mechanism of this invention and performing automated threshold comparison and production line rejection operations, high-precision, non-destructive automated detection of blister box tensile stress whitening defects can be achieved under complex lighting conditions, effectively ensuring the packaging quality of products leaving the factory.
[0054] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for intelligent defect detection of blister packs based on image processing, characterized in that, include: The original grayscale image of the blister box is obtained and local contrast enhancement processing is performed to obtain an enhanced grayscale image. The original grayscale image is divided into several superpixel blocks. For each superpixel block, the base brightness, enhanced brightness, and angular dispersion are calculated separately, and a stress-tensile response index is constructed based on the base brightness, enhanced brightness, and angular dispersion. The calculation method for the base brightness, enhanced brightness, and angular dispersion includes: calculating the average brightness of all pixels within each superpixel block in the original grayscale image, and dividing it by the maximum grayscale level to obtain the base brightness normalized to the dimensionless range of [0,1]. Calculate the average brightness of all pixels within each superpixel block in the enhanced grayscale image, and perform normalization processing to obtain the enhanced brightness normalized to the dimensionless interval [0,1]. Calculate the standard deviation of the gradient direction angle of all pixels in each superpixel block, and process the standard deviation according to the preset angle range normalization coefficient to obtain the angle dispersion normalized to the dimensionless interval [0,1]; wherein, the normalization coefficient is determined based on the upper limit of the value range of the gradient direction angle. The relationship between the stress-tensile response index and the stress-tensile response index is as follows: In the formula, Indicates the first The stress-tensile response index of each superpixel block Indicates the first Enhanced brightness of each superpixel block Indicates the first The base brightness of each superpixel block Indicates the first angular dispersion of each superpixel block Represents the base constant of the natural logarithm; Extract all directly adjacent superpixel blocks in the spatial topology of each superpixel block to form an adjacent superpixel set, and combine the adjacent superpixel set to calculate the isolated defect confidence of each superpixel block; The relationship for the confidence level of isolated defects is as follows: In the formula, Indicates the first confidence level of isolated defects in a superpixel block Indicates the first The stress-tensile response index of each superpixel block Indicates the first The total number of neighboring superpixel blocks contained in the set of adjacent superpixel blocks corresponding to each superpixel block. Indicates the first The set of adjacent superpixels corresponding to each superpixel block. Indicates the first superpixel in the set of adjacent superpixels Stress-tension response index of adjacent superpixel blocks; The confidence level of isolated defects is compared with the preset industrial tolerance threshold to determine whether the blister box has a tensile stress whitening defect, and the corresponding defect judgment signal is output to realize intelligent detection of defects in blister boxes.
2. The intelligent defect detection method for blister packs based on image processing according to claim 1, characterized in that, The step of extracting all directly adjacent superpixel blocks in the spatial topology of each superpixel block to form an adjacent superpixel set includes: traversing the spatial boundary of each superpixel block, extracting all the surrounding superpixel blocks that share boundary pixels with the current superpixel block, and forming the adjacent superpixel set corresponding to the current superpixel block; The total number of adjacent superpixel blocks in the adjacent superpixel set is counted, and boundary conditions are set to ensure that the total number is always greater than or equal to 1. The boundary conditions are implemented as follows: for superpixel blocks at the image edge, if the number of their adjacent superpixel blocks is 0, they are merged with the nearest adjacent superpixel block to ensure that the number of adjacent superpixel blocks in the merged superpixel block is ≥1; for non-edge superpixel blocks, the number of their directly adjacent superpixel blocks is directly counted to ensure that the number is ≥1.
3. The intelligent defect detection method for blister packs based on image processing according to claim 1, characterized in that, The method for obtaining the preset industrial tolerance threshold includes: obtaining a historical good product dataset and calculating the confidence level of isolated defects for all test samples in the historical good product dataset; The maximum confidence level of isolated defects in the test sample is extracted, multiplied by a preset multiplier to obtain a benchmark reference value, and then dynamically compensated for by combining the real-time imaging fluctuation of the current production environment, and set as the preset industrial tolerance threshold.
4. The intelligent defect detection method for blister packs based on image processing according to claim 1, characterized in that, The process of acquiring the original grayscale image of the blister pack includes: setting up a dark field lighting system at the inspection station of the production line; and acquiring the image of the blister pack placed flat on the conveyor belt vertically downwards using an image acquisition device.
5. The intelligent defect detection method for blister packs based on image processing according to claim 1, characterized in that, Before calculating the base brightness, enhanced brightness, and angular dispersion, the process also includes: calculating the horizontal and vertical gradients of each pixel within the superpixel block using operators. Based on the horizontal and vertical gradients, the gradient direction angle of each pixel is obtained by using the arctangent function, and the gradient direction angle is mapped to the range of [0, 1.57] radians.
6. The intelligent defect detection method for blister packs based on image processing according to claim 1, characterized in that, The local contrast enhancement process is implemented using a multi-scale contrast enhancement algorithm, which is a local contrast enhancement algorithm for the retina and cerebral cortex.
7. The intelligent defect detection method for blister packs based on image processing according to claim 1, characterized in that, The output of the corresponding defect judgment signal includes: when it is determined that the blister box has a tensile stress whitening defect, generating abnormal identification data containing the defect location characteristics, and outputting a level trigger signal or alarm command to the external control system for downstream sorting equipment to call.
Citation Information
Patent Citations
Inspection method, and inspection device
JP2019090643A
Monitoring system and method of identification of anomalies in a 3D printing process
US20220143704A1
