JP6970066B2 - Image processing device and ranging device - Google Patents

Image processing device and ranging device Download PDF

Info

Publication number
JP6970066B2
JP6970066B2 JP2018171504A JP2018171504A JP6970066B2 JP 6970066 B2 JP6970066 B2 JP 6970066B2 JP 2018171504 A JP2018171504 A JP 2018171504A JP 2018171504 A JP2018171504 A JP 2018171504A JP 6970066 B2 JP6970066 B2 JP 6970066B2
Authority
JP
Japan
Prior art keywords
image
filter
unit
distance
subject
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2018171504A
Other languages
Japanese (ja)
Other versions
JP2020041973A (en
Inventor
智也 鶴山
彰久 森屋
直 三島
貴之 佐々木
潤 山口
達夫 小坂谷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP2018171504A priority Critical patent/JP6970066B2/en
Publication of JP2020041973A publication Critical patent/JP2020041973A/en
Application granted granted Critical
Publication of JP6970066B2 publication Critical patent/JP6970066B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Measurement Of Optical Distance (AREA)
  • Focusing (AREA)
  • Blocking Light For Cameras (AREA)
  • Optical Filters (AREA)
  • Automatic Focus Adjustment (AREA)

Description

本発明の実施形態は、画像処理装置および測距装置に関する。 Embodiments of the present invention relate to an image processing device and a distance measuring device.

2つのカメラやステレオカメラ(複眼のカメラ)で画像を撮像し、その画像から被写体までの距離を取得する技術が知られている。また近時、1つのカメラ(単眼のカメラ)で撮像された画像から被写体までの距離を取得する技術が提案されている。 There is known a technique of capturing an image with two cameras or a stereo camera (compound eye camera) and acquiring the distance from the image to the subject. Recently, a technique for acquiring a distance from an image captured by one camera (monocular camera) to a subject has been proposed.

1つのカメラで撮像された画像から被写体までの距離を取得する方法として、開口部にカラーフィルタが配置されたカメラを用いる方法がある。 As a method of acquiring the distance from the image captured by one camera to the subject, there is a method of using a camera in which a color filter is arranged in the opening.

特開2016−102733号公報Japanese Unexamined Patent Publication No. 2016-102733 特開2017−40642号公報Japanese Unexamined Patent Publication No. 2017-40642 特開2012−2859号公報Japanese Unexamined Patent Publication No. 2012-2859

カメラは1つ以上のレンズを含むレンズユニットを備え、開口部はそのレンズユニットの内部に位置する。そのため市販のカメラ内の開口部にカラーフィルタを配置することは困難であり、また開口部に一旦配置されたカラーフィルタの向きを変更することも困難である。 The camera comprises a lens unit containing one or more lenses, the aperture of which is located inside the lens unit. Therefore, it is difficult to arrange the color filter in the opening in a commercially available camera, and it is also difficult to change the direction of the color filter once arranged in the opening.

本発明が解決しようとする課題は、被写体までの距離を精度良く算出できる画像処理装置および測距装置を提供することである。 An object to be solved by the present invention is to provide an image processing device and a distance measuring device capable of accurately calculating the distance to a subject.

実施形態によれば、画像処理装置は、取得部と、処理部とを具備する。前記取得部は、第1波長帯域の光を透過する第1フィルタ領域と、第2波長帯域の光を透過する第2フィルタ領域とを備え、前記第1波長帯域と前記第2波長帯域は共通の波長帯域を含むフィルタ部を通過した光を受光するイメージセンサを有する撮像装置を用いて撮像された、キャリブレーションのための第1被写体が撮像された第1画像と、前記第1被写体とは異なる第2被写体が撮像された第2画像とを取得する。前記処理部は、前記イメージセンサを用いて、キャリブレーションのための第1被写体が撮像された第1画像と、第2被写体が撮像された第2画像とを取得し、前記第1画像と前記第2画像とを用いて前記第2被写体までの距離を算出する。 According to the embodiment, the image processing apparatus includes an acquisition unit and a processing unit. The acquisition unit includes a first filter region that transmits light in the first wavelength band and a second filter region that transmits light in the second wavelength band, and the first wavelength band and the second wavelength band are common. The first image in which the first subject for calibration is captured and the first subject is captured by using an image sensor having an image sensor that receives light that has passed through the filter unit including the wavelength band of A second image in which a different second subject is captured is acquired. The processing unit uses the image sensor to acquire a first image in which the first subject for calibration is captured and a second image in which the second subject is captured, and the first image and the above are described. The distance to the second subject is calculated using the second image.

実施形態に係る画像処理装置および撮像装置を含む測距装置の一構成例を示すブロック図。FIG. 3 is a block diagram showing a configuration example of a distance measuring device including an image processing device and an image pickup device according to an embodiment. 図1の撮像装置に設けられるフィルタの一構成例を示す図。The figure which shows one configuration example of the filter provided in the image pickup apparatus of FIG. 図2のフィルタが有する透過率特性の例を示す図。The figure which shows the example of the transmittance characteristic which the filter of FIG. 2 has. 図1の撮像装置における光線変化と撮像画像上のぼけ形状との関係の例を説明するための図。It is a figure for demonstrating an example of the relationship between the light ray change in the image pickup apparatus of FIG. 1 and the blur shape on a captured image. 図1の撮像装置による撮像画像上のぼけを利用して、被写体までの距離を算出する方法の例を説明するための図。It is a figure for demonstrating an example of the method of calculating the distance to a subject by using the blur on the image captured by the image pickup apparatus of FIG. 図1の測距装置によって実行される測距処理の手順の例を示すフローチャート。The flowchart which shows the example of the procedure of the distance measurement processing executed by the distance measurement device of FIG. 図1の撮像装置に設けられるフィルタユニットおよびレンズユニットの構成の例を示す断面図。The cross-sectional view which shows the example of the structure of the filter unit and the lens unit provided in the image pickup apparatus of FIG. 図1の撮像装置の構造の例を示す斜視図。The perspective view which shows the example of the structure of the image pickup apparatus of FIG. 図1の撮像装置に設けられるフィルタユニットにおいて、止めネジを用いてフィルタの向きが固定される例を示す斜視図。FIG. 3 is a perspective view showing an example in which the direction of the filter is fixed by using a set screw in the filter unit provided in the image pickup apparatus of FIG. 1. 図1の撮像装置に設けられるフィルタユニットにおいて、ロックリングを用いてフィルタの向きが固定される例を示す斜視図。FIG. 3 is a perspective view showing an example in which the direction of the filter is fixed by using a lock ring in the filter unit provided in the image pickup apparatus of FIG. 1. 図1の撮像装置の構造の別の例を示す斜視図。FIG. 3 is a perspective view showing another example of the structure of the image pickup apparatus of FIG. 図1の測距装置に設けられる画像処理部の機能構成の例を示すブロック図。FIG. 3 is a block diagram showing an example of a functional configuration of an image processing unit provided in the distance measuring device of FIG. 図1の撮像装置によって撮像されるキャリブレーションチャートの例を示す図。The figure which shows the example of the calibration chart which is imaged by the image pickup apparatus of FIG. 図1の撮像装置を用いて図13のキャリブレーションチャートを撮像した場合に取得される第1画像の例を示す図。The figure which shows the example of the 1st image acquired when the calibration chart of FIG. 13 is imaged using the image pickup apparatus of FIG. 図1の測距装置によって、図14の第1画像と測距対象の被写体が撮像された第2画像とを用いて当該被写体までの距離が算出される例を説明するための図。FIG. 3 is a diagram for explaining an example in which the distance to the subject is calculated by using the distance measuring device of FIG. 14 using the first image of FIG. 14 and the second image of the subject to be measured. 図14の第1画像からフィルタの向きが算出される例を示す図。The figure which shows the example which the direction of a filter is calculated from the 1st image of FIG. 図1の測距装置によって実行されるキャリブレーション処理の手順の例を示すフローチャート。The flowchart which shows the example of the procedure of the calibration process performed by the distance measuring device of FIG. 図1の測距装置によって実行される、フィルタの向きに関する補正機能を有する測距処理の手順の別の例を示すフローチャート。The flowchart which shows another example of the procedure of the distance measuring process which has the correction function about the direction of a filter performed by the distance measuring apparatus of FIG. 図1の測距装置によって、図14の第1画像と測距対象の被写体が撮像された第2画像とを用いて当該被写体までの距離が算出される別の例を説明するための図。FIG. 3 is a diagram for explaining another example in which the distance to the subject is calculated by using the first image of FIG. 14 and the second image of the subject to be measured by the distance measuring device of FIG. 1. 図1の撮像装置を用いて取得されたキャリブレーションチャートの画像から、撮像装置の画角が算出される例を示す図。The figure which shows the example which the angle of view of an image pickup apparatus is calculated from the image of the calibration chart acquired by using the image pickup apparatus of FIG. 図1の撮像装置を用いて傾いたキャリブレーションチャートの画像が取得された場合に、当該画像が補正される例を示す図。The figure which shows the example which the image of the tilted calibration chart is corrected when the image of the tilted calibration chart is acquired by using the image pickup apparatus of FIG. 図1の撮像装置を用いて取得された画像上のぼけからフィルタの位置ずれ検出される例を示す図。It is a figure which shows the example which the position shift of a filter is detected from the blur on the image acquired by using the image pickup apparatus of FIG. 図1の撮像装置を用いて取得された画像に、フィルタ枠の影が写り込んでいる例を示す図。It is a figure which shows the example which the shadow of a filter frame is reflected in the image acquired by using the image pickup apparatus of FIG. 図1の撮像装置の構造の別の例を示す斜視図。FIG. 3 is a perspective view showing another example of the structure of the image pickup apparatus of FIG. 図1の撮像装置に設けられたディスプレイに表示されるガイド画面の例を示す図。The figure which shows the example of the guide screen displayed on the display provided in the image pickup apparatus of FIG. 図1の撮像装置の構造のさらに別の例を示す斜視図。FIG. 3 is a perspective view showing still another example of the structure of the image pickup apparatus of FIG.

以下、実施の形態について図面を参照して説明する。 Hereinafter, embodiments will be described with reference to the drawings.

(第1実施形態)
まず、図1を参照して、第1実施形態に係る撮像装置を備える測距装置の構成を説明する。この測距装置1は、画像を撮像し、撮像された画像を用いて被写体の位置を実スケールで推定する。推定される被写体の位置は、撮像地点から被写体までの距離(奥行きとも称する)を少なくとも含み、例えば、三次元空間の座標として表される。
(First Embodiment)
First, with reference to FIG. 1, a configuration of a distance measuring device including the image pickup device according to the first embodiment will be described. The distance measuring device 1 captures an image and estimates the position of the subject on an actual scale using the captured image. The estimated position of the subject includes at least the distance (also referred to as depth) from the imaging point to the subject, and is represented as, for example, coordinates in a three-dimensional space.

この測距装置1は、画像を撮像する撮像部11と、撮像された画像を処理する画像処理部12とを備える。測距装置1は、撮像部11と画像処理部12とを備える1つの装置として実現されてもよいし、撮像部11に相当する撮像装置と、画像処理部12に相当する画像処理装置とのような複数の装置で構成されるシステムとして実現されてもよい。あるいは、撮像装置11が画像処理部12をさらに備えていてもよい。撮像部11は、被写体の画像と当該被写体までの距離に関する情報とを一度の撮影で取得する機能を有する。撮像部11は、この機能により、例えば撮像時の被写体までの距離情報が符号化された画像を取得する。また、画像処理部12は、例えば、コンピュータ、または各種電子機器に内蔵される組み込みシステムとして実現され得る。画像処理部12は、撮像部11により撮像された1つ以上の画像を用いて、被写体の三次元情報(例えば、被写体の三次元座標、被写体までの距離等)を生成する機能を有している。 The distance measuring device 1 includes an image pickup unit 11 for capturing an image and an image processing unit 12 for processing the captured image. The distance measuring device 1 may be realized as one device including the image pickup unit 11 and the image processing unit 12, and the image pickup device corresponding to the image pickup unit 11 and the image processing device corresponding to the image processing unit 12 may be realized. It may be realized as a system composed of a plurality of such devices. Alternatively, the image pickup apparatus 11 may further include an image processing unit 12. The image pickup unit 11 has a function of acquiring an image of a subject and information on a distance to the subject in a single shooting. By this function, the image pickup unit 11 acquires, for example, an image in which the distance information to the subject at the time of image pickup is encoded. Further, the image processing unit 12 can be realized as an embedded system built in, for example, a computer or various electronic devices. The image processing unit 12 has a function of generating three-dimensional information of the subject (for example, three-dimensional coordinates of the subject, distance to the subject, etc.) using one or more images captured by the image pickup unit 11. There is.

測距装置1はディスプレイ13をさらに備えていてもよい。画像処理部12はディスプレイ13に映像信号を送出し、ディスプレイ13はその映像信号に基づく画面画像を表示する。表示される画面画像には、撮像画像が含まれていてもよいし、撮像画像を処理することにより得られた様々な情報が含まれていてもよい。 The distance measuring device 1 may further include a display 13. The image processing unit 12 sends a video signal to the display 13, and the display 13 displays a screen image based on the video signal. The screen image to be displayed may include a captured image, or may include various information obtained by processing the captured image.

図1に示すように、撮像部11は、フィルタユニット2とレンズユニット(例えばレンズ鏡筒)3とイメージセンサ41とを備える単眼カメラによって構成され得る。レンズユニット3の一端は、イメージセンサ41を備えるカメラ本体に対して着脱自在である。フィルタユニット2は、レンズユニット3の他端に対して着脱自在である。撮像部11は、イメージセンサ41を備えるカメラ本体にレンズユニット3の一端が直接的にまたは間接的に装着され、レンズユニット3の他端にフィルタユニット2が直接的にまたは間接的に取り付けられて構成されてもよい。 As shown in FIG. 1, the image pickup unit 11 may be composed of a monocular camera including a filter unit 2, a lens unit (for example, a lens barrel) 3, and an image sensor 41. One end of the lens unit 3 is removable from the camera body including the image sensor 41. The filter unit 2 is removable from the other end of the lens unit 3. In the image pickup unit 11, one end of the lens unit 3 is directly or indirectly attached to the camera body including the image sensor 41, and the filter unit 2 is directly or indirectly attached to the other end of the lens unit 3. It may be configured.

カメラ本体とレンズユニット3とは、機械的および光学的に結合する嵌合構造であるマウントを備え得る。例えば、カメラ本体側のマウント(レンズマウントとも称する)と、レンズユニット3側のマウント(ボディマウントとも称する)とが対応する形状を有している場合、レンズマウントとボディマウントとを結合することによりカメラ本体にレンズユニット3が装着される。マウントの装着形態には例えばねじ込み式(スクリューマウント)とバヨネット式とがあり、いずれの装着形態であってもよい。 The camera body and the lens unit 3 may be provided with a mount that is a fitting structure that is mechanically and optically coupled. For example, when the mount on the camera body side (also referred to as a lens mount) and the mount on the lens unit 3 side (also referred to as a body mount) have a corresponding shape, the lens mount and the body mount can be combined. The lens unit 3 is attached to the camera body. There are, for example, a screw type (screw mount) and a bayonet type in the mounting form of the mount, and any mounting form may be used.

また例えば、カメラ本体側のレンズマウントとレンズユニット3側のボディマウントとが対応する形状を有していない場合、これら形状を媒介するマウントアダプタを用いてカメラ本体にレンズユニット3の一端が間接的に装着される。つまり、カメラ本体にレンズユニット3の一端が間接的に装着されるとは、例えば、カメラ本体にマウントアダプタが装着され、このマウントアダプタにレンズユニット3の一端が取り付けられることを意味する。 Further, for example, when the lens mount on the camera body side and the body mount on the lens unit 3 side do not have corresponding shapes, one end of the lens unit 3 is indirectly connected to the camera body by using a mount adapter that mediates these shapes. It is attached to. That is, the fact that one end of the lens unit 3 is indirectly attached to the camera body means that, for example, a mount adapter is attached to the camera body and one end of the lens unit 3 is attached to this mount adapter.

また、レンズユニット3の他端にフィルタユニット2が間接的に取り付けられるとは、例えば、レンズユニット3の他端にフィルタユニット2とは別のフィルタが取り付けられ、その別のフィルタにフィルタユニット2が取り付けられることを意味する。 Further, the fact that the filter unit 2 is indirectly attached to the other end of the lens unit 3 means that, for example, a filter different from the filter unit 2 is attached to the other end of the lens unit 3, and the filter unit 2 is attached to the other filter. Means that is attached.

フィルタユニット2は、互いに異なる波長帯域の光(例えば互いに異なる色成分の光)を透過する複数のフィルタ領域を含む光学フィルタ21(以下、単にフィルタとも称する)を備える。複数の波長帯域の一部は重複していてもよい。フィルタ21は、例えば2色のカラーフィルタ領域である第1フィルタ領域211と第2フィルタ領域212とで構成される。例えば、第1フィルタ領域211は第1波長帯域の光を透過する。第2フィルタ領域212は第2波長帯域の光を透過する。第1波長帯域と第2波長帯域は共通の波長帯域を含む。
レンズユニット3は1つ以上のレンズ31を備える。
The filter unit 2 includes an optical filter 21 (hereinafter, also simply referred to as a filter) including a plurality of filter regions that transmit light having different wavelength bands (for example, light having different color components). Part of the plurality of wavelength bands may overlap. The filter 21 is composed of, for example, a first filter region 211 and a second filter region 212, which are color filter regions of two colors. For example, the first filter region 211 transmits light in the first wavelength band. The second filter region 212 transmits light in the second wavelength band. The first wavelength band and the second wavelength band include a common wavelength band.
The lens unit 3 includes one or more lenses 31.

イメージセンサ41は、フィルタ21とレンズ31とを透過(通過)した光を受光し、受光した光を電気信号に変換(光電変換)する。イメージセンサ41には、例えばCCD(Charge Coupled Device)やCMOS(Complementary Metal Oxide Semiconductor)が用いられる。イメージセンサ41は、少なくとも二種類の撮像素子を含み、例えば、赤色(R)の光を受光する撮像素子を含む第1センサ411と、緑色(G)の光を受光する撮像素子を含む第2センサ412と、青色(B)の光を受光する撮像素子を含む第3センサ413とを備える。各撮像素子は、対応する波長帯域の光を受光し、受光した光を電気信号に変換する。この電気信号をA/D変換することによりカラー画像を生成することができる。以下では、画像のR成分、G成分、B成分である色成分画像(波長成分画像とも称する)を、それぞれR画像、G画像、B画像とも称する。なお、赤色、緑色、青色の撮像素子毎の電気信号を用いて、R画像、G画像、B画像をそれぞれ生成することもできる。つまり、撮像部11は、一度の撮像(ワンショット)で、カラー画像、R画像、G画像、およびB画像の少なくとも1つを生成することができる。 The image sensor 41 receives the light transmitted (passed) through the filter 21 and the lens 31, and converts the received light into an electric signal (photoelectric conversion). For the image sensor 41, for example, a CCD (Charge Coupled Device) or a CMOS (Complementary Metal Oxide Sensor) is used. The image sensor 41 includes at least two types of image pickup elements, for example, a first sensor 411 including an image pickup element that receives red (R) light, and a second image sensor 41 that includes an image pickup element that receives green (G) light. It includes a sensor 412 and a third sensor 413 including an image pickup element that receives blue (B) light. Each image sensor receives light in the corresponding wavelength band and converts the received light into an electric signal. A color image can be generated by A / D conversion of this electric signal. Hereinafter, the color component image (also referred to as a wavelength component image) which is the R component, the G component, and the B component of the image is also referred to as an R image, a G image, and a B image, respectively. It is also possible to generate an R image, a G image, and a B image by using the electric signals of each of the red, green, and blue image pickup elements. That is, the imaging unit 11 can generate at least one of a color image, an R image, a G image, and a B image in one imaging (one shot).

次いで図2はフィルタ21の構成の例を示す。フィルタ21は互いに異なる光の波長帯域(色成分)を透過する複数のフィルタ領域を有し、2つ以上のフィルタ領域は撮像装置11(レンズ31)の光学中心213に対して非点対称な形状である。フィルタ21は、例えば二色のカラーフィルタ領域である第1フィルタ領域211と第2フィルタ領域212とで構成される。フィルタ21の中心は撮像装置11の光学中心213と一致している。第1フィルタ領域211および第2フィルタ領域212はそれぞれ、光学中心213に対して非点対称である形状を有している。また例えば、2つのフィルタ領域211,212は重複せず、且つ2つのフィルタ領域211,212によってフィルタ21の全領域を構成している。 Next, FIG. 2 shows an example of the configuration of the filter 21. The filter 21 has a plurality of filter regions that transmit different wavelength bands (color components) of light, and the two or more filter regions have a shape astigmatic with respect to the optical center 213 of the image pickup apparatus 11 (lens 31). Is. The filter 21 is composed of, for example, a first filter region 211 and a second filter region 212, which are two-color filter regions. The center of the filter 21 coincides with the optical center 213 of the image pickup apparatus 11. The first filter region 211 and the second filter region 212 each have a shape that is non-point symmetric with respect to the optical center 213. Further, for example, the two filter regions 211 and 212 do not overlap, and the two filter regions 211 and 212 constitute the entire region of the filter 21.

図2に示す例では、第1フィルタ領域211および第2フィルタ領域212はそれぞれ、円形のフィルタ21が光学中心213を通る線分(境界線とも称する)214で分割された半円の形状を有している。第1フィルタ領域211はイメージセンサ41で受光される光の色(例えば赤色(R)、緑色(G)、および青色(B))の内、第1の組み合わせの複数色(例えば赤色および緑色)を透過する。第2フィルタ領域212はイメージセンサ41で受光される光の色の内、第1の組み合わせとは異なる第2の組み合わせの複数色(例えば青色および緑色)を透過する。したがって、第1フィルタ領域211と第2フィルタ領域212とからなるフィルタ21の全面は共通の光の色(例えば緑色)を透過する。第1フィルタ領域211は、例えばイエロー(Y)のフィルタ領域であり、第2フィルタ領域212は、例えばシアン(C)のフィルタ領域である。なお、第1フィルタ領域211がマゼンタ(M)のフィルタ領域であって、第2フィルタ領域212がイエロー(Y)のフィルタ領域であってもよい。さらに、第1フィルタ領域211がシアン(C)のフィルタ領域であって、第2フィルタ領域212がマゼンタ(M)のフィルタ領域であってもよい。 In the example shown in FIG. 2, the first filter region 211 and the second filter region 212 each have a semicircular shape in which the circular filter 21 is divided by a line segment (also referred to as a boundary line) 214 passing through the optical center 213. doing. The first filter region 211 is a plurality of colors (for example, red and green) of the first combination among the colors of light received by the image sensor 41 (for example, red (R), green (G), and blue (B)). Is transparent. The second filter region 212 transmits a plurality of colors (for example, blue and green) of the second combination different from the first combination among the colors of the light received by the image sensor 41. Therefore, the entire surface of the filter 21 including the first filter region 211 and the second filter region 212 transmits a common light color (for example, green). The first filter region 211 is, for example, a yellow (Y) filter region, and the second filter region 212 is, for example, a cyan (C) filter region. The first filter area 211 may be a magenta (M) filter area, and the second filter area 212 may be a yellow (Y) filter area. Further, the first filter region 211 may be a cyan (C) filter region, and the second filter region 212 may be a magenta (M) filter region.

各カラーフィルタが透過する波長帯域は異なる。1つのフィルタ領域が透過する光の波長帯域の一部と、別の1つのカラーフィルタ領域が透過する光の波長帯域の一部は、例えば重複する。1つのカラーフィルタ領域が透過する光の波長帯域は、例えば別の1つのカラーフィルタ領域が透過する光の波長帯域を含んでもよい。 The wavelength band transmitted by each color filter is different. A part of the wavelength band of light transmitted through one filter region and a part of the wavelength band of light transmitted through another color filter region overlap, for example. The wavelength band of light transmitted through one color filter region may include, for example, the wavelength band of light transmitted through another color filter region.

なお、第1フィルタ領域211と第2フィルタ領域212とは、任意の波長帯域の透過率を変更するフィルタ、任意方向の偏光光を通過させる偏光フィルタ、または任意の波長帯域の集光パワーを変更するマイクロレンズであってもよい。例えば、任意の波長帯域の透過率を変更するフィルタは、原色フィルタ(RGB)、補色フィルタ(CMY)、色補正フィルタ(CC−RGB/CMY)、赤外線・紫外線カットフィルタ、NDフィルタ、または遮蔽板であってもよい。第1フィルタ領域211や第2フィルタ領域212がマイクロレンズである場合は、レンズにより光線の集光の分布に偏りが生じることでぼけの形状が変化する。 The first filter region 211 and the second filter region 212 change the transmittance of an arbitrary wavelength band, a polarizing filter that allows polarized light in an arbitrary direction to pass through, or the focusing power of an arbitrary wavelength band. It may be a microlens. For example, the filter that changes the transmittance in any wavelength band is a primary color filter (RGB), a complementary color filter (CMY), a color correction filter (CC-RGB / CMY), an infrared / ultraviolet cut filter, an ND filter, or a shielding plate. May be. When the first filter region 211 and the second filter region 212 are microlenses, the shape of the blur changes due to the bias in the distribution of the light rays collected by the lens.

以下では説明を分かりやすくするために、図2に示すフィルタ21において、第1フィルタ領域211がイエロー(Y)のフィルタ領域であり、第2フィルタ領域212がシアン(C)のフィルタ領域である場合を主に例示する。 In the following, in order to make the explanation easier to understand, in the filter 21 shown in FIG. 2, the first filter region 211 is a yellow (Y) filter region, and the second filter region 212 is a cyan (C) filter region. Is mainly illustrated.

図2に示したフィルタ21が、例えばカメラの開口部に配置されることにより、開口部が2色で二分割された構造開口であるカラー開口が構成される。このカラー開口を透過する光線に基づいて、イメージセンサ41は画像を生成する。イメージセンサ41に入射する光の光路上において、フィルタ21とイメージセンサ41との間にレンズ31が配置されてもよい。イメージセンサ41に入射する光の光路上において、レンズ31とイメージセンサ41との間にフィルタ21が配置されてもよい。レンズ31が複数設けられる場合、フィルタ21は2つのレンズ31の間に配置されてもよい。 By arranging the filter 21 shown in FIG. 2, for example, in the opening of the camera, a color opening, which is a structural opening in which the opening is divided into two colors, is formed. The image sensor 41 produces an image based on the light rays transmitted through this color aperture. A lens 31 may be arranged between the filter 21 and the image sensor 41 on the optical path of the light incident on the image sensor 41. A filter 21 may be arranged between the lens 31 and the image sensor 41 on the optical path of the light incident on the image sensor 41. When a plurality of lenses 31 are provided, the filter 21 may be arranged between the two lenses 31.

第2センサ412に対応する波長帯域の光は、イエローの第1フィルタ領域211とシアンの第2フィルタ領域212の両方を透過する。第1センサ411に対応する波長帯域の光は、イエローの第1フィルタ領域211を透過し、シアンの第2フィルタ領域212を透過しない。第3センサ413に対応する波長帯域の光は、シアンの第2フィルタ領域212を透過し、イエローの第1フィルタ領域211を透過しない。 Light in the wavelength band corresponding to the second sensor 412 passes through both the yellow first filter region 211 and the cyan second filter region 212. Light in the wavelength band corresponding to the first sensor 411 passes through the yellow first filter region 211 and does not pass through the cyan second filter region 212. Light in the wavelength band corresponding to the third sensor 413 passes through the cyan second filter region 212 and does not pass through the yellow first filter region 211.

なお、ある波長帯域の光がフィルタまたはフィルタ領域を透過するとは、フィルタまたはフィルタ領域が高い透過率でその波長帯域の光を透過し、そのフィルタまたはフィルタ領域による当該波長帯域の光の減衰(すなわち、光量の低下)が極めて小さいことを意味する。また、ある波長帯域の光がフィルタまたはフィルタ領域を透過しないとは、光がフィルタまたはフィルタ領域に遮蔽されることであり、例えば、フィルタまたはフィルタ領域が低い透過率でその波長帯域の光を透過し、そのフィルタまたはフィルタ領域による当該波長帯域の光の減衰が極めて大きいことを意味する。例えばフィルタまたはフィルタ領域は、ある波長帯域の光を吸収することにより光を減衰させる。 When light in a certain wavelength band passes through a filter or a filter region, the filter or the filter region transmits light in the wavelength band with a high transmittance, and the filter or the filter region attenuates the light in the wavelength band (that is,). , The decrease in the amount of light) is extremely small. Also, the fact that light in a certain wavelength band does not pass through the filter or filter area means that the light is shielded by the filter or filter area, for example, the filter or filter area transmits light in that wavelength band with low transmittance. However, it means that the attenuation of light in the wavelength band by the filter or the filter region is extremely large. For example, a filter or filter region attenuates light by absorbing light in a certain wavelength band.

図3は、第1フィルタ領域211および第2フィルタ領域212の透過率特性の例を示す。なお、可視光の波長帯域のうち700nmより長い波長の光に対する透過率は図示を省略してあるが、その透過率は700nmの場合に近いものである。図3に示すイエローの第1フィルタ領域211の透過率特性215では、波長帯域が620nmから750nm程度のR画像に対応する光と、波長帯域が495nmから570nm程度のG画像に対応する光とが高い透過率で透過され、波長帯域が450nmから495nm程度のB画像に対応する光がほとんど透過されていない。また、シアンの第2フィルタ領域212の透過率特性216では、B画像およびG画像に対応する波長帯域の光が高い透過率で透過され、R画像に対応する波長帯域の光がほとんど透過されていない。 FIG. 3 shows an example of the transmittance characteristics of the first filter region 211 and the second filter region 212. Although the transmittance for light having a wavelength longer than 700 nm in the wavelength band of visible light is not shown, the transmittance is close to that of 700 nm. In the transmittance characteristic 215 of the first filter region 211 of yellow shown in FIG. 3, light corresponding to an R image having a wavelength band of about 620 nm to 750 nm and light corresponding to a G image having a wavelength band of about 495 nm to 570 nm are present. It is transmitted with a high transmittance, and almost no light corresponding to a B image having a wavelength band of about 450 nm to 495 nm is transmitted. Further, in the transmittance characteristic 216 of the second filter region 212 of cyan, the light in the wavelength band corresponding to the B image and the G image is transmitted with a high transmittance, and the light in the wavelength band corresponding to the R image is almost transmitted. No.

したがって、R画像(第1センサ411)に対応する波長帯域の光はイエローの第1フィルタ領域211のみを透過し、B画像(第3センサ413)に対応する波長帯域の光はシアンの第2フィルタ領域212のみを透過する。G画像(第2センサ412)に対応する波長帯域の光は、第1フィルタ領域211と第2フィルタ領域212を透過する。 Therefore, the light in the wavelength band corresponding to the R image (first sensor 411) is transmitted only through the yellow first filter region 211, and the light in the wavelength band corresponding to the B image (third sensor 413) is the second cyan. Only the filter area 212 is transmitted. Light in the wavelength band corresponding to the G image (second sensor 412) passes through the first filter region 211 and the second filter region 212.

このようなR画像、B画像およびG画像上のぼけの形状は被写体までの距離dに応じて、より詳細には距離dと合焦距離dfとの差分に応じて変化する。合焦距離dfは、撮像位置から、画像上にぼけが発生しない(すなわちピントが合う)合焦位置までの距離である。また、各フィルタ領域211,212が光学中心213に対して非点対称な形状であるので、R画像上およびB画像上のぼけの形状は、被写体が合焦距離dfよりも手前にあるか、それとも奥にあるかによって異なり、また偏っている。R画像上およびB画像上のぼけの偏りの方向は、撮像位置から見て、被写体が合焦距離dfよりも手前にあるか、それとも奥にあるかによってそれぞれ反転する。 The shape of the blur on the R image, the B image, and the G image changes according to the distance d to the subject, and more specifically according to the difference between the distance d and the focusing distance df. The in-focus distance df is the distance from the imaging position to the in-focus position where blurring does not occur (that is, is in focus) on the image. Further, since each of the filter regions 211 and 212 has a shape that is non-point symmetric with respect to the optical center 213, the shape of the blur on the R image and the B image indicates whether the subject is in front of the focusing distance df. It depends on whether it is in the back or it is biased. The direction of the blur on the R image and the B image is reversed depending on whether the subject is in front of or behind the focusing distance df when viewed from the imaging position.

図4を参照して、フィルタ21を備える撮像部11における光線変化と撮像画像上のぼけ形状との関係について説明する。
被写体210が合焦距離dfよりも奥にある場合(d>df)、イメージセンサ41によって撮像された画像にはぼけが発生する。この画像のぼけの形状を示すぼけ関数(PSF:Point Spread Function)は、R画像、G画像およびB画像でそれぞれ異なっている。例えば、R画像のぼけ関数201Rは左側に偏ったぼけの形状を示し、G画像のぼけ関数201Gは偏りのないぼけの形状を示し、B画像のぼけ関数201Bは右側に偏ったぼけの形状を示している。
With reference to FIG. 4, the relationship between the light ray change in the image pickup unit 11 including the filter 21 and the blur shape on the captured image will be described.
When the subject 210 is deeper than the focusing distance df (d> df), the image captured by the image sensor 41 is blurred. The blur function (PSF: Point Spread Function) indicating the shape of the blur of this image is different between the R image, the G image, and the B image. For example, the blur function 201R of the R image shows the shape of the blur biased to the left, the blur function 201G of the G image shows the shape of the blur without bias, and the blur function 201B of the B image shows the shape of the blur biased to the right. Shows.

また、被写体210が合焦距離dfにある場合(d=df)、イメージセンサ41によって撮像された画像にはほとんどぼけが発生しない。この画像のぼけの形状を示すぼけ関数は、R画像、G画像およびB画像でほぼ同じである。すなわち、R画像のぼけ関数201R、G画像のぼけ関数201G、およびB画像のぼけ関数201Bは、偏りのないぼけの形状を示している。 Further, when the subject 210 is at the focusing distance df (d = df), almost no blur occurs in the image captured by the image sensor 41. The blur function indicating the shape of the blur in this image is almost the same for the R image, the G image, and the B image. That is, the blur function 201R of the R image, the blur function 201G of the G image, and the blur function 201B of the B image show an unbiased shape of the blur.

また、被写体210が合焦距離dfよりも手前にある場合(d<df)、イメージセンサ41によって撮像された画像にはぼけが発生する。この画像のぼけの形状を示すぼけ関数は、R画像、G画像およびB画像でそれぞれ異なっている。すなわち、R画像のぼけ関数201Rは右側に偏ったぼけの形状を示し、G画像のぼけ関数201Gは偏りのないぼけの形状を示し、B画像のぼけ関数201Bは左側に偏ったぼけの形状を示している。 Further, when the subject 210 is in front of the focusing distance df (d <df), the image captured by the image sensor 41 is blurred. The blur function indicating the shape of the blur of this image is different between the R image, the G image, and the B image. That is, the blur function 201R of the R image shows the shape of the blur biased to the right, the blur function 201G of the G image shows the shape of the blur without bias, and the blur function 201B of the B image shows the shape of the blur biased to the left. Shows.

このように、被写体210が合焦距離dfよりも手前または奥にある場合、イエローの第1フィルタ領域211を透過した光線に基づくR画像のぼけ関数201R,203Rは非対称であり、またシアンの第2フィルタ領域212を透過した光線に基づくB画像のぼけ関数201B,203Bも非対称である。そして、そのR画像のぼけ関数201R,203Rは、B画像のぼけ関数201B,203Bとは異なっている。 As described above, when the subject 210 is in front of or behind the focusing distance df, the blur functions 201R and 203R of the R image based on the light rays transmitted through the first filter region 211 of yellow are asymmetrical, and the cyanth th. The blur functions 201B and 203B of the B image based on the light rays transmitted through the two filter regions 212 are also asymmetric. The R image blur functions 201R and 203R are different from the B image blur functions 201B and 203B.

図5はこのような画像上のぼけを利用して被写体210までの距離を算出(推定)する方法を示す。図5に示す例では、フィルタ21はイエローの第1フィルタ領域211とシアンの第2フィルタ領域212とによって構成されている。そのため、R画像に対応する波長帯域の光が第1フィルタ領域211に対応する部分51Rを通過し、G画像に対応する波長帯域の光が第1フィルタ領域211および第2フィルタ領域212に対応する部分51Gを通過し、B画像に対応する波長帯域の光が第2フィルタ領域212に対応する部分51Bを通過する。 FIG. 5 shows a method of calculating (estimating) the distance to the subject 210 by using such a blur on the image. In the example shown in FIG. 5, the filter 21 is composed of a yellow first filter region 211 and a cyan second filter region 212. Therefore, the light in the wavelength band corresponding to the R image passes through the portion 51R corresponding to the first filter region 211, and the light in the wavelength band corresponding to the G image corresponds to the first filter region 211 and the second filter region 212. The light in the wavelength band corresponding to the B image passes through the portion 51G and passes through the portion 51B corresponding to the second filter region 212.

このようなフィルタ21を用いて撮像された画像上にぼけが生じた場合、R画像、G画像およびB画像上のぼけはそれぞれ異なる形状になる。図5に示すように、G画像のぼけ関数52Gは左右対称であるぼけの形状を表している。また、R画像のぼけ関数52RおよびB画像のぼけ関数52Bは非点対称であるぼけの形状を表し、ぼけの偏りはそれぞれ異なっている。 When blurring occurs on an image captured by using such a filter 21, the blurring on the R image, the G image, and the B image has different shapes. As shown in FIG. 5, the blur function 52G of the G image represents a symmetrical blur shape. Further, the blur function 52R of the R image and the blur function 52B of the B image represent the shape of the blur that is non-point symmetric, and the bias of the blur is different from each other.

R画像のぼけ関数52RおよびB画像のぼけ関数52Bには、R画像およびB画像上の非点対称なぼけを左右対称なぼけに補正するためのぼけ補正フィルタ53,54が適用され、ぼけ補正フィルタ53、54が適用された後のぼけ関数がG画像のぼけ関数52Gと一致するかどうかが判定される。ぼけ補正フィルタ53,54は複数用意されており、複数のぼけ補正フィルタ53、54のそれぞれは、被写体との複数の距離にそれぞれ対応する。あるぼけ補正フィルタ53,54が適用されたぼけ関数が、G画像のぼけ関数52Gと一致した場合には、そのぼけ補正フィルタ53,54に対応する距離が、撮影された被写体210までの距離に決定される。 Blurring function 52R of R image and blurring function 52B of B image are blurred correction filters 53 and 54 for correcting non-point symmetric blurring on R image and B image to left-right symmetric blurring. It is determined whether the blur function after the filters 53 and 54 are applied matches the blur function 52G of the G image. A plurality of blur correction filters 53 and 54 are prepared, and each of the plurality of blur correction filters 53 and 54 corresponds to a plurality of distances to the subject. When the blur function to which a certain blur correction filter 53, 54 is applied matches the blur function 52G of the G image, the distance corresponding to the blur correction filter 53, 54 is the distance to the photographed subject 210. It is determined.

このぼけ関数が一致しているかどうかの判定には、例えば、ぼけ補正フィルタが適用されたR画像またはB画像と、G画像との相関が用いられる。したがって例えば、複数のぼけ補正フィルタから、ぼけ補正フィルタが適用されたぼけ関数とG画像のぼけ関数との相関がより高くなるぼけ補正フィルタを探索することで、画像上の各画素に写る被写体までの距離が推定される。 In determining whether or not the blur functions match, for example, the correlation between the R image or the B image to which the blur correction filter is applied and the G image is used. Therefore, for example, by searching for a blur correction filter that has a higher correlation between the blur function to which the blur correction filter is applied and the blur function of the G image, from a plurality of blur correction filters to the subject reflected in each pixel on the image. Distance is estimated.

ぼけ補正フィルタが適用されたR画像またはB画像と、G画像との相関を示す相関値には、例えば、NCC(Normalized Cross−Correlation)、ZNCC(Zero−mean Normalized Cross−Correlation)、Color Alignment Measure、等が用いられ得る。 Correlation values indicating the correlation between the R image or B image to which the blur correction filter is applied and the G image include, for example, NCC (Normalized Cross-Correlation), ZNCC (Zero-main Normalized Cross-Correlation), and Color Alignment Measurement. , Etc. can be used.

また、あるぼけ補正フィルタ53,54が適用されたぼけ関数55R,55Bが、G画像のぼけ関数52Gと一致しているかどうかの判定に、ぼけ補正フィルタが適用されたR画像またはB画像とG画像との相違度が用いられてもよい。この相違度がより低くなる距離を求めることで、被写体までの距離を算出することができる。相違度には、例えば、SSD(Sum of Squared Difference)、SAD(Sum of Absolute Difference)、等が用いられ得る。 Further, the R image or B image to which the blur correction filter is applied and G are used to determine whether the blur functions 55R and 55B to which a certain blur correction filters 53 and 54 are applied match the blur function 52G of the G image. The degree of difference from the image may be used. The distance to the subject can be calculated by obtaining the distance at which the degree of difference becomes lower. For the degree of difference, for example, SSD (Sum of Squared Difference), SAD (Sum of Absolute Difference), and the like can be used.

なお、ぼけ補正フィルタ53が適用されたR画像のぼけ関数が、ぼけ補正フィルタ54が適用されたB画像のぼけ関数と一致するかどうかが判定されてもよい。これらぼけ補正フィルタ53,54は同一の距離に対応する。ぼけ補正フィルタ53が適用されたR画像のぼけ関数が、ぼけ補正フィルタ54が適用されたB画像のぼけ関数と一致した場合には、それらぼけ補正フィルタ53,54に対応する距離が、撮影された被写体210までの距離に決定される。 It may be determined whether or not the blur function of the R image to which the blur correction filter 53 is applied matches the blur function of the B image to which the blur correction filter 54 is applied. These blur correction filters 53 and 54 correspond to the same distance. When the blur function of the R image to which the blur correction filter 53 is applied matches the blur function of the B image to which the blur correction filter 54 is applied, the distances corresponding to the blur correction filters 53 and 54 are photographed. The distance to the subject 210 is determined.

このように、2つの色成分画像上のぼけ(例えば、ぼけ関数、ぼけ形状)の相対的な関係が、被写体までの距離と相関を持つので、画像処理部12はこの相関関係を予めキャリブレーションして保持することもできる。キャリブレーションにより、一方の色成分画像上のぼけを他方の色成分画像上のぼけに補正するためのぼけ補正量と、被写体までの距離との対応を示すルックアップテーブル(LUT)やモデルが作成される。例えば、R画像またはB画像のぼけ関数をG画像のぼけ関数と一致させるために用いられるぼけ補正フィルタ53,54と被写体までの距離との対応を示すLUTまたはモデルが作成される。なお、ぼけ補正量の代わりに、一方の色成分画像上のぼけと他方の色成分画像上のぼけとの関係を示す、例えばぼけの大きさのような他の値(パラメータ)が用いられてもよい。このLUTまたはモデルを参照することにより、ぼけ補正量を被写体までの距離に変換することができる。 In this way, the relative relationship between the blurs (for example, the blur function and the blur shape) on the two color component images correlates with the distance to the subject, and the image processing unit 12 calibrates this correlation in advance. Can also be held. Calibration creates a look-up table (LUT) or model that shows the correspondence between the amount of blur correction for correcting the blur on one color component image to the blur on the other color component image and the distance to the subject. Will be done. For example, a LUT or model is created that shows the correspondence between the blur correction filters 53, 54 used to match the blur function of the R image or the B image with the blur function of the G image and the distance to the subject. Instead of the blur correction amount, another value (parameter) indicating the relationship between the blur on one color component image and the blur on the other color component image, for example, the magnitude of the blur, is used. May be good. By referring to this LUT or model, the amount of blur correction can be converted into the distance to the subject.

図6のフローチャートは、画像処理部12によって実行される測距処理の手順の例を示す。測距処理では、撮像部11により取得された画像を用いて、撮像された時点の撮像部11の位置から画像に写っている被写体までの距離が算出される。 The flowchart of FIG. 6 shows an example of a procedure of distance measurement processing executed by the image processing unit 12. In the distance measuring process, the distance from the position of the image pickup unit 11 at the time of image capture to the subject in the image is calculated using the image acquired by the image pickup unit 11.

まず、画像処理部12は、撮像部11から画像が取得されたか否かを判定する(ステップS11)。画像処理部12は、例えば撮像部11によって新たな画像が生成された場合に、撮像部11から画像が取得されたと判断する。また、画像処理部12は、撮像部11によって生成され、ストレージ等に格納された1つ以上の画像から、1つの画像を取得してもよい。撮像部11から画像が取得されていない場合(ステップS11のNO)、ステップS11に戻り、撮像部11から画像が取得されたか否かが再度判定される。 First, the image processing unit 12 determines whether or not an image has been acquired from the image pickup unit 11 (step S11). The image processing unit 12 determines that an image has been acquired from the image pickup unit 11, for example, when a new image is generated by the image pickup unit 11. Further, the image processing unit 12 may acquire one image from one or more images generated by the image pickup unit 11 and stored in a storage or the like. If the image has not been acquired from the image pickup unit 11 (NO in step S11), the process returns to step S11, and it is determined again whether or not the image has been acquired from the image pickup unit 11.

撮像部11から画像が取得された場合(ステップS11のYES)、画像処理部12は取得された画像内の注目画素を設定する(ステップS12)。注目画素は、例えば画像の左上端の画素から右下端の画素までラスタ走査の順に設定され得る。また、画像上のエッジに対応する画素が注目画素として設定されてもよい。 When an image is acquired from the image pickup unit 11 (YES in step S11), the image processing unit 12 sets the pixel of interest in the acquired image (step S12). The pixels of interest may be set in the order of raster scanning, for example, from the pixel at the upper left corner of the image to the pixel at the lower right corner. Further, the pixel corresponding to the edge on the image may be set as the pixel of interest.

次いで画像処理部12は、あるぼけ補正量に対応するぼけ補正フィルタを取得する(ステップS13)。画像処理部12は、例えば予め用意された複数のぼけ補正量にそれぞれ対応する複数のぼけ補正フィルタ53,54から、1つのぼけ補正フィルタを取得する。画像処理部12は、取得されたぼけ補正フィルタをR画像またはB画像内の注目画素を含む第1領域に適用することにより、補正された第1領域を生成する(ステップS14)。第1領域は、例えば注目画素を中心とする特定のサイズの領域である。 Next, the image processing unit 12 acquires a blur correction filter corresponding to a certain blur correction amount (step S13). The image processing unit 12 acquires one blur correction filter from, for example, a plurality of blur correction filters 53 and 54 corresponding to a plurality of blur correction amounts prepared in advance. The image processing unit 12 generates the corrected first region by applying the acquired blur correction filter to the first region including the pixel of interest in the R image or the B image (step S14). The first region is, for example, a region of a specific size centered on a pixel of interest.

そして画像処理部12は、補正された第1領域と、G画像内の注目画素を含む第2領域とが一致したか否かを判定する(ステップS15)。第2領域は、例えば注目画素を中心とする第1領域と同一のサイズを有する領域である。なお、画像処理部12は、補正された第1領域と第2領域とが一致したか否かを判定する代わりに、補正された第1領域と第2領域との相関値が第1閾値を超えているか否かを、あるいは補正された第1領域と第2領域との相違度が第2閾値未満であるか否かを判定してもよい。補正された第1領域と第2領域とが一致していない場合(ステップS15のNO)、ステップS13に戻り、別のぼけ補正フィルタを用いた処理が行われる。 Then, the image processing unit 12 determines whether or not the corrected first region and the second region including the pixel of interest in the G image match (step S15). The second region is, for example, a region having the same size as the first region centered on the pixel of interest. In addition, instead of determining whether or not the corrected first region and the second region match, the image processing unit 12 sets the first threshold value as the correlation value between the corrected first region and the second region. It may be determined whether or not it exceeds, or whether or not the corrected degree of difference between the first region and the second region is less than the second threshold value. If the corrected first region and the second region do not match (NO in step S15), the process returns to step S13, and processing using another blur correction filter is performed.

補正された第1領域と第2領域とが一致した場合(ステップS15のYES)、画像処理部12は、適用されたぼけ補正フィルタに対応するぼけ補正量に基づいて、被写体までの距離を算出する(ステップS16)。この算出には、上述したように、ぼけ補正量と被写体までの距離との対応を示すLUTやモデルが用いられてもよい。 When the corrected first region and the second region match (YES in step S15), the image processing unit 12 calculates the distance to the subject based on the blur correction amount corresponding to the applied blur correction filter. (Step S16). As described above, a LUT or a model indicating the correspondence between the blur correction amount and the distance to the subject may be used for this calculation.

次いで画像処理部12は、取得された画像内に、被写体までの距離を算出すべき別の画素があるか否かを判定する(ステップS17)。被写体までの距離を算出すべき別の画素がある場合(ステップS17のYES)、ステップS12に戻り、その別の画素に写っている被写体までの距離を算出するための処理が行われる。 Next, the image processing unit 12 determines whether or not there is another pixel in the acquired image for which the distance to the subject should be calculated (step S17). If there is another pixel for which the distance to the subject should be calculated (YES in step S17), the process returns to step S12, and a process for calculating the distance to the subject reflected in the other pixel is performed.

被写体までの距離を算出すべき別の画素がない場合(ステップS17のNO)、処理を終了する。 If there is no other pixel for which the distance to the subject should be calculated (NO in step S17), the process ends.

以上により、画像処理部12は、撮像部11によって取得された画像を用いて、画像内の各画素に写っている被写体までの距離を算出することができる。 As described above, the image processing unit 12 can calculate the distance to the subject reflected in each pixel in the image by using the image acquired by the image pickup unit 11.

ところで、フィルタ21は、被写体までの距離を精度良く算出するために、理想的にはレンズユニット3内の開口部に設けられることが望ましい。図7に示すように、レンズユニット3内の開口部3Aの位置は、レンズユニット3内に配置される1つ以上のレンズ311,312,313の各々の光学特性、レンズ311,312,313の配置等に基づく光学設計によって決定される。開口部3Aは、いずれか2つのレンズ311,312,313の間、レンズユニット3の第1端部3E−1とレンズ311(すなわち第1端部3E−1に最も近いレンズ)との間、またはレンズユニット3の第2端部3E−2とレンズ313(すなわち第2端部3E−2に最も近いレンズ)との間に位置する。 By the way, it is desirable that the filter 21 is ideally provided at the opening in the lens unit 3 in order to calculate the distance to the subject with high accuracy. As shown in FIG. 7, the position of the opening 3A in the lens unit 3 is the optical characteristics of each of the one or more lenses 311, 312, 313 arranged in the lens unit 3, and the positions of the lenses 311, 312, 313. It is determined by the optical design based on the arrangement and so on. The opening 3A is between any two lenses 311, 312, 313, between the first end 3E-1 of the lens unit 3 and the lens 311 (ie, the lens closest to the first end 3E-1). Alternatively, it is located between the second end 3E-2 of the lens unit 3 and the lens 313 (that is, the lens closest to the second end 3E-2).

フィルタ21が開口部3Aに設けられたレンズユニットを利用するには、例えば、開口部3Aにフィルタ21が組み込まれた特殊なレンズユニットを製造するか、あるいは市販のレンズユニットを分解し、開口部3Aにフィルタ21を挿入し、レンズユニットを組み立てなおして改造する必要がある。このような方法は汎用性に乏しく、一般的なユーザが、開口部3Aにフィルタ21が設けられたレンズユニットを利用することは困難である。 To utilize a lens unit in which the filter 21 is provided in the opening 3A, for example, a special lens unit in which the filter 21 is incorporated in the opening 3A is manufactured, or a commercially available lens unit is disassembled and the opening is used. It is necessary to insert the filter 21 into 3A and reassemble and remodel the lens unit. Such a method lacks versatility, and it is difficult for a general user to use a lens unit provided with a filter 21 in the opening 3A.

また、被写体のエッジがフィルタ21内の第1フィルタ領域211と第2フィルタ領域212との境界線214と直交する場合(例えば撮像されるシーンが境界線214に直交するエッジを多く含む場合)、被写体までの距離に応じたぼけを含む画像が得られず、画像から被写体までの距離を算出する測距性能が劣化する。このような場合には、被写体のエッジと、第1フィルタ領域211と第2フィルタ領域212との境界線214とが直交しないように、フィルタ21の向きを変更すること(すなわちフィルタ21を回転させること)により、被写体までの距離を精度良く算出可能な画像を取得できる。 Further, when the edge of the subject is orthogonal to the boundary line 214 between the first filter area 211 and the second filter area 212 in the filter 21 (for example, when the captured scene contains many edges orthogonal to the boundary line 214). An image including blur according to the distance to the subject cannot be obtained, and the distance measurement performance for calculating the distance from the image to the subject deteriorates. In such a case, the direction of the filter 21 is changed (that is, the filter 21 is rotated so that the edge of the subject and the boundary line 214 between the first filter area 211 and the second filter area 212 are not orthogonal to each other. By doing so, it is possible to acquire an image in which the distance to the subject can be calculated accurately.

さらに、開口部3Aに配置されたフィルタ21の向きは振動等で意図しない向きにずれることがある。しかし、レンズユニット3内部の開口部3Aに配置されたフィルタ21の向きを変更することは、ユーザにとって非常に困難な作業である。 Further, the direction of the filter 21 arranged in the opening 3A may shift to an unintended direction due to vibration or the like. However, changing the orientation of the filter 21 arranged in the opening 3A inside the lens unit 3 is a very difficult task for the user.

そのため本実施形態では、フィルタ21がレンズユニット3の外部に設けられる。フィルタ21は、開口部3Aから距離D1だけ離間した、レンズユニット3の外部の位置に設けられる。フィルタ21から開口部3Aまでの距離D1は、フィルタ21を含むフィルタユニット2が取り付けられるレンズユニット3の第1端部3E−1から開口部3Aまでの距離D2よりも長い。これにより、種々のレンズユニット3(あるいはレンズユニット3を備えるカメラ)に対して、レンズユニット3の構造を変更することなく、フィルタ21を備えるフィルタユニット2を容易に取り付けられる。またユーザが容易に操作できるレンズユニット3の外部にフィルタユニット2が設けられるので、被写体上のエッジ等に応じてフィルタ21の向きも容易に調節できる。 Therefore, in the present embodiment, the filter 21 is provided outside the lens unit 3. The filter 21 is provided at a position outside the lens unit 3 at a distance D1 from the opening 3A. The distance D1 from the filter 21 to the opening 3A is longer than the distance D2 from the first end 3E-1 of the lens unit 3 to which the filter unit 2 including the filter 21 is attached to the opening 3A. As a result, the filter unit 2 provided with the filter 21 can be easily attached to various lens units 3 (or a camera provided with the lens unit 3) without changing the structure of the lens unit 3. Further, since the filter unit 2 is provided outside the lens unit 3 that can be easily operated by the user, the orientation of the filter 21 can be easily adjusted according to the edge or the like on the subject.

図8は本実施形態に係る撮像装置11の構造の例を示す。撮像装置11は、フィルタ21を備えるフィルタユニット2と、1つ以上のレンズ31を備えるレンズユニット3と、イメージセンサ41を備えるカメラ本体4とから構成される。フィルタユニット2およびレンズユニット3は、例えば円筒形状を有する。撮像装置11は、カメラ本体4に画像処理部12が設けられた測距装置1であってもよい。また、カメラ本体4にディスプレイ13が組み込まれていてもよい。以下では説明を分かりやすくするために、撮像装置11において、カメラ本体4からフィルタユニット2への向きを前方と称し、フィルタユニット2からカメラ本体4への向きを後方と称する。 FIG. 8 shows an example of the structure of the image pickup apparatus 11 according to the present embodiment. The image pickup apparatus 11 includes a filter unit 2 including a filter 21, a lens unit 3 including one or more lenses 31, and a camera body 4 including an image sensor 41. The filter unit 2 and the lens unit 3 have, for example, a cylindrical shape. The image pickup device 11 may be a distance measuring device 1 in which the image processing unit 12 is provided on the camera body 4. Further, the display 13 may be incorporated in the camera body 4. Hereinafter, in order to make the explanation easier to understand, in the image pickup apparatus 11, the direction from the camera body 4 to the filter unit 2 is referred to as the front, and the direction from the filter unit 2 to the camera body 4 is referred to as the rear.

カメラ本体4の正面には、レンズユニット3を装着するためのレンズマウント42が設けられている。レンズマウント42には、レンズユニット3の第2端部3E−2に設けられるボディマウント(図示せず)が結合される。これによりレンズユニット3がカメラ本体4に装着される。ここではレンズユニット3が交換レンズである例を示したが、レンズユニット3は、コンパクトデジタルカメラ、スマートフォンまたはタブレットPCに設けられるカメラ等のように、カメラ本体4に固定され一体化されていてもよい。 A lens mount 42 for mounting the lens unit 3 is provided on the front surface of the camera body 4. A body mount (not shown) provided at the second end 3E-2 of the lens unit 3 is coupled to the lens mount 42. As a result, the lens unit 3 is attached to the camera body 4. Here, an example in which the lens unit 3 is an interchangeable lens is shown, but even if the lens unit 3 is fixed and integrated with the camera body 4, such as a compact digital camera, a camera provided in a smartphone or a tablet PC, the lens unit 3 is fixed to the camera body 4. good.

レンズユニット3の第1端部3E−1には、フィルタユニット2を取り付けるためのネジ部32が設けられている。ネジ部32は、一般的なレンズユニット3(交換レンズ)において、レンズ31を保護するためのプロテクタや各種のフィルタ(例えばUVカットフィルタ、偏光フィルタ等)を取り付けるために設けられているものであってもよい。 The first end 3E-1 of the lens unit 3 is provided with a screw portion 32 for attaching the filter unit 2. The screw portion 32 is provided in a general lens unit 3 (interchangeable lens) for attaching a protector for protecting the lens 31 and various filters (for example, a UV cut filter, a polarizing filter, etc.). You may.

フィルタユニット2はフィルタ21を保持するフィルタ枠22と、フィルタ枠22に連結する取り付け部23とを備える。フィルタ枠22は、例えば円形のフィルタ21を保持するために円筒形状を有する。取り付け部23はフィルタ枠22の少なくとも一部を囲み、支持する円筒形状を有する。 The filter unit 2 includes a filter frame 22 for holding the filter 21 and a mounting portion 23 connected to the filter frame 22. The filter frame 22 has a cylindrical shape, for example, to hold a circular filter 21. The mounting portion 23 has a cylindrical shape that surrounds and supports at least a portion of the filter frame 22.

また取り付け部23は、レンズユニット3の第1端部3E−1に着脱可能に取り付けられる。取り付け部23は、フィルタユニット2をレンズユニット3の第1端部3E−1に取り付けるためのネジ部231を備える。ネジ部231をレンズユニット3のネジ部32に螺合させることにより、フィルタユニット2がレンズユニット3に取り付けられる。この取り付けにより、取り付け部23がレンズユニット3に対して固定される。 Further, the attachment portion 23 is detachably attached to the first end portion 3E-1 of the lens unit 3. The mounting portion 23 includes a screw portion 231 for mounting the filter unit 2 to the first end portion 3E-1 of the lens unit 3. The filter unit 2 is attached to the lens unit 3 by screwing the screw portion 231 into the screw portion 32 of the lens unit 3. By this attachment, the attachment portion 23 is fixed to the lens unit 3.

なお、レンズユニット3に取り付けられた別のフィルタ等に設けられるネジ部32に、フィルタユニット2のネジ部231が螺合されてもよい。すなわちその別のフィルタ等を挟んで、フィルタユニット2がレンズユニット3に取り付けられてもよい。フィルタユニット2のネジ部231は、対応するネジ部32を有する他の円筒形状の対象への取り付けを可能とするものである。 The screw portion 231 of the filter unit 2 may be screwed into the screw portion 32 provided on another filter or the like attached to the lens unit 3. That is, the filter unit 2 may be attached to the lens unit 3 with the other filter or the like interposed therebetween. The threaded portion 231 of the filter unit 2 allows attachment to another cylindrical object having the corresponding threaded portion 32.

フィルタ枠22は光軸15を中心として(すなわち光学中心213に対して)回転自在である構造を有する。つまりフィルタ枠22は、光軸15を中心として回転することによりフィルタ21の向き(すなわち回転方向の角度)を調節できる調節機構を有する。したがってユーザは、フィルタ枠22を回転させる操作を行うことで、フィルタ21の向きを被写体上のエッジ等に応じて適切に変更できる。フィルタ21の向きは、例えばフィルタ21内の第1フィルタ領域211と第2フィルタ領域212との境界線214の方向で特定される。以下ではこの境界線214の方向をフィルタ21の向きとも称する。 The filter frame 22 has a structure that is rotatable about the optical axis 15 (that is, with respect to the optical center 213). That is, the filter frame 22 has an adjustment mechanism capable of adjusting the direction (that is, the angle in the rotation direction) of the filter 21 by rotating around the optical axis 15. Therefore, the user can appropriately change the direction of the filter 21 according to the edge or the like on the subject by performing the operation of rotating the filter frame 22. The orientation of the filter 21 is specified, for example, in the direction of the boundary line 214 between the first filter region 211 and the second filter region 212 in the filter 21. Hereinafter, the direction of the boundary line 214 is also referred to as the direction of the filter 21.

また図9に示すように、フィルタ枠22は取り付け部23の側面を貫通するネジ232を固定部として用いて、取り付け部23に対して固定される。ネジ232が締め付けられた場合、フィルタ枠22が取り付け部23に対して固定される。一方、ネジ232が緩められた場合、フィルタ枠22は回転自在になる。ネジ232には、例えばネジ頭部がネジ部と同じ大きさである止めネジが用いられる。 Further, as shown in FIG. 9, the filter frame 22 is fixed to the mounting portion 23 by using a screw 232 penetrating the side surface of the mounting portion 23 as a fixing portion. When the screw 232 is tightened, the filter frame 22 is fixed to the mounting portion 23. On the other hand, when the screw 232 is loosened, the filter frame 22 becomes rotatable. For the screw 232, for example, a set screw having a screw head having the same size as the screw portion is used.

あるいは図10に示すように、フィルタ枠22はロックリング25と、取り付け部23に設けられる締め付け部241,243とを固定部として用いて、取り付け部23に対して固定されてもよい。2つの締め付け部241,243は、例えばフィルタ枠22を上方と下方から挟み込むように設けられる。締め付け部241の基端部241Aは取り付け部23の上部に支持(固定)され、基端部241Aからフィルタ枠22に接触する先端部241Bに亘って連続的に延出されている。また、締め付け部243の基端部243Aは取り付け部23の下部に支持(固定)され、基端部243Aからフィルタ枠22に接触する先端部243Bに亘って連続的に延出されている。 Alternatively, as shown in FIG. 10, the filter frame 22 may be fixed to the mounting portion 23 by using the lock ring 25 and the tightening portions 241,243 provided on the mounting portion 23 as fixing portions. The two tightening portions 241,243 are provided so as to sandwich the filter frame 22 from above and below, for example. The base end portion 241A of the tightening portion 241 is supported (fixed) on the upper portion of the mounting portion 23, and extends continuously from the base end portion 241A to the tip end portion 241B in contact with the filter frame 22. Further, the base end portion 243A of the tightening portion 243 is supported (fixed) to the lower portion of the mounting portion 23, and extends continuously from the base end portion 243A to the tip end portion 243B in contact with the filter frame 22.

各先端部241B,243Bには、光軸15に対して外側に、ネジ状の刻みを有するテーパ242,244が設けられている。同様のネジ状の刻みを内側に有するロックリング25がテーパ242,244のネジ状の刻みに対してねじ込まれることにより、フィルタ枠22が取り付け部23に対して固定される。一方、ロックリング25が緩められた場合、フィルタ枠22は回転自在になる。 Each of the tip portions 241B and 243B is provided with tapers 242 and 244 having screw-shaped notches on the outside with respect to the optical axis 15. The filter frame 22 is fixed to the mounting portion 23 by screwing the lock ring 25 having the same screw-shaped notch inside into the thread-shaped notch of the taper 242,244. On the other hand, when the lock ring 25 is loosened, the filter frame 22 becomes rotatable.

フィルタ枠22を取り付け部23に対して固定するための機構(固定部)は、上述した構成に限られず、例えばフィルタ枠22と取り付け部23との間の摩擦力で簡易的に固定される機構であってもよいし、あるいはフィルタ枠22が取り付け部23に圧入されることによって固定力を得る機構であってもよい。つまりフィルタ枠22は、取り付け部23との摩擦力により、または取り付け部23に対する圧入により、取り付け部23に対する位置が保持され得る。 The mechanism (fixing portion) for fixing the filter frame 22 to the mounting portion 23 is not limited to the above-mentioned configuration, and is, for example, a mechanism that is simply fixed by the frictional force between the filter frame 22 and the mounting portion 23. Or it may be a mechanism for obtaining a fixing force by press-fitting the filter frame 22 into the mounting portion 23. That is, the filter frame 22 can be held in position with respect to the mounting portion 23 by frictional force with the mounting portion 23 or by press fitting into the mounting portion 23.

フィルタユニット2には、フィルタ枠22が取り付け部23に対して固定された後に、取り付け部23に対するフィルタ枠22の位置を調整する機構がさらに設けられていてもよい。この機構は、例えば図9に示した例と同様に、取り付け部23の側面を貫通してフィルタ枠22に接触し得る微調整用のネジである。微調整用のネジは、取り付け部23に対するフィルタ枠22の位置を、例えば水平方向と垂直方向に調整(シフト)できるように複数設けられ得る。これにより微調整用のネジを締め付けるか、あるいは緩めることにより、取り付け部23に対するフィルタ枠22の位置を調整できる。 The filter unit 2 may be further provided with a mechanism for adjusting the position of the filter frame 22 with respect to the mounting portion 23 after the filter frame 22 is fixed to the mounting portion 23. This mechanism is, for example, a screw for fine adjustment that can penetrate the side surface of the mounting portion 23 and come into contact with the filter frame 22 as in the example shown in FIG. A plurality of fine adjustment screws may be provided so that the position of the filter frame 22 with respect to the mounting portion 23 can be adjusted (shifted) in the horizontal direction and the vertical direction, for example. As a result, the position of the filter frame 22 with respect to the mounting portion 23 can be adjusted by tightening or loosening the fine adjustment screw.

次いで図11は、撮像装置11がレンズフード8を取り付けるための構造をさらに有する例を示す。レンズフード8はその一端にネジ部81を有している。レンズフード8には、円筒形状以外のレンズフード(例えば花形のレンズフード)のように、取り付けられるべき向きを有するものがある。 Next, FIG. 11 shows an example in which the image pickup apparatus 11 further has a structure for attaching the lens hood 8. The lens hood 8 has a screw portion 81 at one end thereof. Some lens hoods 8 have an orientation to be attached, such as a lens hood other than a cylindrical lens hood (for example, a flower-shaped lens hood).

フィルタ枠22には、その前方に、レンズフード8を取り付けるためのレンズフード枠29がさらに設けられる。レンズフード枠29の前方の端部には、例えばその内側に、レンズフード8が着脱自在に取り付けられるネジ部291(取り付け部)が設けられる。このネジ部291にレンズフード8のネジ部81を螺合させることにより、レンズフード8がレンズフード枠29に取り付けられる。 The filter frame 22 is further provided with a lens hood frame 29 for attaching the lens hood 8 in front of the filter frame 22. At the front end of the lens hood frame 29, for example, a screw portion 291 (mounting portion) to which the lens hood 8 is detachably attached is provided inside the lens hood frame 29. The lens hood 8 is attached to the lens hood frame 29 by screwing the screw portion 81 of the lens hood 8 into the screw portion 291.

レンズフード枠29は光軸15を中心として(すなわち光学中心213に対して)摺動可能(回転自在)である構造を有する。つまりレンズフード枠29は、光軸15を中心として回転することによりレンズフード8の向きを調整できる構造を有する。したがってユーザは、レンズフード枠29を回転させる操作を行うことで、レンズフード8の向きを適切に変更できる。 The lens hood frame 29 has a structure that is slidable (rotatable) about the optical axis 15 (that is, with respect to the optical center 213). That is, the lens hood frame 29 has a structure in which the direction of the lens hood 8 can be adjusted by rotating around the optical axis 15. Therefore, the user can appropriately change the orientation of the lens hood 8 by performing an operation of rotating the lens hood frame 29.

以上の構成により、撮像装置11においてフィルタ21が容易に取り付けられる。フィルタ21は、第1波長帯域の光を透過する第1フィルタ領域211と、第2波長帯域の光を透過する第2フィルタ領域212とを備える。第1波長帯域と第2波長帯域は共通の波長帯域を含む。フィルタ枠22は、フィルタ21を保持する。取り付け部23は、フィルタ枠22に連結し、レンズユニット3の第1端部3E−1に着脱可能に取り付けられる。取り付け部23がレンズユニット3の第1端部3E−1に取り付けられた場合、フィルタ21からレンズユニット3内の開口部3Aまでの距離は、第1端部3E−1から開口部3Aまでの距離よりも長い。 With the above configuration, the filter 21 can be easily attached in the image pickup apparatus 11. The filter 21 includes a first filter region 211 that transmits light in the first wavelength band and a second filter region 212 that transmits light in the second wavelength band. The first wavelength band and the second wavelength band include a common wavelength band. The filter frame 22 holds the filter 21. The attachment portion 23 is connected to the filter frame 22 and is detachably attached to the first end portion 3E-1 of the lens unit 3. When the mounting portion 23 is mounted on the first end portion 3E-1 of the lens unit 3, the distance from the filter 21 to the opening 3A in the lens unit 3 is from the first end 3E-1 to the opening 3A. Longer than the distance.

このように、フィルタ枠22に連結する取り付け部23はレンズユニット3の第1端部3E−1に取り付けられ、着脱自在である。したがって撮像装置11において、フィルタ21が容易に取り付けられると共に、フィルタ21の向きも容易に変更できる。 In this way, the attachment portion 23 connected to the filter frame 22 is attached to the first end portion 3E-1 of the lens unit 3 and is detachable. Therefore, in the image pickup apparatus 11, the filter 21 can be easily attached and the orientation of the filter 21 can be easily changed.

ところで画像処理部12は、図5および図6を参照して上述したように、ある特定の方向(例えば、水平方向、垂直方向等)にぼけの偏りが生じることを前提としたぼけ補正フィルタを用いて、画像に写った被写体までの距離を算出する。フィルタ21の向きが想定された方向からずれることは画像処理部12における測距性能を劣化させ得る。測距性能を高めるためには、撮像時のフィルタ21の向きを、前提としている画像上に生じるぼけの偏りの方向に対応するように設定すること、すなわちフィルタ21の向きを、前提としている画像上に生じるぼけの偏りの方向に直交するように設定することが必要である。 By the way, as described above with reference to FIGS. 5 and 6, the image processing unit 12 provides a blur correction filter on the premise that blur bias occurs in a specific direction (for example, horizontal direction, vertical direction, etc.). Use to calculate the distance to the subject in the image. If the direction of the filter 21 deviates from the assumed direction, the distance measurement performance in the image processing unit 12 may deteriorate. In order to improve the distance measurement performance, the orientation of the filter 21 at the time of imaging should be set so as to correspond to the direction of the blur bias that occurs on the assumed image, that is, the orientation of the filter 21 is assumed. It is necessary to set it so that it is orthogonal to the direction of the bias of the blur that occurs above.

例えばR画像およびB画像上に生じるぼけの偏りが水平方向であることを前提としたぼけ補正フィルタが用意されている場合、フィルタ21の向き(より詳しくはフィルタ21内の境界線214の向き)を垂直方向に設定しておくことで、その意図された水平方向のぼけの偏りが発生した画像を取得できる。また例えばR画像およびB画像上に生じるぼけの偏りが垂直方向であることを前提としたぼけ補正フィルタが用意されている場合、フィルタ21(境界線214)の向きを水平方向に設定しておくことで、その意図された垂直方向のぼけの偏りが発生した画像を取得できる。 For example, when a blur correction filter is prepared on the premise that the blur bias generated on the R image and the B image is in the horizontal direction, the orientation of the filter 21 (more specifically, the orientation of the boundary line 214 in the filter 21). By setting in the vertical direction, it is possible to acquire an image in which the intended horizontal blurring is generated. Further, for example, when a blur correction filter is prepared on the premise that the blur bias generated on the R image and the B image is in the vertical direction, the direction of the filter 21 (boundary line 214) is set in the horizontal direction. This makes it possible to obtain an image in which the intended vertical blur bias occurs.

しかしユーザによる手動の作業では、フィルタ21の向きを、前提としている画像上に生じるぼけの偏りの方向に対応するように正確に設定することが困難であり得る。 However, by manual work by the user, it may be difficult to accurately set the orientation of the filter 21 so as to correspond to the direction of the blur bias that occurs on the presupposed image.

そのため本実施形態では、画像処理部12がフィルタ21の向きに関する補正のための機能を有する。画像処理部12は上述した撮像装置11を用いて、キャリブレーションのための第1被写体(例えばキャリブレーションチャート)が撮像された第1画像と、測距対象の第2被写体が撮像された第2画像とを取得する。そして画像処理部12は、これら第1画像と第2画像とを用いて第2被写体までの距離を算出する。画像処理部12は、第1画像を用いてフィルタ21の向きを算出し、そのフィルタ21の向きと第2画像とを用いて第2被写体までの距離を算出できる。例えば算出されたフィルタ21の向きに基づいて第2画像が補正され、補正された第2画像からぼけ補正フィルタ53,54を用いて第2被写体までの距離が算出される。 Therefore, in the present embodiment, the image processing unit 12 has a function for correcting the orientation of the filter 21. The image processing unit 12 uses the image pickup device 11 described above to capture a first image in which a first subject for calibration (for example, a calibration chart) is captured and a second image in which a second subject to be distance measured is captured. Get the image and. Then, the image processing unit 12 calculates the distance to the second subject using the first image and the second image. The image processing unit 12 can calculate the orientation of the filter 21 using the first image, and can calculate the distance to the second subject using the orientation of the filter 21 and the second image. For example, the second image is corrected based on the calculated orientation of the filter 21, and the distance from the corrected second image to the second subject is calculated using the blur correction filters 53 and 54.

図12は画像処理部12の機能構成の例を示す。画像処理部12は、取得部121、キャリブレーション処理部122、補正部123、および距離算出部124を備える。 FIG. 12 shows an example of the functional configuration of the image processing unit 12. The image processing unit 12 includes an acquisition unit 121, a calibration processing unit 122, a correction unit 123, and a distance calculation unit 124.

取得部121は撮像装置11を用いて画像を取得する。取得部121は、撮像装置11内のイメージセンサによって送出された信号を用いて画像を生成してもよい。あるいは取得部121は、撮像装置11によって生成され、ストレージ(メモリ)等に保存された画像を取得してもよい。取得部121は、例えばキャリブレーションのための第1被写体が撮像された第1画像を取得する。第1被写体は例えばキャリブレーションチャートである。また取得部121は例えば第1画像が取得された後に、測距対象の第2被写体が撮像された第2画像を取得する。第2被写体は複数であってもよい。 The acquisition unit 121 acquires an image using the image pickup device 11. The acquisition unit 121 may generate an image using the signal transmitted by the image sensor in the image pickup apparatus 11. Alternatively, the acquisition unit 121 may acquire an image generated by the image pickup apparatus 11 and stored in a storage (memory) or the like. The acquisition unit 121 acquires, for example, a first image in which the first subject for calibration is captured. The first subject is, for example, a calibration chart. Further, the acquisition unit 121 acquires, for example, a second image in which the second subject to be distanced is captured after the first image is acquired. There may be a plurality of second subjects.

なお、取得された第2画像をストレージ等に保存しておいて、第1画像が取得されてもよい。つまり、保存されている第2画像とその後に取得された第1画像とを用いて、第2画像に撮像された被写体までの距離が算出されてもよい。この場合、第2画像の撮像時と第1画像の撮像時とで撮像装置11に設けられるフィルタ21の向きは変更されないものとする。 The acquired second image may be stored in a storage or the like, and the first image may be acquired. That is, the distance to the subject captured in the second image may be calculated using the stored second image and the first image acquired thereafter. In this case, the orientation of the filter 21 provided in the image pickup apparatus 11 is not changed between the time of capturing the second image and the time of capturing the first image.

図13はキャリブレーションチャート6の例を示す。キャリブレーションチャート6は例えば撮像対象となる平面を有するボード(例えば平板)であって、その平面上に1つ以上の円形または多角形の要素61を含む。キャリブレーションチャート6に複数の要素61が含まれる場合、それら複数の要素61は等間隔で配置される。 FIG. 13 shows an example of the calibration chart 6. The calibration chart 6 is, for example, a board (eg, a flat plate) having a plane to be imaged, and includes one or more circular or polygonal elements 61 on the plane. When the calibration chart 6 includes a plurality of elements 61, the plurality of elements 61 are arranged at equal intervals.

またキャリブレーションチャート6において、要素61の部分とそれ以外の背景部分62とが高いコントラストを有するように、各部分の色が設定されることが望ましい。例えば要素61を黒に、背景部分62を白に設定する。また例えば要素61を白に、背景部分62を黒に設定する。 Further, in the calibration chart 6, it is desirable that the color of each portion is set so that the portion of the element 61 and the other background portion 62 have high contrast. For example, the element 61 is set to black and the background portion 62 is set to white. Further, for example, the element 61 is set to white and the background portion 62 is set to black.

図13に示す例では、キャリブレーションチャート6は、白い背景部分62と、黒い円形である81個(=9×9)の要素61とで構成されている。各要素61は、隣り合う要素61との間隔がXcmである二次元のマトリクス状に配置されている。 In the example shown in FIG. 13, the calibration chart 6 is composed of a white background portion 62 and 81 (= 9 × 9) elements 61 which are black circles. Each element 61 is arranged in a two-dimensional matrix in which the distance from the adjacent element 61 is X cm.

図14は、フィルタ21を備える撮像装置11を用いて、キャリブレーションチャート6の一部が撮像された第1画像71の例を示す。第1画像71上には、撮像時における撮像装置11からキャリブレーションチャート6までの距離に応じたぼけが発生している。また、撮像時のフィルタ21の向きに対応する方向にぼけの偏りが生じている。 FIG. 14 shows an example of the first image 71 in which a part of the calibration chart 6 is captured by using the image pickup device 11 provided with the filter 21. Blurring occurs on the first image 71 according to the distance from the image pickup apparatus 11 to the calibration chart 6 at the time of imaging. Further, there is a blur bias in the direction corresponding to the direction of the filter 21 at the time of imaging.

ここでは一例として、被写体までの距離を算出するために、画像上の水平方向にぼけの偏りが発生すること、すなわちフィルタ21内の境界線214の方向が垂直方向であることを前提としたぼけ補正フィルタが用いられる場合について説明する。 Here, as an example, in order to calculate the distance to the subject, it is assumed that a blur is generated in the horizontal direction on the image, that is, the direction of the boundary line 214 in the filter 21 is the vertical direction. A case where a correction filter is used will be described.

キャリブレーションチャート6上のある要素61を撮像して得られた、第1画像71上の要素711には、水平方向ではない方向にぼけの偏りが生じている。つまり、第1画像71において、要素711のG成分711Gに対して水平方向に、要素711のR成分711RおよびB成分711Bが位置していない。R成分711RはG成分711Gの右斜め上側にずれ、B成分711BはG成分711Gの左斜め下側にずれている。もし要素711に水平方向のぼけの偏りが生じているならば、R成分711RはG成分711Gに対して水平に右側にずれ、B成分711BはG成分711Gに対して水平に左側にずれる。したがって、第1画像71を撮像した時点におけるフィルタ21内の境界線214の方向は垂直方向ではなかったと云える。 The element 711 on the first image 71, which is obtained by imaging a certain element 61 on the calibration chart 6, has a blur bias in a direction other than the horizontal direction. That is, in the first image 71, the R component 711R and the B component 711B of the element 711 are not positioned in the horizontal direction with respect to the G component 711G of the element 711. The R component 711R is displaced diagonally to the upper right of the G component 711G, and the B component 711B is displaced diagonally to the lower left of the G component 711G. If the element 711 has a horizontal blur bias, the R component 711R shifts horizontally to the right with respect to the G component 711G, and the B component 711B shifts horizontally to the left with respect to the G component 711G. Therefore, it can be said that the direction of the boundary line 214 in the filter 21 at the time when the first image 71 is imaged is not the vertical direction.

図15に示すように、キャリブレーション処理部122、補正部123、および距離算出部124は、キャリブレーションチャート6(すなわち第1被写体)が撮像された第1画像71と、測距対象の第2被写体が撮像された第2画像77とを用いて第2被写体までの距離を算出する。 As shown in FIG. 15, the calibration processing unit 122, the correction unit 123, and the distance calculation unit 124 have a first image 71 in which the calibration chart 6 (that is, the first subject) is captured, and a second distance measurement target. The distance to the second subject is calculated using the second image 77 in which the subject is captured.

より具体的には、まずキャリブレーション処理部122は、第1画像71を用いて撮像時のフィルタ21の向き(より詳しくはフィルタ21内の境界線214の方向)21Dを算出する。図16を参照して、第1画像71上の要素711から、第1画像71が撮像された時点におけるフィルタ21内の境界線214の方向が算出される例を説明する。 More specifically, first, the calibration processing unit 122 calculates the direction 21D of the filter 21 at the time of imaging (more specifically, the direction of the boundary line 214 in the filter 21) 21D using the first image 71. An example will be described in which the direction of the boundary line 214 in the filter 21 at the time when the first image 71 is imaged is calculated from the element 711 on the first image 71 with reference to FIG. 16.

キャリブレーション処理部122は、要素711のR成分711Rの重心72RとB成分711Bの重心72Bとをそれぞれ算出する。キャリブレーション処理部122は、重心72Rと重心72Bとをつなぐ線分の方向を、第1画像71上のぼけの偏りの方向71Dとして決定する。このぼけの偏りの方向71Dは、第1画像71上の垂直方向71Vに対して角度θbを有している。また、ぼけの偏りの方向71Dとフィルタ21内の境界線214の方向21Dとは直交するので、フィルタ21内の境界線214の方向21Dは、第1画像71上の垂直方向71Vに対して角度(90°−θb)を有している。キャリブレーション処理部122は、ぼけの偏りの方向71Dを示す角度θbと、フィルタ21内の境界線214の方向21Dを示す角度(90°−θb)とを算出する。 The calibration processing unit 122 calculates the center of gravity 72R of the R component 711R of the element 711 and the center of gravity 72B of the B component 711B, respectively. The calibration processing unit 122 determines the direction of the line segment connecting the center of gravity 72R and the center of gravity 72B as the direction 71D of the blur bias on the first image 71. The direction 71D of this blur bias has an angle θb with respect to the vertical direction 71V on the first image 71. Further, since the direction 71D of the blur bias and the direction 21D of the boundary line 214 in the filter 21 are orthogonal to each other, the direction 21D of the boundary line 214 in the filter 21 is an angle with respect to the vertical direction 71V on the first image 71. It has (90 ° −θb). The calibration processing unit 122 calculates an angle θb indicating the direction 71D of the blur bias and an angle (90 ° −θb) indicating the direction 21D of the boundary line 214 in the filter 21.

なお、フィルタ21が3つ以上のフィルタ領域で構成される場合、キャリブレーション処理部122は、第1画像71を用いて、フィルタ21の向き21Dとして、いずれか2つのフィルタ領域の境界線の方向を算出してもよいし、フィルタ21内の複数の境界線の方向をそれぞれ算出してもよい。 When the filter 21 is composed of three or more filter regions, the calibration processing unit 122 uses the first image 71 as the direction 21D of the filter 21 and the direction of the boundary line of any two filter regions. May be calculated, or the directions of the plurality of boundary lines in the filter 21 may be calculated respectively.

図15に戻り、補正部123は、フィルタ21の境界線214の方向21Dに基づいて第2画像77を補正することにより、補正された第2画像78を生成する。図15に示す例では、補正部123は第2画像77を、フィルタ21の境界線214の方向21Dを示す角度(90°−θb)だけ時計回りに回転させることにより、補正された第2画像78を生成する。これにより第2画像77上の被写体77Aに生じているぼけの偏りの方向は、補正された第2画像78上の被写体78Aでは、前提とされているぼけの偏りの方向(例えば水平方向)に補正される。 Returning to FIG. 15, the correction unit 123 corrects the second image 77 based on the direction 21D of the boundary line 214 of the filter 21 to generate the corrected second image 78. In the example shown in FIG. 15, the correction unit 123 corrects the second image 77 by rotating the second image 77 clockwise by an angle (90 ° −θb) indicating the direction 21D of the boundary line 214 of the filter 21. Generate 78. As a result, the direction of the blur bias that occurs in the subject 77A on the second image 77 is in the direction of the presupposed blur bias (for example, the horizontal direction) in the corrected subject 78A on the second image 78. It will be corrected.

そして距離算出部124は、補正された第2画像78を用いて第2被写体までの距離を算出する。距離算出部124は、例えば予め用意された複数のぼけ補正量にそれぞれ対応する複数のぼけ補正フィルタ53,54と補正された第2画像78とを用いて第2被写体までの距離を算出する。距離を算出する具体的な方法については、図5および図6を参照して上述した通りである。以上により、フィルタ21の向き21Dが、前提とされているぼけの偏りの方向に対応していない場合にも、第2画像78上の被写体までの距離を精度良く算出することができる。 Then, the distance calculation unit 124 calculates the distance to the second subject using the corrected second image 78. The distance calculation unit 124 calculates the distance to the second subject by using, for example, a plurality of blur correction filters 53 and 54 corresponding to a plurality of blur correction amounts prepared in advance and the corrected second image 78. The specific method for calculating the distance is as described above with reference to FIGS. 5 and 6. As described above, the distance to the subject on the second image 78 can be calculated accurately even when the orientation 21D of the filter 21 does not correspond to the presupposed direction of the blur bias.

なお、画像処理部12は通知部125をさらに備えていてもよい。通知部125は、キャリブレーション処理部122によって算出されたフィルタ21の向き21D(例えば角度(90°−θb))をユーザに通知する。ユーザは、この通知に応じてフィルタ21を保持するフィルタ枠22を回転させることにより、フィルタ21の向き21Dを、前提としている画像上に生じるぼけの偏りの方向に対応するように調整すること、すなわちフィルタ21の向き21Dが、前提としている画像上に生じるぼけの偏りの方向に直交するように調整することもできる。この場合、補正部123による第2画像77の補正は必要なく、距離算出部124は、撮像装置11で取得された第2画像77上の被写体までの距離を、予め用意された複数のぼけ補正量にそれぞれ対応する複数のぼけ補正フィルタ53,54を用いて容易に算出できる。 The image processing unit 12 may further include a notification unit 125. The notification unit 125 notifies the user of the orientation 21D (for example, an angle (90 ° −θb)) of the filter 21 calculated by the calibration processing unit 122. The user adjusts the orientation 21D of the filter 21 so as to correspond to the direction of the blur bias that occurs on the assumed image by rotating the filter frame 22 that holds the filter 21 in response to this notification. That is, the orientation 21D of the filter 21 can be adjusted so as to be orthogonal to the direction of the blurring that occurs on the presupposed image. In this case, the correction unit 123 does not need to correct the second image 77, and the distance calculation unit 124 corrects the distance to the subject on the second image 77 acquired by the image pickup apparatus 11 by a plurality of prepared blur corrections. It can be easily calculated by using a plurality of blur correction filters 53 and 54 corresponding to the respective quantities.

図17のフローチャートは、画像処理部(あるいは画像処理装置)12によって実行されるキャリブレーション処理の手順の例を示す。 The flowchart of FIG. 17 shows an example of a procedure of calibration processing executed by the image processing unit (or image processing apparatus) 12.

まず画像処理部12は、キャリブレーションチャート6が撮像された第1画像71を取得する(ステップS21)。画像処理部12は、第1画像71に写ったキャリブレーションチャート6内のある要素711のR成分711Rの重心72RとB成分711Bの重心72Bとを算出する(ステップS22)。そして、画像処理部12は、第1画像71上の垂直方向71Vに対して、R成分711Rの重心72RとB成分711Bの重心72Bとをつなぐ線分がなす角度θbを算出する(ステップS23)。角度θbは、第1画像71上のぼけの偏りの方向71Dを示す。ぼけの偏りの方向71Dとフィルタ21内の境界線214の方向とは直交するので、画像処理部12は、フィルタ21の向き(フィルタ21内の境界線214の方向)21Dを示す角度(90°−θb)を算出できる。 First, the image processing unit 12 acquires the first image 71 in which the calibration chart 6 is captured (step S21). The image processing unit 12 calculates the center of gravity 72R of the R component 711R of the element 711 and the center of gravity 72B of the B component 711B of the element 711 in the calibration chart 6 shown in the first image 71 (step S22). Then, the image processing unit 12 calculates an angle θb formed by a line segment connecting the center of gravity 72R of the R component 711R and the center of gravity 72B of the B component 711B with respect to the vertical direction 71V on the first image 71 (step S23). .. The angle θb indicates the direction 71D of the blur bias on the first image 71. Since the direction of the blur bias 71D and the direction of the boundary line 214 in the filter 21 are orthogonal to each other, the image processing unit 12 has an angle (90 °) indicating the direction of the filter 21 (direction of the boundary line 214 in the filter 21) 21D. −θb) can be calculated.

また画像処理部12は、フィルタ21の向き21Dをユーザに通知してもよい(ステップS24)。画像処理部12は、例えばディスプレイ13の画面にフィルタ21の向き21Dを示す角度(90°−θb)を表示する。 Further, the image processing unit 12 may notify the user of the orientation 21D of the filter 21 (step S24). The image processing unit 12 displays, for example, an angle (90 ° −θb) indicating the direction 21D of the filter 21 on the screen of the display 13.

また図18のフローチャートは、画像処理部12によって実行される、フィルタの向きに関する補正機能を有する測距処理の手順の例を示す。測距処理では、撮像装置11により取得された第2画像77を用いて、撮像された時点の撮像装置11の位置から第2画像77に写っている第2被写体までの距離が算出される。ここでは、この測距処理が実行される前に図17に示したキャリブレーション処理の実行が完了し、且つ第1画像71と第2画像77とで撮像時のフィルタ21の向き21Dが変更されていないことを想定する。 Further, the flowchart of FIG. 18 shows an example of a procedure of distance measurement processing having a correction function regarding the direction of the filter, which is executed by the image processing unit 12. In the distance measuring process, the distance from the position of the image pickup device 11 at the time of image pickup to the second subject reflected in the second image 77 is calculated using the second image 77 acquired by the image pickup device 11. Here, the execution of the calibration process shown in FIG. 17 is completed before the distance measurement process is executed, and the orientation 21D of the filter 21 at the time of imaging is changed between the first image 71 and the second image 77. I assume that it is not.

まず画像処理部12は、撮像装置11を用いて第2画像77が取得されたか否かを判定する(ステップS31)。第2画像77が取得されていない場合(ステップS31のNO)、ステップS31に戻り、撮像装置11を用いて第2画像77が取得されたか否かが再度判定される。 First, the image processing unit 12 determines whether or not the second image 77 has been acquired by using the image pickup device 11 (step S31). If the second image 77 has not been acquired (NO in step S31), the process returns to step S31, and it is determined again whether or not the second image 77 has been acquired using the image pickup apparatus 11.

第2画像77が取得された場合(ステップS31のYES)、画像処理部12は、撮像時のフィルタ21の向き21Dを示す角度(90°−θb)に基づいて第2画像77を回転した補正画像78を生成する(ステップS32)。これにより、第2画像77上のぼけの偏りの方向71Dが水平方向に補正される。 When the second image 77 is acquired (YES in step S31), the image processing unit 12 corrects the rotation of the second image 77 based on the angle (90 ° −θb) indicating the orientation 21D of the filter 21 at the time of imaging. Image 78 is generated (step S32). As a result, the direction 71D of the blur bias on the second image 77 is corrected in the horizontal direction.

画像処理部12は取得された補正画像78内の注目画素を設定する(ステップS33)。注目画素は、例えば補正画像78の左上端の画素から右下端の画素までラスタ走査の順に設定され得る。また、補正画像78上のエッジに対応する画素が注目画素として設定されてもよい。 The image processing unit 12 sets the pixel of interest in the acquired corrected image 78 (step S33). The pixel of interest may be set, for example, from the pixel at the upper left end of the corrected image 78 to the pixel at the lower right end in the order of raster scanning. Further, the pixel corresponding to the edge on the corrected image 78 may be set as the pixel of interest.

次いで画像処理部12は、あるぼけ補正量に対応するぼけ補正フィルタを取得する(ステップS34)。画像処理部12は、例えば予め用意された複数のぼけ補正量にそれぞれ対応する複数のぼけ補正フィルタから、1つのぼけ補正フィルタを取得する。画像処理部12は、取得されたぼけ補正フィルタを、補正画像78のR成分の画像(以下R画像と称する)またはB成分の画像(以下B画像と称する)内の注目画素を含む第1領域に適用することにより、補正された第1領域を生成する(ステップS35)。第1領域は、例えば注目画素を中心とする特定のサイズの領域である。 Next, the image processing unit 12 acquires a blur correction filter corresponding to a certain blur correction amount (step S34). The image processing unit 12 acquires one blur correction filter from, for example, a plurality of blur correction filters corresponding to a plurality of blur correction amounts prepared in advance. The image processing unit 12 uses the acquired blur correction filter as a first region including the pixel of interest in the R component image (hereinafter referred to as R image) or the B component image (hereinafter referred to as B image) of the corrected image 78. By applying to, a corrected first region is generated (step S35). The first region is, for example, a region of a specific size centered on a pixel of interest.

そして画像処理部12は、補正された第1領域と、補正画像78のG成分の画像(以下G画像と称する)内の注目画素を含む第2領域とが一致したか否かを判定する(ステップS36)。第2領域は、例えば注目画素を中心とする第1領域と同一のサイズを有する領域である。なお、画像処理部12は、補正された第1領域と第2領域とが一致したか否かを判定する代わりに、補正された第1領域と第2領域との相関値が第1閾値を超えているか否かを、あるいは補正された第1領域と第2領域との相違度が第2閾値未満であるか否かを判定してもよい。補正された第1領域と第2領域とが一致していない場合(ステップS36のNO)、ステップS34に戻り、別のぼけ補正フィルタを用いた処理が行われる。 Then, the image processing unit 12 determines whether or not the corrected first region and the second region including the pixel of interest in the image of the G component of the corrected image 78 (hereinafter referred to as a G image) match (the image processing unit 12). Step S36). The second region is, for example, a region having the same size as the first region centered on the pixel of interest. In addition, instead of determining whether or not the corrected first region and the second region match, the image processing unit 12 sets the first threshold value as the correlation value between the corrected first region and the second region. It may be determined whether or not it exceeds, or whether or not the corrected degree of difference between the first region and the second region is less than the second threshold value. If the corrected first region and the second region do not match (NO in step S36), the process returns to step S34 and processing using another blur correction filter is performed.

補正された第1領域と第2領域とが一致した場合(ステップS36のYES)、画像処理部12は、適用されたぼけ補正フィルタに対応するぼけ補正量に基づいて、被写体までの距離を算出する(ステップS37)。この算出には、上述したように、ぼけ補正量と被写体までの距離との対応を示すLUTやモデルが用いられてもよい。 When the corrected first region and the second region match (YES in step S36), the image processing unit 12 calculates the distance to the subject based on the blur correction amount corresponding to the applied blur correction filter. (Step S37). As described above, a LUT or a model indicating the correspondence between the blur correction amount and the distance to the subject may be used for this calculation.

次いで画像処理部12は、補正画像78内に、被写体までの距離を算出すべき別の画素があるか否かを判定する(ステップS38)。被写体までの距離を算出すべき別の画素がある場合(ステップS38のYES)、ステップS33に戻り、その別の画素に写っている被写体までの距離を算出するための処理が行われる。 Next, the image processing unit 12 determines whether or not there is another pixel in the corrected image 78 for which the distance to the subject should be calculated (step S38). If there is another pixel for which the distance to the subject should be calculated (YES in step S38), the process returns to step S33, and a process for calculating the distance to the subject reflected in the other pixel is performed.

被写体までの距離を算出すべき別の画素がない場合(ステップS38のNO)、処理を終了する。 If there is no other pixel for which the distance to the subject should be calculated (NO in step S38), the process ends.

以上により、画像処理部12は、キャリブレーション処理で取得されたフィルタ21の向き21Dと撮像装置11によって取得された第2画像77とを用いて、第2画像77内の各画素に写っている被写体までの距離を算出することができる。 As described above, the image processing unit 12 is reflected in each pixel in the second image 77 by using the orientation 21D of the filter 21 acquired in the calibration process and the second image 77 acquired by the image pickup apparatus 11. The distance to the subject can be calculated.

なお図19に示すように、補正画像78を生成することなく、第2画像77内の各画素に写っている被写体までの距離を算出することもできる。図19に示す例では、補正部123は、第1画像71を用いて算出されたフィルタ21の向き21Dに応じて変更されたぼけ補正フィルタ56,57を算出する。画像処理部12は、例えば予め用意された複数のぼけ補正量にそれぞれ対応する複数のぼけ補正フィルタ53,54をフィルタ21の向き21Dに応じて変更することにより、ぼけ補正フィルタ56,57を算出する。 As shown in FIG. 19, it is also possible to calculate the distance to the subject reflected in each pixel in the second image 77 without generating the corrected image 78. In the example shown in FIG. 19, the correction unit 123 calculates the blur correction filters 56 and 57 changed according to the orientation 21D of the filter 21 calculated using the first image 71. The image processing unit 12 calculates the blur correction filters 56 and 57 by, for example, changing the plurality of blur correction filters 53 and 54 corresponding to the plurality of blur correction amounts prepared in advance according to the direction 21D of the filter 21. do.

距離算出部124は、この変更されたぼけ補正フィルタ56,57と第2画像77とを用いて第2被写体までの距離を算出する。距離を算出する具体的な方法は、図5および図6を参照して上述した方法と同様である。 The distance calculation unit 124 calculates the distance to the second subject by using the modified blur correction filters 56 and 57 and the second image 77. The specific method for calculating the distance is the same as the method described above with reference to FIGS. 5 and 6.

また図20に示すように、キャリブレーション処理部122は、キャリブレーションチャート6を撮像した第1画像71を用いて撮像装置11の画角(有効画角とも称する)を算出することもできる。図20では説明を分かりやすくするために、ぼけが発生していない第1画像71Aを例示している。またここでは、キャリブレーションチャート6上の隣り合う要素間の距離が2cmであり、且つキャリブレーションチャート6が撮像装置11の位置から30cm離れた位置に設置されていることを想定する。 Further, as shown in FIG. 20, the calibration processing unit 122 can also calculate the angle of view (also referred to as an effective angle of view) of the image pickup apparatus 11 by using the first image 71 in which the calibration chart 6 is imaged. In FIG. 20, for the sake of clarity, the first image 71A in which blurring does not occur is illustrated. Further, here, it is assumed that the distance between adjacent elements on the calibration chart 6 is 2 cm, and the calibration chart 6 is installed at a position 30 cm away from the position of the image pickup apparatus 11.

第1画像71Aには、実空間の高さ10cm(=2×5)、幅14cm(=2×7)の領域が撮像されている。この場合、水平方向の画角および垂直方向の画角は以下のように算出される。
水平画角θh=2×atan(14/30/2)=26.3°
垂直画角θv=2×atan(10/30/2)=18.9°
In the first image 71A, a region having a height of 10 cm (= 2 × 5) and a width of 14 cm (= 2 × 7) in the real space is imaged. In this case, the horizontal angle of view and the vertical angle of view are calculated as follows.
Horizontal angle of view θh = 2 × atan (14/30/2) = 26.3 °
Vertical angle of view θv = 2 × atan (10/30/2) = 18.9 °

このように、キャリブレーションチャート6を撮像した第1画像71を用いて撮像装置11の画角を算出することができる。例えばレンズユニット3にフィルタユニット2を取り付ける前後それぞれでキャリブレーションチャート6を撮像した画像を取得し、画角を算出することにより、フィルタユニット2を取り付けることによる画角の変化を計測することができる。 In this way, the angle of view of the image pickup apparatus 11 can be calculated using the first image 71 obtained by capturing the calibration chart 6. For example, by acquiring images of the calibration chart 6 before and after attaching the filter unit 2 to the lens unit 3 and calculating the angle of view, it is possible to measure the change in the angle of view due to the attachment of the filter unit 2. ..

撮像されるキャリブレーションチャート6は、撮像装置11と正対していることが望ましい。撮像装置11に正対したキャリブレーションチャート6を撮像するためには、例えば水準器等を用いて水平に設置された撮像装置11で、鉛直方向に立てられたキャリブレーションチャート6を正面から撮像する必要がある。 It is desirable that the calibration chart 6 to be imaged faces the image pickup apparatus 11. In order to image the calibration chart 6 facing the image pickup device 11, for example, the image pickup device 11 installed horizontally using a spirit level or the like captures the calibration chart 6 standing in the vertical direction from the front. There is a need.

撮像装置11に正対していないキャリブレーションチャート6が撮像されたならば、傾いたキャリブレーションチャート6が撮像された画像が取得される。このような場合、キャリブレーション処理部122は、キャリブレーションチャート6の傾きが補正された画像を生成し、その補正画像を用いてフィルタ21の向き21D、画角等の算出を行う。 If the calibration chart 6 not facing the image pickup device 11 is imaged, the image captured by the tilted calibration chart 6 is acquired. In such a case, the calibration processing unit 122 generates an image in which the inclination of the calibration chart 6 is corrected, and calculates the orientation 21D, the angle of view, and the like of the filter 21 using the corrected image.

図21に示す例では、撮像装置11によって、傾いたキャリブレーションチャート6が撮像された画像743が取得されている。キャリブレーション処理部122は、画像743上の要素を検出し、画像743上で水平方向に並んでいるべき要素群をつなぐ線分743Xと、画像743上で垂直方向に並んでいるべき要素群をつなぐ線分743Yとを検出する。なおこの例では、線分741Yは垂直方向に延び、傾いていない。 In the example shown in FIG. 21, the image 743 in which the tilted calibration chart 6 is captured is acquired by the image pickup device 11. The calibration processing unit 122 detects the elements on the image 743, and sets the line segment 743X connecting the elements that should be arranged horizontally on the image 743 and the element groups that should be arranged vertically on the image 743. Detects the connecting line segment 743Y. In this example, the line segment 741Y extends in the vertical direction and is not tilted.

キャリブレーション処理部122は、算出された線分741Xの傾きおよび線分741Yの傾きに基づき、例えばカメラキャリブレーションに用いられるZhangの手法(Zhengyou Zhang、“A Flexible New Technique for Camera Calibration”、[online]、1998年12月2日、Technical Report MSR-TR-98-71、[平成30年9月12日検索]、インターネット<URL:https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/tr98-71.pdf>)を用いて、傾きが補正された画像744を生成する。キャリブレーション処理部122は、例えば線分741Xの傾きが水平方向に、線分741Yの傾きが垂直方向になるように画像743を回転させ、傾きが補正された画像744を生成する。これによりキャリブレーション処理部122は、撮像装置11と正対して撮像されたキャリブレーションチャート6の画像を用いる場合と同様にして、補正画像744を用いてフィルタ21の向き21D、画角等を算出できる。 The calibration processing unit 122 is based on the calculated inclination of the line segment 741X and the inclination of the line segment 741Y, for example, Zhengyou Zhang, “A Flexible New Technique for Camera Calibration”, [online. ], December 2, 1998, Technical Report MSR-TR-98-71, [Search on September 12, 2018], Internet <URL: https://www.microsoft.com/en-us/research/ wp-content / uploads / 2016/02 / tr98-71.pdf>) is used to generate the tilt-corrected image 744. The calibration processing unit 122 rotates the image 743 so that the inclination of the line segment 741X is in the horizontal direction and the inclination of the line segment 741Y is in the vertical direction, for example, to generate an image 744 with the inclination corrected. As a result, the calibration processing unit 122 calculates the orientation 21D, the angle of view, etc. of the filter 21 using the corrected image 744 in the same manner as when the image of the calibration chart 6 captured facing the image pickup device 11 is used. can.

さらに、フィルタ21(フィルタユニット2)はレンズユニット3に対して、フィルタ21の中心213が撮像装置11の光軸15と一致しない位置(すなわち光軸15がフィルタ21の中心を通らない位置)に取り付けられることがある。このようにレンズユニット3に対するフィルタ21の位置ずれがある場合、レンズ31に光を透過するフィルタ21内の第1フィルタ領域211の面積と第2フィルタ領域212の面積とが不均一になる。 Further, the filter 21 (filter unit 2) is located at a position where the center 213 of the filter 21 does not coincide with the optical axis 15 of the image pickup apparatus 11 (that is, the position where the optical axis 15 does not pass through the center of the filter 21) with respect to the lens unit 3. May be attached. When the position of the filter 21 is displaced with respect to the lens unit 3 in this way, the area of the first filter region 211 and the area of the second filter region 212 in the filter 21 that transmits light to the lens 31 become non-uniform.

図22は、フィルタ21の中心213が光軸15と一致していない場合に、撮像装置11によって取得されたキャリブレーションチャート6の画像上の要素751の例を示す。ここでは、フィルタ21の中心213が光軸15と一致せず、例えばイエローの第1フィルタ領域211の面積が、シアンの第2フィルタ領域212の面積よりも広くなっていることを想定する。 FIG. 22 shows an example of the element 751 on the image of the calibration chart 6 acquired by the image pickup apparatus 11 when the center 213 of the filter 21 does not coincide with the optical axis 15. Here, it is assumed that the center 213 of the filter 21 does not coincide with the optical axis 15, and for example, the area of the yellow first filter region 211 is larger than the area of the cyan second filter region 212.

キャリブレーション処理部122は、取得された画像上の要素751において、例えばR成分のぼけ751Rの大きさSrとB成分のぼけ751Bの大きさSbとを比較することにより、フィルタ21の中心213が光軸15と一致していないことを検出する。検出のために用いられる要素751は、例えば画像上の中央付近に位置していることが望ましい。 In the element 751 on the acquired image, the calibration processing unit 122 compares, for example, the magnitude Sr of the blur 751R of the R component with the magnitude Sb of the blur 751B of the B component, so that the center 213 of the filter 21 is set. It is detected that it does not match the optical axis 15. The element 751 used for detection is preferably located near the center of the image, for example.

イエローの第1フィルタ領域211の面積がシアンの第2フィルタ領域212の面積よりも広い場合、取得された画像上の要素751において、広い第1フィルタ領域211を透過する赤の波長帯域の光により得られるR成分のぼけ751Rの大きさSrは、狭い第2フィルタ領域212を透過する青の波長帯域の光により得られるB成分のぼけ751Bの大きさSbよりも大きい。したがってキャリブレーション処理部122は、R成分およびB成分のそれぞれのぼけの大きさに基づいて、フィルタ領域211,212の面積が均一でなく、またいずれのフィルタ領域211,212の面積がより広く(あるいは狭く)なっているかを検出できる。 When the area of the yellow first filter region 211 is larger than the area of the cyan second filter region 212, the light in the red wavelength band transmitted through the wide first filter region 211 in the element 751 on the acquired image. The magnitude Sr of the obtained R component blur 751R is larger than the magnitude Sb of the B component blur 751B obtained by the light in the blue wavelength band transmitted through the narrow second filter region 212. Therefore, in the calibration processing unit 122, the area of the filter regions 211 and 212 is not uniform based on the size of the blur of each of the R component and the B component, and the area of each of the filter regions 211 and 122 is wider ( Or it can be detected whether it is narrowed).

通知部125は、キャリブレーション処理部122による処理結果を用いて、フィルタ21の位置がずれていること、フィルタ21の中心213が光軸15と一致していないこと、フィルタ領域211,212の面積が均一でないこと、いずれのフィルタ領域の面積がより広くなっているか等を、ユーザに通知する。ユーザはこの通知に応じて、レンズユニット3に対してフィルタ21を正しく取り付けることができる。 The notification unit 125 uses the processing result of the calibration processing unit 122 to indicate that the position of the filter 21 is deviated, that the center 213 of the filter 21 does not match the optical axis 15, and that the area of the filter areas 211 and 212 is large. Notify the user that is not uniform, which filter area has a larger area, and the like. The user can correctly attach the filter 21 to the lens unit 3 in response to this notification.

またフィルタ21の中心213が光軸15と一致していない場合には、図23に示すように、撮像装置11によって取得される画像76にフィルタ枠22等のフィルタユニット2の一部による影が写り込むこともある。取得された画像76には、キャリブレーションチャート6の要素61が撮像された領域761と、フィルタ枠22等による影が写り込んだことによって欠けた領域762とが含まれている。 When the center 213 of the filter 21 does not coincide with the optical axis 15, as shown in FIG. 23, a shadow due to a part of the filter unit 2 such as the filter frame 22 is cast on the image 76 acquired by the image pickup apparatus 11. It may be reflected. The acquired image 76 includes a region 761 in which the element 61 of the calibration chart 6 is captured, and a region 762 that is missing due to the shadow cast by the filter frame 22 or the like.

キャリブレーション処理部122は、フィルタ21を取り付ける前の第1画角とフィルタ21を取り付けた後の第2画角とを比較し、第1画角と第2画角との差が閾値を超えている場合に、フィルタ枠22等による影が画像76に写り込んでいると判断する。通知部125は、フィルタ枠22等による影が画像76に写り込んでいることをユーザに通知する。ユーザはこの通知に応じて、レンズユニット3に対してフィルタ21を正しく取り付けることができる。 The calibration processing unit 122 compares the first angle of view before attaching the filter 21 with the second angle of view after attaching the filter 21, and the difference between the first angle of view and the second angle of view exceeds the threshold value. If so, it is determined that the shadow due to the filter frame 22 or the like is reflected in the image 76. The notification unit 125 notifies the user that the shadow due to the filter frame 22 or the like is reflected in the image 76. The user can correctly attach the filter 21 to the lens unit 3 in response to this notification.

なお、フィルタユニット2はクリップ形状を有していてもよい。図24は撮像装置11の構造の別の例を示す。ここでは撮像装置11が、レンズユニット3およびイメージセンサ41を備えるスマートフォン1Aと、クリップ形状を有するフィルタユニット2Aとして実現される場合を例示する。スマートフォン1Aは一例であって、レンズユニット3(レンズ31)上に重ね合わせるように、クリップ形状のフィルタユニット2Aを取り付けられる電子機器であればよい。この電子機器には、例えばレンズユニット3が取り付けられたカメラ本体4や、レンズユニット3を備える電子機器(例えばタブレットPC)が含まれ得る。 The filter unit 2 may have a clip shape. FIG. 24 shows another example of the structure of the image pickup apparatus 11. Here, a case where the image pickup apparatus 11 is realized as a smartphone 1A including a lens unit 3 and an image sensor 41 and a filter unit 2A having a clip shape is illustrated. The smartphone 1A is an example, and may be any electronic device to which a clip-shaped filter unit 2A can be attached so as to be superimposed on the lens unit 3 (lens 31). The electronic device may include, for example, a camera body 4 to which the lens unit 3 is attached, or an electronic device (for example, a tablet PC) including the lens unit 3.

スマートフォン1Aは画像処理部12およびディスプレイ13を備えていてもよい。この場合、フィルタユニット2が取り付けられたスマートフォン1Aは、撮像装置11として用いられるだけでなく、測距装置1として用いることもできる。 The smartphone 1A may include an image processing unit 12 and a display 13. In this case, the smartphone 1A to which the filter unit 2 is attached can be used not only as the image pickup device 11 but also as the distance measuring device 1.

図24(A)に示すように、クリップ形状のフィルタユニット2Aは、スマートフォン1Aの筐体を挟み込むための2つのクリップ部201,202を備える。クリップ部201,202は、スマートフォン1Aの筐体に対してフィルタユニット2Aを固定する固定部である。クリップ部201の第1端部201E−1はフィルタ21を保持する薄い円筒形状を有する。クリップ部202の第1端部202E−1も同様の薄い円筒形状を有するが、フィルタ21は保持されていない。 As shown in FIG. 24A, the clip-shaped filter unit 2A includes two clip portions 201 and 202 for sandwiching the housing of the smartphone 1A. The clip portions 201 and 202 are fixing portions for fixing the filter unit 2A to the housing of the smartphone 1A. The first end portion 201E-1 of the clip portion 201 has a thin cylindrical shape for holding the filter 21. The first end portion 202E-1 of the clip portion 202 also has a similar thin cylindrical shape, but the filter 21 is not held.

クリップ部201の第2端部201E−2とクリップ部202の第2端部202E−2とを外側から挟み込むように力を加えることで、クリップ部201の第1端部201E−1とクリップ部202の第1端部202E−1は開放される。クリップ部201の第2端部201E−2とクリップ部202の第2端部202E−2とに力が加えられなければ、クリップ部201の第1端部201E−1とクリップ部202の第1端部202E−1は閉じる。 By applying a force so as to sandwich the second end portion 201E-2 of the clip portion 201 and the second end portion 202E-2 of the clip portion 202 from the outside, the first end portion 201E-1 of the clip portion 201 and the clip portion are applied. The first end 202E-1 of 202 is opened. If no force is applied to the second end portion 201E-2 of the clip portion 201 and the second end portion 202E-2 of the clip portion 202, the first end portion 201E-1 of the clip portion 201 and the first clip portion 202 The end 202E-1 is closed.

図24(B)に示すように、ユーザはクリップ部201の第2端部201E−2とクリップ部202の第2端部202E−2とを外側から挟み込むように力を加えて第1端部201E−1,202E−1を開放し、フィルタ21がレンズユニット3を覆うように第1端部201E−1と第1端部202E−1との間にスマートフォン1Aを挟み込む。 As shown in FIG. 24B, the user applies a force so as to sandwich the second end portion 201E-2 of the clip portion 201 and the second end portion 202E-2 of the clip portion 202 from the outside, and the first end portion. The 201E-1 and 202E-1 are opened, and the smartphone 1A is sandwiched between the first end portion 201E-1 and the first end portion 202E-1 so that the filter 21 covers the lens unit 3.

ユーザはさらに、スマートフォン1Aを挟み込んでいる第1端部201E−1および第1端部202E−1の位置および向きを調節することもできる。この調節のために、第1端部201E−1および第1端部202E−1に移動や回転のための微動ステージが組み込まれていてもよい。微動ステージは、例えば第1端部201E−1および第1端部202E−1を水平方向および垂直方向にそれぞれシフトする微調整ネジを備える。 The user can also adjust the position and orientation of the first end portion 201E-1 and the first end portion 202E-1 that sandwich the smartphone 1A. For this adjustment, the first end 201E-1 and the first end 202E-1 may incorporate fine movement stages for movement and rotation. The fine movement stage includes, for example, a fine adjustment screw that shifts the first end portion 201E-1 and the first end portion 202E-1 in the horizontal direction and the vertical direction, respectively.

ユーザはレンズユニット3(より詳しくはレンズユニット3に内蔵されるレンズ31)とフィルタ21とが光学的に正しく結合されるように調節する。より具体的には、ユーザはフィルタ21の中心が光軸15上(すなわちレンズユニット3の中心上)に位置するように第1端部201E−1,202E−1を移動する。 The user adjusts the lens unit 3 (more specifically, the lens 31 built in the lens unit 3) and the filter 21 so as to be optically correctly coupled. More specifically, the user moves the first end portions 201E-1 and 202E-1 so that the center of the filter 21 is located on the optical axis 15 (that is, on the center of the lens unit 3).

ユーザはさらに、フィルタ21内の境界線214の方向がスマートフォン1Aの垂直方向45、水平方向46等のある特定の方向に設定されるように、第1端部201E−1,202E−1を回転することもできる。その際、スマートフォン1Aのディスプレイ13の画面には、フィルタ21内の境界線214の方向を特定の方向に設定するためのガイドが表示されてもよい。 The user further rotates the first ends 201E-1, 202E-1 so that the direction of the boundary line 214 in the filter 21 is set to a specific direction such as the vertical direction 45, the horizontal direction 46, etc. of the smartphone 1A. You can also do it. At that time, the screen of the display 13 of the smartphone 1A may display a guide for setting the direction of the boundary line 214 in the filter 21 to a specific direction.

図25はディスプレイ13に表示されるガイド画面90の例を示す。このガイド画面90には、例えばフィルタ21内の境界線214の現在の方向を示す線91と、境界線214の現在の方向を特定の方向(ここでは垂直方向45)に設定するためにフィルタユニット2を回転すべき向き92(ここでは時計回り)とが示されている。ガイド画面90を用いることにより、ユーザはフィルタ21の向きを容易に調節できる。 FIG. 25 shows an example of the guide screen 90 displayed on the display 13. On the guide screen 90, for example, a line 91 indicating the current direction of the boundary line 214 in the filter 21 and a filter unit for setting the current direction of the boundary line 214 to a specific direction (here, the vertical direction 45). The direction in which 2 should be rotated 92 (clockwise in this case) is indicated. By using the guide screen 90, the user can easily adjust the orientation of the filter 21.

ガイド画面90には、フィルタ21の向きだけでなく、キャリブレーションによって得られた画角等の処理結果や被写体までの距離のような測距処理の結果が表示されてもよい。さらに、ガイド画面90には、取り付けられるべき位置(すなわちフィルタ21の中心が光軸15に一致する位置)からずれた位置にフィルタ21が取り付けられていること、フィルタ枠22等の影が画像に写り込んでいること等が示されてもよい。 The guide screen 90 may display not only the orientation of the filter 21, but also the processing result such as the angle of view obtained by calibration and the result of distance measurement processing such as the distance to the subject. Further, on the guide screen 90, the filter 21 is attached at a position deviated from the position to be attached (that is, the position where the center of the filter 21 coincides with the optical axis 15), and the shadow of the filter frame 22 or the like is reflected in the image. It may be shown that it is reflected.

なお、フィルタユニット2Aの形状および構造は、レンズユニット3を備えるスマートフォン1Aの筐体等に取り付けることができればどのような形状および構造であってもよい。 The shape and structure of the filter unit 2A may be any shape and structure as long as it can be attached to the housing or the like of the smartphone 1A provided with the lens unit 3.

例えば図26に示すように、フィルタユニット2Aは、レンズユニット3を備えるスマートフォン1Aの筐体全体を嵌め込んで取り付けるケース(あるいはカバー)の形状を有していてもよい。ケース形状のフィルタユニット2Aでは、スマートフォン1Aに取り付けられた場合にレンズユニット3上に重なる位置に、フィルタ21を保持するフィルタ枠22が設けられる。フィルタ枠22は回転可能であり、ユーザはフィルタ21の向きを任意の方向に調節できる。 For example, as shown in FIG. 26, the filter unit 2A may have the shape of a case (or cover) in which the entire housing of the smartphone 1A including the lens unit 3 is fitted and attached. In the case-shaped filter unit 2A, a filter frame 22 for holding the filter 21 is provided at a position overlapping the lens unit 3 when attached to the smartphone 1A. The filter frame 22 is rotatable and the user can adjust the orientation of the filter 21 in any direction.

以上により、レンズユニット3がフィルタユニット2を取り付けるための構造を有していない場合にも、レンズユニット3を備える筐体に対してレンズユニット3上に重なるようにフィルタユニット2を取り付けられるので、ハードウェア構成によってフィルタ21の向きを精度良く調節できる。フィルタ21の向きが調節されることにより、撮像装置11(例えばスマートフォン1A)を用いて理想的なぼけ(すなわち意図したぼけ)が発生した画像を取得できる。 As described above, even when the lens unit 3 does not have a structure for mounting the filter unit 2, the filter unit 2 can be mounted so as to overlap the lens unit 3 with respect to the housing provided with the lens unit 3. The orientation of the filter 21 can be adjusted accurately depending on the hardware configuration. By adjusting the orientation of the filter 21, the image pickup device 11 (for example, the smartphone 1A) can be used to acquire an image in which an ideal blur (that is, an intended blur) has occurred.

以上説明したように、本実施形態によれば被写体までの距離を精度良く算出できる。フィルタ21は、第1波長帯域の光を透過する第1フィルタ領域211と、第2波長帯域の光を透過する第2フィルタ領域212とを備える。第1波長帯域と第2波長帯域は共通の波長帯域を含む。取得部121は、フィルタ21を通過した光を受光するイメージセンサ41を有する撮像装置11を用いて撮像された、キャリブレーションのための第1被写体が撮像された第1画像71と、第2被写体が撮像された第2画像77とを取得する。画像処理部12は、第1画像71と第2画像77とを用いて第2被写体までの距離を算出する。 As described above, according to the present embodiment, the distance to the subject can be calculated with high accuracy. The filter 21 includes a first filter region 211 that transmits light in the first wavelength band and a second filter region 212 that transmits light in the second wavelength band. The first wavelength band and the second wavelength band include a common wavelength band. The acquisition unit 121 includes a first image 71 in which the first subject for calibration is captured, and a second subject, which is captured by using an image sensor 11 having an image sensor 41 that receives light that has passed through the filter 21. Acquires the second image 77 and the image taken by the user. The image processing unit 12 calculates the distance to the second subject using the first image 71 and the second image 77.

これによりフィルタ21がレンズユニット3の外部に設けられる場合にも、レンズユニット3に取り付けられたフィルタ21の向きを考慮して、被写体までの距離を精度良く算出できる。 As a result, even when the filter 21 is provided outside the lens unit 3, the distance to the subject can be calculated accurately in consideration of the orientation of the filter 21 attached to the lens unit 3.

なお、上述したキャリブレーションのための構成は、フィルタ21がレンズユニット3内の開口部3Aに設けられる場合にも適用できる。したがって、例えば開口部3Aに配置されたフィルタ21の向きが振動等で意図しない向きにずれた場合にも、撮像装置11を用いて取得された画像からその画像上の被写体までの距離を精度良く算出できる。 The above-mentioned configuration for calibration can also be applied when the filter 21 is provided in the opening 3A in the lens unit 3. Therefore, for example, even when the direction of the filter 21 arranged in the opening 3A is deviated to an unintended direction due to vibration or the like, the distance from the image acquired by the image pickup apparatus 11 to the subject on the image can be accurately determined. Can be calculated.

また、本実施形態に記載された様々な機能の各々は、回路(処理回路)によって実現されてもよい。処理回路の例には、中央処理装置(CPU)のような、プログラムされたプロセッサが含まれる。このプロセッサは、メモリに格納されたコンピュータプログラム(命令群)を実行することによって、記載された機能それぞれを実行する。このプロセッサは、電気回路を含むマイクロプロセッサであってもよい。処理回路の例には、デジタル信号プロセッサ(DSP)、特定用途向け集積回路(ASIC)、マイクロコントローラ、コントローラ、他の電気回路部品も含まれる。本実施形態に記載されたCPU以外の他のコンポーネントの各々もまた処理回路によって実現されてもよい。 Further, each of the various functions described in the present embodiment may be realized by a circuit (processing circuit). Examples of processing circuits include programmed processors such as central processing units (CPUs). This processor executes each of the described functions by executing a computer program (instruction group) stored in the memory. This processor may be a microprocessor including an electric circuit. Examples of processing circuits also include digital signal processors (DSPs), application specific integrated circuits (ASICs), microcontrollers, controllers, and other electrical circuit components. Each of the components other than the CPU described in this embodiment may also be realized by the processing circuit.

また、本実施形態の各種処理はコンピュータプログラムによって実現することができるので、このコンピュータプログラムを格納したコンピュータ読み取り可能な記憶媒体を通じてこのコンピュータプログラムをコンピュータにインストールして実行するだけで、本実施形態と同様の効果を容易に実現することができる。 Further, since various processes of the present embodiment can be realized by a computer program, the present embodiment and the present embodiment can be obtained by simply installing and executing the computer program on a computer through a computer-readable storage medium in which the computer program is stored. A similar effect can be easily achieved.

本発明のいくつかの実施形態を説明したが、これらの実施形態は、例として提示したものであり、発明の範囲を限定することは意図していない。これら新規な実施形態は、その他の様々な形態で実施されることが可能であり、発明の要旨を逸脱しない範囲で、種々の省略、置き換え、変更を行うことができる。これら実施形態やその変形は、発明の範囲や要旨に含まれると共に、特許請求の範囲に記載された発明とその均等の範囲に含まれる。 Although some embodiments of the present invention have been described, these embodiments are presented as examples and are not intended to limit the scope of the invention. These novel embodiments can be implemented in various other embodiments, and various omissions, replacements, and changes can be made without departing from the gist of the invention. These embodiments and modifications thereof are included in the scope and gist of the invention, and are also included in the scope of the invention described in the claims and the equivalent scope thereof.

1…測距装置、11…撮像部(撮像装置)、12…画像処理部(画像処理装置)、13…ディスプレイ、15…光軸、121…取得部、122…キャリブレーション処理部、123…補正部、124…距離算出部、125…通知部、2…フィルタユニット、21…フィルタ、211…第1フィルタ領域、212…第2フィルタ領域、213…光学中心、214…境界線、22…フィルタ枠、23…取り付け部、3…レンズユニット、31…レンズ、3A…開口部、4…カメラ本体、41…イメージセンサ、411…第1センサ、412…第2センサ、413…第3センサ、42…レンズマウント。 1 ... Distance measuring device, 11 ... Imaging unit (imaging device), 12 ... Image processing unit (image processing device), 13 ... Display, 15 ... Optical axis, 121 ... Acquisition unit, 122 ... Calibration processing unit, 123 ... Correction Unit, 124 ... Distance calculation unit, 125 ... Notification unit, 2 ... Filter unit, 21 ... Filter, 211 ... First filter area, 212 ... Second filter area, 213 ... Optical center, 214 ... Boundary line, 22 ... Filter frame , 23 ... mounting part, 3 ... lens unit, 31 ... lens, 3A ... opening, 4 ... camera body, 41 ... image sensor, 411 ... first sensor, 412 ... second sensor, 413 ... third sensor, 42 ... Lens mount.

Claims (16)

第1波長帯域の光を透過する第1フィルタ領域と、第2波長帯域の光を透過する第2フィルタ領域とを備え、前記第1波長帯域と前記第2波長帯域は共通の波長帯域を含むフィルタ部を通過した光を受光するイメージセンサを有する撮像装置を用いて撮像された、キャリブレーションのための第1被写体が撮像された第1画像と、前記第1被写体とは異なる第2被写体が撮像された第2画像とを取得する取得部と、
前記第1画像と前記第2画像とを用いて前記第2被写体までの距離を算出する処理部とを具備する画像処理装置。
A first filter region that transmits light in the first wavelength band and a second filter region that transmits light in the second wavelength band are provided, and the first wavelength band and the second wavelength band include a common wavelength band. The first image in which the first subject for calibration is captured and the second subject different from the first subject is captured by using an image sensor having an image sensor that receives light that has passed through the filter unit. An acquisition unit that acquires the captured second image,
An image processing apparatus including a processing unit that calculates a distance to the second subject using the first image and the second image.
前記処理部は、前記第1画像を用いて前記フィルタ部の向きを算出し、前記フィルタ部の向きと前記第2画像とを用いて前記第2被写体までの距離を算出する請求項1記載の画像処理装置。 The first aspect of claim 1, wherein the processing unit calculates the orientation of the filter unit using the first image, and calculates the distance to the second subject using the orientation of the filter unit and the second image. Image processing device. 前記処理部は、
前記フィルタ部の向きに基づいて前記第2画像を回転した補正画像を生成し、
前記補正画像を用いて前記第2被写体までの距離を算出する請求項2記載の画像処理装置。
The processing unit
A corrected image obtained by rotating the second image based on the orientation of the filter unit is generated.
The image processing apparatus according to claim 2, wherein the distance to the second subject is calculated using the corrected image.
前記処理部は、前記撮像装置を用いて取得された画像上のぼけを補正するためのぼけ補正フィルタと前記補正画像とを用いて、前記第2被写体までの距離を算出する請求項3記載の画像処理装置。 The third aspect of the present invention, wherein the processing unit calculates the distance to the second subject by using the blur correction filter for correcting the blur on the image acquired by the image pickup apparatus and the corrected image. Image processing device. 前記処理部は、
前記フィルタ部の向きに基づいて、前記撮像装置を用いて取得された画像上のぼけを補正するためのぼけ補正フィルタを変更し、
変更された前記ぼけ補正フィルタと前記第2画像とを用いて、前記第2被写体までの距離を算出する請求項2記載の画像処理装置。
The processing unit
Based on the orientation of the filter unit, the blur correction filter for correcting the blur on the image acquired by using the image pickup device is changed.
The image processing apparatus according to claim 2, wherein the distance to the second subject is calculated by using the modified blur correction filter and the second image.
前記第1被写体は、1つ以上の円形または多角形の要素を含むキャリブレーションチャートである請求項1記載の画像処理装置。 The image processing apparatus according to claim 1, wherein the first subject is a calibration chart including one or more circular or polygonal elements. 前記第1被写体は、複数の円形または多角形の要素が等間隔で配置されたキャリブレーションチャートである請求項1記載の画像処理装置。 The image processing apparatus according to claim 1, wherein the first subject is a calibration chart in which a plurality of circular or polygonal elements are arranged at equal intervals. 請求項1乃至請求項7のいずれか一項に記載の画像処理装置と、
前記撮像装置とを具備する測距装置。
The image processing apparatus according to any one of claims 1 to 7.
A distance measuring device including the image pickup device.
前記撮像装置は、前記第1フィルタ領域を透過した光と前記第2フィルタ領域を透過した光とが通過する1つ以上のレンズを備えるレンズユニットをさらに具備し、
前記フィルタ部から前記レンズユニット内の開口部までの距離は、前記フィルタ部側の前記レンズユニットの端部から前記開口部までの距離よりも長い請求項8記載の測距装置。
The image pickup apparatus further comprises a lens unit including one or more lenses through which light transmitted through the first filter region and light transmitted through the second filter region pass.
The distance measuring device according to claim 8, wherein the distance from the filter unit to the opening in the lens unit is longer than the distance from the end of the lens unit on the filter unit side to the opening.
前記撮像装置は、
前記フィルタ部を保持するフィルタ枠と、
前記フィルタ枠に連結し、前記レンズユニットの第1端部に着脱可能に取り付けられる取り付け部とをさらに具備し、
前記取り付け部が前記レンズユニットの前記第1端部に取り付けられた場合、前記フィルタ部から前記レンズユニット内の開口部までの距離は、前記第1端部から前記開口部までの距離よりも長い請求項9記載の測距装置。
The image pickup device is
A filter frame that holds the filter unit and
Further provided with a mounting portion that is connected to the filter frame and detachably attached to the first end portion of the lens unit.
When the mounting portion is attached to the first end portion of the lens unit, the distance from the filter portion to the opening in the lens unit is longer than the distance from the first end to the opening. The distance measuring device according to claim 9.
前記フィルタ枠は、前記フィルタ部の向きを調節するために光軸を中心として回転自在である請求項10記載の測距装置。 The distance measuring device according to claim 10, wherein the filter frame is rotatable about an optical axis in order to adjust the direction of the filter unit. 前記撮像装置は、前記フィルタ枠を前記取り付け部に対して固定する固定部をさらに具備する請求項11記載の測距装置。 The distance measuring device according to claim 11, wherein the image pickup device further includes a fixing portion for fixing the filter frame to the mounting portion. 前記フィルタ枠は円筒形状を有し、
前記取り付け部は、前記フィルタ枠の少なくとも一部を囲む円筒形状を有する請求項10乃至請求項12のいずれか一項に記載の測距装置。
The filter frame has a cylindrical shape and has a cylindrical shape.
The distance measuring device according to any one of claims 10 to 12, wherein the mounting portion has a cylindrical shape that surrounds at least a part of the filter frame.
前記固定部は、ネジとロックリングの少なくとも一方を備える請求項12記載の測距装置。 12. The distance measuring device according to claim 12, wherein the fixing portion includes at least one of a screw and a lock ring. 前記固定部は、前記レンズユニットが取り付けられたカメラ本体、または前記レンズユニットを備える電子機器の筐体を挟み込むクリップ形状を有する請求項12記載の測距装置。 The distance measuring device according to claim 12, wherein the fixing portion has a clip shape that sandwiches a camera body to which the lens unit is attached or a housing of an electronic device including the lens unit. 前記撮像装置は、レンズフードが着脱可能に取り付けられる第2取り付け部を備えるレンズフード枠をさらに具備し、
前記レンズフード枠は、前記第2取り付け部に取り付けられたレンズフードの向きを調節するために光軸を中心として回転自在である請求項8記載の測距装置。
The image pickup apparatus further comprises a lens hood frame including a second attachment portion to which the lens hood is detachably attached.
The distance measuring device according to claim 8, wherein the lens hood frame is rotatable about an optical axis in order to adjust the direction of the lens hood attached to the second mounting portion.
JP2018171504A 2018-09-13 2018-09-13 Image processing device and ranging device Active JP6970066B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018171504A JP6970066B2 (en) 2018-09-13 2018-09-13 Image processing device and ranging device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018171504A JP6970066B2 (en) 2018-09-13 2018-09-13 Image processing device and ranging device

Publications (2)

Publication Number Publication Date
JP2020041973A JP2020041973A (en) 2020-03-19
JP6970066B2 true JP6970066B2 (en) 2021-11-24

Family

ID=69798076

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018171504A Active JP6970066B2 (en) 2018-09-13 2018-09-13 Image processing device and ranging device

Country Status (1)

Country Link
JP (1) JP6970066B2 (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002189243A (en) * 2000-12-22 2002-07-05 Mamiya Op Co Ltd Device for attaching accessory of lens
JP2013003159A (en) * 2011-06-10 2013-01-07 Olympus Corp Imaging apparatus
JP2018084571A (en) * 2016-11-11 2018-05-31 株式会社東芝 Processing device, imaging device, and automatic control system
JP3211867U (en) * 2017-05-18 2017-08-10 炎 喬 Ringlight adapter for early diagnosis of pressure ulcers

Also Published As

Publication number Publication date
JP2020041973A (en) 2020-03-19

Similar Documents

Publication Publication Date Title
US8049801B2 (en) Image sensor and imaging apparatus
JP5901246B2 (en) Imaging device
US8854533B2 (en) Image capture apparatus and control method therefor
JP6124564B2 (en) Focus detection apparatus and method, and imaging apparatus
US9398199B2 (en) Image capture apparatus capable of shifting electrical signal when center of gravity is shifted due to an eclipse of pupil area
JP6989466B2 (en) Optical filter, image pickup device and ranging device
US8937662B2 (en) Image processing device, image processing method, and program
JP6991957B2 (en) Image processing device, image pickup device and image processing method
WO2011095026A1 (en) Method and system for photography
JP5784395B2 (en) Imaging device
JP6942480B2 (en) Focus detector, focus detection method, and focus detection program
JP2015046019A (en) Image processing device, imaging device, imaging system, image processing method, program, and storage medium
JP2005128092A (en) Camera
JP5560766B2 (en) Image processing apparatus, imaging apparatus, and program
JP6970066B2 (en) Image processing device and ranging device
JP6997295B2 (en) Imaging device, imaging method, and program
JP7171331B2 (en) Imaging device
JP5038448B2 (en) camera
JP2017040704A (en) Imaging apparatus and imaging system
JP2015087494A (en) Imaging device
WO2018235709A1 (en) Distance measuring camera and distance measurement method
JP7235068B2 (en) Imaging device
JP7445508B2 (en) Imaging device
KR100860700B1 (en) Realizing method of depth of field and digital camera using thereof
US8531753B1 (en) Adaptive optical filter

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20200316

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20210210

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20210309

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20210413

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20211028

R151 Written notification of patent or utility model registration

Ref document number: 6970066

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151