JP4752421B2 - Image retouching method, image retouching device, and image retouching program - Google Patents

Image retouching method, image retouching device, and image retouching program Download PDF

Info

Publication number
JP4752421B2
JP4752421B2 JP2005275688A JP2005275688A JP4752421B2 JP 4752421 B2 JP4752421 B2 JP 4752421B2 JP 2005275688 A JP2005275688 A JP 2005275688A JP 2005275688 A JP2005275688 A JP 2005275688A JP 4752421 B2 JP4752421 B2 JP 4752421B2
Authority
JP
Japan
Prior art keywords
image
raw data
operation value
setting
retouch
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2005275688A
Other languages
Japanese (ja)
Other versions
JP2007087147A (en
Inventor
宣泰 有馬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
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 Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2005275688A priority Critical patent/JP4752421B2/en
Publication of JP2007087147A publication Critical patent/JP2007087147A/en
Application granted granted Critical
Publication of JP4752421B2 publication Critical patent/JP4752421B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Description

本発明は画像レタッチ方法、画像レタッチ装置及び画像レタッチプログラムに関し、特にRAWデータ処理に関する。   The present invention relates to an image retouching method, an image retouching apparatus, and an image retouching program, and more particularly to RAW data processing.

従来、ディジタルカメラなどの画像入力装置のデータ記録フォーマットとしてRAWデータフォーマットが知られている。一画素毎に1つの色成分のみを持つRAWデータは対象物を表す画像としては不完全な情報である。したがって、少なくとも各画素の不足している色成分を近傍画素の色成分で補間するデモザイク処理(カラーフィルタ配列補間処理ともいう。)をRAWデータに施すまでは、対象物を表す画像を表示したり印刷することができない。RAWデータフォーマットがJPEG、TIFFといった画像データフォーマットに比べて有利な点は、連続撮影間隔、ハードウェアリソースなどの制約を受けること無しに、対象物を表す好ましい画像を対象物の記録後に生成できる点である。対象物の記録後にRAWデータから対象物を表す画像を生成するためのシステムでは、カラーバランス補正、輝度補正、鮮鋭度補正等のレタッチ処理機能を一般に備えている。このようなシステムでは、ユーザによってレタッチ操作値が入力されるたびに、入力されたレタッチ操作値に応じたレタッチ処理の結果を表すプレビュー画像を表示する。レタッチ操作値の入力に対するプレビュー表示の応答時間を短縮するためには、レタッチ操作値の入力前にデモザイク処理を実行しておくことが好ましい。   Conventionally, a RAW data format is known as a data recording format of an image input device such as a digital camera. RAW data having only one color component per pixel is incomplete information as an image representing an object. Therefore, an image representing an object is displayed until a demosaic process (also referred to as a color filter array interpolation process) for interpolating at least the missing color component of each pixel with a color component of a neighboring pixel is performed on the RAW data. I can't print. The advantage of the RAW data format over image data formats such as JPEG and TIFF is that a preferred image representing the object can be generated after the object is recorded without being restricted by the continuous shooting interval, hardware resources, etc. It is. A system for generating an image representing an object from RAW data after the object is recorded generally includes retouch processing functions such as color balance correction, luminance correction, and sharpness correction. In such a system, every time a retouch operation value is input by the user, a preview image representing the result of the retouch process corresponding to the input retouch operation value is displayed. In order to shorten the response time of the preview display with respect to the input of the retouch operation value, it is preferable to execute the demosaic process before the input of the retouch operation value.

ところで、ホワイトバランス補正処理では、ディジタルカメラ等に備わるイメージセンサの各カラーフィルタを透過した光の光量をそのまま表しているRAWデータを有彩色成分毎に定数倍することによって、最も正確な補正結果を得ることができる。また、露出の過不足をリカバーするための輝度補正処理でも、イメージセンサの各カラーフィルタを透過した光の光量をそのまま表しているRAWデータの値を定数倍することによって、最も正確な補正結果を得ることができる。   By the way, in the white balance correction process, the most accurate correction result is obtained by multiplying the RAW data, which directly represents the amount of light transmitted through each color filter of the image sensor provided in the digital camera, for each chromatic component. Obtainable. In the brightness correction process for recovering overexposure and underexposure, the most accurate correction result can be obtained by multiplying the raw data value that directly represents the amount of light transmitted through each color filter of the image sensor. Obtainable.

しかし、デモザイク処理では、各画素で不足している色成分が近傍画素の色成分で補間されるため、イメージセンサの各カラーフィルタを透過した光の光量を表していない、いわば偽の情報が追加される。したがって、デモザイク処理後にホワイトバランス補正処理や輝度補正処理を施す場合、正確な補正結果を得ることができなかったり、正確な補正結果を得るために非常に複雑な演算処理が必要になるという問題がある。   However, in the demosaic processing, the color component that is lacking in each pixel is interpolated with the color components of neighboring pixels, so false information that does not represent the amount of light transmitted through each color filter of the image sensor is added. Is done. Therefore, when white balance correction processing and luminance correction processing are performed after demosaic processing, there is a problem that an accurate correction result cannot be obtained or a very complicated calculation process is required to obtain an accurate correction result. is there.

特開2005−33468号公報JP-A-2005-33468

本発明は上述の問題を解決するために創作されたものであって、レタッチ操作値の入力に対するプレビュー表示の応答時間が短く、単純な処理で正確なレタッチが可能な画像レタッチ方法、画像レタッチ装置及び画像レタッチプログラムを提供することを目的とする。   The present invention was created to solve the above-described problem, and an image retouching method and an image retouching device capable of performing accurate retouching with simple processing, with a short response time for preview display in response to input of a retouching operation value. And an image retouching program.

(1)上記目的を達成するための画像レタッチ方法は、記憶媒体に格納されているRAWデータを取得し、デモザイク処理を用いて前記RAWデータから中間画像を生成し、前記中間画像の生成後の設定操作に応じてレタッチ操作値を設定し、前記レタッチ操作値であるカラーバランス操作値が設定されると、前記カラーバランス操作値に応じたカラーバランスの後方補正処理を用いて前記中間画像から表示のためのプレビュー画像を生成し、前記設定操作後に実行要求が発生すると、前記カラーバランス操作値に応じたカラーバランスの前方補正処理と前記カラーバランスの前方補正処理後のデモザイク処理とを用いて、前記RAWデータから最終画像を生成する、ことを含む。
設定操作前にデモザイク処理を用いてRAWデータから中間画像を生成しておくことにより、カラーバランス操作値の設定後の短時間のうちにカラーバランスが補正されたプレビュー画像を中間画像から生成することができる。実行要求が発生した場合には、デモザイク処理前にカラーバランスを補正し、カラーバランス補正後にデモザイク処理を実行することにより、正確にカラーバランスを補正することができる。また、デモザイク処理前にカラーバランスを補正する場合は、デモザイク処理後にカラーバランスを補正する場合に比べて単純な処理で正確にカラーバランスを補正することができる。また、デモザイク処理前にカラーバランスを補正する場合は、処理対象データがデモザイク処理後に比べて1/3であるため、高速な処理が可能である。すなわち、プレビュー画像生成時と最終画像生成時とにおいて、デモザイク処理とカラーバランス補正処理との実行順序を入れ替えることにより、レタッチ操作値の入力に対するプレビュー表示の応答時間を短くし、単純な処理で正確にレタッチされた最終画像を高速に生成することが可能になる。
(1) An image retouching method for achieving the above object includes obtaining RAW data stored in a storage medium, generating an intermediate image from the RAW data using demosaic processing, and generating the intermediate image after generating the intermediate image. When a retouching operation value is set according to the setting operation, and the color balance operation value that is the retouching operation value is set, display is performed from the intermediate image using a color balance backward correction process according to the color balance operation value. When an execution request is generated after the setting operation is generated using a color balance forward correction process according to the color balance operation value and a demosaic process after the color balance forward correction process, Generating a final image from the RAW data.
By generating an intermediate image from RAW data using demosaic processing before the setting operation, a preview image with the color balance corrected is generated from the intermediate image within a short time after setting the color balance operation value. Can do. When an execution request is generated, the color balance can be accurately corrected by correcting the color balance before the demosaic process and executing the demosaic process after the color balance correction. Further, when the color balance is corrected before the demosaic process, the color balance can be accurately corrected with a simple process compared to the case where the color balance is corrected after the demosaic process. Further, when the color balance is corrected before the demosaic process, the processing target data is 1/3 of that after the demosaic process, so that a high-speed process is possible. In other words, by changing the execution order of demosaic processing and color balance correction processing at the time of preview image generation and final image generation, the response time of preview display to the input of retouching operation values is shortened, and simple processing is accurate. It becomes possible to generate the final image retouched in a high speed.

(2)前記画像レタッチ方法は、前記レタッチ操作値である輝度操作値が設定されると、前記輝度操作値に応じた明度の後方補正処理を用いて、前記中間画像から前記プレビュー画像を生成し、前記設定操作後に実行要求が発生すると、前記輝度操作値に応じた輝度の前方補正処理を前記デモザイク処理前に用いて、前記RAWデータから前記最終画像を生成する、ことを含んでもよい。
設定操作前にデモザイク処理を用いてRAWデータから中間画像を生成しておくことにより、輝度操作値の設定後の短時間のうちに明度が補正されたプレビュー画像を生成することができる。実行要求が発生した場合には、デモザイク処理前に明度を補正し、輝度補正後にデモザイク処理を実行することにより、正確に輝度を補正することができる。また、デモザイク処理前に輝度を補正する場合は、デモザイク処理後に輝度を補正する場合に比べて単純な処理で正確に輝度を補正することができる。また、デモザイク処理前に輝度を補正する場合は、処理対象データがデモザイク処理後に比べて1/3であるため、高速な処理が可能である。すなわち、プレビュー画像生成時と最終画像生成時とにおいて、デモザイク処理と輝度補正処理との実行順序を入れ替えることにより、レタッチ操作値の入力に対するプレビュー表示の応答時間を短くし、単純な処理で正確にレタッチされた最終画像を高速に生成することが可能になる。
(2) In the image retouching method, when a luminance operation value that is the retouch operation value is set, the preview image is generated from the intermediate image by using a lightness backward correction process according to the luminance operation value. When an execution request is generated after the setting operation, the final image may be generated from the RAW data by using a luminance forward correction process according to the luminance operation value before the demosaicing process.
By generating an intermediate image from RAW data using demosaic processing before the setting operation, it is possible to generate a preview image whose lightness is corrected within a short time after setting the luminance operation value. When an execution request is generated, the brightness can be corrected accurately by correcting the brightness before the demosaic process and executing the demosaic process after the brightness correction. Further, when the luminance is corrected before the demosaic process, the luminance can be accurately corrected by a simple process compared to the case where the luminance is corrected after the demosaic process. In addition, when the luminance is corrected before the demosaic process, the processing target data is 1/3 of that after the demosaic process, so that a high-speed process is possible. That is, by changing the execution order of demosaic processing and luminance correction processing at the time of preview image generation and final image generation, the response time of the preview display to the input of the retouch operation value is shortened, and accurate processing is performed with simple processing. It becomes possible to generate the retouched final image at high speed.

(3)上記目的を達成するための画像レタッチ装置は、記憶媒体に格納されているRAWデータを取得するRAWデータ取得手段と、デモザイク処理を用いて前記RAWデータから中間画像を生成する中間画像生成手段と、前記中間画像の生成後の設定操作に応じてレタッチ操作値を設定する設定手段と、前記レタッチ操作値であるカラーバランス操作値が設定されると、前記カラーバランス操作値に応じたカラーバランスの後方補正処理を用いて、前記中間画像から表示のためのプレビュー画像を生成するプレビュー画像生成手段と、前記設定操作後に実行要求が発生すると、前記カラーバランス操作値に応じたカラーバランスの前方補正処理と前記カラーバランスの前方補正処理後のデモザイク処理とを用いて、前記RAWデータから最終画像を生成する最終画像生成手段と、を備える。   (3) An image retouching apparatus for achieving the above object includes a RAW data acquisition unit that acquires RAW data stored in a storage medium, and an intermediate image generation that generates an intermediate image from the RAW data using demosaic processing. Means, setting means for setting a retouch operation value according to the setting operation after the generation of the intermediate image, and setting a color balance operation value as the retouch operation value, a color corresponding to the color balance operation value Preview image generation means for generating a preview image for display from the intermediate image using a balance rearward correction process, and when an execution request occurs after the setting operation, the color balance front according to the color balance operation value Using the correction process and the demosaic process after the color balance forward correction process, Comprising the final image generation means for generating an image.

(4)上記目的を達成するための画像レタッチプログラムは、記憶媒体に格納されているRAWデータを取得するRAWデータ取得手段と、デモザイク処理を用いて前記RAWデータから中間画像を生成する中間画像生成手段と、前記中間画像の生成後の設定操作に応じてレタッチ操作値を設定する設定手段と、前記レタッチ操作値であるカラーバランス操作値が設定されると、前記カラーバランス操作値に応じたカラーバランスの後方補正処理を用いて、前記中間画像から表示のためのプレビュー画像を生成するプレビュー画像生成手段と、前記設定操作後に実行要求が発生すると、前記カラーバランス操作値に応じたカラーバランスの前方補正処理と前記カラーバランスの前方補正処理後のデモザイク処理とを用いて、前記RAWデータから最終画像を生成する最終画像生成手段と、してコンピュータを機能させる。   (4) An image retouching program for achieving the above object includes a RAW data acquisition unit that acquires RAW data stored in a storage medium, and an intermediate image generation that generates an intermediate image from the RAW data using demosaic processing. Means, setting means for setting a retouch operation value according to the setting operation after the generation of the intermediate image, and setting a color balance operation value as the retouch operation value, a color corresponding to the color balance operation value Preview image generation means for generating a preview image for display from the intermediate image using a balance rearward correction process, and when an execution request occurs after the setting operation, the color balance front according to the color balance operation value Using the correction process and the demosaic process after the color balance forward correction process, the RAW data A final image generation means for generating a Luo final image, it causes a computer to.

尚、請求項に記載された方法の各動作の順序は、技術上の阻害要因がない限り、記載順に限定されるものではなく、各動作はどのような順番で実行されてもよく、また同時に実行されてもよい。また、本発明に備わる複数の手段の各機能は、構成自体で機能が特定されるハードウェア資源、プログラムにより機能が特定されるハードウェア資源、又はそれらの組み合わせにより実現される。また、これら複数の手段の各機能は、各々が物理的に互いに独立したハードウェア資源で実現されるものに限定されない。また、本発明は画像レタッチプログラムを記録した記録媒体の発明としても特定することができる。   In addition, the order of each operation | movement of the method described in the claim is not limited in order of description, unless there is a technical obstruction factor, Each operation | movement may be performed in what order, and simultaneously May be executed. In addition, each function of the plurality of means provided in the present invention is realized by a hardware resource whose function is specified by the configuration itself, a hardware resource whose function is specified by a program, or a combination thereof. The functions of the plurality of means are not limited to those realized by hardware resources that are physically independent of each other. The present invention can also be specified as an invention of a recording medium on which an image retouching program is recorded.

以下、本発明をパーソナルコンピュータ(PC)に適用した実施の形態を次の順に説明する。
1.画像レタッチ装置の構成
2.画像レタッチ装置の作動
2−1.対象ファイル選択がトリガとなるプレビュー画像生成処理
2−2.レタッチ操作値の設定
・ホワイトバランス操作値の設定
・輝度操作値の設定
2−3.レタッチ操作値の設定がトリガとなるプレビュー画像生成処理
2−4.最終画像生成処理
3.他の実施形態
Hereinafter, embodiments in which the present invention is applied to a personal computer (PC) will be described in the following order.
1. 1. Configuration of image retouching device 2. Operation of image retouching device 2-1. Preview image generation process triggered by target file selection 2-2. Setting of retouch operation value ・ Setting of white balance operation value ・ Setting of brightness operation value 2-3. Preview image generation processing triggered by setting of the retouch operation value 2-4. 2. Final image generation processing Other embodiments

1.画像レタッチ装置の構成
図2は、画像レタッチ装置を構成するPC1とその周辺装置の概略構成を示すブロック図である。PC1は、ディジタルカメラ6、イメージスキャナ5等の画像入力装置から通信線やリムーバブルメモリを介してRAWデータを取得し、取得したRAWデータから好ましい画像を生成するために用いられる。
1. Configuration of Image Retouching Device FIG. 2 is a block diagram showing a schematic configuration of the PC 1 and its peripheral devices constituting the image retouching device. The PC 1 is used to acquire RAW data from an image input device such as the digital camera 6 or the image scanner 5 via a communication line or a removable memory, and generate a preferable image from the acquired RAW data.

インタフェース部16は、ディジタルカメラ6、イメージスキャナ5、プリンタ4等の外部デバイスと通信するためのUSBコントローラ、USBコネクタ等を備える。ディジタルカメラ6、イメージスキャナ5等の画像入力装置によって生成されたRAWデータは、一旦画像入力装置のメモリに格納された後にインタフェース部16を用いた通信により直接PC1に入力され得る。すなわち、インタフェース部16はRAWデータ取得手段として機能しうる。尚、インタフェース部16には、IEEE1394、IrDA(Infrared Data Association)、Bluetoothなどのあらゆる通信規格に対応する構成を採用しうる。また、PC1には、外部システムの記録媒体に格納されているRAWデータファイルをリムーバブルメモリやインターネットを介して入力してもよい。   The interface unit 16 includes a USB controller, a USB connector, and the like for communicating with external devices such as the digital camera 6, the image scanner 5, and the printer 4. The RAW data generated by the image input device such as the digital camera 6 and the image scanner 5 can be once stored in the memory of the image input device and then directly input to the PC 1 by communication using the interface unit 16. That is, the interface unit 16 can function as a RAW data acquisition unit. The interface unit 16 may employ a configuration corresponding to all communication standards such as IEEE 1394, IrDA (Infrared Data Association), and Bluetooth. Further, the RAW data file stored in the recording medium of the external system may be input to the PC 1 via a removable memory or the Internet.

ハードディスク装置(HDD)18には、PC1を画像レタッチ装置として機能させるための画像レタッチプログラム及びOSが格納されている。HDD18には、レタッチ対象となるRAWデータファイルが格納され得る。画像レタッチプログラムは、リムーバブルメモリ等のコンピュータ読み取り可能な記録媒体からHDD18に転送してもよいし、遠隔地のサーバコンピュータから通信ネットワークを経由してHDD18に転送してもよい。   The hard disk device (HDD) 18 stores an image retouching program and an OS for causing the PC 1 to function as an image retouching device. The HDD 18 can store a RAW data file to be retouched. The image retouching program may be transferred to the HDD 18 from a computer-readable recording medium such as a removable memory, or may be transferred to the HDD 18 via a communication network from a remote server computer.

CPU14は、ROM20及びHDD18に格納されているプログラムを実行してPC1及び周辺装置の各部を制御する。CPU14は、画像レタッチプログラムを実行するとき、中間画像生成手段、設定手段、プレビュー画像生成手段及び最終画像生成手段として機能する。CPU14は、マウス3及びキーボード2によって入力されるコマンドに応じて作動する。マウス3及びキーボード2は、例えばレタッチ操作値の設定要求やレタッチや印刷の実行要求を入力するための設定操作のために用いられる。   The CPU 14 executes programs stored in the ROM 20 and the HDD 18 to control each part of the PC 1 and peripheral devices. When executing the image retouching program, the CPU 14 functions as an intermediate image generating unit, a setting unit, a preview image generating unit, and a final image generating unit. The CPU 14 operates according to commands input from the mouse 3 and the keyboard 2. The mouse 3 and the keyboard 2 are used, for example, for a setting operation for inputting a retouching operation value setting request or a retouching or printing execution request.

RAM12は、プログラムやその処理対象データが一時的に格納される揮発性メモリである。HDD18やリムーバブルメモリや外部システムの記録媒体から取得されたRAWデータはRAM12に格納される。
表示制御部10は、グラフィックコントローラ、フレームメモリ等を備え、フレームメモリに格納されたプレビュー画像等の表示対象画像をディスプレイ7に表示させる。
The RAM 12 is a volatile memory that temporarily stores programs and processing target data. Raw data acquired from the HDD 18, a removable memory, or a recording medium of an external system is stored in the RAM 12.
The display control unit 10 includes a graphic controller, a frame memory, and the like, and displays a display target image such as a preview image stored in the frame memory on the display 7.

2.画像レタッチ装置の作動
図1は、画像レタッチプログラムの実行中のPC1による画像レタッチ処理の流れを示すフローチャートである。
図3は、画像レタッチプログラムの実行中にディスプレイ7に表示される画面の構成を示す図である。この画面を介して、レタッチ対象ファイルの選択操作、レタッチ対象ファイルの選択操作に応じて生成されるプレビュー画像の表示、レタッチ操作値の設定操作、レタッチ操作値に応じて生成されるプレビュー画像の表示、レタッチ実行要求の入力操作などが行われる。
2. Operation of Image Retouching Device FIG. 1 is a flowchart showing a flow of image retouching processing by the PC 1 during execution of an image retouching program.
FIG. 3 is a diagram showing a configuration of a screen displayed on the display 7 during execution of the image retouching program. Via this screen, a retouch target file selection operation, a preview image generated in response to the retouch target file selection operation, a retouch operation value setting operation, and a preview image generated in accordance with the retouch operation value display An input operation of a retouch execution request is performed.

2−1.対象ファイル選択がトリガとなるプレビュー画像生成処理
フォルダ選択ボタン30がクリックされると、図示しないフォルダの参照画面が表示される。ユーザがフォルダの参照画面で指定したフォルダ内の各RAWデータファイルに格納されているサムネイル画像50、52が選択エリア54に表示される。サムネイル画像はディジタルカメラ等の画像入力装置によって生成され、RAWデータによって記録されている対象物の低解像度の画像である。
2-1. Preview image generation process triggered by target file selection When the folder selection button 30 is clicked, a folder reference screen (not shown) is displayed. Thumbnail images 50 and 52 stored in each RAW data file in the folder designated by the user on the folder reference screen are displayed in the selection area 54. A thumbnail image is a low-resolution image of an object generated by an image input device such as a digital camera and recorded by RAW data.

CPU14は、ファイル選択が発生すると、初期設定値に応じて生成されるプレビュー画像の表示処理を起動する(ステップS100)。具体的には例えば、選択エリア54内のサムネイル画像50、52のいずれかがクリックされると、CPU14はホワイトバランスの操作値を「撮影時設定」に設定し、輝度補正の操作値を「0EV」と設定して以下のプレビュー画像の表示処理を開始する。尚、RAWデータからプレビュー画像及び最終画像を生成する処理を何ビットの演算で処理するかについては説明を省略するが、例えば、オーバーフローによる情報欠損を避けるためにビット数を増加させる処理や、出力フォーマットに応じてビット数を減少させる処理は必要に応じて適宜追加することができる。   When file selection occurs, the CPU 14 activates display processing of a preview image generated according to the initial setting value (step S100). Specifically, for example, when one of the thumbnail images 50 and 52 in the selection area 54 is clicked, the CPU 14 sets the white balance operation value to “setting at the time of shooting” and sets the brightness correction operation value to “0EV”. To start the following preview image display process. It should be noted that although the description of how many bits are used in the process of generating the preview image and the final image from the RAW data is omitted, for example, the process of increasing the number of bits to avoid information loss due to overflow, the output A process of reducing the number of bits according to the format can be added as necessary.

ステップS102では、CPU14は対象ファイルを解析し、プレビュー画像及び最終画像の生成に必要な情報を取得する。具体的には例えば、ディジタルカメラの機種、エリアイメージセンサの配列、解像度、一画素当たりのビット数、プレゲイン情報、オプティカルブラック情報、ガンマ補正情報、ホワイトバランスの撮影時設定などがファイルヘッダの解析により特定され、特定されたこれらの属性情報がRAM12に格納される。これらの属性情報は、一般に製造メーカ毎に固有のフォーマットで記録されるが、DNGフォーマットが汎用規格として提唱されている。いずれにしても、どのような製造メーカの画像入力装置によって生成されたRAWデータファイルであっても、これらの属性情報はファイルの解析により特定可能である。   In step S102, the CPU 14 analyzes the target file and obtains information necessary for generating the preview image and the final image. Specifically, for example, digital camera model, area image sensor arrangement, resolution, number of bits per pixel, pre-gain information, optical black information, gamma correction information, white balance shooting settings, etc. The specified attribute information is stored in the RAM 12. These attribute information is generally recorded in a format unique to each manufacturer, but the DNG format is proposed as a general-purpose standard. In any case, even if it is a RAW data file generated by an image input device of any manufacturer, these attribute information can be specified by analyzing the file.

ステップS104では、CPU14はプレゲイン処理を実行する。プレゲイン処理では、ファイルヘッダから取得されたプレゲイン情報に基づいてRAWデータの全画素値が線形に増幅される。
ステップS106では、CPU14はオプティカルブラック情報に基づいてオプティカルブラック補償処理を実行する。オプティカルブラック情報は、画像入力装置のイメージセンサに設けられた光が入射しない受光素子に蓄積された電荷量を表している。オプティカルブラック補償処理では、ファイルヘッダから取得されたオプティカルブラック情報が示す値を黒(例えばR=0/255、G=0/255、B=0/255)とみなしてRAWデータの全画素値からオプティカルブラック情報が示す値が引き算される。
In step S104, the CPU 14 executes pre-gain processing. In the pre-gain process, all pixel values of the RAW data are linearly amplified based on the pre-gain information acquired from the file header.
In step S106, the CPU 14 executes an optical black compensation process based on the optical black information. The optical black information represents the amount of charge accumulated in the light receiving element that is not incident on the light provided in the image sensor of the image input device. In the optical black compensation processing, the value indicated by the optical black information acquired from the file header is regarded as black (for example, R = 0/255, G = 0/255, B = 0/255), and all the pixel values of the RAW data are used. The value indicated by the optical black information is subtracted.

ステップS108では、CPU14はエリアイメージセンサのカラーフィルタの配列に応じたデモザイク処理を実行する。デモザイク処理は、基本的には1画素当たり1つの有彩色成分(例えばR、G、Bのいずれか)しか持たない近傍画素同士で欠乏している有彩色成分を補い合う処理である。ただし、デモザイク処理でモアレパターン、ジャギー、疑色、ハレーション等を抑制するためには、複雑な行列演算が必要になる。また、デモザイク処理は、画像入力装置のイメージセンサに現実に入射した光を表していない値を追加する処理であり、一般には不可逆変換である。したがって、画像入力装置のイメージセンサに入射した光の量が好ましくなかった場合にそれをリカバーするための補正は、デモザイク処理前に実行した方が、デモザイク処理後に実行するよりも単純な処理で狙い通りの結果を得ることができる。しかし、本実施形態では、対象ファイル選択がトリガとなるプレビュー画像生成処理と、レタッチ操作値の設定がトリガとなるプレビュー画像生成処理とにおける各補正処理の実行順序を統一するために、ホワイトバランス補正処理及び輝度補正処理をあえてデモザイク処理後に実行している。   In step S108, the CPU 14 executes a demosaic process according to the arrangement of the color filters of the area image sensor. The demosaic process is basically a process of compensating for a lack of chromatic color components between neighboring pixels having only one chromatic color component (for example, any one of R, G, and B) per pixel. However, in order to suppress moire patterns, jaggies, suspicious colors, halation, etc. in demosaic processing, complicated matrix operations are required. The demosaic process is a process of adding a value that does not represent the light actually incident on the image sensor of the image input apparatus, and is generally an irreversible conversion. Therefore, if the amount of light incident on the image sensor of the image input device is unfavorable, the correction for recovering it is aimed at simpler processing before demosaic processing than before demosaic processing. You can get street results. However, in this embodiment, white balance correction is performed in order to unify the execution order of each correction process in the preview image generation process triggered by the target file selection and the preview image generation process triggered by the setting of the retouch operation value. Processing and brightness correction processing are executed after demosaic processing.

ステップS110では、CPU14は疑色抑制処理を実行する。ベイヤ配列のカラーフィルタを備えたエリアイメージセンサでは、Gの受光素子数は、R及びBの受光素子数の2倍であるため、エイリアシングがR及びBの成分に表れやすい。このために発生する疑色はメディアンフィルタなどを用いた平坦化処理によって抑制される。
ステップS112では、CPU14はカラーマッチング処理を実行する。RAWデータの各色成分の値は画像入力装置のイメージセンサの分光感度特性に依存しているため、sRGB等の汎用規格で規定されている三刺激値と対応していない。カラーマッチング処理は、入力値であるRAWデータで表されている色光をsRGB等の汎用規格で規定されている刺激値で表すための処理である。具体的には、3×3の行列演算や、3次元LUT(Look Up Table)を用いて画素値が変換される。この変換に用いる行列や3次元LUTは、ファイルヘッダから取得したり、機種に応じてあらかじめ定義したものをファイルヘッダから取得した機種情報に応じて適用することができる。
In step S110, the CPU 14 executes a suspicious color suppression process. In an area image sensor having a Bayer array color filter, the number of light receiving elements for G is twice the number of light receiving elements for R and B, and therefore aliasing is likely to appear in the R and B components. For this reason, the suspicious color generated is suppressed by a flattening process using a median filter or the like.
In step S112, the CPU 14 executes color matching processing. Since the value of each color component of the RAW data depends on the spectral sensitivity characteristic of the image sensor of the image input device, it does not correspond to the tristimulus values defined by general-purpose standards such as sRGB. The color matching process is a process for representing the color light represented by the RAW data that is an input value with a stimulus value defined by a general standard such as sRGB. Specifically, pixel values are converted using a 3 × 3 matrix operation or a three-dimensional LUT (Look Up Table). The matrix and the three-dimensional LUT used for this conversion can be acquired from the file header, or can be applied in accordance with the model information acquired from the file header, which is predefined according to the model.

ステップS114では、CPU14はファイルヘッダから取得されたホワイトバランス情報に基づいてホワイトバランス補正を実行する。ある物体の分光放射エネルギー分布は、照明環境が異なれば当然異なるにも関わらず、人間は照明環境が異なっても同じ物体の色は同じ色として知覚する。この傾向は色の恒常性(color constancy)といわれている。これに対し、イメージセンサは物体の分光放射エネルギー分布に応じたバランスで各有彩色成分(本実施形態ではRGBとして説明する。)に対応する電荷を蓄積する。このため、例えば晴天の屋外で昼間に白と知覚される物体が白の画素で表現されるように、RGB各成分のカラーバランスを補正するカラーバランス補正が必要になる。このカラーバランス補正がホワイトバランス補正である。カラーバランス補正では、RGBの各成分毎に異なる定数を用いて各RGB成分を基本的には定数倍する演算が行われる。ただし、飽和による階調損失を抑制するために、部分的に非線形な演算を行うこともできる。具体的には例えば、ファイルヘッダに「蛍光灯:白」というホワイトバランス情報が格納されていた場合、対象物が白色蛍光灯で照明されているはずであるため、画像全体がやや青みがかっている色のバランスを補正する定数が設定される。   In step S114, the CPU 14 performs white balance correction based on the white balance information acquired from the file header. Although the spectral radiant energy distribution of an object is naturally different if the illumination environment is different, humans perceive the same object color as the same color even if the illumination environment is different. This tendency is called color constancy. On the other hand, the image sensor accumulates electric charges corresponding to each chromatic color component (described as RGB in this embodiment) in a balance according to the spectral radiant energy distribution of the object. For this reason, for example, color balance correction for correcting the color balance of each of the RGB components is required so that an object that is perceived as white in the daytime in a sunny day is represented by white pixels. This color balance correction is white balance correction. In the color balance correction, an operation for multiplying each RGB component basically by a constant using different constants for each RGB component is performed. However, in order to suppress gradation loss due to saturation, a partially nonlinear calculation can be performed. Specifically, for example, when white balance information “fluorescent light: white” is stored in the file header, the object should have been illuminated with a white fluorescent light, so that the entire image is slightly bluish A constant for correcting the balance is set.

ステップS116では、CPU14は輝度補正を実行し、その結果生成される中間画像のコピーをレタッチ操作値の設定がトリガとなるプレビュー画像生成処理で用いるためにRAM12の別領域に保存する。この輝度補正は、例えばディジタルカメラの物理的な露出が不適切であった場合に、それをリカバーするためにディジタルカメラで撮影後の露出補正操作が実行されており、その露出補正操作に応じた露出補正情報がファイルヘッダに格納されているような場合にのみ行われる。尚、輝度成分に対して定数を掛け合わせて輝度を補正してもよいが、有彩色成分のそれぞれに定数を掛け合わせて輝度を補正してもよい。尚、レタッチ操作値の設定がトリガとなるプレビュー画像生成処理で用いるための中間画像のコピーを、より早い段階(例えばステップS112の疑色抑制処理直後)でRAM12の別領域に保存してもよい。   In step S116, the CPU 14 performs brightness correction, and stores a copy of the intermediate image generated as a result in another area of the RAM 12 for use in preview image generation processing triggered by setting of the retouch operation value. In this brightness correction, for example, when the physical exposure of the digital camera is inappropriate, an exposure correction operation after shooting is performed by the digital camera in order to recover it, and the exposure correction operation is performed according to the exposure correction operation. This is performed only when exposure correction information is stored in the file header. The luminance may be corrected by multiplying the luminance component by a constant, but the luminance may be corrected by multiplying each of the chromatic color components by a constant. Note that a copy of the intermediate image for use in the preview image generation process triggered by the setting of the retouch operation value may be stored in another area of the RAM 12 at an earlier stage (for example, immediately after the suspicious color suppression process in step S112). .

ステップS118では、CPU14はガンマ補正を実行する。このガンマ補正は、イメージセンサに入射する光の量である輝度に対してイメージセンサの出力信号が線形に対応していない場合に、輝度と出力信号とを線形に対応させるための非線形な演算である。
ステップS120では、CPU12は階調再現処理を実行する。人間が知覚する明るさはイメージセンサの測光量である輝度に対応していない。一般には、感覚量は刺激量の対数に比例するというウェーバ・フェヒナーの仮説に基づいて、輝度を非線形に変換する。尚、階調再現処理でも飽和による階調損失を避けるために、ハイライト領域で階調がゆるやかに抑圧される変換を行うこともできる。
尚、ステップS114〜S120の処理は、順次それぞれ実行してもよいが、各処理の変換式を合成した変換式あるいは変換のためのLUTを設定し、これらを用いて一度に実行することもできる。以上の処理の結果、RAWファイルヘッダから取得された初期設定値である属性情報に応じてプレビュー画像が生成される。
In step S118, the CPU 14 executes gamma correction. This gamma correction is a non-linear operation for linearly matching the brightness and output signal when the output signal of the image sensor does not correspond linearly to the brightness that is the amount of light incident on the image sensor. is there.
In step S120, the CPU 12 executes gradation reproduction processing. The brightness perceived by humans does not correspond to the brightness that is the photometric quantity of the image sensor. In general, the luminance is converted into a non-linearity based on Weber-Fechner's hypothesis that the sensory amount is proportional to the logarithm of the stimulus amount. Note that even in the gradation reproduction process, in order to avoid gradation loss due to saturation, conversion in which the gradation is gently suppressed in the highlight region can be performed.
Note that the processing of steps S114 to S120 may be executed sequentially, but a conversion formula obtained by combining the conversion formulas of the respective processing or an LUT for conversion can be set and executed at once using these. . As a result of the above processing, a preview image is generated according to attribute information that is an initial setting value acquired from the RAW file header.

ステップS122では、PC1はプレビュー画像をディスプレイ7に表示する。具体的には例えば、フレームメモリに格納されたプレビュー画像がディスプレイドライバによって図3に示すプレビュー領域34に表示される。ところで、プレビュー領域34の画素数とRAWデータの画素数とは一般に異なっている。プレビュー画像の画素数はプレビュー領域34の画素数と一致する。したがって、RAWデータからプレビュー画像を生成する過程では、解像度を変換する処理が必要になる。この解像度変換処理は表示直前のこの段階で実行してもよいし、より早い段階で実行することにより、その後の処理対象画素数を減らし、高速化を図ってもよい。また、解像度変換が実行されず、プレビュー画像の一部がプレビュー領域34に表示されてもよい。
以上の処理が全て終了すると、レタッチ対象ファイルを選択する操作の応答としてプレビュー画像がディスプレイ7に表示される。
In step S122, the PC 1 displays a preview image on the display 7. Specifically, for example, the preview image stored in the frame memory is displayed in the preview area 34 shown in FIG. 3 by the display driver. Incidentally, the number of pixels in the preview area 34 and the number of pixels in the RAW data are generally different. The number of pixels in the preview image matches the number of pixels in the preview area 34. Therefore, in the process of generating a preview image from RAW data, a process for converting the resolution is required. This resolution conversion process may be executed at this stage immediately before display, or may be executed at an earlier stage to reduce the number of pixels to be processed thereafter and increase the speed. Also, resolution conversion may not be performed and a part of the preview image may be displayed in the preview area 34.
When all the above processes are completed, a preview image is displayed on the display 7 as a response to the operation of selecting the retouch target file.

2−2.レタッチ操作値の設定
PC1は、レタッチ操作値の設定操作を例えば次のようにして受け付ける。
・ホワイトバランス操作値の設定
図3に示すホワイトバランス補正エリア56には、ドロップダウンメニュー48、色温度スライダ76、色調スライダ70、色温度上下ボタン72、色調上下ボタン66及びスポイト起動チェックボックス46が配置されている。ドロップダウンメニュー48には、撮影時の照明光源等が選択項目として表示される。初期値は「撮影時設定」である。「撮影時設定」は、レタッチ操作値としてファイルヘッダから取得される属性情報を適用する項目である。したがって、「撮影時設定」が選択された場合、各有彩色成分を定数倍するための定数は、ファイルヘッダから取得される属性情報に応じて決まる。「晴天」、「曇天」、「蛍光灯:白」、「白熱灯」、「フラッシュ」等は、各項目に対応する光源の分光放射エネルギー分布に応じて各有彩色成分(例えばR、G、B)を定数倍するための定数が設定される項目である。「オート」は、各有彩色成分を定数倍するための最適な定数を画像解析により求めることを指定する項目である。
2-2. Retouch Operation Value Setting The PC 1 accepts a retouch operation value setting operation as follows, for example.
White Balance Operation Value Setting The white balance correction area 56 shown in FIG. 3 includes a drop-down menu 48, a color temperature slider 76, a color tone slider 70, a color temperature up / down button 72, a color tone up / down button 66, and a dropper activation check box 46. Has been placed. In the drop-down menu 48, an illumination light source at the time of shooting is displayed as a selection item. The initial value is “shooting setting”. “Shooting setting” is an item to which attribute information acquired from a file header is applied as a retouch operation value. Therefore, when “shooting setting” is selected, a constant for multiplying each chromatic color component by a constant is determined according to attribute information acquired from the file header. “Clear sky”, “Cloudy sky”, “Fluorescent lamp: White”, “Incandescent lamp”, “Flash”, etc., each chromatic color component (for example, R, G, etc.) according to the spectral radiant energy distribution of the light source corresponding to each item. This is an item in which a constant for multiplying B) by a constant is set. “Auto” is an item for designating that an optimum constant for multiplying each chromatic color component by a constant is obtained by image analysis.

「カスタム」が選択されると、色温度スライダ76、色調スライダ70、色温度上下ボタン72、色調上下ボタン66及びスポイト起動チェックボックス46が有効になり、これらを用いた操作値の設定が可能なモードに遷移する。色温度スライダ76及び色温度上下ボタン72は、撮影時の光源の色温度を操作値として設定するためのものである。光源の色温度が操作値として設定されると、色温度に応じて予め決められた定数が各有彩色成分毎に設定される。設定される色温度はテキストボックス74に表示される。色調スライダ70及び色調上下ボタン66は、B成分に掛け合わせる定数とG成分に掛け合わせる定数との比を操作値として設定するためのものである。その比は、テキストボックス68に段階的に(例えば±10段階で)表示される。スポイト起動チェックボックス46がオンになるとポインタがスポイト形状になり、クリックされた画素の彩度が0になる定数が各有彩色成分毎に設定される。この場合のホワイトバランス操作値は、クリックされた画素のプレビュー画像内での位置である。   When “Custom” is selected, the color temperature slider 76, the color tone slider 70, the color temperature up / down button 72, the color tone up / down button 66 and the dropper activation check box 46 are enabled, and operation values can be set using these. Transition to mode. The color temperature slider 76 and the color temperature up / down button 72 are for setting the color temperature of the light source at the time of shooting as an operation value. When the color temperature of the light source is set as the operation value, a constant determined in advance according to the color temperature is set for each chromatic color component. The set color temperature is displayed in the text box 74. The color tone slider 70 and the color tone up / down button 66 are for setting a ratio between a constant multiplied by the B component and a constant multiplied by the G component as an operation value. The ratio is displayed step by step (for example, ± 10 steps) in the text box 68. When the dropper activation check box 46 is turned on, the pointer becomes a dropper shape, and a constant that sets the saturation of the clicked pixel to 0 is set for each chromatic color component. The white balance operation value in this case is the position of the clicked pixel in the preview image.

・輝度操作値の設定
図3に示す露出補正エリア58には、EVスライダ62及びEV上下ボタン64が配置されている。EVスライダ62及びEV上下ボタン64は、EV(Exposure Value)を輝度操作値として設定するためのものである。輝度操作値はテキストボックス60に表示される。EVが1増加する毎に輝度換算で明るさが2倍になる定数が設定され、EVが1減少する毎に輝度換算で明るさが1/2倍になる定数が設定される。EVは露出時間単体で考えれば実測値と基準値との比を2を底とした対数で表したものであるから、画像入力装置のイメージセンサに実際に入射した光の量を補正する概念で用いられるパラメータである。またディジタルカメラのF値及びシャッター速度はEVが整数で変化するように段階的に設定できるようになっている。従って、露出の過不足をリカバーするための輝度補正の操作値としてEVを採用することで、どの程度輝度が補正されるのかがユーザにとってわかりやすくなる。そして、EVを輝度操作値として設定させる場合には、輝度換算で明るさを1/4倍、1/2倍、2倍、4倍と変化させることがユーザの意図である。しかし、線形でない階調再現処理やガンマ補正処理を実行した後にこのように輝度を正確に変化させることは、これらの逆変換処理の実行が必要となるため、少なくともレスポンス時間を相当犠牲にしない限り不可能である。
Setting of Brightness Operation Value In the exposure correction area 58 shown in FIG. 3, an EV slider 62 and an EV up / down button 64 are arranged. The EV slider 62 and the EV up / down button 64 are for setting EV (Exposure Value) as a luminance operation value. The brightness operation value is displayed in the text box 60. Every time EV increases by 1, a constant is set that doubles the brightness in terms of luminance, and every time EV decreases by 1, a constant that sets the brightness by half in terms of luminance is set. The EV is a concept of correcting the amount of light actually incident on the image sensor of the image input device, since the ratio of the actual measurement value and the reference value is expressed as a logarithm with a base of 2 when the exposure time is considered alone. The parameter used. In addition, the F value and shutter speed of the digital camera can be set in stages so that EV changes as an integer. Therefore, by using EV as an operation value for luminance correction for recovering overexposure and underexposure, it becomes easy for the user to understand how much luminance is corrected. When EV is set as the luminance operation value, the user's intention is to change the brightness to 1/4, 1/2, 2, 4 or 4 in terms of luminance. However, after performing non-linear gradation reproduction processing and gamma correction processing in this way, changing the brightness accurately in this way requires execution of these inverse transformation processing, so at least unless the response time is significantly sacrificed. Impossible.

2−3.レタッチ操作値の設定がトリガとなるプレビュー画像生成処理
レタッチ対象ファイルが選択された後に設定操作が発生するとPC1は以下のようにしてプレビュー画像から新たなプレビュー画像を生成する(ステップS130)。
尚、本実施の形態では、短縮するために、ガンマ補正処理及び階調再現処理が施されていない中間画像から新たなプレビュー画像が生成されるが、レタッチ対象ファイルが選択された後に初めて生成された完全なプレビュー画像に対してホワイトバランス補正処理及び輝度補正処理を施してもよい。いずれにしても、処理量が相当多いデモザイク処理が施されている画像に対してホワイトバランス補正処理又は輝度補正処理を実行することにより、RAWデータからプレビュー画像を生成する場合に比べて、短時間のうちにプレビュー画像を更新することができる。
2-3. Preview image generation process triggered by setting of the retouch operation value When a setting operation occurs after the retouch target file is selected, the PC 1 generates a new preview image from the preview image as follows (step S130).
In this embodiment, in order to shorten the image, a new preview image is generated from the intermediate image that has not been subjected to the gamma correction process and the gradation reproduction process. However, the preview image is generated only after the retouch target file is selected. Alternatively, white balance correction processing and luminance correction processing may be performed on the complete preview image. In any case, by executing white balance correction processing or luminance correction processing on an image that has been subjected to demosaic processing with a large amount of processing, a shorter time is required than when a preview image is generated from RAW data. The preview image can be updated within a short time.

ステップS132では、CPU14はステップS110で保存された中間画像のコピーに対してホワイトバランス補正処理を実行する。本実施形態では、既にホワイトバランスが補正された中間画像のホワイトバランスを補正するため、RGBに掛け合わされる定数は、中間画像に対して施されたホワイトバランス補正で用いられた定数の影響を受ける。具体的には例えば「晴天」という操作値に応じてR成分に対して用いられる、操作値によって一義的に決まる定数がk1であり、「白熱灯」という操作値に応じてR成分に対して用いられる、操作値によって一義的に決まる定数がk2であるとする。中間画像には「晴天」に応じた定数k1が適用済であって、最新のレタッチ操作値が「白熱灯」である場合、プレビュー画像のR成分に適用される最新の定数は、k2/k1となる。尚、対象ファイル選択がトリガとなって起動されたプレビュー画像生成処理でのホワイトバランス補正処理(ステップS114)が施されていない中間画像に対して、「白熱灯」というレタッチ操作値の設定がトリガとなっているホワイトバランス補正処理を実行する場合には、その中間画像のR成分に適用される定数はk2でよい。 In step S132, the CPU 14 executes white balance correction processing on the intermediate image copy stored in step S110. In this embodiment, since the white balance of the intermediate image whose white balance has already been corrected is corrected, the constant multiplied by RGB is affected by the constant used in the white balance correction applied to the intermediate image. . Specifically, for example, a constant uniquely determined by the operation value used for the R component according to the operation value “sunny” is k 1 , and for the R component according to the operation value “incandescent lamp”. Let k 2 be a constant that is uniquely determined by the operation value. When the constant k 1 corresponding to “clear sky” has been applied to the intermediate image and the latest retouching operation value is “incandescent lamp”, the latest constant applied to the R component of the preview image is k 2. / K 1 Note that the setting of the retouch operation value “incandescent lamp” is triggered for an intermediate image that has not been subjected to the white balance correction process (step S114) in the preview image generation process that is activated by the target file selection as a trigger. and in the case of executing the white balance correction processing, which is made constant to be applied to the R component of the intermediate image may be a k 2.

ステップS134では、CPU14は輝度補正処理を実行する。本実施形態では既に輝度が補正された中間画像の輝度を補正し、またEVはRAWデータを基準に認識される操作値であるため、輝度補正で用いられる定数は中間画像の輝度補正で掛け合わされている定数の影響を受ける。具体的には中間画像に対して掛け合わされている定数の逆数と、最新の輝度補正の操作値によって決まる定数とを掛け合わせた定数が中間画像の輝度成分に対して掛け合わされる。尚、輝度成分に対して定数を掛け合わせてもよいが、有彩色成分のそれぞれに定数を掛け合わせてもよい。もちろん、対象ファイル選択がトリガとなって起動されたプレビュー画像生成処理で輝度補正処理(ステップS116)が施されていない中間画像に対して輝度補正処理を実行する場合には、最新の輝度補正の操作値で一義的に決まる定数を用いて輝度を補正すればよい。また、輝度操作値を、現在表示されているプレビュー画像の輝度を基準にした操作値であるとユーザに認識させるのであれば、直前まで設定されていた輝度操作値に応じて生成された中間画像の輝度成分に、新たに輝度補正の操作値で一義的に決まる定数を単独で掛け合わせればよい。   In step S134, the CPU 14 executes a brightness correction process. In this embodiment, the brightness of the intermediate image whose brightness has already been corrected is corrected, and since EV is an operation value recognized based on the RAW data, the constants used for brightness correction are multiplied by the brightness correction of the intermediate image. Is affected by constants. Specifically, a constant obtained by multiplying the reciprocal of the constant multiplied with the intermediate image and a constant determined by the latest operation value for luminance correction is multiplied with the luminance component of the intermediate image. The luminance component may be multiplied by a constant, but each chromatic color component may be multiplied by a constant. Of course, when the brightness correction process is executed on the intermediate image that has not been subjected to the brightness correction process (step S116) in the preview image generation process activated by the target file selection as a trigger, the latest brightness correction process is performed. The luminance may be corrected using a constant that is uniquely determined by the operation value. In addition, if the user recognizes that the luminance operation value is an operation value based on the luminance of the currently displayed preview image, the intermediate image generated according to the luminance operation value set until immediately before It is sufficient to multiply the brightness component by a constant that is uniquely determined by the brightness correction operation value.

ステップS136では、ステップS116と同様にガンマ補正処理が実行される。
ステップS138では、ステップS118と同様に階調再現処理が実行される。
以上の処理の結果、レタッチ操作値の設定に応じてプレビュー画像が生成(更新)される。尚、ステップS132、S134、S136、S138の処理は、順次それぞれ実行してもよいが、各処理の変換式を合成した変換式あるいは変換のためのLUTを設定し、これらを用いて一度に実行することもできる。
In step S136, the gamma correction process is executed as in step S116.
In step S138, the gradation reproduction process is executed in the same manner as in step S118.
As a result of the above processing, a preview image is generated (updated) according to the setting of the retouch operation value. Note that the processing of steps S132, S134, S136, and S138 may be executed sequentially, but a conversion formula obtained by combining the conversion formulas of each process or an LUT for conversion is set and executed at once using these. You can also

ステップS140では、PC1は更新されたプレビュー画像をディスプレイ7に表示する。具体的には例えば、フレームメモリに格納されたプレビュー画像がディスプレイドライバによって図3に示すプレビュー領域34に表示される。レタッチ操作値の設定操作が行われてからプレビュー画像の表示が更新されるまでの応答時間は、プレゲイン処理(ステップS104)、オプティカルブラック補償処理(ステップS106)、カラーマッチング処理(ステップS108)、デモザイク処理(ステップS110)、疑色抑制処理(ステップS112)が既に施されている中間画像に対して実行されるため、設定されたレタッチ操作値に応じたプレビュー画像をRAWデータから生成する場合に比べて短い。   In step S140, the PC 1 displays the updated preview image on the display 7. Specifically, for example, the preview image stored in the frame memory is displayed in the preview area 34 shown in FIG. 3 by the display driver. The response time from when the retouch operation value setting operation is performed until the preview image display is updated includes pre-gain processing (step S104), optical black compensation processing (step S106), color matching processing (step S108), and demosaic. Since the process (step S110) and the suspicious color suppression process (step S112) are performed on the intermediate image that has already been performed, the preview image corresponding to the set retouch operation value is generated from RAW data. Short.

2−4.最終画像生成処理
現像開始要求は例えば以下のようにして発生する。図3に示す決定ボタン36がクリックされると、プレビュー領域34に表示されているプレビュー画像に対して適用されたレタッチ操作値がRAM12の別領域に保存されるとともに、レタッチ処理の結果を表す縮小プレビュー画像38が候補エリア40に表示される。現像開始ボタン42がクリックされると、出力フォーマットを設定するための図示しないダイアログウィンドウが表示される。このダイアログウィンドウでは、最終画像のサイズ、カラースペース、ファイルフォーマット(JPEG、TIFF等)、圧縮率(高品質、中品質、低品質など)、最終画像を保存するフォルダ等が設定される。このダイアログウィンドウで「OK」ボタンがクリックされると、実行要求である現像開始要求が発生し、候補エリア40に表示されている縮小プレビュー画像38に対応するRAWデータに対する以下の処理が起動される(ステップS150)。
2-4. Final image generation process The development start request is generated, for example, as follows. When the determination button 36 shown in FIG. 3 is clicked, the retouching operation value applied to the preview image displayed in the preview area 34 is saved in another area of the RAM 12 and reduced to indicate the result of the retouching process. A preview image 38 is displayed in the candidate area 40. When the development start button 42 is clicked, a dialog window (not shown) for setting the output format is displayed. In this dialog window, the final image size, color space, file format (JPEG, TIFF, etc.), compression rate (high quality, medium quality, low quality, etc.), folder for saving the final image, and the like are set. When the “OK” button is clicked in this dialog window, a development start request that is an execution request is generated, and the following processing for the RAW data corresponding to the reduced preview image 38 displayed in the candidate area 40 is activated. (Step S150).

ステップS152、S154では、CPU14はステップS104、S106と同様のプレゲイン処理及びオプティカルブラック補償処理を実行する。
ステップS156では、レタッチ操作値によってR、G、B毎に一義的に決まる定数を用いて、ステップS114と同様にR、G、Bの各成分が定数倍されるホワイトバランス補正処理が実行される。ただし、この処理はデモザイク処理前に実行されるため、一画素についてR、G、Bいずれかの1成分だけが存在している中間データに対して定数倍演算が実行される。従って、各画素に適用される定数は色成分毎にある3つの定数のうちの1つのみである。また、デモザイク処理後に比べて処理対象データ量が1/3であるため処理時間は短くなる。そして、この処理は、イメージセンサの各カラーフィルタを透過した光の光量を表していない、いわば偽の情報が混入していない中間データに対して施されるため、単純にR、G、Bの各成分を定数倍するだけでホワイトバランスが狙い通りに正確に補正される。
In steps S152 and S154, the CPU 14 executes pre-gain processing and optical black compensation processing similar to those in steps S104 and S106.
In step S156, white balance correction processing is performed in which each component of R, G, and B is multiplied by a constant, as in step S114, using constants that are uniquely determined for each of R, G, and B depending on the retouching operation value. . However, since this process is performed before demosaic processing, a constant multiplication operation is performed on intermediate data in which only one component of R, G, or B exists for one pixel. Therefore, the constant applied to each pixel is only one of the three constants for each color component. Further, since the processing target data amount is 1/3 compared with after demosaic processing, the processing time is shortened. Since this processing is performed on intermediate data that does not represent the amount of light transmitted through each color filter of the image sensor, that is, so-called false information is not mixed, simply R, G, B By simply multiplying each component by a constant, the white balance is corrected exactly as intended.

ステップS158では、レタッチ操作値によって一義的に決まる定数を用いてステップS116と同様の輝度補正処理が実行される。この輝度補正処理もデモザイク処理前に実行されるため、一画素についてR、G、Bいずれかの1成分だけが存在している中間データに対して定数倍演算が実行される。また、デモザイク処理後に比べて処理対象データ量が1/3であるため処理時間は短くなる。そして、この処理は、イメージセンサの各カラーフィルタを透過した光の光量を表していない、いわば偽の情報が混入していない中間データに対して施されるため、単純にR、G、Bの各成分を定数倍するだけで輝度が狙い通りに正確に補正される。   In step S158, the luminance correction process similar to that in step S116 is executed using a constant uniquely determined by the retouch operation value. Since this luminance correction processing is also performed before demosaicing processing, a constant multiplication operation is performed on intermediate data in which only one component of R, G, or B exists for one pixel. Further, since the processing target data amount is 1/3 compared with after demosaic processing, the processing time is shortened. Since this processing is performed on intermediate data that does not represent the amount of light transmitted through each color filter of the image sensor, that is, so-called false information is not mixed, simply R, G, B By simply multiplying each component by a constant, the brightness is accurately corrected as intended.

ステップS160、S162、S164、S166、S168では、ステップS108、S110、S112、S118、S120と同様のデモザイク処理、疑色抑制処理、カラーマッチング処理、ガンマ補正処理及び階調再現処理が実行される。但し、カラーマッチング処理では、最終画像に設定されているカラースペースへの色空間変換が実行される。
ステップS170では、最終画像に設定されているサイズ、ファイルフォーマット及び圧縮率に従って解像度変換及びエンコードが実行されることにより最終画像が生成され、設定されているフォルダに最終画像が格納される。
In steps S160, S162, S164, S166, and S168, the demosaic process, the suspicious color suppression process, the color matching process, the gamma correction process, and the gradation reproduction process similar to those in steps S108, S110, S112, S118, and S120 are executed. However, in the color matching process, color space conversion to the color space set for the final image is executed.
In step S170, the final image is generated by executing resolution conversion and encoding according to the size, file format, and compression rate set for the final image, and the final image is stored in the set folder.

3.他の実施形態
以上、本発明をPC1に適用した例を説明したが、本発明はRAWデータの印刷機能を有するMFP(Multi Function Printer)及びスタンドアロン型プリンタに適用することもできるし、RAWデータの撮影処理後の現像機能を有するディジタルカメラに適用することもできる。また、レタッチ操作値の設定毎にプレビュー画像が画面表示される例を説明したが、レタッチ操作値の設定毎にプレビュー画像が印刷されてもよい。また、ホワイトバランス補正処理及び輝度補正処理以外の実行順序がプレビュー画像生成時と最終画像生成時とで一致する例を説明したが、ホワイトバランス補正処理及び輝度補正処理以外の処理の実行順序をプレビュー画像生成時と最終画像生成時とで入れ替えてもよい。また、プレビュー画像生成時におけるホワイトバランス補正処理と輝度補正処理の実行順序を入れ替えてもよいし、最終画像生成時におけるホワイトバランス補正処理と輝度補正処理の実行順序を入れ替えてもよい。また、それら以外の処理の実行順序についても、プレビュー画像生成時と最終画像生成時のそれぞれで上記実施形態と異なる順序に入れ替えてもよい。
3. Other Embodiments Although the example in which the present invention is applied to the PC 1 has been described above, the present invention can be applied to an MFP (Multi Function Printer) having a RAW data printing function and a stand-alone printer, The present invention can also be applied to a digital camera having a developing function after photographing processing. Further, although an example in which a preview image is displayed on the screen for each setting of the retouch operation value has been described, a preview image may be printed for each setting of the retouch operation value. Further, the example in which the execution order other than the white balance correction process and the brightness correction process is the same at the time of preview image generation and the final image generation has been described. The image generation and the final image generation may be interchanged. In addition, the execution order of the white balance correction process and the brightness correction process at the time of preview image generation may be switched, and the execution order of the white balance correction process and the brightness correction process at the time of final image generation may be switched. In addition, the execution order of processes other than those may be changed to an order different from that in the above embodiment at the time of preview image generation and at the time of final image generation.

本発明の一実施形態に係るフローチャート。The flowchart which concerns on one Embodiment of this invention. 本発明の一実施形態に係るブロック図。The block diagram which concerns on one Embodiment of this invention. 本発明の一実施形態に係る画面の構成を示す図。The figure which shows the structure of the screen which concerns on one Embodiment of this invention.

符号の説明Explanation of symbols

1:PC(画像レタッチ装置)、14:CPU(中間画像生成手段、設定手段、プレビュー画像生成手段及び最終画像生成手段)、16:インタフェース部(RAWデータ取得手段)、 1: PC (image retouching device), 14: CPU (intermediate image generation means, setting means, preview image generation means, and final image generation means), 16: interface unit (RAW data acquisition means),

Claims (4)

RAWデータ取得手段が、RAWデータを取得し、
中間画像生成手段が、前記RAWデータにデモザイク処理を行い、中間画像を生成して保存し、
設定手段が、操作者の設定操作に応じてレタッチ操作値を設定し、
プレビュー画像表示手段が、前記デモザイク処理された中間画像を前記レタッチ操作値に基づいて補正して表示画面に表示し、
最終画像生成手段が、前記RAWデータを前記レタッチ操作値に基づいて補正し、前記補正されたRAWデータにデモザイク処理を行って最終画像を生成する、
ことを含む画像レタッチ方法。
RAW data acquisition means acquires RAW data ,
The intermediate image generation means performs demosaic processing on the RAW data, generates and stores an intermediate image,
The setting means sets the retouch operation value according to the operator 's setting operation,
A preview image display means corrects the demosaiced intermediate image based on the retouch operation value and displays it on the display screen;
A final image generation unit corrects the RAW data based on the retouch operation value, and performs a demosaic process on the corrected RAW data to generate a final image;
An image retouching method including:
前記レタッチ操作値がカラーバランス操作値および/または輝度操作値であることを特徴とする、請求項1に記載の画像レタッチ方法。 The image retouching method according to claim 1, wherein the retouch operation value is a color balance operation value and / or a luminance operation value. RAWデータを取得するRAWデータ取得手段と、
前記RAWデータにデモザイク処理を行い、中間画像を生成して保存する中間画像生成手段と、
操作者による設定操作に応じてレタッチ操作値を設定する設定手段と、
前記デモザイク処理された中間画像を前記レタッチ操作値に基づいて補正し、表示画面に表示するプレビュー画像表示手段と、
前記RAWデータを前記レタッチ操作値に基づいて補正し、前記補正されたRAWデータにデモザイク処理を行って最終画像を生成する最終画像生成手段と、
を備える画像レタッチ装置。
RAW data acquisition means for acquiring RAW data;
Intermediate image generating means for performing demosaic processing on the RAW data, generating and storing an intermediate image;
Setting means for setting a retouch operation value in accordance with a setting operation by an operator;
A preview image display means for correcting the demosaiced intermediate image based on the retouch operation value and displaying the corrected image on a display screen;
Final image generation means for correcting the RAW data based on the retouch operation value, and performing a demosaic process on the corrected RAW data to generate a final image;
An image retouching device comprising:
RAWデータを取得するRAWデータ取得手段と、
前記RAWデータにデモザイク処理を行い、中間画像を生成して保存する中間画像生成手段と、
操作者による設定操作に応じてレタッチ操作値を設定する設定手段と、
前記デモザイク処理された中間画像を前記レタッチ操作値に基づいて補正し、表示画面に表示するプレビュー画像表示手段と、
前記RAWデータを前記レタッチ操作値に基づいて補正し、前記補正されたRAWデータにデモザイク処理を行って最終画像を生成する最終画像生成手段と、
してコンピュータを機能させる画像レタッチプログラム。
RAW data acquisition means for acquiring RAW data;
Intermediate image generating means for performing demosaic processing on the RAW data, generating and storing an intermediate image;
Setting means for setting a retouch operation value in accordance with a setting operation by an operator;
A preview image display means for correcting the demosaiced intermediate image based on the retouch operation value and displaying the corrected image on a display screen;
Final image generation means for correcting the RAW data based on the retouch operation value, and performing a demosaic process on the corrected RAW data to generate a final image;
Image retouching program that causes a computer to function as a.
JP2005275688A 2005-09-22 2005-09-22 Image retouching method, image retouching device, and image retouching program Expired - Fee Related JP4752421B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005275688A JP4752421B2 (en) 2005-09-22 2005-09-22 Image retouching method, image retouching device, and image retouching program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005275688A JP4752421B2 (en) 2005-09-22 2005-09-22 Image retouching method, image retouching device, and image retouching program

Publications (2)

Publication Number Publication Date
JP2007087147A JP2007087147A (en) 2007-04-05
JP4752421B2 true JP4752421B2 (en) 2011-08-17

Family

ID=37974061

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005275688A Expired - Fee Related JP4752421B2 (en) 2005-09-22 2005-09-22 Image retouching method, image retouching device, and image retouching program

Country Status (1)

Country Link
JP (1) JP4752421B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4600424B2 (en) 2007-05-08 2010-12-15 セイコーエプソン株式会社 Development processing apparatus for undeveloped image data, development processing method, and computer program for development processing
JP4985180B2 (en) * 2007-07-26 2012-07-25 ソニー株式会社 Image processing apparatus, image processing method, image processing program, and imaging apparatus
JP5136209B2 (en) * 2008-05-23 2013-02-06 セイコーエプソン株式会社 Development processing apparatus for undeveloped image data, development processing method, and computer program for development processing
US8035698B2 (en) 2009-01-21 2011-10-11 Seiko Epson Corporation Joint automatic demosaicking and white balancing
CN107622471A (en) * 2017-09-04 2018-01-23 田其冲 A kind of adaptive photographic quality bearing calibration

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003348335A (en) * 2002-05-23 2003-12-05 Fuji Photo Film Co Ltd Image processing method, image processing apparatus, and image processing program
JP4845382B2 (en) * 2004-02-06 2011-12-28 キヤノン株式会社 Image processing apparatus, control method therefor, computer program, and computer-readable storage medium

Also Published As

Publication number Publication date
JP2007087147A (en) 2007-04-05

Similar Documents

Publication Publication Date Title
JP4677391B2 (en) Image processing apparatus, image processing apparatus control method, computer program, and storage medium
JP4325552B2 (en) Image processing apparatus, image processing method, and image processing program
JP2004173010A (en) Image pickup device, image processor, image recorder, image processing method, program and recording medium
KR20120118383A (en) Image compensation device, image processing apparatus and methods thereof
JP2005210526A (en) Image processing apparatus, method, and program, image pickup device, and image data outputting method and program
JP2008177872A (en) Image processing method, device, and program, and imaging device
JP4407454B2 (en) Digital camera and image processing method
JP4752421B2 (en) Image retouching method, image retouching device, and image retouching program
JP2005210495A (en) Image processing apparatus, method, and program
JP5029164B2 (en) Image processing using undeveloped image data
JP2006227698A (en) Raw data processing method, program and device
JP2010226364A (en) White balance processing apparatus, white balance processing method and white balance processing program
JP5552795B2 (en) Imaging apparatus, image processing apparatus, and program
JP2004088345A (en) Image forming method, image processor, print preparation device, and storage medium
JP2006203555A (en) Image processing method, image processor and image processing program
JP6335614B2 (en) Image processing apparatus, control method thereof, and program
JP2006333113A (en) Imaging device
JP5743456B2 (en) Image processing apparatus, image processing method, and imaging apparatus
US20050169523A1 (en) Image processing with information associated with image data
JP2004349842A (en) Method and program for correcting composite image
Brown Color processing for digital cameras
JP2006203571A (en) Imaging apparatus, image processing apparatus, and image recording apparatus
JP2004328534A (en) Image forming method, image processing apparatus and image recording apparatus
JP2006203573A (en) Imaging apparatus, image processor, and image recording apparatus
JP2004222076A (en) Image processing program and method

Legal Events

Date Code Title Description
RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20061222

RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20061226

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20070405

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20080611

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20101221

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110105

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110307

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: 20110426

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110509

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140603

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 4752421

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees