JP2009146033A - Partial image extraction method - Google Patents
Partial image extraction method Download PDFInfo
- Publication number
- JP2009146033A JP2009146033A JP2007320761A JP2007320761A JP2009146033A JP 2009146033 A JP2009146033 A JP 2009146033A JP 2007320761 A JP2007320761 A JP 2007320761A JP 2007320761 A JP2007320761 A JP 2007320761A JP 2009146033 A JP2009146033 A JP 2009146033A
- Authority
- JP
- Japan
- Prior art keywords
- image
- partial image
- mask
- partial
- color component
- 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.)
- Granted
Links
Images
Abstract
Description
本発明は、画像内から部分画像を抽出するための部分画像抽出方法に関する。 The present invention relates to a partial image extraction method for extracting a partial image from an image.
次のような撮影画面の顔領域検出方法が知られている。この顔領域検出方法では、撮影時の撮影倍率から人物の顔のサイズを推定するとともに、画面内での肌色領域のサイズを算出する。そして、推定した人物の顔のサイズと画面上の肌色領域のサイズとを比較することによって、撮影画面内における人物の顔の領域を検出する(例えば、特許文献1)。 There are known methods for detecting a face area of a shooting screen as follows. In this face area detection method, the size of a person's face is estimated from the shooting magnification at the time of shooting, and the size of the skin color area in the screen is calculated. Then, by comparing the estimated face size of the person and the size of the skin color area on the screen, the face area of the person in the shooting screen is detected (for example, Patent Document 1).
しかしながら、従来の方法によれば、人物の顔のサイズを撮影時の撮影倍率から推定しているが、画像内における人物の顔のサイズは、カメラから人物までの距離によっても異なる。そのため、撮影時の撮影倍率から推定したサイズは必ずしも正確であるとは限らず、この推定値に誤りがあると人物の顔の領域を正確に検出できない可能性があった。 However, according to the conventional method, the size of the person's face is estimated from the shooting magnification at the time of shooting, but the size of the person's face in the image also varies depending on the distance from the camera to the person. Therefore, the size estimated from the shooting magnification at the time of shooting is not always accurate, and if the estimated value is incorrect, there is a possibility that the human face area cannot be detected accurately.
本発明は、複数の色成分を有する表色系で表される対象画像内から使用者が注目している部分を含む部分画像を抽出するための部分画像抽出方法であって、対象画像内に、使用者によって指定された指定点を含む枠を設定し、枠内の画像に基づいて、各色成分ごとの色成分画像を生成し、生成した各色成分画像を、それぞれの色成分画像ごとに設定した閾値を用いて2値化して、各色成分ごとのマスク画像を生成し、各色成分ごとのマスク画像のそれぞれを対象として、部分画像を抽出するのに適したマスク画像であるかを判定するための評価値を算出し、算出した評価値に基づいて、各色成分ごとのマスク画像の中から部分画像を抽出するのに最も適したマスク画像を最適マスク画像として選択し、選択した最適マスク画像内に、部分画像を抽出するための抽出領域を設定し、対象画像から、最適マスク画像内に設定した抽出領域に対応する領域内の画像を、部分画像として抽出することを特徴とする。
本発明では、最適マスク画像内の白画素の重心位置と、白画素の数とに基づいて、最適マスク画像内に設定する抽出領域の位置および大きさを決定するようにしてもよい。
各色成分画像ごとに濃度平均値、または濃度中央値を閾値として算出し、各色成分画像ごとに算出した閾値を用いて、それぞれの色成分ごとのマスク画像を生成するようにしてもよい。
各色成分ごとのマスク画像内の白画素の数と、白画素の重心周りの慣性モーメントとに基づいて、評価値を算出するようにしてもよい。
最適マスク画像内の白画素の重心位置から各白画素までの距離に応じた重み付けを行って白画素の重心位置を補正し、補正後の白画素の重心位置が抽出領域中心位置となるように、最適マスク画像内に設定する抽出領域の位置を決定するようにしてもよい。
The present invention relates to a partial image extraction method for extracting a partial image including a portion of interest from a target image represented by a color system having a plurality of color components. , Set a frame containing the specified point specified by the user, generate a color component image for each color component based on the image in the frame, and set each generated color component image for each color component image To generate a mask image for each color component and determine whether the mask image is suitable for extracting a partial image for each mask image for each color component. An evaluation value is calculated, and based on the calculated evaluation value, a mask image most suitable for extracting a partial image is selected as an optimal mask image from the mask images for each color component, and the selected optimal mask image And partial image Set the extraction area for extraction, from the target image, the image in the region corresponding to the extracted area set within an optimal mask image, and extracts a partial image.
In the present invention, the position and size of the extraction region set in the optimal mask image may be determined based on the barycentric position of the white pixels in the optimal mask image and the number of white pixels.
A density average value or a median density value may be calculated as a threshold value for each color component image, and a mask image for each color component may be generated using the threshold value calculated for each color component image.
The evaluation value may be calculated based on the number of white pixels in the mask image for each color component and the moment of inertia around the center of gravity of the white pixels.
Weighting is performed according to the distance from the centroid position of the white pixel in the optimal mask image to each white pixel to correct the centroid position of the white pixel so that the corrected centroid position of the white pixel becomes the extraction area center position. The position of the extraction region set in the optimal mask image may be determined.
本発明によれば、画像内で使用者が注目している部分を含む部分画像を正確に抽出することができる。 ADVANTAGE OF THE INVENTION According to this invention, the partial image containing the part which the user is paying attention in an image can be extracted correctly.
図1は、本実施の形態における部分画像抽出装置としてカメラを使用した場合の一実施の形態の構成を示すブロック図である。カメラ100は、入力スイッチ101と、レンズ102と、撮像素子103と、制御装置104と、メモリ105と、メモリカードスロット106と、モニタ107とを備えている。
FIG. 1 is a block diagram showing the configuration of an embodiment when a camera is used as the partial image extraction apparatus in the present embodiment. The
入力スイッチ101は、使用者によって操作される種々の入力部材を含んでいる。例えば、この入力スイッチ101には、レリーズボタンやカメラ100を操作するための種々の操作ボタンが含まれる。レンズ102は、複数の光学レンズ群から構成されるが、図1では代表して1枚のレンズで表している。
The
撮像素子103は、例えばCCDやCMOSであり、レンズ102を通して入力される被写体像を撮像して、撮像して得た画像データを制御装置104へ出力する。メモリ105は、例えば不揮発性のフラッシュメモリであって、このメモリ105には、制御装置104が実行するプログラムのデータや、プログラム実行時に読み込まれる種々のパラメータなどが記録されている。
The
メモリカードスロット106は、記憶媒体としてのメモリカードを挿入するためのスロットであり、制御装置104から出力された画像ファイルをメモリカードに書き込んで記録する。また、制御装置104からの指示に基づいて、メモリカード内に記憶されている画像ファイルを読み込む。
The
モニタ107は、カメラ100の背面に搭載された液晶モニタ(背面モニタ)であり、当該モニタ107には、メモリカードに記憶されている画像やカメラ100を設定するための設定メニューなどが表示される。
The
制御装置104は、CPU、メモリ、およびその他の周辺回路により構成され、撮像素子103から入力される画像データをモニタ107に出力して表示し、さらにメモリカードスロット106に挿入されているメモリカード内に記録する。なお、制御装置104を構成するメモリには、ROMやRAMが含まれる。
The
制御装置104はまた、部分画像抽出部104aと、AF(オートフォーカス)処理部104bと、撮影処理部104cとを機能的に有している。本実施の形態におけるカメラ100では、制御装置104は、撮像素子103から所定時間間隔で画像データを取得してモニタ107に出力することによって、モニタ107にスルー画を表示する。そして、使用者によって入力スイッチ101に含まれるレリーズボタンが半押しされるとAF(オートフォーカス)処理を行い、さらにレリーズボタンが全押しされると、撮影を行って画像データを取得し、メモリカードに記録する。
The
本実施の形態では、部分画像抽出部104aは、撮像素子103からスルー画が入力された場合に、そのスルー画のあるフレーム内から使用者が注目している部分の画像(部分画像)を抽出する。そして、AF処理部104bは、使用者によってレリーズボタンが半押しされたタイミングで、部分画像抽出部104aによって抽出された部分画像に基づいてAF処理を実行する。これによって、被写体が激しく動き回っている場合など、従来の方法ではピントを合わせ難い場合であっても、使用者が注目している部分にピントを合わせることが可能となる。なお、AF処理は、公知の処理であるため説明を省略することとし、以下、部分画像抽出部104aによる画像内からの部分画像抽出処理について詳細に説明する。
In the present embodiment, when a through image is input from the
まず、使用者は、入力スイッチ101を操作してメニュー画面を呼び出し、当該メニュー画面上で「部分画像の抽出」を選択することによって、処理の開始を指示する。部分画像抽出部104aは、使用者によって処理の開始が指示されると、モニタ107上にスルー画を表示する。使用者は、入力スイッチ101を操作して、モニタ107上に表示された画像内に、注目被写体の位置を特定するための指定点を画像内に設定する。例えば、使用者は、図2に示す画像上で人物の顔に注目している場合には、顔上に指定点(ユーザー指定点)2aを設定する。
First, the user calls the menu screen by operating the
部分画像抽出部104aは、画像内に設定された指定点2aの位置に基づいて、画像内から使用者が注目している部分の部分画像を抽出する。なお、図2に示す例では、指定点2aは、人物の顔から外れているが、部分画像抽出部104aは、以下に示す処理によって、使用者が注目している人物の顔を含む領域内の画像を部分画像として抽出することができる。
The partial
部分画像抽出部104aは、使用者によって設定された指定点2aを中心とした所定範囲を囲むように、画像内に枠Aを設定する。そして、部分画像抽出部104aは、枠A内の画像を抽出し、抽出した枠A内の画像に基づいて、各色成分ごとの画像(色成分画像)、すなわちY成分の画像(Yプレーン画像)、Cr成分の画像(Crプレーン画像)、およびCb成分の画像(Cbプレーン画像)をそれぞれ生成する。
The partial
すなわち、部分画像抽出部104aは、処理の対象となる画像データがYCbCr表色系で表された画像データである場合には、Y成分(輝度成分)からなる輝度画像をYプレーン画像として、Cb成分(色差成分)からなる色差画像をCbプレーン画像として、Cr成分(色差成分)からなる色差画像をCrプレーン画像として生成する。
That is, when the image data to be processed is image data represented in the YCbCr color system, the partial
これに対して、処理の対象となる画像データが他の表色系で表されている場合には、部分画像抽出部104aは、あらかじめ枠A内の画像データをYCbCr表色系の画像データに変換しておく。例えば、処理の対象となる画像データがRGB表色系で表されている場合には、部分画像抽出部104aは、RGB表色系で表されている画像データを次式(1)〜(3)を用いてYCbCr色空間における輝度成分からなる輝度画像と色差成分からなる色差画像とに変換する。
On the other hand, when the image data to be processed is represented by another color system, the partial
すなわち、部分画像抽出部104aは、枠A内の画像データを対象として、次式(1)を用いてY成分からなる輝度画像をYプレーン画像として生成し、次式(2)および(3)を用いてCb成分からなる色差画像とCr成分からなる色差画像とをそれぞれCbプレーン画像、およびCrプレーン画像として生成する。
Y = 0.299R+0.587G+0.114B ・・・(1)
Cb=−0.169R−0.332G+0.500B ・・・(2)
Cr= 0.500R−0.419G−0.081B ・・・(3)
That is, the partial
Y = 0.299R + 0.587G + 0.114B (1)
Cb = −0.169R−0.332G + 0.500B (2)
Cr = 0.500R−0.419G−0.081B (3)
部分画像抽出部104aは、生成したYプレーン画像、Cbプレーン画像、およびCrプレーン画像について、横軸に濃度値(0〜255)、縦軸に画素数をとった濃度ヒストグラムを作成する。すなわち、Yプレーン画像、Cbプレーン画像、Crプレーン画像のそれぞれに対して、画像内の全画素の濃度値を調べ、各濃度値ごとに画素数を計数して、濃度値ごとの画素数の出現頻度を示した濃度ヒストグラムを作成する。
The partial
その結果、例えば図3に示すような濃度ヒストグラムを得る。なお、図3に示す濃度ヒストグラムは、Yプレーン画像、Cbプレーン画像、およびCrプレーン画像のいずれか1つ、例えばYプレーン画像について作成したものであり、その他のCbプレーン画像、およびCrプレーン画像についても同様に作成される。 As a result, for example, a density histogram as shown in FIG. 3 is obtained. The density histogram shown in FIG. 3 is created for any one of a Y plane image, a Cb plane image, and a Cr plane image, for example, a Y plane image, and for other Cb plane images and Cr plane images. Is created in the same way.
部分画像抽出部104aは、このように作成した各プレーン画像の濃度ヒストグラムの中央値、すなわち濃度中央値(Median)3aを算出する。そして、この算出した濃度中央値3aを閾値に設定して、生成したYプレーン画像、Cbプレーン画像、およびCrプレーン画像のそれぞれを2値化して2値マスク画像を生成する。その結果、図4に示すように、それぞれのプレーン画像についての2値マスク画像を生成することができる。
The partial
すなわち、部分画像抽出部104aは、Yプレーン画像をYプレーン画像の濃度中央値3aを閾値として使用して2値化することによって、図4(a)に示すYマスク画像を生成し、Cbプレーン画像をCbプレーン画像の濃度中央値3aを閾値として使用して2値化することによって、図4(b)に示すCbマスク画像を生成する。また、部分画像抽出部104aは、Crプレーン画像をCrプレーン画像の濃度中央値3aを閾値として使用して2値化することによって、図4(c)に示すCrマスク画像を生成する。さらに、部分画像抽出部104aは、Yマスク画像を反転させることによって、図4(d)に示すY補数マスク画像を生成する。
That is, the partial
なお、本実施の形態では、各プレーン画像を濃度中央値3aを閾値として使用して2値化することによってマスク画像を生成する例について説明したが、その他の値を閾値として使用するようにしてもよい。例えば、各プレーン画像の濃度ヒストグラムの平均値、すなわち濃度平均値(Mean)3bを算出して、これを閾値として使用してもよい。
In the present embodiment, an example in which a mask image is generated by binarizing each plane image using the
部分画像抽出部104aは、生成したマスク画像の中から、部分画像を抽出するために用いるマスク画像を選択するために、各マスク画像に対する評価値を算出する。具体的には、部分画像抽出部104aは、まず、各マスク画像の白画素を抽出する。そしてマスク画像ごとにマスク画像内の白画素数を算出するとともに、マスク画像内における白画素の重心位置を特定する。
The partial
そして、部分画像抽出部104aは、各マスク画像のそれぞれについて、マスク画像内で特定した白画素の重心位置に基づいて、白画素の重心周りの慣性モーメントを算出する。すなわち、部分画像抽出部104aは、Yマスク画像の白画素の重心周りの慣性モーメント、Cbマスク画像の白画素の重心周りの慣性モーメント、Crマスク画像の白画素の重心周りの慣性モーメント、およびY補数マスク画像の白画素の重心周りの慣性モーメントをそれぞれ算出する。なお、2値化して得たマスク画像における白画素の重心周りの慣性モーメントの算出方法については、公知のため詳細な説明を省略するが、例えば、白画素の重心からの画素距離の2乗×0または1の濃度値の和により算出することができる。
Then, the partial
部分画像抽出部104aは、上述した処理で各マスク画像ごとに算出した白画素数、および白画素の重心周りの慣性モーメントとに基づいて、次式(4)により、各マスク画像の評価値を算出する。なお、次式(4)において、係数は、あらかじめ設定されている値である。
評価値=(白画素数/慣性モーメント)×係数 ・・・(4)
The partial
Evaluation value = (number of white pixels / moment of inertia) × coefficient (4)
例えば、図4に示した各マスク画像について、係数を10000として算出した場合の評価値を、図4の各マスク画像の下部に示す。部分画像抽出部104aは、各マスク画像の中から、算出した評価値が最も大きいマスク画像を部分画像を抽出するための最適マスク画像として選択する。すなわち、図4に示す例では、部分画像抽出部104aは、評価値が最も大きいCrマスク画像を最適マスク画像として選択する。
For example, for each mask image shown in FIG. 4, the evaluation value when the coefficient is calculated as 10,000 is shown at the bottom of each mask image in FIG. The partial
部分画像抽出部104aは、選択した最適マスク画像内に、中心をそのマスク画像内の白画素の重心位置とし、大きさをそのマスク画像内で算出した白画素数の平方根とする枠B(抽出領域)を設定する。なお、部分画像抽出部104aは、白画素数の平方根が小数の場合には、整数に切り上げて、これを枠Bの大きさとする。例えば、部分画像抽出部104aは、図5に示すように、最適マスク画像として選択したCrマスク画像内に枠Bを設定する。部分画像抽出部104aは、図2に示したスルー画内から、最適マスク画像内に設定した枠B内に相当する領域内の画像を部分画像として抽出する。
The partial
これによって、図6に示すように、使用者によって指定された指定点2aに基づいて設定した枠A内から、使用者が注目している被写体を含む枠B内の画像を部分画像として抽出することができる。そして、上述したように、指定点2aは、使用者が実際に注目している人物の顔からは外れているが、抽出される部分画像は、使用者が注目している人物の顔を含んだ画像とすることができる。 As a result, as shown in FIG. 6, an image in the frame B including the subject focused by the user is extracted as a partial image from the frame A set based on the designated point 2a designated by the user. be able to. As described above, the designated point 2a is not included in the face of the person actually focused on by the user, but the extracted partial image includes the face of the person focused on by the user. It can be an image.
AF処理部104bは、使用者によって、レリーズボタンが半押しされたタイミングで、部分画像抽出部104aによって抽出された部分画像を対象として、公知のAF処理を実行し、ピント合わせを行う。その後、使用者によってレリーズボタンが全押しされると、撮影処理部104cは、撮像素子103から入力される画像データをメモリカードに記録することによって撮影を行う。
The
図7は、本実施の形態におけるカメラ100の処理を示すフローチャートである。図7に示す処理は、上述したように、使用者によって入力スイッチ101が操作されて、メニュー画面上で「部分画像の抽出」が指示されると起動するプログラムとして制御装置104によって実行される。
FIG. 7 is a flowchart showing processing of the
ステップS10において、部分画像抽出部104aは、上述したスルー画をモニタ107に表示して、ステップS20へ進む。ステップS20では、部分画像抽出部104aは、スルー画上で、使用者によって指定点2aが指示されたか否かを判断し、肯定判断した場合には、ステップS30へ進む。
In step S10, the partial
ステップS30では、部分画像抽出部104aは、使用者によって指定された指定点2aを中心とした所定範囲を囲むように、画像内に枠Aを設定する。その後、ステップS40へ進み、部分画像抽出部104aは、枠A内の画像を抽出して、抽出した枠A内の画像に基づいて、上述したYプレーン画像、Crプレーン画像、およびCbプレーン画像をそれぞれ生成する。その後、ステップS50へ進む。
In step S30, the partial
ステップS50では、部分画像抽出部104aは、各プレーン画像について、図3に示した濃度ヒストグラムを作成し、各プレーン画像の濃度ヒストグラムの濃度中央値(Median)3aを算出する。そして、部分画像抽出部104aは、各プレーン画像を、算出した濃度中央値3aを閾値として用いて2値化することによって、図4に示したように、各プレーン画像に対応するマスク画像を生成する。また、部分画像抽出部104aは、生成したYマスク画像を反転することによって、Y補数マスク画像を生成する。その後、ステップS60へ進む。
In step S50, the partial
ステップS60では、部分画像抽出部104aは、上述したように、各マスク画像ごとに算出した白画素数、および白画素の重心周りの慣性モーメントとに基づいて、式(4)により、各マスク画像の評価値を算出する。その後、ステップS70へ進み、部分画像抽出部104aは、各マスク画像の中から、算出した評価値が最も大きいマスク画像を部分画像を抽出するための最適マスク画像として選択して、ステップS80へ進む。
In step S60, as described above, the partial
ステップS80では、部分画像抽出部104aは、上述したように、選択したマスク画像内に、中心をそのマスク画像内の白画素の重心位置とし、大きさをそのマスク画像内で算出した白画素数の平方根とする枠Bを設定する。その後、ステップS90へ進み、部分画像抽出部104aは、スルー画内から、マスク画像内で設定した枠B内に相当する領域内の画像を抽出して、これを部分画像として抽出する。その後、ステップS100へ進む。
In step S80, as described above, the partial
ステップS100では、AF処理部104bは、使用者によってレリーズボタンが半押しされたか否かを判断する。肯定判断した場合には、ステップS110へ進み、AF処理部104bは、部分画像抽出部104aによって抽出された部分画像を対象として、公知のAF処理を実行し、ピント合わせを行う。その後、ステップS120へ進む。
In step S100, the
ステップS120では、撮影処理部104cは、使用者によってレリーズボタンが全押しされたか否かを判断する。肯定判断した場合には、ステップS130へ進み、撮影処理部104cは、撮像素子103から入力される画像データをメモリカードに記録することによって撮影を行う。その後、処理を終了する。
In step S120, the
以上説明した本実施の形態によれば、以下のような作用効果を得ることができる。
(1)部分画像抽出部104aは、画像内に、使用者によって指定された指定点2aを含む枠Aを設定し、枠A内の画像に基づいて、各色成分ごとのプレーン画像を生成し、生成した各色成分のプレーン画像を、それぞれのプレーン画像ごとに設定した閾値を用いて2値化して、各色成分ごとのマスク画像を生成した。また、Yマスク画像を反転することによって、Y補数マスク画像を生成した。そして、部分画像抽出部104aは、各色成分ごとのマスク画像のそれぞれを対象として、部分画像を抽出するのに適したマスク画像であるかを判定するための評価値を算出し、算出した評価値に基づいて、各色成分ごとのマスク画像の中から部分画像を抽出するのに最も適したマスク画像を最適マスク画像として選択した。さらに、部分画像抽出部104aは、選択した最適マスク画像内に、部分画像を抽出するための枠Bを設定し、対象画像から、最適マスク画像内に設定した枠B内の領域に対応する領域内の画像を、部分画像として抽出するようにした。これによって、画像内で使用者が注目している部分を含む部分画像を正確に抽出することができる。
According to the present embodiment described above, the following operational effects can be obtained.
(1) The partial
(2)部分画像抽出部104aは、最適マスク画像内の白画素の重心位置と、白画素の数とに基づいて、最適マスク画像内に設定する枠Bの位置および大きさを決定するようにした。これによって、2値化して得たマスク画像内においては、被写体像に相当する範囲が白い領域として表され、その他の背景領域が黒い領域として表されることを加味して、使用者が注目している可能性が高い被写体を含む領域を含むように最適マスク画像内に枠Bを設定することができる。
(2) The partial
(3)部分画像抽出部104aは、各色成分のプレーン画像ごとに濃度平均値、または濃度中央値を閾値として算出し、各色成分画像ごとに算出した閾値を用いて、それぞれの色成分ごとのマスク画像を生成するようにした。これによって、各プレーン画像を最適な閾値を用いて2値化することができる。
(3) The partial
(4)部分画像抽出部104aは、各色成分ごとのマスク画像内の白画素の数と、白画素の重心周りの慣性モーメントとに基づいて、色(4)によって評価値を算出するようにした。これによって、マスク画像内に白画素が多く存在し、かつ白画素の重心周りの慣性モーメントが小さい場合には、白画素の重心周りに多数の白い領域がまとまって集中していることを意味しており、これは白画素の重心周りに被写体が存在している可能性が高いことを示しているため、このようなマスク画像の評価値が高くなるようにして、部分画像を抽出するための最適なマスク画像を選択することができる。
(4) The partial
―変形例―
なお、上述した実施の形態のカメラは、以下のように変形することもできる。
(1)上述した実施の形態では、処理対象の画像データは、YCbCr表色系で表されているものとした。しかしながら、処理対象の画像データがYIQ表色系における画像データである場合であっても同様に処理が可能である。
-Modification-
The camera according to the above-described embodiment can be modified as follows.
(1) In the embodiment described above, it is assumed that the image data to be processed is represented in the YCbCr color system. However, similar processing is possible even when the image data to be processed is image data in the YIQ color system.
(2)上述した実施の形態では、部分画像抽出部104aが画像内から抽出した部分画像を対象としてAF処理を実行する例について説明した。しかしながら、これに限定されず、部分画像抽出部104aが画像内から抽出した部分画像を対象として露出処理を行うようにしてもよい。また、部分画像抽出部104aが画像内から抽出した部分画像をテンプレート画像として抽出して、時系列で入力されるフレーム間での被写体追尾に用いるようにしてもよい。
(2) In the above-described embodiment, the example in which the AF processing is performed on the partial image extracted from the image by the partial
(3)上述した実施の形態では、部分画像抽出部104aは、選択した最適マスク画像内に、中心をそのマスク画像内の白画素の重心位置とし、大きさをそのマスク画像内で算出した白画素数の平方根とする枠Bを設定し、スルー画内から、最適マスク画像内に設定した枠B内に相当する領域内の画像を部分画像として抽出する例について説明した。しかしながら、このようにマスク画像内の白画素の重心位置を中心とするように枠Bを設定した場合には、画像の端部などの被写体とは関係が無い位置に白画素が存在する場合には、枠Bが使用者が注目している被写体からずれて設定される可能性がある。このため、部分画像抽出部104aは、このような不具合を解決するために、次のようにしてマスク画像内の白画素の重心位置を補正するようにしてもよい。
(3) In the above-described embodiment, the partial
例えば、図8(a)に示す画像に対して上述した処理を行った結果、図8(b)に示すように、Yマスク画像が最適マスク画像として選択され、当該Yマスク画像内に枠Bが設定されたものとする。この図8(b)に示す例では、マスク画像内の左上の白画素の影響を受けて、白画素の重心位置が被写体位置からずれるため、枠Bは被写体からずれて設定されてしまっている。この変形例では、部分画像抽出部104aは、白画素の重心位置を補正して、図8(c)に示すように、枠Bが適正位置に設定されるようにする。
For example, as a result of performing the above-described processing on the image shown in FIG. 8A, as shown in FIG. 8B, the Y mask image is selected as the optimum mask image, and the frame B is included in the Y mask image. Is set. In the example shown in FIG. 8B, the position of the center of gravity of the white pixel deviates from the subject position due to the influence of the upper left white pixel in the mask image, so that the frame B is set deviated from the subject. . In this modification, the partial
図9は、図8(b)に示したYマスク画像における白画素の分布を表した図である。この図9においては、「1」が白画素を表し「0」が黒画素を表している。なお、図9の右側の数字は、対応する列に含まれる白画素の合計個数を表し、下側の数字は、対応する行に含まれる白画素の合計個数を表している。白画素がこの図9に示すように分布している場合に算出される白画素の重心位置は画素9aとなる。ここでは、画素9aを仮の重心と呼ぶ。
FIG. 9 is a diagram showing the distribution of white pixels in the Y mask image shown in FIG. In FIG. 9, “1” represents a white pixel and “0” represents a black pixel. The number on the right side of FIG. 9 represents the total number of white pixels included in the corresponding column, and the number on the lower side represents the total number of white pixels included in the corresponding row. The center position of the white pixel calculated when the white pixels are distributed as shown in FIG. 9 is the
部分画像抽出部104aは、仮の重心9aからY方向(縦方向)およびX方向(横方向)に並んでいる各画素のそれぞれを対象として、仮の重心9aからの距離を算出する。例えば、仮の重心9aの1つ上の画素は、Y方向の距離が1となり、仮の重心9aの2つ右の画素は、X方向の距離が2となる。部分画像抽出部104aは、このように算出した距離のうち、Y方向の距離の最大値と、X方向の距離の最大値を特定する。図9に示す例では、Y方向の距離の最大値は、一番上の画素までの距離の11であり、X方向の距離の最大値は、一番右の画素までの距離の9である。
The partial
部分画像抽出部104aは、特定したY方向の距離の最大値+1(11+1=12)からY方向の距離を算出した各画素までの距離を減算する。これによって、Y方向の各画素ごとに、図9の左側に示す算出結果(Y方向算出結果)が得られる。また、部分画像抽出部104aは、特定したX方向の距離の最大値+1(9+1=10)からX方向の距離を算出した各画素までの距離を減算する。これによって、X方向の各画素ごとに、図9の上側に示す算出結果(X方向算出結果)が得られる。
The partial
部分画像抽出部104aは、このように得たX方向算出結果とY方向算出結果を用いて重み付けを行うことによって、Yマスク画像内における白画素の重心位置を補正する。具体的には、部分画像抽出部104aは、図10(a)に示す式によって重み付けを行って補正後の重心9bの座標値(xw,yw)を算出することができる。なお、図10(b)は、xwの分子の算出例を示した図である、図10(c)は、xwの分母の算出例を示した図である、
The partial
このように補正後の重心9bを算出し、この補正後の重心9bを中心として枠Bを設定することにより、仮の重心9aからの距離が遠い白画素は、重みが小さく重心計算へ寄与し難くなるため、周辺ノイズによる影響を抑えることができ、枠Bを適正位置に設定することができるようになる。
By calculating the corrected center of
なお、本発明の特徴的な機能を損なわない限り、本発明は、上述した実施の形態における構成に何ら限定されない。 Note that the present invention is not limited to the configurations in the above-described embodiments as long as the characteristic functions of the present invention are not impaired.
100 カメラ、101 入力スイッチ、102 レンズ、103 撮像素子、104 制御装置、104a 部分画像抽出部、104b AF処理部、104c 撮影処理部、105 メモリ、106 メモリカードスロット、107 モニタ
DESCRIPTION OF
Claims (5)
前記対象画像内に、使用者によって指定された指定点を含む枠を設定し、
前記枠内の画像に基づいて、各色成分ごとの色成分画像を生成し、
生成した各色成分画像を、それぞれの色成分画像ごとに設定した閾値を用いて2値化して、各色成分ごとのマスク画像を生成し、
前記各色成分ごとのマスク画像のそれぞれを対象として、前記部分画像を抽出するのに適したマスク画像であるかを判定するための評価値を算出し、
算出した前記評価値に基づいて、前記各色成分ごとのマスク画像の中から前記部分画像を抽出するのに最も適したマスク画像を最適マスク画像として選択し、
選択した前記最適マスク画像内に、前記部分画像を抽出するための抽出領域を設定し、
前記対象画像から、前記最適マスク画像内に設定した前記抽出領域に対応する領域内の画像を、前記部分画像として抽出することを特徴とする部分画像抽出方法。 A partial image extraction method for extracting a partial image including a portion of interest by a user from a target image represented by a color system having a plurality of color components,
A frame including a designated point designated by the user is set in the target image,
Based on the image in the frame, generate a color component image for each color component,
Each generated color component image is binarized using a threshold set for each color component image to generate a mask image for each color component,
For each of the mask images for each color component, calculate an evaluation value for determining whether the mask image is suitable for extracting the partial image,
Based on the calculated evaluation value, a mask image most suitable for extracting the partial image from the mask images for each color component is selected as an optimal mask image,
In the selected optimal mask image, set an extraction region for extracting the partial image,
A partial image extraction method, wherein an image in an area corresponding to the extraction area set in the optimum mask image is extracted as the partial image from the target image.
前記最適マスク画像内の白画素の重心位置と、白画素の数とに基づいて、前記最適マスク画像内に設定する前記抽出領域の位置および大きさを決定することを特徴とする部分画像抽出方法。 The partial image extraction method according to claim 1,
A partial image extraction method for determining a position and a size of the extraction region set in the optimum mask image based on a barycentric position of white pixels in the optimum mask image and the number of white pixels. .
各色成分画像ごとに濃度平均値、または濃度中央値を閾値として算出し、各色成分画像ごとに算出した閾値を用いて、それぞれの色成分ごとの前記マスク画像を生成することを特徴とする部分画像抽出方法。 The partial image extraction method according to claim 1 or 2,
A partial image characterized by calculating a density average value or a median density value as a threshold value for each color component image, and generating the mask image for each color component using the threshold value calculated for each color component image Extraction method.
各色成分ごとのマスク画像内の白画素の数と、白画素の重心周りの慣性モーメントとに基づいて、前記評価値を算出することを特徴とする部分画像抽出方法。 In the partial image extraction method as described in any one of Claims 1-3,
A partial image extraction method, wherein the evaluation value is calculated based on the number of white pixels in the mask image for each color component and the moment of inertia around the center of gravity of the white pixels.
前記最適マスク画像内の白画素の重心位置から各白画素までの距離に応じた重み付けを行って前記白画素の重心位置を補正し、補正後の前記白画素の重心位置が前記抽出領域中心位置となるように、前記最適マスク画像内に設定する前記抽出領域の位置を決定することを特徴とする部分画像抽出方法。 In the partial image extraction method according to claim 2,
Weighting according to the distance from the center of gravity of the white pixel in the optimal mask image to each white pixel is performed to correct the center of gravity of the white pixel, and the center of gravity of the white pixel after correction is the center position of the extraction region The partial image extraction method is characterized in that the position of the extraction region to be set in the optimum mask image is determined.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007320761A JP5012477B2 (en) | 2007-12-12 | 2007-12-12 | Partial image extraction method and partial image extraction apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007320761A JP5012477B2 (en) | 2007-12-12 | 2007-12-12 | Partial image extraction method and partial image extraction apparatus |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2009146033A true JP2009146033A (en) | 2009-07-02 |
JP5012477B2 JP5012477B2 (en) | 2012-08-29 |
Family
ID=40916595
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2007320761A Active JP5012477B2 (en) | 2007-12-12 | 2007-12-12 | Partial image extraction method and partial image extraction apparatus |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5012477B2 (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2011109502A (en) * | 2009-11-19 | 2011-06-02 | Nikon Corp | Image tracking device, imaging apparatus, and, image tracking method |
JP2012133573A (en) * | 2010-12-21 | 2012-07-12 | Canon Inc | Image recognition device, image recognition method and program |
JP2014063041A (en) * | 2012-09-21 | 2014-04-10 | Keyence Corp | Imaging analysis apparatus, control method thereof, and program for imaging analysis apparatus |
JP2015149569A (en) * | 2014-02-05 | 2015-08-20 | 株式会社ニコン | Image processing device, imaging device, and image processing program |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH06187455A (en) * | 1992-12-15 | 1994-07-08 | Sharp Corp | Face area extracting device for animation picture |
JPH08184925A (en) * | 1994-10-31 | 1996-07-16 | Fuji Photo Film Co Ltd | Method for determining exposure and method for extracting graphics |
JPH11185025A (en) * | 1997-12-22 | 1999-07-09 | Victor Co Of Japan Ltd | Face image normalization device |
WO2007125866A1 (en) * | 2006-04-28 | 2007-11-08 | Nikon Corporation | Object extracting method, object pursuing method, image synthesizing method, computer program for extracting object, computer program for pursuing object, computer program for synthesizing images, object extracting device, object pursuing device, and image synthesizing device |
-
2007
- 2007-12-12 JP JP2007320761A patent/JP5012477B2/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH06187455A (en) * | 1992-12-15 | 1994-07-08 | Sharp Corp | Face area extracting device for animation picture |
JPH08184925A (en) * | 1994-10-31 | 1996-07-16 | Fuji Photo Film Co Ltd | Method for determining exposure and method for extracting graphics |
JPH11185025A (en) * | 1997-12-22 | 1999-07-09 | Victor Co Of Japan Ltd | Face image normalization device |
WO2007125866A1 (en) * | 2006-04-28 | 2007-11-08 | Nikon Corporation | Object extracting method, object pursuing method, image synthesizing method, computer program for extracting object, computer program for pursuing object, computer program for synthesizing images, object extracting device, object pursuing device, and image synthesizing device |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2011109502A (en) * | 2009-11-19 | 2011-06-02 | Nikon Corp | Image tracking device, imaging apparatus, and, image tracking method |
JP2012133573A (en) * | 2010-12-21 | 2012-07-12 | Canon Inc | Image recognition device, image recognition method and program |
JP2014063041A (en) * | 2012-09-21 | 2014-04-10 | Keyence Corp | Imaging analysis apparatus, control method thereof, and program for imaging analysis apparatus |
JP2015149569A (en) * | 2014-02-05 | 2015-08-20 | 株式会社ニコン | Image processing device, imaging device, and image processing program |
Also Published As
Publication number | Publication date |
---|---|
JP5012477B2 (en) | 2012-08-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4678603B2 (en) | Imaging apparatus and imaging method | |
JP4924606B2 (en) | Subject extraction method, subject tracking method, image composition method, subject extraction computer program, subject tracking computer program, image composition computer program, subject extraction device, subject tracking device, and image composition device | |
JP5246078B2 (en) | Object location program and camera | |
JP2006140594A (en) | Digital camera | |
JP6421794B2 (en) | Image processing apparatus, image processing method, and program | |
JP5699432B2 (en) | Image processing device | |
JP2008271241A (en) | Imaging apparatus, image processing apparatus, imaging method, and image processing method | |
JP2005353010A (en) | Image processor and imaging device | |
JPWO2012002069A1 (en) | Shape extraction method and apparatus, and dimension measuring apparatus and distance measuring apparatus | |
KR20100022918A (en) | Image processing apparatus. image processing method, and storage medium | |
JP2009141475A (en) | Camera | |
JP6525809B2 (en) | Focus detection apparatus and control method thereof | |
JP5012477B2 (en) | Partial image extraction method and partial image extraction apparatus | |
JP2010279054A (en) | Image pickup device, image processing device, image pickup method, and image processing method | |
JP2013012940A (en) | Tracking apparatus and tracking method | |
JP5691617B2 (en) | Subject identification device and subject tracking device | |
JP5949559B2 (en) | Image processing apparatus, imaging apparatus, and image processing program | |
WO2012014946A1 (en) | Image processing device and image processing program | |
JP2010154306A (en) | Device, program and method for imaging control | |
JP2010020602A (en) | Image matching device and camera | |
JP2023033355A (en) | Image processing device and control method therefor | |
JP2006074498A (en) | Image processor and imaging apparatus | |
JP2009009206A (en) | Extraction method of outline inside image and image processor therefor | |
JP5965654B2 (en) | TRACKING DEVICE, IMAGING DEVICE, TRACKING METHOD USED FOR IMAGING DEVICE | |
JP2007020033A (en) | Electronic camera and image processing program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20101202 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20110215 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20110914 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20110920 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20111121 |
|
RD02 | Notification of acceptance of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7422 Effective date: 20111121 |
|
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: 20120508 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20120521 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20150615 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5012477 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20150615 Year of fee payment: 3 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |