JP2006166226A - Digital camera, image processing method and program, and image processing system - Google Patents
Digital camera, image processing method and program, and image processing system Download PDFInfo
- Publication number
- JP2006166226A JP2006166226A JP2004356802A JP2004356802A JP2006166226A JP 2006166226 A JP2006166226 A JP 2006166226A JP 2004356802 A JP2004356802 A JP 2004356802A JP 2004356802 A JP2004356802 A JP 2004356802A JP 2006166226 A JP2006166226 A JP 2006166226A
- Authority
- JP
- Japan
- Prior art keywords
- digital image
- area
- region
- image
- digital
- 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.)
- Withdrawn
Links
Images
Landscapes
- Studio Devices (AREA)
Abstract
Description
本発明は、ディジタルカメラ、画像処理方法及びプログラム、並びに画像処理システムに関する。 The present invention relates to a digital camera, an image processing method and program, and an image processing system.
ディジタルカメラは、フィルムカメラのフィルムの感光部に比べてイメージセンサの感光部の面積が小さいため、フィルムカメラに比べて焦点距離が短いレンズを用いて被写体を撮像する。焦点距離が短いレンズを用いたディジタルカメラでは、奥行きのあるシーンを撮像して生成したディジタル画像でも、焦点の合っていない領域と焦点の合っている領域との鮮鋭度の差が小さくなる。 Since the area of the photosensitive part of the image sensor is smaller than the photosensitive part of the film of the film of the digital camera, the digital camera images the subject using a lens having a shorter focal length than that of the film camera. In a digital camera using a lens with a short focal length, even in a digital image generated by imaging a deep scene, the difference in sharpness between an out-of-focus area and an in-focus area is small.
特許文献1には、ディジタルカメラによって奥行きを強調したディジタル画像を生成する方法が開示されている。特許文献1に開示された方法では、画角内を複数の領域に分割し、各領域毎に被写体までの距離を測定してディジタル画像を生成し、その後、注目領域までの距離と各領域までの距離との差に応じてディジタル画像の各領域をぼかすことにより、奥行きを強調する。
しかし、あるシーンを表すディジタル画像に基づいてそのディジタル画像を領域分割するのではなく、被写体までの距離を個別に測定される小領域に対応してディジタル画像を規則的に分割し、そのように分割された領域毎にぼけの程度を設定すると、規則的な形状の各領域の境界で鮮鋭度が不自然に変化するため、ぼけ方がブロック状になるという問題がある。 However, instead of segmenting the digital image based on a digital image representing a scene, the digital image is regularly segmented according to a small region in which the distance to the subject is individually measured. If the degree of blur is set for each of the divided areas, the sharpness changes unnaturally at the boundaries between the regular shaped areas, and there is a problem that the blur becomes a block shape.
また、ディジタル画像から特定の被写体を抽出する処理は、画像の合成処理などの前処理として頻繁に行われる。従来の画像処理アプリケーションプログラムでは、複数のパラメータをディジタル画像の特性に応じて試行錯誤を繰り返しながらきめ細かく設定する必要があったため、ディジタル画像から特定の被写体を抽出する処理をコンピュータに行わせる作業は難易度の高い作業であった。 Also, the process of extracting a specific subject from a digital image is frequently performed as a pre-process such as an image synthesis process. In the conventional image processing application program, it is necessary to set a plurality of parameters in detail by repeating trial and error according to the characteristics of the digital image. Therefore, it is difficult to cause the computer to perform processing for extracting a specific subject from the digital image. It was a high degree of work.
本発明は、かかる事情に鑑みて創作されたものであって、ディジタル画像から特定の被写体を抽出する作業を容易にするとともに、より確実に被写体を抽出することを可能にするディジタルカメラ、画像処理方法、及びプログラムを提供することを目的とする。
また、本発明の別の目的は、ディジタル画像から特定の被写体を抽出する作業が容易であるとともに、より確実に被写体を抽出する画像処理システムを提供することにある。
The present invention was created in view of such circumstances, and facilitates the work of extracting a specific subject from a digital image, and enables a more reliable extraction of the subject, a digital camera, and image processing It is an object to provide a method and a program.
Another object of the present invention is to provide an image processing system that can easily extract a specific subject from a digital image and can extract the subject more reliably.
上記目的を達成するため、本発明に係るディジタルカメラは、シーンを撮像してディジタル画像を生成する手段であって、同一シーンについて注目領域に焦点が合っている第一ディジタル画像と前記注目領域から焦点が外れている第二ディジタル画像とを生成する撮像手段と、前記第一ディジタル画像と前記第二ディジタル画像との鮮鋭度の差に基づいて前記第一ディジタル画像の前記注目領域に対応する第一領域を特定する領域特定手段と、前記第一ディジタル画像全体の面積と前記第一領域の面積とに基づいて領域特定の成否を判定する判定手段と、を備える。 In order to achieve the above object, a digital camera according to the present invention is a means for capturing a scene and generating a digital image from the first digital image focused on the region of interest for the same scene and the region of interest. Imaging means for generating a second digital image that is out of focus; and a first corresponding to the region of interest of the first digital image based on a sharpness difference between the first digital image and the second digital image. Region specifying means for specifying one region, and determination means for determining success or failure of region specification based on the area of the entire first digital image and the area of the first region.
注目領域に焦点を合わせて撮像すると、その結果生成されるディジタル画像では、注目領域に対応する領域(第一領域)で鮮鋭度が高くなり、それ以外の領域(第二領域)で鮮鋭度が低くなる。また、ディジタルカメラで被写体までの距離とは無関係な特定の距離に焦点を合わせて撮像すると、偶然焦点が合った領域を除いてディジタル画像は全体に鮮鋭度が低くなる。したがって、注目領域に焦点を合わせて撮像することにより生成した第一ディジタル画像と、注目領域から焦点を外して撮像することにより生成した第二ディジタル画像とを比較すると、注目領域に対応する第一領域では鮮鋭度の差が大きく、非注目領域に対応する第二領域では鮮鋭度の差が小さくなる傾向がある。この特性は撮像するシーンによらず単純で普遍的であるため、この特性をアルゴリズムに利用すると、ディジタル画像から特定の対象物を抽出する処理に用いるパラメータの設定を簡素化できる。このディジタルカメラによると、第一ディジタル画像と第二ディジタル画像とを生成するため、当該ディジタルカメラあるいは他の装置においてディジタル画像から特定の被写体を抽出する作業が容易になる。 When an image is focused on the region of interest, the resulting digital image has high sharpness in the region corresponding to the region of interest (first region) and sharpness in the other region (second region). Lower. In addition, when the digital camera is used to focus on a specific distance unrelated to the distance to the subject, the overall sharpness of the digital image is reduced except for the area that is accidentally focused. Therefore, when the first digital image generated by capturing an image with the focus on the attention area is compared with the second digital image generated by capturing the image with the focus off the attention area, the first digital image corresponding to the attention area is compared. The sharpness difference tends to be large in the region, and the sharpness difference tends to be small in the second region corresponding to the non-target region. Since this characteristic is simple and universal regardless of the scene to be imaged, the use of this characteristic in an algorithm can simplify the setting of parameters used for processing for extracting a specific object from a digital image. According to this digital camera, since the first digital image and the second digital image are generated, it is easy to extract a specific subject from the digital image in the digital camera or another device.
また、一般に注目領域はディジタル画像全体に対してある程度の面積を占めることが多い。逆にいうと、注目領域として特定された領域がディジタル画像全体に占める割合が所定の範囲外であれば、領域の特定に失敗している可能性が高い。この特性を利用すると、注目領域に対応する領域の面積とディジタル画像全体の面積とに基づいて領域特定の成否を判定することができる。この判定をディジタルカメラで行えば、領域特定に失敗することを撮像現場で知ることができる。撮像現場で知ることができれば容易に撮像し直すことができるため、失敗した場合はその場で撮像し直すことにより、領域特定に成功する第一ディジタル画像及び第二ディジタル画像をより確実に得ることができる。従って、より確実に被写体を抽出することが可能になる。 In general, the region of interest often occupies a certain area with respect to the entire digital image. In other words, if the ratio of the area specified as the attention area to the entire digital image is outside the predetermined range, there is a high possibility that the area specification has failed. If this characteristic is used, the success or failure of the region specification can be determined based on the area of the region corresponding to the region of interest and the area of the entire digital image. If this determination is performed with a digital camera, it is possible to know at the imaging site that the region specification has failed. Since it can be easily re-captured if it can be known at the imaging site, if it fails, the first digital image and the second digital image that succeed in specifying the region can be obtained more reliably by re-imaging on the spot. Can do. Therefore, the subject can be extracted more reliably.
さらに本発明に係るディジタルカメラでは、前記判定手段は、前記第一ディジタル画像全体の面積と前記第一領域が内接する矩形領域の面積との比、及び前記矩形領域の面積と前記第一領域の面積との比に基づいて領域特定の成否を判定する。一般に注目領域が蛇行した細長い領域である確率は相当低い。このディジタルカメラによると、そうした細長い領域が注目領域に対応する領域として特定され、その結果領域特定に成功したと誤判定されてしまうことを低減できる。 Further, in the digital camera according to the present invention, the determination means includes a ratio of the area of the entire first digital image and the area of the rectangular area inscribed by the first area, and the area of the rectangular area and the area of the first area. The success or failure of region identification is determined based on the ratio with the area. In general, the probability that the region of interest is a meandering elongated region is quite low. According to this digital camera, it is possible to reduce the fact that such a long and narrow area is specified as an area corresponding to the attention area, and as a result, it is erroneously determined that the area has been specified.
さらに本発明に係るディジタルカメラでは、前記撮像手段は、前記第二ディジタル画像を調整範囲の限界近傍に焦点を設定して撮像することにより生成する。調整範囲の限界近傍に焦点を設定して注目領域に焦点が合う可能性は低いため、画一的な処理によって高い確率で注目領域に焦点が合っていない第二ディジタル画像を生成することができる。 Furthermore, in the digital camera according to the present invention, the imaging means generates the second digital image by setting the focal point in the vicinity of the limit of the adjustment range. Since it is unlikely to focus on the attention area by setting the focus near the limit of the adjustment range, it is possible to generate a second digital image that is not focused on the attention area with high probability by uniform processing. .
上記目的を達成するため、本発明に係る画像処理方法は、ディジタルカメラにおける画像処理方法であって、シーンを撮像してディジタル画像を生成する段階であって同一シーンについて注目領域に焦点が合っている第一ディジタル画像と前記注目領域から焦点が外れている第二ディジタル画像とを生成する撮像段階と、前記第一ディジタル画像と前記第二ディジタル画像との鮮鋭度の差に基づいて前記第一ディジタル画像の前記注目領域に対応する第一領域を特定する領域特定段階と、前記第一ディジタル画像全体の面積と前記第一領域の面積とに基づいて領域特定の成否を判定する判定段階と、を含む。この画像処理方法によると、当該ディジタルカメラあるいは他の装置においてディジタル画像から特定の被写体を抽出する作業が容易になるとともに、より確実に被写体を抽出することが可能になる。 In order to achieve the above object, an image processing method according to the present invention is an image processing method in a digital camera, in which a scene is captured and a digital image is generated, and the region of interest is focused on the same scene. An imaging stage for generating a first digital image that is present and a second digital image that is out of focus from the region of interest; and the first digital image based on the sharpness difference between the first digital image and the second digital image. A region identifying step for identifying a first region corresponding to the region of interest in the digital image; a determination step for determining success or failure of region identification based on an area of the entire first digital image and an area of the first region; including. According to this image processing method, it is possible to easily extract a specific subject from a digital image in the digital camera or another apparatus, and it is possible to more reliably extract a subject.
上記目的を達成するため、本発明に係る画像処理プログラムは、シーンを撮像してディジタル画像を生成する手段であって、同一シーンについて注目領域に焦点が合っている第一ディジタル画像と前記注目領域から焦点が外れている第二ディジタル画像とを生成する撮像手段と、前記第一ディジタル画像と前記第二ディジタル画像との鮮鋭度の差に基づいて前記第一ディジタル画像の前記注目領域に対応する第一領域を特定する領域特定手段と、前記第一ディジタル画像全体の面積と前記第一領域の面積とに基づいて領域特定の成否を判定する判定手段としてディジタルカメラを機能させる。この画像処理プログラムによると、当該ディジタルカメラあるいは他の装置においてディジタル画像から特定の被写体を抽出する作業が容易になるとともに、より確実に被写体を抽出することが可能になる。 In order to achieve the above object, an image processing program according to the present invention is a means for capturing a scene and generating a digital image, the first digital image focusing on the attention area for the same scene and the attention area Imaging means for generating a second digital image out of focus with respect to the region of interest of the first digital image based on a sharpness difference between the first digital image and the second digital image The digital camera is caused to function as area specifying means for specifying the first area, and determination means for determining success or failure of area specification based on the area of the entire first digital image and the area of the first area. According to this image processing program, it is possible to easily extract a specific subject from a digital image in the digital camera or another apparatus, and it is possible to extract the subject more reliably.
上記目的を達成するため、本発明に係る画像処理システムは、シーンを撮像してディジタル画像を生成する手段であって、同一シーンについて注目領域に焦点が合っている第一ディジタル画像と前記注目領域から焦点が外れている第二ディジタル画像とを生成する撮像手段と、前記第一ディジタル画像と前記第二ディジタル画像との鮮鋭度の差に基づいて前記第一ディジタル画像の前記注目領域に対応する第一領域を特定する領域特定手段と、前記第一ディジタル画像全体の面積と前記第一領域の面積とに基づいて領域特定の成否を判定する判定手段と、前記判定手段で成功と判定されると、前記領域特定手段で特定された前記第一領域に基づいて前記第一ディジタル画像の前記第一領域以外の第二領域の画素値を均一にする均一手段と、を備える。この画像処理システムによると、ディジタル画像から特定の被写体を抽出する作業が容易であるとともに、より確実に被写体を抽出できる。また、第二領域の画素値を均一にすることにより、事後的に、第一ディジタル画像の第一領域を第二ディジタル画像又は他のディジタル画像に合成することが容易になる。 In order to achieve the above object, an image processing system according to the present invention is a means for capturing a scene and generating a digital image, wherein the first digital image in which the region of interest is focused on the same scene and the region of interest Imaging means for generating a second digital image out of focus with respect to the region of interest of the first digital image based on a sharpness difference between the first digital image and the second digital image A region identifying unit that identifies the first region, a determination unit that determines success or failure of the region identification based on the area of the entire first digital image and the area of the first region, and the determination unit determines success. And uniform means for making the pixel values of the second region other than the first region of the first digital image uniform based on the first region specified by the region specifying means, Obtain. According to this image processing system, it is easy to extract a specific subject from a digital image, and the subject can be extracted more reliably. Further, by making the pixel values of the second region uniform, it becomes easy to synthesize the first region of the first digital image with the second digital image or another digital image afterwards.
上記目的を達成するため、本発明に係る画像処理システムは、シーンを撮像してディジタル画像を生成する手段であって、同一シーンについて注目領域に焦点が合っている第一ディジタル画像と前記注目領域から焦点が外れている第二ディジタル画像とを生成する撮像手段と、前記第一ディジタル画像と前記第二ディジタル画像との鮮鋭度の差に基づいて前記第一ディジタル画像の前記注目領域に対応する第一領域を特定する領域特定手段と、前記第一ディジタル画像全体の面積と前記第一領域の面積とに基づいて領域特定の成否を判定する判定手段と、前記判定手段で成功と判定されると、前記領域特定手段で特定された前記第一領域に基づいて前記第一ディジタル画像の前記第一領域以外の第二領域を透明にする透明手段と、前記透明手段で前記第二領域を透明にした前記第一ディジタル画像を前記第二ディジタル画像又は他のディジタル画像の上に重畳合成する手段と、を備える。この画像処理システムによると、ディジタル画像から特定の被写体を抽出する作業が容易であるとともに、より確実に被写体を抽出できる。また、注目領域だけを重畳合成した第二ディジタル画像、又は注目領域だけを重畳合成した他のディジタル画像を得ることができる。 In order to achieve the above object, an image processing system according to the present invention is a means for capturing a scene and generating a digital image, wherein the first digital image in which the region of interest is focused on the same scene and the region of interest Imaging means for generating a second digital image out of focus with respect to the region of interest of the first digital image based on a sharpness difference between the first digital image and the second digital image A region identifying unit that identifies the first region, a determination unit that determines success or failure of the region identification based on the area of the entire first digital image and the area of the first region, and the determination unit determines success. Transparent means for making the second area other than the first area of the first digital image transparent based on the first area specified by the area specifying means, and the transparent hand In and means for superimposing synthesis over the first digital image transparent said second region said second digital image, or other digital images. According to this image processing system, it is easy to extract a specific subject from a digital image, and the subject can be extracted more reliably. Further, it is possible to obtain a second digital image in which only the region of interest is superimposed and synthesized, or another digital image in which only the region of interest is superimposed and synthesized.
尚、本発明に備わる複数の手段の各機能は、構成自体で機能が特定されるハードウェア資源、プログラムにより機能が特定されるハードウェア資源、又はそれらの組み合わせにより実現される。また、これら複数の手段の各機能は、各々が物理的に互いに独立したハードウェア資源で実現されるものに限定されない。
また、請求項に記載された方法の各動作の順序は、技術上の阻害要因がない限り、記載順に限定されるものではなく、どのような順番で実行されてもよく、また同時に実行されてもよい。
The functions of the plurality of means provided in the present invention are realized by hardware resources whose functions are specified by the configuration itself, hardware resources whose functions are specified by a program, or a combination thereof. The functions of the plurality of means are not limited to those realized by hardware resources that are physically independent of each other.
In addition, the order of each operation of the method described in the claims is not limited to the order of description unless there is a technical impediment, and may be executed in any order, and may be executed simultaneously. Also good.
以下、本発明を実施するための最良の形態を実施例に基づいて説明する。
(画像処理システムの構成)
図2は、本発明の一実施例に係る画像処理システム1の構成を示す模式図である。本発明の一実施例に係る画像処理システムは、ディジタルスチルカメラ(DSC)2と画像処理装置としてのパーソナルコンピュータ(PC)3とで構成される。なお、画像処理装置はディジタル画像を入力するためのインタフェースを備えディジタル画像を単独で印刷可能なプリンタ4などでもよい。
Hereinafter, the best mode for carrying out the present invention will be described based on examples.
(Configuration of image processing system)
FIG. 2 is a schematic diagram showing the configuration of the
1.DSC
図3は、本発明の一実施例に係るDSC2のブロック図である。
レンズ11は、所定距離離れた被写体の鮮鋭な画像がイメージセンサ12の受光面に結像するように電動アクチュエータを駆動源とするレンズ駆動部13によって駆動される。
1. DSC
FIG. 3 is a block diagram of the
The
シャッタ14は、電動アクチュエータを駆動源とするシャッタ駆動部15によって駆動される。
イメージセンサ12は、2次元空間に離散的に配置された受光セルとCCD(Charge Coupled Device)等の電荷転送素子とを備えたエリアイメージセンサである。イメージセンサ12は、センサ駆動部16によって駆動される。イメージセンサ12は、光電変換により得られる電荷を受光セル毎に蓄積し、受光セル毎の受光量に応じた電気信号を出力する。受光面にC(Cyan)、M(Magenta)、Y(Yellow)及びG(Green)の4色の補色フィルタ、又はR(Red)、G(Green)及びB(Blue)の原色フィルタを設けることによりカラー画像を形成することが可能になる。
The
The
アナログディジタル変換器(ADC)17は、イメージセンサ12から出力されるアナログ電気信号を量子化してディジタル信号に変換する。具体的には例えば、ADC17は、電気信号に含まれる雑音の低減処理、ゲイン及びオフセットの調整による電気信号のレベル調整処理、量子化処理等を行う。
ディジタル画像処理部18は、ADC17から出力されたディジタル信号に対し、画像形成処理、ホワイトバランス補正、ガンマ補正、色空間変換等を施し、各画素についてR、G、Bの階調値や、Y、Cb、Crの階調値などを表すディジタル画像を出力する。尚、ここでいう画像形成処理とは、受光セルから出力された一色分の階調値を近傍の受光セルの異なる色の階調値で補間することにより画素毎にRGB又はYCbCrの3つの階調値を持つディジタル画像を出力する処理である。
The analog-digital converter (ADC) 17 quantizes the analog electric signal output from the
The digital
圧縮・伸張部19は、ディジタル画像を圧縮又は伸張する。具体的には、ディジタル画像の系列変換及びエントロピー符号化を行うことによりディジタル画像を圧縮し、それらの逆変換を施すことによりディジタル画像を伸張する。具体的には例えば離散コサイン変換、量子化、ランレングス符号化及びハフマン符号化を用いてディジタル画像を圧縮する。量子化に用いる量子化テーブルを変更することによって量子化ステップ幅を変更すると、圧縮率を変更することができる。
The compression /
リムーバブルメモリインタフェース20は、リムーバブルメモリ21を脱着自在に接続可能であって、圧縮・伸張部19によって圧縮されたディジタル画像をリムーバブルメモリ21に格納する。また、圧縮・伸張部19によって伸張されるディジタル画像は、リムーバブルメモリインタフェース20によってリムーバブルメモリ21から読み出される。DSC2から画像処理装置に画像を伝送する媒体としては、リムーバブルメモリ21の他に各種の電気通信回線を用いてもよい。
The
ワークメモリ22は、ディジタル画像処理部18及び圧縮・伸張部19で処理されるデータを一時的に格納するためのメモリである。
表示部25は、LCD(Liquid Crystal Display)、LCDを制御するディスプレイコントローラなどを備える。表示部25は制御部23によって制御され、撮像モードでは電子ビューファインダとして機能し、再生モードではリムーバブルメモリ21から読み出したディジタル画像を表示するモニタとして機能する。この他、表示部25は種々の設定を行うための各種のメニューやメッセージなどを表示する。
The work memory 22 is a memory for temporarily storing data processed by the digital
The
制御部23は、図示しないCPU、ROM、RAM及びインタフェース回路を備える。制御部23はROMに記憶されているコンピュータプログラムを実行することにより、DSC2の全体を制御する。また、制御部23はROMに記憶されている画像処理プログラムを実行することにより、撮像手段、領域特定手段及び判定手段としても機能する。ROMに記憶する各種のプログラムやデータは所定のサーバからネットワークを介してダウンロードして記憶してもよいし、リムーバブルメモリ21等のコンピュータ読み取り可能な記憶媒体から読み出して記憶してもよい。また、第一ディジタル画像と第二ディジタル画像とをDSC2内で処理を行い別のデータとして収納してもよい。他にも画像処理装置を持ったプリンタ側に第一ディジタル画像と第二ディジタル画像とを送り、プリンタ内で処理を行うことも可能である。
The
レンズ11、イメージセンサ12、シャッタ14、ADC17、ディジタル画像処理部18及び制御部23は、特許請求の範囲に記載の「撮像手段」に相当する。また、制御部23は、特許請求の範囲に記載の「領域特定手段」及び「判定手段」に相当する。
2.画像処理装置
The
2. Image processing device
図4は、PC3のハードウェア構成を示すブロック図である。
PC3は、CPU31、ROM32、RAM33、入力装置34、表示装置35、及び外部記憶装置36を備え、これらはバスで相互に接続されている。CPU31はROM32や外部記憶装置36に記憶されたプログラムを実行してPC3の全体を制御する。ROM32は各種のプログラムやデータを予め記憶しているメモリである。外部記憶装置36はハードディスクなどで構成され、オペレーティングシステム(OS)、各種のプログラムなどを記憶する。外部記憶装置36に記憶する各種のプログラムは、所定のサーバからネットワークを介してダウンロードして入力してもよいし、リムーバブルメモリ21等のコンピュータ読み取り可能な記憶媒体から読み出して入力してもよい。RAM33は各種のプログラムやデータを一時的に記憶するメモリである。入力装置34はマウス、キーボード、リムーバブルメモリインタフェース20、通信インタフェースなどで構成され、DSC2で生成された画像を入力するために用いられる。表示装置35はCRTやLCDなどで構成されている。
FIG. 4 is a block diagram illustrating a hardware configuration of the
The
(画像処理方法)
図1は、画像処理システム1の処理全体の流れを示すフローチャートである。図中のS10〜S50はDSC2による処理であり、S60〜S80はPC3による処理である。
S10では、DSC2により、注目領域に焦点を合わせた状態と注目領域から故意に焦点を外した状態で同一シーンを連続撮像し、それぞれの状態に対応した2つの画像を生成する。注目領域に焦点を合わせた状態で撮像して生成する画像が第一ディジタル画像であり、注目領域から焦点を外した状態で撮像して生成する画像が第二ディジタル画像である。尚、いずれの画像を先に生成してもよい。
(Image processing method)
FIG. 1 is a flowchart showing the overall processing flow of the
In S10, the
S20では、第一ディジタル画像と第二ディジタル画像との鮮鋭度の差を表す差分画像を生成する。
S30では、差分画像に基づいて第一ディジタル画像の注目領域に対応する第一領域を特定し、第一領域の面積と第一ディジタル画像全体の面積とに基づいて領域特定の成否を判定する。失敗と判定した場合はS40に進み、成功と判定した場合はS50に進む。
In S20, a difference image representing a difference in sharpness between the first digital image and the second digital image is generated.
In S30, the first area corresponding to the attention area of the first digital image is specified based on the difference image, and the success or failure of the area specification is determined based on the area of the first area and the area of the entire first digital image. If it is determined to be unsuccessful, the process proceeds to S40, and if it is determined to be successful, the process proceeds to S50.
S40では、失敗を通知する。具体的には例えば領域特定に失敗した旨のメッセージをLCDに表示する。ユーザは領域特定に失敗したことを撮像現場で即時に知ることができるため、その場で再撮像を行うことができる。
S50では、第一ディジタル画像、第二ディジタル画像、及び第一領域を構成する画素を特定するための情報を互いに関連付けてPC3に入力するため、DSC2で第一ディジタル画像、第二ディジタル画像、及び第一領域を構成する画素を特定するための情報を互いに関連付けてリムーバブルメモリ21、通信回線等に出力する。ここで「第一領域を構成する画素を特定するための情報」は、特定された第一領域に応じて生成される情報である。DSC2は領域特定に成功すると特定した第一領域に応じて当該情報を生成する。尚、第一ディジタル画像及び第二ディジタル画像は、例えばモデムを介してインターネット等の電気通信回線に送出してもよいし、例えばUSBケーブル、ブルートゥース等を介して直接PC3に入力してもよい。
In S40, the failure is notified. Specifically, for example, a message indicating that the area specification has failed is displayed on the LCD. Since the user can immediately know at the imaging site that the area specification has failed, the user can perform re-imaging on the spot.
In S50, the first digital image, the second digital image, and information for specifying the pixels constituting the first region are input to the
S60では、互いに関連付けられた第一ディジタル画像、第二ディジタル画像及び第一領域を構成する画素を特定するための情報をリムーバブルメモリ21、通信回線等を介してPC3に入力する。尚、DSC2とPC3とを直接接続し、第一ディジタル画像と第二ディジタル画像とを互いに関連付けてDSC2からPC3に直接入力してもよい。
In S60, the first digital image, the second digital image, and information for specifying the pixels constituting the first region are input to the
S70では、PC3で実行する画像処理プログラムにより、重畳合成処理の前処理として、第一領域を構成する画素を特定するための情報に基づいて第一領域以外の領域(第二領域)を透明にする。具体的には例えば、第一ディジタル画像の第二領域の画素値を0にした画像を生成する。
S80では、第二領域が透明化された第一ディジタル画像と他のディジタル画像とを重畳合成する。具体的には例えば、第二ディジタル画像の上に第一ディジタル画像を重畳合成すると、第一領域が鮮鋭で、第二領域がぼけた画像を生成することができる。このような合成画像では、第二領域の鮮鋭度が第一ディジタル画像より低くなるため、画像の奥行きを強調することができる。尚、第一ディジタル画像をそれと無関係な画像の上に重畳合成してもよい。また、第一ディジタル画像、第二ディジタル画像のいずれか一方又は両方を加工した後に2つの画像を合成してもよい。例えば、第一ディジタル画像と、平滑化フィルタを施してさらにぼかした(鮮鋭度を小さくした)第二ディジタル画像とを合成することにより、より一層画像の奥行きを強調することができる。
In S70, the image processing program executed on the
In S80, the first digital image in which the second region is made transparent and another digital image are superimposed and synthesized. Specifically, for example, when the first digital image is superimposed and synthesized on the second digital image, an image in which the first area is sharp and the second area is blurred can be generated. In such a composite image, since the sharpness of the second region is lower than that of the first digital image, the depth of the image can be emphasized. Note that the first digital image may be superimposed and synthesized on an unrelated image. Alternatively, the two images may be combined after processing one or both of the first digital image and the second digital image. For example, the depth of the image can be further enhanced by synthesizing the first digital image and the second digital image that is further blurred (having a reduced sharpness) by applying a smoothing filter.
2.DSCによる処理の詳細
DSC2による処理のうち、S10、S20及びS30の処理の詳細について説明する。
始めに、S10の処理の詳細について図3に基づいて説明する。
シャッタボタン24が押されると、制御部23は、シャッタ駆動部15、レンズ駆動部13、センサ駆動部16、ディジタル画像処理部18、ワークメモリ22等を例えば次のように制御して第一ディジタル画像及び第二ディジタル画像を生成する。すなわち、シャッタボタン24が押されると、焦点を調整範囲の限界またはその近傍に設定した状態でシャッタ14を所定時間開放し、シャッタ14の開放中にイメージセンサ12に蓄積された電荷を読み出してADC17に入力し、ADC17から出力されるディジタル信号をディジタル画像処理部18で処理して第二ディジタル画像を生成する。次に、被写体の注目領域に焦点を合わせた状態で再度シャッタ14を所定時間開放し、シャッタ14の開放中にイメージセンサ12に蓄積された電荷を読み出してADC17に入力し、ADC17から出力されるディジタル信号をディジタル画像処理部18で処理して第一ディジタル画像を生成する。第一ディジタル画像と第二ディジタル画像を撮像する間隔は短ければ短い程良い。被写体の注目領域に焦点を合わせる処理は、例えば画像の注目領域に対応する領域の高周波成分が最大になるようにレンズ駆動部13をフィードバック制御することによって行う。尚、本実施例では、シャッタ14を所定時間開放することによりイメージセンサ12に電荷を蓄積し、イメージセンサ12に蓄積された電荷から画像を生成することを撮像というものとする。
2. Details of Processing by DSC Among the processing by DSC2, details of the processing of S10, S20, and S30 will be described.
First, details of the process of S10 will be described with reference to FIG.
When the
第二ディジタル画像を先に生成する場合、予め調整範囲の限界またはその近傍に焦点を合わせておくことにより、シャッタボタン24が押された直後に第二ディジタル画像を生成することができ、さらに、その後に一方向に向かって焦点を調整することができるため、シャッタボタン24が押されてから第一ディジタル画像及び第二ディジタル画像を撮像するまでの期間を短縮することができる。レンズ11から最短距離に焦点を合わせた場合も、レンズ11から最長距離に焦点を合わせた場合も、そのような操作によって人物等の注目領域に焦点が合う確率は低い。したがって、焦点を調整範囲の限界またはその近傍に設定した状態で撮像して第二ディジタル画像を生成することにより、注目領域に対応する第一領域とそれ以外の第二領域とに第一ディジタル画像を分割する精度の低下を抑制しつつ、第二ディジタル画像を生成する処理を簡素化することができる。尚、第二ディジタル画像を撮像するとき、レンズ11から最短距離に焦点を合わせてもよいし、レンズ11から最長距離に焦点を合わせてもよい。
When the second digital image is generated first, the second digital image can be generated immediately after the
尚、被写体の注目領域に焦点を合わせた状態で撮像することにより第一ディジタル画像を生成した後に、レンズ11を所定量移動させることにより被写体の注目領域から焦点を外し、その状態で被写体を撮像することにより第二ディジタル画像を生成してもよい。第一ディジタル画像を先に生成する場合、注目領域から焦点を確実に外した状態で第二ディジタル画像を生成することができる。また、第一ディジタル画像を先に生成する場合、手動で注目領域に焦点を合わせてから、第一ディジタル画像と第二ディジタル画像を連続的に生成することが可能になる。
In addition, after the first digital image is generated by imaging in a state in which the subject's attention area is focused, the
また、第一ディジタル画像と第二ディジタル画像の同一領域の鮮鋭度の差が、注目領域で大きく、注目していない領域(注目外領域)で小さくなるように、撮像するシーンに応じて調整範囲の近距離側限界又は遠距離側限界のいずれかに焦点を合わせて第二ディジタル画像を生成してもよい。また、調整範囲の近距離側限界に焦点を合わせたものと遠距離側限界に焦点を合わせたものとの両方を第二ディジタル画像としてもよい。 In addition, the adjustment range according to the scene to be imaged so that the sharpness difference between the same area of the first digital image and the second digital image is large in the attention area and small in the unfocused area (non-notice area). The second digital image may be generated with a focus on either the near side limit or the far side limit. Also, both the image focused on the short distance limit and the image focused on the far distance limit may be used as the second digital image.
制御部23は、圧縮・伸張部19を制御して第一ディジタル画像及び第二ディジタル画像をそれぞれ圧縮し、圧縮された状態の第一ディジタル画像及び第二ディジタル画像を互いに関連付けてリムーバブルメモリ21に格納する。第一ディジタル画像及び第二ディジタル画像をそれぞれ別個独立のファイルとしてリムーバブルメモリ21に格納し、いずれか一方のファイルに他方のファイルへのパスを記録してもよいし、第一ディジタル画像及び第二ディジタル画像を1つのファイルにまとめてリムーバブルメモリ21に格納してもよい。
The
次に、図1に示すS20の処理の詳細について説明する。
図5は、S20の詳細を示すフローチャートである。
S205では、第一ディジタル画像の画素を例えば1つおきに間引いて縦横2分の1の縮小画像を生成する。以降の説明において第一ディジタル画像とは第一ディジタル画像の縮小画像のことをいう。
Next, details of the process of S20 shown in FIG. 1 will be described.
FIG. 5 is a flowchart showing details of S20.
In S205, every other pixel of the first digital image is thinned out, for example, to generate a reduced image of 1/2 in the vertical and horizontal directions. In the following description, the first digital image refers to a reduced image of the first digital image.
S210では、同様に第二ディジタル画像の縮小画像を生成する。以降の説明において第二ディジタル画像とは第二ディジタル画像の縮小画像のことをいう。
S215では、第一ディジタル画像の輝度のエッジを表す第一エッジ画像を生成する。ここで輝度とは、第一ディジタル画像がYCbCr色空間で表されているとすると、Y(輝度)成分の値のことをいう。第一ディジタル画像がRGB色空間で表されている場合は、RGB値から公知の変換式を用いて輝度値を求めることができる。第一エッジ画像の生成は例えばエッジ検出オペレータを用いて行う。第一ディジタル画像は注目領域に焦点が合っているため、第一エッジ画像では注目領域のエッジは濃淡差の大きいエッジ、すなわち高いエッジとなる。尚、第一ディジタル画像の注目画素及びその近傍画素の画素値の平均偏差を求め、求めた平均偏差に基づいて第一エッジ画像の当該注目画素に対応する画素の画素値を設定することにより第一エッジ画像を生成してもよい。平均偏差はばらつきを表すものである。なお、ばらつきは標準偏差や分散などであってもよい。第一ディジタル画像においてエッジ周辺の画素は、エッジを挟んで逆側の領域にある近傍画素との画素値の差が大きい。すなわちエッジ周辺では画素値のばらつきが大きい。このため、エッジ周辺では平均偏差は大きくなる。平均偏差はエッジが明瞭であればあるほど大きくなる。逆にエッジ周辺以外の画素は、近傍画素との画素値の差が小さい。このため平均偏差は小さくなる。以上のことから明らかなように、平均偏差によって第一ディジタル画像のエッジを表すことができる。
In S210, similarly, a reduced image of the second digital image is generated. In the following description, the second digital image refers to a reduced image of the second digital image.
In S215, a first edge image representing the luminance edge of the first digital image is generated. Here, the luminance means a value of a Y (luminance) component when the first digital image is expressed in the YCbCr color space. When the first digital image is represented in the RGB color space, the luminance value can be obtained from the RGB value using a known conversion formula. The first edge image is generated using, for example, an edge detection operator. Since the first digital image is focused on the region of interest, the edge of the region of interest in the first edge image is an edge having a large shade difference, that is, a high edge. The average deviation of the pixel values of the target pixel of the first digital image and its neighboring pixels is obtained, and the pixel value of the pixel corresponding to the target pixel of the first edge image is set based on the obtained average deviation. One edge image may be generated. Average deviation represents variation. The variation may be a standard deviation or a variance. In the first digital image, the pixel around the edge has a large pixel value difference with the neighboring pixel in the region on the opposite side across the edge. That is, there is a large variation in pixel values around the edge. For this reason, the average deviation increases around the edge. The average deviation increases as the edge becomes clearer. Conversely, the pixels other than the periphery of the edge have a small difference in pixel value from the neighboring pixels. For this reason, an average deviation becomes small. As is clear from the above, the edge of the first digital image can be represented by the average deviation.
S220では、同様にして第二ディジタル画像のエッジを表す第二エッジ画像を生成する。
S225では、第一エッジ画像と第二エッジ画像との差分を表す差分画像を生成する。差分画像は、第一エッジ画像をF1(F1={f1 ij})、第二エッジ画像をF2(F2={f2 ij})、それらの差分を表す差分画像をG(G={g ij})としたとき、{g ij}={f1 ij}−{f2 ij}によって求める。
In S220, a second edge image representing the edge of the second digital image is generated in the same manner.
In S225, a difference image representing a difference between the first edge image and the second edge image is generated. The difference image is F1 (F1 = {f1 ij}) for the first edge image, F2 (F2 = {f2 ij}) for the second edge image, and G (G = {g ij}) for the difference between them. ), {G ij} = {f1 ij} − {f2 ij}.
なお、第二ディジタル画像を撮像するためにレンズ11を移動すると、第一ディジタル画像と第二ディジタル画像とで画角がずれ、差分画像にエッジが二重に表れてしまう場合がある。注目領域のエッジが二重に表れても問題はないが、非注目領域のエッジが二重に表れると、二重に表れた2つのエッジが一つの高いエッジとして認識されてしまい、それが注目領域のエッジとして誤認識されてしまうことがある。このため、第一エッジ画像と第二エッジ画像とを比較して位置及び形状が互いに似ているエッジを検出し、似ているとして検出された第一エッジ画像のエッジの画素値から第二エッジ画像の似ているエッジの画素値を引くことにより、画角ズレを補正した差分画像を生成するようにするとよい。
If the
次に、図1に示すS30の処理の詳細について説明する。
図6は、S30の詳細を示すフローチャートである。
S305では、差分画像を所定のしきい値Aで二値化する。これにより注目領域のエッジが抽出される。本実施例では、画素値が大きい画素を黒(0)、画素値が小さい画素を白(1)に変換するものとする。しきい値Aは、例えば画面からユーザが入力する値でもよいし、予め設定された固定値でもよいし、後述するように領域分割の結果をフィードバックしながら自動設定する値でもよい。
Next, details of the processing of S30 shown in FIG. 1 will be described.
FIG. 6 is a flowchart showing details of S30.
In S305, the difference image is binarized with a predetermined threshold A. Thereby, the edge of the attention area is extracted. In this embodiment, a pixel having a large pixel value is converted to black (0), and a pixel having a small pixel value is converted to white (1). The threshold A may be a value input by the user from the screen, a fixed value set in advance, or a value automatically set while feeding back the result of area division as described later.
図7は注目領域で人物に焦点を合わせた状態で撮像された第一ディジタル画像を表しており、図8は注目領域で人物から焦点を外した状態で撮像された第二ディジタル画像を表している。図9はそれらの差分画像の二値画像を表している。第一ディジタル画像では、注目領域である女性に焦点が合っているため、女性に対応する領域で鮮鋭度が高くなり、それ以外の領域で鮮鋭度が低くなる。したがって、第一ディジタル画像のエッジを抽出すると、女性に対応する領域でエッジが多くなり、それ以外の領域でエッジが少なくなる。一方、第二ディジタル画像では、女性から焦点が外れているものの、それ以外の被写体に焦点が合っているわけではないため、全領域で鮮鋭度が低くなる。したがって、第二ディジタル画像のエッジを抽出すると、全領域でエッジが少なくなる。このため、エッジ差分を表す二値画像では、女性に対応する領域に黒画素が集中する。 FIG. 7 shows a first digital image taken with the person focused on the attention area, and FIG. 8 shows a second digital image taken with the person focused on the attention area. Yes. FIG. 9 shows binary images of these difference images. In the first digital image, since the woman as the attention area is focused, the sharpness is high in the area corresponding to the female, and the sharpness is low in the other areas. Therefore, when the edges of the first digital image are extracted, the edges increase in the area corresponding to the female, and the edges decrease in the other areas. On the other hand, although the second digital image is out of focus from the woman, the other subjects are not in focus, so the sharpness is low in all areas. Therefore, when the edges of the second digital image are extracted, the edges are reduced in the entire region. For this reason, in a binary image representing an edge difference, black pixels are concentrated in an area corresponding to a woman.
一般に、人物などの注目領域に対応する被写体とその背後にある被写体とでは、DSC2までの距離に相当の差があるため、注目領域に対応する領域は、図10の実線で示すように、まとまりのある閉じた領域として二値画像に表れる傾向が強い。二値画像は、注目領域でない領域にノイズを含むため、以後の処理では、この傾向に着目してノイズを除去する。尚、注目領域に対応する領域を特定するための以後の全ての処理は、モノクローム画像に対する処理であり、特に二値画像に対する処理であるため、カラー画像に対する処理に比べて単純である。したがって、注目領域を特定する処理の全体を通じて、画像の特性に応じて調整する必要があるパラメータは、種類が少なく、調整範囲が狭い。本実施例で画像の特性に応じて調整する必要があるパラメータは、差分画像を二値化するためのしきい値Aと、後述する最小値フィルタの適用回数Bと、後述する最大値フィルタの適用回数Cとだけである。このように、画像の特性に応じて調整する必要があるパラメータの種類が少なく、また調整範囲が狭いため、ユーザは容易に適切なパラメータを設定することができる。また、画像の特性に応じて調整する必要があるパラメータの種類が少なく、また調整範囲が狭いため、適切なパラメータを自動検出することも可能である。パラメータをユーザが設定する場合も、適切なパラメータを自動検出する場合も、パラメータの設定操作が簡素化されるため、本実施例の画像処理方法によると、ディジタル画像の領域分割が容易になる。
In general, there is a considerable difference in the distance to the
S310では、最小値フィルタを繰り返し適用して二値画像の黒領域を膨張させることによって、近傍の黒領域同士を結合させ、外輪郭が1つの閉曲線で構成されたある程度広い領域を出現させる。最小値フィルタは、注目画素を取り巻く近傍画素中で画素値が最小のものを選択し、選択された画素の画素値を処理後の全ての近傍画素の画素値として採用するフィルタである。最小値フィルタの適用回数Bは、ユーザが入力する値(領域判定あまさ)でもよいし、予め設定された値でもよいし、後述するように領域分割の結果をフィードバックしながら自動設定する値でもよい。図11及び図12は図9に示す画像に最小値フィルタを適用した結果を示す画像である。図12に示す画像は図11に示す画像よりも最小値フィルタを多く適用した結果を示している。図12に示すように、最小値フィルタの適用回数を多くすると注目領域外のノイズが強調されるが、強調されたノイズは後続の処理で消去することができる。 In S310, by repeatedly applying the minimum value filter to expand the black area of the binary image, the adjacent black areas are connected to each other, and a somewhat wide area in which the outer contour is composed of one closed curve appears. The minimum value filter is a filter that selects a pixel having the smallest pixel value among neighboring pixels surrounding the target pixel, and adopts the pixel value of the selected pixel as the pixel value of all the neighboring pixels after processing. The number B of application of the minimum value filter may be a value input by the user (area determination accuracy), a preset value, or a value automatically set while feeding back the result of area division as described later. . 11 and 12 are images showing the result of applying the minimum value filter to the image shown in FIG. The image shown in FIG. 12 shows the result of applying more minimum value filters than the image shown in FIG. As shown in FIG. 12, when the minimum number of times of application of the minimum value filter is increased, noise outside the attention area is enhanced, but the enhanced noise can be eliminated by subsequent processing.
S315では、最大値フィルタを繰り返し適用して黒領域を収縮させる。図13は図12に示す画像に最大値フィルタを適用した結果を示す画像である。最大値フィルタは、注目画素を取り巻く近傍画素中で、画素値が最大のものを選択して処理後の画素の画素値として採用するフィルタである。最大値フィルタを適用する処理では、図18に示すように、最小値フィルタの適用によって結合した黒領域を結合したまま収縮させることができる。図18は、ウィンドウサイズが9画素の最小値フィルタを2回適用した後にウィンドウサイズが9画素の最大値フィルタを2回適用する処理の経過を示している。最大値フィルタの適用回数Cは、例えば画面からユーザが入力する値(領域の痩身度)でもよいし、予め設定された固定値でもよいし、最小値フィルタの適用回数Bと等しい値でもよいし、後述するように領域分割の結果をフィードバックしながら自動設定する値でもよい。 In S315, the black region is contracted by repeatedly applying the maximum value filter. FIG. 13 is an image showing the result of applying the maximum value filter to the image shown in FIG. The maximum value filter is a filter that selects a pixel having the maximum pixel value from among neighboring pixels surrounding the target pixel and adopts it as the pixel value of the processed pixel. In the process of applying the maximum value filter, as shown in FIG. 18, it is possible to shrink the black areas combined by applying the minimum value filter while being combined. FIG. 18 shows a process of applying the maximum value filter having a window size of 9 pixels twice after applying the minimum value filter having a window size of 9 pixels twice. The maximum value filter application count C may be, for example, a value input by the user from the screen (area slimming degree), a preset fixed value, or a value equal to the minimum value filter application frequency B. As will be described later, it may be a value automatically set while feeding back the result of area division.
S320では、以上の処理によって生成された複数の黒領域のうち、最大面積の領域以外のものを反転させる。この処理は、注目領域に対応する黒領域がノイズに相当する黒領域よりも常に広くなることを前提としている。この処理の結果、注目領域に対応する領域のみが黒領域として残り、ノイズに相当する黒領域は消滅する。図14は図13に示す画像に対するこの処理の結果を示している。 In S320, among the plurality of black regions generated by the above processing, those other than the region with the largest area are inverted. This process is based on the premise that the black area corresponding to the attention area is always wider than the black area corresponding to noise. As a result of this processing, only the area corresponding to the attention area remains as a black area, and the black area corresponding to noise disappears. FIG. 14 shows the result of this processing for the image shown in FIG.
尚、複数の黒領域のうち、いずれの領域が注目領域に対応しているかをより正確に判定するために、各領域の面積を単純に比較するだけではなく、例えば中心に近い領域は周縁に近い領域よりも注目領域である可能性が高いことを勘案し、各領域の面積を位置に応じて重み付けしたものを比較してもよい。また、差分画像を二値化するしきい値Aと、最小値フィルタの適用回数Bと、最大値フィルタの適用回数Cの少なくともいずれか1つを変更して上述の処理を繰り返すときに各黒領域の面積の全体の面積に占める割合がどのように増減するかを勘案することにより、いずれの黒領域が注目領域に対応しているかを判定してもよい。 In order to more accurately determine which of the plurality of black regions corresponds to the region of interest, not only simply comparing the areas of the regions, but for example, the region near the center In consideration of the fact that there is a higher possibility that the region is a region of interest than a nearby region, the areas obtained by weighting the area of each region according to the position may be compared. Further, each black color is changed when at least one of threshold value A for binarizing the difference image, minimum value filter application frequency B, and maximum value filter application frequency C is changed and the above-described processing is repeated. It may be determined which black region corresponds to the region of interest by considering how the ratio of the area of the region to the total area increases or decreases.
S325では、黒領域に囲まれた白領域を反転させることにより黒領域を拡張する。この処理の結果、人肌や無地の衣類のように注目領域の中で被写体自体の濃淡変化が平滑な領域(すなわち焦点が合っていても外れていてもエッジが抽出されない領域)に対応する領域(白領域)が周辺の黒領域によって侵食されて消滅する。図15は図14に示す画像に対するこの処理の結果を示している。 In S325, the black area is expanded by inverting the white area surrounded by the black area. As a result of this processing, an area corresponding to a smooth area of the subject itself in the area of interest such as human skin or plain clothing (that is, an area where an edge is not extracted even if it is in focus or out of focus) The (white area) is eroded by the surrounding black area and disappears. FIG. 15 shows the result of this processing for the image shown in FIG.
以上の処理によって、二値画像の黒領域が第一領域として二値画像上で大まかに特定され、二値画像の白領域が第二領域として二値画像上で大まかに特定される。二値画像上で第一領域を特定することは、第一ディジタル画像上で第一領域を特定することに等しい。すなわち、二値画像上で第一領域を特定することによって、第一ディジタル画像上で第一領域が特定されたことになる。尚、以上の処理に加えて、最適なパラメータを自動検出する処理、黒領域のノイズ成分である「ひげ」を除去する処理等を実施してもよい。 Through the above processing, the black area of the binary image is roughly specified as the first area on the binary image, and the white area of the binary image is roughly specified as the second area on the binary image. Specifying the first region on the binary image is equivalent to specifying the first region on the first digital image. That is, by specifying the first area on the binary image, the first area is specified on the first digital image. In addition to the above processing, processing for automatically detecting an optimum parameter, processing for removing “beard” that is a noise component in a black region, and the like may be performed.
S330では、上述の処理の結果として二値画像に残存している黒領域が内接する最小矩形(図16参照)の面積が二値画像全体に占める割合と、黒領域の面積がその最小矩形の面積に占める割合とが所定の範囲内にあるか否かを判定する。具体的には例えば、黒領域が内接する最小矩形の面積が二値画像全体に占める割合をbr%、黒領域の面積がその最小矩形の面積に占める割合をir%とすると、以下の2つの判定条件が供に満たされれば領域特定は成功したと判定する。いずれか一方でも満たされなければS335に進む。 In S330, the ratio of the area of the smallest rectangle (see FIG. 16) inscribed by the black area remaining in the binary image as a result of the above processing to the entire binary image, and the area of the black area is the smallest rectangle. It is determined whether or not the proportion of the area is within a predetermined range. Specifically, for example, assuming that the ratio of the area of the minimum rectangle inscribed in the black area to the entire binary image is br%, and the ratio of the area of the black area to the area of the minimum rectangle is ir%, the following two If the determination condition is satisfied, it is determined that the region specification is successful. If either one is not satisfied, the process proceeds to S335.
30≦br≦95
55≦ir≦70
図17に示すように蛇行した細長い領域が注目領域に対応する確率は相当低い。上述したような判定条件を設定すると、図17に示すような蛇行した細長い領域の場合は領域特定に失敗したと判定される。すなわち、注目領域である可能性が低い領域が注目領域として特定され、その結果領域特定に成功したと誤判定されてしまうことを防止できる。尚、上述した判定条件に示す値はいくつかのサンプルを使用して実験的に求めた値であり、使用したサンプルではほぼ良好な判定結果が得られると判断された値である。これらの値は必要に応じて適宜設定してよい。また、本実施例では第一ディジタル画像全体の面積(二値画像全体の面積)と矩形領域の面積との比、及び矩形領域の面積と第一領域の面積(黒領域の面積)との比に基づいて領域特定の成否を判定しているが、第一ディジタル画像全体の面積と第一領域の面積との比に基づいて領域特定の成否を判定するようにしてもよい。
30 ≦ br ≦ 95
55 ≦ ir ≦ 70
As shown in FIG. 17, the probability that a meandering elongated region corresponds to a region of interest is considerably low. When the determination conditions as described above are set, in the case of a meandering and slender area as shown in FIG. 17, it is determined that the area specification has failed. That is, it is possible to prevent a region that is unlikely to be a region of interest from being identified as a region of interest and, as a result, erroneously determined that the region has been identified. Note that the values shown in the above-described determination conditions are values obtained experimentally by using several samples, and are values that are determined to obtain almost good determination results with the used samples. These values may be appropriately set as necessary. In this embodiment, the ratio of the entire area of the first digital image (the entire area of the binary image) and the area of the rectangular area, and the ratio of the area of the rectangular area and the area of the first area (area of the black area). However, the success or failure of the region specification may be determined based on the ratio between the area of the entire first digital image and the area of the first region.
S335では、差分画像を二値化するしきい値Aと、最小値フィルタの適用回数Bと、最大値フィルタの適用回数Cの少なくともいずれか1つを、予め設定されている許容範囲内で自動再設定する。
S340では、許容範囲内でのパラメータの自動再設定が成功したか否かを判定する。上述の処理を繰り返した結果、最終的にパラメータの許容範囲内で条件を満たすことができない場合、S335において許容範囲内でパラメータを自動再設定することに失敗する。パラメータの自動再設定に失敗した場合は、領域特定に失敗したと判定する。
In S335, at least one of threshold A for binarizing the difference image, minimum value filter application count B, and maximum value filter application frequency C is automatically set within a preset allowable range. Reset it.
In S340, it is determined whether or not the automatic parameter resetting within the allowable range is successful. As a result of repeating the above-described processing, when the condition cannot be finally satisfied within the allowable range of the parameter, it fails to automatically reset the parameter within the allowable range in S335. If automatic parameter resetting fails, it is determined that the area specification has failed.
以上説明した本発明の一実施例に係るDSC2によると、PC3において第一領域の特定に失敗する場合、そのことを撮像現場で事前に知ることができる。撮像現場で知ることができれば容易に撮像し直すことができるため、失敗した場合は領域特定に成功したと判定されるまでその場で撮像し直すことにより、領域特定に成功する第一ディジタル画像及び第二ディジタル画像をより確実に得ることができる。従って、より確実に被写体を抽出することが可能になる。また、DSC2は同一シーンについて注目領域に焦点が合っている第一ディジタル画像と注目領域から焦点が外れている第二ディジタル画像とを生成するため、PC3において撮像時に焦点を合わせた特定の対象物をディジタル画像から抽出する作業が容易になる。
According to the
尚、上述の実施例では、最小値フィルタや最大値フィルタを用いて注目領域に対応する領域を特定しているが、注目領域の特定はこれに限られない。例えば、二値画像において黒画素が集中している領域を注目領域に対応する領域としてもよいし、集中している黒画素の周囲をベクトルラインで滑らかにつなげた領域を注目領域に対応する領域としてもよい。 In the above-described embodiment, the region corresponding to the attention region is specified using the minimum value filter and the maximum value filter, but the specification of the attention region is not limited to this. For example, an area where black pixels are concentrated in a binary image may be set as an area corresponding to the attention area, or an area where the surroundings of the concentrated black pixels are smoothly connected by a vector line is an area corresponding to the attention area. It is good.
また、上述の実施例では、重畳合成処理の前処理として、第一ディジタル画像の第二領域を透明化しているが、第一ディジタル画像の第二領域の画素値を均一にしてもよい。具体的には例えば第二領域が白、黒、青などの単一色を表すように第一ディジタル画像を編集してもよい。第二領域の画素値が均一であれば、第一領域を抽出して他の画像に合成することは容易である。 In the above-described embodiment, the second area of the first digital image is made transparent as the pre-process of the superimposition synthesis process. However, the pixel values of the second area of the first digital image may be made uniform. Specifically, for example, the first digital image may be edited so that the second region represents a single color such as white, black, and blue. If the pixel values of the second region are uniform, it is easy to extract the first region and combine it with another image.
また、上述の実施例では、第一ディジタル画像の第一領域を特定する処理をPC3で行っているが、例えば、DSC2でその処理を行い、さらに第一ディジタル画像の第二領域の画素値を透明又は均一にし、それをリムーバブルメモリ21に格納してもよい。すなわち、DSC2のみで画像処理システムを構成してもよい。これにより、リムーバブルメモリ21から第一ディジタル画像を入力したPC3において第一ディジタル画像の第一領域を他の画像に合成することが容易になる。
In the above-described embodiment, the process for specifying the first area of the first digital image is performed by the
また、本実施例ではDSC2からPC3に第一ディジタル画像、第二ディジタル画像、及び第一領域を構成する画素を特定するための情報を出力しているが、DSC2からPC3に第一ディジタル画像、及び第二ディジタル画像だけを出力し、PC3において第一領域を特定し直すようにしてもよい。ただし、その場合は第一領域を特定する処理がDSC2とPC3とで重複するため、本実施例のようにDSC2からPC3に第一領域を構成する画素を特定するための情報を出力することが望ましい。
In the present embodiment, the
また、本実施例ではディジタルカメラとしてディジタルスチルカメラを例に説明したが、ディジタルカメラ付き携帯電話やディジタルビデオカメラに本発明を適用してもよい。 In this embodiment, a digital still camera is described as an example of a digital camera. However, the present invention may be applied to a mobile phone with a digital camera and a digital video camera.
1 画像処理システム、2 ディジタルスチルカメラ(画像処理システム)、3 パーソナルコンピュータ(画像処理システム)、11 レンズ(撮像手段)、12 イメージセンサ(撮像手段)、14 シャッタ(撮像手段)、17 アナログディジタル変換器(撮像手段)、18 ディジタル画像処理部(撮像手段)、23 制御部(撮像手段、領域特定手段、判定手段)
DESCRIPTION OF
Claims (7)
前記第一ディジタル画像と前記第二ディジタル画像との鮮鋭度の差に基づいて前記第一ディジタル画像の前記注目領域に対応する第一領域を特定する領域特定手段と、
前記第一ディジタル画像全体の面積と前記第一領域の面積とに基づいて領域特定の成否を判定する判定手段と、
を備えることを特徴とするディジタルカメラ。 Image capturing means for capturing a scene and generating a digital image, the image capturing means generating a first digital image in which the region of interest is in focus for the same scene and a second digital image that is out of focus from the region of interest When,
Area specifying means for specifying a first area corresponding to the attention area of the first digital image based on a difference in sharpness between the first digital image and the second digital image;
A determination means for determining success or failure of region identification based on an area of the entire first digital image and an area of the first region;
A digital camera comprising:
シーンを撮像してディジタル画像を生成する段階であって同一シーンについて注目領域に焦点が合っている第一ディジタル画像と前記注目領域から焦点が外れている第二ディジタル画像とを生成する撮像段階と、
前記第一ディジタル画像と前記第二ディジタル画像との鮮鋭度の差に基づいて前記第一ディジタル画像の前記注目領域に対応する第一領域を特定する領域特定段階と、
前記第一ディジタル画像全体の面積と前記第一領域の面積とに基づいて領域特定の成否を判定する判定段階と、
を含むことを特徴とする画像処理方法。 An image processing method in a digital camera,
Imaging a scene to generate a digital image, the imaging stage generating a first digital image that is focused on the region of interest for the same scene and a second digital image that is out of focus from the region of interest; ,
A region specifying step of specifying a first region corresponding to the region of interest of the first digital image based on a difference in sharpness between the first digital image and the second digital image;
A determination step of determining success or failure of region identification based on an area of the entire first digital image and an area of the first region;
An image processing method comprising:
前記第一ディジタル画像と前記第二ディジタル画像との鮮鋭度の差に基づいて前記第一ディジタル画像の前記注目領域に対応する第一領域を特定する領域特定手段と、
前記第一ディジタル画像全体の面積と前記第一領域の面積とに基づいて領域特定の成否を判定する判定手段としてディジタルカメラを機能させることを特徴とする画像処理プログラム。 Image capturing means for capturing a scene and generating a digital image, the image capturing means generating a first digital image in which the region of interest is in focus for the same scene and a second digital image that is out of focus from the region of interest When,
Area specifying means for specifying a first area corresponding to the attention area of the first digital image based on a difference in sharpness between the first digital image and the second digital image;
An image processing program for causing a digital camera to function as determination means for determining success or failure of region identification based on an area of the entire first digital image and an area of the first region.
前記第一ディジタル画像と前記第二ディジタル画像との鮮鋭度の差に基づいて前記第一ディジタル画像の前記注目領域に対応する第一領域を特定する領域特定手段と、
前記第一ディジタル画像全体の面積と前記第一領域の面積とに基づいて領域特定の成否を判定する判定手段と、
前記判定手段で成功と判定されると、前記領域特定手段で特定された前記第一領域に基づいて前記第一ディジタル画像の前記第一領域以外の第二領域の画素値を均一にする均一手段と、
を備えることを特徴とする画像処理システム。 Image capturing means for capturing a scene and generating a digital image, the image capturing means generating a first digital image in which the region of interest is in focus for the same scene and a second digital image that is out of focus from the region of interest When,
Area specifying means for specifying a first area corresponding to the attention area of the first digital image based on a difference in sharpness between the first digital image and the second digital image;
A determination means for determining success or failure of region identification based on an area of the entire first digital image and an area of the first region;
Uniform means for uniformizing the pixel values of the second area other than the first area of the first digital image based on the first area specified by the area specifying means when the determination means determines success. When,
An image processing system comprising:
前記第一ディジタル画像と前記第二ディジタル画像との鮮鋭度の差に基づいて前記第一ディジタル画像の前記注目領域に対応する第一領域を特定する領域特定手段と、
前記第一ディジタル画像全体の面積と前記第一領域の面積とに基づいて領域特定の成否を判定する判定手段と、
前記判定手段で成功と判定されると、前記領域特定手段で特定された前記第一領域に基づいて前記第一ディジタル画像の前記第一領域以外の第二領域を透明にする透明手段と、
前記透明手段で前記第二領域を透明にした前記第一ディジタル画像を前記第二ディジタル画像又は他のディジタル画像の上に重畳合成する手段と、
を備えることを特徴とする画像処理システム。 Image capturing means for capturing a scene and generating a digital image, the image capturing means generating a first digital image in which the region of interest is in focus for the same scene and a second digital image that is out of focus from the region of interest When,
Area specifying means for specifying a first area corresponding to the attention area of the first digital image based on a difference in sharpness between the first digital image and the second digital image;
A determination means for determining success or failure of region identification based on an area of the entire first digital image and an area of the first region;
When the determination means determines success, the transparent means for making the second area other than the first area of the first digital image transparent based on the first area specified by the area specifying means;
Means for superimposing and synthesizing the first digital image in which the second region is made transparent by the transparent means on the second digital image or another digital image;
An image processing system comprising:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004356802A JP2006166226A (en) | 2004-12-09 | 2004-12-09 | Digital camera, image processing method and program, and image processing system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004356802A JP2006166226A (en) | 2004-12-09 | 2004-12-09 | Digital camera, image processing method and program, and image processing system |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2006166226A true JP2006166226A (en) | 2006-06-22 |
Family
ID=36667701
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2004356802A Withdrawn JP2006166226A (en) | 2004-12-09 | 2004-12-09 | Digital camera, image processing method and program, and image processing system |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2006166226A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2013058823A (en) * | 2011-09-07 | 2013-03-28 | Casio Comput Co Ltd | Image processing device, image processing method and program |
CN103095979A (en) * | 2011-11-07 | 2013-05-08 | 华晶科技股份有限公司 | Image processing method and imaging capture device of face overexposure |
JP2013115758A (en) * | 2011-11-30 | 2013-06-10 | Canon Inc | Imaging apparatus, control method of the same, and program |
CN103699877A (en) * | 2013-12-02 | 2014-04-02 | 广东欧珀移动通信有限公司 | Method and system for improving face recognition effects |
US11418714B2 (en) | 2013-07-23 | 2022-08-16 | Sony Group Corporation | Image processing device, method of processing image, image processing program, and imaging device |
-
2004
- 2004-12-09 JP JP2004356802A patent/JP2006166226A/en not_active Withdrawn
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2013058823A (en) * | 2011-09-07 | 2013-03-28 | Casio Comput Co Ltd | Image processing device, image processing method and program |
CN103095979A (en) * | 2011-11-07 | 2013-05-08 | 华晶科技股份有限公司 | Image processing method and imaging capture device of face overexposure |
JP2013115758A (en) * | 2011-11-30 | 2013-06-10 | Canon Inc | Imaging apparatus, control method of the same, and program |
US11418714B2 (en) | 2013-07-23 | 2022-08-16 | Sony Group Corporation | Image processing device, method of processing image, image processing program, and imaging device |
CN103699877A (en) * | 2013-12-02 | 2014-04-02 | 广东欧珀移动通信有限公司 | Method and system for improving face recognition effects |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8928772B2 (en) | Controlling the sharpness of a digital image | |
US8724919B2 (en) | Adjusting the sharpness of a digital image | |
US8494301B2 (en) | Refocusing images using scene captured images | |
JP4666179B2 (en) | Image processing method and image processing apparatus | |
JP4848965B2 (en) | Imaging device | |
KR101590868B1 (en) | A image processing method an image processing apparatus a digital photographing apparatus and a computer-readable storage medium for correcting skin color | |
JP4375448B2 (en) | Image processing apparatus, imaging apparatus, image processing method, and program | |
JP6322099B2 (en) | Image processing apparatus and image processing method | |
JP6472183B2 (en) | Image processing apparatus, control method thereof, and program | |
JP2012133607A (en) | Image processing apparatus, image processing method and program | |
JP5619124B2 (en) | Image processing apparatus, imaging apparatus, image processing program, and image processing method | |
JP5749406B2 (en) | Image processing apparatus, imaging apparatus, computer, image processing method and program | |
KR20100028315A (en) | Method for taking pictures in mobie communication terminal having camera module and apparatus therefor | |
JP2010074549A (en) | Video signal processor, image pickup device, display device and video signal processing method | |
JP2014103643A (en) | Imaging device and subject recognition method | |
US7876370B2 (en) | Image capture apparatus with noise removal using high frequency signal extraction | |
JP2006166226A (en) | Digital camera, image processing method and program, and image processing system | |
JP5509621B2 (en) | Image processing apparatus, camera, and program | |
JP5043787B2 (en) | Imaging apparatus and control method thereof | |
JP5564961B2 (en) | Imaging device | |
JP2006166212A (en) | Image processing method, system, apparatus and program, and digital camera | |
JP2005038083A (en) | Method, system, device and program for processing image, and digital camera | |
JP2006173661A (en) | Method, system, apparatus and program of processing image, and digital camera | |
JP6976734B2 (en) | Image processing equipment, image processing methods, and programs | |
JP2006166383A (en) | Image processing method, system, apparatus and program, and digital camera |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20060823 |
|
RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20061222 |
|
RD03 | Notification of appointment of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7423 Effective date: 20061226 |
|
RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20070410 |
|
A300 | Application deemed to be withdrawn because no request for examination was validly filed |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20080304 |