JP2009146033A - Partial image extraction method - Google Patents

Partial image extraction method Download PDF

Info

Publication number
JP2009146033A
JP2009146033A JP2007320761A JP2007320761A JP2009146033A JP 2009146033 A JP2009146033 A JP 2009146033A JP 2007320761 A JP2007320761 A JP 2007320761A JP 2007320761 A JP2007320761 A JP 2007320761A JP 2009146033 A JP2009146033 A JP 2009146033A
Authority
JP
Japan
Prior art keywords
image
partial image
mask
partial
color component
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2007320761A
Other languages
Japanese (ja)
Other versions
JP5012477B2 (en
Inventor
Hiroyuki Abe
啓之 阿部
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.)
Nikon Corp
Original Assignee
Nikon Corp
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 Nikon Corp filed Critical Nikon Corp
Priority to JP2007320761A priority Critical patent/JP5012477B2/en
Publication of JP2009146033A publication Critical patent/JP2009146033A/en
Application granted granted Critical
Publication of JP5012477B2 publication Critical patent/JP5012477B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To accurately extract a partial image including a part to which a user pays attention in an image. <P>SOLUTION: In a partial image extraction method, a partial image extraction section 104a sets a frame (A) including a designation point 2a designated by a user in an image, generates a plain image for each color component based on the image in the frame (A), performs binary coding of the generated plain image for each color component with a threshold set for each plain image, generates a mask image for each color component, calculates an evaluation value for determining whether the mask image is suitable for extracting a partial image with the mask image for each color component as a target, selects an optimum mask image most suitable for extracting a partial image among the mask images for each color component based on the calculated evaluation value, sets a frame (B) to extract a partial image in the selected optimum mask image, and extracts an image in an area corresponding to the frame (B) set in the optimum mask image as a partial image from the target images. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、画像内から部分画像を抽出するための部分画像抽出方法に関する。   The present invention relates to a partial image extraction method for extracting a partial image from an image.

次のような撮影画面の顔領域検出方法が知られている。この顔領域検出方法では、撮影時の撮影倍率から人物の顔のサイズを推定するとともに、画面内での肌色領域のサイズを算出する。そして、推定した人物の顔のサイズと画面上の肌色領域のサイズとを比較することによって、撮影画面内における人物の顔の領域を検出する(例えば、特許文献1)。   There are known methods for detecting a face area of a shooting screen as follows. In this face area detection method, the size of a person's face is estimated from the shooting magnification at the time of shooting, and the size of the skin color area in the screen is calculated. Then, by comparing the estimated face size of the person and the size of the skin color area on the screen, the face area of the person in the shooting screen is detected (for example, Patent Document 1).

特開平07−306483号公報Japanese Patent Laid-Open No. 07-306483

しかしながら、従来の方法によれば、人物の顔のサイズを撮影時の撮影倍率から推定しているが、画像内における人物の顔のサイズは、カメラから人物までの距離によっても異なる。そのため、撮影時の撮影倍率から推定したサイズは必ずしも正確であるとは限らず、この推定値に誤りがあると人物の顔の領域を正確に検出できない可能性があった。   However, according to the conventional method, the size of the person's face is estimated from the shooting magnification at the time of shooting, but the size of the person's face in the image also varies depending on the distance from the camera to the person. Therefore, the size estimated from the shooting magnification at the time of shooting is not always accurate, and if the estimated value is incorrect, there is a possibility that the human face area cannot be detected accurately.

本発明は、複数の色成分を有する表色系で表される対象画像内から使用者が注目している部分を含む部分画像を抽出するための部分画像抽出方法であって、対象画像内に、使用者によって指定された指定点を含む枠を設定し、枠内の画像に基づいて、各色成分ごとの色成分画像を生成し、生成した各色成分画像を、それぞれの色成分画像ごとに設定した閾値を用いて2値化して、各色成分ごとのマスク画像を生成し、各色成分ごとのマスク画像のそれぞれを対象として、部分画像を抽出するのに適したマスク画像であるかを判定するための評価値を算出し、算出した評価値に基づいて、各色成分ごとのマスク画像の中から部分画像を抽出するのに最も適したマスク画像を最適マスク画像として選択し、選択した最適マスク画像内に、部分画像を抽出するための抽出領域を設定し、対象画像から、最適マスク画像内に設定した抽出領域に対応する領域内の画像を、部分画像として抽出することを特徴とする。
本発明では、最適マスク画像内の白画素の重心位置と、白画素の数とに基づいて、最適マスク画像内に設定する抽出領域の位置および大きさを決定するようにしてもよい。
各色成分画像ごとに濃度平均値、または濃度中央値を閾値として算出し、各色成分画像ごとに算出した閾値を用いて、それぞれの色成分ごとのマスク画像を生成するようにしてもよい。
各色成分ごとのマスク画像内の白画素の数と、白画素の重心周りの慣性モーメントとに基づいて、評価値を算出するようにしてもよい。
最適マスク画像内の白画素の重心位置から各白画素までの距離に応じた重み付けを行って白画素の重心位置を補正し、補正後の白画素の重心位置が抽出領域中心位置となるように、最適マスク画像内に設定する抽出領域の位置を決定するようにしてもよい。
The present invention relates to a partial image extraction method for extracting a partial image including a portion of interest from a target image represented by a color system having a plurality of color components. , Set a frame containing the specified point specified by the user, generate a color component image for each color component based on the image in the frame, and set each generated color component image for each color component image To generate a mask image for each color component and determine whether the mask image is suitable for extracting a partial image for each mask image for each color component. An evaluation value is calculated, and based on the calculated evaluation value, a mask image most suitable for extracting a partial image is selected as an optimal mask image from the mask images for each color component, and the selected optimal mask image And partial image Set the extraction area for extraction, from the target image, the image in the region corresponding to the extracted area set within an optimal mask image, and extracts a partial image.
In the present invention, the position and size of the extraction region set in the optimal mask image may be determined based on the barycentric position of the white pixels in the optimal mask image and the number of white pixels.
A density average value or a median density value may be calculated as a threshold value for each color component image, and a mask image for each color component may be generated using the threshold value calculated for each color component image.
The evaluation value may be calculated based on the number of white pixels in the mask image for each color component and the moment of inertia around the center of gravity of the white pixels.
Weighting is performed according to the distance from the centroid position of the white pixel in the optimal mask image to each white pixel to correct the centroid position of the white pixel so that the corrected centroid position of the white pixel becomes the extraction area center position. The position of the extraction region set in the optimal mask image may be determined.

本発明によれば、画像内で使用者が注目している部分を含む部分画像を正確に抽出することができる。   ADVANTAGE OF THE INVENTION According to this invention, the partial image containing the part which the user is paying attention in an image can be extracted correctly.

図1は、本実施の形態における部分画像抽出装置としてカメラを使用した場合の一実施の形態の構成を示すブロック図である。カメラ100は、入力スイッチ101と、レンズ102と、撮像素子103と、制御装置104と、メモリ105と、メモリカードスロット106と、モニタ107とを備えている。   FIG. 1 is a block diagram showing the configuration of an embodiment when a camera is used as the partial image extraction apparatus in the present embodiment. The camera 100 includes an input switch 101, a lens 102, an image sensor 103, a control device 104, a memory 105, a memory card slot 106, and a monitor 107.

入力スイッチ101は、使用者によって操作される種々の入力部材を含んでいる。例えば、この入力スイッチ101には、レリーズボタンやカメラ100を操作するための種々の操作ボタンが含まれる。レンズ102は、複数の光学レンズ群から構成されるが、図1では代表して1枚のレンズで表している。   The input switch 101 includes various input members operated by the user. For example, the input switch 101 includes a release button and various operation buttons for operating the camera 100. The lens 102 is composed of a plurality of optical lens groups, but is represented by a single lens in FIG.

撮像素子103は、例えばCCDやCMOSであり、レンズ102を通して入力される被写体像を撮像して、撮像して得た画像データを制御装置104へ出力する。メモリ105は、例えば不揮発性のフラッシュメモリであって、このメモリ105には、制御装置104が実行するプログラムのデータや、プログラム実行時に読み込まれる種々のパラメータなどが記録されている。   The image sensor 103 is, for example, a CCD or a CMOS, images a subject image input through the lens 102, and outputs image data obtained by the imaging to the control device 104. The memory 105 is, for example, a non-volatile flash memory, in which data of a program executed by the control device 104, various parameters read at the time of program execution, and the like are recorded.

メモリカードスロット106は、記憶媒体としてのメモリカードを挿入するためのスロットであり、制御装置104から出力された画像ファイルをメモリカードに書き込んで記録する。また、制御装置104からの指示に基づいて、メモリカード内に記憶されている画像ファイルを読み込む。   The memory card slot 106 is a slot for inserting a memory card as a storage medium, and writes and records the image file output from the control device 104 on the memory card. Further, based on an instruction from the control device 104, an image file stored in the memory card is read.

モニタ107は、カメラ100の背面に搭載された液晶モニタ(背面モニタ)であり、当該モニタ107には、メモリカードに記憶されている画像やカメラ100を設定するための設定メニューなどが表示される。   The monitor 107 is a liquid crystal monitor (rear monitor) mounted on the back of the camera 100, and the monitor 107 displays an image stored in a memory card, a setting menu for setting the camera 100, and the like. .

制御装置104は、CPU、メモリ、およびその他の周辺回路により構成され、撮像素子103から入力される画像データをモニタ107に出力して表示し、さらにメモリカードスロット106に挿入されているメモリカード内に記録する。なお、制御装置104を構成するメモリには、ROMやRAMが含まれる。   The control device 104 includes a CPU, a memory, and other peripheral circuits. The control device 104 outputs and displays image data input from the image sensor 103 on the monitor 107, and further, in the memory card inserted in the memory card slot 106. To record. Note that the memory constituting the control device 104 includes ROM and RAM.

制御装置104はまた、部分画像抽出部104aと、AF(オートフォーカス)処理部104bと、撮影処理部104cとを機能的に有している。本実施の形態におけるカメラ100では、制御装置104は、撮像素子103から所定時間間隔で画像データを取得してモニタ107に出力することによって、モニタ107にスルー画を表示する。そして、使用者によって入力スイッチ101に含まれるレリーズボタンが半押しされるとAF(オートフォーカス)処理を行い、さらにレリーズボタンが全押しされると、撮影を行って画像データを取得し、メモリカードに記録する。   The control device 104 also functionally includes a partial image extraction unit 104a, an AF (autofocus) processing unit 104b, and an imaging processing unit 104c. In the camera 100 according to the present embodiment, the control device 104 displays a through image on the monitor 107 by acquiring image data from the image sensor 103 at predetermined time intervals and outputting the image data to the monitor 107. When the release button included in the input switch 101 is half-pressed by the user, AF (autofocus) processing is performed. When the release button is further fully pressed, shooting is performed to acquire image data, and the memory card is obtained. To record.

本実施の形態では、部分画像抽出部104aは、撮像素子103からスルー画が入力された場合に、そのスルー画のあるフレーム内から使用者が注目している部分の画像(部分画像)を抽出する。そして、AF処理部104bは、使用者によってレリーズボタンが半押しされたタイミングで、部分画像抽出部104aによって抽出された部分画像に基づいてAF処理を実行する。これによって、被写体が激しく動き回っている場合など、従来の方法ではピントを合わせ難い場合であっても、使用者が注目している部分にピントを合わせることが可能となる。なお、AF処理は、公知の処理であるため説明を省略することとし、以下、部分画像抽出部104aによる画像内からの部分画像抽出処理について詳細に説明する。   In the present embodiment, when a through image is input from the image sensor 103, the partial image extraction unit 104a extracts an image (partial image) of a portion that the user is paying attention from within a frame with the through image. To do. The AF processing unit 104b executes AF processing based on the partial image extracted by the partial image extraction unit 104a at the timing when the release button is half-pressed by the user. As a result, even when it is difficult to focus with the conventional method, such as when the subject is moving violently, it is possible to focus on the portion that the user is paying attention to. The AF process is a known process and will not be described. Hereinafter, the partial image extraction process from the image by the partial image extraction unit 104a will be described in detail.

まず、使用者は、入力スイッチ101を操作してメニュー画面を呼び出し、当該メニュー画面上で「部分画像の抽出」を選択することによって、処理の開始を指示する。部分画像抽出部104aは、使用者によって処理の開始が指示されると、モニタ107上にスルー画を表示する。使用者は、入力スイッチ101を操作して、モニタ107上に表示された画像内に、注目被写体の位置を特定するための指定点を画像内に設定する。例えば、使用者は、図2に示す画像上で人物の顔に注目している場合には、顔上に指定点(ユーザー指定点)2aを設定する。   First, the user calls the menu screen by operating the input switch 101 and selects “extract partial image” on the menu screen to instruct the start of processing. The partial image extraction unit 104a displays a through image on the monitor 107 when the user instructs the start of processing. The user operates the input switch 101 to set a designated point in the image for specifying the position of the subject of interest in the image displayed on the monitor 107. For example, when the user is paying attention to the face of a person on the image shown in FIG. 2, a designated point (user designated point) 2a is set on the face.

部分画像抽出部104aは、画像内に設定された指定点2aの位置に基づいて、画像内から使用者が注目している部分の部分画像を抽出する。なお、図2に示す例では、指定点2aは、人物の顔から外れているが、部分画像抽出部104aは、以下に示す処理によって、使用者が注目している人物の顔を含む領域内の画像を部分画像として抽出することができる。   The partial image extraction unit 104a extracts a partial image of a portion that is noticed by the user from the image based on the position of the designated point 2a set in the image. In the example shown in FIG. 2, the designated point 2 a is off the face of the person, but the partial image extraction unit 104 a performs processing within the region including the face of the person that the user is paying attention to by the following processing. Can be extracted as a partial image.

部分画像抽出部104aは、使用者によって設定された指定点2aを中心とした所定範囲を囲むように、画像内に枠Aを設定する。そして、部分画像抽出部104aは、枠A内の画像を抽出し、抽出した枠A内の画像に基づいて、各色成分ごとの画像(色成分画像)、すなわちY成分の画像(Yプレーン画像)、Cr成分の画像(Crプレーン画像)、およびCb成分の画像(Cbプレーン画像)をそれぞれ生成する。   The partial image extraction unit 104a sets a frame A in the image so as to surround a predetermined range centered on the designated point 2a set by the user. Then, the partial image extraction unit 104a extracts an image in the frame A, and based on the extracted image in the frame A, an image for each color component (color component image), that is, an image of a Y component (Y plane image). , A Cr component image (Cr plane image) and a Cb component image (Cb plane image) are respectively generated.

すなわち、部分画像抽出部104aは、処理の対象となる画像データがYCbCr表色系で表された画像データである場合には、Y成分(輝度成分)からなる輝度画像をYプレーン画像として、Cb成分(色差成分)からなる色差画像をCbプレーン画像として、Cr成分(色差成分)からなる色差画像をCrプレーン画像として生成する。   That is, when the image data to be processed is image data represented in the YCbCr color system, the partial image extraction unit 104a uses a luminance image composed of a Y component (luminance component) as a Y plane image as a Cb image. A color difference image composed of components (color difference components) is generated as a Cb plane image, and a color difference image composed of Cr components (color difference components) is generated as a Cr plane image.

これに対して、処理の対象となる画像データが他の表色系で表されている場合には、部分画像抽出部104aは、あらかじめ枠A内の画像データをYCbCr表色系の画像データに変換しておく。例えば、処理の対象となる画像データがRGB表色系で表されている場合には、部分画像抽出部104aは、RGB表色系で表されている画像データを次式(1)〜(3)を用いてYCbCr色空間における輝度成分からなる輝度画像と色差成分からなる色差画像とに変換する。   On the other hand, when the image data to be processed is represented by another color system, the partial image extraction unit 104a converts the image data in the frame A into image data of the YCbCr color system in advance. Convert it. For example, when the image data to be processed is expressed in the RGB color system, the partial image extraction unit 104a converts the image data expressed in the RGB color system into the following expressions (1) to (3). ) Is used to convert a luminance image composed of luminance components and a color difference image composed of color difference components in the YCbCr color space.

すなわち、部分画像抽出部104aは、枠A内の画像データを対象として、次式(1)を用いてY成分からなる輝度画像をYプレーン画像として生成し、次式(2)および(3)を用いてCb成分からなる色差画像とCr成分からなる色差画像とをそれぞれCbプレーン画像、およびCrプレーン画像として生成する。
Y = 0.299R+0.587G+0.114B ・・・(1)
Cb=−0.169R−0.332G+0.500B ・・・(2)
Cr= 0.500R−0.419G−0.081B ・・・(3)
That is, the partial image extraction unit 104a generates a luminance image composed of a Y component as a Y plane image using the following equation (1) for the image data in the frame A, and the following equations (2) and (3): Is used to generate a Cb component color difference image and a Cr component color difference image as a Cb plane image and a Cr plane image, respectively.
Y = 0.299R + 0.587G + 0.114B (1)
Cb = −0.169R−0.332G + 0.500B (2)
Cr = 0.500R−0.419G−0.081B (3)

部分画像抽出部104aは、生成したYプレーン画像、Cbプレーン画像、およびCrプレーン画像について、横軸に濃度値(0〜255)、縦軸に画素数をとった濃度ヒストグラムを作成する。すなわち、Yプレーン画像、Cbプレーン画像、Crプレーン画像のそれぞれに対して、画像内の全画素の濃度値を調べ、各濃度値ごとに画素数を計数して、濃度値ごとの画素数の出現頻度を示した濃度ヒストグラムを作成する。   The partial image extraction unit 104a creates a density histogram with the horizontal axis representing the density value (0 to 255) and the vertical axis representing the number of pixels for the generated Y plane image, Cb plane image, and Cr plane image. That is, for each of the Y plane image, the Cb plane image, and the Cr plane image, the density value of all the pixels in the image is examined, the number of pixels is counted for each density value, and the number of pixels for each density value appears. Create a density histogram showing the frequency.

その結果、例えば図3に示すような濃度ヒストグラムを得る。なお、図3に示す濃度ヒストグラムは、Yプレーン画像、Cbプレーン画像、およびCrプレーン画像のいずれか1つ、例えばYプレーン画像について作成したものであり、その他のCbプレーン画像、およびCrプレーン画像についても同様に作成される。   As a result, for example, a density histogram as shown in FIG. 3 is obtained. The density histogram shown in FIG. 3 is created for any one of a Y plane image, a Cb plane image, and a Cr plane image, for example, a Y plane image, and for other Cb plane images and Cr plane images. Is created in the same way.

部分画像抽出部104aは、このように作成した各プレーン画像の濃度ヒストグラムの中央値、すなわち濃度中央値(Median)3aを算出する。そして、この算出した濃度中央値3aを閾値に設定して、生成したYプレーン画像、Cbプレーン画像、およびCrプレーン画像のそれぞれを2値化して2値マスク画像を生成する。その結果、図4に示すように、それぞれのプレーン画像についての2値マスク画像を生成することができる。   The partial image extraction unit 104a calculates the median value of the density histogram of each plane image created in this way, that is, the density median value (Median) 3a. Then, the calculated density median value 3a is set as a threshold value, and each of the generated Y plane image, Cb plane image, and Cr plane image is binarized to generate a binary mask image. As a result, as shown in FIG. 4, a binary mask image for each plane image can be generated.

すなわち、部分画像抽出部104aは、Yプレーン画像をYプレーン画像の濃度中央値3aを閾値として使用して2値化することによって、図4(a)に示すYマスク画像を生成し、Cbプレーン画像をCbプレーン画像の濃度中央値3aを閾値として使用して2値化することによって、図4(b)に示すCbマスク画像を生成する。また、部分画像抽出部104aは、Crプレーン画像をCrプレーン画像の濃度中央値3aを閾値として使用して2値化することによって、図4(c)に示すCrマスク画像を生成する。さらに、部分画像抽出部104aは、Yマスク画像を反転させることによって、図4(d)に示すY補数マスク画像を生成する。   That is, the partial image extraction unit 104a generates a Y mask image shown in FIG. 4A by binarizing the Y plane image using the density median value 3a of the Y plane image as a threshold, and generates the Cb plane. By binarizing the image using the median density value 3a of the Cb plane image as a threshold value, a Cb mask image shown in FIG. 4B is generated. Also, the partial image extraction unit 104a generates a Cr mask image shown in FIG. 4C by binarizing the Cr plane image using the density median value 3a of the Cr plane image as a threshold value. Further, the partial image extraction unit 104a generates the Y complement mask image shown in FIG. 4D by inverting the Y mask image.

なお、本実施の形態では、各プレーン画像を濃度中央値3aを閾値として使用して2値化することによってマスク画像を生成する例について説明したが、その他の値を閾値として使用するようにしてもよい。例えば、各プレーン画像の濃度ヒストグラムの平均値、すなわち濃度平均値(Mean)3bを算出して、これを閾値として使用してもよい。   In the present embodiment, an example in which a mask image is generated by binarizing each plane image using the density median value 3a as a threshold value has been described. However, other values are used as threshold values. Also good. For example, the average value of the density histogram of each plane image, that is, the density average value (Mean) 3b may be calculated and used as a threshold value.

部分画像抽出部104aは、生成したマスク画像の中から、部分画像を抽出するために用いるマスク画像を選択するために、各マスク画像に対する評価値を算出する。具体的には、部分画像抽出部104aは、まず、各マスク画像の白画素を抽出する。そしてマスク画像ごとにマスク画像内の白画素数を算出するとともに、マスク画像内における白画素の重心位置を特定する。   The partial image extraction unit 104a calculates an evaluation value for each mask image in order to select a mask image used for extracting the partial image from the generated mask images. Specifically, the partial image extraction unit 104a first extracts white pixels of each mask image. Then, the number of white pixels in the mask image is calculated for each mask image, and the barycentric position of the white pixels in the mask image is specified.

そして、部分画像抽出部104aは、各マスク画像のそれぞれについて、マスク画像内で特定した白画素の重心位置に基づいて、白画素の重心周りの慣性モーメントを算出する。すなわち、部分画像抽出部104aは、Yマスク画像の白画素の重心周りの慣性モーメント、Cbマスク画像の白画素の重心周りの慣性モーメント、Crマスク画像の白画素の重心周りの慣性モーメント、およびY補数マスク画像の白画素の重心周りの慣性モーメントをそれぞれ算出する。なお、2値化して得たマスク画像における白画素の重心周りの慣性モーメントの算出方法については、公知のため詳細な説明を省略するが、例えば、白画素の重心からの画素距離の2乗×0または1の濃度値の和により算出することができる。   Then, the partial image extraction unit 104a calculates, for each mask image, the moment of inertia around the centroid of the white pixel based on the centroid position of the white pixel specified in the mask image. That is, the partial image extraction unit 104a performs the moment of inertia around the center of gravity of the white pixel of the Y mask image, the moment of inertia around the center of gravity of the white pixel of the Cb mask image, the moment of inertia around the center of gravity of the white pixel of the Cr mask image, The moment of inertia around the center of gravity of the white pixel of the complement mask image is calculated. A method for calculating the moment of inertia around the center of gravity of the white pixel in the mask image obtained by binarization is well known and will not be described in detail. For example, the square of the pixel distance from the center of gravity of the white pixel × It can be calculated by the sum of 0 or 1 density values.

部分画像抽出部104aは、上述した処理で各マスク画像ごとに算出した白画素数、および白画素の重心周りの慣性モーメントとに基づいて、次式(4)により、各マスク画像の評価値を算出する。なお、次式(4)において、係数は、あらかじめ設定されている値である。
評価値=(白画素数/慣性モーメント)×係数 ・・・(4)
The partial image extraction unit 104a calculates the evaluation value of each mask image by the following equation (4) based on the number of white pixels calculated for each mask image by the above-described processing and the moment of inertia around the center of gravity of the white pixels. calculate. In the following equation (4), the coefficient is a preset value.
Evaluation value = (number of white pixels / moment of inertia) × coefficient (4)

例えば、図4に示した各マスク画像について、係数を10000として算出した場合の評価値を、図4の各マスク画像の下部に示す。部分画像抽出部104aは、各マスク画像の中から、算出した評価値が最も大きいマスク画像を部分画像を抽出するための最適マスク画像として選択する。すなわち、図4に示す例では、部分画像抽出部104aは、評価値が最も大きいCrマスク画像を最適マスク画像として選択する。   For example, for each mask image shown in FIG. 4, the evaluation value when the coefficient is calculated as 10,000 is shown at the bottom of each mask image in FIG. The partial image extraction unit 104a selects a mask image having the largest calculated evaluation value as an optimum mask image for extracting a partial image from the mask images. That is, in the example illustrated in FIG. 4, the partial image extraction unit 104 a selects the Cr mask image having the largest evaluation value as the optimal mask image.

部分画像抽出部104aは、選択した最適マスク画像内に、中心をそのマスク画像内の白画素の重心位置とし、大きさをそのマスク画像内で算出した白画素数の平方根とする枠B(抽出領域)を設定する。なお、部分画像抽出部104aは、白画素数の平方根が小数の場合には、整数に切り上げて、これを枠Bの大きさとする。例えば、部分画像抽出部104aは、図5に示すように、最適マスク画像として選択したCrマスク画像内に枠Bを設定する。部分画像抽出部104aは、図2に示したスルー画内から、最適マスク画像内に設定した枠B内に相当する領域内の画像を部分画像として抽出する。   The partial image extracting unit 104a extracts a frame B (extraction in the selected optimum mask image with the center as the barycentric position of the white pixel in the mask image and the size as the square root of the number of white pixels calculated in the mask image. Area). If the square root of the number of white pixels is a decimal number, the partial image extraction unit 104a rounds it up to an integer and sets this to the size of the frame B. For example, as shown in FIG. 5, the partial image extraction unit 104a sets a frame B in the Cr mask image selected as the optimal mask image. The partial image extraction unit 104a extracts, as a partial image, an image in an area corresponding to the frame B set in the optimal mask image from the through image shown in FIG.

これによって、図6に示すように、使用者によって指定された指定点2aに基づいて設定した枠A内から、使用者が注目している被写体を含む枠B内の画像を部分画像として抽出することができる。そして、上述したように、指定点2aは、使用者が実際に注目している人物の顔からは外れているが、抽出される部分画像は、使用者が注目している人物の顔を含んだ画像とすることができる。   As a result, as shown in FIG. 6, an image in the frame B including the subject focused by the user is extracted as a partial image from the frame A set based on the designated point 2a designated by the user. be able to. As described above, the designated point 2a is not included in the face of the person actually focused on by the user, but the extracted partial image includes the face of the person focused on by the user. It can be an image.

AF処理部104bは、使用者によって、レリーズボタンが半押しされたタイミングで、部分画像抽出部104aによって抽出された部分画像を対象として、公知のAF処理を実行し、ピント合わせを行う。その後、使用者によってレリーズボタンが全押しされると、撮影処理部104cは、撮像素子103から入力される画像データをメモリカードに記録することによって撮影を行う。   The AF processing unit 104b performs known AF processing on the partial image extracted by the partial image extraction unit 104a at the timing when the release button is half-pressed by the user, and performs focusing. Thereafter, when the release button is fully pressed by the user, the imaging processing unit 104c performs imaging by recording image data input from the imaging element 103 on a memory card.

図7は、本実施の形態におけるカメラ100の処理を示すフローチャートである。図7に示す処理は、上述したように、使用者によって入力スイッチ101が操作されて、メニュー画面上で「部分画像の抽出」が指示されると起動するプログラムとして制御装置104によって実行される。   FIG. 7 is a flowchart showing processing of the camera 100 in the present embodiment. As described above, the process shown in FIG. 7 is executed by the control device 104 as a program to be started when the user operates the input switch 101 and instructs “extract partial image” on the menu screen.

ステップS10において、部分画像抽出部104aは、上述したスルー画をモニタ107に表示して、ステップS20へ進む。ステップS20では、部分画像抽出部104aは、スルー画上で、使用者によって指定点2aが指示されたか否かを判断し、肯定判断した場合には、ステップS30へ進む。   In step S10, the partial image extraction unit 104a displays the above-described through image on the monitor 107, and proceeds to step S20. In step S20, the partial image extraction unit 104a determines whether or not the designated point 2a is instructed by the user on the through image. If the determination is affirmative, the process proceeds to step S30.

ステップS30では、部分画像抽出部104aは、使用者によって指定された指定点2aを中心とした所定範囲を囲むように、画像内に枠Aを設定する。その後、ステップS40へ進み、部分画像抽出部104aは、枠A内の画像を抽出して、抽出した枠A内の画像に基づいて、上述したYプレーン画像、Crプレーン画像、およびCbプレーン画像をそれぞれ生成する。その後、ステップS50へ進む。   In step S30, the partial image extraction unit 104a sets a frame A in the image so as to surround a predetermined range centered on the designated point 2a designated by the user. Thereafter, the process proceeds to step S40, where the partial image extraction unit 104a extracts the image in the frame A, and based on the extracted image in the frame A, the Y plane image, the Cr plane image, and the Cb plane image described above are extracted. Generate each. Thereafter, the process proceeds to step S50.

ステップS50では、部分画像抽出部104aは、各プレーン画像について、図3に示した濃度ヒストグラムを作成し、各プレーン画像の濃度ヒストグラムの濃度中央値(Median)3aを算出する。そして、部分画像抽出部104aは、各プレーン画像を、算出した濃度中央値3aを閾値として用いて2値化することによって、図4に示したように、各プレーン画像に対応するマスク画像を生成する。また、部分画像抽出部104aは、生成したYマスク画像を反転することによって、Y補数マスク画像を生成する。その後、ステップS60へ進む。   In step S50, the partial image extraction unit 104a creates the density histogram shown in FIG. 3 for each plane image, and calculates the density median (Median) 3a of the density histogram of each plane image. Then, the partial image extraction unit 104a generates a mask image corresponding to each plane image as shown in FIG. 4 by binarizing each plane image using the calculated density median value 3a as a threshold value. To do. Further, the partial image extraction unit 104a generates a Y complement mask image by inverting the generated Y mask image. Thereafter, the process proceeds to step S60.

ステップS60では、部分画像抽出部104aは、上述したように、各マスク画像ごとに算出した白画素数、および白画素の重心周りの慣性モーメントとに基づいて、式(4)により、各マスク画像の評価値を算出する。その後、ステップS70へ進み、部分画像抽出部104aは、各マスク画像の中から、算出した評価値が最も大きいマスク画像を部分画像を抽出するための最適マスク画像として選択して、ステップS80へ進む。   In step S60, as described above, the partial image extraction unit 104a uses the equation (4) to calculate each mask image based on the number of white pixels calculated for each mask image and the moment of inertia around the centroid of the white pixels. The evaluation value of is calculated. Thereafter, the process proceeds to step S70, where the partial image extraction unit 104a selects a mask image having the largest calculated evaluation value as an optimum mask image for extracting the partial image from each mask image, and then proceeds to step S80. .

ステップS80では、部分画像抽出部104aは、上述したように、選択したマスク画像内に、中心をそのマスク画像内の白画素の重心位置とし、大きさをそのマスク画像内で算出した白画素数の平方根とする枠Bを設定する。その後、ステップS90へ進み、部分画像抽出部104aは、スルー画内から、マスク画像内で設定した枠B内に相当する領域内の画像を抽出して、これを部分画像として抽出する。その後、ステップS100へ進む。   In step S80, as described above, the partial image extraction unit 104a uses the center of the selected mask image as the center of gravity of the white pixels in the mask image, and the number of white pixels calculated in the mask image. A frame B that is the square root of is set. Thereafter, the process proceeds to step S90, where the partial image extraction unit 104a extracts an image in an area corresponding to the frame B set in the mask image from the through image, and extracts this as a partial image. Then, it progresses to step S100.

ステップS100では、AF処理部104bは、使用者によってレリーズボタンが半押しされたか否かを判断する。肯定判断した場合には、ステップS110へ進み、AF処理部104bは、部分画像抽出部104aによって抽出された部分画像を対象として、公知のAF処理を実行し、ピント合わせを行う。その後、ステップS120へ進む。   In step S100, the AF processing unit 104b determines whether or not the release button is half-pressed by the user. If the determination is affirmative, the process proceeds to step S110, where the AF processing unit 104b performs a known AF process on the partial image extracted by the partial image extraction unit 104a, and performs focusing. Then, it progresses to step S120.

ステップS120では、撮影処理部104cは、使用者によってレリーズボタンが全押しされたか否かを判断する。肯定判断した場合には、ステップS130へ進み、撮影処理部104cは、撮像素子103から入力される画像データをメモリカードに記録することによって撮影を行う。その後、処理を終了する。   In step S120, the imaging processing unit 104c determines whether or not the release button has been fully pressed by the user. If the determination is affirmative, the process proceeds to step S130, and the imaging processing unit 104c performs imaging by recording the image data input from the image sensor 103 on a memory card. Thereafter, the process ends.

以上説明した本実施の形態によれば、以下のような作用効果を得ることができる。
(1)部分画像抽出部104aは、画像内に、使用者によって指定された指定点2aを含む枠Aを設定し、枠A内の画像に基づいて、各色成分ごとのプレーン画像を生成し、生成した各色成分のプレーン画像を、それぞれのプレーン画像ごとに設定した閾値を用いて2値化して、各色成分ごとのマスク画像を生成した。また、Yマスク画像を反転することによって、Y補数マスク画像を生成した。そして、部分画像抽出部104aは、各色成分ごとのマスク画像のそれぞれを対象として、部分画像を抽出するのに適したマスク画像であるかを判定するための評価値を算出し、算出した評価値に基づいて、各色成分ごとのマスク画像の中から部分画像を抽出するのに最も適したマスク画像を最適マスク画像として選択した。さらに、部分画像抽出部104aは、選択した最適マスク画像内に、部分画像を抽出するための枠Bを設定し、対象画像から、最適マスク画像内に設定した枠B内の領域に対応する領域内の画像を、部分画像として抽出するようにした。これによって、画像内で使用者が注目している部分を含む部分画像を正確に抽出することができる。
According to the present embodiment described above, the following operational effects can be obtained.
(1) The partial image extraction unit 104a sets a frame A including the designated point 2a designated by the user in the image, generates a plain image for each color component based on the image in the frame A, The generated plane image of each color component was binarized using a threshold value set for each plane image, and a mask image for each color component was generated. Also, a Y complement mask image was generated by inverting the Y mask image. Then, the partial image extraction unit 104a calculates, for each mask image for each color component, an evaluation value for determining whether the mask image is suitable for extracting the partial image, and the calculated evaluation value Based on the above, the most suitable mask image for extracting a partial image from the mask images for each color component was selected as the optimum mask image. Furthermore, the partial image extraction unit 104a sets a frame B for extracting the partial image in the selected optimal mask image, and an area corresponding to the area in the frame B set in the optimal mask image from the target image. The image inside was extracted as a partial image. This makes it possible to accurately extract a partial image that includes a portion that the user is paying attention to in the image.

(2)部分画像抽出部104aは、最適マスク画像内の白画素の重心位置と、白画素の数とに基づいて、最適マスク画像内に設定する枠Bの位置および大きさを決定するようにした。これによって、2値化して得たマスク画像内においては、被写体像に相当する範囲が白い領域として表され、その他の背景領域が黒い領域として表されることを加味して、使用者が注目している可能性が高い被写体を含む領域を含むように最適マスク画像内に枠Bを設定することができる。 (2) The partial image extraction unit 104a determines the position and size of the frame B set in the optimal mask image based on the barycentric position of the white pixels in the optimal mask image and the number of white pixels. did. In this way, in the mask image obtained by binarization, the user pays attention to the fact that the range corresponding to the subject image is represented as a white area and the other background area is represented as a black area. The frame B can be set in the optimal mask image so as to include an area including a subject that is likely to be detected.

(3)部分画像抽出部104aは、各色成分のプレーン画像ごとに濃度平均値、または濃度中央値を閾値として算出し、各色成分画像ごとに算出した閾値を用いて、それぞれの色成分ごとのマスク画像を生成するようにした。これによって、各プレーン画像を最適な閾値を用いて2値化することができる。 (3) The partial image extraction unit 104a calculates the density average value or the median density value as a threshold value for each plane image of each color component, and uses the threshold value calculated for each color component image to mask each color component. An image was generated. Thereby, each plane image can be binarized using an optimum threshold value.

(4)部分画像抽出部104aは、各色成分ごとのマスク画像内の白画素の数と、白画素の重心周りの慣性モーメントとに基づいて、色(4)によって評価値を算出するようにした。これによって、マスク画像内に白画素が多く存在し、かつ白画素の重心周りの慣性モーメントが小さい場合には、白画素の重心周りに多数の白い領域がまとまって集中していることを意味しており、これは白画素の重心周りに被写体が存在している可能性が高いことを示しているため、このようなマスク画像の評価値が高くなるようにして、部分画像を抽出するための最適なマスク画像を選択することができる。 (4) The partial image extraction unit 104a calculates the evaluation value based on the color (4) based on the number of white pixels in the mask image for each color component and the moment of inertia around the center of gravity of the white pixels. . As a result, if there are many white pixels in the mask image and the moment of inertia around the centroid of the white pixels is small, it means that many white areas are concentrated around the centroid of the white pixels. This indicates that there is a high possibility that a subject exists around the center of gravity of the white pixel, so that the evaluation value of such a mask image is increased to extract a partial image. An optimal mask image can be selected.

―変形例―
なお、上述した実施の形態のカメラは、以下のように変形することもできる。
(1)上述した実施の形態では、処理対象の画像データは、YCbCr表色系で表されているものとした。しかしながら、処理対象の画像データがYIQ表色系における画像データである場合であっても同様に処理が可能である。
-Modification-
The camera according to the above-described embodiment can be modified as follows.
(1) In the embodiment described above, it is assumed that the image data to be processed is represented in the YCbCr color system. However, similar processing is possible even when the image data to be processed is image data in the YIQ color system.

(2)上述した実施の形態では、部分画像抽出部104aが画像内から抽出した部分画像を対象としてAF処理を実行する例について説明した。しかしながら、これに限定されず、部分画像抽出部104aが画像内から抽出した部分画像を対象として露出処理を行うようにしてもよい。また、部分画像抽出部104aが画像内から抽出した部分画像をテンプレート画像として抽出して、時系列で入力されるフレーム間での被写体追尾に用いるようにしてもよい。 (2) In the above-described embodiment, the example in which the AF processing is performed on the partial image extracted from the image by the partial image extraction unit 104a has been described. However, the present invention is not limited to this, and the exposure process may be performed on a partial image extracted from the image by the partial image extraction unit 104a. Alternatively, the partial image extracted from the image by the partial image extraction unit 104a may be extracted as a template image and used for subject tracking between frames input in time series.

(3)上述した実施の形態では、部分画像抽出部104aは、選択した最適マスク画像内に、中心をそのマスク画像内の白画素の重心位置とし、大きさをそのマスク画像内で算出した白画素数の平方根とする枠Bを設定し、スルー画内から、最適マスク画像内に設定した枠B内に相当する領域内の画像を部分画像として抽出する例について説明した。しかしながら、このようにマスク画像内の白画素の重心位置を中心とするように枠Bを設定した場合には、画像の端部などの被写体とは関係が無い位置に白画素が存在する場合には、枠Bが使用者が注目している被写体からずれて設定される可能性がある。このため、部分画像抽出部104aは、このような不具合を解決するために、次のようにしてマスク画像内の白画素の重心位置を補正するようにしてもよい。 (3) In the above-described embodiment, the partial image extraction unit 104a uses the center of the selected optimal mask image as the center of gravity of the white pixel in the mask image and the size calculated in the mask image. An example has been described in which a frame B is set as the square root of the number of pixels, and an image in an area corresponding to the frame B set in the optimal mask image is extracted as a partial image from the through image. However, when the frame B is set so that the center of gravity of the white pixel in the mask image is centered in this way, when the white pixel exists at a position unrelated to the subject such as the edge of the image. May be set so that the frame B deviates from the subject that the user is paying attention to. For this reason, in order to solve such a problem, the partial image extraction unit 104a may correct the barycentric position of the white pixels in the mask image as follows.

例えば、図8(a)に示す画像に対して上述した処理を行った結果、図8(b)に示すように、Yマスク画像が最適マスク画像として選択され、当該Yマスク画像内に枠Bが設定されたものとする。この図8(b)に示す例では、マスク画像内の左上の白画素の影響を受けて、白画素の重心位置が被写体位置からずれるため、枠Bは被写体からずれて設定されてしまっている。この変形例では、部分画像抽出部104aは、白画素の重心位置を補正して、図8(c)に示すように、枠Bが適正位置に設定されるようにする。   For example, as a result of performing the above-described processing on the image shown in FIG. 8A, as shown in FIG. 8B, the Y mask image is selected as the optimum mask image, and the frame B is included in the Y mask image. Is set. In the example shown in FIG. 8B, the position of the center of gravity of the white pixel deviates from the subject position due to the influence of the upper left white pixel in the mask image, so that the frame B is set deviated from the subject. . In this modification, the partial image extraction unit 104a corrects the barycentric position of the white pixel so that the frame B is set to an appropriate position as shown in FIG. 8C.

図9は、図8(b)に示したYマスク画像における白画素の分布を表した図である。この図9においては、「1」が白画素を表し「0」が黒画素を表している。なお、図9の右側の数字は、対応する列に含まれる白画素の合計個数を表し、下側の数字は、対応する行に含まれる白画素の合計個数を表している。白画素がこの図9に示すように分布している場合に算出される白画素の重心位置は画素9aとなる。ここでは、画素9aを仮の重心と呼ぶ。   FIG. 9 is a diagram showing the distribution of white pixels in the Y mask image shown in FIG. In FIG. 9, “1” represents a white pixel and “0” represents a black pixel. The number on the right side of FIG. 9 represents the total number of white pixels included in the corresponding column, and the number on the lower side represents the total number of white pixels included in the corresponding row. The center position of the white pixel calculated when the white pixels are distributed as shown in FIG. 9 is the pixel 9a. Here, the pixel 9a is referred to as a temporary center of gravity.

