CN104637034A - Method and device for regulating image saturation degree - Google Patents

Method and device for regulating image saturation degree Download PDF

Info

Publication number
CN104637034A
CN104637034A CN201410856533.XA CN201410856533A CN104637034A CN 104637034 A CN104637034 A CN 104637034A CN 201410856533 A CN201410856533 A CN 201410856533A CN 104637034 A CN104637034 A CN 104637034A
Authority
CN
China
Prior art keywords
value
adjustment
image saturation
image
reference value
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.)
Pending
Application number
CN201410856533.XA
Other languages
Chinese (zh)
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.)
Guangzhou Boguan Information Technology Co Ltd
Original Assignee
Guangzhou Boguan Information Technology 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 Guangzhou Boguan Information Technology Co Ltd filed Critical Guangzhou Boguan Information Technology Co Ltd
Priority to CN201410856533.XA priority Critical patent/CN104637034A/en
Publication of CN104637034A publication Critical patent/CN104637034A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses a method for regulating the image saturation degree. The method comprises the following steps that RGB (red green blue) images are received, parameters are regulated, and the RGB value before the image saturation degree regulation is extracted on the basis of the received RGB image; the RGB value before the image saturation degree regulation and the regulation parameters are substituted into the relational expression of the RGB value after the image saturation degree regulation and the RGB value before the image saturation degree regulation, and the RGB value after the image saturation degree regulation is obtained through calculation, wherein the relational expression is obtained through calculation by an RGB to HIS (hue saturation intensity) formula, a saturation regulation formula and an HIS to RGB formula; the RGB image is subjected to saturation degree regulation on the basis of the RGB value after the image saturation degree regulation, and an RGB image after the regulation is obtained; the RGB image after the regulation is output. The invention also discloses a device for regulating the image saturation degree.

Description

The method of adjustment image saturation and device thereof
Technical field
The present invention relates to technical field of image processing, particularly relate to a kind of method and the device thereof that adjust image saturation.
Background technology
Along with the development of computer technology, image processing techniques and universal, Digital Image Processing application is more and more extensive.Image is subject to the impact of sensor, noise or the factor such as quantification, compression in gatherer process, and causes image cannot reach gratifying visual effect.In order to improve visual effect, be very necessary to the enhancing of original image.
Color digital image can be represented, as RGB, YUV, HSV and HSI etc. by multiple Color space model.Wherein:
Rgb space model: the color model that a kind of three primary colours colour mixture principle produces, three primary colours are red, green, blue, are represented respectively by R, G, B, and occurring in nature shades of colour can be mixed by different proportion addition by three primary colours.
The color space model that HSI is a kind of intuitive nature according to color and sets up, color space is the vision system from people, describes color with tone H, saturation degree S and brightness I.Can describe with a conical space model with reference to figure 1, HSI color space.The conical model of this description HSI color space is quite complicated, but really can the change situation of tone H, brightness I and saturation degree S be showed very clear.
Common coloured image adjustment algorithm is by coloured image through color space conversion, and by the space transforming of closely-related three components to substantially incoherent chrominance space, modal is HSI spatial model; Saturation degree adjustment based on HSI spatial model is modal image enhaucament mode.
Saturation degree refers to the purity of color, and purity is higher, and show distincter, purity is lower, shows then dulller.HSI model can be checked colors easily and is in harmonious proportion saturation degree and adjust, but its computing more complicated, relates to the calculating of floating number multiplication, division, trigonometric function and inverse trigonometric function, be therefore difficult to the real time enhancing meeting high clear video image.
Conventional view data is rgb format and each component 8 bit representations, and therefore the scope of each component is the integer between 0 to 255.Carry out saturation degree adjustment for conventional RGB image, such as, to strengthen saturation degree, its traditional processing procedure is:
(1) first, be HSI spatial model by the rgb space model conversion of image, and calculate corresponding H, S, I value.
(2) then, in HSI spatial model, corresponding saturation degree adjustment formula, thus the saturation degree S ' after being enhanced.
(3) last, HSI spatial model after strengthening saturation degree is gone back to rgb space model again, and based on strengthen H, the S of the HSI spatial model after saturation degree ', I value, show after calculating R ', the G ' of the rgb space model after enhancing saturation degree, B '.
The process of traditional this enhancing image saturation can be represented: namely with a simple model
RGB→HSI→HSI′→R′G′B′。
And often pair of image carries out a saturation degree adjustment, just needs repetition said process once.Below, by further description, introduce each process of traditional this enhancing image saturation in detail:
(1) rgb space model conversion is HSI spatial model
RGB is to the conversion based on the polar bicone of cylinder by a unit cube based on Descartes's rectangular coordinate system to the conversion of HSI model.Basic demand is separated by the luminance factor in RGB, colourity is decomposed into tone and saturation degree, and with angle vector representation tone, as shown in Figure 1.
If (R, G, B) represents the red, green and blue value of a color respectively, their value is the integer in [0,255].So, the chrominance component H of HSI color space is calculated as follows:
H = &theta; , G &GreaterEqual; B 2 &pi; - &theta; , G < B - - - ( 1.1 )
Wherein,
&theta; = cos - 1 ( ( R - G ) + ( R - B ) 2 ( R - G ) 2 + ( R - B ) ( G - B ) ) - - - ( 1.2 )
And the saturation degree S of HSI color space and brightness I formula as follows:
S=1-3*Min/(R+G+B) (1.3)
I=(R+G+B)/3 (1.4)
Wherein the scope of Min=Min (R, G, B), tone H be [0,360), the scope of saturation degree S is [0,1], and the scope of brightness I is [0,255].From above formula, we can find out that RGB turns HSI and needs to calculate inverse trigonometric function and floating number division.
(2) HSI spatial model strengthens saturation degree
At HSI space allocation saturation degree S, calculated by saturation degree adjustment formula:
F=S′/S (1.5)
Wherein, F is saturation degree Dynamic gene, and if S=0, then do not do any enhancing process.The saturation degree S ' after HSI spatial enhance can be obtained by formula (1.5).
Therefore, after degree of supersaturation adjustment, obtain (H, S ', the I) value in HSI spatial model.
(3) HSI spatial model goes back to rgb space model again
After (H, S ', the I) value in given HSI space, change into being calculated as follows of rgb space:
If 0≤H < 2 π/3, then
R = I ( 1 - S ) R = I ( 1 + S * cos ( H ) / cos ( &pi; 3 - H ) ) G = 3 I - R - B - - - ( 1.6 )
If 2 π/3≤H < 4 π/3, then
R = I ( 1 - S ) G = I ( 1 + S * cos ( H - 2 &pi; 3 ) / cos ( &pi; - H ) ) B = 3 I - G - R - - - ( 1.7 )
If 4 π/3≤H < 2 π, then
G = I ( 1 - S ) B = I ( 1 + S * cos ( H - 4 &pi; 3 ) / cos ( 5 &pi; 3 - H ) ) R = 3 I - G - B - - - ( 1.8 )
Can find out in order to HSI is converted to RGB from above-mentioned formula, need to calculate trigonometric function and floating number division, and need to select different branch to determine the value of RGB according to the value of tone H.
Visible, in traditional RGB image saturation method of adjustment, need to transfer through rgb space the conversion that HSI space and HSI space transfer two color model of rgb space to, and by the above formula, transfer at rgb space in this conversion process in HSI space and relate to a large amount of calculating (comprising inverse trigonometric function and floating number multiplication and division); And when the HSI space after image saturation adjustment is transformed into rgb space again, there is a large amount of calculating (comprising trigonometric function and floating number division) in this conversion, also comprises the judgement of multiple branch equally.Therefore need very large calculated amount in whole process, and take larger computational resource, speed is extremely low, and the saturation degree for video image strengthens far can not meet real-time demand.
Summary of the invention
The object of the embodiment of the present invention is to provide a kind of method and the device thereof that adjust image saturation, and the mutual conversion without the need to carrying out RGB and HSI space directly can carry out the adjustment of saturation degree to RGB image, thus improves processing speed.
The embodiment of the invention discloses a kind of method adjusting image saturation, it is characterized in that, comprise step:
Receive RGB image and adjustment parameter, and based on the rgb value before the described RGB image zooming-out image saturation adjustment received;
Rgb value before described image saturation adjustment and adjustment parameter are substituted in the relational expression of the rgb value after preset image saturation adjustment and the rgb value before image saturation adjustment, calculate the rgb value after image saturation adjustment; Wherein said relational expression turns by RGB the formulae discovery that the formula of HSI, saturation degree adjustment formula and HSI turn RGB and obtains;
Based on the rgb value after described image saturation adjustment, saturation degree adjustment is carried out to described RGB image, obtains the RGB image after adjustment;
Export the RGB image after described adjustment.
Wherein, described adjustment parameter comprises saturation degree Dynamic gene.
In another embodiment, described relational expression is following formula (1a) ~ (1c):
If Min (R, G, B)=B,
Then B &prime; = B - ( F - 1 ) * { 1 3 ( R + G + B ) - B } R &prime; = R + ( F - 1 ) * { R - 1 3 ( R + G + B ) } G &prime; = R + G + B - B &prime; - R &prime; - - - ( 1 a )
If Min (R, G, B)=R,
Then R &prime; = R - ( F - 1 ) * { 1 3 ( R + G + B ) - R } G &prime; = G + ( F - 1 ) * { G - 1 3 ( R + G + B ) } B &prime; = R + G + B - R &prime; - G &prime; - - - ( 1 b )
If Min (R, G, B)=G,
Then G &prime; = G - ( F - 1 ) * { 1 3 ( R + G + B ) - G } B &prime; = B + ( F - 1 ) * { B - 1 3 ( R + G + B ) } R &prime; = R + G + B - G &prime; - B &prime; - - - ( 1 c )
Wherein, R ', G ', B ' are respectively the rgb value after image saturation adjustment, and R, G, B are respectively the rgb value before image saturation adjustment, and F is saturation degree Dynamic gene.
In another embodiment, described relational expression is following formula (2a) ~ (2c):
If Min (R, G, B)=B,
Then B &prime; = B - { 1 3 ( R + G + B ) - B } > > p 1 - { 1 3 ( R + G + B ) - B } > > p 2 - &CenterDot; &CenterDot; &CenterDot; - { 1 3 ( R + G + B ) - B } > > pm R &prime; = R + { R - 1 3 ( R + G + B ) } > > p 1 + { R - 1 3 ( R + G + B ) } > > p 2 + &CenterDot; &CenterDot; &CenterDot; + { R - 1 3 ( R + G + B ) } > > pm G &prime; = R + G + B - B &prime; - R &prime; - - - ( 2 a )
If Min (R, G, B)=R,
Then R &prime; = R - { 1 3 ( R + G + B ) - R } > > p 1 - { 1 3 ( R + G + B ) - R } > > p 2 - &CenterDot; &CenterDot; &CenterDot; - { 1 3 ( R + G + B ) - R } > > pm G &prime; = G + { G - 1 3 ( R + G + B ) } > > p 1 + { G - 1 3 ( R + G + B ) } > > p 2 + &CenterDot; &CenterDot; &CenterDot; + { G - 1 3 ( R + G + B ) } > > pm B &prime; = R + G + B - R &prime; - G &prime; - - - ( 2 b )
If Min (R, G, B)=G,
Then G &prime; = G - { 1 3 ( R + G + B ) - G } > > p 1 - { 1 3 ( R + G + B ) - G } > > p 2 - . . . - { 1 3 ( R + G + B ) - G } > > pm B &prime; = B + { B - 1 3 ( R + G + B ) } > > p 1 { B - 1 3 ( R + G + B ) } > > p 2 + . . . + { B - 1 3 ( R + G + B ) } > > pm R &prime; = R + G + B - G &prime; - B &prime; - - - ( 2 c )
Wherein, R ', G ', B ' are respectively the rgb value after image saturation adjustment, and R, G, B are respectively the rgb value before image saturation adjustment, and F is saturation degree Dynamic gene, 1≤F≤2, and m be more than or equal to 1 integer; representing will value to move to right pm position.
In another embodiment, described relational expression is following formula (2a ') ~ (2c '):
If Min (R, G, B)=B,
Then R &prime; = R - { 1 3 ( R + G + B ) - R } > > p 1 - { 1 3 ( R + G + B ) - R } > > p 2 - . . . - { 1 3 ( R + G + B ) - R } > > pm G &prime; = G + { G - 1 3 ( R + G + B ) } > > p 1 { G - 1 3 ( R + G + B ) } > > p 2 + . . . + { G - 1 3 ( R + G + B ) } > > pm B &prime; = R + G + B - R &prime; - G &prime; - - - ( 2 b &prime; )
If Min (R, G, B)=R,
Then R &prime; = R - { 1 3 ( R + G + B ) - R } > > p 1 - { 1 3 ( R + G + B ) - R } > > p 2 - . . . - { 1 3 ( R + G + B ) - R } > > pm G &prime; = G + { G - 1 3 ( R + G + B ) } > > p 1 { G - 1 3 ( R + G + B ) } > > p 2 + . . . + { G - 1 3 ( R + G + B ) } > > pm B &prime; = R + G + B - R &prime; - G &prime; - - - ( 2 b &prime; )
If Min (R, G, B)=G,
Then G &prime; = G - { 1 3 ( R + G + B ) - G } > > p 1 - { 1 3 ( R + G + B ) - G } > > p 2 - . . . - { 1 3 ( R + G + B ) - G } > > pm B &prime; = B + { B - 1 3 ( R + G + B ) } > > p 1 { B - 1 3 ( R + G + B ) } > > p 2 + . . . + { B - 1 3 ( R + G + B ) } > > pm R &prime; = R + G + B - G &prime; - B &prime; - - - ( 2 c &prime; )
Wherein, R ', G ', B ' are respectively the rgb value after image saturation adjustment, and R, G, B are respectively the rgb value before image saturation adjustment, and F is saturation degree Dynamic gene, 0≤F≤1, and m be more than or equal to 1 integer; representing will value to move to right pm position.
In another embodiment, described relational expression is following formula (3a) ~ (3d):
S 1 = 1 3 ( R + G + B ) - Min ( R , G , B ) ; level = ( F - 1 ) * 2 n - - - ( 3 a )
If Min (R, G, B)=B,
Then
If Min (R, G, B)=R,
Then
If Min (R, G, B)=G,
Then
Wherein, R ', G ', B ' are respectively the rgb value after image saturation adjustment, R, G, B are respectively the rgb value before image saturation adjustment, F is saturation degree Dynamic gene, > > n is expressed as and moves to right n position to the value asked for, > > k is expressed as and moves to right k position to the value asked for, 4≤n≤16,12≤k≤24, and n, k are integer; And TAB [S 1] value by search the table of comparisons obtain, prestore in the described table of comparisons and work as S 1=1,2 ..., 169, each TAB [S corresponding when 170 1] value, and TAB [S described in each 1] value obtains by following formula: TAB [S 1]=(int) (2 k/ S 1+ 0.5), wherein, int represents and rounds, and+0.5 represents and rounds up.
As the improvement of such scheme, described saturation degree Dynamic gene comprises saturation degree enhancing/Attenuation factor.
Embodiment of the present invention correspondence provides a kind of device adjusting image saturation, comprising:
Storage unit, for storing a relational expression pre-set, described relational expression is used for the relation of the rgb value before the rgb value after the adjustment of Description Image saturation degree and image saturation adjustment; Wherein said relational expression turns by RGB the formulae discovery that the formula of HSI, saturation degree adjustment formula and HSI turn RGB and obtains;
Receiving element, for receiving RGB image and adjustment parameter, and based on the rgb value before the described RGB image zooming-out image saturation adjustment received;
Computing unit, for the rgb value before described image saturation adjustment and adjustment parameter being substituted in described relational expression, calculates the rgb value after image saturation adjustment;
Adjustment unit, based on the rgb value after described image saturation adjustment, carries out saturation degree adjustment to described RGB image, obtains the RGB image after adjustment;
Output unit, exports the RGB image after described adjustment.
Wherein, described adjustment parameter comprises saturation degree Dynamic gene.
Embodiments provide the method for another kind of adjustment image saturation, comprise step:
S1, reception RGB image and adjustment parameter, and based on the described RGB image zooming-out image attributes parameter received; Wherein, described image attributes parameter comprises the red, green, blue value before image saturation adjustment, and described adjustment parameter comprises saturation degree Dynamic gene;
S2, based on the red, green, blue value before the adjustment of described image saturation and described saturation degree Dynamic gene, calculate the red, green, blue value after image saturation adjustment, comprise step:
S21, to be obtained image saturation adjustment by formula (1) before red, green, blue value with value, image saturation adjustment before brightness and image saturation adjust before saturation degree and the product value of brightness:
I 3 = R + G + B I = I 3 * 1 3 S 1 = I - Min ( R , G , B ) - - - ( 1 )
Wherein, I 3for described and value, S 1for described product value, I is the brightness before image saturation adjustment, and R, G, B are respectively the red, green, blue value before image saturation adjustment;
S22, to be obtained the second reference value before image saturation adjustment by formula (2):
Wherein, Y is the second reference value before image saturation adjustment, and R, G, B are respectively the red, green, blue value before image saturation adjustment;
S23, to be obtained the first reference value, the second reference value and the 3rd reference value after image saturation adjustment by formula (3):
X &prime; = Min ( R , G , B ) - &alpha; S 1 Y &prime; = Y + &alpha; ( Y - I ) Z &prime; = I 3 - X &prime; - Y &prime; - - - ( 3 )
Wherein, R, G, B are respectively the red, green, blue value before image saturation adjustment, I 3for described and value, S 1for described product value, I is the brightness before image saturation adjustment, and Y is the second reference value before image saturation adjustment, and X ', Y ' and Z ' are respectively the first reference value, the second reference value and the 3rd reference value after image saturation adjustment, α=F-1, F are described saturation degree Dynamic gene;
S24, to be obtained the red, green, blue value after image saturation adjustment by formula (4):
Wherein, R ', G ', B ' are respectively the red, green, blue value after image saturation adjustment, R, G, B are respectively the red, green, blue value before image saturation adjustment, and X ', Y ' and Z ' are respectively the first reference value, the second reference value and the 3rd reference value after image saturation adjustment;
S3, based on the red, green, blue value after the adjustment of described image saturation, saturation degree adjustment is carried out to described RGB image, obtain the RGB image after adjustment;
S4, export the RGB image after described adjustment.
In another embodiment, in described step S23, replace above-mentioned formula (3) by following formula (3 '), the first reference value, the second reference value and the 3rd reference value with after the adjustment of computed image saturation degree:
X ' = Min ( R , G , B ) - ( S 1 > > p 1 + S 1 > > p 2 + . . . + S 1 > > pm ) Y ' = Y + ( Y - I ) > > p 1 + ( Y - I ) > > p 2 + . . . + ( Y - I ) > > pm Z ' = I 3 - X ' - Y ' - - - ( 3 ' )
Wherein, R, G, B are respectively the red, green, blue value before image saturation adjustment, I 3for described and value, S 1for described product value, I is the brightness before image saturation adjustment, and Y is the second reference value before image saturation adjustment, and X ', Y ' and Z ' are respectively the first reference value, the second reference value and the 3rd reference value after image saturation adjustment; α=F-1, F are saturation degree Dynamic gene, 1≤F≤2, and m be more than or equal to 1 integer; S 1> > pm represents S 1value to move to right pm position.
In another embodiment, in described step S23, by following formula (3 ") replace above-mentioned formula (3), with computed image saturation degree adjustment after the first reference value, the second reference value and the 3rd reference value:
X ' = Min ( R , G , B ) - ( S 1 > > p 1 + S 1 > > p 2 + . . . + S 1 > > pm ) Y ' = Y + ( Y - I ) > > p 1 + ( Y - I ) > > p 2 - . . . - ( Y - I ) > > pm Z ' = I 3 - X ' - Y ' - - - ( 3 ' ' )
Wherein, R, G, B are respectively the red, green, blue value before image saturation adjustment, I 3for described and value, S 1for described product value, I is the brightness before image saturation adjustment, and Y is the second reference value before image saturation adjustment, and X ', Y ' and Z ' are respectively the first reference value, the second reference value and the 3rd reference value after image saturation adjustment; α=F-1, F are saturation degree Dynamic gene, 0≤F≤1, and m be more than or equal to 1 integer; S 1> > pm represents S 1value to move to right pm position.
In another embodiment, in described step S23, replace above-mentioned formula (3) by following formula (3 " '), the first reference value, the second reference value and the 3rd reference value with after the adjustment of computed image saturation degree:
Wherein, R, G, B are respectively the red, green, blue value before image saturation adjustment, I 3for described and value, S 1for described product value, I is the brightness before image saturation adjustment, and Y is the second reference value before image saturation adjustment, and X ', Y ' and Z ' are respectively the first reference value, the second reference value and the 3rd reference value after image saturation adjustment; Level=α * 2 n=(F-1) * 2n, F is saturation degree Dynamic gene, > > n is expressed as and moves to right n position to the value asked for, > > k is expressed as and moves to right k position to the value asked for, the span of n, k is: 4≤n≤16,12≤k≤24; And TAB [S 1] value by search the table of comparisons obtain, prestore in the described table of comparisons as described product value S 1=1,2 ..., 169, each TAB [S corresponding when 170 1] value, and TAB [S described in each 1] value obtains by following formula: TAB [S 1]=(int) (2 k/ S 1+ 0.5), wherein, int represents and rounds, and+0.5 represents and rounds up.
As the improvement of such scheme, described saturation degree Dynamic gene comprises saturation degree enhancing/Attenuation factor.
Embodiment of the present invention correspondence provides a kind of device adjusting image saturation, comprising:
Receiving element, for receiving RGB image and adjustment parameter, and based on the described RGB image zooming-out image attributes parameter received; Wherein, described image attributes parameter comprises the red, green, blue value before image saturation adjustment, and described adjustment parameter comprises saturation degree Dynamic gene;
Computing unit, for according to the red, green, blue value before the adjustment of described image saturation and described saturation degree Dynamic gene, calculates the red, green, blue value after image saturation adjustment, comprising:
First computing module, the red, green, blue value before obtaining image saturation adjustment by formula (1) with value, image saturation adjustment before brightness and image saturation adjust before saturation degree and the product value of brightness:
I 3 = R + G + B I = I 3 * 1 3 S 1 = I - Min ( R , G , B ) - - - ( 1 )
Wherein, I 3for described and value, S 1for described product value, I is the brightness before image saturation adjustment, and R, G, B are respectively the red, green, blue value before image saturation adjustment;
Second computing module, obtains the second reference value before image saturation adjustment by formula (2):
Wherein, Y is the second reference value before image saturation adjustment, and R, G, B are respectively the red, green, blue value before image saturation adjustment;
3rd computing module, obtains the first reference value, the second reference value and the 3rd reference value after image saturation adjustment by formula (3):
X ' = Min ( R , G , B ) - &alpha; S 1 Y ' = Y + &alpha; ( Y - I ) Z ' = I 3 - X ' - Y ' - - - ( 3 )
Wherein, I 3for described and value, S 1for described product value, I is the brightness before image saturation adjustment, R, G, B are respectively the red, green, blue value before image saturation adjustment, Y is the second reference value before image saturation adjustment, X ', Y ' and Z ' are respectively the first reference value, the second reference value and the 3rd reference value after image saturation adjustment, α=F-1, F are described saturation degree Dynamic gene;
4th computing module, obtains the red, green, blue value after image saturation adjustment by formula (4):
Wherein, R ', G ', B ' are respectively the red, green, blue value after image saturation adjustment, R, G, B are respectively the red, green, blue value before image saturation adjustment, and X ', Y ' and Z ' are respectively the first reference value, the second reference value and the 3rd reference value after image saturation adjustment;
Adjustment unit, based on the red, green, blue value after described image saturation adjustment, carries out saturation degree adjustment to described RGB image, thus obtains the RGB image after adjustment; And
Output unit, for exporting the RGB image after described adjustment.
Embodiments provide the method for another kind of adjustment image saturation, comprise step:
Rgb value a () provides image saturation to adjust before and saturation degree Dynamic gene;
First and value after rgb value b () calculates the adjustment of described image saturation before is added;
C described and value are multiplied by the first product value after 1/3 as the brightness value before image saturation adjustment by ();
D () judges the minimum value in the rgb value before the adjustment of described image saturation;
E () calculates the first difference between described brightness value and described minimum value;
F (), according to described minimum value, obtains the second reference value before image saturation adjustment: when minimum value is B value, using R value as the second reference value before described image saturation adjustment; When minimum value is R value, using G value as the second reference value before described image saturation adjustment; When minimum value is G value, using B value as the second reference value before described image saturation adjustment;
The second difference g described saturation degree Dynamic gene is subtracted 1 process by () after is multiplied with described first difference, obtain the second product value, and using the 3rd difference between described minimum value and described second product value as the first reference value after image saturation adjusts;
H the second reference value before described image saturation adjustment is multiplied with described second difference with the 4th difference between described brightness value by (), obtain the 3rd product value, using second and value between the second reference value before described image saturation adjustment and described 3rd product value as the second reference value after image saturation adjustment;
I () deducts the 5th difference of the second reference value after the first reference value after the adjustment of described image saturation and image saturation adjustment as the 3rd reference value after image saturation adjustment by described first and value; And
J () is according to described minimum value, obtain the rgb value after image saturation adjustment: when minimum value is B value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to B, R and G value after image saturation adjustment; When minimum value is R value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to R, G and B value after image saturation adjustment; When minimum value is G value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to G, B and R value after image saturation adjustment.
The corresponding device providing another kind of adjustment image saturation of the embodiment of the present invention, comprising:
Extraction apparatus, for receiving RGB image and adjustment parameter, and extract the rgb value before the image saturation adjustment of described RGB image, wherein said adjustment parameter comprises saturation degree Dynamic gene;
First adder, for calculating first and value after the rgb value addition before the adjustment of described image saturation;
First multiplier, using described first and value and the first product value between 1/3 as the brightness value before image saturation adjustment;
Comparer, for the rgb value before more described image saturation adjustment, and exports minimum value;
First subtracter, calculates the first difference between described brightness value and described minimum value;
First judging unit, according to described minimum value, judges the second reference value before obtaining image saturation adjustment: when minimum value is B value, using R value as the second reference value before described image saturation adjustment; When minimum value is R value, using G value as the second reference value before described image saturation adjustment; When minimum value is G value, using B value as the second reference value before described image saturation adjustment;
Second subtracter, after described saturation degree Dynamic gene is subtracted 1 process, obtains the second difference;
Second multiplier, for calculating the second product value between the second difference and described first difference;
3rd subtracter, deducts described second product value obtain the 3rd difference for calculating described minimum value, and described 3rd difference is as the first reference value after image saturation adjustment;
4th subtracter, for calculating the 4th difference between the second reference value before the adjustment of described image saturation and described brightness value;
3rd multiplier, for calculating the 3rd product value between described 4th difference and described second difference;
Second adder, for calculate described image saturation adjustment before the second reference value and described 3rd product value between second and value, described second and value as image saturation adjust after the second reference value;
5th subtracter, for by first and value deduct described image saturation adjustment after the first reference value and image saturation adjustment after the second reference value obtain the 5th difference, described 5th difference as image saturation adjust after the 3rd reference value; And
Second judging unit, according to described minimum value, judge the rgb value after obtaining image saturation adjustment: when minimum value is B value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to B, R and G value after image saturation adjustment; When minimum value is R value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to R, G and B value after image saturation adjustment; When minimum value is G value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to G, B and R value after image saturation adjustment.
The embodiment of the present invention additionally provides the method for another kind of adjustment image saturation, comprises step:
Rgb value a () provides image saturation to adjust before and saturation degree Dynamic gene, the span of described saturation degree Dynamic gene is [0,2];
First and value after rgb value b () calculates the adjustment of described image saturation before is added;
C described and value are multiplied by first product value of 1/3 as the brightness value before image saturation adjustment by ();
D () judges the minimum value in the rgb value before the adjustment of described image saturation;
E () calculates the first difference between described brightness value and described minimum value;
F (), according to described minimum value, obtains the second reference value before image saturation adjustment: when minimum value is B value, using R value as the second reference value before described image saturation adjustment; When minimum value is R value, using G value as the second reference value before described image saturation adjustment; When minimum value is G value, using B value as the second reference value before described image saturation adjustment;
The second difference g described saturation degree Dynamic gene is subtracted 1 process by () after converts binary value to, described first difference is carried out corresponding shifting function based on described binary value, obtains at least one first off-set value;
H described saturation degree Dynamic gene compares with 1 by (), if be more than or equal to 1, then using the 3rd difference between described minimum value and at least one first off-set value described as the first reference value after image saturation adjusts; Otherwise using second between described minimum value and at least one first off-set value described be worth as the first reference value after image saturation adjusts;
I () calculates the 4th difference between the second reference value before the adjustment of described image saturation and described brightness value, and described 4th difference is carried out corresponding shifting function based on described binary value, obtains at least one second off-set value;
If j () described saturation degree Dynamic gene is more than or equal to 1, then using the 3rd between the second reference value before the adjustment of described image saturation and at least one second off-set value described and value as the second reference value after image saturation adjustment; Otherwise, then using the 5th difference between the second reference value before the adjustment of described image saturation and at least one second off-set value described as the second reference value after image saturation adjustment;
K () deducts the 6th difference of the second reference value after the first reference value after the adjustment of described image saturation and image saturation adjustment as the 3rd reference value after image saturation adjustment by described first and value; And
L () is according to described minimum value, obtain the rgb value after image saturation adjustment: when minimum value is B value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to B, R and G value after image saturation adjustment; When minimum value is R value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to R, G and B value after image saturation adjustment; When minimum value is G value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to G, B and R value after image saturation adjustment.
Embodiment of the present invention correspondence provides the device of another kind of adjustment image saturation, comprising:
Extraction apparatus, for receiving RGB image and adjustment parameter, and extract the rgb value before the image saturation adjustment of described RGB image, wherein said adjustment parameter comprises saturation degree Dynamic gene, and the span of described saturation degree Dynamic gene is [1,2];
First adder, for calculating first and value after the rgb value addition before the adjustment of described image saturation;
Multiplier, using described first and value and 1/3 product value as image saturation adjust before brightness value;
First comparer, for the rgb value before more described image saturation adjustment, and exports minimum value;
First subtracter, calculates the first difference between described brightness value and described minimum value;
First judging unit, according to described minimum value, judges the second reference value before obtaining image saturation adjustment: when minimum value is B value, using R value as the second reference value before described image saturation adjustment; When minimum value is R value, using G value as the second reference value before described image saturation adjustment; When minimum value is G value, using B value as the second reference value before described image saturation adjustment;
Second subtracter, after described saturation degree Dynamic gene is subtracted 1 process, obtains the second difference;
Binary translator, for converting described second difference to binary value; First shift unit, for described first difference is carried out corresponding shifting function based on described binary value, obtains at least one first off-set value;
Second comparer, compares size with by described saturation degree Dynamic gene with 1;
3rd subtracter, for when described saturation degree Dynamic gene is more than or equal to 1, calculates the 3rd difference between described minimum value and at least one first off-set value described, and described 3rd difference is as the first reference value after image saturation adjustment;
Second adder, for when described saturation degree Dynamic gene is less than 1, calculate second between described minimum value and at least one first off-set value described and value adjust as image saturation after the first reference value;
4th subtracter, for calculating the 4th difference between the second reference value before the adjustment of described image saturation and described brightness value;
Second shift unit, for described 4th difference is carried out corresponding shifting function based on described binary value, obtains at least one second off-set value;
Second adder, for when described saturation degree Dynamic gene is more than or equal to 1, calculate described image saturation adjustment before the second reference value and at least one second off-set value described between the 3rd and value, the described 3rd and value as image saturation adjust after the second reference value;
5th subtracter, for when described saturation degree Dynamic gene is less than 1, the second reference value after the 5th difference calculated between the second reference value before the adjustment of described image saturation and at least one second off-set value described adjusts as image saturation;
6th subtracter, for by first and value deduct described image saturation adjustment after the first reference value and image saturation adjustment after the second reference value obtain the 6th difference, described 6th difference as image saturation adjust after the 3rd reference value; And
Second judging unit, according to described minimum value, judge the rgb value after obtaining image saturation adjustment: when minimum value is B value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to B, R and G value after image saturation adjustment; When minimum value is R value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to R, G and B value after image saturation adjustment; When minimum value is G value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to G, B and R value after image saturation adjustment.
The embodiment of the present invention additionally provides the method for another kind of adjustment image saturation, comprises step:
Rgb value a () provides image saturation to adjust before and saturation degree Dynamic gene;
First and value after rgb value b () calculates the adjustment of described image saturation before is added;
(c) using described first and value and 1/3 the first product value as image saturation adjust before brightness value;
D () judges the minimum value in the rgb value before the adjustment of described image saturation;
E () calculates the first difference between described brightness value and described minimum value;
F (), according to described minimum value, obtains the second reference value before image saturation adjustment: when minimum value is B value, using R value as the second reference value before described image saturation adjustment; When minimum value is R value, using G value as the second reference value before described image saturation adjustment; When minimum value is G value, using B value as the second reference value before described image saturation adjustment;
The second difference g described saturation degree Dynamic gene is subtracted 1 process by () after is multiplied by 2 n, obtain the second product value; The 3rd product value between described first difference and described second product value is moved to right behind n position and obtain the first off-set value, using the 3rd difference between described minimum value and described first off-set value as the first reference value after image saturation adjusts;
H () calculates the 4th difference between the second reference value before the adjustment of described image saturation and described brightness value;
I () is when the first reference value after described image saturation adjustment is more than or equal to 0, the 4th product value between described 4th difference and described second product value is moved to right behind n position and obtain the second off-set value, using second and value between the second reference value before described image saturation adjustment and described second off-set value as the second reference value after image saturation adjustment;
J (), when the first reference value after described image saturation adjustment is less than 0, is searched the table of comparisons based on described first difference and is obtained corresponding array value; Prestore when described first difference is 1,2 in the described table of comparisons ..., 169, each array value corresponding when 170, and each array value described is by 2 kwith the ratio of the first difference round up round; Five product value of described minimum value, the 4th between difference and array value is moved to right behind k position and obtain the 3rd off-set value, using the 3rd and value between the second reference value before described image saturation adjustment and described 3rd off-set value as the second reference value after image saturation adjustment;
K () deducts the 5th difference of the second reference value after the first reference value after the adjustment of described image saturation and image saturation adjustment as the 3rd reference value after image saturation adjustment by described first and value; And
L () is by judging described minimum value, obtain the rgb value after image saturation adjustment: when minimum value is B value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to B, R and G value after image saturation adjustment; When minimum value is R value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to R, G and B value after image saturation adjustment; When minimum value is G value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to G, B and R value after image saturation adjustment.
The embodiment of the present invention is the corresponding device providing another kind of adjustment image saturation also, comprising:
Extraction apparatus, for receiving RGB image and adjustment parameter, and extract the rgb value before the image saturation adjustment of described RGB image, wherein said adjustment parameter comprises saturation degree Dynamic gene;
First adder, for calculating first and value after the rgb value addition before the adjustment of described image saturation;
First multiplier, using described first and value and 1/3 product value as image saturation adjust before brightness value;
First comparer, for the rgb value before more described image saturation adjustment, and exports minimum value;
First subtracter, calculates the first difference between described brightness value and described minimum value;
First judging unit, according to described minimum value, judges the second reference value before obtaining image saturation adjustment: when minimum value is B value, using R value as the second reference value before described image saturation adjustment; When minimum value is R value, using G value as the second reference value before described image saturation adjustment; When minimum value is G value, using B value as the second reference value before described image saturation adjustment;
Second subtracter, after described saturation degree Dynamic gene is subtracted 1 process, obtains the second difference;
Second multiplier, for being multiplied by 2 by described second difference n, obtain the second product value;
3rd multiplier, for calculating the 3rd product value between described first difference and described second product value;
First shift unit, for the n position that moved to right by described 3rd product value, obtains the first off-set value;
3rd subtracter, for calculating the 3rd difference between described minimum value and described first off-set value, described 3rd difference is as the first reference value after image saturation adjustment;
4th subtracter, for calculating the 4th difference between the second reference value before the adjustment of described image saturation and described brightness value;
4th multiplier, for calculating the 4th product value between described 4th difference and described second product value;
Second comparer, for by judge described image saturation adjustment after the first reference value and 0 make comparisons;
Second shift unit, for when the first reference value after described image saturation adjustment is more than or equal to 0, obtains the second off-set value behind the n position that moved to right by described 4th product value;
Second adder, for calculate described image saturation adjustment before the second reference value and described second off-set value between second and value, described second and value as image saturation adjust after the second reference value;
Processor, in order to store comparison list, when the first reference value after described image saturation adjustment is less than 0, searches the table of comparisons based on described first difference and obtains corresponding array value; Prestore when described first difference is 1,2 in the described table of comparisons ..., 169, each array value corresponding when 170, and each array value described is by 2 kwith the ratio of the first difference round up round;
5th multiplier, for calculating five product value of described minimum value, the 4th between difference and array value;
3rd shift unit, for obtaining the 3rd off-set value behind the k position that moved to right by described 5th product value;
3rd totalizer, for calculate described image saturation adjustment before the second reference value and described 3rd off-set value between the 3rd and value, the described 3rd and value as image saturation adjust after the second reference value;
5th subtracter, for by first and value deduct described image saturation adjustment after the first reference value and image saturation adjustment after the second reference value obtain the 5th difference, described 5th difference as image saturation adjust after the 3rd reference value; And
Second judging unit, according to described minimum value, judge the rgb value after obtaining image saturation adjustment: when minimum value is B value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to B, R and G value after image saturation adjustment; When minimum value is R value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to R, G and B value after image saturation adjustment; When minimum value is G value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to G, B and R value after image saturation adjustment.
Compared with prior art, the method of adjustment image saturation disclosed by the invention and device thereof are based on the rgb value of the RGB image of input and adjustment parameter, directly calculate the rgb value after image saturation adjustment by the formula preset, thus realize adjusting the saturation degree of RGB image.Therefore, to solve in prior art and saturation degree adjustment is carried out to RGB image at every turn and all need to transfer through rgb space the conversion that HSI space and HSI space transfer two color model of rgb space to, and each conversion exist a large amount of calculating and multiple branch judgement and cause calculated amount large, take the problem that computational resource is large and speed is extremely low, obtain that calculated amount is few, to take computational resource few and improve the beneficial effect of processing speed.
Accompanying drawing explanation
Fig. 1 is the contrast schematic diagram of rgb space model (left side) of the prior art and HIS space model (right side).
Fig. 2 is the schematic flow sheet of the first embodiment of the method for adjustment image saturation of the present invention.
Fig. 3 is the structured flowchart of the first embodiment of the device of adjustment image saturation of the present invention.
Fig. 4 is another structured flowchart of the first embodiment of the device of adjustment image saturation of the present invention.
Fig. 5 is another structured flowchart of the first embodiment of the device of adjustment image saturation of the present invention.
Fig. 6 is the schematic flow sheet of the second embodiment of the method for adjustment image saturation of the present invention.
Fig. 7 is another schematic flow sheet of the second embodiment of the method for adjustment image saturation of the present invention.
Fig. 8 is another schematic flow sheet of the second embodiment of the method for adjustment image saturation of the present invention.
Fig. 9 is another schematic flow sheet of the second embodiment of the method for adjustment image saturation of the present invention.
Figure 10 is the structured flowchart of the second embodiment of the device of adjustment image saturation of the present invention.
Figure 11 is another structured flowchart of the second embodiment of the device of adjustment image saturation of the present invention.
Figure 12 is another structured flowchart of the second embodiment of the device of adjustment image saturation of the present invention.
Figure 13 is the schematic flow sheet of the 3rd embodiment of the method for adjustment image saturation of the present invention.
Figure 14 is the structured flowchart of the 3rd embodiment of the device of adjustment image saturation of the present invention.
Figure 15 is the schematic flow sheet of the 4th embodiment of the method for adjustment image saturation of the present invention.
Figure 16 is the structured flowchart of the 4th embodiment of the device of adjustment image saturation of the present invention.
Figure 17 is the schematic flow sheet of the 5th embodiment of the method for adjustment image saturation of the present invention.
Figure 18 is the structured flowchart of the 5th embodiment of the device of adjustment image saturation of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
See Fig. 2, it is a kind of schematic flow sheet adjusting the first embodiment of the method for image saturation provided by the invention.The method of this adjustment image saturation comprises step:
S101, reception RGB image and adjustment parameter, and based on the rgb value before the described RGB image zooming-out image saturation adjustment received;
S102, the rgb value before the adjustment of described image saturation and adjustment parameter to be substituted in the relational expression of the rgb value after preset image saturation adjustment and the rgb value before image saturation adjustment, calculate the rgb value after image saturation adjustment; Wherein said relational expression turns by RGB the formulae discovery that the formula of HSI, saturation degree adjustment formula and HSI turn RGB and obtains;
S103, based on the rgb value after the adjustment of described image saturation, saturation degree adjustment is carried out to described RGB image, obtain the RGB image after adjustment;
S104, export the RGB image after described adjustment.
General, image saturation refers to the purity of color, and purity is higher, and show distincter, purity is lower, shows then dulller.In the present embodiment, above-mentioned adjustment parameter comprises saturation degree Dynamic gene.And in the image saturation adjustment of reality, can comprise and strengthen or reduce image saturation, therefore, above-mentioned saturation degree Dynamic gene comprises saturation degree and strengthens/reduce the factor.
The method of the adjustment image saturation of the present embodiment transfers the conversion of two color model of rgb space to without the need to transferring HSI space and HSI space to through rgb space, but based on input RGB image rgb value and adjustment parameter, the rgb value after image saturation adjustment is directly calculated by the formula preset, realize adjust the saturation degree of RGB image, calculated amount is few, take the little and raising processing speed of computational resource.
In the present embodiment, the relational expression of the rgb value before the rgb value after the adjustment of described preset image saturation and image saturation adjustment turns by RGB the formulae discovery that the formula of HSI, saturation degree adjustment formula and HSI turn RGB to obtain, below, several attainable instantiation and the computation process of described relational expression is described in detail.
In one embodiment, the relational expression (1) of the rgb value after described preset image saturation adjustment and the rgb value before image saturation adjustment is following formula (1a) ~ (1c):
If Min (R, G, B)=B,
Then B &prime; = B - ( F - 1 ) * { 1 3 ( R + G + B ) - B } R &prime; = R + ( F - 1 ) * { R - 1 3 ( R + G + B ) } G &prime; = R + G + B - B &prime; - R &prime; - - - ( 1 a )
If Min (R, G, B)=R,
Then R &prime; = R - ( F - 1 ) * { 1 3 ( R + G + B ) - R } G &prime; = G + ( F - 1 ) * { G - 1 3 ( R + G + B ) } B &prime; = R + G + B - R &prime; - G &prime; - - - ( 1 b )
If Min (R, G, B)=G,
Then G &prime; = G - ( F - 1 ) * { 1 3 ( R + G + B ) - G } B &prime; = B + ( F - 1 ) * { B - 1 3 ( R + G + B ) } R &prime; = R + G + B - G &prime; - B &prime; - - - ( 1 c )
Wherein, R ', G ', B ' are respectively the rgb value after image saturation adjustment, and R, G, B are respectively the rgb value before image saturation adjustment, and F is saturation degree Dynamic gene.
Wherein, relational expression (1) turns by RGB the formulae discovery that the formula of HSI, saturation degree adjustment formula and HSI turn RGB and obtains, and concrete example is described as follows:
General, the formula that RGB turns HSI can be expressed as:
H = &theta; , G &GreaterEqual; B 2 &pi; - &theta; , G < B - - - ( 1.1 )
Wherein,
&theta; = cos - 1 ( ( R - G ) + ( R - B ) 2 ( R - G ) 2 + ( R - B ) ( G - B ) ) - - - ( 1.2 )
And the saturation degree S of HSI color space and brightness I formula as follows:
S=1-3*Min/(R+G+B) (1.3)
I=(R+G+B)/3 (1.4)
If (R, G, B) represents the red, green and blue value of a color respectively, their value is the integer in [0,255].Wherein the scope of Min=Min (R, G, B), tone H be [0,360), the scope of saturation degree S is [0,1], and the scope of brightness I is [0,255].
The formula spatially adjusting saturation degree at HSI can be expressed as:
F=S′/S (1.5)
Wherein, F is saturation degree Dynamic gene, and we can suppose 1≤F≤2, and if S=0, then do not do any enhancing process.
The formula that HSI after adjustment saturation degree goes back to RGB can be expressed as:
If 0≤H < 2 π/3, then
B = I ( 1 - S &prime; ) R = I ( 1 + S &prime; * cos ( H ) / cos ( &pi; 3 - H ) ) G = 3 I - R - B - - - ( 1.6 )
If 2 π/3≤H < 4 π/3, then
R = I ( 1 - S &prime; ) G = I ( 1 + S &prime; * cos ( H - 2 &pi; 3 ) / cos ( &pi; - H ) ) B = 3 I - G - R - - - ( 1 . 7 )
If 4 π/3≤H < 2 π, then
G = I ( 1 - S &prime; ) B = I ( 1 + S &prime; * cos ( H - 4 &pi; 3 ) ) / cos ( 5 &pi; 3 - H ) ) R = 3 I - G - B - - - ( 1 . 8 )
By finding above-mentioned formula study analysis, a formula can be merged into, shown in following formula in formula (1.6), (1.7), (1.8):
X = I ( 1 - S ) Y = I ( 1 + S * cos ( &psi; ) / cos ( &pi; / 3 - &psi; ) ) Z = 3 I - X - Y - - - ( 2.1 )
If 0≤H < 2 π/3, then
B=X, R=Y, G=Z, ψ=H (2.2) if 2 π/3≤H < 4 π/3, then
R = X , G = Y , B = Z , &psi; = H - 2 &pi; 3 - - - ( 2.3 )
If 4 π/3≤H < 2 π, then
G = X , B = Y , R = Z , &psi; = H - 4 &pi; 3 - - - ( 2 . 4 )
We observe the formula that HSI turns RGB, find conversion formula Zhong Yousange branch, and the judgement of branch depends on the scope of colourity H, the value of H is constant before and after enhancing, very complicated by the calculating of formula (1.1) and (1.2) known H, need to calculate floating number division and inverse trigonometric function, the value therefore by calculating H judges that the mode of branch is very consuming time.The Rule of judgment carefully analyzing these three branches finds that we only need the scope of H value in fact, do not need exact value.
HSI model schematic in our analysis chart 1, three branches finding H are corresponding is respectively that radius three of splitting are fan-shaped with red, green and blue.Further can find, these three fan-shaped is that minimum value is corresponding with certain component of RGB.Be formulated as follows:
Conveniently computing and description, we introduce several new variable newly:
I 3 = R + G + B = 3 * I &Element; [ 0,765 S 3 = I 3 * S = I 3 - 3 * Min &Element; [ 0,510 S 1 = S 3 / 3 = I * S = I - Min &Element; [ 0,170 ] - - - ( 2.6 )
Wherein Min=Min (R, G, B).
Make R ', G ' and B ' be strengthen after each component value, X ', Y ' and Z ' are the values of X, Y and Z after the enhancing corresponding with formula (2.1), then from (2.1), (2.5) and (1.5):
X′=I*(1-S′)=I-I*S′
=I-F*I*S=I-F*S 1(2.7)
Y′=I(1+S′*cos(ψ)/cos(π/3-ψ)) (2.8)
Z′=I 3-X′-Y′ (2.9)
Tentatively being judged by (2.8), in order to calculate Y ', needing the exact value knowing ψ, and need to calculate trigonometric function and floating number division.We only need to know that the value of cos (ψ)/cos (π/3-ψ) just can calculate Y ' in fact, because H value is constant, therefore the value of ψ also remains unchanged, and before and after that is strengthening, the value of cos (ψ)/cos (π/3-ψ) is constant.
Therefore from (2.1):
Y=I(1+S*cos(ψ)/cos(π/3-ψ)) (2.10)
Thus can derive:
cos(ψ)/cos(π/3-ψ)=(Y-I)/(I*S) (2.11)
(2.11) are updated to (2.8) formula, and combine (1.5) and can obtain:
Y′=I(1+S′*(Y-I)/(I*S))
=I+S′*(Y-I)/S=I+F*(Y-I) (2.12)
Make F=1+ α further, then from (2.6), (2.7) and (2.12):
X′=I-F*S 1=I-S 1--αS 1=Min--αS 1(2.13)
Y′=I+F*(Y-I)=I+(Y-I)+α(Y-I)=Y+α(Y-I) (2.14)
To sum up analyze that to obtain conclusion as follows: given rgb value and saturation degree enhancer, variable I 3, S 3and S 1definition is shown in (2.6).If S 3=0 (being equivalent to S=0), then do not do any enhancing process.Otherwise there is following fast algorithm:
X &prime; = Min - &alpha;S 1 Y &prime; = Y + &alpha; ( Y - I ) Z &prime; = I 3 - X &prime; - Y &prime; - - - ( 2.15 )
Wherein Min=Min (R, G, B), α=F-1.X ', Y ' and Z ' are limited to [0,255], then have:
If Min (R, G, B)=B, then
B′=X′,R′=Y′,G′=Z′. (2.16)
If Min (R, G, B)=G, then
G′=X′,B′=Y′,R′=Z′. (2.17)
If Min (R, G, B)=R, then
R′=X′,G′=Y′,B′=Z′. (2.18)
Therefore, by obtaining the relational expression (1) of the present embodiment in conjunction with above formula, as shown in following formula (1a) ~ (1c):
If Min (R, G, B)=R,
Then B &prime; - B ( F - 1 ) * { 1 3 ( R + G + B ) - B } R &prime; = R + ( F - 1 ) * { R - 1 3 ( R + G + B ) } G &prime; = R + G + B - B &prime; - R &prime; - - - ( 1 a )
If Min (R, G, B)=R,
Then R &prime; = R - ( F - 1 ) * { 1 3 ( R + G + B ) - R } G &prime; = G + ( F - 1 ) * { G - 1 3 ( R + G + B ) } B &prime; = R + G + B - R &prime; - G &prime; - - - ( 1 b )
If Min (R, G, B)=G,
Then G &prime; = G - ( F - 1 ) * { 1 3 ( R + G + B ) - G } B &prime; = B + ( F - 1 ) * { B - 1 3 ( R + G + B ) } R &prime; = R + G + B - G &prime; - B &prime; - - - ( 1 c )
Wherein, R ', G ', B ' are respectively the rgb value after image saturation adjustment, and R, G, B are respectively the rgb value before image saturation adjustment, and F is saturation degree Dynamic gene.
In another embodiment, the relational expression (2) of the rgb value after described preset image saturation adjustment and the rgb value before image saturation adjustment is for shown in formula (2a) ~ (2c):
If Min (R, G, B)=B,
Then B &prime; = B - { 1 3 ( R + G + B ) - B } > > p 1 - { 1 3 ( R + G + B ) - B } > > p 2 - . . . - { 1 3 ( R + G + B ) - B } > > pm R &prime; = R + { R - 1 3 ( R + G + B ) } > > p 1 + { R - 1 3 ( R + G + B ) } > > p 2 + . . . + { R - 1 3 ( R + G + B ) } > > pm G &prime; = R + G + B - B &prime; - R &prime; - - - ( 2 a )
If Min (R, G, B)=R,
Then R &prime; = R - { 1 3 ( R + G + B ) - R } > > p 1 - { 1 3 ( R + G + B ) - R } > > p 2 - . . . - { 1 3 ( R + G + B ) - R } > > pm G &prime; = G + { G - 1 3 ( R + G + B ) } > > p 1 + { G - 1 3 ( R + G + B ) } > > p 2 + . . . + { G - 1 3 ( R + G + B ) } > > pm B &prime; = R + G + B - R &prime; - G &prime; - - - ( 2 b )
If Min (R, G, B)=G,
Then G &prime; = G - { 1 3 ( R + G + B ) - G } > > p 1 - { 1 3 ( R + G + B ) - G } > > p 2 - . . . - { 1 3 ( R + G + B ) - G } > > pm B &prime; = B + { B - 1 3 ( R + G + B ) } > > p 1 + { B - 1 3 ( R + G + B ) } > > p 2 + . . . + { B - 1 3 ( R + G + B ) } > > pm R &prime; = R + G + B - G &prime; - B &prime; - - - ( 2 c )
Wherein, R ', G ', B ' are respectively the rgb value after image saturation adjustment, and R, G, B are respectively the rgb value before image saturation adjustment, and F is saturation degree Dynamic gene, 1≤F≤2, and m be more than or equal to 1 integer; { 1 3 ( R + G + B ) - B } > > pm Representing will value to move to right pm position.
The place that the relational expression (2) of the present embodiment is different from the relational expression (1) of a upper embodiment is, in relational expression (1), exists and etc. corresponding multiple floating number multiplication.Value in view of F is scope [1,2], and floating number α in practical application=F-1 some discrete values often, such as 0.125,0.25,0.375,0.5 etc.Consider that the computing of floating number multiplication is more complicated, can affect arithmetic speed, therefore, the relational expression (2) of this enforcement is right and carrying out suitable adjustment etc. multiple floating number multiplication, is the shifting function of integer by floating number multiplication transformations.
Therefore, floating number multiplication relevant to α above can adopt shift operation to replace, such as α=0.5, then α S 1=S 1> > 1.In practical application, we can choose series of discrete α value, and the larger then saturation degree of α value strengthens more severe, otherwise more weak.When α=0, then without any enhancing.
Concrete, floating number α in practical application=F-1 is expressed as binary number, right and then suing for peace etc. carrying out various shifting function, just can obtain and .That is, floating number α=F-1 is expressed as: α=F-1=1/2 p1+ 1/2 p2+ ... + 1/2 pm, m be more than or equal to 1 integer; So, obtain:
( F - 1 ) * { 1 3 ( R + G + B ) - B } = { 1 3 ( R + G + B ) - B } > > p 1 + { 1 3 ( R + G + B ) - B } > > p 2 + . . . + { 1 3 ( R + G + B ) - B } > > pm .
( F - 1 ) * { R - 1 3 ( R + G + B } = ( F - 1 ) * { R - 1 3 ( R + G + B ) } > > p 1 + { R - 1 3 ( R + G + B ) } > > p 2 + . . . + { R - 1 3 ( R + G + B ) } > > pm
Such as, when floating number α=F-1 is 0.375, P can be carried out scale-of-two in conversion, obtain P=0.375=1/2 2+ 1/2 3, thus can obtain: ( F - 1 ) * { 1 3 ( R + G + B ) - B } = { 1 3 ( R + G + B ) - B } > > 2 + { 1 3 ( R + B + B ) - B } > > 3 .
Visible, the relational expression (2) that the present embodiment uses, adopts integer to be shifted the floating number multiplication that instead of in the relational expression (1) of above-described embodiment, reduces computational complexity, and improve arithmetic speed.
In addition, in the present embodiment, described relational expression (2) is applicable to improve image saturation, and namely the span of F is the situation of [1,2]; When needs reduce image saturation, when namely the value of F is scope [0,1], then use following relational expression (2 '), comprise following formula (2a ') ~ (2c '):
If Min (R, G, B)=B,
Then B &prime; = B + { 1 3 ( R + G + B ) - B } > > p 1 + { 1 3 ( R + G + B ) - B } > > p 2 + . . . + { 1 3 ( R + G + B ) - B } > > pm R &prime; = R - { R - 1 3 ( R + G + B ) } > > p 1 - { R - 1 3 ( R + G + B ) } > > p 2 - . . . + { R - 1 3 ( R + G + B ) } > > pm G &prime; = R + G + B - B &prime; - R &prime; - - - ( 2 a &prime; )
If Min (R, G, B)=R,
Then R &prime; = R + { 1 3 ( R + G + B ) - R } > > p 1 + { 1 3 ( R + G + B ) - R } > > p 2 + . . . + { 1 3 ( R + G + B ) - R } > > pm G &prime; = G - { G - 1 3 ( R + G + B ) } > > p 1 - { G - 1 3 ( R + G + B ) } > > p 2 - . . . - { G - 1 3 ( R + G + B ) } > > pm B &prime; = R + G + B - R &prime; - G &prime; - - - ( 2 b &prime; )
If Min (R, G, B)=G,
Then G &prime; = G + { 1 3 ( R + G + B ) - G } > > p 1 + { 1 3 ( R + G + B ) - G } > > p 2 + . . . + { 1 3 ( R + G + B ) - G } > > pm B &prime; = B - { B - 1 3 ( R + G + B ) } > > p 1 - { B - 1 3 ( R + G + B ) } > > p 2 - . . . - { B - 1 3 ( R + G + B ) } > > pm R &prime; = R + G + B - G &prime; - B &prime; - - - ( 2 c &prime; )
Wherein, R ', G ', B ' are respectively the rgb value after image saturation adjustment, and R, G, B are respectively the rgb value before image saturation adjustment, and F is saturation degree Dynamic gene, 0≤F≤1, and F - 1 = - ( 1 2 p 1 + 1 2 p 2 + . . . + 1 2 pm ) , M be more than or equal to 1 integer; { 1 3 ( R + G + B ) - B } > > pm Representing will { 1 3 ( R + G + B ) - B } Value to move to right pm position.
In another embodiment, the relational expression (3) of the rgb value after described preset image saturation adjustment and the rgb value before image saturation adjustment is following formula (3a) ~ (3d):
S 1 = 1 3 ( R + G + B ) - Min ( R , G , B ) ; level = ( F - 1 ) * 2 n ; - - - ( 3 a )
If Min (R, G, B)=B,
Then
If Min (R, G, B)=R,
Then
If Min (R, G, B)=G,
Then
Wherein, R ', G ', B ' are respectively the rgb value after image saturation adjustment, R, G, B are respectively the rgb value before image saturation adjustment, F is saturation degree Dynamic gene, > > n is expressed as and moves to right n position to the value asked for, > > k is expressed as and moves to right k position to the value asked for, 4≤n≤16,12≤k≤24, and n, k are integer; And TAB [S 1] value by search the table of comparisons obtain, prestore in the described table of comparisons and work as S 1=1,2 ..., 169, each TAB [S corresponding when 170 1] value, and TAB [S described in each 1] value obtains by following formula: TAB [S 1]=(int) (2 k/ S 1+ 0.5), wherein, int represents and rounds, and+0.5 represents and rounds up.
The relational expression (3) of the present embodiment and above-mentioned relation formula (2), (2 ') different place is, in relational expression (2), in (2 '), the scope that saturation degree Dynamic gene F limits is, 1≤F≤2 and 0≤F≤1, and the value of relational expression (3) to saturation degree Dynamic gene F that the present embodiment adopts is not restricted.Be described as follows:
In above-mentioned relation formula (2), in (2 '), shift operation can be adopted replace to the relevant floating number multiplication of floating number α=F-1.In practical application, we can choose series of discrete α value, and α value is larger, adjust more severe, otherwise more weak.When α=0, then without any adjustment.
But, also can exist when α value very large (namely F value is very large) time, likely cause the intensity value S ' after enhancing to be greater than 1, therefore need α=F-1 value to be limited in certain scope and make S ' in [0,1].Known by above-mentioned formula (2.13):
0≤S '≤1 is equivalent to X ' >=0 (2.19)
Therefore α value is modified to:
α=(X′≥0)?α:(Min/S 1) (2.20)
When X ' >=0, do not need to carry out correcting process to α;
As X ' < 0, know α=Min/S by (2.20) 1, any one integer V is had:
α*V=V*Min/S 1(2.21)
Visible, in formula (2.21), there is Min/S 1this division, namely unavoidablely must use divider, but uses divider often need use a look-up table (LUT), and it also causes result of calculation inaccurate.Even the error that this division causes can be amplified by multiplication routine afterwards further.
Therefore, in the relational expression (3) that the present embodiment uses, adopt multiplication of integers, to table look-up and shift operation substitutes division in (2.21) formula.(2.21) are rewritten into by we:
&alpha; * V = ( V * Min * 2 k S 1 ) > > k - - - ( 2.22 )
Because S 1value is in [0,170] scope, and we can by 2 k/ S 1be put in an array TAB [170], that is:
TAB[S 1]=(int)(2 k/S 1+0.5) (2.23)
Wherein S 1=1,2 ..., 169,170, int represents and rounds, and+0.5 represents and rounds up.Therefore (2.22) formula is evolved into:
α*V=(V*Min*TAB[S 1])>>k (2.24)
Wherein, the span of k is: 12≤k≤24, and k is preferably 16.
If S 1=0, then S=0, known by supposition above, do not do any enhancing process in this case.Therefore the S in above-mentioned formula 1non-zero.
In addition, when X '>=0, we introduce an integer variable level, represent the intensity that saturation degree strengthens, that is, α=F-1=level/2 n, the span of n is: 4≤n≤16, and n is preferably 8.Therefore the value of level can be [0,2 n], can also greater value be generalized in theory.Divided by 2 nbe equivalent to the n position that moves to right, be therefore equivalent to following formula about the calculating of X ' and Y ' in (2.15):
X′=Min-(level*S 1)>>n (2.25)
If X ' >=0, then
Y′=Y+(level*(Y-I))>>n (2.26)
If X ' < 0, then
Y′=Y+(Min*(Y-I)*TAB[S 1])>>k (2.27)
Wherein the definition of array TAB is shown in (2.24).
Then, according to conclusion formula (2.25), (2.26) and (2.27), to above-mentioned relation formula (1), namely formula (1a) ~ (1c) adjusts, thus obtain the relational expression (3) of the present embodiment, shown in following formula (3a) ~ (3d):
S 1 = 1 3 ( R + G + B ) - Min ( R , G , B ) ; level = ( F - 1 ) * 2 n ; - - - ( 3 a )
If Min (R, G, B)=B,
Then
If Min (R, G, B)=R,
Then
If Min (R, G, B)=G,
Then
Wherein, R ', G ', B ' are respectively the rgb value after image saturation adjustment, R, G, B are respectively the rgb value before image saturation adjustment, F is saturation degree Dynamic gene, > > n is expressed as and moves to right n position to the value asked for, > > k is expressed as and moves to right k position to the value asked for, 4≤n≤16,12≤k≤24, and n, k are integer; And TAB [S 1] value by search the table of comparisons obtain, prestore in the described table of comparisons and work as S 1=1,2 ..., 169, each TAB [S corresponding when 170 1] value, and TAB [S described in each 1] value obtains by following formula: TAB [S 1]=(int) (2 k/ S 1+ 0.5), wherein, int represents and rounds, and+0.5 represents and rounds up.
Visible, the relational expression (3) that the present embodiment uses, do not limit the span of saturation degree Dynamic gene F, applied widely, and by adopt table look-up, integer displacement and multiplication of integers replace floating number multiplication and division, reduce further computational complexity, improve arithmetic speed, and decrease the error of calculating.
With reference to figure 3, it is the structured flowchart of the first embodiment of the device of adjustment image saturation of the present invention.The device of this adjustment image saturation comprises:
Storage unit 201, for storing a relational expression pre-set, described relational expression is used for the relation of the rgb value before the rgb value after the adjustment of Description Image saturation degree and image saturation adjustment; Wherein said relational expression turns by RGB the formulae discovery that the formula of HSI, saturation degree adjustment formula and HSI turn RGB and obtains;
Receiving element 202, for receiving RGB image and adjustment parameter, and based on the rgb value before the described RGB image zooming-out image saturation adjustment received;
Computing unit 203, for the rgb value before described image saturation adjustment and adjustment parameter being substituted in described relational expression, calculates the rgb value after image saturation adjustment;
Adjustment unit 204, based on the rgb value after described image saturation adjustment, carries out saturation degree adjustment to described RGB image, obtains the RGB image after adjustment;
Output unit 205, exports the RGB image after described adjustment.
Same, in the present embodiment, above-mentioned adjustment parameter comprises saturation degree Dynamic gene.And in the image saturation adjustment of reality, can comprise and strengthen or reduce image saturation, therefore, above-mentioned saturation degree Dynamic gene comprises saturation degree and strengthens/reduce the factor.
The device of the adjustment image saturation of the present embodiment transfers the conversion of two color model of rgb space to without the need to transferring HSI space and HSI space to through rgb space, but based on input RGB image rgb value and adjustment parameter, the rgb value after image saturation adjustment is directly calculated by the formula preset, realize adjust the saturation degree of RGB image, calculated amount is few, take the few and raising processing speed of computational resource.
In the present embodiment, as shown in Figure 3, the relational expression (1) that described storage unit 201 prestores is following formula (1a) ~ (1c):
If Min (R, G, B)=B,
Then B &prime; = B - ( F - 1 ) * { 1 3 ( R + G + B ) - B } R &prime; = R + ( F - 1 ) * { R - 1 3 ( R + G + B ) } G &prime; = R + G + B - B &prime; - R &prime; - - - ( 1 a )
If Min (R, G, B)=R,
Then R &prime; = R - ( F - 1 ) * { 1 3 ( R + G + B ) - R } G &prime; = G + ( F - 1 ) * { G - 1 3 ( R + G + B ) } B &prime; = R + G + B - R &prime; - G &prime; - - - ( 1 b )
If Min (R, G, B)=G,
Then G &prime; = G - ( F - 1 ) * { 1 3 ( R + G + B ) - G } B &prime; = B + ( F - 1 ) * { B - 1 3 ( R + G + B ) } R &prime; = R + G + B - G &prime; - B &prime; - - - ( 1 c )
Wherein, R ', G ', B ' are respectively the rgb value after image saturation adjustment, and R, G, B are respectively the rgb value before image saturation adjustment, and F is saturation degree Dynamic gene.
Wherein, relational expression (1) turns by RGB the formulae discovery that the formula of HSI, saturation degree adjustment formula and HSI turn RGB and obtains, and describes, do not repeat them here above specifically referring to.
In another structured flowchart of the present embodiment, as shown in Figure 4, the relational expression (2) that prestores of described storage unit 301 is for shown in formula (2a) ~ (2c):
If Min (R, G, B)=B,
Then B &prime; = B - { 1 3 ( R + G + B ) - B } > > p 1 - { 1 3 ( R + G + B ) - B } > > p 2 - . . . - { 1 3 ( R + G + B ) - B } > > pm R &prime; = R + { R - 1 3 ( R + G + B ) } > > p 1 + { R - 1 3 ( R + G + B ) } > > p 2 + . . . + { R - 1 3 ( R + G + B ) } > > pm G &prime; = R + G + B - B &prime; - R &prime; - - - ( 2 a )
If Min (R, G, B)=R,
Then R &prime; = R - { 1 3 ( R + G + B ) - R } > > p 1 - { 1 3 ( R + G + B ) - R } > > p 2 - . . . - { 1 3 ( R + G + B ) - R } > > pm G &prime; = G + { G - 1 3 ( R + G + B ) } > > p 1 + { G - 1 3 ( R + G + B ) } > > p 2 + . . . + { G - 1 3 ( R + G + B ) } > > pm B &prime; = R + G + B - R &prime; - G &prime; - - - ( 2 b )
If Min (R, G, B)=G,
Then G &prime; = G - { 1 3 ( R + G + B ) - G } > > p 1 - { 1 3 ( R + G + B ) - G } > > p 2 - . . . - { 1 3 ( R + G + B ) - G } > > pm B &prime; = B + { B - 1 3 ( R + G + B ) } > > p 1 + { B - 1 3 ( R + G + B ) } > > p 2 + . . . + { B - 1 3 ( R + G + B ) } > > pm R &prime; = R + G + B - G &prime; - B &prime; - - - ( 2 c )
Wherein, R ', G ', B ' are respectively the rgb value after image saturation adjustment, and R, G, B are respectively the rgb value before image saturation adjustment, and F is saturation degree Dynamic gene, 1≤F≤2, and F - 1 = 1 2 p 1 + 1 2 p 2 + &CenterDot; &CenterDot; &CenterDot; + 1 2 pm , M be more than or equal to 1 integer; { 1 3 ( R + G + B ) - B } > > pm Representing will { 1 3 ( R + G + B ) - B } Value to move to right pm position.
The relational expression (2) that the storage unit 301 of the present embodiment prestores, adopts integer to be shifted the floating number multiplication that instead of in the relational expression (1) of above-described embodiment, reduces computational complexity, and improve arithmetic speed.
In addition, in the present embodiment, described relational expression (2) is applicable to improve image saturation, and namely the span of F is the situation of [1,2]; When needs reduce image saturation, when namely the value of F is scope [0,1], then the relational expression (2 ') using described storage unit 301 to prestore, comprises following formula (2a ') ~ (2c '):
If Min (R, G, B)=B,
Then B &prime; = B + { 1 3 ( R + G + B ) - B } > > p 1 + { 1 3 ( R + G + B ) - B } > > p 2 + . . . + { 1 3 ( R + G + B ) - B } > > pm R &prime; = R - { R - 1 3 ( R + G + B ) } > > p 1 - { R - 1 3 ( R + G + B ) } > > p 2 - . . . - { R - 1 3 ( R + G + B ) } > > pm G &prime; = R + G + B - B &prime; - R &prime; - - - ( 2 a &prime; )
If Min (R, G, B)=R,
Then R &prime; = R + { 1 3 ( R + G + B ) - R } > > p 1 + { 1 3 ( R + G + B ) - R } > > p 2 + . . . + { 1 3 ( R + G + B ) - R } > > pm G &prime; = G - { G - 1 3 ( R + G + B ) } > > p 1 - { G - 1 3 ( R + G + B ) } > > p 2 - . . . - { G - 1 3 ( R + G + B ) } > > pm B &prime; = R + G + B - R &prime; - G &prime; - - - ( 2 b &prime; )
If Min (R, G, B)=G,
Then G &prime; = G + { 1 3 ( R + G + B ) - G } > > p 1 + { 1 3 ( R + G + B ) - G } > > p 2 + . . . + { 1 3 ( R + G + B ) - G } > > pm B &prime; = B - { B - 1 3 ( R + G + B ) } > > p 1 - { B - 1 3 ( R + G + B ) } > > p 2 - . . . - { B - 1 3 ( R + G + B ) } > > pm R &prime; = R + G + B - G &prime; - B &prime; - - - ( 2 c &prime; )
Wherein, R ', G ', B ' are respectively the rgb value after image saturation adjustment, and R, G, B are respectively the rgb value before image saturation adjustment, and F is saturation degree Dynamic gene, 0≤F≤1, and F - 1 = - ( 1 2 p 1 + 1 2 p 2 + &CenterDot; &CenterDot; &CenterDot; + 1 2 pm ) , M be more than or equal to 1 integer; { 1 3 ( R + G + B ) - B } > > pm Representing will { 1 3 ( R + G + B ) - B } Value to move to right pm position.
In another structured flowchart of the present embodiment, as shown in Figure 5, relational expression (3) following formula (3a) ~ (3d) that prestore of described storage unit 401:
S 1 = 1 3 ( R + G + B ) - Min ( R , G , B ) ; level = ( F - 1 ) * 2 n - - - ( 3 a )
If Min (R, G, B)=B,
Then
If Min (R, G, B)=R,
Then
If Min (R, G, B)=G,
Then
Wherein, R ', G ', B ' are respectively the rgb value after image saturation adjustment, R, G, B are respectively the rgb value before image saturation adjustment, F is saturation degree Dynamic gene, > > n is expressed as and moves to right n position to the value asked for, > > k is expressed as and moves to right k position to the value asked for, 4≤n≤16,12≤k≤24, and n, k are integer; And TAB [S 1] value by search the table of comparisons obtain, prestore in the described table of comparisons and work as S 1=1,2 ..., 169, each TAB [S corresponding when 170 1] value, and TAB [S described in each 1] value obtains by following formula: TAB [S 1]=(int) (2 k/ S 1+ 0.5), wherein, int represents and rounds, and+0.5 represents and rounds up.
In addition, the storage unit 401 of the present embodiment also stores the table of comparisons, can by S1=1,2 ..., 169,170 TAB [S1] array values (being calculated by above-mentioned formula (2.27)) corresponding when 170 are prestored in the table of comparisons, when calculating the S1 value of Image Adjusting, the value of TAB [S1] can be obtained by searching the table of comparisons, then substituting in above-mentioned relation formula (3).
The device of the present embodiment adjustment image saturation passes through the preset relational expression (3) of storage unit 401 and the table of comparisons, do not limit the span of saturation degree Dynamic gene F, applied widely, and by adopt table look-up, integer displacement and multiplication of integers replace floating number multiplication and division, reduce further computational complexity, improve arithmetic speed, and decrease the error of calculating.
With reference to figure 6, it is the schematic flow sheet of the second embodiment of the method for adjustment image saturation of the present invention.The method of this adjustment image saturation comprises step:
S501, reception RGB image and adjustment parameter, and based on the described RGB image zooming-out image attributes parameter received; Wherein, described image attributes parameter comprises the red, green, blue value before image saturation adjustment, and described adjustment parameter comprises saturation degree Dynamic gene;
S502, to be obtained image saturation adjustment by formula (1) before red, green, blue value with value, image saturation adjustment before brightness and image saturation adjust before saturation degree and the product value of brightness:
I 3 = R + G + B I = I 3 * 1 3 S 1 = I - Min ( R , G , B ) - - - ( 1 )
Wherein, I 3for described and value, S 1for described product value, I is the brightness before image saturation adjustment, and R, G, B are respectively the red, green, blue value before image saturation adjustment;
S503, to be obtained the second reference value before image saturation adjustment by formula (2):
Wherein, Y is the second reference value before image saturation adjustment, and R, G, B are respectively the red, green, blue value before image saturation adjustment;
S504, to be obtained the first reference value, the second reference value and the 3rd reference value after image saturation adjustment by formula (3):
X &prime; = Min ( R , G , B ) - &alpha;S 1 Y &prime; = Y + &alpha; ( Y - I ) Z &prime; = I 3 - X &prime; - Y &prime; - - - ( 3 )
Wherein, R, G, B are respectively the red, green, blue value before image saturation adjustment, I 3for described and value, S 1for described product value, I is the brightness before image saturation adjustment, and Y is the second reference value before image saturation adjustment, and X ', Y ' and Z ' are respectively the first reference value, the second reference value and the 3rd reference value after image saturation adjustment, α=F-1, F are described saturation degree Dynamic gene;
S505, to be obtained the red, green, blue value after image saturation adjustment by formula (4):
Wherein, R ', G ', B ' are respectively the red, green, blue value after image saturation adjustment, R, G, B are respectively the red, green, blue value before image saturation adjustment, and X ', Y ' and Z ' are respectively the first reference value, the second reference value and the 3rd reference value after image saturation adjustment;
S506, based on the red, green, blue value after the adjustment of described image saturation, saturation degree adjustment is carried out to described RGB image, obtain the RGB image after adjustment;
S507, export the RGB image after described adjustment.
Same, the method for the adjustment image saturation of the present embodiment can be used for adjusting image saturation.In the image saturation adjustment of reality, can comprise and strengthen or reduce image saturation, therefore, above-mentioned saturation degree Dynamic gene comprises saturation degree and strengthens/reduce the factor.
The method of the adjustment image saturation of the present embodiment transfers the conversion of two color model of rgb space to without the need to transferring HSI space and HSI space to through rgb space, but based on input RGB image rgb value and adjustment parameter, the rgb value after image saturation adjustment is directly calculated by the formula preset, realize adjust the saturation degree of RGB image, calculated amount is few, take the few and raising processing speed of computational resource.
In another realization flow of the method for the present embodiment adjustment image saturation, as shown in Figure 7, wherein, step S601 ~ S603, S605 ~ S607 step step corresponding with Fig. 6 is consistent, unlike, in described step S604, replace the formula (3) in the step S504 shown in Fig. 6 by following formula (3 '), the first reference value, the second reference value and the 3rd reference value with after the adjustment of computed image saturation degree:
X &prime; = Min ( R , G , B ) - ( S 1 > > p 1 + S 1 > > p 2 + . . . + S 1 > > pm ) Y &prime; = Y + ( Y - I ) > > p 1 + ( Y - I ) > > p 2 + . . . + ( Y - I ) > > pm Z &prime; = I 3 - X &prime; - Y &prime; - - - ( 3 )
Wherein, R, G, B are respectively the red, green, blue value before image saturation adjustment, I 3for described and value, S 1for described product value, I is the brightness before image saturation adjustment, and Y is the second reference value before image saturation adjustment, and X ', Y ' and Z ' are respectively the first reference value, the second reference value and the 3rd reference value after image saturation adjustment; α=F-1, F are saturation degree Dynamic gene, 1≤F≤2, and m be more than or equal to 1 integer; S 1> > pm represents S 1value to move to right pm position.
In the present embodiment, due to the formula (3) adopting the formula (3 ') of integer displacement to instead of the floating number multiplication in above-mentioned Fig. 6, thus reduce computational complexity, and improve arithmetic speed.
In addition, in the present embodiment, described relational expression (3 ') is applicable to improve image saturation, and namely the span of F is the situation of [1,2]; When needs reduce image saturation, namely the value of F is scope [0,1] when, as shown in Figure 8, wherein, step S701 ~ S703, S705 ~ S707 step step corresponding with Fig. 6 is consistent, unlike, in described step S704, use following formula (3 ") replace the formula (3) in the step S504 shown in above-mentioned Fig. 6, with computed image saturation degree adjustment after the first reference value, the second reference value and the 3rd reference value:
X &prime; = Min ( R , G , B ) - ( S 1 > > p 1 + S 1 > > p 2 + . . . + S 1 > > pm ) Y &prime; = Y - ( Y - I ) > > p 1 - ( Y - I ) > > p 2 - . . . - ( Y - I ) > > pm Z &prime; = I 3 - X &prime; - Y &prime; - - - ( 3 &Prime; )
Wherein, R, G, B are respectively the red, green, blue value before image saturation adjustment, I 3for described and value, S 1for described product value, I is the brightness before image saturation adjustment, and Y is the second reference value before image saturation adjustment, and X ', Y ' and Z ' are respectively the first reference value, the second reference value and the 3rd reference value after image saturation adjustment; α=F-1, F are saturation degree Dynamic gene, 0≤F≤1, and m be more than or equal to 1 integer; S 1> > pm represents S 1value to move to right pm position.
In another realization flow of the method for the present embodiment adjustment image saturation, as shown in Figure 9, step S801 ~ S803, S805 ~ S807 step step corresponding with Fig. 6 is consistent, unlike, in described step S804, following formula (3 " ') is used to replace formula (3) in the step S504 shown in above-mentioned Fig. 6, the first reference value, the second reference value and the 3rd reference value with after the adjustment of computed image saturation degree:
Wherein, R, G, B are respectively the red, green, blue value before image saturation adjustment, I 3for described and value, S 1for described product value, I is the brightness before image saturation adjustment, and Y is the second reference value before image saturation adjustment, and X ', Y ' and Z ' are respectively the first reference value, the second reference value and the 3rd reference value after image saturation adjustment; Level=α * 2 n=(F-1) * 2 nf is saturation degree Dynamic gene, and > > n is expressed as and moves to right n position to the value asked for, and > > k is expressed as and moves to right k position to the value asked for, the span of n, k is: 4≤n≤16,12≤k≤24; And TAB [S 1] value by search the table of comparisons obtain, prestore in the described table of comparisons as described product value S 1=1,2 ..., 169, each TAB [S corresponding when 170 1] value, and TAB [S described in each 1] value obtains by following formula: TAB [S 1]=(int) (2 k/ S 1+ 0.5), int represents and rounds, and+0.5 represents and rounds up.
In the present embodiment, table look-up owing to adopting, the formula relationship formula (3 " ') of integer displacement and multiplication of integers and the table of comparisons; do not limit the span of saturation degree Dynamic gene F; applied widely; and table look-up by adopting, integer displacement and multiplication of integers replace floating number multiplication and division; reduce further computational complexity, improve arithmetic speed, and decrease the error of calculating.
With reference to Figure 10, it is the structured flowchart of the second embodiment of the device of adjustment image saturation of the present invention.The device of this adjustment image saturation comprises:
Receiving element 801, for receiving RGB image and adjustment parameter, and based on the described RGB image zooming-out image attributes parameter received; Wherein, described image attributes parameter comprises the red, green, blue value before image saturation adjustment, and described adjustment parameter comprises saturation degree Dynamic gene;
Computing unit 802, for according to the red, green, blue value before the adjustment of described image saturation and described saturation degree Dynamic gene, calculates the red, green, blue value after image saturation adjustment, comprising:
First computing module 8021, the red, green, blue value before obtaining image saturation adjustment by formula (1) with value, image saturation adjustment before brightness and image saturation adjust before saturation degree and the product value of brightness:
I 3 = R + G + B I = I 3 * 1 3 S 1 = I - Min ( R , G , B ) - - - ( 1 )
Wherein, I 3for described and value, S 1for described product value, I is the brightness before image saturation adjustment, and R, G, B are respectively the red, green, blue value before image saturation adjustment;
Second computing module 8022, obtains the second reference value before image saturation adjustment by formula (2):
Wherein, Y is the second reference value before image saturation adjustment, and R, G, B are respectively the red, green, blue value before image saturation adjustment;
3rd computing module 8023, obtains the first reference value, the second reference value and the 3rd reference value after image saturation adjustment by formula (3):
x &prime; = Min ( R , G , B ) - &alpha;S 1 Y &prime; = Y + &alpha; ( Y - I ) Z &prime; = I 3 - X &prime; - Y &prime; - - - ( 3 )
Wherein, I 3for described and value, S 1for described product value, I is the brightness before image saturation adjustment, R, G, B are respectively the red, green, blue value before image saturation adjustment, Y is the second reference value before image saturation adjustment, X ', Y ' and Z ' are respectively the first reference value, the second reference value and the 3rd reference value after image saturation adjustment, α=F-1, F are described saturation degree Dynamic gene;
4th computing module 8024, obtains the red, green, blue value after image saturation adjustment by formula (4):
Wherein, R ', G ', B ' are respectively the red, green, blue value after image saturation adjustment, R, G, B are respectively the red, green, blue value before image saturation adjustment, and X ', Y ' and Z ' are respectively the first reference value, the second reference value and the 3rd reference value after image saturation adjustment;
Adjustment unit 803, based on the red, green, blue value after described image saturation adjustment, carries out saturation degree adjustment to described RGB image, thus obtains the RGB image after adjustment; And
Output unit 804, for exporting the RGB image after described adjustment.
Same, the device of the adjustment image saturation of the present embodiment can be used for adjusting image saturation.In the image saturation adjustment of reality, can comprise and strengthen or reduce image saturation, therefore, above-mentioned saturation degree Dynamic gene comprises saturation degree and strengthens/reduce the factor.
The device of the adjustment image saturation of the present embodiment transfers the conversion of two color model of rgb space to without the need to transferring HSI space and HSI space to through rgb space, but based on input RGB image rgb value and adjustment parameter, the rgb value after image saturation adjustment is directly calculated by the formula preset, realize adjust the saturation degree of RGB image, calculated amount is few, take the few and raising processing speed of computational resource.
Realize in structure at another of installation method of the present embodiment adjustment image saturation, as shown in figure 11, in the 3rd computing module 9023, by being replaced the formula (3) adopted in the 3rd computing module 8023 shown in Figure 10 by following formula (3 '), the first reference value, the second reference value and the 3rd reference value with after the adjustment of computed image saturation degree:
X &prime; = Min ( R , G , B ) - ( S 1 > > p 1 + S 1 > > p 2 + . . . + S 1 > > pm ) Y &prime; = Y + ( Y - I ) > > p 1 + ( Y - I ) > > p 2 + . . . + ( Y - I ) > > pm Z &prime; = I 3 - X &prime; - Y &prime; - - - ( 3 &prime; )
Wherein, R, G, B are respectively the red, green, blue value before image saturation adjustment, I 3for described and value, S 1for described product value, I is the brightness before image saturation adjustment, and Y is the second reference value before image saturation adjustment, and X ', Y ' and Z ' are respectively the first reference value, the second reference value and the 3rd reference value after image saturation adjustment; α=F-1, F are saturation degree Dynamic gene, 1≤F≤2, and m be more than or equal to 1 integer; S 1> > pm represents S 1value to move to right pm position.
In addition, in the present embodiment, described relational expression (3 ') is applicable to improve image saturation, and namely the span of F is the situation of [1,2]; When needs reduce image saturation, when namely the value of F is scope [0,1], as shown in figure 11, then use relational expression in the 3rd computing module 9023 (3 "):
X &prime; = Min ( R , G , B ) - ( S 1 > > p 1 + S 1 > > p 2 + . . . + S 1 > > pm ) Y &prime; = Y - ( Y - I ) > > p 1 + ( Y - I ) > > p 2 - . . . - ( Y - I ) > > pm Z &prime; = I 3 - X &prime; - Y &prime; - - - ( 3 &prime; &prime; )
Wherein, R, G, B are respectively the red, green, blue value before image saturation adjustment, I 3for described and value, S 1for described product value, I is the brightness before image saturation adjustment, and Y is the second reference value before image saturation adjustment, and X ', Y ' and Z ' are respectively the first reference value, the second reference value and the 3rd reference value after image saturation adjustment; α=F-1, F are saturation degree Dynamic gene, 0≤F≤1, and m be more than or equal to 1 integer; S 1> > pm represents S 1value to move to right pm position.
Realize in structure at another of installation method of the present embodiment adjustment image saturation, as shown in figure 12, in the 3rd computing module 10023, by being replaced the formula (3) adopted in the 3rd computing module 8023 shown in Figure 10 by following formula (3 " '), the first reference value, the second reference value and the 3rd reference value with after the adjustment of computed image saturation degree:
Wherein, R, G, B are respectively the red, green, blue value before image saturation adjustment, I 3for described and value, S 1for described product value, I is the brightness before image saturation adjustment, and Y is the second reference value before image saturation adjustment, and X ', Y ' and Z ' are respectively the first reference value, the second reference value and the 3rd reference value after image saturation adjustment; Level=α * 2 n=(F-1) * 2 nf is saturation degree Dynamic gene, and > > n is expressed as and moves to right n position to the value asked for, and > > k is expressed as and moves to right k position to the value asked for, the span of n, k is: 4≤n≤16,12≤k≤24; And TAB [S 1] value by search the table of comparisons obtain, prestore in the described table of comparisons as described product value S 1=1,2 ..., 169, each TAB [S corresponding when 170 1] value, and TAB [S described in each 1] value obtains by following formula: TAB [S 1]=(int) (2 k/ S 1+ 0.5), int represents and rounds, and+0.5 represents and rounds up.
In addition, 3rd computing module 10023 of the present embodiment also stores the table of comparisons, can by S1=1,2 ..., 169,170 TAB [S1] array values (being calculated by above-mentioned formula (2.27)) corresponding when 170 are prestored in the table of comparisons, when calculating the S1 value of Image Adjusting, the value of TAB [S1] can be obtained by searching the table of comparisons, then substituting in above-mentioned relation formula (3 " ').
The device of the present embodiment adjustment image saturation is by relational expression in the 3rd computing module 10023 (3 " ') and the table of comparisons; do not limit the span of saturation degree Dynamic gene F; applied widely; and table look-up by adopting, integer displacement and multiplication of integers replace floating number multiplication and division; reduce further computational complexity; improve arithmetic speed, and decrease the error of calculating.
With reference to Figure 13, it is the schematic flow sheet of the 3rd embodiment of the method for adjustment image saturation of the present invention.The method of this adjustment image saturation comprises step:
S1101, provide image saturation adjust before rgb value and saturation degree Dynamic gene;
S1102, calculate described image saturation adjustment before rgb value be added after first and value;
S1103, described and value be multiplied by the first product value after 1/3 as the brightness value before image saturation adjustment;
S1104, judge described image saturation adjustment before rgb value in minimum value;
S1105, calculate the first difference between described brightness value and described minimum value;
S1106, according to described minimum value, obtain the second reference value before image saturation adjustment: when minimum value is B value, using R value as the second reference value before described image saturation adjusts; When minimum value is R value, using G value as the second reference value before described image saturation adjustment; When minimum value is G value, using B value as the second reference value before described image saturation adjustment;
S1107, described saturation degree Dynamic gene is subtracted 1 process after the second difference be multiplied with described first difference, obtain the second product value, and using the 3rd difference between described minimum value and described second product value as the first reference value after image saturation adjusts;
S1108, the second reference value before the adjustment of described image saturation to be multiplied with described second difference with the 4th difference between described brightness value, obtain the 3rd product value, using second and value between the second reference value before described image saturation adjustment and described 3rd product value as the second reference value after image saturation adjustment;
S1109, to deduct the 5th difference of the first reference value after the adjustment of described image saturation and the second reference value after image saturation adjustment by described first and value as the 3rd reference value after image saturation adjustment; And
S11010, according to described minimum value, obtain the rgb value after image saturation adjustment: when minimum value is B value, the first reference value after the adjustment of described image saturation, the second reference value, the 3rd reference value correspond to image saturation adjust after B, R and G value; When minimum value is R value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to R, G and B value after image saturation adjustment; When minimum value is G value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to G, B and R value after image saturation adjustment.
In the image saturation adjustment of reality, can comprise and strengthen or reduce image saturation, therefore, above-mentioned saturation degree Dynamic gene comprises saturation degree and strengthens/reduce the factor.
The method of the adjustment image saturation of the present embodiment transfers the conversion of two color model of rgb space to without the need to transferring HSI space and HSI space to through rgb space, but based on input RGB image rgb value and adjustment parameter, the rgb value after image saturation adjustment is directly calculated by the formula preset, realize adjust the saturation degree of RGB image, calculated amount is few, take the few and raising processing speed of computational resource.
With reference to Figure 14, it is the structured flowchart of the 3rd embodiment of the device of adjustment image saturation of the present invention.The device of this adjustment image saturation comprises:
Extraction apparatus 131, for receiving RGB image and adjustment parameter, and extract R, G, B value before the image saturation adjustment of described RGB image, wherein said adjustment parameter comprises saturation degree Dynamic gene F;
First adder 132, for calculating first and value Δ T1 after R, G, B value addition before the adjustment of described image saturation;
First multiplier 133, using the first product value between described first and value Δ T1 and 1/3 as the brightness value V before image saturation adjustment;
Comparer 134, for R, G, B value before more described image saturation adjustment, and exports minimum M in;
First subtracter 135, calculates the first difference DELTA M1 of Min between described brightness value V and described minimum value;
First judging unit 136, according to described minimum M in, judges the second reference value Y before obtaining image saturation adjustment: when minimum value is B value, using R value as the second reference value Y before described image saturation adjustment; When minimum value is R value, using G value as the second reference value Y before described image saturation adjustment; When minimum value is G value, using B value as the second reference value Y before described image saturation adjustment;
Second subtracter 137, after described saturation degree Dynamic gene is subtracted 1 process, obtains the second difference DELTA M2;
Second multiplier 138, for calculating the second product value Δ H2 between the second difference DELTA M2 and described first difference DELTA M1;
3rd subtracter 139, deducts described second product value Δ H2 obtain the 3rd difference for calculating described minimum M in, and described 3rd difference is as the first reference value X ' after image saturation adjustment;
4th subtracter 1300, for calculating the 4th difference DELTA M4 between the second reference value Y before the adjustment of described image saturation and described brightness value V;
3rd multiplier 1301, for calculating the 3rd product value Δ H3 of Δ M2 between described 4th difference DELTA M4 and described second difference;
Second adder 1302, for calculate described image saturation adjustment before the second reference value Y and described 3rd product value Δ H3 between second and value, described second and value as image saturation adjust after the second reference value Y ';
5th subtracter 1303, for by first and value Δ T1 deduct described image saturation adjustment after the first reference value X ' and image saturation adjustment after the second reference value Y ' obtain the 5th difference, described 5th difference as image saturation adjust after the 3rd reference value Z '; And
Second judging unit 1304, according to described minimum M in, judge R ', G ' after obtaining image saturation adjustment, B ' value: when minimum value is B value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to B ', R ' after image saturation adjustment and G ' value; When minimum value is R value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to R ', G ' after image saturation adjustment and B ' value; When minimum value is G value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to G ', B ' after image saturation adjustment and R ' value.
In the image saturation adjustment of reality, can comprise and strengthen or reduce image saturation, therefore, above-mentioned saturation degree Dynamic gene comprises saturation degree and strengthens/reduce the factor.
With reference to Figure 15, it is the schematic flow sheet of the 4th embodiment of the method for adjustment image saturation of the present invention.The method of this adjustment image saturation comprises step:
1401, the rgb value before providing image saturation to adjust and saturation degree Dynamic gene, the span of described saturation degree Dynamic gene is [0,2];
1402, first and value after the rgb value calculated before the adjustment of described image saturation is added;
1403, described and value are multiplied by first product value of 1/3 as the brightness value before image saturation adjustment;
1404, the minimum value in the rgb value before the adjustment of described image saturation is judged;
1405, the first difference between described brightness value and described minimum value is calculated;
1406, according to described minimum value, the second reference value before image saturation adjustment is obtained: when minimum value is B value, using R value as the second reference value before described image saturation adjustment; When minimum value is R value, using G value as the second reference value before described image saturation adjustment; When minimum value is G value, using B value as the second reference value before described image saturation adjustment;
1407, the second difference after described saturation degree Dynamic gene being subtracted 1 process converts binary value to, described first difference is carried out corresponding shifting function based on described binary value, obtains at least one first off-set value;
1408, described saturation degree Dynamic gene is compared with 1, if be more than or equal to 1, then using the 3rd difference between described minimum value and at least one first off-set value described as the first reference value after image saturation adjusts; Otherwise using second between described minimum value and at least one first off-set value described be worth as the first reference value after image saturation adjusts;
1409, calculate the 4th difference between the second reference value before the adjustment of described image saturation and described brightness value, and described 4th difference is carried out corresponding shifting function based on described binary value, obtain at least one second off-set value;
If 14010 described saturation degree Dynamic gene are more than or equal to 1, then using the 3rd between the second reference value before the adjustment of described image saturation and at least one second off-set value described and value as the second reference value after image saturation adjustment; Otherwise, then using the 5th difference between the second reference value before the adjustment of described image saturation and at least one second off-set value described as the second reference value after image saturation adjustment;
14011, the 6th difference of the second reference value after the first reference value after the adjustment of described image saturation and image saturation adjustment is deducted as the 3rd reference value after image saturation adjustment by described first and value; And
14012, according to described minimum value, obtain the rgb value after image saturation adjustment: when minimum value is B value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to B, R and G value after image saturation adjustment; When minimum value is R value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to R, G and B value after image saturation adjustment; When minimum value is G value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to G, B and R value after image saturation adjustment.
In the image saturation adjustment of reality, can comprise and strengthen or reduce image saturation, therefore, above-mentioned saturation degree Dynamic gene comprises saturation degree and strengthens/reduce the factor.
In addition, compared with the method shown in Figure 13, the method for the adjustment image saturation of the present embodiment adopts integer displacement to instead of the floating number multiplication of Figure 13 method, reduces computational complexity, and improves arithmetic speed.
With reference to Figure 16, it is the structured flowchart of the 4th embodiment of the device of adjustment image saturation of the present invention.The device of this adjustment image saturation comprises:
Extraction apparatus 151, for receiving RGB image and adjustment parameter, and extract R, G, B value before the image saturation adjustment of described RGB image, wherein said adjustment parameter comprises saturation degree Dynamic gene F, and the span of described saturation degree Dynamic gene F is [1,2];
First adder 152, for calculating first and value Δ T1 after R, G, B value addition before the adjustment of described image saturation;
Multiplier 153, using described first and value Δ T1 and 1/3 product value as image saturation adjustment before brightness value V;
First comparer 154, for R, G, B value before more described image saturation adjustment, and exports minimum M in;
First subtracter 155, calculates the first difference DELTA M1 between described brightness value V and described minimum M in;
First judging unit 156, according to described minimum M in, judges the second reference value Y before obtaining image saturation adjustment: when minimum value is B value, using R value as the second reference value Y before described image saturation adjustment; When minimum value is R value, using G value as the second reference value Y before described image saturation adjustment; When minimum value is G value, using B value as the second reference value Y before described image saturation adjustment;
Second subtracter 157, after described saturation degree Dynamic gene F is subtracted 1 process, obtains the second difference DELTA M2;
Binary translator 158, for converting described second difference DELTA M2 to binary value Δ M2 ';
First shift unit 159, for described first difference DELTA M1 is carried out corresponding shifting function based on described binary value Δ M2 ', obtains at least one first off-set value T1;
Second comparer 1500, compares size with by described saturation degree Dynamic gene F with 1;
3rd subtracter 1501, for when described saturation degree Dynamic gene F is more than or equal to 1, calculate the 3rd difference between described minimum M in and at least one first off-set value T1 described, described 3rd difference is as the first reference value X ' after image saturation adjustment;
Second adder 1502, for when described saturation degree Dynamic gene F is less than 1, calculate second between described minimum M in and at least one first off-set value T1 described and value adjust as image saturation after the first reference value X ';
4th subtracter 1503, for calculating the 4th difference DELTA M4 between the second reference value Y before the adjustment of described image saturation and described brightness value V;
Second shift unit 1504, for described 4th difference DELTA M4 is carried out corresponding shifting function based on described binary value Δ M2 ', obtains at least one second off-set value T2;
Second adder 1505, for when described saturation degree Dynamic gene F is more than or equal to 1, calculate described image saturation adjustment before the second reference value Y and at least one second off-set value T2 described between the 3rd and value, the described 3rd and value as image saturation adjust after the second reference value Y ';
5th subtracter 1506, for when described saturation degree Dynamic gene F is less than 1, the second reference value Y ' after the 5th difference calculated between the second reference value Y before the adjustment of described image saturation and at least one second off-set value T2 described adjusts as image saturation;
6th subtracter 1507, for by first and value Δ T1 deduct described image saturation adjustment after the first reference value X ' and image saturation adjustment after the second reference value Y ' obtain the 6th difference, described 6th difference as image saturation adjust after the 3rd reference value Z '; And
Second judging unit 1508, according to described minimum M in, judge the rgb value after obtaining image saturation adjustment: when minimum value is B value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to B, R and G value after image saturation adjustment; When minimum value is R value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to R, G and B value after image saturation adjustment; When minimum value is G value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to G, B and R value after image saturation adjustment.
In the image saturation adjustment of reality, can comprise and strengthen or reduce image saturation, therefore, above-mentioned saturation degree Dynamic gene comprises saturation degree and strengthens/reduce the factor.
In addition, compared with Figure 14 shown device, the device of the adjustment image saturation of the present embodiment adopts integer displacement to instead of floating number multiplication, reduces computational complexity, and improves arithmetic speed.
With reference to Figure 17, it is the schematic flow sheet of the 5th embodiment of the method for adjustment image saturation of the present invention.The method of this adjustment image saturation comprises step:
1601, the rgb value before providing image saturation to adjust and saturation degree Dynamic gene;
1602, first and value after the rgb value calculated before the adjustment of described image saturation is added;
1603, using described first and value and 1/3 the first product value as image saturation adjustment before brightness value;
1604, the minimum value in the rgb value before the adjustment of described image saturation is judged;
1605, the first difference between described brightness value and described minimum value is calculated;
1606, according to described minimum value, the second reference value before image saturation adjustment is obtained: when minimum value is B value, using R value as the second reference value before described image saturation adjustment; When minimum value is R value, using G value as the second reference value before described image saturation adjustment; When minimum value is G value, using B value as the second reference value before described image saturation adjustment;
1607, the second difference after described saturation degree Dynamic gene being subtracted 1 process is multiplied by 2 n, obtain the second product value; The 3rd product value between described first difference and described second product value is moved to right behind n position and obtain the first off-set value, using the 3rd difference between described minimum value and described first off-set value as the first reference value after image saturation adjusts;
1608, the 4th difference between the second reference value before the adjustment of described image saturation and described brightness value is calculated;
1609, when the first reference value after described image saturation adjustment is more than or equal to 0, the 4th product value between described 4th difference and described second product value is moved to right behind n position and obtain the second off-set value, using second and value between the second reference value before described image saturation adjustment and described second off-set value as the second reference value after image saturation adjustment;
16010, when the first reference value after described image saturation adjustment is less than 0, search the table of comparisons based on described first difference and obtain corresponding array value; Prestore when described first difference is 1,2 in the described table of comparisons ..., 169, each array value corresponding when 170, and each array value described is by 2 kwith the ratio of the first difference round up round; Five product value of described minimum value, the 4th between difference and array value is moved to right behind k position and obtain the 3rd off-set value, using the 3rd and value between the second reference value before described image saturation adjustment and described 3rd off-set value as the second reference value after image saturation adjustment;
16011, the 5th difference of the second reference value after the first reference value after the adjustment of described image saturation and image saturation adjustment is deducted as the 3rd reference value after image saturation adjustment by described first and value; And
16012, by judging described minimum value, obtain the rgb value after image saturation adjustment: when minimum value is B value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to B, R and G value after image saturation adjustment; When minimum value is R value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to R, G and B value after image saturation adjustment; When minimum value is G value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to G, B and R value after image saturation adjustment.
In the image saturation adjustment of reality, can comprise and strengthen or reduce image saturation, therefore, above-mentioned saturation degree Dynamic gene comprises saturation degree and strengthens/reduce the factor.
Compared with the method for Figure 15, the method for the present embodiment adjustment image saturation does not limit the span of saturation degree Dynamic gene F, the i.e. desirable arbitrary value of F, and therefore the method scope of application is wider; In addition, the present embodiment is tabled look-up by adopting, integer is shifted and multiplication of integers replaces floating number multiplication and division, reduce further computational complexity, improves arithmetic speed, and decrease the error of calculating.
With reference to Figure 18, it is the structured flowchart of the 5th embodiment of the device of adjustment image saturation of the present invention.The device of this adjustment image saturation comprises:
Extraction apparatus 171, for receiving RGB image and adjustment parameter, and extract R, G, B value before the image saturation adjustment of described RGB image, wherein said adjustment parameter comprises saturation degree Dynamic gene;
First adder 172, for calculating first and value Δ T1 after R, G, B value addition before the adjustment of described image saturation;
First multiplier 173, using described first and value Δ T1 and 1/3 product value as image saturation adjustment before brightness value V;
First comparer 174, for R, G, B value before more described image saturation adjustment, and exports minimum M in;
First subtracter 175, calculates the first difference DELTA M1 between described brightness value V and described minimum M in:
First judging unit 176, according to described minimum M in, judges the second reference value Y before obtaining image saturation adjustment: when minimum value is B value, using R value as the second reference value Y before described image saturation adjustment; When minimum value is R value, using G value as the second reference value Y before described image saturation adjustment; When minimum value is G value, using B value as the second reference value Y before described image saturation adjustment;
Second subtracter 177, after described saturation degree Dynamic gene is subtracted 1 process, obtains the second difference DELTA M2;
Second multiplier 178, for described second difference is multiplied by 2n, obtains the second product value Δ H2;
3rd multiplier 179, for calculating the 3rd product value Δ H3 between described first difference DELTA M1 and described second product value Δ H2;
First shift unit 1700, for the n position that moved to right by described 3rd product value Δ H3, obtains the first off-set value T1;
3rd subtracter 1701, for calculating the 3rd difference between described minimum M in and described first off-set value T1, described 3rd difference is as the first reference value X ' after image saturation adjustment;
4th subtracter 1702, for calculating the 4th difference DELTA M4 between the second reference value Y before the adjustment of described image saturation and described brightness value V;
4th multiplier 1703, for calculating the 4th product value Δ H4 between described 4th difference DELTA M4 and described second product value Δ H2;
Second comparer 1704, for by judge described image saturation adjustment after the first reference value X ' and 0 make comparisons;
Second shift unit 1705, for when the first reference value X ' after described image saturation adjustment is more than or equal to 0, obtains the second off-set value T2 behind the n position that moved to right by described 4th product value Δ H4;
Second adder 1706, for calculate described image saturation adjustment before the second reference value Y and described second off-set value T2 between second and value, described second and value as image saturation adjust after the second reference value Y ';
Processor 1707, in order to store comparison list, when the first reference value X ' after described image saturation adjustment is less than 0, searches the table of comparisons based on described first difference DELTA M1 and obtains corresponding array value TAB [Δ M1]; Prestore when described first difference DELTA M1 is 1,2 in the described table of comparisons ..., 169, each array value corresponding when 170, and described each array value TAB [Δ M1] for by the ratio of 2k and the first difference DELTA M1 round up round;
5th multiplier 1708, for calculating the 5th product value Δ H5 between described minimum M in, the 4th difference DELTA M4 and array value TAB [Δ M1];
3rd shift unit 1709, for obtaining the 3rd off-set value T3 behind the k position that moved to right by described 5th product value Δ H5;
3rd totalizer 1710, for calculate described image saturation adjustment before the second reference value Y and described 3rd off-set value T3 between the 3rd and value, the described 3rd and value as image saturation adjust after the second reference value Y ';
5th subtracter 1711, for by first and value Δ T1 deduct described image saturation adjustment after the first reference value X ' and image saturation adjustment after the second reference value Y ' obtain the 5th difference, described 5th difference as image saturation adjust after the 3rd reference value Z '; And
Second judging unit 1712, according to described minimum M in, judge the rgb value after obtaining image saturation adjustment: when minimum value is B value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to B, R and G value after image saturation adjustment; When minimum value is R value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to R, G and B value after image saturation adjustment; When minimum value is G value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to G, B and R value after image saturation adjustment.
Same, in the image saturation adjustment of reality, can comprise and strengthen or reduce image saturation, therefore, above-mentioned saturation degree Dynamic gene comprises saturation degree and strengthens/reduce the factor.
Compared with the method for Figure 16, the device of the present embodiment adjustment image saturation does not limit the span of saturation degree Dynamic gene F, the i.e. desirable arbitrary value of F, and therefore this device scope of application is wider; In addition, the present embodiment is tabled look-up by adopting, integer is shifted and multiplication of integers replaces floating number multiplication and division, reduce further computational complexity, improves arithmetic speed, and decrease the error of calculating.
example explanation
The computation process of traditional algorithm and fast algorithm is provided below by an example.
Assuming that the rgb value of RGB image before image saturation adjustment is: assuming that (R, G, B)=(175,126,153), saturation degree enhancer F=1.375, i.e. α=F-1=0.375.
(1) utilize traditional algorithm step as follows:
A) turn HSI formulae discovery by RGB can obtain:
H=5.7007,S=0.1674,I=151.3333。
B) calculate according to image saturation adjustment formula:
S′=F*S=1.375*0.1674=0.2302。
C) turn RGB formulae discovery according to HSI can obtain:
R′=184,G′=116,B′=154。
(2) utilize the preferred method of the present invention (such as, adopting method shown in Fig. 7) step as follows:
A) first I and S is calculated according to formula (1) 1, I 3:
I 3 = R + G + B = 454 ; I = I 3 / 3 = I 3 * 0.3333 = 151 ; S 1 = I - Min = 151 - 126 = 25
B) due to Min=G, known according to formula (2):
Y=B=153,Y-I=153-151=2
C) X ', Y ' and Z ' is calculated according to formula (3 ') as follows:
X &prime; = Min - &alpha;S 1 = 126 - ( 25 > > 2 + 25 > > 3 ) = 117 ; Y &prime; = Y + &alpha; ( Y - I ) = 153 + ( 2 > > 2 ) + ( 2 > > 3 ) = 153 ; Z &prime; = I 3 - X &prime; - Y &prime; = 454 - 117 - 153 = 184 .
D) finally can be obtained by formula (4):
R′=184,G′=117,B′=153。
The error of this example is:
|184-184|+|116-117|+|154-153|=2
error analysis
Error between the method for the adjustment image saturation according to Fig. 9 and classic method method, can to level=(F-1) * 2 8value traversal [0,256] in all round valuess obtain error corresponding to each level value, we only enumerate the error of part level value correspondence herein, reference table 1:
Table 1 difference strengthens the error analysis under intensity
The resultant error obtained from the visible fast algorithm of form is above very little, and average error is about 1.0, and maximum error is no more than 6.Error is defined as the absolute value sum of each component difference herein.
experimental result
The method of rapid adjustment image saturation of the present invention is tested on two platforms, first PC platform: processor is Intel Core i5-3570 CPU 3.40 GHz, inside saves as 8GB.Another platform is notebook computer: processor is Intel Core i5-4200 CPU 2.50GHz, inside saves as 4GB.By the method (fast) of the method for traditional adjustment image saturation, adjustment image saturation of the present invention and utilize of the present invention and method (quick SSE2) three kinds of modes of adjustment image saturation based on SSE2 technology carry out test comparison, test data following table 2 and table 3:
Table 2 PC platform different resolution elapsed time compares
Table 3 notebook-enabled platform different resolution elapsed time compares
Can find out that the method for adjustment image saturation of the present invention improves clearly relative to the speed of classic method from above test data, in conjunction with SSE2 multimedia instruction set, then speed lifting amplitude is larger, can meet the real time enhancing of 720p video image.
In sum, when the method for adjustment image saturation disclosed by the invention and device thereof transfer the conversion of two color model of rgb space to without the need to transferring HSI space and HSI space to through rgb space, based on rgb value and the adjustment parameter of the RGB image of input, the rgb value after image saturation adjustment is directly calculated by the formula preset, thus realize adjusting the saturation degree of RGB image, calculated amount is little, take that computational resource is little and processing speed fast, can meet the real-time demand of video image enhancement.In addition, also preferably employ and table look-up, to be shifted and multiplication of integers instead of floating number multiplication and division, reduce computational complexity, substantially increase arithmetic speed.And last experimental result shows, the method for adjustment image saturation disclosed by the invention travelling speed on PC and notebook, considerably beyond classic method, therefore has good application in video image adjustment.
The above is the preferred embodiment of the present invention; it should be pointed out that for those skilled in the art, under the premise without departing from the principles of the invention; can also make some improvements and modifications, these improvements and modifications are also considered as protection scope of the present invention.

Claims (30)

1. adjust a method for image saturation, it is characterized in that, comprise step:
Receive RGB image and adjustment parameter, and based on the rgb value before the described RGB image zooming-out image saturation adjustment received;
Rgb value before described image saturation adjustment and adjustment parameter are substituted in the relational expression of the rgb value after preset image saturation adjustment and the rgb value before image saturation adjustment, calculate the rgb value after image saturation adjustment; Wherein said relational expression turns by RGB the formulae discovery that the formula of HSI, saturation degree adjustment formula and HSI turn RGB and obtains;
Based on the rgb value after described image saturation adjustment, saturation degree adjustment is carried out to described RGB image, obtains the RGB image after adjustment;
Export the RGB image after described adjustment.
2. the method for adjustment image saturation as claimed in claim 1, it is characterized in that, described adjustment parameter comprises saturation degree Dynamic gene.
3. the method for adjustment image saturation as claimed in claim 2, it is characterized in that, described relational expression is following formula (1a) ~ (1c):
If Min (R, G, B)=B,
Then B &prime; = B - ( F - 1 ) * { 1 3 ( R + G + B ) - B } R &prime; = R + ( F - 1 ) * { R - 1 3 ( R + G + B ) } G &prime; = R + G + B - B &prime; - R &prime; - - - ( 1 a ) If Min (R, G, B)=R,
Then R &prime; = R - ( F - 1 ) * { 1 3 ( R + G + B ) - R } G &prime; = G + ( F - 1 ) * { G - 1 3 ( R + G + B ) } B &prime; = R + G + B - R &prime; - G &prime; - - - ( 1 b )
If Min (R, G, B)=G,
Then G &prime; = G - ( F - 1 ) * { 1 3 ( R + G + B ) - G } B &prime; = B + ( F - 1 ) * { B - 1 3 ( R + G + B ) } R &prime; = R + G + B - G &prime; - B &prime; - - - ( 1 c )
Wherein, R ', G ', B ' are respectively the rgb value after image saturation adjustment, and R, G, B are respectively the rgb value before image saturation adjustment, and F is saturation degree Dynamic gene.
4. the method for adjustment image saturation as claimed in claim 2, it is characterized in that, described relational expression is following formula (2a) ~ (2c):
If Min (R, G, B)=B,
Then B &prime; = B - { 1 3 ( R + G + B ) - B } > > p 1 - { 1 3 ( R + G + B ) - B } > > p 2 - &CenterDot; &CenterDot; &CenterDot; - { 1 3 ( R + G + B ) - B } > > pm R &prime; = R + { R - 1 3 ( R + G + B ) } > > p 1 + { R - 1 3 ( R + G + B ) } > > p 2 + &CenterDot; &CenterDot; &CenterDot; + { R - 1 3 ( R + G + B ) } > > pm G &prime; = R + G + B - B &prime; - R &prime; - - - ( 2 a )
If Min (R, G, B)=R,
Then R &prime; = R - { 1 3 ( R + G + B ) - R } > > p 1 - { 1 3 ( R + G + B ) - R } > > p 2 - &CenterDot; &CenterDot; &CenterDot; - { 1 3 ( R + G + B ) - R } > > pm G &prime; = G + { G - 1 3 ( R + G + B ) } > > p 1 + { G - 1 3 ( R + G + B ) } > > p 2 + &CenterDot; &CenterDot; &CenterDot; + { G - 1 3 ( R + G + B ) } > > pm B &prime; = R + G + B - R &prime; - G &prime; - - - ( 2 b )
If Min (R, G, B)=G,
Then G &prime; = G - { 1 3 ( R + G + B ) - G } > > p 1 - { 1 3 ( R + G + B ) - G } > > p 2 - &CenterDot; &CenterDot; &CenterDot; - { 1 3 ( R + G + B ) - G } > > pm B &prime; = B + { B - 1 3 ( R + G + B ) } > > p 1 + { B - 1 3 ( R + G + B ) } > > p 2 + &CenterDot; &CenterDot; &CenterDot; + { B - 1 3 ( R + G + B ) } > > pm R &prime; = R + G + B - G &prime; - B &prime; - - - ( 2 c )
Wherein, R ', G ', B ' are respectively the rgb value after image saturation adjustment, and R, G, B are respectively the rgb value before image saturation adjustment, and F is saturation degree Dynamic gene, 1≤F≤2, and m be more than or equal to 1 integer; representing will { 1 3 ( R + G + B ) - B } Value to move to right pm position.
5. the method for adjustment image saturation as claimed in claim 2, it is characterized in that, described relational expression is following formula (2a ') ~ (2c '):
If Min (R, G, B)=B,
Then B &prime; = B - { 1 3 ( R + G + B ) - B } > > p 1 - { 1 3 ( R + G + B ) - B } > > p 2 + &CenterDot; &CenterDot; &CenterDot; + { 1 3 ( R + G + B ) - B } > > pm R &prime; = R + { R - 1 3 ( R + G + B ) } > > p 1 + { R - 1 3 ( R + G + B ) } > > p 2 - &CenterDot; &CenterDot; &CenterDot; - { R - 1 3 ( R + G + B ) } > > pm G &prime; = R + G + B - B &prime; - R &prime; - - - ( 2 a &prime; )
If Min (R, G, B)=R,
Then R &prime; = R - { 1 3 ( R + G + B ) - R } > > p 1 - { 1 3 ( R + G + B ) - R } > > p 2 + &CenterDot; &CenterDot; &CenterDot; - { 1 3 ( R + G + B ) - R } > > pm G &prime; = G - { G - 1 3 ( R + G + B ) } > > p 1 + { G - 1 3 ( R + G + B ) } > > p 2 - &CenterDot; &CenterDot; &CenterDot; + { G - 1 3 ( R + G + B ) } > > pm B &prime; = R + G + B - R &prime; - G &prime; - - - ( 2 b &prime; )
If Min (R, G, B)=G,
Then G &prime; = G - { 1 3 ( R + G + B ) - G } > > p 1 - { 1 3 ( R + G + B ) - G } > > p 2 + &CenterDot; &CenterDot; &CenterDot; + { 1 3 ( R + G + B ) - G } > > pm B &prime; = B - { B - 1 3 ( R + G + B ) } > > p 1 + { B - 1 3 ( R + G + B ) } > > p 2 - &CenterDot; &CenterDot; &CenterDot; - { B - 1 3 ( R + G + B ) } > > pm R &prime; = R + G + B - G &prime; - B &prime; - - - ( 2 c &prime; )
Wherein, R ', G ', B ' are respectively the rgb value after image saturation adjustment, and R, G, B are respectively the rgb value before image saturation adjustment, and F is saturation degree Dynamic gene, 0≤F≤1, and F - 1 = - ( 1 2 p 1 + 1 2 p 2 + . . . + 1 2 pm ) , M be more than or equal to 1 integer; { 1 3 ( R + G + B ) - B } > > pm Representing will { 1 3 ( R + G + B ) - B } Value to move to right pm position.
6. the method for adjustment image saturation as claimed in claim 2, it is characterized in that, described relational expression is following formula (3a) ~ (3d):
S 1 = 1 3 ( R + G + B ) - Min ( R , G , B ) ; level = ( F - 1 ) * 2 n ; - - - ( 3 a )
If Min (R, G, B)=B,
Then
If Min (R, G, B)=R,
Then
If Min (R, G, B)=G,
Then
Wherein, R ', G ', B ' are respectively the rgb value after image saturation adjustment, R, G, B are respectively the rgb value before image saturation adjustment, F is saturation degree Dynamic gene, > > n is expressed as and moves to right n position to the value asked for, > > k is expressed as and moves to right k position to the value asked for, 4≤n≤16,12≤k≤24, and n, k are integer; And TAB [S 1] value by search the table of comparisons obtain, prestore in the described table of comparisons and work as S 1=1,2 ..., 169, each TAB [S corresponding when 170 1] value, and TAB [S described in each 1] value obtains by following formula: TAB [S 1]=(int) (2 k/ S 1+ 0.5), wherein, int represents and rounds, and+0.5 represents and rounds up.
7. the method for adjustment image saturation as claimed in claim 2, it is characterized in that, described saturation degree Dynamic gene comprises saturation degree enhancing/Attenuation factor.
8. adjust a device for image saturation, it is characterized in that, comprising:
Storage unit, for storing a relational expression pre-set, described relational expression is used for the relation of the rgb value before the rgb value after the adjustment of Description Image saturation degree and image saturation adjustment; Wherein said relational expression turns by RGB the formulae discovery that the formula of HSI, saturation degree adjustment formula and HSI turn RGB and obtains;
Receiving element, for receiving RGB image and adjustment parameter, and based on the rgb value before the described RGB image zooming-out image saturation adjustment received;
Computing unit, for the rgb value before described image saturation adjustment and adjustment parameter being substituted in described relational expression, calculates the rgb value after image saturation adjustment;
Adjustment unit, based on the rgb value after described image saturation adjustment, carries out saturation degree adjustment to described RGB image, obtains the RGB image after adjustment;
Output unit, exports the RGB image after described adjustment.
9. the device of adjustment image saturation as claimed in claim 8, it is characterized in that, described adjustment parameter comprises saturation degree Dynamic gene.
10. the device of adjustment image saturation as claimed in claim 9, it is characterized in that, described relational expression is following formula (1a) ~ (1c):
If Min (R, G, B)=B,
Then B &prime; = B - ( F - 1 ) * { 1 3 ( R + G + B ) - B } R &prime; = R + ( F - 1 ) * { R - 1 3 ( R + G + B ) } G &prime; = R + G + B - B &prime; - R &prime; - - - ( 1 a )
If Min (R, G, B)=R,
Then R &prime; = R - ( F - 1 ) * { 1 3 ( R + G + B ) - R } G &prime; = G + ( F - 1 ) * { G - 1 3 ( R + G + B ) } B &prime; = R + G + B - R &prime; - G &prime; - - - ( 1 b )
If Min (R, G, B)=G,
Then G &prime; = G - ( F - 1 ) * { 1 3 ( R + G + B ) - G } B &prime; = B + ( F - 1 ) * { B - 1 3 ( R + G + B ) } R &prime; = R + G + B - G &prime; - B &prime; - - - ( 1 c )
Wherein, R ', G ', B ' are respectively the rgb value after image saturation adjustment, and R, G, B are respectively the rgb value before image saturation adjustment, and F is saturation degree Dynamic gene.
The device of 11. adjustment image saturations as claimed in claim 9, it is characterized in that, described relational expression is following formula (2a) ~ (2c):
If Min (R, G, B)=B,
Then B &prime; = B - { 1 3 ( R + G + B ) - B } > > p 1 - { 1 3 ( R + G + B ) - B } > > p 2 - &CenterDot; &CenterDot; &CenterDot; - { 1 3 ( R + G + B ) - B } > > pm R &prime; = R + { R - 1 3 ( R + G + B ) } > > p 1 + { R - 1 3 ( R + G + B ) } > > p 2 + &CenterDot; &CenterDot; &CenterDot; + { R - 1 3 ( R + G + B ) } > > pm G &prime; = R + G + B - B &prime; - R &prime; - - - ( 2 a )
If Min (R, G, B)=R,
Then R &prime; = R - { 1 3 ( R + G + B ) - R } > > p 1 - { 1 3 ( R + G + B ) - R } > > p 2 - &CenterDot; &CenterDot; &CenterDot; - { 1 3 ( R + G + B ) - R } > > pm G &prime; = G + { G - 1 3 ( R + G + B ) } > > p 1 + { G - 1 3 ( R + G + B ) } > > p 2 + &CenterDot; &CenterDot; &CenterDot; + { G - 1 3 ( R + G + B ) } > > pm B &prime; = R + G + B - R &prime; - G &prime; - - - ( 2 b )
If Min (R, G, B)=G,
Then G &prime; = G - { 1 3 ( R + G + B ) - G } > > p 1 - { 1 3 ( R + G + B ) - G } > > p 2 - &CenterDot; &CenterDot; &CenterDot; - { 1 3 ( R + G + B ) - G } > > pm B &prime; = B + { B - 1 3 ( R + G + B ) } > > p 1 + { B - 1 3 ( R + G + B ) } > > p 2 + &CenterDot; &CenterDot; &CenterDot; + { B - 1 3 ( R + G + B ) } > > pm R &prime; = R + G + B - G &prime; - B &prime; - - - ( 2 c )
Wherein, R ', G ', B ' are respectively the rgb value after image saturation adjustment, and R, G, B are respectively the rgb value before image saturation adjustment, and F is saturation degree Dynamic gene, 1≤F≤2, and m be more than or equal to 1 integer; representing will { 1 3 ( R + G + B ) - B } Value to move to right pm position.
The device of 12. adjustment image saturations as claimed in claim 9, it is characterized in that, described relational expression is following formula (2a ') ~ (2c '):
If Min (R, G, B)=B,
Then B &prime; = B - { 1 3 ( R + G + B ) - B } > > p 1 - { 1 3 ( R + G + B ) - B } > > p 2 + &CenterDot; &CenterDot; &CenterDot; + { 1 3 ( R + G + B ) - B } > > pm R &prime; = R + { R - 1 3 ( R + G + B ) } > > p 1 + { R - 1 3 ( R + G + B ) } > > p 2 - &CenterDot; &CenterDot; &CenterDot; - { R - 1 3 ( R + G + B ) } > > pm G &prime; = R + G + B - B &prime; - R &prime; - - - ( 2 a &prime; )
If Min (R, G, B)=R,
Then R &prime; = R - { 1 3 ( R + G + B ) - R } > > p 1 - { 1 3 ( R + G + B ) - R } > > p 2 + &CenterDot; &CenterDot; &CenterDot; - { 1 3 ( R + G + B ) - R } > > pm G &prime; = G - { G - 1 3 ( R + G + B ) } > > p 1 + { G - 1 3 ( R + G + B ) } > > p 2 - &CenterDot; &CenterDot; &CenterDot; + { G - 1 3 ( R + G + B ) } > > pm B &prime; = R + G + B - R &prime; - G &prime; - - - ( 2 b &prime; )
If Min (R, G, B)=G,
Then G &prime; = G - { 1 3 ( R + G + B ) - G } > > p 1 - { 1 3 ( R + G + B ) - G } > > p 2 + &CenterDot; &CenterDot; &CenterDot; + { 1 3 ( R + G + B ) - G } > > pm B &prime; = B - { B - 1 3 ( R + G + B ) } > > p 1 + { B - 1 3 ( R + G + B ) } > > p 2 - &CenterDot; &CenterDot; &CenterDot; - { B - 1 3 ( R + G + B ) } > > pm R &prime; = R + G + B - G &prime; - B &prime; - - - ( 2 c &prime; )
Wherein, R ', G ', B ' are respectively the rgb value after image saturation adjustment, and R, G, B are respectively the rgb value before image saturation adjustment, and F is saturation degree Dynamic gene, 0≤F≤1, and F - 1 = - ( 1 2 p 1 + 1 2 p 2 + . . . + 1 2 pm ) , M be more than or equal to 1 integer; { 1 3 ( R + G + B ) - B } > > pm Representing will { 1 3 ( R + G + B ) - B } Value to move to right pm position.
The device of 13. adjustment image saturations as claimed in claim 9, it is characterized in that, described relational expression is following formula (3a) ~ (3d):
S 1 = 1 3 ( R + G + B ) - Min ( R , G , B ) ; level = ( F - 1 ) * 2 n ; - - - ( 3 a )
If Min (R, G, B)=B,
Then
If Min (R, G, B)=R,
Then
If Min (R, G, B)=G,
Then
Wherein, R ', G ', B ' are respectively the rgb value after image saturation adjustment, R, G, B are respectively the rgb value before image saturation adjustment, F is saturation degree Dynamic gene, > > n is expressed as and moves to right n position to the value asked for, > > k is expressed as and moves to right k position to the value asked for, 4≤n≤16,12≤k≤24, and n, k are integer; And TAB [S 1value can obtain by searching the table of comparisons, prestore as saturation degree S in the described table of comparisons 1=1,2 ..., 169, each TAB [S corresponding when 170 1] value, and TAB [S described in each 1] value obtained by following formula: TAB [S 1]=(int) (2 k/ S 1+ 0.5), wherein, int represents and rounds, and+0.5 represents and rounds up.
The device of 14. adjustment image saturations as claimed in claim 8, it is characterized in that, described saturation degree Dynamic gene comprises saturation degree enhancing/Attenuation factor.
15. 1 kinds of methods adjusting image saturation, is characterized in that, comprise step:
S1, reception RGB image and adjustment parameter, and based on the described RGB image zooming-out image attributes parameter received; Wherein, described image attributes parameter comprises the red, green, blue value before image saturation adjustment, and described adjustment parameter comprises saturation degree Dynamic gene;
S2, based on the red, green, blue value before the adjustment of described image saturation and described saturation degree Dynamic gene, calculate the red, green, blue value after image saturation adjustment, comprise step:
S21, to be obtained image saturation adjustment by formula (1) before red, green, blue value with value, image saturation adjustment before brightness and image saturation adjust before saturation degree and the product value of brightness:
I 3 = R + G + B I = I 3 * 1 3 S 1 = I - Min ( R , G , B ) - - - ( 1 )
Wherein, I 3for described and value, S 1for described product value, I is the brightness before image saturation adjustment, and R, G, B are respectively the red, green, blue value before image saturation adjustment;
S22, to be obtained the second reference value before image saturation adjustment by formula (2):
Wherein, Y is the second reference value before image saturation adjustment, and R, G, B are respectively the red, green, blue value before image saturation adjustment;
S23, to be obtained the first reference value, the second reference value and the 3rd reference value after image saturation adjustment by formula (3):
X &prime; = Min ( R , G , B ) - &alpha;S 1 Y &prime; = Y + &alpha; ( Y - I ) Z &prime; = I 3 - X &prime; - Y &prime; - - - ( 3 )
Wherein, R, G, B are respectively the red, green, blue value before image saturation adjustment, I 3for described and value, S 1for described product value, I is the brightness before image saturation adjustment, and Y is the second reference value before image saturation adjustment, and X ', Y ' and Z ' are respectively the first reference value, the second reference value and the 3rd reference value after image saturation adjustment, α=F-1, F are described saturation degree Dynamic gene;
S24, to be obtained the red, green, blue value after image saturation adjustment by formula (4):
Wherein, R ', G ', B ' are respectively the red, green, blue value after image saturation adjustment, R, G, B are respectively the red, green, blue value before image saturation adjustment, and X ', Y ' and Z ' are respectively the first reference value, the second reference value and the 3rd reference value after image saturation adjustment;
S3, based on the red, green, blue value after the adjustment of described image saturation, saturation degree adjustment is carried out to described RGB image, obtain the RGB image after adjustment;
S4, export the RGB image after described adjustment.
The method of 16. adjustment image saturations as claimed in claim 15, it is characterized in that, in described step S23, above-mentioned formula (3) is replaced, the first reference value, the second reference value and the 3rd reference value with after the adjustment of computed image saturation degree by following formula (3 '):
X &prime; = Min ( R , G , B ) - ( S 1 > > p 1 + S 1 > > p 2 + . . . + S 1 > > pm ) Y &prime; = Y + ( Y - I ) > > p 1 + ( Y - I ) > > p 2 + . . . + ( Y - I ) > > pm Z &prime; = I 3 - X &prime; - Y &prime; - - - ( 3 &prime; )
Wherein, R, G, B are respectively the red, green, blue value before image saturation adjustment, I 3for described and value, S 1for described product value, I is the brightness before image saturation adjustment, and Y is the second reference value before image saturation adjustment, and X ', Y ' and Z ' are respectively the first reference value, the second reference value and the 3rd reference value after image saturation adjustment; α=F-1, F are saturation degree Dynamic gene, 1≤F≤2, and m be more than or equal to 1 integer; S 1> > pm represents S 1value to move to right pm position.
The method of 17. adjustment image saturations as claimed in claim 15, it is characterized in that, in described step S23, above-mentioned formula (3) is replaced, the first reference value, the second reference value and the 3rd reference value with after the adjustment of computed image saturation degree by following formula (3 ' '):
X &prime; = Min ( R , G , B ) + ( S 1 > > p 1 + S 1 > > p 2 + . . . + S 1 > > pm ) Y &prime; = Y - ( Y - I ) > > p 1 - ( Y - I ) > > p 2 - . . . - ( Y - I ) > > pm Z &prime; = I 3 - X &prime; - Y &prime; - - - ( 3 &prime; &prime; )
Wherein, R, G, B are respectively the red, green, blue value before image saturation adjustment, I 3for described and value, S 1for described product value, I is the brightness before image saturation adjustment, and Y is the second reference value before image saturation adjustment, and X ', Y ' and Z ' are respectively the first reference value, the second reference value and the 3rd reference value after image saturation adjustment; α=F-1, F are saturation degree Dynamic gene, 0≤F≤1, and m be more than or equal to 1 integer; S 1> > pm represents S 1value to move to right pm position.
The method of 18. adjustment image saturations according to any one of claim 15 ~ 17, it is characterized in that, in described step S23, above-mentioned formula (3) is replaced, the first reference value, the second reference value and the 3rd reference value with after the adjustment of computed image saturation degree by following formula (3 " '):
Wherein, R, G, B are respectively the red, green, blue value before image saturation adjustment, I 3for described and value, S 1for described product value, I is the brightness before image saturation adjustment, and Y is the second reference value before image saturation adjustment, and X ', Y ' and Z ' are respectively the first reference value, the second reference value and the 3rd reference value after image saturation adjustment; Level=α * 2 n=(F-1) * 2 nf is saturation degree Dynamic gene, and > > n is expressed as and moves to right n position to the value asked for, and > > k is expressed as and moves to right k position to the value asked for, the span of n, k is: 4≤n≤16,12≤k≤24; And TAB [S 1] value by search the table of comparisons obtain, prestore in the described table of comparisons as described product value S 1=1,2 ..., 169, each TAB [S corresponding when 170 1] value, and TAB [S described in each 1] value obtains by following formula: TAB [S 1]=(int) (2 k/ S 1+ 0.5) wherein, int represents and rounds, and+0.5 represents and rounds up.
The method of 19. adjustment image saturations as claimed in claim 15, it is characterized in that, described saturation degree Dynamic gene comprises saturation degree enhancing/Attenuation factor.
20. 1 kinds of devices adjusting image saturation, is characterized in that, comprising:
Receiving element, for receiving RGB image and adjustment parameter, and based on the described RGB image zooming-out image attributes parameter received; Wherein, described image attributes parameter comprises the red, green, blue value before image saturation adjustment, and described adjustment parameter comprises saturation degree Dynamic gene;
Computing unit, for according to the red, green, blue value before the adjustment of described image saturation and described saturation degree Dynamic gene, calculates the red, green, blue value after image saturation adjustment, comprising:
First computing module, the red, green, blue value before obtaining image saturation adjustment by formula (1) with value, image saturation adjustment before brightness and image saturation adjust before saturation degree and the product value of brightness:
I 3 = R + G + B I = I 3 * 1 3 S 1 = I - Min ( R , G , B ) - - - ( 1 )
Wherein, I 3for described and value, S 1for described product value, I is the brightness before image saturation adjustment, and R, G, B are respectively the red, green, blue value before image saturation adjustment;
Second computing module, obtains the second reference value before image saturation adjustment by formula (2):
Wherein, Y is the second reference value before image saturation adjustment, and R, G, B are respectively the red, green, blue value before image saturation adjustment;
3rd computing module, obtains the first reference value, the second reference value and the 3rd reference value after image saturation adjustment by formula (3):
X &prime; = Min ( R , G , B ) - &alpha;S 1 Y &prime; = Y + &alpha; ( Y - I ) Z &prime; = I 3 - X &prime; - Y &prime; - - - ( 3 )
Wherein, I 3for described and value, S 1for described product value, I is the brightness before image saturation adjustment, R, G, B are respectively the red, green, blue value before image saturation adjustment, Y is the second reference value before image saturation adjustment, X ', Y ' and Z ' are respectively the first reference value, the second reference value and the 3rd reference value after image saturation adjustment, α=F-1, F are described saturation degree Dynamic gene;
4th computing module, obtains the red, green, blue value after image saturation adjustment by formula (4):
Wherein, R ', G ', B ' are respectively the red, green, blue value after image saturation adjustment, R, G, B are respectively the red, green, blue value before image saturation adjustment, and X ', Y ' and Z ' are respectively the first reference value, the second reference value and the 3rd reference value after image saturation adjustment;
Adjustment unit, based on the red, green, blue value after described image saturation adjustment, carries out saturation degree adjustment to described RGB image, thus obtains the RGB image after adjustment; And
Output unit, for exporting the RGB image after described adjustment.
The device of 21. adjustment image saturations as claimed in claim 20, it is characterized in that, described 3rd computing module replaces above-mentioned formula (3) by following formula (3 '), the first reference value, the second reference value and the 3rd reference value with after the adjustment of computed image saturation degree:
Wherein, R, G, B are respectively the red, green, blue value before image saturation adjustment, I 3for described and value, S 1for described product value, I is the brightness before image saturation adjustment, and Y is the second reference value before image saturation adjustment, and X ', Y ' and Z ' are respectively the first reference value, the second reference value and the 3rd reference value after image saturation adjustment; α=F-1, F are saturation degree Dynamic gene, 1≤F≤2, and m be more than or equal to 1 integer; S 1> > pm represents S 1value to move to right pm position.
The device of 22. adjustment image saturations as claimed in claim 20, it is characterized in that, described 3rd computing module by following formula (3 ") replace above-mentioned formula (3), with computed image saturation degree adjustment after the first reference value, the second reference value and the 3rd reference value:
Wherein, R, G, B are respectively the red, green, blue value before image saturation adjustment, I 3for described and value, S 1for described product value, I is the brightness before image saturation adjustment, and Y is the second reference value before image saturation adjustment, and X ', Y ' and Z ' are respectively the first reference value, the second reference value and the 3rd reference value after image saturation adjustment; α=F-1, F are saturation degree Dynamic gene, 0≤F≤1, and m be more than or equal to 1 integer; S 1> > pm represents S 1value to move to right pm position.
The device of 23. adjustment image saturations according to any one of claim 20 ~ 22, it is characterized in that, described 3rd computing module replaces above-mentioned formula (3) by following formula (3 " '), the first reference value, the second reference value and the 3rd reference value with after the adjustment of computed image saturation degree:
Wherein, R, G, B are respectively the red, green, blue value before image saturation adjustment, I 3for described and value, S 1for described product value, I is the brightness before image saturation adjustment, and Y is the second reference value before image saturation adjustment, and X ', Y ' and Z ' are respectively the first reference value, the second reference value and the 3rd reference value after image saturation adjustment; Level=α * 2 n=(F-1) * 2 nf is saturation degree Dynamic gene, and > > n is expressed as and moves to right n position to the value asked for, and > > k is expressed as and moves to right k position to the value asked for, the span of n, k is: 4≤n≤16,12≤k≤24; And TAB [S 1] value by search the table of comparisons obtain, prestore in the described table of comparisons as described product value S 1=1,2 ..., 169, each TAB [S corresponding when 170 1] value, and TAB [S described in each 1] value obtains by following formula: TAB [S 1]=(int) (2 k/ S 1+ 0.5), wherein, int represents and rounds, and+0.5 represents and rounds up.
The system of 24. adjustment image saturations as claimed in claim 20, it is characterized in that, described saturation degree Dynamic gene comprises saturation degree enhancing/Attenuation factor.
25. 1 kinds of methods adjusting image saturation, is characterized in that, comprise step:
Rgb value a () provides image saturation to adjust before and saturation degree Dynamic gene;
First and value after rgb value b () calculates the adjustment of described image saturation before is added;
C described first and value are multiplied by the first product value after 1/3 as the brightness value before image saturation adjustment by ();
D () judges the minimum value in the rgb value before the adjustment of described image saturation;
E () calculates the first difference between described brightness value and described minimum value;
F (), according to described minimum value, obtains the second reference value before image saturation adjustment: when minimum value is B value, using R value as the second reference value before described image saturation adjustment; When minimum value is R value, using G value as the second reference value before described image saturation adjustment; When minimum value is G value, using B value as the second reference value before described image saturation adjustment;
The second difference g described saturation degree Dynamic gene is subtracted 1 process by () after is multiplied with described first difference, obtain the second product value, and using the 3rd difference between described minimum value and described second product value as the first reference value after image saturation adjusts;
H the second reference value before described image saturation adjustment is multiplied with described second difference with the 4th difference between described brightness value by (), obtain the 3rd product value, using second and value between the second reference value before described image saturation adjustment and described 3rd product value as the second reference value after image saturation adjustment;
I () deducts the 5th difference of the second reference value after the first reference value after the adjustment of described image saturation and image saturation adjustment as the 3rd reference value after image saturation adjustment by described first and value; And
J () is according to described minimum value, obtain the rgb value after image saturation adjustment: when minimum value is B value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to B, R and G value after image saturation adjustment; When minimum value is R value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to R, G and B value after image saturation adjustment; When minimum value is G value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to G, B and R value after image saturation adjustment.
26. 1 kinds of devices adjusting image saturation, is characterized in that, comprising:
Extraction apparatus, for receiving RGB image and adjustment parameter, and extract the rgb value before the image saturation adjustment of described RGB image, wherein said adjustment parameter comprises saturation degree Dynamic gene;
First adder, for calculating first and value after the rgb value addition before the adjustment of described image saturation;
First multiplier, using described first and value and the first product value between 1/3 as the brightness value before image saturation adjustment;
Comparer, for the rgb value before more described image saturation adjustment, and exports minimum value;
First subtracter, calculates the first difference between described brightness value and described minimum value;
First judging unit, according to described minimum value, judges the second reference value before obtaining image saturation adjustment: when minimum value is B value, using R value as the second reference value before described image saturation adjustment; When minimum value is R value, using G value as the second reference value before described image saturation adjustment; When minimum value is G value, using B value as the second reference value before described image saturation adjustment;
Second subtracter, after described saturation degree Dynamic gene is subtracted 1 process, obtains the second difference;
Second multiplier, for calculating the second product value between the second difference and described first difference;
3rd subtracter, deducts described second product value obtain the 3rd difference for calculating described minimum value, and described 3rd difference is as the first reference value after image saturation adjustment;
4th subtracter, for calculating the 4th difference between the second reference value before the adjustment of described image saturation and described brightness value;
3rd multiplier, for calculating the 3rd product value between described 4th difference and described second difference;
Second adder, for calculate described image saturation adjustment before the second reference value and described 3rd product value between second and value, described second and value as image saturation adjust after the second reference value;
5th subtracter, for by first and value deduct described image saturation adjustment after the first reference value and image saturation adjustment after the second reference value obtain the 5th difference, described 5th difference as image saturation adjust after the 3rd reference value; And
Second judging unit, according to described minimum value, judge the rgb value after obtaining image saturation adjustment: when minimum value is B value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to B, R and G value after image saturation adjustment; When minimum value is R value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to R, G and B value after image saturation adjustment; When minimum value is G value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to G, B and R value after image saturation adjustment.
27. 1 kinds of methods adjusting image saturation, is characterized in that, comprise step:
Rgb value a () provides image saturation to adjust before and saturation degree Dynamic gene, the span of described saturation degree Dynamic gene is [0,2];
First and value after rgb value b () calculates the adjustment of described image saturation before is added;
C described first and value are multiplied by first product value of 1/3 as the brightness value before image saturation adjustment by ();
D () judges the minimum value in the rgb value before the adjustment of described image saturation;
E () calculates the first difference between described brightness value and described minimum value;
F (), according to described minimum value, obtains the second reference value before image saturation adjustment: when minimum value is B value, using R value as the second reference value before described image saturation adjustment; When minimum value is R value, using G value as the second reference value before described image saturation adjustment; When minimum value is G value, using B value as the second reference value before described image saturation adjustment;
The second difference g described saturation degree Dynamic gene is subtracted 1 process by () after converts binary value to, described first difference is carried out corresponding shifting function based on described binary value, obtains at least one first off-set value;
H described saturation degree Dynamic gene compares with 1 by (), if be more than or equal to 1, then using the 3rd difference between described minimum value and at least one first off-set value described as the first reference value after image saturation adjusts; Otherwise using second between described minimum value and at least one first off-set value described be worth as the first reference value after image saturation adjusts;
I () calculates the 4th difference between the second reference value before the adjustment of described image saturation and described brightness value, and described 4th difference is carried out corresponding shifting function based on described binary value, obtains at least one second off-set value;
If j () described saturation degree Dynamic gene is more than or equal to 1, then using the 3rd between the second reference value before the adjustment of described image saturation and at least one second off-set value described and value as the second reference value after image saturation adjustment; Otherwise, then using the 5th difference between the second reference value before the adjustment of described image saturation and at least one second off-set value described as the second reference value after image saturation adjustment;
K () deducts the 6th difference of the second reference value after the first reference value after the adjustment of described image saturation and image saturation adjustment as the 3rd reference value after image saturation adjustment by described first and value; And
L () is according to described minimum value, obtain the rgb value after image saturation adjustment: when minimum value is B value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to B, R and G value after image saturation adjustment; When minimum value is R value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to R, G and B value after image saturation adjustment; When minimum value is G value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to G, B and R value after image saturation adjustment.
28. 1 kinds of devices adjusting image saturation, is characterized in that, comprising:
Extraction apparatus, for receiving RGB image and adjustment parameter, and extract the rgb value before the image saturation adjustment of described RGB image, wherein said adjustment parameter comprises saturation degree Dynamic gene, and the span of described saturation degree Dynamic gene is [1,2];
First adder, for calculating first and value after the rgb value addition before the adjustment of described image saturation;
Multiplier, using described first and value and 1/3 product value as image saturation adjust before brightness value;
First comparer, for the rgb value before more described image saturation adjustment, and exports minimum value;
First subtracter, calculates the first difference between described brightness value and described minimum value;
First judging unit, according to described minimum value, judges the second reference value before obtaining image saturation adjustment: when minimum value is B value, using R value as the second reference value before described image saturation adjustment; When minimum value is R value, using G value as the second reference value before described image saturation adjustment; When minimum value is G value, using B value as the second reference value before described image saturation adjustment;
Second subtracter, after described saturation degree Dynamic gene is subtracted 1 process, obtains the second difference;
Binary translator, for converting described second difference to binary value; First shift unit, for described first difference is carried out corresponding shifting function based on described binary value, obtains at least one first off-set value;
Second comparer, compares size with by described saturation degree Dynamic gene with 1;
3rd subtracter, for when described saturation degree Dynamic gene is more than or equal to 1, calculates the 3rd difference between described minimum value and at least one first off-set value described, and described 3rd difference is as the first reference value after image saturation adjustment;
Second adder, for when described saturation degree Dynamic gene is less than 1, calculate second between described minimum value and at least one first off-set value described and value adjust as image saturation after the first reference value;
4th subtracter, for calculating the 4th difference between the second reference value before the adjustment of described image saturation and described brightness value;
Second shift unit, for described 4th difference is carried out corresponding shifting function based on described binary value, obtains at least one second off-set value;
Second adder, for when described saturation degree Dynamic gene is more than or equal to 1, calculate described image saturation adjustment before the second reference value and at least one second off-set value described between the 3rd and value, the described 3rd and value as image saturation adjust after the second reference value;
5th subtracter, for when described saturation degree Dynamic gene is less than 1, the second reference value after the 5th difference calculated between the second reference value before the adjustment of described image saturation and at least one second off-set value described adjusts as image saturation;
6th subtracter, for by first and value deduct described image saturation adjustment after the first reference value and image saturation adjustment after the second reference value obtain the 6th difference, described 6th difference as image saturation adjust after the 3rd reference value; And
Second judging unit, according to described minimum value, judge the rgb value after obtaining image saturation adjustment: when minimum value is B value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to B, R and G value after image saturation adjustment; When minimum value is R value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to R, G and B value after image saturation adjustment; When minimum value is G value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to G, B and R value after image saturation adjustment.
29. 1 kinds of methods adjusting image saturation, is characterized in that, comprise step:
Rgb value a () provides image saturation to adjust before and saturation degree Dynamic gene;
First and value after rgb value b () calculates the adjustment of described image saturation before is added;
(c) using described first and value and 1/3 the first product value as image saturation adjust before brightness value;
D () judges the minimum value in the rgb value before the adjustment of described image saturation;
E () calculates the first difference between described brightness value and described minimum value;
F (), according to described minimum value, obtains the second reference value before image saturation adjustment: when minimum value is B value, using R value as the second reference value before described image saturation adjustment; When minimum value is R value, using G value as the second reference value before described image saturation adjustment; When minimum value is G value, using B value as the second reference value before described image saturation adjustment;
The second difference g described saturation degree Dynamic gene is subtracted 1 process by () after is multiplied by 2 n, obtain the second product value; The 3rd product value between described first difference and described second product value is moved to right behind n position and obtain the first off-set value, using the 3rd difference between described minimum value and described first off-set value as the first reference value after image saturation adjusts;
H () calculates the 4th difference between the second reference value before the adjustment of described image saturation and described brightness value;
I () is when the first reference value after described image saturation adjustment is more than or equal to 0, the 4th product value between described 4th difference and described second product value is moved to right behind n position and obtain the second off-set value, using second and value between the second reference value before described image saturation adjustment and described second off-set value as the second reference value after image saturation adjustment;
J (), when the first reference value after described image saturation adjustment is less than 0, is searched the table of comparisons based on described first difference and is obtained corresponding array value; Prestore when described first difference is 1,2 in the described table of comparisons ..., 169, each array value corresponding when 170, and each array value described is by 2 kwith the ratio of the first difference round up round; Five product value of described minimum value, the 4th between difference and array value is moved to right behind k position and obtain the 3rd off-set value, using the 3rd and value between the second reference value before described image saturation adjustment and described 3rd off-set value as the second reference value after image saturation adjustment;
K () deducts the 5th difference of the second reference value after the first reference value after the adjustment of described image saturation and image saturation adjustment as the 3rd reference value after image saturation adjustment by described first and value; And
L () is by judging described minimum value, obtain the rgb value after image saturation adjustment: when minimum value is B value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to B, R and G value after image saturation adjustment; When minimum value is R value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to R, G and B value after image saturation adjustment; When minimum value is G value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to G, B and R value after image saturation adjustment.
30. 1 kinds of devices adjusting image saturation, is characterized in that, comprising:
Extraction apparatus, for receiving RGB image and adjustment parameter, and extract the rgb value before the image saturation adjustment of described RGB image, wherein said adjustment parameter comprises saturation degree Dynamic gene;
First adder, for calculating first and value after the rgb value addition before the adjustment of described image saturation;
First multiplier, using described first and value and 1/3 product value as image saturation adjust before brightness value;
First comparer, for the rgb value before more described image saturation adjustment, and exports minimum value;
First subtracter, calculates the first difference between described brightness value and described minimum value;
First judging unit, according to described minimum value, judges the second reference value before obtaining image saturation adjustment: when minimum value is B value, using R value as the second reference value before described image saturation adjustment; When minimum value is R value, using G value as the second reference value before described image saturation adjustment; When minimum value is G value, using B value as the second reference value before described image saturation adjustment;
Second subtracter, after described saturation degree Dynamic gene is subtracted 1 process, obtains the second difference;
Second multiplier, for being multiplied by 2 by described second difference n, obtain the second product value;
3rd multiplier, for calculating the 3rd product value between described first difference and described second product value;
First shift unit, for the n position that moved to right by described 3rd product value, obtains the first off-set value;
3rd subtracter, for calculating the 3rd difference between described minimum value and described first off-set value, described 3rd difference is as the first reference value after image saturation adjustment;
4th subtracter, for calculating the 4th difference between the second reference value before the adjustment of described image saturation and described brightness value;
4th multiplier, for calculating the 4th product value between described 4th difference and described second product value;
Second comparer, for by judge described image saturation adjustment after the first reference value and 0 make comparisons;
Second shift unit, for when the first reference value after described image saturation adjustment is more than or equal to 0, obtains the second off-set value behind the n position that moved to right by described 4th product value;
Second adder, for calculate described image saturation adjustment before the second reference value and described second off-set value between second and value, described second and value as image saturation adjust after the second reference value;
Processor, in order to store comparison list, when the first reference value after described image saturation adjustment is less than 0, searches the table of comparisons based on described first difference and obtains corresponding array value; Prestore when described first difference is 1,2 in the described table of comparisons ..., 169, each array value corresponding when 170, and each array value described is by 2 kwith the ratio of the first difference round up round;
5th multiplier, for calculating five product value of described minimum value, the 4th between difference and array value;
3rd shift unit, for obtaining the 3rd off-set value behind the k position that moved to right by described 5th product value;
3rd totalizer, for calculate described image saturation adjustment before the second reference value and described 3rd off-set value between the 3rd and value, the described 3rd and value as image saturation adjust after the second reference value;
5th subtracter, for by first and value deduct described image saturation adjustment after the first reference value and image saturation adjustment after the second reference value obtain the 5th difference, described 5th difference as image saturation adjust after the 3rd reference value; And
Second judging unit, according to described minimum value, judge the rgb value after obtaining image saturation adjustment: when minimum value is B value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to B, R and G value after image saturation adjustment; When minimum value is R value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to R, G and B value after image saturation adjustment; When minimum value is G value, the first reference value after described image saturation adjustment, the second reference value, the 3rd reference value correspond to G, B and R value after image saturation adjustment.
CN201410856533.XA 2014-12-31 2014-12-31 Method and device for regulating image saturation degree Pending CN104637034A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410856533.XA CN104637034A (en) 2014-12-31 2014-12-31 Method and device for regulating image saturation degree

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410856533.XA CN104637034A (en) 2014-12-31 2014-12-31 Method and device for regulating image saturation degree

Publications (1)

Publication Number Publication Date
CN104637034A true CN104637034A (en) 2015-05-20

Family

ID=53215741

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410856533.XA Pending CN104637034A (en) 2014-12-31 2014-12-31 Method and device for regulating image saturation degree

Country Status (1)

Country Link
CN (1) CN104637034A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105100762A (en) * 2015-07-17 2015-11-25 敦泰电子有限公司 Image processing method and image processing apparatus
WO2017024615A1 (en) * 2015-08-10 2017-02-16 深圳市华星光电技术有限公司 Image enhancement method
CN108010005A (en) * 2016-10-31 2018-05-08 比亚迪股份有限公司 Adjust the method, apparatus and vehicle of brightness of image

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1622133A (en) * 2004-12-27 2005-06-01 北京中星微电子有限公司 Image zooming method
CN102752605A (en) * 2011-09-30 2012-10-24 新奥特(北京)视频技术有限公司 Method and system for regulating image/video color saturation degree
CN102779330A (en) * 2012-06-13 2012-11-14 京东方科技集团股份有限公司 Image reinforcement method, image reinforcement device and display device
CN103491315A (en) * 2013-08-09 2014-01-01 北京中传视讯科技有限公司 Video data processing method, video data processing device and electronic device comprising video data processing device
CN103971336A (en) * 2014-04-28 2014-08-06 深圳市云宙多媒体技术有限公司 Adjusting method, device and equipment for image lightness
CN103974052A (en) * 2014-04-28 2014-08-06 深圳市云宙多媒体技术有限公司 Adjusting method, device and equipment for image saturation

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1622133A (en) * 2004-12-27 2005-06-01 北京中星微电子有限公司 Image zooming method
CN102752605A (en) * 2011-09-30 2012-10-24 新奥特(北京)视频技术有限公司 Method and system for regulating image/video color saturation degree
CN102779330A (en) * 2012-06-13 2012-11-14 京东方科技集团股份有限公司 Image reinforcement method, image reinforcement device and display device
CN103491315A (en) * 2013-08-09 2014-01-01 北京中传视讯科技有限公司 Video data processing method, video data processing device and electronic device comprising video data processing device
CN103971336A (en) * 2014-04-28 2014-08-06 深圳市云宙多媒体技术有限公司 Adjusting method, device and equipment for image lightness
CN103974052A (en) * 2014-04-28 2014-08-06 深圳市云宙多媒体技术有限公司 Adjusting method, device and equipment for image saturation

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
罗涛: "彩色图像色调增强技术研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
赵胜杰 等: "基于HSI彩色模型的彩色图像自动调节方法", 《科技信息(学术研究)》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105100762A (en) * 2015-07-17 2015-11-25 敦泰电子有限公司 Image processing method and image processing apparatus
WO2017024615A1 (en) * 2015-08-10 2017-02-16 深圳市华星光电技术有限公司 Image enhancement method
CN108010005A (en) * 2016-10-31 2018-05-08 比亚迪股份有限公司 Adjust the method, apparatus and vehicle of brightness of image
CN108010005B (en) * 2016-10-31 2020-11-06 比亚迪股份有限公司 Method and device for adjusting image brightness and vehicle

Similar Documents

Publication Publication Date Title
CN104486606A (en) Method and device for regulating image brightness and contrast ratio
MX2018007486A (en) Optimizing high dynamic range images for particular displays.
Finlayson et al. Diagonal transforms suffice for color constancy
CN103942769B (en) A kind of satellite remote-sensing image fusion method
RU2014143972A (en) PROCESSING IMAGES WITH CHANGE OF BRIGHTNESS WITH COLOR RESTRICTIONS
US20090002782A1 (en) System and method for converting over-range colors
JP2020518086A (en) Method and apparatus for generating a file color scheme
TWI533661B (en) Method and device of skin tone optimization in color gamut mapping system
CN104767983A (en) Picture processing method and device
CN104637034A (en) Method and device for regulating image saturation degree
CN109255774B (en) Image fusion method, device and equipment
CN101594545B (en) Color gamut expanding system and method
WO2016047398A1 (en) Color gamut conversion device, color gamut conversion method, and color gamut conversion program
CN102271251B (en) Lossless image compression method
CN104077794A (en) Picture staining method and device
US8861850B2 (en) Digital image color correction
KR101920403B1 (en) Image treating circuit, image transform device, image display device and image treating method
Hanumantharaju et al. A novel FPGA implementation of adaptive color image enhancement based on HSV color space
CN101334985B (en) Wave data displaying apparatus and method
JP6015359B2 (en) Color video signal processing apparatus, processing method, and processing program
US10242461B1 (en) Method to improve overlay mapping of out-of-gamut
TW201401890A (en) Dynamic range compression method for image and image processing device
CN114512094B (en) Screen color adjusting method, device, terminal and computer readable storage medium
CN113658157B (en) Color segmentation method and device based on HSV space
CN101567965A (en) Image processing apparatus

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20150520