Chromatic aberration measurement method and system based on hyperspectral global scanning imaging and storage medium

By using hyperspectral global scanning imaging technology, feature point detection and stitching methods, combined with correction technology, the problem of insufficient range and accuracy of color difference detection in packaging and printing products has been solved, and accurate color difference measurement of the entire pattern has been achieved.

CN121994720APending Publication Date: 2026-05-08CHINA NAT TOBACCO QUALITY SUPERVISION & TEST CENT +1
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA NAT TOBACCO QUALITY SUPERVISION & TEST CENT
Filing Date
2026-01-23
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

In existing technologies, color difference detection for packaging and printed materials suffers from limited detection range and insufficient accuracy, especially in multi-color gradients and complex patterns where accurate color difference measurement is difficult.

Method used

The hyperspectral full-domain scanning imaging method is adopted. By using feature point detection and stitching technology, hyperspectral scanning sub-images are acquired, stitched and color difference is calculated. Combined with black and white correction, reflectivity calibration correction and multi-region synchronous acquisition correction, abnormal color difference at the edge is eliminated and the detection accuracy is improved.

Benefits of technology

It enables precise measurement of the color gamut distribution of the entire pattern on printed packaging, improving the accuracy and consistency of color difference detection and reducing image distortion and errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121994720A_ABST
    Figure CN121994720A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of optical detection and color measurement, and particularly relates to a chromatic aberration measurement method and system based on hyperspectral global scanning imaging and a storage medium. Comprising the following steps: acquiring a hyperspectral scanning result of a to-be-detected chromatic aberration sample including a hyperspectral scanning sub-image; splicing the to-be-spliced hyperspectral scanning images to obtain a global hyperspectral scanning result of the to-be-detected chromatic aberration sample; the hyperspectral scanning image to be spliced is a hyperspectral scanning sub-image or an intermediate image formed by splicing; the splicing method comprises the following steps: carrying out feature point detection on a to-be-spliced hyperspectral scanning image to obtain a feature point descriptor set of the to-be-spliced hyperspectral scanning image, matching the feature point descriptor set of the to-be-spliced hyperspectral scanning image, and carrying out two-dimensional rigid body coordinate transformation based on a matching result to obtain the to-be-spliced hyperspectral scanning image. The hyperspectral scanning images to be spliced are spliced; and performing chromatic aberration calculation on the global spectrum scanning image of the chromatic aberration sample to be detected and the standard sample to obtain a chromatic aberration calculation result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of optical detection and color measurement technology, specifically relating to a color difference measurement method, system and storage medium based on hyperspectral full-domain scanning imaging. Background Technology

[0002] Color consistency is a core indicator for evaluating the quality of printed packaging. High-end packaging products such as food and cosmetics have extremely high tolerance requirements for color difference; even slight color variations can affect consumers' perception of product quality and even cause economic losses. Traditional color difference detection mainly relies on visual colorimetry and handheld spectrophotometers.

[0003] In existing technologies, spectrophotometers, machine vision inspection methods, or portable photography combined with color card calibration are commonly used for color difference consistency detection. However, spectrophotometers typically have an aperture of 3-8 mm, which can only obtain the average color value within a limited spot area and cannot present the color gamut distribution of the entire pattern. For complex patterns such as multi-color gradients and graphic intersections commonly found in packaging printing, the limited sampling points are insufficient to cover all color areas, and the point-by-point measurement process is cumbersome. Machine vision inspection methods, which use color cameras for millisecond-level colorimetric measurements, have insufficient RGB three-channel spectral dimensions, resulting in limited detection accuracy. Portable photography combined with color card calibration schemes, such as the Chinese invention patent application CN116559119A which proposes a deep learning-based method, system, and medium for detecting color difference in wood staining, use color cards for calibration and then calculate the color difference based on neural networks to identify sample colors. However, its accuracy and stability are sensitive to ambient light and sensor drift; when ambient light and sensor drift occur, accurate color difference calculation cannot be performed.

[0004] To address the aforementioned issues and improve the detection range of spectrophotometers, existing technologies have proposed methods such as point-by-point scanning via motor-driven spectrophotometers or the development of image-based localization-based spectrophotometric detection devices. However, these methods require extremely high positioning accuracy of the motion platform, and the output remains the average color value of the selected area, making it difficult to characterize microscopic color differences and the spatial distribution features of color components in complex patterns. Furthermore, existing technologies have proposed line-scan hyperspectral camera scanning methods. However, the field of view of this method is limited by the integrating sphere sampling aperture, and a single scan only covers a width of a few centimeters, making it difficult to meet the requirements for full-page inspection of packaging and printed materials. Moreover, displacement errors exist in the splicing of large-size samples, resulting in insufficient accuracy in color difference detection. Summary of the Invention

[0005] The purpose of this invention is to provide a color difference measurement method, system and storage medium based on hyperspectral global scanning imaging, so as to solve the technical problem of low color difference detection accuracy in the prior art.

[0006] To address the aforementioned technical problems, this invention provides a color difference measurement method based on hyperspectral global scanning imaging, comprising:

[0007] 1) Obtain the hyperspectral scanning results of the color difference sample to be detected, including at least two hyperspectral scan sub-images;

[0008] 2) The hyperspectral scan images to be stitched are stitched together to obtain the full-domain hyperspectral scan results of the color difference sample to be detected; the hyperspectral scan images to be stitched together are either hyperspectral scan sub-images or intermediate images formed by stitching.

[0009] The stitching method includes: performing feature point detection on the hyperspectral scan image to be stitched to obtain a set of feature point descriptors for the hyperspectral scan image to be stitched; matching the set of feature point descriptors for the hyperspectral scan image to be stitched; and stitching the hyperspectral scan image to be stitched based on the matching results using two-dimensional rigid body coordinate transformation.

[0010] 3) Perform color difference calculation on the full-domain spectral scan image of the color difference sample to be tested and the standard sample to obtain the color difference calculation result.

[0011] Furthermore, the color difference calculation result obtained in step 3) is the color difference calculation result after filtering out abnormal color differences at the edges; correspondingly, the method for filtering out abnormal color differences at the edges includes:

[0012] Edge detection is performed on the full-domain hyperspectral scanning results to obtain the edge regions. Morphological dilation is then performed on the edges to generate an edge mask to cover the transition regions of the edge regions. The color difference data corresponding to the transition regions is then filtered out from the original color difference calculation results to obtain the color difference calculation results after filtering out abnormal color differences at the edges.

[0013] Furthermore, specific methods for calculating the color difference between the full-domain hyperspectral scanning results and standard samples include:

[0014] The stitched global hyperspectral scan results are converted into CIEXYZ tristimulus values, and then further converted to color space to obtain the brightness L and chromaticity a, b of each pixel in the global hyperspectral scan results.

[0015] The stitched global hyperspectral scan results are matched with standard samples. Based on the matching results, the spatial mapping relationship of color information of each pixel between the global hyperspectral scan results and standard samples is determined, and the color difference value between corresponding pixels is calculated according to the following formula:

[0016] In the formula, Let (i, j) be the color difference between pixel (i, j) in the standard sample and the corresponding pixel in the color difference sample to be detected. , , Standard sample pixel coordinates The brightness and chromaticity parameters at that location, , , These are the brightness and chromaticity parameters of the corresponding pixel in the color difference sample to be detected.

[0017] Furthermore, methods for matching the stitched global hyperspectral scan results with standard samples include:

[0018] Feature points are extracted from both the global hyperspectral scanning results and the standard samples to obtain two sets of feature point descriptors. The two sets of feature point descriptors are matched, and based on the matching results, the spatial mapping relationship of the color information of each pixel between the global hyperspectral scanning results and the standard samples is determined by two-dimensional rigid body coordinate transformation.

[0019] Furthermore, the hyperspectral scanning result of the color difference sample to be tested is the corrected hyperspectral scanning result of the color difference sample to be tested, and the correction includes black and white correction and reflectance calibration correction.

[0020] Furthermore, black-and-white correction methods include:

[0021] Obtain the hyperspectral scan response values ​​of the reference white board with the light source on and with the light source off. Calculate the hyperspectral scan results of the color difference sample to be tested after black and white correction using the following formula:

[0022]

[0023] In the formula, I0 is the hyperspectral scanning response value of the color difference sample to be tested after black and white correction, I0 is the hyperspectral scanning response value of the color difference sample to be tested before black and white correction, B is the hyperspectral scanning response value of the reference white board when the light source is off, and W is the hyperspectral scanning response value of the reference white board when the light source is on.

[0024] Furthermore, the method for reflectivity calibration and correction includes:

[0025] A standard grayscale plate is scanned in the X direction to obtain the hyperspectral scanning response value of the standard grayscale plate. A fitting relationship is established between the response value and the true reflectance of the standard grayscale plate. The hyperspectral scanning image of the color difference sample to be tested is then substituted into the fitting relationship to obtain the hyperspectral scanning image of the color difference sample to be tested after reflectance calibration correction.

[0026] Furthermore, the correction also includes multi-region synchronous acquisition correction for eliminating spectral noise, and the method for multi-region synchronous acquisition correction includes:

[0027] The intensity of the light source in the area coated with barium sulfate on the inner wall of the integrating sphere is used as a reference value to correct the hyperspectral scanning results of the color difference sample to be tested. The correction formula is as follows:

[0028]

[0029] In the formula, To detect each pixel (x, y) in the region at the wavelength of the illumination source. The corresponding hyperspectral scan response value at that time, The area on the inner wall of the integrating sphere coated with barium sulfate is illuminated at a wavelength of [wavelength missing]. Average response value data of multiple pixels at the time.

[0030] Furthermore, the edge detection method is the Canny edge detection method.

[0031] Furthermore, the method for matching the feature point descriptor sets of two hyperspectral scan sub-images is KD tree matching.

[0032] Furthermore, in KD tree matching, the method for filtering matching results based on the distance between feature points and the nearest and second nearest points is the LOWE ratio filtering method.

[0033] Furthermore, the feature point detection method is SIFT feature point detection.

[0034] Furthermore, the fitting relationship between the response value and the true reflectance is a quadratic function with the response value as the independent variable.

[0035] The beneficial effects of this invention are as follows: This invention detects feature points in hyperspectral scanned sub-images, obtains a set of feature point descriptors, and then matches the set of feature point descriptors. The matching results are used to perform coordinate transformation to stitch the hyperspectral scanned sub-images together, enabling corresponding stitching between feature points. This results in better matching of the hyperspectral scanned sub-images during the stitching process. Compared with mechanical stitching, it can better eliminate image distortion and errors generated during stitching, improve the imaging quality of hyperspectral scanned images, and ultimately improve the accuracy of color difference detection.

[0036] To address the aforementioned technical problems, this invention also provides a color difference measurement system based on hyperspectral full-domain scanning imaging, comprising an optical system, a motion system, and a stage for carrying a color difference sample to be detected. The motion system is used to realize the relative movement between the optical system and the color difference sample to be detected, thereby enabling the scanning trajectory of the optical system to cover the entire color difference sample to be detected, and obtaining the hyperspectral scanning result of the color difference sample to be detected.

[0037] The color difference measurement system further includes a color difference calculation module, which includes a processor. The processor is used to implement a color difference measurement method based on hyperspectral full-domain scanning imaging when executing a computer program, including:

[0038] 1) Obtain the hyperspectral scanning results of the color difference sample to be detected, including at least two hyperspectral scan sub-images;

[0039] 2) The hyperspectral scan images to be stitched are stitched together to obtain the full-domain hyperspectral scan results of the color difference sample to be detected; the hyperspectral scan images to be stitched together are either hyperspectral scan sub-images or intermediate images formed by stitching.

[0040] The stitching method includes: performing feature point detection on the hyperspectral scan image to be stitched to obtain a set of feature point descriptors for the hyperspectral scan image to be stitched; matching the set of feature point descriptors for the hyperspectral scan image to be stitched; and stitching the hyperspectral scan image to be stitched based on the matching results using two-dimensional rigid body coordinate transformation.

[0041] 3) Perform color difference calculation on the full-domain spectral scan image of the color difference sample to be tested and the standard sample to obtain the color difference calculation result.

[0042] Furthermore, the color difference calculation result obtained in step 3) is the color difference calculation result after filtering out abnormal color differences at the edges; correspondingly, the method for filtering out abnormal color differences at the edges includes:

[0043] Edge detection is performed on the full-domain hyperspectral scanning results to obtain the edge regions. Morphological dilation is then performed on the edge regions to generate an edge mask to cover the transition regions of the edge regions. The color difference data corresponding to the transition regions is then filtered out from the original color difference calculation results to obtain the color difference calculation results after filtering out abnormal color differences at the edges.

[0044] Furthermore, specific methods for calculating the color difference between the full-domain hyperspectral scanning results and standard samples include:

[0045] The stitched global hyperspectral scan results are converted into CIEXYZ tristimulus values, and then further converted to color space to obtain the brightness L and chromaticity a, b of each pixel in the global hyperspectral scan results.

[0046] The stitched global hyperspectral scan results are matched with standard samples. Based on the matching results, the spatial mapping relationship of color information of each pixel between the global hyperspectral scan results and standard samples is determined, and the color difference value between corresponding pixels is calculated according to the following formula:

[0047] In the formula, Let (i, j) be the color difference between pixel (i, j) in the standard sample and the corresponding pixel in the color difference sample to be detected. , , Standard sample pixel coordinates The brightness and chromaticity parameters at that location, , , These are the brightness and chromaticity parameters of the corresponding pixel in the color difference sample to be detected.

[0048] Furthermore, methods for matching the stitched global hyperspectral scan results with standard samples include:

[0049] Feature points are extracted from both the global hyperspectral scanning results and the standard samples to obtain two sets of feature point descriptors. The two sets of feature point descriptors are matched, and based on the matching results, the spatial mapping relationship of the color information of each pixel between the global hyperspectral scanning results and the standard samples is determined by two-dimensional rigid body coordinate transformation.

[0050] Furthermore, the hyperspectral scanning result of the color difference sample to be tested is the corrected hyperspectral scanning result of the color difference sample to be tested, and the correction includes black and white correction and reflectance calibration correction.

[0051] Furthermore, black-and-white correction methods include:

[0052] Obtain the hyperspectral scan response values ​​of the reference white board with the light source on and with the light source off. Calculate the hyperspectral scan results of the color difference sample to be tested after black and white correction using the following formula:

[0053]

[0054] In the formula, I0 is the hyperspectral scanning response value of the color difference sample to be tested after black and white correction, I0 is the hyperspectral scanning response value of the color difference sample to be tested before black and white correction, B is the hyperspectral scanning response value of the reference white board when the light source is off, and W is the hyperspectral scanning response value of the reference white board when the light source is on.

[0055] Furthermore, the method for reflectivity calibration and correction includes:

[0056] A standard grayscale plate is scanned in the X direction to obtain the hyperspectral scanning response value of the standard grayscale plate. A fitting relationship is established between the response value and the true reflectance of the standard grayscale plate. The hyperspectral scanning image of the color difference sample to be tested is then substituted into the fitting relationship to obtain the hyperspectral scanning image of the color difference sample to be tested after reflectance calibration correction.

[0057] Furthermore, the correction also includes multi-region synchronous acquisition correction for eliminating spectral noise, and the method for multi-region synchronous acquisition correction includes:

[0058] The intensity of the light source in the area coated with barium sulfate on the inner wall of the integrating sphere is used as a reference value to correct the hyperspectral scanning results of the color difference sample to be tested. The correction formula is as follows:

[0059]

[0060] In the formula, To detect each pixel (x, y) in the region at the wavelength of the illumination source. The corresponding hyperspectral scan response value at that time, The area on the inner wall of the integrating sphere coated with barium sulfate is illuminated at a wavelength of [wavelength missing]. Average response value data of multiple pixels at the time.

[0061] Furthermore, the edge detection method is the Canny edge detection method.

[0062] Furthermore, the method for matching the feature point descriptor sets of two hyperspectral scan sub-images is KD tree matching.

[0063] Furthermore, in KD tree matching, the method for filtering matching results based on the distance between feature points and the nearest and second nearest points is the LOWE ratio filtering method.

[0064] Furthermore, the feature point detection method is SIFT feature point detection.

[0065] Furthermore, the fitting relationship between the response value and the true reflectance is a quadratic function with the response value as the independent variable.

[0066] Furthermore, the velocity of the motion system is determined by the following formula:

[0067]

[0068] In the formula, V t Let be the velocity of the motion system, and D be the distance between the lens of the hyperspectral camera and the color difference sample to be detected. The detection distance of the hyperspectral camera in the direction of motion of the moving frame. The focal length of the lens for the hyperspectral camera. The sampling frame rate of the hyperspectral camera. This represents the number of pixels in the spatial dimension of the hyperspectral camera's image sensor.

[0069] The beneficial effects of this invention are as follows: This invention detects feature points in hyperspectral scanned sub-images, obtains a set of feature point descriptors, and then matches the set of feature point descriptors. The matching results are used to perform coordinate transformation to stitch the hyperspectral scanned sub-images together, enabling corresponding stitching between feature points. This results in better matching of the hyperspectral scanned sub-images during the stitching process. Compared with mechanical stitching, it can better eliminate image distortion and errors generated during stitching, improve the imaging quality of hyperspectral scanned images, and ultimately improve the accuracy of color difference detection.

[0070] To address the aforementioned technical problems, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed, implements a color difference measurement method based on hyperspectral global scanning imaging, comprising:

[0071] 1) Obtain the hyperspectral scanning results of the color difference sample to be detected, including at least two hyperspectral scan sub-images;

[0072] 2) The hyperspectral scan images to be stitched are stitched together to obtain the full-domain hyperspectral scan results of the color difference sample to be detected; the hyperspectral scan images to be stitched together are either hyperspectral scan sub-images or intermediate images formed by stitching.

[0073] The stitching method includes: performing feature point detection on the hyperspectral scan image to be stitched to obtain a set of feature point descriptors for the hyperspectral scan image to be stitched; matching the set of feature point descriptors for the hyperspectral scan image to be stitched; and stitching the hyperspectral scan image to be stitched based on the matching results using two-dimensional rigid body coordinate transformation.

[0074] 3) Perform color difference calculation on the full-domain spectral scan image of the color difference sample to be tested and the standard sample to obtain the color difference calculation result.

[0075] Furthermore, the color difference calculation result obtained in step 3) is the color difference calculation result after filtering out abnormal color differences at the edges; correspondingly, the method for filtering out abnormal color differences at the edges includes:

[0076] Edge detection is performed on the full-domain hyperspectral scanning results to obtain the edge regions. Morphological dilation is then performed on the edge regions to generate an edge mask to cover the transition regions of the edge regions. The color difference data corresponding to the transition regions is then filtered out from the original color difference calculation results to obtain the color difference calculation results after filtering out abnormal color differences at the edges.

[0077] Furthermore, specific methods for calculating the color difference between the full-domain hyperspectral scanning results and standard samples include:

[0078] The stitched global hyperspectral scan results are converted into CIEXYZ tristimulus values, and then further converted to color space to obtain the brightness L and chromaticity a, b of each pixel in the global hyperspectral scan results.

[0079] The stitched global hyperspectral scan results are matched with standard samples. Based on the matching results, the spatial mapping relationship of color information of each pixel between the global hyperspectral scan results and standard samples is determined, and the color difference value between corresponding pixels is calculated according to the following formula:

[0080] In the formula, Let (i, j) be the color difference between pixel (i, j) in the standard sample and the corresponding pixel in the color difference sample to be detected. , , Standard sample pixel coordinates The brightness and chromaticity parameters at that location, , , These are the brightness and chromaticity parameters of the corresponding pixel in the color difference sample to be detected.

[0081] Furthermore, methods for matching the stitched global hyperspectral scan results with standard samples include:

[0082] Feature points are extracted from both the global hyperspectral scanning results and the standard samples to obtain two sets of feature point descriptors. The two sets of feature point descriptors are matched, and based on the matching results, the spatial mapping relationship of the color information of each pixel between the global hyperspectral scanning results and the standard samples is determined by two-dimensional rigid body coordinate transformation.

[0083] Furthermore, the hyperspectral scanning result of the color difference sample to be tested is the corrected hyperspectral scanning result of the color difference sample to be tested, and the correction includes black and white correction and reflectance calibration correction.

[0084] Furthermore, black-and-white correction methods include:

[0085] Obtain the hyperspectral scan response values ​​of the reference white board with the light source on and with the light source off. Calculate the hyperspectral scan results of the color difference sample to be tested after black and white correction using the following formula:

[0086]

[0087] In the formula, I0 is the hyperspectral scanning response value of the color difference sample to be tested after black and white correction, I0 is the hyperspectral scanning response value of the color difference sample to be tested before black and white correction, B is the hyperspectral scanning response value of the reference white board when the light source is off, and W is the hyperspectral scanning response value of the reference white board when the light source is on.

[0088] Furthermore, the method for reflectivity calibration and correction includes:

[0089] A standard grayscale plate is scanned in the X direction to obtain the hyperspectral scanning response value of the standard grayscale plate. A fitting relationship is established between the response value and the true reflectance of the standard grayscale plate. The hyperspectral scanning image of the color difference sample to be tested is then substituted into the fitting relationship to obtain the hyperspectral scanning image of the color difference sample to be tested after reflectance calibration correction.

[0090] Furthermore, the correction also includes multi-region synchronous acquisition correction for eliminating spectral noise, and the method for multi-region synchronous acquisition correction includes:

[0091] The intensity of the light source in the area coated with barium sulfate on the inner wall of the integrating sphere is used as a reference value to correct the hyperspectral scanning results of the color difference sample to be tested. The correction formula is as follows:

[0092]

[0093] In the formula, To detect each pixel (x, y) in the region at the wavelength of the illumination source. The corresponding hyperspectral scan response value at that time, The area on the inner wall of the integrating sphere coated with barium sulfate is illuminated at a wavelength of [wavelength missing]. Average response value data of multiple pixels at the time.

[0094] Furthermore, the edge detection method is the Canny edge detection method.

[0095] Furthermore, the method for matching the feature point descriptor sets of two hyperspectral scan sub-images is KD tree matching.

[0096] Furthermore, in KD tree matching, the method for filtering matching results based on the distance between feature points and the nearest and second nearest points is the LOWE ratio filtering method.

[0097] Furthermore, the feature point detection method is SIFT feature point detection.

[0098] Furthermore, the fitting relationship between the response value and the true reflectance is a quadratic function with the response value as the independent variable.

[0099] The beneficial effects of this invention are as follows: This invention detects feature points in hyperspectral scanned sub-images, obtains a set of feature point descriptors, and then matches the set of feature point descriptors. The matching results are used to perform coordinate transformation to stitch the hyperspectral scanned sub-images together, enabling corresponding stitching between feature points. This results in better matching of the hyperspectral scanned sub-images during the stitching process. Compared with mechanical stitching, it can better eliminate image distortion and errors generated during stitching, improve the imaging quality of hyperspectral scanned images, and ultimately improve the accuracy of color difference detection. Attached Figure Description

[0100] Figure 1 This is a structural diagram of the color difference measurement system based on hyperspectral global scanning imaging of the present invention;

[0101] Figure 2 This is a schematic diagram of the integrating sphere in the color difference measurement system based on hyperspectral global scanning imaging of the present invention;

[0102] Figure 3 This is a schematic diagram of the motion path of the motion system of the present invention;

[0103] Figure 4 This is a flowchart illustrating the color difference measurement method based on hyperspectral global scanning imaging according to the present invention.

[0104] Figure 5 This is a schematic diagram of the correction of the hyperspectral scan image of the present invention;

[0105] Figure 6 These are the spectral data of the standard whiteboard of this invention;

[0106] Figure 7 This invention involves the simultaneous acquisition and correction of pixel brightness values ​​in the same column before and after multi-region synchronous acquisition.

[0107] Figure 8 This is the standard grayscale plate spectral reflectance diagram of the present invention;

[0108] Figure 9 This is a diagram of the reflectivity correction coefficients of the present invention;

[0109] Figure 10 This is a schematic diagram of hyperspectral scanning sub-image stitching according to the present invention;

[0110] Figure 11 This is a schematic diagram of the color difference calculation and edge detection filtering of abnormal color differences in this invention. Detailed Implementation

[0111] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments.

[0112] System Implementation Example:

[0113] The color difference measurement system based on hyperspectral global scanning imaging of the present invention is as follows: Figure 1 As shown, the system includes a stage, an optical system, and a motion system. The optical system includes a hyperspectral camera and an integrating sphere illumination system, which are rigidly fixed to the hyperspectral camera. The motion system is used for relative movement between the optical system and the color difference sample to be detected, so that the scanning trajectory of the optical system covers the entire color difference sample to be detected, obtaining a hyperspectral scan image of the color difference sample; the hyperspectral scan image includes at least two hyperspectral scan sub-images; the motion platform includes an X-direction motion component and a Y-direction motion component. The X-direction motion component and the Y-direction motion component are used to drive the stage to move in the X and Y directions, respectively, and the stage is used to carry the sample to be detected for color difference detection.

[0114] In this embodiment, the hyperspectral camera is a high-resolution visible-near-infrared hyperspectral camera covering the 400-1000nm spectral range, with a spectral resolution of 2.8nm and a spatial pixel count of 1920. The integrating sphere illumination system structure is as follows: Figure 2 As shown, an integrating sphere illumination system using a D65 standard light source with a D / 8 geometric optical structure is employed. The light source has a color temperature of 6500 K and a power of 3 W. The inner wall of the integrating sphere is coated with a barium sulfate layer, resulting in a reflectivity ≥98%, ensuring uniform diffuse reflection illumination. The average coefficient of variation for spatial uniformity of the light source is ≤1%. The integrating sphere has a diameter of 150 mm and a 30 mm × 30 mm square sampling port at the bottom. A 25 mm diameter signal receiving port and an openable / closable optical trap are positioned at an 8° angle on both sides of the sampling port's normal. One port serves as the signal receiving port connected to a hyperspectral camera lens, while the other acts as the openable / closable optical trap to control the inclusion of specular reflection light. The spatial uniformity of the integrating sphere's illumination is quantitatively evaluated: using spectral signals under a fixed standard white board, the average spatial coefficient of variation (CV) for each wavelength is calculated to quantitatively characterize similarity. The calculated average CV is 0.9%, indicating excellent spatial uniformity of the light source, meeting the requirements for high-precision detection.

[0115] In this embodiment, the X-direction motion component and the Y-direction motion component are each driven by a 1.8° stepper motor with a pitch of 4 mm and a displacement accuracy of 0.02 mm. The stage size is 150 mm × 280 mm. The X-direction motion component is used to drive the stage to move along a direction perpendicular to the camera slit to achieve push-broom imaging, and the Y-direction motion component is used to drive the stage to achieve vertical positioning of the sample to be detected for color difference. The motion platform drags the stage to move through the X and Y directions to achieve scanning of the sample to be detected for color difference. In this embodiment, the X-direction motion component of the motion platform drives the stage to move from one end to the other along the X direction. After reaching the other end, the X-direction motion component stops running, obtaining a hyperspectral scan sub-image of the sample to be detected for color difference. The Y-direction motion component adjusts the position of the stage in the Y direction, and then the X-direction motion drives the stage to move along the X direction again to obtain another hyperspectral scan sub-image scanning path of the sample to be detected for color difference. In this embodiment, as shown... Figure 3 As shown, an "S"-shaped scanning path is formed to obtain four hyperspectral scanning sub-images (A, B, C, and D) of the color difference sample to be detected, so that the detection range of the optical system covers the entire stage, thereby realizing a complete scan of the color difference sample to be detected.

[0116] The movement distance of the X-direction motion component should be greater than or equal to the length of the stage in the X direction, and the adjustment distance of the Y-direction motion component each time should be less than or equal to the detection distance of the optical system in the Y direction, so as to ensure that the scanning path covers all pixels of the sample to be detected for color difference.

[0117] In this embodiment, the motion speed V of the X-direction motion component t The calculation method is as follows:

[0118] (1)

[0119] In the formula, D is the distance between the sample on the stage and the lens of the hyperspectral camera, x is the distance of the photosensitive element in the X direction in a single detection, f is the focal length of the lens of the hyperspectral camera, fps is the sampling frame rate of the hyperspectral camera, and N is the number of spatial pixels of the photosensitive element.

[0120] The color difference measurement system based on hyperspectral global scanning imaging of the present invention further includes a color difference calculation module. The color difference calculation module includes a processor. When the processor executes a computer program, it implements the color difference measurement method based on hyperspectral global scanning imaging of the present invention. This method is as follows: Figure 4 As shown, the specific steps include:

[0121] Step 1: Obtain the hyperspectral scan image of the sample to be tested for color difference. The hyperspectral scan results include the hyperspectral scan sub-images obtained by moving the scan in the X direction after each adjustment of the Y-direction position.

[0122] In this embodiment, that is Figure 2 The four hyperspectral scan sub-images are A, B, C, and D.

[0123] Step 2: Correct the hyperspectral scanning sub-images of each color difference detection sample.

[0124] In this embodiment, the corrections required for the hyperspectral scanning results include at least black-and-white correction and reflectance calibration correction. Furthermore, to eliminate spectral noise, this embodiment also includes multi-region synchronous acquisition correction for noise reduction. The following explanation uses all three types of corrections as examples. Figure 5 As shown, it specifically includes:

[0125] 1. Black and white correction.

[0126] The reference white plate response value data W was obtained by collecting data using a standard white calibration plate (also known as a reference white plate). The spectral data of the standard white plate is as follows: Figure 6 As shown in the figure, the horizontal axis represents the wave field, the red curve represents the average spectrum, the red area represents the spectral distribution region, the blue curve represents the maximum value, and the green curve represents the minimum value. The light source of the integrating sphere illumination system was turned off, and the dark signal data W was reacquired. The response value data after black-and-white correction was then calculated.

[0127] (2)

[0128] In the formula, I0 is the hyperspectral scanning response value of the color difference sample to be tested after black and white correction, I0 is the hyperspectral scanning response value of the color difference sample to be tested before black and white correction, B is the hyperspectral scanning response value of the reference white board when the light source is off, and W is the hyperspectral scanning response value of the reference white board when the light source is on.

[0129] In this embodiment, the reference whiteboard is a standard polytetrafluoroethylene white calibration board.

[0130] 2. Multi-region synchronous data acquisition and calibration.

[0131] Because the integrating sphere and camera remain rigidly fixed, the longitudinal axis of the push-broom imaging maps changes in the time dimension. After black-and-white correction of the acquired data, it can be observed that the brightness value (L) of pixels in the same column, affected by temperature-current fluctuations, exhibits periodic changes, indicating that short-term light source instability introduces spectral noise. A hyperspectral camera is used to simultaneously cover the sampling port area (detection area) of the integrating sphere and the surrounding inner wall area of ​​the integrating sphere (reference area coated with barium sulfate), such as... Figure 5 As shown, the barium sulfate coating area on the inner wall is used as the light source intensity reference to compensate for light source fluctuations in real time. The specific calculation method is as follows:

[0132] (3)

[0133] In the formula, To detect each pixel (x, y) in the region at the wavelength of the illumination source. The corresponding hyperspectral scan response value at that time, The area on the inner wall of the integrating sphere coated with barium sulfate is illuminated at a wavelength of [wavelength missing]. This refers to the average response value data of multiple pixels. The brightness values ​​of pixels in the same column before and after correction are collected synchronously from multiple regions, as shown below. Figure 7 As shown in the figure, the vertical axis represents pixel coordinates, and the horizontal axis represents brightness L. Figure 7 (I) represents the brightness value of the pixels in this column before multi-region synchronous acquisition and correction, and (II) represents the brightness value of the pixels in this column after multi-region synchronous acquisition and correction.

[0134] The light source fluctuation compensation strategy reduced the range of brightness values ​​of pixels in the same column from 0.606 to 0.259, achieving a fluctuation suppression rate of 57.3% and improving short-term measurement repeatability.

[0135] 3. Reflectivity calibration and correction.

[0136] A standard grayscale plate is scanned in the X direction. The scan results are then corrected for black and white values ​​and multi-region synchronous acquisition. The average value of the scan line data corresponding to each pixel in the corrected Y direction is then calculated. The processed spectral response value is then fitted to the known reflectance of the standard grayscale plate to obtain a quantitative relationship between the system response value and the true reflectance. The hyperspectral scan image of the color difference sample to be detected is then applied to this quantitative relationship to obtain the corrected hyperspectral camera scan result of the color difference sample to be detected.

[0137] The specific calculation formula is as follows:

[0138] (4)

[0139] In the formula, This is the average value of the system response of each pixel in the Y direction when scanning a standard grayscale plate. For the corrected standard grayscale pixel (x, y) at a light source wavelength of The system response value at that time.

[0140] The average system response value is fitted with a polynomial to the known reflectance of a standard grayscale plate. In this embodiment, the fitting relationship between the response value and the true reflectance is a quadratic function with the response value as the independent variable. The specific quantitative relationship between the response value and the true reflectance is as follows:

[0141] (5)

[0142] In the formula, For a standard grayscale board, the wavelength of the illumination source is... The known reflectivity, , and These are the coefficients obtained from the fitting. The spectral reflectance of the standard grayscale plate is as follows: Figure 8 As shown, the horizontal axis represents wavelength, and the vertical axis represents reflection coefficient.

[0143] Substituting the hyperspectral imaging results of the color difference sample to be detected into the above relationship, the corrected hyperspectral imaging results of the color difference sample to be detected are as follows:

[0144] (6)

[0145] In the formula, The hyperspectral imaging results of the color difference sample to be tested after correction. The wavelength of each pixel in the color difference sample to be tested after light source spectral noise compensation. The response value data. In this embodiment, the reflectivity calibration coefficient is as follows: Figure 9 As shown.

[0146] Through the above corrections, four corrected hyperspectral scanning sub-images A, B, C, and D of the color difference samples to be detected are obtained.

[0147] Step 3: Perform pixel stitching on the corrected hyperspectral scan sub-images to obtain the stitched global hyperspectral scan result.

[0148] The hyperspectral scan images to be stitched are stitched together to obtain the full-domain hyperspectral scan result of the color difference sample to be detected. The hyperspectral scan images to be stitched are either hyperspectral scan sub-images or intermediate images formed by stitching. The stitching order is not limited. In this embodiment, hyperspectral scan sub-images A and B are stitched together first, then the stitched intermediate image AB is stitched together with hyperspectral scan sub-image C, and finally the stitched intermediate image ABC is stitched together with hyperspectral scan sub-image D.

[0149] In other embodiments, the hyperspectral scanning sub-images A and B can be stitched together first, then the hyperspectral scanning sub-images C and D can be stitched together, and then the intermediate images AB and CD can be stitched together.

[0150] The method for stitching together hyperspectral scanned images to be stitched is as follows:

[0151] Feature point detection is performed on the hyperspectral scan images to be stitched to obtain a set of feature point descriptors for the hyperspectral scan images to be stitched. The set of feature point descriptors for the hyperspectral scan images to be stitched is matched. Based on the matching results, the two hyperspectral scan sub-images are stitched together using two-dimensional rigid body coordinate transformation.

[0152] In this embodiment, SIFT feature point detection is used to extract feature points, and pixel stitching is performed based on the extracted feature points to obtain the stitched global hyperspectral scanning result.

[0153] In this embodiment, the pixel stitching method uses KD-tree sampling for optimized matching, resulting in higher matching efficiency.

[0154] The specific steps are as follows:

[0155] 3.1 SIFT Feature Point Detection.

[0156] SIFT feature point detection, selecting hyperspectral scanning results of the corrected color difference sample to be detected. A composite RGB image of three representative bands. RGB A multi-scale Gaussian difference pyramid is constructed to identify local extrema in scale space. For the detected feature points, a smoothed image is used. Calculate gradient magnitude and direction :

[0157] (7)

[0158] (8)

[0159] In the formula, L(x, y) represents the feature value of pixel (x, y).

[0160] Construct gradient direction histograms, divide the neighborhood of feature points into 4×4 sub-regions, construct 8-direction gradient histograms in each sub-region, concatenate them to form a 128-dimensional feature vector and normalize it as a feature point descriptor. Normalize it to obtain Output a set of reference image feature descriptors and the set of image features to be matched .

[0161] 3.2. Based on the output image feature set and the image feature set to be matched, KD-tree optimization is used to match the two sets. The specific steps are as follows:

[0162] Construct a set of feature descriptors for the images to be matched The KD-tree structure, for each feature descriptor set R in the image i Search for nearest neighbors in a KD-tree and next nearest neighbor Calculate the features R in the feature descriptor set respectively. i Distance to nearest and second nearest neighbors and .

[0163] In this embodiment, the method for constructing a KD tree is as follows: select a dimension, calculate the median of the coordinates of the data points in that dimension as the split point, divide the data into left and right groups, and recursively repeat this process in the left and right subsets, switching the split dimension in a loop until all data points are included in the tree node, thereby improving the retrieval efficiency by about 70% compared to the enumeration method.

[0164] In this embodiment, Euclidean distance is used, and the calculation formula is as follows:

[0165] (9)

[0166] (10)

[0167] In the formula, For feature R in the feature descriptor set i With nearest neighbor S i The distance between them For feature R in the feature descriptor set i With the next nearest neighbor S p The distance between them.

[0168] For feature R i With nearest neighbor S i and the next nearest neighbor S p The distance between them is used for matching and filtering to obtain an initial set of matching point pairs. ,in For the coordinates of feature points in the reference image, These are the coordinates of the corresponding points in the image to be registered.

[0169] In this embodiment, the matching and filtering method uses the Lowe ratio test for matching and filtering, and the formula is expressed as follows:

[0170] (11)

[0171] In the formula, To set the matching threshold, a value of 0.7 is used in this embodiment.

[0172] In other implementations, an enumeration method can also be used. A comparison of the matching performance and accuracy of the KD-tree method and the enumeration method is as follows:

[0173] In this embodiment, taking 200-800 feature points as an example, we compare the retrieval performance of KD-tree retrieval with that of enumeration method and KD-tree method. The time consumption and accuracy of matching structure are shown in Table 1.

[0174] Table 1. Time consumption for KD-tree retrieval and enumeration method for feature points of different sizes.

[0175]

[0176] As shown in Table 1, the advantage of KD tree matching efficiency becomes more significant with the increase of data scale. Under the premise of maintaining the same matching accuracy, the matching time is reduced by 70%, which verifies the effectiveness and accuracy of the KD tree method of the present invention for feature matching and image stitching.

[0177] 3.3 Based on the matching results, the hyperspectral scan images to be stitched are stitched together using two-dimensional rigid body coordinate transformation.

[0178] The specific transformation formula for two-dimensional rigid body coordinate transformation is as follows:

[0179] (12)

[0180] In the formula, The coordinates in the image to be matched. These are the coordinates of the reference image that should correspond to after the transformation. For rotation angle, and This represents the translation amount. The registered global hyperspectral image is obtained. The result of pixel stitching after translation is as follows: Figure 10 As shown, where Figure 10 (I) is the hyperspectral scan image before stitching. Figure 10 (II) Mechanically spliced ​​images, where there is a displacement error at the box, causing the image to deform. Figure 10 (III) The image stitched by the method of the present invention has a well-stitched box and the image does not deform. As can be seen from the figure, the present invention can eliminate displacement error by extracting SIFT feature points and optimizing KD tree. Compared with mechanical stitching, it improves the image continuity of the whole-domain scanning result and the reliability of color difference detection.

[0181] Step 4: Calculate the color difference between the full-domain hyperspectral scanning results and the standard sample to obtain the color difference calculation results of the full-domain hyperspectral scanning results.

[0182] Step four of the present invention includes two embodiments. In the first embodiment, the color difference calculation result can be obtained by directly performing color difference calculation. The specific steps include:

[0183] 4.1 Color Space Conversion: Based on the spectral power distribution of the CIE standard illuminant D65 light source and an 8° standard color difference observer, the stitched global hyperspectral scan results are converted into CIEXYZ tristimulus values, and further converted to the CIELAB color space to obtain the brightness of each pixel. and chromaticity , .

[0184] 4.2 Pixel color difference calculation: Calculate the CIELAB color parameter map of the color difference sample to be detected. , , and color parameter diagram of standard samples , , A secondary matching process is performed to establish a pixel-level color information spatial mapping relationship between the color difference sample to be detected and the standard sample. The color difference value of the corresponding pixel is calculated according to the CIE color difference calculation formula. The specific calculation formula is as follows:

[0185] (13)

[0186] In the formula, Let x=i and y=j be the color difference between the pixels. , , Standard sample pixel coordinates The color parameters at that location, , , The color parameters are the corresponding pixels of the color difference sample to be detected.

[0187] In this embodiment, the secondary matching method is the same as the matching method used during stitching, specifically as follows: Feature points are extracted from both the global hyperspectral scan result and the standard sample to obtain two sets of feature point descriptors. These two sets of feature point descriptors are then matched. Based on the matching result, a two-dimensional rigid body coordinate transformation is used to determine the spatial mapping relationship of the color information of each pixel between the global hyperspectral scan result and the standard sample. In this embodiment, the SIFT feature point detection method is also used during secondary matching, and KD-tree matching is employed for the matching method.

[0188] In color difference detection of printed materials, at the boundary between two different colors, such as the boundary between red and white, due to the resolution limitations of the image acquisition device and the influence of the optical system, edge pixels will exhibit color aliasing, presenting an intermediate transition color between the two colors. If these edge pixels are included in the color difference calculation, false large color difference values ​​of 30 to 40 will be generated. When aligning and comparing the standard sample image with the test sample image, even with a precise registration algorithm, there is still a registration error of 0.5 to 2 pixels. This error means that the corresponding pixels in the edge region actually belong to different color blocks, and directly comparing these pixels will introduce false color difference values. Therefore, in the second embodiment of step four, in order to avoid edge errors, edge detection is also performed on the stitched full-domain hyperspectral scan results, filtering out edge non-maximum value data, and removing the color difference data corresponding to the edge non-maximum value data to obtain the color difference detection result after filtering out abnormal edge color differences.

[0189] In this embodiment, the edge detection method adopts the Canny edge detection algorithm, and the specific steps are as follows:

[0190] 5.1. Perform image grayscale conversion and smoothing on the stitched global hyperspectral scan results:

[0191] Convert the registered image to a grayscale image. The grayscale image is then smoothed to eliminate noise interference. In this embodiment, the smoothing method uses a Gaussian kernel. Smoothing is performed to eliminate noise interference.

[0192] 5.2 Gradient Calculation: Calculate the gradient magnitude and direction for each pixel.

[0193] In this embodiment, S is used. obel The operator calculates the gradient magnitude M and direction of each pixel. The specific calculation formula is as follows:

[0194] (14)

[0195] (15)

[0196] In the formula, G x and G y These are the gradients in the x and y directions, respectively.

[0197] 5.3. Perform non-maximum suppression on the gradient magnitude of each pixel: perform local maxima filtering on the gradient magnitude along the gradient direction to refine the edge width to a single pixel.

[0198] 5.4 Classify the gradient magnitude of edge pixels after non-maximum suppression: Set a strong edge threshold T high and weak edge threshold T low Edge pixels with gradient magnitudes greater than a strong edge threshold are classified as strong edges; edge pixels with gradient magnitudes less than a weak edge threshold are classified as weak edges; and edge pixels with gradient magnitudes greater than or equal to a weak edge threshold and less than or equal to a strong edge threshold are classified as weak edges. The formula is as follows:

[0199] (16)

[0200] Strong edges are all preserved. For weak edges, it is determined whether they are connected to strong edges. If they are connected to strong edges, they are preserved; otherwise, the weak edge is suppressed.

[0201] In this embodiment, the strong edge threshold Take the 70-90 percentile of the gradient magnitude histogram, and use the weak edge threshold. Ensure that the true edge recognition rate is ≥95% and the noise false detection rate is ≤5%.

[0202] 5.5 In printed images, color mixing, ink penetration, and optical diffraction occur in edge areas, causing the Lab value of these areas to not accurately reflect the printed color. Directly including these values ​​in color difference calculations will introduce false, large color difference values ​​(up to [amount missing]). Based on the classification results of edge pixels, pixels with gradient magnitudes greater than the strong edge threshold are marked as 1 in the mask, indicating that the location is an edge region. To completely cover the edge transition region, a morphological dilation operation is performed on the mask using a 2×2 structuring element, resulting in the final edge mask. Edge anomaly data (including suppressed data and data corresponding to the edge mask) is filtered in the color difference detection results to ensure the accuracy of color difference calculation.

[0203] Edge masks can automatically adapt to the complex edge structures of different printed patterns, eliminating the need for manual delineation of the detection area. Even with certain image registration errors or printing burrs, edge masks can exclude these unstable areas, stably outputting reliable color difference detection results and improving the robustness of the entire detection system.

[0204] To verify the effectiveness of the edge-abnormal color difference filtering mechanism of the present invention, in this embodiment, the same color difference sample to be detected is independently acquired twice, resulting in two stitched global hyperspectral scan results. A correspondence between each pixel in the two global hyperspectral scan results is established through secondary matching, and the color difference value of each corresponding pixel is calculated. Through edge detection and masking processing, abnormal color difference data in the color difference map is removed. Figure 11 As shown in the figure, the bright pseudo-chromatic difference band in the original chromatic difference image can be obtained ( The area (of color difference) accounted for 3.73%. After edge detection and anomaly processing, the false color difference band was significantly eliminated, and accurate registration was also achieved for areas with color gradients in the color difference sample to be detected. Quantitative analysis data is shown in Table 2. The data shows that the edge detection and masking processing method of the present invention, while retaining 95.4% of the main area, also successfully suppressed 95.3% of the edge false color difference. This verifies the engineering applicability of the edge detection and masking processing method of the present invention under complex texture samples, and can accurately focus on the macroscopic color gamut characteristics of concern to the packaging paper industry, meeting the high-precision detection requirements.

[0205] Table 2 Quantitative Analysis of Edge Processing

[0206] Original image Edge area False color difference band Eliminate false color difference Number of pixels 3856673 177165 142696 135989

[0207] In this embodiment, in accordance with the verification items and procedures of JJG 595-2002 "Verification Procedure for Colorimeters", the stability of the color difference measurement system based on hyperspectral full-domain scanning imaging of the present invention is tested using a verification card sample as the color difference sample to be tested. The repeatability and reproducibility of the system are measured using a standard white board, and the indication error of the system is measured using five standard color boards (white, red, green, blue, and yellow). The measurement results are shown in Table 3.

[0208] Table 3. System colorimetric performance indicators

[0209]

[0210] As shown in Table 3, all indicators of the color difference measurement system based on hyperspectral full-domain scanning imaging of the present invention meet the first-level verification standard, verifying the color difference detection capability of the color difference measurement system based on hyperspectral full-domain scanning imaging of the present invention.

[0211] Method implementation:

[0212] The color difference measurement method based on hyperspectral global scanning imaging of the present invention is as follows: Figure 4 As shown, the specific steps include:

[0213] Step 1: Obtain the hyperspectral scan image of the sample to be tested for color difference. The hyperspectral scan results include the hyperspectral scan sub-images obtained by moving the scan in the X direction after each adjustment of the Y-direction position.

[0214] In this embodiment, that is Figure 2 The four hyperspectral scan sub-images are A, B, C, and D.

[0215] Step 2: Correct the hyperspectral scanning results of the color difference test sample.

[0216] In this embodiment, the corrections required for the hyperspectral scanning results include at least black-and-white correction and reflectance calibration correction. Furthermore, to eliminate spectral noise, this embodiment also includes multi-region synchronous acquisition correction for noise reduction.

[0217] 1. Black and white correction.

[0218] The reference white plate response value data W was obtained by collecting data using a standard white calibration plate (also known as a reference white plate). The spectral data of the standard white plate is as follows: Figure 6 As shown, the light source of the integrating sphere illumination system is turned off, the dark signal data W is reacquired, and the response value data after black and white correction is calculated.

[0219] 2. Multi-region synchronous data acquisition and calibration.

[0220] Because the integrating sphere and camera remain rigidly fixed, the longitudinal axis of the push-broom imaging maps changes in the time dimension. After black-and-white correction of the acquired data, it can be observed that the brightness value (L) of pixels in the same column, affected by temperature-current fluctuations, exhibits periodic changes, indicating that short-term light source instability introduces spectral noise. A hyperspectral camera is used to simultaneously cover the sampling port area (detection area) of the integrating sphere and the surrounding inner wall area of ​​the integrating sphere (reference area coated with barium sulfate), such as... Figure 5 As shown.

[0221] 3. Reflectivity correction.

[0222] The standard grayscale plate is scanned in the X direction to acquire the scan line data corresponding to each pixel in the Y direction and the average value is taken. The processed spectral response value is fitted with the known reflectance of the standard grayscale plate to obtain the quantitative relationship between the system response value and the true reflectance. The hyperspectral scan image of the color difference sample to be detected is then incorporated into this quantitative relationship to obtain the corrected hyperspectral camera scan result of the color difference sample to be detected.

[0223] Step 3: Perform pixel stitching on the corrected hyperspectral scanning results to obtain the stitched global hyperspectral scanning results.

[0224] The hyperspectral scan images to be stitched are then stitched together to obtain the full-domain hyperspectral scan result of the color difference sample to be detected. The hyperspectral scan images to be stitched together are either sub-images of the hyperspectral scan or intermediate images formed by stitching. The method for stitching the hyperspectral scan images to be stitched together is as follows:

[0225] Feature point detection is performed on the hyperspectral scan images to be stitched to obtain a set of feature point descriptors for the hyperspectral scan images to be stitched. The set of feature point descriptors for the hyperspectral scan images to be stitched is matched. Based on the matching results, the two hyperspectral scan sub-images are stitched together using two-dimensional rigid body coordinate transformation.

[0226] In this embodiment, SIFT feature point detection is used for feature point detection, and KD tree matching is used for matching, which has higher matching efficiency.

[0227] Step 4: Calculate the color difference between the full-domain hyperspectral scanning results and the standard sample to obtain the color difference calculation results of the full-domain hyperspectral scanning results.

[0228] Step four of the present invention includes two embodiments. In the first embodiment, the color difference calculation result can be obtained by directly performing color difference calculation.

[0229] Since hyperspectral image scanning is prone to errors at the image edges, leading to incorrect color difference detection results, in the second embodiment of step four, in order to avoid edge errors, edge detection is also performed on the stitched global hyperspectral scanning results, filtering out edge non-maximum data, and removing the color difference data corresponding to the edge non-maximum data to obtain the color difference detection results after filtering out abnormal color differences at the edges.

[0230] In this embodiment, the edge detection method employs the Canny edge detection algorithm. Then, based on the detection results of the Canny edge detection algorithm, an edge mask is generated, and the corresponding color difference data is filtered out from the original color difference calculation results to obtain the color difference detection result after filtering out abnormal edge color differences.

[0231] Generate a binary edge mask containing a 2×2 pixel buffer, mark all transition areas, and filter out edge anomalies in color difference statistics to ensure the accuracy of color difference calculation.

[0232] Implementation of computer-readable storage media:

[0233] The present invention provides a computer-readable storage medium having a computer program stored therein. When executed, the computer program implements the color difference measurement method based on hyperspectral global scanning imaging of the present invention. The method is as follows: Figure 4 As shown, the specific steps include:

[0234] Step 1: Obtain the hyperspectral scan image of the sample to be tested for color difference. The hyperspectral scan results include the hyperspectral scan sub-images obtained by moving the scan in the X direction after each adjustment of the Y-direction position.

[0235] In this embodiment, that is Figure 2 The four hyperspectral scan sub-images are A, B, C, and D.

[0236] Step 2: Correct the hyperspectral scanning results of the color difference test sample.

[0237] In this embodiment, the corrections required for the hyperspectral scanning results include at least black-and-white correction and reflectance calibration correction. Furthermore, to eliminate spectral noise, this embodiment also includes multi-region synchronous acquisition correction for noise reduction.

[0238] 1. Black and white correction.

[0239] The reference white plate response value data W was obtained by collecting data using a standard white calibration plate (also known as a reference white plate). The spectral data of the standard white plate is as follows: Figure 6 As shown, the light source of the integrating sphere illumination system is turned off, the dark signal data W is reacquired, and the response value data after black and white correction is calculated.

[0240] 2. Multi-region synchronous data acquisition and calibration.

[0241] Because the integrating sphere and camera remain rigidly fixed, the longitudinal axis of the push-broom imaging maps changes in the time dimension. After black-and-white correction of the acquired data, it can be observed that the brightness value (L) of pixels in the same column, affected by temperature-current fluctuations, exhibits periodic changes, indicating that short-term light source instability introduces spectral noise. A hyperspectral camera is used to simultaneously cover the sampling port area (detection area) of the integrating sphere and the surrounding inner wall area of ​​the integrating sphere (reference area coated with barium sulfate), such as... Figure 5 As shown.

[0242] 3. Reflectivity correction.

[0243] The standard grayscale plate is scanned in the X direction to acquire the scan line data corresponding to each pixel in the Y direction and the average value is taken. The processed spectral response value is fitted with the known reflectance of the standard grayscale plate to obtain the quantitative relationship between the system response value and the true reflectance. The hyperspectral scan image of the color difference sample to be detected is then incorporated into this quantitative relationship to obtain the corrected hyperspectral camera scan result of the color difference sample to be detected.

[0244] Step 3: Perform pixel stitching on the corrected hyperspectral scanning results to obtain the stitched global hyperspectral scanning results.

[0245] The hyperspectral scan images to be stitched are then stitched together to obtain the full-domain hyperspectral scan result of the color difference sample to be detected. The hyperspectral scan images to be stitched together are either sub-images of the hyperspectral scan or intermediate images formed by stitching. The method for stitching the hyperspectral scan images to be stitched together is as follows:

[0246] Feature point detection is performed on the hyperspectral scan images to be stitched to obtain a set of feature point descriptors for the hyperspectral scan images to be stitched. The set of feature point descriptors for the hyperspectral scan images to be stitched is matched. Based on the matching results, the two hyperspectral scan sub-images are stitched together using two-dimensional rigid body coordinate transformation.

[0247] In this embodiment, SIFT feature point detection is used for feature point detection, and KD tree matching is used for matching, which has higher matching efficiency.

[0248] Step 4: Calculate the color difference between the full-domain hyperspectral scanning results and the standard sample to obtain the color difference calculation results of the full-domain hyperspectral scanning results.

[0249] Step four of the present invention includes two embodiments. In the first embodiment, the color difference calculation result can be obtained by directly performing color difference calculation.

[0250] Since hyperspectral image scanning is prone to errors at the image edges, leading to incorrect color difference detection results, in the second embodiment of step four, in order to avoid edge errors, edge detection is also performed on the stitched global hyperspectral scanning results, filtering out edge non-maximum data, and removing the color difference data corresponding to the edge non-maximum data to obtain the color difference detection results after filtering out abnormal color differences at the edges.

[0251] The edge detection method employs the Canny edge detection algorithm. Then, based on the detection results of the Canny edge detection algorithm, an edge mask is generated, and the corresponding color difference data is filtered out from the original color difference calculation results to obtain the color difference detection result after filtering out abnormal edge color differences.

[0252] Generate a binary edge mask containing a 2×2 pixel buffer, mark all transition areas, and filter out edge anomalies in color difference statistics to ensure the accuracy of color difference calculation.

[0253] In summary, this invention, by integrating a hyperspectral camera, a D / 8 integrating sphere light source, and a high-precision two-dimensional motion platform, achieves full-area scanning imaging of large-size packaging materials of 250 mm × 100 mm. It overcomes the limitation of traditional spectrophotometers with small measurement apertures (3-8 mm), and can obtain the complete spectral reflectance curve of each pixel on the sample surface. It provides pixel-level color difference distribution maps for complex patterns and gradient color areas, solving the industry problem that traditional methods cannot comprehensively evaluate the color consistency of large-area samples.

[0254] This invention proposes a multi-region synchronous acquisition and correction strategy, which utilizes the field of view of a hyperspectral camera to simultaneously cover the detection area and the reference area on the inner wall of the integrating sphere. The barium sulfate coating area is used as the light source intensity benchmark to compensate for the spectral noise caused by temperature and current fluctuations in the light source in real time. This reduces the range of brightness values ​​of pixels in the same column from 0.606 to 0.259, with a fluctuation suppression rate of 57.3%. This significantly improves the short-term measurement repeatability and long-term stability of the system, ensuring that the colorimetric performance meets the national first-class colorimeter standard (JJG595-2002).

[0255] This invention innovatively employs a sub-pixel-level image registration method based on SIFT feature detection and KD-tree optimized search, effectively overcoming mechanical displacement errors introduced by two-dimensional motion platforms due to factors such as transmission tolerance, servo lag, and asynchronous acquisition-motion. By constructing a 128-dimensional feature descriptor and utilizing KD-trees to accelerate nearest neighbor search, the feature matching efficiency is improved by approximately 70% compared to the traditional enumeration method. Combining the RANSAC algorithm and a two-dimensional rigid body transformation model avoids the influence of perspective distortion on spectral information, achieving high-precision panoramic image fusion for large-size samples, significantly improving spatial consistency and measurement reliability.

[0256] This invention introduces the Canny edge detection algorithm to construct an intelligent abnormal color difference filtering mechanism. It addresses the edge color difference artifacts caused by discretized sampling in high-texture areas after registration. Through Gaussian smoothing, gradient calculation, non-maximum suppression, and dual threshold detection, it generates an accurate edge mask. While retaining 95.4% of the effective color difference data in the main area, it successfully suppresses 95.3% of the edge pseudo-color difference, ensuring that the color difference statistics focus on the macroscopic color gamut deviation characteristics that are of concern to the packaging industry, and avoiding the interference of abnormal data in the edge transition area on the measurement results.

[0257] The color measurement performance of this invention has been rigorously verified by the national standard JJG 595-2002. All indicators, including stability, repeatability, reproducibility, and indication error, have reached the first-class verification standard. Furthermore, while ensuring the accuracy of point measurement, the measurement range is extended to the entire sample surface, realizing comprehensive and precise measurement. This enables the detection of local defects and macroscopic uneven distribution, providing an efficient, accurate, and reliable system solution for quality control in the packaging and printing industry.

Claims

1. A color difference measurement method based on hyperspectral global scanning imaging, characterized in that, include: 1) Obtain the hyperspectral scanning results of the color difference sample to be detected, including at least two hyperspectral scan sub-images; 2) The hyperspectral scan images to be stitched are stitched together to obtain the full-domain hyperspectral scan results of the color difference sample to be detected; The hyperspectral scan images to be stitched together are either hyperspectral scan sub-images or intermediate images formed by stitching together. The stitching method includes: performing feature point detection on the hyperspectral scan image to be stitched to obtain a set of feature point descriptors for the hyperspectral scan image to be stitched; matching the set of feature point descriptors for the hyperspectral scan image to be stitched; and stitching the hyperspectral scan image to be stitched based on the matching results using two-dimensional rigid body coordinate transformation. 3) Perform color difference calculation on the full-domain spectral scan image of the color difference sample to be tested and the standard sample to obtain the color difference calculation result.

2. The color difference measurement method based on hyperspectral global scanning imaging according to claim 1, characterized in that, The color difference calculation result obtained in step 3) is the color difference calculation result after filtering out abnormal color differences at the edges; Correspondingly, methods for filtering out abnormal color differences at the edges include: Edge detection is performed on the full-domain hyperspectral scanning results to obtain the edge regions. Morphological dilation is then performed on the edge regions to generate an edge mask to cover the transition regions of the edge regions. The color difference data corresponding to the transition regions is then filtered out from the original color difference calculation results to obtain the color difference calculation results after filtering out abnormal color differences at the edges.

3. The color difference measurement method based on hyperspectral global scanning imaging according to claim 1, characterized in that, Specific methods for calculating the color difference between full-domain hyperspectral scanning results and standard samples include: The stitched global hyperspectral scan results are converted into CIEXYZ tristimulus values, and then further converted to color space to obtain the brightness L and chromaticity a, b of each pixel in the global hyperspectral scan results. The stitched global hyperspectral scan results are matched with standard samples. Based on the matching results, the spatial mapping relationship of color information of each pixel between the global hyperspectral scan results and standard samples is determined, and the color difference value between corresponding pixels is calculated according to the following formula: In the formula, Let (i, j) be the color difference between pixel (i, j) in the standard sample and the corresponding pixel in the color difference sample to be detected. , , Standard sample pixel coordinates The brightness and chromaticity parameters at that location, , , These are the brightness and chromaticity parameters of the corresponding pixel in the color difference sample to be detected.

4. The color difference measurement method based on hyperspectral global scanning imaging according to claim 3, characterized in that, Methods for matching the stitched global hyperspectral scan results with standard samples include: Feature points are extracted from both the global hyperspectral scanning results and the standard samples to obtain two sets of feature point descriptors. The two sets of feature point descriptors are matched, and based on the matching results, the spatial mapping relationship of the color information of each pixel between the global hyperspectral scanning results and the standard samples is determined by two-dimensional rigid body coordinate transformation.

5. The color difference measurement method based on hyperspectral global scanning imaging according to claim 1, characterized in that, The hyperspectral scanning results of the color difference sample to be tested are the corrected hyperspectral scanning results of the color difference sample to be tested. The correction includes black and white correction and reflectance calibration correction.

6. The color difference measurement method based on hyperspectral global scanning imaging according to claim 5, characterized in that, Methods for black and white correction include: Obtain the hyperspectral scan response values ​​of the reference white board with the light source on and with the light source off. Calculate the hyperspectral scan results of the color difference sample to be tested after black and white correction using the following formula: In the formula, I0 is the hyperspectral scanning response value of the color difference sample to be tested after black and white correction, I0 is the hyperspectral scanning response value of the color difference sample to be tested before black and white correction, B is the hyperspectral scanning response value of the reference white board when the light source is off, and W is the hyperspectral scanning response value of the reference white board when the light source is on.

7. The color difference measurement method based on hyperspectral global scanning imaging according to claim 5, characterized in that, The method for reflectivity calibration and correction includes: A standard grayscale plate is scanned in the X direction to obtain the hyperspectral scanning response value of the standard grayscale plate. A fitting relationship is established between the response value and the true reflectance of the standard grayscale plate. The hyperspectral scanning image of the color difference sample to be tested is then substituted into the fitting relationship to obtain the hyperspectral scanning image of the color difference sample to be tested after reflectance calibration correction.

8. The color difference measurement method based on hyperspectral global scanning imaging as described in claim 5, characterized in that, The correction also includes multi-region synchronous acquisition correction for eliminating spectral noise, and the method for multi-region synchronous acquisition correction includes: The intensity of the light source in the area coated with barium sulfate on the inner wall of the integrating sphere is used as a reference value to correct the hyperspectral scanning results of the color difference sample to be tested. The correction formula is as follows: In the formula, To detect each pixel (x, y) in the region at the wavelength of the illumination source. The corresponding hyperspectral scan response value at that time, The region on the inner wall of the integrating sphere coated with barium sulfate is illuminated at a wavelength of [wavelength missing]. Average response value data of multiple pixels at the time.

9. The color difference measurement method based on hyperspectral global scanning imaging according to claim 2, characterized in that, The edge detection method used is the Canny edge detection method.

10. The color difference measurement method based on hyperspectral global scanning imaging according to claim 1, characterized in that, The method for matching the feature point descriptor sets of two hyperspectral scan sub-images is KD tree matching.

11. The color difference measurement method based on hyperspectral global scanning imaging according to claim 10, characterized in that, In KD-tree matching, the method for filtering matching results based on the distance between a feature point and its nearest and second-nearest points is the LOWE ratio filtering method.

12. The color difference measurement method based on hyperspectral global scanning imaging according to claim 1, characterized in that, The feature point detection method is SIFT feature point detection.

13. The color difference measurement method based on hyperspectral global scanning imaging according to claim 7, characterized in that, The fitting relationship between the response value and the true reflectance is a quadratic function with the response value as the independent variable.

14. A color difference measurement system based on hyperspectral global scanning imaging, characterized in that, It includes an optical system, a motion system, and a stage for carrying the color difference sample to be detected. The motion system is used to realize the relative movement between the optical system and the color difference sample to be detected, so that the scanning trajectory of the optical system covers the entire color difference sample to be detected, and the hyperspectral scanning result of the color difference sample to be detected is obtained. The color difference measurement system further includes a color difference calculation module, which includes a processor. The processor is used to implement the color difference measurement method based on hyperspectral full-domain scanning imaging as described in any one of claims 1-13 when executing a computer program.

15. The color difference measurement system based on hyperspectral global scanning imaging according to claim 14, characterized in that, The velocity of a motion system is determined by the following formula: In the formula, V t Let be the velocity of the motion system, and D be the distance between the lens of the hyperspectral camera and the color difference sample to be detected. The detection distance of the hyperspectral camera in the direction of motion of the moving frame. The focal length of the lens for a hyperspectral camera. The sampling frame rate of the hyperspectral camera. This represents the number of pixels in the spatial dimension of the hyperspectral camera's image sensor.

16. A computer-readable storage medium having a computer program stored internally, characterized in that, When the computer program is executed, it implements the color difference measurement method based on hyperspectral scanning imaging as described in any one of claims 1-13.

Citation Information

Patent Citations

  • Wood dyeing color difference detection method and system based on deep learning and medium

    CN116559119A