部分画像抽出部104aは、仮の重心9aからY方向(縦方向)およびX方向(横方向)に並んでいる各画素のそれぞれを対象として、仮の重心9aからの距離を算出する。例えば、仮の重心9aの1つ上の画素は、Y方向の距離が1となり、仮の重心9aの2つ右の画素は、X方向の距離が2となる。部分画像抽出部104aは、このように算出した距離のうち、Y方向の距離の最大値と、X方向の距離の最大値を特定する。図9に示す例では、Y方向の距離の最大値は、一番上の画素までの距離の11であり、X方向の距離の最大値は、一番右の画素までの距離の9である。   The partial image extraction unit 104a calculates the distance from the temporary centroid 9a for each pixel arranged in the Y direction (vertical direction) and the X direction (horizontal direction) from the temporary centroid 9a. For example, the pixel one pixel above the temporary centroid 9a has a distance in the Y direction of 1, and the pixel two pixels to the right of the temporary centroid 9a has a distance in the X direction of 2. The partial image extraction unit 104a specifies the maximum distance value in the Y direction and the maximum distance value in the X direction among the distances calculated in this way. In the example shown in FIG. 9, the maximum value of the distance in the Y direction is 11 of the distance to the top pixel, and the maximum value of the distance in the X direction is 9 of the distance to the rightmost pixel. .

部分画像抽出部104aは、特定したY方向の距離の最大値+1(11+1=12)からY方向の距離を算出した各画素までの距離を減算する。これによって、Y方向の各画素ごとに、図9の左側に示す算出結果(Y方向算出結果)が得られる。また、部分画像抽出部104aは、特定したX方向の距離の最大値+1(9+1=10)からX方向の距離を算出した各画素までの距離を減算する。これによって、X方向の各画素ごとに、図9の上側に示す算出結果(X方向算出結果)が得られる。   The partial image extraction unit 104a subtracts the distance to each pixel for which the distance in the Y direction is calculated from the specified maximum value +1 (11 + 1 = 12) of the distance in the Y direction. As a result, the calculation result (Y direction calculation result) shown on the left side of FIG. 9 is obtained for each pixel in the Y direction. Further, the partial image extraction unit 104a subtracts the distance to each pixel for which the distance in the X direction is calculated from the specified maximum value +1 (9 + 1 = 10) of the distance in the X direction. As a result, the calculation result (X direction calculation result) shown on the upper side of FIG. 9 is obtained for each pixel in the X direction.

部分画像抽出部104aは、このように得たX方向算出結果とY方向算出結果を用いて重み付けを行うことによって、Yマスク画像内における白画素の重心位置を補正する。具体的には、部分画像抽出部104aは、図10(a)に示す式によって重み付けを行って補正後の重心9bの座標値(x,y)を算出することができる。なお、図10(b)は、xの分子の算出例を示した図である、図10(c)は、xの分母の算出例を示した図である、 The partial image extraction unit 104a corrects the barycentric position of the white pixel in the Y mask image by performing weighting using the X direction calculation result and the Y direction calculation result thus obtained. Specifically, the partial image extraction unit 104a can calculate the coordinate values (x w , y w ) of the corrected center of gravity 9b by performing weighting according to the equation shown in FIG. Incidentally, FIG. 10 (b) is a diagram showing a calculation example of a molecule of x w, FIG. 10 (c) is a diagram showing an example of calculation of the denominator of x w,

このように補正後の重心9bを算出し、この補正後の重心9bを中心として枠Bを設定することにより、仮の重心9aからの距離が遠い白画素は、重みが小さく重心計算へ寄与し難くなるため、周辺ノイズによる影響を抑えることができ、枠Bを適正位置に設定することができるようになる。   By calculating the corrected center of gravity 9b and setting the frame B around the corrected center of gravity 9b, white pixels that are far from the temporary center of gravity 9a have a small weight and contribute to the center of gravity calculation. Since it becomes difficult, the influence by surrounding noise can be suppressed and the frame B can be set at an appropriate position.

なお、本発明の特徴的な機能を損なわない限り、本発明は、上述した実施の形態における構成に何ら限定されない。   Note that the present invention is not limited to the configurations in the above-described embodiments as long as the characteristic functions of the present invention are not impaired.

カメラの一実施の形態の構成を示すブロック図である。It is a block diagram which shows the structure of one Embodiment of a camera. 画像上に設定された指定点2aの具体例を示す図である。It is a figure which shows the specific example of the designated point 2a set on the image. プレーン画像に基づいて作成された濃度ヒストグラムの具体例を示す図である。It is a figure which shows the specific example of the density histogram produced based on the plain image. プレーン画像を2値化して生成したマスク画像の具体例を示す図である。It is a figure which shows the specific example of the mask image produced | generated by binarizing a plain image. Crマスク画像内に枠Bを設定した場合の具体例を示す図である。It is a figure which shows the specific example at the time of setting the flame | frame B in Cr mask image. 画像内から抽出される部分画像の具体例を示す図である。It is a figure which shows the specific example of the partial image extracted from the inside of an image. カメラ100の処理を示すフローチャート図である。FIG. 6 is a flowchart showing processing of the camera 100. 変形例(3)における枠Bの設定例を示す図である。It is a figure which shows the example of a setting of the flame | frame B in a modification (3). 変形例(3)における白画素の分布例を示す図である。It is a figure which shows the example of distribution of the white pixel in a modification (3). 変形例(3)における白画素の重心位置の補正式の具体例を示す図である。It is a figure which shows the specific example of the correction formula of the gravity center position of the white pixel in a modification (3).

符号の説明Explanation of symbols

100 カメラ、101 入力スイッチ、102 レンズ、103 撮像素子、104 制御装置、104a 部分画像抽出部、104b AF処理部、104c 撮影処理部、105 メモリ、106 メモリカードスロット、107 モニタ DESCRIPTION OF SYMBOLS 100 Camera, 101 Input switch, 102 Lens, 103 Image pick-up element, 104 Control apparatus, 104a Partial image extraction part, 104b AF process part, 104c Shooting process part, 105 Memory, 106 Memory card slot, 107 Monitor

Claims (5)

複数の色成分を有する表色系で表される対象画像内から使用者が注目している部分を含む部分画像を抽出するための部分画像抽出方法であって、
前記対象画像内に、使用者によって指定された指定点を含む枠を設定し、
前記枠内の画像に基づいて、各色成分ごとの色成分画像を生成し、
生成した各色成分画像を、それぞれの色成分画像ごとに設定した閾値を用いて2値化して、各色成分ごとのマスク画像を生成し、
前記各色成分ごとのマスク画像のそれぞれを対象として、前記部分画像を抽出するのに適したマスク画像であるかを判定するための評価値を算出し、
算出した前記評価値に基づいて、前記各色成分ごとのマスク画像の中から前記部分画像を抽出するのに最も適したマスク画像を最適マスク画像として選択し、
選択した前記最適マスク画像内に、前記部分画像を抽出するための抽出領域を設定し、
前記対象画像から、前記最適マスク画像内に設定した前記抽出領域に対応する領域内の画像を、前記部分画像として抽出することを特徴とする部分画像抽出方法。
A partial image extraction method for extracting a partial image including a portion of interest by a user from a target image represented by a color system having a plurality of color components,
A frame including a designated point designated by the user is set in the target image,
Based on the image in the frame, generate a color component image for each color component,
Each generated color component image is binarized using a threshold set for each color component image to generate a mask image for each color component,
For each of the mask images for each color component, calculate an evaluation value for determining whether the mask image is suitable for extracting the partial image,
Based on the calculated evaluation value, a mask image most suitable for extracting the partial image from the mask images for each color component is selected as an optimal mask image,
In the selected optimal mask image, set an extraction region for extracting the partial image,
A partial image extraction method, wherein an image in an area corresponding to the extraction area set in the optimum mask image is extracted as the partial image from the target image.
請求項1に記載の部分画像抽出方法において、
前記最適マスク画像内の白画素の重心位置と、白画素の数とに基づいて、前記最適マスク画像内に設定する前記抽出領域の位置および大きさを決定することを特徴とする部分画像抽出方法。
The partial image extraction method according to claim 1,
A partial image extraction method for determining a position and a size of the extraction region set in the optimum mask image based on a barycentric position of white pixels in the optimum mask image and the number of white pixels. .
請求項1または2に記載の部分画像抽出方法において、
各色成分画像ごとに濃度平均値、または濃度中央値を閾値として算出し、各色成分画像ごとに算出した閾値を用いて、それぞれの色成分ごとの前記マスク画像を生成することを特徴とする部分画像抽出方法。
The partial image extraction method according to claim 1 or 2,
A partial image characterized by calculating a density average value or a median density value as a threshold value for each color component image, and generating the mask image for each color component using the threshold value calculated for each color component image Extraction method.
請求項1〜3のいずれか一項に記載の部分画像抽出方法において、
各色成分ごとのマスク画像内の白画素の数と、白画素の重心周りの慣性モーメントとに基づいて、前記評価値を算出することを特徴とする部分画像抽出方法。
In the partial image extraction method as described in any one of Claims 1-3,
A partial image extraction method, wherein the evaluation value is calculated based on the number of white pixels in the mask image for each color component and the moment of inertia around the center of gravity of the white pixels.
請求項2に記載の部分画像抽出方法において、
前記最適マスク画像内の白画素の重心位置から各白画素までの距離に応じた重み付けを行って前記白画素の重心位置を補正し、補正後の前記白画素の重心位置が前記抽出領域中心位置となるように、前記最適マスク画像内に設定する前記抽出領域の位置を決定することを特徴とする部分画像抽出方法。
In the partial image extraction method according to claim 2,
Weighting according to the distance from the center of gravity of the white pixel in the optimal mask image to each white pixel is performed to correct the center of gravity of the white pixel, and the center of gravity of the white pixel after correction is the center position of the extraction region The partial image extraction method is characterized in that the position of the extraction region to be set in the optimum mask image is determined.
JP2007320761A 2007-12-12 2007-12-12 Partial image extraction method and partial image extraction apparatus Active JP5012477B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007320761A JP5012477B2 (en) 2007-12-12 2007-12-12 Partial image extraction method and partial image extraction apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007320761A JP5012477B2 (en) 2007-12-12 2007-12-12 Partial image extraction method and partial image extraction apparatus

Publications (2)

Publication Number Publication Date
JP2009146033A true JP2009146033A (en) 2009-07-02
JP5012477B2 JP5012477B2 (en) 2012-08-29

Family

ID=40916595

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007320761A Active JP5012477B2 (en) 2007-12-12 2007-12-12 Partial image extraction method and partial image extraction apparatus

Country Status (1)

Country Link
JP (1) JP5012477B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011109502A (en) * 2009-11-19 2011-06-02 Nikon Corp Image tracking device, imaging apparatus, and, image tracking method
JP2012133573A (en) * 2010-12-21 2012-07-12 Canon Inc Image recognition device, image recognition method and program
JP2014063041A (en) * 2012-09-21 2014-04-10 Keyence Corp Imaging analysis apparatus, control method thereof, and program for imaging analysis apparatus
JP2015149569A (en) * 2014-02-05 2015-08-20 株式会社ニコン Image processing device, imaging device, and image processing program

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06187455A (en) * 1992-12-15 1994-07-08 Sharp Corp Face area extracting device for animation picture
JPH08184925A (en) * 1994-10-31 1996-07-16 Fuji Photo Film Co Ltd Method for determining exposure and method for extracting graphics
JPH11185025A (en) * 1997-12-22 1999-07-09 Victor Co Of Japan Ltd Face image normalization device
WO2007125866A1 (en) * 2006-04-28 2007-11-08 Nikon Corporation Object extracting method, object pursuing method, image synthesizing method, computer program for extracting object, computer program for pursuing object, computer program for synthesizing images, object extracting device, object pursuing device, and image synthesizing device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06187455A (en) * 1992-12-15 1994-07-08 Sharp Corp Face area extracting device for animation picture
JPH08184925A (en) * 1994-10-31 1996-07-16 Fuji Photo Film Co Ltd Method for determining exposure and method for extracting graphics
JPH11185025A (en) * 1997-12-22 1999-07-09 Victor Co Of Japan Ltd Face image normalization device
WO2007125866A1 (en) * 2006-04-28 2007-11-08 Nikon Corporation Object extracting method, object pursuing method, image synthesizing method, computer program for extracting object, computer program for pursuing object, computer program for synthesizing images, object extracting device, object pursuing device, and image synthesizing device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011109502A (en) * 2009-11-19 2011-06-02 Nikon Corp Image tracking device, imaging apparatus, and, image tracking method
JP2012133573A (en) * 2010-12-21 2012-07-12 Canon Inc Image recognition device, image recognition method and program
JP2014063041A (en) * 2012-09-21 2014-04-10 Keyence Corp Imaging analysis apparatus, control method thereof, and program for imaging analysis apparatus
JP2015149569A (en) * 2014-02-05 2015-08-20 株式会社ニコン Image processing device, imaging device, and image processing program

Also Published As

Publication number Publication date
JP5012477B2 (en) 2012-08-29

Similar Documents

Publication Publication Date Title
JP4678603B2 (en) Imaging apparatus and imaging method
JP4924606B2 (en) Subject extraction method, subject tracking method, image composition method, subject extraction computer program, subject tracking computer program, image composition computer program, subject extraction device, subject tracking device, and image composition device
JP5246078B2 (en) Object location program and camera
JP2006140594A (en) Digital camera
JP6421794B2 (en) Image processing apparatus, image processing method, and program
JP5699432B2 (en) Image processing device
JP2008271241A (en) Imaging apparatus, image processing apparatus, imaging method, and image processing method
JP2005353010A (en) Image processor and imaging device
JPWO2012002069A1 (en) Shape extraction method and apparatus, and dimension measuring apparatus and distance measuring apparatus
KR20100022918A (en) Image processing apparatus. image processing method, and storage medium
JP2009141475A (en) Camera
JP6525809B2 (en) Focus detection apparatus and control method thereof
JP5012477B2 (en) Partial image extraction method and partial image extraction apparatus
JP2010279054A (en) Image pickup device, image processing device, image pickup method, and image processing method
JP2013012940A (en) Tracking apparatus and tracking method
JP5691617B2 (en) Subject identification device and subject tracking device
JP5949559B2 (en) Image processing apparatus, imaging apparatus, and image processing program
WO2012014946A1 (en) Image processing device and image processing program
JP2010154306A (en) Device, program and method for imaging control
JP2010020602A (en) Image matching device and camera
JP2023033355A (en) Image processing device and control method therefor
JP2006074498A (en) Image processor and imaging apparatus
JP2009009206A (en) Extraction method of outline inside image and image processor therefor
JP5965654B2 (en) TRACKING DEVICE, IMAGING DEVICE, TRACKING METHOD USED FOR IMAGING DEVICE
JP2007020033A (en) Electronic camera and image processing program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20101202

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110215

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20110914

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110920

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20111121

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20111121

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20120508

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120521

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150615

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 5012477

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150615

Year of fee payment: 3

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250