Beer capping defect identification method based on image intelligent identification

By setting up a camera and a light source emitter in the beer cap inspection process, and combining triple features and a sophisticated light pattern calculation model, the system automatically switches between light control modes and performs brightness compensation. This solves the problem of light interference in beer cap defect identification, achieves high-precision image recognition and human eye verification, and ensures the accuracy of the identification.

CN120635017BActive Publication Date: 2026-01-23BUDWEISER BEER FOSHAN
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510734695.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-04
Publication Date
2026-01-23
Estimated Expiration
2045-06-04

AI Technical Summary

Technical Problem

Existing technologies for identifying defects in beer caps suffer from severe issues such as loss of details in dark areas, overexposure in bright areas, and halo phenomena due to lighting conditions. This results in a high failure rate for machine recognition and difficulty in controlling the accuracy of manual recognition, leading to low reliability of the recognition results.

Method used

Employing an image-based intelligent recognition method, this approach combines a camera and a light source emitter with three key features—brightness, color, and edge gradient—to output precise light control decisions. It constructs an elite light pattern calculation model, dynamically adjusts the brightness transition curve, performs brightness compensation and halo suppression, uses a three-dimensional color lookup table for color calibration, and integrates both machine and human recognition mechanisms.

Benefits of technology

It improves light control precision, reduces halo diffusion, enhances image color gamut performance and color accuracy, ensures the accuracy of machine and human eye recognition, and achieves secondary verification of machine recognition through a dual mechanism, thus guaranteeing the overall recognition accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120635017B_ABST
    Figure CN120635017B_ABST
Patent Text Reader

Abstract

The application discloses a beer sealing cover defect identification method based on image intelligent identification, and relates to the field of image identification, and comprises the following steps: extracting the brightness distribution, color histogram and edge gradient features of a camera shooting picture; constructing a sharp light type calculation model, dynamically adjusting the brightness transition curve of adjacent partitions; identifying high-contrast edges in the picture, dynamically adjusting the brightness attenuation curve of adjacent partitions according to the edge brightness difference; and performing color calibration through a three-dimensional color lookup table; and using a double mechanism to identify defects in actual sealing cover images. The light rays of the light source emitter are regulated and controlled, so that the machine and the human eye can easily identify under the condition of contrast, the halo diffusion radius is reduced, and the three-dimensional color lookup table is used for color calibration, so that the machine and the human eye are prevented from being affected by the image itself when identifying, and the accuracy of overall identification is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image recognition, specifically to a method for identifying defects in beer bottle caps based on intelligent image recognition. Background Technology

[0002] Currently, there is a high demand for automated and accurate defect segmentation in the manufacturing industry. In manufacturing, such as beer bottle cap defect detection, the need for automated visual inspection technology for defect segmentation is growing. However, images used for defect identification may suffer from problems due to lighting conditions, such as loss of detail in dark areas, overexposure in bright areas, and severe halo effects. These factors significantly interfere with identification. Furthermore, machine-based identification has a certain failure rate, requiring manual verification. However, the accuracy of manual identification is difficult to control, making accurate identification challenging. Consequently, the overall reliability of the identification results has room for improvement. Summary of the Invention

[0003] To address the aforementioned technical problems, this paper provides a method for identifying defects in beer bottle caps based on intelligent image recognition. This technical solution resolves the issues raised in the background section.

[0004] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0005] A method for identifying defects in beer bottle caps based on image intelligent recognition includes:

[0006] At least one camera and a light source emitter are set around the beer bottle cap detection position. The camera is located below the plane of the beer bottle cap, and the light source emitters are evenly distributed around the beer bottle cap in 360 degrees.

[0007] Extract the brightness distribution, color histogram, and edge gradient features from the camera's captured image, and combine these three features to output precise light control decisions, enabling automatic switching of light control modes;

[0008] Construct an elite light pattern calculation model and dynamically adjust the brightness transition curves of adjacent zones to reduce the halo diffusion radius;

[0009] Based on human visual perception habits, brightness compensation is performed on dark areas, and dynamic compression is performed on highlight areas;

[0010] Identify high-contrast edges in the image, dynamically adjust the brightness attenuation curves of adjacent zones based on the edge brightness difference, and adjust the halo suppression intensity.

[0011] Based on the actual capped image, the image contrast is dynamically adjusted, the input signal is color gamut converted, and color calibration is performed through a three-dimensional color lookup table;

[0012] A dual mechanism is used for defect identification in actual capped images.

[0013] Preferably, the step of combining brightness, color, and edge gradient features to output precise light control decisions includes the following steps:

[0014] The image is divided into blocks, the average brightness value of each block is calculated, a brightness distribution histogram is generated, and the percentage of pixels in each brightness range is calculated.

[0015] The image was converted from the red-green-blue color space to the hue-saturation-brightness color space, and histograms of the three channels were calculated respectively.

[0016] Calculate the gradient magnitude and direction of the image, statistically analyze the distribution of gradient magnitude, and mark high gradient regions as edge regions;

[0017] The brightness distribution histogram and color histogram are jointly analyzed to calculate the joint statistics of brightness and color, output the brightness-color covariance matrix, and calculate the determinant value of the brightness-color covariance matrix.

[0018] The correlation between edge gradient features and brightness distribution is analyzed to calculate the correlation coefficient between edge gradient and brightness.

[0019] Based on brightness distribution, color histogram, and edge gradient features, thresholds are set for brightness, color, and edge gradient scores. The ratio of the edge gradient score threshold to the brightness score threshold is the correlation coefficient, and the ratio of the brightness score threshold to the color score threshold is the determinant value.

[0020] Determine whether the brightness, color, and edge gradient scores of each block are all higher than the corresponding threshold. If so, the block is determined to be a highlight area, and the local light control mode is switched to control the brightness of at least one light source emitter until the brightness, color, and edge gradient scores of each block are equal to the corresponding threshold. If not, no output is made.

[0021] Determine if the brightness distribution of the image is uniform and the edge gradient is below the corresponding threshold. If so, switch to global light control mode and synchronously increase the brightness of each block until the edge gradient equals the corresponding threshold. If not, do not output.

[0022] Determine if there are more than three blocks in the image whose edge gradient scores are higher than the corresponding threshold. If so, switch to local light control mode; otherwise, do not output anything.

[0023] Preferably, the step of constructing the refined light pattern calculation model and dynamically adjusting the brightness transition curves of adjacent partitions includes the following steps:

[0024] Ray tracing is used to simulate light propagation, and the light contribution of each partition to the target area is calculated to obtain a fine light pattern calculation model. The target area is the location of the camera.

[0025] The range of light contribution is divided into three equal parts and used as the first brightness difference threshold and the second brightness difference threshold, respectively, to obtain at least one image frame;

[0026] Determine whether the brightness difference of the light contribution of adjacent partitions to the target area in the current frame is less than the first brightness difference threshold. If yes, use the linear brightness transition curve; otherwise, do not output anything.

[0027] Determine whether the brightness difference of the light contribution of adjacent partitions to the target area in the current frame is greater than the second brightness difference threshold. If yes, use the Gaussian transition curve; otherwise, use the S-shaped growth transition curve.

[0028] The brightness adjustment values ​​of at least two consecutive frames are weighted and averaged. The brightness adjustment value of the current frame is recorded as the sum of 70% of the initial brightness value of the current frame and 30% of the brightness adjustment value of the previous frame. The weighted result is used to adjust adjacent partitions.

[0029] Preferably, the step of performing brightness compensation on dark areas and dynamic compression on highlight areas includes the following steps:

[0030] The dominant frequency is determined by calculating the spatial frequency distribution of the image using Fourier transform.

[0031] Calculate and output the contrast sensitivity function based on the dominant frequency;

[0032] The cone cell response of the photoreceptor was simulated by plotting the photoreceptor response curve;

[0033] By integrating the contrast sensitivity function and the nonlinear model of the photoreceptor, the differences in human eye sensitivity to different brightness regions are quantified.

[0034] The joint sensitivity is obtained by multiplying the photoreceptor response value by the contrast sensitivity function value.

[0035] Based on joint sensitivity, each zone is divided into dark and highlight areas. Brightness compensation is applied to the dark areas to improve the visibility of dark details, while dynamic compression is applied to the highlight areas to preserve highlight details and avoid overexposure.

[0036] Preferably, the step of dynamically adjusting the brightness attenuation curves of adjacent zones based on edge brightness differences to regulate halo suppression intensity includes the following steps:

[0037] Calculate the gradient magnitude of edge pixels and weight them based on the gray-level variance of the local neighborhood to generate an edge intensity map;

[0038] By introducing directional gradient histogram features, edges in the horizontal, vertical and diagonal directions are distinguished and output;

[0039] A brightness gradient field is generated based on the edge intensity map, the brightness change rate between adjacent partitions is quantified, and the brightness decay curve is dynamically adjusted.

[0040] A Gaussian-S-shaped growth curve hybrid model was used to generate the brightness decay curve;

[0041] The steepness coefficient in the Gaussian-S-shaped growth curve hybrid model is preset based on the edge intensity map, and the Gaussian kernel width in the Gaussian-S-shaped growth curve hybrid model is preset based on the brightness gradient field;

[0042] The brightness of the partitions is redistributed, and the compensation brightness of adjacent partitions is calculated based on the brightness attenuation curve.

[0043] The halo radius and peak brightness of the beer cap are monitored in real time using a brightness sensor, and the halo suppression coefficient is calculated.

[0044] The halo suppression coefficient is fed back to the brightness decay curve model to dynamically adjust the steepness coefficient and Gaussian kernel width in the Gaussian-S-shaped growth curve hybrid model.

[0045] Based on the real-time nature of the display effect, the halo suppression coefficient can be fed back and dynamically adjusted in real time.

[0046] Preferably, the dynamic adjustment of screen contrast, color gamut conversion of the input signal, and color calibration using a three-dimensional color lookup table include the following steps:

[0047] The actual sealing image is displayed on an LCD screen, and the twisting angle of the liquid crystal molecules is dynamically adjusted.

[0048] In the high-brightness zone, the twist angle of the liquid crystal molecules is reduced to decrease the light transmittance and avoid overexposure.

[0049] Increasing the twist angle of liquid crystal molecules in the corresponding area of ​​the dark region improves light transmittance and enhances details in the dark area;

[0050] Uniform sampling is performed within the RGB cube to form a three-dimensional grid of points.

[0051] For the red, green and blue components of each sampling point, the LAB value of the target color gamut is obtained by measuring with a spectrophotometer, and an initial three-dimensional color lookup table is constructed.

[0052] The RGB cube is divided into at least two tetrahedral units, each of which consists of four sampling points;

[0053] Record the vertex index and adjacency relationship of each tetrahedral cell to form a data structure. For the input RGB value, determine the tetrahedral cell in which it belongs through the spatial index.

[0054] Determine if the input value is located at the sampling point. If it is, return the corresponding LAB value directly. If not, proceed to interpolation calculation.

[0055] Calculate the volume weight of the input value relative to each vertex of the tetrahedral element, and calculate its LAB value based on the weight.

[0056] Preferably, the defect identification of the actual capping image using a dual mechanism includes the following steps:

[0057] The dual mechanism consists of machine recognition and human recognition;

[0058] The actual sealed image after color calibration is used as the image to be identified;

[0059] When using machine recognition, the outline of the beer cap and the gap between the bottle body are identified in the image to be recognized. The actual width of the gap is identified and the allowable width of the gap is obtained. If the actual width exceeds the allowable width, there is a sealing defect; otherwise, there is no defect.

[0060] When using manual recognition, sampling inspection is performed. The image of the beer cap in the image to be recognized is extracted and magnified by a preset factor to obtain the sampled image.

[0061] A qualified image of the beer bottle cap, magnified to a preset magnification, is pre-generated and used as a sample image;

[0062] A sealing defect exists when there is a visually perceptible difference between the gap between the sampled image and the original image; otherwise, no defect exists.

[0063] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0064] By setting up a camera and a light source emitter, and adjusting the light emitted by the light source emitter based on the images captured by the camera, combined with precise light control decisions based on triple feature output, automatic switching of light control modes is achieved, greatly improving the accuracy of light control. This ensures that the exposure of the acquired images is within a controllable range, making it easy for both machines and the human eye to recognize under its contrast conditions. By constructing a sophisticated light pattern calculation model, the brightness transition curves of adjacent zones are dynamically adjusted, reducing the halo diffusion radius and effectively suppressing the halo phenomenon. Color calibration is performed using a three-dimensional color lookup table, significantly improving color gamut performance and color accuracy, thereby avoiding the influence of the image itself when machines and the human eye recognize it. In addition, a dual mechanism is used for defect recognition of actual cover images. By magnifying the image, the human eye can accurately identify defects, thus performing a secondary verification of machine recognition and ensuring the overall accuracy of recognition. Attached Figure Description

[0065] Figure 1 This is a flowchart of the beer cap defect identification method based on image intelligent recognition according to the present invention;

[0066] Figure 2 The flowchart of this invention, which combines the three features of brightness, color, and edge gradient, outputs a precise light control decision.

[0067] Figure 3 The flowchart for constructing the precision optical pattern calculation model of this invention and dynamically adjusting the brightness transition curve of adjacent partitions;

[0068] Figure 4 This is a flowchart illustrating the process of brightness compensation in dark areas and dynamic compression in highlight areas according to the present invention.

[0069] Figure 5 This is a flowchart illustrating the present invention of dynamically adjusting the brightness attenuation curves of adjacent zones based on edge brightness differences to regulate halo suppression intensity.

[0070] Figure 6 The flowchart of the present invention describes the process of dynamically adjusting screen contrast by converting the input signal into a color gamut and performing color calibration using a three-dimensional color lookup table.

[0071] Figure 7 This is a flowchart illustrating the defect identification of actual cap images using a dual mechanism according to the present invention. Detailed Implementation

[0072] The following description is intended to disclose the invention and enable those skilled in the art to implement it. The preferred embodiments described below are merely examples, and other obvious variations will occur to those skilled in the art.

[0073] Reference Figure 1As shown, a method for identifying defects in beer bottle caps based on image intelligent recognition includes:

[0074] At least one camera and a light source emitter are set around the beer bottle cap detection position. The camera is located below the plane of the beer bottle cap, and the light source emitters are evenly distributed around the beer bottle cap in 360 degrees.

[0075] Extract the brightness distribution, color histogram, and edge gradient features from the camera's captured image, and combine these three features to output precise light control decisions, enabling automatic switching of light control modes;

[0076] Construct an elite light pattern calculation model and dynamically adjust the brightness transition curves of adjacent zones to reduce the halo diffusion radius;

[0077] Based on human visual perception habits, brightness compensation is performed on dark areas, and dynamic compression is performed on highlight areas;

[0078] Identify high-contrast edges in the image, dynamically adjust the brightness attenuation curves of adjacent zones based on the edge brightness difference, and adjust the halo suppression intensity.

[0079] Based on the actual capped image, the image contrast is dynamically adjusted, the input signal is color gamut converted, and color calibration is performed through a three-dimensional color lookup table;

[0080] A dual mechanism is used for defect identification in actual capped images.

[0081] During identification, the main defect is the sealing problem. The sealing is related to the gaps at the cap. Therefore, the identification process mainly focuses on the gaps.

[0082] When performing image recognition, the images of the cover will differ under different lighting conditions. Since there are backlit and illuminated parts of the cover without light processing, the images will differ, which may interfere with machine recognition. This is because the recognition scale is consistent, and different images will affect the recognition. In addition, the contrast varies under different lighting conditions, which leads to different difficulties in gap recognition and thus different recognition accuracy.

[0083] At the same time, since machine recognition has certain faults, manual verification is required. However, the defects in the gaps are extremely difficult to identify with the naked eye. Therefore, it is necessary to make the defects visible to the naked eye through image changes. In the following steps, a series of steps are taken to address the above issues.

[0084] Reference Figure 2 As shown, combining brightness, color, and edge gradient features, the precise light control decision output includes the following steps:

[0085] The image is divided into blocks, the average brightness value of each block is calculated, a brightness distribution histogram is generated, and the percentage of pixels in each brightness range is calculated.

[0086] The image was converted from the red-green-blue color space to the hue-saturation-brightness color space, and histograms of the three channels were calculated respectively.

[0087] Calculate the gradient magnitude and direction of the image, statistically analyze the distribution of gradient magnitude, and mark high gradient regions as edge regions;

[0088] The brightness distribution histogram and color histogram are jointly analyzed to calculate the joint statistics of brightness and color, output the brightness-color covariance matrix, and calculate the determinant value of the brightness-color covariance matrix.

[0089] The correlation between edge gradient features and brightness distribution is analyzed to calculate the correlation coefficient between edge gradient and brightness.

[0090] Based on brightness distribution, color histogram, and edge gradient features, thresholds are set for brightness, color, and edge gradient scores. The ratio of the edge gradient score threshold to the brightness score threshold is the correlation coefficient, and the ratio of the brightness score threshold to the color score threshold is the determinant value.

[0091] Determine whether the brightness, color, and edge gradient scores of each block are all higher than the corresponding threshold. If so, the block is determined to be a highlight area, and the local light control mode is switched to control the brightness of at least one light source emitter until the brightness, color, and edge gradient scores of each block are equal to the corresponding threshold. If not, no output is made.

[0092] Determine if the brightness distribution of the image is uniform and the edge gradient is below the corresponding threshold. If so, switch to global light control mode and synchronously increase the brightness of each block until the edge gradient equals the corresponding threshold. If not, do not output.

[0093] Determine if there are more than three blocks in the image whose edge gradient scores are higher than the corresponding threshold. If so, switch to local light control mode; otherwise, do not output anything.

[0094] The brightness-color covariance matrix is:

[0095]

[0096] In the formula, A is the brightness-color covariance matrix, Cov is the covariance function, and L, H, S, and V are brightness, hue, saturation, and lightness, respectively.

[0097] Multi-threaded parallel computation is used for block processing. The brightness threshold is set to the sum of the mean and standard deviation. The color threshold is set to the top 10 percentile of the histogram of each channel in the hue, saturation, and brightness color space. The gradient threshold is set to the 90th percentile of the gradient magnitude histogram. In the light control mode, the local light control mode is used for adjusting the brightness of the image corresponding to the highlight block, and the global light control mode is used for uniformly adjusting the brightness.

[0098] Reference Figure 3 As shown, constructing an elite beam pattern calculation model and dynamically adjusting the brightness transition curves of adjacent zones includes the following steps:

[0099] Ray tracing is used to simulate light propagation, and the light contribution of each partition to the target area is calculated to obtain a fine light pattern calculation model. The target area is the location of the camera.

[0100] The range of light contribution is divided into three equal parts and used as the first brightness difference threshold and the second brightness difference threshold, respectively, to obtain at least one image frame;

[0101] Determine whether the brightness difference of the light contribution of adjacent partitions to the target area in the current frame is less than the first brightness difference threshold. If yes, use the linear brightness transition curve; otherwise, do not output anything.

[0102] Determine whether the brightness difference of the light contribution of adjacent partitions to the target area in the current frame is greater than the second brightness difference threshold. If yes, use the Gaussian transition curve; otherwise, use the S-shaped growth transition curve.

[0103] The brightness adjustment values ​​of at least two consecutive frames are weighted and averaged. The brightness adjustment value of the current frame is recorded as the sum of 70% of the initial brightness value of the current frame and 30% of the brightness adjustment value of the previous frame. The weighted result is used to adjust adjacent partitions.

[0104] The S-shaped growth transition function is a common S-shaped function in biology. In information science, due to its monotonically increasing and inversely monotonically increasing properties, the S-shaped growth transition function is often used as an activation function for neural networks. It maps variables to a range of 0 and 1, establishing a 3D scene model, defining light source parameters (position, intensity, and spectrum), partition geometry, and material reflection and transmission properties. Monte Carlo ray tracing is used to emit randomly sampled rays from the light source, recording the reflection, refraction, and absorption paths of each ray. For each partition, the total energy of all rays hitting that partition is calculated and divided by the total number of emitted rays to obtain the normalized light contribution. GPU parallel computation of ray tracing is used. Light contribution is pre-calculated and cached for static scenes, while spatial partitioning is used to accelerate ray-partition intersection detection for dynamic scenes. The contribution heatmap of each partition is visualized to verify the rationality of the threshold selection.

[0105] Reference Figure 4As shown, the process of performing brightness compensation on dark areas and dynamic compression on highlight areas includes the following steps:

[0106] The dominant frequency is determined by calculating the spatial frequency distribution of the image using Fourier transform.

[0107] Calculate and output the contrast sensitivity function based on the dominant frequency;

[0108] The cone cell response of the photoreceptor was simulated by plotting the photoreceptor response curve;

[0109] By integrating the contrast sensitivity function and the nonlinear model of the photoreceptor, the differences in human eye sensitivity to different brightness regions are quantified.

[0110] The joint sensitivity is obtained by multiplying the photoreceptor response value by the contrast sensitivity function value.

[0111] Based on joint sensitivity, each zone is divided into dark and highlight areas. Brightness compensation is applied to the dark areas to improve the visibility of dark details, while dynamic compression is applied to the highlight areas to preserve highlight details and avoid overexposure.

[0112] The contrast sensitivity function is:

[0113]

[0114] In the formula, CSF(f) is the contrast sensitivity function, f is the spatial frequency, and C0 is the normalization constant, which is set to 100. L0 is the average brightness of the region, f0 is the reference brightness, γ is the dominant frequency, γ is the brightness sensitivity index, which is set to 0.2, and β and α are the dynamic adjustment index and dynamic adjustment coefficient, respectively.

[0115] The input image is converted to grayscale, and its frequency domain representation is calculated using Fast Fourier Transform. The spatial frequency distribution is calculated by radial averaging, and Gaussian fitting is performed on the radial averaging result. The frequency corresponding to the peak value is the dominant frequency. Through the above method, the entire chain optimization from image analysis to hardware control can be achieved, which significantly improves the dark details of the display, enhances visibility, and suppresses highlight overexposure.

[0116] Reference Figure 5 As shown, adjusting the brightness attenuation curves of adjacent zones dynamically based on edge brightness differences to regulate halo suppression intensity includes the following steps:

[0117] Calculate the gradient magnitude of edge pixels and weight them based on the gray-level variance of the local neighborhood to generate an edge intensity map;

[0118] By introducing directional gradient histogram features, edges in the horizontal, vertical and diagonal directions are distinguished and output;

[0119] A brightness gradient field is generated based on the edge intensity map, the brightness change rate between adjacent partitions is quantified, and the brightness decay curve is dynamically adjusted.

[0120] A Gaussian-S-shaped growth curve hybrid model was used to generate the brightness decay curve;

[0121] The steepness coefficient in the Gaussian-S-shaped growth curve hybrid model is preset based on the edge intensity map, and the Gaussian kernel width in the Gaussian-S-shaped growth curve hybrid model is preset based on the brightness gradient field;

[0122] The brightness of the partitions is redistributed, and the compensation brightness of adjacent partitions is calculated based on the brightness attenuation curve.

[0123] The halo radius and peak brightness of the beer cap are monitored in real time using a brightness sensor, and the halo suppression coefficient is calculated.

[0124] The halo suppression coefficient is fed back to the brightness decay curve model to dynamically adjust the steepness coefficient and Gaussian kernel width in the Gaussian-S-shaped growth curve hybrid model.

[0125] Based on the real-time nature of the display effect, the halo suppression coefficient can be fed back and dynamically adjusted in real time.

[0126] The Gaussian-S-type growth curve hybrid model is as follows:

[0127]

[0128] In the formula, L(x) is a Gaussian-S-type growth curve mixture model, L target denoted as target brightness, x0 as edge position, x as current position, k as steepness coefficient, and σ as Gaussian kernel width;

[0129] High-precision brightness sensors are evenly distributed around the beer cap. The brightness distribution matrix of the current frame is obtained through the sensors. Connectivity analysis is performed on each high-brightness area, the center point is marked, and the system expands outward in the radial direction to detect the boundary point where the brightness decays to 20% of the peak brightness. The average radius is calculated and output as the halo radius of the beer cap.

[0130] Reference Figure 6 As shown, dynamically adjusting the screen contrast, converting the input signal to its color gamut, and performing color calibration using a 3D color lookup table include the following steps:

[0131] The actual sealing image is displayed on an LCD screen, and the twisting angle of the liquid crystal molecules is dynamically adjusted.

[0132] In the high-brightness zone, the twist angle of the liquid crystal molecules is reduced to decrease the light transmittance and avoid overexposure.

[0133] Increasing the twist angle of liquid crystal molecules in the corresponding area of ​​the dark region improves light transmittance and enhances details in the dark area;

[0134] Uniform sampling is performed within the RGB cube to form a three-dimensional grid of points.

[0135] For the red, green and blue components of each sampling point, the LAB value of the target color gamut is obtained by measuring with a spectrophotometer, and an initial three-dimensional color lookup table is constructed.

[0136] The RGB cube is divided into at least two tetrahedral units, each of which consists of four sampling points;

[0137] Record the vertex index and adjacency relationship of each tetrahedral cell to form a data structure. For the input RGB value, determine the tetrahedral cell in which it belongs through the spatial index.

[0138] Determine if the input value is located at the sampling point. If it is, return the corresponding LAB value directly. If not, proceed to interpolation calculation.

[0139] Calculate the volume weight of the input value relative to each vertex of the tetrahedral element, and calculate its LAB value based on the weight. Then, perform color calibration based on the recalculated LAB value and the initial 3D color lookup table.

[0140] The volume weight is:

[0141]

[0142] In the formula, ω is the volume weight of the input value relative to the V0 vertex of the tetrahedral element, P is the input value, V0, V1, V2, and V3 are the four vertices of the tetrahedral element where the input value is located, and Vol is the volume function.

[0143] The liquid crystal driving voltage is calculated based on the adjusted torsion angle and applied to the liquid crystal panel through the driving chip. This ensures that the response time of the driving signal meets the display refresh rate requirements. By adjusting the torsion angle of the liquid crystal molecules in real time, the display effect in bright and dark areas is optimized. High-precision color conversion is achieved through sampling and interpolation to ensure accurate color reproduction. The liquid crystal control and color conversion processes need to be closely coordinated, and the display parameters are dynamically adjusted according to the actual brightness of the covered image.

[0144] Reference Figure 7 As shown, the defect identification of actual cap images using a dual mechanism includes the following steps:

[0145] The dual mechanism consists of machine recognition and human recognition;

[0146] The actual sealed image after color calibration is used as the image to be identified;

[0147] When using machine recognition, the outline of the beer cap and the gap between the bottle body are identified in the image to be recognized. The actual width of the gap is identified and the allowable width of the gap is obtained. If the actual width exceeds the allowable width, there is a sealing defect; otherwise, there is no defect.

[0148] When using manual recognition, sampling inspection is performed. The image of the beer cap in the image to be recognized is extracted and magnified by a preset factor to obtain the sampled image.

[0149] A qualified image of the beer bottle cap, magnified to a preset magnification, is pre-generated and used as a sample image;

[0150] A sealing defect exists when there is a visually perceptible difference between the gap between the sampled image and the original image; otherwise, no defect exists.

[0151] Manual identification is limited by the speed of identification and is carried out by sampling. Since the defects of the gaps are very small, they cannot be directly identified by the naked eye. Therefore, the image is magnified. The preset magnification is based on experience and is set according to the recognition ability of the human eye. This ensures that all gaps can be identified after magnification. In this way, the results of machine identification can be verified, thereby ensuring the overall accuracy of identification.

[0152] Furthermore, this solution also proposes a computer-readable storage medium storing a computer-readable program, which, when invoked, executes the aforementioned method for identifying beer cap defects based on image intelligent recognition.

[0153] It is understandable that the storage medium can be a magnetic medium, such as a floppy disk, hard disk, or magnetic tape; an optical medium, such as a DVD; or a semiconductor medium, such as a solid-state drive (SSD).

