CN106657960A - Color space conversion method - Google Patents

Color space conversion method Download PDF

Info

Publication number
CN106657960A
CN106657960A CN201610874941.7A CN201610874941A CN106657960A CN 106657960 A CN106657960 A CN 106657960A CN 201610874941 A CN201610874941 A CN 201610874941A CN 106657960 A CN106657960 A CN 106657960A
Authority
CN
China
Prior art keywords
new
values
component
coefficient
color space
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN201610874941.7A
Other languages
Chinese (zh)
Other versions
CN106657960B (en
Inventor
郭颖瑜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chipone Technology Beijing Co Ltd
Original Assignee
Chipone Technology Beijing Co Ltd
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 Chipone Technology Beijing Co Ltd filed Critical Chipone Technology Beijing Co Ltd
Priority to CN201610874941.7A priority Critical patent/CN106657960B/en
Publication of CN106657960A publication Critical patent/CN106657960A/en
Application granted granted Critical
Publication of CN106657960B publication Critical patent/CN106657960B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Processing Of Color Television Signals (AREA)
  • Image Processing (AREA)

Abstract

The invention relates to a color space conversion method. The color space conversion method is suitable for converting a first component, a second component and a third component of a first color space into a fourth component, a fifth component and a sixth component of a second color space. The color space conversion method comprises the following steps that: (a) nine new coefficients and three new parameters which are dyadic rationals are selected; (b) the new fourth component, the new fifth component and the new sixth component are obtained according to the first component, the second component, the third component, the nine new coefficients and the three new parameters; and (c) the nine new coefficients and the three new parameters are simplified through reduction of fractions to a common denominator, so that a logic circuit unit can calculate the new fourth component, the new fifth component and the new sixth component by using a plurality of adders and a plurality of selectors without using a multiplier.

Description

Color space changover method
Technical field
The invention relates to a kind of color space changover method, particularly relates to one kind and applies in drive integrated circult (Driver IC) touch-control integrated circuit (Touch IC) can save chip area with the calculation time and in three primary colors (RGB) color Space and component aberration (YCbCr) color space make between the two the color space changover method changed.
Prior art
Traditionally, when dealing with to image, meeting first will be in R values, the G of three primary colors (RGB) color space (Domain) Value and B values are first converted into remaking computing in the Y value of component aberration (YCbCr) color space, Cb values and Cr values.Treat that computing is completed Afterwards, then by the new Y value after the computing of component aberration (YCbCr) color space institute, new Cb values and new Cr values convert back in three primary colors (RGB) the new R values of color space, new G values and new B values.
R values, G values and B values are converted into the relational expression of Y value, Cb values and Cr values respectively such as formula (1), public affairs by prior art Shown in formula (2) and formula (3).Wherein, the scope of R values, G values and B values be all integer between 0 to 255 (comprising 0 and 255), the scope of Y value is the integer (comprising 16 and 235) between 16 to 235, and Cb values and Cr values are all between 16 to 240 Between integer (include 16 and 240).
Y value=0.257*R values+0.504*G values+0.098*B values+16... formula (1)
Cb values=- 0.148*R values -0.291*G values+0.439*B values+128... formula (2)
Cr values=0.439*R values -0.368*G values -0.071*B values+128... formula (3)
And prior art by Y value, Cb values and Cr values be converted into the relational expression of R values, G values and B values respectively as formula (4), Shown in formula (5) and formula (6).Wherein, the scope of R values, G values and B values is also all that integer between 0 to 255 (is included 0 and 255).
R values=1.164*Y values+1.596*Cr values -222.921... formula (4)
G values=1.164*Y values -0.392*Cb values -0.813*Cr values+135.576. formula (5)
B values=1.164*Y values+2.017*Cb values -276.836... formula (6)
From formula (1) to (6), whether will be converted into dividing in the R values of three primary colors color space, G values and B values Y value, Cb values and the Cr values of aberration color space are measured, or will be in the conversion of the Y value of component colour dyeing color space, Cb values and Cr values Into the R values in three primary colors color space, G values and B values, when realizing with the hardware of logic circuit, it is required for using multiplier, And then cause the calculating time of hardware to increase or the shared on the integrated area of hardware becomes big, and become one it is to be solved Problem.
The content of the invention
Therefore, the purpose of the present invention, that is, providing a kind of color space conversion side for saving chip area and calculation time Method.
Then, color space changover method of the present invention, it is adaptable to by the first component of the first color space, second component, And three-component is converted into the 4th component, the 5th component and the 6th component of the second color space.Define the 4th component to be equal to First component, second component and three-component are multiplied by respectively the first coefficient, the second coefficient and the 3rd coefficient and the first parameter Summation.Define the 5th component equal to the first component, second component and three-component be multiplied by respectively the 4th coefficient, the 5th coefficient, And the 6th coefficient and the second parameter summation.The 6th component is defined equal to the first component, second component and three-component difference It is multiplied by the summation of the 7th coefficient, the 8th coefficient and the 9th coefficient and the 3rd parameter.The color space changover method is patrolled by one Collect circuit unit to implement, and comprising step (a)~(c).
(a) select respectively the first coefficient, the second coefficient, the 3rd coefficient, the 4th coefficient, the 5th coefficient, the 6th coefficient, the 7th It is new first coefficient of coefficient, the 8th coefficient, the 9th coefficient, the first parameter, the second parameter and the 3rd parameter, new second coefficient, new It is 3rd coefficient, new 4th coefficient, new 5th coefficient, new 6th coefficient, new 7th coefficient, new 8th coefficient, new 9th coefficient, new First parameter, new second parameter and new 3rd parameter, wherein, new first coefficient is to new 9th coefficient, and new first ginseng The absolute value of number to new 3rd parameter and the difference of its initial value is less than 0.005, and new first coefficient is to new 9th coefficient, and New first parameter to new 3rd parameter is a kind of dyadic rational.
B () obtains new 4th component, new 5th component and new 6th component.New 4th component be equal to the first component, the It is total with new first parameter that two components and three-component are multiplied by respectively new first coefficient, new second coefficient and New-regionalism architecture number With.New 5th component equal to the first component, second component and three-component be multiplied by respectively new 4th coefficient, new 5th coefficient, And the summation of new 6th coefficient and new second parameter.New 6th component is equal to the first component, second component and three-component point It is not multiplied by the summation of new 7th coefficient, new 8th coefficient and new 9th coefficient and new 3rd parameter.
C () is by new first coefficient to New-regionalism architecture number and new first parameter, new 4th coefficient to new 6th coefficient and new Two parameters and new 7th coefficient distinguish reduction of fractions to a common denominator abbreviation to new 9th coefficient with new 3rd parameter so that the logic circuit unit makes With multiple adders and multiple selectors, and do not use multiplier and calculate new 4th component, new 5th component and new 6th point Amount.
In certain embodiments, the first color space is three primary colors (RGB) color space, and the first component is to the three-component Respectively R values, G values and B values.Second color space is component aberration (YCbCr) color space, and the 4th component is to the 6th component Respectively Y value, Cb values and Cr values.First coefficient to the 9th coefficient is respectively 0.257,0.504,0.098, -0.148, - 0.291st, 0.439,0.439, -0.368 and -0.071, the first parameter to the 3rd parameter is respectively 16,128 and 128.Wherein, In step (a), new first coefficient to new 9th coefficient is respectively 0.2578125,0.5,0.09375, -0.1484375, - 0.2890625th, 0.4375,0.4375, -0.3671875 and -0.0703125, new first parameter to new 3rd parameter is respectively 16th, 128 and 128.
In certain embodiments, wherein, in step (c), define new 4th component, new 5th component and new 6th point Amount is respectively new Y value, new Cb values and new Cr values,
New Y value=(R values<<5+R values+G is worth<<6+B values<<3+B values<<2)>>7+16,
New Cb values=(B values<<6-B values<<3-G values<<5-G values<<2-G values-R is worth<<4-R values<<1-R values)>>7+128,
New Cr values=(R values<<6-R values<<3-G values<<6+G values<<4+G values-B is worth<<3-B values)>>7+128.
In certain embodiments, the first component to three-component scope between 0 to 255, the scope of the 4th component Between 16 to 235, the scope of the 5th component and the 6th component is between 16 to 240.Wherein, in step (b) and (c) In, the scope of new 4th component between 16 to 235, the scope of new 5th component and new 6th component between 16 to 240 it Between.
In further embodiments, the first color space be component aberration (YCbCr) color space, the first component to the 3rd Component is respectively Y value, Cb values and Cr values.Second color space is three primary colors (RGB) color space, and the 4th component is to the 6th point Amount is respectively R values, G values and B values.First coefficient to the 9th coefficient is respectively 1.164,0,1.596,1.164, -0.392, - 0.813rd, 1.164,2.017 and 0, the first parameter to the 3rd parameter is respectively -222.921,135.576 and -276.836.Its In, in step (a), new first coefficient to new 9th coefficient is respectively 1.1640625,0,1.59375,1.1640625 ,- 0.390625th, -0.8125,1.1640625,2.015625 and 0, new first parameter to new 3rd parameter be respectively - 222.921875th, 135.578125 and -276.8359375.
In certain embodiments, wherein, in step (c), define new 4th component, new 5th component and new 6th point Amount is respectively new R values, new G values and new B values,
New R values=Y value+(Y value<<4+Y values<<2+Y values)>>7+Cr value -222+ (Cr values<<6+Cr values<<3+Cr values<<2-118)> >7,
New G values=Y value+(Y value<<4+Y values<<2+Y values)>>7+135- (Cb values<<5+Cb values<<4+Cb values<<2+Cr values<<6+Cr Value<<5+Cr values<<3)>>7,
New B values=Y value+(Y value<<4+Y values<<2+Y values)>>7+Cb values<<1+ (Cb values<<1-107)>>7-276.
In certain embodiments, the scope of the first component is between 16 to 235, second component and three-component scope Between 16 to 240, the scope of the 4th component to the 6th component is between 0 to 255.Wherein, in step (b) and (c), The scope of new 4th component to new 6th component is between 0 to 255.
The present invention at least has following effect:It is to the new 9th by new first coefficient for selecting to belong to dyadic rational Number, and new first parameter is to new 3rd parameter, to obtain new 4th component to new 6th component, and by by new first coefficient extremely New 9th coefficient distinguishes reduction of fractions to a common denominator abbreviation with new first parameter to new 3rd parameter respectively so that logic circuit unit is added using multiple Musical instruments used in a Buddhist or Taoist mass and multiple selectors, and do not use multiplier and calculate new 4th component to new 6th component, to save logic circuit list The hardware usable floor area of unit and calculation time.
Description of the drawings
Other features and effect of the present invention, will clearly be presented in the embodiment with reference to schema, wherein:
Fig. 1 is a flow chart, the step of illustrate one embodiment of color space changover method of the present invention;
Fig. 2 is a circuit diagram, illustrates the computing circuit of the new Y value of embodiment;
Fig. 3 is a circuit diagram, illustrates the computing circuit of the new Cb values of embodiment;And
Fig. 4 is a circuit diagram, illustrates the computing circuit of the new Cr values of embodiment.
Reference numeral explanation
S1~S3 ... steps
R[7:0] ... R values
G[7:0] ... G values
B[7:0] ... B values
The new Y values of Y ...
The new Cb values of Cb ...
The new Cr values of Cr ...
Y_tmp[15:0] ... median
Cb_tmp[15:0] ... median
Cr_tmp[15:0] ... median
51~55 ... adders
61~65 ... adders
71~79 ... buffers
81~84 ... adders
91~93 ... registers
R[7:0], 5'b0 ... R values<<5 computing
R[7:0], 4'b0 ... R values<<4 computing
R[7:0], 1'b0 ... R values<<1 computing
G[7:0], 6'b0 ... G values<<6 computing
G[7:0], 2'b0 ... G values<<2 computing
G[7:0], 5'b0 ... G values<<5 computing
B[7:0], 2'b0 ... B values<<2 computing
B[7:0], 3'b0 ... B values<<3 computing
B[7:0], 6'b0 ... B values<<6 computing
8'd16 ... does add operation with 16
8'd128 ... does add operation with 128
Specific embodiment
Before the present invention is described in detail, it shall be noted that in the following description content, similar component is with identical Numbering representing.
Refering to Fig. 1, one embodiment of color space changover method of the present invention, it is adaptable to by the first of the first color space Component, second component and three-component are converted into the 4th component, the 5th component and the 6th component of the second color space.Definition 4th component is multiplied by respectively the first coefficient, the second coefficient and the 3rd coefficient equal to the first component, second component and three-component With the summation of the first parameter.Define the 5th component and be multiplied by the 4th respectively equal to the first component, second component and three-component and be The summation of number, the 5th coefficient and the 6th coefficient and the second parameter.The 6th component is defined equal to the first component, second component and the Three-component is multiplied by respectively the summation of the 7th coefficient, the 8th coefficient and the 9th coefficient and the 3rd parameter.
More specifically, when the first color space is three primary colors (RGB) color space, and the second color space is component colour During difference (YCbCr) color space, the first component to three-component is respectively R values, G values and B values, and the 4th component to the 6th point Amount is respectively Y value, Cb values and Cr values.First coefficient to the 9th coefficient is respectively 0.257,0.504,0.098, -0.148, - 0.291st, 0.439,0.439, -0.368 and -0.071, the first parameter to the 3rd parameter is respectively 16,128 and 128, its relation Formula respectively such as following formula (1)~(3), wherein, the first component to three-component, i.e., the scope of R values, G values and B values is between 0 To between 255, the scope of the 4th component, i.e. Y value between 16 to 235, the 5th component and the 6th component, i.e. Cb values and Cr values Scope between 16 to 240.
Y value=0.257*R values+0.504*G values+0.098*B values+16... formula (1)
Cb values=- 0.148*R values -0.291*G values+0.439*B values+128... formula (2)
Cr values=0.439*R values -0.368*G values -0.071*B values+128... formula (3)
Conversely, when the first color space is component aberration (YCbCr) color space, and the second color space is three primary colors (RGB) during color space, the first component to three-component is respectively Y value, Cb values and Cr values, and the 4th component to the 6th component Respectively R values, G values and B values.First coefficient to the 9th coefficient is respectively 1.164,0,1.596,1.164, -0.392, - 0.813rd, 1.164,2.017 and 0, the first parameter to the 3rd parameter is respectively -222.921,135.576 and -276.836, its Relational expression respectively such as following formula (4)~(6), wherein, the scope of the first component, i.e. Y value between 16 to 235, second Component and three-component, the i.e. scope of Cb values and Cr values between 16 to 240, the 4th component to the 6th component, i.e. R values, G The scope of value and B values is between 0 to 255.In addition, what is especially remarked additionally is:In the present embodiment, formula (4)~ (6) last term coefficient is respectively -222.921,135.576 and -276.836, and in other embodiments, due to calculating During retain the difference of decimal number of words, last term coefficients of formula (4)~(6) can also be respectively -222.912, 135.488 and -276.928, it is not subject to the limits.
R values=1.164*Y values+1.596*Cr values -222.921... formula (4)
G values=1.164*Y values -0.392*Cb values -0.813*Cr values+135.576. formula (5)
B values=1.164*Y values+2.017*Cb values -276.836... formula (6)
Color space changover method is implemented by logic circuit unit, and comprising S1~S3.
In step S1, the first coefficient, the second coefficient, the 3rd coefficient, the 4th coefficient, the 5th coefficient, the 6th is selected to be respectively Number, new first coefficient of the 7th coefficient, the 8th coefficient, the 9th coefficient, the first parameter, the second parameter and the 3rd parameter, new second Coefficient, New-regionalism architecture number, new 4th coefficient, new 5th coefficient, new 6th coefficient, new 7th coefficient, new 8th coefficient, the new 9th Coefficient, new first parameter, new second parameter and new 3rd parameter.Wherein, new first coefficient is to new 9th coefficient, and is somebody's turn to do The absolute value of new first parameter to new 3rd parameter and the difference of its initial value is less than 0.005, and new first coefficient is to the new 9th Coefficient, and new first parameter is a kind of dyadic rational to new 3rd parameter.In more detail, dyadic rational refers to one ten The numerical value of system is can be equal to a/2 during binary representationb, wherein, a is integer, and b is natural number.
More specifically, when the first color space is three primary colors (RGB) color space, and the second color space is component colour During difference (YCbCr) color space, new first coefficient to new 9th coefficient is respectively 0.2578125,0.5,0.09375 ,- 0.1484375th, -0.2890625,0.4375,0.4375, -0.3671875 and -0.0703125, new first parameter to the new 3rd Parameter is respectively 16,128 and 128.
Conversely, when the first color space is component aberration (YCbCr) color space, and the second color space is three primary colors (RGB) during color space, new first coefficient to new 9th coefficient is respectively 1.1640625,0,1.59375,1.1640625 ,- 0.390625th, -0.8125,1.1640625,2.015625 and 0, new first parameter to new 3rd parameter be respectively - 222.921875th, 135.578125 and -276.8359375.
In step S2, new 4th component, new 5th component and new 6th component are obtained.New 4th component is equal to first point Amount, second component and three-component are multiplied by respectively new first coefficient, new second coefficient and New-regionalism architecture number and new first parameter Summation.New 5th component is multiplied by respectively new 4th coefficient, the new 5th is equal to the first component, second component and three-component The summation of number and new 6th coefficient and new second parameter.New 6th component is equal to the first component, second component and three-component The summation of new 7th coefficient, new 8th coefficient and new 9th coefficient and new 3rd parameter is multiplied by respectively.
More specifically, when the first color space is three primary colors (RGB) color space, and the second color space is component colour During difference (YCbCr) color space, define new 4th component to new 6th component and be respectively new Y value, new Cb values and new Cr values, its Relational expression respectively such as following formula (7)~(9), wherein, the scope of new 4th component between 16 to 235, new 5th point The scope of amount and new 6th component is between 16 to 240.
New Y value=0.2578125*R values+0.5*G value+0.09375*B are worth+16. formula (7)
New Cb values=- 0.1484375*R values -0.2890625*G values+0.4375*B values+128... formula (8)
New Cr values=0.4375*R values -0.3671875*G values -0.0703125*B values+128... formula (9)
Conversely, when the first color space is component aberration (YCbCr) color space, and the second color space is three primary colors (RGB) during color space, define new 4th component to new 6th component and be respectively new R values, new G values and new B values, its relational expression Respectively such as following formula (10)~(12), wherein, the scope of new 4th component to new 6th component is between 0 to 255.
New R values=1.1640625*Y values+1.59375*Cr values -222.921875...... formula (10)
New G values=1.1640625*Y values -0.390625*Cb values -0.8125*Cr values+135.578125... formula (11)
New B values=1.1640625*Y values+2.015625*Cb values -276.8359375... formula (12)
In step S3, by new first coefficient to New-regionalism architecture number with new first parameter, new 4th coefficient to new 6th coefficient Distinguish reduction of fractions to a common denominator abbreviation with new 3rd parameter to new 9th coefficient with new second parameter and new 7th coefficient so that logic circuit list Unit is not used multiplier and is calculated new 4th component, new 5th component and new the using multiple adders and multiple selectors Six components.
More specifically, when the first color space is three primary colors (RGB) color space, and the second color space is component colour During difference (YCbCr) color space, following reduction of fractions to a common denominator abbreviation is made respectively in formula (7)~(9), to obtain formula (13)~(15).Its In, ">>" represent and make shift operation, such as>>2 is 2 positions of right shift, similarly, "<<" it is also that shift operation is made in expression, such as<< 3 is 3 positions of shifted left.
New Y value=0.2578125*R values+0.5*G value+0.09375*B are worth+16. formula (7)
=(33/128*R values)+(64/128*G values)+(12/128*B values)+16
=(33*R values+64*G value+12*B values)/128+16
=(32*R values+R value+64*G value+8*B value+4*B values)/128+16
=(R values<<5+R values+G is worth<<6+B values<<3+B values<<2)>>7+16...... formula (13)
New Cb values=- 0.1484375*R values -0.2890625*G values+0.4375*B values+128... formula (8)
=-(19/128*R value)-(37/128*G values)+(56/128*B values)+128
=(56*B values -37*G value -19*R values)/128+128
=(32*B values+16*B value+8*B value -32*G value -4*G value-G value -16*R value -2*R value-R values)/128+128
=(B values<<5+B values<<4+B values<<3-G values<<5-G values<<2-G values-R is worth<<4-R values<<1-R values)>>7+128
=(B values<<6-B values<<3-G values<<5-G values<<2-G values-R is worth<<4-R values<<1-R values)>>7+128... formula (14)
New Cr values=0.4375*R values -0.3671875*G values -0.0703125*B values+128... formula (9)
=(56/128*R values)-(47/128*G values)-(9/128*B values)+128
=(56*R values -47*G value -9*B values)/128+128
=(32*R values+16*R value+8*R value -32*G value -8*G value -4*G value -2*G value-G value -8*B value-B values)/128+128
=(R values<<5+R values<<4+R values<<3-G values<<5-G values<<3-G values<<2-G values<<1-G values-B is worth<<3-B values)>>7+ 128
=(R values<<6-R values<<3-G values<<6+G values<<4+G values-B is worth<<3-B values)>>7+128... formula (15)
Referring again to Fig. 2, Fig. 2 is a circuit diagram, with the R values of 8, G values and B values, exemplarily illustrates embodiment How the formula (13) of new Y value is realized by the computing circuit of hardware.Buffer 71 receives R values (R [7:0] after), first is produced Output valve, i.e. R [7:, and the second output valve, i.e. R [7 0]:0], 5'b0, to adder (Full Adder;FA) 81 it is added, its In, R [7:0], 5'b0 is exactly to make R values<<5 computing.Buffer 72 receives G values (G [7:0] after), the 3rd output valve, i.e. G are produced [7:0], 6'b0, exactly makees G values<<6 computing, and export to adder 83.Buffer 73 receives B values (B [7:0] after), produce 4th output valve, i.e. B [7:0], 3'b0, and the 5th output valve, i.e. B [7:0], 2'b0, is added to adder 82, wherein, B [7:0], 3'b0 is exactly to make B values<<3 computing, B [7:0], 2'b0 is exactly to make B values<<2 computing.Adder 83 is by buffer 72 The 3rd output valve be added again with the addition result of adder 81,82, produce the 6th output valve, i.e. Y_tmp [15:0], that is, Make (R values<<5+R values+G is worth<<6+B values<<3+B values<<2) computing.Register 91 receives the 6th output valve and to produce the 7th defeated Go out value, i.e. Y_tmp [15:7], that is, make (R values<<5+R values+G is worth<<6+B values<<3+B values<<2)>>7 computing.Adder 84 are added the 7th output valve with 8'd16, that is, make (R values<<5+R values+G is worth<<6+B values<<3+B values<<2)>>The fortune of 7+16 Calculate, and then produce new Y value.Similar with the explanation of Fig. 2 referring again to Fig. 3 and Fig. 4, Fig. 3 exemplarily illustrates the Cb values of embodiment Formula (14) is how by buffer 74~76, adder 61~65 and register 92 realizing.And Fig. 4 is exemplarily illustrated The formula (15) of the Cr values of embodiment is how by buffer 77~79, adder 51~55 and register 93 realizing.
Conversely, when the first color space is component aberration (YCbCr) color space, and the second color space is three primary colors (RGB) during color space, following reduction of fractions to a common denominator abbreviation is made respectively in formula (10)~(12), to obtain formula (16)~(18).Wherein, Define Yt values=Y value+(Y value<<4+Y values<<2+Y values)>>7
New R values=1.1640625*Y values+1.59375*Cr values -222.921875...... formula (10)
=(149/128) * Y values+(204/128) * Cr value -222- (118/128)
=(149*Y values+204*Cr values -118)/128-222
=(128*Y values+16*Y value+4*Y value+Y values+128*Cr value+64*Cr value+8*Cr value+4*Cr values -118)/128-222
=Y value+Cr value -222+ (16*Y value+4*Y value+Y values+64*Cr value+8*Cr value+4*Cr values -118)/128
=Y value+(Y value<<4+Y values<<2+Y values)>>7+Cr value -222+ (Cr values<<6+Cr values<<3+Cr values<<2-118)>>7
=Yt values+Cr is worth -222+ (Cr values<<6+Cr values<<3+Cr values<<2-118)>>7... formula (16)
New G values=1.1640625*Y values -0.390625*Cb values -0.8125*Cr values+135.578125... formula (11)
=(149/128) * Y values-(50/128) * Cb values-(104/128) * Cr value+135+ (74/128)
=(149*Y values -50*Cb value -104*Cr values+74)/128+135
=(128*Y values+16*Y value+4*Y value+Y values -32*Cb value -16*Cb value -2*Cb value -64*Cr value -32*Cr value -8*Cr values +74)/128+135
=Y value+135+ (16*Y value+4*Y value+Y values -32*Cb value -16*Cb value -2*Cb value -64*Cr value -32*Cr value -8*Cr values +74)/128
=Y value+135+ (Y values<<4+Y values<<2+Y values-Cb is worth<<5-Cb values<<4-Cb values<<2-Cr values<<6-Cr values<<5-Cr values <<3)>>7
=Yt value+135- (Cb values<<5+Cb values<<4+Cb values<<2+Cr values<<6+Cr values<<5+Cr values<<3)>>7... formula (17)
New B values=1.1640625*Y values+2.015625*Cb values -276.8359375... formula (12)
=(149/128) * Y values+(258/128) * Cb value -276- (107/128)
=(149*Y values+258*Cb values -107)/128-276
=(128*Y values+16*Y value+4*Y value+Y values+256*Cb value+2*Cb values -107)/128-276
=Y value+2*Cb values+(16*Y value+4*Y value+Y values+2*Cb values -107)/128-276
=Y value+Cb is worth<<1+ (Y values<<4+Y values<<2+Y values+Cb is worth<<1-107)>>7-276
=Yt values+Cb is worth<<1+ (Cb values<<1-107)>>7-276... formula (18)
Formula (1)~(6) of script are required for making the floating-point operation of multiplication, via color conversion space-wise of the present invention Formula (13)~(18) for being obtained understand, each formula only comprising "+", "-", ">>" or "<<" four kinds of oeprators, and institute Have coefficient to be all integer, that is to say, that logic circuit unit only need to make respectively using adder (Adder) and selector " + ", "-" with ">>」、「<<" logical operation and integer arithmetic, three primary colors (RGB) color space and component aberration can be realized (YCbCr) conversion between color space, and completely without using any one multiplier, and then save shared by hardware Area and calculation time.
Additionally, what is especially remarked additionally is:In the present embodiment, color conversion space-wise of the present invention is to apply driving When integrated circuit (Driver IC) and touch-control integrated circuit (Touch IC) make sharpness (Sharpness) process, elder generation is needed To be converted into making in the Y value of component colour dyeing color space, Cb values and Cr values in the R values of three primary colors color space, G values and B values Computing, then the Y value processed in component colour dyeing color space, Cb values and Cr values are converted into the new of three primary colors color space One group of R values, G values and B values.And in other embodiments, color conversion space-wise of the present invention can also be applied in any pattern Image procossing on, it is not subject to the limits to improve the sharpness of image.
In sum, from formula (1)~(6), prior art is in three primary colors (RGB) color space and component aberration (YCbCr) when color space is changed, it is required for using multiplier to make floating-point operation, and multiplier is in logic circuit unit It is to increase hardware to calculate the time or cause desired hardware area.However, by color space of the present invention conversion forwarding method institute Formula (13)~(18) of acquisition, it is only necessary to rgb value is multiplied by with particular factor or YCbCr values shift again the power side of (Shift) 2 Reach as integer arithmetic, also just therefore adder and selection can be used according to formula (13)~(18) by logic circuit unit Device, and do not use multiplier to realize that color space is changed, to save hardware area and the calculation time of logic circuit unit, therefore really In fact the purpose of the present invention can be reached.
Only as described above, only embodiments of the invention are all when limiting the scope of present invention enforcement with this It is the simple equivalence changes and modification made according to scope of the present invention patent and patent specification content, all still belongs to the present invention In the range of patent covers.

Claims (12)

1. a kind of color space changover method, it is adaptable to by the first component of the first color space, second component and three-component Be converted into the 4th component, the 5th component and the 6th component of the second color space, define the 4th component equal to the first component, Second component and three-component are multiplied by respectively the summation of the first coefficient, the second coefficient and the 3rd coefficient and the first parameter, definition 5th component is multiplied by respectively the 4th coefficient, the 5th coefficient and the 6th coefficient equal to the first component, second component and three-component With the summation of the second parameter, define the 6th component and be multiplied by the 7th respectively equal to the first component, second component and three-component and be The summation of number, the 8th coefficient and the 9th coefficient and the 3rd parameter, the color space changover method is by logic circuit unit reality Apply, and comprise the steps of:
A () selects respectively the first coefficient, the second coefficient, the 3rd coefficient, the 4th coefficient, the 5th coefficient, the 6th coefficient, the 7th to be Number, the first new coefficient of the 8th coefficient, the 9th coefficient, the first parameter, the second parameter and the 3rd parameter, the second new coefficient, The 3rd coefficient newly, the 4th new coefficient, the 5th new coefficient, the 6th new coefficient, the 7th new coefficient, the new the 8th are Several, new the 9th coefficient, the first new parameter, the second new parameter and the 3rd new parameter.And the first new coefficient is new to this The 9th coefficient, and the first new parameter is binary system rational to the 3rd new parameter;
B () obtains new the 4th component, the 5th new component and the 6th new component, the 4th new component be equal to this first Component, the second component and the three-component be multiplied by respectively the first new coefficient, the second new coefficient and this new The summation of three coefficients and the first new parameter, the 5th new component is equal to first component, the second component and the 3rd Component is multiplied by respectively the 4th new coefficient, the 5th new coefficient and the 6th new coefficient and the second new parameter Summation, the 6th new component is equal to first component, the second component and the three-component and is multiplied by this respectively and the new 7th is Number, the 8th new coefficient and the 9th new coefficient and the 3rd new parameter it is total
With;And
C () is new to this with the first new parameter, the 4th new coefficient to the 3rd new coefficient by the first new coefficient The 6th coefficient and the second new parameter and the 7th new coefficient to the 9th new coefficient and the 3rd new parameter point Other reduction of fractions to a common denominator abbreviation so that the logic circuit unit is not used multiplier and calculated using multiple adders and multiple selectors The 4th new component, the 5th new component and the 6th new component.
2. color space changover method as claimed in claim 1, the first new coefficient, and should to the 9th new coefficient The absolute value of the first new parameter to the 3rd new parameter and the difference of its initial value is less than 0.005.
3. color space changover method as claimed in claim 2, first color space is three primary colors (RGB) color space, First component is respectively R values, G values and B values to the three-component, and second color space is component aberration (YCbCr) color Space, the 4th component is respectively Y value, Cb values and Cr values to the 6th component.
4. color space changover method as claimed in claim 3, the first coefficient to the 9th coefficient is respectively 0.257, 0.504th, 0.098, -0.148, -0.291,0.439,0.439, -0.368 and -0.071, first parameter is to the 3rd parameter Respectively 16,128 and 128, wherein, in step (a), the first new coefficient to the 9th new coefficient is respectively 0.2578125th, 0.5,0.09375, -0.1484375, -0.2890625,0.4375,0.4375, -0.3671875 and - 0.0703125, the first new parameter to the 3rd new parameter is respectively 16,128 and 128.
5. color space changover method as claimed in claim 4, wherein, in step (c), define the 4th new component, should New the 5th component and the 6th new component is respectively new Y value, new Cb values and new Cr values,
New Y value=(R values<<5+R values+G is worth<<6+B values<<3+B values<<2)>>7+16,
New Cb values=(B values<<6-B values<<3-G values<<5-G values<<2-G values-R is worth<<4-R values<<1-R values)>>7+128,
New Cr values=(R values<<6-R values<<3-G values<<6+G values<<4+G values-B is worth<<3-B values)>>7+128.
6. color space changover method as claimed in claim 5, first component to the three-component scope between 0 to Between 255, the scope of the 4th component between 16 to 235, the scope of the 5th component and the 6th component between 16 to Between 240, wherein, in step (b) and (c), between 16 to 235, this new 5th for the scope of the 4th new component The scope of component and the 6th new component is between 16 to 240.
7. color space changover method as claimed in claim 6, the first color space is that component aberration (YCbCr) color is empty Between, the first component to three-component is respectively Y value, Cb values and Cr values, and the second color space is three primary colors (RGB) color space, 4th component is respectively R values, G values and B values to the 6th component.
8. color space changover method as claimed in claim 7, first coefficient to the 9th coefficient is respectively 1.164,0, 1.596th, 1.164, -0.392, -0.813,1.164,2.017 and 0, the first parameter to the 3rd parameter respectively -222.921, 135.576 and -276.836, wherein, in step (a), the first new coefficient is respectively to the 9th new coefficient 1.1640625th, 0,1.59375,1.1640625, -0.390625, -0.8125,1.1640625,2.015625 and 0, it is described new The first parameter to the 3rd new parameter be respectively -222.921875,135.578125 and -276.8359375.
9. color space changover method as claimed in claim 8, wherein, in step (c), define the 4th new component, The 5th new component and the 6th new component are respectively new R values, new G values and new B values,
New R values=Y value+(Y value<<4+Y values<<2+Y values)>>7+Cr value -222+ (Cr values<<6+Cr values<<3+Cr values<<2- 118)>>7,
New G values=Y value+(Y value<<4+Y values<<2+Y values)>>7+135- (Cb values<<5+Cb values<<4+Cb values<<2+Cr values<<6+ Cr values<<5+Cr values<<3)>>7,
New B values=Y value+(Y value<<4+Y values<<2+Y values)>>7+Cb values<<1+ (Cb values<<1-107)>>7-276.
10. color space changover method as claimed in claim 9, the scope of the first component between 16 to 235, second point Amount and three-component scope between 16 to 240, the scope of the 4th component to the 6th component between 0 to 255, its In, in step (b) and (c), the scope of new the 4th component to the 6th new component is between 0 to 255.
11. a kind of color space conversion apparatus, using the method as described in claim 1~10 any one, described device bag Include:
Adder, for the add operation in color space transfer process;
Selector, for the shift operation in color space transfer process.
12. color space conversion apparatus as claimed in claim 11, also include
Buffer, for receiving the data of three primary colors color space and producing output valve;And
Register, for receiving color space transfer process in data and produce output valve.
CN201610874941.7A 2016-09-30 2016-09-30 Color space changover method Active CN106657960B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610874941.7A CN106657960B (en) 2016-09-30 2016-09-30 Color space changover method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610874941.7A CN106657960B (en) 2016-09-30 2016-09-30 Color space changover method

Publications (2)

Publication Number Publication Date
CN106657960A true CN106657960A (en) 2017-05-10
CN106657960B CN106657960B (en) 2018-12-25

Family

ID=58854300

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610874941.7A Active CN106657960B (en) 2016-09-30 2016-09-30 Color space changover method

Country Status (1)

Country Link
CN (1) CN106657960B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0680223A1 (en) * 1994-04-22 1995-11-02 Winbond Electronics Corporation Method and apparatus for color space conversion
CN1192631A (en) * 1997-03-04 1998-09-09 华邦电子股份有限公司 Method and device for realizing color space conversion by matrix calculation
US5841422A (en) * 1996-12-10 1998-11-24 Winbond Electronics Corp. Method and apparatus for reducing the number of matrix operations when converting RGB color space signals to YCbCr color space signals
CN1642292A (en) * 2004-01-14 2005-07-20 威达电股份有限公司 Colour format converting method and long-distance control device using said method
CN101795417A (en) * 2009-12-03 2010-08-04 山东科技大学 Method for designing YUV-to-RGB circuit having zooming function
CN101946501A (en) * 2007-12-14 2011-01-12 高通股份有限公司 Efficient diffusion dithering using dyadic rationals
CN102638688A (en) * 2011-02-09 2012-08-15 三星电子株式会社 Method and apparatus for brightness-controlling image conversion
CN102984512A (en) * 2011-09-20 2013-03-20 微软公司 Low-complexity remote presentation session encoder
CN103079079A (en) * 2013-01-23 2013-05-01 中国人民解放军装备学院 Subword parallel method for color spatial transformation

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0680223A1 (en) * 1994-04-22 1995-11-02 Winbond Electronics Corporation Method and apparatus for color space conversion
US5841422A (en) * 1996-12-10 1998-11-24 Winbond Electronics Corp. Method and apparatus for reducing the number of matrix operations when converting RGB color space signals to YCbCr color space signals
CN1192631A (en) * 1997-03-04 1998-09-09 华邦电子股份有限公司 Method and device for realizing color space conversion by matrix calculation
CN1642292A (en) * 2004-01-14 2005-07-20 威达电股份有限公司 Colour format converting method and long-distance control device using said method
CN101946501A (en) * 2007-12-14 2011-01-12 高通股份有限公司 Efficient diffusion dithering using dyadic rationals
CN101795417A (en) * 2009-12-03 2010-08-04 山东科技大学 Method for designing YUV-to-RGB circuit having zooming function
CN102638688A (en) * 2011-02-09 2012-08-15 三星电子株式会社 Method and apparatus for brightness-controlling image conversion
CN102984512A (en) * 2011-09-20 2013-03-20 微软公司 Low-complexity remote presentation session encoder
CN103079079A (en) * 2013-01-23 2013-05-01 中国人民解放军装备学院 Subword parallel method for color spatial transformation

Also Published As

Publication number Publication date
CN106657960B (en) 2018-12-25

Similar Documents

Publication Publication Date Title
CN103248793B (en) The colour of skin optimization method of gamut conversion system and device
US20010014175A1 (en) Method for rapid color keying of color video images using individual color component look-up-tables
Younes et al. Efficient image processing application using residue number system
CN102105903B (en) Method and system for predictive scaling of colour mapped images
CN110362293A (en) Multiplier, data processing method, chip and electronic equipment
CN110515587A (en) Multiplier, data processing method, chip and electronic equipment
EP3451294B1 (en) Luminance-normalised colour spaces
CN110531954A (en) Multiplier, data processing method, chip and electronic equipment
Chanussot et al. Bit mixing paradigm for multivalued morphological filters
CN106657960A (en) Color space conversion method
CN110222815A (en) Configurable activation primitive device and method suitable for deep learning hardware accelerator
CN104715454A (en) Anti-aliasing graph overlapping algorithm
Borisov et al. Toric modular forms of higher weight
CN101304467B (en) Color processing apparatus and method
CN106296614B (en) Image processing apparatus and image processing method
CN101026696A (en) Image synthesizer and image synthesizing method for the same
CN107872657A (en) The method of color gamut space conversion based on FPGA
TWI650732B (en) Color space conversion method
CN100546336C (en) Color space changover method and device thereof
CN109634556A (en) A kind of multiply-accumulator and cumulative output method
CN101772804A (en) Image processor, image processing method, display device, program and integrated circuit
CN102289831B (en) Method and system for generating color pencil drawings
Wang et al. Two new proposed image zooming methods
US7890564B2 (en) Interpolation FIR filter and method thereof
CN108600575B (en) RGB image encryption method based on incomplete Feistel network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant