JP5757108B2 - Image processing apparatus and program - Google Patents
Image processing apparatus and program Download PDFInfo
- Publication number
- JP5757108B2 JP5757108B2 JP2011051489A JP2011051489A JP5757108B2 JP 5757108 B2 JP5757108 B2 JP 5757108B2 JP 2011051489 A JP2011051489 A JP 2011051489A JP 2011051489 A JP2011051489 A JP 2011051489A JP 5757108 B2 JP5757108 B2 JP 5757108B2
- Authority
- JP
- Japan
- Prior art keywords
- color
- values
- shift
- image data
- value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
- 238000012545 processing Methods 0.000 title claims description 50
- 238000006243 chemical reaction Methods 0.000 claims description 75
- 238000004364 calculation method Methods 0.000 claims description 25
- 125000002057 carboxymethyl group Chemical group [H]OC(=O)C([H])([H])[*] 0.000 claims description 2
- 238000000034 method Methods 0.000 description 32
- 239000011159 matrix material Substances 0.000 description 9
- 239000003086 colorant Substances 0.000 description 7
- 238000010586 diagram Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 4
- 230000000694 effects Effects 0.000 description 2
- 230000000873 masking effect Effects 0.000 description 2
- 238000013459 approach Methods 0.000 description 1
- 238000007429 general method Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Images
Landscapes
- Facsimile Image Signal Circuits (AREA)
- Color Image Communication Systems (AREA)
- Image Processing (AREA)
Description
本発明は、画像処理装置およびプログラムに関する。 The present invention relates to an image processing apparatus and a program.
特許文献1には、カラー画像信号の3色のうち、各2色の差の自乗値に係数を乗じた数値を記憶するテーブルメモリと、この2色の差の絶対値を求める演算器とを備え、演算器の出力を読み出しアドレスとしてテーブルメモリを参照することにより、マスキング演算式の2次項を演算するようにしたマスキング演算装置が開示されている。
本発明の目的は、変換係数を乗算した後に全ての項に対してシフト演算を行う場合や、変換係数を乗算した項を全て加算した後に一括してシフト演算を行う場合と比較して、少ない演算処理で精度の高い色変換を実現することが可能な画像処理装置およびプログラムを提供することである。 The object of the present invention is less than the case where shift operations are performed on all terms after multiplication by transform coefficients and the case where shift operations are performed collectively after adding all terms multiplied by transform coefficients. An object of the present invention is to provide an image processing apparatus and a program capable of realizing color conversion with high accuracy by arithmetic processing.
[画像処理装置]
請求項1に係る本発明は、入力された複数の色成分により表現された第1の表色系の画像データに対して複数の色成分の組み合わせを乗算して得られる多次項の値を複数算出する算出手段と、
前記算出手段により算出された複数の多次項の値を、それぞれ予め設定されたビット数だけシフトする複数の第1のシフト手段と、
入力された前記複数の色成分の値および前記第1のシフト手段によりシフトされた後の値に対して、予め設定された複数の変換係数を、第2の表色系の各色成分毎にそれぞれ乗算する複数の乗算手段と、
前記複数の乗算手段により変換係数が乗算された後の値を、第2の表色系の各色成分毎にそれぞれ加算する複数の加算手段と、
前記複数の加算手段により加算された値をそれぞれ予め設定されたビット数だけシフトして、第2の表色系の画像データの各色成分の値として出力する複数の第2のシフト手段と、
を備えた画像処理装置である。
[Image processing device]
According to the first aspect of the present invention, a plurality of values of a multi-order term obtained by multiplying image data of the first color system expressed by a plurality of input color components by a combination of a plurality of color components. A calculating means for calculating;
A plurality of first shift means for shifting the values of a plurality of multi-order terms calculated by the calculation means by a preset number of bits;
A plurality of preset conversion coefficients are set for each color component of the second color system for the input values of the plurality of color components and the values after being shifted by the first shift means. A plurality of multiplication means for multiplying;
A plurality of addition means for adding the values after the conversion coefficients are multiplied by the plurality of multiplication means for each color component of the second color system;
A plurality of second shift means for shifting the values added by the plurality of addition means by a predetermined number of bits and outputting the values as the values of the respective color components of the second color system image data;
Is an image processing apparatus.
請求項2に係る本発明は、前記第1のシフト手段が、前記多次項の次数に応じたビット数だけ前記複数の多次項の値をシフトする請求項1記載の画像処理装置である。
The present invention according to claim 2 is the image processing apparatus according to
請求項3に係る本発明は、前記算出手段が、前記第1の表色系の画像データに対して前記複数の色成分から選択した異なる2色の色成分の乗算値および各色成分の自乗値を前記多次項の値としてそれぞれ算出する請求項1記載の画像処理装置である。
According to a third aspect of the present invention, there is provided a multiplication value of two different color components selected from the plurality of color components and a square value of each color component by the calculation means for the image data of the first color system. The image processing apparatus according to
請求項4に係る本発明は、前記第1の表色系の画像データがRGB表色系の画像データであり、前記第2の表色系の画像データがL*a*b*表色系の画像データである請求項1から3のいずれか1項記載の画像処理装置である。
According to a fourth aspect of the present invention, the image data of the first color system is image data of an RGB color system, and the image data of the second color system is an L * a * b * color system. The image processing apparatus according to any one of
[プログラム]
請求項5に係る本発明は、入力された複数の色成分により表現された第1の表色系の画像データに対して複数の色成分の組み合わせを乗算して得られる多次項の値を複数算出するステップと、
算出された複数の多次項の値を、それぞれ予め設定されたビット数だけシフトするシフトステップと、
入力された前記複数の色成分の値および前記シフトステップによりシフトされた後の値に対して、予め設定された複数の変換係数を、第2の表色系の各色成分毎にそれぞれ乗算するステップと、
変換係数が乗算された後の値を、第2の表色系の各色成分毎にそれぞれ加算するステップと、
各色成分毎に加算された値をそれぞれ予め設定されたビット数だけシフトして、第2の表色系の画像データの各色成分の値として出力するステップとをコンピュータに実行させるためのプログラムである。
[program]
According to the fifth aspect of the present invention, a plurality of values of a multi-order term obtained by multiplying the first color system image data expressed by a plurality of input color components by a combination of a plurality of color components are provided. A calculating step;
A shift step for shifting the calculated values of the multiple-order terms by a preset number of bits,
For values after being shifted by the value and the previous carboxymethyl shift steps of the input of the plurality of color components, a plurality of conversion coefficients set in advance, respectively multiplying each color component of the second color system And steps to
Adding the value after the multiplication by the conversion coefficient for each color component of the second color system;
A program for causing a computer to execute a step of shifting a value added for each color component by a predetermined number of bits and outputting the value as a value of each color component of second color system image data .
請求項1に係る本発明によれば、変換係数を乗算した後に全ての項に対してシフト演算を行う場合や、変換係数を乗算した項を全て加算した後に一括してシフト演算を行う場合と比較して、少ない演算処理で精度の高い色変換を実現することが可能な画像処理装置を提供することができる。 According to the first aspect of the present invention, the shift operation is performed on all the terms after multiplication by the transform coefficient, or the shift operation is performed collectively after all the terms multiplied by the transform coefficient are added. In comparison, it is possible to provide an image processing apparatus capable of realizing highly accurate color conversion with less arithmetic processing.
請求項2に係る本発明によれば、請求項1に係る本発明により得られる効果に加えて、演算処理量と色変換精度のバランスを適切に保つことができるという効果を得ることができる。 According to the second aspect of the present invention, in addition to the effect obtained by the first aspect of the present invention, it is possible to obtain the effect that the balance between the calculation processing amount and the color conversion accuracy can be appropriately maintained.
請求項3に係る本発明によれば、第1の表色系の画像データから2次項を算出して色変換を行う際に、変換係数を乗算した後に全ての項に対してシフト演算を行う場合や、変換係数を乗算した項を全て加算した後に一括してシフト演算を行う場合と比較して、少ない演算処理で精度の高い色変換を実現することが可能な画像処理装置を提供することができる。 According to the third aspect of the present invention, when the secondary term is calculated from the image data of the first color system and color conversion is performed, the shift operation is performed on all the terms after multiplying the conversion coefficient. To provide an image processing apparatus capable of realizing color conversion with high accuracy with a small amount of arithmetic processing, compared to a case where shift operations are performed collectively after adding all terms multiplied by conversion coefficients. Can do.
請求項4に係る本発明によれば、RGB表色系の画像データをL*a*b*表色系の画像データに色変換を行う際に、変換係数を乗算した後に全ての項に対してシフト演算を行う場合や、変換係数を乗算した項を全て加算した後に一括してシフト演算を行う場合と比較して、少ない演算処理で精度の高い色変換を実現することが可能な画像処理装置を提供することができる。 According to the fourth aspect of the present invention, when color conversion is performed on image data of the RGB color system to image data of the L * a * b * color system, all the terms are applied after multiplying the conversion coefficient. Compared to the case where shift calculation is performed, or the case where shift operation is performed collectively after adding all the terms multiplied by the conversion coefficient, image processing that can realize highly accurate color conversion with less calculation processing An apparatus can be provided.
請求項5に係る本発明によれば、変換係数を乗算した後に全ての項に対してシフト演算を行う場合や、変換係数を乗算した項を全て加算した後に一括してシフト演算を行う場合と比較して、少ない演算処理で精度の高い色変換を実現することが可能なプログラムを提供することができる。 According to the fifth aspect of the present invention, the shift operation is performed on all the terms after multiplication by the transform coefficient, or the shift operation is performed collectively after all the terms multiplied by the transform coefficient are added. In comparison, it is possible to provide a program capable of realizing highly accurate color conversion with a small amount of arithmetic processing.
[背景]
まず、本発明の理解を助けるために、その背景及び概略を説明する。
[background]
First, in order to help understanding of the present invention, its background and outline will be described.
ある色空間の画像データを他の色空間の画像データに変換する方法として、N×Mの行列演算を行う方法が知られている。例えば、RGBの色成分で表されたRGB表色系の画像データをL*a*b*表色系の画像データに変換するために、図1に示すような3×9の行列演算を行う方法が知られている。 As a method for converting image data of a certain color space into image data of another color space, a method of performing an N × M matrix operation is known. For example, in order to convert RGB color system image data represented by RGB color components into L * a * b * color system image data, a 3 × 9 matrix operation as shown in FIG. 1 is performed. The method is known.
この図1に示した行列演算では、入力信号として、B、G、R、B×B、G×G、R×R、B×G、G×R、R×Bという9つの値が入力され、出力として、L*、a*、b*という3つの値が出力信号として得られる。 In the matrix operation shown in FIG. 1, nine values B, G, R, B × B, G × G, R × R, B × G, G × R, and R × B are input as input signals. As an output, three values L *, a *, and b * are obtained as output signals.
この行列演算を行うことにより例えば、L*=C11×B+C12×G+・・・・・+C19×R×Bというような演算が行われ、L*、a*、b*の値がそれぞれ算出される。このような行列演算を行う場合の変換係数C11、C12、・・・C39の値の例を図2に示す。 By performing this matrix operation, for example, an operation such as L * = C11 × B + C12 × G +... + C19 × R × B is performed, and the values of L *, a *, and b * are calculated. . FIG. 2 shows an example of the values of the conversion coefficients C11, C12,... C39 when performing such a matrix operation.
上記のような演算処理をデジタル処理により行うためには、一般的に先ず変換係数の実数値を整数値とシフト量に変換しておき、実際の演算処理を行う場合には、先ず入力値に整数値を乗算し、得られた値を予め設定されたシフト量だけシフトすることにより除算する方法が行われている。 In order to perform the arithmetic processing as described above by digital processing, generally, first convert the real value of the conversion coefficient into an integer value and a shift amount. A method of performing division by multiplying an integer value and shifting the obtained value by a preset shift amount is performed.
このような演算を行うための画像処理装置の構成を図3に示す。この画像処理装置は、2次項生成部81と、L*、a*、b*の色成分毎に設けられた演算器82、83、84とから構成されている。
FIG. 3 shows the configuration of an image processing apparatus for performing such calculations. This image processing apparatus includes a secondary
2次項生成部81は、3色の色成分B、G、Rにより表現されたRGB表色系の画像データを入力し、その3色の色成分から選択可能な全ての2色の色成分の乗算値B×G、G×R、R×Gおよび各色成分の自乗値(2乗値)B×B、G×G、R×Rをそれぞれ算出し、入力した3色の色成分とともに出力する。
The secondary
演算器82、83、84は、それぞれ、色成分生成期81から出力された9つの値に基づいて、L*、a*、b*の値を算出する。
The
この演算器82の具体的な構成の一例を図4に示す。この図4に示した演算器82は、最も一般的な方式(以下通常方式と呼ぶ)であり、乗算器91〜99と、シフト演算器101〜109と、加算器110とから構成されている。
An example of a specific configuration of the
乗算器91〜99は、それぞれ、入力値である9つの値B、G、R、B×B、G×G、R×R、B×G、G×R、R×Bに対して、図5に示すような変換係数D11、D12、・・・、D19を乗算する。
この図5に示す変換係数D11、・・・、D39およびシフト量sft11、・・・、sft39は、図2に示した変換係数を整数の変換係数とシフト量に変換したものである。 5, conversion coefficients D11,..., D39 and shift amounts sft11,..., Sft39 shown in FIG. 5 are obtained by converting the conversion coefficients shown in FIG.
そして、シフト演算器101〜109は、図5に示すようなシフト量sft11、sft12、・・・、sft19により指定されたビット数だけ、乗算器91〜99により変換係数が乗算された後の値をシフトする。
Then, the
そして、加算器110は、シフト演算器101〜109からの出力値を全て加算して、L*の値として出力する。
The
なお、図5において変換係数D21、D22、・・・、D29およびシフト量sft21、sft22、・・・、sft29は、a*の値を算出するためのものである。また、変換係数D31、D32、・・・、D39およびシフト量sft31、sft32、・・・、sft39は、b*の値を算出するためのものである。 5, conversion coefficients D21, D22,..., D29 and shift amounts sft21, sft22,..., Sft29 are for calculating the value of a *. The conversion coefficients D31, D32,..., D39 and the shift amounts sft31, sft32,..., Sft39 are for calculating the value of b *.
このような色変換処理では、乗算処理およびシフト演算処理は、1つの項に注目すると図6に示すように行われる。この図6は、色成分Bの値に変換係数D11=−571を乗算し、sft11=12ビットだけシフト演算する場合を示すものである。 In such a color conversion process, the multiplication process and the shift operation process are performed as shown in FIG. FIG. 6 shows a case where the value of the color component B is multiplied by a conversion coefficient D11 = −571 and a shift operation is performed by sft11 = 12 bits.
なお、入力値である色成分Bの値は8ビットにより表現され、変換係数D11は符号付の11ビットにより表現され、シフト量sft11は5ビットにより表現されている。 Note that the value of the color component B that is an input value is expressed by 8 bits, the conversion coefficient D11 is expressed by 11 bits with a sign, and the shift amount sft11 is expressed by 5 bits.
入力値である100は、乗算器91により変換係数D11=−571が乗算されることにより19ビットで表現される値(−57100)となる。そして、この値はシフト演算器101により12ビットだけシフトされることにより−13.9375となり加算器110に出力される。
The
もし、図2に示した変換係数C11=−0.139610126615を用いて実数計算を行った場合、100×C11=−13.9610126615となるため、図6に示した方法によりほぼ同等の結果が得られていることがわかる。 If the real number calculation is performed using the conversion coefficient C11 = −0.139610126615 shown in FIG. 2, since 100 × C11 = −13.96610126615, almost the same result can be obtained by the method shown in FIG. You can see that
また、演算器82の具体的な構成の他の例を図7に示す。この図7に示した演算器82は、シフト演算を行う回数を減らすことを目的として、シフト演算を加算器110の出力値に対して1回のみ行うようにした共通シフト方式と呼ばれる構成であり、乗算器91〜99と、加算器110と、シフト演算器120とから構成されている。なお、図7において、図4中の構成要素と同一の構成要素には同一の符号を付し、説明を省略するものとする。
Another example of the specific configuration of the
乗算器91〜99は、それぞれ、入力値である9つの値B、G、R、B×B、G×G、R×R、B×G、G×R、R×Bに対して、図8に示すような変換係数E11、E12、・・・、E19を乗算する。
この図8に示す変換係数E11、・・・、E39および共通シフト量sftL、sft a、sft bは、図2に示した変換係数を整数の変換係数と共通シフト量に変換したものである。 The conversion coefficients E11,..., E39 and the common shift amounts sftL, sfta, sftb shown in FIG. 8 are obtained by converting the conversion coefficients shown in FIG. 2 into integer conversion coefficients and common shift amounts.
そして、加算器110は、乗算器91〜99からの出力値を全て加算して出力する。シフト演算器120は、共通シフト量sftL(14ビット)により指定されたビット数だけ、加算器110の出力値をシフトして、L*の値として出力する。
The
この共通シフト方式の演算処理によれば、図4の通常方式と比較してシフト演算処理が少なくなっていることが分かる。 According to this common shift method arithmetic processing, it can be seen that the shift arithmetic processing is reduced as compared with the normal method of FIG.
[実施形態]
次に、本発明の実施の形態について図面を参照して詳細に説明する。
図9は本発明の一実施形態の画像処理装置のハードウェア構成を示す図である。
[Embodiment]
Next, embodiments of the present invention will be described in detail with reference to the drawings.
FIG. 9 is a diagram showing a hardware configuration of the image processing apparatus according to the embodiment of the present invention.
本実施形態の画像処理装置は、図9に示されるように、DSP(Digital Signal Processor)11と、メモリ12と、ROM13とにより構成されている。
As shown in FIG. 9, the image processing apparatus according to the present embodiment includes a DSP (Digital Signal Processor) 11, a
DSP11は、メモリ12またはROM13に格納された制御プログラムに基づいて所定の処理を実行することによりRGB表色系の画像データをL*a*b*表色系の画像データへの色変換処理を実現する。なお、本実施形態では、DSP11は、メモリ12またはROM13内に格納された制御プログラムを読み出して実行するものとして説明したが、当該プログラムをCD−ROM等の記憶媒体に格納してDSP11に提供することも可能である。
The
図10は、上記の制御プログラムが実行されることにより実現される本実施形態の画像処理装置の機能構成を示すブロック図である。 FIG. 10 is a block diagram illustrating a functional configuration of the image processing apparatus according to the present exemplary embodiment that is realized by executing the control program.
本実施形態の画像処理装置は、図10に示されるように、2次項生成部20と、プリシフト部30と、乗算部40L、40a、40bと、加算器50L、50a、50bと、シフト演算器60L、60a、60bとを備えている。
As shown in FIG. 10, the image processing apparatus according to the present embodiment includes a secondary
また、プリシフト部30は、シフト演算器31〜36から構成されている。また、乗算部40Lは、乗算器41〜49から構成されている。なお、乗算部40a、40bの構成は乗算部40Lと同様な構成であるため、その説明は省略する。
The
2次項生成部20は、RGB表色系の画像データに対して3つの色成分R、G、Bから選択した異なる2色の色成分の乗算値(BG、GR、GB)および各色成分の自乗値(BB、GG、RR)を2次項の値としてそれぞれ算出する。なお、本実施形態における2次項生成部20は、入力されたBGRの各色成分の値もそのまま出力している。
The quadratic
プリシフト部30におけるシフト演算器31〜36は、それぞれ、2次項生成部20により算出された6つの2次項の値を、それぞれプリシフト量Sbb、Sgg、・・・、Srbにより設定されたビット数だけシフトする。
The
乗算部40Lにおける乗算器41〜49は、RGB表色系の画像データの3つの色成分の値(B、G、R)およびプリシフト部30においてシフト演算された後の値に対して、予め設定された9つの変換係数C1〜C9を、L*a*b*表色系の各色成分毎にそれぞれ乗算する。
加算器50Lは、9つの乗算器41〜49により変換係数C1〜C9が乗算された後の値を加算して出力する。
The
シフト演算器60Lは、加算器50Lにより加算された値を共通シフト量SLとして設定されたビット数だけシフトして、L*a*b*表色系の画像データのL*成分の値として出力する。
The
また、上記で説明したのと同様な処理により、乗算部40a、加算器50aによりa*成分の値が算出され、乗算部40b、加算器50bによりb*成分の値が算出される。
In addition, by the same process as described above, the value of the a * component is calculated by the
本実施形態において3色の出力値を得るために必要なシフト演算回数は、シフト演算器31〜36、60L、60a、60bにおいて行われる合計9回である。
In this embodiment, the number of shift operations necessary to obtain output values of three colors is a total of nine times performed in the
これに対して、図4に示した通常方式では、1色の出力を得るためにシフト演算器101〜109分の9回のシフト演算処理が必要であり、3色の出力を得るためには27(=9回×3色)回のシフト演算が必要となっている。 On the other hand, the normal method shown in FIG. 4 requires nine shift arithmetic processes 101 to 109 in order to obtain one color output, and in order to obtain three color outputs. 27 (= 9 times × 3 colors) shift operations are required.
本実施形態では、2次の項(BB、GG、RR、BG、GR、RB)については変換係数C4〜C9を乗算する前にプリシフト部30におけるシフト演算が行われるため、L*、a*、b*の3色で共通したシフト演算を行うことが可能となり、各色毎に独立してシフト演算を行う場合と比較してシフト演算の回数が削減されている。
In the present embodiment, the second-order terms (BB, GG, RR, BG, GR, RB) are subjected to a shift operation in the
次に、本実施形態の画像処理装置において使用される変換係数C1〜C9、プリシフト量Sbb〜Srb、および共通シフト量SL、Sa、Sbの例を図11に示す。この図11に示した変換係数やプリシフト量、共通シフト量は、図2に示した変換係数による演算と同じ演算を行うために設定された値である。また、ここではL*成分を算出するための変換係数、a*成分を算出するための変換係数、b*成分を算出するための変換係数を全てC1〜C9で表現しているが、図11に示すように、これらの変換係数はL*、a*、b*の各色毎に設定される異なる係数である。 Next, FIG. 11 shows examples of conversion coefficients C1 to C9, preshift amounts Sbb to Srb, and common shift amounts SL, Sa, and Sb used in the image processing apparatus of the present embodiment. The conversion coefficient, pre-shift amount, and common shift amount shown in FIG. 11 are values set to perform the same calculation as the calculation using the conversion coefficient shown in FIG. Here, the conversion coefficient for calculating the L * component, the conversion coefficient for calculating the a * component, and the conversion coefficient for calculating the b * component are all expressed by C1 to C9. As shown in FIG. 5, these conversion coefficients are different coefficients set for each color of L *, a *, and b *.
なお、図11に示した例では、プリシフト量Sbb〜Srbは共通して4ビット、共通シフト量SL、Sa、Sbは全て14ビットに設定する場合が示されているが、これらのシフト量をそれぞれ異なる値に設定することも可能である。 In the example shown in FIG. 11, the preshift amounts Sbb to Srb are commonly set to 4 bits, and the common shift amounts SL, Sa, and Sb are all set to 14 bits. It is also possible to set different values.
図2に示したような実数値を整数部とシフト量に置き換えるためには、まず、各実数値の中で最も大きい値が整数部のビット幅を超えない範囲で最大に保たれるようにする。例えば、図2に示す変換係数を整数部とシフト量に置き換える場合、置き換えた後の変換係数を符号付16ビットで表現しようとすると、変換係数は±32768(=215)の範囲としなければならない。そして、図2に示された変換係数で絶対値が最も大きな変換係数はC22=1.395056962967であるため、この変換係数C22が上述した範囲に収まるような共通シフト量を設定する。具体的には、1.395056962967×214=22856.61326であり、1.395056962967×215=45713.22652であるため、上記の範囲を超えない共通シフト量として14が設定される。 In order to replace the real value as shown in FIG. 2 with the integer part and the shift amount, first, the largest value in each real value is kept to the maximum within the range not exceeding the bit width of the integer part. To do. For example, when the conversion coefficient shown in FIG. 2 is replaced with an integer part and a shift amount, if the converted conversion coefficient is expressed with signed 16 bits, the conversion coefficient must be within a range of ± 32768 (= 2 15 ). Don't be. Since the conversion coefficient having the largest absolute value among the conversion coefficients shown in FIG. 2 is C22 = 1.395506629967, a common shift amount is set such that the conversion coefficient C22 falls within the above-described range. Specifically, since 1.395056696967 × 2 14 = 22856.661326 and 1.395056696967 × 2 15 = 45713.22652, 14 is set as the common shift amount not exceeding the above range.
そして、2次の項に対する変換係数については、整数部のビット幅を超えない範囲で大きくなるようにプリシフト部30のプリシフト量を設定する。例えば、プリシフト量を4ビットとした場合、2次の項に対する変換係数C4〜C9については、値が約24倍となるように設定する。
Then, the pre-shift amount of the
そのため、図8に示した共通シフト方式の変換係数と比較して、図11に示した本実施形態における変換係数は、2次の項に対する変換係数のみが約16倍になっているのが分かる。そのため、本実施形態における演算処理の結果は、多次項に乗算される変換係数C4〜C9の実効ビットは、共通シフト方式と比較して大きくなっている。 Therefore, as compared with the conversion coefficient of the common shift method shown in FIG. 8, it can be seen that the conversion coefficient in this embodiment shown in FIG. . Therefore, as a result of the arithmetic processing in this embodiment, the effective bits of the conversion coefficients C4 to C9 multiplied by the multi-order term are larger than those in the common shift method.
何故ならば、2次の項は2つの値の乗算値であるため、RGB単独の値と比較して絶対値が大きくなり、変換係数は相対的に小さくなるが、本実施形態の方式では、この2次の項を大きくすることにより実数計算値との間の誤差が少なくなるからである。 This is because the second-order term is a multiplication value of two values, so that the absolute value is larger than the RGB single value and the conversion coefficient is relatively small. This is because an error between the calculated value and the real number is reduced by increasing the quadratic term.
例えば、入力値をB=150、G=200、R=250とした場合の各演算方式による演算結果を図12に示す。 For example, FIG. 12 shows the calculation results by each calculation method when the input values are B = 150, G = 200, and R = 250.
この図12を参照すると、実数計算値(理論値)と比較して最も近い値が得られるのは通常方式であるが、本実施形態における演算結果もこの通常方式とほぼ同程度の精度となっていることが分かる。また、共通シフト方式の演算結果は、通常方式や本実施形態における演算方式と比較すると、実数計算値との色差が大きくなっているのが分かる。 Referring to FIG. 12, it is the normal method that obtains the closest value compared to the real number calculated value (theoretical value), but the calculation result in the present embodiment also has almost the same accuracy as this normal method. I understand that In addition, it can be seen that the color difference between the calculation result of the common shift method and the real number calculation value is larger than that of the normal method or the calculation method in the present embodiment.
また、1クロックでシフト演算処理と乗算処理を同時に実行可能な機能を備えるDSPを用いると、2次の項に対するプリシフト演算処理(プリシフト部30)と、乗算部40Lにおける乗算処理を1クロックで実行することが可能となる。つまり、このようなDSPを用いることにより、図7に示した共通シフト方式と同じ演算処理量で色変換精度が通常方式に近づくこととなる。
Also, when a DSP having a function capable of simultaneously executing a shift operation process and a multiplication process in one clock is used, a preshift operation process (preshift unit 30) for a second-order term and a multiplication process in the
このようなDSPを用いた場合の演算処理を回路的な表現で記載したものを図13に示す。
この図13に示した構成では、シフト演算器31〜36と、乗算器41〜49と、加算器71〜78と、シフト演算器60Lにより演算処理が行われている。
FIG. 13 shows the arithmetic processing in the case of using such a DSP in a circuit expression.
In the configuration shown in FIG. 13, arithmetic processing is performed by
図13に示すように、1クロックでシフト演算処理と乗算処理を同時に実行可能な機能を備えるDSPを用いれば、シフト演算器31および乗算器44の処理や、シフト演算器32、乗算器45および加算器71の処理や、シフト演算器36、乗算器49および加算器75の処理が1クロックで実行される。
As shown in FIG. 13, if a DSP having a function capable of simultaneously executing a shift calculation process and a multiplication process in one clock is used, the processes of the
[変形例]
上記実施形態では、説明を簡単にするためにRGB3色の表色系の画像データから2次の項(BB、GG、RR、BG、GR、RB)を算出して色変換のための行列演算を行う場合について説明しているが、3次項以上の多次項を算出して色変換を行うような場合にも本発明は同様に適用可能である。
[Modification]
In the above-described embodiment, in order to simplify the description, a quadratic term (BB, GG, RR, BG, GR, RB) is calculated from the RGB three-color color system image data, and matrix calculation for color conversion is performed. However, the present invention is also applicable to a case where color conversion is performed by calculating a third-order term or higher order term.
例えば入力画像データがRGB表色系の画像データの場合、3次の項として、BBB、GGG、RRR、BBR、BBG、GGB、GGR、RRB、RRG、BGRという10の項を算出して上記で説明した2次の項、各色成分の値とともに行列演算を行うことにより色変換処理を実現することが可能である。 For example, when the input image data is RGB color system image data, 10 terms of BBB, GGG, RRR, BBR, BBG, GGB, GGR, RRB, RRG, BGR are calculated as the third-order terms. It is possible to realize color conversion processing by performing a matrix operation together with the second-order term and the value of each color component described.
この場合、図10に示した構成において、2次項生成部20を、複数の色成分により表現された表色系の画像データに対して複数の色成分の組み合わせを乗算して得られる多次項の値を複数算出する多次項生成部に置き換えれば良い。そして、プリシフト部30では、算出された複数の多次項の値を、それぞれ予め設定されたビット数だけシフトするようにすれば良い。
In this case, in the configuration shown in FIG. 10, the secondary
さらに、このような構成において、プリシフト部30では、多次項の次数に応じたビット数だけ複数の多次項の値をシフトするようにしても良い。つまり、多次項の次数毎にシフト演算を行うシフト量を設定するようにしても良い。
Further, in such a configuration, the
また、上記実施形態では、RGBの色空間とL*a*b*の色空間との間の3入力3出力の色変換(3色の色成分を3色の色成分に変換する色変換)を行う場合を用いて説明したが、本発明はこれに限定されるものではなく、RGB、CMY、CMYK、L*a*b*、YCbCr、XYZ等の他の色空間を含めた複数の色空間のうちの任意の2つの色空間の間で色変換を行う場合でも同様に本発明を適用することができるものである。 Further, in the above-described embodiment, 3-input 3-output color conversion between the RGB color space and the L * a * b * color space (color conversion for converting three color components into three color components). However, the present invention is not limited to this, and a plurality of colors including other color spaces such as RGB, CMY, CMYK, L * a * b *, YCbCr, and XYZ. The present invention can be similarly applied even when color conversion is performed between any two color spaces in the space.
しかし、例えば3入力4出力の色変換を行う場合には、4色目の出力を得るために、図1に示した変換係数に対してC41〜C49という新たな変換係数が必要となる。 However, for example, when performing 3-input 4-output color conversion, new conversion coefficients C41 to C49 are required for the conversion coefficients shown in FIG.
また、4入力3出力の色変換を行う場合には、入力項の数が4色目の値の項、4色目の自乗項、4色目と他の3色との組み合わせの項だけ増加する。例えば、CMYKを入力とする場合には、C、M、Y、K、C×C、M×M、Y×Y、K×K、C×M、M×Y、Y×C、K×C、K×M、K×Yという14の項が入力項となる。また、入力項の数が増えたことにより、増えた入力項に対応する変換係数も必要となる。 When performing color conversion with four inputs and three outputs, the number of input terms increases by the value of the fourth color, the square of the fourth color, and the term of the combination of the fourth color and the other three colors. For example, when CMYK is input, C, M, Y, K, C × C, M × M, Y × Y, K × K, C × M, M × Y, Y × C, K × C , K × M, and K × Y are 14 terms. Further, as the number of input terms increases, conversion coefficients corresponding to the increased input terms are also required.
また、CMYKの色空間からC’M’Y’K’の色空間への色変換のような4入力4出力の色変換を行う場合には、上記の2つの場合を組み合わせれば実現可能である。 Further, when performing 4-input 4-output color conversion such as color conversion from the CMYK color space to the C′M′Y′K ′ color space, it can be realized by combining the above two cases. is there.
11 DSP
12 メモリ
13 ROM
20 2次項生成部
30 プリシフト部
31〜36 シフト演算器
40L、40a、40b 乗算部
41〜49 乗算器
50L、50a、50b 加算器
60L、60a、60b シフト演算器
71〜78 加算器
81 2次項生成部
82〜84 演算器
91〜99 乗算器
101〜109 シフト演算器
110 加算器
120 シフト演算器
11 DSP
12
20 Second-
Claims (5)
前記算出手段により算出された複数の多次項の値を、それぞれ予め設定されたビット数だけシフトする複数の第1のシフト手段と、
入力された前記複数の色成分の値および前記第1のシフト手段によりシフトされた後の値に対して、予め設定された複数の変換係数を、第2の表色系の各色成分毎にそれぞれ乗算する複数の乗算手段と、
前記複数の乗算手段により変換係数が乗算された後の値を、第2の表色系の各色成分毎にそれぞれ加算する複数の加算手段と、
前記複数の加算手段により加算された値をそれぞれ予め設定されたビット数だけシフトして、第2の表色系の画像データの各色成分の値として出力する複数の第2のシフト手段と、
を備えた画像処理装置。 Calculating means for calculating a plurality of values of multi-order terms obtained by multiplying a combination of a plurality of color components with respect to the first color system image data expressed by the plurality of input color components;
A plurality of first shift means for shifting the values of a plurality of multi-order terms calculated by the calculation means by a preset number of bits;
A plurality of preset conversion coefficients are set for each color component of the second color system for the input values of the plurality of color components and the values after being shifted by the first shift means. A plurality of multiplication means for multiplying;
A plurality of addition means for adding the values after the conversion coefficients are multiplied by the plurality of multiplication means for each color component of the second color system;
A plurality of second shift means for shifting the values added by the plurality of addition means by a predetermined number of bits and outputting the values as the values of the respective color components of the second color system image data;
An image processing apparatus.
算出された複数の多次項の値を、それぞれ予め設定されたビット数だけシフトするシフトステップと、
入力された前記複数の色成分の値および前記シフトステップによりシフトされた後の値に対して、予め設定された複数の変換係数を、第2の表色系の各色成分毎にそれぞれ乗算するステップと、
変換係数が乗算された後の値を、第2の表色系の各色成分毎にそれぞれ加算するステップと、
各色成分毎に加算された値をそれぞれ予め設定されたビット数だけシフトして、第2の表色系の画像データの各色成分の値として出力するステップとをコンピュータに実行させるためのプログラム。 Calculating a plurality of values of multi-order terms obtained by multiplying image data of the first color system expressed by a plurality of input color components by a combination of a plurality of color components;
A shift step for shifting the calculated values of the multiple-order terms by a preset number of bits,
For values after being shifted by the value and the previous carboxymethyl shift steps of the input of the plurality of color components, a plurality of conversion coefficients set in advance, respectively multiplying each color component of the second color system And steps to
Adding the value after the multiplication by the conversion coefficient for each color component of the second color system;
A program for causing a computer to execute a step of shifting a value added for each color component by a predetermined number of bits and outputting the value as a value of each color component of second color system image data.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2011051489A JP5757108B2 (en) | 2011-03-09 | 2011-03-09 | Image processing apparatus and program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2011051489A JP5757108B2 (en) | 2011-03-09 | 2011-03-09 | Image processing apparatus and program |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2012191316A JP2012191316A (en) | 2012-10-04 |
| JP5757108B2 true JP5757108B2 (en) | 2015-07-29 |
Family
ID=47084029
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2011051489A Expired - Fee Related JP5757108B2 (en) | 2011-03-09 | 2011-03-09 | Image processing apparatus and program |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP5757108B2 (en) |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2000183753A (en) * | 1998-12-17 | 2000-06-30 | Sony Corp | Signal conversion device and signal conversion method |
| JP4023267B2 (en) * | 2002-09-12 | 2007-12-19 | 村田機械株式会社 | Color image processing apparatus and color image processing method |
| JP4250493B2 (en) * | 2003-10-01 | 2009-04-08 | キヤノン株式会社 | Color conversion matrix generation method, color conversion table creation method and program |
| JP2009033341A (en) * | 2007-07-25 | 2009-02-12 | Fuji Xerox Co Ltd | Image processing device, image forming apparatus and image processing method |
-
2011
- 2011-03-09 JP JP2011051489A patent/JP5757108B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2012191316A (en) | 2012-10-04 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP4790791B2 (en) | Multiplier, digital filter, signal processing device, synthesis device, synthesis program, and synthesis program recording medium | |
| JP5640081B2 (en) | Integer and multiply-add operations with saturation | |
| KR20040039470A (en) | Split multiplier for efficient mixed-precision dsp | |
| US9164728B1 (en) | Ternary DSP block | |
| Haritha et al. | Design of an enhanced array based approximate arithmetic computing model for multipliers and squarers | |
| JP5757108B2 (en) | Image processing apparatus and program | |
| JP2006172035A (en) | Divide and square root calculator | |
| JPWO2008018197A1 (en) | Digital filter, synthesizing apparatus thereof, synthesizing program, and synthesizing program recording medium | |
| Al-Khaleel et al. | Fast and compact binary-to-BCD conversion circuits for decimal multiplication | |
| JP2019121171A5 (en) | ||
| US7043517B2 (en) | Multiply accumulator for two N bit multipliers and an M bit addend | |
| WO2011036746A1 (en) | Calculation device | |
| KR102338863B1 (en) | Apparatus and method for controlling operation | |
| US6230178B1 (en) | Method for the production of an error correction parameter associated with the implementation of a modular operation according to the Montgomery method | |
| JP4856445B2 (en) | Image composition apparatus and image composition method therefor | |
| CN105656450B (en) | The digital low-pass filtering method and device of integer arithmetic | |
| US7890564B2 (en) | Interpolation FIR filter and method thereof | |
| JP2002344757A (en) | Color interpolation method and color interpolation apparatus | |
| JP2011180966A (en) | Product-sum computing unit | |
| US9069624B1 (en) | Systems and methods for DSP block enhancement | |
| Dave et al. | Multiplication by complements | |
| JPH09172554A (en) | Color lookup table | |
| JPH02114324A (en) | Multiplier | |
| JP4954019B2 (en) | Arithmetic unit | |
| JPH09153130A (en) | Color conversion method and device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20140218 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20141208 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20141211 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20150206 |
|
| TRDD | Decision of grant or rejection written | ||
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20150507 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20150520 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 5757108 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| S533 | Written request for registration of change of name |
Free format text: JAPANESE INTERMEDIATE CODE: R313533 |
|
| R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
| LAPS | Cancellation because of no payment of annual fees |