CN102110428B - Method and device for converting color space from CMYK to RGB - Google Patents

Method and device for converting color space from CMYK to RGB Download PDF

Info

Publication number
CN102110428B
CN102110428B CN200910243865.XA CN200910243865A CN102110428B CN 102110428 B CN102110428 B CN 102110428B CN 200910243865 A CN200910243865 A CN 200910243865A CN 102110428 B CN102110428 B CN 102110428B
Authority
CN
China
Prior art keywords
layer
node
input
output
hidden
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.)
Expired - Fee Related
Application number
CN200910243865.XA
Other languages
Chinese (zh)
Other versions
CN102110428A (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.)
China Digital Video Beijing Ltd
Original Assignee
China Digital Video Beijing 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 China Digital Video Beijing Ltd filed Critical China Digital Video Beijing Ltd
Priority to CN200910243865.XA priority Critical patent/CN102110428B/en
Publication of CN102110428A publication Critical patent/CN102110428A/en
Application granted granted Critical
Publication of CN102110428B publication Critical patent/CN102110428B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Facsimile Image Signal Circuits (AREA)
  • Color Image Communication Systems (AREA)

Abstract

The present invention provides a method and a device for converting a color space from CMYK (Cyan, Magenta, Yellow, Black) to RGB (Red, Green, Blue), wherein the method concretely comprises: an establishing step, in which a BP neural network conversion model is established, C, M, Y, K in the CMYK color space are taken as input variables of the conversion model, R, G, B in the RGB color space are taken as output variables of the conversion model, and parameters of the model comprise network weights and network thresholds; a obtaining step, in which N CMYK color values and corresponding RGB color values are separately taken as inputs and expected outputs of training samples to obtain the training samples; and a training step, in which, aiming at the training samples, a BP algorithm is adopted to train the conversion model so as to obtain corrected model parameters, thereby determining the conversion model. The method and the device in the present invention are used for reducing conversion errors of the color space from the CMYK to the RGB.

Description

A kind of CMYK is to the conversion method of rgb color space and device
Technical field
The present invention relates to technical field of image processing, particularly relate to a kind of CMYK to the conversion method of rgb color space and device.
Background technology
In recent years applying in increasingly extensive visualization of spatial information, the colour of spatial information expresses one of the main target having become spatial information analysis, process and application with application.Because color can most accurately express objective object, the vision of people reflects the diversity of the fastest visualization of spatial information mode to color and needs to come by multiple colour generation equipment and material the color of reproduction space information, thus result through and color transformedly describe demand space and different colour generation equipment and material realizing and meet Color Expression in multicolour, make the color transformed technical barrier becoming visualization of spatial information.
Color transformed referring to set up between different color space mapping relations one to one, the color space enabling the color data provided meet practical application to support.The color transformed of broad sense is exactly colour space transformation, what also represent by a certain color space color transformedly represents in another kind of color space, as common RGB (red Red, green Green, blue Blue), CMYK (blue or green Cyan, fuchsin Magenta, yellow Yellow, black Black), L *a *b *the mutual conversion of color spaces such as (illuminance Luminosity, a, b represent three-dimensional two axles of color respectively).
In the Color Expression of current spatial information, rgb color space and cmyk color space are the basic color spaces that spatial information shows and prints.Wherein, rgb color pattern is most basic color mode, as long as the image shown on computer screen, just must show with RGB pattern, because the physical arrangement of display follows RGB.And cmyk color pattern, also referred to as printing color pattern, as long as the image seen on printed matter, show with CMYK pattern.
In image processing field, often there is the conversion requirements from CMYK to rgb color space.Such as, consider that AI is that planar design personnel use, need to print, the file of the * .AI type stored in AI (Adobe Illustrator) software all shows with CMYK pattern.Like this, when designer applies the file of * .AI type on the computer screen, just need to be converted into RGB pattern.
Rgb color pattern is a kind of color standard of industry member, by obtaining color miscellaneous to the change of R, G, blue B tri-Color Channels and their superpositions each other, namely RGB is the color representing red, green, blue three passages, this standard almost include human eyesight can all colours of perception.
Cmyk color pattern is a kind of specially for the color standard of press setting, by obtaining shades of colour to the change of C, M, Y, K tetra-colors and their superpositions each other, CMYK represents green grass or young crops, fuchsin, Huang, black four kinds of special ink colors of printing, specific in printing, be produce color by controlling the printing that is stacked on paper of green grass or young crops, fuchsin, Huang, black four color inks, its chromatic number is less than RGB look.
Lab pattern is a kind of color mode announced in 1976 by International Commission on Illumination (CIE), is that CIE organizes of determining to include human eye visible institute the colorful one color mode in theory.
The color that can show due to Lab pattern is greater than RGB and CMYK two kinds of color modes, therefore, existing CMYK is to the conversion method of rgb color space, often using LAB pattern as a kind of internal color pattern, also be, the execution sequence of existing conversion method is first CMYK → Lab, is then only Lab → RGB.But Lab is device independent color space, CMYK, RGB are device dependent color spaces, so above-mentioned transformational relation nonlinearity is high, and transformed error is often not ideal enough.
In a word, the technical matters needing those skilled in the art urgently to solve is exactly: how can solve CMYK to the large problem of the transformed error of rgb color space.
Summary of the invention
Technical matters to be solved by this invention is to provide a kind of CMYK to the conversion method of rgb color space and device, in order to reduce transformed error.
In order to solve the problem, the invention discloses the conversion method of a kind of CMYK to rgb color space, comprising:
Establishment step: set up BP neural network transformation model, using the input variable of C, M, Y, the K in CMYK space as this transformation model, R, G, B in rgb space are as the output variable of this transformation model, and the parameter of described model comprises network weight and network threshold;
Obtaining step: the input being training sample with N number of CMYK color value and corresponding RGB color value and desired output, obtain training sample;
Training step: for described training sample, adopts this transformation model of BP Algorithm for Training, obtains the model parameter revised, thus determine this transformation model.
Preferably, the structure of described transformation model comprises input layer, a hidden layer and output layer, and input layer number is 4, and output layer nodes is 3, and the number of hidden nodes is wherein, 1 < a < 30.
Preferably, the transport function of described hidden layer and output layer is Sigmoid type: f (x)=1/ [1+e^ (-bx)], b > 0.
Preferably, described training step comprises:
Initialization operation: preset number of samples K=0, preset the local error upper limit and the global error upper limit, initialization is carried out to network weight and network threshold, wherein, described network weight comprises the connection weights between output layer node and hidden node, and the connection weights between hidden node and input layer, described network threshold comprises hidden node threshold value and output layer Node B threshold;
Input operation: input K training sample, as current training sample, wherein, K ∈ 1,2 ..., N};
First calculating operation: the output valve calculating each node of hidden layer;
Second calculating operation: the output valve calculating each node of output layer;
3rd calculating operation: for current sample, based on the output valve of desired output and each node of output layer, adopts Square-type error function, calculates the error of current sample;
First judges operation: judge whether the error of current sample is less than the local error upper limit, if so, then performs second and judges operation; Otherwise, perform first and revise operation;
Second judges operation: judge whether K > N-1 sets up, and if so, then performs the 4th calculating operation; Otherwise, perform first and revise operation;
4th calculating operation: for all N number of samples, based on the output valve of desired output and each node of output layer, adopts Square-type error function, calculates global error;
3rd judges operation: judge whether global error is less than the global error upper limit, and if so, then algorithm terminates; Otherwise, perform first and revise operation;
First revises operation: the calibration corrections calculating the connection weights between output layer node and hidden node, and according to described calibration corrections, revises the connection weights between output layer and hidden layer and output layer threshold value;
Second revises operation: the calibration corrections calculating the connection weights between hidden node and input layer, and according to described calibration corrections, connection weights between hidden layer and input layer and hidden node threshold value are revised, and makes K=K+1, return input operation.
Preferably, described training step comprises:
Initialization operation: preset frequency of training T, K=0, set current frequency of training t=0, initialization is carried out to network weight and network threshold, wherein, described network weight comprises the connection weights between output layer node and hidden node, and the connection weights between hidden node and input layer, and described network threshold comprises hidden node threshold value and output layer Node B threshold;
Input operation: input K training sample, as current training sample, wherein, K ∈ 1,2 ..., N};
First calculating operation: the output valve calculating each node of hidden layer;
Second calculating operation: the output valve calculating each node of output layer;
First revises operation: the calibration corrections calculating the connection weights between output layer node and hidden node, and according to described calibration corrections, revises the connection weights between output layer and hidden layer and output layer threshold value;
Second revises operation: the calibration corrections calculating the connection weights between hidden node and input layer, and according to described calibration corrections, revises the connection weights between hidden layer and input layer and hidden node threshold value;
First judges operation: judge whether K > N-1 sets up, and if so, then performs second and judges operation; Otherwise, K=K+1, and return input operation;
Second judges operation: judge whether t > T-2 sets up, and if so, then algorithm terminates; Otherwise, upgrade frequency of training t=t+1, and return input operation.
Preferably, as b=1, described obtaining step comprises:
Obtain N number of CMYK color value and corresponding RGB color value, and it can be used as input and the desired output raw data of training sample;
Described input and desired output raw data are normalized, make its value between [0,1].
The invention also discloses the conversion equipment of a kind of CMYK to rgb color space, comprising:
Set up module, for setting up BP neural network transformation model, using the input variable of C, M, Y, the K in CMYK space as this transformation model, R, G, B in rgb space are as the output variable of this transformation model, and the parameter of described model comprises network weight and network threshold;
Acquisition module, for be training sample with N number of CMYK color value and corresponding RGB color value input and desired output, obtains training sample;
Training module, for for described training sample, adopts this transformation model of BP Algorithm for Training, obtains the model parameter revised, thus determine this transformation model.
Preferably, the structure of described transformation model comprises input layer, a hidden layer and output layer.
Preferably, described training module comprises:
Initialization submodule, for preset number of samples K=0, preset the local error upper limit and the global error upper limit, initialization is carried out to network weight and network threshold, wherein, described network weight comprises the connection weights between output layer node and hidden node, and the connection weights between hidden node and input layer, and described network threshold comprises hidden node threshold value and output layer Node B threshold;
Input submodule, for inputting K training sample, as current training sample, wherein, K ∈ 1,2 ..., N};
First calculating sub module, for calculating the output valve of each node of hidden layer;
Second calculating sub module, for calculating the output valve of each node of output layer;
3rd calculating sub module, for for current sample, based on the output valve of desired output and each node of output layer, adopts Square-type error function, calculates the error of current sample;
First judges submodule, for judging whether the error of current sample is less than the local error upper limit, if so, then triggering second and judging submodule; Otherwise, trigger first and revise submodule;
Second judges submodule, for judging whether K > N-1 sets up, if so, then triggers the 4th calculating sub module; Otherwise, trigger first and revise submodule;
4th calculating sub module, for for all N number of samples, based on the output valve of desired output and each node of output layer, adopts Square-type error function, calculates global error;
3rd judges submodule, for judging whether global error is less than the global error upper limit, if so, then terminates training; Otherwise, trigger first and revise submodule;
First revises submodule, for calculating the calibration corrections of the connection weights between output layer node and hidden node, and according to described calibration corrections, revises the connection weights between output layer and hidden layer and output layer threshold value;
Second revises submodule, for calculating the calibration corrections of the connection weights between hidden node and input layer, and according to described calibration corrections, the connection weights between hidden layer and input layer and hidden node threshold value are revised, and trigger input submodule.
Preferably, the transport function of described hidden layer and output layer is Sigmoid type: f (x)=1/ [1+e^ (-x)];
Described acquisition module comprises:
Color value obtains submodule, for obtaining N number of CMYK color value and corresponding RGB color value, and it can be used as input and the desired output raw data of training sample;
Normalization submodule, for being normalized described input and desired output raw data, makes its value between [0,1].
Compared with prior art, the present invention has the following advantages:
The present invention utilizes neural network not understanding the feature completing Nonlinear Modeling under the prerequisite inputing or outputing relationship between variables, by CMYK to rgb color space to change abstract be a neural net model establishing problem, specifically, first, using C, M, Y, the K in CMYK space as input variable, R, G, B in rgb space, as output variable, set up BP neural network transformation model, and the parameter of described model comprises network weight and network threshold; Then, for the training sample that reality obtains, adopt this transformation model of BP Algorithm for Training, obtain the model parameter revised, thus determine this transformation model; Due to the training process of this transformation model, it is the process of described model parameter being carried out to constantly correction, the error that this process can be performed until transformation model output reduces to acceptable degree, and therefore, the present invention can reduce the transformed error of CMYK to rgb color space.
Accompanying drawing explanation
Fig. 1 is the process flow diagram of a kind of CMYK of the present invention to the conversion method embodiment of rgb color space;
Fig. 2 is a kind of BP neural network structure of the present invention figure;
Fig. 3 is the transport function that BP network is conventional;
Fig. 4 is a kind of sigmoid examples of functions of the present invention;
Fig. 5 is the process flow diagram of a kind of error transfer factor scheme of the present invention.
Embodiment
For enabling above-mentioned purpose of the present invention, feature and advantage become apparent more, and below in conjunction with the drawings and specific embodiments, the present invention is further detailed explanation.
Because table color method different in space information system has different colour gamuts and precision, this transformation relation usually can be caused explicitly can not to express with simple, thus cause color transformed relation very complicated.
R, G, B component that rgb color pattern use RGB model is each pixel in image distributes the intensity level in 0 ~ 255 scope.Such as: pure red R value is 255, G value be 0, B value is 0; R, G, B tri-value equal (except 0 and 255) of grey; R, G, B of white are 255; R, G, B of black are 0.RGB image only uses three kinds of colors, them just can be made according to the mixing of different ratios, screen reappears 16777216 kinds of colors.
And in the image of cmyk color pattern, each pixel is synthesized according to different ratios by C, M, Y and K look.Often kind of printing-ink of each pixel can be assigned with a percent value, the printing ink colors percent value that the color assignment of the brightest (Gao Guang) is lower, the percent value that the color assignment of comparatively dark (shadow) is higher.Such as, bright redness may comprise 2% cyan, 93% fuchsin, 90% yellow and 0% black.In CMYK image, when the value of all 4 kinds of components is all 0%, pure white will be produced.
One of core idea of the present invention is, since comprise four channel C, M, Y, K in the image of cmyk color pattern, three passages R, G, B are comprised in the image of rgb color pattern, if by abstract for the relation between described two kinds of patterns be a mathematical model, so, CMYK just can be reduced to a Mathematical Modeling Problem to the conversion of rgb color space.
Traditional mathematics modeling method, comprise modelling by mechanism, multivariate statistical method, kalman filter method, homing method etc. based on model, these methods can describe out some simple linear systems, but, accurate description is difficult to the linear system of some complexity and nonlinear system.And cmyk color pattern is to the conversion of rgb color pattern, it is a typical nonlinear problem.
Inventor herein notices this point, creatively utilizes neural network not understanding the feature completing Nonlinear Modeling under the prerequisite inputing or outputing relationship between variables, sets up the transformation model of CMYK to rgb color space.
With reference to Fig. 1, show the process flow diagram of a kind of CMYK of the present invention to the conversion method embodiment of rgb color space, specifically can comprise:
Establishment step 101, set up BP neural network transformation model, can using the input variable of C, M, Y, the K in CMYK space as this transformation model, using the output variable of R, G, the B in rgb space as this transformation model, the parameter of described model can comprise network weight and network threshold;
BP (Back Propagation) network is a kind of Multi-layered Feedforward Networks by Back Propagation Algorithm training, is one of current most widely used neural network model.
As shown in Figure 2, BP neural network can comprise with lower unit:
1. processing unit (neuron) (representing with circle in figure), i.e. the element of neural network.Input value is just proceeded to adjacent synaptic weight by the processing unit of input layer, and the processing unit of hidden layer and output layer is by the summation of their input value and according to transfer function calculating output valve;
2. synaptic weight (as V, W in figure).Processing unit in neural network connects by it, and its value changes with the connection degree of each processing unit;
3. layer.Neural network generally has input layer x, hidden layer y and output layer o;
4. threshold value.Its value can be constant or variable value, and it can make network can more freely obtain the funtcional relationship that will describe;
5. transport function f (x).It is the processing unit exported by the data transformations of input, is generally nonlinear function.
Therefore, determine the network number of plies, every node layer number, transport function, initial weight coefficient etc. and also just determine BP network.There is certain governing principle when determining these options, but be more by experience.
Specific to the embodiment of the present invention, then the structure of described transformation model can comprise input layer, hidden layer and output layer, and input layer number is 4, and output layer nodes is 3.
For Multi-layered Feedforward Networks, the determination of the number of hidden nodes is the key of success or failure.If quantity very little, then network can obtain in order to the information of dealing with problems very little; If quantity is too many, not only increase the training time, and, too much also may there is what is called " transition coincide " (Overfitting) problem in hidden node, namely test error increase causes generalization ability to decline, and therefore, choose reasonable the number of hidden nodes is extremely important.
Selection and comparison about hidden layer number and nodes thereof is complicated, and rule is: can correctly reflect on the basis of input/output relation, should select less the number of hidden nodes, to make network structure as far as possible simple.Therefore, the embodiment of the present invention preferentially selects single hidden layer configuration, and selects the number of hidden nodes according to following experimental formula:
wherein, 1 < a < 30.
The transport function of BP network has multiple.As shown in Figure 3, the desirable arbitrary value of input value of Log-sigmoid type function, output valve is between zero and one; The desirable arbitrary value of input value of tan-sigmod type transport function, output valve is between-1 to+1; The desirable arbitrary value of constrained input value of linear transfer function purelin.
In one preferred embodiment of the invention, adopt sigmoid type function f (x)=1/ [1+e^ (-bx)] (b > 0) as the transport function of hidden layer and output layer.With reference to figure 4, show the sigmoid examples of functions of b=1, it is a good threshold function table, and have continuously, smooth, strictly monotone, about (0,0.5) centrosymmetric feature.
Obtaining step 102, with the RGB color value of N number of CMYK color value and correspondence be training sample input and desired output, obtain training sample;
Such as, for the forecast model of single hidden layer, be in the transport function of hidden layer and output layer: time f (x)=1/ [1+e^ (-x)], between zero and one, now, described obtaining step can comprise following sub-step to its output valve:
Sub-step A1, obtain the RGB color value of N number of CMYK color value and correspondence, and it can be used as input and the desired output raw data of training sample;
Sub-step A2, described input and desired output raw data to be normalized, to make its value between [0,1].
Training step 103, for described training sample, adopt this transformation model of BP Algorithm for Training, obtain the model parameter revised, thus determine this transformation model.
The basic thought of BP algorithm is, training process is made up of the forward-propagating of signal and backpropagation two processes of error.
1) forward-propagating: input amendment-> input layer-> each hidden layer (process)-> output layer;
2) error back propagation: output error (certain form)-> hidden layer (successively)-> input layer;
Its fundamental purpose is by by output error anti-pass, gives all unit of each layer, thus obtains the error signal of each layer unit, and then revise the weights (its process is the process of a weighed value adjusting) of each unit by error distribution.
Therefore, the information forward-propagating gone round and begun again and error back propagation process are the processes that each layer weights constantly adjust, and are also the processes of neural network learning training, the error that this process is performed until network output reduces to acceptable degree, or till the frequency of training preset.
Correspondingly, the embodiment of the present invention can comprise following two kinds of training programs:
One, error transfer factor scheme
Typical BP algorithm adopts gradient descent method, and its basic thought is, perform error function Gradient Descent strategy in weight vector space, dynamic iterative search one group of weight vector, makes network error function reach minimum value, thus complete information extraction and Memory Process.
For making those skilled in the art understand the present invention better, below by way of concrete example, this programme is described.
Suppose that the training sample obtaining step of this example is, by the AI software of Adobe, obtain N=625 CMYK color value and corresponding RGB color value, as training sample;
Transformation model is three layers of BP network of a single hidden layer:
Input layer number is 4, if Y i 1for the output of input layer i (i=0,1,2,3);
The number of hidden nodes n 1=18, the characteristic of each node is Sigmoid type: f (x)=1/ [1+e^ (-x)], Y j 2for middle layer node j (j=0,1,2 ..., 16,17) output;
Output layer nodes is 3, and the characteristic of each node is Sigmoid type: f (x)=1/ [1+e^ (-x)], Y k 3for the output of output layer node k (k=0,1,2), T kfor the desired output that output layer node k (k=0,1,2) is corresponding;
W ijfor the connection weights between node i and node j, W jkfor the connection weights between node j and node k, θ jfor the threshold value of middle layer node j, θ kfor the threshold value of output layer node k;
Adopt Square-type error function
With reference to Fig. 5, show the realization flow figure of this programme, specifically can comprise:
Initialization operation 501, preset number of samples p=0, preset the local error upper limit and the global error upper limit, initialization is carried out to network weight and network threshold, wherein, described network weight can comprise the connection weights between output layer node and hidden node, and the connection weights between hidden node and input layer, described network threshold can comprise hidden node threshold value and output layer Node B threshold;
Such as, little random number is given to network weight and threshold value, W ij(t) ∈ [-1,1], W jk(t) ∈ [-1,1], θ j(t) ∈ [-1,1], θ k(t) ∈ [-1,1];
Input operation 502, input p training sample, as current training sample, wherein, p ∈ 1,2 ..., N};
The output valve of the first calculating operation 503, each node of calculating hidden layer Y j 2 = f ( &Sigma; i = 1 N W ij Y i 1 - &theta; j ) = f ( &Sigma; i = 1 N W ij X k - &theta; j ) ;
The output valve of the second calculating operation 504, each node of calculating output layer
3rd calculating operation 505, for current sample, based on the output valve of desired output and each node of output layer, adopt Square-type error function, calculate the error of current sample
First judge operation 506, judge whether the error of current sample is less than the local error upper limit, if so, then perform second and judge operation 507; Otherwise, perform first and revise operation 510;
Second judge operation 507, judge whether K > N-1 sets up, if so, then perform the 4th calculating operation 508; Otherwise, perform first and revise operation 510;
4th calculating operation 508, for all N number of samples, based on the output valve of desired output and each node of output layer, adopt Square-type error function, calculate global error
3rd judge operation 509, judge whether global error is less than the global error upper limit, and if so, then algorithm terminates; Otherwise, perform first and revise operation 510;
First revise operation 510, calculate connection weights correction between output layer node and hidden node: and according to calibration corrections δ krevise connection weight value matrix W between output layer and hidden layer jkwith threshold vector θ k;
Such as, to the connection weights W of node K and hidden layer j jkwith being modified to of the threshold value of node K: θ k(t+1)=θ k(t)+β δ k.
Second revise operation 511, calculate connection weights correction between hidden node and input layer: and according to described calibration corrections δ jrevise the connection weight value matrix W between hidden layer and input layer jiwith threshold vector θ j, and make K=K+1, return input operation 502.
Such as, the connection weights W of hidden layer j and input layer i jiwith the threshold vector θ of node j jmodified value be: θ j(t+1)=θ j(t)+α δ j.
Two, frequency of training Adjusted Option
Frequency of training is an important parameter of neural network.Frequency of training too much can cause the mistake of network to fit, and causes result to produce deviation; Frequency of training is crossed and is made network be difficult to convergence at least, does not reach training requirement.The basic thought of this programme is, terminates learning process by the frequency of training preset.
In specific implementation, the implementation procedure of this programme can comprise:
Initialization operation, preset frequency of training T, K=0, set current frequency of training t=0, initialization is carried out to network weight and network threshold, wherein, described network weight can comprise the connection weights between output layer node and hidden node, and the connection weights between hidden node and input layer, and described network threshold can comprise hidden node threshold value and output layer Node B threshold;
Input operation: input K training sample, as current training sample, wherein, K ∈ 1,2 ..., N};
The output valve of the first calculating operation, each node of calculating hidden layer;
The output valve of the second calculating operation, each node of calculating output layer;
First revises the calibration corrections operating, calculate the connection weights between output layer node and hidden node, and according to described calibration corrections, revises the connection weights between output layer and hidden layer and output layer threshold value;
Second revises the calibration corrections operating, calculate the connection weights between hidden node and input layer, and according to described calibration corrections, revises the connection weights between hidden layer and input layer and hidden node threshold value;
First judges to operate, judge whether K > N-1 sets up, and if so, then performs second and judges operation; Otherwise, K=K+1, and return input operation;
Second judges to operate, judge whether t > T-2 sets up, and if so, then algorithm terminates; Otherwise, upgrade frequency of training t=t+1, and return input operation.
Be appreciated that the implementation procedure of above-mentioned two schemes just exemplarily, those skilled in the art as required, can also adopt other interpretational criterias, as adopted square error (MSE, Mean SquareError); Or, adopt other training rules, as utilized the improved Back Propagation, self-adaptative adjustment learning rate, momentum-adjusting learning rate adjustment algorithm, L-M (Levenberg-Marquardt) learning rules etc. of momentum method, the present invention is not limited concrete interpretational criteria and training rules.
In addition, above-mentioned two schemes can also be combined, adjust weights and threshold, the present invention is not limited this.
The invention also discloses the conversion equipment embodiment of a kind of CMYK to rgb color space, specifically can comprise:
Set up module, for setting up BP neural network transformation model, can using the input variable of C, M, Y, the K in CMYK space as this transformation model, using the output variable of R, G, the B in rgb space as this transformation model, the parameter of described model can comprise network weight and network threshold;
For the embodiment of the present invention, the structure of described transformation model can comprise input layer, a hidden layer and output layer;
Acquisition module, for be training sample with N number of CMYK color value and corresponding RGB color value input and desired output, obtains training sample;
Be Sigmoid type in the transport function of described hidden layer and output layer: time f (x)=1/ [1+e^ (-x)], described acquisition module can comprise:
Color value obtains submodule, for obtaining N number of CMYK color value and corresponding RGB color value, and it can be used as input and the desired output raw data of training sample;
Normalization submodule, for being normalized described input and desired output raw data, makes its value between [0,1].
Training module, for for described training sample, adopts this transformation model of BP Algorithm for Training, obtains the model parameter revised, thus determine this transformation model.
In one preferred embodiment of the invention, described training module can comprise following submodule:
Initialization submodule, for preset number of samples K=0, preset the local error upper limit and the global error upper limit, initialization is carried out to network weight and network threshold, wherein, described network weight can comprise the connection weights between output layer node and hidden node, and the connection weights between hidden node and input layer, and described network threshold can comprise hidden node threshold value and output layer Node B threshold;
Input submodule, for inputting K training sample, as current training sample, wherein, K ∈ 1,2 ..., N};
First calculating sub module, for calculating the output valve of each node of hidden layer;
Second calculating sub module, for calculating the output valve of each node of output layer;
3rd calculating sub module, for for current sample, based on the output valve of desired output and each node of output layer, adopts Square-type error function, calculates the error of current sample;
First judges submodule, for judging whether the error of current sample is less than the local error upper limit, if so, then triggering second and judging submodule; Otherwise, trigger first and revise submodule;
Second judges submodule, for judging whether K > N-1 sets up, if so, then triggers the 4th calculating sub module; Otherwise, trigger first and revise submodule;
4th calculating sub module, for for all N number of samples, based on the output valve of desired output and each node of output layer, adopts Square-type error function, calculates global error;
3rd judges submodule, for judging whether global error is less than the global error upper limit, if so, then terminates training; Otherwise, trigger first and revise submodule;
First revises submodule, for calculating the calibration corrections of the connection weights between output layer node and hidden node, and according to described calibration corrections, revises the connection weights between output layer and hidden layer and output layer threshold value;
Second revises submodule, for calculating the calibration corrections of the connection weights between hidden node and input layer, and according to described calibration corrections, the connection weights between hidden layer and input layer and hidden node threshold value are revised, and trigger input submodule.
For device embodiment, due to the embodiment of the method basic simlarity shown in itself and Fig. 1, so description is fairly simple, relevant part illustrates see the part of embodiment of the method.
Above to a kind of CMYK provided by the present invention to the conversion method of rgb color space and device, be described in detail, apply specific case herein to set forth principle of the present invention and embodiment, the explanation of above embodiment just understands method of the present invention and core concept thereof for helping; Meanwhile, for one of ordinary skill in the art, according to thought of the present invention, all will change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.

Claims (7)

1. CMYK is to a conversion method for rgb color space, it is characterized in that, comprising:
Establishment step: set up BP neural network transformation model, using the input variable of C, M, Y, the K in CMYK space as this transformation model, R, G, B in rgb space are as the output variable of this transformation model, and the parameter of described model comprises network weight and network threshold;
Obtaining step: the input being training sample with N number of CMYK color value and corresponding RGB color value and desired output, obtain training sample;
Training step: for described training sample, adopts this transformation model of BP Algorithm for Training, obtains the model parameter revised, thus determine this transformation model;
Described training step comprises: initialization operation: preset number of samples K=0, preset the local error upper limit and the global error upper limit, initialization is carried out to network weight and network threshold, wherein, described network weight comprises the connection weights between output layer node and hidden node, and the connection weights between hidden node and input layer, described network threshold comprises hidden node threshold value and output layer Node B threshold; Input operation: input K training sample, as current training sample, wherein, K ∈ 1,2 ..., N}; First calculating operation: the output valve calculating each node of hidden layer; Second calculating operation: the output valve calculating each node of output layer; 3rd calculating operation: for current sample, based on the output valve of desired output and each node of output layer, adopts Square-type error function, calculates the error of current sample; First judges operation: judge whether the error of current sample is less than the local error upper limit, if so, then performs second and judges operation; Otherwise, perform first and revise operation; Second judges operation: judge whether K>N-1 sets up, and if so, then performs the 4th calculating operation; Otherwise, perform first and revise operation; 4th calculating operation: for all N number of samples, based on the output valve of desired output and each node of output layer, adopts Square-type error function, calculates global error; 3rd judges operation: judge whether global error is less than the global error upper limit, and if so, then algorithm terminates; Otherwise, perform first and revise operation; First revises operation: the calibration corrections calculating the connection weights between output layer node and hidden node, and according to described calibration corrections, revises the connection weights between output layer and hidden layer and output layer threshold value; Second revises operation: the calibration corrections calculating the connection weights between hidden node and input layer, and according to described calibration corrections, connection weights between hidden layer and input layer and hidden node threshold value are revised, and makes K=K+1, return input operation;
Or
Described training step comprises: initialization operation: preset frequency of training T, K=0, set current frequency of training t=0, initialization is carried out to network weight and network threshold, wherein, described network weight comprises the connection weights between output layer node and hidden node, and the connection weights between hidden node and input layer, and described network threshold comprises hidden node threshold value and output layer Node B threshold; Input operation: input K training sample, as current training sample, wherein, K ∈ 1,2 ..., N}; First calculating operation: the output valve calculating each node of hidden layer; Second calculating operation: the output valve calculating each node of output layer; First revises operation: the calibration corrections calculating the connection weights between output layer node and hidden node, and according to described calibration corrections, revises the connection weights between output layer and hidden layer and output layer threshold value; Second revises operation: the calibration corrections calculating the connection weights between hidden node and input layer, and according to described calibration corrections, revises the connection weights between hidden layer and input layer and hidden node threshold value; First judges operation: judge whether K>N-1 sets up, and if so, then performs second and judges operation; Otherwise, K=K+1, and return input operation; Second judges operation: judge whether t>T-2 sets up, and if so, then algorithm terminates; Otherwise, upgrade frequency of training t=t+1, and return input operation.
2. the method for claim 1, is characterized in that, the structure of described transformation model comprises input layer, a hidden layer and output layer, and input layer number is 4, and output layer nodes is 3, and the number of hidden nodes is wherein, 1<a<30.
3. method as claimed in claim 2, it is characterized in that, the transport function of described hidden layer and output layer is Sigmoid type: f (x)=1/ [1+e^ (-bx)], b>0.
4. method as claimed in claim 3, it is characterized in that, as b=1, described obtaining step comprises:
Obtain N number of CMYK color value and corresponding RGB color value, and it can be used as input and the desired output raw data of training sample;
Described input and desired output raw data are normalized, make its value between [0,1].
5. CMYK is to a conversion equipment for rgb color space, it is characterized in that, comprising:
Set up module, for setting up BP neural network transformation model, using the input variable of C, M, Y, the K in CMYK space as this transformation model, R, G, B in rgb space are as the output variable of this transformation model, and the parameter of described model comprises network weight and network threshold;
Acquisition module, for be training sample with N number of CMYK color value and corresponding RGB color value input and desired output, obtains training sample;
Training module, for for described training sample, adopts this transformation model of BP Algorithm for Training, obtains the model parameter revised, thus determine this transformation model;
Described training module comprises:
Initialization submodule, for preset number of samples K=0, preset the local error upper limit and the global error upper limit, initialization is carried out to network weight and network threshold, wherein, described network weight comprises the connection weights between output layer node and hidden node, and the connection weights between hidden node and input layer, and described network threshold comprises hidden node threshold value and output layer Node B threshold; Input submodule, for inputting K training sample, as current training sample, wherein, K ∈ 1,2 ..., N}; First calculating sub module, for calculating the output valve of each node of hidden layer; Second calculating sub module, for calculating the output valve of each node of output layer; 3rd calculating sub module, for for current sample, based on the output valve of desired output and each node of output layer, adopts Square-type error function, calculates the error of current sample; First judges submodule, for judging whether the error of current sample is less than the local error upper limit, if so, then triggering second and judging submodule; Otherwise, trigger first and revise submodule; Second judges submodule, for judging whether K>N-1 sets up, if so, then triggers the 4th calculating sub module; Otherwise, trigger first and revise submodule; 4th calculating sub module, for for all N number of samples, based on the output valve of desired output and each node of output layer, adopts Square-type error function, calculates global error; 3rd judges submodule, for judging whether global error is less than the global error upper limit, if so, then terminates training; Otherwise, trigger first and revise submodule; First revises submodule, for calculating the calibration corrections of the connection weights between output layer node and hidden node, and according to described calibration corrections, revises the connection weights between output layer and hidden layer and output layer threshold value; Second revises submodule, for calculating the calibration corrections of the connection weights between hidden node and input layer, and according to described calibration corrections, the connection weights between hidden layer and input layer and hidden node threshold value are revised, and trigger input submodule;
Or, described training module comprises: initialization operation: preset frequency of training T, K=0, set current frequency of training t=0, carry out initialization to network weight and network threshold, wherein, described network weight comprises the connection weights between output layer node and hidden node, and the connection weights between hidden node and input layer, described network threshold comprises hidden node threshold value and output layer Node B threshold; Input operation: input K training sample, as current training sample, wherein, K ∈ 1,2 ..., N}; First calculating operation: the output valve calculating each node of hidden layer; Second calculating operation: the output valve calculating each node of output layer; First revises operation: the calibration corrections calculating the connection weights between output layer node and hidden node, and according to described calibration corrections, revises the connection weights between output layer and hidden layer and output layer threshold value; Second revises operation: the calibration corrections calculating the connection weights between hidden node and input layer, and according to described calibration corrections, revises the connection weights between hidden layer and input layer and hidden node threshold value; First judges operation: judge whether K>N-1 sets up, and if so, then performs second and judges operation; Otherwise, K=K+1, and return input operation; Second judges operation: judge whether t>T-2 sets up, and if so, then algorithm terminates; Otherwise, upgrade frequency of training t=t+1, and return input operation.
6. device as claimed in claim 5, it is characterized in that, the structure of described transformation model comprises input layer, a hidden layer and output layer.
7. device as claimed in claim 6, it is characterized in that, the transport function of described hidden layer and output layer is Sigmoid type: f (x)=1/ [1+e^ (-x)];
Described acquisition module comprises:
Color value obtains submodule, for obtaining N number of CMYK color value and corresponding RGB color value, and it can be used as input and the desired output raw data of training sample;
Normalization submodule, for being normalized described input and desired output raw data, makes its value between [0,1].
CN200910243865.XA 2009-12-23 2009-12-23 Method and device for converting color space from CMYK to RGB Expired - Fee Related CN102110428B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200910243865.XA CN102110428B (en) 2009-12-23 2009-12-23 Method and device for converting color space from CMYK to RGB

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200910243865.XA CN102110428B (en) 2009-12-23 2009-12-23 Method and device for converting color space from CMYK to RGB

