JP4894278B2 - Camera apparatus and camera control program - Google Patents

Camera apparatus and camera control program Download PDF

Info

Publication number
JP4894278B2
JP4894278B2 JP2006026481A JP2006026481A JP4894278B2 JP 4894278 B2 JP4894278 B2 JP 4894278B2 JP 2006026481 A JP2006026481 A JP 2006026481A JP 2006026481 A JP2006026481 A JP 2006026481A JP 4894278 B2 JP4894278 B2 JP 4894278B2
Authority
JP
Japan
Prior art keywords
image
subject
shooting
display
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2006026481A
Other languages
Japanese (ja)
Other versions
JP2007208757A (en
Inventor
一記 喜多
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 JP2006026481A priority Critical patent/JP4894278B2/en
Publication of JP2007208757A publication Critical patent/JP2007208757A/en
Application granted granted Critical
Publication of JP4894278B2 publication Critical patent/JP4894278B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、被写体の計数機能を備えたカメラ装置、及びカメラ装置に被写体の計数機能を付与するカメラ制御プログラムに関する。   The present invention relates to a camera device having a subject counting function, and a camera control program for giving a subject counting function to the camera device.

従来、被写体を認識する機能を備えたカメラ装置が提案されている。この機能を備えたカメラ装置は、主被写体が人物か否かを判定し、人物であると判定されたときと、人物以外であると判定されたときとで、異なる露出設定を行う(特許文献1参照)。
特開平05−041830号公報
Conventionally, a camera apparatus having a function of recognizing a subject has been proposed. The camera device having this function determines whether or not the main subject is a person, and performs different exposure settings when it is determined that the main subject is a person and when it is determined that the main subject is not a person (Patent Literature). 1).
JP 05-041830 A

ところで、集合写真を撮影する場合において、全員が集合しているか否かを確認するために、撮影者等が目視により集合者の人数を確認することはよく見られる光景である。このとき、人物であると判定した被写体に基づき人数をカウントする機能をカメラ装置に付加すれば、撮影者等が目視により人数を確認する煩雑な撮影前動作が不要となり、利便性が得られる。しかし、集合写真の撮影場所は一般に観光地等であって、集合者の周囲には無関係が人々が不可避的に存在する。したがって、単に結像した被写体像に基づき人数をカウントする機能を付加しても、集合すべき者の人数等の所望の被写体の数を適正にカウントすることはできない。   By the way, when taking a group photo, it is a common scene that a photographer or the like visually confirms the number of gatherers in order to confirm whether or not everyone is gathering. At this time, if a function for counting the number of persons based on the subject determined to be a person is added to the camera device, a complicated pre-shooting operation in which a photographer or the like visually confirms the number of persons becomes unnecessary, and convenience is obtained. However, a group photo is generally taken at a sightseeing spot, and there are unavoidable people around the gathering. Therefore, the number of desired subjects such as the number of persons to be gathered cannot be properly counted even if a function of counting the number of people based on the formed subject image is added.

本発明は、かかる従来の課題に鑑みてなされたものであり、所望の被写体の数を適正にカウントすることのできるカメラ装置及びカメラ制御プログラムを提供することを目的とする。   The present invention has been made in view of such conventional problems, and an object of the present invention is to provide a camera device and a camera control program capable of appropriately counting the number of desired subjects.

請求項1記載の発明は、  The invention described in claim 1
被写体を結像させる結像手段と、  Imaging means for imaging a subject;
この結像手段により結像される画像を表示する表示手段と、  Display means for displaying an image formed by the imaging means;
前記表示手段に表示された画像内から計数の対照となる複数の被写体を任意に選択する選択手段と、  A selection means for arbitrarily selecting a plurality of subjects to be counted from the image displayed on the display means;
前記表示手段に表示された画像内において、各被写体から抽出された特徴データとの類似度が所定以上である画像部分の個数を被写体毎に計数する計数手段と、  Counting means for counting, for each subject, the number of image portions whose similarity with feature data extracted from each subject is greater than or equal to a predetermined value in the image displayed on the display means;
前記計数手段により各被写体毎に計数された個数を、各被写体毎に区別して前記表示手段に同時に表示させる表示制御手段と、  Display control means for simultaneously displaying the number counted for each subject by the counting means on the display means while distinguishing for each subject;
を備えることを特徴とする。  It is characterized by providing.
請求項2記載の発明は、更に、  The invention according to claim 2 further includes
前記表示制御手段は、前記選択手段により選択された複数の被写体の各々について、各被写体のサンプル画像と各被写体の個数とを対応付けて前記表示手段に同時に表示することを特徴とする。  The display control means displays a sample image of each subject and the number of each subject in association with each other on the display means for each of the plurality of subjects selected by the selection means.
請求項3記載の発明は、更に、  The invention according to claim 3 further includes
前記表示制御手段は、前記表示手段に表示した画像内において、前記計数手段により計数された各被写体に対応する画像部分を識別表示した状態で、各被写体のサンプル画像と各被写体の個数とを対応付けて同時に表示することを特徴とする。  The display control means associates the sample image of each subject with the number of each subject in a state where the image portion corresponding to each subject counted by the counting means is identified and displayed in the image displayed on the display means. It is characterized by being displayed at the same time.
請求項4記載の発明は、更に、  The invention according to claim 4 further includes
前記表示制御手段は、複数の被写体の各々に対応した異なる形状で塗りつぶしを行って、各被写体に対応する画像部分を識別表示することを特徴とする。  The display control means performs painting with different shapes corresponding to each of a plurality of subjects to identify and display an image portion corresponding to each subject.
請求項5記載の発明は、更に、  The invention according to claim 5 further includes:
操作に応じて位置が任意に変位するカーソルを前記表示手段に表示し、このカーソルで指定される2点を対角とする任意の領域を指定する領域指定手段を更に備え、  A cursor whose position is arbitrarily displaced in accordance with the operation is displayed on the display means, and further includes an area designating means for designating an arbitrary area whose diagonals are two points designated by the cursor,
前記計数手段は、前記領域指定手段により指定された領域内において、各被写体から抽出された特徴データとの類似度が所定以上である画像部分の個数を計数することを特徴とする。  The counting means counts the number of image portions whose similarity with the feature data extracted from each subject is greater than or equal to a predetermined value in the area specified by the area specifying means.
請求項6記載の発明は、更に、  The invention described in claim 6 further includes:
操作に応じて位置が任意に変位するカーソルを前記表示手段に表示し、このカーソルで示される任意の位置を指定する位置指定手段を更に備え、  A cursor whose position is arbitrarily displaced according to the operation is displayed on the display means, and further includes a position designation means for designating an arbitrary position indicated by the cursor,
前記選択手段は、前記位置指定手段により指定された位置にある被写体を選択することを特徴とする。  The selection means selects a subject at a position designated by the position designation means.
請求項7記載の発明は、更に、  The invention according to claim 7 further includes
前記位置指定手段は、操作に応じて位置と大きさが任意に変位するカーソルを前記表示手段に表示し、このカーソルで示される任意の位置と大きさを指定し、  The position specifying means displays a cursor whose position and size are arbitrarily displaced according to an operation on the display means, and specifies an arbitrary position and size indicated by the cursor,
前記選択手段は、前記位置指定手段により指定された位置と大きさに対応する領域内から被写体を選択することを特徴とする。  The selection unit selects a subject from an area corresponding to the position and size designated by the position designation unit.
請求項8記載の発明は、更に、  The invention described in claim 8 further includes:
前記計数手段により計数された前記画像部分の個数に基づき、当該カメラ装置の撮影動作を制御する撮影制御手段を更に備えることを特徴とする。  The image pickup apparatus further includes shooting control means for controlling a shooting operation of the camera device based on the number of the image portions counted by the counting means.
請求項9記載の発明は、更に、  The invention according to claim 9 further includes
複数の撮影シーンの各々対応して撮影条件を記憶した記憶手段と、  Storage means for storing shooting conditions corresponding to each of a plurality of shooting scenes;
前記計数手段により計数された前記画像部分の個数に基づき、前記複数の撮影シーンのいずれかを選択する選択手段と、  Selection means for selecting one of the plurality of shooting scenes based on the number of the image portions counted by the counting means;
この選択手段により選択された撮影シーンに対応して前記記憶手段に記憶されている前記撮影条件に基づき、当該カメラ装置の撮影動作を制御する撮影制御手段を更に備えることを特徴とする。  The image processing apparatus further includes shooting control means for controlling the shooting operation of the camera device based on the shooting conditions stored in the storage means corresponding to the shooting scene selected by the selection means.
請求項10記載の発明は、更に、  The invention described in claim 10 further includes:
撮影者の指示操作に基づき、前記複数の撮影シーンのいずれかを選択する指示選択手段を備え、  An instruction selecting means for selecting any of the plurality of shooting scenes based on a photographer's instruction operation;
前記撮影制御手段は、前記指示選択手段により撮影シーンが選択された場合には、該撮影シーンに対応して前記記憶手段に記憶されている前記撮影条件に基づき、当該カメラ装置の撮影動作を制御することを特徴とする。  When the shooting scene is selected by the instruction selection unit, the shooting control unit controls the shooting operation of the camera device based on the shooting condition stored in the storage unit corresponding to the shooting scene. It is characterized by doing.
請求項11記載の発明は、更に、  The invention described in claim 11 further includes:
前記撮影制御手段は、当該カメラ装置の合焦動作、被写界深度、露出条件、フィルタ処理の少なくとも一つを制御することを特徴とする。  The imaging control unit controls at least one of a focusing operation, a depth of field, an exposure condition, and a filtering process of the camera device.
請求項12記載の発明は、  The invention according to claim 12
被写体を結像させる結像手段と、この結像手段により結像される画像を表示する表示手段とを備えるカメラ装置が有するコンピュータを、  A computer having a camera device including an image forming means for forming an image of a subject and a display means for displaying an image formed by the image forming means;
前記表示手段に表示された画像内から計数の対照となる複数の被写体を任意に選択する選択手段と、  A selection means for arbitrarily selecting a plurality of subjects to be counted from the image displayed on the display means;
前記表示手段に表示された画像内において、各被写体から抽出された特徴データとの類似度が所定以上である画像部分の個数を被写体毎に計数する計数手段と、  Counting means for counting, for each subject, the number of image portions whose similarity with feature data extracted from each subject is greater than or equal to a predetermined value in the image displayed on the display means;
前記計数手段により各被写体毎に計数された個数を、各被写体毎に区別して前記表示手段に表示させる表示制御手段と、  Display control means for causing the display means to display the number counted for each subject by the counting means for each subject;
して機能させることを特徴とする。  It is characterized by functioning.

以上説明したように本発明によれば、撮像して表示された画像内から計数の対照となる複数の被写体を任意に選択し、この選択された各被写体毎に計数された個数を、各被写体毎に区別して表示手段に同時に表示させることで、任意に選択した複数の被写体の各々の個数を同時に表示して比較確認することが可能となる。 As described above, according to the present invention, a plurality of subjects to be counted are arbitrarily selected from within an image captured and displayed, and the number counted for each selected subject is determined as each subject. By distinguishing them and displaying them simultaneously on the display means, it is possible to simultaneously display the number of each of a plurality of arbitrarily selected subjects for comparison and confirmation .

以下、本発明の一実施の形態を図に従って説明する。   Hereinafter, an embodiment of the present invention will be described with reference to the drawings.

(第1の実施の形態)
図1(A)は各実施の形態に共通するデジタルカメラ1の正面図、(B)は背面図、(C)は側面透視図である。このデジタルカメラ1の本体2には、その上面部に半押し機能を備えたレリーズ釦(シャッタースイッチ)3と電源スイッチ4とが配置されており、正面部にはグリップ部5、ストロボ6及び撮像レンズ部の受光窓7が配置されている。また、背面部には、モード切替スイッチ8、ズーム操作キー9、左右上下操作部を有するカーソルキー10、決定/OKキー11、DISPキー12、メニューキー13及び電子ファインダとしても機能するLCDからなる表示部14が配置されているとともに、メモリ媒体と電池とを収納するメモリ媒体/電池収納部15が設けられている。また、回動式ミラー18、レンズ群19及びCCD等で構成される撮像素子20等が配置されている。
(First embodiment)
1A is a front view of a digital camera 1 common to each embodiment, FIG. 1B is a rear view, and FIG. 1C is a side perspective view. The main body 2 of the digital camera 1 is provided with a release button (shutter switch) 3 and a power switch 4 having a half-press function on the upper surface portion, and a grip portion 5, a strobe 6 and an image pickup device on the front portion. A light receiving window 7 of the lens unit is arranged. Further, on the back side, a mode changeover switch 8, a zoom operation key 9, a cursor key 10 having a left / right / up / down operation unit, an enter / OK key 11, a DISP key 12, a menu key 13 and an LCD functioning also as an electronic viewfinder are provided. A display unit 14 is disposed, and a memory medium / battery storage unit 15 for storing a memory medium and a battery is provided. In addition, an image pickup device 20 including a rotary mirror 18, a lens group 19, a CCD, and the like are disposed.

図2は、デジタルカメラ1の概略的回路構成を示すブロック図である。このデジタルカメラ1は、主制御手段100、撮影制御手段101及び画像処理手段102を備えている。主制御手段100は、抽出領域の選択手段103、テンプレート設定手段104、特徴データのテンプレートメモリ105及び撮影シーン設定手段106を有し、抽出領域の選択手段103にはカーソル操作手段107からのカーソル操作情報が入力され、撮影シーン設定手段106にはモード選択操作手段108からのモード選択操作情報が入力される。撮影制御手段101には、撮影シーン選択手段103からの設定情報、後述する認識処理ブロック からの認識情報、測光手段109からの測光情報、測距手段110からの測距情報が入力される。撮影制御手段101は、これら入力情報に基づき、照明手段111、光学系駆動部112、絞り/シャッター駆動部113、撮像駆動部114及び信号処理手段115を制御する。   FIG. 2 is a block diagram illustrating a schematic circuit configuration of the digital camera 1. The digital camera 1 includes a main control unit 100, an imaging control unit 101, and an image processing unit 102. The main control unit 100 includes an extraction region selection unit 103, a template setting unit 104, a feature data template memory 105, and a shooting scene setting unit 106. The extraction region selection unit 103 includes a cursor operation from the cursor operation unit 107. The information is input, and the mode selection operation information from the mode selection operation unit 108 is input to the shooting scene setting unit 106. The shooting control unit 101 receives setting information from the shooting scene selection unit 103, recognition information from a recognition processing block described later, photometry information from the photometry unit 109, and distance measurement information from the range finding unit 110. The imaging control unit 101 controls the illumination unit 111, the optical system driving unit 112, the aperture / shutter driving unit 113, the imaging driving unit 114, and the signal processing unit 115 based on the input information.

他方、撮影光学系116の光軸上には、絞り117、シャッター118及び撮像手段119が配置されている。撮影光学系116は、光学系駆動部112により、絞り117とシャッター118は絞り/シャッター駆動部113により、撮像手段119は撮像駆動部114により各々駆動される。信号処理手段115は、撮像手段119からのアナログ信号を処理するとともにデジタル信号に変換し、このデジタル画像信号は画像バッファメモリ120を介して、前記画像信号処理手段102に入力される。   On the other hand, an aperture 117, a shutter 118, and an imaging unit 119 are disposed on the optical axis of the photographing optical system 116. The photographing optical system 116 is driven by the optical system driving unit 112, the diaphragm 117 and the shutter 118 are driven by the diaphragm / shutter driving unit 113, and the imaging unit 119 is driven by the imaging driving unit 114, respectively. The signal processing unit 115 processes the analog signal from the imaging unit 119 and converts it into a digital signal, and this digital image signal is input to the image signal processing unit 102 via the image buffer memory 120.

画像処理手段102は、前処理ブロック121、特徴抽出ブロック122及び認識処理ブロック123を有している。この画像処理手段102において、各ブロック121〜123を経由しない画像バッファメモリ120からの画像データは、画像圧縮/符号化手段124に入力される一方、各ブロック121〜123を経由した画像データは、画像圧縮/符号化手段124と前記撮影制御手段101とに入力される。前記画像圧縮/符号化手段124は、これら画像データを圧縮及び符号化処理し、この処理された画像データは画像記録手段125に記録される。また、特徴抽出ブロック122からの情報は、前記特徴データのテンプレートメモリ105に入力されて記憶されるように構成されている。   The image processing unit 102 includes a preprocessing block 121, a feature extraction block 122, and a recognition processing block 123. In this image processing means 102, image data from the image buffer memory 120 that does not pass through the blocks 121 to 123 is input to the image compression / encoding means 124, while image data that passes through the blocks 121 to 123 is The data is input to the image compression / encoding unit 124 and the photographing control unit 101. The image compression / encoding unit 124 compresses and encodes these image data, and the processed image data is recorded in the image recording unit 125. The information from the feature extraction block 122 is configured to be input and stored in the template memory 105 of the feature data.

図3は、デジタルカメラ1の具体的回路構成を示すブロック図である。図において、操作部23は、前記レリーズ釦3や電源スイッチ4等の図1に示したスイッチやキー群等で構成され、このスイッチ及びキー群の操作情報は、入力回路24を介して、制御部25に入力される。制御部25は、CPU及びその周辺回路と、CPUの作業用メモリであるRAM等から構成されるマイクロコンピュータであり、各部を制御する。   FIG. 3 is a block diagram showing a specific circuit configuration of the digital camera 1. In the figure, the operation unit 23 is composed of the switches and key groups shown in FIG. 1 such as the release button 3 and the power switch 4, and the operation information of the switches and key groups is controlled via the input circuit 24. Input to the unit 25. The control unit 25 is a microcomputer including a CPU and its peripheral circuits, a RAM that is a working memory of the CPU, and the like, and controls each unit.

この制御部25には、表示メモリ26、表示駆動ブロック27、画像バッファメモリ28、画像信号処理部29、圧縮符号化/伸長復号化部30、静止画/動画画像メモリ31、プログラムメモリ32、データメモリ33、メモリIF34、外部I/Oインターフェース35、通信制御ブロック36、電源制御ブロック37及び撮影制御部38が接続されている。表示メモリ26には、表示部14に表示される各種表示データが一時的に記憶される。表示駆動ブロック27は、前記表示部14を駆動し、画像バッファメモリ28は、画像データを処理する際等において一時的に格納する。   The control unit 25 includes a display memory 26, a display drive block 27, an image buffer memory 28, an image signal processing unit 29, a compression encoding / decompression decoding unit 30, a still image / moving image memory 31, a program memory 32, data A memory 33, a memory IF 34, an external I / O interface 35, a communication control block 36, a power supply control block 37, and a photographing control unit 38 are connected. The display memory 26 temporarily stores various display data displayed on the display unit 14. The display drive block 27 drives the display unit 14, and the image buffer memory 28 temporarily stores the image data when processing it.

画像信号処理部29は、後述する撮像素子から制御部25が取り込んだ画像信号に対する各種処理を実行するDSPからなる。圧縮符号化/伸長復号化部30は、この画像信号処理部で処理された画像データを記録時には伸長処理し、記録した画像データを再生する際には伸長復号化する。静止画/動画画像メモリ31は、レリーズ釦3の操作により撮像された画像データ(静止画像データ)を記録保存する。プログラムメモリ32は、後述するフローチャートに示す制御部25の制御プログラム、及び「人物撮影モード」「夜景撮影モード」等の撮影シーン毎の撮影制御プログラム、撮影シーン毎の対象被写体の種別情報、該対象被写体の種別に対応する特徴量データ等が記憶されている。   The image signal processing unit 29 is a DSP that executes various processes on an image signal taken in by the control unit 25 from an image sensor described later. The compression encoding / decompression decoding unit 30 decompresses the image data processed by the image signal processing unit at the time of recording, and decompresses and decodes the recorded image data at the time of reproduction. The still image / moving image memory 31 records and saves image data (still image data) captured by operating the release button 3. The program memory 32 includes a control program of the control unit 25 shown in a flowchart to be described later, a shooting control program for each shooting scene such as “person shooting mode” and “night scene shooting mode”, target subject type information for each shooting scene, the target Feature amount data corresponding to the type of subject is stored.

データメモリ33は各種データが予め格納されているとともに画像データ以外の他のデータを格納し、また、後述するフローチャートに示すテンプレートメモリとしても機能する。メモリIF34は、着脱自在な外部メモリ媒体39に接続されている。外部I/Oインターフェース35は、USBコネクタ40に接続され、通信制御ブロック36は無線LAN等送受信部41を介してアンテナ42に接続され、電源制御ブロック37には、電池43が接続されている。電池43からの電力は電源制御ブロック37及び制御部25を介して各部に供給される。   The data memory 33 stores various data in advance and stores data other than the image data, and also functions as a template memory shown in a flowchart described later. The memory IF 34 is connected to a removable external memory medium 39. The external I / O interface 35 is connected to the USB connector 40, the communication control block 36 is connected to the antenna 42 via the wireless LAN transmission / reception unit 41, and the battery 43 is connected to the power control block 37. The electric power from the battery 43 is supplied to each unit via the power control block 37 and the control unit 25.

前記撮影制御部38には、前記ストロボ6の照射角を駆動する照射各駆動部44、照射を駆動するストロボ照明駆動部45とが接続されているとともに、測光、測距センサ46の受光角を駆動する受光角駆動部47、測光、測距センサ46から色温度を検出して出力する色温度検出部48、測光データを検出して出力する測光部49及び測距データを検出して出力する測距部50が接続されている。さらに前記撮影制御部38には、前記第1及び第2角速度センサ17、17が各々角速度検出部51、52、積分器53、54を介して接続されている。   The photographing control unit 38 is connected to each irradiation drive unit 44 for driving the irradiation angle of the strobe 6 and a strobe illumination driving unit 45 for driving the irradiation. The light receiving angle driving unit 47 to be driven, the color temperature detecting unit 48 for detecting and outputting the color temperature from the photometric / ranging sensor 46, the photometric unit 49 for detecting and outputting the photometric data, and the distance measuring data are detected and output. A distance measuring unit 50 is connected. Furthermore, the first and second angular velocity sensors 17 and 17 are connected to the photographing control unit 38 via angular velocity detectors 51 and 52 and integrators 53 and 54, respectively.

一方、ズームレンズユニット55には、前記回動式ミラー18、レンズ群19及び撮像素子20が配置されているとともに、この回動式ミラー18を回転駆動する駆動機構56、前記レンズ群19中に介挿された絞り57が設けられており、また、撮像素子20の前面にはシャッター58が配置されている。   On the other hand, the zoom lens unit 55 is provided with the rotary mirror 18, the lens group 19, and the imaging device 20, and a drive mechanism 56 that rotationally drives the rotary mirror 18 and the lens group 19. An inserted diaphragm 57 is provided, and a shutter 58 is disposed in front of the image sensor 20.

さらに、前記撮影制御部38には、電動ミラーY方向駆動部59、電動ミラーX方向駆動部60、フォーカスレンズ駆動部61、ズームレンズ駆動部62、絞り駆動部63、シャッター駆動部64、映像信号処理部65及びタイミング制御&ドライバ66が接続されている。電動ミラーY方向駆動部59は、駆動機構56を駆動して回動式ミラー18を上下方向に動作させるものであり、電動ミラーX方向駆動部60は左右方向に動作させるものである。フォーカスレンズ駆動部61は、レンズ群19中のフォーカスレンズを駆動するものであり、ズームレンズ駆動部62は、ズーム操作キー9の操作に応じて被写体像を拡大または縮小すべくレンズ群19中ズームレンズを駆動するものである。また、 絞り駆動部63は前記絞り57を駆動するものであり、シャッター駆動部64は前記シャッター58を駆動するものである。前記映像信号処理部65は、撮像素子20からのアナログ信号をデジタル信号に変換するA/D回路及びこのA/D回路からのデジタル撮像信号を保持するCDSと、CDSから撮像信号を供給されるアナログアンプであるゲイン調整アンプ(AGC)等からなる。   Further, the photographing control unit 38 includes an electric mirror Y direction driving unit 59, an electric mirror X direction driving unit 60, a focus lens driving unit 61, a zoom lens driving unit 62, an aperture driving unit 63, a shutter driving unit 64, and a video signal. A processing unit 65 and a timing control & driver 66 are connected. The electric mirror Y direction drive unit 59 drives the drive mechanism 56 to operate the rotary mirror 18 in the vertical direction, and the electric mirror X direction drive unit 60 operates in the left and right direction. The focus lens driving unit 61 drives the focus lens in the lens group 19, and the zoom lens driving unit 62 zooms in the lens group 19 to enlarge or reduce the subject image in accordance with the operation of the zoom operation key 9. The lens is driven. The aperture driving unit 63 drives the aperture 57, and the shutter driving unit 64 drives the shutter 58. The video signal processor 65 is supplied with an A / D circuit that converts an analog signal from the image sensor 20 into a digital signal, a CDS that holds the digital image signal from the A / D circuit, and an image signal from the CDS. It consists of a gain adjustment amplifier (AGC), which is an analog amplifier.

図4は本実施の形態の処理手順を示すフローチャートであり、図5はこのフローチャートに対応する説明図である。制御部25は、画像認識撮影モードが設定されている状態において、プログラムメモリ32に格納されているプログラムに基づき、図4に示すフローチャートに従って処理を実行する。先ず、ユーザーによる操作部23での操作により、シーン別撮影モードが設定されているか否かを判断する(ステップS101)。シーン別撮影モードが設定されていない場合には、その他のモード処理を実行する(ステップS102)。シーン別撮影モードが設定されている場合には、選択撮影シーンに応じて、予め設定された対象被写体の種別情報をメモリ(プログラムメモリ32)から読み出す(ステップS102)。さらに、当該対象被写体の種別に対応する特徴データを前記メモリ(プログラムメモリ32)から読み出し、テンプレートメモリ(データメモリ33)に記憶する(ステップS103)。   FIG. 4 is a flowchart showing the processing procedure of the present embodiment, and FIG. 5 is an explanatory diagram corresponding to this flowchart. The control unit 25 executes processing according to the flowchart shown in FIG. 4 based on the program stored in the program memory 32 in the state where the image recognition photographing mode is set. First, it is determined whether or not a scene-specific shooting mode is set by an operation of the operation unit 23 by the user (step S101). If the scene-specific shooting mode is not set, other mode processing is executed (step S102). If the scene-by-scene shooting mode is set, preset target subject type information is read from the memory (program memory 32) in accordance with the selected shooting scene (step S102). Further, feature data corresponding to the type of the subject is read from the memory (program memory 32) and stored in the template memory (data memory 33) (step S103).

一方、シーン別撮影モードが設定されていない場合には、カスタム設定シーンの撮影モードが設定されているか否かを判断し(ステップS104)、設定されていない場合にはその他の処理に移行する。また、カスタム設定シーンの撮影モードが設定されている場合には、撮影スルー画像視野内からカーソル等でサンプル抽出領域を選択する(ステップS105)。すなわち、カスタム設定シーンの撮影モードの状態においては、レンズ群19により撮像素子20上に結像された被写体像が、図5(A)に示すように、スルー画像P1として表示部14に表示されている。また、このカスタム設定シーンの撮影モードにおいては、前記カーソルキー10の操作により、位置及び大きさを変更可能な囲繞形状のカーソルC1をスルー画像P1上に表示させる。そして、カーソルキー10の操作によりカーソルC1の位置及び大きさを調整して、決定/OKキー11の操作により決定すると、カーソルC1により囲繞された領域がサンプル抽出領域として選択される。したがって、図5(A)の例においては、カーソルC1により囲繞された果物(蜜柑)の領域がサンプル抽出領域として選択されることとなる。   On the other hand, if the shooting mode for each scene is not set, it is determined whether or not the shooting mode for the custom setting scene is set (step S104). If it is not set, the process proceeds to other processing. If the shooting mode of the custom setting scene is set, a sample extraction region is selected with a cursor or the like from within the shooting through image field of view (step S105). That is, in the custom setting scene shooting mode state, the subject image formed on the image sensor 20 by the lens group 19 is displayed on the display unit 14 as a through image P1, as shown in FIG. ing. In the shooting mode of the custom setting scene, the cursor-shaped cursor C1 whose position and size can be changed is displayed on the through image P1 by operating the cursor key 10. When the position and size of the cursor C1 are adjusted by operating the cursor key 10 and determined by operating the enter / OK key 11, the area surrounded by the cursor C1 is selected as the sample extraction area. Therefore, in the example of FIG. 5A, the fruit (mikan) region surrounded by the cursor C1 is selected as the sample extraction region.

次に、この選択された領域内のブロック画像から特徴抽出処理により特徴を抽出し(ステップS106)、この抽出した特徴量データを、前記テンプレートメモリに記憶する(ステップS107)。したがって、このステップS107での処理により、図5(B)に示すように、テンプレートメモリにはサンプル画像P2の特徴量データDとして、色相=HHH、彩度=SSS、明度=VVV、輪郭形状=fff、大きさ=LLLが記憶されることとなる。   Next, features are extracted from the block image in the selected region by feature extraction processing (step S106), and the extracted feature data is stored in the template memory (step S107). Therefore, as a result of the processing in step S107, as shown in FIG. 5B, the template memory includes the feature amount data D of the sample image P2, as hue = HHH, saturation = SSS, brightness = VVV, contour shape = fff, size = LLL will be stored.

そして、ステップS103またはステップS107に続くステップS108では、この時点で表示部14に表示されているスルー画像を読み込む。次に、カーソル操作等により、取り込んだ被写体像から対角の2点で識別したい領域を選択する(ステップS109)。すなわち、識別すべき領域を選択する処理を実行する際には、図5(C)に示すように、表示部14において前記カーソルC1とは異なる十字状の第1カーソルC2をスルー画像P1上に表示させる。そして、カーソルキー10の操作により第1カーソルC2の位置を調整して、決定/OKキー11の操作により決定すると、第1カーソルC2の位置が決定される。次に、カーソルキー10が操作されると、図5(D)に示すように、第1カーソルC2から分離した第2カーソルC3を表示させ、カーソルキー10の操作により第2カーソルC3の位置を調整して、決定/OKキー11の操作により決定すると、第2カーソルC3の位置が決定される。そして、この第1カーソルC2と第2カーソルC3を対角とする矩形の領域を決定し、この矩形の領域を識別すべき領域である識別領域F1とする。なお、このとき、表示部14の隅部に、前記サンプル画像P2を表示させておく。   Then, in step S108 following step S103 or step S107, the through image currently displayed on the display unit 14 is read. Next, a region to be identified by two diagonal points is selected from the captured subject image by a cursor operation or the like (step S109). That is, when executing the process of selecting the region to be identified, as shown in FIG. 5C, the cross-shaped first cursor C2 different from the cursor C1 is displayed on the through image P1 on the display unit 14. Display. Then, when the position of the first cursor C2 is adjusted by operating the cursor key 10 and determined by operating the enter / OK key 11, the position of the first cursor C2 is determined. Next, when the cursor key 10 is operated, as shown in FIG. 5D, the second cursor C3 separated from the first cursor C2 is displayed, and the position of the second cursor C3 is moved by operating the cursor key 10. When the adjustment is performed and the determination / OK key 11 is operated, the position of the second cursor C3 is determined. Then, a rectangular area whose diagonal is the first cursor C2 and the second cursor C3 is determined, and this rectangular area is set as an identification area F1 that is an area to be identified. At this time, the sample image P2 is displayed at the corner of the display unit 14.

次に、識別領域F1内の被写体像から抽出領域を検出する(ステップS110)。この抽出領域の検出は、後述するようにスルー画像の画像データの輝度信号及び色差信号から、近い輝度または色差信号別に、例えば同系色の色相別等に領域を分割し、さらに、領域の境界線となる輪郭線を抽出し、この輪郭線で囲まれた部分を一つの抽出領域として検出する。したがって、図5(D)に示すように、識別領域F1内に4個の蜜柑mと1個の林檎aとが存在すると、黄色系の色相領域であって輪郭線で囲まれた4個の蜜柑m領域と、黄赤系の色相領域であって輪郭線で囲まれた1個の林檎a領域との、計5個の抽出領域が検出されることとなる。引き続き、この検出した抽出領域を順次選択し(ステップS111)、この選択した抽出領域におけるスルー画像の特徴抽出処理を実行する(ステップS112)。つまり、選択した抽出領域において、前記特徴量データDが有する特徴種別の特徴量を抽出する。したがって、本例においては、特徴量データDは、色相、彩度、明度、輪郭形状、大きさであったことから、抽出領域にこれら色相、彩度、明度、輪郭形状、大きさの特徴量を抽出する。   Next, an extraction area is detected from the subject image in the identification area F1 (step S110). As will be described later, this extraction area is detected by dividing the area into brightness or color difference signals from the brightness signal and color difference signal of the image data of the through image, for example, by hue of similar colors, and the boundary lines of the areas. A contour line is extracted, and a portion surrounded by the contour line is detected as one extraction region. Therefore, as shown in FIG. 5 (D), if there are four mandarin oranges m and one apple a in the identification area F1, the four shaded yellow areas surrounded by the outlines. A total of five extraction regions, i.e., the mandarin orange m region and one apple a region that is a yellow-red hue region and surrounded by a contour line, are detected. Subsequently, the detected extraction areas are sequentially selected (step S111), and the feature extraction process of the through image in the selected extraction area is executed (step S112). That is, the feature amount of the feature type included in the feature amount data D is extracted in the selected extraction region. Therefore, in the present example, the feature amount data D is hue, saturation, brightness, contour shape, and size. Therefore, the feature amount of these hue, saturation, brightness, contour shape, and size is included in the extraction region. To extract.

そして、このステップS112で抽出した特徴量と、テンプレートメモリに記憶されている前記特徴量データDの色相=HHH、彩度=SSS、明度=VVV、輪郭形状=fff、大きさ=LLLと比較し類似度を算出する(ステップS113)。つまり、特徴量データDの各値と抽出した特徴量の各値との比率を算出する。次に、この算出した比率である類似度が所定値以上であるか否かを判断し(ステップS114)、所定値未満である場合にはステップS115及びステップS116の処理を行うことなくステップS117に進む。また、類似度が所定値以上である場合には、今回の選択領域を類似被写体の存在領域としてデータメモリ33に記憶する(ステップS115)。また、類似被写体の識別数を計数しているカウンタの値をカウントアップさせる(ステップS116)。このとき、選択されている抽出領域が蜜柑mであれば、類似度は所定以上となることから、ステップS116の処理が実行されてカウンタの値がカウントアップされる。しかし、選択されている抽出領域が林檎aであれば、類似度は所定未満となることから、ステップS116の処理が実行されずカウンタの値がカウントアップされることもない。   Then, the feature amount extracted in step S112 is compared with the hue = HHH, saturation = SSS, brightness = VVV, contour shape = fff, size = LLL of the feature amount data D stored in the template memory. The similarity is calculated (step S113). That is, the ratio between each value of the feature value data D and each value of the extracted feature value is calculated. Next, it is determined whether or not the degree of similarity, which is the calculated ratio, is greater than or equal to a predetermined value (step S114). If it is less than the predetermined value, the process proceeds to step S117 without performing steps S115 and S116. move on. If the similarity is greater than or equal to a predetermined value, the current selected area is stored in the data memory 33 as an existing area of a similar subject (step S115). In addition, the value of the counter that counts the identification number of similar subjects is counted up (step S116). At this time, if the selected extraction region is mandarin orange m, the similarity is greater than or equal to a predetermined value, so the process of step S116 is executed and the counter value is counted up. However, if the selected extraction region is apple a, the degree of similarity is less than a predetermined value, so that the process of step S116 is not executed and the value of the counter is not counted up.

そして、最後の抽出領域まで以上のステップS111〜ステップS116の処理を実行したか否かを判断し(ステップS117)、最後の抽出領域となるまでステップS111からの処理を繰り返す。したがって、本例においては、ステップS111からの処理が5回繰り返されることとなり、5回繰り返されることにより、最後の抽出領域となったならば、識別された類似被写体の領域とカウント数を表示させる(ステップS117)。このとき、本例においては前述のように、識別領域F1内に4個の蜜柑mと1個の林檎aとが存在することから、このステップS117での処理より、図5(E)に示すように、表示部14には類似被写体の領域F2とカウント数N(Count=4)とが表示されることとなる。   Then, it is determined whether or not the processing in steps S111 to S116 has been executed up to the last extraction region (step S117), and the processing from step S111 is repeated until the last extraction region is reached. Therefore, in this example, the process from step S111 is repeated five times, and if the last extracted area is obtained by repeating the process five times, the identified similar subject area and the count number are displayed. (Step S117). At this time, in the present example, as described above, there are four mandarin oranges m and one apple a in the identification area F1, so that the processing in this step S117 is shown in FIG. As described above, the display unit 14 displays the similar subject area F2 and the count number N (Count = 4).

次に、類似被写体の領域またはカウント数に応じて撮影処理を実行する(ステップS118)。つまり、識別された被写体に焦点が合うように自動焦点(AF)処理する等の焦点制御を行い、あるいは、識別された被写体が画角一杯になるようにズーム倍率やレンズ焦点距離を調整するなどの画角制御を行い、もしくは、識別された被写体に応じて撮影シーン別プログラムを自動選択する等のシーン自動選択処理等を行う。したがって、このステップS118の処理が実行された後、ユーザがレリーズ釦3を操作することにより、ステップS118での処理に応じた画像が撮像されることとなる。   Next, a photographing process is executed according to the similar subject area or the number of counts (step S118). That is, focus control such as automatic focusing (AF) processing is performed so that the identified subject is in focus, or the zoom magnification and the lens focal length are adjusted so that the identified subject has a full angle of view. Angle of view control is performed, or automatic scene selection processing such as automatic selection of a shooting scene-specific program according to the identified subject is performed. Therefore, after the process of step S118 is executed, the user operates the release button 3 to capture an image according to the process of step S118.

なお、本実施の形態においては、表示部14にカウント数Nを表示させるようにしたが、表示させることなく、音声によりカウント数Nを報知するようにしてもよい。   In the present embodiment, the count number N is displayed on the display unit 14, but the count number N may be notified by voice without being displayed.

図6は、具体例として人物の顔を抽出して撮影する場合の動作例を示す図である。本例では、
1)予め、人間の顔の特徴データをテンプレートしてメモリに記憶しておく。
1′)あるいは、図示に示すように、撮影時に、識別したい被写体である人間の顔の見本となる被写体画像を、スルー画像内から領域を選択して指定し、選択された領域の被写体像を、識別対象の被写体のサンプルとして登録する。
FIG. 6 is a diagram illustrating an operation example when a human face is extracted and photographed as a specific example. In this example,
1) Human face feature data is previously stored as a template in a memory.
1 ′) Alternatively, as shown in the figure, a subject image that is a sample of a human face that is a subject to be identified is selected by selecting a region from the through image, and a subject image in the selected region is selected. And register as a sample of the subject to be identified.

そして、「人物モード」が選択された場合には、この記憶された人間の顔の特徴データを呼び出して、テンプレートデータとして、指定された画像領域の被写体像に対して、テンプレートの特徴量に合致する被写体があるか否かを検索するテンプレートマッチング動作を行う。すなわち、
2)まず、被写体画像のスルー画像から識別したい領域をカーソル操作などで選択する。
3)次に、撮像画像データの輝度信号及び色差信号から、近い輝度値または色差信号別に、例えば、同系の色相別等に領域を分割し、さらに、領域の境界線となる輪郭線を抽出する。
4)各分割領域(抽出領域)の内、例えばテンプレート画像の色相に近い色相の領域のみを抽出する。
5)さらに、領域の画像を2値化して、また、必要ならば、拡張、縮小処理などを行って細かい凹凸等を削減し、得られた輪郭の形状や大きさをテンプレートの特徴量と比較して、類似度が所定値以上高ければ、その領域を当該認識対象の人間の顔と認識して、その数をカウントする。
6)識別された被写体の計数値を表示するとともに、識別された領域の輪郭線、またはその中を塗りつぶした被写体像をスルー画像に重ねて表示して、識別領域を区別表示できるようにする。
When the “person mode” is selected, the stored human face feature data is recalled, and the template feature data matches the feature amount of the subject in the designated image area. A template matching operation for searching whether or not there is a subject to be performed is performed. That is,
2) First, a region to be identified from the through image of the subject image is selected by a cursor operation or the like.
3) Next, from the luminance signal and color difference signal of the captured image data, the region is divided into similar luminance values or color difference signals, for example, according to similar hues, and a contour line that is a boundary line of the region is extracted. .
4) For example, only a region having a hue close to the hue of the template image is extracted from each divided region (extraction region).
5) Furthermore, binarize the image of the area, and if necessary, perform expansion and reduction processing to reduce fine irregularities, etc., and compare the shape and size of the obtained contour with the feature amount of the template If the similarity is higher than a predetermined value, the area is recognized as a human face to be recognized and the number is counted.
6) The count value of the identified subject is displayed, and the contour line of the identified area or the subject image filled in the superimposed area is displayed on the through image so that the identified area can be distinguished and displayed.

図7〜図9は、その他の被写体の認識と計数処理の動作例を示す図である。図7は野鳥を数える例であり、(A)に示すように、カーソルC1をスルー画像P1上に表示させ、前記カーソルキー10の操作によりカーソルC1の位置及び大きさを調整して、決定/OKキー11の操作により決定すると、カーソルC1により囲繞された領域がサンプル抽出領域として選択される。この選択された領域内のブロック画像から特徴抽出処理により特徴を抽出し、この抽出した特徴量データを、前記テンプレートメモリに記憶する。   FIG. 7 to FIG. 9 are diagrams showing examples of other subject recognition and counting processing operations. FIG. 7 shows an example of counting wild birds. As shown in FIG. 7A, the cursor C1 is displayed on the through image P1, and the position / size of the cursor C1 is adjusted by the operation of the cursor key 10. When determined by operating the OK key 11, the area surrounded by the cursor C1 is selected as the sample extraction area. Features are extracted from the block image in the selected region by feature extraction processing, and the extracted feature data is stored in the template memory.

また、(B)に示すように、表示部14において前記カーソルC1とは異なるカーソルC2をスルー画像P2上に表示させる。そして、前記カーソルキー10の操作によりカーソルC2の位置を調整して、決定/OKキー11の操作により決定すると、カーソルC2の位置が決定される。カーソルC2で囲まれた矩形の領域を識別すべき領域である識別領域F1とする。なお、このとき、表示部14の隅部に、前記サンプル画像P2を表示させておく。そして、識別領域F1内の被写体像から抽出領域を検出する等により、前述しように、サンプル画像P2と類似する類似被写体の識別数を計数して、野鳥の数であるカウント数N(Count=10)を表示させる。   Further, as shown in (B), a cursor C2 different from the cursor C1 is displayed on the through image P2 on the display unit 14. Then, the position of the cursor C2 is determined by adjusting the position of the cursor C2 by operating the cursor key 10 and determining by the operation of the OK / OK key 11. The rectangular area surrounded by the cursor C2 is defined as an identification area F1 that is an area to be identified. At this time, the sample image P2 is displayed at the corner of the display unit 14. Then, as described above, the number of identifications of similar subjects similar to the sample image P2 is counted by detecting an extraction region from the subject image in the identification region F1, and the count number N (Count = 10) which is the number of wild birds. ) Is displayed.

図8は集客数を数える例であり、(A)に示すように、予めテンプレートメモリに記憶したサンプル画像P2を表示部14に表示させ、(B)に示すように、カーソルC2をスルー画像P1上に表示させる。そして、前記カーソルキー10の操作によりカーソルC2の位置を調整して、決定/OKキー11の操作により決定すると、カーソルC2の位置が決定される。カーソルC2で囲まれた矩形の領域を識別すべき領域である識別領域F1とする。そして、識別領域F1内の被写体像から抽出領域を検出する等により、前述しように、サンプル画像P2と類似する類似被写体の識別数を計数して、観客の数であるカウント数N(Count=2570)を表示させる。   FIG. 8 shows an example in which the number of customers is counted. As shown in FIG. 8A, a sample image P2 stored in advance in the template memory is displayed on the display unit 14, and as shown in FIG. 8B, the cursor C2 is moved to the through image P1. Display above. Then, the position of the cursor C2 is determined by adjusting the position of the cursor C2 by operating the cursor key 10 and determining by the operation of the OK / OK key 11. The rectangular area surrounded by the cursor C2 is defined as an identification area F1 that is an area to be identified. Then, as described above, the number of identifications of similar subjects similar to the sample image P2 is counted by detecting an extraction region from the subject image in the identification region F1, and the count number N (Count = 2570) which is the number of spectators. ) Is displayed.

図9は陳列商品を種別毎に数える例であり、(A)に示すように、表示部14にスルー画像P1を表示させた後、(B)に示すように、予めテンプレートメモリに記憶したサンプル画像A,Bを表示させ、カーソルC2をスルー画像P1上に表示させる。そして、前記カーソルキー10の操作によりカーソルC2の位置を調整して、決定/OKキー11の操作により決定すると、カーソルC2の位置が決定される。カーソルC2で囲まれた矩形の領域を識別すべき領域である識別領域F1とする。そして、識別領域F1内の被写体像から抽出領域を検出する等により、サンプル画像A,Bと類似する類似被写体の識別数を計数して、陳列商品の種別毎のカウント数N(Count A=03 Count b=04)を表示させる。無論、(A)に示した陳列商品のみならず、(C)に示した陳列商品であっても種別毎にカウント数を表示することが可能である。   FIG. 9 is an example of counting displayed products for each type. As shown in FIG. 9A, after the through image P1 is displayed on the display unit 14, a sample stored in the template memory in advance as shown in FIG. 9B. The images A and B are displayed, and the cursor C2 is displayed on the through image P1. Then, the position of the cursor C2 is determined by adjusting the position of the cursor C2 by operating the cursor key 10 and determining by the operation of the OK / OK key 11. The rectangular area surrounded by the cursor C2 is defined as an identification area F1 that is an area to be identified. Then, the number of identifications of similar subjects similar to the sample images A and B is counted by detecting an extraction region from the subject image in the identification region F1, and the count number N (Count A = 03) for each type of display product. (Count b = 04) is displayed. Of course, it is possible to display the number of counts for each type not only for the display product shown in (A) but also for the display product shown in (C).

図10は、本実施の形態における認識処理、認識被写体の設定メニューの表示例を示す図である。メニューキー13(MENU)の操作に応じて、表示部14に(a)に示す画像認識処理の設定メニューを表示する。この状態でカーソルキー10の上下操作部の操作により「画像認識」が選択されて、決定/OKキー11の操作されると、画像認識撮影モードが設定されることとなる。また、(a)の表示状態で、カーソルキー10の右操作部が操作されると、(a′)の表示状態に移行し、「OFF(認識しない)」「オート(撮影シーン別)」・・・等の画像認識モードにおける選択メニューを表示する。また、(b)に示すメニュー画面((a)と同様の画面)において、「認識する被写体の設定」が選択されると、(b′)の認識する被写体の設定メニュー画面に移行する。   FIG. 10 is a diagram showing a display example of the recognition processing and recognition subject setting menu in the present embodiment. In response to the operation of the menu key 13 (MENU), the setting menu for the image recognition process shown in FIG. In this state, when “image recognition” is selected by operating the up / down operation unit of the cursor key 10 and the enter / OK key 11 is operated, the image recognition photographing mode is set. Further, when the right operation portion of the cursor key 10 is operated in the display state of (a), the state shifts to the display state of (a ′), “OFF (not recognized)”, “Auto (by shooting scene)”.・ ・ Displays the selection menu in the image recognition mode. In addition, when “recognized subject setting” is selected on the menu screen shown in FIG. 5B (the same screen as FIG. 1A), the screen shifts to the recognized subject setting menu screen shown in FIG.

図11は、図4のフローチャートにおけるステップS106で実行される特徴抽出処理の詳細を示すフローチャートである。先ず、前記ステップS105において、カーソル等で選択されたサンプル抽出領域内の対象画像データを取り込む(ステップS201)。次に、前処理(1)を実行して、画像強調処理、または、鮮鋭化処理、雑音除去処理などを行い(ステップS202)、前処理(2)を実行して、2値化処理、または、正規化処理、回転処理、座標変換処理などを行う(ステップS203)。さらに、特徴抽出処理(1)を実行して、フィルタ処理、または、輪郭抽出、領域抽出、細線化、拡張収縮処理などを行い(ステップS204)、特徴抽出処理(2)を実行して、大きさ、周囲長、面積等の算出、または、円らしさ、フーリエ記述子の算出、輪郭形状の評価値算出などを行う。
(先鋭化、輪郭抽出)
図12及び図13は、前記ステップS202の前処理(1)における鮮鋭化処理、ステップS204の特徴抽出処理(1)における輪郭抽出処理の例として、1次微分フィルタまたは2次微分フィルタ処理による画像の先鋭化処理、エッジ(輪郭)抽出処理の例を示す図である。図12に示すように、階調が変化する部分のエッジがボケた画像f(i,j)を、
Δx=f(i+j,j)−j(i−1,j)、
Δy=f(i+j,j)−j(i−1,j)、
g(i,j)=√{(Δx+(Δyf)}、
または、g(i,j)=|Δxf|+|Δyf|、
等の演算により、1次部分や勾配(Gradient)を求めると、階調が変化する勾配部分や輪郭を抽出できる。
FIG. 11 is a flowchart showing details of the feature extraction process executed in step S106 in the flowchart of FIG. First, in step S105, target image data in the sample extraction area selected by the cursor or the like is captured (step S201). Next, pre-processing (1) is executed, image enhancement processing, sharpening processing, noise removal processing, etc. are performed (step S202), pre-processing (2) is executed, binarization processing, or Normalization processing, rotation processing, coordinate conversion processing, and the like are performed (step S203). Further, the feature extraction process (1) is executed to perform filter processing, contour extraction, region extraction, thinning, expansion / contraction processing, etc. (step S204), and the feature extraction process (2) is executed to increase the size. Then, calculation of circumference, area, etc., or circularity, calculation of Fourier descriptor, calculation of contour shape evaluation value, etc. are performed.
(Sharpening, contour extraction)
FIGS. 12 and 13 show an image obtained by a primary differential filter process or a secondary differential filter process as an example of the sharpening process in the pre-process (1) in step S202 and the contour extraction process in the feature extraction process (1) in step S204. It is a figure which shows the example of this sharpening process and edge (contour) extraction process. As shown in FIG. 12, an image f (i, j) in which the edge of the portion where the gradation changes is blurred
Δx f = f (i + j, j) −j (i−1, j),
Δy f = f (i + j, j) −j (i−1, j),
g (i, j) = √ {(Δx f ) 2 + (Δyf) 2 },
Or g (i, j) = | Δxf | + | Δyf |
When the primary part and the gradient (Gradient) are obtained by the calculation such as the above, it is possible to extract the gradient part and the contour whose gradation changes.

あるいは、
f(i,j)=∂f/∂x+∂f/∂y、または、
f(i,j)=f(i+1,j)+f(i−1,j)+f(i,j−1)+f(i,j −1)−4f(i,j)
等の演算により、さらに微分する2次微分(Laplacian)処理を施し、この結果を原画像データから差し引くと、エッジ部分の高周波成分を強調した画像を合成でき、ボケたエッジや輪郭を強調することができる。
Or
2 f (i, j) = ∂ 2 f / ∂x 2 + ∂ 2 f / ∂y 2 , or
2 f (i, j) = f (i + 1, j) + f (i−1, j) + f (i, j−1) + f (i, j−1) −4f (i, j)
By performing a second-order differential (Laplacian) process that is further differentiated by operations such as the above, and subtracting this result from the original image data, an image that emphasizes the high-frequency component of the edge portion can be synthesized, and blurred edges and contours can be emphasized Can do.

エッジや輪郭の強調処理をソフトウエア処理で行うには、図13に示した「Prewittフィルタ」「Sobeiフィルタ」や「Kirschフィルタ」「Robertsフィルタ」等の1次微分の空間フィルタ演算子(オペレータ)、または、「Laplaciantフィルタ」等の2次微分の空間フィルタ演算子等を用いることができる。図示のように、入力画像220は、演算221により出力画像222に変換される。また、A−A′線上の入力画像223は、Prewittフィルタ(1次微分フィルタ)224により、A−A′線上の出力画像224に変換され、Sobeiフィルタ(1次微分フィルタ)226により、A−A′線上の出力画像227に変換され、Laplaciantフィルタ(2次微分フィルタ)228により、A−A′線上の出力画像229に変換される。   In order to perform edge and contour enhancement processing by software processing, first-order differential spatial filter operators (operators) such as “Prewitt filter”, “Sobei filter”, “Kirsch filter”, and “Roberts filter” shown in FIG. Alternatively, a second-order differential spatial filter operator such as “Laplacant filter” or the like can be used. As illustrated, the input image 220 is converted into an output image 222 by an operation 221. The input image 223 on the A-A ′ line is converted into an output image 224 on the A-A ′ line by the Prewitt filter (first-order differential filter) 224, and the A- It is converted into an output image 227 on the A ′ line, and is converted into an output image 229 on the AA ′ line by a Laplacent filter (secondary differential filter) 228.

このようなフィルタ処理を、前述の前処理における画像の先鋭化処理や、特徴抽出処理における輪郭抽出やエッジ抽出などに利用できる。被写体像の輪郭形状や外形パターン、面積などを特徴データに利用するには、特徴抽出したい画像データの輝度置等を、画素毎に輪郭強調やエッジ検出用のフィルタ演算等を行って、輪郭強調や外形抽出した画像に変換してから、特徴データ等を抽出する。   Such filter processing can be used for image sharpening processing in the above-described preprocessing, contour extraction or edge extraction in feature extraction processing, and the like. To use the contour shape, outline pattern, area, etc. of the subject image as feature data, perform brightness enhancement of the image data that you want to extract the features for each pixel by performing contour enhancement, edge detection filter operation, etc. Then, after converting the image into an extracted image, feature data and the like are extracted.

(2値化、平均化、輝度変換)
図14及び図15は、前記ステップS202の前処理(1)における画像強調処理、ステップS203の前処理(2)における2値化処理、ステップS204の特徴抽出処理(1)の処理例としての輝度の抽出処理の例を示す図である。図14(a)の線形の輝度変換(中間階調の改善)に示すように、入力画像230は、演算(変換式)231により出力画像232に変換される。また、入力画像の輝度ヒストグラム分布P(x)233は、輝度変換式234により、出力画像の輝度ヒストグラム分布P(x)235に変換される。また、(b)の2値化処理に示すように、入力画像の輝度分布P(x)236は、変換式237により、出力画像の輝度分布P(x)238に変換される。また、図15の所定の輝度の抽出処理に示すように、入力画像の輝度分布P(x)239は、変換式240により、出力画像の輝度分布P(x)241に変換される。
(Binarization, averaging, luminance conversion)
14 and 15 show the luminance as an example of the image enhancement processing in the preprocessing (1) in step S202, the binarization processing in the preprocessing (2) in step S203, and the feature extraction processing (1) in step S204. It is a figure which shows the example of this extraction process. As shown in the linear luminance conversion (improvement of intermediate gradation) in FIG. 14A, the input image 230 is converted into an output image 232 by an operation (conversion formula) 231. Further, the luminance histogram distribution P (x) 233 of the input image is converted into the luminance histogram distribution P (x) 235 of the output image by the luminance conversion equation 234. Further, as shown in the binarization process of (b), the luminance distribution P (x) 236 of the input image is converted into the luminance distribution P (x) 238 of the output image by the conversion equation 237. Further, as shown in the predetermined luminance extraction process of FIG. 15, the luminance distribution P (x) 239 of the input image is converted into the luminance distribution P (x) 241 of the output image by the conversion equation 240.

このように、被写体像の画像データ(輝度値や色差値)の分布パターンなどを特徴データとして利用する場合に、画像データの輝度分布(ヒストグラム)を求め、輝度変換処理を行うことにより中間階調などの強調や圧縮ができる。また、所定の閾値との大小で2値化したり、所定の輝度の領域だけを抽出することができる。あるいは、画素数毎に輝度値や色差値を平均化(モザイク化)してまとめて、パターン単純化や情報量の圧縮ができる。   As described above, when the distribution pattern of the image data (luminance value and color difference value) of the subject image is used as feature data, the luminance distribution (histogram) of the image data is obtained, and the luminance conversion process is performed to obtain the intermediate gradation. Can be emphasized and compressed. Further, binarization can be performed based on a predetermined threshold value, or only a region having a predetermined luminance can be extracted. Alternatively, luminance values and color difference values are averaged (mosaicized) for each number of pixels, and the patterns can be simplified and the information amount can be compressed.

(画像データの変換)
なお、画像データのRGB信号や輝度信号Y、色差信号Cb,Cr、あるいは、色相/彩度/明度を表すHSV(またはHSB)データ等は、以下の変換式で相互に容易に変換できる。
例えば、RGBデータをYCbCrデータに変換するには、
Y=0.299*R+0.587*G+0.114*B、
Cb=0.172*R−0.339*G+0.511*B+CENTER、
Cr=0.511*R−0.428*G−0.083*B+CENTER、
YCbCrデータをRGBデータに変換するには、
R=Y+0.000*(Cb−CENTER)+1.371*(Cr−CENTER)、
G=Y−0.336*(Cb−CENTER)−0.698*(Cr−CENTER)、
B=Y+1.732*(Cb−CENTER)+0.000*(Cr−CENTER)、
(Conversion of image data)
Note that RGB signals, luminance signals Y, color difference signals Cb and Cr, or HSV (or HSB) data representing hue / saturation / lightness, etc. of image data can be easily converted to each other by the following conversion formula.
For example, to convert RGB data to YCbCr data,
Y = 0.299 * R + 0.587 * G + 0.114 * B,
Cb = 0.172 * R−0.339 * G + 0.511 * B + CENTER
Cr = 0.511 * R−0.428 * G−0.083 * B + CENTER
To convert YCbCr data to RGB data,
R = Y + 0.000 * (Cb-CENTER) + 1.371 * (Cr-CENTER)
G = Y−0.336 * (Cb−CENTER) −0.698 * (Cr−CENTER)
B = Y + 1.732 * (Cb-CENTER) + 0.000 * (Cr-CENTER)

RGBデータ(各0〜1)をHSV(またはHSB)データに変換するには、
cmax=maximum(R,G.B)、cmin=minimum(R,G.B)とすると、
明度V=cmax、彩度S=(cmax−cmin)/cmax(ただし、cmax=0のときは、S=0)、
R=cmaxのときは、色相H=60°*{(G−B)/(cmax−cmin)}、
G=cmaxのときは、色相H=60°*{2+(B−R)/(cmax−cmin)}、
B=cmaxのときは、色相H=60°*{4+(R−G)/(cmax−cmin)}、
なお、H<0のときはHに360°を加える。また、S=0のときはH=0とする。
To convert RGB data (each 0 to 1) to HSV (or HSB) data,
If cmax = maximum (R, GB) and cmin = minimum (R, GB),
Lightness V = cmax, saturation S = (cmax−cmin) / cmax (where c = 0, S = 0),
When R = cmax, hue H = 60 ° * {(GB) / (cmax-cmin)},
When G = cmax, hue H = 60 ° * {2+ (BR) / (cmax-cmin)},
When B = cmax, hue H = 60 ° * {4+ (RG) / (cmax−cmin)},
When H <0, 360 ° is added to H. When S = 0, H = 0.

(色相の抽出、肌色の抽出)
図16は、前記ステップS204の特徴抽出処理(1)の領域抽出処理例であって、所定の色の領域を抽出する例として、人間の肌色領域の抽出例を示す図である。(a)は、人間の肌の分光反射率特性の例であり、(b)は、撮影画像サンプル中の肌色領域のRGB値、及びHSV値の例(色相:Hueを0〜360°、彩度:Saturationを0〜255、明度:Value of Brightnessを0〜255として場合)である。また、(c)は、肌色の色相:Hue:0〜360°、彩度:Saturation:0〜1分布の例で、肌色の画像データの多くは、色相環で6°〜38°の範囲に多く分布することが知られている(Skin Colour Analysis(by J.Sherrah and S.Gong)http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPLES/GONGI/cvOnline-skinColourAnalysis.html)。これらを利用すれば、HSV値から、色相で約6°〜38°の範囲の人間の顔の肌色とするなど、特定色の被写体の領域を適宜抽出することができる。
(Hue extraction, skin color extraction)
FIG. 16 is an example of region extraction processing in the feature extraction processing (1) of step S204, and shows an example of human skin color region extraction as an example of extracting a predetermined color region. (A) is an example of spectral reflectance characteristics of human skin, and (b) is an example of RGB values and HSV values of the skin color region in the photographed image sample (hue: Hue of 0 to 360 °, chromatic Degree: Saturation is 0 to 255, Brightness: Value of Brightness is 0 to 255). (C) is an example of skin color hue: Hue: 0 to 360 °, saturation: Saturation: 0 to 1 distribution, and most of the skin color image data is in the range of 6 ° to 38 ° in the hue circle. Many distributions are known (Skin Color Analysis (by J. Sherrah and S. Gong) http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPLES/GONGI/cvOnline-skinColourAnalysis.html ). By using these, it is possible to appropriately extract a subject area of a specific color, such as a skin color of a human face having a hue in a range of about 6 ° to 38 ° from the HSV value.

(膨脹、収縮、細線化、線図形化)
図17は、前記ステップS204の特徴抽出処理(1)における膨脹収縮処理の例を示す図である。輪郭形状などから被写体の形状や特徴を判別するには、先ず、形状を単純化して情報量を圧縮や線図形化してから判別することが好ましい。例えば、図(a)のように、2値化された画像の輪郭や、1−画素と0−画素の境界領域で、1−画素を(8近傍の画素の)一層分だけ外側に太くする、所謂「膨脹」(Expansion)処理を行うと、輪郭などの境界部分の小さな孔や溝が取り除かれ、また、同図(b)のように、逆に、一層分だけ細くする「収縮」(Contraction)処理により境界部分の突起や孤立点などが取り除かれるので、膨脹処理と収縮処理を組み合わせることで、形状の単純化ができる。
(Expansion, contraction, thinning, line drawing)
FIG. 17 is a diagram showing an example of the expansion / contraction process in the feature extraction process (1) in step S204. In order to determine the shape and characteristics of the subject from the contour shape or the like, it is preferable to first determine after simplifying the shape and compressing the information amount into a line figure. For example, as shown in FIG. 1A, the 1-pixel is thickened to the outside by one layer (of 8 neighboring pixels) in the binarized image outline or the boundary area between 1-pixel and 0-pixel. When the so-called “expansion” process is performed, small holes and grooves in the boundary such as the contour are removed, and conversely, as shown in FIG. The contraction process removes protrusions and isolated points at the boundary, so the shape can be simplified by combining the expansion process and the contraction process.

また、2値化された画像から、線幅が1の中心を抽出する、所謂「細線化」(Thinning)処理により、骨状(スケルトン)の概略形状を求めることができる。また、2値化された輪郭パターンの周囲を外側と内側とから境界に沿ってたどり、境界部画素を1とし、残りの画素を0とする「境界線追跡」処理により、輪郭の境界線のみの画像に変換できる。あるいは、輪郭形状の数画素毎に選択した画素のみを折れ線で連結する「折れ線近似」処理などを用いてもよい。   Further, a rough shape of a skeleton can be obtained by so-called “thinning” (Thinning) processing in which a center having a line width of 1 is extracted from a binarized image. Further, only the boundary line of the contour is obtained by “boundary line tracking” processing in which the periphery of the binarized contour pattern is traced along the boundary from the outside and the inside, the boundary pixel is set to 1, and the remaining pixels are set to 0. Can be converted to. Alternatively, a “polyline approximation” process or the like in which only pixels selected for every several pixels of the contour shape are connected by a polyline may be used.

(形状の識別1)
形状の識別は、2値化や線図形化したテンプレート画像やその特徴量を記憶しておき、それらと入力画像の2値化や線図形化した画像や特徴データとの相関度や類似度などを計算して、形状の識別や類似度の判別ができる。あるいは、領域内の画像からテンプレート画像と類似する画像の位置を順次検索するテンプレートマッチング等の手法により、類似する画像や図形の検索ができる。また、簡略には、被写体像の2値化画像や輪郭図形、境界線図形等の縦横の大きさ、半径、周囲長、画素数、面積、幾何学的な寸法の比などから、簡易に類似度判断や被写体の識別を行ってもよい。
(Shape identification 1)
Shape identification is performed by storing binarized or line figured template images and their feature values, and the degree of correlation and similarity between the binarized and line figured image and feature data of the input image. Can be calculated to identify the shape and determine the similarity. Alternatively, it is possible to search for similar images and graphics by a method such as template matching for sequentially searching the positions of images similar to the template image from the images in the region. Also, for simplicity, similarities are easily obtained from the binarized image of the subject image, the vertical and horizontal sizes of the contour figure, boundary line figure, etc., radius, perimeter length, number of pixels, area, ratio of geometric dimensions, etc. Degree determination and subject identification may be performed.

例えば、図18に示すように、円では周囲長L=2πr、面積S=πrなので、(周囲長L)/(面積A)=4πとなることから、図形の輪郭線の円らしさを、
円らしさ=(周囲長L)/(面積S)、または、
円形度e=4π(円らしさ)=4πS/Lとして計算して、
円らしさが4π(=12.57)に近い値かどうか、または、円形度が1.0に近いかどうかで、丸い形状の被写体か、凹凸が多い尖った被写体か等を計算し、形状の識別に利用できる。同様に、図19に示すように、輪郭の縦横比=長さh/幅wなどから、形状の「細長さ」等の評価値を求めてもよい。
For example, as shown in FIG. 18, since the circumference of a circle is L = 2πr and the area S = πr 2 , (circumference length L) 2 / (area A) = 4π, so the circularity of the contour of the figure is reduced. ,
Circularity = (peripheral length L) 2 / (area S), or
Calculate with circularity e = 4π (circularness) = 4πS / L 2 ,
Whether the object has a round shape or a sharp object with many irregularities is calculated according to whether the circularity is close to 4π (= 12.57) or the circularity is close to 1.0, and the shape is identified. Available. Similarly, as shown in FIG. 19, an evaluation value such as “strip length” of a shape may be obtained from the aspect ratio of the contour = length h / width w.

(形状の識別2.偏角関数、位置座標関数)
また、図20に示すように、図形の輪郭線に沿って、始点から順次、偏角θ(s)を求めて、1次元関数(偏角関数)に変換して、輪郭形状の特徴量として利用できる。あるいは、図21に示すように、同様に、輪郭線に沿って順次、位置座標x(s)、y(s)、または、z(s)=x(s)+j・y(s)を求めて、1次元の位置座標関数に変換して、輪郭形状の特徴量として利用できる。
(Shape identification 2. Declination function, Position coordinate function)
Further, as shown in FIG. 20, along the contour line of the figure, the deflection angle θ (s) is obtained sequentially from the start point, converted into a one-dimensional function (deflection angle function), and used as the feature amount of the contour shape. Available. Alternatively, as shown in FIG. 21, similarly, position coordinates x (s), y (s) or z (s) = x (s) + j · y (s) are sequentially obtained along the contour line. Thus, it can be converted into a one-dimensional position coordinate function and used as a feature amount of the contour shape.

(形状の識別3.フーリエ記述子)
(Z形記述子)
さらに、例えば、図22に示すように、前述の偏角関数θ(s)を正規化して、正規化偏角関数:θ(s)=θ(s)−θ(0)−2πs/L、
を求め、これの(i=0,1,2・・・,N−1)の離散化データφ[i]をフーリエ変換して、次のようなZ(Zahn)形フーリエ記述子を求め、輪郭形状の識別に利用できる。
θ(s)の離散化データ:φ[i]=θ[i]−θ[0]−2πi/N
(i=0,1,2・・・,N-1)
θ(s)の離散フーリエ変換(=Z形記述子):Cz[k]=(1/N)Σφ[i]EXP(−j2πki/N)。
(Shape identification 3. Fourier descriptor)
(Z descriptor)
Further, for example, as shown in FIG. 22, the above-mentioned declination function θ (s) is normalized, and the normalized declination function: θ N (s) = θ (s) −θ (0) −2πs / L ,
And Fourier transform of the discretized data φ [i] of (i = 0, 1, 2,..., N−1) to obtain the following Z (Zahn) type Fourier descriptor, It can be used to identify contour shapes.
Discretized data of θ N (s): φ [i] = θ [i] −θ [0] −2πi / N
(I = 0,1,2 ..., N-1)
Discrete Fourier transform of θ N (s) (= Z-type descriptor): Cz [k] = (1 / N) Σφ [i] EXP (−j2πki / N).

(G形記述子)
同様に、図23に示すように、前述の位置座標の複素平面座標z(s)を離散フーリエ変換して、G(Grundlund)形フーリエ記述子を求め、輪郭形状の識別に利用してもよい。
位置座標の複素平面座標z(s)=x(s)+j・y[s]、
z(s)の離散化データz(i)=x[i]+j・y[0] (i=0,1,2・・・,N-1)、
z(s)の離散フーリエ変換(=G記述子):Cg[k]=(1/N)Σz[i]EXP(−j2πki/N)。
(G type descriptor)
Similarly, as shown in FIG. 23, the above-described complex plane coordinate z (s) of the position coordinate may be subjected to discrete Fourier transform to obtain a G (Grundlund) type Fourier descriptor, which may be used for identifying the contour shape. .
Complex plane coordinates z (s) = x (s) + j · y [s] of position coordinates,
discretized data of z (s) z (i) = x [i] + j · y [0] (i = 0, 1, 2..., N−1),
Discrete Fourier transform of z (s) (= G descriptor): Cg [k] = (1 / N) Σz [i] EXP (−j2πki / N).

(P形記述子)
また、図24に示すように、折れ線近似した偏角θ[i]の指数関数w[i]を求め、w[i]をフーリエ変換した、P(Phase)形記述子を求め、輪郭形状の識別に利用してもよい。
w[i]=exp(jθ[i])=cosθ[i]+sinθ[i]
=(z[i+1]−z[i])/δ、
ただし、線分δ=|z[i+1]−z[i]|
w[i]の離散フーリエ変換(=p形記述子):Cp[k]=(1/N)Σw[i]exp(−j2πki/N)。
(P type descriptor)
Also, as shown in FIG. 24, an exponential function w [i] of the deflection angle θ [i] approximated by a polygonal line is obtained, a P (Phase) shape descriptor obtained by Fourier transforming w [i] is obtained, and the contour shape is obtained. It may be used for identification.
w [i] = exp (jθ [i]) = cosθ [i] + sinθ [i]
= (Z [i + 1] -z [i]) / δ,
However, the line segment δ = | z [i + 1] −z [i] |
Discrete Fourier transform of w [i] (= p-type descriptor): Cp [k] = (1 / N) Σw [i] exp (−j2πki / N).

(特徴量の比較、類似図形の検索)
また、記憶されたテンプレート画像と被写体画像の類似度の判別や検索には、テンプレートマッチングなどのパターンマッチング法や、動きベクトル検出におけるブロックマッチング法などが利用できる。テンプレートマッチングにより、特徴抽出領域の入力画像f[i,j]の特徴データの中から、例えば、(m×n)の記録された参照画像(または特徴データ)t[k,l]に一致する画像の位置を検出する。参照画像の中心(または端点)が入力画像のある点(i,j)に重なるように置いて、点(i,j)を順に縦横にラスター走査しながら、重なる部分の画像データの類似度を順次計算して、類似度が最も高い位置点(i,j)を、類似する被写体がある位置として求めることができる。
(Comparison of features, search for similar figures)
In addition, a pattern matching method such as template matching or a block matching method in motion vector detection can be used to determine and search the similarity between the stored template image and the subject image. By template matching, for example, (m × n) recorded reference images (or feature data) t [k, l] are matched from the feature data of the input image f [i, j] in the feature extraction region. Detect the position of the image. Place the center (or end point) of the reference image so that it overlaps a certain point (i, j) of the input image, and perform raster scanning of the point (i, j) in order vertically and horizontally, and the similarity of the image data of the overlapping part By calculating sequentially, the position point (i, j) having the highest degree of similarity can be obtained as a position where there is a similar subject.

(相関度(相関係数))
図25に示すように、入力画像f[k,l]とテンプレート画像(参照画像)t[k,l]との相関度は、次式のピアソンの相関係数(積率相関係数)Rなどで算出でき、最も相関係数Rが大きくなる位置が、検索する類似被写体がある位置として求められる。
R=(画像fと画像tの共分散)/f(画像fの標準偏差)・(画像tの標準偏差)
=[ΣL=0 n−1ΣK=0 m−1{f[k,l]−fAV}{t[k,l]−tAV}]
/√[ΣL=0 n−1ΣK=0 m−1{f[k,l]−fAV]・√[ΣL=0 n−1ΣK=0 m−1{t[k,l]−tAV
ただし、fAV:参照画像f[k,l]の画像データ(輝度値、色差値、特徴量など)の平均値、
AV:参照画像t[k,l]の画像データ(輝度値、色差値、特徴量など)の平均値。
(Correlation degree (correlation coefficient))
As shown in FIG. 25, the correlation between the input image f [k, l] and the template image (reference image) t [k, l] is Pearson's correlation coefficient (product moment correlation coefficient) R The position where the correlation coefficient R is largest can be obtained as the position where there is a similar subject to be searched.
R = (covariance between image f and image t) / f (standard deviation of image f) · (standard deviation of image t)
= [ΣL = 0 n−1 ΣK = 0 m−1 {f [k, l] −f AV } {t [k, l] −t AV }]
/ √ [Σ L = 0 n−1 Σ K = 0 m−1 {f [k, l] −f AV } 2 ] · √ [Σ L = 0 n−1 Σ K = 0 m−1 {t [ k, l] −t AV } 2 ]
However, f AV : the average value of the image data (luminance value, color difference value, feature amount, etc.) of the reference image f [k, l],
t AV : average value of image data (luminance value, color difference value, feature amount, etc.) of the reference image t [k, l].

(テンプレートマッチングの類似度)
テンプレートマッチングなど、画像f[i,j]の中から、画像サイズ(m×n)の画像t[k,l]を走査して検索する場合、類似度は、次式で計算でき、類似度r(i,j)が最も大きくなる走査位置の点(i,j)が類似する被写体の位置として求まる。
R(i,j)=ΣL=0 n−1ΣK=0 m−1f[i−(m/2)+k,j−(n/2)+1]・t[k,l]
ただし、(i,j):点の位置座標、f[i,j]:入力画像データ、t[k,l]:テンプレート画像のデータ、(m×n):テンプレート画像のサイズ。
これを、前述の相関係数Rと同様に、平均値を差し引くなど正規化してもちいてもよい。
(Similarity of template matching)
When searching by scanning an image t [k, l] having an image size (m × n) from the image f [i, j], such as template matching, the similarity can be calculated by the following equation. A point (i, j) at the scanning position where r (i, j) is the largest is obtained as a similar subject position.
R (i, j) = Σ L = 0 n−1 ΣK = 0 m−1 f [i− (m / 2) + k, j− (n / 2) +1] · t [k, l]
However, (i, j): position coordinates of points, f [i, j]: input image data, t [k, l]: template image data, (m × n): size of template image.
Similar to the correlation coefficient R described above, this may be normalized by subtracting the average value.

(絶対値差分和、距離)
前記の類似度、R(i,j)では乗算のための計算が増えるため、2値化画像など、平均値を差し引いたり、正規化を省略したりできる場合には、類似度の代わりに、次式のような画像間の差分和により、相違の程度(「距離」)を表すD(i,j)を求め、これを評価関数として利用できる。この場合には、加減算だけで計算できるので演算を高速化できる。この場合は、距離D(i,j)が最も小さい点(i,j)がマッチング位置を表す。
D(i,j)=ΣL=0 n−1ΣK=0 m−1|f[i−(m/2)+k,j−(n/2)+1]−t[k,l]|
ただし、(i,j):点の位置座標、f[i,j]:入力画像データ、t[k,l]:テンプレート画像のデータ、(m×n):テンプレート画像のサイズ。
(Absolute difference sum, distance)
Since the calculation for multiplication increases with the similarity, R (i, j), when the average value can be subtracted or normalization can be omitted, such as a binary image, instead of the similarity, D (i, j) representing the degree of difference (“distance”) is obtained from the difference sum between images as in the following equation, and this can be used as an evaluation function. In this case, the calculation can be speeded up because it can be calculated only by addition and subtraction. In this case, the point (i, j) having the smallest distance D (i, j) represents the matching position.
D (i, j) = Σ L = 0 n−1 Σ K = 0 m−1 | f [i− (m / 2) + k, j− (n / 2) +1] −t [k, l] |
However, (i, j): position coordinates of points, f [i, j]: input image data, t [k, l]: template image data, (m × n): size of template image.

(特定被写体の認識処理、顔の認識処理)
前記の認識処理において、特定の被写体やシーン別撮影モードなどで注目する被写体別に専用の識別データや認識処理を必要とする場合がある。例えば「人物」の撮影シーンや「人物と風景」の撮影シーンなどにおいて、人間の顔を認識する例を説明する。
(Specific subject recognition processing, face recognition processing)
In the above recognition processing, there are cases where dedicated identification data or recognition processing is required for each subject to be noticed in a specific subject or scene-specific shooting mode. For example, an example of recognizing a human face in a “person” shooting scene, a “person and landscape” shooting scene, or the like will be described.

図26(a)は、顔の眼の領域を抽出するためのマスクパターンの例で、これを参照パターンとして、テンプレートマッチング等を用いて検索して、入力画像から眼や顔のある画像領域を検索できる。(b)は、眼を認識するデータの例で、例えば、眼の細長さ=b/aとして、α≦b/a≦αの条件に合致する、または、(眼の面積)S≒π×a×b、(黒眼(瞳)の面積)S=π×r、黒眼(瞳)の比率S/S=r/abとして、β≦r/ab≦βなどの条件に合致する被写体画像の領域を「眼の領域」と識別することができる。また、(c)は、人間の顔と認識するための条件データの設定で、例えば、(眉下〜鼻下までの長さ)h1≒(鼻下〜あごまでの長さ)h2、または、(右眼の幅)W≒(両眼の間)W≒(左眼の幅)W、などの条件を満たす被写体画像の領域を「顔の領域」であると識別できる。 FIG. 26A shows an example of a mask pattern for extracting an eye area of a face. Using this as a reference pattern, search is performed using template matching or the like, and an image area having an eye or a face is searched from an input image. Searchable. (B) is an example of data for recognizing the eye. For example, when the eye length = b / a, the condition of α 1 ≦ b / a ≦ α 2 is satisfied, or (eye area) S 1 ≈π × a × b, (area of black eye (pupil)) S 2 = π × r 2 , and ratio of black eyes (pupil) S 2 / S 1 = r 2 / ab, β 1 ≦ r 2 / ab ≦ beta 2 the condition region of a subject image matching the like can be identified as a "region of the eye." (C) is a setting of condition data for recognizing a human face. For example, (length from below the eyebrows to below the nose) h1≈ (length from below the nose to the chin) h2, or An area of the subject image that satisfies the conditions such as (right eye width) W 1 ≈ (between eyes) W 2 ≈ (left eye width) W 3 can be identified as a “face area”.

図27は、人間の認識処理1(中距離、頭の認識)の処理手順を示すフローチャートである。先ず、画像を取り込み(ステップS301)、輝度もしくは色差データに基づいて輪郭を抽出する(ステップS302)。次に、前記画像をこの抽出した輪郭を境界とする領域に分割し(ステップS303)、分割領域の中からいずれかの対象領域を選択する(ステップS304)。そして、輪郭線の周囲長L、面積Sを算出し、e=4πS/Lにより、円形度(円らしさ)を算出する(ステップS305)。この算出したeが、「e1≦e≦e2」であるか否かを判断する(ステップS306)。この判断がNOであれば人間の頭の領域でないと認識し(ステップS307)、後述するステップS312に進む。 FIG. 27 is a flowchart illustrating a processing procedure of human recognition processing 1 (medium distance, head recognition). First, an image is captured (step S301), and a contour is extracted based on luminance or color difference data (step S302). Next, the image is divided into regions having the extracted contour as a boundary (step S303), and any target region is selected from the divided regions (step S304). Then, the peripheral length L and area S of the contour line are calculated, and the circularity (circularness) is calculated by e = 4πS / L 2 (step S305). It is determined whether the calculated e is “e1 ≦ e ≦ e2” (step S306). If this determination is NO, it is recognized that the region is not a human head region (step S307), and the process proceeds to step S312 described later.

また、前記判断がYESであれば、比較するテンプレートとして顔のテンプレートを設定し、この設定した顔のテンプレートと選択画像(対象領域)との類似度を算出する(ステップS308)。次に、この算出した類似度が所定値以上であるか否かを判断し(ステップS309)、所定値未満である場合には、前述と同様に、人間の頭の領域でないと認識する(ステップS307)。また、所定値以上である場合には、人間の顔の領域として認識し(ステップS310)、この頭と認識された位置座標を記憶する(ステップS311)。次に、今回選択した領域が、当該画像において最後の領域であるか否かを判断し(ステップS312)、最後の領域でない場合には、ステップS304に戻って次の領域を選択し、前述した処理を繰り返す。そして、最後の領域まで以上の処理が実行されると、ステップS312の判断がYESとなり、記憶した位置座標を出力する(ステップS313)。   If the determination is YES, a face template is set as a template to be compared, and the similarity between the set face template and the selected image (target region) is calculated (step S308). Next, it is determined whether or not the calculated similarity is greater than or equal to a predetermined value (step S309). If it is less than the predetermined value, it is recognized that it is not a human head region (step S309). S307). If it is equal to or greater than the predetermined value, it is recognized as a human face region (step S310), and the position coordinates recognized as the head are stored (step S311). Next, it is determined whether or not the region selected this time is the last region in the image (step S312). If it is not the last region, the process returns to step S304 to select the next region and Repeat the process. When the above processing is executed up to the last area, the determination in step S312 is YES, and the stored position coordinates are output (step S313).

図28は、人間の識別処理2(近距離、顔の認識)の処理手順を示すフローチャートである。先ず、画像を取り込み(ステップS401)、輝度もしくは色差データに基づいて輪郭を抽出する(ステップS402)。次に、前記画像をこの抽出した輪郭を境界とする領域に分割し(ステップS403)、分割領域の中からいずれかの対象領域を選択する(ステップS404)。そして、RGBまたは色差データに基づいて、選択した領域の平均RGBまたは平均色差データを算出し(ステップS405)、この算出したRGBまたは色差値をHSVに変換する(ステップS406)。   FIG. 28 is a flowchart showing a processing procedure of human identification processing 2 (short distance, face recognition). First, an image is captured (step S401), and a contour is extracted based on luminance or color difference data (step S402). Next, the image is divided into regions having the extracted contour as a boundary (step S403), and any target region is selected from the divided regions (step S404). Then, based on the RGB or color difference data, the average RGB or average color difference data of the selected region is calculated (step S405), and the calculated RGB or color difference value is converted into HSV (step S406).

引き続き、この変換したHSVが肌色の領域は否か、つまり、色相(Hue)が6〜38°か否かを判断し(ステップS407)、この判断がNOである場合には、顔の領域でないと判断する(ステップS415)。ステップS407での判断がYESである場合には、顔のマスクパターン(図26参照)を設定し、前記対象領域において眼と瞳の領域を検索する(ステップS408)。次に、眼の領域は検出できたか否かを判断し(ステップS409)、検出できない場合には、顔の領域でないと判断する(ステップS415)。検出できた場合には、眼の縦横比(b/a)、眼と瞳(黒眼)の面積比(r/ab)を算出し(ステップS410)、眼と瞳の比率は所定範囲内か否か、すなわち前記α≦b/a≦αの条件に合致するか否かを判断する(ステップS411)。この判断がNOである場合には、顔の領域でないと判断する(ステップS415)。 Subsequently, it is determined whether or not the converted HSV is a skin color region, that is, whether or not the hue (Hue) is 6 to 38 ° (step S407). If this determination is NO, the region is not a face region. Is determined (step S415). If the determination in step S407 is yes, a face mask pattern (see FIG. 26) is set, and eye and pupil regions are searched in the target region (step S408). Next, it is determined whether or not the eye region has been detected (step S409). If it cannot be detected, it is determined that the eye region is not a face region (step S415). If detected, the aspect ratio (b / a) of the eye and the area ratio (r 2 / ab) of the eyes and pupils (black eyes) are calculated (step S410), and the ratio of the eyes and pupils is within a predetermined range. Whether or not the condition of α 1 ≦ b / a ≦ α 2 is satisfied (step S411). If this determination is NO, it is determined that the region is not a face region (step S415).

ステップS411の判断がYESである場合には、眼と瞳の比率は所定範囲内であるか否か、すなわち前記β≦r/ab≦βの条件に合致するか否かを判断する(ステップS412)。この判断がNOである場合には、顔の領域でないと判断する(ステップS415)。ステップS412の判断がYESである場合には、右眼の幅W、右眼と左眼の間隔W、左眼の幅Wを算出し(ステップS413)、WとW、Wは等しいか否か、すなわちW−δ≦W≦W+δ、W−δ≦W≦W+δであるか否かを判断する(ステップS414)。この判断がNOである場合には、顔の領域でないと判断する(ステップS415)。そして、この判断がYESである場合、つまり、ステップS407、S409、S411、S412、S414の判断が全てYESである場合には、前記ステップS404で選択した領域を、顔の領域として認識する(ステップS416)。さらに、この認識された顔の領域の位置座標を記憶する(ステップS417)。次に、今回選択した領域が、当該画像において最後の領域であるか否かを判断し(ステップS418)、最後の領域でない場合には、ステップS404に戻って次の領域を選択し、前述した処理を繰り返す。そして、最後の領域まで以上の処理が実行されると、ステップS418の判断がYESとなり、認識結果を出力する(ステップS419)。 If the determination in step S411 is YES, it is determined whether or not the ratio between the eyes and the pupil is within a predetermined range, that is, whether or not the condition of β 1 ≦ r 2 / ab ≦ β 2 is satisfied. (Step S412). If this determination is NO, it is determined that the region is not a face region (step S415). If the determination in step S412 is YES, the right eye width W 1 , the right eye-left eye interval W 2 , and the left eye width W 3 are calculated (step S413), and W 1 and W 2 , W It is determined whether 3 is equal, that is, whether W 1 −δ ≦ W 2 ≦ W 1 + δ and W 1 −δ ≦ W 3 ≦ W 1 + δ (step S414). If this determination is NO, it is determined that the region is not a face region (step S415). If this determination is YES, that is, if all the determinations in steps S407, S409, S411, S412, and S414 are YES, the region selected in step S404 is recognized as a face region (step S416). Further, the position coordinates of the recognized face area are stored (step S417). Next, it is determined whether or not the region selected this time is the last region in the image (step S418). If it is not the last region, the process returns to step S404 to select the next region and Repeat the process. When the above processing is executed up to the last area, the determination in step S418 is YES, and the recognition result is output (step S419).

(第2の実施の形態)
図29、30は、本発明の第2の実施の形態を示すものである。本実施の形態は、撮影シーン別に対応して、特定の被写体の参照画像データや特徴量データを設定しておき、これらシーン別の参照画像と特徴データとを順にテンプレートメモリに呼び出して設定し、フォーカスされた被写体像のスルー画像を、設定された特定画像の画像や特徴データと順次比較して、合致する被写体があると認識されれば、当該シーンの被写体、及びその認識された被写体の数に応じて、該当するシーン別撮影プログラムを自動的に選択するようにしたものである。
(Second Embodiment)
29 and 30 show a second embodiment of the present invention. In the present embodiment, reference image data and feature amount data of a specific subject are set corresponding to each shooting scene, and these scene-specific reference images and feature data are sequentially set in the template memory. The through image of the focused subject image is sequentially compared with the image and feature data of the set specific image, and if it is recognized that there is a matching subject, the subject of the scene and the number of recognized subjects The corresponding scene-specific shooting program is automatically selected according to the above.

すなわち、この実施の形態において前記プログラムメモリ32には、図29に示すように、人物を写す場合(1)、複数の人物を風景を写す場合(2)、花を写す場合(3)・・・等の撮影シーン別に、当該シーンを撮影する場合に好適なシーン別撮影制御プログラムが記憶されているとともに、撮影シーンに対応してそのサンプル画像300と、「色強調が肌色に設定されます。」等の当該シーン別撮影制御プログラムに関する説明文301等が記憶されている。さらに、各撮影シーンに対応して参照画像(サンプル画像300とは異なる比較用の画像)またはこの参照画像の特徴量データが記憶されている。   That is, in this embodiment, as shown in FIG. 29, in the program memory 32, when a person is photographed (1), when a plurality of persons are photographed as a landscape (2), when a flower is photographed (3)・ For each shooting scene, etc., a scene-specific shooting control program suitable for shooting the scene is stored, and the sample image 300 corresponding to the shooting scene and “color enhancement is set to skin color. ”And the like related to the scene-specific shooting control program. Further, a reference image (an image for comparison different from the sample image 300) or feature data of the reference image is stored corresponding to each shooting scene.

すなわち、例えば、撮影シーン(2)の複数の人物を写す撮影シーンに対応して、1つの人物の顔の画像が参照画像として記憶され、またはこの参照画像の特徴量データが記憶されている。また、撮影シーン(3)の複数の花びらからなる花を写す撮影シーンに対応して、1枚の花びらの画像が参照画像として記憶され、またはこの参照画像の特徴量データが記憶されている。なお、各特徴量データには、「No.」が付されている。   That is, for example, an image of one person's face is stored as a reference image or feature amount data of the reference image is stored in correspondence with a shooting scene in which a plurality of persons in the shooting scene (2) are captured. Corresponding to a shooting scene in which a flower composed of a plurality of petals in the shooting scene (3) is captured, an image of one petal is stored as a reference image, or feature amount data of this reference image is stored. In addition, “No.” is attached to each feature amount data.

図30は、本実施の形態の処理手順を示す一連のフローチャートであり、制御部25はプログラムメモリ32に格納されているプログラムに基づき、同図に示すフローチャートに従って処理を実行する。先ず、ユーザーによる操作入力部35での操作によって、撮影シーンの自動選択機能がONとなっているか否かを判断し(ステップS501)、ONとなっていない場合には、その他の撮影モード処理に移行する(ステップS502)。またONとなっている場合には、フォーカス枠を選択する(ステップS503)。つまり、この実施の形態においては、表示部14に被写体スルー画像とともに複数のフォーカス枠を表示し、ユーザによる操作部23での操作により、この複数のフォーカス枠のいずれかを選択する。したがって、この実施の形態においては、フォーカス枠の選択により、スルー画像において識別したい領域が指定されることとなる。   FIG. 30 is a series of flowcharts showing the processing procedure of the present embodiment, and the control unit 25 executes processing according to the flowchart shown in FIG. First, it is determined whether or not the automatic selection function of the shooting scene is turned on by the operation of the operation input unit 35 by the user (Step S501). The process proceeds (step S502). If it is ON, a focus frame is selected (step S503). That is, in this embodiment, a plurality of focus frames are displayed on the display unit 14 together with the subject through image, and one of the plurality of focus frames is selected by an operation on the operation unit 23 by the user. Therefore, in this embodiment, the region to be identified in the through image is designated by selecting the focus frame.

次に、表示部14に表示されている被写体画像(被写体スルー画像)を読み込み(ステップS504)、フォーカス枠周辺の被写体に対して、AF処理を実行して合焦させ(ステップS505)。さらに、この合焦させたフォーカス枠周辺領域内の被写体像を輝度もしくは色差データに基づいて輪郭抽出し(ステップS506)、この抽出した輪郭を境界とする複数の領域に分割する(ステップS507)。   Next, the subject image (subject through image) displayed on the display unit 14 is read (step S504), and AF processing is executed on the subject around the focus frame to focus (step S505). Further, contour extraction is performed on the subject image in the focused frame peripheral region based on the luminance or color difference data (step S506), and the image is divided into a plurality of regions with the extracted contour as a boundary (step S507).

また、第1の撮影シーン(撮影シーン(1))に対応して記憶された前記参照画像もしくは特徴量データを読み出し、テンプレートメモリ(データメモリ38)に設定する(ステップS508)。引き続き、フォーカス領域内(フォーカス枠内)から、最も大きい、もしくは、中央の輪郭領域を選択し(ステップS509)、この選択された領域のスルー画像に対して前述した特徴抽出処理を実行する(ステップS510)。また、このステップS510で抽出した特徴量をテンプレートの特徴量(テンプレートメモリに記憶された参照画像もしくは特徴量データ)と比較し類似度を算出する(ステップS511)。そして、この算出した類似度が所定値以上であるか否かを判断し(ステップS512)、所定値以上でない場合には、ステップS513及びS514の処理を行うことなく、ステップS515に進む。しかし、類似度が所定値以上であった場合には、テンプレートに設定された参照特徴量に該当する被写体と認識し、特徴量No.と被写体の位置座標を記憶するとともに(ステップS513)、被写体の認識数をカウントする(ステップS514)。   Further, the reference image or feature data stored corresponding to the first shooting scene (shooting scene (1)) is read and set in the template memory (data memory 38) (step S508). Subsequently, the largest or central contour region is selected from within the focus region (within the focus frame) (step S509), and the above-described feature extraction processing is executed on the through image of the selected region (step S509). S510). Further, the feature amount extracted in step S510 is compared with the feature amount of the template (reference image or feature amount data stored in the template memory) to calculate the similarity (step S511). Then, it is determined whether or not the calculated similarity is greater than or equal to a predetermined value (step S512). If not, the process proceeds to step S515 without performing steps S513 and S514. However, if the similarity is equal to or greater than a predetermined value, the subject is recognized as a subject corresponding to the reference feature amount set in the template, and the feature amount No. And the position coordinates of the subject are stored (step S513), and the number of recognized subjects is counted (step S514).

また、前記ステップS507で分割した領域おける次の分割領域を選択して(ステップS515)、全ての領域と対比済となったか否かを判断し(ステップS516)、全ての領域と対比済となるまでステップS510からの処理を繰り返す。全ての領域と対比済となったならば、認識された被写体、あるいは領域があるか否か、または前記ステップS514でカウントした認識数のカウント値が1以上であるか否かを判断する(ステップS517)。この判断の結果、認識された被写体、あるいは領域がなく、またはカウントした認識数のカウント値が0であった場合には、次の撮影シーンに対応して記憶された前記参照画像もしくは特徴量データを読み出し、テンプレートメモリ(データメモリ38)に設定する(ステップS518)。そして、全ての撮影シーンと比較済みか否かを判断し(ステップS519)、比較済みでない場合には前述したステップS509からの処理を繰り返す。また、全ての撮影シーンと比較済みとなった場合には、撮影シーンの自動選択に失敗した旨を表示部14に表示し、または、通常の自動撮影モードを選択して(ステップS520)、後述するステップS523に進む。   Further, the next divided area in the area divided in step S507 is selected (step S515), and it is determined whether or not all areas have been compared (step S516), and all areas have been compared. Until the process from step S510 is repeated. If all the areas have been compared, it is determined whether there is a recognized object or area, or whether the count value of the number of recognitions counted in step S514 is 1 or more (step S514). S517). If the result of this determination is that there is no recognized subject or area, or the count value of the recognized number of counts is 0, the reference image or feature quantity data stored corresponding to the next shooting scene Is set in the template memory (data memory 38) (step S518). Then, it is determined whether or not all the shooting scenes have been compared (step S519), and if not compared, the processing from step S509 described above is repeated. If all the shooting scenes have been compared, the fact that the automatic selection of the shooting scene has failed is displayed on the display unit 14 or the normal automatic shooting mode is selected (step S520), which will be described later. The process proceeds to step S523.

他方、ステップS517での判断の結果、認識された被写体、あるいは領域があり、またはカウントした認識数のカウント値が1以上であった場合には、合致すると認識されたテンプレート及び認識された被写体、あるいは領域の数に応じて撮影シーンを自動的に選択する(ステップS521)。   On the other hand, as a result of the determination in step S517, if there is a recognized subject or area, or the count value of the counted number of recognition is 1 or more, the template recognized as matching and the recognized subject, Alternatively, a shooting scene is automatically selected according to the number of areas (step S521).

すなわち、例えば、前述のように、撮影シーン(2)の複数の人物を写す撮影シーンに対応して、1つの人物の顔の画像が参照画像の特徴量データが記憶されており、ステップS508でこの特徴量データがテンプレートメモリに設定されたとする。この状態でユーザが人物3人を被写体として、フォーカス枠内に位置させてカメラを構えると、S510〜S516の処理が繰り返されることにより、ステップS514で認識数「3」がカウントされることとなる。また、人物が「3」に対応する撮影シーンは、撮影シーン(2)であることから、複数の人物を写す場合(2)を自動的に選択する。そして、この選択された撮影シーンを表示部14の一部に表示するとともに、選択された撮影シーンに応じて撮影条件等を自動的に設定する。つまり、前述のように、プログラムメモリ32には、複数の人物を写す場合(2)に好適な撮影シーン別撮影制御プログラムが記憶されていることから、当該撮影制御プログラムを起動させることにより、撮影条件等を自動的に設定する。これにより、認識した被写体数等に応じて、適切な撮影条件で撮影を行うことが可能となる。   That is, for example, as described above, the feature amount data of the reference image is stored as the face image of one person corresponding to the shooting scene in which a plurality of persons in the shooting scene (2) are shot, and in step S508, It is assumed that this feature amount data is set in the template memory. In this state, when the user holds the camera with three persons as subjects and is positioned within the focus frame, the number of recognitions “3” is counted in step S514 by repeating the processing of S510 to S516. . Also, since the photographic scene corresponding to the person “3” is the photographic scene (2), the case (2) where a plurality of persons are photographed is automatically selected. Then, the selected shooting scene is displayed on a part of the display unit 14, and shooting conditions and the like are automatically set according to the selected shooting scene. That is, as described above, the program memory 32 stores a shooting control program for each shooting scene that is suitable for shooting a plurality of persons (2). Set conditions automatically. Thereby, it is possible to perform shooting under appropriate shooting conditions according to the number of recognized subjects and the like.

(第3の実施の形態)
図31、32は、本発明の第3の実施の形態を示すものであり、人物と認識された被写体の数に応じて撮影条件を自動設定するようにしたものである。 図31は、本実施の形態の処理手順を示す一連のフローチャートであり、制御部25はプログラムメモリ32に格納されているプログラムに基づき、同図に示すフローチャートに従って処理を実行する。先ず、ユーザによる操作部23の操作によって人物撮影モードが設定されているか否かを判断し(ステップS601)、設定されていない場合にはその他の撮影モード処理に移行する(ステップS602)。また、人物撮影モードが設定されている場合には、この時点で表示部14にスルー画像として表示されている被写体画像を取り込む(ステップS603)。そして、前述した図4のステップS109と同様に、取り込んだ被写体像から対角の2点で識別したい領域を選択する(ステップS604)。
(Third embodiment)
FIGS. 31 and 32 show a third embodiment of the present invention, in which shooting conditions are automatically set according to the number of subjects recognized as a person. FIG. 31 is a series of flowcharts showing the processing procedure of the present embodiment, and the control unit 25 executes processing according to the flowchart shown in FIG. 31 based on the program stored in the program memory 32. First, it is determined whether or not the person photographing mode is set by the operation of the operation unit 23 by the user (step S601). If not set, the process proceeds to other photographing mode processing (step S602). If the person shooting mode is set, the subject image displayed as a through image on the display unit 14 at this time is captured (step S603). Then, similarly to step S109 of FIG. 4 described above, a region to be identified by two diagonal points is selected from the captured subject image (step S604).

次に、前記取り込んだ被写体画像に対し輪郭抽出処理を行って、複数領域に分割する(ステップS605)。つまり前述したように、被写体画像の画像データの輝度信号及び色差信号から、近い輝度または色差信号別に、例えば同系色の色相別等に領域を分割し、さらに、領域の境界線となる輪郭線を抽出し、この輪郭線で囲まれた部分を一つの輪郭領域(抽出領域)とすることにより、被写体画像を複数領域に分割する。引き続き、プログラムメモリ32に予め記憶されている人物に対応する参照画像、特徴量データを読み出してテンプレートメモリ(データメモリ33)に設定する(ステップS606)。   Next, the extracted subject image is subjected to contour extraction processing and divided into a plurality of regions (step S605). That is, as described above, the region is divided into luminance or color difference signals from the luminance signal and color difference signal of the subject image according to similar luminance or color difference signals, for example, by hues of similar colors, and the contour line that becomes the boundary line of the region is further divided. The subject image is divided into a plurality of regions by extracting and defining a portion surrounded by the contour line as one contour region (extraction region). Subsequently, the reference image and feature data corresponding to the person stored in advance in the program memory 32 are read out and set in the template memory (data memory 33) (step S606).

また、前記ステップS603で分割した複数の輪郭領域のうち、最も大きい領域、最も被写体までの距離が近い領域、中央に近い領域のいずれか先ず選択する(ステップS607)。さらに、この選択領域の被写体を測距するとともに、AF処理を行って当該被写体に合焦させて(ステップS608)、この選択領域の被写体に対して前述した特徴抽出処理を実行する(ステップS609)。このステップS609で抽出した特徴量をテンプレートの特徴量(テンプレートメモリに記憶された参照画像もしくは特徴量データ)と比較し類似度を算出する(ステップS610)。そして、この算出した類似度が所定値以上であるか否かを判断し(ステップS611)、所定値以上でない場合には、ステップS612及びS613の処理を行うことなく、ステップS614に進む。類似度が所定値以上であった場合には、人物と認識し、当該被写体のスルー画像における位置座標、及び前記ステップS608で測距した当該被写体の距離情報を記憶する(ステップS612)。さらに、人数をカウントしているカウンタの値をカウントアップさせるともに、前記ステップS605で分割した輪郭領域おける次の領域を選択する(ステップS613)。そして、全ての輪郭領域と対比したか否かを判断し(ステップS614)、全ての領域と対比済となるまでステップS608からの処理を繰り返す。   Of the plurality of contour regions divided in step S603, the largest region, the region closest to the subject, or the region near the center is first selected (step S607). Further, the subject in the selected area is measured, and AF processing is performed to focus on the subject (step S608), and the above-described feature extraction process is executed on the subject in the selected area (step S609). . The feature amount extracted in step S609 is compared with the feature amount of the template (reference image or feature amount data stored in the template memory) to calculate the similarity (step S610). Then, it is determined whether or not the calculated similarity is greater than or equal to a predetermined value (step S611). If not, the process proceeds to step S614 without performing the processes of steps S612 and S613. If the similarity is equal to or greater than a predetermined value, the person is recognized as a person, and the position coordinates of the subject in the through image and the distance information of the subject measured in step S608 are stored (step S612). Further, the value of the counter that counts the number of people is counted up, and the next area in the contour area divided in step S605 is selected (step S613). Then, it is determined whether or not all contour regions have been compared (step S614), and the processing from step S608 is repeated until all the regions have been compared.

全ての領域と対比済となったならば、前記ステップS613でカウントした認識カウント数(人数)が1以上であるか否かを判断し(ステップS615)、認識カウント数が0であった場合には、人物が認識できない旨を表示部14に表示し、または、その他の撮影モードを選択する(ステップS616)。   If all the areas have been compared, it is determined whether or not the recognition count (number of people) counted in step S613 is 1 or more (step S615), and if the recognition count is 0. Displays that the person cannot be recognized on the display unit 14 or selects another shooting mode (step S616).

他方、ステップS615での判断の結果、認識カウント数(人数)が1以上であった場合には、この人物と認識された被写体の数(人数)に応じて、撮影条件等を設定する(ステップS617)。具体的には、以下のステップS618〜S628に示す処理を実行する。先ず、認識カウント数が1であるか否かを判断し(ステップS618)、認識カウント数=1である場合には、当該被写体の距離Lの前方a[mm]、後方b[mm]の範囲に被写界深度を設定する(ステップS619)。例えば、過焦点距離(HFD)を
HFD=(L/a)−L、または
HFD=(L/b)+L、に設定する。
On the other hand, if the result of determination in step S615 is that the recognition count number (number of people) is 1 or more, shooting conditions and the like are set according to the number of subjects recognized as this person (number of people) (step 615). S617). Specifically, the processes shown in the following steps S618 to S628 are executed. First, it is determined whether or not the recognition count number is 1 (step S618). If the recognition count number is 1, the range of the distance a to the front a [mm] and the rear b [mm] of the subject. The depth of field is set to (step S619). For example, the hyperfocal distance (HFD) is set to HFD = (L 2 / a) −L or HFD = (L 2 / b) + L.

次に、焦点距離(f)と、前記設定過焦点距離(HFD)に相当する下記絞り値Fに設定する(ステップS620)。
F=f/(δ・HFD)
(δ:許容錯乱円径)
さらに、色強調を肌色に設定し、シャープネスをややソフトに設定する(ステップS621)。しかる後に、撮影処理を実行し、ユーザによるレリーズ釦3の操作に応答して、撮像素子20から画像データを取り込み、圧縮符号化/伸長復号化部30で圧縮符号化して、静止画/動画画像メモリ31に記録する(ステップS629)。
Next, the following aperture value F corresponding to the focal length (f) and the set hyperfocal length (HFD) is set (step S620).
F = f 2 / (δ · HFD)
(Δ: Allowable circle of confusion)
Further, the color enhancement is set to the skin color, and the sharpness is set to be slightly soft (step S621). Thereafter, shooting processing is executed, and in response to the user operating the release button 3, image data is captured from the image sensor 20, compressed and encoded by the compression encoding / decompression decoding unit 30, and a still image / moving image It records in the memory 31 (step S629).

したがって、認識カウント数=1であった場合には、図23(A)に示すように、人物が1人であって、前記ステップS619〜S621で設定された撮影条件で撮影された静止画が静止画/動画画像メモリ31に記録される。つまり、認識された被写体の数(人数)が1人であれば、当該人物のポートレート撮影と判断して、当該被写体にのみピントを合わせ、背景は少しボケるように、当該被写体の距離に応じて、人物の前後10cm程度の範囲のみ被写体深度Z(または、それに対応する過焦点距離HFD)を設定し、過焦点距離HFDとレンズ焦点距離(f)に応じて絞りの値(F値)を設定し、設定された絞り値のApex値(Av値)に連動して、測光値に基づく適正露出値(Ev)となるTv値(=Ev−Av)に相当する露出時間(シャッター速度)を設定する。また、人物のポートレート撮影として、肌色を強調する色補正フィルタ処理を加え、輪郭強調処理フィルタによるシャープネスは、ややソフト(ソフトフォーカス気味)に設定して撮影する。   Therefore, when the recognition count number = 1, as shown in FIG. 23A, there is one person, and a still image shot under the shooting conditions set in steps S619 to S621 is taken. It is recorded in the still image / moving image memory 31. In other words, if the number (number of subjects) of the recognized subjects is one, it is determined that the person has taken a portrait, and only the subject is focused, and the background is slightly blurred so that the background is slightly blurred. Accordingly, the subject depth Z (or the hyperfocal distance HFD corresponding thereto) is set only in the range of about 10 cm before and after the person, and the aperture value (F value) is set according to the hyperfocal distance HFD and the lens focal length (f). And an exposure time (shutter speed) corresponding to a Tv value (= Ev−Av) that becomes an appropriate exposure value (Ev) based on the photometric value in conjunction with the Apex value (Av value) of the set aperture value. Set. For portrait photography of a person, color correction filter processing for enhancing skin color is added, and sharpness by the contour enhancement processing filter is set slightly soft (soft focus).

また、ステップS618での判断の結果、認識カウント数≠1であった場合には、認識カウント数が2〜5であるか否かを判断する(ステップS622)。認識カウント数=2〜5である場合には、最も近い人物の距離L1から最も遠い人物の距離L2までピントが合うよう、被写界深度を設定する(ステップS623)。例えば、過焦点距離(HFD)を
HFD=(L・L1)/(L−L1)、または
HFD=(L・L2)/(L−L2)、に設定する。
If the recognition count number ≠ 1 as a result of the determination in step S618, it is determined whether the recognition count number is 2 to 5 (step S622). When the recognition count number is 2 to 5, the depth of field is set so that the distance from the nearest person distance L1 to the farthest person distance L2 is in focus (step S623). For example, the hyperfocal distance (HFD) is set to HFD = (L·L1) / (L−L1) or HFD = (L·L2) / (L−L2).

次に、設定した過焦点距離(HFD)に相当する下記絞り値Fに設定する(ステップS624)。
F=f/(δ・HFD)
(δ:許容錯乱円径)
さらに、色強調を肌色に設定し、シャープネスをノーマルに設定する(ステップS625)。しかる後に、前記撮影処理を実行する(ステップS628)。したがって、認識カウント数=3であった場合には図32(B)に示すように、人物が3人であって、前記ステップS623〜S625で設定された撮影条件で撮影された静止画が静止画/動画画像メモリ31に記録される。つまり、認識された被写体の数(人数)が2〜5人程度の場合には、複数人のスナップショットと判断して、最も近い人物の距離L1から最も遠い人物の距離L2までにピントが合うように、被写界深度Z(または、それに対応する過焦点距離HFD)と絞りの値(F値)に設定して、前述と同様に連動して適正露出となる露出時間を設定し、また、肌色を強調する色補正フィルタ処理を加え、輪郭強調処理フィルタによるシャープネスは、ノーマルに設定して撮影する。
Next, the following aperture value F corresponding to the set hyperfocal distance (HFD) is set (step S624).
F = f 2 / (δ · HFD)
(Δ: Allowable circle of confusion)
Further, the color enhancement is set to skin color, and the sharpness is set to normal (step S625). Thereafter, the photographing process is executed (step S628). Therefore, when the recognition count number = 3, as shown in FIG. 32 (B), there are three persons and still images shot under the shooting conditions set in steps S623 to S625 are still images. Recorded in the image / moving image memory 31. In other words, when the number of recognized subjects (number of persons) is about 2 to 5, it is determined as a snapshot of a plurality of persons, and the focus is adjusted from the distance L1 of the nearest person to the distance L2 of the farthest person. As described above, the depth of field Z (or the corresponding hyperfocal distance HFD) and the aperture value (F value) are set, and the exposure time for proper exposure is set in conjunction with the above, and Then, color correction filter processing for emphasizing the skin color is added, and the sharpness by the contour enhancement processing filter is set to normal, and shooting is performed.

