JP2009130630A - Color processor and method thereof - Google Patents

Color processor and method thereof Download PDF

Info

Publication number
JP2009130630A
JP2009130630A JP2007303540A JP2007303540A JP2009130630A JP 2009130630 A JP2009130630 A JP 2009130630A JP 2007303540 A JP2007303540 A JP 2007303540A JP 2007303540 A JP2007303540 A JP 2007303540A JP 2009130630 A JP2009130630 A JP 2009130630A
Authority
JP
Japan
Prior art keywords
color
image
adjustment
color adjustment
saturation
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
JP2007303540A
Other languages
Japanese (ja)
Inventor
Chie Ishikawa
智恵 石川
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 JP2007303540A priority Critical patent/JP2009130630A/en
Publication of JP2009130630A publication Critical patent/JP2009130630A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

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

Abstract

<P>PROBLEM TO BE SOLVED: To adjust the color tone of an image to be adjusted without sense of incongruity when performing color balance adjustment when making the color tone of the image to be adjusted close to the color tone of a reference image. <P>SOLUTION: A reference image to be reference of color tone and an image of a color tone adjustment target are input (S301), feature quantity of the reference image and feature quantity of the image of a color tone adjustment target are calculated, and the saturation of the reference image and the saturation of the image of a color tone adjustment target are calculated (S302, S304). A color tone adjustment condition on the image of a color tone adjustment target is set so as to make the color tone of the image of a color tone adjustment target close to the color tone of the reference image on the basis of the feature quantity and saturation of the reference image and the image of a color tone adjustment target (S305 to S308). Then, the set color tone adjustment condition is used to perform color adjustment of the image of a color tone adjustment target (S309). In such a case, if the saturation of the image of a color tone adjustment target is lower than the saturation of the reference image, the color tone adjustment condition is adjusted so as to reduce an adjustment amount of color adjustment. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、画像の色調整に関する。   The present invention relates to image color adjustment.

ディジタルスチルカメラなどの画像生成装置で撮影した画像にカラーバランス調整を施すことは一般的である。カラーバランス調整処理により、個々の画像の色をより適切に表現する技術は、様々に提案されている。   It is common to perform color balance adjustment on an image taken by an image generation device such as a digital still camera. Various techniques for more appropriately expressing the colors of individual images by color balance adjustment processing have been proposed.

特許文献1は、無彩色の物体色の範囲(以下、無彩物体色範囲)を予め複数設定し、処理対象画像の画素が、どの無彩物体色範囲に多く分布するかを調べて、カラーバランス調整を行う技術を開示する。   Patent Document 1 sets a plurality of achromatic object color ranges (hereinafter referred to as achromatic object color ranges) in advance, investigates in which achromatic object color range the pixels of the processing target image are distributed, A technique for performing balance adjustment is disclosed.

特許文献2は、人の顔に注目して、カラーバランス調整を行う技術を開示する。つまり、画像全体から求めた基本濃度補正係数と、顔画像の領域を重視して顔画像の平均濃度値から求めた顔依存濃度補正係数から、一つの濃度補正曲線を生成する。   Patent Document 2 discloses a technique for performing color balance adjustment while paying attention to a human face. That is, one density correction curve is generated from the basic density correction coefficient obtained from the entire image and the face-dependent density correction coefficient obtained from the average density value of the face image with emphasis on the face image area.

上記の技術は、個々の画像のカラーバランスを補正して画像に生じている色かぶりを低減し、元々白色である撮像対象を正しく白色で再現するものである。   The above technique corrects the color balance of each image to reduce the color cast generated in the image, and correctly reproduces the image pickup target that is originally white in white.

また、目標画像を設定し、色を合わせたい画像を、目標画像の色調に合わせる技術が提案されている。   Further, a technique has been proposed in which a target image is set and an image whose color is to be matched is matched with the color tone of the target image.

特許文献3は、画像の撮影シーンを、風景やポートレートなどの複数のカテゴリに分類し、各カテゴリにおける最も理想的な色分布を決定する。そして、各画像を、そのカテゴリの理想的な色分布を目標として色補正する技術を開示する。特許文献4は、画像全体ではなく、指定された領域の色合わせを行うカラーバランス調整を開示する。   Patent Document 3 classifies image shooting scenes into a plurality of categories such as landscapes and portraits, and determines the most ideal color distribution in each category. Then, a technique for color correcting each image with an ideal color distribution of the category as a target is disclosed. Patent Document 4 discloses color balance adjustment that performs color matching of a specified area, not the entire image.

しかし、上記の技術は何れも、複数枚の画像が一頁にレイアウトされる例えばアルバムのような画像において、すべての画像を同じ雰囲気にするようなカラーバランス調整には向かない。   However, none of the above techniques is suitable for color balance adjustment in which, for example, an album-like image in which a plurality of images are laid out on one page, all images have the same atmosphere.

特許文献1、2に開示される技術は、基本的に色かぶりを低減する技術である。例えばウェディングアルバムは、温かみのある色合いのアルバムに仕上げたいから、少し赤から黄色の方向に色かぶりした状態の画像が好まれる。しかし、個々の画像の色かぶりを取ってしまえば、ウェディングアルバム全体が冷たい印象の仕上がりになる。そこで、個々の画像のカラーバランスを調整して色かぶりをとり、その後、画像全体の色合いを調整することいなるが、類似する処理を二回繰り返すことになり、作業効率が悪い。   The techniques disclosed in Patent Documents 1 and 2 are basically techniques for reducing color cast. For example, a wedding album is desired to be finished in an album with a warm color, so an image with a color cast from a little red to yellow is preferred. However, if you remove the color cast from each individual image, the entire wedding album will have a cool impression. Therefore, the color balance is adjusted by adjusting the color balance of each image, and then the color of the entire image is adjusted. However, similar processing is repeated twice, and the work efficiency is poor.

また、特許文献3に開示される技術をアルバムの頁内の画像に適用する場合、例えばポートレートと風景画像などシーンの違いに合わせて異なる目標画像を用意すれば、同じ頁内の画像の色合いの違いが観察者に違和感を与える可能性がある。また、シーンごとではなく、頁ごとに目標画像を設定すれば、画像の雰囲気は統一されるとしても、画像自体の品質を大きく損う危惧がある。   In addition, when applying the technique disclosed in Patent Document 3 to an image on an album page, if different target images such as portrait and landscape images are prepared for different scenes, the color of the image on the same page The difference between the two may make the viewer feel uncomfortable. Also, if a target image is set for each page, not for each scene, there is a risk that the quality of the image itself will be greatly impaired even if the atmosphere of the image is unified.

例えば、室内において電球で照明された物体の写真A(黄色がかぶる)と、屋外や窓に近い位置にある物体または昼白色の蛍光灯で照明された物体の写真Bを同一頁にレイアウトする場合を考える。この場合、写真Aの画像を目標画像にしてカラーバランス調整すれば、写真Bに写った植物の葉が黄色くなり過ぎて枯れた印象になり、人の顔が黄色くなる弊害が生じる。   For example, when laying out a photo A of an object illuminated with a light bulb indoors (yellow) and a photo B of an object located outdoors or near a window or illuminated with a white fluorescent lamp on the same page think of. In this case, if the color balance adjustment is performed using the image of the photo A as the target image, the leaves of the plant shown in the photo B become too yellow and wither the impression that the human face becomes yellow.

また、特許文献4に開示される技術をウェディングアルバムのように様々な光源下、様々な場所で撮影された画像に適用する場合を考える。この場合、例えば顔やドレスなど特定の領域を指定してカラーバランス調整を行えば、画像全体の色が不自然になる。あるいは、同一の色になると見做せるような領域が、カラーバランス調整の対象画像すべてには設定できない、などの問題が生じる。   Also, consider a case where the technique disclosed in Patent Document 4 is applied to images taken at various places under various light sources such as a wedding album. In this case, for example, if a specific area such as a face or a dress is designated and color balance adjustment is performed, the color of the entire image becomes unnatural. Alternatively, there arises a problem that an area that can be regarded as the same color cannot be set in all the target images for color balance adjustment.

特開2005-318489公報JP 2005-318489 特開2007-018073公報JP 2007-018073 JP 特開2003-134341公報JP 2003-134341 A 特開平8-297731号公報JP-A-8-297731

本発明は、色調整対象の画像の色調を基準画像の色調に近付ける色調整を行う際に、色調整対象の画像の色調を違和感なく調整することを目的とする。   An object of the present invention is to adjust the color tone of a color adjustment target image without a sense of incongruity when performing color adjustment that brings the color tone of an image to be color adjusted close to the color tone of a reference image.

本発明は、前記の目的を達成する一手段として、以下の構成を備える。   The present invention has the following configuration as one means for achieving the above object.

本発明にかかる色処理装置は、処理対象画像の色調を基準画像の色調に合わせるように修正する色処理装置であって、色調の基準となる基準画像と、色調整対象の画像を入力する入力手段と、前記基準画像の特徴量および前記色調整対象の画像の特徴量を算出する算出手段と、前記基準画像の彩度および前記色調整対象の画像の彩度を計算する計算手段と、前記基準画像および前記色調整対象の画像の特徴量および彩度に基づき、前記色調整対象の画像の色調が前記基準画像の色調に近付くように、前記色調整対象の画像に対する色調整条件を設定する設定手段と、前記設定された色調整条件を用いて、前記色調整対象の画像を色調整する調整手段とを有し、前記設定手段は、前記基準画像の彩度よりも前記色調整対象の画像の彩度が低い場合は、前記色調整の調整量を低減するように、前記色調整条件を調整することを特徴とする。   The color processing apparatus according to the present invention is a color processing apparatus that corrects the color tone of the processing target image to match the color tone of the reference image, and is used to input a reference image that is a reference for the color tone and an image that is a color adjustment target. Means for calculating the feature amount of the reference image and the feature amount of the color adjustment target image, calculation means for calculating the saturation of the reference image and the saturation of the color adjustment target image, Based on the feature amount and saturation of the reference image and the color adjustment target image, color adjustment conditions for the color adjustment target image are set so that the color tone of the color adjustment target image approaches the color tone of the reference image. A setting unit; and an adjusting unit configured to perform color adjustment on the color adjustment target image using the set color adjustment condition, wherein the setting unit determines the color adjustment target based on a saturation of the reference image. When image saturation is low So as to reduce the adjustment amount of the color adjustment, and adjusting the color adjustment conditions.

本発明にかかる色処理方法は、処理対象画像の色調を基準画像の色調に合わせるように修正する色処理方法であって、色調の基準となる基準画像と、色調整対象の画像を入力するステップと、前記基準画像の特徴量および前記色調整対象の画像の特徴量を算出するステップと、前記基準画像の彩度および前記色調整対象の画像の彩度を計算するステップと、前記基準画像および前記色調整対象の画像の特徴量および彩度に基づき、前記色調整対象の画像の色調が前記基準画像の色調に近付くように、前記色調整対象の画像に対する色調整条件を設定する設定ステップと、前記設定された色調整条件を用いて、前記色調整対象の画像を色調整するステップとを有し、前記設定ステップは、前記基準画像の彩度よりも前記色調整対象の画像の彩度が低い場合は、前記色調整の調整量を低減するように、前記色調整条件を調整することを特徴とする。   A color processing method according to the present invention is a color processing method for correcting a color tone of a processing target image so as to match a color tone of a reference image, and a step of inputting a reference image serving as a color tone reference and an image to be color adjusted Calculating a feature amount of the reference image and a feature amount of the color adjustment target image; calculating a saturation of the reference image and a saturation of the color adjustment target image; and A setting step for setting color adjustment conditions for the color adjustment target image so that the color tone of the color adjustment target image approaches the color tone of the reference image based on the feature amount and saturation of the color adjustment target image; Adjusting the color adjustment target image using the set color adjustment condition, and the setting step includes a saturation of the color adjustment target image rather than a saturation of the reference image. If low, to reduce the adjustment amount of the color adjustment, and adjusting the color adjustment conditions.

本発明によれば、色調整対象の画像の色調を基準画像の色調に近付ける色調整を行う際に、色調整対象の画像の色調を違和感なく調整することができる。   According to the present invention, when performing color adjustment that brings the color tone of the color adjustment target image closer to the color tone of the reference image, the color tone of the color adjustment target image can be adjusted without a sense of incongruity.

以下、本発明にかかる実施例の色処理を図面を参照して詳細に説明する。   Hereinafter, color processing according to an embodiment of the present invention will be described in detail with reference to the drawings.

実施例1においては、一頁内にレイアウトされる複数枚の画像の色調を合わせる例を説明する。   In the first embodiment, an example in which the color tones of a plurality of images laid out in one page are matched will be described.

[装置の構成]
図1は実施例の画像処理装置(色処理装置)の構成例を示すブロック図である。
[Device configuration]
FIG. 1 is a block diagram illustrating a configuration example of an image processing apparatus (color processing apparatus) according to an embodiment.

マイクロプロセッサ(CPU)104は、ランダムアクセスメモリ(RAM)106をワークメモリとして、リードオンリメモリ(ROM)105や記憶部103に格納された各種プログラムを実行して、システムバス109を介して後述する構成を制御する。そして、後述する処理を含む様々な処理を実行する。   The microprocessor (CPU) 104 executes various programs stored in the read only memory (ROM) 105 and the storage unit 103 using the random access memory (RAM) 106 as a work memory, and will be described later via the system bus 109. Control the configuration. And various processes including the process mentioned later are performed.

入出力部101は、キーボード、マウスなどの入力デバイス、メモリカードリーダライタ、ディジタルカメラやプリンタなどの画像入出力デバイスを接続するためのUSBやIEEE1394などのシリアルバスインタフェイスを備える。また、ネットワークに接続するためのネットワークインタフェイスカード(NIC)を備える。   The input / output unit 101 includes a serial bus interface such as USB or IEEE1394 for connecting an input device such as a keyboard and mouse, a memory card reader / writer, and an image input / output device such as a digital camera or printer. In addition, a network interface card (NIC) for connecting to the network is provided.

CPU104は、入出力部101を介して、入力デバイスからユーザ指示を入力し、メモリカード、画像入力デバイス、ネットワーク上のサーバから画像データなどの各種データを入力する。また、入出力部101を介して、色処理結果の画像データを画像出力デバイスに出力したり、メモリカードやサーバに出力する。   The CPU 104 inputs user instructions from the input device via the input / output unit 101, and inputs various data such as image data from a memory card, an image input device, and a server on the network. Also, the image data of the color processing result is output to an image output device or output to a memory card or a server via the input / output unit 101.

表示部102は、例えば液晶パネルである。CPU104は、表示部102にグラフィックユーザインタフェイス(GUI)などを表示する。記憶部103は、例えばハードディスクドライブ(HDD)で、オペレーティングシステム(OS)や後述する処理用のプログラムなどの各種プログラム、および、画像データなど様々なデータを格納する。   The display unit 102 is a liquid crystal panel, for example. The CPU 104 displays a graphic user interface (GUI) or the like on the display unit 102. The storage unit 103 is, for example, a hard disk drive (HDD), and stores various programs such as an operating system (OS) and processing programs described later, and various data such as image data.

[アルバムの一例]
図2は一頁内に複数の写真画像がレイアウトされたアルバムの一例を示す図である。
[Example of album]
FIG. 2 is a diagram showing an example of an album in which a plurality of photographic images are laid out on one page.

各写真画像の撮影場所は、次のとおりとする。
写真画像201と202:披露宴会場内、
写真画像203と204:式場内、
写真画像205 :屋外、
写真画像206 :スタジオ
The shooting location of each photographic image is as follows.
Photo images 201 and 202: Inside the reception hall
Photo images 203 and 204: Inside the ceremony hall
Photo 205: Outdoor,
Photo 206: Studio

撮影場所の関係から、写真画像202は最も黄色をかぶり、写真画像203の色かぶり度合いが次に強いとする。同じ披露宴会場で撮影された写真画像であっても、照明の関係から、写真画像201の色かぶり度合いは三番目に強く、以下、色かぶり度合いの強い順に写真画像204、205、206の順になるとする。なお、屋外撮影された写真画像205と、スタジオでライトを調節して撮影された写真画像206にはほぼ色かぶりがない。   From the relationship of the shooting location, it is assumed that the photographic image 202 is the most yellowish and the photographic image 203 has the next strongest color cast. Even in the case of photographic images taken at the same reception hall, the color cast degree of the photographic image 201 is the third strongest due to lighting, and the following is the order of the photographic images 204, 205, 206 in order of the strong color cast degree. To do. Note that the photographic image 205 taken outdoors and the photographic image 206 taken by adjusting the light in the studio have almost no color cast.

以下では、これら写真画像のカラーバランスを合わせる例を説明する。なお、写真画像はすべてRGB各色8ビットのディジタルデータとする。   In the following, an example of adjusting the color balance of these photographic images will be described. All photographic images are RGB digital data of 8 bits.

[カラーバランス調整]
図3はカラーバランス調整方法を説明するフローチャートで、CPU104が実行する処理である。
[Color balance adjustment]
FIG. 3 is a flowchart for explaining the color balance adjustment method, which is a process executed by the CPU 104.

CPU104は、ユーザ指示に従い一頁にレイアウトする複数の画像(n枚とする)を入力する(S301)。その際、CPU104は、ユーザが指示するカラーバランスの基準にする画像を基準画像Isとして入力し、その他の画像をI[0]〜I[n-2]として入力する。ここでは、図2に示す写真画像201が基準画像Isとして指示された場合を説明する。また、写真画像201以外の写真画像と配列の関係は以下のとおりとする。
I[0]=写真画像202、
I[1]=写真画像203、
I[2]=写真画像204、
I[3]=写真画像205、
I[4]=写真画像206
The CPU 104 inputs a plurality of images (n images) to be laid out on one page according to a user instruction (S301). At that time, the CPU 104 inputs an image to be used as a reference for the color balance specified by the user as the reference image Is, and inputs other images as I [0] to I [n-2]. Here, a case where the photographic image 201 shown in FIG. 2 is designated as the reference image Is will be described. The relationship between the photographic images other than the photographic image 201 and the arrangement is as follows.
I [0] = Photo 202,
I [1] = Picture image 203,
I [2] = Picture 204
I [3] = Picture image 205,
I [4] = Picture 206

なお、一頁にレイアウトする画像が二枚の場合は、基準画像一枚に対して、色を合わせたい画像が一枚になる。   If there are two images to be laid out on one page, there will be one image whose color is to be matched to one reference image.

次に、CPU104は、式(1)により基準画像Isの各色成分の平均値である平均RGB値(Rs, Gs, Bs)を計算し、式(2)(2')により平均RGB値から平均彩度Ssを計算する(S302)。
Rs = ΣR/N
Gs = ΣG/N …(1)
Bs = ΣB/N
ここで、ΣRは全画素のR値の総和、
ΣGは全画素のG値の総和、
ΣBは全画素のB値の総和、
Nは画素数
Ss' = {MAX(Rs, Gs, Bs)-MIN(Rs, Gs, Bs)}/MAX(Rs, Gs, Bs) …(2)
ここで、MAX()は最大値を求める関数、
MIN()は最小値を求める関数
Next, the CPU 104 calculates an average RGB value (Rs, Gs, Bs) that is an average value of each color component of the reference image Is according to the equation (1), and calculates an average from the average RGB value according to the equations (2) and (2 ′). The saturation Ss is calculated (S302).
Rs = ΣR / N
Gs = ΣG / N (1)
Bs = ΣB / N
Where ΣR is the sum of R values of all pixels,
ΣG is the sum of G values of all pixels,
ΣB is the sum of B values of all pixels,
N is the number of pixels
Ss' = {MAX (Rs, Gs, Bs) -MIN (Rs, Gs, Bs)} / MAX (Rs, Gs, Bs)… (2)
Where MAX () is the function to find the maximum value,
MIN () is a function to find the minimum value

式(2)によって計算されるSs'は0〜1の間の値をもつ。そこで、Ss'に255を掛けて、0〜255の値をもつ平均彩度Ssに変換する。
Ss = 255×Ss' …(2')
Ss ′ calculated by Equation (2) has a value between 0 and 1. Therefore, Ss ′ is multiplied by 255 and converted to an average saturation Ss having a value of 0 to 255.
Ss = 255 × Ss '… (2')

例えば基準画像Isの平均RGB値、平均彩度Ssは次の値になるとする。
Rs = 189, Gs = 149, Bs = 88、
Ss = 136
For example, it is assumed that the average RGB value and the average saturation Ss of the reference image Is are as follows.
Rs = 189, Gs = 149, Bs = 88,
Ss = 136

次に、CPU104は、カラーバランスの調整を終えた画像をカウントするためのカウンタkをゼロに初期化し(S303)、画像I[k](調整対象画像)の平均RGB値(Rk, Gk, Bk)と平均彩度Skを算出する(S304)。なお、平均RGB値(Rk, Gk, Bk)と平均彩度Skの計算式は式(1)(2)(2')と同様である。   Next, the CPU 104 initializes a counter k for counting images for which color balance adjustment is completed to zero (S303), and averages RGB values (Rk, Gk, Bk) of the image I [k] (adjustment target image). ) And average saturation Sk are calculated (S304). Note that the formulas for calculating the average RGB values (Rk, Gk, Bk) and the average saturation Sk are the same as the formulas (1), (2), and (2 ′).

図4は写真画像201〜206の平均RGB値および平均彩度Sの計算結果の一例を示す図である。   FIG. 4 is a diagram showing an example of the calculation result of the average RGB value and the average saturation S of the photographic images 201 to 206.

次に、CPU104は、基準画像Isの平均RGB値(Rs, Gs, Bs)と画像I[k]の平均RGB値(Rk, Gk, Bk)から、詳細は後述するが、カラーバランス調整の処理条件(色調整条件)を算出する。つまり、色調整係数である基本カラーバランス調整係数(以下、基本補正係数)γroとγboを算出する(S305)。   Next, the CPU 104 determines the color balance adjustment process from the average RGB values (Rs, Gs, Bs) of the reference image Is and the average RGB values (Rk, Gk, Bk) of the image I [k], as will be described in detail later. Conditions (color adjustment conditions) are calculated. That is, basic color balance adjustment coefficients (hereinafter, basic correction coefficients) γro and γbo, which are color adjustment coefficients, are calculated (S305).

次に、CPU104は、基準画像ISの平均彩度Ssと、画像I[k]の平均彩度Skの差分の絶対値Δs=|Ss-Sk|(以下、単に差分と呼ぶ)を計算し、差分Δsと所定の閾値Txを比較する(S306)。そして、差分が閾値より大きい(Δs>Tx)場合は、差分Δsに応じて1.0に近付けるように調整した最終カラーバランス調整係数(以下、最終補正係数)γrとγbを算出する(S307)。   Next, the CPU 104 calculates the absolute value Δs = | Ss−Sk | (hereinafter simply referred to as the difference) of the difference between the average saturation Ss of the reference image IS and the average saturation Sk of the image I [k]. The difference Δs is compared with a predetermined threshold Tx (S306). If the difference is larger than the threshold value (Δs> Tx), final color balance adjustment coefficients (hereinafter referred to as final correction coefficients) γr and γb adjusted to approach 1.0 according to the difference Δs are calculated (S307).

Δs>Txの場合、基準画像Isの色かぶり度合いが、画像I[k]の色かぶり度合いよりもかなり強く、基準画像Isの平均彩度Ssに合わせて画像I[k]のカラーバランスを調整すると、違和感がある画像になることが多い。そこで、詳細は後述するが、最終補正係数γを1.0に近付けるようにして、カラーバランス調整の度合い(調整量)を小さくする。   When Δs> Tx, the color cast of the reference image Is is considerably stronger than the color cast of the image I [k], and the color balance of the image I [k] is adjusted according to the average saturation Ss of the reference image Is. In this case, the image often has a sense of incongruity. Therefore, as will be described in detail later, the degree of color balance adjustment (adjustment amount) is reduced by bringing the final correction coefficient γ closer to 1.0.

また、差分が閾値以下(Δs≦Tx)の場合、CPU104は、基本補正係数γroとγboをそのまま最終補正係数γrとγbにする(S308)。   If the difference is equal to or smaller than the threshold (Δs ≦ Tx), the CPU 104 sets the basic correction coefficients γro and γbo to the final correction coefficients γr and γb as they are (S308).

次に、CPU104は、詳細は後述するが、最終補正係数γrとγbを使って画像I[k]をカラーバランス調整(補正)する(S309)。そして、カウンタkをインクリメントし(S310)、カウンタkの値とn-2を比較して(S311)、k<n-2であれば処理をステップと304に戻し、k=n-2に達すると処理を終了する。   Next, although details will be described later, the CPU 104 performs color balance adjustment (correction) on the image I [k] using the final correction coefficients γr and γb (S309). Then, the counter k is incremented (S310), the value of the counter k is compared with n-2 (S311), and if k <n-2, the process returns to step 304 and reaches k = n-2. Then, the process ends.

●彩度の差分による調整度合いの修正
図5は最終補正係数γを修正する方法を説明する図で、Tx=40、Tx'=80とする例を示している。
Correction of Adjustment Level Based on Saturation Difference FIG. 5 is a diagram for explaining a method of correcting the final correction coefficient γ and shows an example in which Tx = 40 and Tx ′ = 80.

Δs≦Txの領域501は最終補正係数γ=γo(修正なし)にする。また、Tx<Δs<Tx'の領域502は、次式によりΔsに比例して最終補正係数γが1.0に近付くように修正する。そして、Tx'≦Δsの領域503は最終補正係数γ=1.0にする。
γ = (1 - γo)Δs/(Tx' - Tx) + 2γo - 1 …(3)
ここで、Tx<Δs<Tx'
A region 501 where Δs ≦ Tx is set to a final correction coefficient γ = γo (no correction). Further, the region 502 where Tx <Δs <Tx ′ is corrected so that the final correction coefficient γ approaches 1.0 in proportion to Δs according to the following equation. In the region 503 where Tx ′ ≦ Δs, the final correction coefficient γ = 1.0.
γ = (1-γo) Δs / (Tx '-Tx) + 2γo-1… (3)
Where Tx <Δs <Tx '

なお、図5にはγo<1.0の場合の領域502の修正ラインを示すが、γo>1.0の場合もある。γo>1.0の場合、領域502の修正ラインは負の傾きをもつことは言うまでもない。   FIG. 5 shows a correction line of the region 502 when γo <1.0, but there may be a case where γo> 1.0. Needless to say, when γo> 1.0, the correction line in the region 502 has a negative slope.

●基本補正係数の計算
図6は基本補正係数γoの計算(S305)を説明するフローチャートである。
Calculation of Basic Correction Coefficient FIG. 6 is a flowchart for explaining the calculation of basic correction coefficient γo (S305).

CPU104は、基準画像Isの平均RGB値(Rs, Gs, Bs)と調整画像I[k]の平均RGB値(Rk, Gk, Bk)から、カラーバランス調整後の平均RGB値の目標値(Rf, Gf, Bf)を計算する(S501)。カラーバランス調整後の画像I[k]に、基準画像Isと同様の色かぶりを与えるには、画像I[k]のG色成分値とR色成分値の割合とG色成分値とB色成分値の割合を、基準画像Isとほぼ同じにすればよい。そこでG色成分値を固定し、目標値(Rf, Gf, Bf)を算出すると次のようになる。
Rf = Rs/Gs×Gk
Gf = Gk …(4)
Bf = Bs/Gs×Gk
The CPU 104 calculates the target value (Rf) of the average RGB value after color balance adjustment from the average RGB value (Rs, Gs, Bs) of the reference image Is and the average RGB value (Rk, Gk, Bk) of the adjusted image I [k]. , Gf, Bf) is calculated (S501). To give the same color cast to the image I [k] after color balance adjustment as in the reference image Is, the ratio of the G color component value and the R color component value, the G color component value, and the B color of the image I [k] The ratio of the component values may be almost the same as that of the reference image Is. Therefore, when the G color component value is fixed and the target values (Rf, Gf, Bf) are calculated, the result is as follows.
Rf = Rs / Gs × Gk
Gf = Gk (4)
Bf = Bs / Gs × Gk

次に、CPU104は、画像I[k]の平均値RkとBkおよび目標値RfとBfを用いて、基本補正係数γroとγboを下式から計算する(S502)。
γro = log(Rk/255)/log(Rf/255)
γbo = log(Bk/255)/log(Bf/255) …(5)
ここで、0<Rk≦255、0<Bk≦255、
0<Rf<255、0<Bf<255
Next, the CPU 104 calculates basic correction coefficients γro and γbo from the following equations using the average values Rk and Bk and target values Rf and Bf of the image I [k] (S502).
γro = log (Rk / 255) / log (Rf / 255)
γbo = log (Bk / 255) / log (Bf / 255)… (5)
Where 0 <Rk ≦ 255, 0 <Bk ≦ 255,
0 <Rf <255, 0 <Bf <255

図7は画像I[k]の基本補正係数γoと最終補正係数γの計算結果を示す図である。画像I[0]とI[1]はΔs≦Tx(=40)であり、基本補正係数γoと最終補正係数γは等しい。一方、画像I[2]〜I[4]はΔs>Tx(=40)であり、最終補正係数γは1.0に近付くように、または、1.0に修正される。   FIG. 7 is a diagram illustrating calculation results of the basic correction coefficient γo and the final correction coefficient γ of the image I [k]. The images I [0] and I [1] satisfy Δs ≦ Tx (= 40), and the basic correction coefficient γo and the final correction coefficient γ are equal. On the other hand, the images I [2] to I [4] satisfy Δs> Tx (= 40), and the final correction coefficient γ approaches 1.0 or is corrected to 1.0.

●カラーバランス調整
図8は画像I[k]のカラーバランス調整を説明するフローチャートである。
Color Balance Adjustment FIG. 8 is a flowchart for explaining the color balance adjustment of the image I [k].

CPU104は、最終補正係数γrとγbそれぞれと1.0を比較し(S601)、何れも1.0の場合はカラーバランス補正を行わずに処理を終了する。   The CPU 104 compares the final correction coefficients γr and γb with 1.0 (S601), and if both are 1.0, the process ends without performing color balance correction.

最終補正係数γrとγbの何れか一方でも1.0以外の場合、CPU104は、最終補正係数γrとγbを使って、調整前後のR値およびB値の対応を表す一次元ルックアップテーブル(LUT)を作成する(S602)。なお、調整後の値が255を超える場合は255にクリップする。そして、作成したLUTを使って、画像I[k]の全画素のR値とB値を補正する(S603)。   If either of the final correction coefficients γr and γb is other than 1.0, the CPU 104 uses the final correction coefficients γr and γb to generate a one-dimensional lookup table (LUT) that represents the correspondence between the R value and B value before and after adjustment. Create (S602). If the value after adjustment exceeds 255, clip to 255. Then, using the created LUT, the R value and the B value of all the pixels of the image I [k] are corrected (S603).

図5には、彩度の差分Δsが閾値Tx'(=80)より大きい場合に、最終補正係数γを1.0にする(カラーバランス補正を行わない)最終補正係数γの修正方法を示した。しかし、図9に示すように、彩度の差分Δsが最大値255付近において最終補正係数γが1.0になるように、閾値Tx(=40)から滑らかに最終補正係数γを1.0に近付けてもよい。なお、図9にはγo<1.0の場合の修正ラインを示すが、γo>1.0の場合もある。γo>1.0の場合、修正ラインは負の傾きをもつことは言うまでもない。   FIG. 5 shows a method of correcting the final correction coefficient γ by setting the final correction coefficient γ to 1.0 (no color balance correction is performed) when the saturation difference Δs is larger than the threshold value Tx ′ (= 80). However, as shown in FIG. 9, the final correction coefficient γ can be smoothly approached to 1.0 from the threshold Tx (= 40) so that the final correction coefficient γ is 1.0 when the saturation difference Δs is around the maximum value 255. Good. FIG. 9 shows a correction line when γo <1.0, but there are also cases where γo> 1.0. Needless to say, when γo> 1.0, the correction line has a negative slope.

基準画像と調整対象画像の彩度の差分Δsが所定の閾値Txより大きい場合、基準画像Isの色かぶり度合いが、画像I[k]の色かぶり度合いよりもかなり強いと考えられる。そこで、Tx<Δsの場合はカラーバランス調整用の補正係数γを1.0に近付ける(調整の度合いを弱くする)ように修正する。その結果、一頁内にレイアウトする複数の画像をカラーバランス調整して、それら画像に同じ雰囲気を与える場合、元々彩度が低い画像に含まれる人の顔が色かぶりし過ぎる問題を防ぐことができる。   When the difference Δs in saturation between the reference image and the adjustment target image is larger than the predetermined threshold Tx, it is considered that the color fog degree of the reference image Is is considerably stronger than the color fog degree of the image I [k]. Therefore, when Tx <Δs, correction is performed so that the correction coefficient γ for color balance adjustment approaches 1.0 (the degree of adjustment is weakened). As a result, when adjusting the color balance of multiple images laid out on a single page and giving them the same atmosphere, it is possible to prevent the problem that the face of a person included in an image with originally low saturation is overcast. it can.

以下、本発明にかかる実施例2の色処理を説明する。なお、実施例2において、実施例1と略同様の構成については、同一符号を付して、その詳細説明を省略する。   The color processing according to the second embodiment of the present invention will be described below. Note that the same reference numerals in the second embodiment denote the same parts as in the first embodiment, and a detailed description thereof will be omitted.

実施例1では、彩度の差分を利用して最終補正係数γを設定したが、実施例2では、顔の検出技術が利用して、彩度が低く、顔がある写真画像の場合にカラーバランスの調整度合いを弱くする方法を説明する。   In the first embodiment, the final correction coefficient γ is set using the difference in saturation, but in the second embodiment, the face detection technology is used to reduce the color in the case of a photographic image with low saturation and a face. A method of weakening the balance adjustment will be described.

図10は実施例2におけるカラーバランス調整方法を説明するフローチャートで、CPU104が実行する処理である。   FIG. 10 is a flowchart for explaining the color balance adjustment method according to the second embodiment.

CPU104は、実施例1と同じ処理(S301〜S306)を行う。そして、彩度の差分が所定の閾値を超える(Δs>Tx)の場合は、画像I[k]に対して顔の検出を行い(S701)、画像I[k]が顔画像を含むか否かを判定する(S702)。なお、顔の検出方法は、様々な方法が提案されていて、どのような方法を採用してもよい。   The CPU 104 performs the same processing (S301 to S306) as in the first embodiment. If the saturation difference exceeds a predetermined threshold (Δs> Tx), face detection is performed on the image I [k] (S701), and whether or not the image I [k] includes a face image. Is determined (S702). Various methods for detecting the face have been proposed, and any method may be adopted.

画像I[k]が顔画像を含む場合、CPU104は、実施例1と同様の処理(S307)を行い最終補正係数γを計算する。また、画像I[k]が顔画像を含まない場合は、実施例1と同様の処理(S308)を行い最終補正係数を決定する。   When the image I [k] includes a face image, the CPU 104 performs a process (S307) similar to that in the first embodiment and calculates a final correction coefficient γ. If the image I [k] does not include a face image, the same processing (S308) as in the first embodiment is performed to determine the final correction coefficient.

次に、CPU104は、実施例1と同じ処理(S309〜S311)を行う。   Next, the CPU 104 performs the same processing (S309 to S311) as in the first embodiment.

つまり、実施例2においては、基準画像Isに比べて調整対象画像I[k]の彩度が低く、かつ、調整画像I[k]が顔画像を含む場合に、カラーバランスの調整度合いを弱め、それ以外の画像は基準画像Isに合わせたカラーバランス調整を行う。顔の検出処理に若干時間が掛かるが、顔画像を重視した(顔の色に違和感を与えない)カラーバランス調整を行うことができる。   That is, in Example 2, when the saturation of the adjustment target image I [k] is lower than that of the reference image Is and the adjustment image I [k] includes a face image, the degree of adjustment of the color balance is weakened. For other images, color balance adjustment is performed in accordance with the reference image Is. Although the face detection process takes a little time, it is possible to perform color balance adjustment that places importance on the face image (does not give an uncomfortable feeling to the face color).

以下、本発明にかかる実施例3の色処理を説明する。なお、実施例3において、実施例1、2と略同様の構成については、同一符号を付して、その詳細説明を省略する。   Hereinafter, color processing according to the third embodiment of the present invention will be described. Note that the same reference numerals in the third embodiment denote the same parts as in the first and second embodiments, and a detailed description thereof will be omitted.

実施例2では、基準画像Isより調整対象画像I[k]の彩度が低くても、顔がない場合は、基本補正係数γoをそのまま最終補正係数γにする例を説明した。しかし、この方法では、画像I[k]が顔画像を含まない場合に、例えば植物の葉が色かぶりし過ぎる問題は、なお残ることになる。また、顔の検出が難しい横顔や俯いた顔などが色かぶりし過ぎる問題も残る。そこで、実施例3では、顔画像を重視しつつ、顔画像を含まない画像の色かぶりを考慮したカラーバランス調整を説明する。   In the second embodiment, an example has been described in which the basic correction coefficient γo is used as it is as the final correction coefficient γ when there is no face even if the saturation of the adjustment target image I [k] is lower than the reference image Is. However, with this method, when the image I [k] does not include a face image, for example, the problem that the leaves of the plant are too fogged still remains. In addition, there remains a problem that a side face or a crawling face that is difficult to detect a face is too colored. Thus, in the third embodiment, color balance adjustment that considers the color cast of an image that does not include a face image while giving importance to the face image will be described.

図11は実施例3におけるカラーバランス調整方法を説明するフローチャートで、CPU104が実行する処理である。   FIG. 11 is a flowchart for explaining the color balance adjustment method according to the third embodiment.

CPU104は、実施例1と同じ処理(S301〜S306)を行う。そして、彩度の差分が所定の閾値を超える(Δs>Tx)の場合は、実施例2と同様に、画像I[k]に対して顔の検出を行い(S701)、画像I[k]が顔画像を含むか否かを判定する(S702)。なお、顔の検出方法は、様々な方法が提案されていて、どのような方法を採用してもよい。   The CPU 104 performs the same processing (S301 to S306) as in the first embodiment. If the saturation difference exceeds a predetermined threshold (Δs> Tx), face detection is performed on the image I [k] (S701), and the image I [k] It is determined whether or not includes a face image (S702). Various methods for detecting the face have been proposed, and any method may be adopted.

画像I[k]が顔画像を含む場合、CPU104は、1.0に近い補正係数γを算出し易い第一の関数F1(Δs, γo)を使って最終補正係数γrとγbを算出する(S801)。言い換えれば、弱めの最終補正係数γを算出する。   When the image I [k] includes a face image, the CPU 104 calculates the final correction coefficients γr and γb using the first function F1 (Δs, γo) that can easily calculate the correction coefficient γ close to 1.0 (S801). . In other words, a weak final correction coefficient γ is calculated.

一方、画像I[k]が顔画像を含まない場合、CPU104は、関数F1より強めの補正係数γを算出する第二の関数F2(Δs, γo)を使って、最終補正係数γrとγbを算出する(S802)。言い換えれば、少し弱めの最終補正係数γを算出する。   On the other hand, when the image I [k] does not include a face image, the CPU 104 uses the second function F2 (Δs, γo) that calculates a correction coefficient γ stronger than the function F1, and calculates the final correction coefficients γr and γb. Calculate (S802). In other words, a slightly weaker final correction coefficient γ is calculated.

次に、CPU104は、実施例1と同じ処理(S309〜S311)を行う。   Next, the CPU 104 performs the same processing (S309 to S311) as in the first embodiment.

図5、9に限定するわけではないが、例えば、関数F1は図5に示すような関数であり、関数F2は図9に示すような関数である。言い換えれば、画像I[k]が顔画像を含む場合は、1.0に近い弱い補正係数γを算出し易い関数F1を利用し、顔画像を含まない場合は、基本補正係数γoに近い補正係数γを算出し易い関数F2を利用する。   Although not limited to FIGS. 5 and 9, for example, the function F1 is a function as shown in FIG. 5, and the function F2 is a function as shown in FIG. In other words, when the image I [k] includes a face image, the function F1 that easily calculates a weak correction coefficient γ close to 1.0 is used, and when the image I [k] does not include a face image, the correction coefficient γ close to the basic correction coefficient γo. The function F2 is used to easily calculate

実施例3は、顔の検出結果に応じて二つの関数を選択するため、実施例2に比べるとやや煩雑になる。しかし、顔が検出されない場合でも、画像I[k]の彩度が基準画像Isの彩度に比べて小さい場合は、最終補正係数γを若干弱めることができる。その結果、実施例2に比べて、個々の写真画像が含む画像を配慮した補正を行うことができる。   In the third embodiment, since two functions are selected according to the face detection result, the second embodiment is slightly more complicated than the second embodiment. However, even when a face is not detected, the final correction coefficient γ can be slightly weakened if the saturation of the image I [k] is smaller than the saturation of the reference image Is. As a result, it is possible to perform correction in consideration of an image included in each photographic image as compared with the second embodiment.

以下、本発明にかかる実施例4の色処理を説明する。なお、実施例4において、実施例1〜3と略同様の構成については、同一符号を付して、その詳細説明を省略する。   The color processing according to the fourth embodiment of the present invention will be described below. Note that the same reference numerals in the fourth embodiment denote the same parts as in the first to third embodiments, and a detailed description thereof will be omitted.

写真画像に撮影時情報(例えばExifデータ)が付加されている場合、その情報を利用することができる。実施例4では、Exifデータの撮影シーンタイプタグを利用してカラーバランス調整を行う例を説明する。なお、撮影シーンタイプタグは、撮影時の被写体の種別を示し、撮影時の撮影モードが記録されていることもある。タグ番号は41990であり、その値が「2」であれば、被写体の種別が人物であることを示す。   When shooting time information (for example, Exif data) is added to a photographic image, the information can be used. In the fourth embodiment, an example in which color balance adjustment is performed using a shooting scene type tag of Exif data will be described. The shooting scene type tag indicates the type of the subject at the time of shooting, and the shooting mode at the time of shooting may be recorded. The tag number is 41990, and a value of “2” indicates that the subject type is a person.

図12は実施例4におけるカラーバランス調整方法を説明するフローチャートで、CPU104が実行する処理である。   FIG. 12 is a flowchart for explaining the color balance adjustment method according to the fourth embodiment.

CPU104は、実施例1と同じ処理(S301〜S306)を行う。そして、彩度の差分が所定の閾値を超える(Δs>Tx)の場合は、画像I[k]のExifデータを取得し(S901)、タグ番号41990の値が「2」(撮影シーンタイプが人物)か否かを判定する(S902)。   The CPU 104 performs the same processing (S301 to S306) as in the first embodiment. If the saturation difference exceeds a predetermined threshold (Δs> Tx), the Exif data of the image I [k] is acquired (S901), and the value of the tag number 41990 is “2” (the shooting scene type is It is determined whether or not a person is present (S902).

撮影シーンタイプが人物の場合、CPU104は、実施例1と同様の処理(S307)を行い最終補正係数γを計算する。また、撮影シーンタイプが人物以外の場合は、実施例1と同様の処理(S308)を行い最終補正係数を決定する。あるいは、実施例3のように、撮影シーンタイプが人物の場合は関数F1(Δs, γo)を使ってγrとγbを算出し(S801)、撮影シーンタイプが人物以外の場合は関数F2(Δs, γo)を使ってγrとγbを算出(S802)してもよい。   When the shooting scene type is a person, the CPU 104 performs the same processing (S307) as that of the first embodiment and calculates the final correction coefficient γ. If the shooting scene type is other than person, the same processing (S308) as in the first embodiment is performed to determine the final correction coefficient. Alternatively, as in the third embodiment, when the shooting scene type is a person, the function F1 (Δs, γo) is used to calculate γr and γb (S801), and when the shooting scene type is other than a person, the function F2 (Δs , γo) may be used to calculate γr and γb (S802).

次に、CPU104は、実施例1と同じ処理(S309〜S311)を行う。   Next, the CPU 104 performs the same processing (S309 to S311) as in the first embodiment.

なお、Exif2.2は、撮影シーンタイプを推奨タグとして規定し、必ずしも写真画像のデータファイルに記載されているとは限らない。また、Exif2.2以前には撮影シーンタイプに対応するタグがない。しかし、撮影時に付加されるExif情報を利用すれば、顔の検出処理を行わずに(処理時間を短縮し、処理負荷を軽減して)、顔画像が色かぶりし過ぎる問題を防ぐことができる。   Exif 2.2 defines the shooting scene type as a recommended tag and is not always described in the data file of the photographic image. Also, there is no tag corresponding to the shooting scene type before Exif 2.2. However, using the Exif information added at the time of shooting can prevent the face image from being overcast without reducing the face detection process (reducing processing time and processing load). .

[変形例]
上記の実施例では、基準画像Isの平均RGB値(Rs, Gs, Bs)と調整画像I[k]の平均RGB値(Rk, Gk, Bk)を用いて基本カラーバランス調整係数を求めた。しかし、他の画像の特徴量を用いて基本カラーバランス調整係数を求めるようにしても構わない。例えば、特徴量として、色に応じて重み付けした重み付け平均値、ハイライト部やシャドウ部の平均RGB値などを使用するようにしても構わない。
[Modification]
In the above embodiment, the basic color balance adjustment coefficient is obtained using the average RGB values (Rs, Gs, Bs) of the reference image Is and the average RGB values (Rk, Gk, Bk) of the adjusted image I [k]. However, the basic color balance adjustment coefficient may be obtained using the feature amount of another image. For example, a weighted average value weighted according to a color, an average RGB value of a highlight portion or a shadow portion, or the like may be used as the feature amount.

また、上記の実施例のように、R成分とB成分に対する調整係数を使用するのではなく、マトリクスなどの他の調整方法を使用してもよい。   Further, instead of using adjustment coefficients for the R component and the B component as in the above embodiment, other adjustment methods such as a matrix may be used.

実施例2、3では、調整対象画像I[k]が顔画像を含むか否かによりカラーバランス調整を弱める度合い(補正係数γ)を決定したが、顔画像が画像全体に占める面積の割合(占有率)によって、補正係数γを決定してもよい。例えば、占有率が15%以上の場合、顔を重視して撮影された写真画像と判断することができる。そこで、占有率が15%を以上の場合は基本補正係数γoを弱めた値を最終補正係数γにし、15%未満の場合は雰囲気を重視して基本補正係数γoをそのまま最終補正係数γにする。   In the second and third embodiments, the degree to which the color balance adjustment is weakened (correction coefficient γ) is determined depending on whether or not the adjustment target image I [k] includes a face image, but the ratio of the area of the face image to the entire image ( The correction coefficient γ may be determined according to the occupation ratio. For example, when the occupation ratio is 15% or more, it can be determined that the photograph image is taken with emphasis on the face. Therefore, if the occupation ratio is 15% or more, the value obtained by weakening the basic correction coefficient γo is used as the final correction coefficient γ, and if it is less than 15%, the atmosphere is emphasized and the basic correction coefficient γo is used as it is as the final correction coefficient γ .

実施例4では、撮影シーンタイプタグを利用する例を説明したが、露出プログラムタグを利用してもよい。露出プログラムタグの値「7」はポートレートモードを表す。従って、ステップS902で、Exif IFDの中の露出プログラムタグ(タグ番号34850)の値が「7」(ポートレートモード)か否かを判定する。そして、「7」であれば処理をステップS307(S801)へ進め、「7」以外であれば処理をステップS308(S802)へ進める。   In the fourth embodiment, an example in which the shooting scene type tag is used has been described. However, an exposure program tag may be used. The value “7” of the exposure program tag represents the portrait mode. Accordingly, in step S902, it is determined whether or not the value of the exposure program tag (tag number 34850) in the Exif IFD is “7” (portrait mode). If “7”, the process proceeds to step S307 (S801), and if other than “7”, the process proceeds to step S308 (S802).

勿論、撮影シーンタイプタグと露出プラグラムタグの両方を利用して、最終補正係数γを決定してもよい。また、撮影時の付加情報として、メーカノートタグに記録された各社独自の情報を利用してもよい。   Of course, the final correction coefficient γ may be determined using both the shooting scene type tag and the exposure program tag. Further, as the additional information at the time of photographing, information unique to each company recorded in the maker note tag may be used.

あるいは、撮影後の編集作業やセレクト作業の際に、人物が写っていることを示す情報を画像データに付加し、その付加情報を利用して、最終補正係数γを決めてもよい。また、画像データに付加された情報から、人物を撮影したことを示す情報が得られる場合と、そうでない場合に応じて最終補正係数γを計算する関数を分けてもよい。   Alternatively, information indicating that a person is captured may be added to the image data at the time of editing or selecting after shooting, and the final correction coefficient γ may be determined using the additional information. Further, the function for calculating the final correction coefficient γ may be divided according to the case where information indicating that a person is photographed is obtained from the information added to the image data and the case where the information is not obtained.

[他の実施例]
なお、本発明は、複数の機器(例えばコンピュータ、インタフェイス機器、リーダ、プリンタなど)から構成されるシステムに適用しても、一つの機器からなる装置(例えば、複写機、ファクシミリ装置、制御装置など)に適用してもよい。
[Other embodiments]
Note that the present invention can be applied to a system constituted by a plurality of devices (for example, a computer, an interface device, a reader, a printer, etc.), but an apparatus (for example, a copier, a facsimile machine, a control device) composed of a single device. Etc.).

また、本発明の目的は、上記実施例の機能を実現するコンピュータプログラムを記録した記憶媒体をシステムまたは装置に供給し、そのシステムまたは装置のコンピュータ(CPUやMPU)が前記コンピュータプログラムを実行することでも達成される。この場合、記憶媒体から読み出されたソフトウェア自体が上記実施例の機能を実現することになり、そのコンピュータプログラムと、そのコンピュータプログラムを記憶する、コンピュータが読み取り可能な記憶媒体は本発明を構成する。   Another object of the present invention is to supply a storage medium storing a computer program for realizing the functions of the above-described embodiments to a system or apparatus, and the computer (CPU or MPU) of the system or apparatus executes the computer program. But it is achieved. In this case, the software read from the storage medium itself realizes the functions of the above embodiments, and the computer program and the computer-readable storage medium storing the computer program constitute the present invention. .

また、前記コンピュータプログラムの実行により上記機能が実現されるだけではない。つまり、そのコンピュータプログラムの指示により、コンピュータ上で稼働するオペレーティングシステム(OS)および/または第一の、第二の、第三の、…プログラムなどが実際の処理の一部または全部を行い、それによって上記機能が実現される場合も含む。   Further, the above functions are not only realized by the execution of the computer program. That is, according to the instruction of the computer program, the operating system (OS) and / or the first, second, third,... This includes the case where the above function is realized.

また、前記コンピュータプログラムがコンピュータに接続された機能拡張カードやユニットなどのデバイスのメモリに書き込まれていてもよい。つまり、そのコンピュータプログラムの指示により、第一の、第二の、第三の、…デバイスのCPUなどが実際の処理の一部または全部を行い、それによって上記機能が実現される場合も含む。   The computer program may be written in a memory of a device such as a function expansion card or unit connected to the computer. That is, it includes the case where the CPU of the first, second, third,... Device performs part or all of the actual processing according to the instructions of the computer program, thereby realizing the above functions.

本発明を前記記憶媒体に適用する場合、その記憶媒体には、先に説明したフローチャートに対応または関連するコンピュータプログラムが格納される。   When the present invention is applied to the storage medium, the storage medium stores a computer program corresponding to or related to the flowchart described above.

実施例1の画像処理装置(色処理装置)の構成例を示すブロック図、FIG. 1 is a block diagram illustrating a configuration example of an image processing apparatus (color processing apparatus) according to a first embodiment; 一頁内に複数の写真画像がレイアウトされたアルバムの一例を示す図、A diagram showing an example of an album in which a plurality of photo images are laid out on one page, カラーバランス調整方法を説明するフローチャート、A flowchart for explaining a color balance adjustment method; 写真画像の平均RGB値および平均彩度Sの計算結果の一例を示す図、The figure which shows an example of the calculation result of the average RGB value and average saturation S of a photograph image, 最終補正係数γを修正する方法を説明する図、A diagram for explaining a method of correcting the final correction coefficient γ, 基本補正係数γoの計算を説明するフローチャート、A flowchart for explaining the calculation of the basic correction coefficient γo; 画像I[k]の基本補正係数γoと最終補正係数γの計算結果を示す図、The figure which shows the calculation result of basic correction coefficient γo and final correction coefficient γ of image I [k] 画像I[k]のカラーバランス調整を説明するフローチャート、A flowchart for explaining color balance adjustment of an image I [k], 最終補正係数γを修正する別の方法を説明する図、The figure explaining another method of correcting the final correction coefficient γ, 実施例2におけるカラーバランス調整方法を説明するフローチャート、Flowchart for explaining a color balance adjustment method in Embodiment 2, 実施例3におけるカラーバランス調整方法を説明するフローチャート、Flowchart for explaining a color balance adjustment method in Embodiment 3, 実施例4におけるカラーバランス調整方法を説明するフローチャートである。10 is a flowchart for explaining a color balance adjustment method in Embodiment 4.

Claims (11)

処理対象画像の色調を基準画像の色調に合わせるように修正する色処理装置であって、
色調の基準となる基準画像と、色調整対象の画像を入力する入力手段と、
前記基準画像の特徴量および前記色調整対象の画像の特徴量を算出する算出手段と、
前記基準画像の彩度および前記色調整対象の画像の彩度を計算する計算手段と、
前記基準画像および前記色調整対象の画像の特徴量および彩度に基づき、前記色調整対象の画像の色調が前記基準画像の色調に近付くように、前記色調整対象の画像に対する色調整条件を設定する設定手段と、
前記設定された色調整条件を用いて、前記色調整対象の画像を色調整する調整手段とを有し、
前記設定手段は、前記基準画像の彩度よりも前記色調整対象の画像の彩度が低い場合は、前記色調整の調整量を低減するように、前記色調整条件を調整することを特徴とする色処理装置。
A color processing device that corrects the color tone of a processing target image to match the color tone of a reference image,
An input means for inputting a reference image as a reference for color tone, and an image to be color-adjusted;
Calculating means for calculating the feature amount of the reference image and the feature amount of the image to be color-adjusted;
Calculating means for calculating the saturation of the reference image and the saturation of the image to be color-adjusted;
Based on the feature amount and saturation of the reference image and the color adjustment target image, a color adjustment condition for the color adjustment target image is set so that the color tone of the color adjustment target image approaches the color tone of the reference image Setting means to
Adjusting means for adjusting the color of the image to be color-adjusted using the set color adjustment conditions;
The setting means adjusts the color adjustment condition so as to reduce the adjustment amount of the color adjustment when the saturation of the color adjustment target image is lower than the saturation of the reference image. Color processing device.
前記設定手段は、前記基準画像の彩度と前記色調整対象の画像の彩度の差分の絶対値が所定の閾値を超えない場合、前記色調整条件の調整を行わないことを特徴とする請求項1に記載された色処理装置。   The setting means does not adjust the color adjustment condition when the absolute value of the difference between the saturation of the reference image and the saturation of the image to be color adjusted does not exceed a predetermined threshold. Item 2. A color processing apparatus according to Item 1. 前記設定手段は、前記差分の絶対値が前記所定の閾値を超える場合は、前記色調整条件を調整して前記色調整の調整量を低減することを特徴とする請求項2に記載された色処理装置。   3. The color according to claim 2, wherein when the absolute value of the difference exceeds the predetermined threshold, the setting unit reduces the adjustment amount of the color adjustment by adjusting the color adjustment condition. Processing equipment. さらに、前記色調整対象の画像から顔画像を検出する検出手段を有し、
前記設定手段は、前記差分の絶対値が前記所定の閾値を超え、前記顔画像が検出された場合は、前記色調整条件を調整して前記色調整の調整量を低減することを特徴とする請求項2に記載された色処理装置。
Furthermore, it has a detection means for detecting a face image from the color adjustment target image,
When the absolute value of the difference exceeds the predetermined threshold and the face image is detected, the setting unit adjusts the color adjustment condition to reduce the adjustment amount of the color adjustment. The color processing apparatus according to claim 2.
さらに、前記色調整対象の画像から顔画像を検出する検出手段を有し、
前記設定手段は、前記差分の絶対値が前記所定の閾値を超えた場合、前記顔画像が検出されると、第一の関数により前記色調整条件を調整して前記色調整の調整量を低減し、前記顔画像が検出されないと、第二の関数により前記色調整条件を調整して前記色調整の調整量を低減し、前記第一の関数は前記第二の関数に比べて前記調整量の低減が大きいことを特徴とする請求項2に記載された色処理装置。
Furthermore, it has a detection means for detecting a face image from the color adjustment target image,
If the absolute value of the difference exceeds the predetermined threshold and the face image is detected, the setting means adjusts the color adjustment condition using a first function to reduce the adjustment amount of the color adjustment If the face image is not detected, the color adjustment condition is adjusted by a second function to reduce the adjustment amount of the color adjustment, and the first function is less than the second function. 3. The color processing apparatus according to claim 2, wherein the reduction of the color is large.
さらに、前記色調整対象の画像から撮影時情報を取得する取得手段を有し、
前記設定手段は、前記差分の絶対値が前記所定の閾値を超え、前記撮影時情報が人物の撮影を表す場合は、前記色調整条件を調整して前記色調整の調整量を低減することを特徴とする請求項2に記載された色処理装置。
Furthermore, it has acquisition means for acquiring shooting time information from the color adjustment target image,
When the absolute value of the difference exceeds the predetermined threshold value and the shooting time information represents shooting of a person, the setting means adjusts the color adjustment condition to reduce the adjustment amount of the color adjustment. 3. The color processing apparatus according to claim 2, wherein the color processing apparatus is characterized.
前記設定手段は、前記基準画像および前記色調整対象の画像の各色成分の平均値から前記色調整条件を設定することを特徴とする請求項1から請求項6の何れか一項に記載された色処理装置。   7. The setting unit according to claim 1, wherein the setting unit sets the color adjustment condition from an average value of each color component of the reference image and the color adjustment target image. Color processing device. 前記設定手段は、前記基準画像および前記色調整対象のG色成分の平均値に対するR色成分の平均値の比から前記色調整条件として前記R色成分の色調整係数を設定し、前記基準画像および前記色調整対象の前記G色成分の平均値に対するB色成分の平均値の比から前記色調整条件として前記B色成分の色調整係数を設定することを特徴とする請求項7に記載された色処理装置。   The setting means sets a color adjustment coefficient of the R color component as the color adjustment condition from a ratio of an average value of the R color component to an average value of the G color component of the reference image and the color adjustment target, and the reference image 8. The color adjustment coefficient of the B color component is set as the color adjustment condition from the ratio of the average value of the B color component to the average value of the G color component of the color adjustment target. Color processing device. 処理対象画像の色調を基準画像の色調に合わせるように修正する色処理方法であって、
色調の基準となる基準画像と、色調整対象の画像を入力するステップと、
前記基準画像の特徴量および前記色調整対象の画像の特徴量を算出するステップと、
前記基準画像の彩度および前記色調整対象の画像の彩度を計算するステップと、
前記基準画像および前記色調整対象の画像の特徴量および彩度に基づき、前記色調整対象の画像の色調が前記基準画像の色調に近付くように、前記色調整対象の画像に対する色調整条件を設定する設定ステップと、
前記設定された色調整条件を用いて、前記色調整対象の画像を色調整するステップとを有し、
前記設定ステップは、前記基準画像の彩度よりも前記色調整対象の画像の彩度が低い場合は、前記色調整の調整量を低減するように、前記色調整条件を調整することを特徴とする色処理方法。
A color processing method for correcting the color tone of a processing target image to match the color tone of a reference image,
A step of inputting a reference image to be a reference for color tone and an image to be color-adjusted;
Calculating a feature amount of the reference image and a feature amount of the color adjustment target image;
Calculating the saturation of the reference image and the saturation of the color adjustment target image;
Based on the feature amount and saturation of the reference image and the color adjustment target image, a color adjustment condition for the color adjustment target image is set so that the color tone of the color adjustment target image approaches the color tone of the reference image A setting step to
Adjusting the color adjustment target image using the set color adjustment conditions,
The setting step adjusts the color adjustment condition so as to reduce an adjustment amount of the color adjustment when the saturation of the image to be color adjusted is lower than the saturation of the reference image. Color processing method.
コンピュータ装置を制御して、請求項1から請求項8の何れか一項に記載された色処理装置の各手段として機能させることを特徴とするコンピュータプログラム。   9. A computer program for controlling a computer device to function as each unit of the color processing device according to claim 1. 請求項10に記載されたコンピュータプログラムが記録されたことを特徴とするコンピュータが読み取り可能な記憶媒体。   11. A computer-readable storage medium in which the computer program according to claim 10 is recorded.
JP2007303540A 2007-11-22 2007-11-22 Color processor and method thereof Withdrawn JP2009130630A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007303540A JP2009130630A (en) 2007-11-22 2007-11-22 Color processor and method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007303540A JP2009130630A (en) 2007-11-22 2007-11-22 Color processor and method thereof

Publications (1)

Publication Number Publication Date
JP2009130630A true JP2009130630A (en) 2009-06-11

Family

ID=40821111

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007303540A Withdrawn JP2009130630A (en) 2007-11-22 2007-11-22 Color processor and method thereof

Country Status (1)

Country Link
JP (1) JP2009130630A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011035894A (en) * 2009-07-07 2011-02-17 Sony Corp Image processing device, image processing method, and program
WO2021157900A1 (en) * 2020-02-05 2021-08-12 삼성전자 주식회사 Method for providing filter and electronic device supporting same

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011035894A (en) * 2009-07-07 2011-02-17 Sony Corp Image processing device, image processing method, and program
WO2021157900A1 (en) * 2020-02-05 2021-08-12 삼성전자 주식회사 Method for providing filter and electronic device supporting same
KR20210099975A (en) * 2020-02-05 2021-08-13 삼성전자주식회사 Method for providing filter and electronic device for supporting the same
KR102671722B1 (en) * 2020-02-05 2024-06-04 삼성전자주식회사 Method for providing filter and electronic device for supporting the same

Similar Documents

Publication Publication Date Title
CN110447051B (en) Perceptually preserving contrast and chroma of a reference scene
US7583403B2 (en) Image processing device
US20180041691A1 (en) Camera using preview image to select exposure
US9723285B2 (en) Multi-area white-balance control device, multi-area white-balance control method, multi-area white-balance control program, computer in which multi-area white-balance control program is recorded, multi-area white-balance image-processing device, multi-area white-balance image-processing method, multi-area white-balance image-processing program, computer in which multi-area white-balance image-processing program is recorded, and image-capture apparatus
CN101103635B (en) White balance correction in digital camera images
US7076119B2 (en) Method, apparatus, and program for image processing
JP4906627B2 (en) Image processing apparatus, image processing method, computer program, and storage medium
JP4854748B2 (en) Development server and development method
US6504952B1 (en) Image processing method and apparatus
US8861849B2 (en) Image processing
JP2006121695A (en) Device and method for color correction of input image
JP2003179756A (en) Method for processing data from digital image and program product
JP4924114B2 (en) Image processing program and image processing method
JP2008283291A (en) Development processor for undeveloped image data, development processing method, and computer program for development processing
JP6178590B2 (en) Image processing apparatus, image processing method, program, and storage medium
WO2018175337A1 (en) Perceptually preserving scene-referred contrasts and chromaticities
JP4979090B2 (en) Image processing apparatus, image processing method, program, and recording medium
JP2009130630A (en) Color processor and method thereof
JP5070921B2 (en) Development processing apparatus for undeveloped image data, development processing method, and computer program for development processing
JP2006350621A (en) Image processor and image processing program
JPH1155688A (en) Image color conversion method and its system
JP2007312125A (en) Image processor, image processing method, and image processing program
JP2002094810A (en) Picture processor, picture processing method and memory medium having stored programs for the method
KR101241263B1 (en) Apparatus and method for generating catalog image and program therefor
JP2004023347A (en) Apparatus, system and method of image processing, storage medium and program

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20110201