JP2010154323A - Image processing apparatus, image extraction method, and, program - Google Patents

Image processing apparatus, image extraction method, and, program Download PDF

Info

Publication number
JP2010154323A
JP2010154323A JP2008331103A JP2008331103A JP2010154323A JP 2010154323 A JP2010154323 A JP 2010154323A JP 2008331103 A JP2008331103 A JP 2008331103A JP 2008331103 A JP2008331103 A JP 2008331103A JP 2010154323 A JP2010154323 A JP 2010154323A
Authority
JP
Japan
Prior art keywords
image
area
subject
processing apparatus
image processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2008331103A
Other languages
Japanese (ja)
Inventor
Mitsuyasu Nakajima
光康 中嶋
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.)
Casio Computer Co Ltd
Original Assignee
Casio Computer Co 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 Casio Computer Co Ltd filed Critical Casio Computer Co Ltd
Priority to JP2008331103A priority Critical patent/JP2010154323A/en
Publication of JP2010154323A publication Critical patent/JP2010154323A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Studio Devices (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To more efficiently perform an effective subject extraction. <P>SOLUTION: An image dividing section 213 divides one of two captured images, captured by a first imaging section 100A and a second imaging section 100B into a plurality of regions on the basis of color information, luminance information, or the like. A distance calculating section 214 uses the divided regions as a template and performs scanning on the other captured image. The distance calculating section 214 calculates the photographic distance for a searched area, based on the principle of parallax-based triangulation. When a subject position is designated, an area including the position is used as a template, or in the case, where no subject position is designated, overall area is used as a template and candidate areas are extracted, on the basis of the photographic distance. A subject extracting section 215 calculates an inter-color distance between a candidate area and a non-candidate area adjacent to the candidate area; and when the inter-color distance is short, the area is excluded from the candidate. A candidate area, after correction based on the inter-color distance, is extracted as a subject image. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、画像処理装置、画像抽出方法、および、プログラムに関し、特に、撮像画像からの被写体領域抽出に好適な画像処理装置、画像抽出方法、および、プログラムに関する。   The present invention relates to an image processing device, an image extraction method, and a program, and more particularly, to an image processing device, an image extraction method, and a program suitable for extracting a subject area from a captured image.

デジタルカメラの普及により、撮影した画像に対する様々な画像処理を容易におこなうことができる。例えば、同じアングルから複数の撮影をおこなうことで、被写体部分を抽出して合成する手法などが確立している(例えば、特許文献1)。   With the widespread use of digital cameras, various image processing can be easily performed on captured images. For example, a technique of extracting and combining subject portions by performing a plurality of shootings from the same angle has been established (for example, Patent Document 1).

特開2003−338977号公報JP 2003-338777 A

特許文献1などの従来技術では、被写体領域を抽出する際、主に色情報に基づいた抽出が一般的である。例えば、赤い被写体を背景から分離させる場合には、画像中の各画素の色がある範囲の赤い色に入るか判定し、その結果に基づいて抽出する画素であるか識別する。   In conventional techniques such as Patent Document 1, when extracting a subject area, extraction based mainly on color information is common. For example, when a red subject is separated from the background, it is determined whether the color of each pixel in the image falls within a certain range of red color, and the pixel to be extracted is identified based on the result.

このような色情報を用いた画像抽出では、単調な背景の中に異なる色の被写体がある場合などには好適であるが、背景と被写体とで同じような色を含んでいる場合には、適切な画像抽出をおこなうことができない。   Image extraction using such color information is suitable when there is a subject with different colors in a monotonous background, but when the background and subject contain similar colors, Appropriate image extraction cannot be performed.

その他の方法として、画像のエッジ情報、すなわち、画像中の画素の値(例えば、色や明度)が変化する部分の情報を用いる方法がある。この方法では、通常、画像中で隣接する画素間の色や画像濃度の差が大きいところをエッジとして求め、エッジを繋ぐことで輪郭を求める。   As another method, there is a method of using edge information of an image, that is, information of a portion in which a pixel value (for example, color or brightness) in the image changes. In this method, usually, a portion where a difference in color or image density between adjacent pixels in an image is large is obtained as an edge, and an edge is obtained by connecting the edges.

しかしながら、この方法では、エッジを探索して次々に繋ぐ処理をコンピュータによる自動処理でおこなうため、例えば、エッジの候補が多数現れたり、途切れたりする場合には、エッジがうまく繋がらないことがある。   However, in this method, the process of searching for edges and connecting them one after another is performed automatically by a computer. For example, when many edge candidates appear or are interrupted, the edges may not be connected well.

本発明は、上記実状に鑑みてなされたものであり、効果的な画像抽出をより効率的におこなうことのできる画像処理装置、画像抽出方法、および、プログラムを提供することを目的とする。   The present invention has been made in view of the above circumstances, and an object thereof is to provide an image processing apparatus, an image extraction method, and a program capable of more efficiently performing effective image extraction.

上記目的を達成するため、本発明の第1の観点にかかる画像処理装置は、
同一の被写体について撮像時の光軸位置が異なる2つの撮像画像を取得する画像取得手段と、
前記画像取得手段が取得した撮像画像の一方を複数の領域に分割する分割手段と、
前記分割された領域をテンプレートとした前記撮像画像の他方に対するテンプレートマッチングにより、前記分割された領域単位で撮影距離を算出する撮影距離算出手段と、
前記撮影距離算出手段が算出した撮影距離に基づいて、前記撮像画像から被写体領域を抽出する抽出手段と、
を備えることを特徴とする。
In order to achieve the above object, an image processing apparatus according to a first aspect of the present invention provides:
Image acquisition means for acquiring two captured images having different optical axis positions at the time of imaging for the same subject;
A dividing unit that divides one of the captured images acquired by the image acquiring unit into a plurality of regions;
Shooting distance calculation means for calculating a shooting distance in units of the divided areas by template matching with respect to the other of the captured images using the divided areas as templates;
Extraction means for extracting a subject area from the captured image based on the shooting distance calculated by the shooting distance calculation means;
It is characterized by providing.

上記画像処理装置において、
前記分割手段は、前記撮像画像における画素値に基づいて前記複数の領域に分割することが望ましい。
In the image processing apparatus,
The dividing unit may divide the plurality of regions based on pixel values in the captured image.

上記画像処理装置において、
前記抽出手段は、前記撮影距離が最も短い領域と、前記撮影距離に基づいて該領域と連続する領域と、を前記被写体領域として抽出することができる。
In the image processing apparatus,
The extraction unit can extract an area having the shortest shooting distance and an area continuous with the area based on the shooting distance as the subject area.

上記画像処理装置において、
前記抽出手段は、前記撮像画像の中央にある領域と、前記撮影距離に基づいて該領域と連続する領域と、を前記被写体領域として抽出することができる。
In the image processing apparatus,
The extraction unit can extract a region in the center of the captured image and a region continuous with the region based on the shooting distance as the subject region.

上記画像処理装置において、
前記抽出手段は、前記撮像画像上で指定された位置にある領域と、前記撮影距離に基づいて該領域と連続する領域と、を前記被写体領域として抽出することができる。
In the image processing apparatus,
The extraction unit can extract, as the subject area, an area at a specified position on the captured image and an area continuous with the area based on the shooting distance.

上記画像処理装置は、
前記撮像画像上で人物の顔を認識する顔認識手段をさらに備えていてもよく、この場合、
前記抽出手段は、前記顔認識手段が認識した顔部分の領域と、前記撮影距離に基づいた該領域に連結する領域と、を前記被写体領域として抽出することができる。
The image processing apparatus includes:
It may further comprise face recognition means for recognizing a person's face on the captured image.
The extraction unit can extract a face part region recognized by the face recognition unit and a region connected to the region based on the shooting distance as the subject region.

上記画像処理装置において、
前記抽出手段は、
被写体領域として抽出した領域を候補領域とし、該候補領域に隣接する非候補領域との色間距離を算出する色間距離算出手段と、
前記色間距離算出手段が算出した色間距離に基づいて、前記候補領域を候補から除外する除外手段と、をさらに備えていることが望ましい。
In the image processing apparatus,
The extraction means includes
An inter-color distance calculating means for calculating an inter-color distance with a non-candidate area adjacent to the candidate area, the area extracted as the subject area;
It is desirable to further include an excluding unit that excludes the candidate region from candidates based on the intercolor distance calculated by the intercolor distance calculating unit.

上記画像処理装置において、
前記画像取得手段は、前記2つの撮像画像を取得する平行ステレオカメラを備えていることが望ましい。
In the image processing apparatus,
The image acquisition unit preferably includes a parallel stereo camera that acquires the two captured images.

上記目的を達成するため、本発明の第2の観点にかかる画像抽出方法は、
同一の被写体について撮像時の光軸位置が異なる2つの撮像画像から被写体領域を抽出する画像抽出方法であって、
前記2つの撮像画像を取得する画像取得ステップと、
前記画像取得ステップで取得した撮像画像の一方を複数の領域に分割する分割ステップと、
前記分割された領域をテンプレートとした前記撮像画像の他方に対するテンプレートマッチングにより、前記分割された領域単位で撮影距離を算出する撮影距離算出ステップと、
前記撮影距離算出ステップで算出された撮影距離に基づいて、前記撮像画像から被写体領域を抽出する抽出ステップと、
を含むことを特徴とする。
In order to achieve the above object, an image extraction method according to a second aspect of the present invention includes:
An image extraction method for extracting a subject area from two captured images having different optical axis positions at the time of imaging for the same subject,
An image acquisition step of acquiring the two captured images;
A division step of dividing one of the captured images acquired in the image acquisition step into a plurality of regions;
A shooting distance calculating step of calculating a shooting distance in units of the divided areas by template matching for the other of the captured images using the divided areas as templates;
An extraction step of extracting a subject area from the captured image based on the shooting distance calculated in the shooting distance calculation step;
It is characterized by including.

上記目的を達成するため、本発明の第3の観点にかかるプログラムは、
コンピュータに、
同一の被写体について撮像時の光軸位置が異なる2つの撮像画像を取得する機能と、
前記取得した撮像画像の一方を複数の領域に分割する機能と、
前記分割された領域をテンプレートとした前記撮像画像の他方に対するテンプレートマッチングにより、前記分割された領域単位で撮影距離を算出する機能と、
前記算出した撮影距離に基づいて、前記撮像画像から被写体領域を抽出する機能と、
を実現させることを特徴とする。
In order to achieve the above object, a program according to the third aspect of the present invention is:
On the computer,
A function of acquiring two captured images having different optical axis positions at the time of imaging for the same subject;
A function of dividing one of the acquired captured images into a plurality of regions;
A function of calculating a shooting distance in units of the divided areas by template matching for the other of the captured images using the divided areas as templates;
A function of extracting a subject area from the captured image based on the calculated shooting distance;
It is characterized by realizing.

本発明によれば、より効率的に被写体領域を抽出することができる。   According to the present invention, a subject area can be extracted more efficiently.

本発明にかかる実施形態を、図面を参照して以下に説明する。本実施形態では、本発明をデジタルスチルカメラ(以下、デジタルカメラ)によって実現した場合を例示する。本実施形態にかかるデジタルカメラ1は、一般的なデジタルスチルカメラが有する機能を備えているものとするが、撮像にかかる構成を2つ備えた、いわゆる複眼カメラとする。   Embodiments according to the present invention will be described below with reference to the drawings. In the present embodiment, a case where the present invention is realized by a digital still camera (hereinafter referred to as a digital camera) is illustrated. The digital camera 1 according to the present embodiment is assumed to have a function that a general digital still camera has, but is a so-called compound eye camera including two configurations related to imaging.

図1は、本発明の実施形態にかかるデジタルカメラ1の構成を示すブロック図である。本実施形態にかかるデジタルカメラ1の概略的構成は、図示するように、第1撮像部100A、第2撮像部100B、データ処理部200、インタフェース(I/F)部300、などである。   FIG. 1 is a block diagram showing a configuration of a digital camera 1 according to an embodiment of the present invention. The schematic configuration of the digital camera 1 according to the present embodiment includes a first imaging unit 100A, a second imaging unit 100B, a data processing unit 200, an interface (I / F) unit 300, and the like as illustrated.

第1撮像部100Aおよび第2撮像部100Bは、デジタルカメラ1の撮像動作をおこなう部分である。上述したように、本実施形態にかかるデジタルカメラ1は複眼カメラであるため、第1撮像部100Aと第2撮像部100Bとを有する構成であるが、第1撮像部100Aと第2撮像部100Bは同一の構成である。以下、第1撮像部100Aについての構成には参照符号の末尾に「A」を付し、第2撮像部100Bについての構成には参照符号の末尾に「B」を付す。   The first imaging unit 100 </ b> A and the second imaging unit 100 </ b> B are parts that perform the imaging operation of the digital camera 1. As described above, since the digital camera 1 according to the present embodiment is a compound eye camera, the first camera 100A and the second imager 100B are configured with the first imager 100A and the second imager 100B. Have the same configuration. Hereinafter, “A” is added to the end of the reference numeral for the configuration of the first imaging unit 100A, and “B” is added to the end of the reference numeral for the configuration of the second imaging unit 100B.

図1に示すように、第1撮像部100A(第2撮像部100B)は、光学装置110A(110B)やイメージセンサ部120A(120B)などから構成されている。   As shown in FIG. 1, the first imaging unit 100A (second imaging unit 100B) includes an optical device 110A (110B), an image sensor unit 120A (120B), and the like.

光学装置110A(110B)は、例えば、レンズ、絞り機構、シャッタ機構、などを含み、撮像にかかる光学的動作をおこなう。すなわち、光学装置110A(110B)の動作により、入射光が集光されるとともに、焦点距離、絞り、シャッタスピードなどといった、画角やピント、露出などにかかる光学的要素の調整がなされる。なお、光学装置110A(110B)に含まれるシャッタ機構はいわゆるメカニカルシャッタであり、イメージセンサの動作のみでシャッタ動作をおこなう場合には、光学装置110A(110B)にシャッタ機構が含まれていなくてもよい。また、光学装置110A(110B)は、後述する制御部210による制御によって動作する。   The optical device 110A (110B) includes, for example, a lens, a diaphragm mechanism, a shutter mechanism, and the like, and performs an optical operation related to imaging. In other words, the operation of the optical device 110A (110B) collects incident light and adjusts optical elements related to the angle of view, focus, exposure, and the like, such as focal length, aperture, and shutter speed. The shutter mechanism included in the optical device 110A (110B) is a so-called mechanical shutter. When the shutter operation is performed only by the operation of the image sensor, the optical device 110A (110B) may not include the shutter mechanism. Good. The optical device 110A (110B) operates under the control of the control unit 210 described later.

イメージセンサ部120A(120B)は、光学装置110A(110B)によって集光された入射光に応じた電気信号を生成する、例えば、CCD(Charge Coupled Device:電荷結合素子)やCMOS(Complementally Metal Oxide Semiconductor:相補型金属酸化物半導体)などのイメージセンサから構成される。イメージセンサ部120A(120B)は、光電変換をおこなうことで、受光に応じた電気信号を発生してデータ処理部200に出力する。   The image sensor unit 120A (120B) generates an electrical signal corresponding to incident light collected by the optical device 110A (110B), for example, a CCD (Charge Coupled Device) or a CMOS (Complementally Metal Oxide Semiconductor). : Complementary metal oxide semiconductor). The image sensor unit 120 </ b> A (120 </ b> B) performs an electrical conversion to generate an electrical signal corresponding to the received light and output it to the data processing unit 200.

