JP5565227B2 - Image processing apparatus, image processing method, and program - Google Patents

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

Info

Publication number
JP5565227B2
JP5565227B2 JP2010203865A JP2010203865A JP5565227B2 JP 5565227 B2 JP5565227 B2 JP 5565227B2 JP 2010203865 A JP2010203865 A JP 2010203865A JP 2010203865 A JP2010203865 A JP 2010203865A JP 5565227 B2 JP5565227 B2 JP 5565227B2
Authority
JP
Japan
Prior art keywords
image
subject
unit
corrected
predetermined
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.)
Active
Application number
JP2010203865A
Other languages
Japanese (ja)
Other versions
JP2012059158A (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 JP2010203865A priority Critical patent/JP5565227B2/en
Publication of JP2012059158A publication Critical patent/JP2012059158A/en
Application granted granted Critical
Publication of JP5565227B2 publication Critical patent/JP5565227B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Studio Devices (AREA)
  • Image Analysis (AREA)
  • Processing Or Creating Images (AREA)
  • Image Processing (AREA)
  • Studio Circuits (AREA)

Description

本発明は、画像処理装置、画像処理方法及びプログラムに関する。   The present invention relates to an image processing apparatus, an image processing method, and a program.

従来、撮像装置を用いて、背景内に被写体が存在する画像と被写体が存在しない背景画像とを撮像して、背景画像と被写体が存在する画像から差分情報を生成し、被写体のみを抜き出すアプリケーションが知られている(例えば、特許文献1参照)。   Conventionally, an application that uses an imaging device to capture an image with a subject in the background and a background image without the subject, generate difference information from the background image and the image with the subject, and extract only the subject It is known (see, for example, Patent Document 1).

特開平10−21408号公報Japanese Patent Laid-Open No. 10-21408

しかしながら、上記特許文献1のアプリケーションにおいては、画像解析処理により自動的に被写体画像を抜き出すため、意図しない画像領域が抜き出されてしまったときには、その処理をキャンセルし再度最初から処理を行わなくてはならないという問題があった。   However, since the subject image is automatically extracted by the image analysis process in the application disclosed in Patent Document 1, when an unintended image area is extracted, the process is canceled and the process is not performed again from the beginning. There was a problem not to be.

そこで、本発明の課題は、被写体画像を抽出した後でも、当該被写体画像の修正を行うことができる画像処理装置、画像処理方法及びプログラムを提供することである。   Therefore, an object of the present invention is to provide an image processing device, an image processing method, and a program that can correct a subject image even after the subject image is extracted.

上記課題を解決するため、請求項1に記載の発明の画像処理装置は、
背景内に被写体が存在する被写体存在画像と前記背景内に前記被写体の存在しない被写体非存在画像との間で対応する各画素の差分情報に基づいて、前記被写体存在画像から被写体が含まれる被写体画像を抽出する抽出手段と、前記抽出手段により抽出された前記被写体画像の前記被写体存在画像における位置を示す所定階調のアルファマップを生成する第1生成手段と、この第1生成手段により生成されたアルファマップに基づいて、所定軸方向のアルファ値のグラフを生成する第2生成手段と、この第2生成手段により生成されたグラフにて、前記被写体画像であるか否かの判定に係る所定の閾値を設定する設定手段と、この設定手段により設定された前記所定の閾値に基づいて、前記抽出手段により抽出された被写体画像における修正すべき領域を特定する特定手段と、この特定手段により特定された修正すべき領域を、前記被写体存在画像における前記修正すべき領域と対応する領域に基づいて修正する修正手段と、を備えたことを特徴としている。
In order to solve the above problem, an image processing apparatus according to claim 1 is provided.
Based on the corresponding differential information of each pixel with the non-existing object absence image of the subject on the subject-including image and the previous xenon in Jing the presence of an object in the background, include the subject from the subject existing image Extraction means for extracting a subject image, first generation means for generating an alpha map of a predetermined gradation indicating the position of the subject image extracted by the extraction means in the subject presence image, and generated by the first generation means A second generation unit that generates a graph of an alpha value in a predetermined axis direction based on the generated alpha map, and a determination as to whether or not the subject image is generated by the graph generated by the second generation unit setting means for setting the predetermined threshold value, based on the predetermined threshold set by the setting means, modified in the extracted object image by the extraction unit Specifying means for specific areas to, that this area should be corrected specified by the specifying means, with a, a correction means for correcting, based on the region corresponding to the region to be the modification in the subject-including image It is characterized by.

請求項に記載の発明は、請求項に記載の画像処理装置において、
前記修正手段は、前記設定手段により前記所定の閾値が設定される毎に、前記第1生成手段により生成される前記アルファマップを順次修正することを特徴としている。
The invention according to claim 2 is the image processing apparatus according to claim 1 ,
The correction means sequentially corrects the alpha map generated by the first generation means every time the predetermined threshold is set by the setting means.

請求項に記載の発明は、請求項に記載の画像処理装置において、
前記修正手段により前記アルファマップが修正される毎に、当該アルファマップに基づいて、表示用の前記被写体存在画像から前記被写体画像を切り抜いた被写体切り抜き画像を順次生成する第3生成手段と、この第3生成手段により前記被写体切り抜き画像が生成される毎に、当該被写体切り抜き画像を表示部に順次表示させる表示制御手段と、を更に備えることを特徴としている。
The invention according to claim 3 is the image processing apparatus according to claim 2 ,
A third generating unit that sequentially generates a subject cut-out image obtained by cutting out the subject image from the subject-existing image for display based on the alpha map each time the alpha map is corrected by the correcting unit; 3 is further provided with display control means for sequentially displaying the subject clipped image on the display unit each time the subject clipped image is generated by the generating means.

請求項に記載の発明は、請求項1に記載の画像処理装置において、
前記特定手段は、前記被写体画像における操作部の所定操作に基づいて指定された領域を前記修正すべき領域として特定することを特徴としている。
According to a fourth aspect of the present invention, in the image processing apparatus according to the first aspect,
The specifying means specifies a region specified based on a predetermined operation of the operation unit in the subject image as the region to be corrected.

請求項に記載の発明の画像処理方法は、
画像処理装置を用いた画像処理方法であって、背景内に被写体が存在する被写体存在画像と前記背景内に前記被写体の存在しない被写体非存在画像との間で対応する各画素の差分情報に基づいて、前記被写体存在画像から被写体が含まれる被写体画像を抽出する処理と、抽出された前記被写体画像の前記被写体存在画像における位置を示す所定階調のアルファマップを生成する処理と、生成されたアルファマップに基づいて、所定軸方向のアルファ値のグラフを生成する処理と、生成されたグラフにて、前記被写体画像であるか否かの判定に係る所定の閾値を設定する処理と、設定された前記所定の閾値に基づいて、抽出された被写体画像における修正すべき領域を特定する処理と、特定された修正すべき領域を、前記被写体存在画像における前記修正すべき領域と対応する領域に基づいて修正する処理と、を備えたことを特徴としている。
The image processing method of the invention according to claim 5
An image processing method using the image processing apparatus, the difference information of each pixel corresponding with the non-existent object absence image of the subject on the subject-including image and the previous xenon in Jing the presence of an object in the background And a process for extracting a subject image including a subject from the subject existing image, and a process for generating an alpha map of a predetermined gradation indicating a position of the extracted subject image in the subject existing image. Processing for generating a graph of an alpha value in a predetermined axis direction based on the determined alpha map, processing for setting a predetermined threshold for determining whether or not the subject image is the generated graph, and setting based on the predetermined threshold which is a process of identify the region to be corrected in the extracted object image, the region to be corrected identified, put the subject-including image It is characterized by comprising a process of modified based on a region corresponding to the modified region to be.

請求項に記載の発明のプログラムは、
画像処理装置のコンピュータを、背景内に被写体が存在する被写体存在画像と前記背景内に前記被写体の存在しない被写体非存在画像との間で対応する各画素の差分情報に基づいて、前記被写体存在画像から被写体が含まれる被写体画像を抽出する抽出手段、前記抽出手段により抽出された前記被写体画像の前記被写体存在画像における位置を示す所定階調のアルファマップを生成する第1生成手段、この第1生成手段により生成されたアルファマップに基づいて、所定軸方向のアルファ値のグラフを生成する第2生成手段、この第2生成手段により生成されたグラフにて、前記被写体画像であるか否かの判定に係る所定の閾値を設定する設定手段、この設定手段により設定された前記所定の閾値に基づいて、前記抽出手段により抽出された被写体画像における修正すべき領域を特定する特定手段、この特定手段により特定された修正すべき領域を、前記被写体存在画像における前記修正すべき領域と対応する領域に基づいて修正する修正手段、として機能させることを特徴としている。
The program of the invention described in claim 6 is:
The computer of the image processing apparatus, based on the corresponding differential information of each pixel with the non-existing object absence image of the subject on the subject-including image and the previous xenon in Jing the presence of an object in the background, the object Extraction means for extracting a subject image including a subject from a presence image; first generation means for generating an alpha map of a predetermined gradation indicating a position of the subject image extracted by the extraction means in the subject presence image; A second generation unit that generates a graph of an alpha value in a predetermined axis direction based on the alpha map generated by the first generation unit; whether the subject image is the graph generated by the second generation unit; setting means for setting a predetermined threshold value according to the determination of, based on the set predetermined threshold by the setting means, extracted by the extraction means Specifying means, correction means the region to be corrected, which is specified by the specifying means, modified based on the region corresponding to the region to be the modification in the subject-including image that identify the region to be corrected in Utsushitai image, It is characterized by making it function as.

本発明によれば、被写体画像を抽出した後でも、当該被写体画像の修正を行うことができる。   According to the present invention, the subject image can be corrected even after the subject image is extracted.

本発明を適用した一実施形態の撮像装置の概略構成を示すブロック図である。It is a block diagram which shows schematic structure of the imaging device of one Embodiment to which this invention is applied. 図1の撮像装置による被写体切り抜き処理に係る動作の一例を示すフローチャートである。3 is a flowchart illustrating an example of an operation related to subject clipping processing by the imaging apparatus of FIG. 1. 図2の被写体切り抜き処理を説明するための画像の一例を模式的に示す図である。It is a figure which shows typically an example of the image for demonstrating the object clipping process of FIG. 図1の撮像装置による被写体修正処理に係る動作の一例を示すフローチャートである。3 is a flowchart illustrating an example of an operation related to subject correction processing by the imaging apparatus of FIG. 1. 図4の被写体修正処理を説明するための画像の一例を模式的に示す図である。FIG. 5 is a diagram schematically illustrating an example of an image for explaining subject correction processing in FIG. 4.

以下に、本発明について、図面を用いて具体的な態様を説明する。ただし、発明の範囲は、図示例に限定されない。
図1は、本発明を適用した一実施形態の撮像装置100の概略構成を示すブロック図である。
Hereinafter, specific embodiments of the present invention will be described with reference to the drawings. However, the scope of the invention is not limited to the illustrated examples.
FIG. 1 is a block diagram illustrating a schematic configuration of an imaging apparatus 100 according to an embodiment to which the present invention is applied.

本実施形態の撮像装置100は、被写体存在画像P1と被写体非存在画像(図示略)との間で対応する各画素の差分情報に基づいて、被写体存在画像P1から被写体が含まれる被写体画像Pgを抽出し、当該被写体画像Pgにおける修正すべき領域を所定条件に従って特定して、特定された修正すべき領域を、被写体存在画像P1における対応する領域に基づいて修正する。
具体的には、図1に示すように、撮像装置100は、レンズ部1と、電子撮像部2と、撮像制御部3と、画像データ生成部4と、画像メモリ5と、特徴量演算部6と、ブロックマッチング部7と、画像処理部8と、表示制御部9と、表示部10と、記録媒体制御部11と、操作入力部12と、中央制御部13とを備えている。
また、撮像制御部3と、特徴量演算部6と、ブロックマッチング部7と、画像処理部8と、中央制御部13は、例えば、カスタムLSI1Aとして設計されている。
The imaging apparatus 100 according to the present embodiment obtains a subject image Pg including a subject from the subject presence image P1 based on difference information of each pixel corresponding to the subject presence image P1 and a subject non-existence image (not shown). Extraction is performed, the region to be corrected in the subject image Pg is specified according to a predetermined condition, and the specified region to be corrected is corrected based on the corresponding region in the subject presence image P1.
Specifically, as illustrated in FIG. 1, the imaging apparatus 100 includes a lens unit 1, an electronic imaging unit 2, an imaging control unit 3, an image data generation unit 4, an image memory 5, and a feature amount calculation unit. 6, a block matching unit 7, an image processing unit 8, a display control unit 9, a display unit 10, a recording medium control unit 11, an operation input unit 12, and a central control unit 13.
Further, the imaging control unit 3, the feature amount calculation unit 6, the block matching unit 7, the image processing unit 8, and the central control unit 13 are designed as a custom LSI 1A, for example.

レンズ部1は、複数のレンズから構成され、ズームレンズやフォーカスレンズ等を備えている。
また、レンズ部1は、図示は省略するが、被写体の撮像の際に、ズームレンズを光軸方向に移動させるズーム駆動部、フォーカスレンズを光軸方向に移動させる合焦駆動部等を備えていても良い。
The lens unit 1 includes a plurality of lenses and includes a zoom lens, a focus lens, and the like.
Although not shown, the lens unit 1 includes a zoom drive unit that moves the zoom lens in the optical axis direction and a focus drive unit that moves the focus lens in the optical axis direction when imaging a subject. May be.

電子撮像部2は、例えば、CCD(Charge Coupled Device)やCMOS(Complementary Metal-oxide Semiconductor)等のイメージセンサから構成され、レンズ部1の各種レンズを通過した光学像を二次元の画像信号に変換する。   The electronic imaging unit 2 is composed of an image sensor such as a CCD (Charge Coupled Device) or a CMOS (Complementary Metal-oxide Semiconductor), for example, and converts an optical image that has passed through various lenses of the lens unit 1 into a two-dimensional image signal. To do.

撮像制御部3は、図示は省略するが、タイミング発生器、ドライバなどを備えている。そして、撮像制御部3は、タイミング発生器、ドライバにより電子撮像部2を走査駆動して、所定周期毎に光学像を電子撮像部2により二次元の画像信号に変換させ、当該電子撮像部2の撮像領域から1画面分ずつ画像フレームを読み出して画像データ生成部4に出力させる。
また、撮像制御部3は、被写体の撮像条件の調整制御として、AF(自動合焦処理)やAE(自動露出処理)やAWB(自動ホワイトバランス)等を行う。
Although not shown, the imaging control unit 3 includes a timing generator, a driver, and the like. Then, the imaging control unit 3 scans and drives the electronic imaging unit 2 with a timing generator and a driver, converts the optical image into a two-dimensional image signal with the electronic imaging unit 2 every predetermined period, and the electronic imaging unit 2 Image frames are read out from the imaging area for each screen and output to the image data generation unit 4.
The imaging control unit 3 performs AF (automatic focusing processing), AE (automatic exposure processing), AWB (automatic white balance), and the like as adjustment control of the imaging conditions of the subject.

このように構成されたレンズ部1、電子撮像部2及び撮像制御部3は、撮像手段として、背景内に被写体が存在する被写体存在画像P1(図3(a)等参照)や、この被写体存在画像P1の背景と略同一(望ましくは完全同一)の背景内に被写体の存在しない被写体非存在画像(図示略)等を撮像する。   The lens unit 1, the electronic image capturing unit 2, and the image capturing control unit 3 configured in this way are used as an image capturing unit, such as a subject existing image P 1 (see FIG. 3A) or the like, A non-existing subject image (not shown) or the like in which no subject exists is captured in a background that is substantially the same as the background of the image P1 (preferably completely the same).

画像データ生成部4は、電子撮像部2から転送された画像フレームのアナログ値の信号に対してRGBの各色成分毎に適宜ゲイン調整した後に、サンプルホールド回路(図示略)でサンプルホールドしてA/D変換器(図示略)でデジタルデータに変換し、カラープロセス回路(図示略)で画素補間処理及びγ補正処理を含むカラープロセス処理を行った後、デジタル値の輝度信号Y及び色差信号Cb,Cr(YUVデータ)を生成する。
カラープロセス回路から出力される輝度信号Y及び色差信号Cb,Crは、図示しないDMAコントローラを介して、バッファメモリとして使用される画像メモリ5にDMA転送される。
The image data generation unit 4 appropriately adjusts the gain for each RGB color component with respect to the analog value signal of the image frame transferred from the electronic imaging unit 2, and then performs sample holding by a sample hold circuit (not shown). The digital signal is converted into digital data by a / D converter (not shown), color processing including pixel interpolation processing and γ correction processing is performed by a color process circuit (not shown), and then a digital luminance signal Y and color difference signal Cb , Cr (YUV data).
The luminance signal Y and the color difference signals Cb and Cr output from the color process circuit are DMA-transferred to an image memory 5 used as a buffer memory via a DMA controller (not shown).

画像メモリ5は、例えば、DRAM等により構成され、特徴量演算部6と、ブロックマッチング部7と、画像処理部8と、中央制御部13等によって処理されるデータ等を一時記憶する。   The image memory 5 is configured by, for example, a DRAM or the like, and temporarily stores data processed by the feature amount calculation unit 6, the block matching unit 7, the image processing unit 8, the central control unit 13, and the like.

特徴量演算部6は、被写体非存在画像を基準として、当該被写体非存在画像から特徴点を抽出する特徴抽出処理を行う。具体的には、特徴量演算部6は、例えば、被写体非存在画像のYUVデータに基づいて、所定数(或いは、所定数以上)の特徴の高いブロック領域(特徴点)を選択して、当該ブロックの内容をテンプレート(例えば、16×16画素の正方形)として抽出する。
ここで、特徴抽出処理とは、多数の候補ブロックから追跡に都合の良い特徴性の高いものを選択する処理である。
The feature amount calculation unit 6 performs feature extraction processing for extracting feature points from the subject non-existing image with reference to the subject non-existing image. Specifically, the feature amount calculation unit 6 selects, for example, a predetermined number (or a predetermined number or more) of highly featured block areas (feature points) based on the YUV data of the subject non-existing image, The contents of the block are extracted as a template (for example, a square of 16 × 16 pixels).
Here, the feature extraction process is a process of selecting a feature having a high characteristic convenient for tracking from a large number of candidate blocks.

ブロックマッチング部7は、被写体切り抜き画像P2(図3(c)参照)を生成する際に、被写体非存在画像と被写体存在画像P1の位置合わせのためのブロックマッチング処理を行う。具体的には、ブロックマッチング部7は、特徴抽出処理にて抽出されたテンプレートが被写体存在画像P1内のどこに対応するか、つまり、被写体存在画像P1内にてテンプレートの画素値が最適にマッチする位置(対応領域)を探索する。そして、画素値の相違度の評価値(例えば、差分二乗和(SSD)や差分絶対値和(SAD)等)が最も良かった被写体非存在画像と被写体存在画像P1間の最適なオフセットを当該テンプレートの動きベクトルとして算出する。   When generating the subject cutout image P2 (see FIG. 3C), the block matching unit 7 performs block matching processing for aligning the subject nonexistent image and the subject present image P1. Specifically, the block matching unit 7 optimally matches where the template extracted by the feature extraction processing corresponds to in the subject existing image P1, that is, the template pixel value in the subject existing image P1. Search for a position (corresponding region). Then, an optimum offset between the subject non-existing image and the subject existing image P1 having the best evaluation value (for example, sum of squared differences (SSD), sum of absolute differences (SAD), etc.) of the pixel value is determined as the template. As a motion vector.

画像処理部8は、画像取得部8aと、位置合わせ部8bと、画像抽出部8cと、位置情報生成部8dと、画像生成部8eと、グラフ生成部8fと、修正領域特定部8gと、画像修正部8hとを具備している。   The image processing unit 8 includes an image acquisition unit 8a, a registration unit 8b, an image extraction unit 8c, a position information generation unit 8d, an image generation unit 8e, a graph generation unit 8f, a correction region specification unit 8g, And an image correction unit 8h.

画像取得部8aは、被写体存在画像P1及び被写体非存在画像の画像データを取得する。
即ち、画像取得部8aは、画像メモリ5に一時記憶されている被写体存在画像P1のYUVデータ及び被写体非存在画像のYUVデータを読み出して取得する。
The image acquisition unit 8a acquires the image data of the subject presence image P1 and the subject non-existence image.
That is, the image acquisition unit 8a reads and acquires the YUV data of the subject existing image P1 and the YUV data of the subject non-existing image temporarily stored in the image memory 5.

位置合わせ部8bは、被写体存在画像P1と被写体非存在画像との位置合わせを行う。
即ち、位置合わせ部8bは、被写体非存在画像から抽出した特徴点に基づいて、被写体非存在画像に対する被写体存在画像P1の各画素の座標変換式(射影変換行列)を算出し、当該座標変換式に従って被写体存在画像P1を座標変換して被写体非存在画像と位置合わせを行う。
The alignment unit 8b performs alignment between the subject presence image P1 and the subject non-existence image.
That is, the alignment unit 8b calculates a coordinate conversion formula (projection conversion matrix) of each pixel of the subject presence image P1 with respect to the subject non-existence image based on the feature points extracted from the subject non-existence image. The subject presence image P1 is subjected to coordinate transformation to align with the subject non-existence image.

画像抽出部8cは、被写体存在画像P1から被写体が含まれる被写体画像Pgを抽出する。
即ち、画像抽出部8cは、位置合わせ部8bにより位置合わせされた被写体存在画像P1と被写体非存在画像との間で対応する各画素の差分情報を生成し、当該差分情報を基準として被写体存在画像P1から被写体が含まれる被写体画像Pgを抽出する。
ここで、画像抽出部8cは、被写体存在画像P1と被写体非存在画像との間で対応する各画素の差分情報に基づいて、被写体存在画像P1から被写体が含まれる被写体画像Pgを抽出する抽出手段を構成している。
The image extraction unit 8c extracts a subject image Pg including a subject from the subject presence image P1.
That is, the image extraction unit 8c generates difference information of each corresponding pixel between the subject presence image P1 and the subject non-existence image aligned by the alignment unit 8b, and the subject presence image is based on the difference information. A subject image Pg including the subject is extracted from P1.
Here, the image extraction unit 8c extracts the subject image Pg including the subject from the subject presence image P1 based on the difference information of each pixel corresponding to the subject presence image P1 and the subject non-existence image. Is configured.

位置情報生成部8dは、被写体存在画像P1における被写体画像Pgの位置を示す位置情報を生成する。
即ち、位置情報生成部8dは、被写体存在画像P1から抽出された被写体画像Pgの位置を特定して、被写体存在画像P1における被写体画像Pgの位置を示す所定階調(例えば、256階調:8bit)のアルファマップM(図3(b)参照)を生成する。
ここで、アルファマップMとは、被写体存在画像P1の各画素について、被写体画像Pgを所定の背景に対してアルファブレンディングする際の重みをアルファ値(α:0〜255)として表したものである。なお、図3(b)並びに後述する図5(d)〜図5(f)にあっては、アルファ値が「0」の被写体画像Pgが存しない領域を黒色で表し、アルファ値が「255」の被写体画像Pgが存する領域を白色で表し、アルファ値が「1〜254」の中間階調の領域をドットを付して白色と黒色の中間色で表すものとする。
このように、位置情報生成部8dは、画像抽出部8cにより抽出された被写体画像Pgの被写体存在画像P1における位置を示す所定階調のアルファマップMを生成する第1生成手段を構成している。
The position information generation unit 8d generates position information indicating the position of the subject image Pg in the subject presence image P1.
That is, the position information generation unit 8d specifies the position of the subject image Pg extracted from the subject existence image P1, and indicates a predetermined gradation (for example, 256 gradations: 8 bits) indicating the position of the subject image Pg in the subject existence image P1. ) Alpha map M (see FIG. 3B).
Here, the alpha map M represents a weight when alpha blending the subject image Pg with respect to a predetermined background for each pixel of the subject existing image P1 as an alpha value (α: 0 to 255). . In FIG. 3B and FIGS. 5D to 5F described later, an area where the subject image Pg having an alpha value of “0” does not exist is represented in black, and the alpha value is “255”. The area where the subject image Pg exists is expressed in white, and the intermediate gradation area where the alpha value is “1 to 254” is indicated by an intermediate color between white and black with dots.
As described above, the position information generation unit 8d constitutes a first generation unit that generates an alpha map M having a predetermined gradation indicating the position of the subject image Pg extracted by the image extraction unit 8c in the subject existing image P1. .

画像生成部8eは、被写体切り抜き画像P2の画像データを生成する。
即ち、画像生成部8eは、生成されたアルファマップMに基づいて、被写体存在画像P1の各画素のうち、アルファ値が「255」の画素を所定の単一色画像(図示略)に対して透過させず、アルファ値が「0」の画素を透過させ、アルファ値が1≦α≦254の画素を所定の単一色とブレンディングさせるように、被写体画像Pgを所定の単一色画像と合成して被写体切り抜き画像P2の画像データを生成する。
ここで、被写体存在画像P1は、記録用として記録媒体11aに記録される高解像度の画像データであっても良いし、画像データ生成部4により生成されたライブビュー表示用の低解像度の縮小画像データであっても良い。
The image generation unit 8e generates image data of the subject cutout image P2.
In other words, based on the generated alpha map M, the image generation unit 8e transmits a pixel having an alpha value of “255” among the pixels of the subject existing image P1 to a predetermined single color image (not shown). The subject image Pg is synthesized with the predetermined single color image so that the pixels with the alpha value of “0” are transmitted and the pixels with the alpha value of 1 ≦ α ≦ 254 are blended with the predetermined single color. Image data of the cutout image P2 is generated.
Here, the subject presence image P1 may be high-resolution image data recorded on the recording medium 11a for recording, or a low-resolution reduced image for live view display generated by the image data generation unit 4. It may be data.

また、画像生成部8eは、画像修正部8hによるアルファマップMの修正後、当該アルファマップMに基づいて、被写体存在画像P1のライブビュー表示用の縮小画像データから被写体画像Pgを切り抜いた被写体切り抜き画像P2を生成する。即ち、画像生成部8eは、第3生成手段として、画像修正部8hによりアルファマップMが修正される毎に、当該アルファマップMに基づいて、表示用の被写体存在画像P1から被写体画像Pgを切り抜いた被写体切り抜き画像P2を順次生成する。
なお、被写体切り抜き画像P2の生成方法は、上記と同様であり、その詳細な説明は省略する。
Further, the image generation unit 8e cuts the subject image Pg from the reduced image data for live view display of the subject existing image P1 based on the alpha map M after the alpha map M is corrected by the image correction unit 8h. An image P2 is generated. That is, the image generation unit 8e cuts out the subject image Pg from the display subject existing image P1 based on the alpha map M every time the alpha map M is corrected by the image correction unit 8h as the third generation unit. The subject cutout images P2 are sequentially generated.
Note that the method of generating the subject cutout image P2 is the same as described above, and a detailed description thereof is omitted.

グラフ生成部8fは、アルファマップMのアルファ値のグラフGを生成する。
即ち、グラフ生成部8fは、位置情報生成部8dにより生成されたアルファマップMに基づいて、x軸(所定軸)方向のアルファ値のグラフGを生成する。具体的には、グラフ生成部8fは、アルファマップMのy座標を所定座標に固定し、x軸(所定軸)方向に沿ってアルファ値を取得していって当該アルファ値のグラフGa〜Gc(図5(a)〜図5(c)参照)を生成する。
なお、アルファマップMのy軸方向における固定座標は、例えば、アルファマップMの中心座標や、x軸と略等しい方向に沿ったアルファ値が「0」以外の画素の連続性や頻度、x軸と略等しい方向に沿ったアルファ値が「255」の画素の連続性や頻度、x軸と略等しい方向に沿ったアルファ値が「0」の画素の連続性や頻度等を考慮して自動的に特定されても良いし、ユーザによる操作入力部12の所定操作に基づいて所定のy座標が特定されても良い。
The graph generation unit 8 f generates a graph G of the alpha value of the alpha map M.
That is, the graph generation unit 8f generates a graph G of an alpha value in the x-axis (predetermined axis) direction based on the alpha map M generated by the position information generation unit 8d. Specifically, the graph generation unit 8f fixes the y coordinate of the alpha map M to a predetermined coordinate, acquires an alpha value along the x-axis (predetermined axis) direction, and displays the alpha value graphs Ga to Gc. (See FIGS. 5A to 5C).
The fixed coordinates in the y-axis direction of the alpha map M are, for example, the center coordinates of the alpha map M, the continuity and frequency of pixels whose alpha value along the direction substantially equal to the x-axis is not “0”, the x-axis Automatically considering the continuity and frequency of pixels with an alpha value of “255” along the direction that is almost equal to the vertical axis, and the continuity and frequency of pixels with an alpha value of “0” along the direction that is almost equal to the x axis. The predetermined y coordinate may be specified based on a predetermined operation of the operation input unit 12 by the user.

なお、グラフ生成部8fは、アルファマップMのy座標を所定座標に固定して、x軸方向のアルファ値のグラフGを生成するようにしたが、一例であってこれに限られるものではなく、例えば、アルファマップMのx座標を所定座標に固定して、y軸方向のアルファ値のグラフを生成するようにしても良い。
このように、グラフ生成部8fは、位置情報生成部8dにより生成されたアルファマップMに基づいて、所定軸方向のアルファ値のグラフGを生成する第2生成手段を構成している。
The graph generation unit 8f fixes the y coordinate of the alpha map M to a predetermined coordinate and generates the graph G of the alpha value in the x-axis direction, but is not limited to this example. For example, a graph of an alpha value in the y-axis direction may be generated by fixing the x coordinate of the alpha map M to a predetermined coordinate.
As described above, the graph generation unit 8f constitutes a second generation unit that generates the graph G of the alpha value in the predetermined axis direction based on the alpha map M generated by the position information generation unit 8d.

修正領域特定部8gは、被写体画像Pgにおける修正すべき領域を特定する。
即ち、修正領域特定部8gは、画像抽出部8cにより抽出された被写体画像Pgにおける修正すべき領域を特定する。具体的には、修正領域特定部8gは、ユーザによる操作入力部12の所定操作に基づいて中央制御部13により設定された被写体画像Pgであるか否かの判定に係る所定の閾値に基づいて、修正領域を特定する。例えば、ユーザによる操作入力部12の所定操作に基づいて所定の閾値を指示する直線が、y軸上の所定のアルファ値に設定されることに基づいて、修正領域特定部8gは、アルファマップMにおける当該アルファ値(所定の閾値)以上の値を有する画素からなる領域を特定する。そして、修正領域特定部8gは、被写体画像Pgの中で、アルファマップMにて特定された領域に対応する領域を修正領域として特定する。
ここで、修正領域特定部8gは、画像抽出部8cにより抽出された被写体画像Pgにおける修正すべき領域を所定条件に従って特定する特定手段を構成している。
The correction area specifying unit 8g specifies an area to be corrected in the subject image Pg.
That is, the correction area specifying unit 8g specifies an area to be corrected in the subject image Pg extracted by the image extraction unit 8c. Specifically, the correction area specifying unit 8g is based on a predetermined threshold value for determining whether or not the subject image Pg is set by the central control unit 13 based on a predetermined operation of the operation input unit 12 by the user. Identify the correction area. For example, based on the fact that a straight line indicating a predetermined threshold value is set to a predetermined alpha value on the y-axis based on a predetermined operation of the operation input unit 12 by the user, the correction area specifying unit 8g An area composed of pixels having a value equal to or greater than the alpha value (predetermined threshold value) is specified. Then, the correction area specifying unit 8g specifies an area corresponding to the area specified by the alpha map M in the subject image Pg as the correction area.
Here, the correction area specifying unit 8g constitutes specifying means for specifying the area to be corrected in the subject image Pg extracted by the image extracting unit 8c according to a predetermined condition.

画像修正部8hは、被写体画像Pgにおける修正領域を修正する。
即ち、画像修正部8hは、修正領域特定部8gにより特定された修正すべき領域を、被写体存在画像P1における対応する領域に基づいて修正する。具体的には、画像修正部8hは、中央制御部13により設定された所定の閾値(アルファ値)に基づいて、アルファマップMにおける当該アルファ値以上の値を有する画素からなる領域を修正する。より具体的には、画像修正部8hは、アルファマップMにて、中央制御部13により設定された所定の閾値(アルファ値)以上の値を有する中間階調の画素のアルファ値を最大値(例えば、256階調では、「255」)に変更する。また、画像修正部8hは、中央制御部13により所定の閾値が設定される毎に、アルファマップMを順次修正する。
その後、画像生成部8eは、画像修正部8hによる修正後のアルファマップMに基づいて、被写体存在画像P1のライブビュー表示用の縮小画像データから被写体画像Pgを切り抜いた被写体切り抜き画像P2を生成することにより、当該被写体切り抜き画像P2の被写体画像Pgを修正する。
なお、被写体切り抜き画像P2の被写体画像Pgの修正にアルファマップMを用いるようにしたが、一例であってこれに限られるものではなく、例えば、被写体画像Pgの修正領域の画素を被写体存在画像P1の対応する領域の画素で置換する方法など適宜任意に変更可能である。
このように、画像修正部8h及び画像生成部8eは、修正領域特定部8gにより特定された修正すべき領域を、被写体存在画像P1における対応する領域に基づいて修正する修正手段を構成している。
The image correction unit 8h corrects the correction area in the subject image Pg.
That is, the image correcting unit 8h corrects the region to be corrected specified by the correction region specifying unit 8g based on the corresponding region in the subject existing image P1. Specifically, the image correction unit 8h corrects an area composed of pixels having a value equal to or higher than the alpha value in the alpha map M based on a predetermined threshold (alpha value) set by the central control unit 13. More specifically, the image correction unit 8h sets the alpha value of an intermediate gradation pixel having a value equal to or larger than a predetermined threshold (alpha value) set by the central control unit 13 in the alpha map M to the maximum value ( For example, it is changed to “255” for 256 gradations. The image correcting unit 8h sequentially corrects the alpha map M every time a predetermined threshold is set by the central control unit 13.
Thereafter, the image generation unit 8e generates a subject cutout image P2 obtained by cutting out the subject image Pg from the reduced image data for live view display of the subject existing image P1 based on the alpha map M corrected by the image correction unit 8h. Thus, the subject image Pg of the subject cutout image P2 is corrected.
Note that the alpha map M is used to correct the subject image Pg of the subject cutout image P2, but this is an example, and the present invention is not limited to this. For example, pixels in the correction area of the subject image Pg are set as the subject existing image P1. It is possible to arbitrarily change the method of replacing with the pixel in the corresponding region.
As described above, the image correcting unit 8h and the image generating unit 8e constitute correcting means for correcting the region to be corrected specified by the correction region specifying unit 8g based on the corresponding region in the subject existing image P1. .

表示制御部9は、画像メモリ5に一時的に記憶されている表示用画像データを読み出して表示部10に表示させる制御を行う。
具体的には、表示制御部9は、VRAM、VRAMコントローラ、デジタルビデオエンコーダなどを備えている。そして、デジタルビデオエンコーダは、中央制御部13の制御下にて画像メモリ5から読み出されてVRAM(図示略)に記憶されている輝度信号Y及び色差信号Cb,Crを、VRAMコントローラを介してVRAMから定期的に読み出して、これらのデータを元にビデオ信号を発生して表示部10に出力する。
The display control unit 9 performs control to read display image data temporarily stored in the image memory 5 and display the data on the display unit 10.
Specifically, the display control unit 9 includes a VRAM, a VRAM controller, a digital video encoder, and the like. The digital video encoder reads the luminance signal Y and the color difference signals Cb and Cr read from the image memory 5 and stored in the VRAM (not shown) under the control of the central control unit 13 via the VRAM controller. The data is periodically read from the VRAM, a video signal is generated based on these data, and is output to the display unit 10.

表示部10は、例えば、液晶表示装置であり、表示制御部9からのビデオ信号に基づいて電子撮像部2により撮像された画像などを表示画面に表示する。具体的には、表示部10は、撮像モードにて、レンズ部1、電子撮像部2及び撮像制御部3による被写体の撮像により生成された複数の画像フレームに基づいてライブビュー画像を表示したり、本撮像画像として撮像されたレックビュー画像を表示する。   The display unit 10 is, for example, a liquid crystal display device, and displays an image captured by the electronic imaging unit 2 on the display screen based on a video signal from the display control unit 9. Specifically, the display unit 10 displays a live view image based on a plurality of image frames generated by imaging the subject by the lens unit 1, the electronic imaging unit 2, and the imaging control unit 3 in the imaging mode. The REC view image captured as the actual captured image is displayed.

また、表示部10は、表示制御部9の制御下にて、画像生成部8eにより生成された被写体切り抜き画像P2を表示する。具体的には、表示制御部9は、画像生成部8eにより被写体切り抜き画像P2が生成される毎に、当該被写体切り抜き画像P2を表示部10に表示させる。
ここで、表示制御部9は、画像生成部8eにより被写体切り抜き画像P2が生成される毎に、当該被写体切り抜き画像P2を表示部10に順次表示させる表示制御手段を構成している。
Further, the display unit 10 displays the subject cutout image P2 generated by the image generation unit 8e under the control of the display control unit 9. Specifically, the display control unit 9 causes the display unit 10 to display the subject cutout image P2 every time the subject cutout image P2 is generated by the image generation unit 8e.
Here, the display control unit 9 constitutes a display control means for sequentially displaying the subject cutout image P2 on the display unit 10 every time the subject cutout image P2 is generated by the image generation unit 8e.

記録媒体制御部11は、記録媒体11aが着脱自在に構成され、装着された記録媒体11aからのデータの読み出しや記録媒体11aに対するデータの書き込みを制御する。即ち、記録媒体制御部11は、画像処理部8のJPEG圧縮部(図示略)により符号化された撮像画像の記録用の画像データを記録媒体11aに記録させる。
被写体画像Pgの画像データは、画像生成部8eの位置情報生成部8dにより生成されたアルファマップM及び被写体存在画像P1と対応付けられて、当該被写体切り抜き画像P2の画像データの拡張子を「.jpe」として記録されている。
The recording medium control unit 11 is configured such that the recording medium 11a is detachable, and controls reading of data from the loaded recording medium 11a and writing of data to the recording medium 11a. That is, the recording medium control unit 11 records the image data for recording the captured image encoded by the JPEG compression unit (not shown) of the image processing unit 8 on the recording medium 11a.
The image data of the subject image Pg is associated with the alpha map M and the subject presence image P1 generated by the position information generation unit 8d of the image generation unit 8e, and the extension of the image data of the subject cutout image P2 is “. jpe ".

なお、記録媒体11aは、例えば、不揮発性メモリ(フラッシュメモリ)等により構成されるが、一例であってこれに限られるものではなく、適宜任意に変更可能である。   The recording medium 11a is composed of, for example, a non-volatile memory (flash memory) or the like. However, the recording medium 11a is an example and is not limited thereto, and can be arbitrarily changed as appropriate.

操作入力部12は、当該撮像装置100の所定操作を行うためのものである。具体的には、操作入力部12は、被写体の撮影指示に係るシャッタボタン12a、撮像モードや機能等の選択指示に係る選択決定用ボタン12b、ズーム量の調整指示に係るズームボタン(図示略)等を備え、これらのボタンの操作に応じて所定の操作信号を中央制御部13に出力する。   The operation input unit 12 is for performing a predetermined operation of the imaging apparatus 100. Specifically, the operation input unit 12 includes a shutter button 12a related to a subject shooting instruction, a selection determination button 12b related to a selection instruction for an imaging mode, a function, and the like, and a zoom button (not shown) related to a zoom amount adjustment instruction. And a predetermined operation signal is output to the central control unit 13 in accordance with the operation of these buttons.

また、操作入力部12の選択決定用ボタン12bは、アルファマップMの所定軸方向のアルファ値に基づいて生成され、表示部10に表示されたグラフGにて、被写体画像Pgであるか否かの判定に係る所定の閾値(例えば、アルファ値が256階調の場合、「0」〜「255」の任意の値等)の設定指示を入力する。具体的には、例えば、ユーザによる選択決定用ボタン12bの所定操作に基づいて、x軸と略等しい方向に沿って延在する所定の閾値を指示する直線をy軸方向に沿って移動させることで、所定の閾値の設定指示を入力する。そして、選択決定用ボタン12bは、当該操作入力部12の操作に応じた所定の指示信号を中央制御部13に出力する。
中央制御部13は、入力された指示信号によって指示された所定の値を、被写体画像Pgであるか否かの判定に係る所定の閾値として設定する。
ここで、操作入力部12及び中央制御部13は、グラフ生成部8fにより生成されたグラフGにて、被写体画像Pgであるか否かの判定に係る所定の閾値を設定する設定手段を構成している。
In addition, the selection determination button 12b of the operation input unit 12 is generated based on the alpha value in the predetermined axis direction of the alpha map M, and is a subject image Pg in the graph G displayed on the display unit 10. A setting instruction for a predetermined threshold related to the determination (for example, an arbitrary value from “0” to “255” when the alpha value is 256 gradations) is input. Specifically, for example, based on a predetermined operation of the selection decision button 12b by the user, a straight line indicating a predetermined threshold extending along a direction substantially equal to the x axis is moved along the y axis direction. Then, a predetermined threshold setting instruction is input. Then, the selection determination button 12 b outputs a predetermined instruction signal corresponding to the operation of the operation input unit 12 to the central control unit 13.
The central control unit 13 sets a predetermined value indicated by the input instruction signal as a predetermined threshold for determining whether or not the image is the subject image Pg.
Here, the operation input unit 12 and the central control unit 13 constitute setting means for setting a predetermined threshold for determining whether or not the image is the subject image Pg in the graph G generated by the graph generation unit 8f. ing.

中央制御部13は、撮像装置100の各部を制御するものである。具体的には、中央制御部13は、CPU、RAM、ROM(何れも図示略)を備え、撮像装置100用の各種処理プログラム(図示略)に従って各種の制御動作を行う。   The central control unit 13 controls each unit of the imaging apparatus 100. Specifically, the central control unit 13 includes a CPU, a RAM, and a ROM (all not shown), and performs various control operations according to various processing programs (not shown) for the imaging apparatus 100.

次に、撮像装置100による被写体切り抜き処理について、図2及び図3を参照して説明する。
図2は、被写体切り抜き処理に係る動作の一例を示すフローチャートである。
Next, the subject clipping process performed by the imaging apparatus 100 will be described with reference to FIGS.
FIG. 2 is a flowchart illustrating an example of an operation related to the subject clipping process.

被写体切り抜き処理は、ユーザによる操作入力部12の選択決定用ボタン12bの所定操作に基づいて、メニュー画面に表示された複数の撮像モードの中から被写体切り抜きモードが選択指示された場合に実行される処理である。
また、以下に説明する被写体切り抜き処理にあっては、例えば、被写体として電車の玩具を撮像するものとする。
The subject clipping process is executed when a subject clipping mode is selected from a plurality of imaging modes displayed on the menu screen based on a predetermined operation of the selection determination button 12b of the operation input unit 12 by the user. It is processing.
In the subject cutout process described below, for example, a train toy is imaged as a subject.

図2に示すように、先ず、表示制御部9は、レンズ部1、電子撮像部2及び撮像制御部3による被写体の撮像により生成された複数の画像フレームに基づいてライブビュー画像を表示部10の表示画面に表示させるとともに、当該ライブビュー画像に重畳させて、被写体存在画像P1の撮像指示メッセージを表示部10の表示画面に表示させる(ステップS1)。
その後、中央制御部13は、ユーザによる操作入力部12のシャッタボタン12aの所定操作に基づいて撮像指示が入力されたか否かを判定する(ステップS2)。ここで、撮像指示が入力されたと判定されると(ステップS2;YES)、撮像制御部3は、フォーカスレンズの合焦位置や露出条件(シャッター速度、絞り、増幅率等)やホワイトバランス等の撮像条件を調整して、被写体存在画像P1(図3(a)参照)の光学像を所定の条件で電子撮像部2により撮像させる(ステップS3)。そして、画像データ生成部4は、電子撮像部2から転送された被写体存在画像P1のYUVデータを生成する。なお、当該被写体存在画像P1のYUVデータは、画像メモリ5に一時記憶される。
また、撮像制御部3は、当該被写体存在画像P1の撮像の際の合焦位置や露出条件やホワイトバランス等の条件を固定した状態を維持する。
As shown in FIG. 2, first, the display control unit 9 displays a live view image based on a plurality of image frames generated by imaging a subject by the lens unit 1, the electronic imaging unit 2, and the imaging control unit 3. And the image capturing instruction message of the subject existing image P1 is displayed on the display screen of the display unit 10 (step S1).
Thereafter, the central control unit 13 determines whether or not an imaging instruction has been input based on a predetermined operation of the shutter button 12a of the operation input unit 12 by the user (step S2). If it is determined that an imaging instruction has been input (step S2; YES), the imaging control unit 3 determines the focus lens focus position, exposure conditions (shutter speed, aperture, amplification factor, etc.), white balance, and the like. The imaging condition is adjusted, and an optical image of the subject presence image P1 (see FIG. 3A) is captured by the electronic imaging unit 2 under a predetermined condition (step S3). Then, the image data generation unit 4 generates YUV data of the subject existing image P1 transferred from the electronic imaging unit 2. The YUV data of the subject existing image P1 is temporarily stored in the image memory 5.
Further, the imaging control unit 3 maintains a state in which conditions such as a focus position, an exposure condition, and a white balance at the time of imaging the subject presence image P1 are fixed.

次に、表示制御部9は、レンズ部1、電子撮像部2及び撮像制御部3による被写体の撮像により生成された複数の画像フレームに基づいてライブビュー画像を表示部10の表示画面に表示させるとともに、当該ライブビュー画像に重畳させて、被写体存在画像P1の半透過の表示態様の画像と被写体非存在画像の撮像指示メッセージを表示部10の表示画面に表示させる(ステップS4)。
この後、中央制御部13は、ユーザによる操作入力部12のシャッタボタン12aの所定操作に基づいて撮像指示が入力されたか否かを判定する(ステップS5)。そして、ユーザは、被写体を画角外に移動させた後、ユーザにより被写体非存在画像が被写体存在画像P1の半透過の画像と重なるようにカメラ位置が調整されて、操作入力部12のシャッタボタン12aが所定操作されて撮像指示が入力されたと判定されると(ステップS5;YES)、撮像制御部3は、被写体非存在画像の光学像を被写体存在画像P1の撮像後に固定された撮像条件で電子撮像部2により撮像させる(ステップS6)。そして、画像データ生成部4は、電子撮像部2から転送された被写体非存在画像のYUVデータを生成する。なお、当該被写体存在画像P1のYUVデータは、画像メモリ5に一時記憶される。
Next, the display control unit 9 displays a live view image on the display screen of the display unit 10 based on a plurality of image frames generated by imaging the subject by the lens unit 1, the electronic imaging unit 2, and the imaging control unit 3. At the same time, the image of the semi-transparent display mode of the subject existing image P1 and the imaging instruction message of the subject non-existing image are displayed on the display screen of the display unit 10 so as to be superimposed on the live view image (step S4).
Thereafter, the central control unit 13 determines whether or not an imaging instruction has been input based on a predetermined operation of the shutter button 12a of the operation input unit 12 by the user (step S5). Then, after the user moves the subject out of the angle of view, the camera position is adjusted by the user so that the subject non-existing image overlaps the semi-transparent image of the subject existing image P1, and the shutter button of the operation input unit 12 is moved. If it is determined that the image capturing instruction is input by performing a predetermined operation on 12a (step S5; YES), the image capturing control unit 3 captures the optical image of the subject non-existing image under the image capturing condition fixed after capturing the subject existing image P1. An image is picked up by the electronic image pickup unit 2 (step S6). Then, the image data generation unit 4 generates YUV data of the subject non-existence image transferred from the electronic imaging unit 2. The YUV data of the subject existing image P1 is temporarily stored in the image memory 5.

次に、中央制御部13は、特徴量演算部6、ブロックマッチング部7及び画像処理部8に、画像メモリ5に一時記憶されている被写体非存在画像のYUVデータを基準として、被写体存在画像P1のYUVデータを射影変換させるための射影変換行列を所定の画像変換モデル(例えば、相似変換モデル、或いは合同変換モデル)で算出させる(ステップS7)。
具体的には、特徴量演算部6は、被写体非存在画像のYUVデータに基づいて、所定数(或いは、所定数以上)の特徴の高いブロック領域(特徴点)を選択して、当該ブロックの内容をテンプレートとして抽出する。そして、ブロックマッチング部7は、特徴抽出処理にて抽出されたテンプレートの画素値が最適にマッチする位置を被写体存在画像P1内にて探索して、画素値の相違度の評価値が最も良かった被写体非存在画像と被写体存在画像P1間の最適なオフセットを当該テンプレートの動きベクトルとして算出する。そして、画像処理部8の画像取得部8aは、画像メモリ5から被写体存在画像P1のYUVデータ及び被写体非存在画像のYUVデータを取得した後、位置合わせ部8bは、ブロックマッチング部7により算出された複数のテンプレートの動きベクトルに基づいて全体の動きベクトルを統計的に算出し、当該動きベクトルに係る特徴点対応を用いて被写体存在画像P1の射影変換行列を算出する。
Next, the central control unit 13 uses the feature existence calculation unit 6, the block matching unit 7, and the image processing unit 8 as a reference to the subject presence image P 1 based on the YUV data of the subject non-existence image temporarily stored in the image memory 5. A projection transformation matrix for projective transformation of the YUV data is calculated using a predetermined image transformation model (for example, a similarity transformation model or a joint transformation model) (step S7).
Specifically, the feature amount calculation unit 6 selects a predetermined number (or a predetermined number or more) of highly featured block regions (feature points) based on the YUV data of the subject nonexistent image, and Extract the contents as a template. Then, the block matching unit 7 searches the subject existing image P1 for a position where the pixel value of the template extracted by the feature extraction process is optimally matched, and the evaluation value of the difference between the pixel values is the best. An optimum offset between the subject non-existing image and the subject existing image P1 is calculated as a motion vector of the template. Then, after the image acquisition unit 8a of the image processing unit 8 acquires the YUV data of the subject existing image P1 and the YUV data of the subject nonexistent image from the image memory 5, the alignment unit 8b is calculated by the block matching unit 7. The overall motion vector is statistically calculated based on the motion vectors of the plurality of templates, and the projective transformation matrix of the subject existing image P1 is calculated using the feature point correspondence related to the motion vector.

次に、位置合わせ部8bは、算出された射影変換行例に基づいて被写体存在画像P1を射影変換することで、被写体存在画像P1のYUVデータと被写体非存在画像のYUVデータとを位置合わせする処理を行う(ステップS8)。   Next, the alignment unit 8b performs the projective transformation on the subject existing image P1 based on the calculated projective transformation example, thereby aligning the YUV data of the subject existing image P1 and the YUV data of the subject nonexistent image. Processing is performed (step S8).

そして、画像抽出部8cは、被写体存在画像P1から被写体が含まれる被写体画像Pgを抽出する処理を行う(ステップS9)。
具体的には、画像抽出部8cは、被写体存在画像P1のYUVデータと被写体非存在画像のYUVデータの各々に対してローパスフィルタをかけて各画像の高周波成分を除去する。その後、画像抽出部8cは、ローパスフィルタをかけた被写体存在画像P1と被写体非存在画像との間で対応する各画素について相違度を算出して相違度マップを生成する。続けて、画像抽出部8cは、各画素に係る相違度マップを所定の閾値で2値化した後、相違度マップから細かいノイズや手ぶれにより相違が生じた領域を除去するために収縮処理を行う。その後、画像抽出部8cは、ラベリング処理を行って、所定値以下の領域や最大領域以外の領域を除去した後、一番大きな島のパターンを被写体画像Pgとして特定し、収縮分を修正するための膨張処理を行う。
Then, the image extraction unit 8c performs a process of extracting the subject image Pg including the subject from the subject existing image P1 (step S9).
Specifically, the image extraction unit 8c applies a low-pass filter to each of the YUV data of the subject existing image P1 and the YUV data of the subject nonexistent image to remove high frequency components of each image. Thereafter, the image extraction unit 8c calculates a difference for each corresponding pixel between the subject existing image P1 and the subject non-existing image subjected to the low-pass filter, and generates a difference map. Subsequently, the image extraction unit 8c binarizes the dissimilarity map relating to each pixel with a predetermined threshold value, and then performs a contraction process in order to remove a region in which the dissimilarity is caused by fine noise or camera shake from the dissimilarity map. . After that, the image extraction unit 8c performs a labeling process, removes areas below a predetermined value and areas other than the maximum area, identifies the largest island pattern as the subject image Pg, and corrects the shrinkage. The expansion process is performed.

次に、位置情報生成部8dは、抽出された被写体画像Pgの被写体存在画像P1内での位置を示す所定階調(例えば、256階調)のアルファマップM(図3(b)参照)を生成する(ステップS10)。   Next, the position information generation unit 8d displays an alpha map M (see FIG. 3B) having a predetermined gradation (for example, 256 gradations) indicating the position of the extracted subject image Pg in the subject existing image P1. Generate (step S10).

その後、画像生成部8eは、ライブビュー表示用の被写体存在画像P1に基づいて、被写体画像Pgを所定の単一色画像と合成した被写体切り抜き画像P2(図3(c)参照)の画像データを生成する処理を行う(ステップS11)。
具体的には、画像生成部8eは、被写体存在画像P1、単一色画像及びアルファマップMを読み出して画像メモリ5に展開した後、被写体存在画像P1を水平及び垂直ともに所定倍率で縮小してライブビュー表示用の低解像度の縮小画像データを生成する。また、画像生成部8eは、被写体存在画像P1の解像度に合わせてアルファマップMを縮小する。そして、画像生成部8eは、ライブビュー表示用の低解像度の被写体存在画像P1の全ての画素について、アルファ値が「0」の画素については透過させ、アルファ値が1≦α<254の画素については所定の単一色とブレンディングを行い、アルファ値が「255」の画素については何もせずに所定の単一色に対して透過させないようにする。
Thereafter, the image generation unit 8e generates image data of a subject cutout image P2 (see FIG. 3C) obtained by combining the subject image Pg with a predetermined single color image based on the subject existing image P1 for live view display. Is performed (step S11).
Specifically, the image generation unit 8e reads out the subject existing image P1, the single color image, and the alpha map M, develops them in the image memory 5, and then reduces the subject existing image P1 at a predetermined magnification both in the horizontal and vertical directions. Low-resolution reduced image data for view display is generated. Further, the image generation unit 8e reduces the alpha map M in accordance with the resolution of the subject existing image P1. Then, the image generation unit 8e transmits all the pixels of the low-resolution subject existing image P1 for live view display with respect to the pixels with the alpha value “0” and the pixels with the alpha value 1 ≦ α <254. Performs blending with a predetermined single color, and does not transmit the pixel with an alpha value of “255” to the predetermined single color without doing anything.

その後、記録媒体制御部11は、記録媒体11aの所定領域に、被写体存在画像P1の画像データと、画像処理部8の位置情報生成部8dにより生成されたアルファマップMと、被写体切り抜き画像P2の画像データとを対応付けて一ファイルで記録させる(ステップS12)。   Thereafter, the recording medium control unit 11 stores the image data of the subject existing image P1, the alpha map M generated by the position information generation unit 8d of the image processing unit 8, and the subject clipped image P2 in a predetermined area of the recording medium 11a. The image data is associated and recorded in one file (step S12).

これにより、被写体切り抜き処理を終了する。
この結果、例えば、所定の背景内から電車の玩具が被写体として抽出された被写体切り抜き画像P2の画像データが生成されるが、被写体画像Pgの背景色と等しい色の部分などでは、アルファ値が「255」(白色)とならずに、アルファ値が「1〜254」の中間階調(白色と黒色の中間色)の領域が生じてしまう。
Thereby, the subject clipping process is completed.
As a result, for example, image data of a subject cutout image P2 in which a train toy is extracted as a subject from within a predetermined background is generated, but the alpha value is `` in the color portion equal to the background color of the subject image Pg ''. Instead of 255 ”(white), an intermediate tone area (white and black intermediate color) with an alpha value of“ 1 to 254 ”occurs.

次に、被写体修正処理について、図4及び図5を参照して説明する。
図4は、被写体修正処理に係る動作の一例を示すフローチャートである。
Next, the subject correction process will be described with reference to FIGS.
FIG. 4 is a flowchart illustrating an example of an operation related to the subject correction process.

被写体修正処理は、被写体切り抜き処理の後、ユーザによる操作入力部12の選択決定用ボタン12bの所定操作に基づいて、メニュー画面に表示された複数の動作モードの中から被写体修正モードが選択指示された場合に実行される処理である。
また、以下に説明する被写体修正処理にあっては、例えば、被写体画像Pgとして電車の玩具が抽出されたものを修正の対象とする。
In the subject correction process, the subject correction mode is selected from a plurality of operation modes displayed on the menu screen based on a predetermined operation of the selection decision button 12b of the operation input unit 12 by the user after the subject clipping process. This process is executed when
In the subject correction processing described below, for example, a subject image Pg from which a train toy is extracted is set as a correction target.

図4に示すように、表示制御部9は、記録媒体11aに記録されている少なくとも一の被写体切り抜き画像P2の画像データのうち、ユーザによる操作入力部12の所定操作に従って指定された所定の被写体切り抜き画像P2の画像データに基づいて、被写体画像Pgを表示部10の表示画面に表示させる(ステップS21)。
続けて、中央制御部13は、ユーザによる操作入力部12の所定操作に基づいて被写体画像Pgの修正指示が入力されたか否かを判定する(ステップS22)。
As shown in FIG. 4, the display control unit 9 is a predetermined subject specified in accordance with a predetermined operation of the operation input unit 12 by the user among the image data of at least one subject cutout image P2 recorded on the recording medium 11a. Based on the image data of the cutout image P2, the subject image Pg is displayed on the display screen of the display unit 10 (step S21).
Subsequently, the central control unit 13 determines whether or not a correction instruction for the subject image Pg has been input based on a predetermined operation of the operation input unit 12 by the user (step S22).

ステップS22にて、修正指示が入力されたと判定されると(ステップS22;YES)、グラフ生成部8fは、アルファマップMのy座標を所定座標に固定し、x軸(所定軸)方向に沿ってアルファ値を取得していって当該アルファ値のグラフG(例えば、グラフGa等;図5(a)参照)を生成する。そして、表示制御部9は、グラフ生成部8fにより生成されたグラフG(例えば、グラフGa等)を表示部10の表示画面に表示させる(ステップS23)。
一方、ステップS22にて、修正指示が入力されていないと判定されると(ステップS22;NO)、中央制御部13は、被写体修正処理を終了させる。
If it is determined in step S22 that a correction instruction has been input (step S22; YES), the graph generation unit 8f fixes the y coordinate of the alpha map M to a predetermined coordinate and follows the x axis (predetermined axis) direction. Thus, the alpha value is acquired, and a graph G of the alpha value (for example, graph Ga or the like; see FIG. 5A) is generated. And the display control part 9 displays the graph G (for example, graph Ga etc.) produced | generated by the graph production | generation part 8f on the display screen of the display part 10 (step S23).
On the other hand, if it is determined in step S22 that no correction instruction has been input (step S22; NO), the central control unit 13 ends the subject correction process.

次に、中央制御部13は、ユーザによる操作入力部12の所定操作に基づいて、被写体画像Pgであるか否かの判定に係る所定の閾値が入力されたか否かを判定する(ステップS24)。
ここで、所定の閾値が入力されたと判定されると(ステップS24;YES)、修正領域特定部8gは、y軸上にて所定の閾値を指示する直線が設定されたアルファ値に基づいて、アルファマップMにおける当該アルファ値(所定の閾値)以上の値を有する画素からなる領域を修正領域として特定する(ステップS25)。そして、画像修正部8hは、アルファマップMにおける修正領域、即ち、所定の閾値(アルファ値)以上の値を有する中間階調の全ての画素のアルファ値を最大値(例えば、256階調では、「255」)に変更することで、修正後のアルファマップM(例えば、アルファマップMa等;図5(d)参照)を生成する(ステップS26)。
Next, the central control unit 13 determines whether or not a predetermined threshold value related to determination of whether or not the subject image Pg is input based on a predetermined operation of the operation input unit 12 by the user (step S24). .
Here, if it is determined that a predetermined threshold is input (step S24; YES), the correction area specifying unit 8g is based on an alpha value in which a straight line indicating the predetermined threshold is set on the y-axis. An area composed of pixels having a value equal to or higher than the alpha value (predetermined threshold) in the alpha map M is specified as a correction area (step S25). Then, the image correction unit 8h sets the alpha value of all the pixels in the correction area in the alpha map M, that is, the intermediate gradation having a value equal to or larger than a predetermined threshold (alpha value) to a maximum value (for example, in 256 gradations, By changing to “255”), a corrected alpha map M (for example, alpha map Ma etc .; see FIG. 5D) is generated (step S26).

続けて、画像生成部8eは、ライブビュー表示用の被写体存在画像P1及び修正後のアルファマップM(例えば、アルファマップMa等)に基づいて、被写体画像Pgを所定の単一色画像と合成した被写体切り抜き画像P2(例えば、被写体切り抜き画像P2a等;図5(g)参照)の画像データを生成する処理を行う(ステップS27)。
具体的には、画像生成部8eは、被写体存在画像P1を水平及び垂直ともに所定倍率で縮小してライブビュー表示用の低解像度の縮小画像データを生成するとともに、被写体存在画像P1の解像度に合わせて修正後のアルファマップM(例えば、アルファマップMa等)を縮小する。そして、画像生成部8eは、ライブビュー表示用の低解像度の被写体存在画像P1の全ての画素について、アルファ値が「0」の画素については透過させ、アルファ値が1≦α<254の画素については所定の単一色とブレンディングを行い、アルファ値が「255」の画素については何もせずに所定の単一色に対して透過させないようにする。
その後、表示制御部9は、画像生成部8eにより生成された被写体切り抜き画像P2(例えば、被写体切り抜き画像P2a等)の画像データに基づいて、所定の単一色画像に被写体が重畳された被写体切り抜き画像P2を表示部10の表示画面に表示させる(ステップS28)。
Subsequently, the image generating unit 8e combines the subject image Pg with a predetermined single color image based on the subject existing image P1 for live view display and the corrected alpha map M (for example, alpha map Ma). Processing for generating image data of the cutout image P2 (for example, the subject cutout image P2a; see FIG. 5G) is performed (step S27).
Specifically, the image generation unit 8e reduces the subject existing image P1 at a predetermined magnification both horizontally and vertically to generate low-resolution reduced image data for live view display, and matches the resolution of the subject existing image P1. Thus, the corrected alpha map M (for example, alpha map Ma) is reduced. Then, the image generation unit 8e transmits all the pixels of the low-resolution subject existing image P1 for live view display with respect to the pixels with the alpha value “0” and the pixels with the alpha value 1 ≦ α <254. Performs blending with a predetermined single color, and does not transmit the pixel with an alpha value of “255” to the predetermined single color without doing anything.
Thereafter, the display control unit 9 performs the subject cut-out image in which the subject is superimposed on a predetermined single color image based on the image data of the subject cut-out image P2 (for example, the subject cut-out image P2a) generated by the image generation unit 8e. P2 is displayed on the display screen of the display unit 10 (step S28).

続けて、中央制御部13は、処理をステップS23に移行して、グラフ生成部8fは、修正後のアルファマップM(例えば、アルファマップMa等)に基づいて、アルファ値のグラフG(例えば、グラフGb、Gc等;図5(b)、図5(c)等参照)を再度生成して、表示制御部9は、グラフ生成部8fにより生成されたグラフG(例えば、グラフGb、Gc等)を表示部10の表示画面に再度表示させる(ステップS23)。   Subsequently, the central control unit 13 shifts the process to step S23, and the graph generation unit 8f, based on the corrected alpha map M (for example, alpha map Ma), displays an alpha value graph G (for example, The graphs Gb, Gc, etc .; see FIGS. 5B, 5C, etc.) are generated again, and the display control unit 9 generates the graph G generated by the graph generation unit 8f (for example, the graphs Gb, Gc, etc.). ) Is again displayed on the display screen of the display unit 10 (step S23).

次に、上記と同様に、中央制御部13は、ユーザによる操作入力部12の所定操作に基づいて、被写体画像Pgであるか否かの判定に係る所定の閾値が新たに入力されたか否かを判定する(ステップS24)。即ち、修正後のアルファマップM(例えば、アルファマップMa等)を用いても被写体切り抜き画像P2の被写体画像Pgの修正が不十分であるとユーザによって判断される場合には、新たな閾値が入力されることとなる。
そして、ステップS24にて、被写体画像Pgであるか否かの判定に係る所定の閾値が新たに入力されると(ステップS24;YES)、修正領域特定部8gは、アルファマップM(例えば、アルファマップMa等)における所定の閾値以上の値を有する画素からなる領域を修正領域として再度特定する(ステップS25)。そして、画像修正部8hは、アルファマップM(例えば、アルファマップMa等)における修正領域、即ち、所定の閾値(アルファ値)以上の値を有する中間階調の全ての画素のアルファ値を最大値(例えば、256階調では、「255」)に変更することで、修正後のアルファマップM(例えば、アルファマップMb、Mc等;図5(e)、図5(f)等参照)を生成する(ステップS26)。
Next, in the same manner as described above, the central control unit 13 determines whether or not a predetermined threshold value relating to determination of whether or not the subject image Pg is newly input based on a predetermined operation of the operation input unit 12 by the user. Is determined (step S24). That is, if the user determines that the correction of the subject image Pg of the subject clipped image P2 is insufficient even when the corrected alpha map M (for example, the alpha map Ma) is used, a new threshold value is input. Will be.
In step S24, when a predetermined threshold value for determining whether or not the subject image is Pg is newly input (step S24; YES), the correction area specifying unit 8g causes the alpha map M (for example, alpha) to be input. An area composed of pixels having a value equal to or greater than a predetermined threshold in the map Ma or the like is specified again as a correction area (step S25). Then, the image correction unit 8h sets the alpha value of the correction region in the alpha map M (for example, the alpha map Ma), that is, the alpha value of all pixels of the intermediate gradation having a value equal to or greater than a predetermined threshold (alpha value) to the maximum value. (For example, “255” in 256 gradations) By changing to the modified alpha map M (for example, alpha map Mb, Mc, etc .; see FIG. 5E, FIG. 5F, etc.) (Step S26).

次に、上記と同様に、画像生成部8eは、ライブビュー表示用の被写体存在画像P1及び修正後のアルファマップM(例えば、アルファマップMb、Mc等)に基づいて、被写体画像Pgを所定の単一色画像と合成した被写体切り抜き画像P2(例えば、被写体切り抜き画像P2b、P2c等;図5(h)、図5(i)等参照)の画像データを生成する処理を行う(ステップS27)。
その後、上記と同様に、表示制御部9は、画像生成部8eにより生成された被写体切り抜き画像P2(例えば、被写体切り抜き画像P2b、P2c等)の画像データに基づいて、所定の単一色画像に被写体が重畳された被写体切り抜き画像P2を表示部10の表示画面に表示させる(ステップS28)。
Next, in the same manner as described above, the image generation unit 8e generates a subject image Pg based on the subject existing image P1 for live view display and the corrected alpha map M (for example, alpha map Mb, Mc, etc.). Processing is performed to generate image data of a subject cutout image P2 (for example, subject cutout images P2b, P2c, etc .; see FIG. 5H, FIG. 5I, etc.) combined with the single color image (step S27).
Thereafter, as described above, the display control unit 9 converts the subject into a predetermined single color image based on the image data of the subject cutout image P2 (for example, the subject cutout images P2b, P2c, etc.) generated by the image generation unit 8e. Is displayed on the display screen of the display unit 10 (step S28).

続けて、中央制御部13は、処理をステップS23に移行して、修正後のアルファマップM(例えば、アルファマップMb、Mc等)のアルファ値のグラフG(例えば、グラフGb、Gc等)を再度生成して、表示制御部9は、グラフ生成部8fにより生成されたグラフG(例えば、グラフGb、Gc等)を表示部10の表示画面に再度表示させる(ステップS23)。   Subsequently, the central control unit 13 shifts the process to step S23 to display a graph G (for example, graphs Gb, Gc, etc.) of the alpha value of the corrected alpha map M (for example, alpha map Mb, Mc, etc.). The display control unit 9 again generates and displays the graph G (for example, graphs Gb, Gc, etc.) generated by the graph generation unit 8f on the display screen of the display unit 10 (step S23).

次に、上記と同様に、中央制御部13は、ユーザによる操作入力部12の所定操作に基づいて、被写体画像Pgであるか否かの判定に係る所定の閾値が新たに入力されたか否かを判定する(ステップS24)。即ち、修正後のアルファマップM(例えば、アルファマップMc等)を用いることで被写体切り抜き画像P2の被写体画像Pgの修正が十分であるとユーザによって判断される場合には、新たな閾値が入力されることはない。
そして、ステップS24にて、被写体画像Pgであるか否かの判定に係る所定の閾値が入力されていないと判定されると(ステップS24;NO)、中央制御部13は、被写体切り抜き画像P2の被写体画像Pgの修正が行われたか否かを判定する(ステップS29)。
Next, in the same manner as described above, the central control unit 13 determines whether or not a predetermined threshold value relating to determination of whether or not the subject image Pg is newly input based on a predetermined operation of the operation input unit 12 by the user. Is determined (step S24). That is, if the user determines that the correction of the subject image Pg of the subject cutout image P2 is sufficient by using the corrected alpha map M (for example, the alpha map Mc), a new threshold value is input. Never happen.
If it is determined in step S24 that a predetermined threshold value for determining whether or not the subject image is Pg is not input (step S24; NO), the central control unit 13 determines that the subject clipped image P2 It is determined whether or not the subject image Pg has been corrected (step S29).

ステップS29にて、被写体画像Pgの修正が行われたと判定されると(ステップS29;YES)、記録媒体制御部11は、記録媒体11aの所定領域に、被写体存在画像P1の画像データと、修正後のアルファマップM(例えば、アルファマップMc等)と、被写体切り抜き画像P2の画像データとを対応付けて一ファイルで記録させる(ステップS30)。
一方、被写体画像Pgの修正が行われていないと判定されると(ステップS29;NO)、中央制御部13は、ステップS30をスキップして、被写体修正処理を終了させる。
When it is determined in step S29 that the subject image Pg has been corrected (step S29; YES), the recording medium control unit 11 reads the image data of the subject existing image P1 in the predetermined area of the recording medium 11a and the correction. The subsequent alpha map M (for example, the alpha map Mc) is associated with the image data of the subject cutout image P2 and recorded in one file (step S30).
On the other hand, if it is determined that the subject image Pg has not been corrected (step S29; NO), the central control unit 13 skips step S30 and ends the subject correction process.

以上のように、本実施形態の撮像装置100によれば、被写体画像Pgにおける修正すべき領域を特定して、この特定された修正すべき領域を、被写体存在画像P1における対応する領域に基づいて修正するので、一旦被写体存在画像P1から被写体画像Pgを抽出した後でも、当該被写体画像Pgの修正を適正に行うことができる。   As described above, according to the imaging apparatus 100 of the present embodiment, the region to be corrected in the subject image Pg is specified, and the specified region to be corrected is based on the corresponding region in the subject existing image P1. Since the correction is made, the subject image Pg can be appropriately corrected even after the subject image Pg is once extracted from the subject existing image P1.

具体的には、被写体画像Pgの被写体存在画像P1における位置を示す所定階調のアルファマップMの所定軸(例えば、x軸)方向のアルファ値のグラフGを生成し、生成されたグラフGにて、被写体画像Pgであるか否かの判定に係る所定の閾値(アルファ値)を設定することに基づいて、被写体画像Pgにおける修正すべき領域を特定する。また、所定の閾値が設定される毎に、当該所定の閾値以上の値を有する中間階調の画素のアルファ値を最大値(例えば、256階調では、「255」)に変更することで、アルファマップMを順次修正する。
そして、アルファマップMが順次修正される毎に、当該アルファマップMに基づいて、ライブビュー表示用の被写体存在画像P1から被写体画像Pgを切り抜いた被写体切り抜き画像P2を生成することで、当該被写体切り抜き画像P2の被写体画像Pgを修正することができる。即ち、記録用として記録される高解像度の被写体存在画像P1から被写体切り抜き画像P2を生成するのではなく、表示用の低解像度の被写体存在画像P1から被写体切り抜き画像P2を生成するので、高解像度の被写体存在画像P1は元画像として加工せずに記録しておくことができる。また、表示用の低解像度の被写体存在画像P1を用いることで、高解像度の被写体存在画像P1を用いる場合に比して被写体画像Pgの生成に係る処理の高速化を図ることができる。
また、このとき、被写体切り抜き画像P2が生成される毎(被写体画像Pgが修正される毎)に、当該被写体切り抜き画像P2の被写体画像Pgを表示するので、ユーザに被写体画像Pgの修正度合いを確認させながら、当該被写体画像Pgに対して更なる修正が必要か否かを判断させることができる。
Specifically, a graph G of an alpha value in the direction of a predetermined axis (for example, the x axis) of an alpha map M having a predetermined gradation indicating the position of the subject image Pg in the subject existing image P1 is generated. Thus, an area to be corrected in the subject image Pg is specified based on setting a predetermined threshold value (alpha value) relating to the determination as to whether or not the subject image is Pg. Further, every time a predetermined threshold value is set, by changing the alpha value of the intermediate gradation pixel having a value equal to or higher than the predetermined threshold value to the maximum value (for example, “255” in 256 gradations), Modify alpha map M sequentially.
Then, each time the alpha map M is sequentially corrected, the subject clipping image P2 is generated by clipping the subject image Pg from the subject existing image P1 for live view display based on the alpha map M. The subject image Pg of the image P2 can be corrected. That is, instead of generating the subject cutout image P2 from the high resolution subject existing image P1 recorded for recording, the subject cutout image P2 is generated from the low resolution subject existing image P1 for display. The subject presence image P1 can be recorded without being processed as an original image. Further, by using the low-resolution subject existence image P1 for display, it is possible to increase the processing speed related to the generation of the subject image Pg compared to the case where the high-resolution subject existence image P1 is used.
At this time, each time the subject cutout image P2 is generated (every time the subject image Pg is corrected), the subject image Pg of the subject cutout image P2 is displayed, so that the user can confirm the degree of correction of the subject image Pg. It is possible to determine whether or not further correction is necessary for the subject image Pg.

なお、本発明は、上記実施形態に限定されることなく、本発明の趣旨を逸脱しない範囲において、種々の改良並びに設計の変更を行っても良い。
例えば、上記実施形態にあっては、被写体画像Pgであるか否かの判定に係る所定の閾値(アルファ値)をユーザによる操作入力部12の所定操作に基づいて設定するようにしたが、これに限られるものではなく、例えば、当該所定の閾値を自動的に設定するようにしても良い。即ち、グラフGにおけるy軸上にて所定の閾値を指示する直線を自動的に所定方向(例えば、アルファ値が「255」から「0」となる方向)に移動させることで所定の閾値を設定して、当該閾値に基づいてアルファマップMを自動的に修正するようにしても良い。
The present invention is not limited to the above-described embodiment, and various improvements and design changes may be made without departing from the spirit of the present invention.
For example, in the above embodiment, the predetermined threshold (alpha value) relating to the determination of whether or not the subject image Pg is set based on the predetermined operation of the operation input unit 12 by the user. For example, the predetermined threshold value may be automatically set. That is, a predetermined threshold value is set by automatically moving a straight line indicating a predetermined threshold value on the y axis in the graph G in a predetermined direction (for example, a direction in which an alpha value is changed from “255” to “0”). Then, the alpha map M may be automatically corrected based on the threshold value.

また、上記実施形態にあっては、アルファマップMのグラフGにおけるy軸上にて所定の閾値を指示する直線が設定されたアルファ値に基づいて、被写体画像Pgにおける修正領域を特定するようにしたが、一例であってこれに限られるものではなく、修正領域の特定方法は適宜任意に変更可能である。
即ち、操作入力部12にタッチパネル(図示略)を具備して、表示部10に表示されている被写体画像Pg上にて修正すべき領域がユーザにより指定されることで、修正領域特定部8gが修正領域を特定するようにしても良い。具体的には、表示部10に表示されている被写体画像Pg上にて修正すべき領域がユーザにより指定されると、修正領域特定部8gは、当該指定された領域を修正すべき領域として特定する。そして、画像修正部8hは、アルファマップMにおける当該修正領域に対応する画素のアルファ値(中間階調の画素のアルファ値)を最大値(例えば、256階調では、「255」)に変更することで、アルファマップMを修正する。
In the above embodiment, the correction region in the subject image Pg is specified based on the alpha value in which a straight line indicating a predetermined threshold is set on the y axis in the graph G of the alpha map M. However, this is only an example, and the present invention is not limited to this, and the method of specifying the correction region can be arbitrarily changed as appropriate.
That is, the operation input unit 12 includes a touch panel (not shown), and the correction area specifying unit 8g is designated by the user specifying an area to be corrected on the subject image Pg displayed on the display unit 10. The correction area may be specified. Specifically, when an area to be corrected is specified on the subject image Pg displayed on the display unit 10, the correction area specifying unit 8g specifies the specified area as an area to be corrected. To do. Then, the image correction unit 8h changes the alpha value of the pixel corresponding to the correction area in the alpha map M (the alpha value of the intermediate gradation pixel) to the maximum value (for example, “255” in 256 gradations). That will fix the alpha map M.

このように、ユーザによる操作入力部12の所定操作に基づいて指定された被写体画像Pgにおける修正すべき領域を特定するので、表示部10に表示されている被写体画像Pgにて修正領域をユーザに直感的に指定させることができ、被写体画像Pgの修正を簡便に行うことができる。   As described above, since the region to be corrected in the subject image Pg designated based on the predetermined operation of the operation input unit 12 by the user is specified, the correction region is specified to the user by the subject image Pg displayed on the display unit 10. It can be specified intuitively, and the subject image Pg can be easily corrected.

また、上記実施形態にあっては、中央制御部13により所定の閾値(アルファ値)が設定されることに基づいて、アルファマップMを修正するようにしたが、アルファマップMの修正方法は一例であってこれに限られるものではなく、例えば、所定の閾値(アルファ値)が設定されなくとも、自動的に、所定の中間階調値以上のアルファ値を最大値(例えば、256階調では、「255」)に変更したり、所定の中間階調値未満のアルファ値を最小値(例えば、256階調では、「0」)に変更するようにしても良い。   Further, in the above embodiment, the alpha map M is corrected based on the fact that the central control unit 13 sets a predetermined threshold value (alpha value). However, the alpha map M correction method is an example. However, the present invention is not limited to this. For example, even if a predetermined threshold value (alpha value) is not set, an alpha value equal to or higher than a predetermined intermediate gradation value is automatically set to a maximum value (for example, 256 gradations). , “255”), or an alpha value less than a predetermined intermediate gradation value may be changed to a minimum value (for example, “0” for 256 gradations).

さらに、記録媒体11aに記録される修正後のアルファマップM(例えば、アルファマップMc等)に対して平均化フィルタをかけて被写体領域の縁部に合成階調をかけても良く、これにより、被写体画像Pgを背景画像と合成した場合に、被写体領域との境界部分がはっきりしていない自然な感じにすることができる。   Further, the corrected alpha map M (for example, alpha map Mc) recorded on the recording medium 11a may be subjected to an averaging filter to apply a synthetic gradation to the edge of the subject area. When the subject image Pg is combined with the background image, a natural feeling that the boundary portion with the subject region is not clear can be obtained.

また、撮像装置100の構成は、上記実施形態に例示したものは一例であり、これに限られるものではない。即ち、画像処理装置として、撮像装置100を例示したが、これに限られるものではい。例えば、被写体存在画像P1や被写体非存在画像の撮像は、当該撮像装置100とは異なる撮像装置(図示略)にて行い、この撮像装置から転送された画像データのみを記録して、上記の被写体切り抜き処理や被写体修正処理等を実行する構成でも良い。   In addition, the configuration of the imaging apparatus 100 is merely an example illustrated in the above embodiment, and is not limited thereto. That is, the imaging apparatus 100 is illustrated as the image processing apparatus, but is not limited thereto. For example, the subject presence image P1 and the subject non-existence image are picked up by an image pickup device (not shown) different from the image pickup device 100, and only the image data transferred from the image pickup device is recorded. A configuration in which clipping processing, subject correction processing, or the like is executed may be employed.

加えて、上記実施形態にあっては、抽出手段、特定手段、修正手段としての機能を、画像処理部8の画像抽出部8c、画像生成部8e、修正領域特定部8g、画像修正部8hが駆動することにより実現される構成としたが、これに限られるものではなく、中央制御部13のCPUによって所定のプログラム等が実行されることにより実現される構成としても良い。
即ち、撮像装置100のプログラムを記憶するプログラムメモリ(図示略)に、抽出処理ルーチン、特定処理ルーチン、修正処理ルーチンを含むプログラムを記憶しておく。そして、抽出処理ルーチンにより中央制御部13のCPUを、背景内に被写体が存在する被写体存在画像P1と背景と略同一の背景内に被写体の存在しない被写体非存在画像との間で対応する各画素の差分情報に基づいて、被写体存在画像P1から被写体が含まれる被写体画像Pgを抽出する抽出手段として機能させるようにしても良い。また、特定処理ルーチンにより中央制御部13のCPUを、抽出手段により抽出された被写体画像Pgにおける修正すべき領域を特定する特定手段として機能させるようにしても良い。また、修正処理ルーチンにより中央制御部13のCPUを、特定手段により特定された修正すべき領域を、被写体存在画像P1における対応する領域に基づいて修正する修正手段として機能させるようにしても良い。
In addition, in the above-described embodiment, the functions of the extraction unit, the specification unit, and the correction unit are the image extraction unit 8c, the image generation unit 8e, the correction region specification unit 8g, and the image correction unit 8h of the image processing unit 8. The configuration realized by driving is not limited to this, and may be realized by executing a predetermined program or the like by the CPU of the central control unit 13.
That is, a program memory (not shown) that stores the program of the imaging apparatus 100 stores a program including an extraction processing routine, a specific processing routine, and a correction processing routine. Then, by the extraction processing routine, the CPU of the central control unit 13 causes each pixel corresponding between the subject existing image P1 in which the subject exists in the background and the subject nonexistent image in which the subject does not exist in the same background as the background. Based on this difference information, it may be made to function as an extracting means for extracting the subject image Pg including the subject from the subject existing image P1. Further, the CPU of the central control unit 13 may function as a specifying unit that specifies a region to be corrected in the subject image Pg extracted by the extracting unit by the specifying process routine. Further, the CPU of the central control unit 13 may function as a correction unit that corrects the area to be corrected specified by the specifying unit based on the corresponding area in the subject existing image P1 by the correction processing routine.

同様に、第1生成手段、第2生成手段、設定手段、第3生成手段、表示制御手段についても、中央制御部13のCPUによって所定のプログラム等が実行されることにより実現される構成としても良い。   Similarly, the first generation unit, the second generation unit, the setting unit, the third generation unit, and the display control unit may be realized by executing a predetermined program or the like by the CPU of the central control unit 13. good.

さらに、上記の各処理を実行するためのプログラムを格納したコンピュータ読み取り可能な媒体として、ROMやハードディスク等の他、フラッシュメモリ等の不揮発性メモリ、CD−ROM等の可搬型記録媒体を適用することも可能である。また、プログラムのデータを所定の通信回線を介して提供する媒体としては、キャリアウェーブ(搬送波)も適用される。   Furthermore, as a computer-readable medium storing a program for executing each of the above processes, a non-volatile memory such as a flash memory or a portable recording medium such as a CD-ROM is applied in addition to a ROM or a hard disk. Is also possible. A carrier wave is also used as a medium for providing program data via a predetermined communication line.

100 撮像装置
1 レンズ部
2 電子撮像部
3 撮像制御部
8 画像処理部
8c 画像抽出部
8d 位置情報生成部
8e 画像生成部
8f グラフ生成部
8g 修正領域特定部
8h 画像修正部
12 操作入力部
13 中央制御部
DESCRIPTION OF SYMBOLS 100 Imaging device 1 Lens part 2 Electronic imaging part 3 Imaging control part 8 Image processing part 8c Image extraction part 8d Position information generation part 8e Image generation part 8f Graph generation part 8g Correction area specification part 8h Image correction part 12 Operation input part 13 Center Control unit

Claims (6)

背景内に被写体が存在する被写体存在画像と前記背景内に前記被写体の存在しない被写体非存在画像との間で対応する各画素の差分情報に基づいて、前記被写体存在画像から被写体が含まれる被写体画像を抽出する抽出手段と、
前記抽出手段により抽出された前記被写体画像の前記被写体存在画像における位置を示す所定階調のアルファマップを生成する第1生成手段と、
この第1生成手段により生成されたアルファマップに基づいて、所定軸方向のアルファ値のグラフを生成する第2生成手段と、
この第2生成手段により生成されたグラフにて、前記被写体画像であるか否かの判定に係る所定の閾値を設定する設定手段と、
この設定手段により設定された前記所定の閾値に基づいて、前記抽出手段により抽出された被写体画像における修正すべき領域を特定する特定手段と、
この特定手段により特定された修正すべき領域を、前記被写体存在画像における前記修正すべき領域と対応する領域に基づいて修正する修正手段と、
を備えたことを特徴とする画像処理装置。
Based on the corresponding differential information of each pixel with the non-existing object absence image of the subject on the subject-including image and the previous xenon in Jing the presence of an object in the background, include the subject from the subject existing image Extraction means for extracting a subject image;
First generation means for generating an alpha map of a predetermined gradation indicating a position of the subject image extracted by the extraction means in the subject existing image;
Second generation means for generating a graph of an alpha value in a predetermined axis direction based on the alpha map generated by the first generation means;
Setting means for setting a predetermined threshold value for determining whether or not the image is the subject image in the graph generated by the second generation means;
Based on this setting the predetermined threshold value set by means specifying means for identify the region to be corrected in the extracted object image by said extraction means,
Correction means for correcting the area to be corrected specified by the specifying means based on an area corresponding to the area to be corrected in the subject existing image;
An image processing apparatus comprising:
前記修正手段は、前記設定手段により前記所定の閾値が設定される毎に、前記第1生成手段により生成される前記アルファマップを順次修正することを特徴とする請求項に記載の画像処理装置。 The image processing apparatus according to claim 1 , wherein the correction unit sequentially corrects the alpha map generated by the first generation unit each time the predetermined threshold is set by the setting unit. . 前記修正手段により前記アルファマップが修正される毎に、当該アルファマップに基づいて、表示用の前記被写体存在画像から前記被写体画像を切り抜いた被写体切り抜き画像を順次生成する第3生成手段と、
この第3生成手段により前記被写体切り抜き画像が生成される毎に、当該被写体切り抜き画像を表示部に順次表示させる表示制御手段と、を更に備えることを特徴とする請求項に記載の画像処理装置。
Third generation means for sequentially generating a subject cutout image obtained by cutting out the subject image from the subject existing image for display based on the alphamap each time the alphamap is corrected by the correction means;
3. The image processing apparatus according to claim 2 , further comprising: a display control unit configured to sequentially display the subject clipped image on the display unit each time the subject clipped image is generated by the third generation unit. .
前記特定手段は、前記被写体画像における操作部の所定操作に基づいて指定された領域を前記修正すべき領域として特定することを特徴とする請求項1に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the specifying unit specifies a region specified based on a predetermined operation of the operation unit in the subject image as the region to be corrected. 画像処理装置を用いた画像処理方法であって、
背景内に被写体が存在する被写体存在画像と前記背景内に前記被写体の存在しない被写体非存在画像との間で対応する各画素の差分情報に基づいて、前記被写体存在画像から被写体が含まれる被写体画像を抽出する処理と、
抽出された前記被写体画像の前記被写体存在画像における位置を示す所定階調のアルファマップを生成する処理と、
生成されたアルファマップに基づいて、所定軸方向のアルファ値のグラフを生成する処理と、
生成されたグラフにて、前記被写体画像であるか否かの判定に係る所定の閾値を設定する処理と、
設定された前記所定の閾値に基づいて、抽出された被写体画像における修正すべき領域を特定する処理と、
特定された修正すべき領域を、前記被写体存在画像における前記修正すべき領域と対応する領域に基づいて修正する処理と、
を備えたことを特徴とする画像処理方法。
An image processing method using an image processing apparatus,
Based on the corresponding differential information of each pixel with the non-existing object absence image of the subject on the subject-including image and the previous xenon in Jing the presence of an object in the background, include the subject from the subject existing image Processing to extract a subject image;
A process for generating an alpha map of a predetermined gradation indicating a position of the extracted subject image in the subject existing image;
Based on the generated alpha map, a process of generating a graph of alpha values in a predetermined axis direction,
A process of setting a predetermined threshold value for determining whether or not the image is the subject image in the generated graph;
Based on the set the predetermined threshold, the process of identify the region to be corrected in the extracted object image,
A process of correcting the identified area to be corrected based on an area corresponding to the area to be corrected in the subject existing image;
An image processing method comprising:
画像処理装置のコンピュータを、
背景内に被写体が存在する被写体存在画像と前記背景内に前記被写体の存在しない被写体非存在画像との間で対応する各画素の差分情報に基づいて、前記被写体存在画像から被写体が含まれる被写体画像を抽出する抽出手段、
前記抽出手段により抽出された前記被写体画像の前記被写体存在画像における位置を示す所定階調のアルファマップを生成する第1生成手段、
この第1生成手段により生成されたアルファマップに基づいて、所定軸方向のアルファ値のグラフを生成する第2生成手段、
この第2生成手段により生成されたグラフにて、前記被写体画像であるか否かの判定に係る所定の閾値を設定する設定手段、
この設定手段により設定された前記所定の閾値に基づいて、前記抽出手段により抽出された被写体画像における修正すべき領域を特定する特定手段、
この特定手段により特定された修正すべき領域を、前記被写体存在画像における前記修正すべき領域と対応する領域に基づいて修正する修正手段、
として機能させることを特徴とするプログラム。
The computer of the image processing device
Based on the corresponding differential information of each pixel with the non-existing object absence image of the subject on the subject-including image and the previous xenon in Jing the presence of an object in the background, include the subject from the subject existing image Extraction means for extracting a subject image;
First generation means for generating an alpha map of a predetermined gradation indicating a position of the subject image extracted by the extraction means in the subject existing image;
Second generation means for generating a graph of alpha values in a predetermined axial direction based on the alpha map generated by the first generation means;
Setting means for setting a predetermined threshold value for determining whether or not the image is the subject image in the graph generated by the second generation means;
Based on the predetermined threshold set by the setting means, identification means for identify the area to be corrected in the subject image extracted by the extraction means,
Correction means for correcting the area to be corrected specified by the specifying means based on an area corresponding to the area to be corrected in the subject existing image;
A program characterized by functioning as
JP2010203865A 2010-09-13 2010-09-13 Image processing apparatus, image processing method, and program Active JP5565227B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010203865A JP5565227B2 (en) 2010-09-13 2010-09-13 Image processing apparatus, image processing method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010203865A JP5565227B2 (en) 2010-09-13 2010-09-13 Image processing apparatus, image processing method, and program

Publications (2)

Publication Number Publication Date
JP2012059158A JP2012059158A (en) 2012-03-22
JP5565227B2 true JP5565227B2 (en) 2014-08-06

Family

ID=46056151

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010203865A Active JP5565227B2 (en) 2010-09-13 2010-09-13 Image processing apparatus, image processing method, and program

Country Status (1)

Country Link
JP (1) JP5565227B2 (en)

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08241394A (en) * 1995-03-03 1996-09-17 Toppan Printing Co Ltd Image clipping device
JP3679512B2 (en) * 1996-07-05 2005-08-03 キヤノン株式会社 Image extraction apparatus and method
JP2008116459A (en) * 1999-10-22 2008-05-22 Toshiba Corp Method of extracting contour of image, method of extracting object from image, and image transmission system using method of extracting object
JP3411971B2 (en) * 2001-02-14 2003-06-03 三菱電機株式会社 Human image extraction device
JP2004038746A (en) * 2002-07-05 2004-02-05 Toshiba Corp Image editing method and image editing system
JP5025950B2 (en) * 2005-12-12 2012-09-12 任天堂株式会社 Information processing program, information processing apparatus, information processing system, and information processing method
JP2008278448A (en) * 2007-04-02 2008-11-13 Nikon Corp Imaging apparatus
JP4760973B2 (en) * 2008-12-16 2011-08-31 カシオ計算機株式会社 Imaging apparatus and image processing method

Also Published As

Publication number Publication date
JP2012059158A (en) 2012-03-22

Similar Documents

Publication Publication Date Title
JP5105550B2 (en) Image composition apparatus and program
JP5051156B2 (en) Image processing apparatus and program
JP4760973B2 (en) Imaging apparatus and image processing method
JP4798236B2 (en) Imaging apparatus, image processing method, and program
JP4947136B2 (en) Image processing apparatus, image processing method, and program
JP5504990B2 (en) Imaging apparatus, image processing apparatus, and program
JP5267279B2 (en) Image composition apparatus and program
JP5402166B2 (en) Image composition apparatus and program
JP2011066827A (en) Image processing apparatus, image processing method and program
JP5402148B2 (en) Image composition apparatus, image composition method, and program
JP5493839B2 (en) Imaging apparatus, image composition method, and program
JP5131399B2 (en) Image processing apparatus, image processing method, and program
JP5636660B2 (en) Image processing apparatus, image processing method, and program
JP5565227B2 (en) Image processing apparatus, image processing method, and program
JP2011182014A (en) Image pickup device, image processing method and program
JP2011041041A (en) Imaging apparatus, imaging method and program
JP2011003057A (en) Image composition device, image specifying method, image composition method, and program
JP5494537B2 (en) Image processing apparatus and program
JP2010278701A (en) Image combining device, and image combining method and program
JP5381207B2 (en) Image composition apparatus and program
JP2011077820A (en) Image synthesis device and method, and program
JP5310361B2 (en) Imaging apparatus, image processing method, and program
JP5402361B2 (en) Imaging apparatus, image processing method, and program
JP4803319B2 (en) Imaging apparatus, image processing method, and program
JP2011175663A (en) Imaging device, image processing method, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130510

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20131205

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20131217

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140116

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140602

R150 Certificate of patent or registration of utility model

Ref document number: 5565227

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150