WO2019200689A1 - Image graying method and device, and storage medium - Google Patents

Image graying method and device, and storage medium Download PDF

Info

Publication number
WO2019200689A1
WO2019200689A1 PCT/CN2018/091568 CN2018091568W WO2019200689A1 WO 2019200689 A1 WO2019200689 A1 WO 2019200689A1 CN 2018091568 W CN2018091568 W CN 2018091568W WO 2019200689 A1 WO2019200689 A1 WO 2019200689A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
color
color channel
energy
coefficient
Prior art date
Application number
PCT/CN2018/091568
Other languages
French (fr)
Chinese (zh)
Inventor
袁誉乐
曹建民
赵勇
王新安
Original Assignee
深圳技术大学(筹)
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳技术大学(筹) filed Critical 深圳技术大学(筹)
Publication of WO2019200689A1 publication Critical patent/WO2019200689A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof

Definitions

  • the present invention relates to the field of image processing technologies, and in particular, to an image graying method and apparatus, and a storage medium.
  • Image grayscale processing is a common method when processing images, and mainly refers to a process of converting a color image into a grayscale image.
  • the RGB color coding method is a common form of color image.
  • the color of each pixel in the image is determined by three components: R, G, and B.
  • Each component has 255 values, so that one pixel can have more than 1600.
  • the range of variation of 10,000 (255*255*255) colors and the grayscale image is a special color image when the three components of R, G, and B are the same, and each pixel can have a variation range of 256 colors. Therefore, the grayscale image still reflects the distribution characteristics of the whole image in terms of chromaticity and brightness as the color image.
  • the images of various formats are generally converted into grayscale images to reduce the calculation amount of subsequent images. .
  • Image grayscale processing is suitable for a wide range of fields, such as printers in daily life, which need to print color digital documents into grayscale paper documents to save costs, and the quality of image grayscale processing will directly affect the documents. Print effect.
  • a good image graying algorithm is often needed to improve the real-time performance of the processing process. Fidelity, while ensuring low power consumption and real-time image grayscale processing capability, it is also necessary to avoid the loss of image information during the grayscale processing of color images.
  • the general grayscale algorithm is to perform a linear floating-point multiplication and addition operation on the basis of the intensity values of the R, G, and B channels to obtain a grayscale image.
  • This method does not highlight the image well.
  • the original content especially if the overall color of the original image content is relatively close.
  • some people such as the image processing technology team of the Chinese University of Hong Kong
  • the original image information is retained to a certain extent, which is superior to the conventional linear transformation method.
  • this method also has the disadvantage of complicated calculation process.
  • the technical problem mainly solved by the invention is how to reduce the computational complexity of the image graying algorithm, and at the same time reduce the amount of information loss in the graying process to improve the fidelity of the grayscale image.
  • an embodiment provides an image grayscale method, comprising the steps of:
  • the acquiring the energy of each color channel of the color image separately includes:
  • the energy corresponding to each color channel is obtained according to the image color distribution and the probability histogram of each color channel.
  • Performing a downsampling process on the color image to obtain a zoomed image including:
  • the obtaining an image color distribution according to the zoomed image includes:
  • the image color distribution is obtained from the color class diagram.
  • the obtaining the optimal coefficients of the respective color channels according to the energy of the respective color channels including:
  • Energy and coefficient acquisition step comparing energy of each color channel to obtain minimum energy; respectively obtaining transform coefficients of each color channel, and using a transform coefficient of a color channel corresponding to the minimum energy as a maximum transform coefficient;
  • Iterative step updating the transform coefficients of the respective color channels according to the maximum transform coefficient and the preset adjustment step size and adjustment range;
  • the first determining step determining whether the preset number of iterations is reached, and if not, repeating the iterative step, and vice versa, outputting the latest transform coefficient of each color channel as the optimal coefficient of the corresponding channel.
  • the iterative steps include:
  • Self-adjusting step the maximum transform coefficient is automatically reduced by one adjustment step, and the transform coefficient of one color channel adjacent to the color channel having the largest transform coefficient is incremented by one adjustment step, and the sum of the transform coefficients according to all color channels is 1 Then, the transform coefficients of the remaining color channels are adjusted; the energy of each color channel is calculated and updated according to the adjusted transform coefficients of the respective color channels, and the energy after updating any color channel is determined to be smaller than the minimum of each color channel obtained before the update. When energy is used, the energy of the color channel is updated to the minimum energy obtained before the update;
  • a second determining step determining whether the sum of the adjustment step lengths of the maximum transform coefficients is up to a preset adjustment amount, and if not, repeating the self-adjusting step, and vice versa, outputting the latest adjusted transform coefficients of the respective color channels And compare to get the maximum transform coefficient.
  • the second determining step includes:
  • the self-adjusting step is repeated until the maximum transform coefficient is about to exceed the adjustment range. Otherwise, the newly adjusted transform coefficients of the respective color channels are outputted, and the maximum transform coefficients are compared.
  • a grayscale image corresponding to the color image including:
  • the grayscale image corresponding to the color image is calculated according to the optimal coefficient of each color channel and the brightness corresponding to each color channel.
  • an embodiment provides an image grayscale device, including:
  • a color channel acquiring unit configured to respectively acquire energy of each color channel of the color image
  • An optimal coefficient acquisition unit configured to obtain an optimal coefficient of each color channel according to the energy of each color channel
  • a calculating unit configured to obtain a grayscale image corresponding to the color image according to an optimal coefficient of each color channel.
  • the image gradation device further includes a display unit for displaying the grayscale image and/or the color image.
  • an embodiment provides a computer readable storage medium comprising a program executable by a processor to implement the method of the first aspect described above.
  • the input color image is downsampled, and the energy of each color channel of the downsampled processed image is obtained, and the iterative algorithm according to the transform coefficient is obtained.
  • the optimum coefficient of each color channel thereby performing gradation transformation on the original color image according to the optimal coefficients to obtain a grayscale image. Since the image is grayed out, the color image is first downsampled, so that the color image reduces the redundancy of the image information while retaining the main image information, which is beneficial to reduce the calculation amount of the process of obtaining the optimal coefficient later.
  • the matching coefficient between the color coefficient and the color image has a good matching degree, which can effectively reduce the gray image coloring process.
  • the loss of image information in the middle can maximize the main image information of the original color image, which is beneficial to improve the fidelity of the gray image.
  • 1 is a flow chart of an image graying method
  • 2 is a flow chart of a method for obtaining channel energy
  • Figure 3 is a flow chart for obtaining an image color distribution
  • Fig. 5 is a structural diagram of an image gradation device.
  • the present application discloses an image grayscale method, which includes steps S100-S400, which are respectively described below.
  • step S100 a color image is input.
  • image color coding methods commonly known as RGB, CMY, CMYK, HSV, HIS, YUV
  • each color coding method has one or more color channels, each Each color channel stores information about the color elements in the image, and the colors in all the color channels are superimposed to produce the color of the pixels in the image. Therefore, the color images input here include, but are not limited to, RGB images (RGB images include three color channels of red R, green G, and blue B).
  • step S200 the energy of each color channel of the color image is respectively obtained, where the energy refers to the information cross entropy of the intensity distribution of the intensity values between the color channels after the color channels are converted according to the corresponding coefficients.
  • the embodiment uses the RGB color image as an example to illustrate how to obtain energy on the three color channels of R, G, and B.
  • Step S200 Steps S210-S230 may be included, which are specifically described below.
  • step S210 in order to reduce the redundancy information in the image and obtain a better image size, the RGB color image needs to be downsampled to obtain a zoomed image.
  • the specific process is:
  • the method of acquiring the pixel value is a commonly used method for processing an image, and belongs to the prior art, and will not be described in detail herein.
  • the RGB color image is used as a zoom Image; when h is greater than or equal to the first value and less than or equal to the third value, or w is greater than or equal to the second value and less than or equal to the fourth value, w and h are each reduced to the original 1/2, and the scaled image is taken as The image is scaled; when h is greater than the third value or w is greater than the fourth value, w and h are each reduced to the original 1/4, and the scaled image is taken as the scaled image.
  • the first value, the second value, the third value, and the fourth value herein represent pixel reference values set by the user as needed, and are preferably set to 288, 352, 600, and 800, respectively. .
  • Step S220 performing color and probability statistics on the scaled image obtained in step S210 to obtain an image color distribution X of the scaled image, and a probability histogram Y j of each color channel (subscript j may take 1, 2, and 3, Represents the color channels corresponding to R, G, and B).
  • the process of acquiring the image color distribution X may specifically include steps S221-S223, which are respectively described below.
  • Step S221 the scaled image is often a 24-bit bitmap, consisting of three components of R, G, and B, each component occupies 8 bits. At this time, each component is compressed from 8 bits to 5 bits, and then cluster analysis is performed ( Cluster analysis is an aggregation processing method for data, which is to aggregate similar data into a class and then perform a unified representation to represent the similar colors on the respective color channels of the scaled image in the same color, and finally make the whole frame. Images can be converted to 256 colors for uniform representation.
  • the K-means algorithm can be used for clustering analysis, which belongs to the hard clustering algorithm and is representative of a typical prototype-based objective function clustering method. It is a certain distance from the data point to the prototype.
  • the algorithm usually adopts the error square sum criterion function as the clustering criterion function, and uses the function to obtain the extreme value method to obtain the adjustment rules of the iterative operation to achieve the goal of the smallest evaluation index. It belongs to the prior art and will not be specifically described here.
  • Step S222 after performing cluster analysis on the scaled image, the entire image can be converted into 256 types of colors for unified representation.
  • the color class diagram color(i) is obtained, where i represents the color class. The number ranges from 0 to 255.
  • Step S223 the color class diagram color(i) includes the main color information of the zoomed image, and the color information is statistically obtained to obtain the image color distribution X, and the color distribution map PD of the zoomed image is obtained according to the image color distribution X ( X, i), specifically expressed as
  • the color distribution map PD(X, i) has a small color error between the original compressed image and does not affect the main image information in the original compressed image.
  • the probability histogram distribution Y j (including Y 1 , Y 2 , Y 3 ) can take the values on the color channels of R, G, and B respectively, and obtain the probability histogram corresponding to each probability histogram according to the value obtained.
  • PD(Y j , i) specifically expressed as
  • Step S230 according to the image color distribution X and its corresponding color distribution map PD(X, i), and each probability histogram distribution Y j and its corresponding probability histogram PD(Y j , i)
  • the energy corresponding to the color channel can be expressed as
  • step S300 the optimal coefficients of the respective color channels are obtained according to the energy of each color channel.
  • the R color channel, the G color channel, and the B are respectively obtained according to the energies En(Y 1 ), En(Y 2 ), and En(Y 3 ) of the three color channels obtained in step S230.
  • the optimal coefficient of the color channel may include steps S310-350, as described below.
  • Step S310 which may be referred to as an energy and coefficient acquisition step.
  • the energy of each color channel is compared to obtain a minimum energy, and at the same time, the transform coefficients corresponding to the three color channels R, G, and B are obtained, and the minimum energy is obtained.
  • the transform coefficient of the corresponding color channel is taken as the maximum transform coefficient.
  • the three color channels R, G, and B respectively correspond to a set of transform coefficients (c_r, c_g, c_b), and in the initial stage, the initial transform coefficient corresponding to the R color channel is (1, 0, 0).
  • the initial transform coefficient corresponding to the G color channel is (0, 1, 0)
  • the initial transform coefficient corresponding to the B color channel is (0, 0, 1).
  • the energy of the R color channel is the smallest, then (1, 0, 0) is used as the reference coefficient group, where 1 can be used as the maximum transform coefficient c_max.
  • Step S320 which may be referred to as an iterative step.
  • the transform coefficients of the respective color channels are updated according to the maximum transform coefficient c_max and the preset adjustment step size ⁇ and the adjustment amount ⁇ , which may specifically include steps S321-S325, Each step is described in detail.
  • Step S321 which may be referred to as a self-adjusting step, for self-adjusting the transform coefficients of the respective color channels.
  • the maximum transform coefficient c_max is used (if the R color channel has the largest transform coefficient c_max, then at this time, c_r and C_max is equal) decrementing an adjustment step ⁇ , increasing the transform coefficient of a color channel adjacent to the color channel having the largest transform coefficient (such as a G color channel) by an adjustment step ⁇ , according to the transform coefficients of all color channels And the transformation coefficient of the remaining color channel is adjusted for 1 and is expressed by the formula as
  • Step size ⁇ according to the sum of the transform coefficients of all the color channels is 1 and then adjust the transform coefficients of the remaining color channels, which are specifically expressed by the formula
  • one adjustment step ⁇ can be automatically subtracted from the maximum transform coefficient c_max, and the transform coefficients of the remaining two color channels are respectively increased by half adjustment steps, so that all color channels can also be achieved.
  • the requirement that the sum of the transform coefficients is 1, is expressed by a formula
  • the self-adjusting method specifically represented by the formula in the above embodiment is the case where the R color channel has the largest transform coefficient c_max, then, by referring to the formulas, the G color channel has the largest transform coefficient and The formula for the B color channel with the largest transform coefficient is not described here. It should also be understood by those skilled in the art that the above embodiments only enumerate the optimal implementation method for the self-increase or self-decrement of the transform coefficients of the respective color channels, in addition to which the self-increase or self-decrement such as ⁇ /4 can be added. For the method of adjusting the value, as long as the sum of the transform coefficients of all the color channels is 1, the specific adjustment value is not limited.
  • Step S322 calculating and updating the energy of each color channel according to the converted transform coefficients of the respective color channels.
  • the energy of the three color channels R, G, and B are respectively calculated according to step S220, then each The energy of the color channel is updated to En(Y 1 )', En(Y 2 )', and En(Y 3 )', respectively.
  • Step S323 determining whether the energy of any color channel update is less than the minimum energy in each color channel obtained before the update, and if yes, proceeding to step S324, otherwise proceeding to step S325.
  • Step S324 updating the energy of all the color channels satisfying the determination condition in step S323 to the minimum energy obtained before the update, for example, before proceeding to step S321, if the R color channel has the minimum energy En(Y 1 ), when determining En When both (Y 2 )' and En(Y 3 )' are smaller than the minimum energy En(Y 1 ), both En(Y 2 )' and En(Y 3 )' are updated to En(Y 1 ), and the rest are not The energy of the color channel that satisfies the judgment condition remains unchanged.
  • Step S325 which may be referred to as a second determining step, determining whether the sum of the adjustment step sizes of the maximum transform coefficients is reduced to a preset adjustment amount ⁇ . If not, proceeding to step S321; otherwise, outputting the latest adjustment of each color channel. The resulting transform coefficients are re-compared to obtain the maximum transform coefficient c_max.
  • the adjustment step size ⁇ and the adjustment amount ⁇ can be set to 0.02 and 0.2, respectively, and the number of cycles k can be set to record the number of self-adjustment times shown in step S321, and k starts counting from 0, and each step is performed. S321 then k is incremented by 1. When the sum of the adjustment step sizes of the self-decreasing k*0.02 does not reach the adjustment amount of 0.2, step S321 is performed again; when the sum of the adjustment step sizes of the self-decreasing k*0.02 reaches the adjustment amount of 0.2, the latest adjusted transformation is output.
  • the coefficients c_r, c_g, and c_b are compared and the maximum value among the three is compared, and the maximum value is updated to the maximum transform coefficient c_max, and the next iteration operation is performed.
  • step S325 can be implemented in another manner of determining. Obtaining the adjustment range [c_max- ⁇ , c_max] according to the maximum transform coefficient c_max and the preset adjustment amount ⁇ , and determining whether the adjusted maximum transform coefficient c_max exceeds the adjustment range [c_max- ⁇ , c_max], and if not, proceeding to step S321 Until the maximum transform coefficient c_max is about to exceed the adjustment range [c_max- ⁇ , c_max], otherwise, the newly adjusted transform coefficients c_r, c_g and c_b of the respective color channels are output, and the maximum value among the three is compared, which will be the largest The value is updated to the maximum transform coefficient c_max for the next iteration.
  • Step S330 which may be referred to as a first determining step, determines whether the preset number of iterations is reached. If not, the process proceeds to step S321, and the iterative operation is performed again. Otherwise, the process proceeds to step S340.
  • an iteration counter t may be set to record the number of iterations of step S320, t starts counting from 0, and each time step S320 is performed, t is incremented by 1, when t exceeds the number of iterations set by the user (eg 2) When the iterative operation is no longer performed, the process proceeds to step S340.
  • step S340 the latest transform coefficients c_r, c_g, and c_b of the respective color channels are output as the optimum coefficients of the corresponding channels.
  • Step S400 the grayscale image corresponding to the color image is obtained according to the optimal coefficient of each color channel.
  • the original RGB color is calculated according to the optimal coefficient c_r of the R color channel, the optimal coefficient c_g of the G color channel, and the optimal coefficient c_b of the B color channel.
  • the grayscale image corresponding to the image can be expressed as a formula
  • r, g, and b respectively represent the brightness of the R, G, and B color channels on the original RGB color image
  • the process of obtaining the brightness of the color channel belongs to the prior art, and is not specifically described herein. It should be noted that when the original color image is directly converted into gradation according to the optimal coefficient of each color channel, it is beneficial to retain most of the image information on the original color image, and the operation process is relatively simple, which can save a lot of calculation time. .
  • the present application discloses an image gradation device 5, which includes an input unit 51, a color channel acquisition unit 52, an optimal coefficient acquisition unit 53, and a calculation unit. 54, respectively, explained below.
  • the input unit 51 is configured to input a color image, and the specific process of inputting the color image may refer to step S100, and details are not described herein again.
  • the color channel acquisition unit 52 is in communication with the input unit 51 for acquiring the energy of each color channel of the color image. For the specific process, refer to step S200, and details are not described herein.
  • the optimal coefficient acquisition unit 53 is communicatively coupled to the color channel acquisition unit 52 for obtaining the optimal coefficients of the respective color channels according to the energy of the respective color channels.
  • step S300 which is not described herein.
  • the calculation unit 54 is in communication with the optimal coefficient acquisition unit 53 for obtaining the grayscale image corresponding to the color image according to the optimal coefficient of each color channel.
  • the optimal coefficient acquisition unit 53 for obtaining the grayscale image corresponding to the color image according to the optimal coefficient of each color channel.
  • the image grading device 5 may further include a display unit 55, which may be communicatively coupled to the computing unit 54 for displaying the grayscale image output by the computing unit 54, even the display unit 55. It is also possible to display the color image processed by the computing unit so that the color image and the grayscale image can be compared, which is convenient for the staff to observe the comparison result.
  • the display unit 55 can be various types of display devices that can display screens such as televisions, display screens, projectors, and the like.
  • the program may be stored in a computer readable storage medium, and the storage medium may include: a read only memory, a random access memory, a magnetic disk, an optical disk, a hard disk, etc.
  • the computer executes the program to implement the above functions.
  • the program is stored in the memory of the device, and when the program in the memory is executed by the processor, all or part of the above functions can be realized.
  • the program may also be stored in a storage medium such as a server, another computer, a magnetic disk, an optical disk, a flash disk or a mobile hard disk, and may be saved by downloading or copying.
  • the system is updated in the memory of the local device, or the system of the local device is updated.

Abstract

An image graying method and a storage medium. Downsampling processing is performed on an input color image to obtain the energy of all color channels of a downsampled scaled image, and optimal coefficients of the color channels are obtained according to an iterative algorithm of transform coefficients so as to perform grey level transformation on an original color image according to the optimal coefficients to obtain a gray level image. According to the image graying method, downsampling processing is firstly performed on the color image, so that the color image reduces the redundancy of image information while retaining primary image information, thereby facilitating reducing the computational complexity in the process of obtaining the optimal coefficients in the later period; according to the image graying method, an iterative algorithm is introduced to obtain the optimal coefficients of the color channels, so that there is a good matching degree between the transform coefficients of the color channels and the color image, loss of the image information in the color image graying process can be effectively reduced, the primary image information of the original color image can be retained to the greatest extent, and the fidelity of the gray level image is facilitated to be improved.

Description

一种图像灰度化方法及装置、存储介质Image graying method and device, storage medium 技术领域Technical field
本发明涉及图像处理技术领域,具体涉及一种图像灰度化方法及装置、存储介质。The present invention relates to the field of image processing technologies, and in particular, to an image graying method and apparatus, and a storage medium.
背景技术Background technique
图像灰度化处理是处理图像时的一种常用方法,其主要是指将彩色图像转化成为灰度图像的过程。RGB颜色编码方法是彩色图像的一种常用形式,图像中每个像素的颜色都由R、G、B三个分量决定,而每个分量有255个值可取,这样一个像素点可以有1600多万(255*255*255)种颜色的变化范围,而灰度图像是R、G、B三个分量相同时一种特殊的彩色图像,每个像素点可以有256种颜色的变化范围。所以,灰度图像与彩色图像一样仍然反映了整幅图像在色度和亮度方面的分布特征,在数字图像处理时一般先将各种格式的图像转变成灰度图像以减少后续图像的计算量。Image grayscale processing is a common method when processing images, and mainly refers to a process of converting a color image into a grayscale image. The RGB color coding method is a common form of color image. The color of each pixel in the image is determined by three components: R, G, and B. Each component has 255 values, so that one pixel can have more than 1600. The range of variation of 10,000 (255*255*255) colors, and the grayscale image is a special color image when the three components of R, G, and B are the same, and each pixel can have a variation range of 256 colors. Therefore, the grayscale image still reflects the distribution characteristics of the whole image in terms of chromaticity and brightness as the color image. In digital image processing, the images of various formats are generally converted into grayscale images to reduce the calculation amount of subsequent images. .
图像灰度化处理适用于非常广泛的领域,比如日常生活中的打印机,需要将彩色数字文档打印成灰度化的纸张文档以节省成本,而且,图像灰度化处理的好坏将直接影响文档的打印效果。另外,在日常的各种图像、视频算法中为了加快图像灰度化处理的运行速度,以及节省硬件内存和计算资源的开销,往往需要好的图像灰度化算法来提高处理过程的实时性和保真性,在保证低功耗和实时的图像灰度化处理能力的同时,还需要尽可能地避免彩色图像在灰度化处理过程中图像信息丢失的情形。Image grayscale processing is suitable for a wide range of fields, such as printers in daily life, which need to print color digital documents into grayscale paper documents to save costs, and the quality of image grayscale processing will directly affect the documents. Print effect. In addition, in daily image and video algorithms, in order to speed up the operation of image grayscale processing and save hardware memory and computing resources, a good image graying algorithm is often needed to improve the real-time performance of the processing process. Fidelity, while ensuring low power consumption and real-time image grayscale processing capability, it is also necessary to avoid the loss of image information during the grayscale processing of color images.
现在通用的灰度化算法,是在R、G、B三个通道的强度值的基础上作一个线性的浮点数乘法和加法运算以得到灰度图像,这种方法并不能很好地凸显图像的原有内容,特别是在原有图像内容的整体颜色比较接近的情况下。另外,也有人员(如香港中文大学的图像处理技术团队)利用变换后的灰度图像和颜色差值图像的对比关系来构建基于二次范式的方法来优化灰度化的求解过程,该方法能在一定程度上保留原有图像信息,相比而言优于以往的线性变换方法,但是,该方法也存在计算过程复杂的缺点。Now the general grayscale algorithm is to perform a linear floating-point multiplication and addition operation on the basis of the intensity values of the R, G, and B channels to obtain a grayscale image. This method does not highlight the image well. The original content, especially if the overall color of the original image content is relatively close. In addition, some people (such as the image processing technology team of the Chinese University of Hong Kong) use the contrast relationship between the transformed grayscale image and the color difference image to construct a quadratic paradigm-based method to optimize the grayscale solution process. The original image information is retained to a certain extent, which is superior to the conventional linear transformation method. However, this method also has the disadvantage of complicated calculation process.
发明内容Summary of the invention
本发明主要解决的技术问题是如何降低图像灰度化算法的计算复杂度的同时,尽量减少灰度化过程中的信息损失量,以提升灰度图像的保真性。The technical problem mainly solved by the invention is how to reduce the computational complexity of the image graying algorithm, and at the same time reduce the amount of information loss in the graying process to improve the fidelity of the grayscale image.
根据第一方面,一种实施例提供一种图像灰度化方法,包括以下步骤:According to a first aspect, an embodiment provides an image grayscale method, comprising the steps of:
输入彩色图像;Enter a color image;
分别获取所述彩色图像的各个颜色通道的能量;Obtaining energy of each color channel of the color image separately;
根据所述各个颜色通道的能量获得各个颜色通道的最佳系数;Obtaining an optimum coefficient of each color channel according to the energy of each color channel;
根据所述各个颜色通道的最佳系数获得所述颜色图像对应的灰度图像。Obtaining a grayscale image corresponding to the color image according to an optimal coefficient of each color channel.
所述分别获取所述彩色图像的各个颜色通道的能量,包括:The acquiring the energy of each color channel of the color image separately includes:
对所述彩色图像进行降采样处理,获取缩放图像;Performing downsampling processing on the color image to obtain a scaled image;
获取所述缩放图像的图像颜色分布,以及每个颜色通道的概率直方分布;Obtaining an image color distribution of the scaled image, and a probability histogram of each color channel;
根据所述图像颜色分布和所述每个颜色通道的概率直方分布获得每个颜色通道对应的能量。The energy corresponding to each color channel is obtained according to the image color distribution and the probability histogram of each color channel.
所述对所述彩色图像进行降采样处理,获取缩放图像,包括:Performing a downsampling process on the color image to obtain a zoomed image, including:
获取所述彩色图像的宽度像素w和高度像素h;Obtaining a width pixel w and a height pixel h of the color image;
当h小于第一值且w小于第二值时,将所述彩色图像作为所述缩放图像;When h is smaller than the first value and w is smaller than the second value, the color image is taken as the zoomed image;
当h大于等于第一值且小于等于第三值,或者w大于等于第二值且小于等于第四值时,将w和h各缩小为原来的1/2,将缩放后的图像作为所述缩放图像;When h is greater than or equal to the first value and less than or equal to the third value, or w is greater than or equal to the second value and less than or equal to the fourth value, w and h are each reduced to 1/2 of the original, and the scaled image is used as the Scale the image;
当h大于第三值或者w大于第四值时,将w和h各缩小为原来的1/4,将缩放后的图像作为所述缩放图像。When h is greater than the third value or w is greater than the fourth value, w and h are each reduced to the original 1/4, and the scaled image is taken as the scaled image.
所述根据所述缩放图像获得图像颜色分布,包括:The obtaining an image color distribution according to the zoomed image includes:
对所述缩放图像进行聚类分析,以将所述缩放图像上的相近颜色用同一种颜色进行表示;Performing cluster analysis on the scaled image to represent similar colors on the scaled image with the same color;
根据聚类分析的结果将所述缩放图像量化为一色类图;And quantizing the scaled image into a color class diagram according to a result of cluster analysis;
根据该色类图获得所述图像颜色分布。The image color distribution is obtained from the color class diagram.
所述根据所述各个颜色通道的能量获得各个颜色通道的最佳系数,包括:The obtaining the optimal coefficients of the respective color channels according to the energy of the respective color channels, including:
能量和系数获取步骤:比较各个颜色通道的能量以得到最小能量;分别获取各个颜色通道的变换系数,将最小能量对应的颜色通道的变换系数作为最大变换系数;Energy and coefficient acquisition step: comparing energy of each color channel to obtain minimum energy; respectively obtaining transform coefficients of each color channel, and using a transform coefficient of a color channel corresponding to the minimum energy as a maximum transform coefficient;
迭代步骤:根据最大变换系数以及预先设置的调整步长和调整范围更新各个颜色通道的变换系数;Iterative step: updating the transform coefficients of the respective color channels according to the maximum transform coefficient and the preset adjustment step size and adjustment range;
第一判断步骤:判断是否达到预设的迭代次数,若否,则重复所述迭代步骤,反之,则将各个颜色通道最新的变换系数作为对应通道的最佳系数进行输出。The first determining step: determining whether the preset number of iterations is reached, and if not, repeating the iterative step, and vice versa, outputting the latest transform coefficient of each color channel as the optimal coefficient of the corresponding channel.
所述迭代步骤包括:The iterative steps include:
自调整步骤:将最大变换系数自减一个调整步长,将具有最大变换系数的颜色通道相邻的一个颜色通道的变换系数自增一个调整步长,根据所有颜色通道的变换系数之和为1再调整剩下的颜色通道的变换系数;根据调整后的各个颜色通道的变换系数计算并更新各个颜色通道的能量,当判断任一颜色通道更新后的能量小于更新前所得各个颜色通道中的最小能量时,则将该颜色通道的能量更新为更新前所得的最小能量;Self-adjusting step: the maximum transform coefficient is automatically reduced by one adjustment step, and the transform coefficient of one color channel adjacent to the color channel having the largest transform coefficient is incremented by one adjustment step, and the sum of the transform coefficients according to all color channels is 1 Then, the transform coefficients of the remaining color channels are adjusted; the energy of each color channel is calculated and updated according to the adjusted transform coefficients of the respective color channels, and the energy after updating any color channel is determined to be smaller than the minimum of each color channel obtained before the update. When energy is used, the energy of the color channel is updated to the minimum energy obtained before the update;
第二判断步骤:判断最大变换系数所自减的调整步长之和是否达到预设的调整量,若否,则重复所述自调整步骤,反之,则输出各个颜色通道最新调整后的变换系数,并比较得到最大变换系数。a second determining step: determining whether the sum of the adjustment step lengths of the maximum transform coefficients is up to a preset adjustment amount, and if not, repeating the self-adjusting step, and vice versa, outputting the latest adjusted transform coefficients of the respective color channels And compare to get the maximum transform coefficient.
所述第二判断步骤包括:The second determining step includes:
根据所述最大变换系数和所述预设的调整量获得调整范围;Obtaining an adjustment range according to the maximum transform coefficient and the preset adjustment amount;
判断调整后的最大变换系数是否超过所述调整范围;Determining whether the adjusted maximum transform coefficient exceeds the adjustment range;
若否,则重复所述自调整步骤,直至最大变换系数即将超过所述调整范围,反之,则输出各个颜色通道最新调整后的变换系数,并比较得到最大变换系数。If not, the self-adjusting step is repeated until the maximum transform coefficient is about to exceed the adjustment range. Otherwise, the newly adjusted transform coefficients of the respective color channels are outputted, and the maximum transform coefficients are compared.
所述根据所述各个颜色通道的最佳系数获得所述颜色图像对应的灰度图像,包括:And obtaining, according to an optimal coefficient of each color channel, a grayscale image corresponding to the color image, including:
根据各个颜色通道的最佳系数和各颜色通道对应的亮度计算得到所述颜色图像对应的灰度图像。The grayscale image corresponding to the color image is calculated according to the optimal coefficient of each color channel and the brightness corresponding to each color channel.
根据第二方面,一种实施例提供一种图像灰度化装置,包括:According to a second aspect, an embodiment provides an image grayscale device, including:
输入单元,用于输入彩色图像;An input unit for inputting a color image;
颜色通道获取单元,用于分别获取所述彩色图像的各个颜色通道的能量;a color channel acquiring unit, configured to respectively acquire energy of each color channel of the color image;
最佳系数获取单元,用于根据所述各个颜色通道的能量获得各个颜色通道的最佳系数;An optimal coefficient acquisition unit, configured to obtain an optimal coefficient of each color channel according to the energy of each color channel;
计算单元,用于根据所述各个颜色通道的最佳系数获得所述颜色图像对应的灰度图像。And a calculating unit, configured to obtain a grayscale image corresponding to the color image according to an optimal coefficient of each color channel.
所述图像灰度化装置还包括显示单元,用于显示所述灰度图像和/或所述彩色图像。The image gradation device further includes a display unit for displaying the grayscale image and/or the color image.
根据第三方面,一种实施例中提供一种计算机可读存储介质,包括程序,所述程序能够被处理器执行以实现如上述第一方面所述的方法。According to a third aspect, an embodiment provides a computer readable storage medium comprising a program executable by a processor to implement the method of the first aspect described above.
本申请的有益效果是:The beneficial effects of the application are:
依据上述实施例的一种图像灰度化方法及装置、存储介质,对输入的彩色图像进行降采样处理,获取降采样处理后的缩放图像的各颜色通道的能量,依据变换系数的迭代算法获得各颜色通道的最佳系数,从而根据该些最佳系数对原彩色图像进行灰度变换以得到灰度图像。由于采用该图像灰度化方法时首先对彩色图像进行了降采样处理,使得彩色图像在保留主要图像信息的情况下减少了图像信息的冗余量,利于减少后期获得最佳系数过程的计算量;由于该图像灰度化方法中引入了迭代算法来获得颜色通道的最佳系数,使得各颜色通道的变换系数与彩色图像之间拥有较好的匹配度,可有效减少彩色图像灰度化过程中图像信息的损失量,可最大程度地保留原彩色图像的主要图像信息,利于提高灰度图像的保真性。According to the image graying method and device and the storage medium of the above embodiment, the input color image is downsampled, and the energy of each color channel of the downsampled processed image is obtained, and the iterative algorithm according to the transform coefficient is obtained. The optimum coefficient of each color channel, thereby performing gradation transformation on the original color image according to the optimal coefficients to obtain a grayscale image. Since the image is grayed out, the color image is first downsampled, so that the color image reduces the redundancy of the image information while retaining the main image information, which is beneficial to reduce the calculation amount of the process of obtaining the optimal coefficient later. Since the image graying method introduces an iterative algorithm to obtain the optimal coefficient of the color channel, the matching coefficient between the color coefficient and the color image has a good matching degree, which can effectively reduce the gray image coloring process. The loss of image information in the middle can maximize the main image information of the original color image, which is beneficial to improve the fidelity of the gray image.
附图说明DRAWINGS
图1为图像灰度化方法的流程图;1 is a flow chart of an image graying method;
图2为通道能量获取方法的流程图;2 is a flow chart of a method for obtaining channel energy;
图3为获取图像颜色分布的流程图;Figure 3 is a flow chart for obtaining an image color distribution;
图4为最佳系数迭代算法的流程图;4 is a flow chart of an optimal coefficient iterative algorithm;
图5为图像灰度化装置的结构图。Fig. 5 is a structural diagram of an image gradation device.
具体实施方式detailed description
下面通过具体实施方式结合附图对本发明作进一步详细说明。其中不同实施方式中类似元件采用了相关联的类似的元件标号。在以下的实施方式中,很多细节描述是为了使得本申请能被更好的理解。然而,本领域技术人员可以毫不费力的认识到,其中部分特征在不同情况下是可以省略的,或者可以由其他元件、材料、方法所替代。在某些情况下, 本申请相关的一些操作并没有在说明书中显示或者描述,这是为了避免本申请的核心部分被过多的描述所淹没,而对于本领域技术人员而言,详细描述这些相关操作并不是必要的,他们根据说明书中的描述以及本领域的一般技术知识即可完整了解相关操作。The present invention will be further described in detail below with reference to the accompanying drawings. Similar elements in different embodiments employ associated similar component numbers. In the following embodiments, many of the details are described in order to provide a better understanding of the application. However, those skilled in the art can easily realize that some of the features may be omitted in different situations, or may be replaced by other components, materials, and methods. In some cases, some operations related to the present application are not shown or described in the specification, in order to avoid that the core portion of the present application is overwhelmed by excessive description, and those skilled in the art will describe these in detail. Related operations are not necessary, they can fully understand the relevant operations according to the description in the manual and the general technical knowledge in the field.
另外,说明书中所描述的特点、操作或者特征可以以任意适当的方式结合形成各种实施方式。同时,方法描述中的各步骤或者动作也可以按照本领域技术人员所能显而易见的方式进行顺序调换或调整。因此,说明书和附图中的各种顺序只是为了清楚描述某一个实施例,并不意味着是必须的顺序,除非另有说明其中某个顺序是必须遵循的。In addition, the features, operations, or characteristics described in the specification may be combined in any suitable manner to form various embodiments. At the same time, the steps or actions in the method description can also be sequentially changed or adjusted in a manner that can be apparent to those skilled in the art. Therefore, the various sequences in the specification and the drawings are only for the purpose of describing a particular embodiment, and are not intended to
本文中为部件所编序号本身,例如“第一”、“第二”等,仅用于区分所描述的对象,不具有任何顺序或技术含义。而本申请所说“连接”、“联接”,如无特别说明,均包括直接和间接连接(联接)。The serial numbers themselves for the components herein, such as "first", "second", etc., are only used to distinguish the described objects, and do not have any order or technical meaning. As used herein, "connected" or "coupled", unless otherwise specified, includes both direct and indirect connections (joining).
请参考图1,本申请公开了一种图像灰度化方法,其包括步骤S100-S400,下面分别说明。Referring to FIG. 1, the present application discloses an image grayscale method, which includes steps S100-S400, which are respectively described below.
步骤S100,输入彩色图像。为适应不同场合的应用需求,技术人员开发了多种图像的颜色编码方法,常见的有RGB、CMY、CMYK、HSV、HIS、YUV,每种颜色编码方法都具有一个或多个颜色通道,每个颜色通道都存放着图像中颜色元素的信息,将所有颜色通道中的颜色叠加混合即可产生图像中像素的颜色。因此,这里输入的彩色图像包括但不限于RGB图像(RGB图像包括红色R、绿色G、蓝色B三个颜色通道)。In step S100, a color image is input. In order to meet the application needs of different occasions, technicians have developed a variety of image color coding methods, commonly known as RGB, CMY, CMYK, HSV, HIS, YUV, each color coding method has one or more color channels, each Each color channel stores information about the color elements in the image, and the colors in all the color channels are superimposed to produce the color of the pixels in the image. Therefore, the color images input here include, but are not limited to, RGB images (RGB images include three color channels of red R, green G, and blue B).
步骤S200,分别获取彩色图像的各个颜色通道的能量,这里的能量是指各颜色通道根据对应系数转化为灰度图后与量化后为色类图之间强度值概率分布的信息交叉熵。在一实施例中,为了清楚地理解获取彩色图像各个颜色通道的能量的过程,本实施例以RGB彩色图像为例来说明如何获取R、G、B三个颜色通道上的能量,该步骤S200可包括步骤S210-S230,分别具体说明如下。In step S200, the energy of each color channel of the color image is respectively obtained, where the energy refers to the information cross entropy of the intensity distribution of the intensity values between the color channels after the color channels are converted according to the corresponding coefficients. In an embodiment, in order to clearly understand the process of acquiring the energy of each color channel of the color image, the embodiment uses the RGB color image as an example to illustrate how to obtain energy on the three color channels of R, G, and B. Step S200 Steps S210-S230 may be included, which are specifically described below.
步骤S210,为减小图像中的冗余量信息,获得更好的图像尺寸,需要先对RGB彩色图像进行降采样处理,获取缩放图像。具体过程为:In step S210, in order to reduce the redundancy information in the image and obtain a better image size, the RGB color image needs to be downsampled to obtain a zoomed image. The specific process is:
(1)获取RGB彩色图像的高度像素h和宽度像素w,获取像素值技术是处理图像常用到的方法,属于现有技术,这里不再对其进行详细说明。(1) Acquiring the height pixel h and the width pixel w of the RGB color image, the method of acquiring the pixel value is a commonly used method for processing an image, and belongs to the prior art, and will not be described in detail herein.
(2)根据高度像素h和宽度像素w合理地缩放该RGB彩色图像, 这里提供了一种技术手段,具体为:当h小于第一值且w小于第二值时,将RGB彩色图像作为缩放图像;当h大于等于第一值且小于等于第三值,或者w大于等于第二值且小于等于第四值时,将w和h各缩小为原来的1/2,将缩放后的图像作为缩放图像;当h大于第三值或者w大于第四值时,将w和h各缩小为原来的1/4,将缩放后的图像作为缩放图像。在一具体实施例中,这里的第一值、第二值、第三值、第四值均表示用户根据需要而设定的像素参考值,优选地,分别设为288、352、600、800。(2) Reasonably scaling the RGB color image according to the height pixel h and the width pixel w. Here, a technical means is provided, specifically: when h is smaller than the first value and w is smaller than the second value, the RGB color image is used as a zoom Image; when h is greater than or equal to the first value and less than or equal to the third value, or w is greater than or equal to the second value and less than or equal to the fourth value, w and h are each reduced to the original 1/2, and the scaled image is taken as The image is scaled; when h is greater than the third value or w is greater than the fourth value, w and h are each reduced to the original 1/4, and the scaled image is taken as the scaled image. In a specific embodiment, the first value, the second value, the third value, and the fourth value herein represent pixel reference values set by the user as needed, and are preferably set to 288, 352, 600, and 800, respectively. .
步骤S220,对步骤S210中得到的缩放图像进行颜色和概率统计,以获取该缩放图像的图像颜色分布X,以及每个颜色通道的概率直方分布Y j(下标j可取1、2和3,分别代表R、G、B对应的颜色通道)。 Step S220, performing color and probability statistics on the scaled image obtained in step S210 to obtain an image color distribution X of the scaled image, and a probability histogram Y j of each color channel (subscript j may take 1, 2, and 3, Represents the color channels corresponding to R, G, and B).
其中,获取图像颜色分布X的过程可具体包括步骤S221-S223,分别说明如下。The process of acquiring the image color distribution X may specifically include steps S221-S223, which are respectively described below.
步骤S221,该缩放图像往往为24bits位图,由R、G、B三分量构成,每个分量占8bits,此时,现将每个分量由8bits压缩成5bits,然后对其进行聚类分析(聚类分析是对数据的一种聚集处理方法,是将类似的数据聚成一类然后进行统一表示),以将缩放图像的各个颜色通道上的相近颜色用同一种颜色进行表示,最终使得整幅图像可转换为256类颜色以进行统一表示。Step S221, the scaled image is often a 24-bit bitmap, consisting of three components of R, G, and B, each component occupies 8 bits. At this time, each component is compressed from 8 bits to 5 bits, and then cluster analysis is performed ( Cluster analysis is an aggregation processing method for data, which is to aggregate similar data into a class and then perform a unified representation to represent the similar colors on the respective color channels of the scaled image in the same color, and finally make the whole frame. Images can be converted to 256 colors for uniform representation.
在一具体实施例中,可采用K-means算法进行聚类分析,该算法属于硬聚类算法,是典型的基于原型的目标函数聚类方法的代表,它是数据点到原型的某种距离作为优化的目标函数,该算法通常采用误差平方和准则函数作为聚类准则函数,利用函数求极值的方法得到迭代运算的调整规则,以达到评价指标最小的目的。属于现有技术,这里不再具体说明。In a specific embodiment, the K-means algorithm can be used for clustering analysis, which belongs to the hard clustering algorithm and is representative of a typical prototype-based objective function clustering method. It is a certain distance from the data point to the prototype. As an objective function of optimization, the algorithm usually adopts the error square sum criterion function as the clustering criterion function, and uses the function to obtain the extreme value method to obtain the adjustment rules of the iterative operation to achieve the goal of the smallest evaluation index. It belongs to the prior art and will not be specifically described here.
步骤S222,将缩放图像进行聚类分析之后,整幅图像可转换为256类颜色以进行统一表示,根据这样的聚类分析结果即量化得到色类图color(i),这里的i表示颜色类编号,取值范围是0-255。Step S222, after performing cluster analysis on the scaled image, the entire image can be converted into 256 types of colors for unified representation. According to the result of the cluster analysis, the color class diagram color(i) is obtained, where i represents the color class. The number ranges from 0 to 255.
步骤S223,该色类图color(i)包括了缩放图像的主要颜色信息,对该些颜色信息进行统计可得到图像颜色分布X,根据图像颜色分布X可得到该缩放图像的颜色分布图PD(X,i),具体表示为Step S223, the color class diagram color(i) includes the main color information of the zoomed image, and the color information is statistically obtained to obtain the image color distribution X, and the color distribution map PD of the zoomed image is obtained according to the image color distribution X ( X, i), specifically expressed as
Figure PCTCN2018091568-appb-000001
Figure PCTCN2018091568-appb-000001
该颜色分布图PD(X,i)与原压缩图像之间具有较小的颜色误差,不会对原压缩图像中的主要图像信息造成影响。The color distribution map PD(X, i) has a small color error between the original compressed image and does not affect the main image information in the original compressed image.
其中,概率直方分布Y j(包括Y 1、Y 2、Y 3)可分别取R、G、B的颜色通道上的值,根据取值结果获得每个概率直方分布所对应的概率直方分布图PD(Y j,i),具体表示为 Wherein, the probability histogram distribution Y j (including Y 1 , Y 2 , Y 3 ) can take the values on the color channels of R, G, and B respectively, and obtain the probability histogram corresponding to each probability histogram according to the value obtained. PD(Y j , i), specifically expressed as
Figure PCTCN2018091568-appb-000002
Figure PCTCN2018091568-appb-000002
步骤S230,根据图像颜色分布X及其对应的颜色分布图PD(X,i),以及每个概率直方分布Y j及其所对应的概率直方分布图PD(Y j,i)可得到每个颜色通道对应的能量。R颜色通道所对应的能量具体可表示为 Step S230, according to the image color distribution X and its corresponding color distribution map PD(X, i), and each probability histogram distribution Y j and its corresponding probability histogram PD(Y j , i) The energy corresponding to the color channel. The energy corresponding to the R color channel can be expressed as
Figure PCTCN2018091568-appb-000003
Figure PCTCN2018091568-appb-000003
那么,本领域的技术人员可根据该计算方法分别得到G颜色通道和B颜色通道的能量En(Y 2)和En(Y 3)。 Then, those skilled in the art can obtain the energies En(Y 2 ) and En(Y 3 ) of the G color channel and the B color channel, respectively, according to the calculation method.
步骤S300,根据各个颜色通道的能量获得各个颜色通道的最佳系数。在一实施例中,见图4,根据步骤S230中得到的三个颜色通道的能量En(Y 1)、En(Y 2)和En(Y 3)分别获得R颜色通道、G颜色通道和B颜色通道的最佳系数,可包括步骤S310-350,具体说明如下。 In step S300, the optimal coefficients of the respective color channels are obtained according to the energy of each color channel. In an embodiment, as shown in FIG. 4, the R color channel, the G color channel, and the B are respectively obtained according to the energies En(Y 1 ), En(Y 2 ), and En(Y 3 ) of the three color channels obtained in step S230. The optimal coefficient of the color channel may include steps S310-350, as described below.
步骤S310,可称为能量和系数获取步骤,在一实施例中,比较各个颜色通道的的能量以得到最小能量,同时,获取R、G、B三个颜色通道对应的变换系数,将最小能量对应的颜色通道的变换系数作为最大变换系数。在一具体实施例中,R、G、B三个颜色通道分别对应一组变换系数(c_r,c_g,c_b),在初始阶段,R颜色通道对应的初始变换系数为(1,0,0),G颜色通道对应的初始变换系数为(0,1,0),B颜色通道对应的初始变换系数为(0,0,1),那么,如果R颜色通道的能量最小,就将(1,0,0)做为基准系数组,其中,1可作为最大变换系数c_max。Step S310, which may be referred to as an energy and coefficient acquisition step. In an embodiment, the energy of each color channel is compared to obtain a minimum energy, and at the same time, the transform coefficients corresponding to the three color channels R, G, and B are obtained, and the minimum energy is obtained. The transform coefficient of the corresponding color channel is taken as the maximum transform coefficient. In a specific embodiment, the three color channels R, G, and B respectively correspond to a set of transform coefficients (c_r, c_g, c_b), and in the initial stage, the initial transform coefficient corresponding to the R color channel is (1, 0, 0). The initial transform coefficient corresponding to the G color channel is (0, 1, 0), and the initial transform coefficient corresponding to the B color channel is (0, 0, 1). Then, if the energy of the R color channel is the smallest, then (1, 0, 0) is used as the reference coefficient group, where 1 can be used as the maximum transform coefficient c_max.
步骤S320,可称为迭代步骤,在一实施例中,根据最大变换系数c_max以及预先设置的调整步长λ和调整量α更新各个颜色通道的变换系数,具体可包括步骤S321-S325,下面对各个步骤进行具体说明。Step S320, which may be referred to as an iterative step. In an embodiment, the transform coefficients of the respective color channels are updated according to the maximum transform coefficient c_max and the preset adjustment step size λ and the adjustment amount α, which may specifically include steps S321-S325, Each step is described in detail.
步骤S321,可称为自调整步骤,用于自调整各个颜色通道的变换系数,在一具体实施例中,将最大变换系数c_max(假如R颜色通道拥有 最大变换系数c_max,那么此时,c_r和c_max相等)自减一个调整步长λ,将具有最大变换系数的颜色通道相邻的一个颜色通道(比如G颜色通道)的变换系数自增一个调整步长λ,根据所有颜色通道的变换系数之和为1再调整剩下的颜色通道的变换系数,用公式具体表示为Step S321, which may be referred to as a self-adjusting step, for self-adjusting the transform coefficients of the respective color channels. In a specific embodiment, the maximum transform coefficient c_max is used (if the R color channel has the largest transform coefficient c_max, then at this time, c_r and C_max is equal) decrementing an adjustment step λ, increasing the transform coefficient of a color channel adjacent to the color channel having the largest transform coefficient (such as a G color channel) by an adjustment step λ, according to the transform coefficients of all color channels And the transformation coefficient of the remaining color channel is adjusted for 1 and is expressed by the formula as
Figure PCTCN2018091568-appb-000004
Figure PCTCN2018091568-appb-000004
c_g=c_g+λC_g=c_g+λ
c_b=1-c_r-c_gC_b=1-c_r-c_g
需要说明的是,本实施例还存在另一种情况,在将R颜色通道对应的最大变换系数c_max自减一个调整步长λ时,可将相邻的B颜色通道的变换系数自增一个调整步长λ,根据所有颜色通道的变换系数之和为1再调整剩下的颜色通道的变换系数,用公式具体表示为It should be noted that there is another case in this embodiment, when the maximum transform coefficient c_max corresponding to the R color channel is automatically reduced by one adjustment step λ, the transform coefficient of the adjacent B color channel can be automatically adjusted by one. Step size λ, according to the sum of the transform coefficients of all the color channels is 1 and then adjust the transform coefficients of the remaining color channels, which are specifically expressed by the formula
Figure PCTCN2018091568-appb-000005
Figure PCTCN2018091568-appb-000005
c_b=c_b+λC_b=c_b+λ
c_g=1-c_r-c_bC_g=1-c_r-c_b
在另一个实施例中,可对最大变换系数c_max自减一个调整步长λ,对剩下两个的颜色通道的变换系数分别自增半个调整步长,如此,也可达到所有颜色通道的变换系数之和为1的要求,用公式具体表示为In another embodiment, one adjustment step λ can be automatically subtracted from the maximum transform coefficient c_max, and the transform coefficients of the remaining two color channels are respectively increased by half adjustment steps, so that all color channels can also be achieved. The requirement that the sum of the transform coefficients is 1, is expressed by a formula
Figure PCTCN2018091568-appb-000006
Figure PCTCN2018091568-appb-000006
c_g=c_g+λ/2C_g=c_g+λ/2
c_b=c_b+λ/2C_b=c_b+λ/2
本领域的技术人员应当理解,上述实施例中用公式具体表示的自调整方法是R颜色通道拥有最大变换系数c_max时的情况,那么,可以参考该些公式,得到G颜色通道拥有最大变换系数以及B颜色通道拥有最大变换系数时的公式表示,这里不再进行赘述。本领域的技术人员还应当理解,上述实施例仅列举了各个颜色通道的变换系数进行自增或者自减运算的最优实施方法,除此之外,还可以自增或者自减诸如λ/4等调整值的方法,只要所有颜色通道的变换系数之和为1即可,而具体的调整值不做限制。It should be understood by those skilled in the art that the self-adjusting method specifically represented by the formula in the above embodiment is the case where the R color channel has the largest transform coefficient c_max, then, by referring to the formulas, the G color channel has the largest transform coefficient and The formula for the B color channel with the largest transform coefficient is not described here. It should also be understood by those skilled in the art that the above embodiments only enumerate the optimal implementation method for the self-increase or self-decrement of the transform coefficients of the respective color channels, in addition to which the self-increase or self-decrement such as λ/4 can be added. For the method of adjusting the value, as long as the sum of the transform coefficients of all the color channels is 1, the specific adjustment value is not limited.
步骤S322,根据调整后的各个颜色通道的变换系数计算并更新各个颜色通道的能量,在一具体实施例中,根据步骤S220分别计算得到R、G、B三个颜色通道的能量,那么,各颜色通道的能量分别更新为En(Y 1)'、En(Y 2)'和En(Y 3)'。 Step S322, calculating and updating the energy of each color channel according to the converted transform coefficients of the respective color channels. In a specific embodiment, the energy of the three color channels R, G, and B are respectively calculated according to step S220, then each The energy of the color channel is updated to En(Y 1 )', En(Y 2 )', and En(Y 3 )', respectively.
步骤S323,判断任一颜色通道更新后的能量是否小于更新前所得各个颜色通道中的最小能量,若是,则进入步骤S324,反之进入步骤S325。Step S323, determining whether the energy of any color channel update is less than the minimum energy in each color channel obtained before the update, and if yes, proceeding to step S324, otherwise proceeding to step S325.
步骤S324,将步骤S323中所有满足判断条件的颜色通道的能量均更新为更新前所得的最小能量,例如,在进入步骤S321之前,如果R颜色通道具有最小能量En(Y 1),当判断En(Y 2)'和En(Y 3)'均小于该最小能量En(Y 1)时,则将En(Y 2)'和En(Y 3)'均更新为En(Y 1),其余不满足判断条件的颜色通道的能量保持不变。 Step S324, updating the energy of all the color channels satisfying the determination condition in step S323 to the minimum energy obtained before the update, for example, before proceeding to step S321, if the R color channel has the minimum energy En(Y 1 ), when determining En When both (Y 2 )' and En(Y 3 )' are smaller than the minimum energy En(Y 1 ), both En(Y 2 )' and En(Y 3 )' are updated to En(Y 1 ), and the rest are not The energy of the color channel that satisfies the judgment condition remains unchanged.
步骤S325,可称为第二判断步骤,判断最大变换系数所自减的调整步长之和是否达到预设的调整量α,若否,则进入步骤S321,反之,则输出各个颜色通道最新调整后的变换系数,并重新比较得到最大变换系数c_max。Step S325, which may be referred to as a second determining step, determining whether the sum of the adjustment step sizes of the maximum transform coefficients is reduced to a preset adjustment amount α. If not, proceeding to step S321; otherwise, outputting the latest adjustment of each color channel. The resulting transform coefficients are re-compared to obtain the maximum transform coefficient c_max.
在一具体实施例中,可设置调整步长λ和调整量α分别为0.02、0.2,可设置循环次数k来记录步骤S321中所示的自调整次数,k从0开始计数,每进行一次步骤S321则k自加1。当自减的调整步长之和k*0.02没有达到调整量0.2时,则再次执行步骤S321;当自减的调整步长之和k*0.02达到调整量0.2时,则输出最新调整后的变换系数c_r、c_g和c_b,并比较得三者之中的最大值,将最大值更新为最大变换系数c_max,进行下一次迭代运算。In a specific embodiment, the adjustment step size λ and the adjustment amount α can be set to 0.02 and 0.2, respectively, and the number of cycles k can be set to record the number of self-adjustment times shown in step S321, and k starts counting from 0, and each step is performed. S321 then k is incremented by 1. When the sum of the adjustment step sizes of the self-decreasing k*0.02 does not reach the adjustment amount of 0.2, step S321 is performed again; when the sum of the adjustment step sizes of the self-decreasing k*0.02 reaches the adjustment amount of 0.2, the latest adjusted transformation is output. The coefficients c_r, c_g, and c_b are compared and the maximum value among the three is compared, and the maximum value is updated to the maximum transform coefficient c_max, and the next iteration operation is performed.
在另一个具体实施例中,可采用另一种判断方式来实现步骤S325。根据最大变换系数c_max和预设的调整量α获得调整范围[c_max-α,c_max],判断调整后的最大变换系数c_max是否超过调整范围[c_max-α,c_max],若否,则进入步骤S321,直至最大变换系数c_max即将超过调整范围[c_max-α,c_max],反之,则输出各个颜色通道最新调整后的变换系数c_r、c_g和c_b,并比较得三者之中的最大值,将最大值更新为最大变换系数c_max,进行下一次迭代运算。In another embodiment, step S325 can be implemented in another manner of determining. Obtaining the adjustment range [c_max-α, c_max] according to the maximum transform coefficient c_max and the preset adjustment amount α, and determining whether the adjusted maximum transform coefficient c_max exceeds the adjustment range [c_max-α, c_max], and if not, proceeding to step S321 Until the maximum transform coefficient c_max is about to exceed the adjustment range [c_max-α, c_max], otherwise, the newly adjusted transform coefficients c_r, c_g and c_b of the respective color channels are output, and the maximum value among the three is compared, which will be the largest The value is updated to the maximum transform coefficient c_max for the next iteration.
步骤S330,可称为第一判断步骤,判断是否达到预设的迭代次数,若否,则进入步骤S321,重新进行迭代运算,反之,进入步骤S340。Step S330, which may be referred to as a first determining step, determines whether the preset number of iterations is reached. If not, the process proceeds to step S321, and the iterative operation is performed again. Otherwise, the process proceeds to step S340.
在一具体实施例中,可设置一迭代计数器t来记录步骤S320的迭代次数,t从0开始计数,每执行一次步骤S320,则t自加1,当t超过用户设定的迭代次数(比如2)时,则不再进行迭代操作,而是进入步骤S340。In a specific embodiment, an iteration counter t may be set to record the number of iterations of step S320, t starts counting from 0, and each time step S320 is performed, t is incremented by 1, when t exceeds the number of iterations set by the user (eg 2) When the iterative operation is no longer performed, the process proceeds to step S340.
步骤S340,将各个颜色通道最新的变换系数c_r、c_g和c_b作为 对应通道的最佳系数进行输出。In step S340, the latest transform coefficients c_r, c_g, and c_b of the respective color channels are output as the optimum coefficients of the corresponding channels.
步骤S400,所述根据各个颜色通道的最佳系数获得颜色图像对应的灰度图像。在一实施例中,根据R颜色通道的最佳系数c_r,G颜色通道的最佳系数c_g,B颜色通道的最佳系数c_b来对原RGB彩色图像进行灰度变换,从而计算得到原RGB颜色图像对应的灰度图像,可用公式表示为Step S400, the grayscale image corresponding to the color image is obtained according to the optimal coefficient of each color channel. In an embodiment, the original RGB color is calculated according to the optimal coefficient c_r of the R color channel, the optimal coefficient c_g of the G color channel, and the optimal coefficient c_b of the B color channel. The grayscale image corresponding to the image can be expressed as a formula
y=r*c_r+g*c_g+b*c_by=r*c_r+g*c_g+b*c_b
其中,r、g、b分别表示原RGB彩色图像上R、G、B颜色通道的亮度,获得颜色通道的亮度的过程属于现有技术,这里不再具体说明。需要说明的是,根据各个颜色通道的最佳系数对原彩色图像直接进行灰度变换时,有利于保留原彩色图像上的大部分图像信息,而且,运算过程较为简单,可节约大量的计算时间。Wherein, r, g, and b respectively represent the brightness of the R, G, and B color channels on the original RGB color image, and the process of obtaining the brightness of the color channel belongs to the prior art, and is not specifically described herein. It should be noted that when the original color image is directly converted into gradation according to the optimal coefficient of each color channel, it is beneficial to retain most of the image information on the original color image, and the operation process is relatively simple, which can save a lot of calculation time. .
请参考图5,在一个实施例中,本申请公开了一种图像灰度化装置,该图像灰度化装置5包括输入单元51、颜色通道获取单元52、最佳系数获取单元53和计算单元54,下面分别说明。Referring to FIG. 5, in one embodiment, the present application discloses an image gradation device 5, which includes an input unit 51, a color channel acquisition unit 52, an optimal coefficient acquisition unit 53, and a calculation unit. 54, respectively, explained below.
输入单元51,用于输入彩色图像,输入彩色图像的具体过程可参考步骤S100,这里不再赘述。The input unit 51 is configured to input a color image, and the specific process of inputting the color image may refer to step S100, and details are not described herein again.
颜色通道获取单元52与输入单元51通信连接,用于分别获取彩色图像的各个颜色通道的能量,具体过程可参考步骤S200,这里不再赘述。The color channel acquisition unit 52 is in communication with the input unit 51 for acquiring the energy of each color channel of the color image. For the specific process, refer to step S200, and details are not described herein.
最佳系数获取单元53与颜色通道获取单元52通信连接,用于根据各个颜色通道的能量获得各个颜色通道的最佳系数,具体过程可参考步骤S300,这里不再赘述。The optimal coefficient acquisition unit 53 is communicatively coupled to the color channel acquisition unit 52 for obtaining the optimal coefficients of the respective color channels according to the energy of the respective color channels. For the specific process, reference may be made to step S300, which is not described herein.
计算单元54与最佳系数获取单元53通信连接,用于根据各个颜色通道的最佳系数获得颜色图像对应的灰度图像,具体过程可参考步骤S400,这里不再进行赘述。The calculation unit 54 is in communication with the optimal coefficient acquisition unit 53 for obtaining the grayscale image corresponding to the color image according to the optimal coefficient of each color channel. For the specific process, reference may be made to step S400, and details are not described herein.
进一步地,在另一个实施例中,图像灰度化装置5还可以包括显示单元55,显示单元55可与计算单元54通信连接,用于显示计算单元54输出的灰度图像,甚至显示单元55还可以显示计算单元所处理的彩色图像,从而使得彩色图像和灰度图像能够进行对比,利于工作人员观察对比结果。此外,显示单元55可为电视、显示屏、投影仪等可进行画面展示的各种类型的显示设备。Further, in another embodiment, the image grading device 5 may further include a display unit 55, which may be communicatively coupled to the computing unit 54 for displaying the grayscale image output by the computing unit 54, even the display unit 55. It is also possible to display the color image processed by the computing unit so that the color image and the grayscale image can be compared, which is convenient for the staff to observe the comparison result. In addition, the display unit 55 can be various types of display devices that can display screens such as televisions, display screens, projectors, and the like.
本领域技术人员可以理解,上述实施方式中各种方法的全部或部分功能可以通过硬件的方式实现,也可以通过计算机程序的方式实现。当上述实施方式中全部或部分功能通过计算机程序的方式实现时,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:只读存储器、随机存储器、磁盘、光盘、硬盘等,通过计算机执行该程序以实现上述功能。例如,将程序存储在设备的存储器中,当通过处理器执行存储器中程序,即可实现上述全部或部分功能。另外,当上述实施方式中全部或部分功能通过计算机程序的方式实现时,该程序也可以存储在服务器、另一计算机、磁盘、光盘、闪存盘或移动硬盘等存储介质中,通过下载或复制保存到本地设备的存储器中,或对本地设备的系统进行版本更新,当通过处理器执行存储器中的程序时,即可实现上述实施方式中全部或部分功能。Those skilled in the art can understand that all or part of the functions of the various methods in the above embodiments may be implemented by hardware or by a computer program. When all or part of the functions in the above embodiments are implemented by a computer program, the program may be stored in a computer readable storage medium, and the storage medium may include: a read only memory, a random access memory, a magnetic disk, an optical disk, a hard disk, etc. The computer executes the program to implement the above functions. For example, the program is stored in the memory of the device, and when the program in the memory is executed by the processor, all or part of the above functions can be realized. In addition, when all or part of the functions in the above embodiment are implemented by a computer program, the program may also be stored in a storage medium such as a server, another computer, a magnetic disk, an optical disk, a flash disk or a mobile hard disk, and may be saved by downloading or copying. The system is updated in the memory of the local device, or the system of the local device is updated. When the program in the memory is executed by the processor, all or part of the functions in the above embodiments may be implemented.
以上应用了具体个例对本发明进行阐述,只是用于帮助理解本发明,并不用以限制本发明。对于本发明所属技术领域的技术人员,依据本发明的思想,还可以做出若干简单推演、变形或替换。The invention has been described above with reference to specific examples, which are merely intended to aid the understanding of the invention and are not intended to limit the invention. For the person skilled in the art to which the invention pertains, several simple derivations, variations or substitutions can be made in accordance with the inventive concept.

Claims (11)

  1. 一种图像灰度化方法,其特征在于,包括以下步骤:An image grayscale method, comprising the steps of:
    输入彩色图像;Enter a color image;
    分别获取所述彩色图像的各个颜色通道的能量;Obtaining energy of each color channel of the color image separately;
    根据所述各个颜色通道的能量获得各个颜色通道的最佳系数;Obtaining an optimum coefficient of each color channel according to the energy of each color channel;
    根据所述各个颜色通道的最佳系数获得所述颜色图像对应的灰度图像。Obtaining a grayscale image corresponding to the color image according to an optimal coefficient of each color channel.
  2. 如权利要求1所述的图像灰度化方法,其特征在于,所述分别获取所述彩色图像的各个颜色通道的能量,包括:The image gradation method according to claim 1, wherein the respectively acquiring energy of each color channel of the color image comprises:
    对所述彩色图像进行降采样处理,获取缩放图像;Performing downsampling processing on the color image to obtain a scaled image;
    获取所述缩放图像的图像颜色分布,以及每个颜色通道的概率直方分布;Obtaining an image color distribution of the scaled image, and a probability histogram of each color channel;
    根据所述图像颜色分布和所述每个颜色通道的概率直方分布获得每个颜色通道对应的能量。The energy corresponding to each color channel is obtained according to the image color distribution and the probability histogram of each color channel.
  3. 如权利要求2所述的图像灰度化方法,其特征在于,所述对所述彩色图像进行降采样处理,获取缩放图像,包括:The method of image grading according to claim 2, wherein the downsampling the color image to obtain a zoomed image comprises:
    获取所述彩色图像的高度像素h和宽度像素w;Obtaining a height pixel h and a width pixel w of the color image;
    当h小于第一值且w小于第二值时,将所述彩色图像作为所述缩放图像;When h is smaller than the first value and w is smaller than the second value, the color image is taken as the zoomed image;
    当h大于等于第一值且小于等于第三值,或者w大于等于第二值且小于等于第四值时,将w和h各缩小为原来的1/2,将缩放后的图像作为所述缩放图像;When h is greater than or equal to the first value and less than or equal to the third value, or w is greater than or equal to the second value and less than or equal to the fourth value, w and h are each reduced to 1/2 of the original, and the scaled image is used as the Scale the image;
    当h大于第三值或者w大于第四值时,将w和h各缩小为原来的1/4,将缩放后的图像作为所述缩放图像。When h is greater than the third value or w is greater than the fourth value, w and h are each reduced to the original 1/4, and the scaled image is taken as the scaled image.
  4. 如权利要求2所述的图像灰度化方法,其特征在于,所述根据所述缩放图像获得图像颜色分布,包括:The image gradation method according to claim 2, wherein the obtaining an image color distribution according to the zoomed image comprises:
    对所述缩放图像进行聚类分析,以将所述缩放图像上的相近颜色用同一种颜色进行表示;Performing cluster analysis on the scaled image to represent similar colors on the scaled image with the same color;
    根据聚类分析的结果将所述缩放图像量化为一色类图;And quantizing the scaled image into a color class diagram according to a result of cluster analysis;
    根据该色类图获得所述图像颜色分布。The image color distribution is obtained from the color class diagram.
  5. 如权利要求1所述的图像灰度化方法,其特征在于,所述根据所述各个颜色通道的能量获得各个颜色通道的最佳系数,包括:The image gradation method according to claim 1, wherein the obtaining the optimal coefficients of the respective color channels according to the energy of the respective color channels comprises:
    能量和系数获取步骤:比较各个颜色通道的能量以得到最小能量;分别获取各个颜色通道的变换系数,将最小能量对应的颜色通道的变换系数作为最大变换系数;Energy and coefficient acquisition step: comparing energy of each color channel to obtain minimum energy; respectively obtaining transform coefficients of each color channel, and using a transform coefficient of a color channel corresponding to the minimum energy as a maximum transform coefficient;
    迭代步骤:根据最大变换系数以及预先设置的调整步长和调整量更新各个颜色通道的变换系数;An iterative step: updating the transform coefficients of the respective color channels according to the maximum transform coefficient and the preset adjustment step size and the adjustment amount;
    第一判断步骤:判断是否达到预设的迭代次数,若否,则重复所述迭代步骤,反之,则将各个颜色通道最新的变换系数作为对应通道的最佳系数进行输出。The first determining step: determining whether the preset number of iterations is reached, and if not, repeating the iterative step, and vice versa, outputting the latest transform coefficient of each color channel as the optimal coefficient of the corresponding channel.
  6. 如权利要求5所述的图像灰度化方法,其特征在于,所述迭代步骤包括:The image grayscale method according to claim 5, wherein the iterative step comprises:
    自调整步骤:将最大变换系数自减一个调整步长,将具有最大变换系数的颜色通道相邻的一个颜色通道的变换系数自增一个调整步长,根据所有颜色通道的变换系数之和为1再调整剩下的颜色通道的变换系数;根据调整后的各个颜色通道的变换系数计算并更新各个颜色通道的能量,当判断任一颜色通道更新后的能量小于更新前所得各个颜色通道中的最小能量时,则将该颜色通道的能量更新为更新前所得的最小能量;Self-adjusting step: the maximum transform coefficient is automatically reduced by one adjustment step, and the transform coefficient of one color channel adjacent to the color channel having the largest transform coefficient is incremented by one adjustment step, and the sum of the transform coefficients according to all color channels is 1 Then, the transform coefficients of the remaining color channels are adjusted; the energy of each color channel is calculated and updated according to the adjusted transform coefficients of the respective color channels, and the energy after updating any color channel is determined to be smaller than the minimum of each color channel obtained before the update. When energy is used, the energy of the color channel is updated to the minimum energy obtained before the update;
    第二判断步骤:判断最大变换系数所自减的调整步长之和是否达到预设的调整量,若否,则重复所述自调整步骤,反之,则输出各个颜色通道最新调整后的变换系数,并比较得到最大变换系数。a second determining step: determining whether the sum of the adjustment step lengths of the maximum transform coefficients is up to a preset adjustment amount, and if not, repeating the self-adjusting step, and vice versa, outputting the latest adjusted transform coefficients of the respective color channels And compare to get the maximum transform coefficient.
  7. 如权利要求6所述的图像灰度化方法,其特征在于,所述第二判断步骤包括:The image grayscale method according to claim 6, wherein the second determining step comprises:
    根据所述最大变换系数和所述预设的调整量获得调整范围;Obtaining an adjustment range according to the maximum transform coefficient and the preset adjustment amount;
    判断调整后的最大变换系数是否超过所述调整范围;Determining whether the adjusted maximum transform coefficient exceeds the adjustment range;
    若否,则重复所述自调整步骤,直至最大变换系数即将超过所述调整范围,反之,则输出各个颜色通道最新调整后的变换系数,并比较得到最大变换系数。If not, the self-adjusting step is repeated until the maximum transform coefficient is about to exceed the adjustment range. Otherwise, the newly adjusted transform coefficients of the respective color channels are outputted, and the maximum transform coefficients are compared.
  8. 如权利要求1所述的图像灰度化方法,其特征在于,所述根据所述各个颜色通道的最佳系数获得所述颜色图像对应的灰度图像,包括:The image gradation method according to claim 1, wherein the obtaining the grayscale image corresponding to the color image according to the optimal coefficient of each color channel comprises:
    根据各个颜色通道的最佳系数和各颜色通道对应的亮度计算得到所述颜色图像对应的灰度图像。The grayscale image corresponding to the color image is calculated according to the optimal coefficient of each color channel and the brightness corresponding to each color channel.
  9. 一种图像灰度化装置,其特征在于,包括:An image graying device, comprising:
    输入单元,用于输入彩色图像;An input unit for inputting a color image;
    颜色通道获取单元,用于分别获取所述彩色图像的各个颜色通道的能量;a color channel acquiring unit, configured to respectively acquire energy of each color channel of the color image;
    最佳系数获取单元,用于根据所述各个颜色通道的能量获得各个颜色通道的最佳系数;An optimal coefficient acquisition unit, configured to obtain an optimal coefficient of each color channel according to the energy of each color channel;
    计算单元,用于根据所述各个颜色通道的最佳系数获得所述颜色图像对应的灰度图像。And a calculating unit, configured to obtain a grayscale image corresponding to the color image according to an optimal coefficient of each color channel.
  10. 如权利要求9所述的图像灰度化装置,其特征在于,还包括显示单元,用于显示所述灰度图像和/或所述彩色图像。The image gradation device according to claim 9, further comprising a display unit for displaying said grayscale image and/or said color image.
  11. 一种计算机可读存储介质,其特征在于,包括程序,所述程序能够被处理器执行以实现如权利要求1-8中任一项所述的方法。A computer readable storage medium, comprising a program executable by a processor to implement the method of any of claims 1-8.
PCT/CN2018/091568 2018-04-16 2018-06-15 Image graying method and device, and storage medium WO2019200689A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810338090.3A CN108765501B (en) 2018-04-16 2018-04-16 Image graying method and storage medium
CN201810338090.3 2018-04-16

Publications (1)

Publication Number Publication Date
WO2019200689A1 true WO2019200689A1 (en) 2019-10-24

Family

ID=64010981

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/091568 WO2019200689A1 (en) 2018-04-16 2018-06-15 Image graying method and device, and storage medium

Country Status (2)

Country Link
CN (1) CN108765501B (en)
WO (1) WO2019200689A1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104217403A (en) * 2014-08-26 2014-12-17 浙江工商大学 Method for converting colored image into grayscale image
US20150237234A1 (en) * 2012-07-24 2015-08-20 Marti María Saguer Color Image Conversion
CN106447603A (en) * 2016-09-28 2017-02-22 西安交通大学 Color image graying method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150237234A1 (en) * 2012-07-24 2015-08-20 Marti María Saguer Color Image Conversion
CN104217403A (en) * 2014-08-26 2014-12-17 浙江工商大学 Method for converting colored image into grayscale image
CN106447603A (en) * 2016-09-28 2017-02-22 西安交通大学 Color image graying method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
SHI, ZHIPENG ET AL.: "A Color-to-Gray Conversion Based on Visual Feature Extraction of JND", 2016 INTERNATIONAL CONFERENCE ON PROGRESS IN INFORMATICS AND COMPUTING, 25 December 2016 (2016-12-25), pages 345 - 349, XP033258073, DOI: 10.1109/PIC.2016.7949523 *
XIAO, JIANXIONGFENG ET AL.: "Image Decolorization and Parameterization Algorithm with Local Contrast Enhancement", COMPUTER ERA, 15 March 2016 (2016-03-15), pages 45 - 49, XP055645601, ISSN: 1006-8228 *

Also Published As

Publication number Publication date
CN108765501A (en) 2018-11-06
CN108765501B (en) 2020-01-14

Similar Documents

Publication Publication Date Title
US8290295B2 (en) Multi-modal tone-mapping of images
CN109274985B (en) Video transcoding method and device, computer equipment and storage medium
US11663707B2 (en) Method and system for image enhancement
JP4097873B2 (en) Image compression method and image compression apparatus for multispectral image
TWI666921B (en) Method and device for tone-mapping a high dynamic range image
US8860806B2 (en) Method, device, and system for performing color enhancement on whiteboard color image
JP2005176361A (en) Color transformation method and apparatus
CN110189266B (en) Self-adaptive rapid image enhancement method
WO2023173557A1 (en) Image processing method and apparatus, and electronic device and storage medium
WO2023273340A1 (en) Method and apparatus for generating relighting image, and electronic device
CN111881920B (en) Network adaptation method of large-resolution image and neural network training device
Aboshosha et al. Resolution and quality enhancement of images using interpolation and contrast limited adaptive histogram equalization
Smelyakov et al. The Efficiency of Images Reduction Algorithms with Small-Sized and Linear Details
US10567777B2 (en) Contrast optimization and local adaptation approach for high dynamic range compression
CN114708157A (en) Image compression method, electronic device, and computer-readable storage medium
Miyata et al. Novel inverse colorization for image compression
US20220301124A1 (en) Efficient user-defined sdr-to-hdr conversion with model templates
US20240054605A1 (en) Methods and systems for wavelet domain-based normalizing flow super-resolution image reconstruction
WO2019200689A1 (en) Image graying method and device, and storage medium
CN116489330A (en) Self-adaptive white balance method and device, electronic equipment and storage medium
WO2023284528A1 (en) Image enhancement method and apparatus, computer device, and storage medium
CN108305234B (en) Double-histogram equalization method based on optimization model
Pan et al. Adapting iterative Retinex computation for high-dynamic-range tone mapping
EP3054416B1 (en) Method, system and device for generating more natural images
Mustafa et al. A comparative study on the loss functions for image enhancement networks

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18914995

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18914995

Country of ref document: EP

Kind code of ref document: A1