Online tobacco leaf image color correction method, system and device

By acquiring 24-color chart images and calculating gamma values ​​and transformation matrix M, the problem of inaccurate color reproduction when industrial cameras capture tobacco leaf images was solved, achieving high-precision color correction and reproduction of tobacco leaf images online.

CN115665565BActive Publication Date: 2026-06-23YUNNAN TOBACCO LEAF

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
YUNNAN TOBACCO LEAF
Filing Date
2022-10-25
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

When industrial cameras capture images of tobacco leaves, color differences arise due to environmental and equipment factors, and the color reproduction accuracy of traditional methods is not precise enough.

Method used

By acquiring images from a 24-color chart, calculating the brightness of gray blocks, fitting the gamma values ​​of the RGB channels, calculating the RGB response signal value P, and obtaining the transformation matrix M of the XYZ values, a precise transformation from RGB to XYZ is achieved, enabling online color correction of tobacco leaf images.

Benefits of technology

It achieves high-precision restoration of tobacco leaf image color correction online, ensuring accurate reproduction of tobacco leaf color under different devices and environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115665565B_ABST
    Figure CN115665565B_ABST
Patent Text Reader

Abstract

The application discloses an online tobacco leaf image color correction method, system and device, which comprises the following steps: obtaining the image of a 24-color card, measuring and calculating the brightness of six gray blocks in the 24-color card; obtaining the 24-color card RGB color value according to the image of the 24-color card; fitting the brightness of the gray blocks to obtain the gamma value of the three RGB color channels; calculating the response signal value P of the 24-color card RGB color value according to the gamma value of the RGB channel and the 24-color card RGB color value, obtaining the XYZ value under the standard light source condition of the 24-color card, expressing the XYZ value vector as H, and calculating the transformation matrix M from the RGB response signal value P to the XYZ value; obtaining the RGB color value of the online tobacco leaf image, calculating the response signal value of the online tobacco leaf image RGB color value, and obtaining the XYZ value of the online tobacco leaf image for display according to the response signal value and the transformation matrix M. The application can realize online tobacco leaf image color correction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image color correction, and in particular to an online method, system, and apparatus for color correction of tobacco leaf images. Background Technology

[0002] When industrial cameras take pictures, the color of the tobacco leaves seen on the display device is significantly different from the color of the tobacco leaves in the actual environment due to factors such as the movement of tobacco leaves along the production line, the lighting system of the production environment, the internal settings of the camera, and the different display devices.

[0003] Traditional target color characterization methods typically use a camera to capture RGB values ​​from a standard color chart and then directly establish a transformation relationship with the XYZ values ​​of the color chart under standard lighting conditions. However, since the camera needs to perform gamma correction on the sensor response signal when acquiring RGB values ​​to compensate for the nonlinear perception of natural brightness by the human eye, the established transformation relationship is not accurate enough for color reproduction. Summary of the Invention

[0004] The purpose of this invention is to provide an online tobacco leaf image color correction method, system, and apparatus, which aims to solve the problem of online tobacco leaf image color correction.

[0005] This invention provides an online tobacco leaf image color correction method, comprising:

[0006] S1. Acquire an image of the 24-color chart and measure and calculate the brightness of the 6 gray blocks in the 24-color chart;

[0007] S2. Obtain the RGB color values ​​of the 24-color card based on the image of the 24-color card;

[0008] S3. Fit the brightness of the 6 gray blocks to obtain the gamma values ​​of the three color channels of RGB;

[0009] S4. Calculate the response signal value P of the RGB color values ​​of the 24 color card based on the gamma value of the RGB channel and the RGB color values ​​of the 24 color card. P is the extended vector.

[0010] S5. Obtain the XYZ values ​​under the standard illuminant conditions of the 24-color card, represent the XYZ value vector as H, and calculate the transformation matrix M from the RGB response signal value P to the XYZ value.

[0011] S6. Obtain the RGB color values ​​of the online tobacco leaf image, calculate the response signal value of the RGB color values ​​of the online tobacco leaf image, obtain the XYZ values ​​of the online tobacco leaf image based on the response signal value and the transformation matrix M, and display the online tobacco leaf image based on the XYZ values ​​to complete the color correction of the online tobacco leaf image.

[0012] The present invention also provides an online tobacco leaf image color correction system, comprising:

[0013] Acquisition module: Used to acquire images of the 24-color chart and measure and calculate the brightness of the six gray blocks in the 24-color chart;

[0014] Color value module: Used to obtain the RGB color values ​​of the 24-color card from the image of the 24-color card;

[0015] Fitting module: Used to fit the brightness of 6 gray blocks to obtain the gamma values ​​of the three color channels of RGB;

[0016] Calculation module: used to calculate the response signal value P of the RGB color values ​​of the 24-color card based on the gamma values ​​of the RGB channels and the RGB color values ​​of the 24-color card, where P is the extended vector;

[0017] Transformation module: used to obtain the XYZ values ​​under the standard illuminant conditions of the 24-color card, represent the XYZ value vector as H, and calculate the transformation matrix M from the RGB response signal value P to the XYZ value;

[0018] Display module: Used to acquire the RGB color values ​​of online tobacco leaf images, calculate the response signal values ​​of the RGB color values ​​of online tobacco leaf images, obtain the XYZ values ​​of online tobacco leaf images based on the response signal values ​​and the transformation matrix M, and display the online tobacco leaf images based on the XYZ values, thus completing the color correction of online tobacco leaf images.

[0019] This invention also provides an online tobacco leaf image color correction device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the above method.

[0020] This invention also provides a computer-readable storage medium storing an information transmission implementation program, which, when executed by a processor, implements the steps of the above-described method.

[0021] By using the embodiments of the present invention, the gamma value obtained by fitting makes the established transformation relationship more accurate in color restoration, thus realizing online color correction of tobacco leaf images.

[0022] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0023] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0024] Figure 1 This is a flowchart of the online tobacco leaf image color correction method according to an embodiment of the present invention;

[0025] Figure 2 This is a schematic diagram of the online tobacco leaf image color correction system according to an embodiment of the present invention;

[0026] Figure 3 This is a schematic diagram of an online tobacco leaf image color correction device according to an embodiment of the present invention. Detailed Implementation

[0027] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0028] Method Implementation Examples

[0029] According to an embodiment of the present invention, an online tobacco leaf image color correction method is provided. Figure 1 This is a flowchart of the online tobacco leaf image color correction method according to an embodiment of the present invention, such as... Figure 1 As shown, it specifically includes:

[0030] S1. Acquire an image of the 24-color chart and measure and calculate the brightness of the 6 gray blocks in the 24-color chart;

[0031] S2. Obtain the RGB color values ​​of the 24-color card based on the image of the 24-color card;

[0032] S3. Fit the brightness of the 6 gray blocks to obtain the gamma values ​​of the three color channels of RGB;

[0033] By inversely gamma-correcting the RGB color values ​​to their response signal values ​​r, g, b, the problem of insufficient accuracy in color reproduction caused by the fact that cameras need to perform gamma correction on the sensor response signal when acquiring RGB values ​​to compensate for the nonlinear perception of natural brightness by the human eye is solved.

[0034] S4. Calculate the response signal value P of the RGB color values ​​of the 24 color card based on the gamma value of the RGB channel and the RGB color values ​​of the 24 color card. P is the extended vector.

[0035] S5. Obtain the XYZ values ​​under the standard illuminant conditions of the 24-color card, represent the XYZ value vector as H, and calculate the transformation matrix M from the RGB response signal value P to the XYZ value.

[0036] S6. Obtain the RGB color values ​​of the online tobacco leaf image, calculate the response signal value of the RGB color values ​​of the online tobacco leaf image, obtain the XYZ values ​​of the online tobacco leaf image based on the response signal value and the transformation matrix M, and display the online tobacco leaf image based on the XYZ values ​​to complete the color correction of the online tobacco leaf image.

[0037] S1 specifically includes: acquiring an image of a 24-color chart. The XYZ values ​​of the 24 color patches under a standard light source are known. Under the standard light source, the brightness of these 6 gray patches is obtained from the power spectrum of the light source and its reflectance coefficient.

[0038]

[0039] Where S(λ) is the power spectrum of the light source; r i (λ) represents the reflectance coefficients of 6 gray spectra, i = 1, 2, 3, 4, 5, 6.

[0040] S3 specifically includes:

[0041] Get the RGB values ​​a of the 6 gray blocks i b i c t The gamma values ​​g of the three RGB color channels were obtained by fitting the formula. r g g g b The formula is as follows:

[0042]

[0043] S4 specifically includes:

[0044] The response signal value of the color block is 1≤j≤24, j∈N+, the 24 response signal values ​​are represented by a 24×3 matrix p. Adding higher-order terms and cross terms to vector p yields vector P. The XYZ values ​​are represented by a 24×3 matrix H. The transformation formula from RGB response signal values ​​to XYZ values ​​is as follows:

[0045] H = PM;

[0046] Calculate the transformation matrix M.

[0047] Typically, extension terms are added to vector p, such as higher-order terms or cross terms of the channels, to achieve nonlinear transformation between the two and improve the mapping accuracy of spatial transformation. If the number of terms in vector p is extended to 11, then P is represented as a 24×11 matrix, and the coefficient matrix M is an 11×3 matrix. As the number of terms in matrix P increases, the capacity of the coefficient matrix M also increases significantly, which in turn affects the accuracy of the camera characterization model.

[0048] Through transformation, the transformation matrix M can be obtained:

[0049] M = (P T P) -1 P T H

[0050] After obtaining the coefficient matrix M using the above steps, the RGB values ​​of the entire photo, which depend on the device, can be converted to an independent color space CIEXYZ or CIELAB, thereby achieving color replication and reproduction between different devices.

[0051] It provides an efficient color reproduction method for real-time capture of dynamic objects in industrial production processes.

[0052] This invention provides a method for accurately reproducing the color of dynamically collected tobacco leaves during industrial production under different lighting conditions and using an international standard color chart for color correction. It is a digital camera color correction method based on a target color.

[0053] In a fixed-light-source shooting scenario, a 24-color chart is placed around the target image. Camera parameters are adjusted for taking photos. The images are captured, and software and related algorithms are used to extract the RGB color values ​​of the ColorChecker 24-color chart for that scenario. By calculating the gamma values ​​of the camera's three color channels, the RGB color values ​​are inversely gamma-corrected to their response signal values ​​r, g, b. Then, the conversion relationship from r, g, b to the XYZ color space is calculated using polynomial regression. The software-programmed solution and characteristic results demonstrate that this color characteristication method can achieve real-time online color correction of tobacco leaf images.

[0054] This invention accurately realizes the color characteristics of industrial cameras, effectively solving the problem of inconsistency between the color of tobacco leaves captured in dynamic tobacco leaf images and the actual color of tobacco leaves in industrial production, and achieving faithful reproduction of the color captured in dynamic tobacco leaf images.

[0055] System Implementation Examples

[0056] According to an embodiment of the present invention, an online tobacco leaf image color correction system is provided. Figure 2 This is a schematic diagram of an online tobacco leaf image color correction system according to an embodiment of the present invention, as shown below. Figure 2As shown, it specifically includes:

[0057] Acquisition module: Used to acquire images of the 24-color chart and measure and calculate the brightness of the six gray blocks in the 24-color chart;

[0058] Color value module: Used to obtain the RGB color values ​​of the 24-color card from the image of the 24-color card;

[0059] Fitting module: Used to fit the brightness of 6 gray blocks to obtain the gamma values ​​of the three color channels of RGB;

[0060] Calculation module: used to calculate the response signal value P of the RGB color values ​​of the 24-color card based on the gamma values ​​of the RGB channels and the RGB color values ​​of the 24-color card, where P is the extended vector;

[0061] Transformation module: used to obtain the XYZ values ​​under the standard illuminant conditions of the 24-color card, represent the XYZ value vector as H, and calculate the transformation matrix M from the RGB response signal value P to the XYZ value;

[0062] Display module: Used to acquire the RGB color values ​​of online tobacco leaf images, calculate the response signal values ​​of the RGB color values ​​of online tobacco leaf images, obtain the XYZ values ​​of online tobacco leaf images based on the response signal values ​​and the transformation matrix M, and display the online tobacco leaf images based on the XYZ values, thus completing the color correction of online tobacco leaf images.

[0063] The acquisition module is specifically used to: acquire an image of a 24-color chart, and obtain the brightness of the six gray patches under a standard light source using the power spectrum and reflectance coefficient of the light source.

[0064]

[0065] Where S(λ) is the power spectrum of the light source; r i (λ) represents the reflectance coefficients of 6 gray spectra, i = 1, 2, 3, 4, 5, 6.

[0066] The fitting module is specifically used for:

[0067] Get the RGB values ​​a of the 6 gray blocks i ,b i ,c i The gamma values ​​g of the three RGB color channels were obtained by fitting the formula. r g g g b The formula is as follows:

[0068]

[0069] The calculation module is specifically used for:

[0070] The response signal value of the color block is 1≤j≤24, j∈N + The 24 response signal values ​​are represented by a 24×3 matrix p. Adding higher-order terms and cross terms to vector p yields vector P. The XYZ values ​​are represented by a 24×3 matrix H. The transformation formula from RGB response signal values ​​to XYZ values ​​is as follows:

[0071] H = PM;

[0072] Calculate the transformation matrix M.

[0073] The embodiments of the present invention are system embodiments corresponding to the above method embodiments. The specific operation of each module can be understood by referring to the description of the method embodiments, and will not be repeated here.

[0074] Device Example 1

[0075] This invention provides an online tobacco leaf image color correction device, such as... Figure 3 As shown, it includes: a memory 30, a processor 32, and a computer program stored on the memory 30 and executable on the processor 32. When the computer program is executed by the processor, it implements the steps in the above method embodiments.

[0076] Device Example 2

[0077] This invention provides a computer-readable storage medium storing an information transmission implementation program, which, when executed by a processor 32, implements the steps described in the above method embodiments.

[0078] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions to the technical solutions of the embodiments of the present invention do not cause the essence of the corresponding technical solutions to deviate from the scope of the present solution.

Claims

1. An online tobacco leaf image color correction method, characterized in that, include, S1. Acquire an image of the 24-color chart and measure and calculate the brightness of six gray patches in the 24-color chart; specifically, this includes: acquiring an image of the 24-color chart, and obtaining the brightness of these six gray patches under a standard light source using the power spectrum and reflectance of the light source. (1); in, It is the power spectrum of the light source; The reflectance coefficients of 6 gray spectra are given, i = 1, 2, 3, 4, 5, 6; S2. Obtain the RGB color values ​​of the 24-color card based on the image of the 24-color card; S3. Fit the brightness of the six gray blocks to obtain the gamma values ​​of the three RGB color channels; specifically including: Get the RGB values ​​of the 6 gray blocks , , The gamma values ​​of the three RGB color channels were obtained by fitting the formula. The formula is as follows: (2); S4. Calculate the response signal value P of the RGB color values ​​of the 24-color card based on the gamma values ​​of the RGB channels and the RGB color values ​​of the 24-color card. P is the extended vector. Specifically, this includes: The response signal value of the color block is r= g= b= , j N + The 24 response signal values ​​are represented by a 24×3 matrix R. Expanding matrix R row-wise into a vector r, and adding higher-order terms and cross terms to vector r, yields an extended vector P. The XYZ values ​​are represented by a 24×3 matrix H. The transformation formula from RGB response signal values ​​to XYZ values ​​is as follows: H=PM; Calculate the transformation matrix M; S5. Obtain the XYZ values ​​under the standard illuminant conditions of the 24-color card, represent the XYZ value vector as H, and calculate the transformation matrix M from the RGB response signal value P to the XYZ value. S6. Obtain the RGB color values ​​of the online tobacco leaf image, calculate the response signal value of the RGB color values ​​of the online tobacco leaf image, obtain the XYZ values ​​of the online tobacco leaf image based on the response signal value and the transformation matrix M, and display the online tobacco leaf image based on the XYZ values ​​to complete the color correction of the online tobacco leaf image.

2. An online tobacco leaf image color correction system, characterized in that, include, Acquisition Module: Used to acquire images of the 24-color chart and measure and calculate the brightness of six gray patches in the 24-color chart; specifically, it is used to: acquire images of the 24-color chart, and obtain the brightness of these six gray patches under a standard light source using the power spectrum and reflectance of the light source. (1); in, It is the power spectrum of the light source; The reflectance coefficients of 6 gray spectra are given, i = 1, 2, 3, 4, 5, 6; Color value module: Used to obtain the RGB color values ​​of the 24-color card from the image of the 24-color card; Fitting module: Used to fit the brightness of 6 gray blocks to obtain the gamma values ​​of the RGB three color channels; specifically used for: Get the RGB values ​​of the 6 gray blocks , , The gamma values ​​of the three RGB color channels were obtained by fitting the formula. The formula is as follows: (2); Calculation module: Used to calculate the response signal value P of the RGB color values ​​of the 24-color chart based on the gamma values ​​of the RGB channels and the RGB color values ​​of the 24-color chart, where P is the extended vector; specifically used for: The response signal value of the color block is r= g= b= , j N + The 24 response signal values ​​are represented by a 24×3 matrix R. Expanding matrix R row-wise into a vector r, and adding higher-order terms and cross terms to vector r, yields an extended vector P. The XYZ values ​​are represented by a 24×3 matrix H. The transformation formula from RGB response signal values ​​to XYZ values ​​is as follows: H=PM; Calculate the transformation matrix M; Transformation module: used to obtain the XYZ values ​​under the standard illuminant conditions of the 24-color card, represent the XYZ value vector as H, and calculate the transformation matrix M from the RGB response signal value P to the XYZ value; Display module: Used to acquire the RGB color values ​​of online tobacco leaf images, calculate the response signal values ​​of the RGB color values ​​of online tobacco leaf images, obtain the XYZ values ​​of online tobacco leaf images based on the response signal values ​​and the transformation matrix M, and display the online tobacco leaf images based on the XYZ values, thus completing the color correction of online tobacco leaf images.

3. An online tobacco leaf image color correction device, characterized in that, include: The memory, the processor, and the computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the online tobacco image color correction method as described in claim 1.

4. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores an implementation program for information transmission, which, when executed by a processor, implements the steps of the online tobacco leaf image color correction method as described in claim 1.