上述したように、第1撮像部100Aと第2撮像部100Bは同一の構成である。より詳細には、レンズの焦点距離fやF値、絞り機構の絞り範囲、イメージセンサのサイズや画素数、配列、画素面積などの各仕様がすべて同一である。   As described above, the first imaging unit 100A and the second imaging unit 100B have the same configuration. More specifically, the specifications such as the focal length f and F value of the lens, the aperture range of the aperture mechanism, the size and number of pixels of the image sensor, the arrangement, and the pixel area are all the same.

このような第1撮像部100Aと第2撮像部100Bを有するデジタルカメラ1は、図2(a)に示すように、光学装置110Aに構成されたレンズと光学装置110Bに構成されたレンズとが、デジタルカメラ1の外面における同一面上に形成された構成とする。ここでは、シャッタボタンが上になる方向でデジタルカメラ1を水平にした場合に、中心位置が水平方向で同一線上となるよう2つのレンズ(受光部)が配置されるものとする。つまり、第1撮像部100Aと第2撮像部100Bとを同時に動作させた場合、同一被写体についての画像が撮像されることになるが、各画像における光軸位置が横方向にずれている画像となる。   As shown in FIG. 2A, the digital camera 1 having the first imaging unit 100A and the second imaging unit 100B includes a lens configured in the optical device 110A and a lens configured in the optical device 110B. The digital camera 1 is formed on the same outer surface. Here, it is assumed that when the digital camera 1 is leveled in the direction in which the shutter button is upward, the two lenses (light receiving portions) are arranged so that the center position is on the same line in the horizontal direction. That is, when the first imaging unit 100A and the second imaging unit 100B are operated simultaneously, images of the same subject are captured, but the optical axis position in each image is shifted in the horizontal direction. Become.

この場合、図2(b)の透視射影モデルに示すような光学的特性となるよう第1撮像部100Aと第2撮像部100Bが配置される。図2(b)に示す透視射影モデルは、X、Y、Zからなる3次元直交座標系に基づくものであり、第1撮像部100Aについてのこの座標系を以下「カメラ座標」と呼ぶ。図2(b)では、第1撮像部100Aの光学中心を原点としたカメラ座標を示している。   In this case, the first imaging unit 100A and the second imaging unit 100B are arranged so as to have optical characteristics as shown in the perspective projection model of FIG. The perspective projection model shown in FIG. 2B is based on a three-dimensional orthogonal coordinate system composed of X, Y, and Z, and this coordinate system for the first imaging unit 100A is hereinafter referred to as “camera coordinates”. FIG. 2B shows camera coordinates with the optical center of the first imaging unit 100A as the origin.

カメラ座標においては、Z軸をカメラの光学方向に一致する方向とし、X軸とY軸はそれぞれ画像の横方向と縦方向に平行する。ここで、光軸と画像座標面の交点を原点(すなわち、光学中心)とし、イメージセンサの画素間隔を換算してカメラ座標と長さの単位を合わせた場合、第1撮像部100Aについての画像座標面で被写体A1を示す画像座標を(u1, v1)とし、第2撮像部100Bについての画像座標面では(u'1, v'1)とする。   In camera coordinates, the Z-axis is the direction that matches the optical direction of the camera, and the X-axis and Y-axis are parallel to the horizontal and vertical directions of the image, respectively. Here, when the intersection of the optical axis and the image coordinate plane is set as the origin (that is, the optical center), the pixel interval of the image sensor is converted, and the unit of the camera coordinate and the length is matched, the image about the first imaging unit 100A The image coordinate indicating the subject A1 on the coordinate plane is (u1, v1), and the image coordinate plane for the second imaging unit 100B is (u′1, v′1).

第1撮像部100Aと第2撮像部100Bは、それぞれの光軸が平行(すなわち、輻輳角が0)になり、かつ、第1撮像部100Aについての画像座標u軸と第2撮像部100Bについての画像座標u'軸が同一線上で同じ方向となるよう配置される(すなわち、エピポーラ線が一致)。また、上述したように、第1撮像部100Aおよび第2撮像部100Bの焦点距離fや画素間隔は同じであり、光軸と画像座標面とが垂直に交わっている。このような構成を「平行ステレオ」と呼び、デジタルカメラ1の第1撮像部100Aと第2撮像部100Bは平行ステレオの構成となっている。   The first imaging unit 100A and the second imaging unit 100B have parallel optical axes (that is, the convergence angle is 0), and the image coordinate u-axis and the second imaging unit 100B for the first imaging unit 100A. Are arranged such that the image coordinate u ′ axes are in the same direction on the same line (that is, epipolar lines coincide). Further, as described above, the focal length f and the pixel interval of the first imaging unit 100A and the second imaging unit 100B are the same, and the optical axis and the image coordinate plane intersect perpendicularly. Such a configuration is called “parallel stereo”, and the first imaging unit 100A and the second imaging unit 100B of the digital camera 1 have a parallel stereo configuration.

図1に戻り、デジタルカメラ1の構成の説明を続ける。   Returning to FIG. 1, the description of the configuration of the digital camera 1 will be continued.

データ処理部200は、第1撮像部100Aおよび第2撮像部100Bによる撮像動作によって生成された電気信号を処理し、撮像画像を示すデジタルデータを生成するとともに、撮像画像に対する画像処理などをおこなう。図1に示すように、データ処理部200は、制御部210、画像処理部220、画像メモリ230、画像出力部240、記憶部250、外部記憶部260、などから構成される。   The data processing unit 200 processes the electrical signal generated by the imaging operation by the first imaging unit 100A and the second imaging unit 100B, generates digital data indicating the captured image, and performs image processing on the captured image. As shown in FIG. 1, the data processing unit 200 includes a control unit 210, an image processing unit 220, an image memory 230, an image output unit 240, a storage unit 250, an external storage unit 260, and the like.

制御部210は、例えば、CPU(Central Processing Unit:中央演算処理装置)などのプロセッサや、RAM(Random Access Memory)などの主記憶装置(メモリ)、などから構成され、後述する記憶部250などに格納されているプログラムを実行することで、デジタルカメラ1の各部を制御する。また、本実施形態では、所定のプログラムを実行することで、後述する各処理にかかる機能が制御部210によって実現される。   The control unit 210 includes, for example, a processor such as a CPU (Central Processing Unit), a main storage device (memory) such as a RAM (Random Access Memory), and the like. Each part of the digital camera 1 is controlled by executing the stored program. Further, in the present embodiment, by executing a predetermined program, a function related to each process described later is realized by the control unit 210.

画像処理部220は、例えば、ADC(Analog-Digital Converter:アナログ−デジタル変換器)、バッファメモリ、画像処理用のプロセッサ(いわゆる、画像処理エンジン)などから構成され、イメージセンサ部120Aおよび120Bによって生成された電気信号に基づいて、撮像画像を示すデジタルデータを生成する。   The image processing unit 220 includes, for example, an ADC (Analog-Digital Converter), a buffer memory, a processor for image processing (so-called image processing engine), and the like, and is generated by the image sensor units 120A and 120B. Based on the electrical signal thus generated, digital data indicating a captured image is generated.

すなわち、イメージセンサ部120A(120B)から出力されたアナログ電気信号をADCがデジタル信号に変換して順次バッファメモリに格納すると、バッファされたデジタルデータに対し、画像処理エンジンがいわゆる現像処理などをおこなうことで、画質の調整やデータ圧縮などをおこなう。   That is, when the analog electric signal output from the image sensor unit 120A (120B) is converted into a digital signal by the ADC and sequentially stored in the buffer memory, the image processing engine performs a so-called development process on the buffered digital data. In this way, image quality adjustment and data compression are performed.

画像メモリ230は、例えば、RAMやフラッシュメモリなどの記憶装置から構成され、画像処理部220によって生成された撮像画像データや、制御部210によって処理される画像データなどを一時的に格納する。   The image memory 230 includes, for example, a storage device such as a RAM or a flash memory, and temporarily stores captured image data generated by the image processing unit 220, image data processed by the control unit 210, and the like.

画像出力部240は、例えば、RGB信号の生成回路などから構成され、画像メモリ230に展開された画像データをRGB信号などに変換して表示画面(後述する表示部310など)に出力する。   The image output unit 240 includes, for example, an RGB signal generation circuit and the like, converts the image data expanded in the image memory 230 into an RGB signal and the like, and outputs the RGB signal to a display screen (a display unit 310 to be described later).

記憶部250は、例えば、ROM(Read Only Memory)やフラッシュメモリなどの記憶装置から構成され、デジタルカメラ1の動作に必要なプログラムやデータなどを格納する。本実施形態では、制御部210などが実行する動作プログラムや処理に必要となるパラメータや演算式などが記憶部250に格納されているものとする。   The storage unit 250 includes a storage device such as a ROM (Read Only Memory) or a flash memory, and stores programs and data necessary for the operation of the digital camera 1. In the present embodiment, it is assumed that the operation program executed by the control unit 210 and the like, parameters and arithmetic expressions necessary for the processing are stored in the storage unit 250.

外部記憶部260は、例えば、メモリカードなどといった、デジタルカメラ1に着脱可能な記憶装置から構成され、デジタルカメラ1で撮像した画像データなどを格納する。   The external storage unit 260 includes a storage device that can be attached to and detached from the digital camera 1 such as a memory card, and stores image data captured by the digital camera 1.

インタフェース部300は、デジタルカメラ1とその使用者あるいは外部装置とのインタフェースにかかる構成であり、図1に示すように、表示部310、外部インタフェース(I/F)部320、操作部330、などから構成される。   The interface unit 300 has a configuration related to an interface between the digital camera 1 and its user or an external device. As shown in FIG. 1, the display unit 310, an external interface (I / F) unit 320, an operation unit 330, etc. Consists of

表示部310は、例えば、液晶表示装置などから構成され、デジタルカメラ1を操作するために必要な種々の画面や、撮影時のライブビュー画像、撮像画像、などを表示出力する。本実施形態では、画像出力部240からの画像信号(RGB信号)などに基づいて撮像画像等の表示出力がおこなわれる。   The display unit 310 includes, for example, a liquid crystal display device, and displays and outputs various screens necessary for operating the digital camera 1, live view images at the time of shooting, captured images, and the like. In the present embodiment, display output of a captured image or the like is performed based on an image signal (RGB signal) from the image output unit 240.

外部インタフェース部320は、例えば、USB(Universal Serial Bus)コネクタやビデオ出力端子などから構成され、外部のコンピュータ装置への画像データの出力や、外部のモニタ装置への撮像画像の表示出力などをおこなう。   The external interface unit 320 includes, for example, a USB (Universal Serial Bus) connector, a video output terminal, and the like, and performs output of image data to an external computer device, display output of a captured image to an external monitor device, and the like. .

操作部330は、デジタルカメラ1の外面上に構成されている各種ボタンなどによって構成され、デジタルカメラ1の使用者による操作に応じた入力信号を生成して制御部210に入力する。操作部330を構成するボタンとして、例えば、シャッタ動作を指示するためのシャッタボタンや、デジタルカメラ1のもつ動作モードを指定するためのモードボタン、各種設定をおこなうための十字キーや機能ボタン、などが含まれているものとする。   The operation unit 330 includes various buttons configured on the outer surface of the digital camera 1, generates an input signal corresponding to an operation by the user of the digital camera 1, and inputs the input signal to the control unit 210. As buttons constituting the operation unit 330, for example, a shutter button for instructing a shutter operation, a mode button for designating an operation mode of the digital camera 1, a cross key and a function button for performing various settings, and the like Is included.

ここで、本実施形態では、記憶部250に格納されている動作プログラムを制御部210が実行することで、後述する各処理が実現されるが、この場合に制御部210によって実現される機能を、図3を参照して説明する。   Here, in the present embodiment, the control unit 210 executes the operation program stored in the storage unit 250 to realize each process described later. In this case, the functions realized by the control unit 210 are implemented. This will be described with reference to FIG.

図3は、制御部210によって実現される機能を示した機能ブロック図である。ここでは、複眼カメラによって撮像された画像から被写体画像を抽出する機能を実現するために必要な機能構成を示す。この場合、図示するように、制御部210は、動作モード処理部211、撮像制御部212、画像分割部213、距離算出部214、被写体抽出部215、などとして機能する。   FIG. 3 is a functional block diagram illustrating functions realized by the control unit 210. Here, a functional configuration necessary for realizing a function of extracting a subject image from an image captured by a compound eye camera is shown. In this case, as illustrated, the control unit 210 functions as an operation mode processing unit 211, an imaging control unit 212, an image division unit 213, a distance calculation unit 214, a subject extraction unit 215, and the like.

動作モード処理部211は、表示部310との協働により、デジタルカメラ1が有する各種動作モードをデジタルカメラ1のユーザに指定させるために必要な画面表示や指定された動作モード毎の設定画面表示などをおこなう他、操作部330との協働により、ユーザが指定した動作モードを認識し、当該動作モードの実行に必要なプログラムや演算式などを記憶部250から読み出し、制御部210の主記憶装置(メモリ)にロードする。   The operation mode processing unit 211 cooperates with the display unit 310 to display screens necessary for the user of the digital camera 1 to specify various operation modes of the digital camera 1 and setting screen displays for each specified operation mode. In addition, the operation mode designated by the user is recognized in cooperation with the operation unit 330, and a program or an arithmetic expression necessary for executing the operation mode is read from the storage unit 250, and the main memory of the control unit 210 is read out. Load to device (memory).

本実施形態では、デジタルカメラ1での撮影後に撮像画像から被写体部分を抽出する動作モード(画像抽出モード)がユーザによって指定されるものとし、以下に説明する制御部210の各機能構成は、画像抽出モードの指定に応じて動作モード処理部211がロードしたプログラムを実行することで実現される機能構成である。   In the present embodiment, it is assumed that an operation mode (image extraction mode) for extracting a subject portion from a captured image after shooting with the digital camera 1 is specified by the user, and each functional configuration of the control unit 210 described below is an image. This is a functional configuration realized by executing the program loaded by the operation mode processing unit 211 in accordance with the designation of the extraction mode.

撮像制御部212は、第1撮像部100Aおよび第2撮像部100Bを制御することでデジタルカメラ1での撮像動作を実行する。本実施形態にかかる被写体画像抽出機能は、平行ステレオ構成となっている第1撮像部100Aと第2撮像部100Bから得られた撮像画像から被写体画像を抽出するので、本実施形態にかかる撮像制御部212は、第1撮像部100Aと第2撮像部100Bで同時に撮像動作をおこなうよう制御する。これにより、同一の被写体について、光軸位置の異なる2つの撮像画像が取得される。   The imaging control unit 212 executes the imaging operation with the digital camera 1 by controlling the first imaging unit 100A and the second imaging unit 100B. The subject image extraction function according to the present embodiment extracts a subject image from captured images obtained from the first imaging unit 100A and the second imaging unit 100B having a parallel stereo configuration, and thus imaging control according to the present embodiment. The unit 212 controls the first imaging unit 100A and the second imaging unit 100B to perform the imaging operation at the same time. Thereby, two captured images having different optical axis positions are acquired for the same subject.

画像分割部213は、撮像制御部212の制御によって得られた撮像画像上での領域分割をおこなう。ここでは、取得された2つの撮像画像のうちの一方について領域分割をおこなう。本実施形態では、第1撮像部100Aによる撮像動作で得られた撮像画像(以下、「対象画像」とする)で領域分割をおこなうものとする。本実施形態にかかる画像分割部213は、例えば、色情報や輝度勾配情報などを用いるMeanshift法やWatershed法などによって領域分割をおこなうものとする。   The image dividing unit 213 performs region division on the captured image obtained by the control of the imaging control unit 212. Here, region division is performed for one of the two acquired captured images. In the present embodiment, it is assumed that region division is performed on a captured image (hereinafter, referred to as “target image”) obtained by an imaging operation by the first imaging unit 100A. The image dividing unit 213 according to the present embodiment performs region division by, for example, the Meanshift method or the Watershed method using color information, luminance gradient information, or the like.

距離算出部214は、対象画像上で分割された領域に基づく2つの撮像画像間の照合により、領域毎の撮影距離を算出する処理をおこなう。本実施形態では、対象画像上で分割された領域をテンプレートとして、第2撮像部100Bの撮像動作で得られた撮像画像(以下、「基準画像」とする)に対するテンプレート照合をおこない、照合する分割領域の画像の相違度から撮影距離を算出する。本実施形態にかかる距離算出部214は、例えば、差の2乗和を評価式とするSSD(Sum of Squared Difference)を用いたテンプレート照合をおこなうものとする。   The distance calculation unit 214 performs a process of calculating a shooting distance for each region by comparing two captured images based on the region divided on the target image. In the present embodiment, using a region divided on the target image as a template, a template matching is performed on a captured image (hereinafter referred to as a “reference image”) obtained by the imaging operation of the second imaging unit 100B, and the matching is performed. The shooting distance is calculated from the difference between the images in the area. The distance calculation unit 214 according to the present embodiment performs, for example, template matching using an SSD (Sum of Squared Difference) that uses the sum of squares of differences as an evaluation formula.

被写体抽出部215は、距離算出部214によるテンプレート照合で算出された分割領域毎の撮影距離に基づいて、所望する被写体像が示されている領域を抽出する。ここで、撮影距離に基づく判定では、被写体領域の候補を抽出し、抽出した被写体領域候補と背景との境界における色間距離を算出することで、正確な被写体画像の抽出をおこなう。   The subject extraction unit 215 extracts a region in which a desired subject image is shown based on the shooting distance for each divided region calculated by the template matching performed by the distance calculation unit 214. Here, in the determination based on the shooting distance, a subject area candidate is extracted, and an accurate subject image is extracted by calculating a distance between colors at the boundary between the extracted subject area candidate and the background.

以上が制御部210によって実現される機能である。なお、本実施形態では、制御部210がプログラムを実行することによる論理的処理で上述した各機能が実現されるものとするが、これらの機能を、例えば、ASIC(Application Specific Integrated Circuit:特定用途向け集積回路)などのハードウェアによって構成してもよい。この場合、図3に示した機能のうち、画像処理にかかる機能については、画像処理部220によって実現されてもよい。   The above is the function realized by the control unit 210. In the present embodiment, each function described above is realized by a logical process performed by the control unit 210 executing a program. These functions are, for example, ASIC (Application Specific Integrated Circuit). Or an integrated circuit). In this case, among the functions shown in FIG. 3, the functions related to image processing may be realized by the image processing unit 220.

以上説明したデジタルカメラ1の構成は、本発明を実現するために必要な構成であり、デジタルカメラとしての基本機能や種々の付加機能に用いられる構成は必要に応じて備えられているものとする。   The configuration of the digital camera 1 described above is a configuration necessary for realizing the present invention, and a configuration used for a basic function and various additional functions as a digital camera is provided as necessary. .

このような構成のデジタルカメラ1による動作を以下に説明する。ここでは、デジタルカメラ1の動作モードのうち、上述した「画像抽出モード」が選択された場合にデジタルカメラ1が実行する「被写体抽出処理」を、図4に示すフローチャートを参照して説明する。この「被写体抽出処理」は、デジタルカメラ1のユーザが操作部330を操作することで、画像抽出モードを選択したことを契機に開始される。この場合、動作モード処理部211が、被写体抽出動作にかかるプログラムなどを記憶部250からロードすることで、図3に示した各機能構成により以下の処理が実行される。   The operation of the digital camera 1 having such a configuration will be described below. Here, the “subject extraction process” executed by the digital camera 1 when the above-described “image extraction mode” is selected from the operation modes of the digital camera 1 will be described with reference to the flowchart shown in FIG. This “subject extraction process” is started when the user of the digital camera 1 selects the image extraction mode by operating the operation unit 330. In this case, the operation mode processing unit 211 loads a program or the like related to the subject extraction operation from the storage unit 250, whereby the following processing is executed by each functional configuration illustrated in FIG.

処理が開始されると、撮像制御部212は、シャッタボタン(操作部330)が操作されたことに応じて、第1撮像部100Aおよび第2撮像部100Bを制御し、第1撮像部100Aおよび第2撮像部100Bで同時に撮像動作(複眼同時撮像)をおこなわせる(ステップS11:Yes、ステップS12)。   When the processing is started, the imaging control unit 212 controls the first imaging unit 100A and the second imaging unit 100B in response to the operation of the shutter button (operation unit 330), and the first imaging unit 100A and The second imaging unit 100B simultaneously performs an imaging operation (compound eye simultaneous imaging) (step S11: Yes, step S12).

ここで、本実施形態では、図8(a)に示すような場面をデジタルカメラ1で撮影する場合を想定する。ここでは、図8(a)に示すように、被写体Aと被写体Bをデジタルカメラ1で撮影するが、デジタルカメラ1から各被写体までの距離は、被写体Aの方が近くなっている。   Here, in this embodiment, the case where the scene as shown to Fig.8 (a) is image | photographed with the digital camera 1 is assumed. Here, as shown in FIG. 8A, the subject A and the subject B are photographed by the digital camera 1, but the distance from the digital camera 1 to each subject is closer to the subject A.

このような場面で複眼同時撮像をおこなった場合の撮像画像の例を、図8(b)および図8(c)に示す。本実施形態では、被写体に向かって左側となるレンズが第2撮像部100Bに構成され、被写体に向かって右側となるレンズが第1撮像部100Aに構成されているものとする。この場合、図8(b)は、第2撮像部100Bによって撮像された画像を示し、図8(c)は、第1撮像部100Aによって撮像された画像を示す。   FIGS. 8B and 8C show examples of captured images in the case where compound eye simultaneous imaging is performed in such a scene. In the present embodiment, it is assumed that the lens on the left side facing the subject is configured in the second imaging unit 100B, and the lens on the right side facing the subject is configured in the first imaging unit 100A. In this case, FIG. 8B illustrates an image captured by the second imaging unit 100B, and FIG. 8C illustrates an image captured by the first imaging unit 100A.

上述したように、各レンズの光軸が水平方向に異なるよう配置されているので、撮像によって得られた2つの画像には、同じ被写体が写っているが、その横方向の位置は異なっている。   As described above, since the optical axes of the respective lenses are arranged so as to be different in the horizontal direction, the same subject is shown in the two images obtained by imaging, but the positions in the horizontal direction are different. .

このようにして2つの撮像画像が取得されると、動作モード処理部211は、表示部310に設定画面を表示し、デジタルカメラ1のユーザに、撮像画像からの抽出を所望する被写体位置の指定方法を設定させる(ステップS13)。ここでは、被写体位置を指定する方法として、例えば、「画像中央」、「任意指定」、「顔認識」、「最短距離」、などが選択可能に設定画面に表示され、デジタルカメラ1のユーザは、操作部330を操作することで、撮像画像に適した方法を指定する。   When two captured images are acquired in this way, the operation mode processing unit 211 displays a setting screen on the display unit 310, and specifies the subject position desired to be extracted from the captured image to the user of the digital camera 1. A method is set (step S13). Here, as a method for designating the subject position, for example, “center of image”, “arbitrary designation”, “face recognition”, “shortest distance”, and the like are displayed on the setting screen so that the user of the digital camera 1 can select. By operating the operation unit 330, a method suitable for the captured image is designated.

ここで、「画像中央」は、抽出を所望する被写体が撮像画像の中央部に写っている場合に選択される方法であり、被写体位置が画像の中央であることが指定される。   Here, “image center” is a method that is selected when the subject desired to be extracted appears in the center of the captured image, and designates that the subject position is the center of the image.

「任意指定」は、抽出を所望する被写体の撮像画像上での位置をユーザが任意に指定する方法であり、例えば、カーソルによって撮像画像上の位置を指定する。   “Arbitrary designation” is a method in which the user arbitrarily designates the position on the captured image of the subject desired to be extracted. For example, the position on the captured image is designated by a cursor.

「顔認識」は、デジタルカメラ1が顔認識機能を有している場合に選択可能な方法であり、顔認識によって認識された顔部分の位置が被写体位置として指定される方法である。   “Face recognition” is a method that can be selected when the digital camera 1 has a face recognition function, and is a method in which the position of the face portion recognized by face recognition is designated as the subject position.

「最短距離」は、撮像画像に写っている複数の被写体のうち、デジタルカメラ1と最も近い距離にある被写体を、抽出対象として指定する方法である。この方法は、撮影距離に基づいて被写体部分を判定するため、上記の各方法と異なり、被写体位置を指定しない方法である。   The “shortest distance” is a method of designating a subject closest to the digital camera 1 among a plurality of subjects shown in a captured image as an extraction target. In this method, since the subject portion is determined based on the shooting distance, unlike the above-described methods, the subject position is not designated.

これらの方法のいずれかが指定されると、動作モード処理部211は、指定された方法がいずれであるかを示す情報を、制御部210のメモリに保持する。   When any one of these methods is specified, the operation mode processing unit 211 stores information indicating which method is specified in the memory of the control unit 210.

被写体位置の指定方法が選択されると、動作モード処理部211は、その旨を画像分割部213に通知する。画像分割部213は、動作モード処理部211からの通知に応じて、画像メモリ230に展開されている撮像画像のうち、第1撮像部100Aによって撮像された画像(対象画像)を、複数の小領域に分割する(ステップS14)。   When the method for specifying the subject position is selected, the operation mode processing unit 211 notifies the image dividing unit 213 to that effect. In response to the notification from the operation mode processing unit 211, the image dividing unit 213 converts an image (target image) captured by the first imaging unit 100A from among the captured images developed in the image memory 230 into a plurality of small images. The area is divided (step S14).

ここでは、色情報や輝度勾配情報などを用いるMeanshift法やWatershed法などによって領域分割をおこなう。すなわち、色や輝度などの画素値に基づいて、撮像画像が複数の領域に分割される。領域分割された対象画像の例を図9(a)に示す。   Here, the region is divided by the Meanshift method or the Watershed method using color information, luminance gradient information, or the like. That is, the captured image is divided into a plurality of regions based on pixel values such as color and luminance. FIG. 9A shows an example of the target image divided into regions.

このようにして対象画像を複数の小領域に分割すると、画像分割部213は、その旨を距離算出部214に通知する。距離算出部214は、画像分割部213からの通知に応じて、分割された領域単位で撮影距離を算出する処理をおこなう。ここで、上述した被写体位置の指定方法により被写体位置の指定があるか否かを判別する(ステップS15)。ここでは、上述した「画像中央」、「任意指定」、「顔認識」のいずれかが選択されていれば「被写体位置の指定あり」と判別し(ステップS15:Yes)、「最短距離」が選択されていれば「被写体位置の指定なし」と判別する(ステップS15:No)。   When the target image is divided into a plurality of small areas in this way, the image dividing unit 213 notifies the distance calculating unit 214 to that effect. The distance calculation unit 214 performs a process of calculating the shooting distance in units of divided areas in response to the notification from the image dividing unit 213. Here, it is determined whether or not the subject position is designated by the above-described subject position designation method (step S15). Here, if any of the above-mentioned “image center”, “arbitrary designation”, or “face recognition” is selected, it is determined that “subject position has been designated” (step S15: Yes), and “shortest distance” is determined. If it is selected, it is determined that “no subject position is specified” (step S15: No).

距離算出部214は、「被写体位置の指定あり」と判別した場合には(ステップS15:Yes)、「候補領域抽出処理(1)」を実行し(ステップS100)、「被写体位置の指定なし」と判別した場合には(ステップS15:No)、「候補領域抽出処理(2)」を実行する(ステップS200)。   When the distance calculation unit 214 determines that “the subject position is specified” (step S15: Yes), the “candidate region extraction process (1)” is executed (step S100), and “the subject position is not specified”. (Step S15: No), “candidate area extraction process (2)” is executed (Step S200).

まず、「候補領域抽出処理(1)」を、図5に示すフローチャートを参照して説明する。   First, “candidate area extraction processing (1)” will be described with reference to the flowchart shown in FIG.

処理が開始されると、距離算出部214は、対象画像上で分割された領域のうち、指定された位置に該当する領域を基準テンプレートに指定する(ステップS101)。   When the process is started, the distance calculation unit 214 designates an area corresponding to the designated position among the areas divided on the target image as a reference template (step S101).

ここで、位置指定方法が「画像中央」である場合、距離算出部214は、対象画像の中央位置を示す座標が含まれている領域を基準テンプレートに指定する。   Here, when the position designation method is “image center”, the distance calculation unit 214 designates, as a reference template, an area including coordinates indicating the center position of the target image.

また、位置指定方法が「任意指定」であれば、ユーザが指定した位置の座標が含まれている領域を基準テンプレートに指定する。   If the position designation method is “arbitrary designation”, an area including the coordinates of the position designated by the user is designated as the reference template.

位置指定方法が「顔認識」の場合は、対象画像上で顔認識動作を実行し、認識された顔部分の座標が含まれている領域を基準テンプレートに指定する。なお、顔認識にかかる動作は、既知の顔認識技術を用いて制御部210によって実行されるものとする。   When the position designation method is “face recognition”, a face recognition operation is executed on the target image, and an area including the coordinates of the recognized face portion is designated as a reference template. Note that the operation related to face recognition is executed by the control unit 210 using a known face recognition technique.

基準テンプレートを指定すると、距離算出部214は、領域分割がおこなわれた対象画像とは光軸位置の異なる基準画像上で、指定した基準テンプレートを走査する(ステップS102)。ここでは、SSDなどによるテンプレートマッチングにより、基準テンプレートと類似する画像領域を基準画像上で探索する。ここで、SSDによるテンプレートマッチングをおこなった場合、完全に一致する画像があれば、値が0になる。この値は画像間の相違が大きい程大きくなるので、テンプレートマッチングによって得られる値は、テンプレートとの相違度を示すことになる。   When the reference template is designated, the distance calculation unit 214 scans the designated reference template on a reference image having a different optical axis position from the target image subjected to the region division (step S102). Here, an image region similar to the reference template is searched on the reference image by template matching using SSD or the like. Here, when template matching by SSD is performed, the value is 0 if there is an image that completely matches. Since this value increases as the difference between images increases, the value obtained by template matching indicates the degree of difference from the template.

よって、距離算出部214は、基準テンプレートを基準画像上で走査して得られる相違度が最小となる部分が、基準テンプレートに対応する画像領域として特定する(ステップS103)。   Therefore, the distance calculation unit 214 identifies a portion having a minimum difference obtained by scanning the reference template on the reference image as an image region corresponding to the reference template (step S103).

例えば、対象画像上で指定された基準テンプレートが図9(b)でハッチングによって示した領域であるとすると、基準画像上で探索される領域は、例えば、図9(c)でハッチングによって示した領域となる。この場合、各画像上の対応領域の座標は横方向で異なるため、図示するような視差dが生じている。   For example, if the reference template designated on the target image is the area indicated by hatching in FIG. 9B, the area searched on the reference image is indicated by hatching in FIG. 9C, for example. It becomes an area. In this case, since the coordinates of the corresponding area on each image are different in the horizontal direction, a parallax d as illustrated is generated.

よって、距離算出部214は、ステップS103で特定した基準画像上の領域と、対象画像上で指定した基準テンプレートとの座標上の差異を算出する(ステップS104)。   Therefore, the distance calculation unit 214 calculates the difference in coordinates between the region on the reference image specified in step S103 and the reference template specified on the target image (step S104).

このようにして座標上の差異が求められると、三角測量の原理により、基準テンプレートの領域に写っている被写体からデジタルカメラ1までの距離(撮影距離)を算出することができる(ステップS105)。   When the difference in coordinates is obtained in this way, the distance (photographing distance) from the subject in the reference template area to the digital camera 1 can be calculated by the principle of triangulation (step S105).

ここで、本実施形態では、抽出対象とする被写体を被写体Aとし(図8(a)参照)、被写体Aが写っている領域(図9(b)でハッチングによって示した基準テンプレート)の中心位置をA1とし、カメラ座標において座標(X1、Y1、Z1)であるものとする。この場合、図2(b)に示したような平行ステレオ構成のデジタルカメラ1においては、A1の座標(X1、Y1、Z1)はそれぞれ、以下の数1〜数3で表される。ここで、(u1, v1)は、第1撮像部100Aについての画像座標面(すなわち、対象画像)への射影点、(u'1, v'1)は、第2撮像部100Bについての画像座標面(すなわち、基準画像)への射影点を示す。また、bは第1撮像部100Aおよび第2撮像部100Bの光軸間距離(基線間距離)を示す。   Here, in this embodiment, the subject to be extracted is the subject A (see FIG. 8A), and the center position of the region in which the subject A is shown (reference template indicated by hatching in FIG. 9B) Is A1, and the coordinates are (X1, Y1, Z1) in camera coordinates. In this case, in the digital camera 1 having a parallel stereo configuration as shown in FIG. 2B, the coordinates (X1, Y1, Z1) of A1 are represented by the following equations 1 to 3, respectively. Here, (u1, v1) is a projection point on the image coordinate plane (that is, the target image) of the first imaging unit 100A, and (u′1, v′1) is an image of the second imaging unit 100B. A projection point on a coordinate plane (ie, a reference image) is shown. In addition, b indicates the distance between the optical axes (baseline distance) of the first imaging unit 100A and the second imaging unit 100B.

(数1)
X1=(b×(u1))/((u'1)−u1)
(Equation 1)
X1 = (b × (u1)) / ((u′1) −u1)

(数2)
Y1=(b×(v1))/((u'1)−u1)
(Equation 2)
Y1 = (b × (v1)) / ((u′1) −u1)

(数3)
Z1=(b×f)/((u'1)−u1)
(Equation 3)
Z1 = (b × f) / ((u′1) −u1)

ここで、デジタルカメラ1からA1までの距離は、A1の座標Z1によって示されるので、距離算出部214は、上記数3を演算することで、基準テンプレートまでの撮影距離を算出することができる。   Here, since the distance from the digital camera 1 to A1 is indicated by the coordinate Z1 of A1, the distance calculation unit 214 can calculate the shooting distance to the reference template by calculating Equation 3 above.

この数3は、三角測量の原理によって導かれるものである。三角測量の原理を、図10を参照して説明する。   This number 3 is derived by the principle of triangulation. The principle of triangulation will be described with reference to FIG.

図10は、図2(b)に示した平行ステレオ構成におけるカメラ座標を上から見た模式図である。第1撮像部100Aによる視点がカメラ座標となっているので、被写体位置A1のX軸方向の座標はカメラ座標上のX1で与えられ、この数値は図10に示した数式(1)で求められる。   FIG. 10 is a schematic view of the camera coordinates in the parallel stereo configuration shown in FIG. Since the viewpoint by the first imaging unit 100A is the camera coordinate, the coordinate of the subject position A1 in the X-axis direction is given by X1 on the camera coordinate, and this numerical value can be obtained by Expression (1) shown in FIG. .

一方、第2撮像部100Bからの視点におけるA1のX軸方向の座標は、光軸間距離bとカメラ座標のX1との和であり、図10に示した数式(2)で求められ、これらの数式(1)と数式(2)から、上記数3が導き出される。   On the other hand, the coordinate in the X-axis direction of A1 at the viewpoint from the second imaging unit 100B is the sum of the inter-optical axis distance b and the camera coordinate X1, and is obtained by Expression (2) shown in FIG. The above Equation 3 is derived from Equation (1) and Equation (2).

このような三角測量の原理を用いて、基準テンプレートの撮影距離(以下、「基準撮影距離」とする)を算出すると、距離算出部214は、対象画像上で、基準テンプレートに連続して隣接する複数の領域を選択し(ステップS106)、選択した各領域について、上述したようなテンプレートマッチングをおこなう(ステップS107)。   When the shooting distance of the reference template (hereinafter referred to as “reference shooting distance”) is calculated using the principle of triangulation, the distance calculation unit 214 is adjacent to the reference template continuously on the target image. A plurality of regions are selected (step S106), and template matching as described above is performed for each selected region (step S107).

すなわち、抽出を所望する被写体の位置として指定された基準テンプレートであるが、当該基準テンプレートの領域のみで被写体のすべてが含まれているとは限らないため、基準テンプレートに隣接する領域についてテンプレートマッチングをおこなって、被写体Aを示している領域を探索する。   That is, although the reference template is designated as the position of the subject desired to be extracted, but not all of the subject is included only in the region of the reference template, template matching is performed for the region adjacent to the reference template. By doing so, an area indicating the subject A is searched.

この場合、被写体Aが写っている領域は、基準テンプレートについて算出された撮影距離と同一もしくは近似するので、距離算出部214は、選択した領域それぞれの撮影距離をテンプレートマッチングによって算出する。   In this case, since the area where the subject A is shown is the same as or close to the shooting distance calculated for the reference template, the distance calculation unit 214 calculates the shooting distance of each of the selected areas by template matching.

そして、距離算出部214は、基準テンプレートで算出した撮影距離と同一もしくは近似する撮影距離が算出された領域を特定する(ステップS108)。ここで、被写体に奥行きがある場合、基準テンプレートの撮影距離と同一の撮影距離となる領域だけでは、被写体を示すことができない。よって、奥行き方向の距離に一定の範囲を設定し、この範囲内の撮影距離となる領域を特定する。この範囲は、予め既定値が設定されていてもよく、あるいは、本処理をおこなう都度、ユーザに指定させるようにしてもよい。   Then, the distance calculation unit 214 identifies an area where a shooting distance that is the same as or close to the shooting distance calculated by the reference template is calculated (step S108). Here, when the subject has a depth, the subject cannot be shown only by an area having the same shooting distance as that of the reference template. Therefore, a fixed range is set for the distance in the depth direction, and an area that is a shooting distance within this range is specified. A predetermined value may be set in advance for this range, or the range may be specified by the user each time this process is performed.

距離算出部214は、ステップS101で基準テンプレートとして指定した領域と、ステップS108で特定した領域とを、被写体を示す領域の候補、すなわち、抽出する領域の候補とし、各領域を示す画像データを対象画像から抽出する(ステップS109)。   The distance calculation unit 214 sets the area specified as the reference template in step S101 and the area specified in step S108 as candidates for areas indicating subjects, that is, candidates for areas to be extracted, and targets image data indicating each area. Extract from the image (step S109).

このようにして、被写体領域として抽出する候補となる領域が抽出されると、「被写体抽出処理」(図4)のフローに戻る。   When a candidate area to be extracted as a subject area is extracted in this way, the process returns to the “subject extraction process” (FIG. 4).

次に、被写体位置が指定されなかった場合に実行される「候補領域抽出処理(2)」を、図6に示すフローチャートを参照して説明する。   Next, the “candidate area extraction process (2)” executed when the subject position is not designated will be described with reference to the flowchart shown in FIG.

被写体位置が指定された場合は、当該位置を基準テンプレートとしたが、被写体位置が指定されず、撮影距離が最短距離となる部分を被写体位置とする場合には、対象画像上で分割された領域すべてを用いてテンプレートマッチングをおこなう。   When the subject position is specified, the position is set as the reference template. However, when the subject position is not specified and the portion where the shooting distance is the shortest distance is set as the subject position, the area divided on the target image Perform template matching using everything.

よって、距離算出部214はまず、対象画像上で分割された領域にナンバリングをおこない(ステップS201)、領域番号順に順次指定する(ステップS202)。   Therefore, the distance calculation unit 214 first performs numbering on the regions divided on the target image (step S201), and sequentially specifies the region numbers in order (step S202).

この場合、指定した領域をテンプレートとして基準画像上を走査する(ステップS203、ステップS204)。ここでは、上述した「候補領域抽出処理(1)」でおこなったテンプレートマッチングと同様の方法で走査する。   In this case, the reference image is scanned using the designated area as a template (steps S203 and S204). Here, scanning is performed in the same manner as the template matching performed in the “candidate area extraction process (1)” described above.

そして、各テンプレートについて、相違度が最小となる部分を特定すると(ステップS205)、距離算出部214は、当該相違度と閾値を比較する。つまり、撮像画像全体を対象とした場合、視差の影響などにより対応部分が存在しないことがある。よって、相違度が最小となる部分が特定されても、その相違度が所定の閾値より大きい場合には、マッチングの対象から除外する。   Then, when a portion having a minimum difference is specified for each template (step S205), the distance calculation unit 214 compares the difference with a threshold value. That is, when the entire captured image is targeted, there may be no corresponding part due to the influence of parallax or the like. Therefore, even if the part having the smallest difference is specified, if the difference is larger than a predetermined threshold, it is excluded from the matching target.

この場合、距離算出部214は、相違度が閾値以内となる領域については(ステップS206:Yes)、その座標上の差異を算出した上で三角測量の原理で撮影距離を算出し(ステップS207、ステップS208)、その領域の座標と撮影距離をメモリなどに記録する(ステップS209)。   In this case, the distance calculation unit 214 calculates the shooting distance based on the principle of triangulation after calculating the difference on the coordinates for the region where the degree of difference is within the threshold (step S206: Yes) (step S207, In step S208, the coordinates of the area and the shooting distance are recorded in a memory or the like (step S209).

一方、相違度が閾値より大きい場合(ステップS206:No)、このような撮影距離の算出はおこなわない。   On the other hand, when the dissimilarity is larger than the threshold value (step S206: No), such a calculation of the shooting distance is not performed.

このような動作を分割された各領域についておこなう(ステップS210、ステップS211:No)。   Such an operation is performed for each divided area (step S210, step S211: No).

すべての分割領域について上記の処理をおこなうと(ステップS211:Yes)、距離算出部214は、ステップS209で記録した撮影距離に基づき、対象画像上の分割領域の中で、撮影距離が最短となる領域を特定する(ステップS212)。   When the above processing is performed for all the divided areas (step S211: Yes), the distance calculation unit 214 has the shortest shooting distance among the divided areas on the target image based on the shooting distance recorded in step S209. An area is specified (step S212).

抽出を所望する被写体(被写体A)が最も近くにある場合、ステップS212で特定された領域に当該被写体が写っていることになる。よって、距離算出部214は、特定した領域に連続して隣接する領域のうち、撮影距離が所定の範囲内となる領域を特定し(ステップS213)、ステップS212とステップS213で特定した領域を、抽出候補として抽出する(ステップS214)。   When the subject to be extracted (subject A) is closest, the subject is shown in the area specified in step S212. Therefore, the distance calculation unit 214 specifies an area in which the shooting distance is within a predetermined range among areas continuously adjacent to the specified area (Step S213), and the area specified in Step S212 and Step S213 is determined. Extracted as extraction candidates (step S214).

このようにして抽出候補となる領域の画像データを抽出すると、「被写体抽出処理」(図4)のフローに戻る。   When the image data of the extraction candidate area is extracted in this manner, the flow returns to the “subject extraction process” (FIG. 4).

「被写体抽出処理」では、上述した「候補領域抽出処理(1)」または「候補領域抽出処理(2)」で抽出された被写体領域を修正するための「抽出領域修正処理」が被写体抽出部215によって実行される(ステップS300)。   In the “subject extraction process”, the “extraction area correction process” for correcting the subject area extracted in the “candidate area extraction process (1)” or “candidate area extraction process (2)” described above is the subject extraction unit 215. (Step S300).

つまり、撮影距離に基づいて被写体領域を抽出した場合、距離の近い他の被写体が含まれてしまう場合がある。例えば、被写体Aを抽出対象とした場合に抽出された候補領域が、図11(a)にハッチングで示す部分である場合、この領域によって示される画像は、図11(b)に示すように、被写体Aとは異なるものになってしまう。   That is, when the subject area is extracted based on the shooting distance, other subjects that are close in distance may be included. For example, if the candidate area extracted when subject A is an extraction target is a part indicated by hatching in FIG. 11A, the image indicated by this area is as shown in FIG. This is different from the subject A.

このような誤認識を修正するため、被写体抽出部215は「抽出領域修正処理」を実行する。この「抽出領域修正処理」を、図7に示すフローチャートを参照して説明する。   In order to correct such erroneous recognition, the subject extraction unit 215 executes “extraction region correction processing”. This “extraction area correction process” will be described with reference to the flowchart shown in FIG.

処理が開始されると、被写体抽出部215は、候補となった領域にナンバリングをおこない(ステップS301)、候補領域を順次指定する(ステップS302)。   When the process is started, the subject extraction unit 215 performs numbering on the candidate areas (step S301), and sequentially designates candidate areas (step S302).

このとき被写体抽出部215は、修正動作の状態を判定するためのフラグ(状態判定フラグ)に「0」を設定することでリセットする(ステップS303)。   At this time, the subject extraction unit 215 resets the flag (state determination flag) for determining the state of the correction operation by setting “0” (step S303).

被写体抽出部215は、指定した候補領域に隣接する領域(図11(c)参照)で、「候補領域抽出処理(1)」または「候補領域抽出処理(2)」で候補領域とされなかった領域(以下、「隣接非候補領域」とする)を抽出する(ステップS304)。   The subject extraction unit 215 is an area adjacent to the designated candidate area (see FIG. 11C) and has not been selected as a candidate area in the “candidate area extraction process (1)” or “candidate area extraction process (2)”. A region (hereinafter referred to as “adjacent non-candidate region”) is extracted (step S304).

この状態を、図12(a)を参照して説明する。図12(a)は、理解を容易にするため、候補領域と、これに隣接する他の領域を模式的に示したものである。図12(a)に示す候補領域には、複数の隣接領域があるが、このうち、相違度が閾値より大きいと判別された領域については「隣接非候補領域」から除外する。このような領域については、相違度が閾値より大きいと判別された時点で、例えば、マスクするなどにより除外する。   This state will be described with reference to FIG. FIG. 12A schematically shows a candidate area and another area adjacent to the candidate area for easy understanding. The candidate area shown in FIG. 12A includes a plurality of adjacent areas. Of these, areas determined to have a degree of difference greater than the threshold are excluded from “adjacent non-candidate areas”. Such areas are excluded, for example, by masking when it is determined that the degree of difference is greater than the threshold.

被写体抽出部215は、現在対象となっている候補領域に隣接し、かつ、相違度が閾値以内であった非候補領域を「隣接非候補領域」に指定すると、当該候補領域と隣接非候補領域の双方に、図12(a)に示すような判定領域を設定する(ステップS305)。   When the subject extraction unit 215 designates a non-candidate region that is adjacent to the current candidate region and the difference is within a threshold value as an “adjacent non-candidate region”, the subject extraction unit 215 and the adjacent non-candidate region In both cases, a determination area as shown in FIG. 12A is set (step S305).

この判定領域は、例えば、候補領域と隣接非候補領域の境界部分に設定され、例えば、1ピクセル分の幅をもった矩形領域である。なお、判定領域の位置は境界部分に限られるものではなく、例えば、図12(b)に示すように、境界からオフセットした位置に設定してもよい。   This determination area is set, for example, at the boundary portion between the candidate area and the adjacent non-candidate area, and is, for example, a rectangular area having a width of one pixel. Note that the position of the determination region is not limited to the boundary portion, and may be set to a position offset from the boundary as shown in FIG.

被写体抽出部215は、このようにして設定した2つの判定領域間の色間距離を算出する(ステップS306)。ここでは、例えば、各判定領域におけるRGB空間をLab空間に変換し、abのユークリッド間距離を算出することで色間距離を算出する。   The subject extraction unit 215 calculates the inter-color distance between the two determination areas set in this way (step S306). Here, for example, the RGB space in each determination region is converted into a Lab space, and the inter-Euclidean distance is calculated by calculating the inter-Euclidean distance.

被写体抽出部215は、算出した色空間距離を閾値と比較し(ステップS307)、閾値以内の色間距離であれば(ステップS308:Yes)、当該候補領域を、被写体領域としての抽出対象から除外する(ステップS309)。   The subject extraction unit 215 compares the calculated color space distance with a threshold value (step S307), and if the inter-color distance is within the threshold value (step S308: Yes), excludes the candidate area from the extraction target as the subject area. (Step S309).

例えば、図11(a)の例においては、被写体Aを示す領域の他に、被写体Aが置かれていたテーブルの一部が候補として誤認識されているが、誤認識された領域についての隣接非候補領域はテーブル部分を示しているので、色間距離が近いことになる。よって、候補領域と隣接非候補領域との色間距離が閾値以内となる場合には、当該候補領域は誤認識されたものとみなすことができ、この候補領域を除外する。   For example, in the example of FIG. 11A, in addition to the area indicating the subject A, a part of the table on which the subject A is placed is erroneously recognized as a candidate. Since the non-candidate area indicates a table portion, the distance between colors is short. Therefore, when the inter-color distance between the candidate area and the adjacent non-candidate area is within the threshold value, the candidate area can be regarded as being misrecognized, and this candidate area is excluded.

このような、色間距離に基づいて候補領域を除外した場合、被写体抽出部215は、状態判定フラグに「1」を設定する(ステップS310)。   When the candidate area is excluded based on the inter-color distance, the subject extraction unit 215 sets “1” in the state determination flag (step S310).

このような動作を、全ての候補領域についておこなう(ステップS311、ステップS312:No)。   Such an operation is performed for all candidate regions (step S311, step S312: No).

すべての候補領域について上記処理をおこなうと(ステップS312:Yes)、被写体抽出部215は、状態判定フラグが「0」であるか否かを判別する(ステップS313)。上述したように、色間距離に基づいて候補領域の除外がおこなわれると、状態判定フラグが「1」となるが、除外がおこなわれなかった場合(ステップS308:No)には、状態判定フラグは「0」のままとなる。   When the above processing is performed for all candidate regions (step S312: Yes), the subject extraction unit 215 determines whether or not the state determination flag is “0” (step S313). As described above, when the candidate area is excluded based on the inter-color distance, the state determination flag is “1”. However, if the exclusion is not performed (No in step S308), the state determination flag is set. Remains “0”.

状態判定フラグが「1」となっている場合(ステップS313:No)、色間距離に基づいた修正がおこなわれたことになるので、除外後の候補領域を対象としてステップS301〜ステップS312の処理をおこなうことで、より詳細に誤認識領域の除去をおこなう。   When the state determination flag is “1” (step S313: No), the correction based on the inter-color distance has been performed, so the processing of steps S301 to S312 is performed on the candidate area after exclusion. In this way, the erroneous recognition area is removed in more detail.

このような処理を繰り返し、色間距離に基づく修正がなされなくなれば(ステップS313:Yes)、本処理を終了し、「被写体抽出処理」(図4)のフローに戻る。   If such processing is repeated and correction based on the inter-color distance is no longer made (step S313: Yes), this processing ends and the flow returns to the “subject extraction processing” (FIG. 4).

「被写体抽出処理」では、「抽出領域修正処理」で修正された候補領域を被写体領域として抽出する(ステップS16)。この場合、被写体抽出部215は、抽出した被写体領域の画像データから被写体部分のみを示した画像を生成し、例えば、表示部310に表示出力する。また、操作部330の操作によるユーザ指示に基づいて、抽出した被写体画像を記憶部250や外部記憶部260などに保存する。   In the “subject extraction process”, the candidate area corrected by the “extraction area correction process” is extracted as a subject area (step S16). In this case, the subject extraction unit 215 generates an image showing only the subject portion from the extracted image data of the subject region, and displays and outputs the image on the display unit 310, for example. Further, the extracted subject image is stored in the storage unit 250, the external storage unit 260, or the like based on a user instruction by the operation of the operation unit 330.

そして、所定の終了イベント(例えば、画像抽出モードの解除や、デジタルカメラ1の電源オフなど)が発生するまで上述した各処理をおこない(ステップS17:No)、終了イベントの発生により処理を終了する(ステップS17:Yes)。   Then, the above-described processes are performed until a predetermined end event (for example, cancellation of the image extraction mode or power-off of the digital camera 1) occurs (step S17: No), and the process ends when the end event occurs. (Step S17: Yes).

以上説明したように、本発明を上記実施形態の如く適用することにより、撮像画像からの効果的な被写体抽出を効率的におこなうことができる。   As described above, by applying the present invention as in the above embodiment, effective subject extraction from a captured image can be performed efficiently.

つまり、平行ステレオに基づいて得られる光軸の異なる撮像画像から、三角測量の原理で撮影距離を算出することができるので、撮像画像上の領域単位で撮影距離に基づいた領域抽出をおこなうことができ、正確な被写体抽出を自動的におこなうことができる。   In other words, since the shooting distance can be calculated based on the principle of triangulation from captured images with different optical axes obtained based on parallel stereo, it is possible to perform region extraction based on the shooting distance in units of regions on the captured image. And accurate subject extraction can be performed automatically.

この場合において、例えば、色情報や輝度情報などの画素値に基づいた領域分割をおこなってテンプレートマッチングをおこなうので、被写体部分の画像上の特徴がテンプレートとなり、効率的なテンプレートマッチングをおこなうことができる。   In this case, for example, since region matching based on pixel values such as color information and luminance information is performed and template matching is performed, the feature on the image of the subject portion becomes a template, and efficient template matching can be performed. .

また、撮影距離に基づいて被写体領域を特定しているので、撮影距離が最短となる領域を被写体部分として抽出することができ、被写体位置を指定しない場合でも、自動的に被写体領域を抽出することができる。   In addition, since the subject area is specified based on the shooting distance, the area with the shortest shooting distance can be extracted as the subject portion, and the subject area can be automatically extracted even if the subject position is not specified. Can do.

あるいは、被写体位置が指定できる場合には、指定された位置の周辺でマッチングをおこなうので、処理時間を大幅に短縮することができる。   Alternatively, when the subject position can be designated, matching is performed around the designated position, so that the processing time can be greatly shortened.

さらに、撮影距離に基づいて被写体領域の候補を特定し、候補領域に隣接する非候補領域との間の色間距離に基づいて候補を除外するので、撮影距離だけでは誤認識されるような領域のない、より正確な被写体抽出をおこなうことができる。   Furthermore, since the candidate of the subject area is specified based on the shooting distance and the candidate is excluded based on the inter-color distance between the non-candidate areas adjacent to the candidate area, an area that is erroneously recognized only by the shooting distance This makes it possible to extract the subject more accurately without any problem.

上記実施形態は一例であり、本発明の適用範囲はこれに限られない。すなわち、種々の応用が可能であり、あらゆる実施の形態が本発明の範囲に含まれる。   The said embodiment is an example and the application range of this invention is not restricted to this. That is, various applications are possible, and all embodiments are included in the scope of the present invention.

また、上記実施形態では、色情報や輝度情報に基づいて領域分割する例を示したが、テンプレートマッチングをおこなうことができるのであれば、領域分割の方法はこれに限られず任意である。   In the above embodiment, an example is shown in which the region is divided based on the color information and the luminance information. However, as long as template matching can be performed, the region dividing method is not limited to this and is arbitrary.

また、上記実施形態で示した被写体位置を指定する方法は一例であり、これらに限られるものではない。   Further, the method of specifying the subject position shown in the above embodiment is an example, and is not limited thereto.

また、上記実施形態では、誤認識された領域を修正する際に、色間距離に基づく判定をおこなったが、被写体部分を峻別することができるのであれば、判定に用いる方法は任意である。   In the above embodiment, the determination based on the inter-color distance is performed when correcting the misrecognized region. However, as long as the subject portion can be distinguished, the method used for the determination is arbitrary.

なお、本発明を上記実施形態で例示したデジタルカメラ1のような撮像装置で実現する場合においては、本発明にかかる構成や機能を予め備えた撮像装置として提供できる他、制御部210の各機能と同様の機能を実現するプログラムを適用することにより、既存の撮像装置を本発明にかかる撮像装置をして機能させることもできる。この場合、平行ステレオの構成となっている撮像装置であることが望ましいが、撮像手段が単一の撮像装置であっても、同一の被写体について光軸位置の異なる画像を取得することができれば、本発明の適用により、効率的な被写体抽出をおこなうことができる。   In the case where the present invention is realized by an imaging apparatus such as the digital camera 1 exemplified in the above embodiment, each function of the control unit 210 can be provided in addition to the provision of the configuration and functions according to the present invention in advance. By applying a program that realizes the same function as the above, it is possible to make an existing imaging device function as the imaging device according to the present invention. In this case, it is desirable that the imaging device has a parallel stereo configuration, but even if the imaging unit is a single imaging device, if images with different optical axis positions can be acquired for the same subject, By applying the present invention, efficient subject extraction can be performed.

例えば、上記実施形態では、平行ステレオの撮像装置として本発明を実現した場合を例示したが、撮像機能のない装置(例えば、パーソナルコンピュータなど)として本発明の画像処理装置を実現してもよい。   For example, in the above-described embodiment, the case where the present invention is realized as a parallel stereo imaging apparatus is illustrated, but the image processing apparatus of the present invention may be realized as an apparatus having no imaging function (for example, a personal computer).

この場合も、本発明にかかるプログラムを適用することで、既存の装置を本発明にかかる画像処理装置として機能させることができる。   Also in this case, by applying the program according to the present invention, it is possible to cause an existing apparatus to function as the image processing apparatus according to the present invention.

このようなプログラムの適用方法は任意であり、例えば、CD−ROMやメモリカードなどの記憶媒体に格納して適用できる他、例えば、インターネットなどの通信媒体を介して適用することもできる。   The application method of such a program is arbitrary. For example, the program can be applied by being stored in a storage medium such as a CD-ROM or a memory card, or can be applied via a communication medium such as the Internet.

本発明の実施形態にかかるデジタルカメラの構成を示すブロック図である。It is a block diagram which shows the structure of the digital camera concerning embodiment of this invention. 本発明の実施形態にかかるデジタルカメラが複眼カメラ(平行ステレオカメラ)であることを説明するための図であり、(a)はデジタルカメラの外観構成を示し、(b)は平行ステレオの概念を示す。It is a figure for demonstrating that the digital camera concerning embodiment of this invention is a compound eye camera (parallel stereo camera), (a) shows the external appearance structure of a digital camera, (b) shows the concept of parallel stereo. Show. 図1に示す制御部によって実現される機能を示す機能ブロック図である。It is a functional block diagram which shows the function implement | achieved by the control part shown in FIG. 本発明の実施形態にかかる「被写体抽出処理」を説明するためのフローチャートである。It is a flowchart for demonstrating the "subject extraction process" concerning embodiment of this invention. 図4に示す「被写体抽出処理」で実行される「候補領域抽出処理(1)」を説明するためのフローチャートである。5 is a flowchart for explaining a “candidate area extraction process (1)” executed in the “subject extraction process” shown in FIG. 4. 図4に示す「被写体抽出処理」で実行される「候補領域抽出処理(2)」を説明するためのフローチャートである。5 is a flowchart for explaining a “candidate area extraction process (2)” executed in the “subject extraction process” shown in FIG. 4. 図4に示す「被写体抽出処理」で実行される「抽出領域修正処理」を説明するためのフローチャートである。5 is a flowchart for explaining an “extraction region correction process” executed in the “subject extraction process” shown in FIG. 本発明の実施形態で想定する場面を説明するための図であり、(a)は撮影する場面の例を示し、(b)および(c)は撮像された画像の例を示す。It is a figure for demonstrating the scene assumed by embodiment of this invention, (a) shows the example of the scene to image | photograph, (b) and (c) show the example of the imaged image. 図5または図6に示した「候補領域抽出処理(1)」または「候補領域抽出処理(2)」における動作を説明するための図であり、(a)は領域分割された撮像画像の例を示し、(b)はテンプレートとして指定された領域の例を示し、(c)はテンプレートマッチングによって探索された領域の例を示す。FIG. 7 is a diagram for explaining an operation in “candidate area extraction processing (1)” or “candidate area extraction processing (2)” shown in FIG. 5 or FIG. 6, and FIG. (B) shows an example of an area designated as a template, and (c) shows an example of an area searched by template matching. 三角測量の原理を説明するための図である。It is a figure for demonstrating the principle of a triangulation. 図7に示した「抽出領域修正処理」における動作を説明するための図であり、(a)は候補領域が誤認識された場合の例を示し、(b)は候補領域が誤認識された場合の被写体画像の例を示し、(c)は誤認識された領域を修正するために用いられる領域の例を示す。FIGS. 8A and 8B are diagrams for explaining an operation in the “extraction area correction process” shown in FIG. 7, in which FIG. 7A shows an example when a candidate area is erroneously recognized, and FIG. An example of the subject image in this case is shown, and (c) shows an example of the region used for correcting the erroneously recognized region. 図7に示した「抽出領域修正処理」における動作を説明するための図であり、(a)は候補領域と隣接非候補領域に設定される判定領域の例を示し、(b)は候補領域と隣接非候補領域に設定される判定領域の他の例を示す。FIG. 8 is a diagram for explaining an operation in the “extraction area correction process” illustrated in FIG. 7, in which (a) illustrates an example of determination areas set as a candidate area and an adjacent non-candidate area, and (b) illustrates a candidate area. Another example of the determination region set as the adjacent non-candidate region is shown.

符号の説明Explanation of symbols

1…デジタルカメラ、100A…第1撮像部、110A…光学装置、120A…イメージセンサ部、100B…第2撮像部、110B…光学装置、120B…イメージセンサ部、200…データ処理部、210…制御部、211…動作モード処理部、212…撮像制御部、213…画像分割部、214…距離算出部、215…被写体抽出部、220…画像処理部、230…画像メモリ、240…画像出力部、250…記憶部、260…外部記憶部、300…インタフェース部、310…表示部、320…外部インタフェース部、330…操作部 DESCRIPTION OF SYMBOLS 1 ... Digital camera, 100A ... 1st imaging part, 110A ... Optical apparatus, 120A ... Image sensor part, 100B ... 2nd imaging part, 110B ... Optical apparatus, 120B ... Image sensor part, 200 ... Data processing part, 210 ... Control 211, operation mode processing unit, 212 imaging control unit, 213 image division unit, 214 distance calculation unit, 215 subject extraction unit, 220 image processing unit, 230 image memory, 240 image output unit, 250 ... storage unit, 260 ... external storage unit, 300 ... interface unit, 310 ... display unit, 320 ... external interface unit, 330 ... operation unit

Claims (10)

同一の被写体について撮像時の光軸位置が異なる2つの撮像画像を取得する画像取得手段と、
前記画像取得手段が取得した撮像画像の一方を複数の領域に分割する分割手段と、
前記分割された領域をテンプレートとした前記撮像画像の他方に対するテンプレートマッチングにより、前記分割された領域単位で撮影距離を算出する撮影距離算出手段と、
前記撮影距離算出手段が算出した撮影距離に基づいて、前記撮像画像から被写体領域を抽出する抽出手段と、
を備えることを特徴とする画像処理装置。
Image acquisition means for acquiring two captured images having different optical axis positions at the time of imaging for the same subject;
A dividing unit that divides one of the captured images acquired by the image acquiring unit into a plurality of regions;
Shooting distance calculation means for calculating a shooting distance in units of the divided areas by template matching with respect to the other of the captured images using the divided areas as templates;
Extraction means for extracting a subject area from the captured image based on the shooting distance calculated by the shooting distance calculation means;
An image processing apparatus comprising:
前記分割手段は、前記撮像画像における画素値に基づいて前記複数の領域に分割する、
ことを特徴とする請求項1に記載の画像処理装置。
The dividing unit divides the plurality of regions based on pixel values in the captured image.
The image processing apparatus according to claim 1.
前記抽出手段は、前記撮影距離が最も短い領域と、前記撮影距離に基づいて該領域と連続する領域と、を前記被写体領域として抽出する、
ことを特徴とする請求項1または2に記載の画像処理装置。
The extraction means extracts, as the subject area, an area having the shortest shooting distance and an area continuous with the area based on the shooting distance;
The image processing apparatus according to claim 1, wherein the image processing apparatus is an image processing apparatus.
前記抽出手段は、前記撮像画像の中央にある領域と、前記撮影距離に基づいて該領域と連続する領域と、を前記被写体領域として抽出する、
ことを特徴とする請求項1または2に記載の画像処理装置。
The extraction means extracts an area in the center of the captured image and an area continuous with the area based on the shooting distance as the subject area.
The image processing apparatus according to claim 1, wherein the image processing apparatus is an image processing apparatus.
前記抽出手段は、前記撮像画像上で指定された位置にある領域と、前記撮影距離に基づいて該領域と連続する領域と、を前記被写体領域として抽出する、
ことを特徴とする請求項1または2に記載の画像処理装置。
The extraction means extracts, as the subject area, an area at a position designated on the captured image and an area continuous with the area based on the shooting distance;
The image processing apparatus according to claim 1, wherein the image processing apparatus is an image processing apparatus.
前記撮像画像上で人物の顔を認識する顔認識手段をさらに備え、
前記抽出手段は、前記顔認識手段が認識した顔部分の領域と、前記撮影距離に基づいた該領域に連結する領域と、を前記被写体領域として抽出する、
ことを特徴とする請求項1または2に記載の画像処理装置。
Further comprising face recognition means for recognizing a human face on the captured image;
The extraction means extracts a face part area recognized by the face recognition means and an area connected to the area based on the shooting distance as the subject area;
The image processing apparatus according to claim 1, wherein the image processing apparatus is an image processing apparatus.
前記抽出手段は、
被写体領域として抽出した領域を候補領域とし、該候補領域に隣接する非候補領域との色間距離を算出する色間距離算出手段と、
前記色間距離算出手段が算出した色間距離に基づいて、前記候補領域を候補から除外する除外手段と、をさらに備える、
ことを特徴とする請求項1乃至6のいずれか1項に記載の画像処理装置。
The extraction means includes
An inter-color distance calculating means for calculating an inter-color distance with a non-candidate area adjacent to the candidate area, the area extracted as the subject area;
Exclusion means for excluding the candidate region from candidates based on the intercolor distance calculated by the intercolor distance calculation means,
The image processing apparatus according to claim 1, wherein the image processing apparatus is an image processing apparatus.
前記画像取得手段は、前記2つの撮像画像を取得する平行ステレオカメラを備える、
ことを特徴とする請求項1乃至7のいずれか1項に記載の画像処理装置。
The image acquisition means includes a parallel stereo camera that acquires the two captured images.
The image processing apparatus according to claim 1, wherein the image processing apparatus is an image processing apparatus.
同一の被写体について撮像時の光軸位置が異なる2つの撮像画像から被写体領域を抽出する画像抽出方法であって、
前記2つの撮像画像を取得する画像取得ステップと、
前記画像取得ステップで取得した撮像画像の一方を複数の領域に分割する分割ステップと、
前記分割された領域をテンプレートとした前記撮像画像の他方に対するテンプレートマッチングにより、前記分割された領域単位で撮影距離を算出する撮影距離算出ステップと、
前記撮影距離算出ステップで算出された撮影距離に基づいて、前記撮像画像から被写体領域を抽出する抽出ステップと、
を含むことを特徴とする画像抽出方法。
An image extraction method for extracting a subject area from two captured images having different optical axis positions at the time of imaging for the same subject,
An image acquisition step of acquiring the two captured images;
A division step of dividing one of the captured images acquired in the image acquisition step into a plurality of regions;
A shooting distance calculating step of calculating a shooting distance in units of the divided areas by template matching for the other of the captured images using the divided areas as templates;
An extraction step of extracting a subject area from the captured image based on the shooting distance calculated in the shooting distance calculation step;
An image extraction method comprising:
コンピュータに、
同一の被写体について撮像時の光軸位置が異なる2つの撮像画像を取得する機能と、
前記取得した撮像画像の一方を複数の領域に分割する機能と、
前記分割された領域をテンプレートとした前記撮像画像の他方に対するテンプレートマッチングにより、前記分割された領域単位で撮影距離を算出する機能と、
前記算出した撮影距離に基づいて、前記撮像画像から被写体領域を抽出する機能と、
を実現させることを特徴とするプログラム。
On the computer,
A function of acquiring two captured images having different optical axis positions at the time of imaging for the same subject;
A function of dividing one of the acquired captured images into a plurality of regions;
A function of calculating a shooting distance in units of the divided areas by template matching for the other of the captured images using the divided areas as templates;
A function of extracting a subject area from the captured image based on the calculated shooting distance;
A program characterized by realizing.
JP2008331103A 2008-12-25 2008-12-25 Image processing apparatus, image extraction method, and, program Pending JP2010154323A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008331103A JP2010154323A (en) 2008-12-25 2008-12-25 Image processing apparatus, image extraction method, and, program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008331103A JP2010154323A (en) 2008-12-25 2008-12-25 Image processing apparatus, image extraction method, and, program

Publications (1)

Publication Number Publication Date
JP2010154323A true JP2010154323A (en) 2010-07-08

Family

ID=42572855

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008331103A Pending JP2010154323A (en) 2008-12-25 2008-12-25 Image processing apparatus, image extraction method, and, program

Country Status (1)

Country Link
JP (1) JP2010154323A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012249149A (en) * 2011-05-30 2012-12-13 Canon Inc Image processing device, image processing method and program thereof
JP2013017053A (en) * 2011-07-04 2013-01-24 Taisei Corp Panoramic image distance calculation device
WO2016002296A1 (en) * 2014-07-01 2016-01-07 ソニー株式会社 Optical control device and optical control method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002366963A (en) * 2001-06-12 2002-12-20 Ricoh Co Ltd Method and device for processing image, imaging device and computer program
JP2006301962A (en) * 2005-04-20 2006-11-02 Toyota Motor Corp Image processing method and image processor
JP2006310979A (en) * 2005-04-26 2006-11-09 Fuji Photo Film Co Ltd Imaging apparatus
JP2008021224A (en) * 2006-07-14 2008-01-31 Digital Fashion Ltd Image processing program, image processing method and image processor
JP2008187260A (en) * 2007-01-26 2008-08-14 Nikon Corp Imaging device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002366963A (en) * 2001-06-12 2002-12-20 Ricoh Co Ltd Method and device for processing image, imaging device and computer program
JP2006301962A (en) * 2005-04-20 2006-11-02 Toyota Motor Corp Image processing method and image processor
JP2006310979A (en) * 2005-04-26 2006-11-09 Fuji Photo Film Co Ltd Imaging apparatus
JP2008021224A (en) * 2006-07-14 2008-01-31 Digital Fashion Ltd Image processing program, image processing method and image processor
JP2008187260A (en) * 2007-01-26 2008-08-14 Nikon Corp Imaging device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012249149A (en) * 2011-05-30 2012-12-13 Canon Inc Image processing device, image processing method and program thereof
JP2013017053A (en) * 2011-07-04 2013-01-24 Taisei Corp Panoramic image distance calculation device
WO2016002296A1 (en) * 2014-07-01 2016-01-07 ソニー株式会社 Optical control device and optical control method

Similar Documents

Publication Publication Date Title
JP4983905B2 (en) Imaging apparatus, 3D modeling data generation method, and program
JP4752918B2 (en) Image processing apparatus, image collation method, and program
KR20160028490A (en) Image processing apparatus, image processing method, and imaging system
CN111726521B (en) Photographing method and photographing device of terminal and terminal
JP6020471B2 (en) Image processing method, image processing apparatus, and image processing program
JP6218378B2 (en) Image processing apparatus and image processing method
JP2010166545A (en) Image pickup device, flash image generating method, and program
JP2014143673A (en) Image processing device, image capturing apparatus, image processing method and recording medium
JP2019106045A (en) Image processing device, method, and program
JP2011191568A (en) Imaging device, display method and program
JP5310837B2 (en) Image generating apparatus, digital camera, method, and program
JP6635764B2 (en) Imaging device, control method thereof, and control program
JP2009111716A (en) Imaging apparatus, program and template generating method
JP2009053786A (en) Image processor, imaging apparatus, image processing method, and program
JP2010154323A (en) Image processing apparatus, image extraction method, and, program
JP2013195577A (en) Imaging device, imaging method, and program
JP2019175112A (en) Image processing device, photographing device, image processing method, and program
JP2018182700A (en) Image processing apparatus, control method of the same, program, and storage medium
WO2015198478A1 (en) Image distortion correction apparatus, information processing apparatus and image distortion correction method
JP5359930B2 (en) Imaging apparatus, display method, and program
JP2019191661A (en) Image processing apparatus, imaging device, image processing method, and program
JP6604760B2 (en) Image processing apparatus, control method therefor, and program
JP7373297B2 (en) Image processing device, image processing method and program
JP2012073930A (en) Image processing apparatus, image processing method, and program
CN109214983B (en) Image acquisition device and image splicing method thereof

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110826

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120906

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120911

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20130723