JP2005252392A - Image processing apparatus and method therefor, computer program and computer-readable storage medium - Google Patents

Image processing apparatus and method therefor, computer program and computer-readable storage medium Download PDF

Info

Publication number
JP2005252392A
JP2005252392A JP2004056668A JP2004056668A JP2005252392A JP 2005252392 A JP2005252392 A JP 2005252392A JP 2004056668 A JP2004056668 A JP 2004056668A JP 2004056668 A JP2004056668 A JP 2004056668A JP 2005252392 A JP2005252392 A JP 2005252392A
Authority
JP
Japan
Prior art keywords
color space
image data
correction
image
corrected
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.)
Withdrawn
Application number
JP2004056668A
Other languages
Japanese (ja)
Inventor
Yasuo Fukuda
康男 福田
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2004056668A priority Critical patent/JP2005252392A/en
Publication of JP2005252392A publication Critical patent/JP2005252392A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

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

Abstract

<P>PROBLEM TO BE SOLVED: To obtain a satisfactory color image, by preventing the entire image from becoming unnatural in correcting constituents for deciding the colors of the image, such as brightness. <P>SOLUTION: Target pixel data are converted into pixel values of an RGB space, a first color space (S202), and is converted in accordance with instructed brightness parameter (S203). Also, the target pixel data are converted into pixel values of a color space of YCbCr, a second color space (S205), and corrected in accordance with a instructed brightness parameter (S206). Then, each of the corrected pixel data are set as the same color space (S207), and then composited (S208). <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明はデジタル画像処理、特にデジタル画像の明るさ等の色を決定する要素に関する補正技術に関するものである。   The present invention relates to digital image processing, and more particularly to a correction technique related to an element that determines a color such as brightness of a digital image.

イメージスキャナでカラー写真や透過原稿(フィルム等)を読取る際、一般に、パーソナルコンピュータ上で各種パラメータを設定した上で読取っている。このパラメータの中には明るさに関するパラメータも含まれる。明るさのパラメータは、人間にとって理解し易い形態で明暗の度合をGUI画面にてスライダーバー等を操作するもの、数値で設定するものなどがある。
また、画像の自動補正などにおいて、画像の明るさの度合いに応じた補正条件を用いて補正するものがある(特許文献1)。
特開平3−278957号公報
When a color photograph or a transparent original (film or the like) is read by an image scanner, the reading is generally performed after setting various parameters on a personal computer. This parameter includes a parameter related to brightness. Brightness parameters include those that operate a slider bar or the like on the GUI screen, and numerical values that set the degree of lightness and darkness in a form that is easy for humans to understand.
In addition, there is an automatic correction of an image using a correction condition corresponding to the degree of image brightness (Patent Document 1).
JP-A-3-278957

ところで、イメージスキャナから出力されるデータはR、G、B空間のデジタルデータであり、設定された明るさの度合に応じて各色成分毎にγ変換を施すことになる。ところが、明るさの度合を強くした場合、画像全体の色みが強くなりすぎるという現象が発生する。   By the way, data output from the image scanner is digital data in R, G, and B spaces, and γ conversion is performed for each color component in accordance with the set brightness level. However, when the degree of brightness is increased, a phenomenon occurs in which the color of the entire image becomes too strong.

そこで、RGB色空間から比較的簡便に変換できるYCbCr色空間に各画素値を変換し、その中のY成分(輝度成分)についてのみ、指定されたパラメータに従って補正を行い、最後にRGB画像を得る方法が考えられる。しかしながら、YCbCr色空間でY成分を明るく設定すればするほど、画像全体の色みが失われていく現象が発生する。   Therefore, each pixel value is converted from the RGB color space to a YCbCr color space that can be converted relatively easily, and only the Y component (luminance component) is corrected according to the designated parameters, and finally an RGB image is obtained. A method is conceivable. However, the brighter the Y component is set in the YCbCr color space, the more the color of the entire image is lost.

本発明はかかる問題点に鑑みされたものであり、明るさ等の画像の色を決定する要素についての補正を行う際に、画像全体が不自然になることを抑制し、良好なカラー画像を得る技術を提供しようとするものである。   The present invention has been made in view of such a problem, and when performing correction for an element that determines the color of an image such as brightness, the entire image is suppressed from becoming unnatural, and a good color image is obtained. It is intended to provide the technology to obtain.

画像データの色を決定する複数の要素中の1つの要素について補正する画像処理装置であって、
補正対象の要素を変更した場合に他の要素に関する少なくとも1つの画質に与える影響方向が異なる第1、第2の色空間それぞれの画像データを、補正対象とする画像データから変換して得る色空間変換手段と、
該色空間変換手段で得られた第1の色空間の第1の画像データと、第2の色空間の第2の画像データそれぞれに対して前記補正対象の要素の変更を反映させて、補正済第1の画像データと補正済第2の画像データを得る画像補正手段と、
前記補正済第1の画像データと前記補正済第2の画像データそれぞれの色空間を同一色空間にし、所定比率で合成する合成手段とを備える。
An image processing apparatus that corrects one element among a plurality of elements that determine the color of image data,
Color space obtained by converting the image data of each of the first and second color spaces having different influence directions on at least one image quality related to other elements when the correction target element is changed from the image data to be corrected Conversion means;
The correction of the correction target element is reflected on each of the first image data of the first color space obtained by the color space conversion means and the second image data of the second color space. Image correction means for obtaining first image data and corrected second image data;
Combining means for combining the corrected first image data and the corrected second image data into the same color space and combining them at a predetermined ratio.

本発明によれば、明るさ等の画像の色を決定する要素についての補正を行う際に、画像全体が不自然になることを抑制し、良好なカラー画像を得ることが可能になる。   According to the present invention, when correcting an element that determines the color of an image such as brightness, it is possible to suppress the entire image from becoming unnatural and obtain a good color image.

以下、添付図面に従って本発明に係る実施形態を詳細に説明する。   Hereinafter, embodiments according to the present invention will be described in detail with reference to the accompanying drawings.

<第1の実施形態>
図中、101は装置全体の制御を司るCPUであり、102はBIOSやブートプログラムを記憶するROM、103はCPU101のワークエリアとして使用されるRAMである。104はキーボード、ポインティングデバイス(マウス(登録商標)、トラックボール、トラックパッド、タブレット等)で構成される入力部である。なお、キーボードは物理的なキーボードとするが、画面上に表示するソフトウェアキーボードやボタン群、モードダイヤルでも構わない。105はハードディスク等の大容量の外部記憶装置であり、ここにはOSや実施形態で説明するプログラムや各種アプリケーション、並びに処理した画像ファイル等を記憶する。
<First Embodiment>
In the figure, 101 is a CPU that controls the entire apparatus, 102 is a ROM that stores a BIOS and a boot program, and 103 is a RAM that is used as a work area of the CPU 101. An input unit 104 includes a keyboard and a pointing device (such as a mouse (registered trademark), a trackball, a trackpad, and a tablet). The keyboard is a physical keyboard, but may be a software keyboard, a button group, or a mode dial displayed on the screen. Reference numeral 105 denotes a large-capacity external storage device such as a hard disk, which stores the OS, programs described in the embodiments, various applications, processed image files, and the like.

106は機器間通信を行う通信部であって、イーサネット(登録商標)インタフェース、USB、IEEE1284、IEEE1394、電話回線などの有線による通信方式であってもよいし、あるいは赤外線(IrDA)、IEEE802.11a, IEEE802.11b, IEEE802.11g, Bluetooth, UWB(Ultra Wide Band)等の無線通信方式であっても良い。   A communication unit 106 performs communication between devices, and may be a wired communication system such as an Ethernet (registered trademark) interface, USB, IEEE1284, IEEE1394, a telephone line, or infrared (IrDA), IEEE802.11a. , IEEE802.11b, IEEE802.11g, Bluetooth, UWB (Ultra Wide Band), etc. may be used.

107はビデオメモリとそのビデオへの描画処理するコントローラ、更には、ビデオメモリに描画された画像データをビデオ信号として表示部108に出力する表示制御部である。表示部108としては、CRT装置、液晶表示装置等が挙げられる。   Reference numeral 107 denotes a video memory and a controller that performs drawing processing on the video, and a display control unit that outputs image data drawn in the video memory to the display unit 108 as a video signal. Examples of the display unit 108 include a CRT device and a liquid crystal display device.

109は画像入力インタフェースであり、画像データ発生源110(イメージスキャナやデジタルカメラ等)からの画像データを入力するためのものである。また、画像データ発生源としては、画像データを記憶した記憶媒体(CDROM、DVD、メモリカード等)でも構わない。この場合には、画像データ発生源はそれら記憶媒体をアクセスするデバイスとなる。また、画像データはネットワークから受信するようにする場合胃は、通信部106を介して入力することになる。   Reference numeral 109 denotes an image input interface for inputting image data from an image data generation source 110 (such as an image scanner or a digital camera). The image data generation source may be a storage medium (CDROM, DVD, memory card, etc.) that stores image data. In this case, the image data generation source is a device that accesses these storage media. When the image data is received from the network, the stomach is input via the communication unit 106.

本装置に電源が投入されると、CPU101はROM102のブートプログラムに従って処理を開始し、外部記憶装置105からOSをRAM103にロードし、そして、各種アプリケーションプログラムも同装置からRAM103にロードして実行することになる。   When the apparatus is powered on, the CPU 101 starts processing according to the boot program stored in the ROM 102, loads the OS from the external storage device 105 to the RAM 103, and loads various application programs from the apparatus to the RAM 103 for execution. It will be.

本実施形態では、画像データを補正する処理に特徴を有するものであるが、説明を簡単なものとするため、画像データ発生源110はイメージスキャナ、実施形態における画像補正処理プログラムは外部記憶装置105からRAMにロードされるスキャナドライバとして説明する。   The present embodiment is characterized by the process of correcting image data. However, for the sake of simplicity, the image data generation source 110 is an image scanner, and the image correction processing program in the embodiment is an external storage device 105. The scanner driver loaded into the RAM will be described.

本実施形態における画像補正処理プログラムは、入力画像データの色空間がRGB色空間で表わされ、補正を行う色空間(以下、補正色空間とも略記)としてRGB色空間(第一の補正色空間)とYCbCR(以下YCCとも略する)色空間(第二の補正色空間)、第一の補正色空間での補正結果と第二の色補正空間での補正結果を合成する色空間(以下、合成色空間とも略記)をRGB色空間、出力画像データの色空間をRGB色空間として説明を行う。   The image correction processing program according to the present embodiment represents an RGB color space (first correction color space) as a color space (hereinafter also abbreviated as a correction color space) in which the color space of input image data is represented by an RGB color space. ) And YCbCR (hereinafter also abbreviated as YCC) color space (second correction color space), a color space (hereinafter referred to as a color space that combines the correction result in the first correction color space and the correction result in the second color correction space). In the following description, the color space of the output image data is abbreviated as RGB color space.

画像データの補正はγ変換について説明し、RGB色空間では、R,G,B各色成分データに対して独立にγ補正を行い、YCbCr色空間ではY成分のみにγ補正を行う場合を例として説明を行う。また、入出力画像データの画素のR、G、Bの各成分データは8ビット符号なし整数(256階調)として説明するが、R、G、Bの値のビット長さは例えば16ビットの整数値でも良い。或いは、0.0〜1.0の実数値で表現しても構わない。YCbCr色空間の各成分データY、Cb、Crは、後述する色空間変換の式によれば、R、G、Bが整数値であっても、実数となるが、この小数部を丸めて整数化して扱うのであっても良いし、あるいは実数値のまま扱うのであっても良い。   Image data correction will be described with respect to γ conversion. In the RGB color space, R, G, B color component data is independently subjected to γ correction, and in the YCbCr color space, γ correction is performed only on the Y component. Give an explanation. The R, G, and B component data of the pixel of the input / output image data will be described as an 8-bit unsigned integer (256 gradations). The bit length of the R, G, and B values is, for example, 16 bits. It may be an integer value. Or you may express by the real value of 0.0-1.0. Each component data Y, Cb, and Cr in the YCbCr color space is a real number even if R, G, and B are integer values according to a color space conversion formula described later, but this decimal part is rounded to an integer. It may be handled as a digitized value, or it may be handled as a real value.

まずRGB色空間からYCbCr色空間への変換は次の式1の通りである。

Figure 2005252392
First, the conversion from the RGB color space to the YCbCr color space is expressed by the following equation (1).
Figure 2005252392

また、YCbCr色空間からRGB色空間への変換は次の式2の通りである。

Figure 2005252392
Further, the conversion from the YCbCr color space to the RGB color space is represented by the following equation (2).
Figure 2005252392

また、γ補正は、入力値が0〜1.0の実数値で表される場合、次の式3に示すような処理である。式3中の“γ”は、このγ補正処理のパラメータであり、Sinは入力画素値、Soutはγ補正後の画素値である。

Figure 2005252392
Further, the γ correction is a process as shown in the following expression 3 when the input value is expressed by a real value of 0 to 1.0. “Γ” in Equation 3 is a parameter of this γ correction process, Sin is an input pixel value, and Sout is a pixel value after γ correction.
Figure 2005252392

また、入力値が8ビット(0乃至255のいずれかの整数)で表される場合のガンマ補正は、次の式4になる。

Figure 2005252392
Further, gamma correction when the input value is expressed by 8 bits (any integer from 0 to 255) is expressed by the following equation (4).
Figure 2005252392

図2は、このγ補正カーブを示している。図2で、横軸は入力値、縦軸はγ補正後の出力値である。図2に示すように、パラメータγの値が“1”の場合、入力信号値と出力信号値は一致し、γが“1.0”より大きい場合には、中間レベルの信号値が小さくなるように、γが“1.0”より小さい場合には、中間レベルの信号値が大きくなるように補正される。R、G、Bは波長は異なるもののそれぞれの輝度を示し、YCbCrのYは文字通りの輝度成分であるので、これらを入力値とした場合、γ値が“1.0”を越える場合には暗くなる方向に補正され、γ値が“1.0”より小さい場合には明るくなる方向に補正されることになる。
次に、実施形態におけるスキャナドライバの処理を説明する。この処理は、上位の画像編集等のアプリケーションから、原稿読取りが指示された場合に起動するものである。
FIG. 2 shows this γ correction curve. In FIG. 2, the horizontal axis represents input values, and the vertical axis represents output values after γ correction. As shown in FIG. 2, when the value of the parameter γ is “1”, the input signal value matches the output signal value, and when γ is greater than “1.0”, the intermediate level signal value is decreased. , Γ is smaller than “1.0”, the signal value of the intermediate level is corrected so as to increase. R, G, and B indicate the respective luminances with different wavelengths, and Y of YCbCr is a literal luminance component. Therefore, when these are input values, they become dark when the γ value exceeds “1.0”. If the γ value is smaller than “1.0”, the brightness is corrected in a brighter direction.
Next, the processing of the scanner driver in the embodiment will be described. This process is started when a document reading is instructed from a higher-level image editing application.

先ず、ステップS1において、図5に示すようなGUIウインドウ501を表示部108に表示させるべく、表示制御部107に対し、図5に示すようなGUIの描画を行わせる。   First, in step S1, in order to display a GUI window 501 as shown in FIG. 5 on the display unit 108, the display control unit 107 is caused to draw a GUI as shown in FIG.

GUIウインドウ501には、図示に示すように、原稿読取りに関する各種パラメータ領域502、設定するパラメータ項目を表示させるためのスクロール指示部503、並びに、スキャンを中止するキャンセルボタン504、スキャンの開始指示を行うためのスキャンボタン505等の各種コントロールアイテムが設けられている。   In the GUI window 501, as shown in the figure, various parameter areas 502 relating to document reading, a scroll instruction unit 503 for displaying parameter items to be set, a cancel button 504 for canceling scanning, and a scan start instruction are given. Various control items such as a scan button 505 are provided.

設定パラメータには、スキャンモード、解像度、明るさ…が含まれる。この中で、スキャンモードとしては、2値モノクロ、8ビットモノクロ(256階調グレースール)、そして、図示の24ビットカラー多値(R、G、Bそれぞれを256階調で読込むモード)の中から選択できる。明るさは、感覚的なものであるので図示のようにスライダーバー形態で表示した。スライダバーのツマミ位置は初期状態では中央(γ値が“1.0”に相当)に設定される。   Setting parameters include scan mode, resolution, brightness, and so on. Among these, the scan modes include binary monochrome, 8-bit monochrome (256 gradation grayscale), and the illustrated 24-bit color multi-value (mode for reading R, G, and B in 256 gradations). You can choose from. Since the brightness is sensuous, it is displayed in the form of a slider bar as shown in the figure. The slider bar knob position is set to the center (corresponding to a γ value of “1.0”) in the initial state.

図5のGUIウインドウを表示すると、ユーザは、表示中の各コントロールアイテムのいずれかを入力部104を操作して選択や設定等の各種操作を行う。この操作内容をステップS2、S3にて判定することになる。なお、この場合の入力部104の操作は、ポインティングデバイスに連動するカーソルの表示位置変更と、ポインティングデバイスに設けられたボタンの押下(以下、単にクリックという)操作であるものとする。   When the GUI window of FIG. 5 is displayed, the user performs various operations such as selection and setting by operating the input unit 104 for any of the displayed control items. This operation content is determined in steps S2 and S3. Note that the operation of the input unit 104 in this case is assumed to be a change in the display position of a cursor linked to the pointing device and an operation of pressing a button provided on the pointing device (hereinafter simply referred to as a click).

スキャンパラメータを設定する操作を行った場合には、ステップS4にてその設定に応じた表示更新とその際の設定内容を記憶保持する処理を行う。また、キャンセルボタン504がクリックされた場合には本処理を終了する。   When an operation for setting a scan parameter is performed, in step S4, a display update corresponding to the setting and a process for storing and holding the setting content at that time are performed. In addition, when the cancel button 504 is clicked, this processing ends.

さて、スキャンボタン505がクリックされると、処理はステップS5に進んで、直前の操作で設定された各パラメータのうち、画像データ発生源110であるイメージスキャナに送信すべきパラメータとスキャン開始指示コマンドをイメージスキャナに送信する。イメージスキャナに送信したパラメータ以外のパラメータに関する処理は、実施形態におけるスキャナドライバ側で処理することになる。詳細は後述するが、この明るさパラメータによって、補正処理に利用するγ補正パラメータを、スキャナドライバが有するテーブル(実行時はRAM106に格納されることになる)に基づいて決定する。図7はそのテーブルを示している。   When the scan button 505 is clicked, the process proceeds to step S5, and among the parameters set by the previous operation, parameters to be transmitted to the image scanner that is the image data generation source 110 and a scan start instruction command. To the image scanner. Processing related to parameters other than the parameters transmitted to the image scanner is processed on the scanner driver side in the embodiment. As will be described in detail later, a gamma correction parameter to be used for the correction process is determined based on a table (stored in the RAM 106 at the time of execution) of the scanner driver, based on the brightness parameter. FIG. 7 shows the table.

実施形態では、スキャンモードや読取り解像度に関してはイメージスキャナに送信し、明るさについてはスキャナドライバ側で処理するものとする。   In the embodiment, the scan mode and the reading resolution are transmitted to the image scanner, and the brightness is processed on the scanner driver side.

ステップS5による処理の結果、イメージスキャナは原稿の読取りを開始することになる。イメージスキャナ装置には、リニアイメージセンサが固定されていて原稿を搬送するタイプ、イメージセンサを原稿に対して搬送するタイプがあるが、いずれでも構わない。要は、原稿とイメージセンサが相対的に移動するものであればよい。この移動方向を副走査方向、それに直交する方向のリニアイメージセンサの撮像素子が配列方向を主走査方向と言う。   As a result of the processing in step S5, the image scanner starts reading the document. Image scanner apparatuses include a type in which a linear image sensor is fixed and a document is conveyed, and a type in which an image sensor is conveyed with respect to a document. The point is that the document and the image sensor may move relatively. This moving direction is referred to as the sub-scanning direction, and the arrangement direction of the imaging elements of the linear image sensor in the direction orthogonal thereto is referred to as the main scanning direction.

原稿読取り指示を行うと、1ライン単位にR、G、Bデータが送信されてくるので、ステップS6にて、画像データの入力(受信)及び補正処理を行い、ステップS7にて、本スキャナドライバを起動させたアプリケーションに補正後の画像データ(R、G、Bデータ)を出力することになる。   When a document reading instruction is issued, R, G, and B data are transmitted for each line. Therefore, input (reception) and correction processing of image data are performed in step S6, and this scanner driver is processed in step S7. The corrected image data (R, G, B data) will be output to the application that has started up.

次に、図3におけるステップS6の処理の詳細を図4のフローチャートに従って説明する。なお、イメージスキャナからは1ライン単位に読取ったR、G、Bデータが入力されるが、副走査方向の各ラインのデータが入力されるので、入力される画像は2次元画像(2次元マトリクス)として見なして説明する。すなわち、図6に示すように、読取られた画像に対して主走査方向(図示の実線矢印)に1画素単位に読み込み、ラインの終端画素の補正処理が終わると、次ラインの先頭の画素に対する補正を行うこと、最終ラインの終端画素まで行うことになる。また、イメージスキャナから入力された画像データはRAM103に格納されていく。   Next, details of the process of step S6 in FIG. 3 will be described with reference to the flowchart of FIG. Note that R, G, and B data read in units of one line are input from the image scanner, but since the data of each line in the sub-scanning direction is input, the input image is a two-dimensional image (two-dimensional matrix). ). That is, as shown in FIG. 6, when the read image is read in units of one pixel in the main scanning direction (solid arrow in the figure) and the correction processing of the end pixel of the line is completed, Correction is performed up to the last pixel of the final line. The image data input from the image scanner is stored in the RAM 103.

先ず、ステップS201では、補正対象画素の画素値データを読み込む。これは、入力画像の対象画素の格納されているRAM106のアドレスを計算し、該当アドレスから1画素分のデータを読み込む。以下、ここで読み込んだ1画素のデータはR、G、B(各8ビット=0〜255の範囲内の整数値)で構成さるので、以下では、1画素データを(r,g,b)として説明する。   First, in step S201, pixel value data of a correction target pixel is read. This calculates the address of the RAM 106 in which the target pixel of the input image is stored, and reads data for one pixel from the corresponding address. Hereinafter, since the data of one pixel read here is composed of R, G, and B (8 bits each = integer value within a range of 0 to 255), one pixel data is represented by (r, g, b) below. Will be described.

ステップS202では、対象画素データを第1の補正色空間に変換する。本実施形態の場合、入力画像データの色空間と、第1の補正色空間は同じRGB色空間であるので、特に変換する必要はない。このような場合、本ステップS202は省略しても良い。   In step S202, the target pixel data is converted into the first correction color space. In the case of the present embodiment, the color space of the input image data and the first correction color space are the same RGB color space, so there is no need to convert them. In such a case, this step S202 may be omitted.

次いで、ステップS203では、第1の補正色空間で補正を適用する。本実施形態の場合、第1の補正色空間はRGB色空間である。従って注目画素データ(r、g、b)に対して、図7のテーブルで決定されたγ補正パラメータγrgbをγ値とする式4のγ補正処理を行う。γ補正パラメータγrはR成分用、γgはG成分用、γbはB成分用のγ値である。補正後のR、G、Bの各データをr',g',b'とすると、この補正処理では次の式5による補正を行うことになる。

Figure 2005252392
Next, in step S203, correction is applied in the first correction color space. In the present embodiment, the first correction color space is an RGB color space. Therefore, γ correction processing of Expression 4 is performed on the target pixel data (r, g, b) using the γ correction parameters γ r , γ g , γ b determined in the table of FIG. 7 as γ values. The γ correction parameter γ r is for the R component, γ g is for the G component, and γ b is the γ value for the B component. Assuming that the corrected R, G, and B data are r ′, g ′, and b ′, in this correction process, correction according to the following Expression 5 is performed.
Figure 2005252392

なお、この補正処理は、演算によるものであるが、各色成分に対するγ値が決まると、入力値に対する補正の値が一意に決定されるので、設定された明るさパラメータに対応する入出力関係を示すテーブルを用意しておき、そのテーブルを参照して求めても構わない。この場合、演算処理は実質的になくなるので、演算に係る多くのクロックを削減でき、イメージスキャナからの画像データの入力速度(読取り速度と実質的等価)に近づけることが可能となる。
ステップS204では、ステップS203の処理結果である、第1の補正色空間の補正画素データを合成色空間のデータに変換する。本実施形態の場合、第1の補正色空間と合成色空間は同じRGB色空間なので、特に変換する必要はない。このような場合、本ステップS204は省略しても良い。
Note that this correction processing is based on calculation, but when the γ value for each color component is determined, the correction value for the input value is uniquely determined, so the input / output relationship corresponding to the set brightness parameter is It is also possible to prepare the table shown and obtain the table by referring to the table. In this case, since the arithmetic processing is substantially eliminated, it is possible to reduce many clocks related to the arithmetic operation and to approach the input speed (substantially equivalent to the reading speed) of the image data from the image scanner.
In step S204, the correction pixel data in the first correction color space, which is the processing result in step S203, is converted into data in the composite color space. In the case of the present embodiment, the first correction color space and the composite color space are the same RGB color space, so there is no need to convert them. In such a case, this step S204 may be omitted.

続く、ステップS205では、対象画素データ(r、g、b)を第2の補正色空間に変換する。本実施形態における第2の補正色空間はYCbCr色空間であり、入力画素データの色空間はRGB色空間なので、先に示した式1に従って色空間変換を行う。変換して得られたY,Cb,Crの各データを(y,cb,cr)として説明する。y値がYCbCrのY、すなわち輝度値に対応し、cb値、cr値は色差値Cb,Crに対応する。なお、このy、cb、crは小数点以下適当な桁まで有する実数で表わされる。   In step S205, the target pixel data (r, g, b) is converted to the second correction color space. Since the second correction color space in this embodiment is the YCbCr color space and the color space of the input pixel data is the RGB color space, the color space conversion is performed according to the above-described Expression 1. The Y, Cb, and Cr data obtained by the conversion will be described as (y, cb, cr). The y value corresponds to Y of YCbCr, that is, the luminance value, and the cb value and cr value correspond to the color difference values Cb and Cr. The y, cb, and cr are represented by real numbers having an appropriate digit after the decimal point.

なお、ステップS202と同様に、色空間変換が不要な場合、本ステップS205は省略可能であるのは明らかである。   As in step S202, it is obvious that this step S205 can be omitted when color space conversion is not required.

ステップS206では、第2の補正色空間の画素データ(y,cb,cr)のy値を、図7のテーブルで決定されたγ値“γy”を用いて次式6で補正する。補正する対象はyデータである。補正後のY成分の値をy’と表現すると、補正後の画素データは(y’、cb、cr)で表わされる。

Figure 2005252392
In step S206, the y value of the pixel data (y, cb, cr) in the second correction color space is corrected by the following equation 6 using the γ value “γ y ” determined in the table of FIG. The object to be corrected is y data. When the corrected Y component value is expressed as y ′, the corrected pixel data is expressed as (y ′, cb, cr).
Figure 2005252392

ステップS207では、ステップS206の処理結果である、第2の補正色空間の補正後の画素データ(y’、cb,cr)を合成色空間のデータに変換する。本実施形態の場合、第2の補正色空間はYCbCr色空間であり、合成色空間はRGB空間なので、式2に従って色空間変換を行うことになる。この色変換後のデータを以下(r'',g'',b'')で表わす。
以上の結果、イメージスキャナから入力された画素値(r、g、b)に対して、その補正後の画素値(r’、g’、b’)と、画素値(r'',g'',b'')が得られることになる。なお、ステップS204と同様に、色空間変換が不要な場合、本ステップS207は省略可能であるのは明らかである。
In step S207, the pixel data (y ′, cb, cr) after the correction in the second correction color space, which is the processing result in step S206, is converted into data in the combined color space. In the case of the present embodiment, the second correction color space is the YCbCr color space, and the composite color space is the RGB space, so color space conversion is performed according to Equation 2. The data after this color conversion is represented by the following (r ″, g ″, b ″).
As a result, with respect to the pixel values (r, g, b) input from the image scanner, the corrected pixel values (r ′, g ′, b ′) and the pixel values (r ″, g ′). ', B'') is obtained. As in step S204, it is obvious that this step S207 can be omitted when color space conversion is unnecessary.

次のステップS208では、先のステップS204で得られた第1の補正色空間での補正結果を合成色空間に変換したデータと、ステップS207で得られた第2の補正色空間での補正結果を合成色空間に変換したデータとを合成する。本実施形態の場合には、第1の補正色空間での補正結果と第2の補正色空間での補正結果を重み付け平均して算出する。合成後の画素値を(r''',g''',b''')とすると、次の式7により演算する。

Figure 2005252392
In the next step S208, the data obtained by converting the correction result in the first correction color space obtained in the previous step S204 into the composite color space, and the correction result in the second correction color space obtained in step S207. Is combined with the data converted into the composite color space. In the case of this embodiment, the correction result in the first correction color space and the correction result in the second correction color space are calculated by weighted averaging. When the combined pixel value is (r ″ ′, g ′ ″, b ′ ″), the calculation is performed according to the following Expression 7.
Figure 2005252392

ここで、αR、αG、αBは、第1の色空間での補正結果と第2の色空間での補正結果を合成する際のR、G、B各成分の重み付け係数である。実験で確かめたところ、αR=αG=αB=0.5で良好な結果が得られた。
また、本実施形態では重み付け平均によって合成を行ったが、第1の色空間と第2の色空間での補正結果のうち、信号値が大きいほう、もしくは信号値が小さいほうを合成結果とするような変形も容易である。また、αR、αG、αBに相当する設定を、GUIウインドウにて設定するようにしても構わない。
Here, α R , α G , and α B are weighting coefficients of the R, G, and B components when the correction result in the first color space and the correction result in the second color space are combined. As a result of experiments, good results were obtained with αR = αG = αB = 0.5.
In the present embodiment, the synthesis is performed by weighted averaging. However, among the correction results in the first color space and the second color space, the larger signal value or the smaller signal value is used as the synthesis result. Such deformation is also easy. In addition, settings corresponding to α R , α G , and α B may be set in the GUI window.

次に、ステップS209では、ステップS208で合成した画素データ(r''',g''',b''')を出力色空間に変換して、RAM103に確保された出力バッファに出力する。本実施形態では、合成色空間と出力色空間は同じRGB色空間であるので、特に変換は必要ない。したがって、ステップS208の結果である画素データ(r''',g''',b'''を出力バッファに出力する。出力処理は、RAM103でのアドレス位置を計算し、得られたアドレス位置に書き込むことになる。このとき、次の補正対象の画素位置を決定するため、図6に示す方向に移動する。   Next, in step S209, the pixel data (r ′ ″, g ′ ″, b ′ ″) synthesized in step S208 is converted into an output color space and output to an output buffer secured in the RAM 103. In the present embodiment, since the combined color space and the output color space are the same RGB color space, no particular conversion is required. Therefore, the pixel data (r ′ ″, g ′ ″, b ′ ″, which is the result of step S208, is output to the output buffer. The output process calculates the address position in the RAM 103, and the obtained address position. At this time, in order to determine the pixel position to be corrected next, it moves in the direction shown in FIG.

そして、ステップS211にて、画像の最終ラインの最終画素に対する補正が完了したか否かを判断し、否の場合にはステップS201以降の処理を繰り返すことになる。また、全画素に対する処理が完了したと判断した場合には、図3のステップS6の処理を終えることになるから、ステップS7にて上位アプリケーションに補正後のデータを出力することになる。   In step S211, it is determined whether or not the correction for the final pixel of the final line of the image has been completed. If not, the processes in and after step S201 are repeated. If it is determined that the processing for all the pixels has been completed, the processing in step S6 in FIG. 3 is completed, and thus the corrected data is output to the upper application in step S7.

なお、上記では、画像全体の補正処理が終わってから、スキャナドライバの実行指示した上位アプリケーションに補正後のデータを渡すものであったが、補正後のデータが作成されるたびに上位アプリケーションに渡すようにしても構わない。   In the above description, after the correction processing for the entire image is completed, the corrected data is passed to the upper application instructed to be executed by the scanner driver. However, every time corrected data is created, the corrected data is transferred to the upper application. It doesn't matter if you do.

また、本実施形態では、第2の補正色空間であるYCbCr色空間上でY信号のみを補正したが、これは明るさに対する補正のためである。スキャンする際のGUIウインドウにて、色味に関するパラメータを設定しているのであれば、Cb、Crに補正を行うようになる。   In the present embodiment, only the Y signal is corrected in the YCbCr color space that is the second correction color space, but this is for correction of brightness. If parameters relating to color are set in the GUI window when scanning, Cb and Cr are corrected.

また、実施形態では、入力されるRGBが8ビット(符号無し=0乃至255のレンジ)、或いは、それを正規化した0.0〜1.0として説明を行ったが、例えば公知のscRGBのように、負の値や、1.0を超える値をとるような色空間にも容易に適用可能であることは明らかである。   In the embodiment, the description has been made assuming that the input RGB is 8 bits (no sign = 0 to 255), or 0.0 to 1.0 obtained by normalizing the input RGB. It is obvious that the present invention can be easily applied to a color space having a value of 1.0 or a value exceeding 1.0.

また、入力される画像データがRGBに限らず、例えばデジタルカメラで撮像された画像の多くは、YcbCrが多い。このような画像を入力した場合には、復号処理後の第1の色空間は当然YCbCrとして処理されるので、上記実施形態で説明した第1、第2の色空間、合成色空間、出力色空間は適宜変更してもよいことも明らかである。   In addition, input image data is not limited to RGB, and for example, many images captured by a digital camera have a large amount of YcbCr. When such an image is input, the first color space after the decoding process is naturally processed as YCbCr. Therefore, the first and second color spaces, the combined color space, and the output color described in the above embodiment are used. It is clear that the space may be changed as appropriate.

また、実施形態では、特性の異なる2つの色空間の画素データを合成することで、出力画素を決定する例を説明したが、3つ、あるいはそれ以上の色空間のデータを作成した後、共通な色空間にして合成してもよいことも明らかである。要は、RGB色空間とYCbCr色空間のように、明るさ(補正対象要素)を明るくするように補正を行った場合に、それぞれの色空間で他の要素(実施形態では色み(彩度))が強くなるものとそれとは逆に弱くなるような色空間であれば適用可能である。   In the embodiment, the example in which the output pixel is determined by combining pixel data of two color spaces having different characteristics has been described. However, after data of three or more color spaces is created, It is obvious that the color space may be combined. In short, when correction is performed to increase the brightness (element to be corrected), such as the RGB color space and the YCbCr color space, other elements (color saturation (saturation in the embodiment) in each color space are used. It can be applied to any color space in which)) becomes stronger and weaker on the contrary.

また、実施形態では、明るさ調整をγ変換で実現する例を説明したが、これ以外の信号変換処理であっても適用可能であることは言うまでもない。   In the embodiment, the example in which the brightness adjustment is realized by the γ conversion has been described, but it goes without saying that other signal conversion processes can be applied.

また、実施形態では、画像処理のパラメータをユーザが指示するような例で説明したが、パラメータを入力画像全体もしくは部分画像の解析結果より自動的に設定するように構成しても良い。例えば、実施形態のγ変換処理の場合、入力画像全体の平均輝度を算出して、その平均輝度に応じてγ変換のパラメータγを決定するように構成しても良い。この時、必要であれば画像全体を一度蓄積するようにし、蓄積した画像に対して補正を適用するように構成すれば良い。あるいは、公知のスキャナ装置等で実施する場合、一度低解像度で画像読み込み(プレスキャン)を行い、画像読み込み領域等設定してから目的とする解像度で画像を読み込む(本スキャン)ように構成することが可能なので、プレスキャンの画像からパラメータを決定し、そのパラメータを本スキャン画像に対して適用するように構成することも可能である。このような構成は、大量の画像を自動処理するような、対話的な処理を行いにくい、もしくは対話的な処理を減らしたい場合に好適である。平均輝度とγパラメータの対応関係は、予め定めておいてテーブル化して保持しておけば良く、実行時にはそのテーブルを参照するように構成すれば良い。あるいは、算出した平均輝度レベルが予め定めておいた値、例えば0.5(8ビット符号なし整数での表現の場合は128)といった値になるようなγ変換のγパラメータを逆に計算し、その計算の結果得られたγパラメータに応じて処理を行うように構成することも可能である。いずれにせよ、本発明は2つの色空間での補正結果を合成することが主眼であって、補正パラメータの与え方には様々な変形があって良い。   In the embodiment, the example in which the user instructs the image processing parameter has been described. However, the parameter may be automatically set based on the analysis result of the entire input image or the partial image. For example, in the case of the γ conversion process of the embodiment, the average luminance of the entire input image may be calculated, and the γ conversion parameter γ may be determined according to the average luminance. At this time, if necessary, the entire image may be accumulated once, and the correction may be applied to the accumulated image. Alternatively, when implemented with a known scanner device, etc., it is configured to read an image at a low resolution (pre-scan) once, set an image reading area, etc., and then read an image at a target resolution (main scan). Therefore, it is possible to determine a parameter from the pre-scan image and apply the parameter to the main-scan image. Such a configuration is suitable when it is difficult to perform interactive processing such as automatically processing a large amount of images or when it is desired to reduce interactive processing. The correspondence relationship between the average luminance and the γ parameter may be determined in advance and stored in a table, and the table may be referred to at the time of execution. Alternatively, the γ parameter of γ conversion is calculated in reverse so that the calculated average luminance level becomes a predetermined value, for example, 0.5 (128 in the case of 8-bit unsigned integer expression), and the calculation is performed. It is also possible to configure to perform processing according to the γ parameter obtained as a result of the above. In any case, the present invention mainly focuses on combining the correction results in the two color spaces, and there may be various modifications in the way of providing the correction parameters.

更に、実施形態で説明したように、画像データを入力したり、保存する構成を必要とするものの、それらと協動処理するパーソナルコンピュータ等の汎用情報処理装置上で実行されるコンピュータプログラムで実現可能であるから、本発明はコンピュータプログラムをその範疇とする。また、通常、コンピュータプログラムはCDROM等のコンピュータ可読記憶媒体をコンピュータにセットし、システムにコピーもしくはインストールすることで実行可能となるわけであるから、当然、このようなコンピュータ可読記憶媒体も本発明の範疇になる。   Furthermore, as described in the embodiment, although it requires a configuration for inputting and storing image data, it can be realized by a computer program executed on a general-purpose information processing apparatus such as a personal computer that cooperates with them. Therefore, the present invention falls within the category of computer programs. In general, a computer program can be executed by setting a computer-readable storage medium such as a CDROM in a computer and copying or installing the computer program in a system. Of course, such a computer-readable storage medium is also of the present invention. Become a category.

以上説明したように、本実施形態によれば、画像補正の際に第一の色空間で行った補正結果と第二の色空間で行った補正結果を合成することにより、好適な補正結果を得ることができる。   As described above, according to the present embodiment, a suitable correction result is obtained by combining the correction result performed in the first color space and the correction result performed in the second color space at the time of image correction. Can be obtained.

<変形例>
上記実施形態では、第1の補正色空間および第2の補正色空間に実際に画素値データを変換したが、RGB色空間と、それに対して線形変換である行列演算を行って得られるYCbCr色空間のみを用いるような場合には、実際にYCbCr色空間に変換しなくても処理を行うことが可能である。
<Modification>
In the above embodiment, the pixel value data is actually converted into the first correction color space and the second correction color space. When only the space is used, the processing can be performed without actually converting to the YCbCr color space.

今、あるRGBデータ(r1、g1、b1)からYCbCr色空間のデータ(y1、cb1、cr1)を得て、データy1をy2に変換した結果を再びRGB空間のデータ(r2、g2、b2)にする場合を考察する。ここで、「y2−y1」をdyとすると、y2=y1+dyとなる。   Now, YCbCr color space data (y1, cb1, cr1) is obtained from certain RGB data (r1, g1, b1), and the result of converting data y1 to y2 is again RGB space data (r2, g2, b2). Consider the case. Here, when “y2−y1” is dy, y2 = y1 + dy.

従って、式2に(r2、g2、b2)と、y2=y1+dyを代入して整理すると、次の式8が得られる。

Figure 2005252392
Therefore, when (r2, g2, b2) and y2 = y1 + dy are substituted into Equation 2 and rearranged, the following Equation 8 is obtained.
Figure 2005252392

上記のように、RGB色空間の画素データをYCbCr色空間に変換してYの値を変更して再びRGB色空間に戻す処理は、Yの変分を計算し、それを元のRGBの各成分に足すことと等価であることがわかる。
したがって、実際にRGBよりYCbCrに変換するのではなく、元データのRGB画素値より、YCbCr色空間におけるY成分のみを算出し、そのY成分にγ補正を施した後の変分値を計算すれば、演算量は少なくできることになり、ソフトウェア(コンピュータプログラム)で実現する場合には、その処理を高速なものとすることができる。
As described above, the process of converting the pixel data in the RGB color space to the YCbCr color space, changing the value of Y, and returning it to the RGB color space again calculates the variation of Y and converts it to each of the original RGB It turns out that it is equivalent to adding to a component.
Therefore, instead of actually converting from RGB to YCbCr, only the Y component in the YCbCr color space is calculated from the RGB pixel value of the original data, and the variation value after the γ correction is applied to the Y component is calculated. For example, the amount of calculation can be reduced, and when implemented by software (computer program), the processing can be performed at high speed.

上記の処理を実現する場合の処理を図8のフローチャートに従って説明する。同図は図4に代わるものでもあるので、同じ処理を行う工程には同符号を付与し、その説明を省略する。   Processing for realizing the above processing will be described with reference to the flowchart of FIG. Since this figure is also a substitute for FIG. 4, the same reference numerals are given to the steps for performing the same processing, and the description thereof is omitted.

先ず、ステップS501において、ステップS201同様に対象データのRGBの画素値を読み込む。   First, in step S501, the RGB pixel values of the target data are read as in step S201.

ステップS502では、ステップS203で説明したように、RGB色空間での補正処理を行う。なお、図4のステップS202、S204は、第1の実施形態で説明したように、本実施形態では色空間変換が不要なので、図8では省略してある。   In step S502, as described in step S203, correction processing in the RGB color space is performed. As described in the first embodiment, steps S202 and S204 in FIG. 4 are omitted in FIG. 8 because color space conversion is not necessary in this embodiment.

続くステップS503では、第1の実施形態とは異なり、YCbCr色空間での補正による、y値の変分dyを算出する。   In the subsequent step S503, unlike the first embodiment, a variation dy of the y value is calculated by correction in the YCbCr color space.

この処理では、先ず、y値を算出する。これには、式1におけるCb、Crについて演算は不要であり、以下の式9に(r,g,b)を代入し、y値を算出すれば良い。
y=0.299×r+0.5870×g+0.1140×b …式9
続いて、式6により、γ補正後のy’を算出する。これは既に第1の実施形態で説明したので割愛する。次に、輝度差分値dy=y'−yを計算する。これは、求めたy'からyを単純に減じればよい。
In this process, first, the y value is calculated. For this, no calculation is required for Cb and Cr in Equation 1, and (r, g, b) may be substituted into Equation 9 below to calculate the y value.
y = 0.299 × r + 0.5870 × g + 0.1140 × b Equation 9
Subsequently, y ′ after γ correction is calculated by Equation 6. Since this has already been described in the first embodiment, it is omitted. Next, the luminance difference value dy = y′−y is calculated. This can be done by simply subtracting y from the obtained y ′.

第1の実施形態において、γ変換を予めルックアップテーブル化することについて言及したが、このdyもγ値が定まった後にはyの値により一意に決定するので、予め0〜255の場合についてdyを算出しておきルックアップテーブル化することも可能である。   In the first embodiment, the γ conversion is referred to as a look-up table in advance. However, since dy is also uniquely determined by the value of y after the γ value is determined, dy is previously determined for the case of 0 to 255. It is also possible to calculate and to create a lookup table.

続くステップS505では、YCbCr空間での補正結果のRGB色空間に変換する。そして変換して得られたデータを、元のRGB画素値とステップS504で求めたdyより算出する。これは、先に説明したように、式8において、(r2、g2、b2)を(r''、g''、b'')とし、(r1、g1、b1)を(r'、g'、b')とすれば求めることができる。   In the subsequent step S505, the RGB color space of the correction result in the YCbCr space is converted. Then, the data obtained by the conversion is calculated from the original RGB pixel value and dy obtained in step S504. As described above, in Expression 8, (r2, g2, b2) is set to (r ″, g ″, b ″), and (r1, g1, b1) is set to (r ′, g1). ', B').

以上、RGB色空間と、それに対して線形変換である行列演算を行って得られるYCbCr色空間のみを用いるような場合には、実際にYCbCr色空間の全データに変換しなくても処理を行う変形例を示した。この場合、第1の実施形態で説明した場合に比べ計算量を削減できるので処理の高速化が望めるという利得がある。   As described above, in the case where only the RGB color space and the YCbCr color space obtained by performing the matrix operation that is linear conversion on the RGB color space are used, the processing is performed without actually converting all the data in the YCbCr color space. A modification is shown. In this case, since the amount of calculation can be reduced compared to the case described in the first embodiment, there is a gain that the processing can be speeded up.

また、本実施形態はRGB色空間上で処理を行う例を示したが、RGB色空間とYCbCr色空間は線形変換の関係にあるので、逆にYCbCr空間上で行うような変形も可能である。   In the present embodiment, an example is shown in which processing is performed in the RGB color space. However, since the RGB color space and the YCbCr color space are in a linear transformation relationship, it is possible to perform a modification such that the processing is performed in the YCbCr space. .

また、実施形態ではRGB色空間とYCbCr色空間を例にしたが、他の色空間であっても同様な関係、すなわち、明るさ等の画像調整対象パラメータを変更した場合、第1の色空間と第2の色空間では相反するような画質になる関係にある場合に適用可能である。   In the embodiment, the RGB color space and the YCbCr color space are taken as an example. However, even in other color spaces, the same relationship, that is, when the image adjustment target parameter such as brightness is changed, the first color space. And the second color space can be applied when the image quality is in a contradictory relationship.

<第2の実施形態>
上記第1の実施形態並びにその変形例は、ホストコンピュータ等で実行されるイメージスキャナドライバを例にした。また、合成係数αR、αG、αBもGUIウインドウにて設定するようにしても良い点についても言及した。従って、アプリケーションを利用しているユーザにとっては、編集対象の読み取り画像を表示した際には、そこには最適な画像が表示されることとが可能となる。
<Second Embodiment>
In the first embodiment and the modifications thereof, an image scanner driver executed by a host computer or the like is taken as an example. Also, it has been mentioned that the synthesis coefficients α R , α G , α B may also be set in the GUI window. Therefore, when a read image to be edited is displayed for a user who uses the application, an optimum image can be displayed there.

しかし、スキャナで読取った無加工の画像データを、インタラクティブ(対話形式)に明るさ等を画調に関する編集を行い、故意に明るさを強調もしくは暗目にしたいという要望があるかもしれない。   However, there may be a desire to intentionally enhance or darken the brightness of the raw image data read by the scanner by interactively editing the brightness etc. with respect to the image quality.

本第2の実施形態では、このような要望に応えるためのアプリケーションプログラムにつて説明する。なお、本第2の実施形態でも、編集対象の画像は、スキャナで読取る場合には、スキャナドライバを介在させることになるが、この場合のスキャナドライバは通常のそれと同様で、無加工もしくはそれに近い画像データをアプリケーションに渡すものとする。また、第2の実施形態での処理はアプリケーションプログラムであるので、編集対象の画像ファイルは、デジタルカメラで撮像された画像ファイルでも良いことになる点に注意されたい。   In the second embodiment, an application program for responding to such a request will be described. Even in the second embodiment, when an image to be edited is read by a scanner, a scanner driver is interposed. In this case, the scanner driver is the same as a normal one, and is not processed or close to it. Assume that image data is passed to the application. It should be noted that since the processing in the second embodiment is an application program, the image file to be edited may be an image file captured by a digital camera.

説明を簡単なものとするため、ここではデジタルカメラで撮像した画像(JPEGファイル)の明るさ補正を行う場合について説明する。装置構成は、図1と同じものとする。   In order to simplify the description, here, a case will be described in which the brightness of an image (JPEG file) captured by a digital camera is corrected. The apparatus configuration is the same as in FIG.

前提としてJPEGファイルの色空間はYCbCrとする。また、表示装置は一般的なRGBの各輝度成分にしたがって表示するものとする。従って、JPEGファイルをデコードする際には、図4におけるステップS202の処理を行うことと等価となる。また、表示装置がRGBであるので、合成色空間はRGBであると都合が良い。更に、最終的にユーザは明るさ補正を行った画像を保存する際に、そのファイル形式を指定することになるので、出力色空間への変換、すなわち、図4でのステップS210はその際の保存形式で決定されることになる。   As a premise, the color space of the JPEG file is YCbCr. The display device displays according to general luminance components of RGB. Therefore, when decoding a JPEG file, this is equivalent to performing the process of step S202 in FIG. Further, since the display device is RGB, it is convenient that the composite color space is RGB. Furthermore, since the user finally designates the file format when saving the brightness-corrected image, conversion to the output color space, that is, step S210 in FIG. It will be determined by the storage format.

図9は第2の実施形態における画像編集アプリケーションにおける編集ウインドウを示している。   FIG. 9 shows an editing window in the image editing application in the second embodiment.

図示において、901は編集対象の画像を指定するためのファイル指定コントロールである。図示に示すように、ファイルをパス付きでキーボードより入力するものとするが、右端にある▽印をクリックすることで、ファイル選択のためのダイアログボックスを表示して、ポインティングデバイスで編集対象のファイルを選択しても構わない。902は選択した画像ファイルを表示するオリジナル画像表示エリアである。   In the figure, reference numeral 901 denotes a file designation control for designating an image to be edited. As shown in the figure, it is assumed that the file is input from the keyboard with a path, but clicking the ▽ mark at the right end displays a dialog box for file selection, and the file to be edited with the pointing device You may choose. Reference numeral 902 denotes an original image display area for displaying the selected image file.

903はRGB空間での明るさ調整用エリアであり、図示に示すようにR、G、B各成分毎にγ値を調整するスライダバー903(初期値は中央位置にツマミが位置するので、各γ値は“1.0”)が設けられている。また、図示の「連動」チェックボックス903bをチェックすると、1つの色成分のスライダバーを左右に移動させると、他の色成分のスライダーバーも同位置に移動する。そして、γ補正後の画像をリアルタイムに表示する画像表示エリア903cと、その結果を保存したい場合にクリックする保存ボタン903dを備える。   Reference numeral 903 denotes a brightness adjustment area in the RGB space. As shown in the figure, a slider bar 903 for adjusting the γ value for each of the R, G, and B components (the initial value has a knob at the center position. The γ value is “1.0”). If the “linked” check box 903b shown in the figure is checked, when the slider bar for one color component is moved to the left or right, the slider bar for the other color component is also moved to the same position. An image display area 903c for displaying the image after γ correction in real time and a save button 903d to be clicked when the result is to be saved are provided.

904はYCbCr空間でのY成分についての明るさ調整用エリアであり、Y成分についてのスライダーバー904a(初期状態ではツマミ位置が中央にあり、γ値は“1.0”),調整後の画像をリアルタイムに表示する画像表示エリア904c、及び保存ボタン904dを備える。   904 is a brightness adjustment area for the Y component in the YCbCr space. The slider bar 904a for the Y component (the knob position is at the center and the γ value is “1.0” in the initial state), and the adjusted image is real-time. An image display area 904c and a save button 904d.

905は合成画像結果を表示する合成画像調整エリアであり、合成係数αR、αG、αBそれぞれをRGB空間での補正結果と、YCbCr空間での補正結果とのどちらよりにするかを指定するスライダーバー905aを備える。スライダーバーのツマミが中央位置にあるとき、第1の実施形態で説明した状態になる。また、リアルタイムに合成結果を表示する画像表示エリア905c、及び保存ボタン905dを含む。 Reference numeral 905 denotes a composite image adjustment area for displaying a composite image result, which specifies whether the composite coefficients α R , α G , and α B are to be corrected in the RGB space or in the YCbCr space. A slider bar 905a is provided. When the slider bar knob is at the center position, the state described in the first embodiment is obtained. Further, an image display area 905c for displaying the synthesis result in real time and a save button 905d are included.

ユーザは所望とするスライダーバーをポインティングデバイスを用いてドラッグ操作することで、明るさを調整することが可能になる。   The user can adjust the brightness by dragging a desired slider bar using a pointing device.

上記処理を実現するため、RAM103の格納状況を図10に従って説明する。   In order to implement the above processing, the storage status of the RAM 103 will be described with reference to FIG.

JPEGデータ(ユーザが指定した画像ファイルのデータ)はRAM106のエリア10aに格納される。読み込みが行われると、デコード処理を行い、その結果であるRGB形式の画像データがエリア106bに展開される。このエリア106bに格納された画像データが図9のオリジナル画像表示エリア902に表示される。なお、一般に、デジタルカメラで撮像した画像サイズは数百万画素になり、表示装置の表示能力を越える。従って、適当に間引き処理した結果を表示する。これは以下に説明する画像表示でも同様である。   JPEG data (image file data specified by the user) is stored in the area 10 a of the RAM 106. When the reading is performed, a decoding process is performed, and the resulting RGB format image data is developed in the area 106b. The image data stored in this area 106b is displayed in the original image display area 902 of FIG. In general, the size of an image captured by a digital camera is several million pixels, which exceeds the display capability of the display device. Accordingly, the result of appropriate thinning processing is displayed. The same applies to the image display described below.

オリジナル画像データがエリア106bに格納されると、その画像データをその際のRGBのスライダーバーのツマミ位置に従ってγ補正を行い、エリア106cに格納する。こnエリア106cに格納された画像が画像表示領域903cに格納される。   When the original image data is stored in the area 106b, the image data is subjected to γ correction according to the knob position of the RGB slider bar at that time, and stored in the area 106c. The image stored in the n area 106c is stored in the image display area 903c.

また、エリア106bに格納された画像(RGB空間画像データ)をYCbCr変換を行い、エリア106dに格納する。表示装置はRGB形式でしか表示できないから、このエリア106dに格納された画像データをそのまま表示することはできない。そこで、エリア106dに格納された画像は、そのY成分についてのスライダーバーのツマミ位置にしたがってγ補正を行い、その結果をRGB変換を行ってエリア106eに格納する。そして、このエリア106eに格納された画像を画像表示エリア904cに表示する。なお、エリア106dへのYCbCr空間画像データの格納処理は一度だけで良い。   Further, the image (RGB space image data) stored in the area 106b is subjected to YCbCr conversion and stored in the area 106d. Since the display device can display only in the RGB format, the image data stored in this area 106d cannot be displayed as it is. Therefore, the image stored in the area 106d is subjected to γ correction in accordance with the slider bar knob position for the Y component, and the result is subjected to RGB conversion and stored in the area 106e. Then, the image stored in this area 106e is displayed in the image display area 904c. Note that the storage process of the YCbCr space image data in the area 106d may be performed only once.

また、エリア106c、エリア106eのいずれか一方が更新された場合には、それら2つの画像をスライダーバー905aの各ツマミ位置にしたがった比率で合成し、その結果をエリア106fに格納する。エリア106fに格納された画像は、画像表示エリア905に表示するために使用される。   When either one of the area 106c and the area 106e is updated, the two images are combined at a ratio according to each knob position of the slider bar 905a, and the result is stored in the area 106f. The image stored in the area 106f is used for displaying in the image display area 905.

以上であるが、エリア106c、エリア106eのいずれか一方が更新された場合に図4のステップS208以降の処理を行えば良い。また、上記説明から本第2の実施形態におけるアプリケーションの処理内容は自明であるから、その説明については省略する。   As described above, when one of the area 106c and the area 106e is updated, the processing after step S208 in FIG. 4 may be performed. In addition, the processing contents of the application in the second embodiment are self-evident from the above description, and thus the description thereof is omitted.

以上説明したように本第2の実施形態によれば、第1の実施形態の作用効果に加えて、画像編集処理でのインタラクティブな編集にも適用できるようになり、且つ、ユーザは編集結果得られる3つのうち少なくとも1つの画像を保存することも可能となる。   As described above, according to the second embodiment, in addition to the function and effect of the first embodiment, it can be applied to interactive editing in the image editing process, and the user can obtain the editing result. It is also possible to store at least one of the three images.

実施形態における画像処理装置のブロック構成図である。1 is a block configuration diagram of an image processing apparatus according to an embodiment. γ補正の変換曲線の例を示す図である。It is a figure which shows the example of the conversion curve of (gamma) correction. 実施形態におけるスキャナドライバの処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of the scanner driver in embodiment. 図3におけるステップS6の詳細を示すフローチャートである。It is a flowchart which shows the detail of step S6 in FIG. 実施形態のスキャナドライバ起動時のGUIウインドウの一例を示す図である。It is a figure which shows an example of the GUI window at the time of the scanner driver starting of embodiment. 実施形態における画像補正の際のスキャン順を示す図である。It is a figure which shows the scanning order in the case of the image correction in embodiment. 明るさとγ補正のパラメータとの対応テーブルを示す図である。It is a figure which shows the correspondence table of the parameter of brightness and (gamma) correction. 図3におけるステップS6の変形例の詳細を示すフローチャートである。It is a flowchart which shows the detail of the modification of step S6 in FIG. 第2の実施形態における画像編集ウインドウの一例を示す図である。It is a figure which shows an example of the image edit window in 2nd Embodiment. 第2の実施形態におけるRAMのデータの格納状態と変換処理の関係を示す図である。It is a figure which shows the relationship between the storage state of the data of RAM in 2nd Embodiment, and a conversion process.

Claims (10)

画像データの色を決定する複数の要素中の1つの要素について補正する画像処理装置であって、
補正対象の要素を変更した場合に他の要素に関する少なくとも1つの画質に与える影響方向が異なる第1、第2の色空間それぞれの画像データを、補正対象とする画像データから変換して得る色空間変換手段と、
該色空間変換手段で得られた第1の色空間の第1の画像データと、第2の色空間の第2の画像データそれぞれに対して前記補正対象の要素の変更を反映させて、補正済第1の画像データと補正済第2の画像データを得る画像補正手段と、
前記補正済第1の画像データと前記補正済第2の画像データそれぞれの色空間を同一色空間にし、所定比率で合成する合成手段と
を備えることを特徴とする画像処理装置。
An image processing apparatus that corrects one element among a plurality of elements that determine the color of image data,
Color space obtained by converting the image data of each of the first and second color spaces having different influence directions on at least one image quality related to other elements when the correction target element is changed from the image data to be corrected Conversion means;
The correction of the correction target element is reflected on each of the first image data of the first color space obtained by the color space conversion means and the second image data of the second color space. Image correction means for obtaining first image data and corrected second image data;
An image processing apparatus comprising: a combining unit configured to combine the corrected first image data and the corrected second image data into the same color space and combine them at a predetermined ratio.
前記第1の色空間はRGB色空間、前記第2の色空間はYCbCr色空間であり、前記補正対象の要素は明るさであることを特徴とする請求項1に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the first color space is an RGB color space, the second color space is a YCbCr color space, and the correction target element is brightness. 前記所定比率を変更する変更手段を備えることを特徴とする請求項1又は2に記載の画像処理装置。   The image processing apparatus according to claim 1, further comprising a changing unit that changes the predetermined ratio. 補正対象の画像データの色空間が前記第1、又は第2の色空間のいずれかと同じ場合、前記色空間変換手段は、補正対象の画像データの色空間と異なる色空間の画像データのみを生成するために変換することを特徴とする請求項1乃至3のいずれか1つに記載の画像処理装置。   When the color space of the image data to be corrected is the same as the first or second color space, the color space conversion unit generates only image data in a color space different from the color space of the image data to be corrected. The image processing apparatus according to claim 1, wherein the image processing apparatus performs conversion to perform the conversion. 画像データの色を決定する複数の要素中の1つの要素について補正する画像処理方法であって、
補正対象の要素を変更した場合に他の要素に関する少なくとも1つの画質に与える影響方向が異なる第1、第2の色空間それぞれの画像データを、補正対象とする画像データから変換して得る色空間変換工程と、
該色空間変換工程で得られた第1の色空間の第1の画像データと、第2の色空間の第2の画像データそれぞれに対して前記補正対象の要素の変更を反映させて、補正済第1の画像データと補正済第2の画像データを得る画像補正工程と、
前記補正済第1の画像データと前記補正済第2の画像データそれぞれの色空間を同一色空間にし、所定比率で合成する合成工程と
を備えることを特徴とする画像処理方法。
An image processing method for correcting one element among a plurality of elements for determining the color of image data,
Color space obtained by converting the image data of each of the first and second color spaces having different influence directions on at least one image quality related to other elements when the correction target element is changed from the image data to be corrected Conversion process;
Correction is performed by reflecting the change of the element to be corrected in each of the first image data in the first color space obtained in the color space conversion step and the second image data in the second color space. An image correction step of obtaining the completed first image data and the corrected second image data;
An image processing method comprising: combining the corrected first image data and the corrected second image data with the same color space and combining them at a predetermined ratio.
画像データの色を決定する複数の要素中の1つの要素について補正する画像処理装置として機能するコンピュータプログラムであって、
補正対象の要素を変更した場合に他の要素に関する少なくとも1つの画質に与える影響方向が異なる第1、第2の色空間それぞれの画像データを、補正対象とする画像データから変換して得る色空間変換手段と、
該色空間変換手段で得られた第1の色空間の第1の画像データと、第2の色空間の第2の画像データそれぞれに対して前記補正対象の要素の変更を反映させて、補正済第1の画像データと補正済第2の画像データを得る画像補正手段と、
前記補正済第1の画像データと前記補正済第2の画像データそれぞれの色空間を同一色空間にし、所定比率で合成する合成手段
として機能することを特徴とするコンピュータプログラム。
A computer program that functions as an image processing device that corrects one element among a plurality of elements that determine the color of image data,
Color space obtained by converting the image data of each of the first and second color spaces having different influence directions on at least one image quality related to other elements when the correction target element is changed from the image data to be corrected Conversion means;
The correction of the correction target element is reflected on each of the first image data of the first color space obtained by the color space conversion means and the second image data of the second color space. Image correction means for obtaining first image data and corrected second image data;
A computer program that functions as a combining unit that combines the corrected first image data and the corrected second image data into the same color space and combines them at a predetermined ratio.
請求項6に記載のコンピュータプログラムを格納することを特徴とするコンピュータ可読記憶媒体。   A computer-readable storage medium storing the computer program according to claim 6. 画像に対して補正パラメータに応じた画像補正を行う画像処理方法であって、
補正パラメータを入力し、
前記画像を示す第1の色空間の画像データに対して、前記補正パラメータに応じた第1の補正を行い、
前記画像を示す第2の色空間の画像データに対して、前記補正パラメータに応じた第2の補正を行い、
前記第1の補正が行われた画像データと前記第2の補正が行われた画像データを第3の色空間に変換し、合成する画像処理方法であり、
前記第1の色空間と前記第2の色空間とは異なることを特徴とする画像処理方法。
An image processing method for performing image correction on an image according to a correction parameter,
Enter correction parameters,
A first correction according to the correction parameter is performed on the image data of the first color space indicating the image,
A second correction according to the correction parameter is performed on the image data of the second color space indicating the image,
An image processing method for converting the image data subjected to the first correction and the image data subjected to the second correction into a third color space and combining them.
The image processing method, wherein the first color space and the second color space are different.
前記第1の色空間と前記第3の色空間は同一であることを特徴とする請求項8記載の画像処理方法。   9. The image processing method according to claim 8, wherein the first color space and the third color space are the same. 前記第1の補正は、前記補正パラメータに応じた補正条件を用いて補正し、
前記第2の補正は、前記補正パラメータに応じた補正条件を用いて補正することを特徴とする請求項8または9記載の画像処理方法。
The first correction is corrected using a correction condition according to the correction parameter,
The image processing method according to claim 8, wherein the second correction is performed using a correction condition corresponding to the correction parameter.
JP2004056668A 2004-03-01 2004-03-01 Image processing apparatus and method therefor, computer program and computer-readable storage medium Withdrawn JP2005252392A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004056668A JP2005252392A (en) 2004-03-01 2004-03-01 Image processing apparatus and method therefor, computer program and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004056668A JP2005252392A (en) 2004-03-01 2004-03-01 Image processing apparatus and method therefor, computer program and computer-readable storage medium

Publications (1)

Publication Number Publication Date
JP2005252392A true JP2005252392A (en) 2005-09-15

Family

ID=35032508

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004056668A Withdrawn JP2005252392A (en) 2004-03-01 2004-03-01 Image processing apparatus and method therefor, computer program and computer-readable storage medium

Country Status (1)

Country Link
JP (1) JP2005252392A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8374458B2 (en) 2005-12-21 2013-02-12 Nec Corporation Tone correcting method, tone correcting apparatus, tone correcting program, and image equipment
CN104050700A (en) * 2014-06-13 2014-09-17 北京奥普科星技术有限公司 Image synthetic method and device
JP2015226164A (en) * 2014-05-27 2015-12-14 富士ゼロックス株式会社 Image processing apparatus and program
CN110648373A (en) * 2019-09-16 2020-01-03 紫光展讯通信(惠州)有限公司 Image processing method and device
WO2023036181A1 (en) * 2021-09-10 2023-03-16 北京字跳网络技术有限公司 Image processing method and apparatus

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8374458B2 (en) 2005-12-21 2013-02-12 Nec Corporation Tone correcting method, tone correcting apparatus, tone correcting program, and image equipment
JP2015226164A (en) * 2014-05-27 2015-12-14 富士ゼロックス株式会社 Image processing apparatus and program
CN105323502A (en) * 2014-05-27 2016-02-10 富士施乐株式会社 Image processing apparatus and image processing method
CN105323502B (en) * 2014-05-27 2019-01-25 富士施乐株式会社 Image processing equipment and image processing method
CN104050700A (en) * 2014-06-13 2014-09-17 北京奥普科星技术有限公司 Image synthetic method and device
CN110648373A (en) * 2019-09-16 2020-01-03 紫光展讯通信(惠州)有限公司 Image processing method and device
CN110648373B (en) * 2019-09-16 2022-04-15 紫光展讯通信(惠州)有限公司 Image processing method and device
WO2023036181A1 (en) * 2021-09-10 2023-03-16 北京字跳网络技术有限公司 Image processing method and apparatus

Similar Documents

Publication Publication Date Title
US7450281B2 (en) Image processing apparatus and information processing apparatus, and method thereof
JP5205968B2 (en) Gradation correction method, gradation correction apparatus, gradation correction program, and image device
JP4375781B2 (en) Image processing apparatus, image processing method, program, and recording medium
US8103119B2 (en) Image processing device, image processing method, image processing program product, and image-capturing device
US6608926B1 (en) Image processing method, image processing apparatus and recording medium
US7453598B2 (en) Image processing method and apparatus, and color conversion table generation method and apparatus
JP4209439B2 (en) Image processing apparatus, image processing system, image processing method, image processing program, and integrated circuit device
US7809186B2 (en) Image processing apparatus, image processing method, program thereof, and recording medium
JP2002016818A (en) Color correction method and device, and recording medium
KR101927968B1 (en) METHOD AND DEVICE FOR DISPLAYING IMAGE BASED ON METADATA, AND RECORDING MEDIUM THEREFOR
JP2007208956A (en) Image processing apparatus, image forming apparatus, control method of image processing apparatus, image processing program, and computer-readable storage medium
JP5235759B2 (en) Image processing apparatus, image processing method, and program
JP2007202218A (en) Method and apparatus for enhancing source digital image
JP2002016874A (en) Method and apparatus for processing image as well as recording medium for recording program therefor
JP2008072604A (en) Image processing system, apparatus, medium, and program
JP5664261B2 (en) Image processing apparatus and image processing program
JP4387907B2 (en) Image processing method and apparatus
JP4527500B2 (en) Image processing method, apparatus, and program
JP2007208912A (en) Image processing apparatus and control method, computer program, and storage medium
WO2009093294A1 (en) Image signal processing device and image signal processing program
JP2005252392A (en) Image processing apparatus and method therefor, computer program and computer-readable storage medium
JP2001169098A (en) Medium recording output picture data correction program, output picture data correction method, output picture data correction device, medium recording picture data reduction program, picture data reduction method, picture data reduction device, medium recording picture data correction program and method and device for correcting picture data
JP4007964B2 (en) Image processing apparatus, image processing method, and image processing program
JP2008245024A (en) Generation of lookup table
JP3754944B2 (en) Image processing apparatus and method

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20070501