JP2009070103A - Image processor and image processing method - Google Patents

Image processor and image processing method Download PDF

Info

Publication number
JP2009070103A
JP2009070103A JP2007237265A JP2007237265A JP2009070103A JP 2009070103 A JP2009070103 A JP 2009070103A JP 2007237265 A JP2007237265 A JP 2007237265A JP 2007237265 A JP2007237265 A JP 2007237265A JP 2009070103 A JP2009070103 A JP 2009070103A
Authority
JP
Japan
Prior art keywords
image
frequency component
specific area
color
pixel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
JP2007237265A
Other languages
Japanese (ja)
Inventor
Yasuo Fukuda
康男 福田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2007237265A priority Critical patent/JP2009070103A/en
Publication of JP2009070103A publication Critical patent/JP2009070103A/en
Withdrawn legal-status Critical Current

Links

Landscapes

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

Abstract

<P>PROBLEM TO BE SOLVED: To appropriately and easily detect a specific color pixel locally existing within a photographic image of a person, such as red eye which occurs as color abnormality of a pupil from the image. <P>SOLUTION: A low-frequency component is extracted from an input image to generate a low-frequency component image (S201), and each pixel of the input image is converted so as to remove a peripheral color based on the low-frequency component image to thereby form a converted image (S202). Processing for detecting a specific color pixel locally existing within the converted image is performed to the converted image (S203-S207). According to this, the accuracy in detection of a localized spec color pixel is improved. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は画像処理装置および画像処理方法に関し、特に、画像内に局在する特定色の画素を検出する画像処理装置および画像処理方法に関する。   The present invention relates to an image processing apparatus and an image processing method, and more particularly to an image processing apparatus and an image processing method for detecting pixels of a specific color localized in an image.

人物画像の撮影時に発生する、いわゆる赤目等の瞳の色異常に対して修正を施すために、各種の赤目修正技術が提案されている。このような赤目修正技術においては通常、処理対象画像をオペレータが黙視によって確認し、赤目修正が必要であるか否かを判定し、該判定結果に応じて修正を施すものであった。   Various red-eye correction techniques have been proposed in order to correct a pupil color abnormality such as so-called red-eye that occurs when a human image is captured. In such a red-eye correction technique, usually, the operator confirms the image to be processed silently, determines whether red-eye correction is necessary, and performs correction according to the determination result.

しかしながら、例えば業務などで大量の画像を処理する必要がある場合に、上記のように処理対象画像の一枚一枚をオペレータが黙視で確認していたのでは、多大な労力が必要となってしまうという問題がある。   However, for example, when it is necessary to process a large amount of images for business or the like, if the operator confirms each image to be processed silently as described above, a great deal of labor is required. There is a problem of end.

したがって、処理対象画像中に赤目が発生したかどうか、またそれは画像中のどの部位に発生したかという判断を自動的に行う(赤目検出)ことが求められる。また、特に大量処理を行う場合でなくても、例えば専門的な知識を持たないコンシューマユーザの場合、そもそも赤目の修正処理を好適に行うことは困難であり、やはり赤目検出処理および赤目修正処理が自動的に行われることが好ましい。   Therefore, it is required to automatically determine whether red eyes have occurred in the processing target image and in which part of the image it has occurred (red eye detection). In addition, even if not a large amount of processing, for example, a consumer user who does not have specialized knowledge, it is difficult to suitably perform red-eye correction processing in the first place, and red-eye detection processing and red-eye correction processing are also performed. Preferably it is done automatically.

上記状況を踏まえ、自動的な赤目検出処理に関しても様々な方法が提案されている。例えば、赤目を囲む画像上の領域と、赤目を表す色空間上の範囲を設定し、設定した領域内において、設定した色範囲の画素を目的の色に修正する方法が開示されている(特許文献1参照)。あるいは、赤目候補画素を検出して空間的なグループに分類した後に種画素を探し、リージョングローで領域を決定し、補正する方法が開示されている(特許文献2参照)。また、赤強調を行った結果に対して、空間フィルタを用いた畳み込みを行い、形状とサイズによって赤目の画素領域を判別し、色調整する方法が開示されている(特許文献3参照)。また、顔検出を行い、該検出された顔が赤い瞳孔を含むか否か、またその位置とサイズを検出する方法が開示されている(特許文献4参照)。また、赤目検出アルゴリズムで赤目を検出し、さらに顔検出を行うことにより、顔画像があるか否かによって赤目を確認する方法が開示されている(特許文献5参照)。
USP5130789 USP5432863 USP6204858 USP6278491 特開2001-309225号公報
Based on the above situation, various methods have been proposed for automatic red-eye detection processing. For example, a method is disclosed in which a region on an image surrounding a red eye and a range in a color space representing the red eye are set, and pixels in the set color range are corrected to a target color in the set region (patent) Reference 1). Alternatively, a method is disclosed in which red eye candidate pixels are detected and classified into a spatial group, seed pixels are searched for, regions are determined by region glow, and correction is performed (see Patent Document 2). Further, a method is disclosed in which convolution using a spatial filter is performed on the result of red enhancement, the pixel region of the red eye is discriminated based on the shape and size, and color adjustment is performed (see Patent Document 3). In addition, a method is disclosed in which face detection is performed and whether or not the detected face includes a red pupil, and the position and size thereof are detected (see Patent Document 4). Also, a method is disclosed in which red eyes are detected by a red eye detection algorithm, and face detection is performed to check red eyes based on whether or not there is a face image (see Patent Document 5).
USP5130789 USP5432863 USP6204858 USP6278491 JP 2001-309225 A

上記従来例で示したように、赤目検出方法の多くは入力画像の画素値をそのまま判定するものである。つまり、赤目を検出するためには画像中の赤い画素に注目して検出を行っている。   As shown in the above conventional example, many of the red-eye detection methods determine the pixel value of the input image as it is. That is, in order to detect red eyes, detection is performed by paying attention to red pixels in the image.

しかしながら、目の周囲にある人の肌の色も、概略赤〜オレンジの色を持っている場合が多いので、赤目と肌との弁別のためのパラメータチューニングが困難であるという課題がある。また、撮影時の状況によっては画像全体が赤〜オレンジに色かぶりしている場合があり、そのような場合にはさらに赤目と肌との弁別が困難になるという課題がある。   However, since the skin color of a person around the eyes often has a roughly red to orange color, there is a problem that it is difficult to perform parameter tuning for discriminating between red eyes and skin. Further, depending on the situation at the time of photographing, the entire image may be colored from red to orange, and in such a case, there is a problem that it is difficult to distinguish red eyes from skin.

この弁別精度をあげるために、例えば上記特許文献3では赤強調を行う方法が開示されているが、先に述べたように画像全体が赤〜オレンジに色かぶりしている場合にはそれらが全て赤強調されるため、依然として弁別が困難であるという課題が残る。   In order to increase this discrimination accuracy, for example, Patent Document 3 discloses a method of performing red enhancement. However, as described above, when the entire image is colored from red to orange, all of them are disclosed. Due to the red emphasis, the problem remains that discrimination is still difficult.

また、上記特許文献4や特許文献5では、顔検出などの情報を利用する方法が開示されているが、この方法はそもそも、顔の肌の色が赤目と弁別困難であるという課題を解決するものではない。むしろ、誤検出(例えば赤信号の赤いランプを誤検出する、等)の削減を目的としたものであるといえよう。   Moreover, although the method of using information, such as face detection, is disclosed in the said patent document 4 and the patent document 5, this method solves the subject that the color of the skin of the face is difficult to distinguish from red eyes in the first place. It is not a thing. Rather, it can be said that the purpose is to reduce false detection (for example, false detection of a red lamp having a red signal).

本発明は上述した課題を解決するためになされたものであり、画像内に局在する特定色の画素を適切かつ容易に検出する画像処理装置および画像処理方法を提供することを目的とする。   SUMMARY An advantage of some aspects of the invention is that it provides an image processing apparatus and an image processing method that appropriately and easily detect pixels of a specific color localized in an image.

特に、人物を撮影した画像から瞳の色異常として発生する赤目の色を適切に検出する画像処理装置および画像処理方法を提供することを目的とする。   In particular, it is an object of the present invention to provide an image processing apparatus and an image processing method for appropriately detecting a red-eye color generated as a pupil color abnormality from an image of a person photographed.

上記目的を達成するための一手法として、本発明の画像処理方法は以下のステップを備える。   As a technique for achieving the above object, the image processing method of the present invention includes the following steps.

すなわち、入力画像から低周波成分を抽出して低周波成分画像を生成する低周波成分抽出ステップと、前記入力画像について、その画素ごとに前記低周波成分画像に基づく周辺色を除去するように変換した変換後画像を作成する画像変換ステップと、前記変換後画像に局在する特定色の画素を検出する特定色検出ステップと、を有することを特徴とする。   That is, a low-frequency component extraction step for extracting a low-frequency component from an input image to generate a low-frequency component image, and converting the input image so that peripheral colors based on the low-frequency component image are removed for each pixel An image conversion step for creating the converted image, and a specific color detection step for detecting pixels of a specific color localized in the converted image.

以上の構成からなる本発明によれば、画像内に局在する特定色の画素を適切かつ容易に検出することができる。   According to the present invention having the above configuration, it is possible to appropriately and easily detect pixels of a specific color that are localized in an image.

特に、人物を撮影した画像から瞳の色異常として発生する赤目の色を適切かつ容易に検出することができる。   In particular, it is possible to appropriately and easily detect the red-eye color generated as a pupil color abnormality from an image of a person photographed.

以下、添付の図面を参照して、本発明をその好適な実施形態に基づいて詳細に説明する。なお、以下の実施形態において示す構成は一例に過ぎず、本発明は図示された構成に限定されるものではない。   Hereinafter, the present invention will be described in detail based on preferred embodiments with reference to the accompanying drawings. The configurations shown in the following embodiments are merely examples, and the present invention is not limited to the illustrated configurations.

<第1実施形態>
●装置構成
図1は、本実施形態に係る画像処理方法を実現する画像処理装置の構成例を示すブロック図である。
<First Embodiment>
Apparatus Configuration FIG. 1 is a block diagram illustrating a configuration example of an image processing apparatus that implements an image processing method according to the present embodiment.

同図において、入力部101は、ユーザからの指示や、データ等を入力する装置であり、キーボードやポインティングデバイスを含む。なお、ポインティングデバイスとしてはマウス、トラックボール、トラックパッド、タブレット等が挙げられる。あるいは、本実施形態の画像処理装置が例えばデジタルカメラやプリンタ等であった場合には、ボタンやモードダイヤル等で構成されるものであっても良い。また、キーボードをソフトウェアで構成し(いわゆるソフトウェアキーボード)、ボタンやモードダイヤル、あるいは先に挙げたポインティングデバイスを操作して文字を入力するように構成しても良い。   In the figure, an input unit 101 is a device for inputting an instruction from a user, data, and the like, and includes a keyboard and a pointing device. Note that examples of the pointing device include a mouse, a trackball, a trackpad, and a tablet. Alternatively, when the image processing apparatus of the present embodiment is, for example, a digital camera or a printer, the image processing apparatus may be configured with buttons, a mode dial, and the like. Further, the keyboard may be configured by software (so-called software keyboard), and a character may be input by operating a button, a mode dial, or the pointing device mentioned above.

データ保存部102は、画像データを保持するための構成である。具体的には、ハードディスク、フロッピーディスク(登録商標)、CD−ROM、CD−RやDVD、メモリーカード、CFカード、スマートメディア、SDカード、メモリスティック、xDピクチャーカード、USBメモリ等で構成される。データ保存部102には画像データ以外にも、プログラムやその他のデータを保存することも可能である。データ保存部102は上述したように実在の装置によって構成しても良いし、あるいは、後述するRAM106の一部を用いても良い。あるいは、後述する通信部107で接続された先の機器のデータ保存部を通信部107を介して利用する、というように仮想的に構成しても良い。   The data storage unit 102 is configured to hold image data. Specifically, it is composed of a hard disk, floppy disk (registered trademark), CD-ROM, CD-R, DVD, memory card, CF card, smart media, SD card, memory stick, xD picture card, USB memory, etc. . In addition to image data, the data storage unit 102 can store programs and other data. The data storage unit 102 may be configured by an actual device as described above, or a part of the RAM 106 described later may be used. Alternatively, it may be configured virtually such that a data storage unit of a previous device connected by the communication unit 107 described later is used via the communication unit 107.

表示部103は、画像処理の前後の画像を表示、あるいはGUI等の画像を表示する装置であり、一般的にはCRTや液晶ディスプレイなどが用いられる。あるいは、ケーブル等で接続された装置外部のディスプレイ装置を利用しても良い。   The display unit 103 is a device that displays images before and after image processing, or displays an image such as a GUI, and generally uses a CRT, a liquid crystal display, or the like. Alternatively, a display device outside the device connected by a cable or the like may be used.

104はCPUであり、上述した各構成の処理の全てに関わる。ROM105とRAM106は、その処理に必要なプログラム、データ、作業領域などをCPU104に提供する。また、後述する処理に必要な制御プログラムは、データ保存部102またはROM105に格納されている場合には、一旦RAM106に読み込まれてから実行される。またあるいは、通信部107を経由して装置がプログラムを受信する場合には、一旦データ保存部102に記録した後にRAM106に読み込まれるか、通信部107から直接、RAM106に読み込まれてから実行される。   Reference numeral 104 denotes a CPU, which is involved in all the processes of the above-described components. The ROM 105 and RAM 106 provide the CPU 104 with programs, data, work areas, and the like necessary for the processing. Further, when a control program necessary for processing to be described later is stored in the data storage unit 102 or the ROM 105, it is once read into the RAM 106 and executed. Alternatively, when the apparatus receives a program via the communication unit 107, the program is once recorded in the data storage unit 102 and then read into the RAM 106, or directly read from the communication unit 107 into the RAM 106 and executed. .

通信部107は、機器間の通信を行うためのI/Fである。通信部107としては例えば、周知のイーサネット(登録商標)、USB、IEEE1284、IEEE1394、電話回線などの有線による通信方式を用いることができる。あるいは、赤外線(IrDA)、IEEE802.11a,IEEE802.11b,IEEE802.11g,Bluetooth,UWB(Ultra Wide Band)等の無線通信方式であっても良い。   The communication unit 107 is an I / F for performing communication between devices. As the communication unit 107, for example, a well-known Ethernet (registered trademark), USB, IEEE1284, IEEE1394, a wired communication system such as a telephone line can be used. Alternatively, a wireless communication method such as infrared (IrDA), IEEE802.11a, IEEE802.11b, IEEE802.11g, Bluetooth, UWB (Ultra Wide Band) may be used.

なお、図1では入力部101、データ保存部102、表示部103が全て1つの装置内に含まれるように示したが、あるいはこれらの部分が周知の通信方式による通信路で接続されており、全体としてこのような構成となっているのであっても構わない。   1 shows that the input unit 101, the data storage unit 102, and the display unit 103 are all included in one device, or these parts are connected by a communication path using a known communication method. It may be such a configuration as a whole.

なお、システム構成については、上記以外にも、様々な構成要素が存在するが、本発明の主眼ではないので、その説明は省略する。   In addition to the above, there are various components of the system configuration, but the description is omitted because it is not the main point of the present invention.

●赤目領域検出処理概要
図2は、上記構成によって実現される、本実施形態における赤目領域検出処理を示すフローチャートである。
Overview of Red-Eye Area Detection Process FIG. 2 is a flowchart showing the red-eye area detection process in the present embodiment realized by the above configuration.

図2に示す処理に先立って、本実施形態による赤目領域検出の処理対象となる画像を読み込む必要がある。処理対象画像は、例えば図1に示すデータ保存部102などに所定のファイルフォーマットに従って格納されている。例えば、入力部101におけるユーザ操作による処理開始指示をトリガとして、データ保存部102に保持された画像に対して順番に図2で示す画像処理を行う。あるいは、通信部107を介して接続した他の機器から画像データを受信したことをトリガとして、画像処理を開始するように構成しても良い。本実施形態では、表示部103に画像データの一覧を表示し、該一覧の中からユーザが所望する画像を入力部101を操作して選択し、このユーザの画像選択をトリガとして、本実施形態の画像処理を開始するとする。   Prior to the processing shown in FIG. 2, it is necessary to read an image to be processed for red-eye area detection according to the present embodiment. The processing target image is stored in the data storage unit 102 shown in FIG. 1 according to a predetermined file format, for example. For example, the image processing illustrated in FIG. 2 is sequentially performed on the images held in the data storage unit 102 with a processing start instruction by a user operation in the input unit 101 as a trigger. Or you may comprise so that image processing may be started by having received image data from the other apparatus connected via the communication part 107 as a trigger. In the present embodiment, a list of image data is displayed on the display unit 103, an image desired by the user is selected from the list by operating the input unit 101, and this user's image selection is used as a trigger. Let's start image processing.

本実施形態における赤目領域検出処理は、いわゆる「赤目」に代表される色異常が非常に局所的な色の異常であることに注目し、その局所的な特性を相対的に他より際立たせる処理を行うことによって、その検出精度を向上させるものである。したがって、本実施形態では特に赤目を検出する例を説明するが、本発明は赤目検出に限らず、局所的に孤立した色を検出する他の目的に応用することも可能である。   The red-eye area detection process in the present embodiment is a process in which a color abnormality represented by so-called “red-eye” is a very local color abnormality, and its local characteristics are relatively more prominent than others. This improves the detection accuracy. Therefore, in this embodiment, an example of detecting red eyes will be described. However, the present invention is not limited to red eye detection, but can be applied to other purposes for detecting locally isolated colors.

以下、図2のフローチャートに従って説明する。   Hereinafter, description will be given with reference to the flowchart of FIG.

まずステップS201において、読み込んだ処理対象画像に対して、その低周波成分を抽出することにより、低周波成分画像を生成する。ここで抽出される低周波成分は少なくとも、ある1つの周波数特性のもので良いが、好ましくは、周波数特性が異なる複数種類の低周波成分をそれぞれ抽出する。本実施形態では、2種類の周波数特性の異なる低周波成分画像を抽出する例を示す。   First, in step S201, a low frequency component image is generated by extracting the low frequency component of the read processing target image. The low frequency component extracted here may be at least one frequency characteristic, but preferably a plurality of types of low frequency components having different frequency characteristics are extracted. In this embodiment, an example in which two types of low frequency component images having different frequency characteristics are extracted is shown.

なお、ここでの低周波成分の抽出処理方法としては任意の方法を用いて構わないが、例えば、入力画像に対してガウシアンフィルタを適用することによって低周波成分の抽出を行うことができる。また、この時のフィルタサイズ(参照領域の広さ)を変えることにより、周波数特性が異なる低周波成分を抽出することができる。あるいは、入力画像に対して縮小処理を施した後に入力画像と同じ解像度に拡大することで、低周波成分を抽出することも可能である。この時、縮小するサイズを変更することで、周波数特性を変えることができる。   Although any method may be used as the low-frequency component extraction processing here, for example, a low-frequency component can be extracted by applying a Gaussian filter to the input image. Further, by changing the filter size (the width of the reference region) at this time, low frequency components having different frequency characteristics can be extracted. Alternatively, it is possible to extract a low frequency component by performing a reduction process on the input image and then enlarging the input image to the same resolution as the input image. At this time, the frequency characteristic can be changed by changing the size to be reduced.

抽出する低周波成分の周波数特性は予め定めておけば良い。具体的には、処理に用いるフィルタのサイズや、あるいは画像の縮小を伴う場合は、その画像の縮小率や、あるいは縮小後の画像サイズを決めておけば良い。   The frequency characteristics of the low frequency component to be extracted may be determined in advance. Specifically, when the size of the filter used for processing or the reduction of the image is involved, the reduction ratio of the image or the size of the image after reduction may be determined.

なお本実施形態では、ここで抽出した低周波成分画像を用いて、注目画素に対して周辺色の影響を除去することにより、局所的に特異な色の特性を多く残したまま、大域的な色(色かぶりなど)を除去することを特徴とする。これにより、カラーバランスの影響を除去するとともに、目に比べて比較的大域的な目の周辺にある肌の色味が抑制され、赤目を代表とする局所的な色異常の検出を容易にすることができる。したがって、入力画像がカラー画像で複数のチャネルデータからなる場合には、各チャネル画像別に低周波成分を抽出し、複数のチャネルデータからなる低周波成分画像を作成する。   In the present embodiment, the low-frequency component image extracted here is used to remove the influence of the peripheral color on the target pixel, thereby leaving a large number of locally unique color characteristics, It is characterized by removing colors (color cast, etc.). This eliminates the effects of color balance, suppresses the skin tone around the eyes that are relatively global compared to the eyes, and facilitates detection of local color abnormalities typified by red eyes. be able to. Therefore, when the input image is a color image and includes a plurality of channel data, a low frequency component is extracted for each channel image, and a low frequency component image including a plurality of channel data is created.

なお、本実施形態において入力画像の色を規定する色空間については特に制限はない。例えば、RGBやYCbCr、あるいはXYZ、L*a*b*などであっても良い。以下では、色空間はRGBであるとして説明する。   In the present embodiment, there is no particular limitation on the color space that defines the color of the input image. For example, RGB, YCbCr, XYZ, L * a * b *, or the like may be used. In the following description, it is assumed that the color space is RGB.

