CN105100762B - A kind of image processing method and image processing apparatus - Google Patents

A kind of image processing method and image processing apparatus Download PDF

Info

Publication number
CN105100762B
CN105100762B CN201510424446.1A CN201510424446A CN105100762B CN 105100762 B CN105100762 B CN 105100762B CN 201510424446 A CN201510424446 A CN 201510424446A CN 105100762 B CN105100762 B CN 105100762B
Authority
CN
China
Prior art keywords
delta
component
new
target
parameter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510424446.1A
Other languages
Chinese (zh)
Other versions
CN105100762A (en
Inventor
李振徽
陈玮凯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dun Tai Electronics Co Ltd
Original Assignee
Dun Tai Electronics 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 Dun Tai Electronics Co Ltd filed Critical Dun Tai Electronics Co Ltd
Priority to CN201510424446.1A priority Critical patent/CN105100762B/en
Publication of CN105100762A publication Critical patent/CN105100762A/en
Application granted granted Critical
Publication of CN105100762B publication Critical patent/CN105100762B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The embodiment of the invention discloses a kind of image processing method and image processing apparatus, for accelerating to perform speed, the power consumption of image processing apparatus is reduced, it may also be used for the integrated circuit without divider or without FPU.Present invention method includes:Obtain the red component, green component, blue component of pending pixel;Receive colorimetric parameter and saturation parameters;According to colorimetric parameter and the first preset value computation interval variable and declinate variable;Computing, which is carried out, according to red component, green component, blue component, the first preset value, interval variable, declinate variable and saturation parameters obtains target interval variable and provisional parameter;Shifting processing is carried out to provisional parameter and obtains target component;Target red component, target green component and target blue component are determined according to target interval variable and target component, the color shown according to target red component, target green component and target blue component to pending pixel is updated.

Description

A kind of image processing method and image processing apparatus
Technical field
The present embodiments relate to image processing field, more particularly to a kind of image processing method and image processing apparatus.
Background technology
In image processing field, RGB (RGB) color model is a kind of color standard of industrial quarters, by RGB The change of three passage colors and their superpositions from each other form a variety of colors.In rgb color pattern, RGB moulds Type distributes a value for the RGB component of each pixel in image, when the memory space of pixel component is 8bits, pixel The number range of component is 0~255 (0~28), for example:As the R of pixel, G, B component is 0, and pixel is black;Work as picture The R of vegetarian refreshments, G, B component are 255, and pixel is white;When the R component of colour vegetarian refreshments is that 255, G components are 0, B component is 0, Pixel is pure red.In RGB image, different colors can be formed according to the various combination of RGB component numerical value.
Hsv color model is a kind of user oriented color model, wherein, " H " in HSV represents tone (Hue), " S " Saturation degree (Saturation) is represented, " V " represents brightness (Value), in hsv color model, can be by H, S, V tri- The change of color attribute adjusts the color of pixel.Tone H represents the position of color information, i.e. residing spectral color, should Parameter is represented with angular metric, and all tones can be represented from 0 degree to 360 degree;Saturation degree S represents the purity and face of selected color The ratio between maximum purity of color, span is from 0 to 1, as S=0, only gray scale;Brightness V represents the light levels of color, model Enclose from 0 to 255.
The color adjustment mode of prior art approximately as:The color of pending pixel is changed by rgb color space To HSV color spaces, the tone of color, saturation degree or brightness are adjusted in HSV color spaces, further according to the face after adjustment RGB component after tone, saturation degree and the brightness calculation adjustment of color so that pixel color is updated to the RGB component after adjustment The tertiary colour of composition.
But, by the color of pending pixel from during rgb color space is transformed into HSV color spaces, calculate The formula of saturation degree is:Saturation degree=(maximum-minimum value)/maximum, value is the decimal between [0,1].Calculating , it is necessary to carry out division and floating-point processing in journey.Or, pixel color from HSV color spaces is transformed into rgb color space During, the formula for calculating tone interval i and tone declinate f is as follows:H=h/60, i=floor (h), f=h-floor (h);H/60 needs division to realize, f is h/60 decimal point part, it is necessary to carry out floating-point processing.
In the IC design (IC Design, Integrated circuit design) of image procossing, for example, The driving IC of liquid crystal display (LCD, Liquid Crystal Display), or IP-based web camera (IPCam, IP network camera) miniature image processing chip in, the color of pixel is entered using existing color adjustment algorithm During row processing, it is necessary to divider and floating point calculator (FPU, floating point unit) are used, due to divider and FPU Construction complexity is, it is necessary to take the area of integrated circuit in sizable image processing apparatus, for integrated in image processing apparatus The manufacturing cost influence of circuit is very big.
The content of the invention
The embodiments of the invention provide a kind of image processing method and image processing apparatus, integrated circuit can be saved Run power consumption.
In view of this, first aspect of the embodiment of the present invention provides a kind of image processing method, including:
Obtain the red component, green component, blue component of pending pixel;
Receive colorimetric parameter and saturation parameters;
According to the colorimetric parameter and the first preset value computation interval variable and declinate variable, the colorimetric parameter, Saturation parameters, the first preset value, interval variable and declinate variable are integer;
According to the red component, the green component, the blue component, first preset value, the interval change Amount, the declinate variable and the saturation parameters carry out computing and obtain target interval variable and provisional parameter;
Shifting processing is carried out to the provisional parameter and obtains target component;
According to the target interval variable and the target component determine target red component, target green component and Target blue component, according to the target red component, target green component and target blue component to the pending picture The color that vegetarian refreshments is shown is updated.
With reference in a first aspect, in the first possible embodiment of first aspect, it is described according to the colorimetric parameter and First preset value computation interval variable and declinate variable include:
Wherein interval variable Δ i and declinate variable Δ f can meet following equation:
Δ h=(Δ i*m)+Δ f;
Wherein, the Δ h is the colorimetric parameter, and the m is the first preset value, and the m is integer, and the Δ f is less than Or equal to the m.
With reference in a first aspect, or first aspect the first possible embodiment, may implement second of first aspect It is described according to the red component, the green component, the blue component, first preset value, the interval in mode Variable, the declinate variable and the saturation parameters, which calculate target interval variable and provisional parameter, to be included:
Brightness and minimum component are determined according to the red component, the green component, the blue component;
According to the red component, the green component, the blue component, the brightness and the minimum component meter Difference parameter collection is calculated, the difference parameter collection includes the first difference parameter;
According to the red component, the green component, the blue component, the difference parameter collection and described first Preset value calculates target interval parameter and goal discrepancy angle variable;
Target interval variable is determined according to the target interval parameter;
According to the brightness, first difference parameter, first preset value, the goal discrepancy angle variable and described Saturation parameters calculate provisional parameter.
With reference to second of possible embodiment of first aspect, in the third possible embodiment of first aspect, according to The red component, the green component, the blue component determine that brightness and minimum component include:
If r>G, r>B, then max=r;If r>G, b>R, then max=b;If r<G, r>B, then max=g;
If r<G, r<B, then min=r;If r<G, b<R, then min=b;If r>G, r<B, then min=g;
Wherein, the max is brightness, and the min is minimum component, and the r is the red component, and the g is described Green component, the b is the blue component.
It is described in the 4th kind of possible embodiment of first aspect with reference to the third possible embodiment of first aspect Difference ginseng is calculated according to the red component, the green component, the blue component, the brightness and the minimum component Manifold includes:
Delta=max-min;If r<G, then delta_rg=g-r;If r>G, then delta_rg=r-g;If b<R, then Delta_br=r-b;If b>R, then delta_br=b-r;If b<G, then delta_gb=g-b;If b>G, then delta_gb= g-b;
The delta is the first difference parameter, and the delta_rg is the second difference parameter, and the delta_br is the 3rd Difference parameter, the delta_gb is the 4th difference parameter, and the max is the brightness, and the min is the minimum component, The r is the red component, and the g is the green component, and the b is the blue component.
It is described in the 5th kind of possible embodiment of first aspect with reference to the third possible embodiment of first aspect According to the red component, the green component, the blue component, the difference parameter collection and the first preset value meter Calculating target interval parameter and goal discrepancy angle variable includes:
Target interval parameter i' and goal discrepancy angle variable new_f is calculated in the following manner:
If r=g, g=b, then i'=Δs i, new_f=0;
If r=max, g≤b, delta_gb*m=delta*m, then i'=Δs i+1, new_f=Δs f*delta;
If r=max, g≤b, Δ f*delta+delta_gb*m≤delta*m, then i'=Δs i+1, new_f=Δs f* delta+delta_gb*m-delta*m;
If r=max, g≤b, Δ f*delta+delta_gb*m<Delta*m, then i'=Δs i, new_f=Δs f* delta;
If r=max, g<B, Δ f*delta≤delta_gb*m, then new_f=Δs f*delta-delta_gb*m, i'= Δi+6;
If r=max, g<B, Δ f*delta<Delta_gb*m, then i'=Δs i+5, new_f=Δs f*delta+delta* m-delta_gb*m;
If g=max, r≤2*delta+b, b≤r, delta_br*m=delta*m, then i'=Δs i+3, new_f=Δs f*delta;
If g=max, r≤2*delta+b, b≤r, Δ f*delta+delta_br*m>Delta*m, then i'=Δs i+3, New_f=Δs f*delta+delta_br*m-delta*m;
If g=max, r≤2*delta+b, b≤r, Δ f*delta+delta_br*m≤delta*m, then i'=Δs i+2, New_f=Δs f*delta+delta_br*m;
If g=max, r≤2*delta+b, r>B, Δ f*delta≤delta_br*m, then i'=Δs i+2, new_f=Δs f*delta-delta_br*m;
If g=max, r≤2*delta+b, r>B, Δ f*delta<Delta_br*m, then i'=Δs i+1, new_f=Δs f*delta+delta*m-delta_br*m;
If g=max, r>2*delta+b, then i'=Δs i, new_f=Δs f*delta;
If b=max, g≤4*delta+r, r>G, Δ f*delta+delta_rg*m≤delta*m, then i'=Δs i+5, New_f=Δs f*delta+delta_rg*m-delta*m;
If b=max, g≤4*delta+r, r>G, Δ f*delta+delta_rg*m<Delta*m, then i'=Δs i+4, New_f=Δs f*delta+delta_rg*m;
If b=max, g≤4*delta+r, g>R, Δ f*delta≤delta_rg*m, then i'=Δs i+4, new_f=Δs f*delta-delta_rg*m;
If b=max, g≤4*delta+r, g>R, Δ f*delta<Delta_rg*m, then i'=Δs i+3, new_f=Δs f*delta+delta*m-delta_rg*m;
If b=max, g>4*delta+r, then i'=Δs i, new_f=Δs f*delta;
Wherein, the r is the red component, and the g is the green component, and the b is the blue component, described M is first preset value, and the Δ f is the declinate variable, and the delta is first difference parameter, described Delta_rg is second difference parameter, and the delta_br is the 3rd difference parameter, and the delta_gb is described 4th difference parameter, the Δ i is the interval variable, and the Δ f is the declinate variable.
It is described in the 6th kind of possible embodiment of first aspect with reference to the third possible embodiment of first aspect Determine that target interval variable includes according to the target interval parameter:
If i'≤6, new_i=i'-6;If i'<6, then new_i=i';
Wherein, the new_i is target interval variable, and the i' is the target interval parameter.
It is described in the 7th kind of possible embodiment of first aspect with reference to the 6th kind of possible embodiment of first aspect Joined according to the brightness, first difference parameter, first preset value, the goal discrepancy angle variable and the saturation degree Number, which calculates provisional parameter, to be included:
The first provisional parameter b_stp1, the second provisional parameter c_stp1 and the 3rd provisional parameter are calculated in the following way d_stp1:
B_stp1=(max*n)-(delta*adj_sat);
C_stp1=(max*m*n)-(adj_sat*new_f);
D_stp1=(max*m*n)+(adj_sat*new_f)-(delta*adj_sat*m);
The max is the brightness, and the delta is first difference parameter, and the adj_sat is the saturation degree Parameter, the new_f is the goal discrepancy angle variable, and the m is first preset value, and the n is the second preset value, described M and n meet below equation:M=2n.
It is described in the 8th kind of possible embodiment of first aspect with reference to the 7th kind of possible embodiment of first aspect Provisional parameter progress shifting processing is obtained into target component includes:
First object parameter b_value, the second target component c_value, the 3rd target component are calculated in the following manner d_value:
B_value=(b_stp1>>k1);
C_value=(c_stp1>>k2);
D_value=(d_stp1>>k2);
Wherein, k1, k2 are default integer, b_stp1>>K1 represents b_stp1 moving to right k1 bit.
With reference to the 8th kind of possible embodiment of first aspect, in the 9th kind of possible embodiment of first aspect, including: Target red component new_r, target green component new_g and target blue component new_b are calculated in the following manner:
If new_i=0, new_r=max, new_g=d_value, new_b=b_value;
If new_i=1, new_r=c_value, new_g=max, new_b=b_value;
If new_i=2, new_r=b_value, new_g=max, new_b=d_value;
If new_i=3, new_r=b_value, new_g=c_value, new_b=max;
If new_i=4, new_r=d_value, new_g=b_value, new_b=max;
If new_i=5, new_r=max, new_g=b_value, new_b=c_value;
Wherein, new_r is target red component, and new_g is target green component, and new_b is target blue component, b_ Value is first provisional parameter, and c_value is second provisional parameter, and d_value is the 3rd provisional parameter, New_i is the target interval variable, and the max is the brightness.
It is described in the tenth kind of possible embodiment of first aspect with reference to the 7th kind of possible embodiment of first aspect Provisional parameter is calculated according to the brightness, first difference parameter, the goal discrepancy angle variable and the saturation parameters Include before:
Judge whether the product of first difference parameter and the saturation parameters is pre- less than the brightness and described second If the product of value, if so, then triggering according to the brightness, first difference parameter, the goal discrepancy angle variable and described full The step of provisional parameter being calculated with degree parameter.
Second aspect of the embodiment of the present invention provides a kind of image processing apparatus, including:
Acquisition module, red component, green component, blue component for obtaining pending pixel;
Receiving module, for receiving colorimetric parameter and saturation parameters;
Computing module, for according to the colorimetric parameter and the first preset value computation interval variable and declinate variable;
Computing module, for being preset according to the red component, the green component, the blue component, described first Value, the interval variable, the declinate variable and the saturation parameters carry out computing and obtain target interval variable and face When parameter;
Shifting processing module, target component is obtained for carrying out shifting processing to the provisional parameter;
Determining module, for determining target red component, mesh according to the target interval variable and the target component Mark green component and target blue component;
Update module, for according to the target red component, target green component and target blue component to described The color that pending pixel is shown is updated.
With reference to second aspect, in the first possible embodiment of second aspect, the computing module is specifically for basis The red component, the green component, the blue component determine brightness and minimum component;According to the red component, The green component, the blue component, the brightness and the minimum component calculate difference parameter collection, the difference parameter Collection includes the first difference parameter;According to the red component, the green component, the blue component, the difference parameter collection And first preset value calculates target interval parameter and goal discrepancy angle variable;Mesh is determined according to the target interval parameter Mark interval variable;According to the brightness, first difference parameter, the goal discrepancy angle variable and the saturation parameters meter Calculate provisional parameter.
It is described in second of possible embodiment of second aspect with reference to the first possible embodiment of second aspect Computing module is additionally operable to judge whether first difference parameter and the product of the saturation parameters are less than the brightness and second The product of preset value, if so, then triggering the computing module according to the brightness, first difference parameter, the target declinate Variable and the saturation parameters calculate the provisional parameter.
As can be seen from the above technical solutions, the embodiment of the present invention has advantages below:Obtain the red of pending pixel Colouring component, green component, blue component;Receive colorimetric parameter and saturation parameters;It is default according to colorimetric parameter and first It is worth computation interval variable and declinate variable, colorimetric parameter, saturation parameters, the first preset value, interval variable and declinate become Measure as integer;According to red component, green component, blue component, the first preset value, interval variable, declinate variable and saturation Degree parameter carries out computing and obtains target interval variable and provisional parameter;Shifting processing is carried out to provisional parameter and obtains target ginseng Number;Target red component, target green component and target blue component are determined according to target interval variable and target component, The color shown according to target red component, target green component and target blue component to pending pixel is carried out more Newly.In embodiments of the present invention, colorimetric parameter and saturation parameters are adjusted, calculating process is optimized so that defeated It is integer to enter data, intermediate data and gained RGB component, and the algorithm is realized simply, reduces the complexity of calculating, simultaneously Can accelerate to perform speed, reduce the power consumption of image processing apparatus, improve overall execution efficiency, it may also be used for without divider or Integrated circuit without FPU.
Brief description of the drawings
Fig. 1 is a schematic flow sheet of image processing method in the embodiment of the present invention;
Fig. 2 is another schematic flow sheet of image processing method in the embodiment of the present invention;
Fig. 3 is a structural representation of image processing apparatus in the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than whole embodiments.It is based on Embodiment in the present invention, the every other implementation that those skilled in the art are obtained under the premise of creative work is not made Example, belongs to the scope of protection of the invention.
Referring to Fig. 1, one embodiment of image processing method includes in the embodiment of the present invention:
Step S101, red component, green component, the blue component for obtaining pending pixel;
Image processing apparatus can obtain the red component, green component, blue component of pending pixel, image procossing Device is the picture reproducer for possessing disposal ability, can be computer, television set or mobile phone etc., can also be other similar devices, It is not construed as limiting herein.
The value of color component is positive integer, and value size is related to the memory space of color component, is not construed as limiting herein.
The red component of the pending pixel of image processing apparatus acquisition, green component, the detailed process of blue component are Prior art, here is omitted.
Step S102, reception colorimetric parameter and saturation parameters;
Image processing apparatus can receive colorimetric parameter and saturation parameters,
When the color of pending pixel is represented with hsv color model, image processing apparatus can utilize colorimetric parameter The tone value of pending pixel is adjusted, the intensity value of pending pixel adjusted using saturation parameters Whole, above-mentioned colorimetric parameter and saturation parameters are integer.
It should be noted that the sequencing that this step is not fixed with step S101, is not construed as limiting herein.In this step In, colorimetric parameter can be first received, then receive saturation parameters, can also first receive saturation parameters, then receive colorimetric parameter, It is not construed as limiting herein.
Step S103, according to colorimetric parameter and the first preset value computation interval variable and declinate variable;
Image processing apparatus receive colorimetric parameter after, according to the first preset value by colorimetric parameter be decomposed into interval variable and Declinate variable, interval variable is the corresponding interval of colorimetric parameter, and declinate variable is colorimetric parameter interval corresponding with colorimetric parameter The difference of middle minimum value.
Colorimetric parameter is decomposed into interval variable and declinate variable by image processing apparatus, can when handling colorimetric parameter To carry out positive integer processing to colorimetric parameter, and without computing into decimal form, carry out floating-point operation.
Step S104, according to red component, green component, blue component, the first preset value, interval variable, declinate variable And saturation parameters carry out computing and obtain target interval variable and provisional parameter;
Tone interval includes 6 intervals, is first interval from red to yellow, is second interval from yellow to green, from Green is 3rd interval to cyan, is the 4th interval from cyan to blueness, interval for the 5th from blueness to magenta, from magenta It is interval for the 6th to red.
Red component, green component, blue component are compared by image processing apparatus, it may be determined that pending pixel Color tone it is interval, obtain after interval variable, target interval variable can be obtained according to interval variable and tone interval.
Image processing apparatus is obtained after red component, green component, blue component, determines the corresponding default bar of the color Part, carries out computing according to red component, green component, blue component, the first preset value and declinate variable and obtains the change of target declinate Amount, calculates interim according to red component, green component, blue component, the first preset value, goal discrepancy angle variable and saturation parameters Parameter.
Step S105, to provisional parameter carry out shifting processing obtain target component;
Image processing apparatus is obtained after provisional parameter, and provisional parameter progress shifting processing is obtained into target component, target Parameter is used to determine color of object component.
Step S106, determined according to target interval variable and target component target red component, target green component with And target blue component;
Image processing apparatus is obtained after target interval variable and target component, can according to target interval variable and Target component determines color of object component, so that the pixel color is transformed into rgb color space from HSV color spaces.
It should be noted that target interval is corresponding with target interval variable, when the tone of pending pixel color is located at Target interval, color component value is target component.Image processing apparatus is determined according to target interval variable and target component Color of object component detailed process is prior art, and here is omitted.
Step S107, according to target red component, target green component and target blue component to pending pixel The color of display is updated.
Image processing apparatus is according to target red component, target green component and target blue component to pending pixel The color of point display is updated as prior art, and here is omitted.
In the present embodiment, image processing apparatus can obtain the red component, green component, blueness point of pending pixel Amount;Receive colorimetric parameter and saturation parameters;According to colorimetric parameter and the first preset value computation interval variable and declinate Variable, colorimetric parameter, saturation parameters, the first preset value, interval variable and declinate variable are integer;According to red component, Green component, blue component, the first preset value, interval variable, declinate variable and saturation parameters carry out computing and obtain target Interval variable and provisional parameter;Shifting processing is carried out to provisional parameter and obtains target component;According to target interval variable and Target component determines target red component, target green component and target blue component, green according to target red component, target The color that colouring component and target blue component are shown to pending pixel is updated.In embodiments of the present invention, to color Parameter and saturation parameters are adjusted to be adjusted, calculating process is optimized so that input data, intermediate data and gained RGB component is integer, and the algorithm is realized simply, reduces the complexity of calculating, while can accelerate to perform speed, reduces figure As the power consumption of processing unit, overall execution efficiency is improved, it may also be used for the integrated circuit without divider or without FPU.
Referring to Fig. 2, another embodiment of image processing method includes in the embodiment of the present invention:
Step S201, red component, green component, the blue component for obtaining pending pixel;
In the present embodiment, the span of the color component of pending pixel for [0, m).M is the first preset value, value For the positive integer power of 2 more than 2, color component includes red component, green component, blue component.Color point in the present invention Amount can be represented with Δ i*m+ Δs f, therefore when calculating interval panel tone and goal discrepancy angle variable, can pass through displacement to the right Computing replaces division arithmetic.
Step S202, reception colorimetric parameter and saturation parameters;
In this step, the span of colorimetric parameter for [0,6m), the spans of saturation parameters for [0, m).
When the colorimetric parameter or saturation parameters scope that image processing apparatus is received exceed span, step is triggered S209;When the colorimetric parameter or saturation parameters scope that image processing apparatus is received are within span, step is triggered S203。
Step S203, according to colorimetric parameter and the first preset value computation interval variable and declinate variable;
Image processing apparatus is obtained after colorimetric parameter, and interval variable Δ i and declinate can be determined in the following manner Variable Δ f;If Δ h<M, then Δ i=0, Δ f=Δs h;If m<Δh<2m, then Δ i=1, Δ f=Δs h-m;If 2m<Δh<3m, Then Δ i=2, Δ f=Δs h-2m;If 3m<Δh<4m, then Δ i=3, Δ f=Δs h-3m;If 4m<Δh<5m, then Δ i=4, Δ F=Δs h-4m;If 5m<Δh<6m, then Δ i=5, Δ f=Δs h-5m;If Δ h=6m, Δ i=6, Δ f=0;If Δ h> 6m, then Δ i=0, Δ f=0;Wherein, interval variable Δ i and declinate variable Δ f meet below equation:Δ f=Δs h- (Δ i* m).Δ i is interval variable, and Δ f is declinate variable, and m is the first preset value, and Δ h is colorimetric parameter.Δ i span for [0, 6], Δ f span be [0, m).
It should be noted that in this step, comparing colorimetric parameter with after the multiple of the first preset value, can also first determine Interval variable, then calculate declinate variable;Or, declinate variable, then computation interval variable are first determined, it is not construed as limiting herein.
Step S204, determine according to red component, green component, blue component brightness and minimum component;
Brightness max and minimum component min is determined in the following manner:
If r>G, r>B, then max=r;If r>G, b>R, then max=b;If r<G, r>B, then max=g;
If r<G, r<B, then min=r;If r<G, b<R, then min=b;If r>G, r<B, then min=g;
Wherein, r is red component, and g is green component, and b is blue component, and max is positive integer.
Step S205, difference parameter calculated according to red component, green component, blue component, brightness and minimum component Collection;
Image processing apparatus can calculate poor according to red component, green component, blue component, brightness and minimum component Different parameter set, difference parameter collection includes the first difference parameter, the second difference parameter, the 3rd difference parameter, the 4th difference parameter, tool Body computational methods are as follows:
Delta=max-min;If r<G, then delta_rg=g-r;If r>G, then delta_rg=r-g;If b<R, then Delta_br=r-b;If b>R, then delta_br=b-r;If b<G, then delta_gb=g-b;If b>G, then delta_gb= g-b;Wherein, delta is the first difference parameter, and delta_rg is the second difference parameter, and delta_br is the 3rd difference parameter, Delta_gb is the 4th difference parameter, and max is brightness, and min is minimum component, and r is red component, and g is green component, and b is yes Blue component.
Step S206, according to red component, green component, blue component, difference parameter collection and the first preset value calculate Target interval parameter and goal discrepancy angle variable;
Image processing apparatus calculates target interval variable parameter i' and target interval variable declinate in the following manner new_f:
If r=g, g=b, then i'=Δs i, new_f=0;
If r=max, g≤b, delta_gb*m=delta*m, then i'=Δs i+1, new_f=Δs f*delta;
If r=max, g≤b, Δ f*delta+delta_gb*m≤delta*m, then i'=Δs i+1, new_f=Δs f* delta+delta_gb*m-delta*m;
If r=max, g≤b, Δ f*delta+delta_gb*m<Delta*m, then i'=Δs i, new_f=Δs f* delta;
If r=max, g<B, Δ f*delta≤delta_gb*m, then i'=Δs i+6, new_f=Δs f*delta- delta_gb*m;
If r=max, g<B, Δ f*delta<Delta_gb*m, then i'=Δs i+5, new_f=Δs f*delta+delta* m-delta_gb*m;
If g=max, r≤2*delta+b, b≤r, delta_br*m=delta*m, then i'=Δs i+3, new_f=Δs f*delta;
If g=max, r≤2*delta+b, b≤r, Δ f*delta+delta_br*m>Delta*m, then i'=Δs i+3, New_f=Δs f*delta+delta_br*m-delta*m;
If g=max, r≤2*delta+b, b≤r, Δ f*delta+delta_br*m≤delta*m, then i'=Δs i+2, New_f=Δs f*delta+delta_br*m;
If g=max, r≤2*delta+b, r>B, Δ f*delta≤delta_br*m, then i'=Δs i+2, new_f=Δs f*delta-delta_br*m;
If g=max, r≤2*delta+b, r>B, Δ f*delta<Delta_br*m, then i'=Δs i+1, new_f=Δs f*delta+delta*m-delta_br*m;
If g=max, r>2*delta+b, then i'=Δs i, new_f=Δs f*delta;
If b=max, g≤4*delta+r, r>G, Δ f*delta+delta_rg*m≤delta*m, then i'=Δs i+5, New_f=Δs f*delta+delta_rg*m-delta*m;
If b=max, g≤4*delta+r, r>G, Δ f*delta+delta_rg*m<Delta*m, then i'=Δs i+4, New_f=Δs f*delta+delta_rg*m;
If b=max, g≤4*delta+r, g>R, Δ f*delta≤delta_rg*m, then i'=Δs i+4, new_f=Δs f*delta-delta_rg*m;
If b=max, g≤4*delta+r, g>R, Δ f*delta<Delta_rg*m, then i'=Δs i+3, new_f=Δs f*delta+delta*m-delta_rg*m;
If b=max, g>4*delta+r, then i'=Δs i, new_f=Δs f*delta.
Wherein, r is red component, and g is green component, and b is blue component, and m is the first preset value, and Δ f is declinate variable, Delta is the first difference parameter, and delta_rg is the second difference parameter, and delta_br is the 3rd difference parameter, and delta_gb is 4th difference parameter.
By the restrictive condition of setting, target interval parameter i' and panel tone declinate new_f, target interval ginseng are determined Number i' and panel tone declinate new_f is positive integer, and target interval parameter i' is used to calculate target interval variable, panel tone Declinate parameter new_f is used to calculate target component.
Step S207, target interval variable determined according to target interval parameter;
Image processing apparatus can determine target interval variable according to target interval parameter, and specific formula is as follows:If i'≤ 6, then new_i=i'-6;If i'<6, then new_i=i';
When the color of pending pixel is represented with hsv color model, target interval variable is the corresponding color of the color Adjust interval, if i'≤6, expression is adjusted using colorimetric parameter to the color, more than interval range, it is necessary to the color pair The tone interval answered is adjusted, and is adjusted to new_i=i'-6.
Step S208, judge the first difference parameter and saturation parameters product whether be less than brightness and the second preset value it Product, if so, step S210 is then triggered, if it is not, then triggering step S209;
Image processing apparatus is obtained after the first difference parameter, saturation parameters and brightness, it can be determined that delta* adj_sat<Whether max*n sets up, wherein, delta is the first difference parameter, and adj_sat is saturation parameters, and max is brightness, N is the second preset value, and the second preset value and the first preset value meet below equation:M=2n.
If delta*adj_sat<Max*n, shows saturation parameters within the scope of the restriction of saturation parameters, triggering step Rapid 210, if delta*adj_sat≤max*n, represent that saturation parameters outside the restriction scope of saturation parameters, are unsatisfactory for This algorithm is provided, triggers step 209.
It should be noted that in actual applications, if limited in input process saturation parameters so that Without this deterministic process in calculating process, this step can not also be performed, is not construed as limiting herein.
Step S209, perform other flows.
When image processing apparatus determines the first difference parameter with the product of saturation parameters not less than brightness and the second preset value Product when, then show saturation parameters exceed saturation parameters restriction scope, be unsatisfactory at the qualifications of this algorithm, image Saturation parameters can be set to the second preset value by reason device so that the saturation degree of above-mentioned color keeps constant, can also alert, Show that the saturation parameters of input are wrong, can also carry out other flows, be not construed as limiting herein.
Step S210, according to brightness, the first difference parameter, the first preset value, goal discrepancy angle variable and saturation parameters Calculate provisional parameter;
Image processing apparatus calculate in the following way the first provisional parameter b_stp1, the second provisional parameter c_stp1 and 3rd provisional parameter d_stp1:
B_stp1=(max*n)-(delta*adj_sat);
C_stp1=(max*m*n)-(adj_sat*new_f);
D_stp1=(max*m*n)+(adj_sat*new_f)-(delta*adj_sat*m);
Wherein, max is brightness, and delta is the first difference parameter, and adj_sat is saturation parameters, and m is the first preset value, N is the second preset value.
Step S211, to provisional parameter carry out shifting processing obtain target component;
Image processing apparatus calculates first object parameter b_value, the second target component c_value in the following way, 3rd target component d_value:
B_value=(b_stp1>>k1);
C_value=(c_stp1>>k2);
D_value=(d_stp1>>k2);
Wherein, k1, k2 are default integer, b_stp1>>K1 shows b_stp1 moving to right k1 bit, c_stp1>>K2 tables It is bright that c_stp1 is moved to right into k2 bit, d_stp1>>K2 shows d_stp1 moving to right k2 bit.
It should be noted that k1, k2 meet below equation:N=2k1, m=2k1+1, m*n=2k2, m are first default Value, n is the second preset value.
Colorimetric parameter and saturation parameters are exaggerated adjustment by this algorithm, in this step by gained provisional parameter The corresponding order of magnitude of RGB component is reverted to, because n is 2 k1 power, therefore provisional parameter k1 bit is moved to right into mathematically It is equivalent to provisional parameter divided by n, is that can be achieved without divider.
Step S212, determined according to target interval variable and target component target red component, target green component with And target blue component;
Image processing apparatus calculates target red component in the following manner according to target interval variable and target component New_r, target green component new_g and target blue component new_b:
If new_i=0, new_r=max, new_g=d_value, new_b=b_value;
If new_i=1, new_r=c_value, new_g=max, new_b=b_value;
If new_i=2, new_r=b_value, new_g=max, new_b=d_value;
If new_i=3, new_r=b_value, new_g=c_value, new_b=max;
If new_i=4, new_r=d_value, new_g=b_value, new_b=max;
If new_i=5, new_r=max, new_g=b_value, new_b=c_value;
Wherein, b_value is the first provisional parameter, and c_value is the second provisional parameter, and d_value is the 3rd interim ginseng Number, new_i is target interval variable, and max is brightness.
Image processing apparatus obtains color of object component, that is, represents to change the color of the pixel from HSV color spaces To rgb color space.
Step S213, according to target red component, target green component and target blue component to pending pixel The color of display is updated.
Image processing apparatus is according to target red component, target green component and target blue component to pending pixel The color of point display is updated.
In the present embodiment, image processing apparatus can obtain the red component, green component, blueness point of pending pixel Amount;Receive colorimetric parameter and saturation parameters;According to colorimetric parameter and the first preset value computation interval variable and declinate Variable, colorimetric parameter, saturation parameters, the first preset value, interval variable and declinate variable are integer;According to red component, Green component, blue component, the first preset value, interval variable, declinate variable and saturation parameters carry out computing and obtain target Interval variable and provisional parameter;Shifting processing is carried out to provisional parameter and obtains target component;According to target interval variable and Target component determines target red component, target green component and target blue component, green according to target red component, target The color that colouring component and target blue component are shown to pending pixel is updated.In embodiments of the present invention, to color Parameter and saturation parameters are adjusted to be adjusted, calculating process is optimized so that input data, intermediate data and gained RGB component is integer, and the algorithm is realized simply, reduces the complexity of calculating, while can accelerate to perform speed, reduces figure As the power consumption of processing unit, overall execution efficiency is improved, it may also be used for the integrated circuit without divider or without FPU.
Secondly, the embodiments of the invention provide the concrete processing procedure of conversion pixel color, scheme implementation is improved Feasibility.
For ease of understanding, image processing method in the embodiment of the present invention is retouched with a concrete application scene below State:
In the concrete application scene of the present embodiment, image processing apparatus is by taking computer as an example, it is assumed that computer stores picture The memory space of the color component of vegetarian refreshments is 8bits, then computer obtains the r of pending rgb pixel point, g, b tri- colors point Amount, such as (250,45,120), red component r is 250, and green component g is 45, and blue component b is 120;
User inputs colorimetric parameter in a computer, it is assumed that colorimetric parameter is 1000, and the first preset value is 256, computer Judge that 1000 are more than 3*256 and less than 4*256, it is 3 to obtain interval variable Δ i, and declinate variable Δ f is 24;
Computer determines brightness max and minimum component min according to r, g, b, specific as follows:R, g, b are compared, 250>45,250>120, it is 250,45 to obtain brightness max<250,45<120, it is 45 to obtain minimum component min;
Computer obtains difference parameter collection by the following method:
First difference parameter delta:250-45=205, the second difference parameter delta_rg:250-45=205, the 3rd is poor Different parameter delta_br:250-120=130, the 4th difference parameter delta_gb:120-45=75;
Obtain after above-mentioned parameter, computer judges r, max, g, b, and Δ f, delta, delta_gb, m meet following bar Part:R=max (250=250), g<b(45<120), Δ f*delta<delta_gb*m(24*205<75*256), then computer Target interval parameter i' is calculated in the following way:I'=Δs i+5 (8=3+5), goal discrepancy angle variable new_f:New_f=Δs F*delta+delta*m-delta_gb*m=(24*205+205*256-75*256)=38200;
Computer judges i'>6, determine target interval variable new_i=i'-6=8-6=2;
User inputs saturation parameters in a computer, it is assumed that saturation parameters are 130, and default the is worth to according to first Two preset values are 128, and computer compares delta*adj_sat (205*130) and max*n (250*128), determines 205*130< 250*128, shows saturation parameters scope within this algorithm prescribed limit;
Computer according to brightness max, the first difference parameter delta, the first preset value m, goal discrepancy angle variable new_f and Saturation parameters adj_sat is calculated:
First provisional parameter b_stp1:B_stp1=(max*n)-(delta*adj_sat)=250*128-205*130= 5350;
Second provisional parameter c_stp1=(max*m*n)-(adj_sat*new_f)=250*256*128-130*38200 =3226000;
3rd provisional parameter d_stp1=(max*m*n)+(adj_sat*new_f)-(delta*adj_sat*m)=250* 256*128+130*38200-205*130*256=6335600;
Target component is calculated according to provisional parameter, is accomplished by the following way:
First object parameter:B_value=(b_stp1>>7), show that the first provisional parameter b_stp1 is moved to right into 7 obtains 41;
Second target component:C_value=(c_stp1>>K2), show that the second provisional parameter is moved to right into 15 obtains 98;
3rd target component:D_value=(d_stp1>>K2), show that the 3rd provisional parameter is moved right into 15 obtains 193;
Computer is 2 according to target interval variable new_i, using first object parameter 41 as target red component, by the Two target components 250 regard the 3rd targeted parameter value 193 as the blue variable of target as target green component;
The color that pending pixel is shown is updated by the color component (41,250,193) according to getting.
Image processing method in the embodiment of the present invention is described from the angle of method above, below from the angle of device Image processing apparatus in the embodiment of the present invention is described:
Referring to Fig. 3, one embodiment of image processing apparatus includes in the embodiment of the present invention:
Acquisition module 301, red component, green component, blue component for obtaining pending pixel;
Receiving module 302, for receiving colorimetric parameter and saturation parameters;
Computing module 303, for according to colorimetric parameter and the first preset value computation interval variable and declinate variable;
Computing module 304, for according to red component, green component, blue component, the first preset value interval variable, difference Angle variable and saturation parameters carry out computing and obtain target interval variable and provisional parameter;
Shifting processing module 305, target component is obtained for carrying out shifting processing to provisional parameter;
Determining module 306, for determining target red component, target green according to target interval variable and target component Component and target blue component;
Update module 307, for according to target red component, target green component and target blue component to pending The color that pixel is shown is updated.
Optionally, on the basis of embodiment illustrated in fig. 3, another embodiment of image processing apparatus in the embodiment of the present invention In, computing module 304 specifically for determining brightness and minimum component according to red component, green component, blue component, according to Red component, green component, blue component, brightness and minimum component calculate difference parameter collection, and difference parameter collection includes first Difference parameter, target interval is calculated according to red component, green component, blue component, difference parameter collection and the first preset value Parameter and goal discrepancy angle variable, target interval variable is determined according to target interval parameter, according to brightness, the first difference parameter, Goal discrepancy angle variable and saturation parameters calculate provisional parameter.
Optionally, on the basis of embodiment illustrated in fig. 3 or alternative embodiment, image processing apparatus in the embodiment of the present invention Another embodiment in, computing module is additionally operable to judge whether the product of the first difference parameter and saturation parameters is less than brightness and the The product of two preset values, if so, then triggering computing module is according to brightness, the first difference parameter, goal discrepancy angle variable and saturation degree Parameter calculates provisional parameter.
For ease of understanding, below with modules of the practical application scene to image processing apparatus in the embodiment of the present invention Between interaction be described:
Acquisition module 301 obtains the red component, green component, blue component of pending pixel;
Receiving module 302 receives colorimetric parameter and saturation parameters;
Colorimetric parameter that computing module 303 is received according to receiving module 302 and the first preset value computation interval variable with And declinate variable;
Red component that computing module 304 is obtained according to acquisition module 301, green component, blue component determine brightness with And minimum component;Difference parameter collection is calculated according to red component, green component, blue component, brightness and minimum component;According to Red component, green component, blue component, difference parameter collection and the first preset value calculate target interval parameter and goal discrepancy Angle variable;According to target interval parameter determine target interval variable according to brightness, the first difference parameter, goal discrepancy angle variable and Saturation parameters calculate provisional parameter;The provisional parameter that shifting processing module 305 is obtained to the computing of computing module 304 is shifted Processing obtains target component;Target interval variable and shifting processing that determining module 306 is obtained according to the computing of computing module 304 The target component that module 305 is obtained determines target red component, target green component and target blue component;Update module 307 target red component, target green component and the target blue components determined according to determining module 306 are to pending pixel The color of point display is updated.
Computing module 304 is additionally operable to judge whether the product of the first difference parameter and saturation parameters is pre- less than brightness and second If the product of value.
It is apparent to those skilled in the art that, for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit, may be referred to the corresponding process in preceding method embodiment, will not be repeated here.
In several embodiments provided herein, it should be understood that disclosed system, apparatus and method can be with Realize by another way.For example, device embodiment described above is only schematical, for example, the division of unit, It is only a kind of division of logic function, there can be other dividing mode when actually realizing, such as multiple units or component can be with With reference to or be desirably integrated into another system, or some features can be ignored, or not perform.It is another, it is shown or discussed Coupling each other or direct-coupling or communication connection can be by some interfaces, the INDIRECT COUPLING of device or unit or Communication connection, can be electrical, machinery or other forms.
The unit illustrated as separating component can be or may not be physically separate, be shown as unit Part can be or may not be physical location, you can with positioned at a place, or can also be distributed to multiple networks On unit.Some or all of unit therein can be selected to realize the purpose of this embodiment scheme according to the actual needs.
In addition, each functional unit in each embodiment of the invention can be integrated in a processing unit, can also That unit is individually physically present, can also two or more units it is integrated in a unit.Above-mentioned integrated list Member can both be realized in the form of hardware, it would however also be possible to employ the form of SFU software functional unit is realized.
If integrated unit is realized using in the form of SFU software functional unit and is used as independent production marketing or in use, can To be stored in a computer read/write memory medium.Based on it is such understand, technical scheme substantially or Saying all or part of the part contributed to prior art or the technical scheme can be embodied in the form of software product Out, the computer software product is stored in a storage medium, including some instructions are to cause a computer equipment (can be personal computer, server, or network equipment etc.) performs all or part of each embodiment method of the invention Step.And foregoing storage medium includes:It is USB flash disk, mobile hard disk, read-only storage (ROM, Read-Only Memory), random Access memory (RAM, Random Access Memory), disk or CD etc. are various can be with the medium of store program codes.
The above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations, although with reference to the foregoing embodiments The present invention is described in detail, it will be understood by those within the art that:It still can be to foregoing each implementation Technical scheme described in example is modified, or carries out equivalent substitution to which part technical characteristic;And these modification or Replace, the essence of appropriate technical solution is departed from the spirit and scope of various embodiments of the present invention technical scheme.

Claims (11)

1. a kind of image processing method, it is characterised in that including:
Obtain the red component, green component, blue component of pending pixel;
Receive colorimetric parameter and saturation parameters;
According to the colorimetric parameter and the first preset value computation interval variable and declinate variable, it is specially:Interval variable Δ i Following equation can be met with declinate variable Δ f:Δ h=(Δ i*m)+Δ f;Wherein, the Δ f is less than or equal to the m, institute Δ h is stated for the colorimetric parameter, the m is the first preset value, the colorimetric parameter, saturation parameters, the first preset value, interval Variable and declinate variable are integer;
According to the red component, the green component, the blue component, first preset value, the interval variable, institute State declinate variable and the saturation parameters carry out computing and obtain target interval variable and provisional parameter, be specially:According to The red component, the green component, the blue component determine brightness and minimum component;According to the red component, The green component, the blue component, the brightness and the minimum component calculate difference parameter collection, the difference parameter Collection includes the first difference parameter;According to the red component, the green component, the blue component, the difference parameter collection And first preset value calculates target interval parameter and goal discrepancy angle variable;Mesh is determined according to the target interval parameter Mark interval variable;According to the brightness, first difference parameter, first preset value, the goal discrepancy angle variable and The saturation parameters calculate provisional parameter;
Dextroposition processing is carried out to the provisional parameter and obtains target component;
Target red component, target green component and target are determined according to the target interval variable and the target component Blue component, according to the target red component, target green component and target blue component to the pending pixel The color of display is updated.
2. image processing method according to claim 1, it is characterised in that according to the red component, the green point Amount, the blue component determine that brightness and minimum component include:
If r>G, r>B, then max=r;If r>G, b>R, then max=b;If r<G, r>B, then max=g;
If r<G, r<B, then min=r;If r<G, b<R, then min=b;If r>G, r<B, then min=g;
Wherein, the max is brightness, and the min is minimum component, and the r is the red component, and the g is the green Component, the b is the blue component.
3. image processing method according to claim 2, it is characterised in that it is described according to the red component, it is described green Colouring component, the blue component, the brightness and the minimum component, which calculate difference parameter collection, to be included:
Delta=max-min;If r<G, then delta_rg=g-r;If r>G, then delta_rg=r-g;If b<R, then delta_ Br=r-b;If b>R, then delta_br=b-r;If b<G, then delta_gb=g-b;If b>G, then delta_gb=g-b;
The delta is the first difference parameter, and the delta_rg is the second difference parameter, and the delta_br is the 3rd difference Parameter, the delta_gb is the 4th difference parameter, and the max is the brightness, and the min is the minimum component, the r For the red component, the g is the green component, and the b is the blue component.
4. image processing method according to claim 3, it is characterised in that it is described according to the red component, it is described green Colouring component, the blue component, the difference parameter collection and first preset value calculate target interval parameter and target Declinate variable includes:
Target interval parameter i' and goal discrepancy angle variable new_f is calculated in the following manner:
If r=g, g=b, then i'=Δs i, new_f=0;
If r=max, g≤b, delta_gb*m=delta*m, then i'=Δs i+1, new_f=Δs f*delta;
If r=max, g≤b, Δ f*delta+delta_gb*m≤delta*m, then i'=Δs i+1, new_f=Δs f*delta+ delta_gb*m-delta*m;
If r=max, g≤b, Δ f*delta+delta_gb*m<Delta*m, then i'=Δs i, new_f=Δs f*delta;
If r=max, g<B, Δ f*delta≤delta_gb*m, then new_f=Δs f*delta-delta_gb*m, i'=Δs i+ 6;
If r=max, g<B, Δ f*delta<Delta_gb*m, then i'=Δs i+5, new_f=Δs f*delta+delta*m- delta_gb*m;
If g=max, r≤2*delta+b, b≤r, delta_br*m=delta*m, then i'=Δs i+3, new_f=Δs f* delta;
If g=max, r≤2*delta+b, b≤r, Δ f*delta+delta_br*m>Delta*m, then i'=Δs i+3, new_f =Δ f*delta+delta_br*m-delta*m;
If g=max, r≤2*delta+b, b≤r, Δ f*delta+delta_br*m≤delta*m, then i'=Δs i+2, new_ F=Δs f*delta+delta_br*m;
If g=max, r≤2*delta+b, r>B, Δ f*delta≤delta_br*m, then i'=Δs i+2, new_f=Δs f* delta-delta_br*m;
If g=max, r≤2*delta+b, r>B, Δ f*delta<Delta_br*m, then i'=Δs i+1, new_f=Δs f* delta+delta*m-delta_br*m;
If g=max, r>2*delta+b, then i'=Δs i, new_f=Δs f*delta;
If b=max, g≤4*delta+r, r>G, Δ f*delta+delta_rg*m≤delta*m, then i'=Δs i+5, new_f =Δ f*delta+delta_rg*m-delta*m;
If b=max, g≤4*delta+r, r>G, Δ f*delta+delta_rg*m<Delta*m, then i'=Δs i+4, new_f =Δ f*delta+delta_rg*m;
If b=max, g≤4*delta+r, g>R, Δ f*delta≤delta_rg*m, then i'=Δs i+4, new_f=Δs f* delta-delta_rg*m;
If b=max, g≤4*delta+r, g>R, Δ f*delta<Delta_rg*m, then i'=Δs i+3, new_f=Δs f* delta+delta*m-delta_rg*m;
If b=max, g>4*delta+r, then i'=Δs i, new_f=Δs f*delta;
Wherein, the r is the red component, and the g is the green component, and the b is the blue component, and the m is First preset value, the Δ f is the declinate variable, and the delta is first difference parameter, the delta_rg For second difference parameter, the delta_br is the 3rd difference parameter, and the delta_gb is the 4th difference Parameter, the Δ i is the interval variable, and the Δ f is the declinate variable.
5. image processing method according to claim 4, it is characterised in that described to be determined according to the target interval parameter Target interval variable includes:
If i'≤6, new_i=i'-6;If i'<6, then new_i=i';
Wherein, the new_i is target interval variable, and the i' is the target interval parameter.
6. image processing method according to claim 4, it is characterised in that it is described according to the brightness, it is described first poor Different parameter, first preset value, the goal discrepancy angle variable and the saturation parameters, which calculate provisional parameter, to be included:
The first provisional parameter b_stp1, the second provisional parameter c_stp1 and the 3rd provisional parameter d_ are calculated in the following way stp1:
B_stp1=(max*n)-(delta*adj_sat);
C_stp1=(max*m*n)-(adj_sat*new_f);
D_stp1=(max*m*n)+(adj_sat*new_f)-(delta*adj_sat*m);
Wherein, the max is the brightness, and the delta is first difference parameter, and the adj_sat is the saturation Parameter is spent, the new_f is the goal discrepancy angle variable, and the m is first preset value, and the n is the second preset value, institute State m and n meets below equation:M=2n.
7. image processing method according to claim 6, it is characterised in that described that the provisional parameter is subjected to dextroposition Processing, which obtains target component, to be included:
First object parameter b_value, the second target component c_value, the 3rd target component d_ are calculated in the following manner value:
B_value=(b_stp1>>k1);
C_value=(c_stp1>>k2);
D_value=(d_stp1>>k2);
Wherein, k1, k2 are default integer, b_stp1>>K1 represents b_stp1 moving to right k1 bit.
8. image processing method according to claim 7, it is characterised in that it is described according to the target interval variable and The target component determines that target red component, target green component and target blue component include:
Target red component new_r, target green component new_g and target blue component new_b are calculated in the following manner:
If new_i=0, new_r=max, new_g=d_value, new_b=b_value;
If new_i=1, new_r=c_value, new_g=max, new_b=b_value;
If new_i=2, new_r=b_value, new_g=max, new_b=d_value;
If new_i=3, new_r=b_value, new_g=c_value, new_b=max;
If new_i=4, new_r=d_value, new_g=b_value, new_b=max;
If new_i=5, new_r=max, new_g=b_value, new_b=c_value;
Wherein, new_r is target red component, and new_g is target green component, and new_b is target blue component, b_value For first provisional parameter, c_value is second provisional parameter, and d_value is the 3rd provisional parameter, new_i For the target interval variable, the max is the brightness.
9. image processing method according to claim 6, it is characterised in that it is described according to the brightness, it is described first poor Different parameter, the goal discrepancy angle variable and the saturation parameters include before calculating provisional parameter:
Judge whether first difference parameter and the product of the saturation parameters are less than the brightness and second preset value Product, if so, then triggering according to the brightness, first difference parameter, the goal discrepancy angle variable and the saturation degree The step of parameter calculates provisional parameter.
10. a kind of image processing apparatus, it is characterised in that including:
Acquisition module, red component, green component, blue component for obtaining pending pixel;
Receiving module, for receiving colorimetric parameter and saturation parameters;
Computing module, it is described for according to the colorimetric parameter and the first preset value computation interval variable and declinate variable Computing module is specifically for according to formula Δ h=(Δ i*m)+Δ f, computation interval variable Δ i and declinate variable Δ f;Wherein, institute Δ f is stated less than or equal to the m, the Δ h is the colorimetric parameter, the m is the first preset value, it is the colorimetric parameter, full It is integer with degree parameter, the first preset value, interval variable and declinate variable;
Computing module, for according to the red component, the green component, the blue component, first preset value, institute State interval variable, the declinate variable and saturation parameters progress computing and obtain target interval variable and interim ginseng Number;Wherein, the computing module is bright specifically for being determined according to the red component, the green component, the blue component Degree and minimum component;According to the red component, the green component, the blue component, the brightness and it is described most Small component calculates difference parameter collection, and the difference parameter collection includes the first difference parameter;According to the red component, the green Component, the blue component, the difference parameter collection and first preset value calculate target interval parameter and goal discrepancy Angle variable;Target interval variable is determined according to the target interval parameter;According to the brightness, first difference parameter, institute State goal discrepancy angle variable and the saturation parameters calculate provisional parameter;
Shifting processing module, target component is obtained for carrying out dextroposition processing to the provisional parameter;
Determining module, for determining that target red component, target are green according to the target interval variable and the target component Colouring component and target blue component;
Update module, for waiting to locate to described according to the target red component, target green component and target blue component The color that reason pixel is shown is updated.
11. image processing apparatus according to claim 10, it is characterised in that the computing module is additionally operable to judge described Whether the first difference parameter and the product of the saturation parameters are less than the brightness and the product of the second preset value, if so, then triggering The computing module is according to the brightness, first difference parameter, the goal discrepancy angle variable and the saturation parameters Calculate the provisional parameter.
CN201510424446.1A 2015-07-17 2015-07-17 A kind of image processing method and image processing apparatus Active CN105100762B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510424446.1A CN105100762B (en) 2015-07-17 2015-07-17 A kind of image processing method and image processing apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510424446.1A CN105100762B (en) 2015-07-17 2015-07-17 A kind of image processing method and image processing apparatus

Publications (2)

Publication Number Publication Date
CN105100762A CN105100762A (en) 2015-11-25
CN105100762B true CN105100762B (en) 2017-09-29

Family

ID=54580180

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510424446.1A Active CN105100762B (en) 2015-07-17 2015-07-17 A kind of image processing method and image processing apparatus

Country Status (1)

Country Link
CN (1) CN105100762B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111615714B (en) * 2018-06-27 2023-12-15 华为技术有限公司 Color adjustment method of RGB data
CN115829861B (en) * 2022-11-02 2023-11-21 上海傲显科技有限公司 Image color enhancement method and image color enhancement device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4403397B2 (en) * 2004-07-21 2010-01-27 ソニー株式会社 User interface providing device
CN101325723B (en) * 2007-06-15 2010-07-07 凌阳科技股份有限公司 System and method for adjusting image color
CN104486606B (en) * 2014-12-30 2017-06-06 广州博冠信息科技有限公司 The method and its device of adjustment brightness of image and contrast
CN104637034A (en) * 2014-12-31 2015-05-20 广州博冠信息科技有限公司 Method and device for regulating image saturation degree

Also Published As

Publication number Publication date
CN105100762A (en) 2015-11-25

Similar Documents

Publication Publication Date Title
CN105118413B (en) The compensation method of RGBW based on white sub-pixels colour cast and device
CN102097082B (en) Color regulation method for multi-play unit spliced display system and system thereof
CN102542548B (en) Color calibration method and device between a kind of image
CN107705264B (en) Image processing method, electronic equipment and device with storage function
CN111953955B (en) White balance compensation method and device and electronic equipment
CN104243946A (en) Image color enhancement method and device for display
US10728425B2 (en) Color gamut mapping method and color gamut mapping device
CN106791759A (en) The bearing calibration of medical display color uniformity and correction system
CN103167292A (en) Auto white balance adjustment system, auto white balance adjustment method, and camera module
KR20030031673A (en) Color conversion system and method using the same
CN109978961A (en) A kind of pattern colour side removing method, device and electronic equipment
CN105100762B (en) A kind of image processing method and image processing apparatus
WO2023016320A1 (en) Image processing method and apparatus, and device and medium
CN108337496A (en) White balancing treatment method, processing unit, processing equipment and storage medium
CN105575314A (en) Gray scale processing method, gray scale processing device and display device
CN104641631B (en) By the color enhancement of gamut extension
EP3518531B1 (en) Color gamut maintaining system and method
CN114739918A (en) Plant color measuring method, device, system and storage medium
WO2006095496A1 (en) Color changing device, program, image display, and portable terminal
CN103021375B (en) Image intensity regulating circuit
CN101409770B (en) Method and apparatus for determining two-dimension Lab color range map contour
CN102855843B (en) Energy-saving optimizing method of color sets used for three-dimensional drawing for OLED (Organic Light Emitting Diode) display device
CN100502459C (en) Picture color controlling method and system
CN107316040A (en) A kind of color of image spatial transform method of illumination invariant
CN103974049A (en) Wearable projector and projection method

Legal Events

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