Beer sealing cover defect identification method based on image intelligent identification

By setting up cameras and light emitters in beer cap detection, combining brightness, color and edge gradient features to make light control decisions, building an elite light type calculation model, dynamically adjusting the brightness transition curve, performing brightness compensation and halo suppression, using a three-dimensional color lookup table for color calibration, and combining machine and manual recognition, the problem of light interference in beer cap defect recognition is solved, achieving high-precision and high-accuracy recognition.

CN120635017AActive Publication Date: 2025-09-12BUDWEISER BEER FOSHAN

Patent Information

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

Smart Images

  • Figure CN120635017A_ABST
    Figure CN120635017A_ABST
Patent Text Reader

Abstract

The invention discloses a beer sealing cover defect identification method based on image intelligent identification, and relates to the field of image identification, and the method comprises the steps: extracting the brightness distribution, color histogram and edge gradient features of a picture shot by a camera; constructing a precise light type calculation model, and dynamically adjusting brightness transition curves of adjacent partitions; identifying a high-contrast edge in the picture, and dynamically adjusting a brightness decay curve of adjacent partitions according to an edge brightness difference; color calibration is carried out through a three-dimensional color lookup table; and performing defect identification on an actual sealing cover image by using a dual mechanism. The light rays of the light source emitter are regulated and controlled, so that under the contrast condition, a machine and human eyes are easy to identify, the halo diffusion radius is reduced, and color calibration is carried out through the three-dimensional color lookup table, so that the machine and the human eyes are prevented from being influenced by images during identification, and the overall identification accuracy is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image recognition, and in particular to a beer cap defect recognition method based on image intelligent recognition. Background Art

[0002] Today, there is a high demand for automatic and accurate defect segmentation in the manufacturing industry. In manufacturing, for example, in beer cap defect identification, there is a growing demand for automated visual inspection technologies for defect segmentation. However, due to lighting conditions, images used for defect identification can suffer from issues such as loss of detail in dark areas, overexposure of highlights, and severe haloing. These issues significantly interfere with identification, and machine recognition, due to a certain failure rate, requires manual review. However, manual recognition accuracy is difficult to control, making accurate identification difficult to achieve. Consequently, the overall credibility of the recognition results needs to be improved. Summary of the Invention

[0003] In order to solve the above technical problems, a method for identifying beer cap defects based on image intelligent recognition is provided. This technical solution solves the problems raised in the above background technology.

[0004] In order to achieve the above objects, the technical solution adopted by the present invention is:

[0005] A beer cap defect recognition method based on image intelligent recognition, comprising:

[0006] At least one camera and light source emitter are arranged around the beer cap detection position, the camera is located below the plane where the beer bottle cap is located, and the light source emitters are evenly distributed 360 degrees around the beer bottle cap;

[0007] Extracts the brightness distribution, color histogram, and edge gradient features of the camera image, and combines these features to output precise light control decisions, enabling automatic switching of light control modes.

[0008] Build an elite light type calculation model to dynamically adjust the brightness transition curve of adjacent partitions and reduce the halo diffusion radius;

[0009] Based on the human eye's 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 curve of adjacent partitions based on the edge brightness difference, and adjust the halo suppression strength;

[0011] Based on the actual cover image, the image contrast is dynamically adjusted, the input signal is converted into a color gamut, and color calibration is performed using a three-dimensional color lookup table.

[0012] A dual mechanism is used for defect recognition of the actual capping image.

[0013] Preferably, the step of combining the triple features of brightness, color and edge gradient to output a precise light control decision comprises the following steps:

[0014] Divide the image into blocks, calculate the average brightness value of each block, generate a brightness distribution histogram, and count the percentage of pixels in each brightness range;

[0015] Convert the image from the red, green and blue color space to the hue, saturation and lightness color space, and calculate the histograms of the three channels respectively;

[0016] Calculate the gradient magnitude and direction of the image, count the distribution of the gradient magnitude, and mark the high gradient area as the edge area;

[0017] Perform joint analysis on the brightness distribution histogram and the color histogram, calculate the joint statistics of brightness and color, output the brightness-color covariance matrix, and calculate the determinant value corresponding to the brightness-color covariance matrix;

[0018] Conduct correlation analysis on edge gradient features and brightness distribution, and calculate the correlation coefficient between edge gradient and brightness;

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

[0020] Determine whether the brightness, color, and edge gradient scores of each block are all higher than the corresponding thresholds. 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 thresholds. If not, no output is made;

[0021] Determine whether the brightness distribution of the image is uniform and the edge gradient is lower than the corresponding threshold. If so, switch to global light control mode and simultaneously increase the brightness of each block until the edge gradient is equal to the corresponding threshold. If not, no output is made;

[0022] Determine whether the number of blocks in the image whose edge gradient scores are higher than the corresponding threshold is greater than three. If so, switch to local light control mode; otherwise, do not output.

[0023] Preferably, the construction of an elite light type calculation model and the dynamic adjustment of the brightness transition curve of adjacent partitions include the following steps:

[0024] Use ray tracing to simulate light propagation and calculate the light contribution of each partition to the target area to obtain an elite light pattern calculation model. The target area is the location of the camera.

[0025] Divide the value range of the light contribution into three equal parts as a first brightness difference threshold and a 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 a first brightness difference threshold. If so, use a linear brightness transition curve; if not, do not output;

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

[0028] The brightness adjustment values ​​of at least two consecutive frames are weighted 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 control the adjacent partitions.

[0029] Preferably, the brightness compensation for the dark area and the dynamic compression for the highlight area include the following steps:

[0030] Calculate the spatial frequency distribution of the image through Fourier transform and determine the dominant frequency;

[0031] Based on the dominant frequency, the contrast sensitivity function is calculated and output;

[0032] By plotting the photoreceptor response curve, the cone cell response of the nonlinear model of the photoreceptor is simulated;

[0033] By integrating the contrast sensitivity function with the nonlinear model of photoreceptors, the sensitivity differences of the human eye to different brightness areas are quantified.

[0034] The photoreceptor response value is multiplied by the contrast sensitivity function value to obtain the joint sensitivity;

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

[0036] Preferably, dynamically adjusting the brightness attenuation curves of adjacent partitions according to the edge brightness difference to adjust the halo suppression intensity includes the following steps:

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

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

[0039] Generate a brightness gradient field based on the edge intensity map, quantify the brightness change rate between adjacent partitions, and dynamically adjust the brightness attenuation curve;

[0040] A Gaussian-Sigmoid growth curve mixture model was used to generate the brightness decay curve;

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

[0042] Redistributing the brightness of the partitions and calculating the compensation brightness of adjacent partitions according to the brightness attenuation curve;

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

[0044] Feedback the halo suppression coefficient to the brightness attenuation 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 display effect, real-time feedback and dynamic adjustment of the halo suppression coefficient are achieved.

[0046] Preferably, the dynamically adjusting the picture contrast, converting the input signal into a color gamut, and performing color calibration using a three-dimensional color lookup table comprises the following steps:

[0047] The actual capping image is displayed on a liquid crystal screen, and the torsion angle of the liquid crystal molecules is dynamically adjusted;

[0048] Reduce the twist angle of liquid crystal molecules in the corresponding area of ​​the highlight partition to reduce light transmittance and avoid overexposure;

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

[0050] Uniform sampling in the RGB cube to form a three-dimensional grid point;

[0051] For each sampling point, the red, green and blue color components are measured by a spectrophotometer to obtain their LAB values ​​in the target color gamut and construct an initial three-dimensional color lookup table.

[0052] Divide the RGB cube 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 unit to form a data structure. For the input RGB value, determine the tetrahedral unit where it is located through the spatial index;

[0054] Determine whether the input value is located at the sampling point. If so, directly return the corresponding LAB value. If not, enter the interpolation calculation;

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

[0056] Preferably, the method of using a dual mechanism to identify defects in the actual capping image comprises the following steps:

[0057] The dual mechanisms are machine recognition and human recognition;

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

[0059] When using machine recognition, the gap between the outline of the beer cap and the bottle body is 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 manual recognition is used, sampling detection is performed, and the image of the beer cap in the image to be recognized is extracted and magnified by a preset multiple to obtain a sampling image;

[0061] Pre-form a qualified image of the beer cap magnified at a preset multiple as a sample image;

[0062] When there is a gap between the sampling image and the sample image that is discernible to the human eye, there is a sealing defect; otherwise, there is no defect.

[0063] Compared with the prior art, the present invention has the following beneficial effects:

