JP2010279054A - Image pickup device, image processing device, image pickup method, and image processing method - Google Patents

Image pickup device, image processing device, image pickup method, and image processing method Download PDF

Info

Publication number
JP2010279054A
JP2010279054A JP2010160850A JP2010160850A JP2010279054A JP 2010279054 A JP2010279054 A JP 2010279054A JP 2010160850 A JP2010160850 A JP 2010160850A JP 2010160850 A JP2010160850 A JP 2010160850A JP 2010279054 A JP2010279054 A JP 2010279054A
Authority
JP
Japan
Prior art keywords
image
main subject
focus position
sharpness
focus
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2010160850A
Other languages
Japanese (ja)
Other versions
JP5144724B2 (en
Inventor
Masaya Tamaru
雅也 田丸
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.)
Fujifilm Corp
Original Assignee
Fujifilm Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujifilm Corp filed Critical Fujifilm Corp
Priority to JP2010160850A priority Critical patent/JP5144724B2/en
Publication of JP2010279054A publication Critical patent/JP2010279054A/en
Application granted granted Critical
Publication of JP5144724B2 publication Critical patent/JP5144724B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide an image having an intentionally blurred part other than a main subject, which is the same as an image picked up with a shallow depth of field through blurring processing even when an image of a deep depth of field is picked up. <P>SOLUTION: Focus bracket photographing is executed in a focused position of the main subject and a focal point position therearound, and the degree of sharpness of pixels selected in the entire image is calculated. If the degree of sharpness of a reference image is the largest, the pixel value of the reference image is output (step S102). If the degree of sharpness is not the largest and the degree of sharpness of an image far from the focused position of the main subject is the largest, the pixel value of an image closer from the focused position of the main subject is output (step S104). In the other cases, the pixel value of an image far from the focused position of the main subject is output (step S105). The above processing is executed for all the pixels so as to composite output pixels. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は撮像装置、画像処理装置、撮像方法、及び画像処理方法に係り、特に焦点位置の異なる複数の画像を合成することにより、ぼけ強調画像を得る撮像装置、画像処理装置、撮像方法、及び画像処理方法に関する。   The present invention relates to an imaging apparatus, an image processing apparatus, an imaging method, and an image processing method, and in particular, an imaging apparatus, an image processing apparatus, an imaging method, and an imaging apparatus that obtain a blur-emphasized image by combining a plurality of images having different focal positions. The present invention relates to an image processing method.

従来より、写真撮影において、絞りを開放側に設定して被写界深度を浅くすることにより主要被写体だけに焦点を合わせ、主要被写体以外の他の部分を意図的にぼかす撮影方法が行われてきた。しかし、このような撮影方法が可能なのは、絞りをマニュアルで調節可能な一眼レフカメラ等の大型カメラに限られ、またコンパクトカメラ等では撮像素子が小さいために、絞りを自動的に開放側に制御しても主要被写体以外の部分をぼかすのは困難であった。   Conventionally, in photography, a method has been used in which only the main subject is focused by intentionally blurring other parts other than the main subject by setting the aperture to the open side and reducing the depth of field. It was. However, this type of photography is possible only for large cameras, such as single-lens reflex cameras, where the aperture can be adjusted manually, and because the image sensor is small for compact cameras, the aperture is automatically controlled to the open side. Even so, it was difficult to blur areas other than the main subject.

このような課題を解決するために、撮影した画像データに対して画像処理を行うことにより、ぼけ強調画像を得る技術が知られている。特許文献1には、撮影した画像データから非合焦領域を検出し、非合焦領域に対してデジタル信号処理によってぼかし処理を行うデジタルカメラが開示されている。特許文献1のデジタルカメラによれば、被写界深度が深い画像を撮影した場合であっても、ぼかし処理により被写界深度を浅く撮影した画像と同様な、主要被写体以外の他の部分を意図的にぼかした画像を得ることができる。   In order to solve such a problem, a technique for obtaining a blur-enhanced image by performing image processing on captured image data is known. Patent Document 1 discloses a digital camera that detects a non-focused area from captured image data and performs a blurring process on the non-focused area by digital signal processing. According to the digital camera of Patent Document 1, even when an image with a deep depth of field is taken, other parts other than the main subject are the same as those taken with a shallow depth of field by the blurring process. An intentionally blurred image can be obtained.

特開2006−140594号公報JP 2006-140594 A

しかしながら、特許文献1に記載のデジタルカメラにおいては、被写体の周波数特性を考慮せずに光強度変化等で非合焦領域を判断しているため、もともと周波数の低い被写体なのか、非合焦により周波数が低くなっているかの区別がつかず、良好な非合焦領域の判断ができなかった。このため、ぼかしたい領域を適切にぼかすことができない場合があるという欠点があった。   However, in the digital camera described in Patent Document 1, since the out-of-focus area is determined by light intensity change or the like without considering the frequency characteristics of the subject, whether the subject is originally a low-frequency subject or not by focusing. It was impossible to distinguish whether the frequency was low, and it was not possible to determine a good out-of-focus area. For this reason, there is a drawback in that the area to be blurred cannot be appropriately blurred.

本発明はこのような事情に鑑みてなされたもので、被写界深度の浅い画像を撮影することが困難なコンパクトカメラ等においても、ぼかしたい領域を適切にぼかした、意図したぼけ強調画像を得ることができる撮像装置、画像処理装置、撮像方法、及び画像処理方法を提供することを目的とする。   The present invention has been made in view of such circumstances, and in a compact camera or the like where it is difficult to capture an image with a shallow depth of field, an intended blur-enhanced image obtained by appropriately blurring a region to be blurred is provided. An object is to provide an imaging device, an image processing device, an imaging method, and an image processing method that can be obtained.

前記目的を達成するために本発明に係る撮像装置は、画像データに基づいて主要被写体の合焦位置を判断する自動合焦位置判断手段と、予め定められた移動量で離散的に焦点位置を移動して順次画像を撮影することにより複数の画像を得るフォーカスブラケット撮影手段と、前記移動する焦点位置が前記自動合焦位置判断手段により判断された前記主要被写体の合焦位置とその前後の焦点位置を含むように制御する焦点位置制御手段と、前記主要被写体の合焦位置で撮影された画像及び前記主要被写体の合焦位置の前後の焦点位置で撮影された画像を含む前記フォーカスブラケット撮影手段により撮影された複数の画像間の対応する座標の画素の鮮鋭度を算出する鮮鋭度算出手段と、前記複数の画像を合成する画像合成手段と、前記画像合成手段により得られた画像を記録媒体に記録する記録手段とを備え、前記画像合成手段は、前記複数画像間の対応する座標の画素において、前記主要被写体の合焦位置で撮影された画素の鮮鋭度が最大の場合はその画素を選択し、前記主要被写体の合焦位置よりも前の焦点位置で撮影された画素の鮮鋭度が最大の場合は前記主要被写体の合焦位置よりも後の焦点位置で撮影された画素を選択し、前記主要被写体の合焦位置よりも後の焦点位置で撮影された画素の鮮鋭度が最大の場合は前記主要被写体の合焦位置よりも前の焦点位置で撮影された画素を選択して画像合成することを特徴とする。   In order to achieve the above object, an imaging apparatus according to the present invention includes an automatic focusing position determination unit that determines a focusing position of a main subject based on image data, and discretely sets a focal position with a predetermined amount of movement. A focus bracket photographing unit that obtains a plurality of images by moving and sequentially capturing images, and a focus position of the main subject in which the moving focus position is determined by the automatic focus position determination unit and a focus before and after the focus position A focus position control means for controlling to include a position; and the focus bracket photographing means including an image photographed at a focus position of the main subject and an image photographed at a focus position before and after the focus position of the main subject. Sharpness calculation means for calculating the sharpness of pixels of corresponding coordinates between a plurality of images taken by the image, image composition means for combining the plurality of images, and the image composition Recording means for recording the image obtained by the stage on a recording medium, wherein the image synthesizing means is configured to sharpen pixels photographed at the in-focus position of the main subject in pixels corresponding to coordinates between the plurality of images. When the degree is the maximum, the pixel is selected, and when the sharpness of the pixel photographed at the focal position before the focus position of the main subject is the maximum, the focus after the focus position of the main subject is selected. If the pixel captured at the position is selected and the sharpness of the pixel captured at the focal position after the focus position of the main subject is the maximum, the focus position before the focus position of the main subject is selected. It is characterized in that photographed pixels are selected and an image is synthesized.

これにより、ぼけ強調画像を得ることができる。   Thereby, a blur-emphasized image can be obtained.

また、ぼかしたい領域を適切なぼかし量でぼかすことができ、意図したぼけ強調画像を得ることができる。   In addition, it is possible to blur an area to be blurred with an appropriate blur amount, and an intended blur-enhanced image can be obtained.

前記主要被写体の合焦位置で撮影された画像内の被写体の特徴点を抽出する特徴点抽出手段と、前記主要被写体の合焦位置の前後の焦点位置で撮影された画像内の前記特徴点に対応する被写体の対応点を検出する対応点検出手段と、前記対応点の座標がそれぞれ対応する前記特徴点の座標に一致するように前記主要被写体の合焦位置の前後の焦点位置で撮影された画像を変形する画像変形手段とを備え、前記鮮鋭度算出手段は、前記主要被写体の合焦位置で撮影された画像及び前記変形された主要被写体の合焦位置の前後の焦点位置で撮影された画像の複数の画像間の対応する座標の画素の鮮鋭度を算出することが好ましい。   Feature point extraction means for extracting a feature point of a subject in an image photographed at the focus position of the main subject, and the feature point in an image photographed at a focal position before and after the focus position of the main subject. Corresponding point detection means for detecting corresponding points of the corresponding subject, and images taken at focal positions before and after the in-focus position of the main subject so that the coordinates of the corresponding points coincide with the coordinates of the corresponding feature points, respectively. An image deformation means for deforming an image, wherein the sharpness calculation means is photographed at an image photographed at a focus position of the main subject and at a focal position before and after the focus position of the deformed main subject. It is preferable to calculate the sharpness of the pixel at the corresponding coordinates between a plurality of images.

前記焦点位置制御手段は、撮影時の絞り及び撮影時の焦点距離のうち少なくとも一方に基づいて、前記移動する焦点位置を制御することが好ましい。   It is preferable that the focal position control means controls the moving focal position based on at least one of a diaphragm at the time of photographing and a focal length at the time of photographing.

これにより、被写界深度に応じたフォーカスブラケット撮影が可能になる。   This makes it possible to perform focus bracket shooting according to the depth of field.

ぼけ強調度を設定するぼけ強調度設定手段を備え、前記焦点位置制御手段は、前記主要被写体の合焦位置より前の焦点位置を複数含むように制御するとともに前記主要被写体の後の焦点位置を複数含むように制御し、前記画像合成手段は、前記複数画像間の対応する座標の画素において、前記主要被写体の合焦位置よりも前の焦点位置で撮影された画素の鮮鋭度が最大の場合は前記主要被写体の合焦位置よりも後の焦点位置で撮影された複数の画像から前記ぼけ強調度に応じた画素を選択し、前記主要被写体の合焦位置よりも後の焦点位置で撮影された画素の鮮鋭度が最大の場合は前記主要被写体の合焦位置よりも前の焦点位置で撮影された複数の画像から前記ぼけ強調度に応じた画素を選択して画像合成してもよい。   A blur enhancement level setting unit configured to set a blur enhancement level, wherein the focus position control unit performs control so as to include a plurality of focus positions before the focus position of the main subject, and sets a focus position after the main subject. A plurality of images, and the image composition means has a maximum sharpness of a pixel photographed at a focal position before the in-focus position of the main subject in pixels corresponding to coordinates between the plurality of images. Selects a pixel corresponding to the degree of blur enhancement from a plurality of images taken at a focal position after the focus position of the main subject, and is taken at a focus position after the focus position of the main subject. If the sharpness of the pixel is maximum, the image may be synthesized by selecting pixels corresponding to the blur enhancement degree from a plurality of images taken at a focal position before the focus position of the main subject.

これにより、ユーザが好みに応じたぼけ量のぼけ強調画像を撮影することができる。   As a result, a blur-enhanced image with a blur amount according to the user's preference can be taken.

前記目的を達成するために請求項5に記載の画像処理装置は、主要被写体の合焦位置で撮影された画像と前記主要被写体の合焦位置の前後の焦点位置で撮影された画像を含むそれぞれ異なる焦点位置で撮影された同一シーンの複数の画像を入力させる入力手段と、前記複数の画像間の対応する座標の画素の鮮鋭度を算出する鮮鋭度算出手段と、前記複数の画像を合成する画像合成手段と、前記画像合成手段により得られた画像を出力する出力手段とを備え、前記画像合成手段は、前記複数画像間の対応する座標の画素において、前記主要被写体の合焦位置で撮影された画素の鮮鋭度が最大の場合はその画素を選択し、前記主要被写体の合焦位置よりも前の焦点位置で撮影された画素の鮮鋭度が最大の場合は前記主要被写体の合焦位置よりも後の焦点位置で撮影された画素を選択し、前記主要被写体の合焦位置よりも後の焦点位置で撮影された画素の鮮鋭度が最大の場合は前記主要被写体の合焦位置よりも前の焦点位置で撮影された画素を選択して画像合成することを特徴とする。   In order to achieve the object, the image processing apparatus according to claim 5 includes an image photographed at a focus position of a main subject and an image photographed at a focal position before and after the focus position of the main subject. An input unit that inputs a plurality of images of the same scene photographed at different focal positions, a sharpness calculation unit that calculates the sharpness of pixels at corresponding coordinates between the plurality of images, and the plurality of images are combined. An image synthesizing unit; and an output unit that outputs the image obtained by the image synthesizing unit, wherein the image synthesizing unit captures an image at a focus position of the main subject in a pixel of corresponding coordinates between the plurality of images. When the sharpness of the captured pixel is maximum, the pixel is selected, and when the sharpness of the pixel photographed at the focal position before the focus position of the main subject is maximum, the focus position of the main subject is selected. After When a pixel photographed at a focal position is selected and the sharpness of a pixel photographed at a focal position after the focal position of the main subject is maximum, the focal position before the focal position of the main subject The pixel photographed in step (b) is selected and combined.

前記目的を達成するために請求項6に記載の撮像方法は、画像データに基づいて主要被写体の合焦位置を判断する自動合焦位置判断工程と、予め定められた移動量で離散的に焦点位置を移動して順次画像を撮影することにより複数の画像を得るフォーカスブラケット撮影工程と、前記移動する焦点位置が前記自動合焦位置判断工程により判断された前記主要被写体の合焦位置と前記主要被写体の合焦位置の前後の焦点位置を含むように制御する焦点位置制御工程と、前記主要被写体の合焦位置で撮影された画像及び前記主要被写体の合焦位置の前後の焦点位置で撮影された画像を含む前記フォーカスブラケット撮影工程により撮影された複数の画像間の対応する座標の画素の鮮鋭度を算出する鮮鋭度算出工程と、前記複数の画像を合成する画像合成工程と、前記画像合成工程により得られた画像を記録媒体に記録する記録工程とを備え、前記画像合成工程は、前記複数画像間の対応する座標の画素において、前記主要被写体の合焦位置で撮影された画素の鮮鋭度が最大の場合はその画素を選択し、前記主要被写体の合焦位置よりも前の焦点位置で撮影された画素の鮮鋭度が最大の場合は前記主要被写体の合焦位置よりも後の焦点位置で撮影された画素を選択し、前記主要被写体の合焦位置よりも後の焦点位置で撮影された画素の鮮鋭度が最大の場合は前記主要被写体の合焦位置よりも前の焦点位置で撮影された画素を選択して画像合成することを特徴とする。   In order to achieve the above object, the imaging method according to claim 6 includes an automatic in-focus position determining step of determining an in-focus position of a main subject based on image data, and discrete focusing with a predetermined amount of movement. A focus bracket imaging step of obtaining a plurality of images by moving the position and sequentially capturing images; and a focus position of the main subject in which the moving focus position is determined by the automatic focus position determination step; A focus position control step for controlling the focus position before and after the focus position of the subject, an image shot at the focus position of the main subject, and a focus position before and after the focus position of the main subject. A sharpness calculating step for calculating the sharpness of pixels at corresponding coordinates between the plurality of images photographed by the focus bracket photographing step including the image, and an image for combining the plurality of images. A synthesizing step; and a recording step of recording the image obtained by the image synthesizing step on a recording medium, wherein the image synthesizing step includes a focus position of the main subject at pixels of corresponding coordinates between the plurality of images. When the sharpness of the pixel photographed in step 1 is the maximum, that pixel is selected, and when the sharpness of the pixel photographed at the focal position before the in-focus position of the main subject is maximum, the alignment of the main subject is selected. When a pixel photographed at a focal position after the focal position is selected and the sharpness of the pixel photographed at a focal position after the focal position of the main subject is maximum, the focal position of the main subject is selected. The present invention is characterized in that an image is synthesized by selecting pixels photographed at a focal position before the image.

前記目的を達成するために請求項7に記載の画像処理方法は、主要被写体の合焦位置で撮影された画像と前記主要被写体の合焦位置の前後の焦点位置で撮影された画像を含むそれぞれ異なる焦点位置で撮影された同一シーンの複数の画像を入力させる入力工程と、前記複数の画像間の対応する座標の画素の鮮鋭度を算出する鮮鋭度算出工程と、前記複数の画像を合成する画像合成工程と、前記画像合成工程により得られた画像を出力する出力工程とを備え、前記画像合成工程は、前記複数画像間の対応する座標の画素において、前記主要被写体の合焦位置で撮影された画素の鮮鋭度が最大の場合はその画素を選択し、前記主要被写体の合焦位置よりも前の焦点位置で撮影された画素の鮮鋭度が最大の場合は前記主要被写体の合焦位置よりも後の焦点位置で撮影された画素を選択し、前記主要被写体の合焦位置よりも後の焦点位置で撮影された画素の鮮鋭度が最大の場合は前記主要被写体の合焦位置よりも前の焦点位置で撮影された画素を選択して画像合成することを特徴とする。   In order to achieve the object, an image processing method according to claim 7 includes an image photographed at a focus position of a main subject and an image photographed at a focal position before and after the focus position of the main subject. An input step for inputting a plurality of images of the same scene photographed at different focal positions, a sharpness calculation step for calculating a sharpness of a pixel at a corresponding coordinate between the plurality of images, and a combination of the plurality of images. An image synthesizing step, and an output step for outputting the image obtained by the image synthesizing step, wherein the image synthesizing step is performed at a focus position of the main subject in pixels of corresponding coordinates between the plurality of images. When the sharpness of the captured pixel is maximum, the pixel is selected, and when the sharpness of the pixel photographed at the focal position before the focus position of the main subject is maximum, the focus position of the main subject is selected. After When a pixel photographed at a focal position is selected and the sharpness of a pixel photographed at a focal position after the focal position of the main subject is maximum, the focal position before the focal position of the main subject The pixel photographed in step (b) is selected and combined.

本発明によれば、通常撮影よりも自然なぼけ強調された画像を得ることができる。これにより、コンパクトカメラのように撮像素子が小さいカメラを用いて、一眼レフのように撮像素子が大きいカメラで撮影されるような被写界深度の浅い、ぼけ味のある画像を得る撮像装置、画像処理装置、撮像方法、及び画像処理方法を提供することができる。   According to the present invention, it is possible to obtain a blur-enhanced image that is more natural than normal shooting. Thereby, using a camera with a small imaging device such as a compact camera, an imaging device that obtains a shallow, blurred image with a shallow depth of field such as a single-lens reflex camera that is photographed with a large imaging device, An image processing apparatus, an imaging method, and an image processing method can be provided.

図1は、本発明に係る第1の実施の形態のデジタルカメラ1の内部構成の一例を示すブロック図である。FIG. 1 is a block diagram showing an example of the internal configuration of the digital camera 1 according to the first embodiment of the present invention. 図2はコミュニティの登録動作について示すフローチャートである。FIG. 2 is a flowchart showing a community registration operation. 図3は、フォーカスブラケット撮影から得られた画像を示す図である。FIG. 3 is a diagram illustrating an image obtained from the focus bracket shooting. 図4は、デジタルカメラ1の対応点検出の動作について示すフローチャートである。FIG. 4 is a flowchart showing the operation of detecting corresponding points of the digital camera 1. 図5は、画像変形について示す図である。FIG. 5 is a diagram illustrating image deformation. 図6は、画像合成処理の動作を示すフローチャートである。FIG. 6 is a flowchart showing the operation of the image composition process. 図7は、ラプラシアンフィルタのフィルタ行列を示す図である。FIG. 7 is a diagram illustrating a filter matrix of a Laplacian filter. 図8は、ぼけ強調撮影モードの動作を示すフローチャートである。FIG. 8 is a flowchart showing the operation in the blur enhancement shooting mode. 図9は、各焦点位置と各焦点位置におけるAF評価値を示したグラフである。FIG. 9 is a graph showing each focus position and the AF evaluation value at each focus position. 図10は第2の実施の形態における画像合成処理の動作のフローチャートである。FIG. 10 is a flowchart of the operation of the image composition process in the second embodiment. 図11は、主要被写体の合焦位置Bで撮影された画像と、その合焦位置の前後の焦点位置であるA及びCで撮影された画像の、鮮鋭度を示すグラフである。FIG. 11 is a graph showing the sharpness of an image captured at the focus position B of the main subject and images captured at A and C, which are focal positions before and after the focus position. 図12は、本発明に係る第3の実施の形態のデジタルカメラ1の内部構成の一例を示すブロック図である。FIG. 12 is a block diagram showing an example of the internal configuration of the digital camera 1 according to the third embodiment of the present invention. 図13は、第3の実施の形態のぼけ強調撮影モードの動作を示すフローチャートである。FIG. 13 is a flowchart illustrating the operation in the blur-enhanced shooting mode according to the third embodiment. 図14は、各焦点位置と各焦点位置におけるAF評価値を示したグラフである。FIG. 14 is a graph showing each focus position and the AF evaluation value at each focus position. 図15は、絞りと焦点距離と焦点位置の間隔dの関係を示すグラフである。FIG. 15 is a graph showing the relationship between the aperture, the focal distance, and the distance d between the focal positions. 図16は、ぼかし量算出処理の動作を示すフローチャートである。FIG. 16 is a flowchart showing the operation of the blur amount calculation process. 図17は、ぼかし処理の動作を示すフローチャートである。FIG. 17 is a flowchart showing the operation of the blurring process. 図18は、ぼかし量の絶対値|k|とガウシアンフィルタのσパラメータの関係、及びを示したグラフである。FIG. 18 is a graph showing the relationship between the absolute value | k | of the blur amount and the σ parameter of the Gaussian filter.

以下、添付図面に従って本発明を実施するための最良の形態について説明する。   The best mode for carrying out the present invention will be described below with reference to the accompanying drawings.

<第1の実施の形態>
図1は、本発明に係る第1の実施の形態のデジタルカメラ1の内部構成の一例を示すブロック図である。
<First Embodiment>
FIG. 1 is a block diagram showing an example of the internal configuration of the digital camera 1 according to the first embodiment of the present invention.

CPU24は、シャッタースイッチを含む操作部23の入力に基づいてデジタルカメラ1内の各回路を統括制御するもので、カメラ制御プログラムにしたがった処理を実行する。   The CPU 24 performs overall control of each circuit in the digital camera 1 based on the input of the operation unit 23 including the shutter switch, and executes processing according to the camera control program.

このCPU24の各回路の制御は、アドレスバス25及びデータバス26を介しておこなう。またCPU24は、メインメモリ28との間で、必要なデータの授受を行う。メインメモリ28の内部はROM領域とRAM領域に分かれており、このROM領域には、カ
メラ制御プログラム、起動時のオープニング画像、停止時のエンディング画像、デジタルカメラ1の操作に使用するメニュー画像等のGUI用の画像、スクリーンセイバー用の画像、処理中のプログレス表示用の画像(目盛りが変化する砂時計の画像等)、キー操作音(シャッター音等)、警告音、及びエラー音等を示す音声データ等が記録されている。
Control of each circuit of the CPU 24 is performed via an address bus 25 and a data bus 26. The CPU 24 exchanges necessary data with the main memory 28. The main memory 28 is divided into a ROM area and a RAM area. The ROM area includes a camera control program, an opening image at startup, an ending image at stop, a menu image used for operating the digital camera 1, and the like. GUI image, screen saver image, progress display image during processing (such as an hourglass image whose scale changes), key operation sound (shutter sound, etc.), sound data indicating warning sound, error sound, etc. Is recorded.

デジタルカメラ1に電源が投入されると、CPU24はこれを検出し、一定期間メインメモリ28のROM領域に格納されているオープニング画像を表示部35に表示した後、撮影モードで撮影スタンバイ状態にする。この撮影スタンバイ状態では、CPU24は、表示部35に動画(スルー画)を表示させる。   When the digital camera 1 is turned on, the CPU 24 detects this, displays the opening image stored in the ROM area of the main memory 28 for a certain period on the display unit 35, and then enters the shooting standby state in the shooting mode. . In the photographing standby state, the CPU 24 displays a moving image (through image) on the display unit 35.

ユーザ(撮影者)は、表示部35に表示されるスルー画を見ながらフレーミングしたり、撮影したい被写体を確認したり、撮影後の画像を確認したり、撮影条件を設定したりする。   The user (photographer) performs framing while viewing the through image displayed on the display unit 35, confirms the subject to be photographed, confirms the image after photographing, and sets photographing conditions.

上記撮影スタンバイ状態時に操作部23の図示しないシャッタースイッチが押されると、CPU24は、積算部31で算出したAF評価値に基づいて合焦位置を判断し、レンズ駆動部16を介してレンズ11を駆動しフォーカス制御を行い、絞り駆動部17を介して絞り12を駆動し露出制御を行い、レンズ11、絞り12、Irカットフィルタ13、及び光学ローパスフィルタ14を介して固体撮像素子15の受光面上に被写体像を結像させる。ここで、必要であればストロボ19を撮影補助光として発光させる。またこのとき、受光部20によりストロボ19の発光量を制御する。固体撮像素子15の受光面に結像された被写体像をその光量に応じた量の信号電荷に変換し、この信号電荷はCPU24の指令に従い撮像素子駆動部18から与えられる駆動パルスに基づいてアナログ信号処理部21に送られ、ここで相関二重サンプリング処理された後に増幅され、A/D変換器22に加えられる。   When a shutter switch (not shown) of the operation unit 23 is pressed during the shooting standby state, the CPU 24 determines the in-focus position based on the AF evaluation value calculated by the integrating unit 31 and moves the lens 11 through the lens driving unit 16. Drive and focus control, drive aperture 12 through aperture drive unit 17 to perform exposure control, and light receiving surface of solid-state image sensor 15 through lens 11, aperture 12, Ir cut filter 13, and optical low-pass filter 14 A subject image is formed on the top. Here, if necessary, the strobe 19 is caused to emit light as auxiliary photographing light. At this time, the light receiving unit 20 controls the light emission amount of the strobe 19. The subject image formed on the light receiving surface of the solid-state image sensor 15 is converted into a signal charge of an amount corresponding to the amount of the light. The signal is sent to the signal processing unit 21, where it is subjected to correlated double sampling processing, amplified, and added to the A / D converter 22.

A/D変換器22によってデジタル信号に変換された点順次のR、G、B信号は、メインメモリ制御部27を介してメインメモリ28のRAM領域に記憶される。   The dot sequential R, G, B signals converted into digital signals by the A / D converter 22 are stored in the RAM area of the main memory 28 via the main memory control unit 27.

デジタル信号処理部29は、上記メインメモリ28のRAM領域に格納されたR、G、Bの生データを読み出し、これらに光源種に応じたデジタルゲインをかけることでホワイトバランス調整を行うとともに、ガンマ(階調変換)処理、シャープネス処理等を行ってR、G、B信号を生成する。更にYC信号処理して輝度信号Yとクロマ信号Cr、Cb(YC信号)を生成し再びメインメモリ28のRAM領域に格納する。   The digital signal processing unit 29 reads the R, G, and B raw data stored in the RAM area of the main memory 28 and applies a digital gain corresponding to the light source type to the white data to adjust the white balance. (Tone conversion) processing, sharpness processing, etc. are performed to generate R, G, B signals. Further, YC signal processing is performed to generate a luminance signal Y and chroma signals Cr and Cb (YC signals) and store them again in the RAM area of the main memory 28.

上記のようにしてメインメモリ28のRAM領域に格納されたYC信号は、圧縮伸張処理部30により所定のフォーマットに圧縮されたのち、メモリ制御部32を介して、デジタルカメラ1に着脱自在な記録媒体33に記録される。   The YC signal stored in the RAM area of the main memory 28 as described above is compressed into a predetermined format by the compression / decompression processing unit 30 and is then detachably attached to the digital camera 1 via the memory control unit 32. It is recorded on the medium 33.

また各種操作部23を操作して再生モードが選択されると、記録メディアに記録されている最終コマの画像ファイルがメモリ制御部32を介して読み出される。この読み出された画像ファイルの圧縮データは、圧縮伸張処理部30により非圧縮のYC信号に伸張される。伸張されたYC信号は、表示用の信号形式に変換されて表示部35に出力される。これにより、表示部35には記録メディアに記録されている最終コマの画像が表示される。   When the playback mode is selected by operating the various operation units 23, the image file of the last frame recorded on the recording medium is read via the memory control unit 32. The compressed data of the read image file is expanded into an uncompressed YC signal by the compression / decompression processor 30. The expanded YC signal is converted into a display signal format and output to the display unit 35. Thereby, the image of the last frame recorded on the recording medium is displayed on the display unit 35.

次に、デジタルカメラ1における全焦点画像撮影について説明する。図2は、全焦点画像を撮影するための全焦点画像撮影モードの動作を示すフローチャートである。本発明に係るデジタルカメラ1の全焦点画像撮影モードでは、フォーカスブラケット撮影を行い、各撮影画像の対応点を検出し、対応点の位置が一致するように各撮影画像を変形し、変形した画像を合成することにより全焦点画像を得る。   Next, omnifocal image shooting in the digital camera 1 will be described. FIG. 2 is a flowchart showing the operation of an omnifocal image capturing mode for capturing an omnifocal image. In the omnifocal image shooting mode of the digital camera 1 according to the present invention, focus bracket shooting is performed, the corresponding points of the captured images are detected, the captured images are deformed so that the positions of the corresponding points coincide, and the deformed images are obtained. Are combined to obtain an omnifocal image.

操作部23の図示しないモードスイッチを操作することにより全焦点画像撮影モードが設定され、さらに操作部23のシャッタースイッチが押されると、CPU24はこれらの操作に基づいて、焦点位置を設定し(ステップS21)、撮影を行う(ステップS22)。次に撮影した回数の判定を行う(ステップS23)。所定回数に満たない場合は、異なる焦点位置に設定し(ステップS21)、さらに撮影を行う(ステップS22)。このように異なる焦点位置での撮影を繰り返し、所定回数の撮影を行う(フォーカスブラケット撮影)。各撮影画像は、メインメモリ28のRAM領域に格納される。   When an omnifocal image capturing mode is set by operating a mode switch (not shown) of the operation unit 23, and the shutter switch of the operation unit 23 is further pressed, the CPU 24 sets a focus position based on these operations (step S21), photographing is performed (step S22). Next, the number of shots is determined (step S23). If it is less than the predetermined number of times, a different focal position is set (step S21), and further photographing is performed (step S22). In this way, photographing at different focal positions is repeated, and photographing is performed a predetermined number of times (focus bracket photographing). Each captured image is stored in the RAM area of the main memory 28.

ここで、所定回数については、デジタルカメラ1内において予め定められた回数でもよいし、ユーザが設定できるようにしてもよい。また、撮影条件で決まる被写界深度を判断し、この被写界深度に応じて決定してもよい。全焦点画像を得るためには、画像内の全ての被写体において、いずれか1枚の画像においては合焦していることが必要である。よって、被写界深度が浅い場合は焦点位置の移動量を少なくして撮影枚数を多くする必要がある。また被写界深度が深い場合は焦点位置の移動量を多くして撮影枚数を少なくすることにより、無駄に多くの枚数を撮影してメモリを消費したり、処理負荷を増やすことを防止することができる。   Here, the predetermined number of times may be a predetermined number in the digital camera 1 or may be set by the user. Alternatively, the depth of field determined by the shooting conditions may be determined and determined according to the depth of field. In order to obtain an omnifocal image, it is necessary that all the subjects in the image are in focus in any one of the images. Therefore, when the depth of field is shallow, it is necessary to reduce the amount of movement of the focal position and increase the number of shots. In addition, when the depth of field is deep, by increasing the amount of movement of the focal position and reducing the number of shots, it is possible to prevent unnecessary consumption of memory by taking a large number of shots and increasing the processing load. Can do.

また、この焦点位置の移動については、焦点距離が近い位置から遠い位置へ移動しても、遠い位置から近い位置へ移動しても、又はランダムに移動してもよい。   Further, regarding the movement of the focal position, the focal position may be moved from a position where the focal distance is close to a far position, may be moved from a far position to a close position, or may be moved randomly.

所定回数の撮影が終了すると、各撮影画像における対応点の検出を行う(ステップS24)。   When the predetermined number of times of shooting is completed, corresponding points in each shot image are detected (step S24).

ここで、画像内の対応点の検出について説明する。対応点検出は、複数画像間で対応する点の位置関係を求めるものである。図3は、フォーカスブラケット撮影から得られた画像を示す図である。対応点検出部36が、図3(a)に示す基準画像から特徴点を抽出し、その特徴点が図3(b)に示す追跡画像のどの位置に移動したかを追跡することにより、対応点の検出を行う。図4は、デジタルカメラ1の対応点検出の動作について示すフローチャートである。   Here, detection of corresponding points in the image will be described. Corresponding point detection is to obtain the positional relationship of corresponding points between a plurality of images. FIG. 3 is a diagram illustrating an image obtained from the focus bracket shooting. Corresponding point detection unit 36 extracts a feature point from the reference image shown in FIG. 3A and tracks to which position in the tracking image shown in FIG. Perform point detection. FIG. 4 is a flowchart showing the operation of detecting corresponding points of the digital camera 1.

まず、CPU24は、対応点検出部36へフォーカスブラケット撮影を行った複数画像を入力する(ステップS41)。次に、対応点検出部36は、この複数画像の中から基準画像を選択し(ステップS42)、この基準画像から特徴点の抽出を行う(ステップS43)。基準画像の選択については、デジタルカメラ1内において予め定められた方法に基づいて選択してもよいし、ユーザが選択してもよい。ここでは、最初に撮影した画像を基準画像とする。特徴点抽出の手法は種々のものが提案されているが、ここでは、ある点を中心とする所定領域内の輝度の標準偏差が所定値以上の場合に、その点を特徴点として抽出する。図3(a)における丸印が、図3(a)の画像における特徴点を示す。特徴点は多いほうが以後の処理を精度よく行うことができるが、特徴点が多くなると処理負荷が増大するため、特徴点の数はハード性能から適宜決めればよい。   First, the CPU 24 inputs a plurality of images obtained by focus bracket shooting to the corresponding point detection unit 36 (step S41). Next, the corresponding point detection unit 36 selects a reference image from the plurality of images (step S42), and extracts feature points from the reference image (step S43). The reference image may be selected based on a predetermined method in the digital camera 1 or may be selected by the user. Here, the first photographed image is used as the reference image. Various feature point extraction methods have been proposed. Here, when the standard deviation of luminance in a predetermined area centered on a certain point is a predetermined value or more, that point is extracted as a feature point. Circles in FIG. 3A indicate feature points in the image of FIG. As the number of feature points increases, the subsequent processing can be performed more accurately. However, since the processing load increases as the number of feature points increases, the number of feature points may be determined as appropriate from the hardware performance.

次に、追跡画像の選択を行う(ステップS44)。ステップS41で入力された複数画像のうち、基準画像以外の画像を選択する。   Next, a tracking image is selected (step S44). Of the plurality of images input in step S41, an image other than the reference image is selected.

選択した追跡画像において、基準画像から抽出された特徴点の1つを選択し(ステップS45)、この特徴点がどの位置へ移動したかを追跡する(ステップS46)。追跡手法についても種々のものが提案されているが、ここではその点を中心とする所定領域内の相互相関係数が最小となるような座標を見つける手法(ブロックマッチング法)を用いて追跡を行う。なお、本発明ではフォーカスブラケット撮影を行っているので、焦点位置が移動することによって対応点が移動する方向、及び移動する量は予測可能である。焦点位置の移動による対応点の移動は、画面中心から放射方向へ、又はその逆方向への移動であり、これは焦点位置の移動方向から予測可能である。またその移動量も焦点位置の移動量から予測可能である。よって、これらを考慮して対応点を検出することで、精度、速度ともに対応点検出性能を向上させることができる。   In the selected tracking image, one of the feature points extracted from the reference image is selected (step S45), and the position to which the feature point has moved is tracked (step S46). Various tracking methods have also been proposed. Here, tracking is performed using a method (block matching method) that finds coordinates that minimize the cross-correlation coefficient within a predetermined area centered on that point. Do. Since focus bracket photography is performed in the present invention, the direction and amount of movement of the corresponding point as the focal position moves can be predicted. The movement of the corresponding point by the movement of the focal position is a movement from the center of the screen in the radial direction or in the opposite direction, and this can be predicted from the movement direction of the focal position. The amount of movement can also be predicted from the amount of movement of the focal position. Therefore, by detecting the corresponding points in consideration of these, the corresponding point detection performance can be improved in both accuracy and speed.

特徴点の追跡が終了すると、全特徴点に対して処理を行ったか否かの判定を行う(ステップS47)。処理を行っていない特徴点がある場合は、その特徴点を選択し(ステップS45)、追跡を行う(ステップS46)。このように全ての特徴点において、追跡を行う。   When the tracking of feature points is completed, it is determined whether or not processing has been performed for all feature points (step S47). If there is a feature point that has not been processed, the feature point is selected (step S45), and tracking is performed (step S46). In this way, tracking is performed for all feature points.

全ての特徴点に対して処理を行うと、次に全ての追跡画像に対してこの処理を行ったか否かの判定を行う(ステップS47)。前述したように、この処理は基準画像以外の画像について行う。処理を行っていない追跡画像がある場合は、その追跡画像において同様の処理を行う。全ての追跡画像に対して処理が終了すると、対応点検出処理が終了する。   If processing has been performed for all feature points, it is next determined whether or not this processing has been performed for all tracking images (step S47). As described above, this process is performed for images other than the reference image. If there is a tracking image that has not been processed, the same processing is performed on the tracking image. When the process is finished for all the tracking images, the corresponding point detection process is finished.

対応点検出処理が終了すると、次に画像変形を行う(ステップS25)。この画像変形処理は、対応点検出処理で得られた各追跡画像の対応点が基準画像の対応点の位置に極力一致するように、画像変形部37が追跡画像を変形する。図5は、画像変形について示す図である。図5(a)に示す基準画像に対して、図5(b)に示すように各対応点が平行移動している場合は、平行移動を行う。また図5(c)に示すように各対応点が回転移動している場合は、回転移動を行う。また図5(d)に示すように各対応点が拡大(縮小)している場合は、縮小(拡大)を行う。これらの画像変形は、複数組の対応点の距離の総和が最小となるように移動ベクトルを決めればよい。なお、これらの平行移動、回転、及び拡大・縮小処理は、アフィン変換により行う。   When the corresponding point detection process is completed, the image is then deformed (step S25). In this image deformation process, the image deformation unit 37 deforms the tracking image so that the corresponding point of each tracking image obtained by the corresponding point detection process matches the position of the corresponding point of the reference image as much as possible. FIG. 5 is a diagram illustrating image deformation. When the corresponding points are translated with respect to the reference image shown in FIG. 5A, translation is performed. Further, as shown in FIG. 5C, when each corresponding point is rotationally moved, the rotational movement is performed. Further, as shown in FIG. 5D, when each corresponding point is enlarged (reduced), reduction (enlargement) is performed. For these image deformations, the movement vector may be determined so that the total sum of the distances between a plurality of sets of corresponding points is minimized. These parallel movement, rotation, and enlargement / reduction processing are performed by affine transformation.

また図5(e)に示すように基準画像と追跡画像との間に複雑な動きが生じている場合は、全ての対応点をより精度よく一致させるためにはワーピングを行う。ワーピングは全ての対応点の組を完全に一致するような移動ベクトルを選択するとともに、その周囲の点も補間により求めるものである。   Further, as shown in FIG. 5E, when a complicated movement occurs between the reference image and the tracking image, warping is performed in order to match all corresponding points more accurately. In the warping, a movement vector that completely matches a set of all corresponding points is selected, and surrounding points are also obtained by interpolation.

このように対応点の位置を極力一致させた複数画像に対して、画像合成を行う(ステップS26)。図6は、画像合成処理の動作を示すフローチャートである。画像合成処理では、複数画像において最も鮮鋭度が高い画像、即ち最も焦点の合った画像の画素値を選択し、合成することにより、最終画像として画面内のどの位置においても鮮鋭度が高い画像、即ち全焦点画像を得る。   In this way, image synthesis is performed on a plurality of images in which the positions of corresponding points are matched as much as possible (step S26). FIG. 6 is a flowchart showing the operation of the image composition process. In the image composition process, an image having the highest sharpness in a plurality of images, that is, an image having a high sharpness at any position in the screen as a final image by selecting and synthesizing the pixel values of the most focused image, That is, an omnifocal image is obtained.

まず、画像合成部38が、処理を行う画素の選択を行う(ステップS61)。この画素の選択の順序については、画面の端から順に行えばよく、また他の順序でも構わない。次に、画像の選択を行い(ステップS62)、選択した画像における、ステップS61で選択された画素の鮮鋭度を算出する(ステップS63)。   First, the image composition unit 38 selects a pixel to be processed (step S61). The order of selecting the pixels may be performed in order from the edge of the screen, and other orders may be used. Next, an image is selected (step S62), and the sharpness of the pixel selected in step S61 in the selected image is calculated (step S63).

鮮鋭度の算出については、ラプラシアンフィルタ処理による出力値の絶対値を算出することにより行う。図7は、ラプラシアンフィルタのフィルタ行列を示す図である。ラプラシアンフィルタ処理を行うことによりエッジ検出をすることができ、この出力値の絶対値が鮮鋭度を示す。画像のぼけと鮮鋭度に関しては、画像のぼけが小さい画素ほど鮮鋭度が高く、ぼけが大きくなるほど鮮鋭度が低くなるという関係がある。なお、ラプラシアンフィルタのカーネルはこの例に限定されるものではなく、またラプラシアンフィルタ以外の鮮鋭度算出フィルタを用いてもよい。   The sharpness is calculated by calculating the absolute value of the output value by Laplacian filter processing. FIG. 7 is a diagram illustrating a filter matrix of a Laplacian filter. Edge detection can be performed by performing Laplacian filter processing, and the absolute value of the output value indicates the sharpness. Regarding the blur and sharpness of an image, there is a relationship in which a pixel having a smaller blur of the image has a higher sharpness and a sharper the lower the blur is. The kernel of the Laplacian filter is not limited to this example, and a sharpness calculation filter other than the Laplacian filter may be used.

次に、全画像に対して鮮鋭度の算出が終了したか否かの判定を行う(ステップS64)。鮮鋭度の算出をしていない画像が有る場合には、再び画像の選択を行い(ステップS62)、選択した画像における、ステップS61で選択された画素の鮮鋭度を算出する(ステップS63)。このように、全画像に対して、ステップS61で選択された画素の鮮鋭度を算出する。   Next, it is determined whether or not the sharpness calculation has been completed for all images (step S64). If there is an image whose sharpness is not calculated, the image is selected again (step S62), and the sharpness of the pixel selected in step S61 in the selected image is calculated (step S63). In this way, the sharpness of the pixel selected in step S61 is calculated for all images.

次に、鮮鋭度が最大となる画像の画素値を出力する(ステップS65)。ステップS63において算出した、各画像のステップS61で選択した画素のラプラシアンフィルタ処理における出力値の絶対値を比較し、最大の値である画像の画素値を出力画素して採用する。また、鮮鋭度の高い画像の画素値に対する重みを大きくして加重平均を算出し、これを出力してもよい。   Next, the pixel value of the image with the maximum sharpness is output (step S65). The absolute value of the output value in the Laplacian filter processing of the pixel selected in step S61 of each image calculated in step S63 is compared, and the pixel value of the image that is the maximum value is used as the output pixel. Alternatively, the weighted average may be calculated by increasing the weight for the pixel value of the image with high sharpness, and this may be output.

以上の処理を全ての画素に対して行う。全画素に対して処理が行われたか否かを判定し、全画素に対して終了した場合は、画像合成処理が終了する。   The above processing is performed for all pixels. It is determined whether or not processing has been performed for all pixels, and when the processing has been completed for all pixels, the image composition processing ends.

画像合成処理が終了すると、CPU24は画像合成部38の出力画像をメモリ制御部32を介して記録媒体33に記録して、全焦点画像撮影が終了する(ステップS27)。   When the image composition process is completed, the CPU 24 records the output image of the image composition unit 38 on the recording medium 33 via the memory control unit 32, and the omnifocal image capturing is completed (step S27).

この画像合成部38の出力画像は、記録媒体33に保存せずに、表示制御部34を介して表示部35に表示するだけでもよいし、図示しない外部インターフェースを用いて、外部モニタに表示したり、プリンタ等に印刷物として出力してもよい。   The output image of the image composition unit 38 may be displayed on the display unit 35 via the display control unit 34 without being stored in the recording medium 33, or displayed on an external monitor using an external interface (not shown). Or output as a printed matter to a printer or the like.

このようにして、被写体ブレや手ブレがあっても、全焦点画像を得ることができる。   In this way, an omnifocal image can be obtained even when there is subject blur or camera shake.

特徴点の抽出方法や、特徴点の追跡方法、画像の変形方法、及び画素の鮮鋭度の算出方法については、本実施の形態の方法に限定されず、どの手法を用いても構わない。   The feature point extraction method, the feature point tracking method, the image deformation method, and the pixel sharpness calculation method are not limited to the method of the present embodiment, and any method may be used.

<第2の実施の形態>
次に、デジタルカメラ1におけるぼけ強調撮影について説明する。図8は、ぼけ強調画像を撮影するためのぼけ強調撮影モードの動作を示すフローチャートである。なお、図2のフローチャートと共通する部分には同一の符号を付し、その詳細な説明は省略する。
<Second Embodiment>
Next, blur enhanced shooting in the digital camera 1 will be described. FIG. 8 is a flowchart showing an operation in a blur-enhanced shooting mode for shooting a blur-enhanced image. The parts common to the flowchart of FIG. 2 are denoted by the same reference numerals, and detailed description thereof is omitted.

本発明に係るデジタルカメラ1のぼけ強調画像撮影モードでは、オートフォーカスにより主要被写体の合焦位置とその前後の焦点位置での撮影を含むフォーカスブラケット撮影を行い、各撮影画像の対応点を検出し、対応点の位置が一致するように各撮影画像を変形し、変形した画像を合成することによりぼけ強調画像を得る。   In the blur-enhanced image shooting mode of the digital camera 1 according to the present invention, focus bracket shooting including shooting at the in-focus position of the main subject and the front and rear focus positions is performed by autofocus, and corresponding points of each captured image are detected. Then, each captured image is deformed so that the positions of the corresponding points coincide with each other, and the blurred image is obtained by combining the deformed images.

まず操作部23のモードスイッチを操作することにより、ぼけ強調画像撮影モードに設定される。次に操作部23におけるシャッターボタンが押されると、まず主要被写体に対して自動合焦位置判断(AF)を行う(ステップS81)。このAFについては、通常撮影の際に行われるAFと同じものでよく、撮影に先立ってレンズの焦点位置を駆動させ、その都度積算部31でバンドパスフィルタの出力値等のAF評価値を算出し、CPUにて最もAF評価値の高い焦点位置を合焦位置と判断する。   First, the blur-enhanced image shooting mode is set by operating the mode switch of the operation unit 23. Next, when the shutter button in the operation unit 23 is pressed, automatic focus position determination (AF) is first performed on the main subject (step S81). This AF may be the same as that performed during normal shooting, and the focal position of the lens is driven prior to shooting, and an AF evaluation value such as an output value of a bandpass filter is calculated by the integrating unit 31 each time. Then, the CPU determines that the focus position with the highest AF evaluation value is the in-focus position.

ぼけ強調画像撮影モードでのフォーカスブラケット撮影においては、主要被写体のAF合焦位置と主要被写体のAF合焦位置の前後の焦点位置を含むように焦点位置を移動させて撮影を行う。図9は、デジタルカメラ1の各焦点位置を横軸に、各焦点位置における主要被写体に対するAF評価値を縦軸に表したグラフである。最もAF評価値の高い焦点位置が主要被写体の合焦位置であり、この主要被写体の合焦位置をBとすると、本実施の形態のフォーカスブラケット撮影においては、合焦位置Bと、その前後に所定距離dだけ離れた焦点位置A及びCの3点を撮影の際の焦点位置とする。このdについては、予めデジタルカメラ1内に記憶された固定値でもよいし、ユーザが設定してもよい。また被写界深度を判断し、この被写界深度によって異ならせてもよい。被写界深度によりぼけの度合いが異なるため、被写界深度によりdの値を変更することにより、適切なぼけ具合の意図する画像を得ることが可能となる。   In focus bracket shooting in the blur-enhanced image shooting mode, shooting is performed by moving the focus position to include the AF focus position of the main subject and the focus positions before and after the AF focus position of the main subject. FIG. 9 is a graph in which each focal position of the digital camera 1 is represented on the horizontal axis, and the AF evaluation value for the main subject at each focal position is represented on the vertical axis. The focus position with the highest AF evaluation value is the focus position of the main subject. If the focus position of the main subject is B, in the focus bracket shooting of the present embodiment, the focus position B is Three focal points A and C that are separated by a predetermined distance d are taken as focal positions at the time of photographing. This d may be a fixed value stored in advance in the digital camera 1 or may be set by the user. Further, the depth of field may be determined and varied depending on the depth of field. Since the degree of blur differs depending on the depth of field, it is possible to obtain an image with an appropriate degree of blur by changing the value of d depending on the depth of field.

このように決められた焦点位置において、第1の実施の形態の全焦点画像撮影モードと同様に、フォーカスブラケット撮影を行う(ステップS21〜S23)。各撮影画像は、メインメモリ28のRAM領域に格納される。   At the focal position determined in this way, focus bracket shooting is performed in the same manner as in the omnifocal image shooting mode of the first embodiment (steps S21 to S23). Each captured image is stored in the RAM area of the main memory 28.

フォーカスブラケット撮影が終了すると、各撮影画像における対応点の検出を行う(ステップS24)。ここでは、基準画像を主要被写体の合焦位置Bで撮影された画像とする。対応点検出は第1の実施の形態と同様に行う。   When focus bracket photography is completed, corresponding points in each photographed image are detected (step S24). Here, it is assumed that the reference image is an image taken at the in-focus position B of the main subject. Corresponding point detection is performed in the same manner as in the first embodiment.

対応点検出処理が終了すると、次に画像変形を行う(ステップS25)。画像変形においても、第1の実施の形態と同様に行う。   When the corresponding point detection process is completed, the image is then deformed (step S25). The image deformation is performed in the same manner as in the first embodiment.

画像変形処理が終了すると、次に画像合成を行う。図10は第2の実施の形態における画像合成処理の動作のフローチャートである。なお、図6のフローチャートと共通する部分には同一の符号を付し、その詳細な説明は省略する。本発明の第2の実施の形態のデジタルカメラ1のぼけ強調画像撮影モードにおいては、画像合成処理において、複数画像において基準画像が最も鮮鋭度が高い場合は基準画像の画素を選択し、基準画像以外の画像が最も鮮鋭度が高い場合は、主要被写体の合焦位置に関して、画素の鮮鋭度が最大の焦点位置と対称となる焦点位置で撮影された画像の画素を選択することにより、ぼけ強調画像を得る。   When the image transformation process is completed, image composition is performed next. FIG. 10 is a flowchart of the operation of the image composition process in the second embodiment. In addition, the same code | symbol is attached | subjected to the part which is common in the flowchart of FIG. 6, and the detailed description is abbreviate | omitted. In the blur-enhanced image shooting mode of the digital camera 1 according to the second embodiment of the present invention, when the reference image has the highest sharpness in a plurality of images in the image composition process, a pixel of the reference image is selected, and the reference image If the other image has the highest sharpness, blur enhancement is selected by selecting the pixel of the image taken at the focal position where the sharpness of the pixel is symmetric with respect to the focus position of the main subject. Get an image.

第1の実施の形態と同様に、画像合成部38は、処理を行う画素の選択を行い(ステップS61)、この選択された画素の各画像の鮮鋭度を算出する(ステップS62〜S64)。図11は、主要被写体の合焦位置Bで撮影された画像と、その合焦位置の前後の焦点位置であるA及びCで撮影された画像の、鮮鋭度の関係を示すグラフである。フォーカスブラケット撮影で3枚の画像を撮影した場合、このA、B、及びCの焦点位置で撮影された画像の鮮鋭度の関係は、図11(a)に示すCが最大の場合、図11(b)に示すBが最大の場合、及び図11(c)に示すAが最大の場合の3種類に分類することができる。   Similar to the first embodiment, the image composition unit 38 selects a pixel to be processed (step S61), and calculates the sharpness of each image of the selected pixel (steps S62 to S64). FIG. 11 is a graph showing the relationship between the sharpness of an image shot at the focus position B of the main subject and images shot at the focus positions A and C before and after the focus position. When three images are captured by focus bracket imaging, the relationship between the sharpness of images captured at the focal positions of A, B, and C is as shown in FIG. 11 when C shown in FIG. It can be classified into three types when B shown in (b) is maximum and when A shown in FIG. 11 (c) is maximum.

全画像において選択された画素の鮮鋭度を算出すると、この算出された鮮鋭度に基づいて、基準画像の鮮鋭度が最大であるか否か、即ち鮮鋭度が図11(b)に示す関係であるか否かの判定を行う(ステップS101)。基準画像の鮮鋭度が最大の場合は、基準画像の画素値を出力する(ステップS102)。基準画像の鮮鋭度が最大でない場合は、主要被写体の合焦位置より遠い側の画像の鮮鋭度が最大であるか否か、即ち鮮鋭度が図11(a)に示す関係であるか否かの判定を行う(ステップS103)。主要被写体の合焦位置より遠い側の画像の鮮鋭度が最大の場合は、主要被写体の合焦位置より近い側の画像の画素値を出力する(ステップS104)。また逆に、主要被写体の合焦位置より遠い側の画像の鮮鋭度が最大でない場合は、主要被写体の合焦位置より近い側の画像の鮮鋭度が最大である、即ち鮮鋭度が図11(c)に示す関係であるので、主要被写体の合焦位置より遠い側の画像の画素値を出力する(ステップS105)。   When the sharpness of the selected pixel in all the images is calculated, based on the calculated sharpness, whether or not the sharpness of the reference image is the maximum, that is, the sharpness is in the relationship shown in FIG. It is determined whether or not there is (step S101). If the sharpness of the reference image is maximum, the pixel value of the reference image is output (step S102). When the sharpness of the reference image is not the maximum, whether the sharpness of the image farther from the in-focus position of the main subject is the maximum, that is, whether the sharpness has the relationship shown in FIG. Is determined (step S103). When the sharpness of the image farther from the focus position of the main subject is maximum, the pixel value of the image closer to the focus position of the main subject is output (step S104). On the contrary, when the sharpness of the image farther from the in-focus position of the main subject is not the maximum, the sharpness of the image closer to the in-focus position of the main subject is the maximum, that is, the sharpness is as shown in FIG. Because of the relationship shown in c), the pixel value of the image farther from the focus position of the main subject is output (step S105).

この処理を、全ての画素について行う。全画素に対して処理が終了したと判断すると(ステップS106)、画像合成処理が終了する。   This process is performed for all pixels. When it is determined that the processing has been completed for all the pixels (step S106), the image composition processing ends.

画像合成処理が終了すると、CPU24は画像合成部38の出力画像をメモリ制御部3
2を介して記録媒体33に記録して(ステップS27)、ぼけ強調画像撮影が終了する。
When the image composition processing is completed, the CPU 24 uses the output image of the image composition unit 38 as the memory control unit 3.
2 is recorded on the recording medium 33 (step S27), and blur-emphasized image shooting is completed.

このように、主要被写体の合焦位置Bで撮影された画像の鮮鋭度が低い画素の座標において、ぼけが強くなる画素値を選択することにより、ぼけ強調が可能となる。焦点位置が3点を超える場合でも、鮮鋭度の最大値を取る焦点位置と合焦位置を挟んで反対側の焦点位置にある複数画像から、ぼけ強調度合いに応じて選択すればよい。つまり、よりぼけを強調したい場合には、より鮮鋭度の低い画像の画素値を出力すればよい。   As described above, blur enhancement can be performed by selecting a pixel value at which blur is strong in the coordinates of a pixel having low sharpness in an image photographed at the in-focus position B of the main subject. Even when the focal position exceeds three points, selection may be made according to the degree of blur enhancement from a plurality of images at opposite focal positions across the focal position and the focal position where the maximum sharpness is obtained. That is, when it is desired to emphasize blur, it is only necessary to output pixel values of an image with lower sharpness.

なお、本実施の形態においては主要被写体の合焦位置と、合焦位置に対してdだけ離れたA及びCにおいてフォーカスブラケット撮影を行ったが、A及びCはBに対して対称でなく、dとd’のように合焦位置からの距離が異なってもよい。   In this embodiment, focus bracket shooting was performed at the in-focus position of the main subject and at A and C separated by d from the in-focus position. However, A and C are not symmetrical with respect to B. The distance from the in-focus position may be different as d and d ′.

また、本実施の形態の図10に示す画像合成処理は、対応点検出及び画像変形を行わない画像に対して行ってもよい。即ち、フォーカスブラケット撮影した複数画像において、直接この画像合成処理を行ってもよい。   Further, the image composition processing shown in FIG. 10 of the present embodiment may be performed on an image that is not subjected to corresponding point detection and image deformation. In other words, this image composition processing may be performed directly on a plurality of images taken with focus bracketing.

<第3の実施の形態>
本発明に係る第3の実施の形態のぼけ強調撮影について説明する。図12は、本発明に係る第3の実施の形態のデジタルカメラ1の内部構成の一例を示すブロック図である。図1に示すブロック図とは、画像合成部38の代わりにフィルタ処理部40を備えたところだけが異なる。
<Third Embodiment>
The blur-enhanced shooting according to the third embodiment of the present invention will be described. FIG. 12 is a block diagram showing an example of the internal configuration of the digital camera 1 according to the third embodiment of the present invention. 1 differs from the block diagram shown in FIG. 1 only in that a filter processing unit 40 is provided instead of the image synthesis unit 38.

図13は、デジタルカメラ1のぼけ強調撮影モードの動作を示すフローチャートである。なお、図2及び図8のフローチャートと共通する部分には同一の符号を付し、その詳細な説明は省略する。本発明の第3の実施の形態のデジタルカメラ1のぼけ強調画像撮影モードでは、オートフォーカスにより主要被写体の合焦位置とその前後の焦点位置での撮影を含むフォーカスブラケット撮影を行い、各撮影画像の対応点を検出し、対応点の位置が一致するように各撮影画像を変形し、変形した画像から各画素の鮮鋭度を算出し、鮮鋭度に基づいたフィルタ係数で基準画像にフィルタ処理を施すことによりぼけ強調画像を得る。   FIG. 13 is a flowchart showing the operation of the blur enhancement shooting mode of the digital camera 1. The parts common to the flowcharts of FIGS. 2 and 8 are denoted by the same reference numerals, and detailed description thereof is omitted. In the blur-enhanced image shooting mode of the digital camera 1 according to the third embodiment of the present invention, focus bracket shooting including shooting at the in-focus position of the main subject and the front and rear focus positions is performed by autofocus, and each captured image is captured. The corresponding points are detected, the captured images are deformed so that the positions of the corresponding points coincide with each other, the sharpness of each pixel is calculated from the deformed image, and the reference image is filtered with a filter coefficient based on the sharpness. By applying this, a blur-emphasized image is obtained.

これまでと同様に、ぼけ強調撮影モードにおいて操作部23のシャッターボタンが押されると、主要被写体に対して自動合焦位置判断を行い(ステップS81)、次に焦点位置間隔dを決定する(ステップS161)。   As before, when the shutter button of the operation unit 23 is pressed in the blur-enhanced shooting mode, the automatic focus position determination is performed on the main subject (step S81), and then the focal position interval d is determined (step S81). S161).

本実施の形態では、フォーカスブラケット撮影の際に設定される焦点位置には、主要被写体の合焦位置と、その前後の焦点位置を含むようにする。ここでは図14に示すように、主要被写体の合焦位置F3、主要被写体の合焦位置から前後に焦点間隔dだけ離れた焦点位置F2及びF4、さらに主要被写体の合焦位置F3から遠ざかる方向に、焦点位置F2及びF4から焦点間隔dだけ離れた焦点位置のF1及びF5、の計5点をフォーカスブラケット撮影の際の焦点位置とする。なお、焦点位置の端から順に、F1で撮影された画像の番号を1、F2で撮影された画像の番号を2、・・・、F5で撮影された画像の番号を5、とする。   In the present embodiment, the focus position set at the time of focus bracket shooting includes the focus position of the main subject and the focus positions before and after the focus position. Here, as shown in FIG. 14, the focus position F3 of the main subject, the focus positions F2 and F4 that are separated from the focus position of the main subject by the focal interval d, and further away from the focus position F3 of the main subject. A total of five points, F1 and F5 at focal positions separated from the focal positions F2 and F4 by a focal distance d, are taken as focal positions for focus bracket photography. Note that in order from the end of the focal position, the number of the image captured at F1 is 1, the number of the image captured at F2 is 2,..., And the number of the image captured at F5 is 5.

図15は、撮影時の絞りと焦点距離、及びフォーカスブラケット撮影時の焦点位置の間隔dの関係を3次元的に示したグラフである。このように、絞りのF値が小さい場合や焦点距離が長い場合など、被写界深度が浅い場合はdを小さく、逆に絞りのF値が大きい場合や焦点距離が短い場合など、被写界深度が深い場合はdを大きくするように設定されている。CPU24は、メインメモリ28のROM領域に記憶されたこの設定に基づいて焦点間隔dを決定する。これにより、任意の絞りと焦点距離において、ぼけ強調に適した焦
点の異なる画像を得ることができる。なお、焦点間隔dは一定でなくてもよく、例えば主要被写体の合焦位置から見てNEAR側とFAR側で変えるようにしてもよい。
FIG. 15 is a graph three-dimensionally showing the relationship between the aperture and focal length at the time of shooting, and the distance d between the focal positions at the time of focus bracket shooting. Thus, when the depth of field is shallow, such as when the F value of the diaphragm is small or when the focal length is long, d is small, and conversely, when the F value of the diaphragm is large or the focal length is short, the object is captured. When the depth of field is deep, d is set to be large. The CPU 24 determines the focal distance d based on this setting stored in the ROM area of the main memory 28. As a result, images with different focal points suitable for blur enhancement can be obtained at any aperture and focal length. Note that the focal distance d does not have to be constant, and for example, it may be changed between the NEAR side and the FAR side when viewed from the focus position of the main subject.

以上のように撮影時の絞りと焦点距離から焦点間隔dを決定すると、次にF1〜F5の焦点位置において、フォーカスブラケット撮影を行う(ステップS21〜S23)。この撮影の順序に関しては、適宜決めてよい。各撮影画像は、メインメモリ28のRAM領域に格納される。   When the focal distance d is determined from the aperture and focal length at the time of photographing as described above, focus bracket photographing is performed at the focal positions F1 to F5 (steps S21 to S23). The order of shooting may be determined as appropriate. Each captured image is stored in the RAM area of the main memory 28.

フォーカスブラケット撮影が終了すると、主要被写体の合焦位置で撮影された画像を基準画像として、各撮影画像における対応点の検出を行う(ステップS24)。対応点の検出は、第一の実施の形態と同様に行う。対応点検出処理が終了すると、次に画像変形を行う(ステップS25)。   When focus bracket shooting is completed, the corresponding points in each captured image are detected using the image captured at the in-focus position of the main subject as a reference image (step S24). Corresponding points are detected in the same manner as in the first embodiment. When the corresponding point detection process is completed, the image is then deformed (step S25).

画像変形処理が終了すると、次にぼかし量算出を行う(ステップS162)。図16は、ぼかし量算出処理の動作を示すフローチャートである。なお、図6のフローチャートと共通する部分には同一の符号を付し、その詳細な説明は省略する。   When the image transformation process is completed, the blur amount is calculated (step S162). FIG. 16 is a flowchart showing the operation of the blur amount calculation process. In addition, the same code | symbol is attached | subjected to the part which is common in the flowchart of FIG. 6, and the detailed description is abbreviate | omitted.

最初に、フィルタ処理部40が、処理を行う画素の選択を行う(ステップS61)。次に、画像の選択を行い(ステップS62)、選択した画像における、ステップS61で選択された画素の鮮鋭度を算出する(ステップS63)。鮮鋭度の算出においては、第1の実施の形態と同様に、ラプラシアンフィルタ処理における出力値の絶対値を算出することにより行う。全画像に対して、ステップS61で選択された画素の鮮鋭度を算出する。   First, the filter processing unit 40 selects a pixel to be processed (step S61). Next, an image is selected (step S62), and the sharpness of the pixel selected in step S61 in the selected image is calculated (step S63). The sharpness is calculated by calculating the absolute value of the output value in the Laplacian filter process, as in the first embodiment. The sharpness of the pixel selected in step S61 is calculated for all images.

全画像に対して鮮鋭度の算出が終了したと判断すると(ステップS64)、次に算出した鮮鋭度が最大である画像番号nを算出し(ステップS191)、ぼかし量kを算出する(ステップS192)。   When it is determined that the calculation of the sharpness has been completed for all the images (step S64), the next image number n having the maximum calculated sharpness is calculated (step S191), and the blurring amount k is calculated (step S192). ).

ここで、主要被写体の合焦位置で撮影された画像番号をcとすると、ぼかし量kは以下の式で表される。   Here, if the image number taken at the in-focus position of the main subject is c, the blur amount k is expressed by the following equation.

(数1)
k=u×(nーc)
ここで、uはユーザが指定したぼけ強調度合いであり、uが1.0よりも大きければ基準設定よりもぼけが強調され、uが1.0未満の場合は基準設定よりもぼけが緩和される画像となる。なお、ぼけ強調度合いuは、ユーザが操作部23を操作することにより設定が可能となっている。また、本実施の形態ではc=3である。
(Equation 1)
k = u × (nc)
Here, u is the degree of blur enhancement specified by the user. If u is larger than 1.0, the blur is emphasized more than the standard setting, and if u is less than 1.0, the blur is reduced more than the standard setting. Image. Note that the blur enhancement degree u can be set by the user operating the operation unit 23. In this embodiment, c = 3.

このぼかし量kの算出を全ての画素について行う。全ての画素について終了したと判断すると(ステップS66)、ぼかし量算出処理が終了する。   This blur amount k is calculated for all pixels. If it is determined that all the pixels have been completed (step S66), the blurring amount calculation process ends.

ぼかし量算出処理が終了すると、次にぼかし処理を行う(ステップS163)。図17は、ぼかし処理の動作を示すフローチャートである。本実施の形態では、ぼかし処理にガウシアンフィルタを用いる。   When the blur amount calculation process ends, the blur process is performed (step S163). FIG. 17 is a flowchart showing the operation of the blurring process. In this embodiment, a Gaussian filter is used for the blurring process.

まずフィルタ処理部40が、画素の選択を行い(ステップS61)、選択した画素のぼかし量kを選択する。図16のステップS192で算出された各画素のぼかし量kは、メインメモリ28のRAM領域に記憶されており、これを読み出す。   First, the filter processing unit 40 selects a pixel (step S61), and selects a blur amount k of the selected pixel. The blur amount k of each pixel calculated in step S192 in FIG. 16 is stored in the RAM area of the main memory 28, and is read out.

次に、読み出したぼかし量の絶対値|k|と所定の閾値Thとの比較を行う(ステップS202)。所定の閾値Thの方が大きい場合は、この画素を合焦領域とみなして被写体の合焦位置F3で撮影した画素値を出力する(ステップS146)。ぼかし量の絶対値|k|の方が大きい場合は、この画素をぼけ強調すべき領域とみなしてフィルタ係数を決定する(ステップS203)。   Next, the absolute value | k | of the read blur amount is compared with a predetermined threshold Th (step S202). If the predetermined threshold Th is larger, this pixel is regarded as a focus area, and a pixel value photographed at the focus position F3 of the subject is output (step S146). If the absolute value | k | of the blurring amount is larger, this pixel is regarded as a region to be blurred and emphasized, and a filter coefficient is determined (step S203).

前述したように、本実施の形態では、このフィルタ処理にガウシアンフィルタを用いる。図18は、ぼかし量の絶対値|k|と、ガウシアンフィルタのσパラメータの関係を示したグラフである。図18に示すように、ぼかし量の絶対値|k|が所定の閾値Th以上のとき、ぼかし量の絶対値|k|と比例関係にあるガウシアンフィルタのσパラメータが求められ、このσパラメータに応じたガウシアンフィルタ係数f(x)を決定する。CPU24は、メインメモリ28のRAM領域に記憶されたこの関係に基づいてσパラメータを決定する。   As described above, in this embodiment, a Gaussian filter is used for this filter processing. FIG. 18 is a graph showing the relationship between the absolute value | k | of the blur amount and the σ parameter of the Gaussian filter. As shown in FIG. 18, when the absolute value | k | of the blur amount is equal to or greater than a predetermined threshold Th, a σ parameter of a Gaussian filter that is proportional to the absolute value | k | of the blur amount is obtained. A corresponding Gaussian filter coefficient f (x) is determined. The CPU 24 determines the σ parameter based on this relationship stored in the RAM area of the main memory 28.

図18(b)は、注目画素からの距離xとガウシアンフィルタのフィルタ係数f(x)の関係を示したグラフである。図18(b)に示すように、ガウシアンフィルタはσパラメータが大きいほど周辺画素の重みを大きくして加重平均をとる。よってぼかし量の絶対値|k|の大きさに応じてσパラメータを大きくすることにより、ぼかし量の絶対値|k|が大きいほど平滑化の度合いを大きくすることができる。   FIG. 18B is a graph showing the relationship between the distance x from the target pixel and the filter coefficient f (x) of the Gaussian filter. As shown in FIG. 18B, the Gaussian filter takes a weighted average by increasing the weight of surrounding pixels as the σ parameter increases. Therefore, by increasing the σ parameter in accordance with the magnitude of the absolute value | k | of the blur amount, the degree of smoothing can be increased as the absolute value | k | of the blur amount increases.

このように求められたσパラメータからフィルタ係数f(x)を算出するには、[数2]を用いて演算を行い、算出されたフィルタ係数の総和が1になるように正規化を行う。   In order to calculate the filter coefficient f (x) from the σ parameter thus obtained, calculation is performed using [Equation 2], and normalization is performed so that the total sum of the calculated filter coefficients becomes 1.

Figure 2010279054
Figure 2010279054

デジタルフィルタの場合は注目画素を中心とした離散位置ごとにf(x)が決定される。例えば5タップフィルタの場合は、f(x)={0.1、0.2、0.4、0.2、0.1}などとなる。なお一般には画像の明るさが変動しないよう、各係数の総和が1.0になるように正規化される。またここでは1次元のフィルタ係数で表現しているが、このフィルタを水平方向と垂直方向に順に施すことにより2次元のフィルタ処理を行うことができる。   In the case of a digital filter, f (x) is determined for each discrete position centered on the target pixel. For example, in the case of a 5-tap filter, f (x) = {0.1, 0.2, 0.4, 0.2, 0.1}. In general, normalization is performed so that the sum of the coefficients is 1.0 so that the brightness of the image does not fluctuate. In addition, although it is expressed by a one-dimensional filter coefficient here, two-dimensional filter processing can be performed by sequentially applying this filter in the horizontal direction and the vertical direction.

このように、選択した画素について、ぼかし量に応じたフィルタ処理を行い、出力画素値を算出する(ステップS145)。この処理を全画素について行い、全画素に対して処理が終了したと判断すると(ステップS66)、ぼかし処理が終了する。このように、主要被写体の合焦位置Bで撮影された基準画像に対してフィルタ処理を行うことにより、より自然なぼけ強調が可能となる。   As described above, the selected pixel is subjected to the filtering process according to the blur amount, and the output pixel value is calculated (step S145). This process is performed for all pixels, and if it is determined that the process has been completed for all pixels (step S66), the blurring process is terminated. As described above, by performing the filtering process on the reference image captured at the in-focus position B of the main subject, more natural blur enhancement can be performed.

なお、このフィルタ処理に用いるフィルタはガウシアンフィルタに限られるものではなく、ローパスフィルタなら他のフィルタでも構わない。例えば絞りやレンズの特性に応じたぼけ形状を持ったフィルタを用いてもよい。   Note that the filter used for this filter processing is not limited to the Gaussian filter, and other filters may be used as long as they are low-pass filters. For example, a filter having a blur shape corresponding to the characteristics of the diaphragm or lens may be used.

ぼかし処理が終了すると、CPU24はフィルタ処理部40の出力画像をメモリ制御部32を介して記録媒体33に記録して、全焦点画像撮影が終了する(ステップS27)。   When the blurring process ends, the CPU 24 records the output image of the filter processing unit 40 on the recording medium 33 via the memory control unit 32, and the omnifocal image shooting ends (step S27).

このようにして、ぼけ強調画像を得ることができる。   In this way, a blur-emphasized image can be obtained.

なお、本実施の形態の図16及び図17に示すぼかし処理は、対応点検出及び画像変形を行わない画像に対して行ってもよい。即ち、フォーカスブラケット撮影した複数画像において、直接この画像合成処理を行ってもよい。   Note that the blurring process shown in FIGS. 16 and 17 of the present embodiment may be performed on an image that is not subjected to corresponding point detection and image deformation. In other words, this image composition processing may be performed directly on a plurality of images taken with focus bracketing.

1…デジタルカメラ、11…撮影レンズ、12…絞り、13…Irカットフィルタ、14…光学ローパスフィルタ、15…固体撮像素子、23…操作部、24…CPU、25…アドレスバス、26…データバス、27…メインメモリ制御部、28…メインメモリ、32…メモリ制御部、33…記録媒体、36…対応点検出部、37…画像変形部、38…画像合成部、40…フィルタ処理部   DESCRIPTION OF SYMBOLS 1 ... Digital camera, 11 ... Shooting lens, 12 ... Aperture, 13 ... Ir cut filter, 14 ... Optical low pass filter, 15 ... Solid-state image sensor, 23 ... Operation part, 24 ... CPU, 25 ... Address bus, 26 ... Data bus , 27 ... main memory control section, 28 ... main memory, 32 ... memory control section, 33 ... recording medium, 36 ... corresponding point detection section, 37 ... image deformation section, 38 ... image composition section, 40 ... filter processing section

Claims (7)

画像データに基づいて主要被写体の合焦位置を判断する自動合焦位置判断手段と、
予め定められた移動量で離散的に焦点位置を移動して順次画像を撮影することにより複数の画像を得るフォーカスブラケット撮影手段と、
前記移動する焦点位置が前記自動合焦位置判断手段により判断された前記主要被写体の合焦位置とその前後の焦点位置を含むように制御する焦点位置制御手段と、
前記主要被写体の合焦位置で撮影された画像及び前記主要被写体の合焦位置の前後の焦点位置で撮影された画像を含む前記フォーカスブラケット撮影手段により撮影された複数の画像間の対応する座標の画素の鮮鋭度を算出する鮮鋭度算出手段と、
前記複数の画像を合成する画像合成手段と、
前記画像合成手段により得られた画像を記録媒体に記録する記録手段と、
を備え、
前記画像合成手段は、前記複数画像間の対応する座標の画素において、前記主要被写体の合焦位置で撮影された画素の鮮鋭度が最大の場合はその画素を選択し、前記主要被写体の合焦位置よりも前の焦点位置で撮影された画素の鮮鋭度が最大の場合は前記主要被写体の合焦位置よりも後の焦点位置で撮影された画素を選択し、前記主要被写体の合焦位置よりも後の焦点位置で撮影された画素の鮮鋭度が最大の場合は前記主要被写体の合焦位置よりも前の焦点位置で撮影された画素を選択して画像合成することを特徴とする撮像装置。
Automatic focus position determination means for determining the focus position of the main subject based on the image data;
Focus bracket photographing means for obtaining a plurality of images by moving the focal position discretely with a predetermined amount of movement and sequentially photographing images;
Focus position control means for controlling the moving focus position to include the focus position of the main subject determined by the automatic focus position determination means and the focus positions before and after the focus position;
Corresponding coordinates between a plurality of images photographed by the focus bracket photographing means including an image photographed at a focus position of the main subject and an image photographed at a focal position before and after the focus position of the main subject. Sharpness calculation means for calculating the sharpness of the pixel;
Image combining means for combining the plurality of images;
Recording means for recording the image obtained by the image synthesizing means on a recording medium;
With
The image synthesizing unit selects, when the sharpness of the pixel photographed at the in-focus position of the main subject among the pixels of the corresponding coordinates between the plurality of images is maximum, and selects the focus of the main subject. When the sharpness of the pixel photographed at the focal position before the position is maximum, the pixel photographed at the focal position after the in-focus position of the main subject is selected, and from the in-focus position of the main subject. When the sharpness of a pixel photographed at a later focal position is maximum, an image pickup apparatus is provided that selects and synthesizes an image photographed at a focal position before the focal position of the main subject. .
前記主要被写体の合焦位置で撮影された画像内の被写体の特徴点を抽出する特徴点抽出手段と、
前記主要被写体の合焦位置の前後の焦点位置で撮影された画像内の前記特徴点に対応する被写体の対応点を検出する対応点検出手段と、
前記対応点の座標がそれぞれ対応する前記特徴点の座標に一致するように前記主要被写体の合焦位置の前後の焦点位置で撮影された画像を変形する画像変形手段と、
を備え、
前記鮮鋭度算出手段は、前記主要被写体の合焦位置で撮影された画像及び前記変形された主要被写体の合焦位置の前後の焦点位置で撮影された画像の複数の画像間の対応する座標の画素の鮮鋭度を算出することを特徴とする請求項1に記載の撮像装置。
A feature point extracting means for extracting a feature point of a subject in an image photographed at an in-focus position of the main subject;
Corresponding point detection means for detecting corresponding points of the subject corresponding to the feature points in the image taken at the focal position before and after the focus position of the main subject;
Image deformation means for deforming an image photographed at a focal position before and after the in-focus position of the main subject so that the coordinates of the corresponding points coincide with the coordinates of the corresponding feature points, respectively.
With
The sharpness calculation means is configured to calculate corresponding coordinates between a plurality of images of an image photographed at a focus position of the main subject and an image photographed at a focal position before and after the focus position of the deformed main subject. The imaging device according to claim 1, wherein the sharpness of the pixel is calculated.
前記焦点位置制御手段は、撮影時の絞り及び撮影時の焦点距離のうち少なくとも一方に基づいて、前記移動する焦点位置を制御することを特徴とする請求項1又は2に記載の撮像装置。   The imaging apparatus according to claim 1, wherein the focal position control unit controls the moving focal position based on at least one of a diaphragm at the time of photographing and a focal length at the time of photographing. ぼけ強調度を設定するぼけ強調度設定手段を備え、
前記焦点位置制御手段は、前記主要被写体の合焦位置より前の焦点位置を複数含むように制御するとともに前記主要被写体の後の焦点位置を複数含むように制御し、
前記画像合成手段は、前記複数画像間の対応する座標の画素において、前記主要被写体の合焦位置よりも前の焦点位置で撮影された画素の鮮鋭度が最大の場合は前記主要被写体の合焦位置よりも後の焦点位置で撮影された複数の画像から前記ぼけ強調度に応じた画素を選択し、前記主要被写体の合焦位置よりも後の焦点位置で撮影された画素の鮮鋭度が最大の場合は前記主要被写体の合焦位置よりも前の焦点位置で撮影された複数の画像から前記ぼけ強調度に応じた画素を選択して画像合成することを特徴とする請求項1から3のいずれかに記載の撮像装置。
A blur enhancement setting means for setting the blur enhancement;
The focal position control means controls to include a plurality of focal positions before the focusing position of the main subject and includes a plurality of focal positions after the main subject;
The image synthesizing unit is configured to focus the main subject when the sharpness of the pixel photographed at the focal position before the in-focus position of the main subject is the maximum at the corresponding coordinate pixel between the plurality of images. A pixel corresponding to the blur enhancement degree is selected from a plurality of images photographed at a focal position after the position, and the sharpness of the pixel photographed at the focal position after the focus position of the main subject is maximum. 4. In the case of (1), the image is synthesized by selecting pixels corresponding to the degree of blur enhancement from a plurality of images taken at a focal position before the focus position of the main subject. The imaging device according to any one of the above.
主要被写体の合焦位置で撮影された画像と前記主要被写体の合焦位置の前後の焦点位置で撮影された画像を含むそれぞれ異なる焦点位置で撮影された同一シーンの複数の画像を入力させる入力手段と、
前記複数の画像間の対応する座標の画素の鮮鋭度を算出する鮮鋭度算出手段と、
前記複数の画像を合成する画像合成手段と、
前記画像合成手段により得られた画像を出力する出力手段と、
を備え、
前記画像合成手段は、前記複数画像間の対応する座標の画素において、前記主要被写体の合焦位置で撮影された画素の鮮鋭度が最大の場合はその画素を選択し、前記主要被写体の合焦位置よりも前の焦点位置で撮影された画素の鮮鋭度が最大の場合は前記主要被写体の合焦位置よりも後の焦点位置で撮影された画素を選択し、前記主要被写体の合焦位置よりも後の焦点位置で撮影された画素の鮮鋭度が最大の場合は前記主要被写体の合焦位置よりも前の焦点位置で撮影された画素を選択して画像合成することを特徴とする画像処理装置。
Input means for inputting a plurality of images of the same scene captured at different focal positions, including an image captured at the focus position of the main subject and images captured at focal positions before and after the focus position of the main subject. When,
Sharpness calculation means for calculating the sharpness of pixels of corresponding coordinates between the plurality of images;
Image combining means for combining the plurality of images;
Output means for outputting an image obtained by the image composition means;
With
The image synthesizing unit selects, when the sharpness of the pixel photographed at the in-focus position of the main subject among the pixels of the corresponding coordinates between the plurality of images is maximum, and selects the focus of the main subject. When the sharpness of the pixel photographed at the focal position before the position is maximum, the pixel photographed at the focal position after the in-focus position of the main subject is selected, and from the in-focus position of the main subject. In addition, when the sharpness of a pixel photographed at a later focal position is maximum, the image photographed by selecting a pixel photographed at a focal position before the in-focus position of the main subject and combining the images. apparatus.
画像データに基づいて主要被写体の合焦位置を判断する自動合焦位置判断工程と、
予め定められた移動量で離散的に焦点位置を移動して順次画像を撮影することにより複数の画像を得るフォーカスブラケット撮影工程と、
前記移動する焦点位置が前記自動合焦位置判断工程により判断された前記主要被写体の合焦位置と前記主要被写体の合焦位置の前後の焦点位置を含むように制御する焦点位置制御工程と、
前記主要被写体の合焦位置で撮影された画像及び前記主要被写体の合焦位置の前後の焦点位置で撮影された画像を含む前記フォーカスブラケット撮影工程により撮影された複数の画像間の対応する座標の画素の鮮鋭度を算出する鮮鋭度算出工程と、
前記複数の画像を合成する画像合成工程と、
前記画像合成工程により得られた画像を記録媒体に記録する記録工程と、
を備え、
前記画像合成工程は、前記複数画像間の対応する座標の画素において、前記主要被写体の合焦位置で撮影された画素の鮮鋭度が最大の場合はその画素を選択し、前記主要被写体の合焦位置よりも前の焦点位置で撮影された画素の鮮鋭度が最大の場合は前記主要被写体の合焦位置よりも後の焦点位置で撮影された画素を選択し、前記主要被写体の合焦位置よりも後の焦点位置で撮影された画素の鮮鋭度が最大の場合は前記主要被写体の合焦位置よりも前の焦点位置で撮影された画素を選択して画像合成することを特徴とする撮像方法。
An automatic in-focus position determining step for determining the in-focus position of the main subject based on the image data;
A focus bracket photographing step of obtaining a plurality of images by moving the focal position discretely by a predetermined amount of movement and sequentially photographing images;
A focus position control step for controlling the moving focus position to include a focus position of the main subject determined by the automatic focus position determination step and a focus position before and after the focus position of the main subject;
Corresponding coordinates between a plurality of images photographed by the focus bracket photographing process including an image photographed at a focus position of the main subject and an image photographed at a focal position before and after the focus position of the main subject. A sharpness calculation step for calculating the sharpness of the pixel;
An image synthesis step of synthesizing the plurality of images;
A recording step of recording an image obtained by the image synthesis step on a recording medium;
With
The image compositing step selects, when the sharpness of a pixel photographed at the in-focus position of the main subject among the pixels of corresponding coordinates between the plurality of images is the maximum, and selects the focus of the main subject When the sharpness of the pixel photographed at the focal position before the position is maximum, the pixel photographed at the focal position after the in-focus position of the main subject is selected, and from the in-focus position of the main subject. If the sharpness of a pixel photographed at a later focal position is the maximum, an image capturing method comprising selecting a pixel photographed at a focal position before the in-focus position of the main subject and combining the images. .
主要被写体の合焦位置で撮影された画像と前記主要被写体の合焦位置の前後の焦点位置で撮影された画像を含むそれぞれ異なる焦点位置で撮影された同一シーンの複数の画像を入力させる入力工程と、
前記複数の画像間の対応する座標の画素の鮮鋭度を算出する鮮鋭度算出工程と、
前記複数の画像を合成する画像合成工程と、
前記画像合成工程により得られた画像を出力する出力工程と、
を備え、
前記画像合成工程は、前記複数画像間の対応する座標の画素において、前記主要被写体の合焦位置で撮影された画素の鮮鋭度が最大の場合はその画素を選択し、前記主要被写体の合焦位置よりも前の焦点位置で撮影された画素の鮮鋭度が最大の場合は前記主要被写体の合焦位置よりも後の焦点位置で撮影された画素を選択し、前記主要被写体の合焦位置よりも後の焦点位置で撮影された画素の鮮鋭度が最大の場合は前記主要被写体の合焦位置よりも前の焦点位置で撮影された画素を選択して画像合成することを特徴とする画像処理方法。
An input step of inputting a plurality of images of the same scene captured at different focal positions, including an image captured at the focus position of the main subject and images captured at focal positions before and after the focus position of the main subject. When,
A sharpness calculation step of calculating the sharpness of pixels of corresponding coordinates between the plurality of images;
An image synthesis step of synthesizing the plurality of images;
An output step of outputting an image obtained by the image synthesis step;
With
The image compositing step selects, when the sharpness of a pixel photographed at the in-focus position of the main subject among the pixels of corresponding coordinates between the plurality of images is the maximum, and selects the focus of the main subject When the sharpness of the pixel photographed at the focal position before the position is maximum, the pixel photographed at the focal position after the in-focus position of the main subject is selected, and from the in-focus position of the main subject. In addition, when the sharpness of a pixel photographed at a later focal position is maximum, the image photographed by selecting a pixel photographed at a focal position before the in-focus position of the main subject and combining the images. Method.
JP2010160850A 2010-07-15 2010-07-15 Imaging apparatus, image processing apparatus, imaging method, and image processing method Expired - Fee Related JP5144724B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010160850A JP5144724B2 (en) 2010-07-15 2010-07-15 Imaging apparatus, image processing apparatus, imaging method, and image processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010160850A JP5144724B2 (en) 2010-07-15 2010-07-15 Imaging apparatus, image processing apparatus, imaging method, and image processing method

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2007112147A Division JP4582423B2 (en) 2007-04-20 2007-04-20 Imaging apparatus, image processing apparatus, imaging method, and image processing method

Publications (2)

Publication Number Publication Date
JP2010279054A true JP2010279054A (en) 2010-12-09
JP5144724B2 JP5144724B2 (en) 2013-02-13

Family

ID=43425508

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010160850A Expired - Fee Related JP5144724B2 (en) 2010-07-15 2010-07-15 Imaging apparatus, image processing apparatus, imaging method, and image processing method

Country Status (1)

Country Link
JP (1) JP5144724B2 (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014119715A (en) * 2012-12-19 2014-06-30 Casio Comput Co Ltd Imaging apparatus, imaging method and program
KR20140094791A (en) * 2013-01-23 2014-07-31 삼성전자주식회사 Apparatus and method for processing image of mobile terminal comprising camera
JP2015216678A (en) * 2015-07-09 2015-12-03 カシオ計算機株式会社 Imaging apparatus, imaging method and program
JP2015213615A (en) * 2014-05-09 2015-12-03 学校法人 名城大学 Image generating method, image generating device, and endoscopic examining apparatus including the same
JP2017525228A (en) * 2014-06-17 2017-08-31 ゼットティーイー コーポレーションZte Corporation Camera autofocus optimization method and camera
JP2018005008A (en) * 2016-07-04 2018-01-11 株式会社ニコン Camera body and interchangeable lens
JP2019103097A (en) * 2017-12-07 2019-06-24 キヤノン株式会社 Imaging apparatus, imaging method, and program

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10290389A (en) * 1997-04-16 1998-10-27 Toyota Motor Corp Multi-focus image formation method and image formation device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10290389A (en) * 1997-04-16 1998-10-27 Toyota Motor Corp Multi-focus image formation method and image formation device

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014119715A (en) * 2012-12-19 2014-06-30 Casio Comput Co Ltd Imaging apparatus, imaging method and program
US9386213B2 (en) 2012-12-19 2016-07-05 Casio Computer Co., Ltd. Image capture apparatus that can determine appropriate focus position, image capture method, and storage medium
KR20140094791A (en) * 2013-01-23 2014-07-31 삼성전자주식회사 Apparatus and method for processing image of mobile terminal comprising camera
KR102022892B1 (en) * 2013-01-23 2019-11-04 삼성전자 주식회사 Apparatus and method for processing image of mobile terminal comprising camera
JP2015213615A (en) * 2014-05-09 2015-12-03 学校法人 名城大学 Image generating method, image generating device, and endoscopic examining apparatus including the same
JP2017525228A (en) * 2014-06-17 2017-08-31 ゼットティーイー コーポレーションZte Corporation Camera autofocus optimization method and camera
JP2015216678A (en) * 2015-07-09 2015-12-03 カシオ計算機株式会社 Imaging apparatus, imaging method and program
JP2018005008A (en) * 2016-07-04 2018-01-11 株式会社ニコン Camera body and interchangeable lens
JP2019103097A (en) * 2017-12-07 2019-06-24 キヤノン株式会社 Imaging apparatus, imaging method, and program

Also Published As

Publication number Publication date
JP5144724B2 (en) 2013-02-13

Similar Documents

Publication Publication Date Title
JP4582423B2 (en) Imaging apparatus, image processing apparatus, imaging method, and image processing method
JP4678603B2 (en) Imaging apparatus and imaging method
JP6271990B2 (en) Image processing apparatus and image processing method
JP4665718B2 (en) Imaging device
US8629915B2 (en) Digital photographing apparatus, method of controlling the same, and computer readable storage medium
JP5484631B2 (en) Imaging apparatus, imaging method, program, and program storage medium
US9489747B2 (en) Image processing apparatus for performing object recognition focusing on object motion, and image processing method therefor
WO2017045558A1 (en) Depth-of-field adjustment method and apparatus, and terminal
JP5831033B2 (en) Imaging apparatus and distance information acquisition method
JP5144724B2 (en) Imaging apparatus, image processing apparatus, imaging method, and image processing method
JP5453573B2 (en) Imaging apparatus, imaging method, and program
JP2013005091A (en) Imaging apparatus and distance information acquisition method
KR101728042B1 (en) Digital photographing apparatus and control method thereof
KR20130061083A (en) Image pickup apparatus, control method for image pickup apparatus, and storage medium
JP2018107526A (en) Image processing device, imaging apparatus, image processing method and computer program
JP2015040941A (en) Image-capturing device, control method therefor, and program
JP2013041117A (en) Imaging apparatus and distance information acquisition method
JP2009284056A (en) Image processing apparatus, method, and program
JP2011066827A (en) Image processing apparatus, image processing method and program
JP6645711B2 (en) Image processing apparatus, image processing method, and program
JP2016059051A (en) Imaging device and distance information acquisition method
JP4888829B2 (en) Movie processing device, movie shooting device, and movie shooting program
JP7204387B2 (en) Image processing device and its control method
JP2014131188A (en) Imaging apparatus, control method of the same, and control program
JP2014138378A (en) Image pickup device, control method thereof, and control program thereof

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20121002

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20121024

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

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20121122

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

Free format text: PAYMENT UNTIL: 20151130

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 5144724

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees