WO2020107660A1 - Method for recognizing single-tone image - Google Patents

Method for recognizing single-tone image Download PDF

Info

Publication number
WO2020107660A1
WO2020107660A1 PCT/CN2019/070910 CN2019070910W WO2020107660A1 WO 2020107660 A1 WO2020107660 A1 WO 2020107660A1 CN 2019070910 W CN2019070910 W CN 2019070910W WO 2020107660 A1 WO2020107660 A1 WO 2020107660A1
Authority
WO
WIPO (PCT)
Prior art keywords
value
color temperature
zone
preset
pixels
Prior art date
Application number
PCT/CN2019/070910
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 WO2020107660A1 publication Critical patent/WO2020107660A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N17/00Diagnosis, testing or measuring for television systems or their details
    • H04N17/02Diagnosis, testing or measuring for television systems or their details for colour television signals

Definitions

  • the present invention relates to the field of display technology, and in particular to a method for identifying single-tone images.
  • Thin film transistor Thin Film Transistor, TFT is the main driving element in the current liquid crystal display device (Liquid Crystal Display) and active matrix driven organic electroluminescence display device (Active Matrix Organic Light-Emitting Diode, AMOLED), It is directly related to the display performance of the flat panel display device.
  • liquid crystal displays which include a liquid crystal display panel and a backlight module.
  • the working principle of the liquid crystal display panel is to infuse liquid crystal molecules between the thin film transistor array substrate (Thin Film Transistor Array Substrate, TFT Array Substrate) and the color filter (CF) substrate, and apply them separately on the two substrates
  • the pixel voltage and the common voltage control the rotation direction of the liquid crystal molecules by the electric field formed between the pixel voltage and the common voltage, so as to transmit the light of the backlight module to generate a picture.
  • the existing OLED display device usually includes a substrate, an anode provided on the substrate, an organic light emitting layer provided on the anode, an electron transport layer provided on the organic light emitting layer, and a cathode provided on the electron transport layer.
  • the hole from the anode and the electron from the cathode are emitted to the organic light-emitting layer, and these electrons and holes are combined to generate an excited electron-hole pair, and the excited electron-hole pair is output from the excited state to the ground state Achieve glow.
  • color temperature is an important parameter used to characterize the color characteristics of light. The lower the color temperature, the more reddish the light color, and conversely, the more blued the light color.
  • the overall color temperature of the image can characterize the overall feeling of the image to the viewer.
  • the image color temperature is obtained based on the correlated color temperature (CCT) and the color temperature partition.
  • CCT correlated color temperature
  • the digital rgb value is converted into the chromaticity coordinates of the processing pixel in the chromatogram, and the chromaticity coordinates are located according to the chromaticity coordinates.
  • the color temperature is calculated for the area.
  • An object of the present invention is to provide a method for identifying a single-tone image, which can effectively identify a single-tone image.
  • the present invention provides a method for identifying a single-tone image, including the following steps:
  • Step S1 Provide image display data; the image includes a plurality of pixels, and the image display data includes a plurality of rgb optical values corresponding to the plurality of pixels; convert the plurality of rgb optical values into an HSV color model;
  • Step S2 Form a statistical histogram according to multiple tonal values corresponding to multiple pixels in the HSV color model respectively.
  • the statistical histogram has multiple histogram bars, and the multiple histogram bars respectively correspond to The number of pixels;
  • Step S3. Determine whether the image is a single-tone image according to the number of histograms in the statistical histogram where the number of pixels is greater than a preset number threshold; when the number of pixels is greater than a preset number threshold, the number of histograms is 1 Or, when the number of histograms with a pixel number greater than a preset number threshold is 2, and the tone value intervals corresponding to the two histograms are adjacent to each other, the image is determined to be a single-tone image, otherwise, then Determine that the image is not a monotone image.
  • the size range of the tone value is 0-1, the number of the plurality of histogram bars is n, and the interval of the tone value corresponding to each histogram bar is
  • m is the m-th histogram
  • h m is the tone value interval corresponding to the m-th histogram
  • the preset number threshold is 8% of the total number of pixels in the image corresponding to the histogram.
  • the method for recognizing a single-tone image further includes step S4, selecting the tone value interval corresponding to the histogram with the largest number of pixels, and removing the saturation value of the histogram that is in the tone value interval and the saturation is greater than a preset saturation threshold For pixels whose brightness is less than a preset brightness threshold, the remaining multiple pixels are obtained;
  • Step S5 Calculate the color temperature values of the remaining pixels according to the image color temperature acquisition method to obtain the color temperature value of the single-tone image.
  • step S5 The specific steps of step S5 are:
  • Step S51 Establish a statistical table; the statistical table includes multiple reference color temperatures and multiple weights corresponding to the multiple reference color temperatures, respectively, the multiple reference color temperatures include a preset minimum color temperature, a preset maximum color temperature, and multiple Intermediate color temperature, multiple weights are 0; multiple intermediate color temperatures gradually increase, and are all greater than the minimum color temperature and less than the maximum color temperature;
  • Step S52 providing a chromatogram, dividing the color gamut space in the chromatogram into the first zone, the second zone, and the third zone connected in pairs; the boundary between the first zone and the second zone, the second zone, and the third zone
  • the boundary line of the zone and the boundary line of the third zone and the first zone converge at a reference point.
  • the boundary line of the first zone and the second zone coincides with the isochromatic temperature line corresponding to the maximum color temperature.
  • the junction of the first zone and the third zone The line coincides with the equal color temperature line corresponding to the minimum color temperature, and the boundary between the second zone and the third zone is parallel to the ordinate axis of the chromatogram;
  • Step S53 Select one of the remaining pixels as the processing pixel; convert the rgb optical value of the processing pixel into the chromaticity coordinates of the processing pixel in the chromatogram;
  • Step S54 Determine the position of the chromaticity coordinates of the processing pixel in the color gamut space; if the chromaticity coordinates of the processing pixel are located in the first zone, then calculate the processing pixel's chromaticity coordinates and the preset pixel color temperature calculation formula Color temperature value, to determine whether the color temperature value of the processing pixel is one of multiple reference color temperatures, if so, increase the weight corresponding to the color temperature value of the processing pixel in the statistical table by 1, otherwise the color temperature value and 1 of the processing pixel are used as the reference color temperature And their corresponding weights are added to the statistics table; if the chromaticity coordinates of the processed pixel are in the second area, the connection between the point corresponding to the chromaticity coordinates of the processed pixel and the reference point and the The angle between the boundary lines and the preset first weight value calculation formula calculate the weight value of the processed pixel, and add the weight value to the weight corresponding to the maximum color temperature in the statistical table; if the chromaticity coordinates of the
  • Step S55 Repeat steps S53 and S54 until the remaining multiple pixels all execute steps S53 and S54;
  • Step S56 Multiply each reference color temperature in the statistical table by the corresponding weight, and divide the sum of the products of multiple reference color temperatures and corresponding weights by the sum of the weights corresponding to multiple reference color temperatures to obtain the color temperature of the single-tone image value.
  • the plurality of rgb optical values are obtained from the plurality of rgb digital values corresponding to the plurality of pixels according to an optical value calculation formula, and the optical value calculation formula is: Where R is the red optical value in the rgb optical value, G is the green optical value in the rgb optical value, B is the blue optical value in the rgb optical value, r is the red digital value in the rgb digital value, and g is rgb The green digital value in the digital value, b is the blue digital value in the rgb digital value, Represents the value obtained by performing gamma transformation on r, Represents the value obtained by performing gamma transformation on b, Represents the value obtained by performing gamma transformation on g.
  • the specific process of converting the rgb optical value of the processing pixel to the chromaticity coordinates of the processing pixel in the chromatogram in the step S53 is as follows: calculating the tristimulus of the processing pixel according to the optical rgb value of the processing pixel and a preset tristimulus value calculation formula Value, calculate the chromaticity coordinates of the processed pixel in the chromatogram according to the tristimulus value of the processed pixel and the preset chromaticity coordinate calculation formula;
  • the preset formula for calculating the tristimulus value is: Wherein, X is the red stimulus value in the tristimulus value, Y is the green stimulus value in the tristimulus value, Z is the blue stimulus value in the tristimulus value, and T is the preset conversion matrix;
  • the preset chromaticity coordinate formula is: Where a is the horizontal coordinate of the chromaticity coordinate of the processing pixel in the chromatogram, and b is the vertical coordinate of the chromaticity coordinate of the processing pixel in the chromatogram.
  • the coordinates of the reference points where the boundary between the first zone and the second zone, the boundary between the second zone and the third zone, and the boundary between the third zone and the first zone in the chromatogram are (0.332, 0.1858);
  • the chromatogram is a CIE1931 chromatogram; the preset minimum color temperature is 1000K; and the preset maximum color temperature is 15000K.
  • the invention also provides a method for identifying single-tone images, including the following steps:
  • Step S1 Provide image display data; the image includes a plurality of pixels, and the image display data includes a plurality of rgb optical values corresponding to the plurality of pixels; convert the plurality of rgb optical values into an HSV color model;
  • Step S2 Form a statistical histogram according to multiple tonal values corresponding to multiple pixels in the HSV color model respectively.
  • the statistical histogram has multiple histogram bars, and the multiple histogram bars respectively correspond to The number of pixels;
  • Step S3. Determine whether the image is a single-tone image according to the number of histograms in the statistical histogram where the number of pixels is greater than a preset number threshold; when the number of pixels is greater than a preset number threshold, the number of histograms is 1 Or, when the number of histograms with a pixel number greater than a preset number threshold is 2, and the tone value intervals corresponding to the two histograms are adjacent to each other, the image is determined to be a single-tone image, otherwise, then Determine that the image is not a single-tone image;
  • Step S4 Select the tone value interval corresponding to the histogram with the largest number of pixels, and remove pixels in the histogram that are in the tone value interval and have a saturation greater than a preset saturation threshold or a brightness less than a preset brightness threshold To get the remaining pixels;
  • Step S5 Calculate the color temperature values of the remaining pixels according to the image color temperature acquisition method to obtain the color temperature value of the single-tone image;
  • the preset number threshold is 8% of the total number of pixels in the image corresponding to the histogram.
  • the method for identifying single-tone images of the present invention converts multiple rgb optical values corresponding to multiple pixels into an HSV color model, and according to the multiple tone values corresponding to multiple pixels in the HSV color model, respectively Forming a statistical histogram, the statistical histogram has a plurality of histograms, the plurality of histograms respectively corresponding to the number of pixels in different tone value intervals, according to the statistical histogram, the number of pixels is greater than a preset number threshold The number of histograms to determine whether the image is a single-tone image can effectively identify a single-tone image.
  • FIG. 1 is a flowchart of a method for identifying single-tone images of the present invention
  • FIGS. 2 and 3 are schematic diagrams of statistical histograms of the method for identifying single-tone images of the present invention
  • FIG. 4 is a schematic diagram of a chromatogram of the method for identifying a single-tone image of the present invention.
  • the present invention provides a method for identifying a single-tone image, including the following steps:
  • Step S1 Provide display data of the image; the image includes a plurality of pixels, and the display data of the image includes a plurality of rgb optical values corresponding to the plurality of pixels; convert the plurality of rgb optical values to HSV (Hue Saturation Value) ) Color model;
  • HSV Human Saturation Value
  • Step S2 Please refer to FIG. 2 and FIG. 3, a statistical histogram is formed according to multiple Hue values corresponding to multiple pixels in the HSV color model, and the statistical histogram has multiple histogram bars.
  • the histograms correspond to the number of pixels in different tonal value ranges respectively;
  • Step S3. Determine whether the image is a single-tone image according to the number of histograms in the statistical histogram where the number of pixels is greater than a preset number threshold; when the number of pixels is greater than a preset number threshold, the number of histograms is 1 Or, when the number of histograms with a pixel number greater than a preset number threshold is 2, and the tone value intervals corresponding to the two histograms are adjacent to each other, the image is determined to be a single-tone image, otherwise, then Determine that the image is not a monotone image.
  • the present invention converts multiple rgb optical values corresponding to multiple pixels into an HSV color model, and forms a statistical histogram according to multiple Hue values corresponding to multiple pixels in the HSV color model,
  • the statistical histogram has multiple histogram bars, and the multiple histogram bars respectively correspond to the number of pixels located in different tone value intervals. According to the number of pixels in the statistical histogram, the number of pixels is greater than a preset number threshold To determine whether the image is a monotone image, it can effectively identify the monotone image.
  • the size range of the tone value is 0-1, the number of the plurality of histogram bars is n, and the tone value interval corresponding to each histogram bar is
  • m is the m-th histogram
  • h m is the tone value interval corresponding to the m-th histogram
  • the number of multiple histogram bars of the present invention is greater than or equal to 10 to improve the accuracy of single-tone image recognition.
  • the preset number threshold is that the number of pixels corresponding to the histogram takes up 8% of the total number of pixels in the image, that is, according to the statistical histogram, the number of pixels in the present invention is greater than 8% of the total number of pixels
  • the number of bars determines whether the image is a monotone image.
  • the plurality of rgb optical values are obtained from the plurality of rgb digital values respectively corresponding to the plurality of pixels according to an optical value calculation formula, and the optical value calculation formula is:
  • R is the red optical value in the rgb optical value
  • G is the green optical value in the rgb optical value
  • B is the blue optical value in the rgb optical value
  • r is the red digital value in the rgb digital value
  • g is rgb
  • b is the blue digital value in the rgb digital value
  • Represents the value obtained by performing gamma transformation on r Represents the value obtained by performing gamma transformation on b
  • the present invention further includes step S4, selecting the tone value interval corresponding to the histogram with the largest number of pixels, and removing the saturation and saturation of the histogram located in the tone value interval For pixels that are greater than a preset saturation threshold or whose brightness is less than a preset brightness threshold, the remaining multiple pixels are obtained;
  • Step S5 Calculate the color temperature values of the remaining pixels according to the image color temperature acquisition method to obtain the color temperature value of the single-tone image. That is, the invention removes the noise pixels of the color temperature value of the single-tone image, so that the calculation of the color temperature value of the single-tone image is more accurate.
  • step S5 are:
  • Step S51 Establish a statistical table; the statistical table includes multiple reference color temperatures and multiple weights corresponding to the multiple reference color temperatures, respectively, the multiple reference color temperatures include a preset minimum color temperature, a preset maximum color temperature, and multiple Intermediate color temperature, multiple weights are all 0; multiple intermediate color temperatures gradually increase, and are all greater than the minimum color temperature and less than the maximum color temperature.
  • the preset minimum color temperature is 1000K; the preset maximum color temperature is 15000K.
  • the plurality of intermediate color temperatures may be set at equal intervals between the minimum color temperature and the maximum color temperature.
  • the statistical table may be a statistical table as shown in Table 1 below.
  • Table 1 the difference between each two adjacent color temperatures is 500K, and the difference between the minimum intermediate color temperature and the minimum color temperature is 500K.
  • the difference between the maximum color temperature and the maximum intermediate color temperature is 500K.
  • Step S52 Please refer to FIG. 4 to provide a chromatogram, and to divide the color gamut space in the chromatogram into a first area A, a second area B, and a third area C connected in pairs.
  • the boundary between the first area A and the second area B, the boundary between the second area B and the third area C, and the boundary between the third area C and the first area A converge at a reference point O
  • the first area A and The boundary line of the second zone B coincides with the isochromatic temperature line corresponding to the maximum color temperature
  • the boundary line of the first zone A and the third zone C coincides with the isochromatic temperature line corresponding to the minimum color temperature
  • the boundary of the second zone B and the third zone C The line is parallel to the ordinate axis of the chromatogram.
  • the chromatogram is a CIE1931 chromatogram.
  • the coordinates of the reference point O are (0.332, 0.1858).
  • Step S53 Select one of the remaining pixels as the processing pixel; convert the rgb optical value of the processing pixel into the chromaticity coordinates of the processing pixel in the chromatogram.
  • the specific process of converting the rgb optical value of the processing pixel into the chromaticity coordinates of the processing pixel in the chromatogram in the step S53 is as follows: calculating the processing pixel according to the optical rgb value of the processing pixel and a preset tristimulus value calculation formula The tristimulus value of the pixel is calculated according to the tristimulus value of the processed pixel and the preset chromaticity coordinate calculation formula;
  • the preset formula for calculating the tristimulus value is: Wherein, X is the red stimulus value in the tristimulus value, Y is the green stimulus value in the tristimulus value, Z is the blue stimulus value in the tristimulus value, and T is the preset conversion matrix;
  • the preset chromaticity coordinate formula is: Where a is the horizontal coordinate of the chromaticity coordinate of the processing pixel in the chromatogram, and b is the vertical coordinate of the chromaticity coordinate of the processing pixel in the chromatogram.
  • Step S54 Determine the position of the chromaticity coordinates of the processing pixel in the color gamut space. If the chromaticity coordinates of the processing pixel are located in the first area A, for example, at point P(A) in FIG. 2, then the color temperature value of the processing pixel is calculated according to the chromaticity coordinates of the processing pixel and the preset calculation formula of the pixel color temperature value Whether the color temperature value of a pixel is one of multiple reference color temperatures, if it is, the weight corresponding to the color temperature value of the processed pixel in the statistical table is increased by 1, otherwise the color temperature value and 1 of the processed pixel are used as the reference color temperature and their corresponding weights, respectively Add to the statistics table.
  • the chromaticity coordinates of the processing pixel are located in the second area B, for example, at the point P(B) in FIG. 2, the line between this point and the reference point O and the boundary line between the first area A and the second area B The angle of is ⁇ 1 , and the angle between the boundary between the first area A and the second area B and the boundary between the second area B and the third area C is ⁇ 1 , which corresponds to the chromaticity coordinates of the processed pixel The angle between the line connecting the reference point and the reference point and the boundary between the first area A and the second area B is ⁇ 1 , the preset first weight value calculation formula calculates the weight value of the processed pixel, and the weight The value is added to the weight corresponding to the maximum color temperature of 15000K in the statistical table.
  • the preset second weight value calculation formula calculates the weight value of the processed pixel, and the weight The value is added to the weight corresponding to the minimum color temperature of 1000K in the statistical table.
  • Step S55 Repeat steps S53 and S54 until the remaining multiple pixels all execute steps S53 and S54;
  • Step S56 Multiply each reference color temperature in the statistical table by the corresponding weight, and divide the sum of the products of multiple reference color temperatures and corresponding weights by the sum of the weights corresponding to multiple reference color temperatures to obtain the color temperature of the single-tone image value.
  • the method for identifying single-tone images of the present invention is formed by converting multiple RGB optical values corresponding to multiple pixels into an HSV color model, based on multiple tone values corresponding to multiple pixels in the HSV color model Statistical histogram, the statistical histogram has multiple histogram bars, the multiple histogram bars respectively correspond to the number of pixels located in different tone value intervals, according to the number of pixels in the statistical histogram is greater than a preset number threshold The number of histograms to determine whether the image is a single-tone image can effectively identify a single-tone image.

Abstract

The present invention provides a method for recognizing a single-tone image. The method for recognizing a single-tone image comprises: converting a plurality of rgb optical values corresponding to a plurality of pixels into an HSV color model; forming a statistical histogram according to a plurality of tone values in the HSV color model respectively corresponding to the plurality of pixels, the statistical histogram comprising a plurality of bars, and the plurality of bars respectively corresponding to the quantities of pixels located in different tone value intervals; and determining, according to the quantity of bars, in the statistical histogram, having the quantities of pixels greater than a preset quantity threshold, whether an image is a single-tone image. The method can effectively recognize a single-tone image.

Description

识别单一色调影像的方法Method for identifying single-tone image 技术领域Technical field
本发明涉及显示技术领域,尤其涉及一种识别单一色调影像的方法。The present invention relates to the field of display technology, and in particular to a method for identifying single-tone images.
背景技术Background technique
薄膜晶体管(Thin Film Transistor,TFT)是目前液晶显示装置(Liquid Crystal Display,LCD)和有源矩阵驱动式有机电致发光显示装置(Active Matrix Organic Light-Emitting Diode,AMOLED)中的主要驱动元件,直接关系平板显示装置的显示性能。Thin film transistor (Thin Film Transistor, TFT) is the main driving element in the current liquid crystal display device (Liquid Crystal Display) and active matrix driven organic electroluminescence display device (Active Matrix Organic Light-Emitting Diode, AMOLED), It is directly related to the display performance of the flat panel display device.
现有市场上的液晶显示器大部分为背光型液晶显示器,其包括液晶显示面板及背光模组(backlight module)。液晶显示面板的工作原理是在薄膜晶体管阵列基板(Thin Film Transistor Array Substrate,TFT Array Substrate)与彩色滤光片(Color Filter,CF)基板之间灌入液晶分子,并在两片基板上分别施加像素电压和公共电压,通过像素电压和公共电压之间形成的电场控制液晶分子的旋转方向,以将背光模组的光线透射出来产生画面。Most of the liquid crystal displays on the existing market are backlight type liquid crystal displays, which include a liquid crystal display panel and a backlight module. The working principle of the liquid crystal display panel is to infuse liquid crystal molecules between the thin film transistor array substrate (Thin Film Transistor Array Substrate, TFT Array Substrate) and the color filter (CF) substrate, and apply them separately on the two substrates The pixel voltage and the common voltage control the rotation direction of the liquid crystal molecules by the electric field formed between the pixel voltage and the common voltage, so as to transmit the light of the backlight module to generate a picture.
现有的OLED显示装置通常包括:基板、设于基板上的阳极、设于阳极上的有机发光层,设于有机发光层上的电子传输层及设于电子传输层上的阴极。工作时向有机发光层发射来自阳极的空穴和来自阴极的电子,将这些电子和空穴组合产生激发性电子-空穴对,并将激发性电子-空穴对从受激态输出为基态实现发光。The existing OLED display device usually includes a substrate, an anode provided on the substrate, an organic light emitting layer provided on the anode, an electron transport layer provided on the organic light emitting layer, and a cathode provided on the electron transport layer. During operation, the hole from the anode and the electron from the cathode are emitted to the organic light-emitting layer, and these electrons and holes are combined to generate an excited electron-hole pair, and the excited electron-hole pair is output from the excited state to the ground state Achieve glow.
在显示行业中,色温是用来表征光的颜色特性的重要参数,色温越低,光色越偏红,反之,光色越偏蓝。影像整体的色温可以表征影像给观看者的整体感觉。现有技术中基于相关色温(CCT)和色温分区获取影像色温,通过将影像的数位rgb值,将数位rgb值转换为色谱图中处理像素的色度坐标,根据该色度坐标所在色谱图中的区域计算色温。该现有的获取影像色温方法对于大面积单一暖色色调影像,色温计算值常比期望色温暖很多,很大程度影响计算结果,急需一种能有效识别单一色调影像的方法。In the display industry, color temperature is an important parameter used to characterize the color characteristics of light. The lower the color temperature, the more reddish the light color, and conversely, the more blued the light color. The overall color temperature of the image can characterize the overall feeling of the image to the viewer. In the prior art, the image color temperature is obtained based on the correlated color temperature (CCT) and the color temperature partition. By converting the digital rgb value of the image, the digital rgb value is converted into the chromaticity coordinates of the processing pixel in the chromatogram, and the chromaticity coordinates are located according to the chromaticity coordinates. The color temperature is calculated for the area. For the existing method of acquiring image color temperature, for a large area of a single warm color tone image, the calculated color temperature value is often much warmer than the expected color, which greatly affects the calculation result. There is an urgent need for a method that can effectively identify a single tone image.
发明内容Summary of the invention
本发明的目的在于提供一种识别单一色调影像的方法,可以有效识别单一色调影像。An object of the present invention is to provide a method for identifying a single-tone image, which can effectively identify a single-tone image.
为实现上述目的,本发明提供了一种识别单一色调影像的方法,包括 如下步骤:To achieve the above object, the present invention provides a method for identifying a single-tone image, including the following steps:
步骤S1、提供影像的显示数据;所述影像包括多个像素,所述影像的显示数据包括分别与多个像素对应的多个rgb光学值;将多个rgb光学值转换为HSV颜色模型;Step S1: Provide image display data; the image includes a plurality of pixels, and the image display data includes a plurality of rgb optical values corresponding to the plurality of pixels; convert the plurality of rgb optical values into an HSV color model;
步骤S2、根据HSV颜色模型中分别与多个像素对应的多个色调值形成统计直方图,该统计直方图中具有多个直方条,所述多个直方条分别对应位于不同的色调值区间的像素个数;Step S2. Form a statistical histogram according to multiple tonal values corresponding to multiple pixels in the HSV color model respectively. The statistical histogram has multiple histogram bars, and the multiple histogram bars respectively correspond to The number of pixels;
步骤S3、根据统计直方图中像素个数大于一预设的数量阈值的直方条的数量来判断影像是否为单一色调影像;当像素个数大于一预设的数量阈值的直方条的数量为1时,或者,当像素个数大于一预设的数量阈值的直方条的数量为2,且该2个直方条分别对应的色调值区间相邻时,则判断影像为单一色调影像,否则,则判断影像不为单一色调影像。Step S3. Determine whether the image is a single-tone image according to the number of histograms in the statistical histogram where the number of pixels is greater than a preset number threshold; when the number of pixels is greater than a preset number threshold, the number of histograms is 1 Or, when the number of histograms with a pixel number greater than a preset number threshold is 2, and the tone value intervals corresponding to the two histograms are adjacent to each other, the image is determined to be a single-tone image, otherwise, then Determine that the image is not a monotone image.
所述色调值的大小范围为0-1,设多个直方条的数量为n,每一直方条对应的色调值区间为
Figure PCTCN2019070910-appb-000001
其中,m为第m个直方条,h m为第m个直方条对应的色调值区间,n和m均为正整数且n>=2,m>=1。
The size range of the tone value is 0-1, the number of the plurality of histogram bars is n, and the interval of the tone value corresponding to each histogram bar is
Figure PCTCN2019070910-appb-000001
Where m is the m-th histogram, h m is the tone value interval corresponding to the m-th histogram, n and m are both positive integers and n>=2, m>=1.
所述预设的数量阈值为直方条对应的像素个数占影像的总像素个数的8%。The preset number threshold is 8% of the total number of pixels in the image corresponding to the histogram.
所述识别单一色调影像的方法还包括步骤S4、选取像素个数最多的直方条对应的色调值区间,去除该直方条中位于该色调值区间中且饱和度大于一预设的饱和度阈值或亮度小于一预设的亮度阈值的像素,得到剩余的多个像素;The method for recognizing a single-tone image further includes step S4, selecting the tone value interval corresponding to the histogram with the largest number of pixels, and removing the saturation value of the histogram that is in the tone value interval and the saturation is greater than a preset saturation threshold For pixels whose brightness is less than a preset brightness threshold, the remaining multiple pixels are obtained;
步骤S5、根据影像色温获取方法计算剩余的多个像素的色温值以获取单一色调影像的色温值。Step S5: Calculate the color temperature values of the remaining pixels according to the image color temperature acquisition method to obtain the color temperature value of the single-tone image.
所述步骤S5的具体步骤为:The specific steps of step S5 are:
步骤S51、建立统计表;所述统计表包括多个参考色温及分别与多个参考色温对应的多个权重,所述多个参考色温包括预设的最小色温、预设的最大色温及多个中间色温,多个权重均为0;多个中间色温逐渐增大,且均大于最小色温并小于最大色温;Step S51: Establish a statistical table; the statistical table includes multiple reference color temperatures and multiple weights corresponding to the multiple reference color temperatures, respectively, the multiple reference color temperatures include a preset minimum color temperature, a preset maximum color temperature, and multiple Intermediate color temperature, multiple weights are 0; multiple intermediate color temperatures gradually increase, and are all greater than the minimum color temperature and less than the maximum color temperature;
步骤S52、提供色谱图,将色谱图中的色域空间划分为两两相连的第一区、第二区及第三区;第一区与第二区的交界线、第二区与第三区的交界 线及第三区与第一区的交界线汇聚于一参考点,第一区与第二区的交界线与最大色温对应的等色温线重合,第一区与第三区的交界线与最小色温对应的等色温线重合,第二区与第三区的交界线平行于色谱图的纵坐标轴;Step S52, providing a chromatogram, dividing the color gamut space in the chromatogram into the first zone, the second zone, and the third zone connected in pairs; the boundary between the first zone and the second zone, the second zone, and the third zone The boundary line of the zone and the boundary line of the third zone and the first zone converge at a reference point. The boundary line of the first zone and the second zone coincides with the isochromatic temperature line corresponding to the maximum color temperature. The junction of the first zone and the third zone The line coincides with the equal color temperature line corresponding to the minimum color temperature, and the boundary between the second zone and the third zone is parallel to the ordinate axis of the chromatogram;
步骤S53、选取剩余的多个像素中的一个为处理像素;将处理像素的rgb光学值转换为色谱图中处理像素的色度坐标;Step S53: Select one of the remaining pixels as the processing pixel; convert the rgb optical value of the processing pixel into the chromaticity coordinates of the processing pixel in the chromatogram;
步骤S54、判断处理像素的色度坐标在色域空间中的位置;若处理像素的色度坐标位于第一区,则依据处理像素的色度坐标及预设的像素色温计算公式计算处理像素的色温值,判断处理像素的色温值是否为多个参考色温中的一个,若是则将统计表中与处理像素的色温值对应的权重增加1,否则将处理像素的色温值及1分别作为参考色温及其对应的权重增加至统计表中;若处理像素的色度坐标位于第二区,则依据处理像素的色度坐标所对应的点与参考点的连线和第一区与第二区的交界线间的夹角、预设的第一权重值计算公式计算处理像素的权重值,并将该权重值加入统计表中与最大色温对应的权重;若处理像素的色度坐标位于第三区,则依据处理像素的色度坐标所对应的点与参考点的连线和第一区与第三区的交界线间的夹角、预设的第二权重值计算公式计算处理像素的权重值,并将该权重值加入统计表中与最小色温对应的权重;Step S54: Determine the position of the chromaticity coordinates of the processing pixel in the color gamut space; if the chromaticity coordinates of the processing pixel are located in the first zone, then calculate the processing pixel's chromaticity coordinates and the preset pixel color temperature calculation formula Color temperature value, to determine whether the color temperature value of the processing pixel is one of multiple reference color temperatures, if so, increase the weight corresponding to the color temperature value of the processing pixel in the statistical table by 1, otherwise the color temperature value and 1 of the processing pixel are used as the reference color temperature And their corresponding weights are added to the statistics table; if the chromaticity coordinates of the processed pixel are in the second area, the connection between the point corresponding to the chromaticity coordinates of the processed pixel and the reference point and the The angle between the boundary lines and the preset first weight value calculation formula calculate the weight value of the processed pixel, and add the weight value to the weight corresponding to the maximum color temperature in the statistical table; if the chromaticity coordinates of the processed pixel are located in the third area , Then the weight value of the processing pixel is calculated according to the angle between the connection line between the point corresponding to the chromaticity coordinates of the processing pixel and the reference point and the boundary between the first area and the third area, and the preset second weight value calculation formula , And add the weight value to the weight corresponding to the minimum color temperature in the statistical table;
步骤S55、重复步骤S53及S54,直至剩余的多个像素均执行步骤S53及S54;Step S55. Repeat steps S53 and S54 until the remaining multiple pixels all execute steps S53 and S54;
步骤S56、将统计表中每一参考色温与对应的权重相乘,将多个参考色温与对应的权重的乘积之和与多个参考色温对应的权重之和相除,得到单一色调影像的色温值。Step S56: Multiply each reference color temperature in the statistical table by the corresponding weight, and divide the sum of the products of multiple reference color temperatures and corresponding weights by the sum of the weights corresponding to multiple reference color temperatures to obtain the color temperature of the single-tone image value.
所述多个rgb光学值通过分别与多个像素对应的多个rgb数字值根据光学值计算公式得到,该光学值计算公式为:
Figure PCTCN2019070910-appb-000002
其中,R为rgb光学值中的红色光学值,G为rgb光学值中的绿色光学值,B为rgb光学值中的蓝色光学值,r为rgb数字值中的红色数字值,g为rgb数字值中的绿色数字值,b为rgb数字值中的蓝色数字值,
Figure PCTCN2019070910-appb-000003
表示对 r进行伽马变换处理后得到的值,
Figure PCTCN2019070910-appb-000004
表示对b进行伽马变换处理后得到的值,
Figure PCTCN2019070910-appb-000005
表示对g进行伽马变换处理后得到的值。
The plurality of rgb optical values are obtained from the plurality of rgb digital values corresponding to the plurality of pixels according to an optical value calculation formula, and the optical value calculation formula is:
Figure PCTCN2019070910-appb-000002
Where R is the red optical value in the rgb optical value, G is the green optical value in the rgb optical value, B is the blue optical value in the rgb optical value, r is the red digital value in the rgb digital value, and g is rgb The green digital value in the digital value, b is the blue digital value in the rgb digital value,
Figure PCTCN2019070910-appb-000003
Represents the value obtained by performing gamma transformation on r,
Figure PCTCN2019070910-appb-000004
Represents the value obtained by performing gamma transformation on b,
Figure PCTCN2019070910-appb-000005
Represents the value obtained by performing gamma transformation on g.
所述步骤S53中将处理像素的rgb光学值转换为色谱图中处理像素的色度坐标的具体过程为:根据处理像素的光学rgb值及预设的三刺激值计算公式计算处理像素的三刺激值,依据处理像素的三刺激值及预设的色度坐标计算公式计算色谱图中处理像素的色度坐标;The specific process of converting the rgb optical value of the processing pixel to the chromaticity coordinates of the processing pixel in the chromatogram in the step S53 is as follows: calculating the tristimulus of the processing pixel according to the optical rgb value of the processing pixel and a preset tristimulus value calculation formula Value, calculate the chromaticity coordinates of the processed pixel in the chromatogram according to the tristimulus value of the processed pixel and the preset chromaticity coordinate calculation formula;
所述预设的三刺激值计算公式为:
Figure PCTCN2019070910-appb-000006
其中,X为三刺激值中的红色刺激值,Y为三刺激值中的绿色刺激值,Z为三刺激值中的蓝色刺激值,T为预设的转化矩阵;
The preset formula for calculating the tristimulus value is:
Figure PCTCN2019070910-appb-000006
Wherein, X is the red stimulus value in the tristimulus value, Y is the green stimulus value in the tristimulus value, Z is the blue stimulus value in the tristimulus value, and T is the preset conversion matrix;
所述预设的色度坐标公式为:
Figure PCTCN2019070910-appb-000007
其中,a为处理像素在色谱图中色度坐标的横坐标,b为处理像素在色谱图中色度坐标的纵坐标。
The preset chromaticity coordinate formula is:
Figure PCTCN2019070910-appb-000007
Where a is the horizontal coordinate of the chromaticity coordinate of the processing pixel in the chromatogram, and b is the vertical coordinate of the chromaticity coordinate of the processing pixel in the chromatogram.
所述色谱图中第一区与第二区的交界线、第二区与第三区的交界线及第三区与第一区的交界线汇聚的参考点的坐标为(0.332,0.1858);所述预设的像素色温值计算公式为:CT=-437*s 3+3601*s 2-6861*s+5514.31,其中,CT为像素色温值,
Figure PCTCN2019070910-appb-000008
The coordinates of the reference points where the boundary between the first zone and the second zone, the boundary between the second zone and the third zone, and the boundary between the third zone and the first zone in the chromatogram are (0.332, 0.1858); The preset calculation formula of the pixel color temperature value is: CT=-437*s 3 +3601*s 2 -6861*s+5514.31, where CT is the pixel color temperature value,
Figure PCTCN2019070910-appb-000008
所述预设的第一权重值计算公式为:γ 1=1-α 11,其中,γ 1为处理像素的色度坐标位于第二区时处理像素的权重值,α 1为处理像素的色度 坐标所对应的点与参考点的连线和第一区与第二区的交界线间的夹角,β 1为第一区与第二区的交界线和第二区与第三区的交界线间的夹角; The preset formula for calculating the first weight value is: γ 1 =1-α 11 , where γ 1 is the weight value of the processing pixel when the chromaticity coordinates of the processing pixel are located in the second zone, and α 1 is the processing The angle between the line connecting the point corresponding to the chromaticity coordinates of the pixel and the reference point and the boundary between the first and second regions, β 1 is the boundary between the first and second regions and the second and second regions The angle between the boundary lines of the three districts;
所述预设的第二权重值计算公式为:γ 2=1-α 22,其中,γ 2为处理像素的色度坐标位于第三区时处理像素的权重值,α 2为处理像素的色度坐标所对应的点与参考点的连线和第一区与第三区的交界线间的夹角,β 2为第一区与第三区的交界线和第二区域与第三区的交界线间的夹角。 The preset second weight value calculation formula is: γ 2 =1-α 22 , where γ 2 is the weight value of the processing pixel when the chromaticity coordinates of the processing pixel are located in the third zone, and α 2 is the processing The angle between the line between the point corresponding to the chromaticity coordinates of the pixel and the reference point and the boundary between the first and third regions, β 2 is the boundary between the first and third regions and the second and third regions The angle between the boundaries of the three districts.
所述色谱图为CIE1931色谱图;所述预设的最小色温为1000K;所述预设的最大色温为15000K。The chromatogram is a CIE1931 chromatogram; the preset minimum color temperature is 1000K; and the preset maximum color temperature is 15000K.
本发明还提供了一种识别单一色调影像的方法,包括如下步骤:The invention also provides a method for identifying single-tone images, including the following steps:
步骤S1、提供影像的显示数据;所述影像包括多个像素,所述影像的显示数据包括分别与多个像素对应的多个rgb光学值;将多个rgb光学值转换为HSV颜色模型;Step S1: Provide image display data; the image includes a plurality of pixels, and the image display data includes a plurality of rgb optical values corresponding to the plurality of pixels; convert the plurality of rgb optical values into an HSV color model;
步骤S2、根据HSV颜色模型中分别与多个像素对应的多个色调值形成统计直方图,该统计直方图中具有多个直方条,所述多个直方条分别对应位于不同的色调值区间的像素个数;Step S2. Form a statistical histogram according to multiple tonal values corresponding to multiple pixels in the HSV color model respectively. The statistical histogram has multiple histogram bars, and the multiple histogram bars respectively correspond to The number of pixels;
步骤S3、根据统计直方图中像素个数大于一预设的数量阈值的直方条的数量来判断影像是否为单一色调影像;当像素个数大于一预设的数量阈值的直方条的数量为1时,或者,当像素个数大于一预设的数量阈值的直方条的数量为2,且该2个直方条分别对应的色调值区间相邻时,则判断影像为单一色调影像,否则,则判断影像不为单一色调影像;Step S3. Determine whether the image is a single-tone image according to the number of histograms in the statistical histogram where the number of pixels is greater than a preset number threshold; when the number of pixels is greater than a preset number threshold, the number of histograms is 1 Or, when the number of histograms with a pixel number greater than a preset number threshold is 2, and the tone value intervals corresponding to the two histograms are adjacent to each other, the image is determined to be a single-tone image, otherwise, then Determine that the image is not a single-tone image;
步骤S4、选取像素个数最多的直方条对应的色调值区间,去除该直方条中位于该色调值区间中且饱和度大于一预设的饱和度阈值或亮度小于一预设的亮度阈值的像素,得到剩余的多个像素;Step S4: Select the tone value interval corresponding to the histogram with the largest number of pixels, and remove pixels in the histogram that are in the tone value interval and have a saturation greater than a preset saturation threshold or a brightness less than a preset brightness threshold To get the remaining pixels;
步骤S5、根据影像色温获取方法计算剩余的多个像素的色温值以获取单一色调影像的色温值;Step S5: Calculate the color temperature values of the remaining pixels according to the image color temperature acquisition method to obtain the color temperature value of the single-tone image;
所述预设的数量阈值为直方条对应的像素个数占影像的总像素个数的8%。The preset number threshold is 8% of the total number of pixels in the image corresponding to the histogram.
本发明的有益效果:本发明的识别单一色调影像的方法通过将与多个像素对应的多个rgb光学值转换为HSV颜色模型,根据HSV颜色模型中分别与多个像素对应的多个色调值形成统计直方图,该统计直方图中具有多 个直方条,所述多个直方条分别对应位于不同的色调值区间的像素个数,根据统计直方图中像素个数大于一预设的数量阈值的直方条的数量来判断影像是否为单一色调影像,可以有效识别单一色调影像。Beneficial effect of the present invention: The method for identifying single-tone images of the present invention converts multiple rgb optical values corresponding to multiple pixels into an HSV color model, and according to the multiple tone values corresponding to multiple pixels in the HSV color model, respectively Forming a statistical histogram, the statistical histogram has a plurality of histograms, the plurality of histograms respectively corresponding to the number of pixels in different tone value intervals, according to the statistical histogram, the number of pixels is greater than a preset number threshold The number of histograms to determine whether the image is a single-tone image can effectively identify a single-tone image.
附图说明BRIEF DESCRIPTION
为了能更进一步了解本发明的特征以及技术内容,请参阅以下有关本发明的详细说明与附图,然而附图仅提供参考与说明用,并非用来对本发明加以限制。In order to further understand the features and technical content of the present invention, please refer to the following detailed description and drawings of the present invention. However, the drawings are provided for reference and explanation only, and are not intended to limit the present invention.
附图中,In the drawings,
图1为本发明的识别单一色调影像的方法的流程图;FIG. 1 is a flowchart of a method for identifying single-tone images of the present invention;
图2及图3为本发明的识别单一色调影像的方法的统计直方图的示意图;2 and 3 are schematic diagrams of statistical histograms of the method for identifying single-tone images of the present invention;
图4为本发明的识别单一色调影像的方法的色谱图的示意图。4 is a schematic diagram of a chromatogram of the method for identifying a single-tone image of the present invention.
具体实施方式detailed description
为更进一步阐述本发明所采取的技术手段及其效果,以下结合本发明的优选实施例及其附图进行详细描述。In order to further elaborate on the technical means adopted by the present invention and its effects, the following will be described in detail with reference to the preferred embodiments of the present invention and the accompanying drawings.
请参阅图1,本发明提供一种识别单一色调影像的方法,包括如下步骤:Please refer to FIG. 1, the present invention provides a method for identifying a single-tone image, including the following steps:
步骤S1、提供影像的显示数据;所述影像包括多个像素,所述影像的显示数据包括分别与多个像素对应的多个rgb光学值;将多个rgb光学值转换为HSV(Hue Saturation Value)颜色模型;Step S1: Provide display data of the image; the image includes a plurality of pixels, and the display data of the image includes a plurality of rgb optical values corresponding to the plurality of pixels; convert the plurality of rgb optical values to HSV (Hue Saturation Value) ) Color model;
步骤S2、请参阅图2级图3,根据HSV颜色模型中分别与多个像素对应的多个色调(Hue)值形成统计直方图,该统计直方图中具有多个直方条,所述多个直方条分别对应位于不同的色调值区间的像素个数;Step S2. Please refer to FIG. 2 and FIG. 3, a statistical histogram is formed according to multiple Hue values corresponding to multiple pixels in the HSV color model, and the statistical histogram has multiple histogram bars. The histograms correspond to the number of pixels in different tonal value ranges respectively;
步骤S3、根据统计直方图中像素个数大于一预设的数量阈值的直方条的数量来判断影像是否为单一色调影像;当像素个数大于一预设的数量阈值的直方条的数量为1时,或者,当像素个数大于一预设的数量阈值的直方条的数量为2,且该2个直方条分别对应的色调值区间相邻时,则判断影像为单一色调影像,否则,则判断影像不为单一色调影像。Step S3. Determine whether the image is a single-tone image according to the number of histograms in the statistical histogram where the number of pixels is greater than a preset number threshold; when the number of pixels is greater than a preset number threshold, the number of histograms is 1 Or, when the number of histograms with a pixel number greater than a preset number threshold is 2, and the tone value intervals corresponding to the two histograms are adjacent to each other, the image is determined to be a single-tone image, otherwise, then Determine that the image is not a monotone image.
需要说明的是,本发明通过将与多个像素对应的多个rgb光学值转换为HSV颜色模型,根据HSV颜色模型中分别与多个像素对应的多个色调(Hue)值形成统计直方图,该统计直方图中具有多个直方条,所述多个直方条分别对应位于不同的色调值区间的像素个数,根据统计直方图中像素个数大 于一预设的数量阈值的直方条的数量来判断影像是否为单一色调影像,可以有效识别单一色调影像。It should be noted that the present invention converts multiple rgb optical values corresponding to multiple pixels into an HSV color model, and forms a statistical histogram according to multiple Hue values corresponding to multiple pixels in the HSV color model, The statistical histogram has multiple histogram bars, and the multiple histogram bars respectively correspond to the number of pixels located in different tone value intervals. According to the number of pixels in the statistical histogram, the number of pixels is greater than a preset number threshold To determine whether the image is a monotone image, it can effectively identify the monotone image.
具体的,所述色调值的大小范围为0-1,设多个直方条的数量为n,每一直方条对应的色调值区间为
Figure PCTCN2019070910-appb-000009
其中,m为第m个直方条,h m为第m个直方条对应的色调值区间,n和m均为正整数且n>=2,m>=1。例如,当多个直方条的数量为10,第一个直方条对应的色调值区间为0<=h 1<0.1,第二个直方条对应的色调值区间为0.1<=h 2<0.2,依次类推,第十个直方条对应的色调值区间为0.9<=h 10<1,由于HSV颜色模型中的色调值是一个程环形的数据,色调值1也就是色调值0。
Specifically, the size range of the tone value is 0-1, the number of the plurality of histogram bars is n, and the tone value interval corresponding to each histogram bar is
Figure PCTCN2019070910-appb-000009
Where m is the m-th histogram, h m is the tone value interval corresponding to the m-th histogram, n and m are both positive integers and n>=2, m>=1. For example, when the number of multiple histogram bars is 10, the tone value interval corresponding to the first histogram bar is 0<=h 1 <0.1, and the tone value interval corresponding to the second histogram bar is 0.1<=h 2 <0.2, By analogy, the hue value interval corresponding to the tenth histogram is 0.9<=h 10 <1. Since the hue value in the HSV color model is a circular data, the hue value 1 is the hue value 0.
进一步的,统计直方图中直方条的数量越多,则统计的数据越直观,因此,本发明的多个直方条的数量大于或等于10,以提高单一色调影像识别的准确形。Further, the greater the number of histogram bars in the statistical histogram, the more intuitive the statistical data. Therefore, the number of multiple histogram bars of the present invention is greater than or equal to 10 to improve the accuracy of single-tone image recognition.
具体的,所述预设的数量阈值为直方条对应的像素个数占影像的总像素个数的8%,即本发明根据统计直方图中像素个数大于总像素个数的8%的直方条的数量来判断影像是否为单一色调影像。Specifically, the preset number threshold is that the number of pixels corresponding to the histogram takes up 8% of the total number of pixels in the image, that is, according to the statistical histogram, the number of pixels in the present invention is greater than 8% of the total number of pixels The number of bars determines whether the image is a monotone image.
具体的,所述多个rgb光学值通过分别与多个像素对应的多个rgb数字值根据光学值计算公式得到,该光学值计算公式为:
Figure PCTCN2019070910-appb-000010
其中,R为rgb光学值中的红色光学值,G为rgb光学值中的绿色光学值,B为rgb光学值中的蓝色光学值,r为rgb数字值中的红色数字值,g为rgb数字值中的绿色数字值,b为rgb数字值中的蓝色数字值,
Figure PCTCN2019070910-appb-000011
表示对r进行伽马变换处理后得到的值,
Figure PCTCN2019070910-appb-000012
表示对b进行伽马变换处理后得到的值,
Figure PCTCN2019070910-appb-000013
表示对g进行伽马变换处理后得到的值。
Specifically, the plurality of rgb optical values are obtained from the plurality of rgb digital values respectively corresponding to the plurality of pixels according to an optical value calculation formula, and the optical value calculation formula is:
Figure PCTCN2019070910-appb-000010
Where R is the red optical value in the rgb optical value, G is the green optical value in the rgb optical value, B is the blue optical value in the rgb optical value, r is the red digital value in the rgb digital value, and g is rgb The green digital value in the digital value, b is the blue digital value in the rgb digital value,
Figure PCTCN2019070910-appb-000011
Represents the value obtained by performing gamma transformation on r,
Figure PCTCN2019070910-appb-000012
Represents the value obtained by performing gamma transformation on b,
Figure PCTCN2019070910-appb-000013
Represents the value obtained by performing gamma transformation on g.
具体的,后续还需要获取单一色调影像的色温值,因此本发明还包括步骤S4、选取像素个数最多的直方条对应的色调值区间,去除该直方条中位于该色调值区间中且饱和度大于一预设的饱和度阈值或亮度小于一预设的亮度阈值的像素,得到剩余的多个像素;Specifically, the color temperature value of the single-tone image needs to be acquired later, so the present invention further includes step S4, selecting the tone value interval corresponding to the histogram with the largest number of pixels, and removing the saturation and saturation of the histogram located in the tone value interval For pixels that are greater than a preset saturation threshold or whose brightness is less than a preset brightness threshold, the remaining multiple pixels are obtained;
步骤S5、根据影像色温获取方法计算剩余的多个像素的色温值以获取单一色调影像的色温值。即本发明将单一色调影像的色温值的杂讯像素剔除掉,使单一色调影像的色温值计算更加准确。Step S5: Calculate the color temperature values of the remaining pixels according to the image color temperature acquisition method to obtain the color temperature value of the single-tone image. That is, the invention removes the noise pixels of the color temperature value of the single-tone image, so that the calculation of the color temperature value of the single-tone image is more accurate.
进一步的,所述步骤S5的具体步骤为:Further, the specific steps of step S5 are:
步骤S51、建立统计表;所述统计表包括多个参考色温及分别与多个参考色温对应的多个权重,所述多个参考色温包括预设的最小色温、预设的最大色温及多个中间色温,多个权重均为0;多个中间色温逐渐增大,且均大于最小色温并小于最大色温。Step S51: Establish a statistical table; the statistical table includes multiple reference color temperatures and multiple weights corresponding to the multiple reference color temperatures, respectively, the multiple reference color temperatures include a preset minimum color temperature, a preset maximum color temperature, and multiple Intermediate color temperature, multiple weights are all 0; multiple intermediate color temperatures gradually increase, and are all greater than the minimum color temperature and less than the maximum color temperature.
具体的,所述预设的最小色温为1000K;所述预设的最大色温为15000K。Specifically, the preset minimum color temperature is 1000K; the preset maximum color temperature is 15000K.
具体地,所述多个中间色温可以等间隔的设置在最小色温及最大色温之间。Specifically, the plurality of intermediate color temperatures may be set at equal intervals between the minimum color temperature and the maximum color temperature.
进一步地,所述统计表可以为如下表1的统计表,多个中间色温中,每两个相邻的色温之间的差值为500K,最小的中间色温与最小色温的差值为500K,最大色温与最大的中间色温的差值为500K。Further, the statistical table may be a statistical table as shown in Table 1 below. Among multiple intermediate color temperatures, the difference between each two adjacent color temperatures is 500K, and the difference between the minimum intermediate color temperature and the minimum color temperature is 500K. The difference between the maximum color temperature and the maximum intermediate color temperature is 500K.
表1、统计表Table 1. Statistics
参考色温Reference color temperature 1000K1000K 1500K1500K ……... 15000K 15000K
权重Weights 00 00 ……... 00
步骤S52、请参阅图4,提供色谱图,将色谱图中的色域空间划分为两两相连的第一区A、第二区B及第三区C。第一区A与第二区B的交界线、第二区B与第三区C的交界线及第三区C与第一区A的交界线汇聚于一参考点O,第一区A与第二区B的交界线与最大色温对应的等色温线重合,第一区A与第三区C的交界线与最小色温对应的等色温线重合,第二区B 与第三区C的交界线平行于色谱图的纵坐标轴。Step S52. Please refer to FIG. 4 to provide a chromatogram, and to divide the color gamut space in the chromatogram into a first area A, a second area B, and a third area C connected in pairs. The boundary between the first area A and the second area B, the boundary between the second area B and the third area C, and the boundary between the third area C and the first area A converge at a reference point O, the first area A and The boundary line of the second zone B coincides with the isochromatic temperature line corresponding to the maximum color temperature, the boundary line of the first zone A and the third zone C coincides with the isochromatic temperature line corresponding to the minimum color temperature, and the boundary of the second zone B and the third zone C The line is parallel to the ordinate axis of the chromatogram.
具体地,所述色谱图为CIE1931色谱图。Specifically, the chromatogram is a CIE1931 chromatogram.
具体地,所述色谱图中的所有等色温线均汇聚在该参考点O上。Specifically, all the isochromatic temperature lines in the chromatogram converge on this reference point O.
具体地,所述参考点O的坐标为(0.332,0.1858)。Specifically, the coordinates of the reference point O are (0.332, 0.1858).
步骤S53、选取剩余的多个像素中的一个为处理像素;将处理像素的rgb光学值转换为色谱图中处理像素的色度坐标。Step S53: Select one of the remaining pixels as the processing pixel; convert the rgb optical value of the processing pixel into the chromaticity coordinates of the processing pixel in the chromatogram.
具体的,所述步骤S53中将处理像素的rgb光学值转换为色谱图中处理像素的色度坐标的具体过程为:根据处理像素的光学rgb值及预设的三刺激值计算公式计算处理像素的三刺激值,依据处理像素的三刺激值及预设的色度坐标计算公式计算色谱图中处理像素的色度坐标;Specifically, the specific process of converting the rgb optical value of the processing pixel into the chromaticity coordinates of the processing pixel in the chromatogram in the step S53 is as follows: calculating the processing pixel according to the optical rgb value of the processing pixel and a preset tristimulus value calculation formula The tristimulus value of the pixel is calculated according to the tristimulus value of the processed pixel and the preset chromaticity coordinate calculation formula;
所述预设的三刺激值计算公式为:
Figure PCTCN2019070910-appb-000014
其中,X为三刺激值中的红色刺激值,Y为三刺激值中的绿色刺激值,Z为三刺激值中的蓝色刺激值,T为预设的转化矩阵;
The preset formula for calculating the tristimulus value is:
Figure PCTCN2019070910-appb-000014
Wherein, X is the red stimulus value in the tristimulus value, Y is the green stimulus value in the tristimulus value, Z is the blue stimulus value in the tristimulus value, and T is the preset conversion matrix;
所述预设的色度坐标公式为:
Figure PCTCN2019070910-appb-000015
其中,a为处理像素在色谱图中色度坐标的横坐标,b为处理像素在色谱图中色度坐标的纵坐标。
The preset chromaticity coordinate formula is:
Figure PCTCN2019070910-appb-000015
Where a is the horizontal coordinate of the chromaticity coordinate of the processing pixel in the chromatogram, and b is the vertical coordinate of the chromaticity coordinate of the processing pixel in the chromatogram.
步骤S54、判断处理像素的色度坐标在色域空间中的位置。若处理像素的色度坐标位于第一区A,例如位于图2中P(A)点,则依据处理像素的色度坐标及预设的像素色温值计算公式计算处理像素的色温值,判断处理像素的色温值是否为多个参考色温中的一个,若是则将统计表中与处理像素的色温值对应的权重增加1,否则将处理像素的色温值及1分别作为参考色温及其对应的权重增加至统计表中。若处理像素的色度坐标位于第二区B,例如位于图2中的P(B)点,该点与参考点O之间的连线和第一区A与第二区B的交界线间的角度为α 1,而第一区A与第二区B的交界线和第二区B与第三区C的交界线间的角度为β 1,此时依据处理像素的色度坐标 所对应的点与参考点的连线和第一区A与第二区B的交界线间的夹角也即α 1、预设的第一权重值计算公式计算处理像素的权重值,并将该权重值加入统计表中与最大色温也即15000K对应的权重。若处理像素的色度坐标位于第三区C,例如位于图3中的P(C)点,该点与参考点O之间的连线和第一区A与第三区C的交界线间的角度为α 2,而第一区A与第三区C的交界线和第二区B与第三区C的交界线间的角度为β 2,此时依据处理像素的色度坐标所对应的点与参考点的连线和第一区A与第三区C的交界线间的夹角也即α 2、预设的第二权重值计算公式计算处理像素的权重值,并将该权重值加入统计表中与最小色温也即1000K对应的权重。 Step S54: Determine the position of the chromaticity coordinates of the processing pixel in the color gamut space. If the chromaticity coordinates of the processing pixel are located in the first area A, for example, at point P(A) in FIG. 2, then the color temperature value of the processing pixel is calculated according to the chromaticity coordinates of the processing pixel and the preset calculation formula of the pixel color temperature value Whether the color temperature value of a pixel is one of multiple reference color temperatures, if it is, the weight corresponding to the color temperature value of the processed pixel in the statistical table is increased by 1, otherwise the color temperature value and 1 of the processed pixel are used as the reference color temperature and their corresponding weights, respectively Add to the statistics table. If the chromaticity coordinates of the processing pixel are located in the second area B, for example, at the point P(B) in FIG. 2, the line between this point and the reference point O and the boundary line between the first area A and the second area B The angle of is α 1 , and the angle between the boundary between the first area A and the second area B and the boundary between the second area B and the third area C is β 1 , which corresponds to the chromaticity coordinates of the processed pixel The angle between the line connecting the reference point and the reference point and the boundary between the first area A and the second area B is α 1 , the preset first weight value calculation formula calculates the weight value of the processed pixel, and the weight The value is added to the weight corresponding to the maximum color temperature of 15000K in the statistical table. If the chromaticity coordinates of the processed pixel are located in the third area C, for example, at the point P(C) in FIG. 3, the line between this point and the reference point O and the boundary between the first area A and the third area C The angle is α 2 , and the angle between the boundary between the first area A and the third area C and the boundary between the second area B and the third area C is β 2 , which corresponds to the chromaticity coordinates of the processed pixel The angle between the line connecting the reference point and the reference point and the boundary between the first area A and the third area C, that is, α 2 , the preset second weight value calculation formula calculates the weight value of the processed pixel, and the weight The value is added to the weight corresponding to the minimum color temperature of 1000K in the statistical table.
具体的,所述预设的像素色温值计算公式为:CT=-437*s 3+3601*s 2-6861*s+5514.31,其中,CT为像素色温值,
Figure PCTCN2019070910-appb-000016
Specifically, the preset calculation formula of the pixel color temperature value is: CT=-437*s 3 +3601*s 2 -6861*s+5514.31, where CT is the pixel color temperature value,
Figure PCTCN2019070910-appb-000016
具体的,所述预设的第一权重值计算公式为:γ 1=1-α 11,其中,γ 1为处理像素的色度坐标位于第二区B时处理像素的权重值,α 1为处理像素的色度坐标所对应的点与参考点的连线和第一区A与第二区B的交界线间的夹角,β 1为第一区A与第二区B的交界线和第二区B与第三区C的交界线间的夹角; Specifically, the preset first weight value calculation formula is: γ 1 =1-α 11 , where γ 1 is the weight value of the processing pixel when the chromaticity coordinates of the processing pixel are located in the second area B, α 1 is the angle between the line connecting the point corresponding to the chromaticity coordinates of the processing pixel and the reference point and the boundary between the first area A and the second area B, β 1 is the angle between the first area A and the second area B The angle between the boundary line and the boundary line between the second zone B and the third zone C;
具体的,所述预设的第二权重值计算公式为:γ 2=1-α 22,其中,γ 2为处理像素的色度坐标位于第三区C时处理像素的权重值,α 2为处理像素的色度坐标所对应的点与参考点的连线和第一区A与第三区C的交界线间的夹角,β 2为第一区A与第三区C的交界线和第二区B域与第三区C 的交界线间的夹角。 Specifically, the preset calculation formula of the second weight value is: γ 2 =1-α 22 , where γ 2 is the weight value of the processing pixel when the chromaticity coordinates of the processing pixel are located in the third area C, α 2 is the angle between the line connecting the point corresponding to the chromaticity coordinates of the processing pixel and the reference point and the boundary between the first area A and the third area C, β 2 is the angle between the first area A and the third area C The angle between the boundary line and the boundary line between the second area B and the third area C.
步骤S55、重复步骤S53及S54,直至剩余的多个像素均执行步骤S53及S54;Step S55. Repeat steps S53 and S54 until the remaining multiple pixels all execute steps S53 and S54;
步骤S56、将统计表中每一参考色温与对应的权重相乘,将多个参考色温与对应的权重的乘积之和与多个参考色温对应的权重之和相除,得到单一色调影像的色温值。Step S56: Multiply each reference color temperature in the statistical table by the corresponding weight, and divide the sum of the products of multiple reference color temperatures and corresponding weights by the sum of the weights corresponding to multiple reference color temperatures to obtain the color temperature of the single-tone image value.
综上所述,本发明的识别单一色调影像的方法通过将与多个像素对应的多个rgb光学值转换为HSV颜色模型,根据HSV颜色模型中分别与多个像素对应的多个色调值形成统计直方图,该统计直方图中具有多个直方条,所述多个直方条分别对应位于不同的色调值区间的像素个数,根据统计直方图中像素个数大于一预设的数量阈值的直方条的数量来判断影像是否为单一色调影像,可以有效识别单一色调影像。In summary, the method for identifying single-tone images of the present invention is formed by converting multiple RGB optical values corresponding to multiple pixels into an HSV color model, based on multiple tone values corresponding to multiple pixels in the HSV color model Statistical histogram, the statistical histogram has multiple histogram bars, the multiple histogram bars respectively correspond to the number of pixels located in different tone value intervals, according to the number of pixels in the statistical histogram is greater than a preset number threshold The number of histograms to determine whether the image is a single-tone image can effectively identify a single-tone image.
以上所述,对于本领域的普通技术人员来说,可以根据本发明的技术方案和技术构思作出其他各种相应的改变和变形,而所有这些改变和变形都应属于本发明权利要求的保护范围。As mentioned above, those of ordinary skill in the art can make various other corresponding changes and modifications according to the technical solutions and technical concepts of the present invention, and all such changes and modifications should fall within the protection scope of the claims of the present invention. .

Claims (15)

  1. 一种识别单一色调影像的方法,包括如下步骤:A method for identifying a single-tone image includes the following steps:
    步骤S1、提供影像的显示数据;所述影像包括多个像素,所述影像的显示数据包括分别与多个像素对应的多个rgb光学值;将多个rgb光学值转换为HSV颜色模型;Step S1: Provide image display data; the image includes a plurality of pixels, and the image display data includes a plurality of rgb optical values corresponding to the plurality of pixels; convert the plurality of rgb optical values into an HSV color model;
    步骤S2、根据HSV颜色模型中分别与多个像素对应的多个色调值形成统计直方图,该统计直方图中具有多个直方条,所述多个直方条分别对应位于不同的色调值区间的像素个数;Step S2. Form a statistical histogram according to multiple tonal values corresponding to multiple pixels in the HSV color model respectively. The statistical histogram has multiple histogram bars, and the multiple histogram bars respectively correspond to The number of pixels;
    步骤S3、根据统计直方图中像素个数大于一预设的数量阈值的直方条的数量来判断影像是否为单一色调影像;当像素个数大于一预设的数量阈值的直方条的数量为1时,或者,当像素个数大于一预设的数量阈值的直方条的数量为2,且该2个直方条分别对应的色调值区间相邻时,则判断影像为单一色调影像,否则,则判断影像不为单一色调影像。Step S3. Determine whether the image is a single-tone image according to the number of histograms in the statistical histogram where the number of pixels is greater than a preset number threshold; when the number of pixels is greater than a preset number threshold, the number of histograms is 1 Or, when the number of histograms with a pixel number greater than a preset number threshold is 2, and the tone value intervals corresponding to the two histograms are adjacent to each other, the image is determined to be a single-tone image, otherwise, then Determine that the image is not a monotone image.
  2. 如权利要求1所述的识别单一色调影像的方法,其中,所述色调值的大小范围为0-1,设多个直方条的数量为n,每一直方条对应的色调值区间为
    Figure PCTCN2019070910-appb-100001
    其中,m为第m个直方条,h m为第m个直方条对应的色调值区间,n和m均为正整数且n>=2,m>=1。
    The method for identifying a single-tone image according to claim 1, wherein the size range of the tone value is 0-1, the number of the plurality of histogram bars is n, and the tone value interval corresponding to each histogram bar is
    Figure PCTCN2019070910-appb-100001
    Where m is the m-th histogram, h m is the tone value interval corresponding to the m-th histogram, n and m are both positive integers and n>=2, m>=1.
  3. 如权利要求1所述的识别单一色调影像的方法,其中,所述预设的数量阈值为直方条对应的像素个数占影像的总像素个数的8%。The method for identifying a single-tone image according to claim 1, wherein the preset number threshold is 8% of the total number of pixels in the image corresponding to the histogram.
  4. 如权利要求1所述的识别单一色调影像的方法,还包括步骤S4、选取像素个数最多的直方条对应的色调值区间,去除该直方条中位于该色调值区间中且饱和度大于一预设的饱和度阈值或亮度小于一预设的亮度阈值的像素,得到剩余的多个像素;The method for identifying a single-tone image according to claim 1, further comprising step S4, selecting a tone value interval corresponding to the histogram with the largest number of pixels, and removing the histogram located in the tone value interval and having a saturation greater than a preset The pixels with the set saturation threshold or brightness less than a preset brightness threshold get the remaining pixels;
    步骤S5、根据影像色温获取方法计算剩余的多个像素的色温值以获取单一色调影像的色温值。Step S5: Calculate the color temperature values of the remaining pixels according to the image color temperature acquisition method to obtain the color temperature value of the single-tone image.
  5. 如权利要求4所述的识别单一色调影像的方法,其中,所述步骤S5的具体步骤为:The method for identifying a single-tone image according to claim 4, wherein the specific steps of step S5 are:
    步骤S51、建立统计表;所述统计表包括多个参考色温及分别与多个参考色温对应的多个权重,所述多个参考色温包括预设的最小色温、预设的最大色温及多个中间色温,多个权重均为0;多个中间色温逐渐增大,且均 大于最小色温并小于最大色温;Step S51: Establish a statistical table; the statistical table includes multiple reference color temperatures and multiple weights corresponding to the multiple reference color temperatures, respectively, the multiple reference color temperatures include a preset minimum color temperature, a preset maximum color temperature, and multiple Intermediate color temperature, multiple weights are 0; multiple intermediate color temperatures gradually increase, and are all greater than the minimum color temperature and less than the maximum color temperature;
    步骤S52、提供色谱图,将色谱图中的色域空间划分为两两相连的第一区、第二区及第三区;第一区与第二区的交界线、第二区与第三区的交界线及第三区与第一区的交界线汇聚于一参考点,第一区与第二区的交界线与最大色温对应的等色温线重合,第一区与第三区的交界线与最小色温对应的等色温线重合,第二区与第三区的交界线平行于色谱图的纵坐标轴;Step S52, providing a chromatogram, dividing the color gamut space in the chromatogram into the first zone, the second zone, and the third zone connected in pairs; the boundary between the first zone and the second zone, the second zone, and the third zone The boundary line of the zone and the boundary line of the third zone and the first zone converge at a reference point. The boundary line of the first zone and the second zone coincides with the isochromatic temperature line corresponding to the maximum color temperature. The junction of the first zone and the third zone The line coincides with the equal color temperature line corresponding to the minimum color temperature, and the boundary between the second zone and the third zone is parallel to the ordinate axis of the chromatogram;
    步骤S53、选取剩余的多个像素中的一个为处理像素;将处理像素的rgb光学值转换为色谱图中处理像素的色度坐标;Step S53: Select one of the remaining pixels as the processing pixel; convert the rgb optical value of the processing pixel into the chromaticity coordinates of the processing pixel in the chromatogram;
    步骤S54、判断处理像素的色度坐标在色域空间中的位置;若处理像素的色度坐标位于第一区,则依据处理像素的色度坐标及预设的像素色温计算公式计算处理像素的色温值,判断处理像素的色温值是否为多个参考色温中的一个,若是则将统计表中与处理像素的色温值对应的权重增加1,否则将处理像素的色温值及1分别作为参考色温及其对应的权重增加至统计表中;若处理像素的色度坐标位于第二区,则依据处理像素的色度坐标所对应的点与参考点的连线和第一区与第二区的交界线间的夹角、预设的第一权重值计算公式计算处理像素的权重值,并将该权重值加入统计表中与最大色温对应的权重;若处理像素的色度坐标位于第三区,则依据处理像素的色度坐标所对应的点与参考点的连线和第一区与第三区的交界线间的夹角、预设的第二权重值计算公式计算处理像素的权重值,并将该权重值加入统计表中与最小色温对应的权重;Step S54: Determine the position of the chromaticity coordinates of the processing pixel in the color gamut space; if the chromaticity coordinates of the processing pixel are located in the first zone, then calculate the processing pixel's chromaticity coordinates according to the processing pixel and the preset pixel color temperature calculation formula Color temperature value, to determine whether the color temperature value of the processing pixel is one of multiple reference color temperatures, if it is, increase the weight corresponding to the color temperature value of the processing pixel in the statistical table by 1, otherwise the color temperature value and 1 of the processing pixel are used as the reference color temperature, respectively And their corresponding weights are added to the statistics table; if the chromaticity coordinates of the processed pixel are in the second area, the connection between the point corresponding to the chromaticity coordinates of the processed pixel and the reference point and the The angle between the boundary lines and the preset first weight value calculation formula calculate the weight value of the processed pixel, and add the weight value to the weight corresponding to the maximum color temperature in the statistical table; if the chromaticity coordinates of the processed pixel are located in the third area , Then the weight value of the processing pixel is calculated according to the angle between the connection line between the point corresponding to the chromaticity coordinates of the processing pixel and the reference point and the boundary between the first area and the third area, and the preset second weight value calculation formula , And add the weight value to the weight corresponding to the minimum color temperature in the statistical table;
    步骤S55、重复步骤S53及S54,直至剩余的多个像素均执行步骤S53及S54;Step S55. Repeat steps S53 and S54 until the remaining multiple pixels all execute steps S53 and S54;
    步骤S56、将统计表中每一参考色温与对应的权重相乘,将多个参考色温与对应的权重的乘积之和与多个参考色温对应的权重之和相除,得到单一色调影像的色温值。Step S56: Multiply each reference color temperature in the statistical table by the corresponding weight, and divide the sum of the products of multiple reference color temperatures and corresponding weights by the sum of the weights corresponding to multiple reference color temperatures to obtain the color temperature of the single-tone image value.
  6. 如权利要求5所述的识别单一色调影像的方法,其中,所述多个rgb光学值通过分别与多个像素对应的多个rgb数字值根据光学值计算公式得到,该光学值计算公式为:
    Figure PCTCN2019070910-appb-100002
    其中,R为rgb光学值 中的红色光学值,G为rgb光学值中的绿色光学值,B为rgb光学值中的蓝色光学值,r为rgb数字值中的红色数字值,g为rgb数字值中的绿色数字值,b为rgb数字值中的蓝色数字值,
    Figure PCTCN2019070910-appb-100003
    表示对r进行伽马变换处理后得到的值,
    Figure PCTCN2019070910-appb-100004
    表示对b进行伽马变换处理后得到的值,
    Figure PCTCN2019070910-appb-100005
    表示对g进行伽马变换处理后得到的值。
    The method for identifying a single-tone image according to claim 5, wherein the plurality of rgb optical values are obtained from a plurality of rgb digital values corresponding to the plurality of pixels according to an optical value calculation formula, the optical value calculation formula is:
    Figure PCTCN2019070910-appb-100002
    Where R is the red optical value in the rgb optical value, G is the green optical value in the rgb optical value, B is the blue optical value in the rgb optical value, r is the red digital value in the rgb digital value, and g is rgb The green digital value in the digital value, b is the blue digital value in the rgb digital value,
    Figure PCTCN2019070910-appb-100003
    Represents the value obtained by performing gamma transformation on r,
    Figure PCTCN2019070910-appb-100004
    Represents the value obtained by performing gamma transformation on b,
    Figure PCTCN2019070910-appb-100005
    Represents the value obtained by performing gamma transformation on g.
  7. 如权利要求6所述的识别单一色调影像的方法,其中,所述步骤S53中将处理像素的rgb光学值转换为色谱图中处理像素的色度坐标的具体过程为:根据处理像素的光学rgb值及预设的三刺激值计算公式计算处理像素的三刺激值,依据处理像素的三刺激值及预设的色度坐标计算公式计算色谱图中处理像素的色度坐标;The method for identifying a single-tone image according to claim 6, wherein the specific process of converting the rgb optical value of the processing pixel into the chromaticity coordinates of the processing pixel in the chromatogram in step S53 is: according to the optical rgb of the processing pixel The value and the preset tristimulus value calculation formula calculate the tristimulus value of the processing pixel, and the chromaticity coordinate of the processing pixel in the chromatogram is calculated according to the tristimulus value of the processing pixel and the preset chromaticity coordinate calculation formula;
    所述预设的三刺激值计算公式为:
    Figure PCTCN2019070910-appb-100006
    其中,X为三刺激值中的红色刺激值,Y为三刺激值中的绿色刺激值,Z为三刺激值中的蓝色刺激值,T为预设的转化矩阵;
    The preset formula for calculating the tristimulus value is:
    Figure PCTCN2019070910-appb-100006
    Wherein, X is the red stimulus value in the tristimulus value, Y is the green stimulus value in the tristimulus value, Z is the blue stimulus value in the tristimulus value, and T is the preset conversion matrix;
    所述预设的色度坐标公式为:
    Figure PCTCN2019070910-appb-100007
    其中,a为处理像素在色谱图中色度坐标的横坐标,b为处理像素在色谱图中色度坐标的纵坐标。
    The preset chromaticity coordinate formula is:
    Figure PCTCN2019070910-appb-100007
    Where a is the horizontal coordinate of the chromaticity coordinate of the processing pixel in the chromatogram, and b is the vertical coordinate of the chromaticity coordinate of the processing pixel in the chromatogram.
  8. 如权利要求7所述的识别单一色调影像的方法,其中,所述色谱图中第一区与第二区的交界线、第二区与第三区的交界线及第三区与第一区的交界线汇聚的参考点的坐标为(0.332,0.1858);所述预设的像素色温值计算公式为:CT=-437*s 3+3601*s 2-6861*s+5514.31,其中, CT为像素色温值,
    Figure PCTCN2019070910-appb-100008
    The method for identifying a single-tone image according to claim 7, wherein the boundary between the first and second regions, the boundary between the second and third regions, and the third and first regions in the chromatogram The coordinate of the reference point where the boundary line converges is (0.332, 0.1858); the calculation formula of the preset pixel color temperature value is: CT=-437*s 3 +3601*s 2 -6861*s+5514.31, where, CT Is the pixel color temperature value,
    Figure PCTCN2019070910-appb-100008
  9. 如权利要求5所述的识别单一色调影像的方法,其中,所述预设的第一权重值计算公式为:γ 1=1-α 11,其中,γ 1为处理像素的色度坐标位于第二区时处理像素的权重值,α 1为处理像素的色度坐标所对应的点与参考点的连线和第一区与第二区的交界线间的夹角,β 1为第一区与第二区的交界线和第二区与第三区的交界线间的夹角; The method for identifying a single-tone image according to claim 5, wherein the preset formula for calculating the first weight value is: γ 1 =1-α 11 , where γ 1 is the chromaticity of the processed pixel The weight value of the processing pixel when the coordinates are in the second zone, α 1 is the angle between the line connecting the point corresponding to the chromaticity coordinates of the processing pixel and the reference point and the boundary between the first zone and the second zone, β 1 is The angle between the boundary between the first and second areas and the boundary between the second and third areas;
    所述预设的第二权重值计算公式为:γ 2=1-α 22,其中,γ 2为处理像素的色度坐标位于第三区时处理像素的权重值,α 2为处理像素的色度坐标所对应的点与参考点的连线和第一区与第三区的交界线间的夹角,β 2为第一区与第三区的交界线和第二区域与第三区的交界线间的夹角。 The preset second weight value calculation formula is: γ 2 =1-α 22 , where γ 2 is the weight value of the processing pixel when the chromaticity coordinates of the processing pixel are located in the third zone, and α 2 is the processing The angle between the line between the point corresponding to the chromaticity coordinates of the pixel and the reference point and the boundary between the first and third regions, β 2 is the boundary between the first and third regions and the second and third regions The angle between the boundaries of the three districts.
  10. 如权利要求5所述的识别单一色调影像的方法,其中,所述色谱图为CIE1931色谱图;所述预设的最小色温为1000K;所述预设的最大色温为15000K。The method for identifying a single-tone image according to claim 5, wherein the chromatogram is a CIE1931 chromatogram; the preset minimum color temperature is 1000K; and the preset maximum color temperature is 15000K.
  11. 一种识别单一色调影像的方法,包括如下步骤:A method for identifying a single-tone image includes the following steps:
    步骤S1、提供影像的显示数据;所述影像包括多个像素,所述影像的显示数据包括分别与多个像素对应的多个rgb光学值;将多个rgb光学值转换为HSV颜色模型;Step S1: Provide image display data; the image includes a plurality of pixels, and the image display data includes a plurality of rgb optical values corresponding to the plurality of pixels; convert the plurality of rgb optical values into an HSV color model;
    步骤S2、根据HSV颜色模型中分别与多个像素对应的多个色调值形成统计直方图,该统计直方图中具有多个直方条,所述多个直方条分别对应位于不同的色调值区间的像素个数;Step S2. Form a statistical histogram according to multiple tonal values corresponding to multiple pixels in the HSV color model respectively. The statistical histogram has multiple histogram bars, and the multiple histogram bars respectively correspond to The number of pixels;
    步骤S3、根据统计直方图中像素个数大于一预设的数量阈值的直方条的数量来判断影像是否为单一色调影像;当像素个数大于一预设的数量阈值的直方条的数量为1时,或者,当像素个数大于一预设的数量阈值的直方条的数量为2,且该2个直方条分别对应的色调值区间相邻时,则判断影像为单一色调影像,否则,则判断影像不为单一色调影像;Step S3. Determine whether the image is a single-tone image according to the number of histograms in the statistical histogram where the number of pixels is greater than a preset number threshold; when the number of pixels is greater than a preset number threshold, the number of histograms is 1 Or, when the number of histograms with a pixel number greater than a preset number threshold is 2, and the tone value intervals corresponding to the two histograms are adjacent to each other, the image is determined to be a single-tone image, otherwise, then Determine that the image is not a single-tone image;
    步骤S4、选取像素个数最多的直方条对应的色调值区间,去除该直方 条中位于该色调值区间中且饱和度大于一预设的饱和度阈值或亮度小于一预设的亮度阈值的像素,得到剩余的多个像素;Step S4: Select the tone value interval corresponding to the histogram with the largest number of pixels, and remove pixels in the histogram that are in the tone value interval and have a saturation greater than a preset saturation threshold or a brightness less than a preset brightness threshold To get the remaining pixels;
    步骤S5、根据影像色温获取方法计算剩余的多个像素的色温值以获取单一色调影像的色温值;Step S5: Calculate the color temperature values of the remaining pixels according to the image color temperature acquisition method to obtain the color temperature value of the single-tone image;
    其中,所述预设的数量阈值为直方条对应的像素个数占影像的总像素个数的8%。Wherein, the preset number threshold is 8% of the total number of pixels in the image corresponding to the histogram.
  12. 如权利要求11所述的识别单一色调影像的方法,其中,所述色调值的大小范围为0-1,设多个直方条的数量为n,每一直方条对应的色调值区间为
    Figure PCTCN2019070910-appb-100009
    其中,m为第m个直方条,h m为第m个直方条对应的色调值区间,n和m均为正整数且n>=2,m>=1。
    The method for identifying a single-tone image according to claim 11, wherein the size range of the tone value is 0-1, the number of the plurality of histogram bars is n, and the tone value interval corresponding to each histogram bar is
    Figure PCTCN2019070910-appb-100009
    Where m is the m-th histogram, h m is the tone value interval corresponding to the m-th histogram, n and m are both positive integers and n>=2, m>=1.
  13. 如权利要求11所述的识别单一色调影像的方法,其中,所述步骤S5的具体步骤为:The method for identifying a single-tone image according to claim 11, wherein the specific steps of step S5 are:
    步骤S51、建立统计表;所述统计表包括多个参考色温及分别与多个参考色温对应的多个权重,所述多个参考色温包括预设的最小色温、预设的最大色温及多个中间色温,多个权重均为0;多个中间色温逐渐增大,且均大于最小色温并小于最大色温;Step S51: Establish a statistical table; the statistical table includes multiple reference color temperatures and multiple weights corresponding to the multiple reference color temperatures, respectively, the multiple reference color temperatures include a preset minimum color temperature, a preset maximum color temperature, and multiple Intermediate color temperature, multiple weights are 0; multiple intermediate color temperatures gradually increase, and are all greater than the minimum color temperature and less than the maximum color temperature;
    步骤S52、提供色谱图,将色谱图中的色域空间划分为两两相连的第一区、第二区及第三区;第一区与第二区的交界线、第二区与第三区的交界线及第三区与第一区的交界线汇聚于一参考点,第一区与第二区的交界线与最大色温对应的等色温线重合,第一区与第三区的交界线与最小色温对应的等色温线重合,第二区与第三区的交界线平行于色谱图的纵坐标轴;Step S52, providing a chromatogram, dividing the color gamut space in the chromatogram into the first zone, the second zone, and the third zone connected in pairs; the boundary between the first zone and the second zone, the second zone, and the third zone The boundary line of the zone and the boundary line of the third zone and the first zone converge at a reference point. The boundary line of the first zone and the second zone coincides with the isochromatic temperature line corresponding to the maximum color temperature. The junction of the first zone and the third zone The line coincides with the equal color temperature line corresponding to the minimum color temperature, and the boundary between the second zone and the third zone is parallel to the ordinate axis of the chromatogram;
    步骤S53、选取剩余的多个像素中的一个为处理像素;将处理像素的rgb光学值转换为色谱图中处理像素的色度坐标;Step S53: Select one of the remaining pixels as the processing pixel; convert the rgb optical value of the processing pixel into the chromaticity coordinates of the processing pixel in the chromatogram;
    步骤S54、判断处理像素的色度坐标在色域空间中的位置;若处理像素的色度坐标位于第一区,则依据处理像素的色度坐标及预设的像素色温计算公式计算处理像素的色温值,判断处理像素的色温值是否为多个参考色温中的一个,若是则将统计表中与处理像素的色温值对应的权重增加1,否则将处理像素的色温值及1分别作为参考色温及其对应的权重增加至统计表中;若处理像素的色度坐标位于第二区,则依据处理像素的色度坐标所对应的点与参考点的连线和第一区与第二区的交界线间的夹角、预设的第一权重值计算公式计算处理像素的权重值,并将该权重值加入统计表中与最大色温对应的权重;若处理像素的色度坐标位于第三区,则依据处理像 素的色度坐标所对应的点与参考点的连线和第一区与第三区的交界线间的夹角、预设的第二权重值计算公式计算处理像素的权重值,并将该权重值加入统计表中与最小色温对应的权重;Step S54: Determine the position of the chromaticity coordinates of the processing pixel in the color gamut space; if the chromaticity coordinates of the processing pixel are located in the first zone, then calculate the processing pixel's chromaticity coordinates according to the processing pixel and the preset pixel color temperature calculation formula Color temperature value, to determine whether the color temperature value of the processing pixel is one of multiple reference color temperatures, if it is, increase the weight corresponding to the color temperature value of the processing pixel in the statistical table by 1, otherwise the color temperature value and 1 of the processing pixel are used as the reference color temperature, respectively And their corresponding weights are added to the statistics table; if the chromaticity coordinates of the processed pixel are in the second area, the connection between the point corresponding to the chromaticity coordinates of the processed pixel and the reference point and the The angle between the boundary lines and the preset first weight value calculation formula calculate the weight value of the processed pixel, and add the weight value to the weight corresponding to the maximum color temperature in the statistical table; if the chromaticity coordinates of the processed pixel are located in the third area , Then the weight value of the processing pixel is calculated according to the angle between the connection line between the point corresponding to the chromaticity coordinates of the processing pixel and the reference point and the boundary between the first area and the third area, and the preset second weight value calculation formula , And add the weight value to the weight corresponding to the minimum color temperature in the statistical table;
    步骤S55、重复步骤S53及S54,直至剩余的多个像素均执行步骤S53及S54;Step S55. Repeat steps S53 and S54 until the remaining multiple pixels all execute steps S53 and S54;
    步骤S56、将统计表中每一参考色温与对应的权重相乘,将多个参考色温与对应的权重的乘积之和与多个参考色温对应的权重之和相除,得到单一色调影像的色温值。Step S56: Multiply each reference color temperature in the statistical table by the corresponding weight, and divide the sum of the products of multiple reference color temperatures and corresponding weights by the sum of the weights corresponding to multiple reference color temperatures to obtain the color temperature of the single-tone image value.
  14. 如权利要求13所述的识别单一色调影像的方法,其中,所述多个rgb光学值通过分别与多个像素对应的多个rgb数字值根据光学值计算公式得到,该光学值计算公式为:
    Figure PCTCN2019070910-appb-100010
    其中,R为rgb光学值中的红色光学值,G为rgb光学值中的绿色光学值,B为rgb光学值中的蓝色光学值,r为rgb数字值中的红色数字值,g为rgb数字值中的绿色数字值,b为rgb数字值中的蓝色数字值,
    Figure PCTCN2019070910-appb-100011
    表示对r进行伽马变换处理后得到的值,
    Figure PCTCN2019070910-appb-100012
    表示对b进行伽马变换处理后得到的值,
    Figure PCTCN2019070910-appb-100013
    表示对g进行伽马变换处理后得到的值。
    The method for identifying a single-tone image according to claim 13, wherein the plurality of rgb optical values are obtained from a plurality of rgb digital values respectively corresponding to the plurality of pixels according to an optical value calculation formula, and the optical value calculation formula is:
    Figure PCTCN2019070910-appb-100010
    Where R is the red optical value in the rgb optical value, G is the green optical value in the rgb optical value, B is the blue optical value in the rgb optical value, r is the red digital value in the rgb digital value, and g is rgb The green digital value in the digital value, b is the blue digital value in the rgb digital value,
    Figure PCTCN2019070910-appb-100011
    Represents the value obtained by performing gamma transformation on r,
    Figure PCTCN2019070910-appb-100012
    Represents the value obtained by performing gamma transformation on b,
    Figure PCTCN2019070910-appb-100013
    Represents the value obtained by performing gamma transformation on g.
  15. 如权利要求14所述的识别单一色调影像的方法,其中,所述步骤S53中将处理像素的rgb光学值转换为色谱图中处理像素的色度坐标的具体过程为:根据处理像素的光学rgb值及预设的三刺激值计算公式计算处理像素的三刺激值,依据处理像素的三刺激值及预设的色度坐标计算公式计算色谱图中处理像素的色度坐标;The method of identifying a single-tone image according to claim 14, wherein the specific process of converting the rgb optical value of the processing pixel into the chromaticity coordinates of the processing pixel in the chromatogram in the step S53 is: according to the optical rgb of the processing pixel The value and the preset tristimulus value calculation formula calculate the tristimulus value of the processing pixel, and the chromaticity coordinate of the processing pixel in the chromatogram is calculated according to the tristimulus value of the processing pixel and the preset chromaticity coordinate calculation formula;
    所述预设的三刺激值计算公式为:
    Figure PCTCN2019070910-appb-100014
    其中,X为三刺激值中的红色刺激值,Y为三刺激值中的绿色刺激值,Z为三刺激值中的蓝色刺激值,T为预设的转化矩阵;
    The preset formula for calculating the tristimulus value is:
    Figure PCTCN2019070910-appb-100014
    Wherein, X is the red stimulus value in the tristimulus value, Y is the green stimulus value in the tristimulus value, Z is the blue stimulus value in the tristimulus value, and T is the preset conversion matrix;
    所述预设的色度坐标公式为:
    Figure PCTCN2019070910-appb-100015
    其中,a为处理像素在色谱图中色度坐标的横坐标,b为处理像素在色谱图中色度坐标的纵坐标。
    The preset chromaticity coordinate formula is:
    Figure PCTCN2019070910-appb-100015
    Where a is the horizontal coordinate of the chromaticity coordinate of the processing pixel in the chromatogram, and b is the vertical coordinate of the chromaticity coordinate of the processing pixel in the chromatogram.
PCT/CN2019/070910 2018-11-30 2019-01-08 Method for recognizing single-tone image WO2020107660A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811458986.1 2018-11-30
CN201811458986.1A CN109600606B (en) 2018-11-30 2018-11-30 Method for identifying single tone image

Publications (1)

Publication Number Publication Date
WO2020107660A1 true WO2020107660A1 (en) 2020-06-04

Family

ID=65960049

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/070910 WO2020107660A1 (en) 2018-11-30 2019-01-08 Method for recognizing single-tone image

Country Status (2)

Country Link
CN (1) CN109600606B (en)
WO (1) WO2020107660A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102890924A (en) * 2011-07-21 2013-01-23 晨星软件研发(深圳)有限公司 Method for correcting color of panel and related correction module
CN106791758A (en) * 2016-12-07 2017-05-31 浙江大华技术股份有限公司 The determination methods and device of natural light mixing colour temperature in a kind of image
CN107563986A (en) * 2017-09-08 2018-01-09 北京进化者机器人科技有限公司 The determination methods and system of image-region
CN108769634A (en) * 2018-07-06 2018-11-06 Oppo(重庆)智能科技有限公司 A kind of image processing method, image processing apparatus and terminal device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104469334B (en) * 2014-12-10 2016-08-17 深圳市理邦精密仪器股份有限公司 A kind of Medical Devices obtain the processing method and processing device of view data
CN105631902B (en) * 2015-12-21 2018-09-04 小米科技有限责任公司 Image unicity analysis method and device
CN107465881B (en) * 2017-09-30 2020-06-26 努比亚技术有限公司 Dual-camera focusing method, mobile terminal and computer readable storage medium
CN108307125B (en) * 2018-02-08 2021-10-08 腾讯科技(深圳)有限公司 Image acquisition method, device and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102890924A (en) * 2011-07-21 2013-01-23 晨星软件研发(深圳)有限公司 Method for correcting color of panel and related correction module
CN106791758A (en) * 2016-12-07 2017-05-31 浙江大华技术股份有限公司 The determination methods and device of natural light mixing colour temperature in a kind of image
CN107563986A (en) * 2017-09-08 2018-01-09 北京进化者机器人科技有限公司 The determination methods and system of image-region
CN108769634A (en) * 2018-07-06 2018-11-06 Oppo(重庆)智能科技有限公司 A kind of image processing method, image processing apparatus and terminal device

Also Published As

Publication number Publication date
CN109600606B (en) 2019-12-27
CN109600606A (en) 2019-04-09

Similar Documents

Publication Publication Date Title
US10878762B2 (en) Luminance compensating method, luminance compensating device, display device and storage medium
US9613553B2 (en) Method and device for detecting uniformity of a dark state image of display
WO2017143635A1 (en) Method and system for reducing power consumption of display panel
WO2017166346A1 (en) Method for eliminating oled display panel mura
WO2021218405A1 (en) Method for improving picture display quality, and timing controller and display apparatus
KR102265776B1 (en) brightness control system
CN109493829B (en) Method for acquiring color temperature of image
WO2017166347A1 (en) Method for eliminating oled display panel mura
US20170301275A1 (en) Display devices capable of adjusting the display color gamut and methods of adjusting the color gamut thereof
KR102022812B1 (en) Image Contrast Reinforcement
WO2020224387A1 (en) Drive method, drive apparatus, display device, and computer-readable medium
WO2017045218A1 (en) Adaptive conversion method for image
WO2020094006A1 (en) Display device and driving method therefor, and driving apparatus and computer-readable medium
US10347198B2 (en) Image displaying methods and display devices
WO2015096366A1 (en) Signal conversion device and method, and display device
WO2019061849A1 (en) Brightness adjustment method and brightness adjustment device for display panel
WO2020107661A1 (en) Image color temperature acquisition method
WO2020253053A1 (en) Color enhancement method employing image saliency, and image processing apparatus
WO2017201789A1 (en) Graphene display, and drive method and drive device for graphene display
JP6593899B2 (en) Method and system for improving contrast ratio of OLED display panel
WO2020000477A1 (en) Color gamut correction method and apparatus
US10621930B2 (en) Image processing method and image processing device for reducing color shift
WO2017173682A1 (en) Driving method for graphene display and graphene display
WO2020107660A1 (en) Method for recognizing single-tone image
WO2019127874A1 (en) Driving method for amoled display panel, and related product

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: 19890827

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: 19890827

Country of ref document: EP

Kind code of ref document: A1