JP2009116691A - Image processing method, image processor, and program - Google Patents

Image processing method, image processor, and program Download PDF

Info

Publication number
JP2009116691A
JP2009116691A JP2007290013A JP2007290013A JP2009116691A JP 2009116691 A JP2009116691 A JP 2009116691A JP 2007290013 A JP2007290013 A JP 2007290013A JP 2007290013 A JP2007290013 A JP 2007290013A JP 2009116691 A JP2009116691 A JP 2009116691A
Authority
JP
Japan
Prior art keywords
image
scene
color
partial
correction
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.)
Pending
Application number
JP2007290013A
Other languages
Japanese (ja)
Inventor
Yoshiori Matsumoto
佳織 松本
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 JP2007290013A priority Critical patent/JP2009116691A/en
Publication of JP2009116691A publication Critical patent/JP2009116691A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

<P>PROBLEM TO BE SOLVED: To surely perform correction processing suitable for an image when a color area of complementary colors is included in the image. <P>SOLUTION: An image processing method executes first correction processing or second correction processing for an image. When a color followed by the execution of the second correction processing for a first color approximates an achromatic color as compared with the execution of the first processing and a color followed by the execution of the first correction processing for a second color approximates an achromatic color as compared with the execution of the second correction processing, the first correction processing or the second correction processing is selected according to a rate of the first color to the second color in the image. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、画像処理方法、画像処理装置、及びプログラムに関する。   The present invention relates to an image processing method, an image processing apparatus, and a program.

画像データに基づいて画像のシーンを識別し、識別したシーンに適した補正処理を行う画像処理方法が提案されている。例えば、風景のシーンと識別された画像に対しては、葉の緑色を強調するような補正を行い、紅葉のシーンと識別された画像に対しては、赤色を強調するような補正を行う。補正処理の方法としては、例えば、そのシーンの所定の色(以下、記憶色ともいう)に対する最適値を設定しておき、画像から得られる記憶色の平均値と、予め定めた最適値との差を解消するように補正を行う方法がある。
特開2001−169135号公報
There has been proposed an image processing method for identifying a scene of an image based on image data and performing a correction process suitable for the identified scene. For example, a correction that emphasizes the green color of the leaves is performed for an image identified as a landscape scene, and a correction that emphasizes the red color is performed for an image that is identified as a scene of autumn leaves. As a correction processing method, for example, an optimum value for a predetermined color of the scene (hereinafter also referred to as a memory color) is set, and an average value of the memory color obtained from the image and a predetermined optimum value are set. There is a method of correcting so as to eliminate the difference.
JP 2001-169135 A

ところで、画像は、通常、複数の色を含んで形成されており、同一の画像の中に、色相環で対向位置に位置し、混ぜると無彩色(灰色)になる色(以下、補色ともいう)が含まれていることがある。例えば、紅葉のシーンの画像の場合、赤色の葉と、赤色の補色である緑色の葉が含まれていることがある。このような画像を補正する場合に、補色の一方を強調する補正を行うと、補色の他方が劣化する。なお、劣化とは色が無彩色(灰色)に近づくことである。例えば、紅葉の赤色を強調する補正を行うと、緑色が劣化する。逆に、緑色を強調する風景の補正を行うと、赤色が劣化する。このため、例えば上述した紅葉のシーンの画像に紅葉の補正を行うと、緑色が劣化することによって画像全体として満足のいく補正結果が得られないことがある。   By the way, an image is usually formed to include a plurality of colors. In the same image, a color that is located at the opposite position in the hue circle and becomes an achromatic color (gray) when mixed (hereinafter also referred to as a complementary color). ) May be included. For example, in the case of an autumnal scene image, a red leaf and a green leaf that is a complementary color of red may be included. When correcting such an image, if correction for emphasizing one of the complementary colors is performed, the other of the complementary colors deteriorates. Degradation means that the color approaches an achromatic color (gray). For example, when correction for enhancing the red color of autumn leaves is performed, the green color deteriorates. On the other hand, when a landscape that emphasizes green is corrected, the red color deteriorates. For this reason, for example, if correction of autumn leaves is performed on the image of the autumnal scene described above, a satisfactory correction result may not be obtained for the entire image due to deterioration of green color.

このように、従来、画像の中に補色の関係の色の領域が含まれる場合、その画像に適した補正処理を行うのが困難であるという問題点があった。   As described above, conventionally, when a complementary color-related color region is included in an image, it is difficult to perform correction processing suitable for the image.

本発明は、上記のような課題に鑑みてなされたものであり、その目的は、画像に適した補正処理を確実に行うことにある。   The present invention has been made in view of the problems as described above, and an object thereof is to reliably perform a correction process suitable for an image.

前記目的を達成するための主たる発明は、画像に対して第1補正処理又は第2補正処理を実行する画像処理方法において、第1色に対して、前記第2補正処理を実行すると、前記第1補正処理を実行したときよりも色が無彩色に近づき、且つ、前記第2色に対して、前記第1補正処理を実行すると、前記第2補正処理を実行したときよりも色が無彩色に近づく場合、画像の中の前記第1色と前記第2色の割合に応じて、前記第1補正処理又は前記第2補正処理を選択する、ことを特徴とする。   In a main invention for achieving the above object, in the image processing method for executing the first correction process or the second correction process on the image, the second correction process is executed on the first color. When the first correction process is executed, the color approaches an achromatic color, and when the first correction process is executed for the second color, the color is achromatic as compared with the second correction process. In the case of approaching, the first correction process or the second correction process is selected according to the ratio of the first color and the second color in the image.

本発明の他の特徴は、本明細書、及び添付図面の記載により、明らかにする。   Other features of the present invention will become apparent from the description of this specification and the accompanying drawings.

===開示の概要===
本明細書及び添付図面の記載により、少なくとも以下の事項が明らかになる。
=== Summary of disclosure ===
At least the following matters will become apparent from the description of the present specification and the accompanying drawings.

すなわち、画像に対して第1補正処理又は第2補正処理を実行する画像処理方法において、第1色に対して、前記第2補正処理を実行すると、前記第1補正処理を実行したときよりも色が無彩色に近づき、且つ、前記第2色に対して、前記第1補正処理を実行すると、前記第2補正処理を実行したときよりも色が無彩色に近づく場合、画像の中の前記第1色と前記第2色の割合に応じて、前記第1補正処理又は前記第2補正処理を選択する、ことを特徴とする画像処理方法が明らかになる。
このような画像処理方法によれば、画像に適した補正処理を確実に行うことができる。
That is, in the image processing method for executing the first correction process or the second correction process on the image, when the second correction process is executed for the first color, it is more than when the first correction process is executed. When the color approaches an achromatic color and the first correction process is performed on the second color, the color in the image is closer to the achromatic color than when the second correction process is performed. The image processing method is characterized in that the first correction process or the second correction process is selected according to the ratio between the first color and the second color.
According to such an image processing method, it is possible to reliably perform a correction process suitable for an image.

かかる画像処理方法であって、前記第1色と前記第2色は、互いに補色の関係の色である、ことが好ましい。
このような画像処理方法によれば、画像に対してより適切な補正処理を行うことができる。
In this image processing method, it is preferable that the first color and the second color are complementary colors.
According to such an image processing method, more appropriate correction processing can be performed on the image.

かかる画像処理方法は、第1色が赤色であり、第2色が緑色である場合に好適である。   This image processing method is suitable when the first color is red and the second color is green.

かかる画像処理方法であって、前記割合が同じ場合、前記第2補正処理を選択する、ことが好ましい。
このような画像処理方法によれば、赤色と緑色の割合が同じ場合、視覚に敏感な緑色が無彩色に近づくことを防止できるので、画像に適した補正の方を行うことができる。
In this image processing method, it is preferable that the second correction process is selected when the ratio is the same.
According to such an image processing method, when the ratio of red and green is the same, it is possible to prevent the visually sensitive green from approaching an achromatic color, and therefore, it is possible to perform correction suitable for the image.

かかる画像処理方法であって、前記第1補正処理は、前記第1色を強調する処理であり、前記第2補正処理は、前記第2色を強調する処理である、ことが好ましい。
このような画像処理方法によれば、画像のシーンの特徴を強めることができる。
In this image processing method, it is preferable that the first correction process is a process that emphasizes the first color, and the second correction process is a process that emphasizes the second color.
According to such an image processing method, the feature of the scene of the image can be strengthened.

かかる画像処理方法であって、画像の中の前記第2色に対する前記第1色の割合が閾値よりも大きい場合、前記第1補正処理を選択し、前記割合が前記閾値以下の場合、前記第2補正処理を選択する、ことが好ましい。
このような画像処理方法によれば、第1色と第2色の割合と、閾値との比較によって、画像に適した補正処理を容易に選択することができる。
In this image processing method, when the ratio of the first color to the second color in the image is greater than a threshold, the first correction process is selected, and when the ratio is equal to or less than the threshold, It is preferable to select two correction processes.
According to such an image processing method, a correction process suitable for an image can be easily selected by comparing the ratio between the first color and the second color with a threshold value.

また、画像に対して第1補正処理又は第2補正処理を実行するコントローラを備えた画像処理装置において、第1色に対して、前記第2補正処理を実行すると、前記第1補正処理を実行したときよりも色が無彩色に近づき、且つ、前記第2色に対して、前記第1補正処理を実行すると、前記第2補正処理を実行したときよりも色が無彩色に近づく場合、前記コントローラは、画像の中の前記第1色と前記第2色の割合に応じて、前記第1補正処理又は前記第2補正処理を選択する、ことを特徴とする画像処理装置が明らかとなる。   Further, in the image processing apparatus including a controller that executes the first correction process or the second correction process on the image, the first correction process is executed when the second correction process is executed on the first color. When the color is closer to an achromatic color than when the second correction process is performed, and the color is closer to the achromatic color than when the second correction process is performed, The image processing apparatus is characterized in that the controller selects the first correction process or the second correction process according to the ratio of the first color and the second color in the image.

また、画像処理装置に、画像に対して第1補正処理又は第2補正処理を実行させるプログラムにおいて、第1色に対して、前記第2補正処理を実行すると、前記第1補正処理を実行したときよりも色が無彩色に近づき、且つ、前記第2色に対して、前記第1補正処理を実行すると、前記第2補正処理を実行したときよりも色が無彩色に近づく場合、前記画像処理装置に、画像の中の前記第1色と前記第2色の割合に応じて、前記第1補正処理又は前記第2補正処理を選択させる、ことを特徴とするプログラムが明らかとなる。   In the program for causing the image processing apparatus to execute the first correction process or the second correction process on the image, the first correction process is executed when the second correction process is executed on the first color. When the color is closer to an achromatic color than when the first correction process is performed on the second color, the image is closer to the achromatic color than when the second correction process is performed. A program that makes the processing apparatus select the first correction process or the second correction process according to the ratio of the first color and the second color in the image becomes clear.

===全体構成===
図1は、画像処理システムの説明図である。この画像処理システムは、デジタルスチルカメラ2と、プリンタ4とを備える。
=== Overall structure ===
FIG. 1 is an explanatory diagram of an image processing system. This image processing system includes a digital still camera 2 and a printer 4.

デジタルスチルカメラ2は、被写体をデジタルデバイス(CCDなど)に結像させることによりデジタル画像を取得するカメラである。デジタルスチルカメラ2には、モード設定ダイヤル2Aが設けられている。ユーザは、モード設定ダイヤル2Aによって、撮影条件に応じた撮影モードを設定することができる。例えば、モード設定ダイヤル2Aによって、「夜景」モードが設定されると、デジタルスチルカメラ2は、シャッター速度を遅くしたり、ISO感度を高くしたりして、夜景撮影に適した撮影条件にて撮影を行う。   The digital still camera 2 is a camera that acquires a digital image by forming an image of a subject on a digital device (CCD or the like). The digital still camera 2 is provided with a mode setting dial 2A. The user can set the shooting mode according to the shooting conditions by using the mode setting dial 2A. For example, when the “night scene” mode is set by the mode setting dial 2A, the digital still camera 2 captures images under shooting conditions suitable for night scene shooting by decreasing the shutter speed or increasing the ISO sensitivity. I do.

デジタルスチルカメラ2は、ファイルフォーマット規格に準拠して、撮影により生成した画像ファイルをメモリカード6に保存する。画像ファイルには、撮影した画像のデジタルデータ(画像データ)だけでなく、撮影時の撮影条件(撮影データ)等の付加データも保存される。   The digital still camera 2 stores an image file generated by photographing in the memory card 6 in accordance with the file format standard. In the image file, not only digital data (image data) of a captured image but also additional data such as a shooting condition (shooting data) at the time of shooting is stored.

プリンタ4は、画像データの示す画像を紙に印刷する印刷装置である。プリンタ4には、メモリカード6を挿入するスロット21が設けられている。ユーザは、デジタルスチルカメラ2で撮影した後、デジタルスチルカメラ2からメモリカード6を取り出し、スロット21にメモリカード6を挿入することができる。   The printer 4 is a printing device that prints an image indicated by image data on paper. The printer 4 is provided with a slot 21 into which the memory card 6 is inserted. The user can take a picture with the digital still camera 2, remove the memory card 6 from the digital still camera 2, and insert the memory card 6 into the slot 21.

図2はプリンタ4の構成の説明図である。プリンタ4は、印刷機構10と、この印刷機構10を制御するプリンタ側コントローラ20とを備える。印刷機構10は、インクを吐出するヘッド11と、ヘッド11を制御するヘッド制御部12と、紙を搬送するため等のモータ13と、センサ14とを有する。プリンタ側コントローラ20は、メモリカード6からデータを送受信するためのメモリ用スロット21と、CPU22と、メモリ23と、モータ13を制御する制御ユニット24と、駆動信号(駆動波形)を生成する駆動信号生成部25とを有する。   FIG. 2 is an explanatory diagram of the configuration of the printer 4. The printer 4 includes a printing mechanism 10 and a printer-side controller 20 that controls the printing mechanism 10. The printing mechanism 10 includes a head 11 that ejects ink, a head control unit 12 that controls the head 11, a motor 13 for conveying paper, and a sensor 14. The printer-side controller 20 includes a memory slot 21 for transmitting and receiving data from the memory card 6, a CPU 22, a memory 23, a control unit 24 for controlling the motor 13, and a drive signal for generating a drive signal (drive waveform). And a generation unit 25.

メモリカード6がスロット21に挿入されると、プリンタ側コントローラ20は、メモリカード6に保存されている画像ファイルを読み出してメモリ23に記憶する。そして、プリンタ側コントローラ20は、画像ファイルの画像データを印刷機構10で印刷するための印刷データに変換し、印刷データに基づいて印刷機構10を制御し、紙に画像を印刷する。この一連の動作は、「ダイレクトプリント」と呼ばれている。   When the memory card 6 is inserted into the slot 21, the printer-side controller 20 reads out the image file stored in the memory card 6 and stores it in the memory 23. Then, the printer-side controller 20 converts the image data of the image file into print data for printing by the printing mechanism 10, controls the printing mechanism 10 based on the printing data, and prints an image on paper. This series of operations is called “direct printing”.

なお、「ダイレクトプリント」は、メモリカード6をスロット21に挿入することによって行われるだけでなく、デジタルスチルカメラ2とプリンタ4とをケーブル(不図示)で接続することによっても可能である。   “Direct printing” is not only performed by inserting the memory card 6 into the slot 21, but also by connecting the digital still camera 2 and the printer 4 with a cable (not shown).

===自動補正機能の概要===
「人物」の写真を印刷するときには、肌色をきれいにしたいという要求がある。また、「風景」の写真を印刷するときには、例えば木や草の緑色を強調したいという要求がある。そこで、本実施形態のプリンタ4は、画像ファイルを分析して自動的に適した補正処理を行う自動補正機能を備えている。
=== Outline of automatic correction function ===
When printing a “person” photo, there is a demand to clean the skin tone. Also, when printing a “landscape” photograph, there is a demand for emphasizing the green color of trees and grass, for example. Therefore, the printer 4 of the present embodiment includes an automatic correction function that analyzes an image file and automatically performs a suitable correction process.

図3は、プリンタ4の自動補正機能の説明図である。図中のプリンタ側コントローラ20の各要素は、ソフトウェアとハードウェアによって実現される。   FIG. 3 is an explanatory diagram of the automatic correction function of the printer 4. Each element of the printer-side controller 20 in the figure is realized by software and hardware.

記憶部31は、メモリ23の一部の領域及びCPU22によって実現される。メモリカード6から読み出された画像ファイルの画像データは、記憶部31の画像記憶部31Aに展開される。また、プリンタ側コントローラ20の各要素の演算結果は、記憶部31の結果記憶部31Bに格納される。   The storage unit 31 is realized by a partial area of the memory 23 and the CPU 22. The image data of the image file read from the memory card 6 is developed in the image storage unit 31A of the storage unit 31. In addition, the calculation result of each element of the printer-side controller 20 is stored in the result storage unit 31B of the storage unit 31.

顔識別部32は、CPU22と、メモリ23に記憶された顔識別プログラムとによって実現される。顔識別部32は、画像記憶部31Aに記憶された画像データを分析し、顔の有無を確認する。顔識別部32によって顔が有ると識別された場合、識別対象となる画像が「人物」のシーンに属すると識別される。この場合、シーン識別部33によるシーン識別処理は行われない。顔識別部32による顔識別処理は、既に広く行われている処理と同様なので、詳細な説明は省略する。   The face identification unit 32 is realized by the CPU 22 and a face identification program stored in the memory 23. The face identification unit 32 analyzes the image data stored in the image storage unit 31A and confirms the presence or absence of a face. When the face identifying unit 32 identifies that there is a face, the image to be identified is identified as belonging to the “person” scene. In this case, the scene identification process by the scene identification unit 33 is not performed. Since the face identification process by the face identification unit 32 is the same as a process that has already been widely performed, detailed description thereof is omitted.

シーン識別部33は、CPU22と、メモリ23に記憶されたシーン識別プログラムとによって実現される。シーン識別部33は、画像記憶部31Aに記憶された画像ファイルを分析し、画像データの示す画像のシーンを識別する。シーン識別部33によるシーン識別処理は、顔識別部32によって顔がない(「人物」のシーンでない)と識別された場合に行われる。後述するように、シーン識別部33は、識別対象となる画像が「風景」、「夕景」、「夜景」、「花」、「紅葉」、「その他」のいずれの画像であるかを識別する。   The scene identification unit 33 is realized by the CPU 22 and a scene identification program stored in the memory 23. The scene identification unit 33 analyzes the image file stored in the image storage unit 31A and identifies the scene of the image indicated by the image data. The scene identifying process by the scene identifying unit 33 is performed when the face identifying unit 32 identifies that there is no face (not a “person” scene). As will be described later, the scene identifying unit 33 identifies whether the image to be identified is a “landscape”, “evening scene”, “night scene”, “flower”, “autumn leaves”, or “other” image. .

図4は、画像のシーンと補正内容との関係の説明図である。
画像補正部34は、CPU22と、メモリ23に記憶された画像補正プログラムとによって実現される。画像補正部34は、記憶部31の結果記憶部31B(後述)に記憶されている識別結果(顔識別部32やシーン識別部33の識別結果)に基づいて、画像記憶部31Aの画像データを補正する。例えば、シーン識別部33の識別結果が「風景」である場合には、緑色を強調するような補正が行われる。なお、画像補正部34は、シーンの識別結果だけでなく、画像ファイルの撮影データの内容も反映して、画像データを補正しても良い。例えば、露出補正がマイナスの場合、暗い雰囲気の画像を明るくしないように画像データを補正してもよい。
FIG. 4 is an explanatory diagram of a relationship between an image scene and correction contents.
The image correction unit 34 is realized by the CPU 22 and an image correction program stored in the memory 23. The image correction unit 34 converts the image data of the image storage unit 31A based on the identification results (identification results of the face identification unit 32 and the scene identification unit 33) stored in the result storage unit 31B (described later) of the storage unit 31. to correct. For example, when the identification result of the scene identification unit 33 is “scenery”, a correction that emphasizes green is performed. The image correction unit 34 may correct the image data by reflecting not only the scene identification result but also the contents of the image data of the image file. For example, when the exposure correction is negative, the image data may be corrected so as not to brighten the dark atmosphere image.

プリンタ制御部35は、CPU22、駆動信号生成部25、制御ユニット24及びメモリ23に記憶されたプリンタ制御プログラムによって、実現される。プリンタ制御部35は、補正後の画像データを印刷データに変換し、印刷機構10に画像を印刷させる。   The printer control unit 35 is realized by a printer control program stored in the CPU 22, the drive signal generation unit 25, the control unit 24, and the memory 23. The printer control unit 35 converts the corrected image data into print data, and causes the printing mechanism 10 to print the image.

===シーン識別処理===
図5は、シーン識別部33によるシーン識別処理のフロー図である。図6は、シーン識別部33の機能の説明図である。図中のシーン識別部33の各要素は、ソフトウェアとハードウェアによって実現される。シーン識別部33は、図6に示す特徴量取得部40と、全体識別器50と、部分識別器60と、統合識別器70とを備えている。
=== Scene Identification Processing ===
FIG. 5 is a flowchart of the scene identification process performed by the scene identification unit 33. FIG. 6 is an explanatory diagram of the function of the scene identification unit 33. Each element of the scene identification unit 33 in the figure is realized by software and hardware. The scene identification unit 33 includes a feature amount acquisition unit 40, an overall classifier 50, a partial classifier 60, and an integrated classifier 70 shown in FIG.

最初に、特徴量取得部40が、記憶部31の画像記憶部31Aに展開された画像データを分析し、部分特徴量を取得する(S101)。具体的には、特徴量取得部40は、画像データを8×8の64ブロックに分割し、各ブロックの色平均と分散を算出し、この色平均と分散を部分特徴量として取得する。なお、ここでは各画素はYCC色空間における階調値のデータをもっており、各ブロックごとに、Yの平均値、Cbの平均値及びCrの平均値がそれぞれ算出され、Yの分散、Cbの分散及びCrの分散がそれぞれ算出される。つまり、各ブロックごとに3つの色平均と、3つの分散が部分特徴量として算出される。これらの色平均や分散は、各ブロックにおける部分画像の特徴を示すものである。なお、RGB色空間における平均値や分散を算出してもよい。   First, the feature amount acquisition unit 40 analyzes the image data developed in the image storage unit 31A of the storage unit 31 and acquires partial feature amounts (S101). Specifically, the feature amount acquisition unit 40 divides the image data into 8 × 8 64 blocks, calculates the color average and variance of each block, and acquires the color average and variance as partial feature amounts. Here, each pixel has gradation value data in the YCC color space, and the average value of Y, the average value of Cb, and the average value of Cr are calculated for each block, and the variance of Y and the variance of Cb are calculated. And the variance of Cr are calculated respectively. That is, three color averages and three variances are calculated as partial feature amounts for each block. These color averages and variances indicate the characteristics of the partial images in each block. Note that an average value or variance in the RGB color space may be calculated.

ブロックごとに色平均と分散が算出されるので、特徴量取得部40は、画像記憶部31Aには画像データのすべてを展開せずに、ブロック分の画像データをブロック順に展開する。このため、画像記憶部31Aは、必ずしも画像ファイルの全てを展開できるだけの容量を備えていなくとも良い。   Since the color average and variance are calculated for each block, the feature amount acquisition unit 40 develops the image data for the blocks in the order of blocks without developing all the image data in the image storage unit 31A. For this reason, the image storage unit 31A does not necessarily have a capacity sufficient to expand all of the image files.

次に、特徴量取得部40が、全体特徴量を取得する(S102)。具体的には、特徴量取得部40は、画像データの全体の色平均、分散、重心及び撮影情報を全体特徴量として取得する。なお、これらの色平均や分散は、画像の全体の特徴を示すものである。画像データ全体の色平均、分散及び重心は、先に算出した部分特徴量を用いて算出される。このため、全体特徴量を算出する際に画像データを展開する必要がないので、全体特徴量の算出速度が速くなる、全体識別処理(後述)は、部分識別処理(後述)よりも先に行われるにも関わらず、全体特徴量が部分特徴量よりも後に求められるのは、このように算出速度を速めるためである。なお、撮影情報は、画像ファイルの撮影データから抽出される。具体的には、絞り値、シャッター速度、フラッシュ発光の有無などの情報が全体特徴量として用いられる。但し、画像ファイルの撮影データの全てが全体特徴量として用いられるわけではない。   Next, the feature amount acquisition unit 40 acquires the entire feature amount (S102). Specifically, the feature amount acquisition unit 40 acquires the overall color average, variance, center of gravity, and shooting information of the image data as the overall feature amount. Note that these color averages and variances indicate the overall characteristics of the image. The color average, variance, and center of gravity of the entire image data are calculated using the partial feature values calculated previously. For this reason, since it is not necessary to develop image data when calculating the overall feature quantity, the overall feature quantity calculation speed increases, and the overall identification process (described later) is performed before the partial identification process (described later). In spite of this, the reason why the entire feature amount is obtained after the partial feature amount is to increase the calculation speed in this way. The shooting information is extracted from the shooting data of the image file. Specifically, information such as the aperture value, shutter speed, and the presence or absence of flash emission is used as the overall feature amount. However, not all shooting data of the image file is used as the entire feature amount.

次に、全体識別器50が、全体識別処理を行う(S103)。全体識別処理とは、全体特徴量に基づいて、画像データの示す画像のシーンを識別(推定)する処理である。全体識別処理の詳細については、後述する。   Next, the overall classifier 50 performs overall identification processing (S103). The overall identification process is a process for identifying (estimating) an image scene indicated by image data based on the overall feature amount. Details of the overall identification process will be described later.

全体識別処理によってシーンの識別が出来る場合(S104でYES)、シーン識別部33は、記憶部31の結果記憶部31Bに識別結果を記憶することによってシーンを決定し(S111)、シーン識別処理を終了する。つまり、全体識別処理によってシーンの識別ができた場合(S104でYES)、後段の識別処理が省略される。これによりシーン識別処理の速度が速くなる。
全体識別処理によってシーンの識別ができない場合、(S104でNO)、次に部分識別器60が、部分識別処理を行う(S105)。部分識別処理とは、部分特徴量に基づいて、画像データの示す画像全体のシーンを識別する処理である。部分識別処理の詳細については後述する。
If the scene can be identified by the overall identification process (YES in S104), the scene identification unit 33 determines the scene by storing the identification result in the result storage unit 31B of the storage unit 31 (S111), and performs the scene identification process. finish. That is, when the scene can be identified by the overall identification process (YES in S104), the subsequent identification process is omitted. This increases the speed of the scene identification process.
If the scene cannot be identified by the overall identification process (NO in S104), then the partial classifier 60 performs the partial identification process (S105). The partial identification process is a process for identifying the scene of the entire image indicated by the image data based on the partial feature amount. Details of the partial identification processing will be described later.

部分識別処理によってシーンの識別ができる場合(S106でYES)、シーン識別部33は、記憶部31の結果記憶部31Bに識別結果を記憶することによってシーンを決定し(S111)、シーン識別処理を終了する。つまり、部分識別処理によってシーンの識別ができた場合(S106でYES)、後段の識別処理が省略される。これにより、シーン識別処理の速度が速くなる。
部分識別処理によってシーンの識別ができない場合(S106でNO)、シーン識別部33の特定識別器65は、補色の色を含むシーン(本実施形態では風景のシーンと紅葉のシーン)である可能性の高い画像に対する識別処理(以下、特定識別処理と称する)を行う(S107)。特定識別処理の詳細については後述する。特定識別処理によって識別ができる場合(S108でYES)、記憶部31の結果記憶部31Bに識別結果を記憶することによってシーンを決定し(S111)、シーン識別処理を終了する。特定識別処理によって識別ができない場合(S107でNO)、統合識別器70が、統合識別処理を行う(S109)。特定識別処理及び統合識別処理の詳細については後述する。
If the scene can be identified by the partial identification process (YES in S106), the scene identification unit 33 determines the scene by storing the identification result in the result storage unit 31B of the storage unit 31 (S111), and performs the scene identification process. finish. That is, when the scene can be identified by the partial identification process (YES in S106), the subsequent identification process is omitted. This increases the speed of the scene identification process.
When the scene cannot be identified by the partial identification process (NO in S106), the specific identifier 65 of the scene identification unit 33 may be a scene including a complementary color (landscape scene and autumnal scene in this embodiment). Identification processing (hereinafter referred to as specific identification processing) is performed on an image with a high image quality (S107). Details of the specific identification process will be described later. When the identification can be performed by the specific identification process (YES in S108), the scene is determined by storing the identification result in the result storage unit 31B of the storage unit 31 (S111), and the scene identification process is terminated. When the identification cannot be performed by the specific identification process (NO in S107), the integrated discriminator 70 performs the integrated identification process (S109). Details of the specific identification process and the integrated identification process will be described later.

統合識別処理によってシーンの識別ができる場合(S110でYES)、シーン識別部33は、記憶部31の結果記憶部31Bに識別結果を記憶することによってシーンを決定し(S111)、シーン識別処理を終了する。一方、統合識別処理によってシーンの識別ができない場合(S110でNO)、画像データの示す画像が「その他」のシーン(「風景」、「夕景」、「夜景」、「花」又は「紅葉」以外のシーン)である旨の識別結果を結果記憶部31Bに記憶する(S112)。   When the scene can be identified by the integrated identification process (YES in S110), the scene identification unit 33 determines the scene by storing the identification result in the result storage unit 31B of the storage unit 31 (S111), and performs the scene identification process. finish. On the other hand, when the scene cannot be identified by the integrated identification process (NO in S110), the image indicated by the image data is a scene other than “other” (other than “landscape”, “evening scene”, “night scene”, “flower” or “autumn leaves”. Is stored in the result storage unit 31B (S112).

===全体識別処理===
図7は、全体識別処理のフロー図である。ここでは、図6も参照しながら全体識別処理について説明する。
=== Overall identification processing ===
FIG. 7 is a flowchart of the overall identification process. Here, the overall identification process will be described with reference to FIG.

まず、全体識別器50は、複数のサブ識別器51の中から1つのサブ識別器51を選択する(S201)。全体識別器50には、識別対象となる画像(識別対象画像)が特定のシーンに属するか否かを識別するサブ識別器51が5つ設けられている。5つのサブ識別器51は、それぞれ風景、夕景、夜景、花、紅葉のシーンを識別する。ここでは、全体識別器50は、風景→夕景→夜景→花→紅葉の順に、サブ識別器51を選択する。このため、最初には、識別対象画像が風景のシーンに属するか否かを識別するサブ識別器51(風景識別器51L)が選択される。   First, the overall classifier 50 selects one sub-classifier 51 from the plurality of sub-classifiers 51 (S201). The overall classifier 50 is provided with five sub-classifiers 51 for identifying whether an image to be identified (identification target image) belongs to a specific scene. The five sub classifiers 51 identify scenes of scenery, evening scene, night scene, flowers, and autumn leaves, respectively. Here, the overall classifier 50 selects the sub classifier 51 in the order of landscape → evening scene → night scene → flower → autumn leaves. For this reason, first, the sub classifier 51 (landscape classifier 51L) for identifying whether or not the classification target image belongs to a landscape scene is selected.

次に、全体識別器50は、識別対象テーブルを参照し、選択したサブ識別器51を用いてシーンを識別すべきか否かを判断する(S202)。   Next, the overall classifier 50 refers to the classification target table and determines whether or not a scene should be identified using the selected sub-classifier 51 (S202).

図8は、識別対象テーブルの説明図である。この識別対象テーブルは、記憶部31の結果記憶部31Bに記憶される。識別対象テーブルは、最初の段階では全ての欄がゼロに設定される。S202の処理では、「否定」欄が参照され、ゼロであればYESと判断され、1であればNOと判断される。ここでは、全体識別器50は、識別対象テーブルにおける「風景」欄の「否定」欄を参照し、ゼロであるのでYES(S202でYES)と判断する。   FIG. 8 is an explanatory diagram of the identification target table. This identification target table is stored in the result storage unit 31B of the storage unit 31. In the identification target table, all fields are set to zero in the first stage. In the process of S202, the “No” column is referred to, and if it is zero, it is determined as YES, and if it is 1, it is determined as NO. Here, the overall classifier 50 refers to the “No” column of the “Scenery” column in the identification target table, and determines “YES” (YES in S202) because it is zero.

次に、サブ識別器51は、識別対象画像が特定のシーンに属すか否かを識別する。具体的には、サブ識別器51は、全体特徴量に基づいて、識別対象画像が特定のシーンに属する確率(確信度)を算出する(S203)。本実施形態のサブ識別器51には、サポートベクタマシン(SVM)による識別手法が用いられている。なお、サポートベクタマシンについては、後述する。識別対象画像が特定のシーンに属する場合、サブ識別器51で算出される判別式は、プラスの値になりやすい。識別対象画像が特定のシーンに属しない場合、サブ識別器51で算出される判別式は、マイナスの値になりやすい。また、判別式は、識別対象画像が特定のシーンに属する確信度が高いほど、大きな値になる。このため、判別式の値が大きければ、識別対象画像が特定のシーンに属する確率が高くなり、判別式の値が小さければ、識別対象画像が特定のシーンに属する確率が低くなる。   Next, the sub classifier 51 identifies whether or not the classification target image belongs to a specific scene. Specifically, the sub classifier 51 calculates the probability (certainty factor) that the classification target image belongs to a specific scene based on the entire feature amount (S203). For the sub classifier 51 of this embodiment, a classification method using a support vector machine (SVM) is used. The support vector machine will be described later. When the classification target image belongs to a specific scene, the discriminant calculated by the sub classifier 51 tends to be a positive value. When the classification target image does not belong to a specific scene, the discriminant calculated by the sub classifier 51 tends to be a negative value. Further, the discriminant becomes a larger value as the certainty that the identification target image belongs to a specific scene is higher. Therefore, if the discriminant value is large, the probability that the identification target image belongs to a specific scene is high, and if the discriminant value is small, the probability that the classification target image belongs to a specific scene is low.

次に、サブ識別器51は、判別式の値が肯定閾値より大きいか否かを判断する(S204)。判別式の値が肯定閾値よりも大きければ、サブ識別器51は、識別対象画像が特定のシーンに属すると判断することになる。   Next, the sub discriminator 51 determines whether or not the value of the discriminant is larger than the positive threshold (S204). If the value of the discriminant is larger than the affirmative threshold, the sub discriminator 51 determines that the classification target image belongs to a specific scene.

図9は、全体識別処理の肯定閾値の説明図である。同図において、横軸は肯定閾値を示し、縦軸はRecall又はPrecisionの確率を示す。図10は、RecallとPrecisionの説明図である。判別式の値が肯定閾値以上の場合には識別結果はPositiveであり、判別式の値が肯定閾値以上でない場合には識別結果はNegativeである。   FIG. 9 is an explanatory diagram of an affirmative threshold value of the overall identification process. In the figure, the horizontal axis indicates an affirmative threshold, and the vertical axis indicates the probability of recall or precision. FIG. 10 is an explanatory diagram of Recall and Precision. If the discriminant value is greater than or equal to the positive threshold, the identification result is Positive. If the discriminant value is not greater than or equal to the positive threshold, the identification result is Negative.

Recallは、再現率や検出率を示すものである。Recallは、特定のシーンの画像の総数に対する、特定のシーンに属すると識別された画像の割合である。言い換えると、Recallは、特定のシーンの画像をサブ識別器51に識別させたときに、サブ識別器51がPositiveと識別する確率(特定のシーンの画像が特定のシーンに属すると識別される確率)を示すものである。例えば、風景画像を風景識別器51Lに識別させたときに、風景のシーンに属すると風景識別器51Lが識別する確率を示すものである。   Recall indicates the recall rate and detection rate. Recall is the ratio of images identified as belonging to a specific scene to the total number of images of the specific scene. In other words, Recall is the probability that the sub-identifier 51 identifies the image as a positive when the image of the specific scene is identified by the sub-identifier 51 (the probability that the image of the specific scene belongs to the specific scene. ). For example, when a landscape image is identified by the landscape classifier 51L, it indicates the probability that the landscape classifier 51L identifies it as belonging to a landscape scene.

Precisionは、正答率や正解率を示すものである。Precisionは、Positiveと識別された画像の総数に対する、特定のシーンの画像の数の割合である。言い換えると、Precisionは、特定のシーンを識別するサブ識別器51がPositiveと判断したときに、識別対象の画像が特定のシーンである確率を示すものである。例えば、風景識別器51Lが風景のシーンに属すると識別したときに、その識別した画像が本当に風景画像である確率を示すものである。   Precision indicates the correct answer rate and the correct answer rate. Precision is the ratio of the number of images in a particular scene to the total number of images identified as Positive. In other words, Precision indicates the probability that the image to be identified is a specific scene when the sub-classifier 51 that identifies the specific scene determines that it is Positive. For example, when the landscape classifier 51L identifies that it belongs to a landscape scene, it indicates the probability that the identified image is really a landscape image.

図9から分かる通り、肯定閾値を大きくするほど、Precisionが大きくなる。このため、肯定閾値を大きくするほど、例えば風景のシーンに属すると識別された画像が風景画像である確率が高くなる。つまり、肯定閾値を大きくするほど、誤識別の確率が低くなる。   As can be seen from FIG. 9, the greater the positive threshold, the greater the Precision. For this reason, the larger the positive threshold value, the higher the probability that an image identified as belonging to a landscape scene, for example, is a landscape image. That is, the greater the positive threshold, the lower the probability of misidentification.

一方、肯定閾値を大きくするほど、Recallは小さくなる。この結果、例えば、風景画像を風景識別器51Lで識別した場合であっても、風景のシーンに属すると正しく識別しにくくなる。ところで、識別対象画像が風景のシーンに属すると識別できれば(S204でYES)、残りの別のシーン(夕景など)の識別を行わないようにして全体識別処理の速度を速めている。このため、肯定閾値を大きくするほど、全体識別処理の速度は低下することになる。また、全体識別処理によってシーンが識別できれば部分識別処理を行わないようにしてシーン識別処理の速度を速めているため(S104)、肯定閾値を大きくするほど、シーン識別処理の速度は低下することになる。   On the other hand, the larger the positive threshold, the smaller the Recall. As a result, for example, even when a landscape image is identified by the landscape classifier 51L, it is difficult to correctly identify it as belonging to a landscape scene. By the way, if the image to be identified can be identified as belonging to a landscape scene (YES in S204), the speed of the overall identification process is increased so as not to identify other remaining scenes (such as sunsets). For this reason, the larger the positive threshold, the lower the overall identification processing speed. Further, if the scene can be identified by the overall identification process, the partial identification process is not performed and the speed of the scene identification process is increased (S104). Therefore, as the positive threshold is increased, the scene identification process speed decreases. Become.

つまり、肯定閾値が小さすぎると誤識別の確率が高くなり、大きすぎると処理速度が低下することになる。本実施形態では、正答率(Precision)を97.5%に設定するため、風景の肯定閾値は1.27に設定されている。   That is, if the positive threshold is too small, the probability of misidentification increases, and if it is too large, the processing speed decreases. In this embodiment, since the correct answer rate (Precision) is set to 97.5%, the landscape affirmation threshold is set to 1.27.

判別式の値が肯定閾値より大きければ(S204でYES)、サブ識別器51は、識別対象画像が特定のシーンに属すると判断し、肯定フラグを立てる(S205)。「肯定フラグを立てる」とは、図8の「肯定」欄を1にすることである。この場合、全体識別器50は、次のサブ識別器51による識別を行わずに全体識別処理を終了する。例えば、風景画像であると識別できれば、夕景などの識別を行わずに、全体識別処理を終了する。この場合、次のサブ識別器51による識別を省略しているので、全体識別処理の速度を速めることができる。
判別式の値が肯定閾値より大きくなければ(S204でNO)、サブ識別器51は、識別対象画像が特定のシーンに属すると判断できず、次のS206の処理を行う。
If the discriminant value is greater than the affirmative threshold value (YES in S204), the sub-classifier 51 determines that the classification target image belongs to a specific scene and sets an affirmative flag (S205). “Set an affirmative flag” means that the “affirmation” column in FIG. In this case, the overall discriminator 50 ends the overall discrimination process without performing discrimination by the next sub discriminator 51. For example, if the image can be identified as a landscape image, the entire identification process is terminated without identifying the sunset scene or the like. In this case, since the identification by the next sub-identifier 51 is omitted, the speed of the overall identification process can be increased.
If the value of the discriminant is not greater than the positive threshold (NO in S204), the sub discriminator 51 cannot determine that the classification target image belongs to a specific scene, and performs the next process of S206.

次にサブ識別器51は、判別式の値と否定閾値とを比較する(S206)。これにより、サブ識別器51は、識別対象画像が所定のシーンに属しないかを判断する。このような判断としては、2種類ある。第1に、ある特定のシーンのサブ識別器51の判別式の値が第1否定閾値よりも小さければ、その特定のシーンに識別対象画像が属しないと判断されることになる。例えば、風景識別器51Lの判別式の値が第1否定閾値よりも小さければ、識別対象画像が風景のシーンに属しないと判断されることになる。第2に、ある特定のシーンのサブ識別器51の判別式の値が第2否定閾値よりも大きければ、その特定のシーンとは別のシーンに識別対象画像が属しないと判断されることになる。例えば、風景識別器51Lの判別式の値が第2否定閾値よりも大きければ、識別対象画像が夜景のシーンに属しないと判断されることになる。   Next, the sub discriminator 51 compares the value of the discriminant with the negative threshold (S206). Thereby, the sub classifier 51 determines whether the classification target image does not belong to a predetermined scene. There are two types of such determinations. First, if the value of the discriminant of the sub-classifier 51 of a specific scene is smaller than the first negative threshold, it is determined that the classification target image does not belong to the specific scene. For example, if the discriminant value of the landscape classifier 51L is smaller than the first negative threshold value, it is determined that the classification target image does not belong to a landscape scene. Second, if the value of the discriminant of the sub-identifier 51 of a specific scene is larger than the second negative threshold, it is determined that the classification target image does not belong to a scene different from the specific scene. Become. For example, if the discriminant value of the landscape classifier 51L is larger than the second negative threshold value, it is determined that the classification target image does not belong to the night scene.

図11は、第1否定閾値の説明図である。同図において、横軸は第1否定閾値を示し、縦軸は確率を示す。グラフの太線は、True Negative Recallのグラフであり、風景画像以外の画像を風景画像ではないと正しく識別する確率を示している。グラフの細線は、False Negative Recallのグラフであり、風景画像なのに風景画像ではないと誤って識別する確率を示している。   FIG. 11 is an explanatory diagram of the first negative threshold. In the figure, the horizontal axis indicates the first negative threshold, and the vertical axis indicates the probability. The bold line in the graph is a True Negative Recall graph, and indicates the probability of correctly identifying an image other than a landscape image as not a landscape image. The thin line in the graph is a False Negative Recall graph, which indicates the probability of erroneously identifying a landscape image that is not a landscape image.

図11から分かる通り、第1否定閾値を小さくするほど、False Negative Recallが小さくなる。このため、第1否定閾値を小さくするほど、例えば風景のシーンに属しないと識別された画像が風景画像である確率が低くなる。つまり、誤識別の確率が低くなる。   As can be seen from FIG. 11, the smaller the first negative threshold is, the smaller False Negative Recall is. For this reason, the smaller the first negative threshold, the lower the probability that an image identified as not belonging to a landscape scene is a landscape image, for example. That is, the probability of misidentification is reduced.

一方、第1否定閾値を小さくするほど、True Negative Recallも小さくなる。この結果、風景画像以外の画像を風景画像ではないと識別しにくくなる。その一方、識別対象画像が特定のシーンでないことを識別できれば、部分識別処理の際に、その特定のシーンのサブ部分識別器61による処理を省略してシーン識別処理速度を速めている(後述、図14のS302)。このため、第1否定閾値を小さくするほど、シーン識別処理速度は低下する。   On the other hand, the True Negative Recall decreases as the first negative threshold decreases. As a result, it is difficult to identify an image other than a landscape image unless it is a landscape image. On the other hand, if it can be identified that the image to be identified is not a specific scene, the process by the sub partial classifier 61 of the specific scene is omitted during the partial identification process (according to the description below). S302 in FIG. 14). For this reason, the scene identification processing speed decreases as the first negative threshold is decreased.

つまり、第1否定閾値が大きすぎると誤識別の確率が高くなり、小さすぎると処理速度が低下することになる。本実施形態では、False Negative Recallを2.5%に設定するため、第1否定閾値は−1.10に設定されている。   That is, if the first negative threshold is too large, the probability of misidentification increases, and if it is too small, the processing speed decreases. In the present embodiment, the first negative threshold is set to −1.10 in order to set False Negative Recall to 2.5%.

ところで、ある画像が風景のシーンに属する確率が高ければ、必然的にその画像が夜景のシーンに属する確率は低くなる。このため、風景識別器51Lの判別式の値が大きい場合には、夜景ではないと識別できる場合がある。このような識別を行うために、第2否定閾値が設けられている。   By the way, if the probability that an image belongs to a landscape scene is high, the probability that the image belongs to a night scene is inevitably low. For this reason, when the discriminant value of the landscape discriminator 51L is large, it may be identified that the scene is not a night scene. In order to perform such identification, a second negative threshold is provided.