[0154] In summary, the advantages of this invention are as follows: By setting up a camera and a light source emitter, and adjusting the light emitted by the light source emitter based on the image captured by the camera, combined with precise light control decision-making based on triple feature output, automatic switching of light control mode is achieved, greatly improving the light control accuracy. This ensures that the exposure of the acquired image is within a controllable range, making it easy for both machines and the human eye to recognize under its contrast conditions. By constructing a sophisticated light pattern calculation model and dynamically adjusting the brightness transition curves of adjacent zones, the halo diffusion radius is reduced, effectively suppressing the halo phenomenon. Color calibration is performed using a three-dimensional color lookup table, significantly improving color gamut performance and color accuracy, thereby avoiding the influence of the image itself when machines and the human eye recognize it. In addition, the use of a dual mechanism for defect recognition of actual capped images allows for accurate defect recognition by the human eye by magnifying the image, thus performing a secondary verification of machine recognition and ensuring the overall accuracy of recognition.

[0155] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claimed invention. The scope of protection claimed by the appended claims and their equivalents is defined.

Claims

1. A method for identifying defects in beer bottle caps based on image intelligent recognition, characterized in that, include: At least one camera and a light source emitter are set around the beer bottle cap detection position. The camera is located below the plane of the beer bottle cap, and the light source emitters are evenly distributed around the beer bottle cap in 360 degrees. Extract the brightness distribution, color histogram, and edge gradient features from the camera's captured image, and combine these three features to output precise light control decisions, enabling automatic switching of light control modes; Construct an elite light pattern calculation model and dynamically adjust the brightness transition curves of adjacent zones to reduce the halo diffusion radius; Based on human visual perception habits, brightness compensation is performed on dark areas, and dynamic compression is performed on highlight areas; Identify high-contrast edges in the image, dynamically adjust the brightness attenuation curves of adjacent zones based on the edge brightness difference, and adjust the halo suppression intensity. Based on the actual capped image, the image contrast is dynamically adjusted, the input signal is color gamut converted, and color calibration is performed through a three-dimensional color lookup table; A dual mechanism is used for defect identification in actual capped images.

2. The method for identifying beer cap defects based on image intelligent recognition according to claim 1, characterized in that, The process of combining brightness, color, and edge gradient features to output precise light control decisions includes the following steps: The image is divided into blocks, the average brightness value of each block is calculated, a brightness distribution histogram is generated, and the percentage of pixels in each brightness range is calculated. The image was converted from the red-green-blue color space to the hue-saturation-brightness color space, and histograms of the three channels were calculated respectively. Calculate the gradient magnitude and direction of the image, statistically analyze the distribution of gradient magnitude, and mark high gradient regions as edge regions; The brightness distribution histogram and color histogram are jointly analyzed to calculate the joint statistics of brightness and color, output the brightness-color covariance matrix, and calculate the determinant value of the brightness-color covariance matrix. The correlation between edge gradient features and brightness distribution is analyzed to calculate the correlation coefficient between edge gradient and brightness. Based on brightness distribution, color histogram, and edge gradient features, thresholds are set for brightness, color, and edge gradient scores. The ratio of the edge gradient score threshold to the brightness score threshold is the correlation coefficient, and the ratio of the brightness score threshold to the color score threshold is the determinant value. Determine whether the brightness, color, and edge gradient scores of each block are all higher than the corresponding threshold. If so, the block is determined to be a highlight area, and the local light control mode is switched to control the brightness of at least one light source emitter until the brightness, color, and edge gradient scores of each block are equal to the corresponding threshold. If not, no output is made. Determine if the brightness distribution of the image is uniform and the edge gradient is below the corresponding threshold. If so, switch to global light control mode and synchronously increase the brightness of each block until the edge gradient equals the corresponding threshold. If not, do not output. Determine if there are more than three blocks in the image whose edge gradient scores are higher than the corresponding threshold. If so, switch to local light control mode; otherwise, do not output anything.

3. The method for identifying beer cap defects based on image intelligent recognition according to claim 2, characterized in that, The process of constructing a sophisticated optical pattern calculation model and dynamically adjusting the brightness transition curves of adjacent zones includes the following steps: Ray tracing is used to simulate light propagation, and the light contribution of each partition to the target area is calculated to obtain a fine light pattern calculation model. The target area is the location of the camera. The range of light contribution is divided into three equal parts and used as the first brightness difference threshold and the second brightness difference threshold, respectively, to obtain at least one image frame; Determine whether the brightness difference of the light contribution of adjacent partitions to the target area in the current frame is less than the first brightness difference threshold. If yes, use the linear brightness transition curve; otherwise, do not output anything. Determine whether the brightness difference of the light contribution of adjacent partitions to the target area in the current frame is greater than the second brightness difference threshold. If yes, use the Gaussian transition curve; otherwise, use the S-shaped growth transition curve. The brightness adjustment values ​​of at least two consecutive frames are weighted and averaged. The brightness adjustment value of the current frame is recorded as the sum of 70% of the initial brightness value of the current frame and 30% of the brightness adjustment value of the previous frame. The weighted result is used to adjust adjacent partitions.

