JP5699497B2 - Image processing apparatus and image processing program - Google Patents

Image processing apparatus and image processing program Download PDF

Info

Publication number
JP5699497B2
JP5699497B2 JP2010202904A JP2010202904A JP5699497B2 JP 5699497 B2 JP5699497 B2 JP 5699497B2 JP 2010202904 A JP2010202904 A JP 2010202904A JP 2010202904 A JP2010202904 A JP 2010202904A JP 5699497 B2 JP5699497 B2 JP 5699497B2
Authority
JP
Japan
Prior art keywords
pixel
image
pixels
luminance
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2010202904A
Other languages
Japanese (ja)
Other versions
JP2012059108A (en
Inventor
隼人 立田
隼人 立田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2010202904A priority Critical patent/JP5699497B2/en
Publication of JP2012059108A publication Critical patent/JP2012059108A/en
Application granted granted Critical
Publication of JP5699497B2 publication Critical patent/JP5699497B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本願の開示する技術は、画像処理装置および画像処理プログラムに関する。   The technology disclosed in the present application relates to an image processing apparatus and an image processing program.

従来、例えば、画像内に写っている顔について、画像上のエッジを抽出することにより顔の両端位置および中心位置を検出し、検出した顔の両端位置および中心位置から顔の向きを求める技術がある。   Conventionally, for example, for a face in an image, a technique for detecting both end positions and center positions of the face by extracting edges on the image and obtaining the face orientation from the detected both end positions and center position of the face is known. is there.

また、顔の向きを求めるための情報として、鼻や目などの顔を構成する部品である顔部品の位置を検出する技術がある。例えば、顔画像からエッジを抽出することでエッジ画像を生成し、エッジ画像を所定の方向に投影して得られるヒストグラムの形状を分析することで顔部品の画像上の位置を検出する。また、画像のエッジ情報を用いる手法以外にも、Haar特徴量など、輝度をベースとした特徴量データに基づいて顔部品の顔画像上の位置を検出する技術もある。   Further, as information for obtaining the face orientation, there is a technique for detecting the position of a face part that is a part constituting the face such as a nose or eyes. For example, an edge image is generated by extracting an edge from the face image, and the position of the face part on the image is detected by analyzing the shape of a histogram obtained by projecting the edge image in a predetermined direction. In addition to the technique using image edge information, there is a technique for detecting the position of a facial part on a facial image based on luminance-based feature data such as Haar feature data.

特開2007−72628号公報JP 2007-72628 A

しかしながら、画像からエッジを抽出する技術は、輝度値の変化をエッジとして捉える為、被写体に照射される光の変化に影響を受けやすく、画像コントラストの低下や画像ボケを原因として、顔部品の検出精度が低下する場合があるという問題がある。   However, the technology for extracting edges from images captures changes in luminance values as edges, so it is easily affected by changes in the light applied to the subject, and detection of facial parts due to image contrast degradation and image blurring. There is a problem that accuracy may be lowered.

例えば、被写体である顔に照射されている光が一様ではない場合には、顔部品により顔画像内に形成されるエッジだけではなく、顔画像に形成される光と影の境界をエッジとして抽出してしまう。このため、顔部品の検出精度が低下する場合がある。   For example, if the light emitted to the face that is the subject is not uniform, not only the edge formed in the face image by the facial parts, but also the boundary between the light and shadow formed in the face image as an edge It will be extracted. For this reason, the detection accuracy of face parts may be reduced.

また、被写体である顔に照射される光の強度や照射範囲の変化に伴って、顔画像のコントラストが変化する場合も考えられる。例えば、顔画像からエッジを抽出する場合には、輝度値の変化有無を判断するために任意の閾値が設定される。しかし、画像のコントラストの低下を予め想定し、顔部品により顔画像に形成されるエッジのみを精度よく抽出する閾値を設定することは事実上困難である。また、画像の部位ごとに異なる閾値を算出する手法も存在するが、閾値の算出のために、輝度値の変化モデルに基づくパラメータを設定しておく必要がある。このため、外光の変化に応じて閾値やパラメータを変化させないと、光の強度や照射範囲の変化に伴って顔部品の検出精度が低下する場合がある。   In addition, there may be a case where the contrast of the face image changes with changes in the intensity of light applied to the face that is the subject or the irradiation range. For example, when an edge is extracted from a face image, an arbitrary threshold value is set to determine whether or not the luminance value has changed. However, it is practically difficult to set a threshold value for accurately extracting only the edges formed in the face image by the face parts, assuming that the contrast of the image is lowered in advance. In addition, there is a method of calculating a different threshold value for each part of an image, but it is necessary to set a parameter based on a luminance value change model in order to calculate the threshold value. For this reason, if the threshold value and the parameter are not changed according to the change of the external light, the detection accuracy of the face part may be lowered with the change of the light intensity and the irradiation range.

また、被写体である顔を撮影する撮影装置のフォーカス性能の個体差やレンズの取り付け具合などによっては、画像ボケを起こした顔画像が撮影される場合も考えられる。しかしながら、撮影装置のフォーカス性能の個体差などを原因とする画像ボケを予め想定し、顔部品により顔画像に形成されるエッジのみを精度よく抽出する閾値を設定することは、撮影装置ごとに閾値を補正する必要が生じるため、事実上困難である。このため、閾値を変化させないと、撮影装置のフォーカス性能の個体差やレンズの取り付け具合などによって顔部品の検出精度が低下する場合がある。   Further, depending on individual differences in focus performance of a photographing apparatus that photographs a face that is a subject, how a lens is attached, and the like, a case where a face image with blurred image is photographed may be considered. However, assuming that image blur caused by individual differences in focus performance of the imaging device is assumed in advance, setting a threshold value for accurately extracting only the edges formed on the face image by the facial parts is a threshold value for each imaging device. It is practically difficult to correct this. For this reason, if the threshold value is not changed, the detection accuracy of the face part may decrease due to individual differences in the focusing performance of the photographing apparatus, the degree of lens attachment, and the like.

このように、エッジを抽出することにより顔画像から顔部品を検出する技術では、被写体に照射される光の変化、コントラストの低下あるいは画像ボケなどにより、その検出精度が低下してしまう。   As described above, in the technique of detecting a face part from a face image by extracting an edge, the detection accuracy is lowered due to a change in light irradiated to a subject, a decrease in contrast, an image blur, or the like.

また、上述したHaar特徴量などを用いる技術も顔画像の輝度値を扱う技術である。このため、顔部品の検出精度は、エッジを抽出する技術と同様に、顔に照射される光の変化に影響を受けやすく、被写体に照射される光の変化、コントラストの低下あるいは画像ボケなどにより、顔部品の検出精度が低下する場合がある。Haar特徴量は画像の明暗パターンがテンプレートに一致するか否かで、検出対象を含んだ画像であるか否かを判断する技術である。画像上に現れる明暗パターンは外光変化により影響を受け易い。従って、同一の被写体であっても明暗パターンの現れ方が変化してしまうので、テンプレートと一致しているか否かの評価が困難になり、検出精度が低下する場合がある。   Further, the technique using the Haar feature amount described above is also a technique for handling the luminance value of the face image. For this reason, the detection accuracy of face parts is easily affected by changes in the light applied to the face, similar to the technique for extracting the edge, and is caused by changes in the light applied to the subject, a decrease in contrast, image blurring, etc. In some cases, the detection accuracy of face parts may be reduced. The Haar feature amount is a technique for determining whether or not the image includes a detection target based on whether or not the light / dark pattern of the image matches the template. The light and dark pattern appearing on the image is easily affected by changes in external light. Therefore, since the appearance of the light / dark pattern changes even for the same subject, it may be difficult to evaluate whether or not it matches the template, and the detection accuracy may be reduced.

開示の技術は、上記に鑑みてなされたものであって、外光の影響下であっても、画像から顔部品などの特徴点領域を検出する場合の検出精度の低下を防止することが可能な画像処理装置および画像処理プログラムを提供することを目的とする。   The disclosed technology has been made in view of the above, and can prevent a reduction in detection accuracy when detecting a feature point region such as a facial part from an image even under the influence of external light. An object of the present invention is to provide an image processing apparatus and an image processing program.

本願の開示する画像処理装置は、一つの態様において、取得部と検出部を有する。取得部は、画像内に含まれる、第一の画素と、該第一の画素と互いに1画素以上離れた位置にある複数の画素との輝度値を、該第一の画素を前記画像内で走査させながらそれぞれ取得する。検出部は、走査させながら取得した前記第一の画素と前記複数の画素とのそれぞれの輝度値に基づいて、前記画像内の特徴点を検出する。   In one aspect, an image processing apparatus disclosed in the present application includes an acquisition unit and a detection unit. The acquisition unit obtains luminance values of the first pixel included in the image and a plurality of pixels located at a distance of one pixel or more from the first pixel, and the first pixel is included in the image. Acquire each while scanning. The detection unit detects a feature point in the image based on the luminance values of the first pixel and the plurality of pixels acquired while scanning.

本願の開示する技術の一つの態様によれば、外光の影響下であっても、画像から特徴点領域を検出する場合の検出精度の低下を防止できる。   According to one aspect of the technology disclosed in the present application, it is possible to prevent a decrease in detection accuracy when a feature point region is detected from an image even under the influence of external light.

図1は、実施例1に係る画像処理装置の説明に用いる図である。FIG. 1 is a diagram used for explaining the image processing apparatus according to the first embodiment. 図2は、実施例1に係る画像処理装置の構成を示す機能ブロック図である。FIG. 2 is a functional block diagram illustrating the configuration of the image processing apparatus according to the first embodiment. 図3は、実施例1に係る特徴量記憶部に記憶される情報の一例を示す図である。FIG. 3 is a diagram illustrating an example of information stored in the feature amount storage unit according to the first embodiment. 図4は、実施例1に係る検出部の動作の説明に用いる図である。FIG. 4 is a diagram used for explaining the operation of the detection unit according to the first embodiment. 図5は、実施例1に係る検出部の動作の説明に用いる補足図である。FIG. 5 is a supplementary diagram used to describe the operation of the detection unit according to the first embodiment. 図6は、実施例1に係る検出部の動作の説明に用いる補足図である。FIG. 6 is a supplementary diagram used to describe the operation of the detection unit according to the first embodiment. 図7は、実施例1に係る検出部の動作の説明に用いる補足図である。FIG. 7 is a supplementary diagram used to describe the operation of the detection unit according to the first embodiment. 図8は、実施例1に係る特徴量画像の一例を示す図である。FIG. 8 is a diagram illustrating an example of the feature amount image according to the first embodiment. 図9は、実施例1に係る画像処理装置による処理の全体的な流れを示す図である。FIG. 9 is a diagram illustrating an overall flow of processing by the image processing apparatus according to the first embodiment. 図10は、実施例1に係る画像処理装置による特徴点検出処理の流れを示す図である。FIG. 10 is a diagram illustrating a flow of feature point detection processing by the image processing apparatus according to the first embodiment. 図11は、実施例1に係る画像処理装置の処理結果を説明するための図である。FIG. 11 is a diagram for explaining the processing result of the image processing apparatus according to the first embodiment. 図12は、実施例1に係るコントラストの低下した画像に対する画像処理装置による処理結果を説明するための図である。FIG. 12 is a diagram for explaining a processing result by the image processing apparatus for an image with reduced contrast according to the first embodiment. 図13は、実施例1に係る照射光の強度が変化した画像に対する画像処理装置による処理結果を説明するための図である。FIG. 13 is a diagram for explaining a processing result by the image processing apparatus for an image in which the intensity of irradiation light according to the first embodiment is changed. 図14は、画像処理プログラムを実行する電子機器の一例を示す図である。FIG. 14 is a diagram illustrating an example of an electronic device that executes an image processing program.

以下に、図面を参照しつつ、本願の開示する画像処理装置および画像処理プログラムの一実施形態について詳細に説明する。本願の開示する画像処理プログラムおよび画像処理装置の一実施形態として後述する実施例により、本願が開示する技術が限定されるものではない。なお、以下の実施例では、画像中に人の顔が写っている画像のことを顔画像と呼ぶ。そして、顔画像から、例えば、鼻の穴に相当する領域を示す特徴点を検出する場合の一実施形態について説明する。また、以下の実施例に開示する技術は、処理内容に矛盾を生じさせない範囲で適宜組み合わせることが可能である。   Hereinafter, an embodiment of an image processing apparatus and an image processing program disclosed in the present application will be described in detail with reference to the drawings. The technology disclosed in the present application is not limited by the examples described later as an embodiment of the image processing program and the image processing apparatus disclosed in the present application. In the following embodiments, an image in which a human face is reflected in an image is called a face image. An embodiment in which a feature point indicating a region corresponding to, for example, a nostril is detected from a face image will be described. In addition, the techniques disclosed in the following embodiments can be appropriately combined within a range that does not cause a contradiction in processing contents.

図1は、実施例1に係る画像処理装置の説明に用いる図である。図1に示す1Aは顔画像を表す。図1に示す1Bは、顔画像1Aが撮影されたときに顔に照射されていた光とは、強度や照射範囲などが異なる光が照射された場合に撮影された顔画像を表す。図1に示す1Cは、顔画像1A内の、ある部分領域に相当する輝度値の変化を表したグラフである。この1Cに示す部分領域は、各画素の輝度値が領域の内側から外側へ向かうに従って大きくなっている領域R1を含んでいる。図1に示す1Dは、顔画像1B内の、ある部分領域に相当する輝度値の変化を表したグラフである。この1Dに示す部分領域は、1Cに示す部分領域と同様に、各画素の輝度値が領域の内側から外側へ向かうに従って大きくなっている領域R2を含んでいる。ここで、画像のxy座標軸をそれぞれx軸、y軸とし、z軸に、xy座標で示される位置の画素の輝度値をとると、輝度値の変化の状態を、三次元上の曲面と見なすことができる。このような輝度曲面では、領域R1や領域R2は、領域の中ほどに凹んだ底を持つ穴のように表されることになる。   FIG. 1 is a diagram used for explaining the image processing apparatus according to the first embodiment. 1A shown in FIG. 1 represents a face image. 1B shown in FIG. 1 represents a face image photographed when light having a different intensity or irradiation range from the light irradiated on the face when the face image 1A was photographed. 1C shown in FIG. 1 is a graph showing a change in luminance value corresponding to a certain partial area in the face image 1A. The partial region shown in 1C includes a region R1 in which the luminance value of each pixel increases from the inside to the outside of the region. 1D shown in FIG. 1 is a graph showing a change in luminance value corresponding to a certain partial area in the face image 1B. Similar to the partial region shown in 1C, the partial region shown in 1D includes a region R2 in which the luminance value of each pixel increases from the inside to the outside of the region. Here, if the xy coordinate axes of the image are the x-axis and y-axis, respectively, and the luminance value of the pixel at the position indicated by the xy coordinates is taken on the z-axis, the change state of the luminance value is regarded as a three-dimensional curved surface. be able to. In such a luminance curved surface, the region R1 or the region R2 is represented as a hole having a bottom recessed in the middle of the region.

人の顔をほぼ正面から撮影した場合に、顔画像内に映し出された鼻の穴に相当する領域は、鼻の穴が周囲よりもくぼんでいるので、意図的に光を顔の下から当てない限り、影になる。従って、鼻の穴に相当する領域は、領域R1や領域R2のように、各画素の輝度値が領域の内側から外側へ向かうに従って大きくなる、換言すれば、輝度値が領域の外側から内側へ向かうに従って小さくなることに発明者は気づいた。更に、発明者は、このような画像上の輝度値変化の特徴を利用すれば、画像からエッジを抽出することなく、顔部品の画像上の位置を特定できることに気づいた。実施例1に係る画像処理装置は、領域R1や領域R2のように、顔画像内の部分領域であって、各画素の輝度値が領域の内側から外側へ向い次第に大きくなっている領域は、顔に照射される光の変化に影響されずに、その輝度値変化の特徴を留めている点に着目する。つまり、図1に示す領域R1や領域R2が、その輝度値変化の特徴を留めるのは、顔に照射される光が変化する場合に限らず、顔画像全体のコントラストが低下した場合や、顔画像がボケた場合のいずれについても同様である。   When a person's face is photographed from the front, the area corresponding to the nostril shown in the face image has a deeper nose than the surrounding area. As long as there is no shadow. Accordingly, the region corresponding to the nostril increases like the region R1 and the region R2 as the luminance value of each pixel increases from the inside to the outside of the region. In other words, the luminance value increases from the outside to the inside of the region. The inventor noticed that it became smaller as it went. Furthermore, the inventor has realized that the position of the facial part on the image can be specified without extracting an edge from the image by using the feature of the luminance value change on the image. The image processing apparatus according to the first embodiment is a partial area in the face image, such as the area R1 and the area R2, in which the luminance value of each pixel gradually increases from the inside to the outside of the area. It is noted that the feature of the brightness value change is retained without being affected by the change in the light applied to the face. That is, the region R1 and the region R2 shown in FIG. 1 retain the characteristics of the change in luminance value not only when the light irradiated to the face changes, but also when the contrast of the entire face image is reduced, The same applies to any case where the image is blurred.

そこで、実施例1に係る画像処理装置は、顔画像上で顔部品の位置を検出する際に、鼻の穴のように、各画素の輝度値が領域の内側から外側へ向かうに従って大きくなっている領域内の画素位置を利用することで、顔部品の検出精度の低下を防止する。   Therefore, in the image processing apparatus according to the first embodiment, when detecting the position of the facial part on the face image, the luminance value of each pixel increases from the inside to the outside of the region, like a nostril. By using the pixel position within the area, the reduction in detection accuracy of the face part is prevented.

[画像処理装置の構成(実施例1)]
図2は、実施例1に係る画像処理装置の構成を示す機能ブロック図である。図2に示すように、実施例1に係る画像処理装置300は、例えば、車両1に実装される。そして、画像処理装置300は、車両1に搭載された1または複数の撮影装置100および出力装置200に接続される。なお、図2においては、撮影装置100が複数記載されているが、撮影装置100は1台であっても構わない。
[Configuration of Image Processing Apparatus (Example 1)]
FIG. 2 is a functional block diagram illustrating the configuration of the image processing apparatus according to the first embodiment. As illustrated in FIG. 2, the image processing apparatus 300 according to the first embodiment is mounted on the vehicle 1, for example. The image processing device 300 is connected to one or a plurality of imaging devices 100 and an output device 200 mounted on the vehicle 1. In FIG. 2, a plurality of photographing apparatuses 100 are illustrated, but the number of photographing apparatuses 100 may be one.

撮影装置100は、例えば、単眼カメラやステレオカメラなどに該当する。撮影装置100には、運転者の顔を正面やや下方から撮影した顔画像を撮影するために車室内のステアリングカラムや計器パネル内に備え付けられるものや、車両1の周囲を撮影するために車両の所定位置に設置されるものがある。出力装置200は、例えば、車室内に備え付けられたモニタやディスプレイに該当し、例えば、撮影装置100により撮影された画像を表示する。   The imaging device 100 corresponds to, for example, a monocular camera or a stereo camera. The photographing apparatus 100 is equipped with a steering column or instrument panel in the vehicle interior for photographing a face image obtained by photographing the driver's face from the front or slightly below, or a vehicle for photographing the surroundings of the vehicle 1. Some are installed in place. The output device 200 corresponds to, for example, a monitor or a display provided in the passenger compartment, and displays an image photographed by the photographing device 100, for example.

また、図2に示すように、画像処理装置300は、記憶部310および制御部320を有する。   In addition, as illustrated in FIG. 2, the image processing apparatus 300 includes a storage unit 310 and a control unit 320.

記憶部310は、図2に示すように、画像記憶部311および特徴量記憶部312を有する。なお、記憶部310は、例えば、RAM(Random Access Memory)やフラッシュメモリ(flash memory)などの半導体メモリ素子である。   As illustrated in FIG. 2, the storage unit 310 includes an image storage unit 311 and a feature amount storage unit 312. The storage unit 310 is a semiconductor memory element such as a RAM (Random Access Memory) or a flash memory.

画像記憶部311は、例えば、運転者の顔を正面やや下方から撮影した顔画像を記憶する。運転者の顔画像は、上述した撮影装置100により取得される。特徴量記憶部312は、後述する検出部322により実行された特徴点検出処理の結果として、例えば、顔画像上の座標と所定の特徴量とを対応付けて記憶する。図3は、実施例1に係る特徴量記憶部に記憶される情報の一例を示す図である。図3に示すように、特徴量記憶部312は、座標(X1,Y1)と特徴量(V1)、座標(X2,Y2)と特徴量(V2)、座標(X3,Y3)と特徴量(V3)などをそれぞれ対応付けて記憶する。なお、特徴量記憶部312に記憶される座標や特徴量については、後述する検出部322の説明の中で明らかにする。   The image storage unit 311 stores, for example, a face image obtained by photographing the driver's face from the front or slightly below. The driver's face image is acquired by the photographing apparatus 100 described above. The feature amount storage unit 312 stores, for example, the coordinates on the face image and a predetermined feature amount in association with each other as a result of the feature point detection processing executed by the detection unit 322 described later. FIG. 3 is a diagram illustrating an example of information stored in the feature amount storage unit according to the first embodiment. As shown in FIG. 3, the feature amount storage unit 312 has coordinates (X1, Y1) and feature amounts (V1), coordinates (X2, Y2), feature amounts (V2), coordinates (X3, Y3), and feature amounts ( V3) and the like are stored in association with each other. Note that the coordinates and feature quantities stored in the feature quantity storage unit 312 will be clarified in the description of the detection unit 322 described later.

図2に戻り、制御部320は、取得部321と、検出部322と、判定部323と、報知部324とを有する。なお、制御部320は、例えば、電子回路や集積回路に該当する。電子回路としては、例えば、CPU(Central Processing Unit)やMPU(Micro Processing Unit)がある。また、集積回路としては、例えば、ASIC(Application Specific Integrated Circuit)やFPGA(Field Programmable Gate Array)などがある。   Returning to FIG. 2, the control unit 320 includes an acquisition unit 321, a detection unit 322, a determination unit 323, and a notification unit 324. Note that the control unit 320 corresponds to, for example, an electronic circuit or an integrated circuit. Examples of the electronic circuit include a CPU (Central Processing Unit) and an MPU (Micro Processing Unit). Examples of integrated circuits include ASIC (Application Specific Integrated Circuit) and FPGA (Field Programmable Gate Array).

取得部321は、画像記憶部311から顔画像のデータを取得し、顔画像に含まれる各画素の輝度値を取得する。   The acquisition unit 321 acquires face image data from the image storage unit 311 and acquires the luminance value of each pixel included in the face image.

検出部322は、取得部321により取得された顔画像に含まれる各画素の輝度値に基づいて、顔画像から、例えば、鼻の穴のような特徴点を検出する特徴点検出処理を実行する。図2に示すように、検出部322は、抽出部322A、計算部322B、格納部322Cおよび決定部322Dを有する。   Based on the luminance value of each pixel included in the face image acquired by the acquisition unit 321, the detection unit 322 executes a feature point detection process that detects a feature point such as a nostril from the face image. . As shown in FIG. 2, the detection unit 322 includes an extraction unit 322A, a calculation unit 322B, a storage unit 322C, and a determination unit 322D.

抽出部322Aは、取得部321により取得された顔画像に含まれる各画素の輝度値を元に、各画素の輝度値が領域の内側から外側へ向かうに従って大きくなっている可能性がある領域を特定する処理対象となる画素を抽出する。以下、図4を参照しつつ、抽出部322Aについて説明する。図4は、実施例1に係る検出部の動作の説明に用いる図である。   Based on the luminance value of each pixel included in the face image acquired by the acquisition unit 321, the extraction unit 322 </ b> A extracts a region where the luminance value of each pixel may increase as it goes from the inside to the outside of the region. Pixels to be identified are extracted. Hereinafter, the extraction unit 322A will be described with reference to FIG. FIG. 4 is a diagram used for explaining the operation of the detection unit according to the first embodiment.

図4に示すP1は注目画素を表す。図4に示す4Aは顔画像のある一部の領域を表す。図4に示す領域4Bは、P1を注目画素とした場合に、計算部322Bが行う処理のイメージを分かり易くするためにハッチングされている。図4に示すP2およびP3は、注目画素P1を中心として左右方向、つまりX軸方向に左右に5ピクセルずつ離れた位置にある2つの近傍画素をそれぞれ表す。図4に示すP4およびP5は、注目画素P1を中心として上下方向、つまりY軸方向に上下に5ピクセルずつ離れた位置にある2つの近傍画素をそれぞれ表す。図4に示すC1はX軸方向に配列された3つの画素の輝度値から算出した近似2次関数を表す。図4に示すC2はY軸方向に配列された3つの画素の輝度値から算出した近似2次関数を表す。図4に示すB1は2次関数C1の底、すなわち最小値をとる位置に相当するY座標を示す線分を表す。図4に示すB2は2次関数C2の底、すなわち最小値をとる位置に相当するX座標を示す線分を表す。図4に示す4Cは、線分B1と線分B2とが交差する画素の位置を表す。ここで、図4に示す4Cは、近似式に基づいて、領域4Bに含まれる画素の中で輝度値が最も小さいと推定される画素に該当する。なお、以下では、注目画素P1に対する画素4Cのことを輝度最小点と記すものとする。   P1 shown in FIG. 4 represents a target pixel. 4A shown in FIG. 4 represents a partial area of the face image. A region 4B shown in FIG. 4 is hatched to make the image of the processing performed by the calculation unit 322B easy to understand when P1 is the target pixel. P2 and P3 shown in FIG. 4 respectively represent two neighboring pixels located at a position 5 pixels away from each other in the left-right direction around the target pixel P1, that is, in the X-axis direction. P4 and P5 shown in FIG. 4 respectively represent two neighboring pixels located at a position separated by 5 pixels in the vertical direction around the target pixel P1, that is, in the Y-axis direction. C1 shown in FIG. 4 represents an approximate quadratic function calculated from the luminance values of three pixels arranged in the X-axis direction. C2 shown in FIG. 4 represents an approximate quadratic function calculated from the luminance values of three pixels arranged in the Y-axis direction. B1 shown in FIG. 4 represents a line segment indicating the Y coordinate corresponding to the bottom of the quadratic function C1, that is, the position having the minimum value. B2 shown in FIG. 4 represents a line segment indicating the X coordinate corresponding to the bottom of the quadratic function C2, that is, the position having the minimum value. 4C shown in FIG. 4 represents the position of the pixel where the line segment B1 and the line segment B2 intersect. Here, 4C shown in FIG. 4 corresponds to a pixel whose luminance value is estimated to be the smallest among the pixels included in the region 4B based on the approximate expression. Hereinafter, the pixel 4C corresponding to the target pixel P1 is referred to as a luminance minimum point.

図4に示すように、抽出部322Aは、顔画像4Aに含まれる画素の一つを注目画素P1として選択し、注目画素P1からX軸方向に両側5ピクセルの位置にある近傍画素P2およびP3を取得する。続いて、抽出部322Aは、注目画素P1からY軸方向に両側5ピクセルの位置にある近傍画素P4およびP5を取得する。続いて、抽出部322Aは、注目画素P1の輝度値と近傍画素P2およびP3の各輝度値とを比較するとともに、注目画素P1の輝度値と近傍画素P4およびP5の各輝度値とを比較する。比較の結果、注目画素P1の輝度値が近傍画素P2〜P5の輝度値よりも大きくなければ、注目画素P1および4個の近傍画素を計算部322Bの処理対象とする。注目画素P1が4個の近傍画素のいずれかよりも輝度値が大きければ、この注目画素P1は鼻の穴のように周囲よりも輝度値が暗い領域ではない位置であると見なすことができる。このように、注目画素P1が鼻の穴に相当する領域外であることが自明である場合は、そのP1を計算部322Bの処理対象にしないことで、計算量を少なくすることができる。なお、近傍画素は注目画素の上下左右の4個に限る必要は無く、注目画素を囲む位置にある複数の画素を利用することができる。   As illustrated in FIG. 4, the extraction unit 322A selects one of the pixels included in the face image 4A as the target pixel P1, and neighboring pixels P2 and P3 that are located at five pixels on both sides in the X-axis direction from the target pixel P1. To get. Subsequently, the extraction unit 322A acquires neighboring pixels P4 and P5 located at positions of 5 pixels on both sides in the Y-axis direction from the target pixel P1. Subsequently, the extraction unit 322A compares the luminance value of the target pixel P1 with the luminance values of the neighboring pixels P2 and P3, and compares the luminance value of the target pixel P1 with the luminance values of the neighboring pixels P4 and P5. . As a result of the comparison, if the luminance value of the target pixel P1 is not greater than the luminance values of the neighboring pixels P2 to P5, the target pixel P1 and the four neighboring pixels are set as processing targets of the calculation unit 322B. If the target pixel P1 has a luminance value larger than any of the four neighboring pixels, the target pixel P1 can be regarded as a position where the luminance value is not darker than the surroundings, such as a nostril. Thus, when it is obvious that the target pixel P1 is outside the region corresponding to the nostril, the calculation amount can be reduced by not making the P1 a processing target of the calculation unit 322B. Note that the neighboring pixels need not be limited to the four pixels above, below, left, and right of the target pixel, and a plurality of pixels at positions surrounding the target pixel can be used.

なお、上述した注目画素から近傍画素までの距離(サイズ)は一例である。注目画素から何ピクセル離れた位置の画素を近傍画素とするか、言い換えれば、左右もしくは上下の近傍画素間の距離(サイズ)をどの程度とするか、は、5ピクセルに限るものではなく、以下のようなサイズを設定できる。例えば、撮影装置100で運転席に着いた運転者の顔を撮影した時に顔画像内に映し出される鼻の穴の領域の幅の一般値を予め決定しておく。そして、上述のサイズを、顔画像内で鼻の穴が有する領域の幅よりも狭く、かつ該幅の半分よりも大きな大きさに設定する。例えば、顔画像内に映し出された鼻の穴の領域の縦幅もしくは横幅の7割程度に相当するサイズが適当である。もちろん、本実施例に開示する技術では、鼻の穴以外であっても、各画素の輝度値が領域の内側から外側へ向かうに従って大きくなるような領域であれば検出できる。従って、検出したい領域の画像上での大きさに応じて、検出したい領域の一般値の縦幅もしくは横幅の7割程度に相当するサイズを用いればよい。   Note that the above-described distance (size) from the target pixel to the neighboring pixels is an example. How many pixels away from the target pixel are used as the neighboring pixels, in other words, how much the distance (size) between the left and right or upper and lower neighboring pixels is not limited to 5 pixels. You can set a size like For example, the general value of the width of the nostril area projected in the face image when the image of the driver's face in the driver's seat is photographed by the photographing apparatus 100 is determined in advance. Then, the above-mentioned size is set to be smaller than the width of the region of the nostril in the face image and larger than half of the width. For example, a size corresponding to about 70% of the vertical or horizontal width of the nostril area projected in the face image is appropriate. Of course, the technique disclosed in the present embodiment can detect any area other than the nostrils as long as the luminance value of each pixel increases from the inside to the outside of the area. Therefore, a size corresponding to about 70% of the vertical or horizontal width of the general value of the region to be detected may be used according to the size of the region to be detected on the image.

計算部322Bは、抽出部322Aにより取得された注目画素P1および4個の近傍画素について、画素の輝度値の変動を近似する2次関数を算出する。以下、図4を参照しつつ、計算部322Bの動作を説明する。   The calculation unit 322B calculates a quadratic function that approximates the variation in the luminance value of the pixel of interest pixel P1 and four neighboring pixels acquired by the extraction unit 322A. Hereinafter, the operation of the calculation unit 322B will be described with reference to FIG.

例えば、計算部322Bは、注目画素P1の輝度値と、注目画素P1を含むX軸方向上に配列された2つの近傍画素P2およびP3の輝度値をそれぞれ取得する。そして、計算部322Bは、注目画素P1の輝度値と、近傍画素P2の輝度値およびP3の輝度値とを用いて、2次関数C1を求める。二次関数C1は、画素P1と同じY座標をもつ、画素P2からP3までの間にある各画素の輝度値の変化の状態を近似していると見なすことができる。同様に、計算部322Bは、注目画素P1を含むY軸方向上に配列された2つの近傍画素P4およびP5の輝度値をそれぞれ取得する。そして、計算部322Bは、この注目画素P1の輝度値と、近傍画素P4の輝度値およびP5の輝度値とを用いて、2次関数C2を求める。二次関数C2は、画素P1と同じX座標をもつ、画素P4からP5までの間にある各画素の輝度値の変化の状態を近似していると見なすことができる。   For example, the calculation unit 322B acquires the luminance value of the target pixel P1 and the luminance values of two neighboring pixels P2 and P3 arranged in the X-axis direction including the target pixel P1. Then, the calculation unit 322B calculates a quadratic function C1 using the luminance value of the target pixel P1, the luminance value of the neighboring pixel P2, and the luminance value of P3. The quadratic function C1 can be regarded as approximating the state of change in the luminance value of each pixel between the pixels P2 and P3 having the same Y coordinate as the pixel P1. Similarly, the calculation unit 322B acquires the brightness values of two neighboring pixels P4 and P5 arranged in the Y-axis direction including the target pixel P1. Then, the calculation unit 322B obtains a quadratic function C2 using the luminance value of the target pixel P1, the luminance value of the neighboring pixel P4, and the luminance value of P5. The quadratic function C2 can be regarded as approximating the state of change in luminance value of each pixel between the pixels P4 and P5 having the same X coordinate as the pixel P1.

なお、計算部322Bは、2次関数を用いて、輝度の変化の状態を近似する場合に限られるものではなく、輝度の変化の状態が評価できる関数であればどのような関数を用いてもよい。例えば、三角関数などを用いることもできる。   The calculation unit 322B is not limited to approximating the luminance change state using a quadratic function, and any function can be used as long as the luminance change state can be evaluated. Good. For example, a trigonometric function can be used.

格納部322Cは、計算部322Bにより求められた二つの2次関数それぞれの底により特定される位置の座標に対応付けて所定の特徴量を格納する。以下、図4を参照しつつ、格納部322Cについて説明する。   The storage unit 322C stores a predetermined feature amount in association with the coordinates of the position specified by the bases of the two quadratic functions obtained by the calculation unit 322B. Hereinafter, the storage unit 322C will be described with reference to FIG.

例えば、格納部322Cは、計算部322Bにより求められた2次関数C1および2次関数C2との底、すなわち最小値をとる位置のX座標とY座標とを求める。続いて、格納部322Cは、図4の4Cに示すように、2次関数C1が最小値をとる位置をY軸方向に延長した線分B1と2次関数C2が最小値をとる位置をX軸方向に延長した線分B2とが交差する位置4Cを検出する。つまり、格納部322Cは、2次関数C1が最小値をとる位置のX座標と、2次関数C2が最小値をとる位置のY座標を取得する。   For example, the storage unit 322C obtains the bottom of the quadratic function C1 and the quadratic function C2 obtained by the calculation unit 322B, that is, the X coordinate and the Y coordinate of the position having the minimum value. Subsequently, as illustrated in 4C of FIG. 4, the storage unit 322C determines the position where the line segment B1 obtained by extending the position where the quadratic function C1 takes the minimum value in the Y-axis direction and the position where the quadratic function C2 takes the minimum value as X A position 4C where the line segment B2 extending in the axial direction intersects is detected. That is, the storage unit 322C acquires the X coordinate of the position where the quadratic function C1 takes the minimum value and the Y coordinate of the position where the quadratic function C2 takes the minimum value.

続いて、格納部322Cは、図4の4Cに示す位置の座標を注目画素P1に着目した処理における輝度最小点に決定する。続いて、格納部322Cは、2次関数C1の2次の項の係数値と2次関数C2の2次の項の係数値とを比較して小さい方の係数値を特徴量として取得する。続いて、格納部322Cは、決定した輝度最小点の座標に対応付けて、特徴量として取得した係数値を特徴量記憶部312に格納する。   Subsequently, the storage unit 322C determines the coordinates of the position indicated by 4C in FIG. 4 as the minimum luminance point in the process focusing on the target pixel P1. Subsequently, the storage unit 322C compares the coefficient value of the quadratic term of the quadratic function C1 with the coefficient value of the quadratic term of the quadratic function C2, and acquires the smaller coefficient value as a feature amount. Subsequently, the storage unit 322C stores the coefficient value acquired as the feature amount in the feature amount storage unit 312 in association with the determined coordinates of the minimum luminance point.

なお、抽出部322Aおよび計算部322Bによる、ある注目画素P1に対する処理が終わると、注目画素P1の位置を顔画像内で一つずらして、新たな注目画素P1に対して上述の抽出部322Aおよび計算部322Bによる処理を行う。即ち、注目画素P1をずらしながら、顔画像を走査する。ここで、処理簡略化のために、顔画像を間引いて処理することも考えられる。間引いて処理を行う場合には、注目画素P1を1つずつずらして走査するのではなく、所定個数おきにすらして走査しても良い。また、処理簡略化のために、顔画像から、顔が映っていそうな範囲を特定できるのであれば、そのような範囲のみを対象にして注目画素P1を走査させることも考えられる。例えば、撮影装置100の位置が、顔や鼻の穴などの検出対象に対して固定的であるならば、画像上における検出対象の写る領域を凡そ特定できる。また例えば、肌色の領域を特定し、肌色の領域内で注目画素P1を走査させることも考えられる。   When the extraction unit 322A and the calculation unit 322B complete the process on a certain pixel of interest P1, the position of the pixel of interest P1 is shifted by one in the face image, and the above-described extraction unit 322A and Processing by the calculation unit 322B is performed. That is, the face image is scanned while shifting the target pixel P1. Here, for simplification of processing, it is also conceivable to process by thinning out the face image. In the case of performing processing by thinning out, scanning may be performed by shifting the pixel of interest P1 every predetermined number instead of shifting by one pixel at a time. For simplification of processing, if a range where a face is likely to be reflected can be identified from the face image, it is conceivable to scan the target pixel P1 only for such a range. For example, if the position of the photographing apparatus 100 is fixed with respect to a detection target such as a face or a nostril, an area where the detection target appears on the image can be roughly specified. Further, for example, it is conceivable to specify a skin color region and scan the pixel of interest P1 within the skin color region.

ここで例えば、一つ前に処理した注目画素P1に対して計算部322Bが算出した結果と、次に処理する注目画素P1に対して計算部322Bが算出した結果との間で輝度最小点の座標が同一座標になる場合がある。即ち、異なる注目画素に対してそれぞれ求めた輝度最小点の位置が重複する場合がある。特に、各画素の輝度値が顔画像内のある部分領域において内側から外側へ向かうに従って大きくなっている領域内に注目画素P1がある場合には、輝度最小点が重複することがある。このように、輝度最小点の座標が同一座標になる場合には、格納部322Cは、同一の座標に対応付けて、ある注目画素について格納済みの特徴量に対して他の注目画素に対して算出した特徴量を加算し、特徴量記憶部312に記憶されている特徴量を更新する。   Here, for example, the luminance minimum point is calculated between the result calculated by the calculation unit 322B for the target pixel P1 processed immediately before and the result calculated by the calculation unit 322B for the target pixel P1 processed next. The coordinates may be the same. That is, the position of the minimum luminance point obtained for each different pixel of interest may overlap. In particular, when the pixel of interest P1 is in an area where the luminance value of each pixel increases from the inside toward the outside in a partial area in the face image, the minimum luminance point may overlap. As described above, when the coordinates of the minimum luminance point are the same, the storage unit 322C correlates with the same coordinates and stores the feature amount stored for a certain target pixel with respect to other target pixels. The calculated feature amount is added, and the feature amount stored in the feature amount storage unit 312 is updated.

なお、格納部322Cが、2次関数の2次の項の係数値のうち小さい方の係数値を特徴量とするのは、最終的に特定したい領域とは異なる領域に関する特徴量を低く抑える趣旨である。例えば、顔画像中の鼻の穴に相当する図1に示す領域R1や領域R2のような領域では、X軸方向およびY軸方向の輝度の変化状態を近似した二次関数のカーブが双方同程度となり、各2次関数の2次の項の係数値に大きな差はないことが予想される。ここで、領域R1や領域R2のような領域とは異なり、X軸方向またはY軸方向のいずれか一方の二次関数のカーブが他方に比べて鋭い領域では、近似する2次関数の2次の項の一方の係数値が大きくなる。このように、X軸方向またはY軸方向のいずれか一方の二次関数のカーブが鋭い領域は、最終的に検出したい領域、例えば、図1に示す領域R1や領域R2に該当しないので、このような領域で特徴量が大きくならない方が処理上で都合が良い。そこで、2次関数の小さい方の係数値を特徴量として格納することにより、最終的に検出したい領域に該当しない領域に対する処理の結果、格納される特徴量をできるだけ抑える。   Note that the storage unit 322C uses the smaller coefficient value of the quadratic term coefficient value of the quadratic function as the feature value in order to keep the feature value related to the region different from the region to be finally specified low. It is. For example, in a region such as region R1 or region R2 shown in FIG. 1 corresponding to a nostril in a face image, the curves of the quadratic function approximating the change in luminance in the X-axis direction and the Y-axis direction are both the same. Therefore, it is expected that there is no significant difference in the coefficient values of the quadratic terms of the respective quadratic functions. Here, unlike a region such as the region R1 or the region R2, in a region where the curve of the quadratic function in either the X-axis direction or the Y-axis direction is sharper than the other, the quadratic function of the approximate quadratic function is approximated. The coefficient value of one of the terms becomes larger. As described above, the region where the curve of the quadratic function in either the X-axis direction or the Y-axis direction is sharp does not correspond to the region to be finally detected, for example, the region R1 or the region R2 shown in FIG. It is convenient in processing that the feature amount does not increase in such a region. Therefore, by storing the smaller coefficient value of the quadratic function as a feature amount, the stored feature amount is suppressed as much as possible as a result of the processing for the region not corresponding to the region to be finally detected.

ここで、図5〜図7を用いて、上述してきた検出部322により実行される特徴点検出処理について補足説明する。図5〜図7は、実施例1に係る検出部の動作の説明に用いる補足図である。   Here, the feature point detection process executed by the detection unit 322 described above will be supplementarily described with reference to FIGS. 5 to 7 are supplementary diagrams used for explaining the operation of the detection unit according to the first embodiment.

図5に示す5Aは、各画素の輝度値が領域の内側から外側へ向かうに従って大きくなっている閉鎖領域(α)を有する顔画像の領域の一部を表す3次元モデルである。X軸およびY軸は、顔画像のX軸方向およびY軸方向の位置を示し、Z軸方向はXY座標で特定される位置の画素の輝度値を示す。例えば、顔画像の内、鼻の穴に相当する領域は、閉鎖領域(α)のような状態になる。なお、閉鎖領域(α)に含まれるX軸方向のある画素列の輝度変動を近似すると、例えば、上述した図4に示す2次関数C1のようになる。同様に、閉鎖領域(α)に含まれるY軸方向のある画素列の輝度変動を近似すると、例えば、上述した図4に示す2次関数C2のようになる。図5に示す5Bは、上述した抽出部322A、計算部322B、格納部322Cにより、5Aに示される範囲の顔画像内の各画素を注目画素P1として走査した場合に、特徴量記憶部312に格納される特徴量を立体的に表した3次元モデルである。X軸およびY軸は、図5AのX軸およびY軸に対応し、Z軸方向はXY座標で特定される位置の画素の特徴量を示す。5Bに示すように、5Aに示す閉鎖領域(α)のように、X軸方向Y軸方向とも同程度の二次関数のカーブであれば、複数の注目画素間で輝度最小点がある画素の位置におおよそ集中し、閉鎖領域(α)に関する特徴量が大きく現れる。   5A shown in FIG. 5 is a three-dimensional model representing a part of a face image area having a closed area (α) in which the luminance value of each pixel increases from the inside to the outside of the area. The X axis and the Y axis indicate the positions of the face image in the X axis direction and the Y axis direction, and the Z axis direction indicates the luminance value of the pixel at the position specified by the XY coordinates. For example, an area corresponding to a nostril in the face image is in a state like a closed area (α). When the luminance variation of a certain pixel column in the X-axis direction included in the closed region (α) is approximated, for example, a quadratic function C1 shown in FIG. 4 described above is obtained. Similarly, when the luminance variation of a certain pixel column in the Y-axis direction included in the closed region (α) is approximated, for example, a quadratic function C2 shown in FIG. 4 described above is obtained. 5B shown in FIG. 5 is stored in the feature amount storage unit 312 when each pixel in the face image in the range indicated by 5A is scanned as the target pixel P1 by the extraction unit 322A, the calculation unit 322B, and the storage unit 322C. It is a three-dimensional model that represents stored feature values in a three-dimensional manner. The X axis and the Y axis correspond to the X axis and the Y axis in FIG. 5A, and the Z axis direction indicates the feature amount of the pixel at the position specified by the XY coordinates. As shown in 5B, as in the closed region (α) shown in 5A, if the curve has a quadratic function that is similar in both the X-axis direction and the Y-axis direction, the pixel having the minimum luminance point among a plurality of target pixels is displayed. The feature amount with respect to the closed region (α) appears to be largely concentrated at the position.

続いて、図6に示す6Aは、各画素の輝度値が領域の内側から外側へ向かうに従って大きくなっている溝状の領域(β)を有する顔画像の領域の一部を表す3次元モデルである。X軸およびY軸は、顔画像のX軸方向およびY軸方向の位置を示し、Z軸方向はXY座標で特定される位置の画素の輝度値を示す。例えば、顔画像の内、顔の皺や、線状のくぼみに相当する領域は、閉鎖領域(β)のような状態になる。図6に示す6Bは、上述した抽出部322A、計算部322B、格納部322Cにより、6Aに示される範囲の顔画像内の各画素を注目画素P1として走査した場合に、特徴量記憶部312に格納される特徴量を立体的に表した3次元モデルである。X軸およびY軸は、図6AのX軸およびY軸に対応し、Z軸方向はXY座標で特定される位置の画素の特徴量を示す。6Bに示すように、6Aに示す溝状の領域(β)のように、X軸方向とY軸方向との二次関数のカーブが類似していなければ、即ち、二次関数の二次の項の係数値が大きく相違すれば、複数の注目画素間で輝度最小点が複数の画素の位置に分散し、溝状の領域(β)の特徴量が現れる。   Subsequently, 6A shown in FIG. 6 is a three-dimensional model representing a part of a face image area having a groove-like area (β) in which the luminance value of each pixel increases from the inside to the outside of the area. is there. The X axis and the Y axis indicate the positions of the face image in the X axis direction and the Y axis direction, and the Z axis direction indicates the luminance value of the pixel at the position specified by the XY coordinates. For example, a region corresponding to a facial wrinkle or a linear depression in a face image is in a state like a closed region (β). 6B shown in FIG. 6 is stored in the feature amount storage unit 312 when each pixel in the face image in the range shown in 6A is scanned as the target pixel P1 by the extraction unit 322A, the calculation unit 322B, and the storage unit 322C. It is a three-dimensional model that represents stored feature values in a three-dimensional manner. The X axis and the Y axis correspond to the X axis and the Y axis in FIG. 6A, and the Z axis direction indicates the feature amount of the pixel at the position specified by the XY coordinates. As shown in 6B, as in the groove-like region (β) shown in 6A, if the curves of the quadratic function in the X-axis direction and the Y-axis direction are not similar, that is, the quadratic function quadratic function If the coefficient values of the terms are significantly different, the minimum luminance points are dispersed among the plurality of target pixels at the positions of the plurality of pixels, and the feature amount of the groove-like region (β) appears.

続いて、図7に示す7Aは、各画素の輝度値が領域の内側から外側へ向かうに従って大きくなっている局所的な閉鎖領域(γ)と、輝度が階段状に変化した領域とを有する顔画像の領域の一部を表す3次元モデルである。例えば、顔画像の内、鼻の穴に相当する領域である閉鎖領域(γ)にかかる位置に影が生じていると、図7Aのような状態になる。X軸およびY軸は、顔画像のX軸方向およびY軸方向の位置を示し、Z軸方向はXY座標で特定される位置の画素の輝度値を示す。図7に示す7Bは、上述した抽出部322A、計算部322B、格納部322Cにより、7Aに示される範囲の顔画像内の各画素を注注目画素P1として走査した場合に、特徴量記憶部312に格納される特徴量を立体的に表した3次元モデルである。X軸およびY軸は、図7AのX軸およびY軸に対応し、Z軸方向はXY座標で特定される位置の画素の特徴量を示す。7Bに示すように、輝度が階段状に変化した領域がある場合、つまり顔に光が一様に照射されておらず、影が生じている場合であっても、7Aに示す局所的な閉鎖領域(γ)のある画素の位置に、集中して特徴量が大きく現れる。   7A shown in FIG. 7 is a face having a local closed region (γ) in which the luminance value of each pixel increases from the inside to the outside of the region, and a region in which the luminance changes stepwise. It is a three-dimensional model representing a part of an image area. For example, when a shadow is generated at a position on the closed region (γ), which is a region corresponding to the nostril, in the face image, the state shown in FIG. 7A is obtained. The X axis and the Y axis indicate the positions of the face image in the X axis direction and the Y axis direction, and the Z axis direction indicates the luminance value of the pixel at the position specified by the XY coordinates. 7B is a feature amount storage unit 312 when each pixel in the face image in the range indicated by 7A is scanned as the attention pixel P1 by the extraction unit 322A, the calculation unit 322B, and the storage unit 322C described above. This is a three-dimensional model that three-dimensionally represents the feature amount stored in. The X axis and the Y axis correspond to the X axis and the Y axis in FIG. 7A, and the Z axis direction indicates the feature amount of the pixel at the position specified by the XY coordinates. As shown in 7B, even when there is a region where the luminance changes stepwise, that is, even when the face is not irradiated with light uniformly and a shadow is generated, the local closure shown in 7A A large amount of feature appears concentrated at the position of a pixel in the region (γ).

図5および図7に示すように、各画素の輝度値が領域の内側から外側へ向かうに従って大きくなっている局所的な閉鎖領域では、該閉鎖領域内に注目画素が存在する間は輝度最小点の位置が集中したり重複したりすることが多い。従って、輝度最小点が特定の画素またはその周囲に集中し、その結果、特徴量が大きく現れる。この理由を説明する。まず、図4の4Bに示すサイズを、顔画像内で鼻の穴が有する面積よりも狭く、かつ顔画像内の鼻の穴の中心位置を常に含むような大きさに設定する。すると、鼻の穴の領域内に注目画素と近傍画素とが存在する場合に、輝度最小点が重複する可能性を高くできる。よって、鼻の穴の領域内の特定画素の座標に特徴量が加算される結果、例えば、図5および図7に示すように、特定の画素付近に集中して特徴量が大きく現れる。   As shown in FIGS. 5 and 7, in the local closed region where the luminance value of each pixel increases from the inside to the outside of the region, the minimum luminance point is obtained while the target pixel exists in the closed region. In many cases, the positions of the centers are concentrated or overlapped. Therefore, the minimum luminance points are concentrated on a specific pixel or its surroundings, and as a result, a large amount of feature appears. The reason for this will be explained. First, the size shown in 4B of FIG. 4 is set to a size that is smaller than the area of the nostril in the face image and always includes the center position of the nostril in the face image. Then, when the target pixel and the neighboring pixel exist in the nostril region, the possibility that the minimum luminance point overlaps can be increased. Therefore, as a result of adding the feature quantity to the coordinates of the specific pixel in the nostril area, for example, as shown in FIGS. 5 and 7, the feature quantity appears concentrating near the specific pixel.

一方、図6に示すように、溝状の領域では、該領域内に注目画素や近傍画素が存在する場合でも、注目画素の位置が変わると、近似二次関数の底が重複せず、複数の画素の位置に分散して特徴量が現れていることが分かる。溝状の領域は、周囲と比べて輝度値が低い画素が、ある領域内に固まることがなく線上に続く為、注目画素の位置が変わるにつれて輝度最小点の位置も変化し、重複しにくい。このため、特徴量が分散して格納される結果、例えば、図6に示すように、複数の画素の位置に分散して特徴量が現れる。本発明では、鼻の穴領域の中央付近の輝度値は周辺画素より輝度値が低いことを利用して、特徴量の大きな画素を鼻の穴を検出する際の候補として検出する。従って、特徴量が大きく現れる画素の位置を特定することは、顔画像上で鼻の穴に相当する位置を特定することと同義と考えることができる。   On the other hand, as shown in FIG. 6, in the groove-shaped region, even when the target pixel and neighboring pixels exist in the region, if the position of the target pixel changes, the bottom of the approximate quadratic function does not overlap, It can be seen that feature quantities appear dispersed at the pixel positions. In the groove-shaped region, pixels having a lower luminance value than the surrounding region continue on the line without being solidified within a certain region. Therefore, the position of the minimum luminance point changes as the position of the pixel of interest changes, and is difficult to overlap. For this reason, as a result of storing the feature amounts in a distributed manner, for example, as shown in FIG. 6, the feature amounts appear at a plurality of pixel positions. In the present invention, utilizing the fact that the luminance value near the center of the nostril region is lower than the peripheral pixels, pixels having a large feature amount are detected as candidates for detecting the nostril. Therefore, it can be considered that specifying the position of a pixel having a large feature amount is synonymous with specifying the position corresponding to the nostril on the face image.

このように、上述した検出部322により実行される特徴点検出処理により、顔画像内で検出対象とする顔部品、例えば、鼻の穴である可能性が高い領域内の特定の画素に対応付けられる特徴量が大きくなる。このため、後述する決定部322Dは、この特徴量に基づいて、顔画像から鼻の穴の位置を決定することができる。   As described above, the feature point detection process executed by the detection unit 322 described above associates with a specific pixel in a region that is highly likely to be a face part to be detected in the face image, for example, a nostril. The feature quantity to be increased. Therefore, the determination unit 322D described later can determine the position of the nostril from the face image based on the feature amount.

決定部322Dは、特徴量記憶部312に記憶されている特徴量に基づいて、顔画像の鼻の位置を決定する。特徴量記憶部312から取得した特徴量を所定の閾値と比較して、特徴量が閾値よりも大きい画素の座標を特徴点の候補に決定する。そして、決定部322Dは、特徴点の候補に対応する画素を「白」で描画し、特徴点の候補以外の画素を「黒」で描画した特徴量画像を生成する。図8は、実施例1に係る特徴量画像の一例を示す図である。図8に示す8Aは顔画像を表し、図8に示す8Bは特徴量画像を表す。決定部322Dは、図8の8Aに示すような顔画像について、図8の8Bに示すような特徴量画像を生成する。   The determination unit 322D determines the position of the nose of the face image based on the feature amount stored in the feature amount storage unit 312. The feature amount acquired from the feature amount storage unit 312 is compared with a predetermined threshold value, and the coordinates of a pixel whose feature amount is larger than the threshold value are determined as feature point candidates. Then, the determination unit 322D generates a feature amount image in which pixels corresponding to the feature point candidates are drawn in “white” and pixels other than the feature point candidates are drawn in “black”. FIG. 8 is a diagram illustrating an example of the feature amount image according to the first embodiment. 8A shown in FIG. 8 represents a face image, and 8B shown in FIG. 8 represents a feature amount image. The determination unit 322D generates a feature amount image as illustrated in 8B of FIG. 8 for the face image as illustrated in 8A of FIG.

続いて、決定部322Dは、特徴量画像内に含まれる複数の特徴点の候補の中から、特徴量が最も大きい特徴点の候補を取得する。ここで、特徴点の候補として、単一の画素を扱っても良いし、特徴量を有する画素同士の位置が接している場合にグルーピングし、グルーピングした後の画素群を特徴点の候補として扱っても良い。顔画像の中で、周囲よりも輝度が小さく、線状でもない領域は鼻の穴の他には存在しないことが多いので、特徴量が最も大きい特徴点の候補は、鼻の穴のいずれか一方の位置に該当するとみなすことができる。続いて、決定部322Dは、特徴量が最も大きい特徴点の候補を鼻の穴の一方とした場合に、他方の鼻の穴になり得る特徴点の候補を特徴量画像内に含まれる複数の特徴点の候補の中から取得し、特徴点の候補の組合せを決定する。例えば、決定部322Dは、予め記憶しておいた画像上の鼻の穴の平均的な広さや穴同士の間隔、鼻の穴の輝度パターンなどを用いることにより特徴点の候補の組合せを決定する。そして、決定部322Dは、決定した特徴点の候補の組合せに含まれる各特徴点の候補を特徴点とし、該特徴点の位置を鼻の穴の位置に決定する。   Subsequently, the determination unit 322D acquires a feature point candidate having the largest feature amount from among a plurality of feature point candidates included in the feature amount image. Here, a single pixel may be treated as a feature point candidate, grouping is performed when pixels having feature amounts are in contact with each other, and a group of pixels after grouping is treated as a feature point candidate. May be. In the face image, there is often no area other than the nostril that has a lower brightness than the surrounding area, so the feature point candidate with the largest feature is one of the nostrils. It can be regarded as corresponding to one position. Subsequently, when the feature point candidate having the largest feature amount is set to one of the nostrils, the determination unit 322D includes a plurality of feature point candidates that can be the other nostril in the feature amount image. The feature point candidates are acquired from the feature point candidates, and combinations of feature point candidates are determined. For example, the determination unit 322D determines a combination of feature point candidates by using an average width of nostrils, an interval between holes, a luminance pattern of nostrils, and the like that are stored in advance. . Then, the determination unit 322D determines each feature point candidate included in the determined combination of feature point candidates as a feature point, and determines the position of the feature point as the position of the nostril.

あるいは、決定部322Dは、次のようにして鼻の位置を決定してもよい。例えば、決定部322Dは、特徴量記憶部312に記憶されている特徴量の中から、最も大きい特徴量に対応付けられた座標を取得する。続いて、決定部322Dは、取得した座標を一方の鼻の穴の位置とした場合に、他方の鼻の穴の位置になり得る座標に対応付けられた特徴量を特徴量記憶部312に記憶されている特徴量の中から1または複数取得し、取得した特徴量の中で最も大きい特徴量を特定する。このようにして、決定部322Dは、鼻の穴となる特徴点の組合せを決定し、各特徴点の座標を鼻の穴の位置に決定する。   Alternatively, the determination unit 322D may determine the position of the nose as follows. For example, the determination unit 322D acquires coordinates associated with the largest feature amount from the feature amounts stored in the feature amount storage unit 312. Subsequently, the determining unit 322D stores, in the feature amount storage unit 312, the feature amount associated with the coordinate that can be the position of the other nostril when the acquired coordinate is the position of one nostril. One or a plurality of feature amounts are acquired, and the largest feature amount among the acquired feature amounts is specified. In this way, the determination unit 322D determines the combination of feature points that become the nostrils, and determines the coordinates of each feature point as the position of the nostril.

判定部323は、決定部322Dにより決定された鼻の穴の位置に基づいて顔の向きを検出し、運転中の顔の向きとして適正であるか否かを判定する。例えば、判定部323は、決定部322Dが決定した鼻の穴の位置及び、予め記憶されていた鼻の穴の位置に対する平均的な目の位置を用いて、顔画像内のおおよその目の位置を取得する。そして、おおよその目の位置付近で、予め記憶されていた目の形状パターン検出や、エッジ検出により目の位置を特定する。ここで、鼻の穴の位置に基づいて特定された凡その目の位置付近の輝度平均に基づいて、目を検出するためのエッジ検出の際の閾値を設定しても構わない。   The determination unit 323 detects the orientation of the face based on the position of the nostril determined by the determination unit 322D, and determines whether or not the orientation of the face during driving is appropriate. For example, the determination unit 323 uses the average eye position with respect to the position of the nostril determined by the determination unit 322D and the position of the nostril stored in advance to approximate the position of the eye in the face image. To get. Then, in the vicinity of the approximate eye position, the eye position is specified by eye shape pattern detection or edge detection stored in advance. Here, a threshold value for edge detection for detecting the eyes may be set based on the luminance average in the vicinity of the position of the approximate eye specified based on the position of the nostril.

続いて、判定部323は、継時的に撮影装置100により撮影される顔画像内の鼻の穴の位置および目の位置を捕捉し、鼻の穴の位置および目の位置の移動量を取得する。続いて、鼻の穴の位置および目の位置の移動量から顔の形状を復元し、鼻の穴の位置、目の位置および顔の形状から顔の向きを検出する。続いて、判定部323は、顔の向きの追跡を開始し、運転中の顔の向きとして適正であるか否かの判定処理を実行する。例えば、顔の向きが正面から所定角度以上逸れた場合に、適正ではないと判定することが考えられる。ここで、判定部323は、鼻の穴の位置のみ、もしくは鼻の穴の位置と目の位置のみを継時的に捕捉し、その位置が著しく変化した場合や画像上の所定の範囲から外れた場合に、余所見をした、すなわち顔の向きが適正ではないと判定することもできる。判定の結果、適正である場合には、判定部323は、報知停止指示を報知部324に送る。その結果、報知部324により報知がなされた状態が継続していた場合には、報知が停止される。報知部324により報知がなされていなかった状態であれば、そのまま報知を行わない状態を継続する。一方、判定の結果、不適正である場合には、判定部323は、顔の向きが不適正である旨の警告の報知指示を報知部324に送る。   Subsequently, the determination unit 323 captures the position of the nostril and the eye position in the face image continuously captured by the image capturing apparatus 100, and acquires the movement amount of the nostril position and the eye position. To do. Subsequently, the face shape is restored from the movement amount of the nostril position and the eye position, and the face orientation is detected from the nostril position, the eye position, and the face shape. Subsequently, the determination unit 323 starts tracking the face direction, and executes a process for determining whether or not the face direction during driving is appropriate. For example, it may be determined that the face is not appropriate when the face deviates from the front by a predetermined angle or more. Here, the determination unit 323 captures only the position of the nostril or only the position of the nostril and the position of the eyes over time, and when the position changes significantly or deviates from a predetermined range on the image. In such a case, it can also be determined that a look has been made, that is, the face orientation is not appropriate. As a result of the determination, if it is appropriate, the determination unit 323 sends a notification stop instruction to the notification unit 324. As a result, when the state where the notification is made by the notification unit 324 continues, the notification is stopped. If the notification unit 324 is not notified, the state where the notification is not performed is continued. On the other hand, if the determination result is inappropriate, the determination unit 323 sends a warning notification instruction to the notification unit 324 that the face orientation is inappropriate.

報知部324は、上述した判定部323からの指示に従って、警告の報知および警告の報知停止を行う。報知部324は、判定部323から警告の報知指示があると、余所見を注意する警告を一定間隔で繰り返し報知する。また、報知部324は、判定部323から警告の報知停止指示があると、警告の報知を停止する。   The notification unit 324 performs warning notification and warning stop according to the instruction from the determination unit 323 described above. When there is a warning notification instruction from the determination unit 323, the notification unit 324 repeatedly reports a warning that warns about the observation at regular intervals. In addition, when there is a warning stop instruction from the determination unit 323, the notification unit 324 stops the warning notification.

[画像処理装置による処理(実施例1)]
続いて、図9および図10を用いて、実施例1に係る画像処理装置による処理の流れを説明する。図9は、実施例1に係る画像処理装置による処理の全体的な流れを示す図である。図10は、実施例1に係る画像処理装置による特徴点検出処理の流れを示す図である。
[Processing by Image Processing Apparatus (Example 1)]
Subsequently, the flow of processing by the image processing apparatus according to the first embodiment will be described with reference to FIGS. 9 and 10. FIG. 9 is a diagram illustrating an overall flow of processing by the image processing apparatus according to the first embodiment. FIG. 10 is a diagram illustrating a flow of feature point detection processing by the image processing apparatus according to the first embodiment.

まず、図9を用いて、画像処理装置300による処理の全体的な流れを説明する。なお、画像処理装置300は、例えば、車両1が有する点火装置の作動に応じて図9の処理を開始する。制御部320による判定により、もしくは他の装置からの指示信号により、画像処理装置300にて処理を開始するものと判定された場合には(ステップS101,YES)、検出部322は特徴点検出処理を実行する(ステップS102)。なお、車両1が有する点火装置の作動していない場合には、画像処理装置300は、ステップS101の判定結果をNoとして、ステップS101の判定を繰り返す。もしくは、点火装置が作動していない場合には、画像処理装置3も起動していない場合もある。また、点火装置が作動しているだけでなく、車両1の走行速度が所定以上になったことを制御部320が検出した場合に、S101でYESと判定しても良い。   First, the overall flow of processing by the image processing apparatus 300 will be described with reference to FIG. Note that the image processing device 300 starts the processing of FIG. 9 in accordance with, for example, the operation of the ignition device of the vehicle 1. If it is determined by the control unit 320 or an instruction signal from another device that the image processing apparatus 300 starts processing (YES in step S101), the detection unit 322 performs feature point detection processing. Is executed (step S102). Note that when the ignition device of the vehicle 1 is not operating, the image processing apparatus 300 repeats the determination in step S101 with the determination result in step S101 as No. Alternatively, when the ignition device is not operating, the image processing device 3 may not be activated. Further, not only the ignition device is operating, but also when the control unit 320 detects that the traveling speed of the vehicle 1 has reached a predetermined value or more, it may be determined as YES in S101.

続いて、決定部322Dは、ステップS102の特徴点検出処理の検出結果に基づいて特徴量画像を生成し(ステップS103)、生成した特徴量画像を元に、顔画像の鼻の穴の位置を検出する(ステップS104)。決定部322Dは、上述したようにステップS103を行わずに、ステップS104において、鼻の穴の位置に相当する特徴点の位置を特定しても良い。判定部323は、鼻の穴の位置から運転者の顔の向きを検出し(ステップS105)、顔の向きの追跡を開始し(ステップS106)、運転者の顔の向きが不適正であるか否かの判定処理を開始する(ステップS107)。判定の結果、運転者の顔の向きが不適正である場合には(ステップS107,YES)、判定部323は、警告の報知指示を報知部324に送出する(ステップS108)。続いて、制御部320は次の処理フレームが入力されたかどうかを判定する(ステップS109)。判定の結果、次の処理フレームが入力された場合には(ステップS109,YES)、制御部320は、処理の終了判定を実行する(ステップS110)。判定の結果、処理を終了する場合には(ステップS110,YES)、処理を終了する。一方、処理を終了しない場合には(ステップS110,NO)、上述したステップS102に戻り特徴点抽出処理を実行する。   Subsequently, the determination unit 322D generates a feature amount image based on the detection result of the feature point detection process in step S102 (step S103), and based on the generated feature amount image, determines the position of the nostril of the face image. It detects (step S104). The determination unit 322D may specify the position of the feature point corresponding to the position of the nostril in step S104 without performing step S103 as described above. The determination unit 323 detects the driver's face orientation from the position of the nostril (step S105), starts tracking the face orientation (step S106), and determines whether the driver's face orientation is inappropriate. The determination process of NO is started (step S107). If the result of determination is that the driver's face orientation is inappropriate (step S107, YES), the determination unit 323 sends a warning notification instruction to the notification unit 324 (step S108). Subsequently, the control unit 320 determines whether or not the next processing frame has been input (step S109). As a result of the determination, when the next processing frame is input (step S109, YES), the control unit 320 performs a process end determination (step S110). As a result of the determination, if the process is to be ended (step S110, YES), the process is ended. On the other hand, when the process is not terminated (step S110, NO), the process returns to the above-described step S102 to execute the feature point extraction process.

ここで、ステップS107の説明に戻る。判定の結果、運転者の顔の向きが不適正ではない場合には(ステップS107,NO)、判定部323は、警告報知指示を送出済みであるか否かを判定する(ステップS111)。判定の結果、送出済みである場合には(ステップS111,YES)、判定部323は、警告報知停止指示を報知部324に送出する(ステップS112)。続いて、制御部320は、上述したステップS109に戻り、次の画像フレームの入力を待機する。ここで、ステップS109の説明に戻る。制御部320は、判定の結果、次の処理フレームが入力されていない場合には(ステップS109,NO)、次の処理フレームの入力を待機する。なお、制御部320は、上述したステップS110にて、処理を終了すると判定するまで、入力される処理フレームについて上述したステップS101〜ステップS112までの処理を繰り返す。   Here, the description returns to step S107. If the result of determination is that the driver's face orientation is not inappropriate (step S107, NO), the determination unit 323 determines whether or not a warning notification instruction has been sent (step S111). As a result of the determination, if the transmission has been completed (step S111, YES), the determination unit 323 transmits a warning notification stop instruction to the notification unit 324 (step S112). Subsequently, the control unit 320 returns to step S109 described above and waits for input of the next image frame. Here, the description returns to step S109. If the result of determination is that the next processing frame has not been input (step S109, NO), the control unit 320 waits for input of the next processing frame. Control unit 320 repeats the processing from step S101 to step S112 described above for the input processing frame until it is determined in step S110 that the processing is to be terminated.

続いて、図10を用いて、画像処理装置300による特徴点検出処理の流れを説明する。図10に示すように、抽出部322Aは、画像記憶部311から顔画像を取得し、取得した顔画像に含まれる画素を一つ、注目画素として選択する(ステップS201)。続いて、抽出部322Aは、注目画素の輝度値が近傍画素の輝度値以下であるかを判定する(ステップS202)。判定の結果、注目画素の輝度値が近傍画素の輝度値以下である場合には(ステップS202,Yes)、抽出部322Aは、注目画素と近傍画素との輝度値と座標位置を顔画像から抽出する(ステップS203)。   Next, a flow of feature point detection processing by the image processing apparatus 300 will be described with reference to FIG. As illustrated in FIG. 10, the extraction unit 322A acquires a face image from the image storage unit 311 and selects one pixel included in the acquired face image as a target pixel (step S201). Subsequently, the extraction unit 322A determines whether the luminance value of the target pixel is equal to or lower than the luminance value of the neighboring pixels (Step S202). As a result of the determination, when the luminance value of the target pixel is equal to or lower than the luminance value of the neighboring pixel (step S202, Yes), the extraction unit 322A extracts the luminance value and the coordinate position of the target pixel and the neighboring pixel from the face image. (Step S203).

続いて、計算部322Bは、抽出部322Aにより抽出された注目画素および近傍画素に基づいてX軸方向の近似2次関数を求める(ステップS204)。続いて、計算部322Bは、抽出部322Aにより抽出された注目画素および近傍画素に基づいてY軸方向の近似2次関数を求める(ステップS205)。なお、ステップS204とS205とは、どちらを先に実行しても構わない。   Subsequently, the calculation unit 322B obtains an approximate quadratic function in the X-axis direction based on the target pixel and neighboring pixels extracted by the extraction unit 322A (step S204). Subsequently, the calculation unit 322B obtains an approximate quadratic function in the Y-axis direction based on the target pixel and neighboring pixels extracted by the extraction unit 322A (step S205). Note that either step S204 or S205 may be executed first.

続いて、格納部322Cは、各2次関数が最小値をとる位置により特定される座標を取得し(ステップS206)、2次関数の2次の係数値を比較して小さい方の係数値を特徴量として取得する(ステップS207)。続いて、格納部322Cは、ステップS206で取得した座標に対応付けて、ステップS207で特徴量として取得した係数値を格納する(ステップS208)。続いて、格納部322Cは、顔画像内に含まれる処理対象とすべき全画素を注目画素として選択完了したか否かを判定する(ステップS209)。判定の結果、全画素を選択完了していない場合には(ステップS209,No)、格納部322Cは、注目画素として取得する画素の位置を更新して、上述したステップS201に処理を戻す。一方、判定の結果、全画素を選択完了している場合には(ステップS209,Yes)、格納部322Cは、特徴点検出処理を終了する。なお、上述したステップS208において、格納部322Cは、同一の輝度最小点の座標に対応付けて特徴量が格納済みである場合には、格納済みの特徴量に対して今回の特徴量を加算して更新する。   Subsequently, the storage unit 322C acquires the coordinates specified by the position at which each quadratic function takes the minimum value (step S206), compares the quadratic coefficient values of the quadratic function, and determines the smaller coefficient value. Obtained as a feature amount (step S207). Subsequently, the storage unit 322C stores the coefficient value acquired as the feature amount in step S207 in association with the coordinates acquired in step S206 (step S208). Subsequently, the storage unit 322C determines whether or not all the pixels to be processed included in the face image have been selected as the target pixel (step S209). As a result of the determination, if all the pixels have not been selected (No at Step S209), the storage unit 322C updates the position of the pixel acquired as the target pixel and returns the process to Step S201 described above. On the other hand, as a result of the determination, if all the pixels have been selected (step S209, Yes), the storage unit 322C ends the feature point detection process. In step S208 described above, the storage unit 322C adds the current feature amount to the stored feature amount when the feature amount has been stored in association with the coordinate of the same minimum luminance point. Update.

ここで、ステップS202の説明に戻る。判定の結果、注目画素の輝度値が近傍画素の輝度値よりも大きい場合には、抽出部322Aは、ステップS202の判定結果をNoとして、注目画素として取得する画素の位置を更新して、ステップS201に処理を戻す。   Here, the description returns to step S202. As a result of the determination, if the luminance value of the target pixel is larger than the luminance value of the neighboring pixel, the extraction unit 322A sets the determination result in step S202 to No, updates the position of the pixel acquired as the target pixel, The process returns to S201.

続いて、図11〜図13を参照して、実施例1に係る画像処理装置の処理結果を説明する。図11は、実施例1に係る画像処理装置の処理結果を説明するための図である。図12は、実施例1に係るコントラストの低下した画像に対する画像処理装置による処理結果を説明するための図である。図13は、実施例1に係る照射光の強度が変化した画像に対する画像処理装置による処理結果を説明するための図である。なお、図11〜図13には、画像処理装置300による処理結果として、顔画像と特徴量画像と特徴量との関係を示している。   Next, processing results of the image processing apparatus according to the first embodiment will be described with reference to FIGS. FIG. 11 is a diagram for explaining the processing result of the image processing apparatus according to the first embodiment. FIG. 12 is a diagram for explaining a processing result by the image processing apparatus for an image with reduced contrast according to the first embodiment. FIG. 13 is a diagram for explaining a processing result by the image processing apparatus for an image in which the intensity of irradiation light according to the first embodiment is changed. 11 to 13 show the relationship among the face image, the feature amount image, and the feature amount as a processing result by the image processing apparatus 300. FIG.

図11に示す11Aは顔画像を表す。図11に示す11Bは11Aに対応する特徴量画像を表す。図11に示す11Cは顔画像11Aと特徴量画像11Bと特徴量の格納結果とを重畳させた図を表す。図11に示す11DはY軸上に投影した特徴量の格納結果を表し、特徴量が大きいほどX軸方向の値が大きく示されている。説明の便宜上、特徴量をY軸上に投影しているので、同一のY座標をもつ複数の画素に対する特徴量が加算された状態を示している。11Cに示すように、顔画像11Aに対して特徴量画像11Bを重畳すると、顔画像11Aに映し出された鼻の穴の位置と、特徴量画像11B内に描画された特徴点の位置とが一致する。また、11Cに示すように、顔画像11Aに対して特徴量の格納結果11Dを重畳すると、鼻の穴の位置に対応する位置に特徴点のピークが現れている。11Bにおいては、例えば、鼻の穴に加えて、鼻翼の影や目尻、眉の影なども現れている。しかし、11Dに示されているように、鼻の穴以外の特徴は、特徴量が大きくないので、鼻の穴に相当する特徴とは区別されうる。   11A shown in FIG. 11 represents a face image. 11B shown in FIG. 11 represents a feature amount image corresponding to 11A. 11C shown in FIG. 11 is a diagram in which the face image 11A, the feature amount image 11B, and the feature amount storage result are superimposed. 11D shown in FIG. 11 represents the storage result of the feature amount projected on the Y-axis, and the value in the X-axis direction is shown larger as the feature amount is larger. For convenience of explanation, since the feature amount is projected on the Y-axis, a state is shown in which feature amounts for a plurality of pixels having the same Y coordinate are added. As illustrated in 11C, when the feature amount image 11B is superimposed on the face image 11A, the position of the nostril projected on the face image 11A matches the position of the feature point drawn in the feature amount image 11B. To do. Also, as shown in 11C, when the feature value storage result 11D is superimposed on the face image 11A, a peak of feature points appears at a position corresponding to the position of the nostril. In 11B, for example, in addition to the nostrils, shadows of the nose wings, shadows of the eyes, and shadows of the eyebrows also appear. However, as shown in 11D, the features other than the nostrils can be distinguished from the features corresponding to the nostrils because the feature amount is not large.

図12に示す12Aは、例えば、図11に示す11Aよりもコントラストの低下した顔画像を表す。例えば、薄暗い環境下で顔画像を撮影した場合が相当する。図12に示す12Bは12Aに対応する特徴量画像を表す。図12に示す12Cは顔画像と特徴量画像と特徴量の格納結果とを重畳させた図を表す。図12に示す12DはY軸上に投影した特徴量の格納結果を表し、特徴量が大きいほどX軸方向の値が大きく示されている。説明の便宜上、特徴量をY軸上に投影しているので、同一のY座標をもつ複数の画素に対する特徴量が加算された状態を示している。12Cに示すように、顔画像12Aに対して特徴量画像12Bを重畳すると、顔画像12Aに映し出された鼻の穴の位置と、特徴量画像12B内に描画された特徴点の位置とが一致する。また、12Cに示すように、顔画像12Aに対して特徴量の格納結果12Dを重畳すると、鼻の穴の位置に対応する位置に特徴点のピークが現れている。顔画像の全体的なコントラストが低い場合でも、12Dに示されているように、鼻の穴に相当する特徴には、比較して大きな特徴量が対応付けられているので、鼻の穴に相当する特徴と他の特徴とは区別されうる。   12A shown in FIG. 12 represents, for example, a face image with a lower contrast than 11A shown in FIG. For example, it corresponds to a case where a face image is taken in a dim environment. 12B shown in FIG. 12 represents a feature amount image corresponding to 12A. 12C shown in FIG. 12 represents a diagram in which a face image, a feature amount image, and a feature amount storage result are superimposed. 12D shown in FIG. 12 represents the storage result of the feature amount projected on the Y-axis, and the value in the X-axis direction is shown larger as the feature amount is larger. For convenience of explanation, since the feature amount is projected on the Y-axis, a state is shown in which feature amounts for a plurality of pixels having the same Y coordinate are added. 12C, when the feature amount image 12B is superimposed on the face image 12A, the position of the nostril projected on the face image 12A matches the position of the feature point drawn in the feature amount image 12B. To do. Further, as shown in 12C, when the feature amount storage result 12D is superimposed on the face image 12A, a peak of the feature point appears at a position corresponding to the position of the nostril. Even when the overall contrast of the face image is low, as shown in 12D, the feature corresponding to the nostril is associated with a large feature amount in comparison with the feature corresponding to the nostril. It can be distinguished from other features.

図13に示す13Aは、例えば、図11に示す11Aよりも照射光の強度が変化した顔画像を表す。例えば、顔の一部に影がかかっている状態で撮影した場合が相当する。図13に示す13Bは13Aに対応する特徴量画像を表す。図13に示す13Cは顔画像と特徴量画像と特徴量の格納結果とを重畳させた図を表す。図13に示す13DはY軸上に投影した特徴量の格納結果を表し、特徴量が大きいほどX軸方向の値が大きく示されている。説明の便宜上、特徴量をY軸上に投影しているので、同一のY座標をもつ複数の画素に対する特徴量が加算された状態を示している。13Cに示すように、顔画像13Aに対して特徴量画像13Bを重畳すると、顔画像13Aに映し出された鼻の穴の位置と、特徴量画像13B内に描画された特徴点の位置とが一致する。また、13Cに示すように、顔画像13Aに対して特徴量の格納結果13Dを重畳すると、鼻の穴の位置に対応する位置に特徴点のピークが現れている。顔画像の一部に影などの影響により部分的に輝度が低い領域がある場合でも、13Dに示されているように、鼻の穴に相当する特徴には、他の特徴と比較して大きな特徴量が対応付けられている、鼻の穴に相当する特徴と他の特徴とは区別されうる。   13A shown in FIG. 13 represents, for example, a face image in which the intensity of irradiation light has changed from 11A shown in FIG. For example, it corresponds to a case where a picture is taken with a shadow on a part of the face. 13B shown in FIG. 13 represents a feature amount image corresponding to 13A. 13C shown in FIG. 13 represents a diagram in which a face image, a feature amount image, and a feature amount storage result are superimposed. 13D shown in FIG. 13 represents the storage result of the feature amount projected on the Y-axis, and the value in the X-axis direction is shown larger as the feature amount is larger. For convenience of explanation, since the feature amount is projected on the Y-axis, a state is shown in which feature amounts for a plurality of pixels having the same Y coordinate are added. As illustrated in 13C, when the feature amount image 13B is superimposed on the face image 13A, the position of the nostril projected on the face image 13A matches the position of the feature point drawn in the feature amount image 13B. To do. Further, as shown in 13C, when the storage result 13D of the feature amount is superimposed on the face image 13A, a peak of the feature point appears at a position corresponding to the position of the nostril. Even when a part of the face image has a region where the luminance is partially low due to the influence of a shadow or the like, the feature corresponding to the nostril is larger than the other feature as shown in 13D. A feature corresponding to a feature hole and a feature corresponding to a nostril can be distinguished from other features.

[実施例1による効果]
上述してきたように、実施例1に係る画像処理装置300は、顔画像に含まれる各画素の輝度値に基づいて、各画素の輝度値が領域の内側から外側へ向かうに従って大きくなっている可能性が高い領域内に位置する注目画素およびその近傍画素を取得する。続いて、画像処理装置300は、近傍画素によって特定される範囲内で、輝度が最も小さい可能性がある画素の座標に対応付けて所定の特徴量を格納していく。そして、画像処理装置300は、最も高い特徴量に対応付けられた座標を、例えば、顔画像内に映し出された鼻の穴の領域に含まれる画素として検出する。従って、実施例1によれば、画像に含まれるエッジではなく、輝度の変化の状態に基づいて位置の検出を行うので、画像から検出対象を検出する場合の外光や撮影装置の特性の影響による検出精度の低下を防止できる。言い換えれば、上述した図11〜図13にも示すように、顔に照射される光の変化、画像コントラストの低下や画像ボケなどに対して頑健な顔部品の検出を実現できる。
[Effects of Example 1]
As described above, in the image processing apparatus 300 according to the first embodiment, the luminance value of each pixel can be increased from the inside to the outside of the region based on the luminance value of each pixel included in the face image. A pixel of interest and its neighboring pixels that are located in a region having high characteristics are acquired. Subsequently, the image processing apparatus 300 stores a predetermined feature amount in association with the coordinates of the pixel having the lowest luminance within the range specified by the neighboring pixels. Then, the image processing apparatus 300 detects the coordinate associated with the highest feature amount as, for example, a pixel included in a nostril region projected in the face image. Therefore, according to the first embodiment, since the position is detected based on the state of luminance change, not the edge included in the image, the influence of the external light and the characteristics of the imaging device when detecting the detection target from the image It is possible to prevent a decrease in detection accuracy due to. In other words, as shown in FIGS. 11 to 13 described above, it is possible to realize detection of face parts that is robust against changes in the light applied to the face, a reduction in image contrast, image blur, and the like.

また、実施例1では、高速化のために、近傍画素よりも輝度値が大きくない画素に対してのみ、近似関数の算出を行う。このため、実施例1によれば、各画素の輝度値が領域の内側から外側へ向かうに従って大きくなっている可能性のある領域から効率的に処理を行うことができる。   In the first embodiment, the approximation function is calculated only for a pixel whose luminance value is not larger than that of neighboring pixels in order to increase the speed. For this reason, according to the first embodiment, it is possible to efficiently perform processing from an area in which the luminance value of each pixel may increase as it goes from the inside to the outside of the area.

また、実施例1では、注目画素と近傍画素との間のサイズを、顔画像内で鼻の穴が有する幅よりも狭く、かつ該幅の半分よりも大きな大きさに設定する。これは、顔画像に映し出された鼻の穴の領域内に注目画素および近傍画素が含まれる場合には、顔画像内に映し出された鼻の穴の中心位置および中心位置の近傍に輝度最小点が決定されやすくなるように考慮したものである。このようにして、実施例1では、検出対象とすべき領域の内に注目画素および近傍画素が含まれる場合に、輝度最小点が重複する可能性を高める。このため、実施例1によれば、鼻の穴の領域内の特定画素に対応する座標の特徴量を大きくできる。   In the first embodiment, the size between the target pixel and the neighboring pixels is set to be smaller than the width of the nostril in the face image and larger than half of the width. If the target pixel and neighboring pixels are included in the nostril area projected in the face image, the minimum luminance point is in the vicinity of the center position of the nostril projected in the face image and the center position. Is considered to be easily determined. In this way, in the first embodiment, when the target pixel and neighboring pixels are included in the region to be detected, the possibility that the minimum luminance point overlaps is increased. For this reason, according to Example 1, the feature-value of the coordinate corresponding to the specific pixel in the nostril area | region can be enlarged.

また、実施例1では、近傍画素で挟まれるX軸方向およびY軸方向で、近傍画素と注目画素との輝度変動を近似する2次関数をそれぞれ求め、各2次関数が最小値をとる位置に基づいて、輝度値が最も小さいと推定される画素を求める。ここで、近傍画素よりも輝度値の低い注目画素のみを近似関数の算出対象とすれば、近傍画素で挟まれるX座標およびY座標の範囲で輝度値が最も小さいと推定される画素を求められることになる。このため、実施例1によれば、近傍画素で挟まれるX座標およびY座標の範囲内の輝度最小点を簡易に求めることができる。また、画素の輝度値が領域の内側から外側へ向かうに従って大きくなっている領域の範囲を特定せずに、即ち、エッジ抽出などの処理を行わずに、領域内の輝度最小点を求めることができる。   In the first embodiment, a quadratic function that approximates the luminance variation between the neighboring pixel and the target pixel is obtained in the X-axis direction and the Y-axis direction between the neighboring pixels, and each quadratic function has a minimum value. Based on the above, the pixel whose luminance value is estimated to be the smallest is obtained. Here, if only the target pixel having a lower luminance value than the neighboring pixel is set as the approximation function calculation target, the pixel estimated to have the smallest luminance value in the range of the X coordinate and the Y coordinate sandwiched between the neighboring pixels can be obtained. It will be. For this reason, according to the first embodiment, the minimum luminance point within the range of the X coordinate and the Y coordinate sandwiched between neighboring pixels can be easily obtained. Further, it is possible to obtain the minimum luminance point in the region without specifying the range of the region in which the luminance value of the pixel increases from the inside to the outside of the region, that is, without performing processing such as edge extraction. it can.

また、実施例1では、輝度最小点に対応する画素の座標に対応付けて、2次関数の2次の項の係数値のうち小さい方の係数値を特徴量として格納する。このため、実施例1によれば、例えば、上述した図6に示す顔画像内の溝状の領域については、格納される特徴量を低く抑えることができる。なお、係数値を特徴量として格納する場合に限らず、輝度最小点ごとに所定の度数を1度数ずつ格納してもよい。   In the first embodiment, the smaller coefficient value among the coefficient values of the quadratic term of the quadratic function is stored as a feature amount in association with the coordinates of the pixel corresponding to the minimum luminance point. For this reason, according to the first embodiment, for example, in the groove-shaped region in the face image shown in FIG. Note that the coefficient value is not limited to being stored as a feature amount, and a predetermined frequency may be stored for each minimum luminance point.

また、実施例1では、エッジの抽出のように、決めうちの閾値による処理を行わないので、鼻の穴のように、検出対象となる顔部品の特徴点を画像のコントラストが低い場合でも顔画像内に埋もれさせてしまう恐れがなく、顔部品の検出精度を高くできる。   Further, in the first embodiment, the processing based on the determined threshold is not performed as in the case of edge extraction, so that the feature point of the face part to be detected can be detected even when the image contrast is low, such as a nostril. There is no fear of being buried in the image, and the detection accuracy of the face part can be increased.

なお、実施例1では、各画素の輝度値が領域の内側から外側へ向かうに従って大きくなっている領域内の画素位置を画像から検出することで、例えば、画像が人の顔を撮影したものであれば、鼻の穴を検出できる場合を説明した。これに限定されるものではなく、鼻の穴のような輝度曲面を有する顔部品、例えば、耳の穴などを検出することも可能である。当然ながら、顔部品でなくても、画像上で同様の輝度曲面を呈する領域であれば、検出することが可能である。   In the first embodiment, the pixel position in the region where the luminance value of each pixel increases from the inside to the outside of the region is detected from the image. The case where a nostril can be detected is described. However, the present invention is not limited to this, and it is also possible to detect a facial part having a luminance curved surface such as a nostril, for example, an ear hole. Naturally, even if it is not a face part, it can be detected as long as it is a region exhibiting the same luminance curved surface on the image.

なお、実施例1では、例えば、図4に示す2次関数C1が最小値をとる位置と、2次関数C2が最小値をとる位置とに基づいて、輝度値が最小となる画素の位置を推定する場合を説明したが、これに限定されるものではない。例えば、図4に示す注目画素P1に対して、近傍画素P2からP3の範囲にある画素列の中で輝度値が最小である画素を取得し、この画素のX座標を取得する。同様に、注目画素P1に対して、近傍画素P4からP5の範囲にある画素列の中で輝度値が最小である画素を取得し、この画素のY座標を取得する。そして、このX座標およびY座標で特定される画素を、4つの近傍画素で特定される領域内で輝度値が最小となる可能性のある画素としてもよい。   In the first embodiment, for example, based on the position where the quadratic function C1 shown in FIG. 4 takes the minimum value and the position where the quadratic function C2 takes the minimum value, the position of the pixel having the minimum luminance value is determined. Although the estimation has been described, the present invention is not limited to this. For example, for the pixel of interest P1 shown in FIG. 4, the pixel having the minimum luminance value in the pixel column in the range of the neighboring pixels P2 to P3 is acquired, and the X coordinate of this pixel is acquired. Similarly, with respect to the target pixel P1, a pixel having the minimum luminance value in the pixel row in the range from the neighboring pixels P4 to P5 is acquired, and the Y coordinate of this pixel is acquired. Then, the pixel specified by the X coordinate and the Y coordinate may be a pixel whose luminance value may be minimized within the area specified by the four neighboring pixels.

また、実施例1では、各画素の輝度値が領域の内側から外側へ向かうに従って大きくなっている領域、言い換えれば輝度曲面において緩やかに窪んだ領域内の画素位置を検出する方法を説明した。当然ながら、顔画像における鼻の穴の検出に限らず、各画素の輝度値が領域の内側から外側へ向かうに従って大きくなっている領域であれば、顔以外のものを被写体とした画像であっても適用することができる。また、上述した実施例1と同様の方法で、例えば、各画素の輝度値が領域の内側から外側へ向かうに従って徐々に小さくなっている領域、言い換えれば、輝度曲面において盛り上がった領域内の画素位置を検出することもできる。例えば、カメラ画像内に映し出されたLED(Light Emitting Diode)の光の位置を検出する場合などに利用できる。各車載カメラで撮影された各カメラ画像内のLEDの光の位置を検出できれば、この位置を利用して、例えば、車載カメラのキャリブレーションを実行できる。   In the first embodiment, the method of detecting the pixel position in the region where the luminance value of each pixel increases from the inside to the outside of the region, in other words, in the region where the luminance curved surface is gently depressed. Of course, the image is not limited to the detection of a nostril in a face image, but is an image with a subject other than the face as long as the luminance value of each pixel increases from the inside to the outside of the region. Can also be applied. Further, in the same manner as in the first embodiment described above, for example, the pixel position in a region where the luminance value of each pixel gradually decreases as it goes from the inside to the outside of the region, in other words, in the region that rises on the luminance curved surface. Can also be detected. For example, it can be used for detecting the position of light of an LED (Light Emitting Diode) projected in a camera image. If the position of the LED light in each camera image photographed by each in-vehicle camera can be detected, for example, the in-vehicle camera can be calibrated using this position.

また、実施例1において、輝度曲面において窪んだ領域内の画素位置を検出するとともに、輝度曲面において盛り上がった領域内の画素位置を合わせて検出するようにしてもよい。例えば、顔画像内に映し出された鼻の頭は、ある画素を中心に外側に向かうに従って輝度が徐々に小さくなっている領域である可能性が高い。よって、例えば、仮に、特徴量画像内の特徴点から鼻の穴の位置の候補となる組合せが複数検出された場合に、輝度が盛り上がった領域の一つを鼻の頭と仮定することで、鼻の穴の位置を特定できる場合がある。   In the first embodiment, the pixel position in the recessed area on the luminance curved surface may be detected, and the pixel position in the region raised on the luminance curved surface may be detected together. For example, the head of the nose projected in the face image is likely to be a region where the luminance gradually decreases toward the outside centering on a certain pixel. Therefore, for example, if a plurality of combinations that are candidates for the position of the nostril are detected from the feature points in the feature amount image, it is assumed that one of the areas where the brightness has risen is the head of the nose, In some cases, the position of the nostril can be identified.

以下、本願の開示する画像処理装置および画像処理プログラムの他の実施形態を説明する。   Hereinafter, other embodiments of the image processing apparatus and the image processing program disclosed in the present application will be described.

(1)装置構成等
例えば、図2に示した画像処理装置300の機能ブロックの構成は概念的なものであり、必ずしも物理的に図示の如く構成されていることを要しない。例えば、図2に示した検出部322の抽出部322A、計算部322Bおよび格納部322Cを機能的または物理的に統合してもよい。このように、画像処理装置300の機能ブロックの全部または一部を、各種の負荷や使用状況などに応じて、任意の単位で機能的または物理的に分散・統合して構成することができる。
(1) Apparatus Configuration, etc. For example, the functional block configuration of the image processing apparatus 300 shown in FIG. 2 is conceptual and does not necessarily need to be physically configured as illustrated. For example, the extraction unit 322A, the calculation unit 322B, and the storage unit 322C of the detection unit 322 illustrated in FIG. 2 may be integrated functionally or physically. As described above, all or a part of the functional blocks of the image processing apparatus 300 can be configured to be functionally or physically distributed / integrated in arbitrary units according to various loads or usage conditions.

(2)画像処理プログラム
また、上述の実施例1にて説明した画像処理装置300により実行される各種の処理は、例えば、車両1に搭載されるECU(Electronic Control Unit)に実装されたマイコンなどの電子機器で所定のプログラムを実行することによって実現することもできる。そこで、以下では、図14を用いて、実施例1にて説明した画像処理装置300により実行される処理と同様の機能を実現する画像処理プログラムを実行する電子機器の一例を説明する。図14は、画像処理プログラムを実行する電子機器の一例を示す図である。
(2) Image processing program Various processes executed by the image processing apparatus 300 described in the first embodiment are, for example, a microcomputer mounted on an ECU (Electronic Control Unit) mounted on the vehicle 1 This can also be realized by executing a predetermined program on the electronic device. In the following, an example of an electronic apparatus that executes an image processing program that realizes the same function as the process executed by the image processing apparatus 300 described in the first embodiment will be described with reference to FIG. FIG. 14 is a diagram illustrating an example of an electronic device that executes an image processing program.

図14に示すように、画像処理装置300により実行される各種処理を実現する電子機器400は、各種演算処理を実行するCPU(Central Processing Unit)410を有する。また、図14に示すように、電子機器400は、カメラ画像を取得するためのカメラインターフェース420、ディスプレイとの間で各種データのやり取りを行うためのディスプレイインターフェース430を有する。また、図14に示すように、電子機器400は、ハードウェアアクセラレータとして機能するグラフィックエンジン440を有する。   As illustrated in FIG. 14, the electronic apparatus 400 that implements various processes executed by the image processing apparatus 300 includes a CPU (Central Processing Unit) 410 that executes various arithmetic processes. As shown in FIG. 14, the electronic apparatus 400 includes a camera interface 420 for acquiring camera images and a display interface 430 for exchanging various data with the display. As illustrated in FIG. 14, the electronic device 400 includes a graphic engine 440 that functions as a hardware accelerator.

また、図14に示すように、電子機器400は、CPU410により各種処理を実現するためのプログラムやデータ等を記憶するハードディスク装置450と、各種情報を一時記憶するRAM(Random Access Memory)などのメモリ460とを有する。そして、各装置410〜460は、バス470に接続される。   As shown in FIG. 14, the electronic apparatus 400 includes a hard disk device 450 that stores programs and data for realizing various processes by the CPU 410, and a memory such as a RAM (Random Access Memory) that temporarily stores various information. 460. Each device 410 to 460 is connected to a bus 470.

なお、CPU410の代わりに、例えば、MPU(Micro Processing Unit)などの電子回路、ASIC(Application Specific Integrated Circuit)やFPGA(Field Programmable Gate Array)などの集積回路を用いることもできる。また、メモリ460の代わりに、フラッシュメモリ(flash memory)などの半導体メモリ素子を用いることもできる。   Instead of the CPU 410, for example, an electronic circuit such as an MPU (Micro Processing Unit) or an integrated circuit such as an ASIC (Application Specific Integrated Circuit) or an FPGA (Field Programmable Gate Array) can be used. Further, instead of the memory 460, a semiconductor memory device such as a flash memory can be used.

ハードディスク装置450には、画像処理装置300の機能と同様の機能を発揮する画像処理プログラム451および画像処理用データ452が記憶されている。なお、この画像処理プログラム451を適宜分散させて、ネットワークを介して通信可能に接続された他のコンピュータの記憶部に記憶させておくこともできる。   The hard disk device 450 stores an image processing program 451 and image processing data 452 that exhibit functions similar to those of the image processing device 300. Note that the image processing program 451 may be appropriately distributed and stored in a storage unit of another computer that is communicably connected via a network.

そして、CPU410が、画像処理プログラム451をハードディスク装置450から読み出してRAM460に展開することにより、図14に示すように、画像処理プログラム451は画像処理プロセス461として機能する。画像処理プロセス461は、ハードディスク装置450から読み出した画像処理用データ452等の各種データを適宜メモリ460上の自身に割当てられた領域に展開し、この展開した各種データに基づいて各種処理を実行する。   Then, the CPU 410 reads the image processing program 451 from the hard disk device 450 and develops it in the RAM 460, whereby the image processing program 451 functions as an image processing process 461 as shown in FIG. The image processing process 461 expands various data such as the image processing data 452 read from the hard disk device 450 in an area allocated to itself on the memory 460 as appropriate, and executes various processes based on the expanded data. .

なお、画像処理プロセス461は、例えば、図2に示した画像処理装置300の制御部320にて実行される処理、例えば、図10に示す処理を含む。   Note that the image processing process 461 includes, for example, processing executed by the control unit 320 of the image processing apparatus 300 shown in FIG. 2, for example, processing shown in FIG.

なお、画像処理プログラム451については、必ずしも最初からハードディスク装置450に記憶させておく必要はない。例えば、電子機器400が実装されたECUへ対応ドライブを接続可能なフレキシブルディスク(FD)、CD−ROM、DVDディスク、光磁気ディスク、ICカードなどの「可搬用の物理媒体」に各プログラムを記憶させておく。そして、電子機器400がこれらから各プログラムを読み出して実行するようにしてもよい。   Note that the image processing program 451 is not necessarily stored in the hard disk device 450 from the beginning. For example, each program is stored in a “portable physical medium” such as a flexible disk (FD), a CD-ROM, a DVD disk, a magneto-optical disk, and an IC card that can connect a corresponding drive to the ECU on which the electronic device 400 is mounted. Let me. Then, the electronic apparatus 400 may read and execute each program from these.

さらには、公衆回線、インターネット、LAN、WANなどを介して、電子機器400が実装されたECUに接続される「他のコンピュータ(またはサーバ)」などに各プログラムを記憶させておく。そして、電子機器400がこれらから各プログラムを読み出して実行するようにしてもよい。   Furthermore, each program is stored in “another computer (or server)” connected to the ECU on which the electronic device 400 is mounted via a public line, the Internet, a LAN, a WAN, or the like. Then, the electronic apparatus 400 may read and execute each program from these.

以上の実施例を含む実施形態に関し、さらに以下の付記を開示する。   The following supplementary notes are further disclosed with respect to the embodiments including the above examples.

(付記1)画像内に含まれる、第一の画素と、該第一の画素と互いに1画素以上離れた位置にある複数の画素との輝度値を、該第一の画素を前記画像内で走査させながらそれぞれ取得する取得部と、
走査させながら取得した前記第一の画素と前記複数の画素とのそれぞれの輝度値に基づいて、前記画像内の特徴点を検出する検出部と
を有することを特徴とする画像処理装置。
(Supplementary Note 1) Luminance values of a first pixel included in an image and a plurality of pixels located at a distance of one pixel or more from the first pixel, and the first pixel in the image An acquisition unit for acquiring each while scanning;
An image processing apparatus comprising: a detection unit configured to detect a feature point in the image based on luminance values of the first pixel and the plurality of pixels acquired while scanning.

(付記2)前記検出部は、
前記第一の画素であって、前記複数の画素よりも輝度値が大きくない画素を複数抽出する抽出部と、
前記抽出部により抽出された前記複数の第一の画素それぞれについて、前記第一の画素と前記複数の画素との輝度値に基づき特定される画素の位置に、前記第一の画素と前記複数の画素との輝度値に基づき算出される値を対応付けて記憶部に格納する格納部と、
前記格納部により格納された値に基づいて前記特徴点を決定する決定部と
を有することを特徴とする付記1に記載の画像処理装置。
(Appendix 2) The detection unit
An extraction unit that extracts a plurality of pixels that are the first pixels and whose luminance values are not larger than the plurality of pixels;
For each of the plurality of first pixels extracted by the extraction unit, the first pixel and the plurality of pixels are located at the pixel positions specified based on the luminance values of the first pixel and the plurality of pixels. A storage unit that associates a value calculated based on a luminance value with a pixel and stores the value in a storage unit;
The image processing apparatus according to claim 1, further comprising: a determination unit that determines the feature point based on a value stored by the storage unit.

(付記3)前記複数の画素のそれぞれは前記第一の画素から等しい画素数離れた位置の画素のうち、前記第一の画素を挟む位置に存在する第1の方向上に位置する2つの画素と、前記第一の画素を挟む位置に存在し、かつ、前記第1の方向と直交する第2の方向上に位置する2つの画素とであり、
前記検出部はさらに、前記第1の方向上に位置する2つの画素と前記第一の画素との輝度値から求められる第1の近似関数と、前記第2の方向上に位置する2つの画素と前記第一の画素との輝度値から求められる第2の近似関数とをそれぞれ計算する計算部を有し、
前記格納部は、前記第1の方向上に位置する2つの画素の位置間で前記第1の近似関数が極値をとる位置と、前記第2の方向上に位置する2つの画素の位置間で前記第2の近似関数が極値をとる位置とに基づいて特定される前記画素の位置に対応付けて、前記第1の近似関数の最大次数の項の係数値および前記第2の近似関数の最大次数の項の係数値のうち小さい方の係数値を前記記憶部に格納し、
前記決定部は、前記記憶部に格納された係数値のうち最も大きい値に対応付けられた前記画素の位置に基づいて、前記特徴点を決定することを特徴とする付記2に記載の画像処理装置。
(Supplementary Note 3) Each of the plurality of pixels is a pixel located in a first direction existing at a position sandwiching the first pixel, among pixels located at an equal number of pixels away from the first pixel. And two pixels located in a position sandwiching the first pixel and located in a second direction orthogonal to the first direction,
The detection unit further includes a first approximation function obtained from luminance values of two pixels located in the first direction and the first pixel, and two pixels located in the second direction. And a second approximation function calculated from the luminance values of the first pixel and the second approximation function, respectively,
The storage unit includes a position between the position of the two pixels positioned in the first direction and the position of the two pixels positioned in the second direction. And the second approximation function, the coefficient value of the term of the maximum degree of the first approximation function and the second approximation function in association with the position of the pixel specified based on the position where the second approximation function takes an extreme value. The smaller coefficient value of the coefficient values of the maximum degree term is stored in the storage unit,
The image processing according to appendix 2, wherein the determination unit determines the feature point based on the position of the pixel associated with the largest value among the coefficient values stored in the storage unit. apparatus.

(付記4)前記画像は顔を含んだ画像であり、
前記特徴点に基づいて前記顔の向きを検出し、検出した該顔の向きが適正範囲にあるか否かを判定する判定部と、
前記判定の結果に応じた警告を報知する報知部と
をさらに有することを特徴とする付記1乃至3いずれか1項に記載の画像処理装置。
(Appendix 4) The image is an image including a face,
A determination unit that detects the orientation of the face based on the feature points and determines whether the detected orientation of the face is within an appropriate range;
The image processing apparatus according to any one of supplementary notes 1 to 3, further comprising: a notification unit that notifies a warning according to the determination result.

(付記5)コンピュータに、
画像内に含まれる、第一の画素と、該第一の画素と互いに1画素以上離れた位置にある複数の画素との輝度値を、該第一の画素を前記画像内で走査させながらそれぞれ取得し、
前記走査させながら取得した前記第一の画素と前記複数の画素とのそれぞれの輝度値に基づいて、前記画像内の特徴点を検出する
処理を実行させることを特徴とする画像処理プログラム。
(Appendix 5)
Luminance values of a first pixel included in an image and a plurality of pixels located at a distance of one pixel or more from the first pixel while scanning the first pixel in the image, respectively Acquired,
An image processing program for executing a process of detecting a feature point in the image based on luminance values of the first pixel and the plurality of pixels acquired while scanning.

(付記6)前記コンピュータに、
前記第一の画素であって、前記複数の画素よりも輝度値が大きくない画素を複数抽出し、
前記抽出された前記複数の第一の画素それぞれについて、前記第一の画素と前記複数の画素との輝度値に基づき特定される画素の位置に、前記第一の画素と前記複数の画素との輝度値に基づき算出される値を対応付けて記憶部に格納し、
前記格納部により格納された値に基づいて前記特徴点を決定する
処理をさらに実行させることを特徴とする付記5に記載の画像処理プログラム。
(Appendix 6)
Extracting a plurality of pixels that are the first pixels and whose luminance values are not larger than those of the plurality of pixels;
For each of the plurality of extracted first pixels, the first pixel and the plurality of pixels are located at pixel positions specified based on the luminance values of the first pixel and the plurality of pixels. A value calculated based on the luminance value is associated and stored in the storage unit,
The image processing program according to appendix 5, further comprising executing a process of determining the feature point based on a value stored by the storage unit.

(付記7)前記複数の画素のそれぞれは前記第一の画素から等しい画素数離れた位置の画素のうち、前記第一の画素を挟む位置に存在する第1の方向上に位置する2つの画素と、前記第一の画素を挟む位置に存在し、かつ、前記第1の方向と直交する第2の方向上に位置する2つの画素とであり、
前記コンピュータに、
前記第1の方向上に位置する2つの画素と前記第一の画素との輝度値から求められる第1の近似関数と、前記第2の方向上に位置する2つの画素と前記第一の画素との輝度値から求められる第2の近似関数とをそれぞれ計算する処理をさらに実行させ、
前記第1の方向上に位置する2つの画素の位置間で前記第1の近似関数が極値をとる位置と、前記第2の方向上に位置する2つの画素の位置間で前記第2の近似関数が極値をとる位置とに基づいて特定される前記画素の位置に対応付けて、前記第1の近似関数の最大次数の項の係数値および前記第2の近似関数の最大次数の項の係数値のうち小さい方の係数値を前記記憶部に格納し、
前記記憶部に格納された係数値のうち最も大きい値に対応付けられた前記画素の位置に基づいて、前記特徴点を決定する
処理を実行させることを特徴とする付記6に記載の画像処理プログラム。
(Supplementary Note 7) Each of the plurality of pixels is two pixels located in a first direction existing at a position sandwiching the first pixel among pixels located at an equal number of pixels away from the first pixel. And two pixels located in a position sandwiching the first pixel and located in a second direction orthogonal to the first direction,
In the computer,
A first approximation function obtained from luminance values of two pixels located in the first direction and the first pixel; two pixels located in the second direction; and the first pixel. And further executing a process of calculating each of the second approximate functions obtained from the luminance values of
The position where the first approximate function takes an extreme value between the positions of two pixels located on the first direction and the position between the positions of the two pixels located on the second direction The coefficient value of the term of the maximum order of the first approximation function and the term of the maximum order of the second approximation function are associated with the position of the pixel specified based on the position where the approximation function takes an extreme value. The smaller coefficient value of the coefficient values of is stored in the storage unit,
The image processing program according to appendix 6, wherein a process for determining the feature point is executed based on the position of the pixel associated with the largest value among the coefficient values stored in the storage unit. .

1 車両
100 撮影装置
200 出力装置
300 画像処理装置
310 記憶部
311 画像記憶部
312 特徴量記憶部
320 制御部
321 取得部
322 検出部
322A 抽出部
322B 計算部
322C 格納部
322D 決定部
323 判定部
324 報知部
400 電子機器
410 CPU
420 カメラインターフェース
430 ディスプレイインターフェース
440 グラフィックエンジン
450 ハードディスク装置
451 画像処理プログラム
452 画像処理用データ
460 RAM
461 画像処理プロセス
DESCRIPTION OF SYMBOLS 1 Vehicle 100 Imaging device 200 Output device 300 Image processing device 310 Storage unit 311 Image storage unit 312 Feature amount storage unit 320 Control unit 321 Acquisition unit 322 Detection unit 322A Extraction unit 322B Calculation unit 322C Storage unit 322D Determination unit 323 Determination unit 324 Notification Part 400 electronic device 410 CPU
420 Camera Interface 430 Display Interface 440 Graphic Engine 450 Hard Disk Device 451 Image Processing Program 452 Image Processing Data 460 RAM
461 Image processing process

Claims (4)

画像内に含まれる、第一の画素の輝度値と、第一の方向上で該第一の画素を挟み、前記第一の画素と互いに1画素以上離れた位置にある複数の画素の輝度値と、前記第一の方向に直交する第二の方向上で前記第一の画素を挟み、前記第一の画素と互いに1画素以上離れた位置にある複数の画素の輝度値とを、該第一の画素を前記画像内で走査させながらそれぞれ取得する取得部と、
前記第一の方向上の複数の画素および前記第二の方向上の複数の画素よりも輝度値が小さい第一の画素を、前記画像内を走査させながら複数抽出する抽出部と、
前記抽出部によって抽出された前記第一の画素と前記第一の方向上の複数の画素とにより算出される第1の近似関数が該複数の画素間で最小値を取る位置と、該第一の画素と前記第二の方向上の複数の画素とにより算出される第2の近似関数が該複数の画素間で最小値を取る位置とを基に特定される輝度最小点の位置に対応付けて、前記第1の近似関数の係数値または前記第2の近似関数の係数値を特徴量として記憶部に格納する格納部と、
前記抽出部によって抽出された他の第一の画素の輝度最小点の位置が、前記第一の画素の輝度点の位置と共通する場合に、前記他の第一の画素の輝度最小点の位置に対応する第1の近似関数の係数値または第2の近似関数の係数値を、前記記憶部に格納されている特徴量に加算することで該特徴量を更新する更新部と、
前記記憶部に格納されている各輝度最小点に対応する特徴量の大きさに基づいて、顔部品となる特徴点または特徴点の組み合わせを特定する特定部と
を有することを特徴とする画像処理装置。
The luminance value of the first pixel included in the image, and the luminance values of a plurality of pixels located at least one pixel apart from the first pixel across the first pixel in the first direction And luminance values of a plurality of pixels located at least one pixel apart from the first pixel across the first pixel in a second direction orthogonal to the first direction, An acquisition unit that acquires each pixel while scanning one pixel in the image;
An extraction unit that extracts a plurality of pixels in the first direction and a plurality of first pixels having a luminance value smaller than the plurality of pixels in the second direction while scanning the image;
A position where a first approximation function calculated by the first pixel extracted by the extraction unit and a plurality of pixels in the first direction takes a minimum value among the plurality of pixels; The second approximate function calculated by the pixel and the plurality of pixels in the second direction is associated with the position of the minimum luminance point specified based on the position where the minimum value is taken between the plurality of pixels. A storage unit that stores the coefficient value of the first approximate function or the coefficient value of the second approximate function in the storage unit as a feature amount;
The position of the minimum luminance point of the other first pixel when the position of the minimum luminance point of the other first pixel extracted by the extraction unit is the same as the position of the luminance point of the first pixel. An update unit that updates the feature value by adding the coefficient value of the first approximate function or the coefficient value of the second approximate function corresponding to the feature value stored in the storage unit;
And a specifying unit that specifies a feature point or a combination of feature points to be a facial part based on a feature amount corresponding to each luminance minimum point stored in the storage unit. apparatus.
前記更新部は、前記抽出部によって抽出された他の第一の画素の輝度最小点の位置が、前記第一の画素の輝度点の位置と共通する場合に、前記他の第一の画素の輝度最小点の位置に対応する第1の近似関数の最大次数の項の係数値または第2の近似関数の最大次数の項の係数値のうち小さい方の係数値を前記記憶部に格納されている特徴量に加算し、
前記特定部は、前記記憶部に格納された特徴量のうち最も大きい値に対応付けられた前記画素の位置に基づいて、前記特徴点を決定することを特徴とする請求項1に記載の画像処理装置。
When the position of the luminance minimum point of the other first pixel extracted by the extracting unit is the same as the position of the luminance point of the first pixel, the update unit The smaller coefficient value of the coefficient value of the maximum order term of the first approximate function or the coefficient value of the maximum order term of the second approximate function corresponding to the position of the minimum luminance point is stored in the storage unit. To the feature amount
The image according to claim 1, wherein the specifying unit determines the feature point based on a position of the pixel associated with the largest value among the feature amounts stored in the storage unit. Processing equipment.
前記画像は顔を含んだ画像であり、
前記特徴点に基づいて前記顔の向きを検出し、検出した該顔の向きが適正範囲にあるか否かを判定する判定部と、
前記判定の結果に応じた警告を報知する報知部と
をさらに有することを特徴とする請求項1または2に記載の画像処理装置。
The image is an image including a face,
A determination unit that detects the orientation of the face based on the feature points and determines whether the detected orientation of the face is within an appropriate range;
The image processing apparatus according to claim 1, further comprising: a notification unit that notifies a warning according to the determination result.
コンピュータに、
画像内に含まれる、第一の画素の輝度値と、第一の方向上で該第一の画素を挟み、前記第一の画素と互いに1画素以上離れた位置にある複数の画素の輝度値と、前記第一の方向に直交する第二の方向上で前記第一の画素を挟み、前記第一の画素と互いに1画素以上離れた位置にある複数の画素の輝度値とを、該第一の画素を前記画像内で走査させながらそれぞれ取得し、
前記第一の方向上の複数の画素および前記第二の方向上の複数の画素よりも輝度値が小さい第一の画素を、前記画像内を走査させながら複数抽出し、
出された前記第一の画素と前記第一の方向上の複数の画素とにより算出される第1の近似関数が該複数の画素間で最小値を取る位置と、該第一の画素と前記第二の方向上の複数の画素とにより算出される第2の近似関数が該複数の画素間で最小値を取る位置とを基に特定される輝度最小点の位置に対応付けて、前記第1の近似関数の係数値または前記第2の近似関数の係数値を特徴量として記憶部に格納し、
出された他の第一の画素の輝度最小点の位置が、前記第一の画素の輝度点の位置と共通する場合に、前記他の第一の画素の輝度最小点の位置に対応する第1の近似関数の係数値または第2の近似関数の係数値を、前記記憶部に格納されている特徴量に加算することで該特徴量を更新し、
前記記憶部に格納されている各輝度最小点に対応する特徴量の大きさに基づいて、顔部品となる特徴点または特徴点の組み合わせを特定する
処理を実行させることを特徴とする画像処理プログラム。
On the computer,
The luminance value of the first pixel included in the image, and the luminance values of a plurality of pixels located at least one pixel apart from the first pixel across the first pixel in the first direction And luminance values of a plurality of pixels located at least one pixel apart from the first pixel across the first pixel in a second direction orthogonal to the first direction, Each pixel is acquired while scanning in the image,
Extracting a plurality of pixels in the first direction and a plurality of first pixels having a luminance value smaller than the plurality of pixels in the second direction while scanning the inside of the image,
First approximation function and position of taking a minimum value among the plurality of pixels calculated by extraction with the first pixel issued and a plurality of pixels on the first direction, and said first pixel The second approximation function calculated by the plurality of pixels in the second direction is associated with the position of the minimum luminance point specified based on the position where the minimum value is taken between the plurality of pixels, The coefficient value of the first approximate function or the coefficient value of the second approximate function is stored as a feature quantity in the storage unit,
Position of the extracted issued the other brightness minimum point of the first pixel, if the common with the position of the luminance point of the first pixel, corresponding to the positions of the luminance minimum point of the other of the first pixel Updating the feature value by adding the coefficient value of the first approximate function or the coefficient value of the second approximate function to the feature value stored in the storage unit;
An image processing program for executing a process for specifying a feature point or a combination of feature points to be a facial part based on a feature amount corresponding to each minimum luminance point stored in the storage unit .
JP2010202904A 2010-09-10 2010-09-10 Image processing apparatus and image processing program Expired - Fee Related JP5699497B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010202904A JP5699497B2 (en) 2010-09-10 2010-09-10 Image processing apparatus and image processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010202904A JP5699497B2 (en) 2010-09-10 2010-09-10 Image processing apparatus and image processing program

Publications (2)

Publication Number Publication Date
JP2012059108A JP2012059108A (en) 2012-03-22
JP5699497B2 true JP5699497B2 (en) 2015-04-08

Family

ID=46056108

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010202904A Expired - Fee Related JP5699497B2 (en) 2010-09-10 2010-09-10 Image processing apparatus and image processing program

Country Status (1)

Country Link
JP (1) JP5699497B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5899021B2 (en) * 2012-03-28 2016-04-06 本田技研工業株式会社 Method for discriminating mounting position of portable information terminal to vehicle

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4032632B2 (en) * 2000-11-02 2008-01-16 コニカミノルタビジネステクノロジーズ株式会社 Image processing device

Also Published As

Publication number Publication date
JP2012059108A (en) 2012-03-22

Similar Documents

Publication Publication Date Title
JP6695503B2 (en) Method and system for monitoring the condition of a vehicle driver
CN109788215B (en) Image processing apparatus, computer-readable storage medium, and image processing method
CN108876708B (en) Image processing method, image processing device, electronic equipment and storage medium
EP2131589B1 (en) Image processing device, image processing method, and image processing program
US10304164B2 (en) Image processing apparatus, image processing method, and storage medium for performing lighting processing for image data
JP4791595B2 (en) Image photographing apparatus, image photographing method, and image photographing program
JP5482737B2 (en) Visual load amount estimation device, driving support device, and visual load amount estimation program
US9317924B2 (en) Information processing apparatus, three-dimensional position calculation method, and program
JP2015000156A (en) Terminal device, line of sight detection program and line of sight detection method
Draelos et al. Intel realsense= real low cost gaze
WO2011158463A1 (en) External light glare assessment device, line of sight detection device and external light glare assessment method
KR20170135952A (en) A method for displaying a peripheral area of a vehicle
WO2018230098A1 (en) Endoscope system, and method for operating endoscope system
JP6897082B2 (en) Computer program for face orientation estimation, face orientation estimation device and face orientation estimation method
KR102386444B1 (en) Image depth determining method and living body identification method, circuit, device, and medium
JP4992823B2 (en) Face detection apparatus and face detection method
Wong et al. A smart moving vehicle detection system using motion vectors and generic line features
US9569674B2 (en) Movement amount estimation device, movement amount estimation method, and computer-readable recording medium storing movement amount estimation program
JP2018101212A (en) On-vehicle device and method for calculating degree of face directed to front side
JP6906943B2 (en) On-board unit
WO2015198592A1 (en) Information processing device, information processing method, and information processing program
JP5699497B2 (en) Image processing apparatus and image processing program
JP7392368B2 (en) Image processing device, system, program
US20210125340A1 (en) Vibration analysis device, control method for vibration analysis device, and non-transitory computer-readable recording medium
JPWO2018011928A1 (en) Image processing apparatus, operation method of image processing apparatus, and operation program of image processing apparatus

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130702

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140116

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140128

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140331

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140610

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140811

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20150120

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20150202

R150 Certificate of patent or registration of utility model

Ref document number: 5699497

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees