A brightness correction grayscale method based on color loss

By calculating the brightness and chromaticity differences in the CIE L*a*b* color space and optimizing the objective function with the conjugate gradient method to generate a grayscale image, the problems of low contrast and color information loss in grayscale color images in the existing technology are solved, and efficient and stable grayscale image generation is achieved.

CN117094903BActive Publication Date: 2025-10-03INNER MONGOLIA UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310852102.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-12
Publication Date
2025-10-03
Estimated Expiration
2043-07-12

AI Technical Summary

Technical Problem

Existing color image grayscale conversion methods have shortcomings in preserving brightness and chromaticity information, resulting in low contrast of grayscale images or loss of color information, affecting image processing efficiency and effect.

Method used

Convert the color image to the CIE L*a*b* color space, calculate the brightness and chromaticity differences, define the signed color distance function, combine the brightness and chromaticity information, and optimize the objective function through the conjugate gradient method to generate a grayscale image to balance the brightness and chromaticity information of the color image.

Benefits of technology

The contrast of the original color image is effectively preserved, the generated grayscale image is more in line with human eye perception, the calculation speed is fast, and the result stability and contrast balance are good.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117094903B_ABST
    Figure CN117094903B_ABST
Patent Text Reader

Abstract

A color-loss-based brightness correction grayscale method converts the original color image from the RGB color space to the CIE L*a*b* color space. The brightness and chromaticity differences between the i-th and j-th pixels in the original color image are calculated in the CIE L*a*b* color space. A signed color distance is defined between the i-th and j-th pixels. The optimal solution to the objective function is obtained as the final grayscale output. Based on image color loss, the present invention appropriately reflects the brightness information of the input image and the chromaticity information of the original color image in the grayscale image, thereby improving the contrast of the grayscale image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of digital image processing, and in particular relates to a brightness correction grayscale method based on color loss. Background Art

[0002] With the continuous development of image analysis and computer vision, there are almost no technical fields unrelated to digital image processing. As a result, color image grayscale conversion technology is gaining increasing attention. Although the vast majority of captured images are color photographs, they are still printed in black and white to save costs. For example, the majority of images in many publications are grayscale images. Furthermore, for medical images, directly using grayscale images for subsequent processing can improve computational efficiency. In the system preprocessing stage of some image processing and pattern recognition technologies, such as face recognition and moving object tracking, color images need to be grayscaled to reduce the amount of information in the input image or the amount of computation required for subsequent calculations. This not only increases the processing speed of subsequent algorithms but also greatly improves the overall effectiveness of the system. Therefore, color image grayscale conversion is a crucial research direction in digital image processing, and obtaining effective grayscale images is extremely important.

[0003] Gooch et al. proposed a color removal method (Color2Gray algorithm) that takes color differences into account. This algorithm preserves the color contrast information of the original image pixels to a certain extent. However, because it selectively selects only the brightness or chromaticity information of the pixels when constructing the target difference function, it may cause some pixels to lose brightness information and others to lose chromaticity information. Rasche et al. proposed a new color image decolorization algorithm that transforms the color-to-grayscale conversion problem into an optimization problem. The algorithm stipulates that the perceived color difference between any pair of pixels in the original color image should be proportional to the perceived difference between the corresponding pair of pixels in the grayscale image. To reduce computational time, the set of quantized colors is optimized, and the result is then used to optimize the grayscale levels of all pixels in the resulting image. Although this algorithm can maintain some structural information of the original color image, it still produces some inconsistent contours.

[0004] Grundland, Dodgson, and others proposed a linear grayscale mapping algorithm that integrates image sampling and image dimensionality reduction methods, sampling color differences and performing principal component analysis. Due to the method's continuous mapping and global consistency, it achieves real-time grayscale processing. TANAKA et al. proposed a new color-to-monochrome conversion method that improves the Gooch algorithm to improve computational efficiency, but this improvement only improves computational efficiency, and the grayscale conversion effect remains unsatisfactory. Kim et al. proposed a fast color-to-grayscale conversion algorithm that uses nonlinear global mapping model parameter fitting to preserve the original image color order during grayscale conversion by minimizing the gradient difference between color and grayscale images. [Context unclear - likely a temporally consistent conversion of streaming video at interactive frame rates.] Although this method has few input parameters, maintains most of the image's visual effects, and has good real-time performance, it does not explicitly consider global contrast and instead focuses on local features, resulting in similar grayscale values ​​for pixels of different colors that are far apart.

[0005] Lu et al. proposed a contrast-preserving decolorization method. They exploited weak color constraints to achieve a highly flexible and optimal grayscale representation and proposed a mixture of Gaussian functions to expand the search space during optimization. This strategy automatically finds appropriate grayscales while preserving significant color variations. They also proposed a bimodal distribution, a mixture of two Gaussian distributions, to automatically find an appropriate order related to visual context during optimization. They designed a parameterized multivariate polynomial function for color mapping and developed a fixed-point iterative solver for the new energy function. While image contrast information is preserved to some extent, the algorithm prioritizes performance over computational speed. Seo et al. proposed a new color-to-grayscale algorithm based on principal component analysis (PCA). First, the original color image is transformed from the RGB color model to the YCb Cr color model. Then, PCA analysis is performed on the input image in the YCb Cr color model to reduce its dimensionality and obtain three eigenvectors, of which the eigenvector with the highest energy represents the principal direction of projection. This algorithm preserves the edge contour information and detail information of the image relatively completely, but there are still some flaws in color restoration. In the generated grayscale image, the difference in the grayscale values ​​of the two colors is extremely small, which can easily cause confusion.

[0006] Luo Tingting et al. proposed a color image grayscale algorithm based on contrast stretching and gradient domain optimization. First, the image is decomposed into three channels (R, G, and B), and the contrast of each channel is stretched. Second, the stretched images are merged for preliminary grayscale conversion. Finally, the contrast information of the original image is combined with the resulting image of the preliminary grayscale conversion to form an energy function to obtain the desired grayscale image. This algorithm can well preserve the structural information of the original image and has obvious advantages in preserving local details, and can clearly maintain the detailed information of the original image. However, the algorithm requires multiple iterative calculations and runs slowly. Further research and optimization of the running speed will be carried out in the future. Summary of the Invention

[0007] In order to overcome the shortcomings of the above-mentioned prior art, the purpose of the present invention is to provide a brightness correction grayscale method based on color loss. Based on the image color loss, the brightness information of the input image and the chromaticity information of the original color image are appropriately reflected in the grayscale image, thereby improving the contrast of the grayscale image.

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

[0009] A brightness correction grayscale method based on color loss includes the following steps:

[0010] Step 1: Convert the original color image from RGB color space to CIE L*a*b* color space, and calculate the brightness difference between the ith pixel and the jth pixel in the original color image in CIE L*a*b* color space. and chromaticity difference ΔC ij ,as follows:

[0011]

[0012]

[0013] in, and Respectively represent the brightness of the i-th pixel and the j-th pixel in the CIE L*a*b* color space, and Respectively represent the values ​​of the i-th pixel and the j-th pixel on the a-axis in the CIE L*a*b* color space, and Represent the values ​​of the i-th pixel and the j-th pixel on the b-axis in the CIE L*a*b* color space;

[0014] Step 2: Define the signed color distance δ between the i-th pixel and the j-th pixel ij ,as follows:

[0015]

[0016]

[0017] Φ(x)=αtanh(x / α)

[0018] v θ =(cosθ,sinθ)

[0019] is a unit vector, and ΔC ij Together they determine the value of the sign function. The angle θ controls which colors in the original color image should be brighter in the color-to-gray conversion. α is a positive real number parameter that controls how much color change is allowed to change the source brightness value. Φ(x) is a compression function that compresses the value of x into a specified range.

[0020] Step 3, define the objective function as follows:

[0021]

[0022] Among them, n is the number of pixels of the original color image, f i is the grayscale of the i-th pixel, f j is the grayscale of the jth pixel, vector f=(f1,f2,f3,...,f n ) represents a grayscale image;

[0023] Step 4: Find the optimal solution of the objective function as the final output grayscale image.

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

[0025] (1) Unlike other existing methods, the present invention uses brightness information to compensate for the loss of contrast after the chrominance information is grayed, which well preserves the contrast of the original color image and makes the grayscale image more consistent with the subjective perception of the human eye, resulting in robustness.

[0026] (2) The present invention uses the conjugate gradient method to find the optimal solution. The method used is simple and efficient, and the calculation speed is fast. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 This is a framework diagram of the grayscale method for brightness correction based on color loss of the present invention.

[0028] Figure 2 This is a flow chart of the grayscale method for brightness correction based on color loss of the present invention.

[0029] Figure 3 This is a comparison chart of the results of the algorithm used in the grayscale method of brightness correction based on color loss of the present invention and other algorithms. DETAILED DESCRIPTION

[0030] The embodiments of the present invention are described in detail below with reference to the accompanying drawings and examples.

[0031] The present invention is a brightness correction grayscale method based on color loss, which uses color information to realize the grayscale of color images. The principle is to fully utilize and balance the brightness information and color information of color image pixels to enhance color contrast, so that the brightness information of the input image and the chromaticity information of the original color image are appropriately reflected in the grayscale image, thereby improving the contrast of the grayscale image.

[0032] The principle and process of the present invention are as follows Figure 1 and Figure 2 As shown, please follow the steps below:

[0033] Step 1: Convert the original color image from the RGB color space to the perceptually uniform CIE L*a*b* color space, calculate the perceived brightness of the original color image in the CIE L*a*b* color space, and calculate the brightness difference and chromaticity difference between pixels in the original color image.

[0034] To convert an image from RGB space to CIE L*a*b* space for processing, first convert from the RGB color model to the XYZ color model:

[0035]

[0036] Then convert from XYZ color space to CIE L*a*b* space:

[0037]

[0038]

[0039]

[0040]

[0041] where X n 、Y n , Z n The three stimulus values ​​for standard white are 95.047, 100.0, and 108.883 respectively.

[0042] The present invention calculates the brightness difference between the ith pixel and the jth pixel in the original color image in the CIE L*a*b* color space. and chromaticity difference ΔC ij , which is expressed as follows:

[0043]

[0044]

[0045] in, and Respectively represent the brightness of the i-th pixel and the j-th pixel in the CIE L*a*b* color space, and Respectively represent the values ​​of the i-th pixel and the j-th pixel on the a-axis in the CIE L*a*b* color space, and Represent the values ​​of the i-th pixel and the j-th pixel on the b-axis in the CIE L*a*b* color space, respectively.

[0046] Step 2: Define the signed color distance δ between the i-th pixel and the j-th pixel ij , δ ij It reflects the color difference between pixels. Therefore, the present invention can fully utilize and balance the brightness information and color information of the pixels of the color image, appropriately reflect the color information in the input image in the grayscale image, and improve the contrast of the grayscale image.

[0047] Some existing algorithms only compare the brightness and chromaticity differences between color image pixels, and then selectively map the brightness or chromaticity information of the original color image to the grayscale image, resulting in the loss of color information in the resulting grayscale image and low contrast. To overcome this drawback, the present invention combines the brightness and chromaticity differences between pixels in the color image and defines a signed color distance function δ that uses both brightness and chromaticity components. ij represents the color difference between these pixels, which is expressed as follows:

[0048]

[0049]

[0050] Φ(x)=αtanh(x / α)

[0051] v θ =(cosθ,sinθ)

[0052] in, is a unit vector, and ΔC ij Together they determine the value of the sign function, i.e., and ΔC ij The inner product between them determines the value of the sign function sign().

[0053] The angle θ controls which colors in the original color image should be brighter in the color-to-gray conversion. Specifically, the angle θ divides the chromaticity plane and determines whether the color difference will darken or brighten the source brightness difference. θ varies continuously between 0 and 360 degrees. θ between 0 and 90 degrees and 270 to 360 degrees means brightening warm areas, and between 90 and 270 degrees means darkening cool areas. α is a positive real number parameter that controls how much color change is allowed to change the source brightness value, that is, α controls the amount of color change applied to the source brightness value. Experiments have determined that when α = 15, the best monochrome image (i.e., grayscale image) is achieved.

[0054] Φ(x) is a compression function that compresses large values ​​into a valid range.

[0055] Step 3: Define the objective function containing the color information of the color image as follows:

[0056]

[0057] Among them, n is the number of pixels of the original color image, f i is the grayscale of the i-th pixel, f j is the grayscale of the jth pixel, vector f=(f1,f2,f3,...,f n The present invention uses a set of signed scalars to represent the color differences between pixels in a color image, so that the grayscale levels of the grayscale image can be generated based on these scalars.

[0058] Step 4: Calculate the optimal solution to the objective function, which is used as the final grayscale image output. During the iterative process, the luminance component data of the original color image is used as the initial value of the image grayscale function. Then, through step-by-step iterative calculations, the value of each pixel is updated, ultimately resulting in the desired grayscale image. The present invention determines the optimal grayscale image based on parameters, thereby ensuring that the grayscale image is more consistent with human perception.

[0059] This step uses the conjugate gradient method to obtain the optimal solution of the objective function, which is expressed as follows:

[0060]

[0061] in is the output grayscale image, The local solution can be obtained through the components. for The i-th component of is as follows:

[0062]

[0063] L *Represents the average brightness of the original color image. R is a real number set, and the value range of R is (0,255).

[0064] The present invention uses the conjugate gradient method to solve the objective function minimization problem. In this step, the brightness component of the input image As the initial approximate solution vector x0, the conjugate gradient method is then used to iterate it to its minimum value. The objective function is convex and has an infinite number of solutions. Therefore, when the solution is obtained by the conjugate gradient method Afterwards, a grayscale shift of the solution can be implemented to obtain an effective average brightness of the output converted image. Specifically, the final converted image is obtained by grayscale shifting that draws the average brightness of the output monochrome image to the brightness of the input color image.

[0065] Finally, the present invention can obtain the global optimal solution through minimization.

[0066] To verify the effectiveness of the method of the present invention, the performance of the brightness correction grayscale method based on color loss of the present invention was qualitatively and quantitatively evaluated by the following methods.

[0067] like Figure 3 The method of the present invention is compared with the experimental results of the classic grayscale algorithm of Gooch et al., Lu et al. and Bao S et al., which have better grayscale effects. Comparison of image set results: (a) is the input color image, (b) is the algorithm proposed by Gooch et al., (c) is the algorithm proposed by Lu et al., (d) is the algorithm proposed by Bao S, and (e) is the grayscale result of the algorithm proposed by this invention. Figure 3 Some color to grayscale conversion results obtained by each method are shown. In the figure, the results shown in column (b) are obtained by the method of Gooch et al. Although good grayscale images can be obtained in general, sometimes the output image is not good. Figure 3 As shown in (b2), the character "R" is difficult to distinguish. Column (d) shows the results of the method of Lu et al. Although the color differences in the input images are reflected as grayscale images, the image contrast is generally too high. In other words, it cannot be said to be a good image. The results of the method of Bao et al. are shown in column (d). Although Figures (d3) and (d4) are good in terms of image contrast, the results of Figures (d1) and (d2) are not good. Column (e) shows the results of the proposed method. The overall results of several images are good. It can be said that the proposed method is stable.

[0068] In quantitative evaluation, the The dataset and the algorithms of Gooch et al., Lu et al., and Bao S et al., which have better classic grayscale effects, and the method proposed in this invention are objectively evaluated using the C2G_SSIM evaluation model. The dataset contains 24 color images with relatively simple patterns, saturated colors, and a large number of regions of equal brightness and different chromaticity. C2G-SSIM evaluates the brightness, contrast, and structural similarity between the input color image and the output grayscale image. Using C2G-SSIM, the 24 images in the database are classified as photographic images (PI) and synthetic images (SI). The final C2G-SSIM evaluation value is in the range [0, 1]. A large evaluation value indicates a good output grayscale image.

[0069] Table 1 C2G_SSIM scores of the experimental results of each grayscale algorithm

[0070]

[0071]

[0072] Table 1 shows the C2G_SSIM of each method. For PI and SI, the C2G_SSIM values ​​of our method and Lu et al.'s method are the largest, respectively. Furthermore, the proposed method has the best mean C2G_SSIM value across the entire table.

[0073] The above experimental images and data analysis demonstrate that the present invention can effectively preserve image contrast, ensuring that the grayscaled image is consistent with human perception. Furthermore, the proposed method allows the color information in the input image to be appropriately reflected in the grayscale image, demonstrating good stability.

Claims

1. A brightness correction grayscale method based on color loss, characterized in that: The steps include: Step 1: Convert the original color image from RGB color space to CIE L*a*b* color space, and calculate the brightness difference between the ith pixel and the jth pixel in the original color image in CIE L*a*b* color space. and chromaticity difference ΔC ij ,as follows: in, and Respectively represent the brightness of the i-th pixel and the j-th pixel in the CIE L*a*b* color space, and Respectively represent the values ​​of the i-th pixel and the j-th pixel on the a-axis in the CIE L*a*b* color space, and Represent the values ​​of the i-th pixel and the j-th pixel on the b-axis in the CIE L*a*b* color space; Step 2: Define the signed color distance δ between the i-th pixel and the j-th pixel ij ,as follows: Φ(x)=αtanh(x / α) v θ =(cosθ,sinθ) is a unit vector, and ΔC ij Together they determine the value of the sign function. The angle θ controls which colors in the original color image should be brighter in the color-to-gray conversion. α is a positive real number parameter that controls how much color change is allowed to change the source brightness value. Φ(x) is a compression function that compresses the value of x into a valid range. Step 3, define the objective function as follows: Among them, n is the number of pixels of the original color image, f i is the grayscale of the i-th pixel, f j is the grayscale of the jth pixel, vector f=(f1,f2,f3,...,f n ) represents a grayscale image; Step 4: Find the optimal solution of the objective function as the final output grayscale image.

2. The brightness correction grayscale method based on color loss according to claim 1, characterized in that: In step 2, the angle θ divides the chromaticity plane and determines whether the color difference will darken or brighten the source brightness difference. θ changes continuously between 0 and 360 degrees. θ between 0 and 90 degrees and 270 to 360 degrees indicates brightening the warm color area, and θ between 90 and 270 degrees indicates darkening the cool color area.

3. The brightness correction grayscale method based on color loss according to claim 1, characterized in that: In step 2, the value of α is set to 15.

4. The brightness correction grayscale method based on color loss according to claim 1, characterized in that: In step 4, the optimal solution of the objective function is obtained using the conjugate gradient method, which is expressed as follows: in is the output grayscale image, for The i-th component of is as follows: <L * > represents the average brightness of the original color image, R is a real number set, and the value range of R is (0,255).