4. The method for identifying beer cap defects based on image intelligent recognition according to claim 3, characterized in that, The process of brightness compensation in dark areas and dynamic compression in highlight areas includes the following steps: The dominant frequency is determined by calculating the spatial frequency distribution of the image using Fourier transform. Calculate and output the contrast sensitivity function based on the dominant frequency; The cone cell response of the photoreceptor was simulated by plotting the photoreceptor response curve; By integrating the contrast sensitivity function and the nonlinear model of the photoreceptor, the differences in human eye sensitivity to different brightness regions are quantified. The joint sensitivity is obtained by multiplying the photoreceptor response value by the contrast sensitivity function value. Based on joint sensitivity, each zone is divided into dark and highlight areas. Brightness compensation is applied to the dark areas to improve the visibility of dark details, while dynamic compression is applied to the highlight areas to preserve highlight details and avoid overexposure.

5. The method for identifying beer cap defects based on image intelligent recognition according to claim 4, characterized in that, The step of dynamically adjusting the brightness attenuation curves of adjacent zones based on edge brightness differences to regulate halo suppression intensity includes the following steps: Calculate the gradient magnitude of edge pixels and weight them based on the gray-level variance of the local neighborhood to generate an edge intensity map; By introducing directional gradient histogram features, edges in the horizontal, vertical and diagonal directions are distinguished and output; A brightness gradient field is generated based on the edge intensity map, the brightness change rate between adjacent partitions is quantified, and the brightness decay curve is dynamically adjusted. A Gaussian-S-shaped growth curve hybrid model was used to generate the brightness decay curve; The steepness coefficient in the Gaussian-S-shaped growth curve hybrid model is preset based on the edge intensity map, and the Gaussian kernel width in the Gaussian-S-shaped growth curve hybrid model is preset based on the brightness gradient field; The brightness of the partitions is redistributed, and the compensation brightness of adjacent partitions is calculated based on the brightness attenuation curve. The halo radius and peak brightness of the beer cap are monitored in real time using a brightness sensor, and the halo suppression coefficient is calculated. The halo suppression coefficient is fed back to the brightness decay curve model to dynamically adjust the steepness coefficient and Gaussian kernel width in the Gaussian-S-shaped growth curve hybrid model. Based on the real-time nature of the display effect, the halo suppression coefficient can be fed back and dynamically adjusted in real time.

6. The method for identifying beer cap defects based on image intelligent recognition according to claim 5, characterized in that, The dynamic adjustment of screen contrast, color gamut conversion of the input signal, and color calibration using a three-dimensional color lookup table include the following steps: The actual sealing image is displayed on an LCD screen, and the twisting angle of the liquid crystal molecules is dynamically adjusted. In the high-brightness zone, the twist angle of the liquid crystal molecules is reduced to decrease the light transmittance and avoid overexposure. Increasing the twist angle of liquid crystal molecules in the corresponding area of ​​the dark region improves light transmittance and enhances details in the dark area; Uniform sampling is performed within the RGB cube to form a three-dimensional grid of points. For the red, green and blue components of each sampling point, the LAB value of the target color gamut is obtained by measuring with a spectrophotometer, and an initial three-dimensional color lookup table is constructed. The RGB cube is divided into at least two tetrahedral units, each of which consists of four sampling points; Record the vertex index and adjacency relationship of each tetrahedral cell to form a data structure. For the input RGB value, determine the tetrahedral cell in which it belongs through the spatial index. Determine if the input value is located at the sampling point. If it is, return the corresponding LAB value directly. If not, proceed to interpolation calculation. Calculate the volume weight of the input value relative to each vertex of the tetrahedral element, and calculate its LAB value based on the weight. Then, perform color calibration based on the recalculated LAB value and the initial 3D color lookup table.

7. A method for identifying beer cap defects based on image intelligent recognition according to claim 6, characterized in that, The defect identification of actual cap images using a dual mechanism includes the following steps: The dual mechanism consists of machine recognition and human recognition; The actual sealed image after color calibration is used as the image to be identified; When using machine recognition, the outline of the beer cap and the gap between the bottle body are identified in the image to be recognized. The actual width of the gap is identified and the allowable width of the gap is obtained. If the actual width exceeds the allowable width, there is a sealing defect; otherwise, there is no defect. When using manual recognition, sampling inspection is performed. The image of the beer cap in the image to be recognized is extracted and magnified by a preset factor to obtain the sampled image. A qualified image of the beer bottle cap, magnified to a preset magnification, is pre-generated and used as a sample image; A sealing defect exists when there is a visually perceptible difference between the gap between the sampled image and the original image; otherwise, no defect exists.

Citation Information

Patent Citations

  • Backlight brightness control method, backlight brightness control device and display terminal

    CN105047145A

  • Precise copper material surface defect identification method and system based on optical online detection

    CN119354971A