JP2006350642A - Image processing device and program - Google Patents
Image processing device and program Download PDFInfo
- Publication number
- JP2006350642A JP2006350642A JP2005175302A JP2005175302A JP2006350642A JP 2006350642 A JP2006350642 A JP 2006350642A JP 2005175302 A JP2005175302 A JP 2005175302A JP 2005175302 A JP2005175302 A JP 2005175302A JP 2006350642 A JP2006350642 A JP 2006350642A
- Authority
- JP
- Japan
- Prior art keywords
- image
- skin area
- image processing
- pixel
- determination
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
Images
Landscapes
- Image Processing (AREA)
- Studio Devices (AREA)
- Image Analysis (AREA)
Abstract
Description
本発明は、被写体を撮影して得られた画像における天地方向を判別するための技術に関する。 The present invention relates to a technique for determining a vertical direction in an image obtained by photographing a subject.
デジタルカメラ等の撮影装置では普通、撮影によって得られる画像の形状(以降「フレーム形状」と記す)は予め定められている。それにより、ユーザは撮影する被写体によって撮影装置の構え方を選択するのが普通である。その構え方として、フレーム形状の短辺が天地方向と平行、或いは略平行とするものは「横構え」、その短辺が水平方向と平行、或いは略平行とするものは「縦構え」とそれぞれ呼ぶことにする。ユーザは横構え、縦構えの何れかを選択するのが普通である。 In a photographing apparatus such as a digital camera, the shape of an image obtained by photographing (hereinafter referred to as “frame shape”) is usually predetermined. As a result, the user usually selects how to hold the photographing apparatus according to the subject to be photographed. As for the posture, when the short side of the frame shape is parallel or substantially parallel to the top-and-bottom direction, it is “horizontal”, and when the short side is parallel or substantially parallel to the horizontal direction, “vertical posture”. I will call it. The user usually selects either horizontal or vertical.
撮影装置は通常、画像をそのままの状態で保存するのが普通である。それにより、保存した画像をパーソナルコンピュータ(以下「PC」)等で単に表示させると、縦構えで撮影された画像は水平方向を縦方向にした状態で表示される。つまり、被写体像は撮影者(ユーザ)が実際に見ていた状態から回転させた状態で表示される。 In general, an image capturing apparatus normally stores an image as it is. As a result, when the stored image is simply displayed on a personal computer (hereinafter referred to as “PC”) or the like, the image captured in the vertical orientation is displayed with the horizontal direction set to the vertical direction. That is, the subject image is displayed in a rotated state from the state actually viewed by the photographer (user).
被写体像を回転させた状態で表示させると、見難いのが普通である。このことから、その状態を元の状態に回転させることが望ましい。しかし、その回転をユーザに指示させることは、その指示に手間がかかるだけでなく、適切な状態の画像を表示させるのに時間がかかることを意味するから望ましくないと言える。このようなことから、従来、画像の天地方向を判定する画像処理が行われている。その天地方向を判定する画像処理を行う従来の画像処理装置としては、特許文献1〜3に記載されたものが挙げられる。
When the subject image is displayed in a rotated state, it is usually difficult to see. For this reason, it is desirable to rotate the state to the original state. However, it can be said that instructing the user to rotate the rotation is not desirable because it means that it takes time to display an image in an appropriate state. For this reason, conventionally, image processing for determining the vertical direction of an image has been performed. Examples of conventional image processing apparatuses that perform image processing for determining the vertical direction include those described in
特許文献1に記載された従来の画像処理装置では、画像に写っている文字を認識することにより、天地方向を判定するようにしている。特許文献2、3にそれぞれ記載された従来の画像処理装置では、一般的な環境で撮影された画像はその上辺部分が明るいことに着目し、画像の四隅の明るさを比較することにより上辺(天地方向)を判定するようにしている。その判定を行えるようにする撮影装置としては、天地検出用のセンサ(重力センサ)を搭載したものや、縦構え用、横構え用のシャッターボタンをそれぞれ用意したものがある(特許文献4)。
In the conventional image processing apparatus described in
文字認識技術を利用した方法では、画像中に文字が写っていなければ天地方向の判定を行うことができない。風景写真や人物写真などでは、文字が写っていないことは普通である。また、画像(写真)の四隅の明るさに着目する方法では、その四隅に位置する被写体の明るさが天地方向の判定結果に大きく影響するから、天地方向を正確に判定するうえでの制約(条件)がある。その制約によって、必ずしも天地方向を正確に判定することはできない。このようなことから、天地方向を正確に判定するためには、文字や四隅の明るさ以外のことに着目する必要があると考えられる。 In the method using the character recognition technology, it is impossible to determine the vertical direction unless characters are shown in the image. In landscape photos and portraits, it is normal that characters are not shown. In addition, in the method that focuses on the brightness of the four corners of the image (photo), the brightness of the subject located at the four corners greatly affects the determination result of the top and bottom direction. Condition). Due to the restriction, the vertical direction cannot always be determined accurately. For this reason, it is considered necessary to pay attention to things other than the brightness of characters and four corners in order to accurately determine the vertical direction.
特許文献4に記載された撮影装置では、センサの検出結果、或いは撮影に使われたシャッターボタンを示す情報を画像に付加することにより、天地方向を常に正確に判定させることができる。しかし、そのためには、その撮影装置が画像と併せて保存する特殊な情報に対応させる必要がある。これは、保存した画像を別の装置により表示させる場合には、その装置に、その特殊な情報に対応させるための仕組みを用意しなければならないことを意味する。このことから、天地方向は画像中の情報から判定するのが望ましいと考えられる。
本発明の課題は、文字や四隅の明るさ以外の画像中の情報に着目して天地方向を判定する技術を提供することにある。 An object of the present invention is to provide a technique for determining the top and bottom direction by paying attention to information in an image other than characters and brightness of four corners.
本発明の画像処理装置は、被写体を撮影して得られた画像における天地方向を判定する画像処理を行うことを前提とし、画像を取得する画像取得手段と、画像取得手段が取得した画像中に被写体として撮影されている人物像の肌領域を認識する肌領域認識手段と、肌領域認識手段による肌領域の認識結果を基に、天地方向を判定する方向判定手段と、を具備する。 The image processing apparatus of the present invention is premised on performing image processing for determining the top-to-bottom direction in an image obtained by photographing a subject, and includes an image acquisition unit that acquires an image, and an image acquired by the image acquisition unit. Skin area recognition means for recognizing the skin area of a human image photographed as a subject, and direction determination means for determining the top-to-bottom direction based on the recognition result of the skin area by the skin area recognition means.
なお、上記方向判定手段は、画像の縁と平行な方向毎に、肌領域認識手段が認識した肌領域を対象に分散値を計算し、該計算結果から該縁と平行な方向のうちの一つを天地方向と判定する、ことが望ましい。また、肌領域認識手段が認識した肌領域の大きさを考慮した分散値の計算を行う、ことが望ましい。 The direction determining means calculates a variance value for the skin area recognized by the skin area recognizing means for each direction parallel to the edge of the image, and determines one of the directions parallel to the edge from the calculation result. It is desirable to determine one as the vertical direction. It is also desirable to calculate a variance value in consideration of the size of the skin area recognized by the skin area recognition means.
本発明のプログラムは、上記画像処理装置が具備する手段を実現させるための機能を搭載している。 The program of the present invention has a function for realizing the means included in the image processing apparatus.
本発明は、画像中に被写体として撮影されている人物像の肌領域を認識し、その認識結果を基に、その画像における天地方向を判定する。人は普通、顔が少なくとも露出している。人は多くの場合、地面や床などの多くの人が一度に居られるところに居るが、そのようなところでは水平方向上の異なる位置に場所を確保するのが普通である。このようなことから、複数の人物を撮影した画像では、画像中の人物像を構成する肌領域の分布に、天地方向に依存する傾向が現れることが多い。そのため、画像中に存在する肌領域に着目して、その画像における天地方向を高精度に判定することができる。 The present invention recognizes a skin area of a human image photographed as a subject in an image, and determines the top / bottom direction in the image based on the recognition result. A person usually has at least a face exposed. In many cases, people are in places where many people such as the ground and the floor can be present at one time, but in such places, it is usual to secure places at different positions in the horizontal direction. For this reason, in an image obtained by photographing a plurality of persons, the distribution of the skin area constituting the person image in the image often tends to depend on the top-to-bottom direction. Therefore, paying attention to the skin region existing in the image, the top-and-bottom direction in the image can be determined with high accuracy.
以下、本発明の実施の形態について、図面を参照しながら詳細に説明する。
図1は、本実施の形態による画像処理装置の構成を示す図である。
この画像処理装置は、PCに、本実施の形態による画像処理用プログラムをロードすることにより実現されるものである。図1に示すように、装置全体の制御を行うCPU101と、例えばCPU101がワークに用いるRAMやBIOSが格納されたROMを含むメモリ102と、例えばハードディスク装置である補助記憶装置103と、不図示の通信ネットワークを介した通信を行うための通信インターフェース(I/F)104と、キーボードやマウス等のポインティングデバイスといった各種入力装置と接続用の入力インターフェース(I/F)105と、表示装置と接続用の出力インターフェース(I/F)106と、可搬性の記録媒体MDにアクセスできる媒体駆動装置107と、各部101〜107を相互に接続するバス108と、を備えた構成となっている。
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
FIG. 1 is a diagram illustrating a configuration of an image processing apparatus according to the present embodiment.
This image processing apparatus is realized by loading an image processing program according to the present embodiment on a PC. As shown in FIG. 1, a
上記画像処理用プログラムは、例えば補助記憶装置103、媒体駆動装置107に装着された記録媒体MD、或いは通信I/F104を介して通信可能な外部装置に格納されている。そのプログラムがメモリ102上に読み出されて起動されることにより、本実施の形態による画像処理装置は実現される。デジタルカメラ等の撮影装置による撮影で得られた画像は、記録媒体MDが装着された媒体駆動装置107、或いは通信I/F104によって取得される。
The image processing program is stored in, for example, the
図3は、画像中に複数の人物像が存在する場合の顔領域の分布を説明する図である。図4は、複数の人を被写体として撮影された画像における顔領域の分布例を説明する図である。その図4では、図4(a)〜図4(c)に例1〜3の3例を示している。図3、及び図4において、顔領域は丸、その顔領域が存在する範囲は破線でそれぞれ示している。ここで図3、及び図4を参照して、天地方向の判定方法について具体的に説明する。 FIG. 3 is a diagram for explaining the distribution of the face area when there are a plurality of human images in the image. FIG. 4 is a diagram for explaining an example of distribution of face areas in an image taken with a plurality of people as subjects. FIG. 4 shows three examples 1 to 3 in FIGS. 4 (a) to 4 (c). 3 and 4, the face area is indicated by a circle, and the range where the face area exists is indicated by a broken line. Here, with reference to FIG. 3 and FIG. 4, the determination method of the vertical direction will be specifically described.
人は普通、己の居る場所を確保してその場所に居る。人は多くの場合、地面や床など(以降、便宜的に「地表面」と総称する)の上に居るが、そのような地表面では水平方向上の異なる位置に場所を確保するのが普通である。このことから、図3、及び図4に示すように、複数の人物が写っている画像(写真)では、複数の人物は横に並んだような形となって、顔領域は垂直(天地)方向よりも水平方向に広がって存在する傾向となる。これは、人の数が多くなる程その傾向が強くなる(図4)。天地方向の判定は、このことに着目して行う。 A person usually secures a place where he is and stays there. People are often on the ground, floors, etc. (hereinafter collectively referred to as “the ground surface” for convenience), but it is common to secure places at different positions in the horizontal direction on such ground surfaces. It is. Therefore, as shown in FIGS. 3 and 4, in an image (photograph) in which a plurality of persons are shown, the plurality of persons are arranged side by side, and the face area is vertical (top and bottom). It tends to exist in a horizontal direction rather than a direction. This tendency becomes stronger as the number of people increases (FIG. 4). The determination of the vertical direction is made paying attention to this.
具体的には、画像中で肌色となっている肌色領域を抽出し、その分散を直交する2つの方向で調べ、一方の分散の値が比較的に高く、他方のその値が比較的に低い場合に、その値の低い方向を天地方向と判定する(図3)。撮影装置は縦構え、或いは横構えで撮影を行うのが普通であることから、直交する2つの方向としては、短辺と平行な方向(以降「短辺方向」と呼ぶ)と、長辺と平行な方向(以降「長辺方向」と呼ぶ)と、を採用している(図3)。 Specifically, a flesh-color region that is a flesh-color in the image is extracted, and its variance is examined in two orthogonal directions. One variance value is relatively high and the other value is relatively low. In this case, the direction with the lower value is determined as the top-and-bottom direction (FIG. 3). Since the photographing apparatus normally shoots in a vertical orientation or a horizontal orientation, the two orthogonal directions include a direction parallel to the short side (hereinafter referred to as a “short side direction”) and a long side. A parallel direction (hereinafter referred to as “long side direction”) is adopted (FIG. 3).
人は見上げたり、下を向いたりすることが多いことから、顔の形を認識して、その方向を考慮した判定を行った場合、判定結果の精度の低下を招く可能性は小さくないと考えられる。このことから、本実施の形態では、肌色領域を抽出することにより、その大きさ、及び位置に着目した判定を行うようにしている。顔の形や方向を考慮しないことにより、人による顔の向きの違いに係わらず、天地方向を高精度に判定することができる。また、その判定をより少ない計算量で行えるようになる。 Since people often look up or face down, it is not unlikely that the accuracy of the judgment result will be reduced when the face shape is recognized and the judgment is made in consideration of the direction. It is done. For this reason, in the present embodiment, the skin color region is extracted to make a determination focusing on its size and position. By not considering the shape and direction of the face, it is possible to determine the top-and-bottom direction with high accuracy regardless of the difference in the face direction of the person. Further, the determination can be performed with a smaller calculation amount.
図2は、本実施の形態による画像処理装置の機能構成を示す図である。その画像処理装置は、図2に示すように、画像入力部201、顔認識部202、顔位置の分散計算部203、及び縦横判別部204を備えた構成となっている。
FIG. 2 is a diagram showing a functional configuration of the image processing apparatus according to the present embodiment. As shown in FIG. 2, the image processing apparatus includes an
上記画像入力部201は、撮影装置等で撮影された画像等を入力するものである。入力する画像は、画素毎に画素値を示すデータである。図1に示す構成では、例えばCPU101、メモリ102、補助記憶装置103、通信I/F104、及び媒体駆動装置107によって実現される。
The
顔認識部202は、例えば画像入力部201が入力した画像中から肌色領域を抽出し、抽出した肌色領域毎に、その位置(ここでは重心位置)、及び大きさを示す情報をそれぞれ生成する。顔位置の分散計算部(以降「分散計算部」と略記)203は、顔認識部202から肌色領域毎にそれらの情報を受け取り、短辺方向、長辺方向毎に肌色領域の分散値を計算する。その計算は、画面(画像)全体にわたっての肌色領域の重心位置(平均位置)をG、分散値をσ2とすると、これらは個々の肌色領域iの大きさ(画素数)fi、その重心位置{xi,yi}を用いて以下のように表される。
For example, the
G={Gx,Gy}={Σfi*xi,Σfi*yi}/Σfi ・・・ (1)
σ2={σ2 x,σ2 y}={Σfi*(xi−Gx)2,Σfi*(yi−Gy)2}/Σfi
・・・ (2)
ここでGx及びσ2 xはそれぞれ長辺方向上の重心位置、及び分散値を表し、同様にGy及びσ2 yはそれぞれ短辺方向上の重心位置、及び分散値を表している。
G = {G x , G y } = {Σf i * x i , Σf i * y i } / Σf i (1)
σ 2 = {σ 2 x , σ 2 y } = {Σf i * (x i −G x ) 2 , Σf i * (y i −G y ) 2 } / Σf i
(2)
Here, G x and σ 2 x represent the centroid position and dispersion value in the long side direction, respectively, and similarly G y and σ 2 y represent the centroid position and dispersion value in the short side direction, respectively.
肌色領域の抽出では、顔が写っている顔領域の他に、手や足などの他の部分が写っている領域を抽出することが考えられる。身体の部分では、顔が写っている(露出している)可能性が最も高く、その次に可能性が高いのは手である。顔と手を比較した場合、顔領域のほうの面積が大きいのが普通である。そこで、本実施の形態では、肌色領域の分散値は、肌色領域の大きさを重み付けして計算するようにしている。それにより、計算される分散値に及ぼす手領域などの面積の小さい肌色領域による影響をより小さくさせ、より顔領域を重視する形で分散値を計算するようにしている。 In the extraction of the skin color area, it may be possible to extract an area in which other parts such as hands and feet are shown in addition to the face area in which the face is shown. In the body part, the face is most likely (exposed) and the next most likely is the hand. When comparing a face with a hand, the face area is usually larger. Therefore, in the present embodiment, the variance value of the skin color area is calculated by weighting the size of the skin color area. As a result, the influence of the skin color region having a small area such as the hand region on the calculated variance value is further reduced, and the variance value is calculated in such a manner that the face region is more important.
縦横判別部204は、分散計算部203が方向別に計算した分散値σ2 x、σ2 yを受け取り、天地方向の判別を行う。その判別は、例えばσ2 y/σ2 xの値が所定値TH(>1)より大きければ短辺方向が天地(縦)方向、σ2 x/σ2 yの値が所定値THより大きければ長辺方向が天地(縦)方向、それら何れの関係も満たされない場合には判別不能、とすることで行っている。
The vertical /
画像入力部201が入力した画像は、縦横判別部204による判別結果に応じた回転操作が自動的に行われて表示される。それにより、ユーザが画像の回転操作を指示することなく、画像は適切な状態で表示させることができる。このため、ユーザにとっては適切な状態の画像をより迅速に見ることができる。
The image input by the
上記顔認識部202、分散計算部203、及び縦横判別部204は共に、図1に示す構成では、例えばCPU101、メモリ102、及び補助記憶装置103によって実現される。画像の回転操作は、メモリ102を用いてCPU101により行われ、その回転操作後の画像は出力I/F106を介して表示装置に出力させることで表示される。
In the configuration shown in FIG. 1, the
図2に示す各部201〜4は、CPU101が図5に示す天地方向判定処理を実行した場合に実現される。次に図5を参照して、その判定処理について詳細に説明する。その判定処理自体は、CPU101が例えば上記画像処理用プログラムを補助記憶装置103からメモリ102に読み出して実行することで実現される。
The
先ず、ステップ501では、ユーザが指定した場所から、通信I/F104、或いは媒体駆動装置107を介して画像を入力する。次のステップ502では、入力した画像中の1画素に注目して、その画素値が肌色と見なせる範囲内か否か判定する。その画素値が肌色と見なせる範囲内であった場合、判定はYESとなり、ステップ503でその画素の別の値として1を設定した後、ステップ505に移行する。そうでない場合には、判定はNOとなり、ステップ504でその画素の別の値として0を設定した後、そのステップ505に移行する。
First, in
ステップ505では、全ての画素について調べたか否か判定する。画素値が肌色と見なせる範囲内か否か調べていない画素が残っている場合、判定はNOとなって上記ステップ502に戻り、注目する画素を残っている画素のうちの1つに変更して、その画素値が肌色と見なせる範囲内か否か判定する。そうでない場合には、判定はYESとなってステップ506に移行する。
In
上記ステップ502〜505で形成される処理ループをステップ505の判定がYESとなるまで繰り返し実行することにより、ステップ501で入力した画像から、肌色と見なせる範囲内か否かにより2値化した画像が生成される。その2値化画像において、肌色と見なせる画素の値は1、そうでない画素の値は0である。ステップ506以降では、生成した2値化画像を対象にした処理が行われる。
By repeatedly executing the processing loop formed in
その2値化画像では、画素値が1の画素がどのように肌色領域を構成しているか判明していない。このことから、先ず、ステップ506では、肌色領域を個別に抽出するためのグループ化とラベル付け(ラベリング)処理を行う。その処理の実行により、同一の肌色領域を構成していると見なす画素には同一のラベルが割り当てられ、同一のグループにまとめられる。
In the binarized image, it is not clear how pixels having a pixel value of 1 constitute a skin color area. From this, first, in
ステップ506に続くステップ507では、グループ(抽出した肌色領域)毎に、その大きさ(画素数)fi、及び重心位置{xi,yi}を計算し、その計算後に、肌色領域の平均位置Gを式(1)により計算する。その次に移行するステップ508では、長辺方向、短辺方向別に、式(2)により分散値σ2 x、σ2 yを計算する。ステップ509にはその後に移行する。
In
ステップ509では、σ2 y/σ2 xの値が所定値THより大きいか否か判定する。その値が所定値THより大きい場合、判定はYESとなってステップ510に移行し、短辺方向(図中「垂直方向」と表記)を天地方向と設定した後、一連の処理を終了する。そうでない場合には、判定はNOとなってステップ511に移行する。 In step 509, it is determined whether the value of σ 2 y / σ 2 x is greater than a predetermined value TH. If the value is larger than the predetermined value TH, the determination is YES, the process proceeds to step 510, the short side direction (indicated as “vertical direction” in the figure) is set as the top-and-bottom direction, and the series of processing ends. Otherwise, the determination is no and the process moves to step 511.
ステップ511では、σ2 x/σ2 yの値が所定値THより大きいか否か判定する。その値が所定値THより大きい場合、判定はYESとなってステップ512に移行し、長辺方向(図中「水平方向」と表記)を天地方向と設定した後、一連の処理を終了する。そうでない場合には、判定はNOとなってステップ513に移行し、天地方向は不明と設定した後、一連の処理を終了する。
In
上述の天地判明処理は、画像毎に実行される。それにより、複数の画像を一度に表示させる場合には、画像毎に天地方向が判定され、その判定結果が画像の表示に反映される。なお、図2に示す画像入力部201は上記ステップ501を実行することで実現され、同様に、顔認識部202は上記ステップ502〜506、分散計算部203は上記ステップ507、508、縦横判別部204は上記ステップ509〜513をそれぞれ実行することで実現される。
The above-described top and bottom finding process is executed for each image. Thereby, when displaying a plurality of images at once, the top-and-bottom direction is determined for each image, and the determination result is reflected in the display of the image. The
図6は、上記ステップ506として実行されるグループ化とラベル付け処理のフローチャートである。次に図6を参照して、そのラベル付け処理について詳細に説明する。このラベル付け処理では、画像の左上隅の画素からスタートして、ラスタスキャン順に全ての画素を対象に、連結(隣接)している画素値が1の画素に同一のラベル(番号)を割り当てることが行われる。
FIG. 6 is a flowchart of the grouping and labeling process executed as
先ず、ステップ601では、初期化を行う。その初期化により、割り当てるラベルを管理するための変数Nに1を代入し、全ての画素のラベルをリセット、つまりラベルとして0をセットする。次のステップ602では、注目する画素Aの画素値が0か否か判定する。その画素値が0であった場合、判定はYESとなってステップ608に移行し、そうでない場合には、判定はNOとなってステップ603に移行する。
First, in
ここで画素へのラベリング方法について図7を参照して具体的に説明する。その図7において、各枠はそれぞれ画素を表している。注目する画素はAで示し、その8近傍の画素のうち、左、左上、上、及び右上の4つの画素はそれぞれB〜Eで示している。当然のことながら、それら4つの画素のうちの何れかは注目画素Aの位置によって存在しない場合がある。 Here, a method of labeling pixels will be specifically described with reference to FIG. In FIG. 7, each frame represents a pixel. A pixel of interest is indicated by A, and four pixels on the left, upper left, upper and upper right among the eight neighboring pixels are indicated by B to E, respectively. Of course, any of these four pixels may not exist depending on the position of the pixel of interest A.
注目画素A近傍の4つの画素B〜Eへのラベリングでは、何れの画素にもラベルが割り当てられていない(ケース1)、1つ以上の画素に同一のラベルが割り当てられている(ケース2)、複数の画素に異なるラベルが割り当てられている(ケース3)、の3ケースが考えられる。注目画素Aへのラベリングは、ケース1ではそれまで割り当てていないラベルを割り当て、ケース2では近傍の画素と同一のラベルを割り当て、ケース3では近傍の画素のなかで最小のラベルを割り当てることで行う。ステップ603〜607では、そのようなラベリングを行うための処理が実行される。
In the labeling to the four pixels B to E in the vicinity of the target pixel A, no label is assigned to any pixel (case 1), and the same label is assigned to one or more pixels (case 2). There are three cases where different labels are assigned to a plurality of pixels (case 3). Labeling to the pixel of interest A is performed by assigning a label that has not been assigned in the
先ず、ステップ603では、近傍画素B〜Eの何れかにラベルが割り当てられているか否か判定する。その何れの画素にもラベルが割り当てられていない場合、判定はNOとなり、次にステップ604で注目画素Aに変数Nの値をラベルとして割り当て、更に変数Nの値をインクリメントしてからステップ608に移行する。そうでない場合には、判定はYESとなってステップ605に移行する。
First, in
ステップ605では、近傍画素B〜Eに割り当てられていたラベルが全て同一か否か判定する。そのラベルとして複数の異なるラベルが存在していた場合、判定はNOとなってステップ606に移行し、複数のラベルのなかで最小のラベルを注目画素Aに割り当て、近傍画素B〜Eのなかで最小のラベルが割り当てられていない画素には最小のラベルを新たに割り当てる。その後はステップ608に移行する。一方、そうでない場合には、つまりラベルが全て同一であった場合には、判定はYESとなり、ステップ607で注目画素Aにそのラベルを割り当てた後、そのステップ608に移行する。
In
ステップ608では、注目画素Aが画像の最後(右下隅)の画素か否か判定する。その注目画素Aが最後の画素であった場合、判定はYESとなり、ここで一連の処理を終了する。そうでない場合には、判定はNOとなり、次のステップ609で注目画素Aをラスタスキャン順に沿って次の画素に変更した後、上記ステップ602に戻る。それにより、画素値が1の画素の全てを対象にラベリングを行う。
In
グループ化とラベル付け処理では、上述したような処理が実行される。それにより、同じ肌色領域を構成する画素には同一のラベルが割り当てられてグループ化される。それにより、肌色領域の大きさは、異なるラベル毎に、画素数をカウントすることで計算される。その重心位置Xは、画素毎の座標位置を用いて計算される。 In the grouping and labeling process, the process as described above is executed. As a result, the same label is assigned to the pixels constituting the same skin color area and grouped. Thereby, the size of the skin color area is calculated by counting the number of pixels for each different label. The barycentric position X is calculated using the coordinate position for each pixel.
なお、本実施の形態では、肌色領域の分布状態を評価するために分散値σ2を計算しているが、それとは別の指標を採用しても良い。具体的には、肌色領域が存在する範囲(幅)、その形状等を採用しても良い。また、身体の特定の部分(例えば顔)が写っている肌色領域のみを抽出し、天地方向の判定を行うようにしても良い。特定の肌色領域のみを抽出する場合には、その大きさによる重み付けは行わなくとも良い。天地方向を判定する画像としては、撮影(ここではスキャナ等によって電子化することを含む)によって得られた画像でなくとも良い。例えばコンピュータ・グラフィックスによって生成された画像であっても良い。 In the present embodiment, the variance value σ 2 is calculated in order to evaluate the distribution state of the skin color region, but another index may be employed. Specifically, a range (width) in which the skin color area exists, a shape thereof, and the like may be employed. Alternatively, only the skin color region in which a specific part of the body (for example, a face) is captured may be extracted, and the vertical direction may be determined. When only a specific skin color region is extracted, weighting according to the size may not be performed. The image for determining the top-and-bottom direction may not be an image obtained by photographing (including digitization by a scanner or the like here). For example, it may be an image generated by computer graphics.
101 CPU
102 メモリ
103 補助記憶装置
104 通信インターフェース
105 入力インターフェース
106 出力インターフェース
107 媒体駆動装置
108 バス
101 CPU
102
Claims (4)
前記画像を取得する画像取得手段と、
前記画像取得手段が取得した画像中に被写体として撮影されている人物像の肌領域を認識する肌領域認識手段と、
前記肌領域認識手段による肌領域の認識結果を基に、前記天地方向を判定する方向判定手段と、
を具備することを特徴とする画像処理装置。 In an image processing apparatus for determining a top-and-bottom direction in an image obtained by photographing a subject,
Image acquisition means for acquiring the image;
A skin area recognition means for recognizing a skin area of a person image photographed as a subject in the image acquired by the image acquisition means;
Based on the recognition result of the skin area by the skin area recognition means, direction determination means for determining the top and bottom direction,
An image processing apparatus comprising:
ことを特徴とする請求項1記載の画像処理装置。 The direction determining means calculates a variance value for the skin area recognized by the skin area recognizing means for each direction parallel to the edge of the image, and determines one of the directions parallel to the edge from the calculation result. One is determined to be the top and bottom direction,
The image processing apparatus according to claim 1.
ことを特徴とする請求項2記載の画像処理装置。 The direction determination means calculates a variance value in consideration of the size of the skin area recognized by the skin area recognition means;
The image processing apparatus according to claim 2.
前記画像を取得する機能と、
前記取得する機能により取得した画像中に被写体として撮影されている人物像の肌領域を認識する機能と、
前記認識する機能による肌領域の認識結果を基に、前記天地方向を判定する機能と、
を実現させるためのプログラム。
A program for causing an image processing apparatus to determine a top-to-bottom direction in an image obtained by photographing a subject,
A function of acquiring the image;
A function of recognizing a skin area of a human image captured as a subject in an image acquired by the function of acquiring;
Based on the recognition result of the skin area by the recognition function, the function of determining the top and bottom direction,
A program to realize
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2005175302A JP2006350642A (en) | 2005-06-15 | 2005-06-15 | Image processing device and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2005175302A JP2006350642A (en) | 2005-06-15 | 2005-06-15 | Image processing device and program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2006350642A true JP2006350642A (en) | 2006-12-28 |
Family
ID=37646420
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2005175302A Withdrawn JP2006350642A (en) | 2005-06-15 | 2005-06-15 | Image processing device and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2006350642A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2013146041A1 (en) * | 2012-03-28 | 2013-10-03 | 富士フイルム株式会社 | Image processing device and method, and imaging device |
JP2015015565A (en) * | 2013-07-04 | 2015-01-22 | 京セラドキュメントソリューションズ株式会社 | Image processing apparatus |
US9049397B2 (en) | 2009-12-03 | 2015-06-02 | Sony Corporation | Image processing device and image processing method |
-
2005
- 2005-06-15 JP JP2005175302A patent/JP2006350642A/en not_active Withdrawn
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9049397B2 (en) | 2009-12-03 | 2015-06-02 | Sony Corporation | Image processing device and image processing method |
WO2013146041A1 (en) * | 2012-03-28 | 2013-10-03 | 富士フイルム株式会社 | Image processing device and method, and imaging device |
JPWO2013146041A1 (en) * | 2012-03-28 | 2015-12-10 | 富士フイルム株式会社 | Image processing apparatus and method, and imaging apparatus |
US9596455B2 (en) | 2012-03-28 | 2017-03-14 | Fujifilm Corporation | Image processing device and method, and imaging device |
JP2015015565A (en) * | 2013-07-04 | 2015-01-22 | 京セラドキュメントソリューションズ株式会社 | Image processing apparatus |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7305146B2 (en) | Tilt correction of electronic images | |
JP4957922B2 (en) | Image direction determination apparatus, image direction determination method, and image direction determination program | |
US8619098B2 (en) | Methods and apparatuses for generating co-salient thumbnails for digital images | |
JP5652886B2 (en) | Face authentication device, authentication method and program, information device | |
US7460705B2 (en) | Head-top detecting method, head-top detecting system and a head-top detecting program for a human face | |
JP2012530994A (en) | Method and apparatus for half-face detection | |
WO2011067881A1 (en) | Image processing device and image processing method | |
JP2007074578A (en) | Image processor, photography instrument, and program | |
JP2006119817A (en) | Image processor | |
JP2007272685A (en) | Automatic trimming method, device and program | |
CN103685911A (en) | Image processing apparatus for image processing method | |
JP6098784B2 (en) | Image processing apparatus and program | |
JP2006350642A (en) | Image processing device and program | |
US20060279800A1 (en) | Image processing apparatus, image processing method, and image processing program | |
JP2010015548A (en) | Object tracking device and camera | |
JP2005316958A (en) | Red eye detection device, method, and program | |
JP2012205089A (en) | Information processing device, information processing method, and information processing program | |
US20060010582A1 (en) | Chin detecting method, chin detecting system and chin detecting program for a chin of a human face | |
JP4222013B2 (en) | Image correction apparatus, character recognition method, and image correction program | |
JP2007219899A (en) | Personal identification device, personal identification method, and personal identification program | |
KR20150011714A (en) | Device for determining orientation of picture | |
WO2020208742A1 (en) | Polygon detection device, polygon detection method, and polygon detection program | |
JP6776532B2 (en) | Image processing equipment, imaging equipment, electronic devices and image processing programs | |
JP2008181015A (en) | Image display device, and image display program | |
JP2007025901A (en) | Image processor and image processing method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A300 | Application deemed to be withdrawn because no request for examination was validly filed |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20080902 |