[0064] By setting up a camera and a light source emitter, and adjusting the light of the light source emitter according to the image captured by the camera, the triple feature output is combined to make precise light control decisions, thereby realizing automatic switching of light control modes and greatly improving the light control accuracy. The exposure of the acquired image is within a controllable range, making it easy for machines and human eyes to identify under its contrast conditions. By constructing an elite light type calculation model, the brightness transition curve of adjacent partitions is dynamically adjusted, the halo diffusion radius is reduced, and the halo phenomenon is effectively suppressed. Color calibration is performed through a three-dimensional color lookup table, which significantly improves the color gamut performance and color accuracy, thereby avoiding the influence of the image itself when the machine and human eye are identifying. In addition, the use of a dual mechanism for defect identification of the actual capping image can enable the human eye to accurately identify the defects by amplifying the image, thereby performing a secondary verification of the machine identification to ensure the accuracy of the overall identification. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] Figure 1 This is a flow chart of the beer cap defect recognition method based on image intelligent recognition of the present invention;

[0066] Figure 2 This is a flowchart of the present invention that combines the triple features of brightness, color, and edge gradient to output precise light control decisions;

[0067] Figure 3 A flowchart of the invention for constructing an elite light type calculation model and dynamically adjusting the brightness transition curves of adjacent partitions;

[0068] Figure 4 This is a flow chart of the present invention for performing brightness compensation on dark areas and dynamic compression on highlight areas;

[0069] Figure 5 This is a flow chart of dynamically adjusting the brightness attenuation curves of adjacent partitions according to edge brightness differences and adjusting the halo suppression intensity of the present invention;

[0070] Figure 6 Flowchart of the present invention for dynamically adjusting picture contrast, converting the input signal into a color gamut, and performing color calibration using a three-dimensional color lookup table;

[0071] Figure 7 Flowchart of the defect recognition of actual cover image using dual mechanism of the present invention. DETAILED DESCRIPTION

[0072] The following description is intended to disclose the present invention so that those skilled in the art can implement the present invention. The preferred embodiments described below are only examples, and those skilled in the art may conceive of other obvious variations.

[0073] Reference Figure 1As shown, a beer cap defect recognition method based on image intelligent recognition includes:

[0074] At least one camera and light source emitter are arranged around the beer cap detection position, the camera is located below the plane where the beer bottle cap is located, and the light source emitters are evenly distributed 360 degrees around the beer bottle cap;

[0075] Extracts the brightness distribution, color histogram, and edge gradient features of the camera image, and combines these features to output precise light control decisions, enabling automatic switching of light control modes.

[0076] Build an elite light type calculation model to dynamically adjust the brightness transition curve of adjacent partitions and reduce the halo diffusion radius;

[0077] Based on the human eye's 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 curve of adjacent partitions based on the edge brightness difference, and adjust the halo suppression strength;

[0079] Based on the actual cover image, the image contrast is dynamically adjusted, the input signal is converted into a color gamut, and color calibration is performed using a three-dimensional color lookup table.

[0080] A dual mechanism is used for defect recognition of the actual capping image.

[0081] During identification, the main defect is the sealing problem. The sealing is related to the gap at the cover. Therefore, the gap is mainly identified during identification.

[0082] During image recognition, the images of the cover obtained under different lighting effects are different. Since the cover has a backlit part and a light-facing part when there is no light processing, there will be differences in the images of the two. This may interfere with machine recognition because the recognition scale is consistent and different images will affect recognition. In addition, the contrast is different under different lighting conditions, which leads to different difficulties in gap recognition and, therefore, different recognition accuracy rates.

[0083] At the same time, due to certain failures in machine recognition, manual review is required, but the defects of the gap 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, and then a series of steps are generated to solve the above problems.

[0084] Reference Figure 2 As shown, combining the triple features of brightness, color, and edge gradient to output accurate light control decisions includes the following steps:

[0085] Divide the image into blocks, calculate the average brightness value of each block, generate a brightness distribution histogram, and count the percentage of pixels in each brightness range;

[0086] Convert the image from the red, green and blue color space to the hue, saturation and lightness color space, and calculate the histograms of the three channels respectively;

[0087] Calculate the gradient magnitude and direction of the image, count the distribution of the gradient magnitude, and mark the high gradient area as the edge area;

[0088] Perform joint analysis on the brightness distribution histogram and the color histogram, calculate the joint statistics of brightness and color, output the brightness-color covariance matrix, and calculate the determinant value corresponding to the brightness-color covariance matrix;

[0089] Conduct correlation analysis on edge gradient features and brightness distribution, and calculate the correlation coefficient between edge gradient and brightness;

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

[0091] Determine whether the brightness, color, and edge gradient scores of each block are all higher than the corresponding thresholds. 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 thresholds. If not, no output is made;

[0092] Determine whether the brightness distribution of the image is uniform and the edge gradient is lower than the corresponding threshold. If so, switch to global light control mode and simultaneously increase the brightness of each block until the edge gradient is equal to the corresponding threshold. If not, no output is made;

[0093] Determine whether the number of blocks in the image whose edge gradient scores are higher than the corresponding threshold is greater than three. If so, switch to local light control mode; otherwise, do not output.

[0094] The brightness-color covariance matrix is:

[0095]

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

[0097] Multi-threaded parallel computing is used for block processing. The brightness threshold is set to the sum of the mean and the standard deviation, the color threshold is set to the first 10% quantile of the histogram of each channel in the hue, saturation and lightness color space, and the gradient threshold is set to the 90% quantile of the gradient amplitude histogram. In the light control mode, the local light control mode is used to dim the edge cover image corresponding to the highlight block, and the global light control mode is used to uniformly adjust the brightness.

[0098] Reference Figure 3 As shown, building an elite light type calculation model and dynamically adjusting the brightness transition curve of adjacent partitions includes the following steps:

[0099] Use ray tracing to simulate light propagation and calculate the light contribution of each partition to the target area to obtain an elite light pattern calculation model. The target area is the location of the camera.

[0100] Divide the value range of the light contribution into three equal parts as a first brightness difference threshold and a 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 a first brightness difference threshold. If so, use a linear brightness transition curve; if not, do not output;

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

[0103] The brightness adjustment values ​​of at least two consecutive frames are weighted 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 control the adjacent partitions.

[0104] The S-shaped growth transition curve function is a common S-shaped function in biology. In information science, due to its monotonic and inverse monotonic properties, the S-shaped growth transition curve function is often used as an activation function in neural networks. It maps variables to between 0 and 1, establishes a three-dimensional scene model, and defines the light source parameters, position, intensity, and spectrum, partition geometry, and material reflection and transmission properties. The light generation algorithm Monte Carlo ray tracing is used to emit randomly sampled light from the light source, and the reflection, refraction, and absorption paths of each ray are recorded. For each partition, the total energy of all rays hitting the partition is counted and divided by the total number of emitted rays to obtain the normalized light contribution. The GPU is used to parallelize ray tracing, pre-calculate the light contribution cache for static scenes, and use spatial partitioning to accelerate ray-partition intersection detection for dynamic scenes. The contribution heat map of each partition is visualized to verify the rationality of the threshold selection.

[0105] Reference Figure 4As shown, brightness compensation for dark areas and dynamic compression for highlight areas include the following steps:

[0106] Calculate the spatial frequency distribution of the image through Fourier transform and determine the dominant frequency;

[0107] Based on the dominant frequency, the contrast sensitivity function is calculated and output;

[0108] By plotting the photoreceptor response curve, the cone cell response of the nonlinear model of the photoreceptor is simulated;

[0109] By integrating the contrast sensitivity function with the nonlinear model of photoreceptors, the sensitivity differences of the human eye to different brightness areas are quantified.

[0110] The photoreceptor response value is multiplied by the contrast sensitivity function value to obtain the joint sensitivity;

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

[0112] The contrast sensitivity function is:

[0113]

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

[0115] The input image is converted into a grayscale image, and the frequency domain representation is calculated using fast Fourier transform. The spatial frequency distribution is calculated through radial averaging, and Gaussian fitting is performed on the radial averaging result. The frequency corresponding to the peak is the dominant frequency. Through the above method, full-link optimization from image analysis to hardware control can be achieved, significantly improving the displayed dark details, enhancing visibility while suppressing highlight overexposure.

[0116] Reference Figure 5 As shown, dynamically adjusting the brightness attenuation curve of adjacent partitions according to the edge brightness difference and adjusting the halo suppression intensity include the following steps:

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

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

[0119] Generate a brightness gradient field based on the edge intensity map, quantify the brightness change rate between adjacent partitions, and dynamically adjust the brightness attenuation curve;

[0120] A Gaussian-Sigmoid growth curve mixture model was used to generate the brightness decay curve;

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

[0122] Redistributing the brightness of the partitions and calculating the compensation brightness of adjacent partitions according to the brightness attenuation curve;

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

[0124] Feedback the halo suppression coefficient to the brightness attenuation 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 display effect, real-time feedback and dynamic adjustment of the halo suppression coefficient are achieved.

[0126] The Gaussian-S-type growth curve mixed model is:

[0127]

[0128] Where L(x) is the Gaussian-S type growth curve mixed model, L target is the target brightness, x0 is the edge position, x is the current position, k is the steepness coefficient, and σ is the 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. Connected domain analysis is performed on each high-brightness area, the center point is marked, and the area is expanded outward in the radial direction. The boundary points where the brightness decays to 20% of the peak brightness are detected. The average radius is calculated and output as the halo radius of the beer cap.

[0130] Reference Figure 6 As shown, dynamically adjusting the image contrast, converting the input signal into a color gamut, and performing color calibration using a three-dimensional color lookup table include the following steps:

[0131] The actual capping image is displayed on a liquid crystal screen, and the torsion angle of the liquid crystal molecules is dynamically adjusted;

[0132] Reduce the twist angle of liquid crystal molecules in the corresponding area of ​​the highlight partition to reduce light transmittance and avoid overexposure;

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

[0134] Uniform sampling in the RGB cube to form a three-dimensional grid point;

[0135] For each sampling point, the red, green and blue color components are measured by a spectrophotometer to obtain their LAB values ​​in the target color gamut and construct an initial three-dimensional color lookup table.

[0136] Divide the RGB cube 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 unit to form a data structure. For the input RGB value, determine the tetrahedral unit where it is located through the spatial index;

[0138] Determine whether the input value is located at the sampling point. If so, directly return the corresponding LAB value. If not, enter the interpolation calculation;

[0139] The volume weight of the input value relative to each vertex of the tetrahedral unit is calculated, and its LAB value is calculated according to the weight. The color is calibrated according to the recalculated LAB value and the initial three-dimensional color lookup table.

[0140] The volume weight is:

[0141]

[0142] Where ω is the volume weight of the input value relative to the V0 vertex of the tetrahedron unit, P is the input value, V0, V1, V2, and V3 are the four vertices of the tetrahedron unit 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 driver chip to ensure that the response time of the driving signal meets the display refresh rate requirements. The torsion angle of the liquid crystal molecules is adjusted in real time to optimize the display effects of highlight and dark areas. High-precision color conversion is achieved through sampling and interpolation to ensure the accuracy of color reproduction. The liquid crystal control and color conversion processes need to work closely together to dynamically adjust the display parameters according to the actual brightness of the cover image.

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

[0145] The dual mechanisms are machine recognition and human recognition;

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

[0147] When using machine recognition, the gap between the outline of the beer cap and the bottle body is 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 manual recognition is used, sampling detection is performed, and the image of the beer cap in the image to be recognized is extracted and magnified by a preset multiple to obtain a sampling image;

[0149] Pre-form a qualified image of the beer cap magnified at a preset multiple as a sample image;

[0150] When there is a gap between the sampling image and the sample image that is discernible to the human eye, there is a sealing defect; otherwise, there is no defect.

[0151] Manual recognition is limited by the recognition speed and is carried out in a sampling manner. Since the defects of the gaps are very small, they cannot be directly recognized by the naked eye. Therefore, the image is magnified. The preset magnification is a magnification based on experience and is set according to the recognition ability of the naked eye to ensure that all gaps can be recognized after magnification by the preset magnification. Therefore, the results of machine recognition can be verified to ensure the accuracy of overall recognition.

[0152] Furthermore, the present solution also proposes a computer-readable storage medium on which a computer-readable program is stored. When the computer-readable program is called, the above-mentioned beer cap defect recognition method based on image intelligent recognition is executed.

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

[0154] To sum up, the advantages of the present invention are: by setting a camera and a light source emitter, and regulating the light of the light source emitter according to the image captured by the camera, combining the triple feature output to make precise light control decisions, realizing automatic switching of light control modes, greatly improving the light control accuracy, and making the exposure of the acquired image within a controllable range, so that it is easy for machines and human eyes to identify under its contrast conditions, by constructing an elite light type calculation model, dynamically adjusting the brightness transition curve of adjacent partitions, reducing the halo diffusion radius, and effectively suppressing the halo phenomenon, and performing color calibration through a three-dimensional color lookup table, significantly improving the color gamut performance and color accuracy, thereby avoiding the influence of the image itself when the machine and human eye are recognized, and using a dual mechanism to identify defects in the actual cover image, the human eye can accurately identify defects by amplifying the image, thereby performing secondary verification of the machine recognition to ensure the accuracy of the overall recognition.

[0155] The above shows and describes 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 above embodiments and descriptions merely illustrate the principles of the present invention. Various changes and modifications may be made to the present invention without departing from the spirit and scope of the present invention. Such changes and modifications are intended to fall within the scope of the present invention. The scope of protection claimed by the present invention is defined by the appended claims and their equivalents.

Claims

1. A beer cap defect recognition method based on image intelligent recognition, characterized in that: include: At least one camera and light source emitter are arranged around the beer cap detection position, the camera is located below the plane where the beer bottle cap is located, and the light source emitters are evenly distributed 360 degrees around the beer bottle cap; Extracts the brightness distribution, color histogram, and edge gradient features of the camera image, and combines these features to output precise light control decisions, enabling automatic switching of light control modes. Build an elite light type calculation model to dynamically adjust the brightness transition curve of adjacent partitions and reduce the halo diffusion radius; Based on the human eye's 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 curve of adjacent partitions based on the edge brightness difference, and adjust the halo suppression strength; Based on the actual cover image, the image contrast is dynamically adjusted, the input signal is converted into a color gamut, and color calibration is performed using a three-dimensional color lookup table. A dual mechanism is used for defect recognition of the actual capping image.

2. The beer cap defect recognition method based on image intelligent recognition according to claim 1 is characterized in that: Combining the brightness, color, and edge gradient features to output accurate light control decisions includes the following steps: Divide the image into blocks, calculate the average brightness value of each block, generate a brightness distribution histogram, and count the percentage of pixels in each brightness range; Convert the image from the red, green and blue color space to the hue, saturation and lightness color space, and calculate the histograms of the three channels respectively; Calculate the gradient magnitude and direction of the image, count the distribution of the gradient magnitude, and mark the high gradient area as the edge area; Perform joint analysis on the brightness distribution histogram and the color histogram, calculate the joint statistics of brightness and color, output the brightness-color covariance matrix, and calculate the determinant value corresponding to the brightness-color covariance matrix; Conduct correlation analysis on edge gradient features and brightness distribution, and calculate the correlation coefficient between edge gradient and brightness; Based on the brightness distribution, color histogram and edge gradient features, the thresholds of brightness, color and edge gradient scores are set. The ratio of the threshold of edge gradient score to the threshold of brightness score is the correlation coefficient, and the ratio of the threshold of brightness score to the threshold of color score is the determinant value. Determine whether the brightness, color, and edge gradient scores of each block are all higher than the corresponding thresholds. 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 thresholds. If not, no output is made; Determine whether the brightness distribution of the image is uniform and the edge gradient is lower than the corresponding threshold. If so, switch to global light control mode and simultaneously increase the brightness of each block until the edge gradient is equal to the corresponding threshold. If not, no output is made; Determine whether the number of blocks in the image whose edge gradient scores are higher than the corresponding threshold is greater than three. If so, switch to local light control mode; otherwise, do not output.

3. The beer cap defect recognition method based on image intelligent recognition according to claim 2, characterized in that: The construction of the elite light type calculation model and the dynamic adjustment of the brightness transition curve of adjacent partitions include the following steps: Use ray tracing to simulate light propagation and calculate the light contribution of each partition to the target area to obtain an elite light pattern calculation model. The target area is the location of the camera. Divide the value range of the light contribution into three equal parts as a first brightness difference threshold and a 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 a first brightness difference threshold. If so, use a linear brightness transition curve; if not, do not output; Determine whether the brightness difference of the light contribution of adjacent partitions to the target area in the current frame is greater than a second brightness difference threshold. If so, use the Gaussian transition curve; if not, use the S-type growth transition curve; The brightness adjustment values ​​of at least two consecutive frames are weighted 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 control the adjacent partitions.

4. The beer cap defect recognition method based on image intelligent recognition according to claim 3 is characterized in that: The brightness compensation of the dark area and the dynamic compression of the highlight area include the following steps: Calculate the spatial frequency distribution of the image through Fourier transform and determine the dominant frequency; Based on the dominant frequency, the contrast sensitivity function is calculated and output; By plotting the photoreceptor response curve, the cone cell response of the nonlinear model of the photoreceptor is simulated; By integrating the contrast sensitivity function with the nonlinear model of photoreceptors, the sensitivity differences of the human eye to different brightness areas are quantified. The photoreceptor response value is multiplied by the contrast sensitivity function value to obtain the joint sensitivity; Based on the joint sensitivity, each partition is divided into dark areas and highlight areas. Brightness compensation is performed on the dark areas to improve the visibility of dark details, and dynamic compression is performed on the highlight areas to retain highlight details and avoid overexposure.

5. The beer cap defect recognition method based on image intelligent recognition according to claim 4 is characterized in that: The step of dynamically adjusting the brightness attenuation curves of adjacent partitions according to the edge brightness difference to adjust the halo suppression intensity comprises the following steps: Calculate the gradient magnitude of edge pixels and weight them based on the grayscale variance of the local neighborhood to generate an edge intensity map; By introducing the directional gradient histogram feature, edges in the horizontal, vertical and diagonal directions are distinguished and output; Generate a brightness gradient field based on the edge intensity map, quantify the brightness change rate between adjacent partitions, and dynamically adjust the brightness attenuation curve; A Gaussian-Sigmoid growth curve mixture model was used to generate the brightness decay curve; The steepness coefficient in the Gaussian-S type growth curve mixture model is preset based on the edge intensity map, and the Gaussian kernel width in the Gaussian-S type growth curve mixture model is preset based on the brightness gradient field; Redistributing the brightness of the partitions and calculating the compensation brightness of adjacent partitions according to the brightness attenuation curve; The halo radius and peak brightness of the beer cap are monitored in real time by a brightness sensor, and the halo suppression coefficient is calculated. Feedback the halo suppression coefficient to the brightness attenuation 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 display effect, real-time feedback and dynamic adjustment of the halo suppression coefficient are achieved.

6. The beer cap defect recognition method based on image intelligent recognition according to claim 5 is characterized in that: The method of dynamically adjusting the image contrast, converting the color gamut of the input signal, and performing color calibration using a three-dimensional color lookup table comprises the following steps: The actual capping image is displayed on a liquid crystal screen, and the torsion angle of the liquid crystal molecules is dynamically adjusted; Reduce the twist angle of liquid crystal molecules in the corresponding area of ​​the highlight partition to reduce light transmittance and avoid overexposure; Increasing the twist angle of liquid crystal molecules in the corresponding area of ​​the dark area improves the light transmittance and enhances the dark details; Uniform sampling in the RGB cube to form a three-dimensional grid point; For each sampling point, the red, green and blue color components are measured by a spectrophotometer to obtain their LAB values ​​in the target color gamut and construct an initial three-dimensional color lookup table. Divide the RGB cube into at least two tetrahedral units, each of which consists of four sampling points; Record the vertex index and adjacency relationship of each tetrahedral unit to form a data structure. For the input RGB value, determine the tetrahedral unit where it is located through the spatial index; Determine whether the input value is located at the sampling point. If so, directly return the corresponding LAB value. If not, enter the interpolation calculation; The volume weight of the input value relative to each vertex of the tetrahedral unit is calculated, and its LAB value is calculated according to the weight. The color is calibrated according to the recalculated LAB value and the initial three-dimensional color lookup table.

7. The beer cap defect recognition method based on image intelligent recognition according to claim 6, characterized in that: The defect recognition of the actual capping image using the dual mechanism includes the following steps: The dual mechanisms are machine recognition and human recognition; The actual capping image after color calibration is used as the image to be recognized; When using machine recognition, the gap between the outline of the beer cap and the bottle body is 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 manual recognition is used, sampling detection is performed, and the image of the beer cap in the image to be recognized is extracted and magnified by a preset multiple to obtain a sampling image; Pre-form a qualified image of the beer cap magnified at a preset multiple as a sample image; When there is a gap between the sampling image and the sample image that is discernible to the human eye, there is a sealing defect; otherwise, there is no defect.

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

  • Glass wine bottle surface defect detection method and system

    CN119438210A

  • Cap sealing visual detection method, device and system applied to beverage bottle cap

    CN119741546A

  • Hhalo suppression method based on edge compensation and backlight system

    CN120071845A

Cited By

  • Intelligent imaging device based on multi-spectral linear array and adaptive light source

    CN121298610A

  • Leaf vein detection method and detection equipment for ryegrass

    CN121305534A

  • Exposure compensation method based on light intensity adaptive identification

    CN121691923A