CN106657960B - Color space changover method - Google Patents

Color space changover method Download PDF

Info

Publication number
CN106657960B
CN106657960B CN201610874941.7A CN201610874941A CN106657960B CN 106657960 B CN106657960 B CN 106657960B CN 201610874941 A CN201610874941 A CN 201610874941A CN 106657960 B CN106657960 B CN 106657960B
Authority
CN
China
Prior art keywords
value
new
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.)
Active
Application number
CN201610874941.7A
Other languages
Chinese (zh)
Other versions
CN106657960A (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

Abstract

A kind of color space changover method, it is converted into the 4th component, the 5th component and the 6th component of the second color space suitable for the first component, second component and third component by the first color space, and comprises the steps of the nine new coefficients and three new parameters of (a) selection dyadic rational;(b) according to the first component to third component, nine new coefficients and three new parameters, new 4th component, new 5th component and new 6th component are obtained;(c) nine new coefficients and three new parameters are distinguished into reduction of fractions to a common denominator abbreviation, so that a logic circuit unit uses multiple adders and multiple selectors, and does not use multiplier and calculate new 4th component, new 5th component and new 6th component.

Description

Color space changover method
Technical field
The invention relates to a kind of color space changover methods, particularly relate to a kind of apply in drive integrated circult (Driver IC) touch-control integrated circuit (Touch IC) can save chip area and calculation time and in three primary colors (RGB) color Space and component color difference (YCbCr) color space make the color space changover method converted between the two.
The prior art
It traditionally, can be first by the R value in three primary colors (RGB) color space (Domain), G when being dealt with to image Value and B value are first converted into Y value, Cb value and Cr value in component color difference (YCbCr) color space and remake operation.It is completed to operation Afterwards, then by new Y value, new Cb value and the new Cr value after the operation of component color difference (YCbCr) color space institute it converts back in three primary colors (RGB) the new R value, new G value of color space and new B value.
R value, G value and B value are converted into the relational expression of Y value, Cb value and Cr value respectively such as formula (1), public affairs by the prior art Shown in formula (2) and formula (3).Wherein, the range of R value, G value and B value be all between 0 to 255 integer (comprising 0 and 255), the range of Y value is the integer (comprising 16 and 235) between 16 to 235, and Cb value and Cr value are all between 16 to 240 Between integer (include 16 and 240).
Y value=0.257*R value+0.504*G value+0.098*B value+16... formula (1)
Cb value=- 0.148*R value -0.291*G value+0.439*B value+128... formula (2)
Cr value=0.439*R value -0.368*G value -0.071*B value+128... formula (3)
And the prior art by Y value, Cb value and Cr value be converted into the relational expression of R value, G value and B value respectively as formula (4), Shown in formula (5) and formula (6).Wherein, the range of R value, G value and B value is also all that the integer between 0 to 255 (includes 0 and 255).
R value=1.164*Y value+1.596*Cr value -222.921... formula (4)
G value=1.164*Y value -0.392*Cb value -0.813*Cr value+135.576. formula (5)
B value=1.164*Y value+2.017*Cb value -276.836... formula (6)
By formula (1) to (6) it is found that whether will be converted into dividing in the R value, G value and B value of three primary colors color space Y value, Cb value and the Cr value of color difference color space are measured, or will be converted in the Y value of component colour dyeing color space, Cb value and Cr value It is required when with the hardware realization of logic circuit using multiplier at the R value, G value and B value in three primary colors color space, And then occupied area becomes larger on the integrated for the calculating time increase for leading to hardware or hardware, and it is to be solved as one The problem of.
Summary of the invention
Therefore, the purpose of the present invention is providing the color space conversion side of a kind of saving chip area and calculation time Method.
Then, color space changover method of the present invention, suitable for by the first component of the first color space, second component, And third component is converted into the 4th component, the 5th component and the 6th component of the second color space.The 4th component is defined to be equal to First component, second component and third component are respectively multiplied by the first coefficient, the second coefficient and third coefficient and the first parameter Summation.Define the 5th component equal to the first component, second component and third component respectively multiplied by 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 third component difference Multiplied by the summation of the 7th coefficient, the 8th coefficient and the 9th coefficient and third parameter.The color space changover method is patrolled by one It collects circuit unit to implement, and includes step (a)~(c).
(a) the first coefficient, the second coefficient, third coefficient, the 4th coefficient, the 5th coefficient, the 6th coefficient, the 7th are selected respectively It is coefficient, the 8th coefficient, the 9th coefficient, the first parameter, new first coefficient of the second parameter and third parameter, new second coefficient, new It is third 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 third parameter, wherein new first coefficient to new 9th coefficient and new first ginseng Number to the new third parameter and its initial value absolute value of the difference less than 0.005, and new first coefficient is to new 9th coefficient, and New first parameter to the new third parameter is a kind of dyadic rational.
(b) new 4th component, new 5th component and new 6th component are obtained.New 4th component is equal to the first component, the Two components and third component are respectively multiplied by the total of new first coefficient, new second coefficient and New-regionalism architecture number and new first parameter With.New 5th component be equal to the first component, second component and third component respectively multiplied by 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 third component point Not multiplied by the summation of new 7th coefficient, new 8th coefficient and new 9th coefficient and new third parameter.
(c) by new first coefficient to New-regionalism architecture number and new first parameter, new 4th coefficient to new 6th coefficient and new the Two parameters and new 7th coefficient to new 9th coefficient and new third parameter distinguish reduction of fractions to a common denominator abbreviation, so that the logic circuit unit makes With multiple adders and multiple selectors, and does not use multiplier and calculate new 4th component, new 5th component and 6th point new Amount.
In some embodiments, the first color space is three primary colors (RGB) color space, the first component to the third component Respectively R value, G value and B value.Second color space is component color difference (YCbCr) color space, the 4th component to the 6th component Respectively Y value, Cb value and Cr value.First coefficient to the 9th coefficient is respectively 0.257,0.504,0.098, -0.148, - 0.291,0.439,0.439, -0.368 and -0.071, the first parameter to third 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.2890625,0.4375,0.4375, -0.3671875 and -0.0703125, new first parameter to new third parameter is respectively 16,128 and 128.
In some embodiments, wherein in step (c), define new 4th component, new 5th component and 6th point new Amount respectively new Y value, new Cb value and new Cr value,
New Y value=(R value<<5+R value+G value<<6+B value<<3+B value<<2)>>7+16,
New Cb value=(B value<<6-B value<<3-G value<<5-G value<<2-G value-R value<<4-R value<<1-R value)>>7+128,
New Cr value=(R value<<6-R value<<3-G value<<6+G value<<4+G value-B value<<3-B value)>>7+128.
In some embodiments, the first component to three-component range between 0 to 255, the range of the 4th component Between 16 to 235, the range of the 5th component and the 6th component is between 16 to 240.Wherein, in step (b) and (c) In, the range of new 4th component between 16 to 235, the range of new 5th component and new 6th component between 16 to 240 it Between.
In further embodiments, the first color space is component color difference (YCbCr) color space, the first component to third Component is respectively Y value, Cb value and Cr value.Second color space is three primary colors (RGB) color space, and the 4th component is to the 6th point Amount is respectively R value, G value and B value.First coefficient to the 9th coefficient is respectively 1.164,0,1.596,1.164, -0.392, - 0.813,1.164,2.017 and 0, the first parameter to third 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.390625, -0.8125,1.1640625,2.015625 and 0, new first parameter to new third parameter be respectively - 222.921875,135.578125 and -276.8359375.
In some embodiments, wherein in step (c), define new 4th component, new 5th component and 6th point new Amount respectively new R value, new G value and new B value,
New R value=Y value+(Y value<<4+Y value<<2+Y value)>>7+Cr value -222+ (Cr value<<6+Cr value<<3+Cr value<<2- 118) > > 7,
New G value=Y value+(Y value<<4+Y value<<2+Y value)>>7+135- (Cb value<<5+Cb value<<4+Cb value<<2+Cr value<< 6+Cr value<<5+Cr value<<3)>>7,
New B value=Y value+(Y value<<4+Y value<<2+Y value)>>7+Cb value<<1+ (Cb value<<1-107)>>7-276.
In some embodiments, the range of the first component is between 16 to 235, second component and three-component range Between 16 to 240, the range of the 4th component to the 6th component is between 0 to 255.Wherein, in step (b) and (c), New 4th component to new 6th component range between 0 to 255.
The present invention at least has effects that following: belonging to new first coefficient of dyadic rational to new 9th system by selection Several and new first parameter is to new third 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 third 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 member and calculation time.
Detailed description of the invention
Other features of the invention and effect will be clearly presented in the embodiment referring to schema, in which:
The step of Fig. 1 is a flow chart, illustrates 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 value of embodiment;And
Fig. 4 is a circuit diagram, illustrates the computing circuit of the new Cr value of embodiment.
Accompanying drawings symbol description
S1~S3 ... step
R [7:0] ... R value
G [7:0] ... G value
B [7:0] ... B value
The new Y value of Y ...
The new Cb value of Cb ...
The new Cr value 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 value < < 5 operation
R [7:0], 4'b0 ... R value < < 4 operation
R [7:0], 1'b0 ... R value < < 1 operation
G [7:0], 6'b0 ... G value < < 6 operation
G [7:0], 2'b0 ... G value < < 2 operation
G [7:0], 5'b0 ... G value < < 5 operation
B [7:0], 2'b0 ... B value < < 2 operation
B [7:0], 3'b0 ... B value < < 3 operation
B [7:0], 6'b0 ... B value < < 6 operation
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 Number indicate.
Refering to fig. 1, one embodiment of color space changover method of the present invention, suitable for by the first of the first color space Component, second component and third component are converted into the 4th component, the 5th component and the 6th component of the second color space.Definition 4th component is equal to the first component, second component and third component respectively multiplied by the first coefficient, the second coefficient and third coefficient With the summation of the first parameter.The 5th component is defined equal to the first component, second component and third component respectively multiplied by the 4th system 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 respectively multiplied by the summation of the 7th coefficient, the 8th coefficient and the 9th coefficient and third parameter.
More specifically, when the first color space be three primary colors (RGB) color space, and the second color space be component colour When poor (YCbCr) color space, the first component to third component is respectively R value, G value and B value, and the 4th component is to the 6th point Amount is respectively Y value, Cb value and Cr value.First coefficient to the 9th coefficient is respectively 0.257,0.504,0.098, -0.148, - 0.291,0.439,0.439, -0.368 and -0.071, the first parameter to third parameter is respectively 16,128 and 128, relationship Formula is respectively such as following formula (1)~(3), wherein the first component to third component, i.e., the range of R value, G value and B value is between 0 To between 255, the 4th component, the i.e. range of Y value are between 16 to 235, the 5th component and the 6th component, i.e. Cb value and Cr value Range between 16 to 240.
Y value=0.257*R value+0.504*G value+0.098*B value+16... formula (1)
Cb value=- 0.148*R value -0.291*G value+0.439*B value+128... formula (2)
Cr value=0.439*R value -0.368*G value -0.071*B value+128... formula (3)
Conversely, when the first color space is component color difference (YCbCr) color space, and the second color space is three primary colors (RGB) when color space, the first component to third component is respectively Y value, Cb value and Cr value, and the 4th component to the 6th component Respectively R value, G value and B value.First coefficient to the 9th coefficient is respectively 1.164,0,1.596,1.164, -0.392, - 0.813,1.164,2.017 and 0, the first parameter to third parameter is respectively -222.921,135.576 and -276.836, Relational expression is respectively such as following formula (4)~(6), wherein and the first component, i.e., the range of Y value is between 16 to 235, and second Component and third component, the i.e. range of Cb value and Cr value are between 16 to 240, the 4th component to the 6th component, i.e. R value, G The range of value and B value is between 0 to 255.In addition, especially to remark additionally: in the present embodiment, formula (4)~ (6) last term coefficient is -222.921,135.576 and -276.836 respectively, and in other embodiments, due to calculating The difference of retained decimal number of words in the process, last term coefficient of formula (4)~(6) can also be -222.912 respectively, 135.488 and -276.928, it is not subject to the limits.
R value=1.164*Y value+1.596*Cr value -222.921... formula (4)
G value=1.164*Y value -0.392*Cb value -0.813*Cr value+135.576. formula (5)
B value=1.164*Y value+2.017*Cb value -276.836... formula (6)
Color space changover method is implemented by logic circuit unit, and includes S1~S3.
In step S1, the first coefficient, the second coefficient, third coefficient, the 4th coefficient, the 5th coefficient, the 6th system are selected respectively Number, new first coefficient of the 7th coefficient, the 8th coefficient, the 9th coefficient, the first parameter, the second parameter and third 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 third parameter.Wherein, new first coefficient is to new 9th coefficient, and should New first parameter to the new third parameter and the difference of its initial value absolute value less than 0.005, and new first coefficient is to the new 9th Coefficient and new first parameter to new third parameter are a kind of dyadic rationals.In more detail, dyadic rational refers to one ten The numerical value of system is can be equal to a/2 when binary representationb, wherein a is integer, and b is natural number.
More specifically, when the first color space be three primary colors (RGB) color space, and the second color space be component colour When poor (YCbCr) color space, new first coefficient to new 9th coefficient is respectively 0.2578125,0.5,0.09375 ,- 0.1484375, -0.2890625,0.4375,0.4375, -0.3671875 and -0.0703125, new first parameter to new third Parameter is respectively 16,128 and 128.
Conversely, when the first color space is component color difference (YCbCr) color space, and the second color space is three primary colors (RGB) when color space, new first coefficient to new 9th coefficient is respectively 1.1640625,0,1.59375,1.1640625 ,- 0.390625, -0.8125,1.1640625,2.015625 and 0, new first parameter to new third parameter be respectively - 222.921875,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 third component are respectively multiplied by new first coefficient, new second coefficient and New-regionalism architecture number and new first parameter Summation.New 5th component is equal to the first component, second component and third component respectively multiplied by new 4th coefficient, new 5th system The summation of several and new 6th coefficient and new second parameter.New 6th component is equal to the first component, second component and third component Respectively multiplied by the summation of new 7th coefficient, new 8th coefficient and new 9th coefficient and new third parameter.
More specifically, when the first color space be three primary colors (RGB) color space, and the second color space be component colour When poor (YCbCr) color space, defining new 4th component to new 6th component is respectively new Y value, new Cb value and new Cr value, Relational expression is respectively such as following formula (7)~(9), wherein and the range of new 4th component is between 16 to 235, and new 5th point Amount and the range of new 6th component are between 16 to 240.
New Y value=+ 16. formula (7) of 0.2578125*R value+0.5*G value+0.09375*B value
New Cb value=- 0.1484375*R value -0.2890625*G value+0.4375*B value+128... formula (8)
New Cr value=0.4375*R value -0.3671875*G value -0.0703125*B value+128... formula (9)
Conversely, when the first color space is component color difference (YCbCr) color space, and the second color space is three primary colors (RGB) when color space, defining new 4th component to new 6th component is respectively new R value, new G value and new B value, relational expression Respectively such as following formula (10)~(12), wherein the range of new 4th component to new 6th component is between 0 to 255.
New R value=1.1640625*Y value+1.59375*Cr value -222.921875...... formula (10)
New G value=1.1640625*Y value -0.390625*Cb value -0.8125*Cr value+135.578125... formula (11)
New B value=1.1640625*Y value+2.015625*Cb value -276.8359375... formula (12)
In step S3, by new first coefficient to New-regionalism architecture number and new first parameter, new 4th coefficient to new 6th coefficient Reduction of fractions to a common denominator abbreviation is distinguished with new second parameter and new 7th coefficient to new 9th coefficient and new third parameter, so that logic circuit list Member uses multiple adders and multiple selectors, and does not use multiplier and calculate new 4th component, new 5th component and new the Six components.
More specifically, when the first color space be three primary colors (RGB) color space, and the second color space be component colour When poor (YCbCr) color space, following reduction of fractions to a common denominator abbreviation is made in formula (7)~(9) respectively, to obtain formula (13)~(15).Its In, ">>" indicates to make shift operation, such as>>it 2 is 2 positions of right shift, similarly, "<<" it is also to indicate to make shift operation, such as<< 3 be 3 positions of shifted left.
New Y value=+ 16. formula (7) of 0.2578125*R value+0.5*G value+0.09375*B value
=(33/128*R value)+(64/128*G value)+(12/128*B value)+16
=(33*R value+64*G value+12*B value)/128+16
=(32*R value+R value+64*G value+8*B value+4*B value)/128+16
=(R value<<5+R value+G value<<6+B value<<3+B value<<2)>>7+16...... formula (13)
New Cb value=- 0.1484375*R value -0.2890625*G value+0.4375*B value+128... formula (8)
=-(19/128*R value)-(37/128*G value)+(56/128*B value)+128
=(56*B value -37*G value -19*R value)/128+128
=(32*B value+16*B value+8*B value -32*G value -4*G value-G value -16*R value -2*R value-R value)/128+128
=(B value<<5+B value<<4+B value<<3-G value<<5-G value<<2-G value-R value<<4-R value<<1-R value)>>7+128
=(B value<<6-B value<<3-G value<<5-G value<<2-G value-R value<<4-R value<<1-R value)>>7+128... formula (14)
New Cr value=0.4375*R value -0.3671875*G value -0.0703125*B value+128... formula (9)
=(56/128*R value)-(47/128*G value)-(9/128*B value)+128
=(56*R value -47*G value -9*B value)/128+128
=(32*R value+16*R value+8*R value -32*G value -8*G value -4*G value -2*G value-G value -8*B value-B value)/128+ 128
=(R value<<5+R value<<4+R value<<3-G value<<5-G value<<3-G value<<2-G value<<1-G value-B value<<3-B value)>> 7+128
=(R value<<6-R value<<3-G value<<6+G value<<4+G value-B value<<3-B value)>>7+128... formula (15)
It is a circuit diagram referring again to Fig. 2, Fig. 2, with 8 R values, G value and B value, illustratively illustrates embodiment How the formula (13) of new Y value is realized by the computing circuit of hardware.After buffer 71 receives R value (R [7:0]), first is generated Output valve, i.e. R [7:0] and the second output valve, i.e. R [7:0], 5'b0, until adder (Full Adder;FA it) 81 is added, In, R [7:0], 5'b0 are exactly to make R value < < 5 operation.After buffer 72 receives G value (G [7:0]), third output valve, i.e. G are generated [7:0], 6'b0 exactly make G value < < 6 operation, and export to adder 83.After buffer 73 receives B value (B [7:0]), generate 4th output valve, i.e. B [7:0], 3'b0 and the 5th output valve, i.e. B [7:0], 2'b0, until adder 82 is added, wherein B [7:0], 3'b0 are exactly to make B value < < 3 operation, and B [7:0], 2'b0 are exactly to make B value < < 2 operation.Adder 83 is by buffer 72 Third output valve be added again with the addition result of adder 81,82, generate the 6th output valve, i.e. Y_tmp [15:0], that is, Make the operation of (R value < < 5+R value+G value < < 6+B value < < 3+B value < < 2).Register 91 receives the 6th output valve and generation the 7th is defeated It is worth out, i.e. Y_tmp [15:7], that is, makees (R value<<5+R value+G the value<<operation of 6+B value<<3+B value<<2)>>7.Adder 84 are added the 7th output valve with 8'd16, that is, make (R value<<5+R value+G the value<<fortune of 6+B value<<3+B value<<2)>>7+16 It calculates, and then generates new Y value.Similar with the explanation of Fig. 2 referring again to Fig. 3 and Fig. 4, Fig. 3 illustratively illustrates the Cb value of embodiment How formula (14) is realized by buffer 74~76, adder 61~65 and register 92.And Fig. 4 illustratively illustrates How the formula (15) of the Cr value of embodiment is realized by buffer 77~79, adder 51~55 and register 93.
Conversely, when the first color space is component color difference (YCbCr) color space, and the second color space is three primary colors (RGB) when color space, following reduction of fractions to a common denominator abbreviation is made in formula (10)~(12) respectively, to obtain formula (16)~(18).Wherein, Definition Yt value=Y value+(Y value<<4+Y value<<2+Y value)>>7
New R value=1.1640625*Y value+1.59375*Cr value -222.921875...... formula (10)
=(149/128) * Y value+(204/128) * Cr value -222- (118/128)
=(149*Y value+204*Cr value -118)/128-222
=(128*Y value+16*Y value+4*Y value+Y value+128*Cr value+64*Cr value+8*Cr value+4*Cr value -118)/128- 222
=Y value+Cr value -222+ (16*Y value+4*Y value+Y value+64*Cr value+8*Cr value+4*Cr value -118)/128
=Y value+(Y value<<4+Y value<<2+Y value)>>7+Cr value -222+ (Cr value<<6+Cr value<<3+Cr value<<2-118)>> 7
=Yt value+Cr value -222+ (Cr value<<6+Cr value<<3+Cr value<<2-118)>>7... formula (16)
New G value=1.1640625*Y value -0.390625*Cb value -0.8125*Cr value+135.578125... formula (11)
=(149/128) * Y value-(50/128) * Cb value-(104/128) * Cr value+135+ (74/128)
=(149*Y value -50*Cb value -104*Cr value+74)/128+135
=(128*Y value+16*Y value+4*Y value+Y value -32*Cb value -16*Cb value -2*Cb value -64*Cr value -32*Cr value -8* Cr value+74)/128+135
=Y value+135+ (16*Y value+4*Y value+Y value -32*Cb value -16*Cb value -2*Cb value -64*Cr value -32*Cr value -8* Cr value+74)/128
=Y value+135+ (Y value < < 4+Y value < < 2+Y value-Cb value < < 5-Cb value < < 4-Cb value < < 2-Cr value < < 6-Cr value < < 5- Cr value<<3)>>7
=Yt value+135- (Cb value<<5+Cb value<<4+Cb value<<2+Cr value<<6+Cr value<<5+Cr value<<3)>>7... public affairs Formula (17)
New B value=1.1640625*Y value+2.015625*Cb value -276.8359375... formula (12)
=(149/128) * Y value+(258/128) * Cb value -276- (107/128)
=(149*Y value+258*Cb value -107)/128-276
=(128*Y value+16*Y value+4*Y value+Y value+256*Cb value+2*Cb value -107)/128-276
=Y value+2*Cb value+(16*Y value+4*Y value+Y value+2*Cb value -107)/128-276
=Y value+Cb value<<1+ (Y value<<4+Y value<<2+Y value+Cb value<<1-107)>>7-276
=Yt value+Cb value<<1+ (Cb value<<1-107)>>7-276... formula (18)
Formula (1)~(6) of script require to make the floating-point operation of multiplication, via color conversion space-wise of the present invention Formula (13)~(18) obtained are it is found that each formula only includes "+", "-", ">>" or "<<" four kinds of oeprators, and institute Coefficient is all integer, that is to say, that logic circuit unit only need to make respectively using adder (Adder) and selector " + ", "-" and ">>", the logical operation of "<<" and integer arithmetic, that is, be able to achieve three primary colors (RGB) color space and component color difference (YCbCr) conversion between color space, and completely without using any one multiplier, and then it is occupied to save hardware Area and calculation time.
In addition, especially remarking additionally: 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) processing, elder generation is needed It will be converted into making in the Y value, Cb value and Cr value of component colour dyeing color space in the R value, G value and B value of three primary colors color space Operation, then will be converted into the processed Y value of component colour dyeing color space, Cb value and Cr value in the new of three primary colors color space One group of R value, G value and B value.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 conclusion by formula (1)~(6) it is found that the prior art is in three primary colors (RGB) color space and component color difference (YCbCr) it when color space is converted, requires to make floating-point operation using to multiplier, and multiplier is in logic circuit unit It is that will increase hardware to calculate the time or lead to desired hardware area.However, converting forwarding method institute by color space of the present invention Formula (13)~(18) of acquisition, it is only necessary to shift the power side of (Shift) 2 again multiplied by rgb value or YCbCr value with particular factor Reach as integer arithmetic, also just therefore adder and selection can be used according to formula (13)~(18) by logic circuit unit Device realizes color space conversion without the use of multiplier, to save hardware area and the calculation time of logic circuit unit, therefore really The purpose of the present invention can be reached in fact.
Only as described above, only the embodiment of the present invention is all when cannot be limited the scope of implementation of the present invention with this It is all still to belong to the present invention according to simple equivalent changes and modifications made by scope of the present invention patent and patent specification content In the range of patent covers.

Claims (12)

1. a kind of color space changover method, suitable for by the first component, second component and third component of the first color space It is converted into the 4th component, the 5th component and the 6th component of the second color space, the 4th component is defined and multiplies equal to the first component , multiplied by the summation of third coefficient and the first parameter, the 5th is defined multiplied by the second coefficient, third component with the first coefficient, second component Component be equal to the first component multiplied by the 4th coefficient, second component multiplied by the 5th coefficient, third component multiplied by the 6th coefficient and second The summation of parameter defines the 6th component and is equal to the first component multiplied by the 7th coefficient, second component multiplied by the 8th coefficient, third component Multiplied by the summation of the 9th coefficient and third parameter, which implements by logic circuit unit, and include with Lower step:
(a) the first coefficient, the second coefficient, third coefficient, the 4th coefficient, the 5th coefficient, the 6th coefficient, the 7th system are selected respectively Number, the first new coefficient of the 8th coefficient, the 9th coefficient, the first parameter, the second parameter and third parameter, the second new coefficient, New third coefficient, the 4th new coefficient, the 5th new coefficient, the 6th new coefficient, the 7th new coefficient, the 8th new system Number, the 9th new coefficient, the first new parameter, new the second parameter and new third parameter;And the first new coefficient is new to this The 9th coefficient and new the first parameter to the new third parameter be binary system rational;
(b) the 4th new component, the 5th new component and the 6th new component are obtained, the 4th new component be equal to this first Component is multiplied by the first new coefficient, the second component multiplied by the second new coefficient, the third component multiplied by the new third The summation of coefficient and the first new parameter, the 5th new component be equal to first component multiplied by the 4th new coefficient, should Second component is total multiplied by the 6th new coefficient and new second parameter multiplied by the 5th new coefficient, the third component With the 6th new component is equal to first component multiplied by the 7th new coefficient, the second component multiplied by the 8th new system Number, the third component multiplied by the 9th new coefficient and the new third parameter summation;And
(c) the first new coefficient to the new third coefficient and the first new parameter, the 4th new coefficient is new to this The 6th coefficient and the second new parameter and the 7th new coefficient to the 9th new coefficient and the new third parameter point The score for not being converted into identical denominator carries out the reduction of fractions to a common denominator and shift operation so that the logic circuit unit using multiple adders and Multiple selectors, and do not use multiplier and calculate the 4th new component, the 5th new component and this new 6th point Amount.
2. color space changover method as described in claim 1, the first new coefficient to the 9th new coefficient, and should The first new parameter is to the absolute value of the difference of the new third parameter and its initial value less than 0.005.
3. color space changover method as claimed in claim 2, which is three primary colors color space, this first Component to the third component is respectively R value, G value and B value, which is component colour dyeing color space, and the 4th point Amount to the 6th component is respectively Y value, Cb value and Cr value.
4. color space changover method as claimed in claim 3, the first coefficient to the 9th coefficient is respectively 0.257, 0.504,0.098, -0.148, -0.291,0.439,0.439, -0.368 and -0.071, first parameter to the third parameter Respectively 16,128 and 128, wherein in step (a), the first new coefficient to the 9th new coefficient is respectively 0.2578125,0.5,0.09375, -0.1484375, -0.2890625,0.4375,0.4375, -0.3671875 and - 0.0703125, which 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, be somebody's turn to do The 5th new component and the 6th new component are respectively new Y value, new Cb value and new Cr value,
New Y value=(R value<<5+R value+G value<<6+B value<<3+B value<<2)>>7+16,
New Cb value=(B value<<6-B value<<3-G value<<5-G value<<2-G value-R value<<4-R value<<1-R value)>>7+128,
New Cr value=(R value<<6-R value<<3-G value<<6+G value<<4+G value-B value<<3-B value)>>7+128.
6. color space changover method as claimed in claim 5, first component to the three-component range between 0 to Between 255, the range of the 4th component between 16 to 235, the range of the 5th component and the 6th component between 16 to Between 240, wherein in step (b) and (c), the range of the 4th new component is between 16 to 235, this new 5th The range 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 component colour dyeing color space, first point Amount to third component is respectively Y value, Cb value and Cr value, and the second color space is three primary colors color space, the 4th component to this Six components are respectively R value, G value and B value.
8. color space changover method as claimed in claim 7, first coefficient to the 9th coefficient is respectively 1.164,0, 1.596,1.164, -0.392, -0.813,1.164,2.017 and 0, the first parameter to third parameter respectively -222.921, 135.576 and -276.836, wherein in step (a), new the first coefficient to the 9th new coefficient is respectively 1.1640625,0,1.59375,1.1640625, -0.390625, -0.8125,1.1640625,2.015625 and 0, it is described new The first parameter to new third 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 value, new G value and new B value,
New R value=Y value+(Y value<<4+Y value<<2+Y value)>>7+Cr value -222+ (Cr value<<6+Cr value<<3+Cr value<<2- 118) > > 7,
New G value=Y value+(Y value<<4+Y value<<2+Y value)>>7+135- (Cb value<<5+Cb value<<4+Cb value<<2+Cr value<<6+ Cr value<<5+Cr value<<3)>>7,
New B value=Y value+(Y value<<4+Y value<<2+Y value)>>7+Cb value<<1+ (Cb value<<1-107)>>7-276.
10. color space changover method as claimed in claim 9, the range of the first component is between 16 to 235, and second point Amount and three-component range between 16 to 240, the range of the 4th component to the 6th component between 0 to 255, In, in step (b) and (c) in, the range of the 4th new component to the 6th new component is between 0 to 255.
11. a kind of color space conversion apparatus uses the method as described in claim 1~10 any one, described device packet It includes:
Adder, for the add operation in color space conversion process;
Selector, for the shift operation in color space conversion process.
12. color space conversion apparatus as claimed in claim 11, further includes
Buffer, for receiving the data of three primary colors color space and generating the first output valve;And
Register, for receiving the data in color space conversion process and generating the second 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 CN106657960A (en) 2017-05-10
CN106657960B true 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
CN106657960A (en) 2017-05-10

Similar Documents

Publication Publication Date Title
US8713082B1 (en) Scalable architecture for rank order filtering
US20010014175A1 (en) Method for rapid color keying of color video images using individual color component look-up-tables
GB2526875A (en) Gamut mapping
CN110362293A (en) Multiplier, data processing method, chip and electronic equipment
CN106657960B (en) Color space changover method
Sadangi et al. FPGA implementation of spatial filtering techniques for 2D images
CN110531954A (en) Multiplier, data processing method, chip and electronic equipment
CN109102069A (en) A kind of rapid image convolution algorithm implementation method based on look-up table
CN101304467B (en) Color processing apparatus and method
Brunner Current work and open problems in the numerical analysis of Volterra functional equations with vanishing delays
WO2020100393A1 (en) Neural network processing device, neural network processing method, and neural network processing program
CN107872657A (en) The method of color gamut space conversion based on FPGA
TWI650732B (en) Color space conversion method
CN205959185U (en) Arithmetic circuit
CN103136764A (en) Method and system for analyzing picture foreground colors
US6157939A (en) Methods and apparatus for generating multiplicative inverse product
US10447983B2 (en) Reciprocal approximation circuit
Jin et al. A COUPLED TOTAL VARIATION MODEL WITH CURVATURE DRIVEN FOR IMAGE COLORIZATION.
CN113253972A (en) FPGA implementation method of sparse polynomial multiplication accelerator in LAC
US7890564B2 (en) Interpolation FIR filter and method thereof
Jiang et al. A fast method for RGB to YCrCb conversion based on FPGA
Wang et al. Two new proposed image zooming methods
CN103391416A (en) Image processing method
CN109636863B (en) Color space conversion circuit
CN107563973A (en) A kind of image processing method and device

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