Publications (2)

Publication Number Publication Date
CN102110428A CN102110428A (en) 2011-06-29
CN102110428B true CN102110428B (en) 2015-05-27

Family

ID=44174564

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200910243865.XA Expired - Fee Related CN102110428B (en) 2009-12-23 2009-12-23 Method and device for converting color space from CMYK to RGB

Country Status (1)

Country Link
CN (1) CN102110428B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102622418B (en) * 2012-02-21 2013-08-07 北京联合大学 Prediction device and equipment based on BP (Back Propagation) nerve network
CN103383743B (en) * 2013-07-16 2016-07-06 南京信息工程大学 A kind of chrominance space transformation method
CN111064860A (en) * 2018-10-17 2020-04-24 北京地平线机器人技术研发有限公司 Image correction method, image correction device and electronic equipment
CN111355937B (en) * 2020-03-11 2021-11-16 北京迈格威科技有限公司 Image processing method and device and electronic equipment
CN112270397B (en) * 2020-10-26 2024-02-20 西安工程大学 Color space conversion method based on deep neural network
CN113409206A (en) * 2021-06-11 2021-09-17 西安工程大学 High-precision digital printing color space conversion method
CN113706415A (en) * 2021-08-27 2021-11-26 北京瑞莱智慧科技有限公司 Training data generation method, countermeasure sample generation method, image color correction method and device
CN114285955B (en) * 2021-12-28 2022-12-09 浙江大学 Color gamut mapping method based on dynamic deviation map neural network

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101276473A (en) * 2008-04-17 2008-10-01 上海交通大学 Visualization method for Munsell colour model computer
CN101442602A (en) * 2008-12-31 2009-05-27 陕西科技大学 Color space transition method based on fuzzy theory

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101276473A (en) * 2008-04-17 2008-10-01 上海交通大学 Visualization method for Munsell colour model computer
CN101442602A (en) * 2008-12-31 2009-05-27 陕西科技大学 Color space transition method based on fuzzy theory

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
色彩空间转换的BP神经网络模型;袁磊等;《襄樊学院学报》;20040330;第54页第1段-第56页第3段及图2 *

Also Published As

Publication number Publication date
CN102110428A (en) 2011-06-29

Similar Documents

Publication Publication Date Title
CN102110428B (en) Method and device for converting color space from CMYK to RGB
CN103931169B (en) A kind of general Color Gamut Mapping and color management method
US8213055B2 (en) Color separation into Neugebauer primary area coverage vectors
US10171706B2 (en) Configuring an imaging system
US20170161864A1 (en) Printer cartridge and memory device containing a compressed color table
CN102120384B (en) Multiple primitive color printing quality control method
US20170048421A1 (en) Color mapping
EP3135026B1 (en) Generation of color mapping representative of a color halftone processing pipeline
CN104956653A (en) Color separation
CN102111626A (en) Conversion method and device from red-green-blue (RGB) color space to cyan-magenta-yellow-black (CMYK) color space
CN101489145B (en) Smoothly changing gray levels in color transforms
US11134176B2 (en) Lookup table smoothing
CN109804615B (en) Method, apparatus and storage medium for controlling printing of halftone
CN105681625B (en) Color signal processing apparatus and color signal processing method
CN105262930A (en) ICC file manufacturing method of converting RGB color mode to CMYK color mode
US20190373138A1 (en) Color calibration
US11057543B2 (en) Updating a lookup table for an imaging system
US20030176281A1 (en) Choice of chromophores in two color imaging systems
CN100457467C (en) Color saturation adjustment
US20210004654A1 (en) Printer calibration
Bi et al. Color space conversion algorithm and comparison study
US11477346B2 (en) Color calibration in a printing system
CN113409206A (en) High-precision digital printing color space conversion method
US20220109781A1 (en) Color matching
Abet et al. A neural network approach for RGB to YMCK color conversion

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20150527

Termination date: 20161223

CF01 Termination of patent right due to non-payment of annual fee