●入力画像の変換
続くステップS202では、ステップS201で抽出した低周波成分画像を用いて、入力画像を変換する。この画像変換ステップでは、入力画像の各画素について、その周囲の色を取り除く処理を行う。除去対象となる周囲の色としては、ステップS201で作成した低周波成分画像を用いる。具体的には、まず、入力画像、低周波画像および変換後画像のそれぞれの画素値を以下のように定義する。
Conversion of Input Image In the subsequent step S202, the input image is converted using the low frequency component image extracted in step S201. In this image conversion step, for each pixel of the input image, processing for removing surrounding colors is performed. The low frequency component image created in step S201 is used as the surrounding color to be removed. Specifically, first, the pixel values of the input image, the low-frequency image, and the converted image are defined as follows.

Rsrc(x,y):入力画像の位置(x,y)の画素値のR値
Gsrc(x,y):入力画像の位置(x,y)の画素値のG値
Bsrc(x,y):入力画像の位置(x,y)の画素値のB値
Rdim(x,y):低周波画像の位置(x,y)の画素値のR値
Gdim(x,y):低周波画像の位置(x,y)の画素値のG値
Bdim(x,y):低周波画像の位置(x,y)の画素値のB値
Rdst(x,y):変換後画像の位置(x,y)の画素値のR値
Gdst(x,y):変換後画像の位置(x,y)の画素値のG値
Bdst(x,y):変換後画像の位置(x,y)の画素値のB値
この場合、変換後画像の画素値は以下の式1によって求められる。
Rsrc (x, y): R value of the pixel value at the position (x, y) of the input image Gsrc (x, y): G value of the pixel value at the position (x, y) of the input image Bsrc (x, y) : B value of the pixel value at the position (x, y) of the input image Rdim (x, y): R value of the pixel value at the position (x, y) of the low frequency image Gdim (x, y): of the low frequency image G value of pixel value at position (x, y) Bdim (x, y): B value of pixel value at position (x, y) of low-frequency image Rdst (x, y): Position of converted image (x, y) R value of pixel value of y) Gdst (x, y): G value of pixel value of converted image position (x, y) Bdst (x, y): Pixel of converted image position (x, y) In this case, the pixel value of the converted image is obtained by the following equation 1.

なお、式1において、Rdim(x,y),Gdim(x,y),Bdim(x,y)が0となる場合があるが、その場合は0に代えて非常に小さな値を用いる等すれば良い。   In Equation 1, Rdim (x, y), Gdim (x, y), and Bdim (x, y) may be 0. In this case, a very small value is used instead of 0. It ’s fine.

式1による変換後画像であるRdst(x,y),Gdst(x,y),Bdst(x,y)の値を用いて、後続するステップS203以降の処理を行っても良いが、処理の簡便化のため、これを8ビット整数などに変換することも有効である。そのような場合は、上記式1を例えば、以下の式2とするような変形も考えられる。   Using the values of Rdst (x, y), Gdst (x, y), and Bdst (x, y), which are converted images according to Equation 1, the subsequent processing after step S203 may be performed. For simplicity, it is also effective to convert this into an 8-bit integer. In such a case, the above formula 1 can be modified as the following formula 2, for example.

式2による演算結果は実数となるが、その小数部を四捨五入するなどして整数化すれば良い。なお、式2による変換の結果、Rdst(x,y),Gdst(x,y),Bdst(x,y)が255を越える場合があるが、その場合は255となるようにクリッピングすれば良い。   The calculation result according to Equation 2 is a real number, but it may be converted into an integer by rounding off the decimal part. As a result of the conversion according to Expression 2, Rdst (x, y), Gdst (x, y), and Bdst (x, y) may exceed 255. In this case, clipping may be performed so as to be 255. .

式2によれば、例えばRsrc(x,y)=Rdim(x,y)の場合に、Rdst(x,y)が255/2(整数化すると四捨五入して128)となる。この変換によればすなわち、注目画素と周囲の色が一致する場合に、変換後の画素はRGB値が全て128となり、無彩色値となる。   According to Expression 2, for example, when Rsrc (x, y) = Rdim (x, y), Rdst (x, y) is 255/2 (rounded to 128 when rounded to an integer). According to this conversion, that is, when the target pixel matches the surrounding color, all the RGB values of the converted pixel are 128, and the achromatic color value.

また、あるいは、以下の式3に示すような変換も考えられる。   Alternatively, a conversion as shown in Equation 3 below can be considered.

式3において、Y(x,y)は入力画像の位置(x,y)の画素の輝度値であり、以下の式4に示すRGB−YCbCr変換式に対して、Rsrc,Gsrc,Bsrcを適用して算出する。   In Expression 3, Y (x, y) is the luminance value of the pixel at the position (x, y) of the input image, and Rsrc, Gsrc, and Bsrc are applied to the RGB-YCbCr conversion expression shown in Expression 4 below. To calculate.

式3はすなわち、式2における255/2に代えて入力画像の輝度を用いたものである。また、Y(x,y)を算出する際に、入力画像のRsrc(x,y),Gsrc(x,y),Bsrc(x,y)に代えてRdim(x,y),Gdim(x,y),Bdim(x,y)を用いるように変形することも可能である。   In other words, Expression 3 uses the luminance of the input image instead of 255/2 in Expression 2. When calculating Y (x, y), Rdim (x, y), Gdim (x instead of Rsrc (x, y), Gsrc (x, y), Bsrc (x, y) of the input image , y), Bdim (x, y) can be used.

式3による変換結果においても、Rdst(x,y),Gdst(x,y),Bdst(x,y)が255を越える場合があるが、その場合はやはり255にクリッピングすれば良い。   Even in the conversion result according to Expression 3, Rdst (x, y), Gdst (x, y), and Bdst (x, y) may exceed 255. In this case, it is only necessary to clip to 255.

またあるいは、以下の式5に示すような変換も考えられる。   Alternatively, conversion as shown in the following formula 5 is also conceivable.

ただし、式5においてYsrc(x,y)は、入力画像の位置(x,y)の輝度値であり、Y'は式5のR',G',B'を用いて式4で算出した輝度値である。式5は、一旦、画素値をR',G',B'という値に変換した後、入力画像の輝度との差分(Ysrc(x,y)−Y')を加算する処理である。したがって概略入力画像の輝度値を保ちながら、周囲の色みを除去することが実現される。   However, in Formula 5, Ysrc (x, y) is the luminance value at the position (x, y) of the input image, and Y ′ is calculated by Formula 4 using R ′, G ′, B ′ of Formula 5. It is a luminance value. Expression 5 is a process of adding the difference (Ysrc (x, y) −Y ′) from the luminance of the input image after once converting the pixel value into values of R ′, G ′, and B ′. Therefore, it is possible to remove the surrounding color while maintaining the luminance value of the approximate input image.

式5による変換により、Rdst(x,y),Gdst(x,y),Bdst(x,y)は255を越えたり、あるいは負の値になる場合があるが、その場合はそれぞれ255,0となるようにクリッピングすれば良い。   Rdst (x, y), Gdst (x, y), and Bdst (x, y) may exceed 255 or become negative values depending on the conversion according to Expression 5, in which case 255,0 respectively. Clip it so that

なお、先に述べたように本実施形態では2種類の低周波成分画像を用いるが、このステップS202における変換に先立ち、2種類の低周波成分画像を合成して1つの低周波成分画像を得て、これを利用しても良い。すなわち、合成した低周波成分画像を用いて、上記式1〜式3、あるいは式5による変換を行えば、演算量を削減することができる。またあるいは、複数種類の低周波成分画像を用いて、それぞれ式1〜式3、あるいは式5による変換を施して複数の変換後画像を得た後にこれらを合成し、1つの変換後画像を得るようにしても良い。なお、低周波成分画像や変換後画像の合成方法としては任意で良いが、簡単には、各対応する画素の重み付け平均(特に簡単には単純平均)を取ることによって合成すれば良い。   As described above, in this embodiment, two types of low-frequency component images are used. However, prior to the conversion in step S202, two types of low-frequency component images are combined to obtain one low-frequency component image. This may be used. That is, if the synthesized low frequency component image is used to perform the conversion according to the above formulas 1 to 3 or 5, the calculation amount can be reduced. Alternatively, a plurality of types of low-frequency component images are used to perform conversion according to Equations 1 to 3 or 5 to obtain a plurality of converted images, and then these are combined to obtain one converted image. You may do it. Note that the method for synthesizing the low-frequency component image and the converted image may be arbitrary, but simply, it may be synthesized by taking a weighted average (especially, simple average) of the corresponding pixels.

また、本実施形態のステップS202における処理の本質は、低周波成分画像を用いて画像の大域的な色味を除去するよう画素値変換を行うことである。したがって、上述した式1〜式3、あるいは式5に例示した変換以外であっても、この本質を満足する変換であれば、本発明の意図するところである。   In addition, the essence of the processing in step S202 of the present embodiment is to perform pixel value conversion so as to remove the global color tone of the image using the low frequency component image. Therefore, the present invention is intended as long as the conversion satisfies the essence even if the conversion is other than the conversion exemplified in the above-described formulas 1 to 3 or 5.

以下、本実施形態のステップS202では、ステップS201で得た2種類の低周波成分画像について、それらの平均により1つの合成低周波成分画像を得、該合成低周波成分画像を用いて式5による変換を行うことによって変換後画像を得る、として説明する。式5による変換によれば、変換後画像の各画素の輝度値は、入力画像の輝度値と概略同じであるが、各画素からは周囲の色味が除去されている。   Hereinafter, in step S202 of the present embodiment, for the two types of low-frequency component images obtained in step S201, one synthesized low-frequency component image is obtained by averaging them, and using the synthesized low-frequency component image, Equation 5 is used. A description will be given assuming that a converted image is obtained by performing conversion. According to the conversion according to Equation 5, the luminance value of each pixel of the converted image is substantially the same as the luminance value of the input image, but surrounding colors are removed from each pixel.

●特定色検出
続くステップS203以降の処理では、ステップS202で作成した変換後画像に対して、赤目などの目の色異常に代表される特定色の画素を検出する特定色検出処理を行う。。
Specific Color Detection In the subsequent processing after step S203, specific color detection processing is performed on the converted image created in step S202 to detect pixels of a specific color represented by eye color abnormalities such as red eyes. .

本実施形態では、まず変換後画像の各画素についてその画素値を判定することによって、赤目の候補となる画素を選択し、空間的な連続性に基づいてグループ化し、該グループの特性に応じて適切な赤目領域を検出する。   In this embodiment, first, by determining the pixel value of each pixel in the converted image, the pixels that are candidates for red eye are selected, grouped based on spatial continuity, and according to the characteristics of the group Detect the appropriate red-eye area.

ステップS203では、ステップS202で作成した変換後画像の各画素について、その画素値を調べて特定色の候補画素を検出する。   In step S203, the pixel value of each pixel of the post-conversion image created in step S202 is examined to detect a specific color candidate pixel.

特定色の候補画素検出方法としては、変換後画像の画素値に対して色範囲を設定し、各画素値がその範囲内にあるか否かを判定する。この色範囲をRGBのままで設定しても良いが、好ましくは色相や彩度に相当する軸を持つ色空間に変換する。例えば、RGBを周知のHSVに変換し、H(色相)やS(飽和度)、あるいはV(明るさ)に関する範囲を設定して判定を行う。本出願人が行った実験によれば、色相Hでは0°〜30°、300°〜360°程度の範囲において、良好な結果が得られている。ここで特定色が赤目である場合、この色相Hの範囲には人物の肌色に相当する画素が多く該当するが、ステップS202により変換後画像における肌色部分は無彩色に近づいている。したがって、飽和度Sとして適当な閾値を設け、無彩色に近い画素を除去することで、肌領域の大部分を除去できる。   As a specific color candidate pixel detection method, a color range is set for the pixel value of the converted image, and it is determined whether or not each pixel value is within the range. Although this color range may be set as RGB, it is preferably converted to a color space having an axis corresponding to hue and saturation. For example, RGB is converted into a well-known HSV, and determination is performed by setting a range relating to H (hue), S (saturation), or V (brightness). According to experiments conducted by the present applicant, in the hue H, good results are obtained in the range of about 0 ° to 30 ° and about 300 ° to 360 °. Here, when the specific color is red-eye, many pixels corresponding to the skin color of the person correspond to the hue H range, but the skin color portion in the image after conversion approaches an achromatic color in step S202. Therefore, by setting an appropriate threshold value as the degree of saturation S and removing pixels close to an achromatic color, most of the skin region can be removed.

あるいは、上記のような各色空間軸に沿った範囲ではなく、例えば平均的な赤目画素の画素値を予め定めておき、赤目画素値を中心として色空間上で円、もしくは楕円状の範囲を設定し、その範囲に入るか否かによる判定を行っても良い。   Alternatively, instead of a range along each color space axis as described above, for example, a pixel value of an average red-eye pixel is determined in advance, and a circle or an elliptical range is set on the color space with the red-eye pixel value as a center. However, the determination may be made based on whether or not the range is entered.

また、判定を行う色空間としてHSVを用いる例を示したが、他にも例えば周知のHLS,YCbCr,CIE L*a*b*色空間等、他の色空間を用いても良い。また、この判定については単一の色空間で行わなければならない理由はないので、複数の色空間を用いた判定を行っても良い。   In addition, although an example in which HSV is used as a color space for determination is shown, other color spaces such as the well-known HLS, YCbCr, CIE L * a * b * color space may be used. In addition, since there is no reason for this determination to be performed in a single color space, determination using a plurality of color spaces may be performed.

本実施形態では、ステップS203における判定結果を格納するために、ステップS202による変換後画像と同じ幅と高さのメモリ(判定マップ)を有し、各画素の判定結果を該判定マップに書き込むものとする。なお、判定マップは例えば、データ保存部102やRAM106に保持されるとする。本実施形態では、判定マップに格納されている値が0である場合には、その値と対応する画素はステップS203での判定結果が偽、すなわち赤目候補画素ではないとする。また、判定マップに格納されている値が1である場合には、その値と対応する画素はステップS203での判定結果が真、すなわち赤目候補画素である、とする。   In this embodiment, in order to store the determination result in step S203, a memory (determination map) having the same width and height as the converted image in step S202 is written, and the determination result of each pixel is written in the determination map. And It is assumed that the determination map is held in the data storage unit 102 or the RAM 106, for example. In this embodiment, when the value stored in the determination map is 0, it is assumed that the pixel corresponding to the value is false in the determination result in step S203, that is, not a red-eye candidate pixel. If the value stored in the determination map is 1, the pixel corresponding to the value is determined to be true in step S203, that is, a red-eye candidate pixel.

ここで図3に、本実施形態における変換後画像と判定マップの関係を示す。同図において、301は変換後画像を示し、その内部の正方形領域が各画素に対応し、それぞれ変換後の画素値を有している。また302は判定マップを示し、やはり内部の正方形領域が各画素に対応している。変換後画像301と判定マップ302における画素位置は対応しており、すなわち図3において、変換後画像の画素311は、判定マップ302の画素位置312に対応している。図3に示す例では、判定マップ302の画素位置312に格納されている値は1、つまり真であるため、変換後画像301の画素311は赤目候補画素であることを示している。   FIG. 3 shows the relationship between the converted image and the determination map in this embodiment. In the figure, reference numeral 301 denotes a post-conversion image, and an internal square area corresponds to each pixel, and each has a post-conversion pixel value. Reference numeral 302 denotes a determination map, and an internal square area also corresponds to each pixel. The pixel positions in the converted image 301 and the determination map 302 correspond to each other, that is, the pixel 311 in the converted image corresponds to the pixel position 312 in the determination map 302 in FIG. In the example illustrated in FIG. 3, the value stored at the pixel position 312 of the determination map 302 is 1, that is, true, indicating that the pixel 311 of the converted image 301 is a red-eye candidate pixel.

続くステップS204では、ステップS203で作成した判定マップに対して、小領域除去処理および/または小欠損領域除去処理を行う。これは、後段のステップS205におけるグルーピング処理の処理数を減らすための前処理であり、判定マップにおける候補画素の分布に対し、空間的に孤立した候補画素を除去したり、あるいは空間的にまとまった候補領域の小欠損を埋める処理である。   In subsequent step S204, small area removal processing and / or small defect area removal processing is performed on the determination map created in step S203. This is pre-processing for reducing the number of grouping processes in the subsequent step S205, and spatially isolated candidate pixels are removed from the distribution of candidate pixels in the determination map or are spatially organized. This is a process for filling small defects in candidate areas.

小領域除去、あるいは小欠損領域除去の処理としては任意の方式を利用して良いが、本実施形態では周知のモルフォロジ変換を用いるとし、以下、これを説明する。   An arbitrary method may be used for the small area removal or small defect area removal processing. In the present embodiment, a well-known morphological transformation is used, which will be described below.

モルフォロジ変換には、例えば3×3の範囲で処理を行うとすると、中心の注目画素を除いた8画素のいずれかがONであれば注目画素をONにする拡張処理(Dilation)がある。逆に、8画素のいずれかがOFFであれば注目画素をOFFにする侵食処理(Erosion)がある。また、侵食処理を行った結果に対して拡張処理を行う処理をOpen処理、逆に拡張処理を行った結果に対して侵食処理を行う処理をClose処理と呼ぶ。   In the morphological conversion, for example, when processing is performed in a 3 × 3 range, there is an extension process (Dilation) for turning on a target pixel if any of the eight pixels excluding the central target pixel is ON. Conversely, there is an erosion process (Erosion) that turns off the target pixel if any of the eight pixels is OFF. In addition, a process for performing an expansion process on the result of the erosion process is referred to as an Open process, and a process for performing an erosion process on the result of performing the expansion process is referred to as a Close process.

これらの拡張処理や侵食処理は、そのままでは効果が強いため、本実施形態ではこれを以下のように変形して適用する。   Since these expansion processing and erosion processing are effective as they are, in the present embodiment, these are modified and applied as follows.

・拡張処理は、近傍8画素の過半数がONであれば注目画素をONとし、それ以外の場合は元の値を保持する。     In the expansion process, if the majority of the neighboring 8 pixels is ON, the target pixel is turned ON, and otherwise, the original value is held.

・侵食処理は、近傍8画素の過半数がOFFであれば注目画素をOFFとし、それ以外の場合は元の値を保持する。     In the erosion process, if the majority of the neighboring 8 pixels is OFF, the target pixel is turned OFF, and otherwise, the original value is held.

図4は、本実施形態における変形モルフォロジ変換を説明するための図である。図4において、400は判定マップにおける注目画素であり、401〜408はその近傍の8画素である。判定マップにおいては対応する画素が赤目候補であれば1が、そうでない場合には0が格納されているため、以下では1をON、0をOFFとして処理を行う。   FIG. 4 is a diagram for explaining the modified morphology transformation in the present embodiment. In FIG. 4, reference numeral 400 denotes a target pixel in the determination map, and 401 to 408 denote eight neighboring pixels. In the determination map, 1 is stored if the corresponding pixel is a red-eye candidate, and 0 is stored otherwise. Therefore, in the following, processing is performed with 1 set to ON and 0 set to OFF.

まず、拡張処理について説明する。拡張処理では、上述したように注目画素の近傍8画素のON/OFFを調べ、過半数がONであれば注目画素をONとし、そうでない場合には前の値を保持する。本実施形態の場合、ONは1、OFFは0であるから、近傍8画素(401〜408)の値を加算し、得られる加算値が5以上である場合に、注目画素をON(すなわち1)に変更する。   First, the extension process will be described. In the extension process, as described above, ON / OFF of the eight pixels in the vicinity of the target pixel is checked. If the majority is ON, the target pixel is turned ON. Otherwise, the previous value is held. In this embodiment, ON is 1 and OFF is 0. Therefore, when the values of the neighboring 8 pixels (401 to 408) are added and the obtained addition value is 5 or more, the target pixel is turned ON (that is, 1 ).

続いて、侵食処理について説明する。侵食処理では、上述したように注目画素の近傍8画素のON/OFFを調べ、過半数がOFFであれば注目画素をOFFとし、そうでない場合には前の値を保持する。したがって、近傍8画素(401〜408)の値を加算し、得られる加算値が4以下である場合に、注目画素をOFF(すなわち0)に変更する。   Next, the erosion process will be described. In the erosion process, as described above, ON / OFF of 8 pixels in the vicinity of the target pixel is checked. If the majority is OFF, the target pixel is set to OFF. Otherwise, the previous value is held. Therefore, the values of the neighboring 8 pixels (401 to 408) are added, and when the obtained addition value is 4 or less, the target pixel is changed to OFF (that is, 0).

ステップS204では、上記拡張処理、侵食処理、あるいはその両方を適当回数実行することによって、小領域、あるいは小欠損領域の削除を行う。なお、この実行回数は予め定めておけば良い。   In step S204, the small area or the small defect area is deleted by executing the expansion process, the erosion process, or both appropriately. The number of executions may be determined in advance.

続くステップS205では、ステップS204で小領域・小欠損領域を除去した判定マップにおいて、値がONである画素について、空間的に連結しているものをグループ化することによって、候補画素グループを作成する。そのために、空間的に連結している画素に同一のラベルが付与されるようにラベル付けを行う。   In subsequent step S205, a candidate pixel group is created by grouping pixels that are spatially connected with respect to pixels whose values are ON in the determination map from which the small region / small missing region is removed in step S204. . For this purpose, labeling is performed so that the same label is assigned to the spatially connected pixels.

本実施形態では、注目しているON画素の8近傍にON画素がある場合に、それらは連結しているものとする。なお、この連結判定は一例であって、例えば判定を上下左右の4近傍のみに限定しても良いし、他の定義であっても良い。   In the present embodiment, it is assumed that when there are ON pixels in the vicinity of the ON pixel of interest, they are connected. Note that this connection determination is an example, and for example, the determination may be limited to only four neighborhoods of up, down, left, and right, or other definitions may be used.

図5は、このラベリング処理を説明する図である。同図において、501は修正した判定マップの例を示し、白い正方形は判定結果がONである画素、グレーの正方形は判定結果がOFFである画素をそれぞれ表している。また、502は501に対するラベリング結果であり、x座標5〜10、y座標2〜4にあるONの連結領域にはラベルAが、x座標13,14、y座標3,4にあるONの連結領域には別のラベルBが付与されている。なお、ラベリングの方法については任意である。   FIG. 5 is a diagram for explaining the labeling process. In the figure, reference numeral 501 denotes an example of a corrected determination map. A white square represents a pixel whose determination result is ON, and a gray square represents a pixel whose determination result is OFF. Reference numeral 502 denotes a labeling result for 501. In an ON connection region at x coordinates 5 to 10 and y coordinate 2 to 4, label A is connected to ON at x coordinates 13, 14, and y coordinates 3, 4. Another label B is given to the area. The labeling method is arbitrary.

本実施形態では、ステップS205でのラベリング結果を格納するために、変換後画像と同じ幅と高さのメモリ(IDマップ)を用意し、各画素のラベリング結果をそのメモリに書き込む。   In this embodiment, in order to store the labeling result in step S205, a memory (ID map) having the same width and height as the converted image is prepared, and the labeling result of each pixel is written in the memory.

続くステップS206では、ステップS205で決定したグループ化結果に対してさらに、グループ調整処理を行う。   In subsequent step S206, group adjustment processing is further performed on the grouping result determined in step S205.

図6は、ステップS206によるグループ調整処理の一例を示すフローチャートである。ステップS206では、各グループに対してこのグループ調整処理を施す。   FIG. 6 is a flowchart illustrating an example of the group adjustment process in step S206. In step S206, this group adjustment process is performed on each group.

まずステップS601において、グループ調整のための種画素を決定する。これは、ステップS602での領域成長処理の処理開始位置として用いるものであり、グループを代表する画素である。本実施形態では、調整前のグループの重心座標を求め、該グループにおいて、その重心座標に最も近い画素を種画素として選択する。   First, in step S601, a seed pixel for group adjustment is determined. This is used as a processing start position of the region growth processing in step S602, and is a pixel representing a group. In the present embodiment, the barycentric coordinates of the group before adjustment are obtained, and the pixel closest to the barycentric coordinates in the group is selected as a seed pixel.

続くステップS602では、ステップS601で決定した種画素を起点として、周知の領域成長処理(リージョングロー)を実行する。領域成長処理においてはその処理を終了するために閾値が必要であるが、この閾値は予め定めておけば良い。あるいは領域の平均色や分散などに応じて、閾値を適応的に設定しても良い。   In the subsequent step S602, a known region growth process (region glow) is executed starting from the seed pixel determined in step S601. In the region growing process, a threshold is required to end the process, but this threshold may be determined in advance. Alternatively, the threshold value may be adaptively set according to the average color or dispersion of the area.

ステップS603は、ステップS602における領域成長処理の結果、種画素を起点として検出した領域をグループ情報として記録し、グループ画素を決定する。すなわち、ステップS205で用いたIDマップと同じ大きさのメモリを用意し、そこに調整したラベリング結果を書き込む。   In step S603, as a result of the region growing process in step S602, a region detected using the seed pixel as a starting point is recorded as group information, and a group pixel is determined. That is, a memory having the same size as the ID map used in step S205 is prepared, and the adjusted labeling result is written therein.

続くステップS207では、候補画素グループのうち、最終的な色異常画素グループを決定する。このグループ決定においては、ステップS206で調整したグルーピングに対して絞込みを行い、最終的な赤目を構成する領域を決定する。絞込みの方法については、様々な方法が適用可能であるが、例えば本実施形態では、領域の面積(領域を構成する画素数)を求め、その値が面積閾値を越えたものを赤目を構成する領域として決定する。この面積閾値としては予め適切な値を設定しておけば良い。あるいは、入力画像、もしくは変換後画像の画素数に応じて適応的に決定しても良い。   In the subsequent step S207, a final abnormal color pixel group is determined from the candidate pixel groups. In this group determination, the grouping adjusted in step S206 is narrowed down to determine the final red-eye area. Various methods can be applied as the narrowing-down method. For example, in the present embodiment, the area of the region (the number of pixels constituting the region) is obtained, and red-eye is formed if the value exceeds the area threshold. Determine as an area. An appropriate value may be set in advance as the area threshold. Alternatively, it may be determined adaptively according to the number of pixels of the input image or the converted image.

またあるいは、面積による閾値処理ではなく、領域に対して円形度などを規定し、その円形度に応じて赤目領域を決定するようにしても良い。円形度の一例としては、領域に外接する矩形を設定し、その矩形に内接する円、もしくは楕円の面積を求め、それと領域の面積を比較する。領域が概略円もしくは楕円状になっている場合、領域の面積は円もしくは楕円の面積に近いが、そうでない場合には、領域の面積と円もしくは楕円の面積は違ってくることを利用して判定を行い、比較的円もしくは楕円に近い領域を選択すれば良い。 またあるいは、グループの代表色を決定し、その代表色を用いて判定するようにしても良い。代表色はグループに対応する入力画像もしくは変換後画像の画素値を参照して決定すればよく、例えば、画素の平均画素値を用いれば良い。   Alternatively, instead of threshold processing based on area, a circularity or the like may be defined for the region, and the red-eye region may be determined according to the circularity. As an example of the circularity, a rectangle circumscribing the area is set, the area of a circle or ellipse inscribed in the rectangle is obtained, and the area of the area is compared with the area. If the area is roughly a circle or an ellipse, the area of the area is close to the area of a circle or an ellipse. If not, use the fact that the area of the area is different from the area of a circle or an ellipse. It is only necessary to make a determination and select a region that is relatively close to a circle or an ellipse. Alternatively, the representative color of the group may be determined and determined using the representative color. The representative color may be determined by referring to the pixel value of the input image or the converted image corresponding to the group. For example, the average pixel value of the pixels may be used.

あるいは、上記面積やあるいは円形度、代表色に基づいて、尤もらしい順にグループを並び替えし、上位N個を候補として抽出するようにしてもよい。このNとしては、所定の定数で良い。   Alternatively, based on the area, the circularity, and the representative color, the groups may be rearranged in a reasonable order, and the top N may be extracted as candidates. N may be a predetermined constant.

また、あるいは複数の尺度を用いて赤目領域を判定するようにしても良い。これは例えば、上記判定基準に応じて、各判定基準毎に各グループの尤度(もっともらしさ)を算出し、各基準毎の尤度を合成してグループの尤度とする。尤度の合成としては、各尤度を足し合わせたり掛け合わせたりすることで実現できる。   Alternatively, the red-eye region may be determined using a plurality of scales. For example, the likelihood (reliability) of each group is calculated for each determination criterion in accordance with the determination criterion, and the likelihoods for each criterion are combined to obtain the group likelihood. Likelihood synthesis can be realized by adding or multiplying the likelihoods.

またあるいは、変換後画像だけでなく入力画像も参照し、例えば入力画像の対応する画素も赤目らしい色であるか否かを判定する等により、さらなる絞込みを行うことも有効である。   Alternatively, it is also effective to refer to not only the converted image but also the input image and perform further narrowing down by, for example, determining whether or not the corresponding pixel of the input image has a red-eye color.

以上説明したように本実施形態によれば、入力画像に対して低周波成分を抽出し、その低周波成分画像を注目画素の周辺色として除去することにより、局所的な特定色の画素の検出精度が向上する。すなわち、人物の撮影画像において瞳の色異常候補を適切かつ容易に検出することができる。   As described above, according to this embodiment, a low-frequency component is extracted from an input image, and the low-frequency component image is removed as a peripheral color of the pixel of interest, thereby detecting a local pixel of a specific color. Accuracy is improved. That is, it is possible to appropriately and easily detect a pupil color abnormality candidate in a photographed image of a person.

<第2実施形態>
以下、本発明に係る第2実施形態について説明する。
Second Embodiment
Hereinafter, a second embodiment according to the present invention will be described.

上述した第1実施形態に対し、第2実施形態ではさらに、顔あるいは目等の特定領域の情報を用いることによって、赤目領域の検出精度を向上させることを特徴とする。第1実施形態では、色異常画素グループを、その大きさ、円形度、あるいはグループの代表色に基づいて決定する例を示したが、第2実施形態ではさらに、顔あるいは目等の特定領域情報に基づいて赤目領域を決定する。   In contrast to the first embodiment described above, the second embodiment is characterized in that the detection accuracy of the red-eye region is improved by using information on a specific region such as a face or eyes. In the first embodiment, an example in which an abnormal color pixel group is determined based on its size, circularity, or representative color of the group has been described. However, in the second embodiment, specific area information such as a face or an eye is further displayed. The red-eye area is determined based on.

以下、第2実施形態においては、上述した第1実施形態と特に異なる部分についてのみ説明を行う。   Hereinafter, in the second embodiment, only portions that are particularly different from the first embodiment described above will be described.

第2実施形態では、図2のステップS207において、人物の顔がある領域を表す顔領域情報を用い、該顔領域内に存在する色異常画素グループを選択するように構成する。この時、第1実施形態と同様に、さらにグループ領域の面積、円形度、代表色などで絞り込みを行っても良い。   In the second embodiment, in step S207 of FIG. 2, it is configured to use face area information representing an area where a person's face is present, and to select an abnormal color pixel group existing in the face area. At this time, similarly to the first embodiment, the area may be further narrowed down by the area of the group region, the circularity, the representative color, and the like.

第2実施形態における顔領域情報入力(特定領域入力)は例えば、ユーザによって行うことができる。すなわち、処理対象画像を表示部103に表示することによってユーザに提示し、ユーザが入力部101を操作して顔領域を設定するように、ユーザインターフェースを構成すれば良い。なお、このユーザ入力は、ステップS207に先んじて行うのであれば、任意のタイミングで行っても良い。   The face area information input (specific area input) in the second embodiment can be performed by a user, for example. That is, the user interface may be configured such that the processing target image is displayed on the display unit 103 and presented to the user, and the user operates the input unit 101 to set the face area. Note that this user input may be performed at an arbitrary timing as long as it is performed prior to step S207.

また、好ましくは、周知の顔検出処理によって顔領域を自動的に検出すれば良い。顔検出処理としては任意の方法で構わないが、例えば特開2000-322588号公報に開示されている顔検出処理を用いればよい。この顔検出処理は、ユーザによる入力と同様に、ステップS207に先んじて行うのであれば、任意のタイミングで行っても良い。   Preferably, the face area may be automatically detected by a known face detection process. The face detection process may be any method, but for example, the face detection process disclosed in Japanese Patent Laid-Open No. 2000-322588 may be used. This face detection process may be performed at an arbitrary timing as long as it is performed prior to step S207, similarly to the input by the user.

特定領域として、顔領域ではなく、目の領域情報を用いるように構成することも可能である。すなわち、目の領域をユーザに指定させても良いし、目の領域を自動検出するように構成しても良い。目の領域検出としては任意の方法で構わないが、例えば特開2000-322588号公報に開示されている方法が適用可能である。   It is also possible to use not the face area but the eye area information as the specific area. That is, the eye area may be specified by the user, or the eye area may be automatically detected. Although any method may be used for eye region detection, for example, a method disclosed in Japanese Patent Laid-Open No. 2000-322588 can be applied.

以上説明したように第2実施形態によれば、上述した第1実施形態に対してさらに、人物の顔や目の領域情報を検出条件として用いることにより、より精度の高い赤目検出を行うことができる。   As described above, according to the second embodiment, more accurate red-eye detection can be performed by using area information of a person's face and eyes as a detection condition in addition to the first embodiment described above. it can.

<第3実施形態>
以下、本発明に係る第3実施形態について説明する。
<Third Embodiment>
The third embodiment according to the present invention will be described below.

上述した第2実施形態においては、第1実施形態の処理において色異常画素グループを検出する際に、顔あるいは目の特定領域情報を用いて色異常画素グループを決定する例を示した。第3実施形態においては、この色異常画素グループの検出対象となる画素を、顔あるいは目等の特定領域情報を用いて予め限定することを特徴とする。   In the second embodiment described above, an example in which an abnormal color pixel group is determined using specific area information of the face or eyes when detecting the abnormal color pixel group in the processing of the first embodiment has been described. The third embodiment is characterized in that the pixels to be detected by this color abnormality pixel group are limited in advance using specific area information such as a face or eyes.

以下、第3実施形態においては、上述した第1および第2実施形態と特に異なる部分についてのみ説明を行う。   Hereinafter, in the third embodiment, only portions that are particularly different from the first and second embodiments described above will be described.

図7は、第3実施形態における赤目領域検出処理を示すフローチャートである。なお、図7において図2と同様の処理を行うステップについては同一ステップ番号を付し、説明を省略する。   FIG. 7 is a flowchart showing red-eye area detection processing in the third embodiment. In FIG. 7, steps that perform the same processing as in FIG. 2 are given the same step numbers, and descriptions thereof are omitted.

第3実施形態のステップS701では、顔、あるいは目の特定領域情報に従って、処理対象の画素を制限する。そのため、ステップS202で作成した変換後画像から、顔、あるいは目の特定領域情報に対応する部分領域を切り出し、該切り出した部分領域についてのみ、ステップS203以降の処理を行う。   In step S701 of the third embodiment, the pixels to be processed are limited according to face or eye specific area information. Therefore, a partial area corresponding to the specific area information of the face or eyes is cut out from the converted image created in step S202, and the processes after step S203 are performed only for the cut out partial area.

なお、顔、あるいは目の特定領域情報については、上述した第2実施形態と同様に、ユーザが入力するか、あるいは周知の検出処理により自動設定する。この特定領域設定は、ステップS701に先んじて行うのであれば、任意のタイミングで構わない。   The face or eye specific area information is input by the user or automatically set by a known detection process, as in the second embodiment described above. This specific area setting may be performed at any timing as long as it is performed prior to step S701.

以上説明したように第3実施形態によれば、顔や目の特定領域情報を用いて処理対象画素を制限することにより、色異常候補画素の検出処理に係る演算量を削減することができる。すなわち、上述した第2実施形態と同様に、より精度の高い赤目検出を可能とするともに、処理の早い段階で処理対象画素を限定するために、処理に必要なメモリ量を削減できる、あるいは処理を高速化することができる。   As described above, according to the third embodiment, it is possible to reduce the amount of calculation related to the color abnormality candidate pixel detection process by limiting the processing target pixels using the face and eye specific area information. That is, as in the second embodiment described above, more accurate red-eye detection is possible, and in order to limit the processing target pixels at an early stage of processing, the amount of memory required for processing can be reduced, or processing can be performed. Can be speeded up.

<第4実施形態>
以下、本発明に係る第4実施形態について説明する。
<Fourth embodiment>
The fourth embodiment according to the present invention will be described below.

上述した第1乃至第3実施形態では、抽出する低周波成分の周波数特性を予め定めておく例を示したが、第4実施形態においては、顔あるいは目等の特定領域の大きさに応じて、該周波数特性を適応的に決定することを特徴とする。   In the first to third embodiments described above, an example in which the frequency characteristic of the low frequency component to be extracted is determined in advance has been described, but in the fourth embodiment, depending on the size of a specific region such as a face or eyes. The frequency characteristic is adaptively determined.

以下、第4実施形態においては、上述した第1乃至第3実施形態と特に異なる部分についてのみ説明を行う。   Hereinafter, in the fourth embodiment, only parts that are particularly different from the first to third embodiments described above will be described.

図8は、第4実施形態における赤目領域検出処理を示すフローチャートである。なお、図8において図2と同様の処理を行うステップについては同一ステップ番号を付し、説明を省略する。   FIG. 8 is a flowchart showing red-eye area detection processing in the fourth embodiment. In FIG. 8, steps that perform the same processing as in FIG. 2 are given the same step numbers, and descriptions thereof are omitted.

第4実施形態のステップS801では、顔、あるいは目等の特定領域情報に基づいて、ステップS201で抽出する低周波成分の周波数特性を決定する。例えば、与えられた顔、あるいは目等の特定領域情報に対して予め設定した比率(例えば2倍)の大きさのフィルタによるフィルタ処理を行い、低周波成分を抽出するように構成する。複数種の周波数特性の低周波成分を用いる場合には、この比率を、使用するフィルタの分を用意しておき、それぞれのフィルタサイズを計算すれば良い。   In step S801 of the fourth embodiment, the frequency characteristic of the low frequency component extracted in step S201 is determined based on specific area information such as a face or eyes. For example, it is configured to perform a filtering process using a filter having a ratio (for example, twice) set in advance on specific area information such as a given face or eye, and extract a low frequency component. In the case of using low frequency components of a plurality of types of frequency characteristics, this ratio may be prepared for the filters to be used, and the respective filter sizes may be calculated.

特定領域情報としては、円形や矩形、任意の形状(マスク情報など)等、様々なものが考えられるが、例えば、特定領域に外接する矩形を調べ、その長辺と短辺を求めて大きさを決定することができる。長辺、もしくは短辺を特定領域の大きさとしても良いし、あるいは長辺と短辺の平均を求めて特定領域の大きさとしても良い。そして、決定した特定領域の大きさに対して、予め定めた比率を適用し、フィルタの大きさを決定する。   As the specific area information, various information such as a circle, a rectangle, and an arbitrary shape (mask information, etc.) can be considered. Can be determined. The long side or the short side may be set as the size of the specific region, or the average of the long side and the short side may be obtained and set as the size of the specific region. Then, a predetermined ratio is applied to the determined size of the specific area to determine the size of the filter.

あるいは、特定領域の大きさの、画像全体に対する比率に基づいて周波数特性を決定するように変形しても、それは本発明の意図することころである。   Alternatively, even if the frequency characteristic is determined based on the ratio of the size of the specific area to the entire image, it is intended by the present invention.

なお、顔、あるいは目等の特定領域情報については、上述した第2および第3実施形態と同様に、ユーザが入力するか、あるいは周知の検出処理により自動設定する。この領域設定は、ステップS801に先んじて行うのであれば、任意のタイミングで構わない。   Note that specific area information such as a face or eyes is input by the user or automatically set by a known detection process, as in the second and third embodiments described above. If this area setting is performed prior to step S801, any timing may be used.

続くステップS201では、ステップS801で決定したフィルタサイズに基づいて、低周波成分を抽出することになる。   In subsequent step S201, low frequency components are extracted based on the filter size determined in step S801.

なお、顔や目の領域は1枚の画像中に複数あらわれる可能性があるが、その場合には、例えばその中の1つを選択して処理するように構成すれば良い。1つを選択する場合、最も重要であると推測される被写体の顔、もしくは目領域を選択することが好ましい。経験的に、重要な被写体は、画像のより中央に位置し、また、より大きく撮影されることから、大きな領域、あるいは画像の中央に近い領域、またあるいは大きさと位置の両方を勘案しながら、1つの領域を決定すれば良い。   A plurality of face and eye regions may appear in one image. In that case, for example, one of them may be selected and processed. When selecting one, it is preferable to select the face or eye area of the subject presumed to be most important. Empirically, the important subject is located at the center of the image and is taken larger, so taking into account the large area, the area close to the center of the image, or both size and position, One area may be determined.

逆に、複数検出された領域について、大きさを平均するなどして1つの大きさを決定するような変形も考えられる。   On the other hand, a modification is also conceivable in which one size is determined by averaging the sizes of a plurality of detected regions.

また、上述した第3実施形態に示したように、検出された領域ごとに処理を行う場合には、その領域ごとに周波数特性を決定し、適用することも可能である。   Further, as shown in the third embodiment described above, when processing is performed for each detected region, it is also possible to determine and apply the frequency characteristic for each region.

以上説明したように第4実施形態によれば、顔あるいは目等の特定領域情報に基づいて、処理対象画像から抽出する低周波成分の周波数特性を適応的に決定する。これにより、画像全体に対する被写体の顔の大きさや、あるいは画像サイズの違いに関わらず、概略同等な赤目領域検出を行うことができる。   As described above, according to the fourth embodiment, the frequency characteristic of the low frequency component extracted from the processing target image is adaptively determined based on specific area information such as a face or eyes. As a result, it is possible to perform substantially equivalent red-eye region detection regardless of the size of the subject's face relative to the entire image or the difference in image size.

<第5実施形態>
以下、本発明に係る第5実施形態について説明する。
<Fifth Embodiment>
The fifth embodiment according to the present invention will be described below.

上述した第4実施形態では、顔、あるいは目等の特定領域の大きさに基づいて、抽出する低周波成分の周波数特性を設定する例を示した。第5実施形態では、特に複数種類の低周波成分を用いる場合に、それらの周波数特性を固定し、特定領域の大きさに基づいて、合成時の重み付け係数(合成係数)を変更することを特徴とする。   In the fourth embodiment described above, an example in which the frequency characteristic of the low frequency component to be extracted is set based on the size of a specific area such as a face or an eye has been described. In the fifth embodiment, particularly when a plurality of types of low frequency components are used, their frequency characteristics are fixed, and the weighting coefficient (synthesis coefficient) at the time of synthesis is changed based on the size of the specific region. And

以下、第5実施形態においては、上述した第1乃至第4実施形態と特に異なる部分についてのみ説明を行う。   Hereinafter, in the fifth embodiment, only portions that are particularly different from the first to fourth embodiments described above will be described.

図9は、第5実施形態における赤目領域検出処理を示すフローチャートである。なお、図9において図2と同様の処理を行うステップについては同一ステップ番号を付し、説明を省略する。   FIG. 9 is a flowchart showing red-eye area detection processing in the fifth embodiment. In FIG. 9, steps that perform the same processing as in FIG. 2 are assigned the same step numbers, and descriptions thereof are omitted.

第5実施形態のステップS901では、顔、あるいは目等の特定領域の大きさに基づき、該特定領域が小さい場合には、高い周波数成分ほど重みが大きくなるように、合成係数を決定する。逆に、特定領域が大きい場合には、高い周波数成分ほど重みが小さくなるように、合成係数を決定する。なお、顔、もしくは目の領域が複数ある場合については、上述した第4実施形態と同様に、そのうちの1つを選択すれば良い。   In step S901 of the fifth embodiment, based on the size of a specific area such as a face or an eye, when the specific area is small, the synthesis coefficient is determined so that the higher the frequency component, the greater the weight. On the contrary, when the specific area is large, the synthesis coefficient is determined so that the weight becomes smaller as the frequency component becomes higher. If there are a plurality of face or eye regions, one of them may be selected as in the fourth embodiment described above.

ステップS901で決定した合成係数は、低周波成分画像を合成する際、あるいは、それらに対応する変換後画像の合成の際に、重み付け平均の係数として用いられる。   The synthesis coefficient determined in step S901 is used as a weighted average coefficient when the low-frequency component images are synthesized or when the corresponding converted images are synthesized.

また、上述した第3実施形態に示したように、検出された領域ごとに処理を行う場合には、その領域ごとに合成係数を決定し、適用することも可能である。   Further, as shown in the third embodiment described above, when processing is performed for each detected region, it is also possible to determine and apply a synthesis coefficient for each region.

以上説明したように第5実施形態によれば、顔あるいは目等の特定領域情報に基づいて、処理対象画像から抽出した低周波成分画像の合成係数を適応的に決定する。これにより、検出する周波数特性を固定とした場合でも、画像全体に対する被写体の顔の大きさや、あるいは画像サイズの違いに関わらず、概略同等な赤目領域検出を行うことができる。特に、ステップS202の低周波成分抽出処理をハードウェアにより実装する場合等、抽出する低周波成分の周波数特性を動的に変更することが困難である場合に、第5実施形態は有効である。   As described above, according to the fifth embodiment, the synthesis coefficient of the low-frequency component image extracted from the processing target image is adaptively determined based on specific area information such as a face or eyes. As a result, even when the frequency characteristics to be detected are fixed, substantially equivalent red-eye area detection can be performed regardless of the size of the subject's face relative to the entire image or the difference in image size. In particular, the fifth embodiment is effective when it is difficult to dynamically change the frequency characteristics of the low-frequency component to be extracted, such as when the low-frequency component extraction process in step S202 is implemented by hardware.

<他の実施形態>
以上、実施形態例を詳述したが、本発明は例えば、システム、装置、方法、プログラム若しくは記録媒体(記憶媒体)等としての実施態様をとることが可能である。具体的には、複数の機器(例えば、ホストコンピュータ、インタフェース機器、撮像装置、webアプリケーション等)から構成されるシステムに適用しても良いし、また、一つの機器からなる装置に適用しても良い。
<Other embodiments>
Although the embodiment has been described in detail above, the present invention can take an embodiment as a system, apparatus, method, program, recording medium (storage medium), or the like. Specifically, the present invention may be applied to a system composed of a plurality of devices (for example, a host computer, an interface device, an imaging device, a web application, etc.), or may be applied to a device composed of a single device. good.

尚本発明は、前述した実施形態の機能を実現するソフトウェアプログラムを、システムあるいは装置に直接あるいは遠隔から供給し、そのシステムあるいは装置のコンピュータが該供給されたプログラムコードを読み出して実行することによっても達成される。なお、この場合のプログラムとは、コンピュータ読取可能であり、実施形態において図に示したフローチャートに対応したプログラムである。   The present invention also provides a software program that realizes the functions of the above-described embodiments directly or remotely to a system or apparatus, and the system or apparatus computer reads out and executes the supplied program code. Achieved. The program in this case is a computer-readable program that corresponds to the flowchart shown in the drawing in the embodiment.

従って、本発明の機能処理をコンピュータで実現するために、該コンピュータにインストールされるプログラムコード自体も本発明を実現するものである。つまり、本発明は、本発明の機能処理を実現するためのコンピュータプログラム自体も含まれる。   Accordingly, since the functions of the present invention are implemented by computer, the program code installed in the computer also implements the present invention. In other words, the present invention includes a computer program itself for realizing the functional processing of the present invention.

その場合、プログラムの機能を有していれば、オブジェクトコード、インタプリタにより実行されるプログラム、OSに供給するスクリプトデータ等の形態であっても良い。   In that case, as long as it has the function of a program, it may be in the form of object code, a program executed by an interpreter, script data supplied to the OS, or the like.

プログラムを供給するための記録媒体としては、以下に示す媒体がある。例えば、フロッピー(登録商標)ディスク、ハードディスク、光ディスク、光磁気ディスク、MO、CD-ROM、CD-R、CD-RW、磁気テープ、不揮発性のメモリカード、ROM、DVD(DVD-ROM,DVD-R)などである。   Recording media for supplying the program include the following media. For example, floppy disk, hard disk, optical disk, magneto-optical disk, MO, CD-ROM, CD-R, CD-RW, magnetic tape, nonvolatile memory card, ROM, DVD (DVD-ROM, DVD- R).

プログラムの供給方法としては、以下に示す方法も可能である。すなわち、クライアントコンピュータのブラウザからインターネットのホームページに接続し、そこから本発明のコンピュータプログラムそのもの(又は圧縮され自動インストール機能を含むファイル)をハードディスク等の記録媒体にダウンロードする。また、本発明のプログラムを構成するプログラムコードを複数のファイルに分割し、それぞれのファイルを異なるホームページからダウンロードすることによっても実現可能である。つまり、本発明の機能処理をコンピュータで実現するためのプログラムファイルを複数のユーザに対してダウンロードさせるWWWサーバも、本発明に含まれるものである。   As a program supply method, the following method is also possible. That is, the browser of the client computer is connected to a homepage on the Internet, and the computer program itself (or a compressed file including an automatic installation function) of the present invention is downloaded to a recording medium such as a hard disk. It can also be realized by dividing the program code constituting the program of the present invention into a plurality of files and downloading each file from a different homepage. That is, a WWW server that allows a plurality of users to download a program file for realizing the functional processing of the present invention on a computer is also included in the present invention.

また、本発明のプログラムを暗号化してCD-ROM等の記憶媒体に格納してユーザに配布し、所定の条件をクリアしたユーザに対し、インターネットを介してホームページから暗号化を解く鍵情報をダウンロードさせることも可能である。すなわち該ユーザは、その鍵情報を使用することによって暗号化されたプログラムを実行し、コンピュータにインストールさせることができる。   In addition, the program of the present invention is encrypted, stored in a storage medium such as a CD-ROM, distributed to users, and key information for decryption is downloaded from a homepage via the Internet to users who have cleared predetermined conditions. It is also possible to make it. That is, the user can execute the encrypted program by using the key information and install it on the computer.

また、コンピュータが、読み出したプログラムを実行することによって、前述した実施形態の機能が実現される。さらに、そのプログラムの指示に基づき、コンピュータ上で稼動しているOSなどが、実際の処理の一部または全部を行い、その処理によっても前述した実施形態の機能が実現され得る。   Further, the functions of the above-described embodiments are realized by the computer executing the read program. Furthermore, based on the instructions of the program, an OS or the like running on the computer performs part or all of the actual processing, and the functions of the above-described embodiments can also be realized by the processing.

さらに、記録媒体から読み出されたプログラムが、コンピュータに挿入された機能拡張ボードやコンピュータに接続された機能拡張ユニットに備わるメモリに書き込まれた後、実行されることによっても、前述した実施形態の機能が実現される。すなわち、該プログラムの指示に基づき、その機能拡張ボードや機能拡張ユニットに備わるCPUなどが実際の処理の一部または全部を行うことが可能である。   Further, the program read from the recording medium is written in a memory provided in a function expansion board inserted into the computer or a function expansion unit connected to the computer, and then executed, so that the program of the above-described embodiment can be obtained. Function is realized. That is, based on the instructions of the program, the CPU provided in the function expansion board or function expansion unit can perform part or all of the actual processing.

本発明に係る一実施形態における画像処理装置の構成を示すブロック図である。It is a block diagram which shows the structure of the image processing apparatus in one Embodiment which concerns on this invention. 本実施形態における赤目領域検出処理を示すフローチャートである。It is a flowchart which shows the red-eye area | region detection process in this embodiment. 本実施形態における変換後画像と判定マップの関係を示す図である。It is a figure which shows the relationship between the image after conversion in this embodiment, and the determination map. 本実施形態における変形モルフォロジ変換を説明するための図である。It is a figure for demonstrating the deformation | transformation morphology transformation in this embodiment. 本実施形態におけるラベリング処理を説明するための図である。It is a figure for demonstrating the labeling process in this embodiment. 本実施形態におけるグループ調整処理を示すフローチャートである。It is a flowchart which shows the group adjustment process in this embodiment. 第3実施形態における赤目領域検出処理を示すフローチャートである。It is a flowchart which shows the red-eye area | region detection process in 3rd Embodiment. 第4実施形態における赤目領域検出処理を示すフローチャートである。It is a flowchart which shows the red-eye area | region detection process in 4th Embodiment. 第5実施形態における赤目領域検出処理を示すフローチャートである。It is a flowchart which shows the red-eye area | region detection process in 5th Embodiment.

Claims (16)

低周波成分抽出手段が、入力画像から低周波成分を抽出して低周波成分画像を生成する低周波成分抽出ステップと、
画像変換手段が、前記入力画像について、その画素ごとに前記低周波成分画像に基づく周辺色を除去するように変換した変換後画像を作成する画像変換ステップと、
特定色検出手段が、前記変換後画像に局在する特定色の画素を検出する特定色検出ステップと、
を有することを特徴とする画像処理方法。
A low-frequency component extraction unit that extracts a low-frequency component from the input image to generate a low-frequency component image; and
An image conversion step in which the image conversion means creates a converted image obtained by converting the input image so as to remove the peripheral color based on the low frequency component image for each pixel;
A specific color detecting means for detecting a pixel of a specific color localized in the converted image;
An image processing method comprising:
前記低周波成分抽出ステップにおいては、周波数特性の異なる複数の低周波成分画像を抽出し、
前記画像変換ステップにおいては、前記複数の低周波成分画像を用いて、前記変換後画像を作成することを特徴とする請求項1に記載の画像処理方法。
In the low frequency component extraction step, a plurality of low frequency component images having different frequency characteristics are extracted,
The image processing method according to claim 1, wherein in the image conversion step, the converted image is created using the plurality of low-frequency component images.
前記画像変換ステップにおいては、前記複数の低周波成分画像を合成した合成低周波成分画像を用いて、前記変換後画像を作成することを特徴とする請求項2に記載の画像処理方法。   3. The image processing method according to claim 2, wherein, in the image conversion step, the converted image is created by using a synthesized low frequency component image obtained by synthesizing the plurality of low frequency component images. 前記画像変換ステップにおいては、前記複数の低周波成分画像のそれぞれについて前記変換後画像を作成し、該作成された複数の変換後画像を合成することを特徴とする請求項2に記載の画像処理方法。   3. The image processing according to claim 2, wherein, in the image conversion step, the converted image is generated for each of the plurality of low-frequency component images, and the generated converted images are synthesized. Method. 前記特定色検出ステップは、
前記変換後画像において前記特定色に相当する画素を候補画素として抽出する候補画素検出ステップと、
前記変換後画像における前記候補画素をその空間的な連続性に基づいてグルーピングすることにより候補画素グループを作成するグルーピングステップと、
前記候補画素グループの特性に応じて、前記特定色の画素グループを決定するグループ決定ステップと、
を有することを特徴とする請求項1乃至4のいずれか1項に記載の画像処理方法。
The specific color detection step includes
A candidate pixel detection step of extracting pixels corresponding to the specific color as candidate pixels in the converted image;
A grouping step of creating a candidate pixel group by grouping the candidate pixels in the transformed image based on their spatial continuity;
A group determining step for determining a pixel group of the specific color according to characteristics of the candidate pixel group;
The image processing method according to claim 1, further comprising:
前記特定色検出ステップはさらに、前記変換後画像における前記候補画素の分布に対し、小領域または小欠損領域の少なくともいずれかの除去処理を行う小領域除去ステップを有することを特徴とする請求項5に記載の画像処理方法。   6. The specific color detection step further includes a small region removal step of performing at least one of small region and small defect region removal processing on the candidate pixel distribution in the converted image. An image processing method described in 1. 前記特定色検出ステップはさらに、前記候補画素グループに対し、その種画素に基づく領域成長処理を施すグループ調整ステップを有することを特徴とする請求項5に記載の画像処理方法。   The image processing method according to claim 5, wherein the specific color detection step further includes a group adjustment step of performing region growth processing based on the seed pixel for the candidate pixel group. 前記グループ決定ステップにおいて前記候補画素グループの特性は、面積や形状、あるいは代表色の少なくともいずれか1つであることを特徴とする請求項5に記載の画像処理方法。   6. The image processing method according to claim 5, wherein in the group determination step, the characteristic of the candidate pixel group is at least one of an area, a shape, and a representative color. さらに、特定領域入力手段が、前記入力画像における特定領域を示す特定領域情報を入力する特定領域入力ステップを有し、
前記特定色検出ステップにおいては、前記特定領域情報で示される特定領域について、前記特定色の画素を検出することを特徴とする請求項1乃至8のいずれか1項に記載の画像処理方法。
Furthermore, the specific area input means has a specific area input step of inputting specific area information indicating a specific area in the input image,
9. The image processing method according to claim 1, wherein, in the specific color detection step, pixels of the specific color are detected in a specific area indicated by the specific area information.
さらに、特定領域入力手段が、前記入力画像における特定領域を示す特定領域情報を入力する特定領域入力ステップを有し、
前記低周波成分抽出ステップにおいては、前記入力画像から抽出する低周波成分の周波数特性を前記特定領域情報に応じて決定することを特徴とする請求項1乃至8のいずれか1項に記載の画像処理方法。
Furthermore, the specific area input means has a specific area input step of inputting specific area information indicating a specific area in the input image,
9. The image according to claim 1, wherein in the low frequency component extraction step, a frequency characteristic of a low frequency component extracted from the input image is determined in accordance with the specific region information. Processing method.
さらに、特定領域入力手段が、前記入力画像における特定領域を示す特定領域情報を入力する特定領域入力ステップを有し、
前記画像変換ステップにおいては、前記複数の低周波成分画像の合成方法を前記特定領域情報に応じて制御することを特徴とする請求項3に記載の画像処理方法。
Furthermore, the specific area input means has a specific area input step of inputting specific area information indicating a specific area in the input image,
The image processing method according to claim 3, wherein in the image conversion step, a synthesis method of the plurality of low frequency component images is controlled according to the specific area information.
さらに、特定領域入力手段が、前記入力画像における特定領域を示す特定領域情報を入力する特定領域入力ステップを有し、
前記画像変換ステップにおいては、前記複数の変換後画像の合成方法を前記特定領域情報に応じて制御することを特徴とする請求項4に記載の画像処理方法。
Furthermore, the specific area input means has a specific area input step of inputting specific area information indicating a specific area in the input image,
The image processing method according to claim 4, wherein in the image conversion step, a method for combining the plurality of converted images is controlled according to the specific area information.
前記特定色は、人物画像の撮影時に瞳の色異常として発生する赤目の色であることを特徴とする請求項1乃至12のいずれか1項に記載の画像処理方法。   The image processing method according to claim 1, wherein the specific color is a red-eye color that occurs as a color abnormality of a pupil when a human image is captured. 入力画像から低周波成分を抽出して低周波成分画像を生成する低周波成分抽出手段と、
前記入力画像について、その画素ごとに前記低周波成分画像に基づく周辺色を除去するように変換した変換後画像を作成する画像変換手段と、
前記変換後画像に局在する特定色の画素を検出する特定色検出手段と、
を有することを特徴とする画像処理装置。
Low frequency component extraction means for extracting a low frequency component from an input image and generating a low frequency component image;
For the input image, image conversion means for creating a converted image converted so as to remove the peripheral color based on the low-frequency component image for each pixel;
Specific color detection means for detecting pixels of a specific color localized in the converted image;
An image processing apparatus comprising:
コンピュータで実行されることにより、該コンピュータにおいて請求項1乃至13のいずれか1項に記載の画像処理方法を実行させることを特徴とするコンピュータプログラム。   A computer program that, when executed by a computer, causes the computer to execute the image processing method according to any one of claims 1 to 13. 請求項15に記載のコンピュータプログラムを記録したことを特徴とするコンピュータ読取可能な記録媒体。   A computer-readable recording medium on which the computer program according to claim 15 is recorded.
JP2007237265A 2007-09-12 2007-09-12 Image processor and image processing method Withdrawn JP2009070103A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007237265A JP2009070103A (en) 2007-09-12 2007-09-12 Image processor and image processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007237265A JP2009070103A (en) 2007-09-12 2007-09-12 Image processor and image processing method

Publications (1)

Publication Number Publication Date
JP2009070103A true JP2009070103A (en) 2009-04-02

Family

ID=40606294

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007237265A Withdrawn JP2009070103A (en) 2007-09-12 2007-09-12 Image processor and image processing method

Country Status (1)

Country Link
JP (1) JP2009070103A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011216044A (en) * 2010-04-02 2011-10-27 Seiko Epson Corp Image processor and image processing program
WO2015015582A1 (en) * 2013-07-31 2015-02-05 日立マクセル株式会社 Image noise reduction device, imaging device, and on-board information system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011216044A (en) * 2010-04-02 2011-10-27 Seiko Epson Corp Image processor and image processing program
WO2015015582A1 (en) * 2013-07-31 2015-02-05 日立マクセル株式会社 Image noise reduction device, imaging device, and on-board information system

Similar Documents

Publication Publication Date Title
JP4246810B2 (en) Color adjustment in digital images
JP3810776B2 (en) A method for detecting and correcting red eyes in digital images.
JP6327071B2 (en) Image processing apparatus and image processing method
AU2016225841B2 (en) Predicting accuracy of object recognition in a stitched image
JPWO2004051575A1 (en) Feature region extraction apparatus, feature region extraction method, and feature region extraction program
KR20040089122A (en) Image processing to remove red-eye features without user interaction
JP5653104B2 (en) Image processing apparatus, image processing method, and program
JP2011059733A (en) Image retrieval device and image retrieval method
JP4853560B2 (en) Image processing method, image processing apparatus, and computer program
JP4599110B2 (en) Image processing apparatus and method, imaging apparatus, and program
JP2006018467A (en) Image processing apparatus and image processing method
US8655102B2 (en) Method and system for identifying tokens in an image
CN116563570B (en) Color recognition method and device, electronic equipment and storage medium
JP2009070103A (en) Image processor and image processing method
JP2005346474A (en) Image processing method and image processor and program and storage medium
US10497103B2 (en) Information processing apparatus, information processing system, information processing method, and recording medium
JP2003219180A (en) Image processing method, image processing device, recording medium capable of reading computer and computer program
JP6711031B2 (en) Image processing apparatus, image processing method, image processing system and program
JP4831344B2 (en) Eye position detection method
JP2002208013A (en) Device for extracting image area and method for the same
JP3927979B2 (en) Image processing apparatus and method
US11244187B2 (en) Information processing apparatus and non-transitory computer readable medium
JP7443965B2 (en) Information processing device, correction method, program
JP4586963B2 (en) Automatic pupil correction method
JP5069599B2 (en) Video conversion apparatus, video conversion method, and video conversion program

Legal Events

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

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20101207