図12は、第2否定閾値の説明図である。同図において、横軸は風景の判別式の値を示し、縦軸は確率を示す。同図には、図9のRecallとPrecisionのグラフとともに、夜景のRecallのグラフが点線で描かれている。この点線のグラフに注目すると、風景の判別式の値が−0.45よりも大きければ、その画像が夜景画像である確率は2.5%である。言い換えると、風景の判別式の値が−0.45よりも大きい場合にその画像が夜景画像でないと識別しても、誤識別の確率は2.5%にすぎない。そこで、本実施形態では、第2否定閾値が−0.45に設定されている。   FIG. 12 is an explanatory diagram of the second negative threshold. In the figure, the horizontal axis indicates the value of the landscape discriminant, and the vertical axis indicates the probability. In the same figure, the Recall graph of the night view is drawn with a dotted line together with the Recall and Precision graph of FIG. If attention is paid to this dotted line graph, if the value of the discriminant of the landscape is larger than −0.45, the probability that the image is a night scene image is 2.5%. In other words, if the landscape discriminant value is greater than −0.45, even if the image is identified as not a night scene image, the probability of misidentification is only 2.5%. Therefore, in the present embodiment, the second negative threshold is set to −0.45.

そして、判別式の値が第1否定閾値より小さい場合、又は、判別式の値が第2否定閾値より大きい場合(S206でYES)、サブ識別器51は、識別対象画像が所定のシーンに属しないと判断し、否定フラグを立てる(S207)。「否定フラグを立てる」とは、図8の「否定」欄を1にすることである。例えば、第1否定閾値に基づいて識別対象画像が風景のシーンに属しないと判断された場合、「風景」欄の「否定」欄が1になる。また、第2否定閾値に基づいて識別対象画像が夜景のシーンに属しないと判断された場合、「夜景」欄の「否定」欄が1になる。   When the discriminant value is smaller than the first negative threshold value, or when the discriminant value is larger than the second negative threshold value (YES in S206), the sub-classifier 51 determines that the classification target image belongs to a predetermined scene. It is determined not to do so, and a negative flag is set (S207). “Set a negative flag” means to set the “No” column in FIG. For example, when it is determined that the image to be identified does not belong to a landscape scene based on the first negative threshold, the “denial” column in the “landscape” column is 1. Further, when it is determined that the identification target image does not belong to the night scene based on the second negative threshold, the “Negation” field in the “Night scene” field is “1”.

図13Aは、閾値テーブルの説明図である。この閾値テーブルは、記憶部31に記憶されていても良いし、全体識別処理を実行させるプログラムの一部に組み込まれていても良い。閾値テーブルには、前述の肯定閾値や否定閾値に関するデータが格納されている。   FIG. 13A is an explanatory diagram of a threshold table. This threshold value table may be stored in the storage unit 31 or may be incorporated in a part of a program that executes the overall identification process. The threshold table stores data related to the affirmative threshold and the negative threshold described above.

図13Bは、上記で説明した風景識別器51Lにおける閾値の説明図である。風景識別器51Lには、肯定閾値及び否定閾値が予め設定されている。肯定閾値として1.27が設定されている。否定閾値には第1否定閾値と第2否定閾値とがある。第1否定閾値として−1.10が設定されている。また、第2否定閾値として、風景以外の各シーンにそれぞれ値が設定されている。   FIG. 13B is an explanatory diagram of threshold values in the landscape classifier 51L described above. An affirmative threshold value and a negative threshold value are preset in the landscape discriminator 51L. 1.27 is set as the positive threshold. The negative threshold includes a first negative threshold and a second negative threshold. -1.10 is set as the first negative threshold. In addition, a value is set for each scene other than the landscape as the second negative threshold.

図13Cは、上記で説明した風景識別器51Lの処理の概要の説明図である。ここでは、説明の簡略化のため、第2否定閾値については夜景についてのみ説明する。風景識別器51Lは、判別式の値が1.27よりも大きければ(S204でYES)、識別対象画像が風景のシーンに属すると判断する。また、判別式の値が1.27以下であり(S204でNO)、−0.45よりも大きければ(S206でYES)、風景識別器51Lは、識別対象画像が夜景のシーンに属しないと判断する。また、判別式の値が−1.10よりも小さければ(S206でYES)、風景識別器51Lは、識別対象画像が風景のシーンに属しないと判断する。なお、風景識別器51Lは、夕景や花や紅葉についても、第2否定閾値に基づいて、識別対象画像がそのシーンに属しないかを判断する。但し、これらの第2否定閾値は肯定閾値よりも大きいため、識別対象画像がこれらのシーンに属しないことを風景識別器51Lが判断することはない。   FIG. 13C is an explanatory diagram outlining the processing of the landscape classifier 51L described above. Here, for simplification of description, only the night view will be described for the second negative threshold. If the discriminant value is greater than 1.27 (YES in S204), the landscape classifier 51L determines that the classification target image belongs to a landscape scene. If the value of the discriminant is 1.27 or less (NO in S204) and greater than −0.45 (YES in S206), the landscape classifier 51L indicates that the classification target image does not belong to the night scene. to decide. If the value of the discriminant is smaller than −1.10 (YES in S206), the landscape classifier 51L determines that the classification target image does not belong to a landscape scene. Note that the landscape discriminator 51L also determines whether the image to be identified does not belong to the scene based on the second negative threshold for sunset scenes, flowers, and autumn leaves. However, since these second negative threshold values are larger than the positive threshold values, the landscape discriminator 51L does not determine that the classification target image does not belong to these scenes.

S202においてNOの場合、S206でNOの場合、又はS207の処理を終えた場合、全体識別器50は、次のサブ識別器51の有無を判断する(S208)。ここでは風景識別器51Lによる処理を終えた後なので、全体識別器50は、S208において、次のサブ識別器51(夕景識別器51S)があると判断する。   In the case of NO in S202, in the case of NO in S206, or when the processing in S207 is completed, the overall discriminator 50 determines the presence or absence of the next sub discriminator 51 (S208). Here, since the process by the landscape classifier 51L is finished, the overall classifier 50 determines in S208 that there is a next sub-classifier 51 (evening scene classifier 51S).

そして、S205の処理を終えた場合(識別対象画像が特定のシーンに属すると判断された場合)、又は、S208において次のサブ識別器51がないと判断された場合(識別対象画像が特定のシーンに属すると判断できなかった場合)、全体識別器50は、全体識別処理を終了する。   Then, when the process of S205 is finished (when it is determined that the identification target image belongs to a specific scene), or when it is determined in S208 that there is no next sub-classifier 51 (the identification target image is a specific image). When it cannot be determined that the scene belongs to the scene), the overall discriminator 50 ends the overall discrimination process.

なお、既に説明した通り、全体識別処理が終了すると、シーン識別部33は、全体識別処理によってシーンの識別ができたか否かを判断する(図5のS104)。このとき、シーン識別部33は、図8の識別対象テーブルを参照し、「肯定」欄に1があるか否かを判断することになる。   As already described, when the overall identification process is completed, the scene identification unit 33 determines whether or not the scene has been identified by the overall identification process (S104 in FIG. 5). At this time, the scene identification unit 33 refers to the identification target table in FIG. 8 and determines whether or not there is 1 in the “affirmation” column.

全体識別処理によってシーンの識別ができた場合(S104でYES)、部分識別処理、特定識別処理、及び統合識別処理が省略される。これによりシーン識別処理の速度が速くなる。   When the scene can be identified by the overall identification process (YES in S104), the partial identification process, the specific identification process, and the integrated identification process are omitted. This increases the speed of the scene identification process.

ところで、上記の説明には無いが、全体識別器50は、サブ識別器51によって判別式の値を算出したときには、判別式の値に対応するPrecisionを、確信度に関する情報として結果記憶部31Bに記憶する。もちろん、判別式の値そのものを確信度に関する情報として記憶しても良い。   By the way, although not described above, the overall discriminator 50, when the sub discriminator 51 calculates the discriminant value, the Precision corresponding to the discriminant value is stored in the result storage unit 31B as information on the certainty factor. Remember. Of course, the discriminant value itself may be stored as information on the certainty factor.

===部分識別処理===
図14は、部分識別処理のフロー図である。部分識別処理は、全体識別処理によってシーンの識別ができなかった場合(図5のS104でNO)に行われる。以下に説明するように、部分識別処理は、分割された部分画像のシーンをそれぞれ識別することによって、画像全体のシーンを識別する処理である。ここでは、図6も参照しながら部分識別処理について説明する。
=== Partial identification processing ===
FIG. 14 is a flowchart of the partial identification process. The partial identification process is performed when the scene cannot be identified by the overall identification process (NO in S104 of FIG. 5). As will be described below, the partial identification process is a process for identifying the scene of the entire image by identifying each scene of the divided partial images. Here, the partial identification process will be described with reference to FIG.

まず、部分識別器60は、複数のサブ部分識別器61の中から1つのサブ部分識別器61を選択する(S301)。部分識別器60には、サブ部分識別器61が3つ設けられている。各サブ部分識別器61は、8×8の64ブロックに分割された部分画像がそれぞれ特定のシーンに属するか否かを識別する。ここでの3つのサブ部分識別器61は、それぞれ、夕景、花、紅葉のシーンを識別する。ここでは、部分識別器60は、夕景→花→紅葉の順に、サブ部分識別器61を選択する(なお、サブ部分識別器61の選択順序については、後述する)。このため、最初には、部分画像が夕景のシーンに属するか否かを識別するサブ部分識別器61(夕景部分識別器61S)が選択される。   First, the partial classifier 60 selects one sub partial classifier 61 from the plurality of sub partial classifiers 61 (S301). The partial discriminator 60 is provided with three sub partial discriminators 61. Each sub partial discriminator 61 discriminates whether or not each partial image divided into 8 × 8 64 blocks belongs to a specific scene. Here, the three sub partial classifiers 61 identify scenes of sunset, flowers, and autumn leaves, respectively. Here, the partial discriminator 60 selects the sub partial discriminator 61 in the order of sunset scene → flower → autumn leaves (the selection order of the sub partial discriminator 61 will be described later). Therefore, first, the sub partial classifier 61 (evening scene partial classifier 61S) for identifying whether or not the partial image belongs to the sunset scene is selected.

次に、部分識別器60は、識別対象テーブル(図8)を参照し、選択したサブ部分識別器61を用いてシーンを識別すべきか否かを判断する(S302)。ここでは、部分識別器60は、識別対象テーブルにおける「夕景」欄の「否定」欄を参照し、ゼロであればYESと判断し、1であればNOと判断する。なお、全体識別処理の際に、夕景識別器51Sが第1否定閾値により否定フラグを立てたとき、又は、他のサブ識別器51が第2否定閾値により否定フラグを立てたとき、このS302でNOと判断される。仮にNOと判断されると夕景の部分識別処理は省略されることになるので、部分識別処理の速度が速くなる。但し、ここでは説明の都合上、YESと判断されるものとする。   Next, the partial discriminator 60 refers to the discrimination target table (FIG. 8) and determines whether or not the scene should be discriminated using the selected sub partial discriminator 61 (S302). Here, the partial discriminator 60 refers to the “No” column of the “Evening Scene” column in the classification target table, and determines YES if it is zero, and NO if it is 1. When the evening scene classifier 51S sets a negative flag with the first negative threshold during the overall identification process or when another sub-classifier 51 sets a negative flag with the second negative threshold, in S302 It is judged as NO. If it is determined NO, the sunset partial identification process is omitted, and the partial identification process speed increases. However, for the convenience of explanation, it is assumed that YES is determined here.

次に、サブ部分識別器61は、8×8の64ブロックに分割された部分画像の中から、1つの部分画像を選択する(S303)。   Next, the sub partial discriminator 61 selects one partial image from the partial images divided into 8 × 8 64 blocks (S303).

図15は、夕景部分識別器61Sが選択する部分画像の順番の説明図である。部分画像から画像全体のシーンを特定するような場合、識別に用いられる部分画像は被写体が存在する部分であることが望ましい。そこで、本実施形態では、数千枚のサンプルの夕景画像を用意し、各夕景画像を8×8の64ブロックに分割し、夕景部分画像(夕景の太陽と空の部分画像)を含むブロックを抽出し、抽出されたブロックの位置に基づいて各ブロックにおける夕景部分画像の存在確率を算出した。そして、本実施形態では、存在確率の高いブロックから順番に、部分画像が選択される。なお、図に示す選択順序の情報は、プログラムの一部としてメモリ23に格納されている。   FIG. 15 is an explanatory diagram of the order of partial images selected by the evening scene partial classifier 61S. When the entire image scene is specified from the partial image, it is desirable that the partial image used for identification is a portion where the subject exists. Therefore, in this embodiment, thousands of samples of sunset scene images are prepared, each sunset scene image is divided into 64 blocks of 8 × 8, and blocks including sunset scene partial images (sun and sky partial images of the sunset scene) are included. The presence probability of the sunset partial image in each block was calculated based on the extracted block position. And in this embodiment, a partial image is selected in an order from a block with a high existence probability. Note that the selection order information shown in the figure is stored in the memory 23 as part of the program.

なお、夕景画像の場合、画像の中央付近から上半分に夕景の空が広がっていることが多いため、中央付近から上半分のブロックにおいて存在確率が高くなる。また、夕景画像の場合、画像の下1/3では逆光で陰になり、部分画像単体では夕景か夜景か区別がつかないことが多いため、下1/3のブロックにおいて存在確率が低くなる。花画像の場合、花を中央に配置させる構図にすることが多いため、中央付近における花部分画像の存在確率が高くなる。   In the case of an evening scene image, since the sky of the evening scene often spreads from the vicinity of the center to the upper half, the existence probability increases in the upper half block from the vicinity of the center. In the case of an evening scene image, the lower 1/3 of the image is shaded by backlight, and the partial image alone often cannot be distinguished from the evening scene or the night scene, so the existence probability is lower in the lower 1/3 block. In the case of a flower image, since the composition is often such that the flower is arranged in the center, the existence probability of the flower partial image near the center increases.

次に、サブ部分識別器61は、選択された部分画像の部分特徴量に基づいて、その部分画像が特定のシーンに属するか否かを評価する(S304)。サブ部分識別器61には、全体識別器50のサブ識別器51と同様に、サポートベクタマシン(SVM)による判別手法が用いられている。なお、サポートベクタマシンについては、後述する。判別式の値が正の値であれば、部分画像が特定のシーンに属すると判断し、サブ部分識別器61は正カウント値をインクリメントする。また、判別式の値が負の値であれば、部分画像が特定のシーンに属しないと判断し、サブ部分識別器61は負カウント値をインクリメントする。   Next, the sub partial discriminator 61 evaluates whether or not the partial image belongs to a specific scene based on the partial feature amount of the selected partial image (S304). Similar to the sub classifier 51 of the overall classifier 50, the sub partial classifier 61 uses a discrimination method using a support vector machine (SVM). The support vector machine will be described later. If the discriminant value is a positive value, it is determined that the partial image belongs to a specific scene, and the sub partial classifier 61 increments the positive count value. If the discriminant value is a negative value, it is determined that the partial image does not belong to a specific scene, and the sub partial discriminator 61 increments the negative count value.

次に、サブ部分識別器61は、正カウント値が肯定閾値よりも大きいか否かを判断する(S305)。なお、正カウント値は、特定のシーンに属すると判断された部分画像の数を示すものである。正カウント値が肯定閾値よりも大きければ(S305でYES)、サブ部分識別器61は、識別対象画像が特定のシーンに属すると判断し、肯定フラグを立てる(S306)。この場合、部分識別器60は、次のサブ部分識別器61による識別を行わずに部分識別処理を終了する。この場合、次のサブ部分識別器61による識別を省略しているので、部分識別処理の速度を速めることができる。
正カウント値が肯定閾値より大きくなければ(S305でNO)、サブ部分識別器61は、識別対象画像が特定のシーンに属すると判断できず、次のS307の処理を行う。
Next, the sub partial discriminator 61 determines whether or not the positive count value is larger than the positive threshold value (S305). The positive count value indicates the number of partial images determined to belong to a specific scene. If the positive count value is larger than the affirmative threshold (YES in S305), the sub partial classifier 61 determines that the classification target image belongs to a specific scene, and sets an affirmative flag (S306). In this case, the partial discriminator 60 ends the partial discriminating process without performing discrimination by the next sub partial discriminator 61. In this case, since the identification by the next sub partial classifier 61 is omitted, the speed of the partial classification process can be increased.
If the positive count value is not greater than the positive threshold value (NO in S305), the sub partial classifier 61 cannot determine that the classification target image belongs to a specific scene, and performs the next process of S307.

サブ部分識別器61は、正カウント値と残りの部分画像数との和が肯定閾値よりも小さければ(S307でYES)、S309の処理へ進む。正カウント値と残りの部分画像数との和が肯定閾値よりも小さい場合、残り全ての部分画像によって正カウント値がインクリメントされても、正カウント値が肯定閾値よりも大きくなることがないので、S309に処理を進めることによって、残りの部分画像についてサポートベクタマシンによる識別を省略する。これにより識別処理の速度を速めることができる。   If the sum of the positive count value and the number of remaining partial images is smaller than the positive threshold (YES in S307), the sub partial discriminator 61 proceeds to the process of S309. When the sum of the positive count value and the number of remaining partial images is smaller than the positive threshold value, even if the positive count value is incremented by all the remaining partial images, the positive count value does not become larger than the positive threshold value. By proceeding to S309, the remaining partial images are not identified by the support vector machine. As a result, the speed of the identification process can be increased.

サブ部分識別器61がS307でNOと判断した場合、サブ部分識別器61は、次の部分画像の有無を判断する(S308)。なお、本実施形態では、64個に分割された部分画像の全てを順に選択していない。図15において、太枠で示された上位10番目までの10個の部分画像だけを順に選択している。このため、10番目の部分画像の識別を終えれば、サブ部分識別器61は、S308において次の部分画像はないと判断する(この点を考慮して、S307の「残り部分画像数」も決定される。)。   If the sub partial discriminator 61 determines NO in S307, the sub partial discriminator 61 determines whether there is a next partial image (S308). In the present embodiment, not all of the partial images divided into 64 are selected in order. In FIG. 15, only the ten partial images up to the top 10 indicated by a thick frame are selected in order. Therefore, when the identification of the tenth partial image is completed, the sub partial discriminator 61 determines that there is no next partial image in S308 (in consideration of this point, the “number of remaining partial images” in S307 is also determined). It is determined.).

図16は、64個に分割された部分画像のうち、上位10番目までの10個の部分画像だけで夕景画像を識別したときのRecall及びPrecisionのグラフである。図に示すような肯定閾値を設定すれば、正答率(Precision)を80%程度に設定でき、再現率(Recall)を90%程度に設定でき、精度の高い識別が可能である。   FIG. 16 is a Recall and Precision graph when an evening scene image is identified by only the top 10 partial images among the 64 partial images. If an affirmative threshold as shown in the figure is set, the accuracy rate (Precision) can be set to about 80%, the recall rate (Recall) can be set to about 90%, and identification with high accuracy is possible.

本実施形態では、10個の部分画像だけで夕景画像の識別を行っている。このため、本実施形態では、64個の全ての部分画像を用いて夕景画像の識別を行うよりも、部分識別処理の速度を速めることができる。   In this embodiment, the evening scene image is identified using only 10 partial images. For this reason, in the present embodiment, it is possible to increase the speed of the partial identification process compared to the case where the evening scene image is identified using all 64 partial images.

また、本実施形態では、夕景部分画像の存在確率の高い上位10番目の部分画像を用いて夕景画像の識別を行っている。このため、本実施形態では、存在確率を無視して抽出された10個の部分画像を用いて夕景画像の識別を行うよりも、RecallやPrecisionをともに高く設定することが可能になる。   In this embodiment, the sunset scene image is identified using the top tenth partial image having a high existence probability of the sunset scene partial image. For this reason, in the present embodiment, it is possible to set both Recall and Precision higher than identifying an evening scene image using 10 partial images extracted by ignoring the existence probability.

また、本実施形態では、夕景部分画像の存在確率の高い順に部分画像を選択している。この結果、早い段階でS305の判断がYESになりやすくなる。このため、本実施形態では、存在確率の高低を無視した順で部分画像を選択したときよりも、部分識別処理の速度を速めることができる。   In this embodiment, the partial images are selected in descending order of the existence probability of the sunset partial image. As a result, the determination in S305 is likely to be YES at an early stage. For this reason, in the present embodiment, the speed of the partial identification process can be increased as compared with the case where the partial images are selected in the order in which the presence probability level is ignored.

S307においてYESと判断された場合、又は、S308において次の部分画像がないと判断された場合、サブ部分識別器61は、負カウント値が否定閾値よりも大きいか否かを判断する(S309)。この否定閾値は、前述の全体識別処理における否定閾値(図7のS206)とほぼ同様の機能を果たすものなので、詳しい説明は省略する。S309でYESと判断された場合、図7のS207と同様に否定フラグを立てる。   When it is determined YES in S307, or when it is determined that there is no next partial image in S308, the sub partial discriminator 61 determines whether or not the negative count value is larger than the negative threshold (S309). . Since this negative threshold performs substantially the same function as the negative threshold (S206 in FIG. 7) in the above-described overall identification process, detailed description thereof is omitted. If YES is determined in S309, a negative flag is set as in S207 of FIG.

S302においてNOの場合、S309でNOの場合、又はS310の処理を終えた場合、部分識別器60は、次のサブ部分識別器61の有無を判断する(S311)。夕景部分識別器61Sによる処理を終えた後の場合、サブ部分識別器61として花部分識別器61Fや紅葉部分識別器61Rがまだあるので、部分識別器60は、S311において、次のサブ部分識別器61があると判断する。   In the case of NO in S302, in the case of NO in S309, or when the process of S310 is completed, the partial discriminator 60 determines whether or not there is a next sub partial discriminator 61 (S311). In the case after the processing by the evening scene partial classifier 61S is finished, the flower partial classifier 61F and the autumnal leaves partial classifier 61R are still present as the sub partial classifier 61. It is determined that there is a container 61.

そして、S306の処理を終えた場合(識別対象画像が特定のシーンに属すると判断された場合)、又は、S311において次のサブ部分識別器61がないと判断された場合(識別対象画像が特定のシーンに属すると判断できなかった場合)、部分識別器60は、部分識別処理を終了する。   Then, when the process of S306 is completed (when it is determined that the identification target image belongs to a specific scene), or when it is determined in S311 that there is no next sub partial classifier 61 (the identification target image is specified). If it cannot be determined that the scene belongs to the scene), the partial discriminator 60 ends the partial discrimination processing.

なお、既に説明した通り、部分識別処理が終了すると、シーン識別部33は、部分識別処理によってシーンの識別ができたか否かを判断する(図5のS106)。このとき、シーン識別部33は、図8の識別対象テーブルを参照し、「肯定」欄に1があるか否かを判断することになる。   As already described, when the partial identification process is completed, the scene identification unit 33 determines whether or not the scene has been identified by the partial identification process (S106 in FIG. 5). At this time, the scene identification unit 33 refers to the identification target table in FIG. 8 and determines whether or not there is 1 in the “affirmation” column.

部分識別処理によってシーンの識別ができた場合(S106でYES)、特定識別処理及び統合識別処理が省略される。これにより、シーン識別処理の速度が速くなる。   If the scene can be identified by the partial identification process (YES in S106), the specific identification process and the integrated identification process are omitted. This increases the speed of the scene identification process.

ところで、上記の説明では、夕景部分識別器61Sは、10個の部分画像を用いて夕景画像の識別を行っているが、識別に用いられる部分画像の数は10個に限られるものではない。また、他のサブ部分識別器61が、夕景部分識別器61Sとは異なる数の部分画像を用いて画像を識別しても良い。本実施形態では、花部分識別器61Fは20個の部分画像を用いて花画像を識別し、また、紅葉部分識別器61Rは、15個の部分画像を用いて紅葉画像を識別するものとする。   In the above description, the evening scene partial classifier 61S identifies evening scene images using ten partial images. However, the number of partial images used for identification is not limited to ten. Further, the other sub partial classifier 61 may identify an image using a different number of partial images from the sunset scene partial classifier 61S. In the present embodiment, the flower partial identifier 61F identifies a flower image using 20 partial images, and the autumnal leaf partial identifier 61R identifies a autumnal leaf image using 15 partial images. .

===サポートベクタマシン===
統合識別処理について説明する前に、全体識別処理のサブ識別器51や部分識別処理のサブ部分識別器61において用いられているサポートベクタマシン(SVM)について説明する。
=== Support vector machine ===
Before describing the integrated identification process, the support vector machine (SVM) used in the sub-identifier 51 for the overall identification process and the sub-partial identifier 61 for the partial identification process will be described.

図17Aは、線形サポートベクタマシンによる判別の説明図である。ここでは、2つの特徴量x1、x2によって、学習用サンプルを2次元空間に示している。学習用サンプルは2つのクラスA、Bに分けられている。図中では、クラスAに属するサンプルは丸で示されており、クラスBに属するサンプルは四角で示されている。   FIG. 17A is an explanatory diagram of determination by the linear support vector machine. Here, the learning sample is shown in a two-dimensional space by two feature amounts x1 and x2. The learning sample is divided into two classes A and B. In the figure, samples belonging to class A are indicated by circles, and samples belonging to class B are indicated by squares.

学習用サンプルを用いた学習によって、2次元空間を2つに分ける境界が定義される。境界は、<w・x>+b=0で定義される(なお、x=(x1,x2)であり、wは重みベクトルであり、<w・x>はwとxの内積である)。但し、境界は、マージンが最大になるように、学習用サンプルを用いた学習によって定義される。つまり、図の場合、境界は、太点線ではなく、太実線のようになる。   A boundary that divides the two-dimensional space into two is defined by learning using the learning sample. The boundary is defined by <w · x> + b = 0 (where x = (x1, x2), w is a weight vector, and <w · x> is an inner product of w and x). However, the boundary is defined by learning using a learning sample so that the margin is maximized. That is, in the case of the figure, the boundary is not a thick dotted line but a thick solid line.

判別は、f(x)=<w・x>+bを用いて行われる。ある入力x(この入力xは、学習用サンプルとは別である)について、f(x)>0であればクラスAに属すると判別され、f(x)<0であればクラスBに属すると判別される。   The determination is performed using f (x) = <w · x> + b. A certain input x (this input x is different from the learning sample) is determined to belong to class A if f (x)> 0, and belongs to class B if f (x) <0. Is determined.

ここでは2次元空間を用いて説明しているが、これには限定されない(つまり特徴量は2以上でも良い)。この場合、境界は超平面で定義される。   Here, the description is made using a two-dimensional space, but the present invention is not limited to this (that is, the feature amount may be two or more). In this case, the boundary is defined by a hyperplane.

ところで、2つのクラスに線形関数で分離できないことがある。このような場合に線形サポートベクタマシンによる判別を行うと、判別結果の精度が低下する。そこで、入力空間の特徴量を非線形変換すれば、すなわち入力空間からある特徴空間へ非線形写像すれば、特徴空間において線形関数で分離することができるようになる。非線形サポートベクタマシンでは、これを利用している。   By the way, there are cases where the two classes cannot be separated by a linear function. In such a case, if the determination is performed by the linear support vector machine, the accuracy of the determination result is lowered. Therefore, if the feature quantity of the input space is nonlinearly transformed, that is, if the input space is nonlinearly mapped to a certain feature space, it can be separated by a linear function in the feature space. This is used in the nonlinear support vector machine.

図17Bは、カーネル関数を用いた判別の説明図である。ここでは、2つの特徴量x1、x2によって、学習用サンプルを2次元空間に示している。図17Bの入力空間からの非線形写像が図17Aのような特徴空間になれば、線形関数で2つのクラスに分離することが可能になる。この特徴空間においてマージンが最大になるように境界が定義されれば、特徴空間における境界の逆写像が、図17Bに示す境界になる。この結果、図17Bに示すように、境界は非線形になる。   FIG. 17B is an explanatory diagram of discrimination using a kernel function. Here, the learning sample is shown in a two-dimensional space by two feature amounts x1 and x2. If the nonlinear mapping from the input space of FIG. 17B becomes a feature space as shown in FIG. 17A, it can be separated into two classes by a linear function. If the boundary is defined so that the margin is maximized in this feature space, the inverse mapping of the boundary in the feature space becomes the boundary shown in FIG. 17B. As a result, the boundary becomes nonlinear as shown in FIG. 17B.

本実施形態では、ガウスカーネルを利用することにより、判別式f(x)は次式(1)のようになる(なお、Mは特徴量の数、Nは学習用サンプルのうち識別境界に寄与するサポートベクタの数、wは重み係数、yijはサポートベクタの特徴量、xは入力xの特徴量である)。
In this embodiment, by using a Gaussian kernel, the discriminant f (x) becomes as shown in the following equation (1) (M is the number of feature quantities, and N is a discriminant boundary among learning samples) The number of support vectors to be performed, w i is a weighting factor, y ij is the feature quantity of the support vector, and x i is the feature quantity of the input x).

ある入力x(この入力xは学習用サンプルとは別である)について、f(x)>0であればクラスAに属すると判別され、f(x)<0であればクラスBに属すると判別される。また、f(x)の値が大きい値になるほど、入力xがクラスAに属する確率が高くなる。逆に、判別式f(x)の値が小さい値になるほど、入力xがクラスAに属する確率が低くなる。前述の全体識別処理のサブ識別器51や部分識別処理のサブ部分識別器61では、上記のサポートベクタマシンの判別式f(x)の値を用いている。サポートベクタマシンによる判別式f(x)の値の算出には、学習用サンプルの数(本実施形態では数万個)が多いほど、すなわちサポートベクタの数が多いほど時間がかかる。   It is determined that a certain input x (this input x is different from the learning sample) belongs to class A if f (x)> 0, and belongs to class B if f (x) <0. Determined. In addition, the larger the value of f (x), the higher the probability that the input x belongs to class A. Conversely, the smaller the value of the discriminant f (x), the lower the probability that the input x belongs to class A. In the sub-identifier 51 for the overall identification process and the sub-partial identifier 61 for the partial identification process, the value of the discriminant f (x) of the support vector machine is used. The calculation of the value of the discriminant f (x) by the support vector machine takes time as the number of learning samples (in this embodiment, tens of thousands) increases, that is, as the number of support vectors increases.

なお、学習用サンプルとは別に評価用サンプルが用意されている。前述のRecallやPrecisionのグラフは、評価用サンプルに対する識別結果(判別式f(x)の値)に基づくものである。   An evaluation sample is prepared separately from the learning sample. The above Recall and Precision graphs are based on the identification results (values of the discriminant f (x)) for the evaluation samples.

===統合識別処理===
図5のフローでは、統合識別処理より前に特定識別処理を行なうこととしているが、説明の都合上、統合識別処理の方を先に説明する。なお、特定識別処理の詳細については、後述する。
=== Integrated identification processing ===
In the flow of FIG. 5, the specific identification process is performed before the integrated identification process. However, the integrated identification process will be described first for convenience of explanation. Details of the specific identification process will be described later.

前述の全体識別処理や部分識別処理では、サブ識別器51やサブ部分識別器61における肯定閾値を比較的高めに設定し、Precision(正解率)を高めに設定している。なぜならば、例えば全体識別器51の風景識別器51Lの正解率が低く設定されると、風景識別器51が紅葉画像を風景画像であると誤識別してしまい、紅葉識別器51Rによる識別を行う前に全体識別処理を終えてしまう事態が発生してしまうからである。本実施形態では、Precision(正解率)が高めに設定されることにより、特定のシーンに属する画像が特定のシーンのサブ識別器51(又はサブ部分識別器61)に識別されるようになる(例えば、紅葉画像が紅葉識別器51R(又は紅葉部分識別器61R)によって識別されるようになる)。   In the above-described overall identification process and partial identification process, the positive threshold value in the sub-classifier 51 and the sub-classifier 61 is set relatively high, and the Precision (correct answer rate) is set high. This is because, for example, when the correct answer rate of the landscape classifier 51L of the overall classifier 51 is set low, the landscape classifier 51 misidentifies the autumnal image as a landscape image, and the autumnal classifier 51R performs identification. This is because a situation in which the entire identification process is finished before occurs. In the present embodiment, by setting the Precision (accuracy rate) high, an image belonging to a specific scene is identified by the sub-classifier 51 (or sub-partial classifier 61) of the specific scene ( For example, the autumn leaves image is identified by the autumn leaves discriminator 51R (or the autumn leaf partial discriminator 61R).

但し、全体識別処理や部分識別処理のPrecision(正解率)を高めに設定すると、全体識別処理や部分識別処理ではシーンの識別ができなくなる可能性が高くなる。そこで、本実施形態では、全体識別処理及び部分識別処理によってシーンの識別ができなかった場合、以下に説明する統合識別処理が行われる。   However, if the Precision (accuracy rate) of the overall identification process or the partial identification process is set to be high, there is a high possibility that the scene cannot be identified by the overall identification process or the partial identification process. Therefore, in this embodiment, when the scene cannot be identified by the overall identification process and the partial identification process, the integrated identification process described below is performed.

図18は、統合識別処理のフロー図である。以下に説明するように、統合識別処理は、全体識別処理の各サブ識別器51の判別式の値に基づいて、最も確信度の高いシーンを選択する処理である。   FIG. 18 is a flowchart of the integrated identification process. As will be described below, the integrated identification process is a process of selecting a scene with the highest certainty factor based on the discriminant value of each sub-classifier 51 in the overall identification process.

まず、統合識別器70は、5つのサブ識別器51の判別式の値に基づいて、正となるシーンを抽出する(S401)。このとき、全体識別処理の際に各サブ識別器51が算出した判別式の値が用いられる。   First, the integrated discriminator 70 extracts a positive scene based on the discriminant values of the five sub discriminators 51 (S401). At this time, the value of the discriminant calculated by each sub classifier 51 during the overall identification process is used.

次に、統合識別器70は、判別式の値が正のシーンが存在するか否かを判断する(S402)。判別式の値が正のシーンが存在する場合(S402でYES)、最大値のシーンの欄に肯定フラグを立てて(S403)、統合識別処理を終了する。これにより、最大値のシーンに識別対象画像が属すると判断される。   Next, the integrated discriminator 70 determines whether or not a scene having a positive discriminant value exists (S402). If there is a scene with a positive discriminant value (YES in S402), an affirmative flag is set in the maximum value scene column (S403), and the integrated identification process is terminated. Accordingly, it is determined that the identification target image belongs to the maximum value scene.

一方、判別式の値が正であるシーンが存在しない場合(S402でNO)、肯定フラグを立てずに、統合識別処理を終了する。これにより、図8の識別対象テーブルの肯定欄において、1のシーンが無いままの状態になる。つまり、識別対象画像が、どのシーンに属するか識別できなかったことになる。   On the other hand, if there is no scene having a positive discriminant value (NO in S402), the integrated identification process is terminated without setting an affirmative flag. As a result, there is no scene in the affirmative column of the identification target table in FIG. That is, it cannot be identified to which scene the identification target image belongs.

なお、既に説明した通り、統合識別処理が終了すると、シーン識別部33は、統合識別処理によってシーンの識別ができたか否かを判断する(図5のS108)。このとき、シーン識別部33は、図8の識別対象テーブルを参照し、「肯定」欄に1があるか否かを判断することになる。S402でNOとの判断の場合、S110の判断もNOになる。   As already described, when the integrated identification process is completed, the scene identification unit 33 determines whether or not the scene has been identified by the integrated identification process (S108 in FIG. 5). At this time, the scene identification unit 33 refers to the identification target table in FIG. 8 and determines whether or not there is 1 in the “affirmation” column. If NO is determined in S402, the determination in S110 is also NO.

===第1実施形態の特定識別処理について===
<概要>
前述したように、プリンタ4の画像補正部34は、記憶部31の結果記憶部31Bに記憶されている識別結果(顔識別部32やシーン識別部33の識別結果)に基づいて、画像記憶部31Aの画像データを補正する。例えば、図4に示すように「風景」のシーンと識別された画像に対しては、緑色を強調する補正を行い、「紅葉」のシーンと識別された画像に対しては、赤色を強調する補正を行なう。
=== Regarding the Specific Identification Process of the First Embodiment ===
<Overview>
As described above, the image correction unit 34 of the printer 4 uses the image storage unit based on the identification results (identification results of the face identification unit 32 and the scene identification unit 33) stored in the result storage unit 31B of the storage unit 31. The 31A image data is corrected. For example, as shown in FIG. 4, correction is performed to emphasize green for an image identified as a “landscape” scene, and red is enhanced for an image identified as a “autumn leaves” scene. Make corrections.

ところで、通常、画像は、複数の色の領域を含んで形成されており、同一の画像の中に、色相環で対向する位置の色(補色)の領域が含まれていることがある。例えば、紅葉のシーンの画像の場合、紅葉の赤色の葉と、赤色の補色である緑色の葉が含まれていることがある。そのような画像に、上述したような赤色を強調する紅葉のシーンの補正を行うと、紅葉の特徴である赤色は、色が強調されて紅葉らしさが増す(好ましい色になる)。ところが、赤色の補色である緑色は、無彩色(灰色)に近づく(以下、このことを劣化ともいう)。逆に、この画像に風景の補正を行うと、風景の特徴である緑色は、強調されて好ましい色になる。しかし、緑色の補色である赤色は劣化する。   By the way, an image is usually formed to include a plurality of color areas, and a color (complementary color) area at a position facing each other in the hue ring may be included in the same image. For example, in the case of an image of an autumnal scene, a red leaf of autumnal leaves and a green leaf that is a complementary color of red may be included. When such an image is corrected for the autumnal scene that emphasizes the red color as described above, the red color, which is a characteristic of the autumnal color, is enhanced in color and becomes more like an autumnal color (becomes a preferred color). However, green, which is a complementary color of red, approaches an achromatic color (gray) (hereinafter, this is also referred to as deterioration). Conversely, when landscape correction is performed on this image, green, which is a feature of the landscape, is emphasized and becomes a preferable color. However, red, which is a complementary color of green, deteriorates.

図19A及び図19Bは、紅葉の山肌を撮影した画像の一例を示す図である。この図19A及び図19Bは、シーン識別部33によって、共に紅葉のシーンであると識別された画像である。これらの画像に対して、例えば赤色を強調する紅葉の補正を行うと、図19Bでは、画像全体として満足のいく結果が得られたが、図19Aでは、図19Bの場合と同様の結果が得られなかった。図19Aの場合、紅葉のシーンの補正ではなく、緑を強調する風景シーンの補正をした方が好ましい補正結果が得られた。   FIG. 19A and FIG. 19B are diagrams illustrating an example of an image obtained by capturing a mountain surface of autumn leaves. 19A and 19B are images that are both identified by the scene identifying unit 33 as being autumnal scenes. For example, when correction of autumn leaves for emphasizing red color is performed on these images, a satisfactory result as a whole image is obtained in FIG. 19B, but the same result as in FIG. 19B is obtained in FIG. 19A. I couldn't. In the case of FIG. 19A, a correction result that is more preferable when the scenery scene that emphasizes green is corrected rather than the correction of the autumnal scene is obtained.

この補正結果の違いは、画像における補色(赤色と緑色)の面積の割合に応じて生じると考察できる。つまり、赤色を強調すれば緑色が劣化し、緑色を強調すれば赤色が劣化するため、赤色と緑色の割合が閾値以上の場合には、赤色を強調する紅葉の補正を行う方が好ましい補正結果が得られ、赤色と緑色の割合が閾値以下の場合には緑色を強調する風景の補正を行う方が好ましい補正結果が得られると考えられる。   It can be considered that this difference in the correction results occurs according to the ratio of the areas of complementary colors (red and green) in the image. In other words, if red is emphasized, green is deteriorated, and if green is emphasized, red is deteriorated. Therefore, when the ratio of red to green is equal to or greater than the threshold value, it is preferable to correct autumn leaves that emphasize red. If the ratio between red and green is less than or equal to the threshold value, it is considered that it is possible to obtain a correction result that is more preferable to correct a landscape that emphasizes green.

このように、補色の色を含んでいる画像の場合には、補色の各色の面積の割合に応じて、画像に適した補正処理が変わることになる。そこで、本実施形態のシーン識別部33は、補色の関係の色を含む画像に対して補正処理を考慮した識別を行う特定識別器65を備えている。本実施形態では、特定識別器65は、赤色の領域と緑色領域を含む画像について、(赤色を強調する補正処理が行われる)紅葉のシーンとするか、あるいは(緑色を強調する補正処理が行われる)風景のシーンとするかを判断することにする。   As described above, in the case of an image including a complementary color, the correction process suitable for the image changes according to the ratio of the area of each complementary color. Therefore, the scene identification unit 33 of the present embodiment includes a specific identifier 65 that performs identification in consideration of correction processing on an image including complementary colors. In this embodiment, the specific discriminator 65 sets an image including a red region and a green region as an autumnal scene (a correction process that emphasizes red) is performed, or (a correction process that emphasizes green is performed). Judgment is made on whether the scene is a landscape.

<補正処理の内容について>
ここで、まず、風景の補正処理と紅葉の補正処理の内容の一例について説明する。
風景の補正処理は、図4に示すように、コントラストをやや硬調にし、明るさをやや暗くし、彩度をやや高くし、シャープネスをやや強くする。また、記憶色として緑色が設定されており、緑色の補正を行う。以下、この補正処理の一例について説明する。
<Contents of correction processing>
First, an example of the contents of the landscape correction process and the autumnal leaves correction process will be described.
As shown in FIG. 4, the landscape correction processing makes the contrast slightly harder, makes the brightness slightly darker, makes the saturation slightly higher, and makes the sharpness slightly stronger. Further, green is set as the memory color, and green correction is performed. Hereinafter, an example of this correction process will be described.

まず、緑色の画素に対する、R(赤)G(緑)B(青)の成分の最適値(以下ターゲットともいう)をそれぞれ設定しておく。図20は、緑色のターゲットの一例を示す図である。なお、図20における制御ポイントとは、各色のトーンカーブ(後述する)を制御する階調のことである。   First, optimum values (hereinafter also referred to as targets) of R (red), G (green), and B (blue) components for green pixels are set. FIG. 20 is a diagram illustrating an example of a green target. Note that the control points in FIG. 20 are gradations for controlling the tone curve (described later) of each color.

そして、画像から取得した緑色のRGBの平均値とターゲットとの差を求め、この差を解消するように補正量を求める。例えば、緑色のR、G、Bの各ターゲットをRt、Gt、Btとし、緑色の画素に対するRGBの成分の平均値を、Rga、Gga、Bgaとすると、RGBの制御量はそれぞれ、
ΔRgreen=k(Rt−Rga)
ΔGgreen=k(Gt−Gga)
ΔBgreen=k(Bt−Bga)
となる。なお、kは補正係数である。ここで、緑色の画素の平均値の一例として、Rga=100、Gga=137、Bga=80とし、さらに補正係数k=1/5とした場合、
ΔRgreen=k(Rt−Rga)=(0−100)/5=−20
ΔGgreen=k(Gt−Gga)=(192−137)/5=11
ΔBgreen=k(Bt−Bga)=(20−80)/5=−12
となる。
Then, a difference between the average value of green RGB acquired from the image and the target is obtained, and a correction amount is obtained so as to eliminate this difference. For example, if the green R, G, and B targets are Rt, Gt, and Bt, and the average value of RGB components for the green pixel is Rga, Gga, and Bga, the RGB control amounts are respectively
ΔRgreen = k (Rt−Rga)
ΔGgreen = k (Gt−Gga)
ΔBgreen = k (Bt−Bga)
It becomes. Note that k is a correction coefficient. Here, as an example of the average value of the green pixels, when Rga = 100, Gga = 137, Bga = 80, and further when the correction coefficient k = 1/5,
ΔRgreen = k (Rt−Rga) = (0−100) / 5 = −20
ΔGgreen = k (Gt−Gga) = (192-137) / 5 = 11
ΔBgreen = k (Bt−Bga) = (20−80) / 5 = −12
It becomes.

この制御量を用いて色補正テーブルを作成しトーンカーブの制御を行う。図21は、トーンカーブ制御を説明するための図である。なお、図21は、緑色のG成分について示すものである。また、図21では、画像全体の統計値から決定されたトーンカーブを基本テーブル(実線)で示している。図21に示すように、トーンカーブには、階調「0」〜階調「255」の256の階調があり、このうちの階調「64」の部分に上述したΔGgreenの値を加味する。そして、階調「0」、階調「64」、階調「255」の3点を通る曲線で滑らかに補間する。このようにして、図21に示す色補正テーブル(破線)を作成する。同様にして、緑色のR成分、B成分についてもトーンカーブの制御を行い、色補正テーブルを作成する。ΔGgreenは正であるので、緑色のG成分の色補正テーブルは基本テーブルに比べて高くなる。一方、ΔRgreenとΔBgreenは負であるので、R成分とB成分の色補正テーブルは基本テーブルに比べて低くなる。   A color correction table is created using this control amount to control the tone curve. FIG. 21 is a diagram for explaining tone curve control. FIG. 21 shows the green G component. Further, in FIG. 21, the tone curve determined from the statistical values of the entire image is indicated by a basic table (solid line). As shown in FIG. 21, the tone curve has 256 gradations from gradation “0” to gradation “255”, and the above ΔGgreen value is added to the gradation “64” portion. . Then, smooth interpolation is performed with a curve passing through three points of gradation “0”, gradation “64”, and gradation “255”. In this way, the color correction table (broken line) shown in FIG. 21 is created. Similarly, the tone curve is controlled for the green R component and B component, and a color correction table is created. Since ΔGgreen is positive, the green G component color correction table is higher than the basic table. On the other hand, since ΔRgreen and ΔBgreen are negative, the R component and B component color correction tables are lower than the basic table.

ある画素のR、G、Bに対して風景の補正処理を行った後の値R´、G´、B´は、基本テーブルにおけるRGB値(Rbase、Gbase、Bbase)及び、緑色の色補正テーブルにおけるRGB値(Rgreen、Ggreen、Bgreen)を用いて
R´=(1−Wgreen)Rbase+WgreenRgreen=Rbase+Wgreen(Rgreen−Rbase)
G´=(1−Wgreen)Gbase+WgreenGgreen=Gbase+Wgreen(Ggreen−Gbase)
B´=(1−Wgreen)Bbase+WgreenBgreen=Bbase+Wgreen(Bgreen−Bbase)
と表される。なお、Wgreenは注目成分GがR、Bに対してどの程度強いかを示す重み係数である(0≦Wgreen≦1)。このように、風景の補正を行うことによって、各画素のRGBの値がR´G´B´に変更される。色補正テーブルと基本テーブルの関係よりRgreen<Rbase、Ggreen>Gbase、Bgreen<Bbaseなので、
R´<Rbase
G´>Gbase
B´<Bbase
となる。つまり、各画素のG成分が大きくなり、R成分及びB成分が小さくなるように補正されることになる。従って、緑色は強調されて好ましい色(ターゲット)に近づくが、緑色の補色である赤色は、劣化する。
The values R ′, G ′, B ′ after performing landscape correction processing on R, G, B of a certain pixel are RGB values (Rbase, Gbase, Bbase) in the basic table and the green color correction table. R ′ = (1−Wgreen) Rbase + WgreenRgreen = Rbase + Wgreen (Rgreen−Rbase) using RGB values (Rgreen, Ggreen, Bgreen) in
G '= (1-Wgreen) Gbase + WgreenGgreen = Gbase + Wgreen (Ggreen-Gbase)
B '= (1-Wgreen) Bbase + WgreenBgreen = Bbase + Wgreen (Bgreen-Bbase)
It is expressed. Wgreen is a weighting coefficient indicating how strong the attention component G is against R and B (0 ≦ Wgreen ≦ 1). In this way, by correcting the landscape, the RGB value of each pixel is changed to R′G′B ′. Rgreen <Rbase, Ggreen> Gbase, and Bgreen <Bbase from the relationship between the color correction table and the basic table.
R '<Rbase
G '> Gbase
B '<Bbase
It becomes. That is, correction is performed so that the G component of each pixel increases and the R component and B component decrease. Accordingly, the green color is emphasized and approaches a preferable color (target), but the red color which is a complementary color of green deteriorates.

紅葉の補正処理は、図4に示すように、彩度を高くし、シャープネスを強くする。また、記憶色として赤色が設定されており、画像の赤色を強調するように補正する。この場合も、上述した補正方法と同様の補正処理を行うことができる。これにより赤色についてはより赤い色になり、紅葉らしさが強調される。しかし、この補正により赤色の補色である緑色は劣化する。   As shown in FIG. 4, the correction process for autumn leaves increases the saturation and increases the sharpness. Also, red is set as the memory color, and correction is performed so as to emphasize the red color of the image. Also in this case, the same correction process as that described above can be performed. As a result, the red color becomes a red color, and the color of autumn leaves is emphasized. However, this correction degrades green, which is a complementary color of red.

<特定識別処理について>
図22は、特定識別器65による特定識別処理の一例を説明するフロー図である。なお、図22は、図5の破線部分における処理を示している。
<About specific identification processing>
FIG. 22 is a flowchart illustrating an example of specific identification processing by the specific identifier 65. FIG. 22 shows the processing in the broken line part of FIG.

まず特定識別器65は、記憶部31から、画像の識別結果や特徴量に関するデータを取得する(S501)。そして、特定識別器65は、紅葉のシーンの判別式の値(確信度)と風景のシーンの判別式の値が所定値(例えば正の値)よりも大きいか否かを判断する(S502)。つまり、統合識別器70によって紅葉のシーンあるいは風景のシーンと識別される可能性が高い画像であるかを判断する。   First, the specific discriminator 65 acquires data related to the image discrimination result and the feature amount from the storage unit 31 (S501). The specific discriminator 65 determines whether or not the value of the discriminant for the autumnal scene (the certainty factor) and the value of the discriminant for the landscape scene are larger than a predetermined value (for example, a positive value) (S502). . That is, the integrated discriminator 70 determines whether the image is highly likely to be identified as an autumnal scene or a landscape scene.

紅葉のシーンと風景のシーンの判別式の値が所定値以下であると判断した場合(S502でNO)、統合識別器70が統合識別処理を行う(S109)。
一方、紅葉のシーンの確信度と風景のシーンの判別式の値が所定値よりも大きいと判断した場合(S502でYES)、特定識別器65は、画像の特徴量に関するデータに基づいて、画像の中の赤色の面積と、赤色の補色である緑色の面積の割合(赤色の面積/緑色の面積)を算出する(S503)。そして、赤色と緑色の割合が閾値(本実施形態では1.3とする)よりも大きいか否かを判断する(S504)。
When it is determined that the value of the discriminant between the autumnal scene and the landscape scene is equal to or less than the predetermined value (NO in S502), the integrated discriminator 70 performs the integrated discriminating process (S109).
On the other hand, if it is determined that the certainty factor of the autumnal scene and the discriminant value of the landscape scene are larger than the predetermined value (YES in S502), the specific discriminator 65 determines the image based on the data relating to the image feature amount. The ratio (red area / green area) of the red area and the green area which is the complementary color of red is calculated (S503). Then, it is determined whether or not the ratio between red and green is larger than a threshold value (1.3 in this embodiment) (S504).

赤色と緑色の割合が1.3以下であると判断した場合(S504でNO)、特定識別器65は、風景のシーンであると識別する(S505)。言い換えると、画像補正部34にて緑色を強調する風景の補正処理を行なうシーンを選択する。また、赤色と緑色の割合が1.3よりも大きいと判断した場合(S504でYES)、特定識別器65は、紅葉のシーンであると識別する(S506)。言い換えると、画像補正部34にて赤色を強調する紅葉の補正処理を行なうシーンを選択する。なお、S505での判断の閾値を1よりも大きくしたのは、人の視覚は緑色に対して敏感であり、赤色と緑色が同じ割合の場合、あるいは赤色が緑色よりも少し多い場合においても、緑色を強める補正をした方が好ましい補正結果が得られるためである。   If it is determined that the ratio of red to green is 1.3 or less (NO in S504), the specific identifier 65 identifies a scene of a landscape (S505). In other words, the scene for which the image correction unit 34 performs a correction process for a landscape that emphasizes green is selected. If it is determined that the ratio between red and green is greater than 1.3 (YES in S504), the specific discriminator 65 identifies that the scene is a fall foliage scene (S506). In other words, the scene for which the image correction unit 34 performs correction processing of autumn leaves that emphasize red is selected. It should be noted that the threshold value of the determination in S505 is greater than 1 because human vision is sensitive to green, even when red and green are the same ratio, or when red is slightly more than green, This is because it is possible to obtain a correction result that is preferable to perform correction to increase green.

本実施形態では、画像の中の赤色の領域と緑色の領域の割合に応じて、紅葉のシーンと風景のシーンを識別し、対応する補正処理を行うようにしたが、補色の関係の色が混在する他のシーンの画像(例えば、人物と背景など)についても同様な処理を行うようにしてもよい。   In the present embodiment, the autumnal leaves scene and the landscape scene are identified according to the ratio of the red area and the green area in the image, and the corresponding correction process is performed. Similar processing may be performed for images of other scenes (for example, a person and a background).

このように、補色の関係の色を含む画像に対して、その補色の色の割合に応じてシーン(補正処理)を選択することにより、画像に適した補正を行うことができる。   In this manner, by selecting a scene (correction process) according to the ratio of the complementary color to an image including complementary colors, correction suitable for the image can be performed.

===第2実施形態の特定識別処理について===
第1実施形態では、RGB色空間における補正処理について説明したが、第2実施形態では、L*a*B*色空間における補正処理について説明する。L*a*B*色空間では、ある色と他の色との色の差(以下色差ともいう)が2点間の距離で表せるため、補正量を容易に求めることができる。
=== Regarding the Specific Identification Process of the Second Embodiment ===
In the first embodiment, correction processing in the RGB color space has been described. In the second embodiment, correction processing in the L * a * B * color space will be described. In the L * a * B * color space, a color difference between a certain color and another color (hereinafter also referred to as a color difference) can be expressed by a distance between two points, so that the correction amount can be easily obtained.

図23はL*a*B*色空間の模式図である。また、図24は、図23をL*軸のプラス側から見てa*とb*の座標位置だけで示した図である。図23に示すように、L*a*B*色空間は、L*、a*、b*を軸とする球体として表すことができる。そして、球体内の点は、座標(L、a、b)で表すことができる。   FIG. 23 is a schematic diagram of the L * a * B * color space. FIG. 24 is a diagram showing FIG. 23 only with the coordinate positions of a * and b * when viewed from the plus side of the L * axis. As shown in FIG. 23, the L * a * B * color space can be represented as a sphere with L *, a *, and b * as axes. A point in the sphere can be represented by coordinates (L, a, b).

L*軸は明度の軸であり、プラス側になるほど明るくなりマイナス側になるほど暗くなる。なお、図23のWは白色に相当し、Bは黒色に相当する。そして、WとBとの間は、明るさの違う灰色となっている。   The L * axis is a lightness axis, and becomes brighter toward the positive side and darker toward the negative side. Note that W in FIG. 23 corresponds to white, and B corresponds to black. And between W and B is gray with different brightness.

彩度は、L*軸からの距離に応じて変化する。例えば、a*b*平面において、L*軸上(つまりa*およびb*が共に0の位置)は無彩色(灰色)である。そして、L*軸から離れるほど彩度が高くなり、鮮やかな色となる。   The saturation changes according to the distance from the L * axis. For example, on the a * b * plane, the L * axis (that is, the position where both a * and b * are 0) is achromatic (gray). Then, the further away from the L * axis, the higher the saturation and the brighter the color.

色相は、(a*、b*)の座標の値に応じて変化する。例えばa*がプラス側になるほど、赤味が強くなり、a*がマイナス側になるほど、緑味が強くなる。また、b*がプラス側になるほど、黄味が強くなり、b*がマイナス側になるほど、青味が強くなる。   The hue changes according to the coordinate value (a *, b *). For example, the redness becomes stronger as a * becomes positive, and the greenness becomes stronger as a * becomes negative. In addition, as b * is on the plus side, yellowishness is stronger, and as b * is on the minus side, bluishness is stronger.

以下、L*a*B*色空間における補正処理の一例について説明する。本実施形態では、風景の緑色を強調する場合について説明する。まず、緑色のターゲットとして図24に示すようにL*a*b*=(L1、a1、b1)を設定する(図24の点x1)。具体的には、緑色のターゲットとしては、例えばL*a*b*=(67、−28、48)が設定される。   Hereinafter, an example of correction processing in the L * a * B * color space will be described. In this embodiment, a case where the green color of a landscape is emphasized will be described. First, L * a * b * = (L1, a1, b1) is set as a green target as shown in FIG. 24 (point x1 in FIG. 24). Specifically, for example, L * a * b * = (67, −28, 48) is set as the green target.

また、実際の画像の特徴量のデータから得られた緑色の平均値がL*a*b*=(L2、a2、b2)であるとする(図24の点x2)。この平均値(x2)とターゲット(x1)との差を解消するように補正量を定める。   Further, it is assumed that the average value of the green color obtained from the feature value data of the actual image is L * a * b * = (L2, a2, b2) (point x2 in FIG. 24). The correction amount is determined so as to eliminate the difference between the average value (x2) and the target (x1).

ここで、L*a*B*色空間において、ある色と他の色との色差は2点間の距離で表せるので、ターゲット(x1)と平均値(x2)との色差zは、
z=√{ΔL*+Δa*+Δb*}
=√{(L1−L2)+(a1−a2)+(b1−b2)}
となる。なお、本実施形態では便宜上L1=L2であることとする。すなわち、
z=√{(a1−a2)+(b1−b2)}
となる。この色差zを解消するように補正を行えばよいことになるが、このとき、目標の色(ターゲット)と完全に一致させると、補正後の画像の色が元の色と違いすぎて、満足のいく補正結果が得られないがことがある。そこで、本実施形態では、補正量をhとして、以下の補正式、
h=√z・・・・(1)
を適用する。
Here, in the L * a * B * color space, the color difference between a certain color and another color can be expressed by the distance between two points, so the color difference z between the target (x1) and the average value (x2) is
z = √ {ΔL * 2 + Δa * 2 + Δb * 2 }
= √ {(L1-L2) 2 + (a1-a2) 2 + (b1-b2) 2 }
It becomes. In the present embodiment, it is assumed that L1 = L2 for convenience. That is,
z = √ {(a1-a2) 2 + (b1-b2) 2 }
It becomes. It is only necessary to perform correction so as to eliminate this color difference z. At this time, if it completely matches the target color (target), the color of the corrected image is too different from the original color, which is satisfactory. However, there are cases where the correct correction result cannot be obtained. Therefore, in this embodiment, the correction amount is h,
h = √z (1)
Apply.

図25は、上述した補正式(1)における色差(z)と補正量(h)との関係を示す図である。図25の横軸は色差(z)を示し、縦軸は補正量(h)を示している。このように上述した補正式(1)を用いると、色差が大きくなるにつれて、補正量は緩やかに大きくなる。この補正式(1)によって算出した補正量hを、画像の各画素について加味する補正を行う。   FIG. 25 is a diagram illustrating the relationship between the color difference (z) and the correction amount (h) in the correction equation (1) described above. In FIG. 25, the horizontal axis indicates the color difference (z), and the vertical axis indicates the correction amount (h). As described above, when the correction equation (1) described above is used, the correction amount gradually increases as the color difference increases. The correction amount h calculated by the correction formula (1) is corrected for each pixel of the image.

なお、図24において、点yは赤色の画素(例えば、赤色の平均値)を示している。上述した補正量hによって画像全体の補正を行うと、点yは、y´に補正されることになる。このように、緑色の点x2を強調する(原点からの距離を大きくする)補正によって赤色の点yがy´となり原点(無彩色)に近づく。すなわち、緑色を強調する補正を行うと、赤色が劣化することになる。   In FIG. 24, a point y indicates a red pixel (for example, a red average value). When the entire image is corrected with the correction amount h described above, the point y is corrected to y ′. In this way, the red point y becomes y ′ by the correction that emphasizes the green point x2 (increases the distance from the origin) and approaches the origin (achromatic color). That is, when correction for emphasizing green is performed, red is degraded.

本実施形態では、緑色を強調する補正を行う場合について説明したが、赤色を強調する場合も同様にして補正量を求めることができる。
このようにして算出された補正量によって、赤色を強調する補正処理(例えば紅葉の補正処理)及び緑色を強調する補正処理(例えば風景の補正処理)が行われることになる。
In the present embodiment, the case where correction for emphasizing green is performed has been described. However, the correction amount can also be obtained in the same manner when emphasizing red.
A correction process for emphasizing red (for example, correction process for autumn leaves) and a correction process for emphasizing green (for example, correction process for landscape) are performed based on the correction amount thus calculated.

なお、赤色の領域と緑色の領域が含まれる画像に上述した紅葉の補正処理あるいは風景の補正処理を適用する場合においても、第1実施形態と同様に、特定識別処理において画像の中の赤色と緑色の面積の割合に応じて、紅葉のシーンと風景のシーンを識別するようにすればよい。これにより、第1実施形態と同様に赤色の領域と緑色の領域が共に含まれる画像に適した補正処理を行うことができる。   Even in the case where the above-described autumnal leaf correction process or landscape correction process is applied to an image including a red area and a green area, as in the first embodiment, red and red in the image are identified in the specific identification process. According to the proportion of the green area, the autumnal scene and the landscape scene may be identified. Accordingly, correction processing suitable for an image including both a red region and a green region can be performed as in the first embodiment.

===第3実施形態の特定識別処理について===
前述した実施形態では、画像における補色の色の面積の割合に応じて、適用する補正処理を選択することとしたが、部分識別処理の識別結果を用いて、適用する補正処理を選択するようにしてもよい。
=== Regarding the Specific Identification Process of the Third Embodiment ===
In the above-described embodiment, the correction process to be applied is selected according to the ratio of the area of the complementary color in the image. However, the correction process to be applied is selected using the identification result of the partial identification process. May be.

例えば、シーン識別部33の部分識別器60において、各部分画像が風景のシーンに属するか否か(本実施形態の場合、緑色であるか否か)を識別する風景のシーンのサブ部分識別器(不図示)を設け、部分識別処理を行う際に、少なくとも紅葉と風景の部分識別処理を全ての部分画像について行うようにする。このようにして、シーン毎に部分識別処理を行い、紅葉部分識別器61Rの紅葉検出数カウンタと、風景部分識別器(不図示)の風景検出数カウンタ(不図示)により、紅葉と識別された部分画像の数と、風景と識別された部分画像の数をカウントする。   For example, in the partial discriminator 60 of the scene discriminating unit 33, a sub-partial discriminator for landscape scenes that identifies whether or not each partial image belongs to a landscape scene (in this embodiment, whether it is green). (Not shown) is provided, and when performing partial identification processing, at least partial identification processing of autumn leaves and landscape is performed for all partial images. In this way, partial identification processing is performed for each scene, and the autumnal leaves are identified as autumn leaves by the autumnal leaves detection number counter of the autumnal leaf partial identifier 61R and the landscape detection number counter (not shown) of the landscape partial identifier (not shown). The number of partial images and the number of partial images identified as landscapes are counted.

そして、特定識別処理(図22)におけるS505で、紅葉のシーンと識別された部分画像の個数と、風景のシーンと識別された部分画像の個数の割合を比較する。この結果、紅葉と識別された部分画像の個数と、風景と識別された部分画像の個数との割合が、閾値よりも大きければ紅葉のシーンと識別し、閾値以下であれば風景のシーンと識別する。   Then, in S505 in the specific identification process (FIG. 22), the ratio of the number of partial images identified as an autumnal scene and the number of partial images identified as a landscape scene are compared. As a result, if the ratio between the number of partial images identified as autumn leaves and the number of partial images identified as landscapes is greater than the threshold value, it is identified as an autumnal scene, and if it is equal to or less than the threshold value, it is identified as a landscape scene. To do.

これにより、部分識別処理の識別結果を用いて、画像に適した補正処理を行うことができる。   Thereby, the correction process suitable for the image can be performed using the identification result of the partial identification process.

===その他の実施形態===
一実施形態としてプリンタ4によって画像のシーンの補正処理を行う場合について説明したが、上記の実施形態は、本発明の理解を容易にするためのものであり、本発明を限定して解釈するためのものではない。本発明は、その趣旨を逸脱することなく、変更、改良され得ると共に、本発明にはその等価物が含まれることは言うまでもない。
=== Other Embodiments ===
Although the case where the correction process of the image scene is performed by the printer 4 has been described as an embodiment, the above embodiment is for facilitating the understanding of the present invention, and is intended to limit the interpretation of the present invention. Is not. The present invention can be changed and improved without departing from the gist thereof, and it is needless to say that the present invention includes equivalents thereof.

例えば、前述の実施形態ではプリンタ4がシーン識別処理及び補正処理を行うこととしたが、これらの処理を、例えば、デジタルスチルカメラ2や、デジタルスチルカメラ2から画像データを取得したコンピュータ(不図示)が行うようにしても良い。   For example, in the above-described embodiment, the printer 4 performs the scene identification process and the correction process. These processes are performed by, for example, the digital still camera 2 or a computer (not shown) that acquires image data from the digital still camera 2. ) May be performed.

画像処理システムの説明図である。It is explanatory drawing of an image processing system. プリンタの構成の説明図である。2 is an explanatory diagram of a configuration of a printer. FIG. プリンタの自動補正機能の説明図である。It is explanatory drawing of the automatic correction function of a printer. 画像のシーンと補正内容との関係の説明図である。It is explanatory drawing of the relationship between the scene of an image, and the correction content. シーン識別部によるシーン識別処理のフロー図である。It is a flowchart of the scene identification process by a scene identification part. シーン識別部の機能の説明図である。It is explanatory drawing of the function of a scene identification part. 全体識別処理のフロー図である。It is a flowchart of a whole identification process. 識別対象テーブルの説明図である。It is explanatory drawing of an identification object table. 全体識別処理の肯定閾値の説明図である。It is explanatory drawing of the affirmation threshold value of the whole identification process. RecallとPrecisionの説明図である。It is explanatory drawing of Recall and Precision. 第1否定閾値の説明図である。It is explanatory drawing of a 1st negative threshold value. 第2否定閾値の説明図である。It is explanatory drawing of a 2nd negative threshold value. 図13Aは、閾値テーブルの説明図である。図13Bは、風景識別器における閾値の説明図である。図13Cは、風景識別器の処理の概要の説明図である。FIG. 13A is an explanatory diagram of a threshold table. FIG. 13B is an explanatory diagram of threshold values in the landscape classifier. FIG. 13C is an explanatory diagram of an outline of the process of the landscape classifier. 部分識別処理のフロー図である。It is a flowchart of a partial identification process. 夕景部分識別器が選択する部分画像の順番の説明図である。It is explanatory drawing of the order of the partial image which an evening scene partial identifier selects. 上位10番目までの10個の部分画像だけで夕景画像の識別をしたときのRecall及びPrecisionのグラフである。It is a Recall and Precision graph when the evening scene image is identified only by the top 10 partial images. 図17Aは、線形サポートベクタマシンによる判別の説明図である。図17Bは、カーネル関数を用いた判別の説明図である。FIG. 17A is an explanatory diagram of determination by the linear support vector machine. FIG. 17B is an explanatory diagram of discrimination using a kernel function. 統合識別処理のフロー図である。It is a flowchart of an integrated identification process. 図19A及び図19Bは、紅葉の山肌を撮影した画像を示す図である。FIG. 19A and FIG. 19B are diagrams showing images obtained by photographing mountain leaves of autumn leaves. 緑色のターゲットを示す図である。It is a figure which shows a green target. トーンカーブ制御を説明するための図である。It is a figure for demonstrating tone curve control. 特定識別処理を説明するフロー図である。It is a flowchart explaining a specific identification process. L*a*B*色空間の模式図である。It is a schematic diagram of L * a * B * color space. 図23をL*軸のプラス側から見てa*とb*の座標位置で示した図である。It is the figure which showed FIG. 23 by the coordinate position of a * and b * seeing from the plus side of the L * axis. 2点間の距離と補正量との関係を示す図である。It is a figure which shows the relationship between the distance between two points, and a correction amount.

符号の説明Explanation of symbols

2 デジタルスチルカメラ、2A モード設定ダイヤル、4 プリンタ、
6 メモリカード、10 印刷機構、11 ヘッド、12 ヘッド制御部、
13 モータ、14 センサ、23 メモリ、24 制御ユニット、
25 駆動信号生成部、31 記憶部、31A 画像記憶部、31B 結果記憶部、
32 顔識別部、33 シーン識別部、34 画像補正部、35 プリンタ制御部、
40 特徴量取得部、50 全体識別器、51 サブ識別器、51L 風景識別器、
51S 夕景識別器、51N 夜景識別器、51F 花識別器、51R 紅葉識別器、
60 部分識別器、61 サブ部分識別器、61S 夕景部分識別器、
61F 花部分識別器、61R 紅葉部分識別器、65 特定識別器、
70 統合識別器
2 Digital still camera, 2A mode setting dial, 4 printer,
6 memory card, 10 printing mechanism, 11 heads, 12 head control unit,
13 motor, 14 sensor, 23 memory, 24 control unit,
25 drive signal generation unit, 31 storage unit, 31A image storage unit, 31B result storage unit,
32 face identification unit, 33 scene identification unit, 34 image correction unit, 35 printer control unit,
40 feature quantity acquisition unit, 50 global classifier, 51 sub classifier, 51L landscape classifier,
51S evening scene classifier, 51N night scene classifier, 51F flower classifier, 51R autumn leaves classifier,
60 partial classifiers, 61 sub partial classifiers, 61S evening scene partial classifiers,
61F Flower partial classifier, 61R Autumn leaves partial classifier, 65 Specific classifier,
70 Integrated identifier

Claims (8)

画像に対して第1補正処理又は第2補正処理を実行する画像処理方法において、
第1色に対して、前記第2補正処理を実行すると、前記第1補正処理を実行したときよりも色が無彩色に近づき、且つ、前記第2色に対して、前記第1補正処理を実行すると、前記第2補正処理を実行したときよりも色が無彩色に近づく場合、
画像の中の前記第1色と前記第2色の割合に応じて、前記第1補正処理又は前記第2補正処理を選択する、
ことを特徴とする画像処理方法。
In an image processing method for executing a first correction process or a second correction process on an image,
When the second correction process is performed on the first color, the color is closer to an achromatic color than when the first correction process is performed, and the first correction process is performed on the second color. When executed, if the color is closer to an achromatic color than when the second correction process is executed,
Selecting the first correction process or the second correction process according to the ratio of the first color and the second color in the image;
An image processing method.
請求項1に記載の画像処理方法であって、
前記第1色と前記第2色は、互いに補色の関係の色である、
ことを特徴とする画像処理方法。
The image processing method according to claim 1,
The first color and the second color are complementary colors.
An image processing method.
請求項1又は2に記載の画像処理方法であって、
前記第1色は、赤色であり、
前記第2色は、緑色である、
ことを特徴とする画像処理方法。
The image processing method according to claim 1 or 2,
The first color is red;
The second color is green;
An image processing method.
請求項3に記載の画像処理方法であって、
前記割合が同じ場合、前記第2補正処理を選択する
ことを特徴とする画像処理方法。
The image processing method according to claim 3,
An image processing method, wherein the second correction process is selected when the ratios are the same.
請求項1から4の何れかに記載の画像処理方法であって、
前記第1補正処理は、前記第1色を強調する処理であり、
前記第2補正処理は、前記第2色を強調する処理である、
ことを特徴とする画像処理方法。
An image processing method according to any one of claims 1 to 4,
The first correction process is a process for emphasizing the first color;
The second correction process is a process for enhancing the second color.
An image processing method.
請求項1から5の何れかに記載の画像処理方法であって、
画像の中の前記第2色に対する前記第1色の割合が閾値よりも大きい場合、前記第1補正処理を選択し、
前記割合が前記閾値以下の場合、前記第2補正処理を選択する、
ことを特徴とする画像処理方法。
An image processing method according to any one of claims 1 to 5,
If the ratio of the first color to the second color in the image is greater than a threshold, select the first correction process;
When the ratio is equal to or less than the threshold, the second correction process is selected.
An image processing method.
画像に対して第1補正処理又は第2補正処理を実行するコントローラを備えた画像処理装置において、
第1色に対して、前記第2補正処理を実行すると、前記第1補正処理を実行したときよりも色が無彩色に近づき、且つ、前記第2色に対して、前記第1補正処理を実行すると、前記第2補正処理を実行したときよりも色が無彩色に近づく場合、
前記コントローラは、
画像の中の前記第1色と前記第2色の割合に応じて、前記第1補正処理又は前記第2補正処理を選択する、
ことを特徴とする画像処理装置。
In an image processing apparatus including a controller that executes a first correction process or a second correction process on an image,
When the second correction process is performed on the first color, the color is closer to an achromatic color than when the first correction process is performed, and the first correction process is performed on the second color. When executed, if the color is closer to an achromatic color than when the second correction process is executed,
The controller is
Selecting the first correction process or the second correction process according to the ratio of the first color and the second color in the image;
An image processing apparatus.
画像処理装置に、画像に対して第1補正処理又は第2補正処理を実行させるプログラムにおいて、
第1色に対して、前記第2補正処理を実行すると、前記第1補正処理を実行したときよりも色が無彩色に近づき、且つ、前記第2色に対して、前記第1補正処理を実行すると、前記第2補正処理を実行したときよりも色が無彩色に近づく場合、
前記画像処理装置に、画像の中の前記第1色と前記第2色の割合に応じて、前記第1補正処理又は前記第2補正処理を選択させる、
ことを特徴とするプログラム。
In a program for causing an image processing apparatus to execute a first correction process or a second correction process on an image,
When the second correction process is performed on the first color, the color is closer to an achromatic color than when the first correction process is performed, and the first correction process is performed on the second color. When executed, if the color is closer to an achromatic color than when the second correction process is executed,
Causing the image processing apparatus to select the first correction process or the second correction process according to a ratio between the first color and the second color in the image;
A program characterized by that.
JP2007290013A 2007-11-07 2007-11-07 Image processing method, image processor, and program Pending JP2009116691A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007290013A JP2009116691A (en) 2007-11-07 2007-11-07 Image processing method, image processor, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007290013A JP2009116691A (en) 2007-11-07 2007-11-07 Image processing method, image processor, and program

Publications (1)

Publication Number Publication Date
JP2009116691A true JP2009116691A (en) 2009-05-28

Family

ID=40783762

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007290013A Pending JP2009116691A (en) 2007-11-07 2007-11-07 Image processing method, image processor, and program

Country Status (1)

Country Link
JP (1) JP2009116691A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011010162A (en) * 2009-06-29 2011-01-13 Canon Inc Image processing apparatus, image processing method, and computer program
JP2015219790A (en) * 2014-05-19 2015-12-07 株式会社リコー Image processor, image processing method, and image processing program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011010162A (en) * 2009-06-29 2011-01-13 Canon Inc Image processing apparatus, image processing method, and computer program
JP2015219790A (en) * 2014-05-19 2015-12-07 株式会社リコー Image processor, image processing method, and image processing program

Similar Documents

Publication Publication Date Title
JP4611069B2 (en) Device for selecting an image of a specific scene, program, and recording medium recording the program
US7720302B2 (en) Method, apparatus and program for image processing
EP1802096B1 (en) Image processing device, method, and image processing program
EP1276315A2 (en) A method for processing a digital image to adjust brightness
US8111940B2 (en) Image correction apparatus and method, and image correction program
US20090016616A1 (en) Category Classification Apparatus, Category Classification Method, and Storage Medium Storing a Program
US20080292181A1 (en) Information Processing Method, Information Processing Apparatus, and Storage Medium Storing a Program
JP5040624B2 (en) Information processing method, information processing apparatus, and program
JP3928704B2 (en) Image processing apparatus, image processing method, medium storing image processing program, and image processing program
JP2009093334A (en) Identification method and program
JP2009080557A (en) Identification method and program
CN108965646A (en) Image processing apparatus, image processing method and storage medium
JP4946750B2 (en) Setting method, identification method and program
US20080199084A1 (en) Category Classification Apparatus and Category Classification Method
JP4992519B2 (en) Information processing method, information processing apparatus, and program
JP2009116691A (en) Image processing method, image processor, and program
US8761505B2 (en) Modification of memory colors in digital images
US20080232696A1 (en) Scene Classification Apparatus and Scene Classification Method
JP4992646B2 (en) Identification method and program
JP2009070099A (en) Image-processing device, image-processing method, program and recording medium
JP4882927B2 (en) Category identification method
JP2009044249A (en) Image identification method, image identification device, and program
JP2008234626A (en) Information processing method, information processor, and program
JP2008228086A (en) Information processing method, information processor, and program
JP2008228087A (en) Information processing method, information processor, and program