It is a kind of to reduce the method that color value precision is improved to device pixel degree of dependence
Technical field
Technical field the present invention relates to improve color value precision and display, more specifically, more particularly to a kind of drop
The low method that color value precision is improved to device pixel degree of dependence.
Background technology
With computer technology, the development of image processing techniques and various intelligent terminals and widely available, colorful digital skill
The application of art holds the balance;Various smart machines, or even accurate acquisition of the conventional equipment to color is also more next with the requirement of display
It is higher, such as smart home color lamp, Photoshop image processing tools.
At present, color digital image can have various color space color model to represent, including hsv color
Model, HSI color model, RGB color model, CMYK color model, HSL color model, YUV color model etc., their quilts
It is widely used in automatic identification technology (Auto Identification System, AIDS), digital photography treatment (Digital
Photography processing), the high-technology field such as computer picture Display Technique.In Computer Image Processing,
It is general to use RGB models and HSV models.Primaries pattern (RGB color model) is a kind of based on additive color model and people
The theoretical color space set up of the three primary colors of class vision, by red (Red), green (Green), blue (Blue) trichromatic coloured light with not
Same ratio is added, to produce diversified coloured light.Main purpose is detected in electronic system, is represented and display image,
Such as TV and computer.Before electronic age, the perception based on the mankind to color, RGB color model has had solid
Theory support.HSV is a kind of representation of point in model by rgb color in cylindrical-coordinate system.This representation attempts to do
To than RGB be based on cartesian coordinate system geometry it is more directly perceived, HSV be form and aspect, saturation degree, lightness (Hue,
Saturation, Value), also known as HSB, form and aspect (H) are the base attributes of color, are exactly usually described color designation, such as red
Color, yellow etc..Saturation degree (S) refers to the purity of color, and color higher is purer, low then gradually graying, takes the numerical value of 0-100%.
Lightness (V), brightness (L), takes 0-100%.
All kinds of ripe the color space models theory support and processing scheme solid for color treatments are provided.But,
By taking the most frequently used rgb color model (color category is as 255*255*255) of computer as an example, with regard to current existing conventional equipment bag
Computer, flat board, mobile phone are included, specific color is three-dimensional during pixel size is limited by its hardware device, and Computer Image Processing
This is real for data model, and all colours cannot be realized in same two-dimentional interface display substantially, so that user checks and obtains;
At the same time, all kinds of intelligent home devices and image processing equipment, software require more and more higher to the precision of color.Total
For, the device resolution such as traditional computer, mobile phone, flat board is uneven, and the display capabilities to color are different, display and can
It is smaller with the color gamut for selecting, while precision is not high, tend not to meet requirement of the people to obtaining certain precise color.
The color that traditional offer user interacts show and the method that obtains in, relatively more classical be with
Photoshop, ACDSee are the palette of the image processing software of representative, and these methods are all based on greatly hsv color spatial model,
HSV Color space models are based on the visually-perceptible feature of people, and wherein colourity/phase H represents different colors, such as RGB;It is full
The depth of color is represented with degree S, it is such as dark red pale red;Brightness V represents the bright-dark degree of color, such as brilliant white and dead color.HSV's is extensive
Using two important attribute features based on him, one is its luminance component V unrelated with the colour information of image, and two is phase H, full
It is closely coupled that the mode of color is experienced with degree S and people, and colour table is taken in the photo handling software such as Photoshop, ACDSee
The phase H of color is independent, and then on the basis of the phase that gets colors, saturation degree and brightness according to color draw one
Individual two-dimensional color is interval, and specific color is chosen for user, and display of the method to color is limited by the pixel condition of device therefor,
Finer display is not carried out to color, many color values (R, G, B) can not be in the palette of these image processing tools
Middle acquisition;In addition, the method is independently to separate the phase H values of color out to choose, it is determined that according to saturation degree and bright after H values
Degree repaints color region, so, in same two-dimensional color region, be up to two variables of HSV tri-, this is right
The display and acquisition of color have very big shortcoming.
Therefore, design one kind can break away from equipment performance dependence, and can show and obtain any one color in two dimensional surface
Method it is particularly necessary.
The content of the invention
It is an object of the invention to provide a kind of method for reducing and color value precision being improved to device pixel degree of dependence,
Using the multiple method amplified, by changing the unit precision size of Show Color, smart machine pixel is reduced to Show Color
The limitation of category, the method being combined using HSV and RGB color model shows color as much as possible to user
With obtain more accurate color codomain, meet various different application occasions (including intelligent home device, image processing equipment, figure
As identification etc.) and client to the accurate display of color and the requirement of raising color value precision.
In order to achieve the above object, the technical solution adopted by the present invention is as follows:
It is a kind of to reduce the method that color value precision is improved to device pixel degree of dependence, comprise the following steps,
The first step, the first Color scheme of initialization, selection color take color and obtain reference color data;
Whether second step, the reference color data judged in the first step are color of object, if then obtaining the color of object,
Otherwise perform the 3rd step;
3rd step, the first Color scheme precision of raising, select accurate color color (h, s, v), and obtain reference color
Data;
Whether the 4th step, the reference color data judged in the 3rd step are color of object, if then obtaining the color of object,
Otherwise perform the 5th step;
5th step, the second Color scheme show, select color and obtain reference color data;
Whether the 6th step, the reference color data judged in the 5th step are color of object, if then obtaining the color of object,
Otherwise perform the 7th step;
7th step, the 3rd Color scheme show, select color and obtain reference color data, using the reference color as mesh
Mark color.
Further, the interface of the first Color scheme in the first step is two dimension H/S/V palettes, in the two-dimentional H/
In S/V palettes, ordinate is phase H coordinate variables, and on the horizontal scale, saturation degree S and brightness V is in different coordinate range point
Not as variable or constant;
The interface of the second Color scheme in the 5th step is two dimension V/S palettes, in the two dimensional surface palette,
Abscissa is saturation degree S variables, and ordinate is brightness V variables;
RGB palettes are drawn in the form of gradual change in the interface of the 3rd Color scheme in the 7th step.
Further, the method uses hsv color spatial model, in a two dimensional surface region displaying perceived color, should
Color phase H, saturation degree S and brightness V have corresponding change in region;
First, the selected a part color of user, equipment color according to selected by user obtains the color reference data, and shows
Color regime under the data;If user need to select the more accurate color of object of the color gamut, equipment automatically takes out the color one
Determine the region of scope, the field color is shown;
Then, on the basis of above-mentioned steps, after user selectes accurate color again, equipment color according to selected by user
The color reference data are obtained, and shows color regime under the data;If user need to select the more accurate target of the color gamut
Color, equipment repaints the color regime for changing color under different saturation and brightness according to the selected color of user institute;
Finally, on the basis of above-mentioned steps, equipment color according to selected by user obtains the color reference data, and shows
Color regime under the data, if user need to select the more accurate color of object of the color gamut;The face that equipment is selected according to user
Color, obtains the corresponding rgb value of four, border of certain area color, and the mode rendered with gradual change carries out more accurate to color again
It has been shown that, now, user can see under the color more accurately color regime, carry out more accurate color acquisition action.
Compared with prior art, the advantage of the invention is that:The present invention is reduced and improves color to device pixel degree of dependence
The method of value precision, the method using precision show palette is repeatedly improved, realizes under the conditions of same hardware device, to face
Color carries out larger range of display and more accurate color obtains that (accurately color obtains and is mainly reflected in the rgb value of color and obtains
Take aspect), the dependence to device pixel level has been broken away to a certain extent, meet the need that user obtains to more precise color
Will.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
The accompanying drawing to be used needed for having technology description is briefly described, it should be apparent that, drawings in the following description are only this
Some embodiments of invention, for those of ordinary skill in the art, on the premise of not paying creative work, can be with
Other accompanying drawings are obtained according to these accompanying drawings.
Fig. 1 is the flow chart that the present invention reduces the method that color value precision is improved to device pixel degree of dependence;
Fig. 2 is to be based on HSV models during the present invention reduces the method that color value precision is improved to device pixel degree of dependence
The first Color scheme HSV palettes;
Fig. 3 is that the present invention reduces each Color scheme in the method that color value precision is improved to device pixel degree of dependence
Lower selection color scheme;
Fig. 4 is that the present invention is reduced to the method for device pixel degree of dependence raising color value precision in the first Color scheme
Simulated effect figure in H/S/V palettes.
Specific embodiment
The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, so that advantages and features of the invention energy
It is easier to be readily appreciated by one skilled in the art, apparent is clearly defined so as to be made to protection scope of the present invention.
In order that the purpose of the inventive method, scheme and advantage become apparent from, it is right below in conjunction with accompanying drawing 1~4 and embodiment
A kind of reduction of the inventive method is described in further detail to the method that device pixel degree of dependence improves color value precision.
It is worth noting that, instantiation discussed below is only used for explaining inventive method content, the side of being not intended to limit the present invention
Method.
Can mutually be changed between HSV and RGB color space model used in the inventive method, in different tonings
Board interface is reached using different color display modes and relatively good takes color interfacial effect.RGB patterns are also known as three primary colors optical mode
Formula, primaries show the display for being mainly used in TV and computer, there is CRT Displays, liquid crystal display and plasma
Three kinds of primitive color lights are combined into a variety of colors between all black to whole white by the methods such as display in each pixel
Light, the method for taking 24 bits of each pixel (bit) to represent in computer hardware at present, so three kinds of primitive color lights are respectively assigned to
8 bits, the intensity of each primary colors according to 8 bits peak 28It is divided into 256 values.H can be combined in this way
16777216 kinds of colors.HSV models are generally used in computer graphics application, and HSV is mathematically defined as in rgb space
The transformation of coordinates of R, G and B of color.Conversion formula between the two has various expression ways, what its principle was just as, this
In only take it and discuss such as next conversion formula, it is convenient to realize that the method provides a reference formula on different devices.
If (R, G, B) is respectively a red, green and blue coordinate for color, their value is the real number between 0 to 255,
(H, S, V) value in corresponding HSV space, H ∈ [0 °, 360 °], is hue angle here, and S, V ∈ [0,1] are respectively saturations
Spend and brightness, the computing formula that RGB is transformed into HSV is:
Max=max (R, G, B) is (1)
Min=min (R, G, B) is (2)
V=max; ⑸
Similar, to a color for being scheduled on (H, S, V) value definition in HSV, with H as above, and saturation is represented respectively
The S and V of degree and lightness, (R, G, B) three primary colors corresponding in rgb space may be calculated (R, G, B change between 0 to 1),
Computational methods from HSV to RGB are:
V=V is (8)
P=V × (1-S) is (9)
Q=V × (1-f × S) is (10)
T=V × (1- (1-f) × S) is (11)
Of the invention to reduce the method that color value precision is improved to device pixel degree of dependence, its design is as follows:
Fig. 1 is the first Color scheme interface, and Fig. 2 is the first Color scheme HSV palettes based on HSV models, the two dimensional surface
Palette ordinate is phase H coordinate variables, and on abscissa, saturation degree S and brightness V is in different coordinate ranges respectively as change
Amount or constant, in dashed middle line partial saturation S=1 and brightness V=1, draw to corresponding color, as shown in Fig. 2
Fig. 4 is Fig. 2 simulated effect figures.Be limited by the reasons such as device pixel, now, the unit precision of ordinate phase for h1=360 °/
Ordinate pixel, the unit precision of abscissa is sl1=1/ abscissa pixels.
User selects color, system to provide the user reference color and the display of color selected by user in H/S/V palettes
Related data.If color of object of the reference color for needed for, user's selection end takes color process;If the reference color is target
The a range of color of color selected by user is then carried out precision display higher, now, abscissa table by color gamut value, system
The variable that shows, constant are constant, and the phase unit precision that ordinate is represented is h2=x/ ordinate pixels, x<<360 °, it is evident that
h2<h1.User is observed that apparent distribution of color situation to be selected.User selects color in H/S/V palettes again, is
System provides the user reference color and display related data, and now user obtains more accurate color (h, s, v) value.If should
Color of objects of the color (h, s, v) for needed for, user's selection end takes color process;If the color (h, s, v) is color of object
Value range, system uses the second Color scheme, shows the color regimes of the color (h, s, v) under different brightness and saturation degree.
In the second Color scheme, program palette abscissa is saturation degree S variables, and ordinate is brightness V variables, is painted
Color (h, s, v) processed carry out different brightness and saturation degree under V/S palettes.User selects color, system to provide the user
Reference color and display related data.If color of object of the reference color for needed for, user's selection end takes color process;If should
Reference color is color of object value range, and equipment obtains the reference color four critical color values of a certain size rectangle and is respectively
Color1, Color2, Color3, Color4, carry out the 3rd Color scheme and show.
In the 3rd Color scheme, the vertex color of program palette viewing area four be respectively Color1, Color2,
Color3, Color4, draw RGB palettes in the form of gradual change, and by above step, user can obtain at the interface and miss
The minimum specific color of difference, and the color is obtained by equipment, in the form of numeral and picture to user show the color and its
RGB and HSV value.
Fig. 3 selects color scheme under showing each Color scheme, and the big rectangular area in the left side is palette;Dashed rectangle
After showing user's selection color, the color of object scope that system is obtained automatically;The small rectangle in the upper right corner and correspondence RGB, HSV are use
After family selection color, reference color and its related data that system is provided the user.
Method has altogether to all of distribution of color situation has carried out the treatment of three raising color display precisions, at each
Take after colour table interface user gets colors, equipment can all provide a reference color, and by corresponding RGB/HSV values numeral and
Color picture to user show.Method realizes the function of improving color display range and take color precision, is shown by changing
Unit precision size, limitation of the device pixel to Show Color scope is reduced, using HSV and RGB color model phase
With reference to method, show color as much as possible to user and obtain more accurate color codomain, meet various different applications
Close (including intelligent home device, image processing equipment, image recognition, various low pixel game stations high etc.) client to accurate face
Color shows the requirement with value.
Although being described in conjunction with the accompanying embodiments of the present invention, patent owner can be in appended claims
Within the scope of make various deformations or amendments, as long as no more than the protection domain described by claim of the invention, all should
Within protection scope of the present invention.