また、ステップS622での判断の結果、認識カウント数≠2〜5であった場合には、認識カウント数は6以上である。そして、認識カウント数は6以上である場合には、最も近い人物の距離L1から無限遠点までピントが合うよう、被写界深度を設定する(ステップS626)。例えば、過焦点距離(HFD)を
HFD=L1に設定する。
If the recognition count number is not 2 to 5 as a result of the determination in step S622, the recognition count number is 6 or more. If the recognition count is 6 or more, the depth of field is set so that the closest person is focused from the distance L1 to the point at infinity (step S626). For example, the hyperfocal distance (HFD) is set to HFD = L1.

次に、設定した過焦点距離(HFD)に相当する下記絞り値Fに設定する(ステップS627)。
F=f/(δ・HFD)
(δ:許容錯乱円径)
さらに、色強調を肌色に設定し、シャープネス(輪郭強調)をややハードにに設定する(ステップS628)。しかる後に、前記撮影処理を実行する(ステップS629)。したがって、認識カウント数=6以上であった場合には図32(C)に示すように、人物が例えば16人であって、前記ステップS626〜S68で設定された撮影条件で撮影された静止画が静止画/動画画像メモリ31に記録されることとなる。つまり、認識された被写体の数が6人以上である場合には、複数人の記念写真撮影と判断して、人物だけでなく、遠方の背景や景色にも焦点が合うように、最も近い人物の距離L1から無限遠(∞)までにピントが合うように、被写界深度Z(または、それに対応する過焦点距離HFD)と絞りの値(F値)に設定して、前述と同様に連動して適正露出となる露出時間を設定する。また、人物が小さくなり、遠方の景色もくっきり写るように、輪郭強調処理フィルタによるシャープネスは、ややハードに設定して撮影する。
Next, the following aperture value F corresponding to the set hyperfocal distance (HFD) is set (step S627).
F = f 2 / (δ · HFD)
(Δ: Allowable circle of confusion)
Further, the color enhancement is set to the skin color, and the sharpness (outline enhancement) is set to be slightly hard (step S628). Thereafter, the photographing process is executed (step S629). Therefore, when the recognition count number is 6 or more, as shown in FIG. 32C, there are 16 people, for example, and still images shot under the shooting conditions set in steps S626 to S68. Is recorded in the still image / moving image memory 31. In other words, if the number of recognized subjects is 6 or more, it is determined that a commemorative photo is taken by a plurality of people, and the closest person is focused not only on the person but also on the background and scenery in the distance. In the same manner as described above, the depth of field Z (or the corresponding hyperfocal distance HFD) and the aperture value (F value) are set so that the distance from the distance L1 to infinity (∞) is in focus. Set the exposure time for proper exposure. Further, the sharpness by the edge enhancement processing filter is set to be slightly hard so that a person becomes smaller and a distant scenery can be clearly seen.

このように、認識された被写体の距離、人数に応じて、被写界深度や絞りの設定、各種フィルタの処理の選択などの撮影処理を制御して、同じ人物撮影においても、当該被写体の状況に応じて、ユーザの意図により近い自動撮影が行える。同様に、他の撮影シーンにおいても、撮影距離や認識した被写体の数に応じて、当該撮影シーンの中でも、より詳細な撮影条件の設定や画像処理の設定が可能となる。   In this way, depending on the distance and the number of recognized subjects, the shooting process such as the depth of field and aperture setting, and the selection of various filter processes is controlled, so that the situation of the subject can be obtained even in the same person shooting. Accordingly, automatic shooting closer to the user's intention can be performed. Similarly, in other shooting scenes, more detailed shooting conditions and image processing can be set in the shooting scene according to the shooting distance and the number of recognized subjects.

なお、本実施の形態においては、ステップS604の処理を実行し、前述した図4のステップS109と同様に、取り込んだ被写体像から対角の2点で識別したい領域を選択するようにした。しかし、このステップS604を行うことなく、被写体像の全域を識別したい領域とするようにしてもよい。   In the present embodiment, the process of step S604 is executed, and the region to be identified at two diagonal points is selected from the captured subject image, as in step S109 of FIG. 4 described above. However, the entire region of the subject image may be set to be identified without performing step S604.

ここで、図31のフローチャートにおいて用いた式について説明すると、被写界深度は、撮影レンズの焦点距離(f)と絞り値(F)と撮影距離(F)等から、次のような式で算出することができる。
前方被写界深度Tf=δFL/(f+δFL)
後方被写界深度Tr=δFL/(f−δFL)
被写界深度Z=Tf+Tr=δFL/(f−δFL)
Here, the equation used in the flowchart of FIG. 31 will be described. The depth of field is expressed by the following equation from the focal length (f), aperture value (F), photographing distance (F), and the like of the photographing lens. Can be calculated.
Forward depth of field Tf = δFL 2 / (f 2 + δFL)
Back depth of field Tr = δFL 2 / (f 2 −δFL)
Depth of field Z = Tf + Tr = δFL 2 f 2 / (f 2 −δFL)

また、撮像面から被写体との距離に換算すると、被写界深度限界近点、遠点が求まる。
被写界深度限界近点Lmin=L−Tf=fL/(f+δFL)
被写界深度限界遠点Lmax=L+Tf=fL/(f−δFL)
同様に、被写界深度Z=Tf+Tr=Lmax−Lmin
但し、f;焦点距離、F:絞り値(F値)、L;被写体との撮影距離、δ;許容錯乱円の直径を表す。
Further, when converted into the distance from the imaging surface to the subject, the depth-of-field limit near point and far point are obtained.
Depth of field limit near point Lmin = L−Tf = f 2 L / (f 2 + δFL)
Depth of field limit far point Lmax = L + Tf = f 2 L / (f 2 −δFL)
Similarly, depth of field Z = Tf + Tr = Lmax−Lmin
Where f: focal length, F: aperture value (F value), L: photographing distance to the subject, δ: diameter of allowable circle of confusion.

また、被写界深度遠点(Lmax)が無限遠(∞)となる撮影距離(L)である「過焦点距離」(Hyper Focal Distance、HFD)では、HFDの1/2の距離から無限遠(∞)までにピントが合って見える。この過焦点距離(HFD)と撮影距離(L)の関係からも、同様に、次式のように被写界深度を求めることができる。
過焦点距離HFD=f+δF、
被写界深度限界近点Lmin=(過焦点距離HFD×撮影距離)÷(過焦点距離HFD+撮影距離L)=fL(f+δFL)
被写界深度限界遠点Lmax=(過焦点距離HFD×撮影距離)÷(過焦点距離HFD−撮影距離L)=fL(f−δFL)
被写界深度Z=Lmax−Lmin=2δFL/(f−δ
Further, in the “hyperfocal distance” (HFD), which is an imaging distance (L) at which the depth of field far point (Lmax) becomes infinity (∞), the distance from ½ of HFD to infinity. It appears in focus by (∞). Similarly, from the relationship between the hyperfocal distance (HFD) and the shooting distance (L), the depth of field can be obtained as in the following equation.
Hyperfocal distance HFD = f 2 + δF,
Depth of field limit near point Lmin = (hyperfocal distance HFD × shooting distance) ÷ (hyperfocal distance HFD + shooting distance L) = f 2 L (f 2 + δFL)
Depth of field limit far point Lmax = (hyperfocal distance HFD × shooting distance) ÷ (hyperfocal distance HFD−shooting distance L) = f 2 L (f 2 −δFL)
Depth of field Z = Lmax−Lmin = 2δFL 2 f 2 / (f 4 −δ 2 F 2 L 2 )

したがって、前記ステップS618のように、撮影距離Lを被写体の前a[mm]〜被写体の後b[mm]の範囲にピントが合うように設定するには、
前方被写界深度Tf=a,後方被写界深度Tr=b、被写界深度Z=Tf+Tr=a+b、
もしくは、HFD=(L/a)−L、または、HFD=(L/b)+Lと設定すればよい。
Therefore, as in step S618, in order to set the shooting distance L to be in the range from the front a [mm] of the subject to the rear b [mm] of the subject,
Forward depth of field Tf = a, backward depth of field Tr = b, depth of field Z = Tf + Tr = a + b,
Alternatively, HFD = (L 2 / a) −L or HFD = (L 2 / b) + L may be set.

また、前記ステップS622のように、撮影距離L1〜撮影距離L2までピントが合うように設定するには、
被写界深度限界近点Lmin=L1、被写界深度限界遠点Lmax=L2、被写界深度Z=Lmax−Lmin=L2−L1、
もしくは、HFD=(L・L1)/(L−L1)、または、HFD=(L・L2)/(2−L)と設定すればよい。
Further, as in step S622, in order to set the focus from the shooting distance L1 to the shooting distance L2,
Depth of field limit near point Lmin = L1, Depth of field limit far point Lmax = L2, Depth of field Z = Lmax−Lmin = L2−L1,
Alternatively, HFD = (L·L1) / (L−L1) or HFD = (L·L2) / (2−L) may be set.

また、前記ステップS625のように、撮影距離L1〜無限遠(∞)までピントがあうように設定するには、
過焦点距離HFD=f/δF=L1、
と設定すればよい。
Also, as in step S625, in order to set the focus from the shooting distance L1 to infinity (∞),
Hyperfocal distance HFD = f 2 / δF = L1,
Should be set.

したがって、各設定された被写界深度、もしくは、それに相当する過焦点距離HFDと焦点距離(f)に応じて、絞り値F=f/(δ・HFD)に設定し、
また、露出値(Av)=被写体輝度値(Ev)+感度値(Sv)=開口値(Av)+シャッター速度値(Tv)、
開口値(Av)=log(F)、シャッター速度値(Tv)log(1/T)の関係より、適正露出値Evを満たすシャッター速度値(Tv)=Ev−Av=Ev−log(F)、露出時間(T)=1/(2のTv乗)に設定すればよい。
Therefore, the aperture value F = f 2 / (δ · HFD) is set according to each set depth of field, or the corresponding hyperfocal length HFD and focal length (f),
Further, exposure value (Av) = subject luminance value (Ev) + sensitivity value (Sv) = aperture value (Av) + shutter speed value (Tv),
From the relationship of the aperture value (Av) = log 2 (F) 2 and the shutter speed value (Tv) log 2 (1 / T), the shutter speed value (Tv) satisfying the appropriate exposure value Ev = Ev−Av = Ev−log. 2 (F) 2 , exposure time (T) = 1 / (2 to the power of Tv) may be set.

なお、実施の形態においては、本発明をデジタルカメラに適用するようにしたが、カメラに限らず撮像機能を備えた携帯電話等の各種機器にも本発明を適用することができる。   In the embodiment, the present invention is applied to a digital camera. However, the present invention can be applied not only to a camera but also to various devices such as a mobile phone having an imaging function.

(A)は本発明の各実施の形態に共通するデジタルカメラの正面図、(B)は背面図、(C)は側面透視図である。(A) is a front view of a digital camera common to each embodiment of the present invention, (B) is a rear view, and (C) is a side perspective view. 同デジタルカメラの概略的回路構成を示すブロック図である。FIG. 2 is a block diagram showing a schematic circuit configuration of the digital camera. 同デジタルカメラの具体的回路構成を示すブロック図である。2 is a block diagram showing a specific circuit configuration of the digital camera. FIG. 第1の実施の形態における処理手順を示すフローチャートである。It is a flowchart which shows the process sequence in 1st Embodiment. 同実施の形態の表示画面例を示す図である。It is a figure which shows the example of a display screen of the embodiment. 人物の顔を抽出して撮影する場合の動作例を示す図である。It is a figure which shows the operation example in the case of extracting and photographing a person's face. 野鳥を数える例を示す図である。It is a figure which shows the example which counts a wild bird. 集客数を数える例を示す図である。It is a figure which shows the example which counts the number of customers. 陳列商品を種別毎に数える例示す図である。It is a figure which shows the example which counts display goods for every classification. 本実施の形態における認識処理、認識被写体の設定メニューの表示例を示す図である。It is a figure which shows the example of a display of the recognition processing in this Embodiment, and the setting menu of a recognition subject. 図4のフローチャートにおけるステップS106で実行される特徴抽出処理の詳細を示すフローチャートである。It is a flowchart which shows the detail of the feature extraction process performed by step S106 in the flowchart of FIG. 1次微分フィルタまたは2次微分フィルタ処理による画像の先鋭化処理、エッジ(輪郭)抽出処理の例を示す図である。It is a figure which shows the example of the sharpening process of the image by a primary differential filter or a secondary differential filter process, and an edge (contour) extraction process. 1次微分フィルタまたは2次微分フィルタ処理による画像の先鋭化処理、エッジ(輪郭)抽出処理の例を示す図である。It is a figure which shows the example of the sharpening process of the image by a primary differential filter or a secondary differential filter process, and an edge (contour) extraction process. 膨脹、収縮処理の例を示す図である。It is a figure which shows the example of an expansion and contraction process. 所定の輝度の抽出処理を示す図である。It is a figure which shows the extraction process of predetermined brightness | luminance. 所定の色の領域を抽出する例として、人間の肌色領域の抽出例を示す図である。It is a figure which shows the example of extraction of a human skin color area | region as an example which extracts the area | region of a predetermined color. ステップS204の特徴抽出処理(1)における膨脹収縮処理の例を示す図である。It is a figure which shows the example of the expansion / contraction process in the characteristic extraction process (1) of step S204. 輪郭形状の特徴を抽出する例を示す図である。It is a figure which shows the example which extracts the feature of an outline shape. 輪郭の縦横比=長さh/幅wなどから、形状の「細長さ」等の評価値を求める説明図である。It is explanatory drawing which calculates | requires evaluation values, such as a shape "thin length", from the aspect ratio = length h / width w of an outline. 輪郭形状の偏角関数、位置座標関数の例を示す図である。It is a figure which shows the example of the declination function of a contour shape, and a position coordinate function. 輪郭形状の偏角関数、位置座標関数の例を示す図である。It is a figure which shows the example of the declination function of a contour shape, and a position coordinate function. 輪郭形状のフーリエ記述子の例を示す図である。It is a figure which shows the example of the Fourier descriptor of an outline shape. G形記述子の例を示す図である。It is a figure which shows the example of a G-type descriptor. P形記述子の例を示す図である。It is a figure which shows the example of a P-type descriptor. 入力画像とテンプレート画像との相関度、類似度を算出する説明図である。It is explanatory drawing which calculates the correlation degree and similarity degree of an input image and a template image. 顔の眼の領域を抽出するためのマスクパターンの例を示す図である。It is a figure which shows the example of the mask pattern for extracting the area | region of the eye of the face. 人間の認識処理1(中距離、頭の認識)の処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of the human recognition process 1 (medium distance, head recognition). 人間の顔の簡易な識別処理手順を示すフローチャートである。It is a flowchart which shows the simple identification process procedure of a human face. 本発明の第2の実施の形態における撮影シーンのサンプル画像等を示す図である。It is a figure which shows the sample image etc. of the imaging scene in the 2nd Embodiment of this invention. 同実施の形態における処理手順を示すフローチャートである。It is a flowchart which shows the process sequence in the embodiment. 本発明の第2の実施の形態における処理手順を示すフローチャートである。It is a flowchart which shows the process sequence in the 2nd Embodiment of this invention. 同実施の形態における撮影画像例を示す図である。It is a figure which shows the example of the picked-up image in the same embodiment.

符号の説明Explanation of symbols

1 デジタルカメラ
2 本体
3 レリーズ釦
8 モード切替スイッチ
9 ズーム操作キー
10 カーソルキー
13 メニューキー
14 表示部
20 撮像素子
23 操作部
25 制御部
30 圧縮符号化/伸長復号化部
31 静止画/動画画像メモリ
32 プログラムメモリ
33 データメモリ
35 操作入力部
38 撮影制御部
39 外部メモリ媒体
46 測距センサ
56 駆動機構
58 シャッター
64 シャッター駆動部
DESCRIPTION OF SYMBOLS 1 Digital camera 2 Main body 3 Release button 8 Mode change switch 9 Zoom operation key 10 Cursor key 13 Menu key 14 Display part 20 Image sensor 23 Operation part 25 Control part 30 Compression encoding / decompression decoding part 31 Still image / moving image memory 32 Program memory 33 Data memory 35 Operation input unit 38 Shooting control unit 39 External memory medium 46 Distance sensor 56 Drive mechanism 58 Shutter 64 Shutter drive unit

Claims (12)

被写体を結像させる結像手段と、
この結像手段により結像される画像を表示する表示手段と、
前記表示手段に表示された画像内から計数の対照となる複数の被写体を任意に選択する選択手段と、
前記表示手段に表示された画像内において、各被写体から抽出された特徴データとの類似度が所定以上である画像部分の個数を被写体毎に計数する計数手段と、
前記計数手段により各被写体毎に計数された個数を、各被写体毎に区別して前記表示手段に同時に表示させる表示制御手段と、
を備えることを特徴とするカメラ装置。
Imaging means for imaging a subject;
Display means for displaying an image formed by the imaging means;
A selection means for arbitrarily selecting a plurality of subjects to be counted from the image displayed on the display means;
Counting means for counting, for each subject, the number of image portions whose similarity with feature data extracted from each subject is greater than or equal to a predetermined value in the image displayed on the display means ;
Display control means for simultaneously displaying the number counted for each subject by the counting means on the display means while distinguishing for each subject;
A camera apparatus comprising:
前記表示制御手段は、前記選択手段により選択された複数の被写体の各々について、各被写体のサンプル画像と各被写体の個数とを対応付けて前記表示手段に同時に表示することを特徴とする請求項1記載のカメラ装置。2. The display control means, for each of a plurality of subjects selected by the selection means, displays a sample image of each subject and the number of each subject in association with each other on the display means. The camera device described. 前記表示制御手段は、前記表示手段に表示した画像内において、前記計数手段により計数された各被写体に対応する画像部分を識別表示した状態で、各被写体のサンプル画像と各被写体の個数とを対応付けて同時に表示することを特徴とする請求項2記載のカメラ装置。The display control means associates the sample image of each subject with the number of each subject in a state where the image portion corresponding to each subject counted by the counting means is identified and displayed in the image displayed on the display means. The camera device according to claim 2, wherein the camera device displays the images simultaneously. 前記表示制御手段は、複数の被写体の各々に対応した異なる形状で塗りつぶしを行って、各被写体に対応する画像部分を識別表示することを特徴とする請求項3記載のカメラ装置。4. The camera apparatus according to claim 3, wherein the display control means performs painting with different shapes corresponding to each of a plurality of subjects to identify and display an image portion corresponding to each subject. 操作に応じて位置が任意に変位するカーソルを前記表示手段に表示し、このカーソルで指定される2点を対角とする任意の領域を指定する領域指定手段を更に備え、
前記計数手段は、前記領域指定手段により指定された領域内において、各被写体から抽出された特徴データとの類似度が所定以上である画像部分の個数を計数することを特徴とする請求項1乃至4のいずれかに記載のカメラ装置。
A cursor whose position is arbitrarily displaced in accordance with the operation is displayed on the display means, and further includes an area designating means for designating an arbitrary area whose diagonals are two points designated by the cursor ,
2. The counting unit according to claim 1, wherein the counting unit counts the number of image portions whose similarity with the feature data extracted from each subject is greater than or equal to a predetermined value in the region specified by the region specifying unit. 5. The camera device according to any one of 4.
操作に応じて位置が任意に変位するカーソルを前記表示手段に表示し、このカーソルで示される任意の位置を指定する位置指定手段を更に備え、A cursor whose position is arbitrarily displaced according to the operation is displayed on the display means, and further includes a position designation means for designating an arbitrary position indicated by the cursor,
前記選択手段は、前記位置指定手段により指定された位置にある被写体を選択することを特徴とする請求項1乃至5のいずれかに記載のカメラ装置。  The camera apparatus according to claim 1, wherein the selection unit selects a subject at a position designated by the position designation unit.
前記位置指定手段は、操作に応じて位置と大きさが任意に変位するカーソルを前記表示手段に表示し、このカーソルで示される任意の位置と大きさを指定し、The position specifying means displays a cursor whose position and size are arbitrarily displaced according to an operation on the display means, and specifies an arbitrary position and size indicated by the cursor,
前記選択手段は、前記位置指定手段により指定された位置と大きさに対応する領域内から被写体を選択することを特徴とする請求項6に記載のカメラ装置。  The camera device according to claim 6, wherein the selection unit selects a subject from an area corresponding to the position and size designated by the position designation unit.
前記計数手段により計数された前記画像部分の個数に基づき、当該カメラ装置の撮影動作を制御する撮影制御手段を更に備えることを特徴とする請求項1から7いずれか記載のカメラ装置。 Wherein based on the number of counted the image portion by the counting means, a camera apparatus according to any one of claims 1 to 7, characterized by further comprising a photographing control means for controlling the photographing operation of the camera device. 複数の撮影シーンの各々対応して撮影条件を記憶した記憶手段と、
前記計数手段により計数された前記画像部分の個数に基づき、前記複数の撮影シーンのいずれかを選択する選択手段と、
この選択手段により選択された撮影シーンに対応して前記記憶手段に記憶されている前記撮影条件に基づき、当該カメラ装置の撮影動作を制御する撮影制御手段を更に備えることを特徴とする請求項8記載のカメラ装置。
Storage means for storing shooting conditions corresponding to each of a plurality of shooting scenes;
Selection means for selecting one of the plurality of shooting scenes based on the number of the image portions counted by the counting means;
Claim 8, characterized in that the selection means in response to the selected photographing scene by on the basis of the imaging conditions stored in said storage means, further comprising a photographing control means for controlling the photographing operation of the camera device The camera device described.
撮影者の指示操作に基づき、前記複数の撮影シーンのいずれかを選択する指示選択手段を備え、
前記撮影制御手段は、前記指示選択手段により撮影シーンが選択された場合には、該撮影シーンに対応して前記記憶手段に記憶されている前記撮影条件に基づき、当該カメラ装置の撮影動作を制御することを特徴とする請求項9記載のカメラ装置。
An instruction selecting means for selecting any of the plurality of shooting scenes based on a photographer's instruction operation;
When the shooting scene is selected by the instruction selection unit, the shooting control unit controls the shooting operation of the camera device based on the shooting condition stored in the storage unit corresponding to the shooting scene. The camera device according to claim 9.
前記撮影制御手段は、当該カメラ装置の合焦動作、被写界深度、露出条件、フィルタ処理の少なくとも一つを制御することを特徴とする請求項8記載のカメラ装置。 The camera apparatus according to claim 8 , wherein the photographing control unit controls at least one of a focusing operation, a depth of field, an exposure condition, and a filtering process of the camera apparatus. 被写体を結像させる結像手段と、この結像手段により結像される画像を表示する表示手段とを備えるカメラ装置が有するコンピュータを、
前記表示手段に表示された画像内から計数の対照となる複数の被写体を任意に選択する選択手段と、
前記表示手段に表示された画像内において、各被写体から抽出された特徴データとの類似度が所定以上である画像部分の個数を被写体毎に計数する計数手段と、
前記計数手段により各被写体毎に計数された個数を、各被写体毎に区別して前記表示手段に表示させる表示制御手段と、
して機能させることを特徴とするカメラ制御プログラム。
A computer having a camera device including an image forming means for forming an image of a subject and a display means for displaying an image formed by the image forming means;
A selection means for arbitrarily selecting a plurality of subjects to be counted from the image displayed on the display means;
Counting means for counting, for each subject, the number of image portions whose similarity with feature data extracted from each subject is greater than or equal to a predetermined value in the image displayed on the display means ;
Display control means for causing the display means to display the number counted for each subject by the counting means for each subject;
A camera control program characterized by being made to function.
JP2006026481A 2006-02-03 2006-02-03 Camera apparatus and camera control program Expired - Fee Related JP4894278B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006026481A JP4894278B2 (en) 2006-02-03 2006-02-03 Camera apparatus and camera control program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006026481A JP4894278B2 (en) 2006-02-03 2006-02-03 Camera apparatus and camera control program

Publications (2)

Publication Number Publication Date
JP2007208757A JP2007208757A (en) 2007-08-16
JP4894278B2 true JP4894278B2 (en) 2012-03-14

Family

ID=38487794

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006026481A Expired - Fee Related JP4894278B2 (en) 2006-02-03 2006-02-03 Camera apparatus and camera control program

Country Status (1)

Country Link
JP (1) JP4894278B2 (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4703498B2 (en) * 2006-06-30 2011-06-15 三洋電機株式会社 Digital camera
JP2009156888A (en) * 2007-12-25 2009-07-16 Sanyo Electric Co Ltd Speech corrector and imaging apparatus equipped with the same, and sound correcting method
JP5056297B2 (en) * 2007-09-14 2012-10-24 カシオ計算機株式会社 IMAGING DEVICE, IMAGING DEVICE CONTROL PROGRAM, AND IMAGING DEVICE CONTROL METHOD
JP4994174B2 (en) * 2007-09-28 2012-08-08 東芝情報システム株式会社 Data processing apparatus and data processing method
JP2009124208A (en) * 2007-11-12 2009-06-04 Murata Mach Ltd Image editing apparatus
JP5205961B2 (en) * 2007-12-27 2013-06-05 カシオ計算機株式会社 Imaging apparatus, imaging control method, and program
JP5029647B2 (en) 2009-04-08 2012-09-19 株式会社ニコン Subject tracking device and camera
JP5276538B2 (en) * 2009-07-22 2013-08-28 富士フイルム株式会社 AF frame automatic tracking system
JP2013149034A (en) * 2012-01-18 2013-08-01 Canon Inc Image display apparatus, image display method, and program
JP5811923B2 (en) * 2012-03-28 2015-11-11 富士通株式会社 Information processing apparatus, image processing method, and program
JP6736988B2 (en) * 2016-06-07 2020-08-05 大日本印刷株式会社 Image retrieval system, image processing system and image retrieval program
CN109508626A (en) * 2018-09-12 2019-03-22 深圳市乐视环球科技有限公司 A kind of method and apparatus automatically recording viewing number
JP7267730B2 (en) * 2018-12-21 2023-05-02 東京エレクトロンデバイス株式会社 Article counting device, article counting method and program
JP7303852B2 (en) * 2021-09-08 2023-07-05 ソフトバンク株式会社 Determination device, program, and determination method

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001256477A (en) * 2000-03-13 2001-09-21 Ecchandesu:Kk Information collecting device
JP2001357404A (en) * 2000-06-14 2001-12-26 Minolta Co Ltd Picture extracting device
JP4364464B2 (en) * 2001-09-17 2009-11-18 株式会社リコー Digital camera imaging device
JP3607237B2 (en) * 2001-10-19 2005-01-05 コニカミノルタフォトイメージング株式会社 Digital camera
JP2004227158A (en) * 2003-01-21 2004-08-12 Omron Corp Information providing device and information providing method
JP2004261155A (en) * 2003-03-04 2004-09-24 Ecore Kk Vermin-monitoring system
JP4335727B2 (en) * 2004-03-31 2009-09-30 富士フイルム株式会社 Digital camera for face extraction
JP2005293152A (en) * 2004-03-31 2005-10-20 Seiwa Electric Mfg Co Ltd Pattern matching method and pattern matching device
JP4442330B2 (en) * 2004-06-17 2010-03-31 株式会社ニコン Electronic camera and electronic camera system

Also Published As

Publication number Publication date
JP2007208757A (en) 2007-08-16

Similar Documents

Publication Publication Date Title
JP4894278B2 (en) Camera apparatus and camera control program
EP1522952B1 (en) Digital camera
JP4290100B2 (en) Imaging apparatus and control method thereof
JP4196714B2 (en) Digital camera
US8111946B2 (en) Image processing apparatus, imaging apparatus, and image processing method
EP1431912B1 (en) Method and system for determining an area of importance in an archival image
KR101679290B1 (en) Image processing method and apparatus
JP3684017B2 (en) Image processing apparatus and method
JP2000350123A (en) Picture selection device, camera, picture selection method and recording medium
JP2007088814A (en) Imaging apparatus, image recorder and imaging control program
JP2004320286A (en) Digital camera
JP2007503030A (en) System and method for removing red eye phenomenon from digital images
JP2004317699A (en) Digital camera
US20120213407A1 (en) Image capture and post-capture processing
JP2019106045A (en) Image processing device, method, and program
JP2009134383A (en) Image processing device, method, and program
JP4053764B2 (en) Subject extraction device and photographing device
JP2003156680A (en) Subject extracting device and photographing device
JP2004320285A (en) Digital camera
JP2004005384A (en) Image processing method, image processing device, program, recording medium, automatic trimming device and picture-taking arrangement
JP2002150287A (en) Image detector, image detection method, digital camera and printer
CN109729259B (en) Image processing apparatus, method thereof, system thereof, and computer readable medium
JP2008059534A (en) Image trimming device, image trimming method, and program therefor
JP4726251B2 (en) Imaging apparatus and image processing method
EP1968012A2 (en) Image processing apparatus, image processing method and recording medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090121

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20101118

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20101207

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110202

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: 20111129

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: 20111212

R150 Certificate of patent or registration of utility model

Ref document number: 4894278

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: 20150106

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees