Cigarette packaging material color difference detection model construction method, detection method, device, equipment and storage medium

Through the hyperspectral imaging system and chromatic aberration detection model, the accuracy of chromatic aberration detection of cigarette packaging materials is solved, and more accurate chromatic aberration measurement is achieved, reducing returns and rework.

CN120385666APending Publication Date: 2025-07-29JILIN TOBACCO IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510474969.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-16
Publication Date
2025-07-29

AI Technical Summary

Technical Problem

The existing chromatic difference detection methods for cigarette packaging materials have problems such as large individual differences, large ambient light influence, and inaccurate detection. Especially in high brightness or light colors, the effect is poor and cannot meet the requirements of high-quality control.

Method used

The hyperspectral imaging system is used to collect images of standard samples and production products. After black and white correction and smoothing processing, the spectral reflectivity data is calculated. Combined with Euclidean distance, spectral angle matching, spectral correlation angle and spectral information divergence, a chromatic difference detection model of cigarette packaging materials is constructed. The chromatic difference value and similarity are calculated to achieve more accurate chromatic difference detection.

Benefits of technology

It improves the accuracy of chromatic aberration measurement of cigarette packaging materials, reduces returns and rework phenomena, and is suitable for packaging material inspection of complex patterns or multi-color combinations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120385666A_ABST
    Figure CN120385666A_ABST
Patent Text Reader

Abstract

The invention discloses a cigarette packaging material color difference detection model construction method, a detection method, a detection device, equipment and a storage medium, and the method comprises the following steps: receiving images of a production product and a standard sample related to a cigarette packaging material in different wave bands, and sequentially carrying out black and white correction, spectral reflectivity data extraction and smoothing treatment; calculating the Euclidean distance, spectral angle matching, spectral correlation angle and spectral information divergence of the cigarette packaging material between the production product and the standard sample; based on a preset Euclidean distance, spectral angle matching, a spectral correlation angle and a spectral information divergence comprehensive measurement formula, calculating the similarity between the production product and the standard sample about the cigarette packaging material, and inputting the similarity into a cigarette packaging material color difference detection model to obtain a color difference value between the production product and the standard sample; and obtaining the color difference grade between the produced product and the standard sample based on a preset color difference grading rule. The accuracy of the color difference measurement result of the cigarette packaging material is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of cigarette production, and in particular, to a method for constructing a detection model for color difference of cigarette packaging materials, a detection method, a device, equipment and a storage medium. Background Art

[0002] Currently, due to differences in printing materials and printing processes, there are often certain color differences between printed products and the original manuscripts. Cigarettes produced using packaging with color differences may require rework, and there may also be cases of returns after being sold due to improper detection. Therefore, in order to reduce returns and rework phenomena, it is particularly important to accurately measure and control color differences.

[0003] The evaluation methods for color difference of cigarette packaging materials mainly include subjective visual inspection method, color difference meter analysis method and near-infrared spectrometer analysis method. The subjective visual inspection method judges the color difference of packaging materials by visual inspection of staff. This method has no instrument assistance and completely relies on the experience and visual ability of staff. It is easily affected by individual differences, that is, the color vision ability and sensitivity to color difference of different people are different, resulting in inconsistent measurement results. Moreover, factors such as ambient light and visual fatigue may also interfere with the judgment results, and cannot provide standardized and repeatable evaluation results. This makes the subjective visual inspection method inaccurate in the actual production process and unable to meet the requirements of high-quality control.

[0004] The color difference meter analysis method uses spectral measurement technology to obtain the color data of a sample by measuring the reflected light intensity of the sample at different wavelengths, and then quantitatively describes the color by using methods such as CIE Lab* color space, CIE LCH or CIE XYZ, and calculates the color difference value between the standard sample and the sample to be measured through a color difference formula to evaluate the size of the color difference. Since the color difference meter measures the color difference by collecting spectral data of a single band within a specific wavelength range, the adjustable range is limited. Especially in the case of high brightness or light colors, the color difference meter may not be able to accurately detect subtle color differences. Therefore, this method has a poor detection effect on packaging materials with complex patterns or multi-color combinations, and is easily affected by factors such as surface reflection and gloss of the sample, resulting in errors.

[0005] Near-infrared spectroscopy emits near-infrared light and receives the light signal reflected by the sample, and uses the absorption characteristics of different substances in the near-infrared region to identify the color change of the sample. In color difference analysis, near-infrared spectroscopy technology can be used to quickly detect the color change of materials, especially suitable for the detection of complex materials or multi-layer structures. However, although this method can achieve fast and on-line non-destructive detection, it has limitations in the sensitivity of some color changes, especially in the detection of light and high-brightness colors. In addition, near-infrared spectroscopy is very sensitive to factors such as absorption, scattering, and reflection of materials, and is easily interfered by these factors, resulting in inaccurate measurement results. Summary of the Invention

[0006] To solve at least one aspect of the above problems, the present invention provides a method for constructing a detection model for color difference of cigarette packaging materials, a detection method, device, equipment and storage medium.

[0007] In the first aspect, the present application provides a method for constructing a detection model for color difference of cigarette packaging materials, including the following steps: receiving images of standard samples and production products of cigarette packaging materials in different bands detected by a hyperspectral imaging system; performing black-and-white correction on each group of images of standard samples and production products of cigarette packaging materials in different bands respectively, and extracting spectral reflectance data based on each group of images of standard samples and production products of cigarette packaging materials after black-and-white correction respectively, and performing smoothing processing on the spectral reflectance data respectively; converting the spectral reflectance data of each group of standard samples and production products of cigarette packaging materials into corresponding CIE LAB values according to the color space conversion formula; calculating the color difference values of each group of standard samples and production products of cigarette packaging materials based on the color difference formula; calculating the Euclidean distance, spectral angle matching, spectral correlation angle and spectral information divergence between each group of standard samples and production products of cigarette packaging materials based on the spectral reflectance data of each group of standard samples and production products of cigarette packaging materials; calculating the similarity between each group of standard samples and production products of cigarette packaging materials based on a preset comprehensive measurement formula of Euclidean distance, spectral angle matching, spectral correlation angle and spectral information divergence; training and fitting a model based on the color difference values and similarity data between several groups of standard samples and production products of cigarette packaging materials to obtain a detection model for color difference of cigarette packaging materials, wherein the detection model for color difference of cigarette packaging materials takes the similarity between each group of standard samples and production products of cigarette packaging materials as input and the color difference value between each group of standard samples and production products of cigarette packaging materials as output.

[0008] Preferably, the comprehensive measurement formula of the preset Euclidean distance, spectral angle matching, spectral correlation angle, and spectral information divergence is as follows:

[0009] ,

[0010] where ED is the Euclidean distance; SAM is the spectral angle matching; SCA is the spectral correlation angle; SID is the spectral information divergence; T is the similarity.

[0011] Preferably, the conversion of the spectral reflectance data into CIE LAB values includes the following steps:

[0012] Step 1: Use the interpld function to interpolate the spectral reflectance data to generate spectral reflectance functions at the three dominant color wavelengths of red, green, and blue, , and ; calculate the stimulus values , and at the three dominant color wavelengths of red, green, and blue respectively, where , , ; add the stimulus values at the three dominant color wavelengths of red, green, and blue correspondingly to obtain the value XYZ in the CIE XYZ color space: ;

[0013] Step 2: Convert the XYZ value in the CIE XYZ color space to the sRGB value, and then convert the linearized RGB value back to the XYZ value. The formulas for converting the XYZ value to the sRGB value and converting the linearized RGB value back to the value are respectively:

[0014] ,

[0015] ;

[0016] Step 3: Calculate the L, a, b values according to the value, and the calculation formulas are as follows:

[0017] ,

[0018] where , are the XYZ values of the reference white point respectively.

[0019] Second aspect, the present application provides a method for detecting color difference of cigarette packaging materials, including the following steps: receiving images of the production products and corresponding standard samples detected by a hyperspectral imaging system regarding cigarette packaging materials at different bands; performing black-and-white correction on the images of the production products and standard samples regarding cigarette packaging materials at different bands respectively, and extracting spectral reflectance data based on the images of the production products and standard samples regarding cigarette packaging materials after black-and-white correction at different bands respectively, and performing smoothing processing on the spectral reflectance data respectively; calculating the Euclidean distance, spectral angle matching, spectral correlation angle and spectral information divergence between the production products and the standard samples regarding cigarette packaging materials according to the spectral reflectance data of the production products and the standard samples regarding cigarette packaging materials; calculating the similarity between the production products and the standard samples regarding cigarette packaging materials based on a preset comprehensive measurement formula for Euclidean distance, spectral angle matching, spectral correlation angle and spectral information divergence; inputting the similarity between the production products and the standard samples regarding cigarette packaging materials into a cigarette packaging material color difference detection model to obtain the color difference value between the production products and the standard samples, where the cigarette packaging material color difference detection model is constructed according to the construction method of any one of the above-mentioned cigarette packaging material color difference detection models; obtaining the color difference grade between the production products and the standard samples based on a preset color difference grading rule according to the color difference value between the production products and the standard samples.

[0020] Preferably, it further includes the following step: sending an alarm signal when the color difference grade is greater than a preset grade.

[0021] Preferably, the preset comprehensive measurement formula for Euclidean distance, spectral angle matching, spectral correlation angle and spectral information divergence is:

[0022] ,

[0023] where ED is the Euclidean distance; SAM is the spectral angle matching; SCA is the spectral correlation angle; SID is the spectral information divergence; T is the similarity.

[0024] Preferably, the preset color difference grading rule is that when the color difference value between the production products and the standard samples is not greater than 1, it is defined as grade 1; when the color difference value between the production products and the standard samples is greater than 1 and not greater than 2, it is defined as grade 2; when the color difference value between the production products and the standard samples is greater than 2 and not greater than 3, it is defined as grade 3; when the color difference value between the production products and the standard samples is greater than 3, it is defined as grade 4.

[0025] Thirdly, the present application provides a device for detecting the color difference of cigarette packaging materials. The device includes: a receiving module configured to receive images of the production product and the corresponding standard sample detected by a hyperspectral imaging system in different bands with respect to the cigarette packaging materials; an image processing module configured to perform black and white correction on the images of the production product and the standard sample in different bands with respect to the cigarette packaging materials respectively, extract spectral reflectance data based on the images of the production product and the standard sample in different bands with respect to the cigarette packaging materials after black and white correction respectively, and perform smoothing processing on the spectral reflectance data respectively; a similarity calculation module configured to calculate the Euclidean distance, spectral angle matching, spectral correlation angle, and spectral information divergence between the production product and the standard sample with respect to the cigarette packaging materials based on the spectral reflectance data of the production product and the standard sample with respect to the cigarette packaging materials, and calculate the similarity between the production product and the standard sample with respect to the cigarette packaging materials based on a comprehensive measurement formula of the preset Euclidean distance, spectral angle matching, spectral correlation angle, and spectral information divergence; a color difference value acquisition module configured to input the similarity between the production product and the standard sample with respect to the cigarette packaging materials into a cigarette packaging material color difference detection model to obtain the color difference value between the production product and the standard sample, wherein the cigarette packaging material color difference detection model is constructed according to the construction method of a cigarette packaging material color difference detection model described in any one of the above; a color difference level acquisition module configured to obtain the color difference level between the production product and the standard sample based on the preset color difference grading rule according to the color difference value between the production product and the standard sample.

[0026] Fourthly, the present application provides a device for detecting the color difference of cigarette packaging materials. The device includes a memory and a processor. A computer program is stored on the memory, and when the computer program is executed by the processor, it implements a method for detecting the color difference of cigarette packaging materials described in any one of the above.

[0027] Fifthly, the present application provides a storage medium storing computer-readable instructions, which when run by a processor, execute the method described in any one of the above.

[0028] The method for constructing a detection model, the detection method, device, equipment, and storage medium for the color difference of cigarette packaging materials of the present invention have the following beneficial effects:

[0029] In this application, hyperspectral imaging systems are used to collect images of standard samples and production products regarding cigarette packaging materials at different wavelengths. Since hyperspectral imaging systems have a wide spectral range and higher spectral resolution, and have better anti-interference capabilities against factors such as absorption, scattering, and reflection of materials, more accurate and abundant spectral data can be obtained from the images of standard samples and production products regarding cigarette packaging materials collected by the hyperspectral imaging systems at different wavelengths.

[0030] Based on the images of standard samples and production products regarding cigarette packaging materials collected by the hyperspectral imaging systems at different wavelengths, the color difference and similarity between the standard samples and production products can be obtained respectively. Then, a color difference detection model for cigarette packaging materials is constructed by fitting based on the color difference and similarity between the standard samples and production products. In the detection method of this application, the similarity between the standard samples and production products is obtained by using the images of standard samples and production products regarding cigarette packaging materials collected by the hyperspectral imaging systems at different wavelengths, and then the color difference between the standard samples and production products is obtained by inputting it into the color difference detection model for cigarette packaging materials. Because the Euclidean distance is sensitive to the amplitude of the spectral reflectance curve, which helps to analyze the brightness information of the spectrum; the spectral angle matching is sensitive to the shape of the spectral reflectance curve and can effectively characterize the overall shape characteristics of the spectrum; the spectral information divergence is highly sensitive based on relative entropy and is suitable for detecting small changes in spectral data and can identify color detail differences; the spectral correlation angle focuses on the linear correlation of spectral vectors and has a high discriminative power for hue similarity. And the similarity in this application comprehensively considers multiple factors such as the Euclidean distance, spectral angle matching, spectral correlation angle, and spectral information divergence during the calculation process, and can more comprehensively and accurately characterize the differences between the spectral reflectance curves of the standard samples and production products, thereby making the obtained color difference between the standard samples and production products more accurate. In summary, this application can improve the accuracy of the color difference measurement results of cigarette packaging materials and help reduce the phenomena of returns and rework. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] To better understand the above and other objects, features, advantages, and functions of the present invention, reference can be made to the embodiments shown in the drawings. The same reference numerals in the drawings refer to the same components. Those skilled in the art should understand that the drawings are intended to schematically illustrate the preferred embodiments of the present invention and have no restrictive effect on the scope of the present invention. Each component in the drawings is not drawn to scale.

[0032] Figure 1 Shows a flowchart of a method for constructing a color difference detection model for cigarette packaging materials according to an embodiment of the present invention;

[0033] Figure 2Shows the spectral reflectance curves extracted from the images of the standard samples and production products of cigarette packaging materials in different bands;

[0034] Figure 3 Shows the flowchart of a method for detecting the color difference of cigarette packaging materials according to an embodiment of the present invention;

[0035] Figure 4 Shows the block diagram of a device for detecting the color difference of cigarette packaging materials according to an embodiment of the present invention. Detailed implementation manners

[0036] The following describes exemplary embodiments of the present disclosure with reference to the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for clarity and conciseness, descriptions of well-known functions and structures are omitted below.

[0037] As used herein, the term "including" and its variations mean open inclusion, that is, "including but not limited to". Unless otherwise stated, the term "or" means "and / or". The term "based on" means "at least partially based on". The terms "an exemplary embodiment" and "an embodiment" mean "at least one exemplary embodiment". The term "another embodiment" means "at least one additional embodiment". The terms "first", "second", etc. may refer to different or the same objects. There may be other explicit and implicit definitions below.

[0038] To at least partially solve one or more of the above problems and other potential problems, embodiments of the present disclosure propose a method for constructing a color difference detection model of cigarette packaging materials, as Figure 1 shown, including the following steps:

[0039] Receiving images of standard samples and production products of cigarette packaging materials in different bands from a hyperspectral imaging system; specifically, the hyperspectral imaging system uses a GaiaSorter hyperspectral image system to obtain images of standard samples and production products of cigarette packaging materials with a spectral range of 380nm to 1038nm.

[0040] Performing black and white correction on each group of images of standard samples and production products of cigarette packaging materials in different bands, and respectively extracting spectral reflectance data according to the images of each group of standard samples and production products of cigarette packaging materials after black and white correction, as Figure 2As shown, the spectral reflectance data are smoothed respectively; specifically, the method for performing black-and-white correction on images in different bands is as follows: by taking black and white images containing only the background as reference images, comparing them with the images of the standard samples or the production products regarding the cigarette packaging materials in different bands, and correcting the hyperspectral images according to the differences between the two. The black-and-white correction formula is:

[0041] ,

[0042] where U is the corrected spectral image, U0 is the original spectral image, B is the all-black reference image, and W is the all-white reference image; the smoothing process adopts the Savitzky-Golay (S-G) smoothing method to reduce high-frequency sharp spectral noise and retain the characteristics of data signals such as relative maximum values, minimum values, heights, and widths.

[0043] According to the color space conversion formula, the spectral reflectance data of each group of standard samples and production products regarding the cigarette packaging materials are converted into the corresponding CIE LAB values; according to the CIE LAB values of each group of standard samples and production products regarding the cigarette packaging materials, the color difference values between each group of standard samples and production products regarding the cigarette packaging materials are calculated based on the color difference formula.

[0044] Specifically, the conversion of spectral reflectance data into CIE LAB values includes the following steps:

[0045] Step 1: Use the interpld function to perform interpolation processing on the spectral reflectance data, and generate spectral reflectance functions at the three dominant color wavelengths of red, green, and blue respectively , and ; calculate the stimulus values , and at the three dominant color wavelengths of red, green, and blue respectively, where , , ; add the stimulus values at the three dominant color wavelengths of red, green, and blue correspondingly to obtain the value XYZ in the CIE XYZ color space: ;

[0046] Step 2: Convert the XYZ value in the CIE XYZ color space into an sRGB value, and then convert the linearized RGB value back to the XYZ value. The formulas for converting the XYZ value into an sRGB value and converting the linearized RGB value back to the value are respectively:

[0047] ,

[0048] ;

[0049] Step 3: Calculate the L, a, and b values according to the value, where the calculation formula is:

[0050]

[0051] where , are the XYZ values of the reference white point respectively.

[0052] The color difference formula can be any one of the CIE lab color difference formula, CIE 94 color difference formula, and CIE DE2000 color difference formula. Preferably, the CIE DE2000 color difference formula is selected. Calculate the color difference between each group of standard samples and production products for cigarette packaging materials according to the corresponding CIE LAB values of each group of standard samples and production products for cigarette packaging materials. The CIE lab color difference formula, CIE 94 color difference formula, and CIE DE2000 color difference formula are respectively:

[0053] CIE lab color difference formula:

[0054] ,

[0055] CIE 94 color difference formula:

[0056] ,

[0057] CIE DE2000 color difference formula:

[0058] ,

[0059] where respectively represent the corresponding differences in the CIELAB values of the standard samples and production products for cigarette packaging materials; respectively represent the differences in lightness, chromaticity, and saturation between the two colors; represents the perceptual weights of the two colors in lightness, chromaticity, and saturation; is an adjustment factor used to control the influence degree of different components, represents the correction factor of chroma.

[0060] According to the spectral reflectance data of each group of standard samples and production products for cigarette packaging materials, calculate the Euclidean distance, spectral angle matching, spectral correlation angle, and spectral information divergence between each group of standard samples and production products for cigarette packaging materials respectively; Based on the preset comprehensive measurement formula of Euclidean distance, spectral angle matching, spectral correlation angle, and spectral information divergence, calculate the similarity between each group of standard samples and production products for cigarette packaging materials respectively.

[0061] Specifically, the calculation formulas for the Euclidean distance, spectral angle matching, spectral correlation angle, and spectral information divergence between the standard sample and the production product with respect to cigarette packaging materials are as follows:

[0062] The calculation formula for the Euclidean distance is:

[0063] ,

[0064] where are the spectral reflectances at the i-th wavelength between the standard sample and the production product with respect to cigarette packaging materials respectively; is the Euclidean distance;

[0065] The calculation formula for spectral angle matching is:

[0066] ,

[0067] where is the spectral angle matching; is the spectral angle, , are the spectral reflectances of the two spectra in the n-th band respectively, and L is the number of bands;

[0068] The calculation formula for spectral correlation angle is:

[0069] ,

[0070] where SCA is the spectral correlation angle; is the Pearson correlation coefficient, , are the averages of the two spectra respectively;

[0071] The calculation formula for spectral information divergence is:

[0072] ,

[0073] where is the relative entropy of with respect to is the relative entropy of with respect to

[0074] Preferably, the comprehensive measurement formula for the preset Euclidean distance, spectral angle matching, spectral correlation angle, and spectral information divergence adopted in this application is:

[0075] ,

[0076] where T is the similarity.

[0077] A color difference detection model for cigarette packaging materials is obtained by training and fitting a model based on the color difference and similarity data of cigarette packaging materials between several groups of standard samples and production products. Preferably, the color difference detection model for cigarette packaging materials selects a mathematical model combining a logarithmic linear function and a quadratic function, where the color difference detection model for cigarette packaging materials takes the similarity of cigarette packaging materials between each group of standard samples and production products as the input and the color difference of cigarette packaging materials between each group of standard samples and production products as the output.

[0078] This application also provides a method for detecting the color difference of cigarette packaging materials, as Figure 3 shown, including the following steps:

[0079] Receiving images of cigarette packaging materials of the detected production products and their corresponding standard samples in different bands from a hyperspectral imaging system; specifically, the hyperspectral imaging system uses a GaiaSorter hyperspectral image system to obtain images of cigarette packaging materials of standard samples and production products with a spectral range of 380 nm to 1038 nm. Preferably, the hyperspectral imaging system and the device using the detection method of this application can be optionally installed near the packaging machine in the production workshop or in a non-production workshop such as a laboratory. The hyperspectral imaging system is communicatively connected to the device using the detection method of this application. The hyperspectral imaging system collects images of cigarette packaging materials of the production products completed by the packaging machine in different bands and then sends them to the device using the detection method of this application. For images of cigarette packaging materials of the standard samples in different bands, in some embodiments, the hyperspectral imaging system synchronously collects images of cigarette packaging materials of the standard samples corresponding to the production products in different bands; in other embodiments, several images of cigarette packaging materials of the standard samples are pre-acquired by the hyperspectral imaging system and sent to the device using the detection method of this application for storage, so that several images of cigarette packaging materials of the standard samples are pre-stored in the device using the detection method of this application. The corresponding standard sample images can be selected according to the received production product images by image recognition or by receiving an artificial selection instruction method, and then the following steps are continued.

[0080] Performing black and white correction on the images of cigarette packaging materials of the production products and standard samples in different bands respectively, and extracting spectral reflectance data according to the images of cigarette packaging materials of the production products and standard samples in different bands after black and white correction respectively, as Figure 2As shown, the spectral reflectance data are smoothed respectively; specifically, the method for performing black-and-white correction on images in different bands is as follows: by taking black and white images containing only the background as reference images, comparing them with the images of the standard sample or the production product regarding the cigarette packaging material in different bands, and correcting the hyperspectral image according to the difference between the two. The black-and-white correction formula is:

[0081] ,

[0082] where U is the corrected spectral image, U0 is the original spectral image, B is the all-black reference image, and W is the all-white reference image; the smoothing process adopts the Savitzky-Golay (S-G) smoothing method to reduce high-frequency sharp spectral noise and retain the characteristics of data signals such as relative maximum values, minimum values, heights, and widths.

[0083] Based on the spectral reflectance data of the production product and the standard sample regarding the cigarette packaging material, calculate the Euclidean distance, spectral angle matching, spectral correlation angle, and spectral information divergence between the production product and the standard sample regarding the cigarette packaging material; based on the preset comprehensive metric formula for Euclidean distance, spectral angle matching, spectral correlation angle, and spectral information divergence, calculate the similarity between the production product and the standard sample regarding the cigarette packaging material.

[0084] Specifically, the calculation formulas for the Euclidean distance, spectral angle matching, spectral correlation angle, and spectral information divergence between the standard sample and the production product regarding the cigarette packaging material are as follows:

[0085] The calculation formula for the Euclidean distance is:

[0086] ,

[0087] where are the spectral reflectances at the i-th wavelength between the standard sample and the production product regarding the cigarette packaging material respectively; is the Euclidean distance;

[0088] The calculation formula for spectral angle matching is:

[0089] ,

[0090] where is the spectral angle matching; is the spectral angle, , are the spectral reflectances of the two spectra in the n-th band respectively, and L is the number of bands;

[0091] The calculation formula for the spectral correlation angle is:

[0092] ,

[0093] Among them, SCA is the spectral correlation angle; is the Pearson correlation coefficient, , are the average values of the two spectra respectively;

[0094] The calculation formula of spectral information divergence is:

[0095] ,

[0096] Among them, is the relative entropy of relative to is the relative entropy of relative to , and the relative entropy is calculated using the Kullback-Leibler information divergence.

[0097] Preferably, the comprehensive measurement formula of the preset Euclidean distance, spectral angle matching, spectral correlation angle and spectral information divergence adopted in this application is:

[0098] ,

[0099] Among them, T is the similarity.

[0100] The similarity between the produced product and the standard sample regarding the cigarette packaging material is input into the cigarette packaging material color difference detection model to obtain the color difference value between the produced product and the standard sample, where the cigarette packaging material color difference detection model is constructed according to the construction method of any one of the above-mentioned cigarette packaging material color difference detection models.

[0101] According to the color difference value between the produced product and the standard sample, based on the preset color difference grading rule, the color difference grade between the produced product and the standard sample is obtained. Preferably, the preset color difference grading rule is that when the color difference value between the produced product and the standard sample is not greater than 1, it is defined as grade 1; when the color difference value between the produced product and the standard sample is greater than 1 and not greater than 2, it is defined as grade 2; when the color difference value between the produced product and the standard sample is greater than 2 and not greater than 3, it is defined as grade 3; when the color difference value between the produced product and the standard sample is greater than 3, it is defined as grade 4.

[0102] In a preferred embodiment, the method of the present application further includes the following steps: sending an alarm signal when the color difference level is greater than a preset level, where the preset level is set according to whether the human eye can distinguish color differences. For example, when the color difference level is 1 or 2, it is difficult for the human eye to distinguish color differences, and when the color difference level is 3 or 4, the human eye can clearly distinguish color differences. Then, the preset level is set to level 3. The device using the detection method of the present application can be communicatively connected to an alarm device or a rejection device. The alarm device gives an alarm when receiving the alarm signal to remind the staff to handle it, and the rejection device rejects the produced product when receiving the alarm signal, both of which achieve the on-line detection of the produced product.

[0103] The present application also provides a device for detecting the color difference of cigarette packaging materials, as Figure 4 shown. The device includes: a receiving module configured to receive images of the produced product and the corresponding standard sample regarding the cigarette packaging materials in different wavelength bands from a hyperspectral imaging system; an image processing module configured to perform black and white correction on the images of the produced product and the standard sample regarding the cigarette packaging materials in different wavelength bands respectively, extract spectral reflectance data based on the black and white corrected images of the produced product and the standard sample regarding the cigarette packaging materials in different wavelength bands respectively, and perform smoothing processing on the spectral reflectance data respectively; a similarity calculation module configured to calculate the Euclidean distance, spectral angle matching, spectral correlation angle, and spectral information divergence between the produced product and the standard sample regarding the cigarette packaging materials based on the spectral reflectance data of the produced product and the standard sample regarding the cigarette packaging materials; calculate the similarity between the produced product and the standard sample regarding the cigarette packaging materials based on a comprehensive metric formula of the preset Euclidean distance, spectral angle matching, spectral correlation angle, and spectral information divergence; a color difference value acquisition module configured to input the similarity between the produced product and the standard sample regarding the cigarette packaging materials into a cigarette packaging material color difference detection model to obtain the color difference value between the produced product and the standard sample, where the cigarette packaging material color difference detection model is constructed according to the construction method of any one of the above-mentioned cigarette packaging material color difference detection models; a color difference level acquisition module configured to obtain the color difference level between the produced product and the standard sample based on a preset color difference grading rule according to the color difference value between the produced product and the standard sample. Preferably, the device of the present application further includes a sending module configured to send an alarm signal when the color difference level is greater than a preset level.

[0104] The present application also provides a device for detecting the color difference of cigarette packaging materials. The device includes a memory and a processor. A computer program is stored on the memory, and when the computer program is executed by the processor, it implements the detection method of the color difference of cigarette packaging materials as described in any one of the above.

[0105] The present application also provides a storage medium storing computer-readable instructions that, when executed by a processor, perform the method according to any one of the above.

[0106] The embodiments of the present disclosure have been described above. The above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations are obvious to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The choice of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to technologies in the market, or to enable other ordinary skill in the art to understand the present disclosure.

Claims

1. A method for constructing a color difference detection model of cigarette packaging materials, characterized in that: Including the following steps: Receiving, from a hyperspectral imaging system, images of standard samples in several groups and production products regarding cigarette packaging materials at different bands; Performing black-and-white correction on the images of each group of standard samples and production products regarding cigarette packaging materials at different bands respectively, extracting spectral reflectance data based on the images of each group of standard samples and production products regarding cigarette packaging materials after black-and-white correction respectively, and performing smoothing processing on the spectral reflectance data respectively; Converting the spectral reflectance data of each group of standard samples and production products regarding cigarette packaging materials into corresponding CIE LAB values according to the color space conversion formula; calculating the color difference values between each group of standard samples and production products regarding cigarette packaging materials based on the CIE LAB values of each group of standard samples and production products regarding cigarette packaging materials according to the color difference formula; Calculating the Euclidean distance, spectral angle matching, spectral correlation angle, and spectral information divergence between each group of standard samples and production products regarding cigarette packaging materials based on the spectral reflectance data of each group of standard samples and production products regarding cigarette packaging materials; calculating the similarity between each group of standard samples and production products regarding cigarette packaging materials based on a preset comprehensive measurement formula for Euclidean distance, spectral angle matching, spectral correlation angle, and spectral information divergence; Training a fitting model based on the color difference values and similarity data between several groups of standard samples and production products regarding cigarette packaging materials to obtain a cigarette packaging material color difference detection model, where the cigarette packaging material color difference detection model takes the similarity between each group of standard samples and production products regarding cigarette packaging materials as input and the color difference value between each group of standard samples and production products regarding cigarette packaging materials as output.

2. The method for constructing a color difference detection model of a cigarette packaging material according to claim 1, characterized in that: The preset comprehensive measurement formula for Euclidean distance, spectral angle matching, spectral correlation angle, and spectral information divergence is: , Wherein, ED is the Euclidean distance; SAM is the spectral angle matching; SCA is the spectral correlation angle; SID is the spectral information divergence; T is the similarity.

3. The method for constructing a color difference detection model of a cigarette packaging material according to claim 1, wherein: The conversion of the spectral reflectance data into CIE LAB values includes the following steps: Step 1: Use the interpld function to interpolate the spectral reflectance data and generate spectral reflectance functions at the three dominant color wavelengths of red, green, and blue respectively , and ; Calculate the stimulus values at the three dominant color wavelengths of red, green, and blue respectively , and , where , , ; Add the stimulus values at the three dominant color wavelengths of red, green, and blue correspondingly to obtain the value XYZ in the CIE XYZ color space: ; Step 2: Convert the XYZ values in the CIE XYZ color space to sRGB values, and then convert the linearized RGB values back to XYZ values. The formulas for converting XYZ values to sRGB values and converting the linearized RGB values back are as follows: The values are as follows: , ; Step 3: Calculate the L, a, and b values according to the value, and the calculation formula is as follows: ; Among them, , are the XYZ values of the reference white point respectively.

4. A method for detecting the color difference of cigarette packaging materials, characterized in that: Including the following steps: Receiving, from a hyperspectral imaging system, images of production products and corresponding standard samples regarding cigarette packaging materials detected by it at different bands; Performing black-and-white correction on the images of production products and standard samples regarding cigarette packaging materials at different bands respectively, extracting spectral reflectance data based on the images of production products and standard samples regarding cigarette packaging materials after black-and-white correction respectively, and performing smoothing processing on the spectral reflectance data respectively; Calculating the Euclidean distance, spectral angle matching, spectral correlation angle, and spectral information divergence between production products and standard samples regarding cigarette packaging materials based on the spectral reflectance data of production products and standard samples regarding cigarette packaging materials; calculating the similarity between production products and standard samples regarding cigarette packaging materials based on a preset comprehensive measurement formula for Euclidean distance, spectral angle matching, spectral correlation angle, and spectral information divergence; Input the similarity between the production product and the standard sample regarding the cigarette packaging material into the cigarette packaging material color difference detection model to obtain the color difference value between the production product and the standard sample, where the cigarette packaging material color difference detection model is constructed according to the construction method of a cigarette packaging material color difference detection model described in any one of claims 1 to 3; Based on the preset color difference grading rule, obtain the color difference grade between the production product and the standard sample according to the color difference value between the production product and the standard sample.

5. The detection method for color difference of a cigarette packaging material according to claim 4, wherein: It further includes the following steps: Send an alarm signal when the color difference grade is greater than the preset grade.

6. The method for detecting the color difference of a cigarette packaging material according to claim 4, characterized in that: The preset comprehensive metric formula for Euclidean distance, spectral angle matching, spectral correlation angle, and spectral information divergence is: , where ED is the Euclidean distance; SAM is the spectral angle matching; SCA is the spectral correlation angle; SID is the spectral information divergence; T is the similarity.

7. A method for detecting the color difference of a cigarette packaging material according to claim 4, characterized in that: The preset color difference grading rule is that when the color difference value between the production product and the standard sample is not greater than 1, it is defined as grade 1; when the color difference value between the production product and the standard sample is greater than 1 and not greater than 2, it is defined as grade 2; when the color difference value between the production product and the standard sample is greater than 2 and not greater than 3, it is defined as grade 3; when the color difference value between the production product and the standard sample is greater than 3, it is defined as grade 4.

8. A detection device for the color difference of cigarette packaging materials, characterized in that: The device includes: A receiving module configured to receive images of the production product and its corresponding standard sample regarding the cigarette packaging material at different wavelengths detected by the hyperspectral imaging system; An image processing module configured to perform black-and-white correction on the images of the production product and the standard sample regarding the cigarette packaging material at different wavelengths respectively, extract spectral reflectance data according to the black-and-white corrected images of the production product and the standard sample regarding the cigarette packaging material at different wavelengths respectively, and perform smoothing processing on the spectral reflectance data respectively; A similarity calculation module configured to calculate the Euclidean distance, spectral angle matching, spectral correlation angle, and spectral information divergence between the production product and the standard sample regarding the cigarette packaging material according to the spectral reflectance data of the production product and the standard sample regarding the cigarette packaging material; calculate the similarity between the production product and the standard sample regarding the cigarette packaging material based on the preset comprehensive metric formula for Euclidean distance, spectral angle matching, spectral correlation angle, and spectral information divergence; A color difference value acquisition module configured to input the similarity between the production product and the standard sample regarding the cigarette packaging material into the cigarette packaging material color difference detection model to obtain the color difference value between the production product and the standard sample, where the cigarette packaging material color difference detection model is constructed according to the construction method of a cigarette packaging material color difference detection model described in any one of claims 1 to 3; A color difference grade acquisition module configured to obtain the color difference grade between the production product and the standard sample based on the preset color difference grading rule according to the color difference value between the production product and the standard sample.

9. A detection device for the color difference of cigarette packaging materials, characterized in that: The device includes a memory and a processor, and a computer program is stored on the memory. When the computer program is executed by the processor, it implements the detection method of a cigarette packaging material color difference described in any one of claims 4 to 7.

10. A storage medium, characterized in that: Stores computer-readable instructions that, when executed by a processor, perform the method according to any one of claims 4-7.