JP2016005080A - Imaging apparatus, imaging system, and imaging method - Google Patents

Imaging apparatus, imaging system, and imaging method Download PDF

Info

Publication number
JP2016005080A
JP2016005080A JP2014123502A JP2014123502A JP2016005080A JP 2016005080 A JP2016005080 A JP 2016005080A JP 2014123502 A JP2014123502 A JP 2014123502A JP 2014123502 A JP2014123502 A JP 2014123502A JP 2016005080 A JP2016005080 A JP 2016005080A
Authority
JP
Japan
Prior art keywords
image
subject
unit
imaging
captured image
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.)
Pending
Application number
JP2014123502A
Other languages
Japanese (ja)
Inventor
太郎 澤木
Taro Sawaki
太郎 澤木
泰二郎 森久
Taijiro Morihisa
泰二郎 森久
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.)
Ricoh Co Ltd
Original Assignee
Ricoh Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP2014123502A priority Critical patent/JP2016005080A/en
Publication of JP2016005080A publication Critical patent/JP2016005080A/en
Pending legal-status Critical Current

Links

Landscapes

  • Studio Devices (AREA)
  • Image Processing (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide an imaging apparatus, an imaging system, and an imaging method, capable of improving image restoration performance even at a defocusing position which is not a focus position, using single imaging means.SOLUTION: A lens unit diffuses PSF to input light, so that an image captured by an imaging device 12 has constant blur in a wide depth instead of a blurred state of an image captured by the imaging device 12. A distance judgment unit 142 judges the subject distance of a subject included in the captured image, based on the characteristic of the captured image captured by the imaging device 12. A selection unit 144 selects an inverse conversion filter corresponding to the judged subject distance. A filter processing unit 145 executes inverse conversion processing to the captured image, using the inverse conversion filter selected by the selection unit 144.

Description

本発明は、撮像装置、撮像システムおよび撮像方法に関する。   The present invention relates to an imaging apparatus, an imaging system, and an imaging method.

近年、情報のデジタル化の発展に伴い、撮像装置の分野においてもデジタル化の発展が著しい。特に、デジタルカメラに代表される撮像装置において、撮像部品は従来のフィルムに置き換わって固体撮像素子が使用されている。固体撮像素子(以下、単に撮像素子という)としては、CCD(Charge Coupled Device)センサまたはCMOS(Complementary Metal Oxide Semiconductor)センサ等が使用されている。   In recent years, with the development of digitalization of information, the development of digitization has been remarkable also in the field of imaging devices. In particular, in an imaging apparatus represented by a digital camera, a solid-state imaging device is used instead of a conventional film as an imaging component. A CCD (Charge Coupled Device) sensor, a CMOS (Complementary Metal Oxide Semiconductor) sensor, or the like is used as a solid-state imaging device (hereinafter simply referred to as an imaging device).

このように、撮像素子を使用した撮像装置は、被写体からの光を光学系によって取り込み、固体撮像素子によって光を電気信号に変換して抽出するものである。このような撮像装置として、デジタルカメラの他、ビデオカメラ、シンボルリーダ(バーコードリーダ、二次元コードリーダ、OCR(Optical Character Reader)等)、携帯電話機、携帯情報端末(PDA:Personal Digital Assistant)および産業用カメラ等が挙げられる。   As described above, an image pickup apparatus using an image pickup device captures light from a subject by an optical system, converts the light into an electrical signal by a solid-state image pickup device, and extracts it. As such an imaging device, in addition to a digital camera, a video camera, a symbol reader (bar code reader, two-dimensional code reader, OCR (Optical Character Reader), etc.), a mobile phone, a personal digital assistant (PDA) and a personal digital assistant Examples include industrial cameras.

このような、CCDまたはCMOS等の撮像素子を備えた撮像装置として、光学系の収差によって発生したぼけを含む画像を、フィルタ処理により復元し、被写界深度を拡張する、いわゆるEDoF(Extended Depth of Field)の技術が既に知られている。ただし、フィルタ処理によりぼけを復元できるのは所定のフォーカス位置近傍の点像分布関数(PSF:Point Spread Function)の形が近似している範囲である。したがって、そのフォーカス位置から外れたデフォーカス位置においては、PSFの形も異なるため、同一のフィルタによるフィルタ処理を施しても、画像の復元性能が低下してしまう。   As such an image pickup apparatus having an image pickup element such as a CCD or CMOS, an image including blur caused by aberration of the optical system is restored by filtering, and the so-called EDOF (Extended Depth) is extended. of Field) is already known. However, the blur can be restored by the filtering process within a range in which the shape of a point spread function (PSF) in the vicinity of a predetermined focus position is approximate. Therefore, since the PSF shape is different at the defocus position deviating from the focus position, even if the same filter processing is performed, the image restoration performance deteriorates.

このようなデフォーカス位置での画像の復元性能を低下させないために、複数の撮像部(撮像手段)を備え、これらの撮像部によって得られる距離情報に基づいて、フィルタ処理のためのフィルタを切り替えることによって、デフォーカス位置の画像の復元性能を向上させる技術が提案されている(特許文献1参照)。   In order not to deteriorate the image restoration performance at such a defocus position, a plurality of imaging units (imaging units) are provided, and a filter for filter processing is switched based on distance information obtained by these imaging units. Thus, a technique for improving the restoration performance of the image at the defocus position has been proposed (see Patent Document 1).

特許文献1に記載された技術は、被写体までの距離情報を得るために複数の撮像部を備える必要があるため、装置のサイズが大きくなり、コストが増加してしまうという問題点があった。   The technique described in Patent Document 1 has a problem in that the size of the apparatus increases and the cost increases because it is necessary to include a plurality of imaging units in order to obtain distance information to the subject.

本発明は、上記に鑑みてなされたものであって、1つの撮像手段でフォーカス位置ではないデフォーカス位置においても画像の復元性能を向上させることができる撮像装置、撮像システムおよび撮像方法を提供することを目的とする。   The present invention has been made in view of the above, and provides an imaging apparatus, an imaging system, and an imaging method capable of improving image restoration performance even at a defocus position that is not a focus position by a single imaging unit. For the purpose.

上述した課題を解決し、目的を達成するために、本発明は、入射した光に収差を与える光学系と、前記光学系を通過した前記光を画素に変換して被写体の画像を撮像する1つの撮像手段と、前記撮像手段により撮像された撮像画像の特性に基づいて、前記被写体の被写体距離を判定する距離判定手段と、前記被写体距離に対応した逆変換フィルタを選択する選択手段と、前記選択手段により選択された前記逆変換フィルタにより、前記撮像画像における前記収差によるぼけを復元する逆変換処理を実行する逆変換手段と、を備えていることを特徴とする。   In order to solve the above-described problems and achieve the object, the present invention provides an optical system that gives aberration to incident light, and images the subject by converting the light that has passed through the optical system into pixels 1 Two image pickup means, distance determination means for determining a subject distance of the subject based on characteristics of a captured image picked up by the image pickup means, selection means for selecting an inverse transform filter corresponding to the subject distance, Inverse conversion means for executing an inverse conversion process for restoring blur due to the aberration in the captured image by the inverse conversion filter selected by the selection means is provided.

本発明によれば、1つの撮像手段でフォーカス位置ではないデフォーカス位置においても画像の復元性能を向上させることができる。   According to the present invention, it is possible to improve image restoration performance even at a defocus position that is not a focus position by a single imaging unit.

図1は、実施の形態に係る撮像システムの全体構成の一例を示す図である。FIG. 1 is a diagram illustrating an example of the overall configuration of an imaging system according to an embodiment. 図2は、実施の形態の情報処理装置のハードウェア構成の一例を示す図である。FIG. 2 is a diagram illustrating an example of a hardware configuration of the information processing apparatus according to the embodiment. 図3は、実施の形態に係る撮像装置の構成の一例を示す図である。FIG. 3 is a diagram illustrating an example of the configuration of the imaging apparatus according to the embodiment. 図4は、実施の形態の光学系のレンズ構成の一例を示す図である。FIG. 4 is a diagram illustrating an example of a lens configuration of the optical system according to the embodiment. 図5は、実施の形態の光学系の横収差の一例を示す図である。FIG. 5 is a diagram illustrating an example of lateral aberration of the optical system according to the embodiment. 図6は、実施の形態の光学系の縦収差の一例を示す図である。FIG. 6 is a diagram illustrating an example of longitudinal aberration of the optical system according to the embodiment. 図7は、実施の形態の光学系の像面湾曲の一例を示す図である。FIG. 7 is a diagram illustrating an example of field curvature of the optical system according to the embodiment. 図8は、実施の形態の光学系のディストーションの一例を示す図である。FIG. 8 is a diagram illustrating an example of distortion of the optical system according to the embodiment. 図9は、被写体距離が350[mm]の場合のMTFの実施例である。FIG. 9 shows an example of the MTF when the subject distance is 350 [mm]. 図10は、被写体距離が400[mm]の場合のMTFの実施例である。FIG. 10 is an example of the MTF when the subject distance is 400 [mm]. 図11は、被写体距離が470[mm]の場合のMTFの実施例である。FIG. 11 shows an example of the MTF when the subject distance is 470 [mm]. 図12は、異なる被写体距離にある二次元コードの撮像画像例を示す図である。FIG. 12 is a diagram illustrating an example of a captured image of a two-dimensional code at different subject distances. 図13は、実施の形態に係る撮像装置の画像処理部のブロック構成の一例を示す図である。FIG. 13 is a diagram illustrating an example of a block configuration of an image processing unit of the imaging apparatus according to the embodiment. 図14は、実施の形態に係る撮像装置の撮像素子により撮像される撮像画像の一例を示す図である。FIG. 14 is a diagram illustrating an example of a captured image captured by the imaging device of the imaging apparatus according to the embodiment. 図15は、撮像素子から出力される画素が画像バッファ部に入力される動作を示すタイミングチャートである。FIG. 15 is a timing chart illustrating an operation in which pixels output from the image sensor are input to the image buffer unit. 図16は、逆変換フィルタの構成の一例を示す図である。FIG. 16 is a diagram illustrating an example of the configuration of the inverse transform filter. 図17は、画像を逆変換フィルタによってフィルタ処理することを説明する図である。FIG. 17 is a diagram for describing filtering of an image using an inverse transform filter. 図18は、画像において逆変換フィルタのフィルタ処理の対象となる対象部分画像をスキャンする動作を説明する図である。FIG. 18 is a diagram illustrating an operation of scanning a target partial image that is a target of filter processing of an inverse transform filter in an image. 図19は、実施の形態の画像処理部のフィルタ処理部の逆変換フィルタを決定するための周波数特性を演算する流れの一例を示すフローチャートである。FIG. 19 is a flowchart illustrating an example of a flow of calculating a frequency characteristic for determining an inverse transform filter of the filter processing unit of the image processing unit according to the embodiment. 図20は、光学系を通過した光による撮像画像の空間周波数特性の一例を示す図である。FIG. 20 is a diagram illustrating an example of a spatial frequency characteristic of a captured image by light that has passed through the optical system. 図21は、逆変換処理が行われた画像の空間周波数特性を示す図である。FIG. 21 is a diagram illustrating the spatial frequency characteristics of an image that has been subjected to inverse transformation processing. 図22は、ベストフォーカス位置の被写体に対する逆変換フィルタによってフィルタ処理した二次元コードの画像例を示す図である。FIG. 22 is a diagram illustrating an example of an image of a two-dimensional code that has been filtered by an inverse transform filter for the subject at the best focus position. 図23は、被写体距離が350[mm]および470[mm]の被写体に対して適用する逆変換フィルタの構成の一例を示す図である。FIG. 23 is a diagram illustrating an example of a configuration of an inverse transform filter applied to a subject whose subject distance is 350 [mm] and 470 [mm]. 図24は、被写体距離に対応した逆変換フィルタによってそれぞれフィルタ処理した二次元コードの画像例を示す図である。FIG. 24 is a diagram illustrating an example of a two-dimensional code image that has been filtered by an inverse transform filter corresponding to a subject distance. 図25は、被写体距離が350[mm]の場合の画像の輝度値についてのヒストグラムの実施例を示す図である。FIG. 25 is a diagram showing an example of a histogram for the luminance value of an image when the subject distance is 350 [mm]. 図26は、被写体距離が400[mm]の場合の画像の輝度値についてのヒストグラムの実施例を示す図である。FIG. 26 is a diagram illustrating an example of a histogram regarding the luminance value of an image when the subject distance is 400 [mm]. 図27は、被写体距離が470[mm]の場合の画像の輝度値についてのヒストグラムの実施例を示す図である。FIG. 27 is a diagram illustrating an example of a histogram regarding the luminance value of an image when the subject distance is 470 [mm]. 図28は、実施の形態に係る撮像装置の動作の一例を示すフローチャートである。FIG. 28 is a flowchart illustrating an example of the operation of the imaging apparatus according to the embodiment.

以下に、図面を参照しながら、本発明に係る撮像装置、撮像システムおよび撮像方法の実施の形態を詳細に説明する。また、以下の実施の形態によって本発明が限定されるものではなく、以下の実施の形態における構成要素には、当業者が容易に想到できるもの、実質的に同一のもの、およびいわゆる均等の範囲のものが含まれる。さらに、以下の実施の形態の要旨を逸脱しない範囲で構成要素の種々の省略、置換、変更および組み合わせを行うことができる。   Hereinafter, embodiments of an imaging apparatus, an imaging system, and an imaging method according to the present invention will be described in detail with reference to the drawings. In addition, the present invention is not limited by the following embodiments, and constituent elements in the following embodiments are easily conceivable by those skilled in the art, substantially the same, and so-called equivalent ranges. Is included. Furthermore, various omissions, substitutions, changes, and combinations of the constituent elements can be made without departing from the scope of the following embodiments.

(撮像システムの全体構成)
図1は、実施の形態に係る撮像システムの全体構成の一例を示す図である。図1を参照しながら、本実施の形態の撮像システム500の構成について説明する。
(Overall configuration of imaging system)
FIG. 1 is a diagram illustrating an example of the overall configuration of an imaging system according to an embodiment. A configuration of an imaging system 500 according to the present embodiment will be described with reference to FIG.

図1に示すように、本実施の形態の撮像システム500は、撮像装置1と、PC(Personal Computer)2と、を備えている。撮像装置1とPC2とは、Ethernet(登録商標)ケーブルまたはUSB(Universal Serial Bus)ケーブル等の通信ケーブル3によって通信可能に接続されている。   As shown in FIG. 1, an imaging system 500 of the present embodiment includes an imaging device 1 and a PC (Personal Computer) 2. The imaging device 1 and the PC 2 are communicably connected by a communication cable 3 such as an Ethernet (registered trademark) cable or a USB (Universal Serial Bus) cable.

撮像装置1は、被写体4からの光を電気信号に変換することによって被写体4を撮像し、撮像画像の情報(以下、単に撮像画像という)に対して画像処理を実行し、画像処理後の画像に含まれるシンボルを認識して、認識したシンボルをデコードし、デコードした情報を、通信ケーブル3を介してPC2へ送信する。ここで、撮像装置1によるシンボルの認識、および認識したシンボルのデコードの動作を、単に「シンボルの認識処理」というものとする。シンボルとしては、例えば、バーコード、二次元コードまたは文字列等が挙げられる。PC2は、撮像装置1から受信したデコードされた情報に基づいて所定の処理を実行する。   The imaging device 1 images the subject 4 by converting light from the subject 4 into an electrical signal, performs image processing on information of the captured image (hereinafter simply referred to as a captured image), and performs an image processing after the image processing. Is recognized, the recognized symbol is decoded, and the decoded information is transmitted to the PC 2 via the communication cable 3. Here, the operation of symbol recognition and decoding of the recognized symbol by the imaging apparatus 1 is simply referred to as “symbol recognition processing”. Examples of the symbol include a barcode, a two-dimensional code, a character string, and the like. The PC 2 executes predetermined processing based on the decoded information received from the imaging device 1.

例えば、撮像装置1は、生産ラインを流れる製品に添付されたバーコードを撮像して、バーコードを読み取るための認識処理を実行し、デコードされた情報としての品番情報等をPC2に送信する。PC2は、受信した画像からバーコードの情報を読み出して解析する。   For example, the imaging device 1 images a barcode attached to a product flowing through the production line, executes a recognition process for reading the barcode, and transmits product number information as decoded information to the PC 2. The PC 2 reads and analyzes the barcode information from the received image.

なお、図1に示すように、撮像システム500は、撮像装置1とPC2とが通信ケーブル3を介してデータを通信する有線通信方式のシステムとしているが、これに限定されるものではない。例えば、撮像装置1とPC2とは、Wi−Fi(登録商標)(WirelessFidelity)等の無線通信方式によって互いにデータが通信可能であってもよい。   As shown in FIG. 1, the imaging system 500 is a wired communication system in which the imaging apparatus 1 and the PC 2 communicate data via the communication cable 3, but is not limited to this. For example, the image capturing apparatus 1 and the PC 2 may be capable of communicating data with each other by a wireless communication method such as Wi-Fi (registered trademark) (Wireless Fidelity).

また、撮像装置1およびPC2が生産ラインにおいて使用される場合、撮像システム500は、PC2がPLC(Programmable Logic Controller)等に通信可能に接続されている構成としてもよい。この場合、撮像システム500の動作として、以下の動作が一例として挙げられる。撮像装置1は、生産ラインを流れる製品に添付されたバーコードを撮像して、認識処理によりバーコードを認識してデコードし、デコードした情報としての品番情報をPC2に送信する。PC2は、受信した品番情報から、生産ラインを流れている製品の品番を判定する。PC2は、判定した品番が、生産ラインにおいて段替えされている品番と不一致である場合、判定した品番に対応する製品は異なる品番の製品であることを示す信号をPLCに送信する。PLCは、PC2から異なる品番の製品であることを示す信号を受信した場合、その製品を生産ラインから除去するように生産ラインの動作を制御する。   When the imaging device 1 and the PC 2 are used in a production line, the imaging system 500 may be configured such that the PC 2 is connected to a PLC (Programmable Logic Controller) or the like so as to be able to communicate. In this case, as an operation of the imaging system 500, the following operation is given as an example. The imaging device 1 images a barcode attached to a product flowing through a production line, recognizes and decodes the barcode by a recognition process, and transmits product number information as decoded information to the PC 2. The PC 2 determines the product number of the product flowing through the production line from the received product number information. If the determined product number does not match the product number that has been changed in the production line, the PC 2 transmits a signal indicating that the product corresponding to the determined product number is a product of a different product number to the PLC. When receiving a signal indicating that the product is a product of a different product number from the PC 2, the PLC controls the operation of the production line so as to remove the product from the production line.

(情報処理装置の構成)
図2は、実施の形態の情報処理装置のハードウェア構成の一例を示す図である。図2を参照しながら、情報処理装置の一例であるPC2のハードウェア構成について説明する。
(Configuration of information processing device)
FIG. 2 is a diagram illustrating an example of a hardware configuration of the information processing apparatus according to the embodiment. The hardware configuration of the PC 2 that is an example of the information processing apparatus will be described with reference to FIG.

図2に示すように、情報処理装置の一例であるPC2は、通信部21と、操作部22と、表示部23と、記憶部24と、外部記憶装置25と、制御部26と、を備えている。上記の各部は、バス27によって接続され、互いにデータの送受信が可能となっている。   As illustrated in FIG. 2, the PC 2, which is an example of an information processing device, includes a communication unit 21, an operation unit 22, a display unit 23, a storage unit 24, an external storage device 25, and a control unit 26. ing. The above-described units are connected by a bus 27 and can transmit and receive data to and from each other.

通信部21は、通信ケーブル3を介して、撮像装置1と通信する装置である。通信部21は、例えば、NIC(Network Interface Card)、またはUSBインタフェース装置等の通信装置によって実現される。通信部21の通信規格は、例えば、TCP(Transmission Control Protocol)/IP(Internet Protocol)またはUDP(User Datagram Protocol)/IP等よって実現される。または、通信部21の通信規格は、USB1.1またはUSB2.0等の規格であってもよい。   The communication unit 21 is a device that communicates with the imaging device 1 via the communication cable 3. The communication unit 21 is realized by a communication device such as a NIC (Network Interface Card) or a USB interface device, for example. The communication standard of the communication unit 21 is realized by, for example, TCP (Transmission Control Protocol) / IP (Internet Protocol) or UDP (User Datagram Protocol) / IP. Alternatively, the communication standard of the communication unit 21 may be a standard such as USB 1.1 or USB 2.0.

操作部22は、ユーザによって制御部26に対して所定の処理を実行させるための操作入力を行う装置である。操作部22は、例えば、マウス、キーボード、テンキー、タッチパッドまたはタッチパネルにおける操作入力機能等によって実現される。   The operation unit 22 is a device that performs an operation input for causing the control unit 26 to execute a predetermined process by the user. The operation unit 22 is realized by, for example, an operation input function on a mouse, a keyboard, a numeric keypad, a touch pad, or a touch panel.

表示部23は、制御部26により実行されているアプリケーション画像、または、撮像装置1から出力された画像等を表示する装置である。表示部23は、例えば、CRT(Cathode Ray Tube)ディスプレイ、液晶ディスプレイ、プラズマディスプレイまたは有機EL(Electroluminescence)ディスプレイ等によって実現される。   The display unit 23 is a device that displays an application image executed by the control unit 26 or an image output from the imaging device 1. The display unit 23 is realized by, for example, a CRT (Cathode Ray Tube) display, a liquid crystal display, a plasma display, an organic EL (Electroluminescence) display, or the like.

記憶部24は、PC2で実行される各種プログラムおよびPC2で行われる各種処理に使用されるデータ等を記憶する装置である。記憶部24は、例えば、ROM(Read Only Memory)およびRAM(Random Access Memory)等の記憶装置によって実現される。   The storage unit 24 is a device that stores various programs executed by the PC 2 and data used for various processes performed by the PC 2. The storage unit 24 is realized by a storage device such as a ROM (Read Only Memory) and a RAM (Random Access Memory), for example.

外部記憶装置25は、画像、撮像装置1によりシンボルからデコードされた情報、プログラムおよびフォントデータ等を蓄積して記憶する記憶装置である。外部記憶装置25は、例えば、HDD(Hard Disk Drive)、SSD(Solid State Drive)、光ディスク、または光磁気ディスク(MO:Magneto−Optical Disk)等の記憶装置によって実現される。   The external storage device 25 is a storage device that accumulates and stores images, information decoded from symbols by the imaging device 1, programs, font data, and the like. The external storage device 25 is realized by, for example, a storage device such as a hard disk drive (HDD), a solid state drive (SSD), an optical disk, or a magneto-optical disk (MO: Magneto-Optical Disk).

制御部26は、PC2の各部の動作を制御する装置である。制御部26は、例えば、CPU(Central Processing Unit)およびASIC(Application Specific Integrated Circuit)等で実現される。   The control unit 26 is a device that controls the operation of each unit of the PC 2. The control unit 26 is realized by, for example, a CPU (Central Processing Unit) and an ASIC (Application Specific Integrated Circuit).

(撮像装置の構成)
図3は、実施の形態に係る撮像装置の構成の一例を示す図である。図3を参照しながら、本実施の形態の撮像装置1の構成について説明する。
(Configuration of imaging device)
FIG. 3 is a diagram illustrating an example of the configuration of the imaging apparatus according to the embodiment. The configuration of the imaging apparatus 1 according to the present embodiment will be described with reference to FIG.

図3に示すように、撮像装置1は、レンズユニット11(光学系の一例)と、撮像素子12(撮像手段)と、画像処理部14と、認識処理部15(認識処理手段)と、通信部16と、を備えている。   As illustrated in FIG. 3, the imaging device 1 includes a lens unit 11 (an example of an optical system), an imaging element 12 (imaging unit), an image processing unit 14, a recognition processing unit 15 (recognition processing unit), and communication. Part 16.

レンズユニット11は、被写体4(図1参照)からの光を集光し、撮像素子12に対して結像させるユニットである。レンズユニット11は、1枚以上のレンズで構成された光学系によって実現される。被写体4は、例えば、人物、被監視物、またはバーコードもしくは二次元コード等のシンボル等である。   The lens unit 11 is a unit that collects light from the subject 4 (see FIG. 1) and forms an image on the image sensor 12. The lens unit 11 is realized by an optical system composed of one or more lenses. The subject 4 is, for example, a person, a monitored object, or a symbol such as a barcode or a two-dimensional code.

撮像素子12は、レンズユニット11に入射する被写体4からの光を電気信号に変換することによって被写体4を撮像して画像を生成する固体撮像素子である。撮像素子12は、固体撮像素子を構成する各検出単位によって撮像した画像を構成する画素を出力する。撮像素子12は、例えば、CCDセンサまたはCMOSセンサ等によって実現される。   The imaging element 12 is a solid-state imaging element that captures an image of the subject 4 by converting light from the subject 4 incident on the lens unit 11 into an electrical signal and generates an image. The image sensor 12 outputs pixels constituting an image taken by each detection unit constituting the solid-state image sensor. The image sensor 12 is realized by, for example, a CCD sensor or a CMOS sensor.

画像処理部14は、撮像素子12から出力される撮像画像から、フィルタ処理を施した画像を生成する。   The image processing unit 14 generates an image subjected to filter processing from the captured image output from the imaging element 12.

認識処理部15は、画像処理部14によりフィルタ処理が実行された画像に基づいて、画像に含まれるシンボルを認識して、認識したシンボルをデコードするシンボルの認識処理を実行する。   The recognition processing unit 15 recognizes a symbol included in the image based on the image on which the filter processing has been performed by the image processing unit 14, and executes a symbol recognition process for decoding the recognized symbol.

通信部16は、通信ケーブル3を介して、PC2と通信する装置である。通信部16は、例えば、認識処理部15から出力されるデコードされた情報をPC2に対して送信する。通信部16は、例えば、NIC、またはUSBインタフェース装置等の通信装置によって実現される。通信部16の通信規格は、例えば、TCP/IPまたはUDP/IP等よって実現されるまたは、通信部16の通信規格は、USB1.1またはUSB2.0等の規格であってもよい。   The communication unit 16 is a device that communicates with the PC 2 via the communication cable 3. For example, the communication unit 16 transmits the decoded information output from the recognition processing unit 15 to the PC 2. The communication unit 16 is realized by a communication device such as a NIC or a USB interface device, for example. The communication standard of the communication unit 16 is realized by, for example, TCP / IP or UDP / IP, or the communication standard of the communication unit 16 may be a standard such as USB 1.1 or USB 2.0.

なお、認識処理部15は、撮像装置1に含まれる構成としているが、撮像装置1に接続される外部機器の機能によって実現されるものとしてもよい。例えば、認識処理部15は、撮像装置1ではなくPC2において実現されるものとしてもよい。   The recognition processing unit 15 is configured to be included in the imaging device 1, but may be realized by a function of an external device connected to the imaging device 1. For example, the recognition processing unit 15 may be realized in the PC 2 instead of the imaging device 1.

また、画像処理部14および認識処理部15は、ソフトウェアであるプログラムが実行されるによって実現されてもよく、または、ASICまたはFPGA(Field−Programmable Gate Array)等のハードウェア回路によって実現されてもよい。また、画像処理部14または認識処理部15の少なくともいずれかがプログラムの実行によって実現される場合、そのプログラムは、撮像装置1が備えるROM等に予め組み込まれて提供される。本実施の形態の撮像装置1で実行されるプログラムは、インストール可能な形式または実行可能な形式のファイルでCD−ROM、フレキシブルディスク(FD)、CD−R、DVD(Digital Versatile Disc)等のコンピュータで読み取り可能な記録媒体に記録して提供するように構成してもよい。また、本実施の形態の撮像装置1で実行されるプログラムを、インターネット等のネットワークに接続されたコンピュータ上に格納し、ネットワーク経由でダウンロードさせることにより提供するように構成してもよい。また、本実施の形態の撮像装置1で実行されるプログラムを、インターネット等のネットワーク経由で提供または配布するように構成してもよい。本実施の形態の撮像装置1で実行されるプログラムは、上述した画像処理部14または認識処理部15の少なくともいずれかを含むモジュール構成となっており、実際のハードウェアとしてはCPUが上述のROMからプログラムを読み出して実行することにより、画像処理部14または認識処理部15が主記憶装置上にロードされて生成されるようになっている。   The image processing unit 14 and the recognition processing unit 15 may be realized by executing a program that is software, or may be realized by a hardware circuit such as an ASIC or an FPGA (Field-Programmable Gate Array). Good. When at least one of the image processing unit 14 and the recognition processing unit 15 is realized by executing a program, the program is provided by being incorporated in advance in a ROM or the like included in the imaging device 1. A program executed by the imaging apparatus 1 according to the present embodiment is a file in an installable or executable format, such as a CD-ROM, a flexible disk (FD), a CD-R, a DVD (Digital Versatile Disc), or the like. The information may be provided by being recorded on a recording medium that can be read by the user. Further, the program executed by the imaging apparatus 1 according to the present embodiment may be configured to be provided by being stored on a computer connected to a network such as the Internet and downloaded via the network. Further, the program executed by the imaging apparatus 1 of the present embodiment may be configured to be provided or distributed via a network such as the Internet. The program executed by the imaging apparatus 1 according to the present embodiment has a module configuration including at least one of the image processing unit 14 and the recognition processing unit 15 described above, and the CPU includes the above-described ROM as actual hardware. By reading and executing the program, the image processing unit 14 or the recognition processing unit 15 is loaded on the main storage device and generated.

(レンズユニットの構成)
図4は、実施の形態の光学系のレンズ構成の一例を示す図である。図4を参照しながら、本実施の形態の撮像装置1のレンズユニット11の構成例について説明する。
(Configuration of lens unit)
FIG. 4 is a diagram illustrating an example of a lens configuration of the optical system according to the embodiment. A configuration example of the lens unit 11 of the imaging device 1 according to the present embodiment will be described with reference to FIG.

図4に示すように、レンズユニット11は、例えば、レンズLZ1〜LZ3と、位相板LZ4と、絞りSBと、レンズLZ5〜LZ7と、を含む。これらは、図4の紙面視左側、すなわち被写体側から、紙面視右側、すなわち像面側(撮像素子12側)へ向かう方向に、レンズLZ1〜LZ3、位相板LZ4、絞りSB、レンズLZ5〜LZ7の順に並んで配置されている。また、レンズLZ1〜LZ3、LZ5〜LZ7は、それぞれの光軸が一致するように配置されている。   As shown in FIG. 4, the lens unit 11 includes, for example, lenses LZ1 to LZ3, a phase plate LZ4, a stop SB, and lenses LZ5 to LZ7. These are the lenses LZ1 to LZ3, the phase plate LZ4, the stop SB, and the lenses LZ5 to LZ7 in the direction from the left side in FIG. Are arranged in the order of. The lenses LZ1 to LZ3 and LZ5 to LZ7 are arranged so that their optical axes coincide with each other.

位相板LZ4は、レンズユニット11に入射する光に対して収差を与える作用を有する。その結果、位相板LZ4は、撮像素子12に入射される光に対して点像分布関数(PSF)を拡散する作用を有し、撮像素子12で撮像される画像がぼけた状態とする代わりに広い深度でそのぼけが一定、すなわちPSFの形が一定となるようにする。ここで、PSFの拡散とは、例えば、撮像素子12のセンサ面におけるPSFを3画素以上にまたがるような拡散をいう。なお、レンズユニット11に入射する光に対して収差を与えるのは、位相板LZ4に限定されるものではなく、レンズユニット11に含まれるレンズによって収差が与えられるものとしてもよい。   The phase plate LZ4 has an effect of giving aberration to the light incident on the lens unit 11. As a result, the phase plate LZ4 has a function of diffusing a point spread function (PSF) with respect to the light incident on the image sensor 12, and instead of making the image captured by the image sensor 12 blurred. The blur is constant over a wide depth, that is, the shape of the PSF is constant. Here, the diffusion of the PSF means, for example, a diffusion in which the PSF on the sensor surface of the image sensor 12 extends over 3 pixels or more. Aberration is not limited to the phase plate LZ4, but aberration may be given to the light incident on the lens unit 11 by a lens included in the lens unit 11.

絞りSBは、レンズユニット11に入射する光の量を自在に調整する部材であり、位相板LZ4の近傍に配置されている。   The stop SB is a member that freely adjusts the amount of light incident on the lens unit 11, and is disposed in the vicinity of the phase plate LZ4.

(レンズユニットの収差)
図5は、実施の形態の光学系の横収差の一例を示す図である。図6は、実施の形態の光学系の縦収差の一例を示す図である。図7は、実施の形態の光学系の像面湾曲の一例を示す図である。図8は、実施の形態の光学系のディストーションの一例を示す図である。図5〜8を参照しながら、レンズユニット11が与える収差の例を説明する。
(Lens unit aberration)
FIG. 5 is a diagram illustrating an example of lateral aberration of the optical system according to the embodiment. FIG. 6 is a diagram illustrating an example of longitudinal aberration of the optical system according to the embodiment. FIG. 7 is a diagram illustrating an example of field curvature of the optical system according to the embodiment. FIG. 8 is a diagram illustrating an example of distortion of the optical system according to the embodiment. Examples of aberration given by the lens unit 11 will be described with reference to FIGS.

まず、レンズユニット11は、図5に示すような横収差を与える。ここで、横収差とは、撮像素子12のセンサ面の方向に発生する収差である。図5(a)は、レンズユニット11の光軸と撮像素子12のセンサ面との交点から、レンズユニット11を通過する光線のうちの主光線がセンサ面に達する位置までの長さ、すなわち、主光線についての像高が0[mm]である場合の横収差のグラフを示す。図5(a)の左側のグラフは、レンズユニット11の絞りSBに基づく入射瞳における、後述する図14のY方向に対応する方向の位置Pyと、横収差eyとの関係を示すグラフである。また、図5(b)の右側のグラフは、入射瞳における図14のX方向に対応する方向の位置Pxと、横収差exとの関係を示すグラフである。図5(b)および5(c)は、同様に、主光線についての像高がそれぞれ1.5[mm]、3.0[mm]である場合の横収差のグラフを示す。   First, the lens unit 11 gives lateral aberration as shown in FIG. Here, the lateral aberration is an aberration generated in the direction of the sensor surface of the image sensor 12. FIG. 5A shows the length from the intersection of the optical axis of the lens unit 11 and the sensor surface of the image sensor 12 to the position where the principal ray of the light rays passing through the lens unit 11 reaches the sensor surface, that is, The graph of lateral aberration when the image height for the principal ray is 0 [mm] is shown. The graph on the left side of FIG. 5A is a graph showing the relationship between the lateral aberration ey and the position Py in the direction corresponding to the Y direction of FIG. 14 to be described later, at the entrance pupil based on the stop SB of the lens unit 11. . The graph on the right side of FIG. 5B is a graph showing the relationship between the lateral aberration ex and the position Px in the direction corresponding to the X direction in FIG. 14 at the entrance pupil. FIGS. 5B and 5C similarly show lateral aberration graphs when the image heights of the principal rays are 1.5 [mm] and 3.0 [mm], respectively.

図5に示すように、レンズユニット11が与える横収差は、横軸(センサ面に平行な方向)において、0とはならずに、センサ面の位置に応じた大きさの収差となっている。なお、図5に示すグラフは、可視光線のうち波長が656[nm]の光線(以下、rと示す)、588[nm]の光線(以下、gと示す)、および486[nm]の光線(以下、bと示す)の各光線について示されているが、実質的に分離されず互いに重なり合っている。   As shown in FIG. 5, the lateral aberration given by the lens unit 11 does not become 0 on the horizontal axis (direction parallel to the sensor surface), but is an aberration having a magnitude corresponding to the position of the sensor surface. . Note that the graph shown in FIG. 5 is a visible light ray having a wavelength of 656 [nm] (hereinafter referred to as r), a 588 [nm] ray (hereinafter referred to as g), and a 486 [nm] ray. Although shown for each ray (hereinafter referred to as b), they are not substantially separated but overlap each other.

また、レンズユニット11は、図6に示すような縦収差を与える。ここで、縦収差とは、レンズユニット11の光軸方向(縦方向という)の収差であって、撮像素子12のセンサ面上の一点に結像しないことによって発生する収差である。図6の縦軸は、レンズユニット11に入射する光線の入射点の光軸からの高さ(以下、入射高さという)であり、横軸は、縦収差を示す。また、図6の光線rについてのグラフR1、光線gについてのグラフG1、光線bについてのグラフB1が示すように、縦収差は各光線によって少し大きさが異なっていることがわかる。図6では、0.7[mm]以上の大きな収差が発生していることが示されている。これは、位相板LZ4によってPSFを拡散し、広い深度でぼけが一定(PSFの形が一定)となるようにする機能に基づくものである。ただし、その結果として、後述の図9〜11に示すグラフのようにMTF(Modulation Transfer Function)の低下を招来している。   Further, the lens unit 11 gives a longitudinal aberration as shown in FIG. Here, the longitudinal aberration is an aberration in the optical axis direction (referred to as a longitudinal direction) of the lens unit 11, and is an aberration that occurs when an image is not formed at one point on the sensor surface of the image sensor 12. The vertical axis in FIG. 6 is the height from the optical axis of the incident point of the light beam incident on the lens unit 11 (hereinafter referred to as the incident height), and the horizontal axis indicates the longitudinal aberration. In addition, as shown in the graph R1 for the light ray r, the graph G1 for the light ray g, and the graph B1 for the light ray b in FIG. 6, it can be seen that the longitudinal aberration is slightly different for each light ray. FIG. 6 shows that a large aberration of 0.7 [mm] or more occurs. This is based on the function of diffusing PSF with the phase plate LZ4 so that blur is constant (PSF shape is constant) at a wide depth. However, as a result, the MTF (Modulation Transfer Function) is lowered as shown in the graphs shown in FIGS.

また、レンズユニット11は、図7に示すような像面湾曲の収差を与える。ここで、像面湾曲とは、レンズユニット11に入射する各方向の光が、平面である撮像素子12のセンサ面で結像せず、像点の集合である像面が平面とならずに湾曲する現象をいう。図7では、タンジェンシャル面、すなわちレンズユニット11の光軸と主光線とを含む平面における像面湾曲と、サジタル面、すなわちタンジェンシャル面と直交し、主光線を含む平面における像面湾曲とが示されている。図7の縦軸は、像高IHを示し、横軸は、撮像素子12のセンサ面を基準とした光軸方向の結像点の位置を示す。具体的には、図7に示すグラフR2_Tは、光線rについてのタンジェンシャル面における像面湾曲を示し、グラフG2_Tは、光線gについてのタンジェンシャル面における像面湾曲を示し、そして、グラフB2_Tは、光線bについてのタンジェンシャル面における像面湾曲を示す。また、図7に示すグラフR2_Sは、光線rについてのサジタル面における像面湾曲を示し、グラフG2_Sは、光線gについてのサジタル面における像面湾曲を示し、そして、グラフB2_Sは、光線bについてのサジタル面における像面湾曲を示す。   The lens unit 11 gives an aberration of curvature of field as shown in FIG. Here, the field curvature means that light in each direction incident on the lens unit 11 does not form an image on the sensor surface of the imaging element 12 that is a plane, and the image plane that is a set of image points does not become a plane. The phenomenon of bending. In FIG. 7, the curvature of field in the tangential plane, that is, the plane including the optical axis of the lens unit 11 and the principal ray, and the curvature of field in the sagittal plane, that is, the plane orthogonal to the tangential plane and including the principal ray are obtained. It is shown. In FIG. 7, the vertical axis represents the image height IH, and the horizontal axis represents the position of the imaging point in the optical axis direction with reference to the sensor surface of the image sensor 12. Specifically, the graph R2_T shown in FIG. 7 shows the field curvature in the tangential plane for the ray r, the graph G2_T shows the field curvature in the tangential plane for the ray g, and the graph B2_T is , Shows curvature of field in the tangential plane for ray b. Also, the graph R2_S shown in FIG. 7 shows the field curvature in the sagittal plane for the ray r, the graph G2_S shows the field curvature in the sagittal plane for the ray g, and the graph B2_S shows the curvature for the ray b. The field curvature in the sagittal plane is shown.

また、レンズユニット11は、図8に示すようなディストーションを与える。ここで、ディストーション(歪曲収差)とは、歪みの割合が像高によって異なる収差である。図8の縦軸は、像高IHを示し、横軸は、理想の像高に対する、実際の像高と理想の像高との差の割合を示す。   Moreover, the lens unit 11 gives distortion as shown in FIG. Here, the distortion (distortion aberration) is an aberration in which the distortion rate varies depending on the image height. The vertical axis in FIG. 8 represents the image height IH, and the horizontal axis represents the ratio of the difference between the actual image height and the ideal image height with respect to the ideal image height.

なお、図8に示すグラフは、r光線、g光線およびb光線の各光線について示されているが、実質的に分離されず互いに重なり合っている。   In addition, although the graph shown in FIG. 8 is shown about each light ray of r light, g light, and b light, it is not isolate | separated substantially but it mutually overlaps.

以上のような種類の収差がレンズユニット11によって発生しているが、上述のように、レンズユニット11に含まれる位相板LZ4によって、撮像素子12に入射される光に対してPSFが拡散され、撮像画像をぼけた状態とする代わりに広い深度でそのぼけが一定、すなわちPSFの形が一定となる。   The aberrations of the kind described above are generated by the lens unit 11, but as described above, the PSF is diffused with respect to the light incident on the image sensor 12 by the phase plate LZ4 included in the lens unit 11, Instead of blurring the captured image, the blur is constant over a wide depth, that is, the shape of the PSF is constant.

(収差によるMTFの低下について)
図9は、被写体距離が350[mm]の場合のMTFの実施例である。図10は、被写体距離が400[mm]の場合のMTFの実施例である。図11は、被写体距離が470[mm]の場合のMTFの実施例である。図12は、異なる被写体距離にある二次元コードの撮像画像例を示す図である。図9〜12を参照しながら、収差を与えるレンズユニット11を通過した被写体からの光が撮像素子12によって撮像された画像(撮像画像)のMTFについて説明する。
(About reduction of MTF due to aberration)
FIG. 9 shows an example of the MTF when the subject distance is 350 [mm]. FIG. 10 is an example of the MTF when the subject distance is 400 [mm]. FIG. 11 shows an example of the MTF when the subject distance is 470 [mm]. FIG. 12 is a diagram illustrating an example of a captured image of a two-dimensional code at different subject distances. The MTF of an image (captured image) in which light from a subject that has passed through the lens unit 11 that gives aberration is captured by the image sensor 12 will be described with reference to FIGS.

上述のように、レンズユニット11は、撮像素子12に入射される被写体からの光に対して収差を与えてPSFを拡散し、撮像画像をぼけた状態とする代わりに広い深度でそのぼけが一定となるようにするが、その結果として、MTFの低下を招来する。ここで、MTFとは、被写体の持つコントラストを、どれくらい忠実に再現できるかを数値化した値、すなわちコントラストの再現率を示す値であり、理想値は「1」である。   As described above, the lens unit 11 diffuses the PSF by giving aberration to the light from the subject incident on the image sensor 12, and the blur is constant over a wide depth instead of making the captured image blurred. As a result, the MTF is lowered. Here, the MTF is a value obtained by quantifying how faithfully the contrast of a subject can be reproduced, that is, a value indicating a contrast reproduction rate, and an ideal value is “1”.

図9に示すグラフは、被写体距離(例えば、レンズユニット11から被写体までの距離のように定義する)が350[mm]の場合の撮像画像についての空間周波数に対するMTFの特性の実施例を示すグラフである。図10に示すグラフは、被写体距離が400[mm]の場合の撮像画像についての空間周波数に対するMTFの特性の実施例を示すグラフである。図11に示すグラフは、被写体距離が470[mm]の場合の撮像画像についての空間周波数に対するMTFの特性の実施例を示すグラフである。いずれのグラフにおいても、レンズユニット11による収差の影響で、MTFは理想値である「1」よりも低下しており、特に空間周波数が高くになるにしたがって低下する傾向を有する。   The graph shown in FIG. 9 is a graph showing an example of the MTF characteristics with respect to the spatial frequency for the captured image when the subject distance (for example, defined as the distance from the lens unit 11 to the subject) is 350 [mm]. It is. The graph shown in FIG. 10 is a graph showing an example of the MTF characteristics with respect to the spatial frequency for the captured image when the subject distance is 400 [mm]. The graph shown in FIG. 11 is a graph showing an example of the MTF characteristics with respect to the spatial frequency for the captured image when the subject distance is 470 [mm]. In any graph, the MTF is lower than the ideal value “1” due to the influence of the aberration caused by the lens unit 11, and particularly has a tendency to decrease as the spatial frequency increases.

また、図9〜11に示すグラフの特徴の1つとして、空間周波数について低周波数側のMTF、および高周波数側のMTFが、被写体距離によって異なる。例えば、図9〜11のグラフを互いに比較した場合、低周波数側の空間周波数が例えば10[mm−1]であるとすると、MTFが最も高いのは、図9に示す被写体距離が350[mm]のMTFのグラフである。一方、高周波数側の空間周波数が例えば50[mm−1]であるとすると、MTFが最も高いのは、図10に示す被写体距離が400[mm]のMTFのグラフである。 Further, as one of the characteristics of the graphs shown in FIGS. 9 to 11, the MTF on the low frequency side and the MTF on the high frequency side of the spatial frequency differ depending on the subject distance. For example, when the graphs of FIGS. 9 to 11 are compared with each other and the spatial frequency on the low frequency side is, for example, 10 [mm −1 ], the MTF is the highest when the subject distance shown in FIG. ] Is an MTF graph. On the other hand, when the spatial frequency on the high frequency side is, for example, 50 [mm −1 ], the MTF having the highest MTF is the graph of the MTF with the subject distance of 400 [mm] shown in FIG.

また、図12に示す二次元コードの画像は、被写体としての二次元コードからの、収差を与えるレンズユニット11を通過した光が、撮像素子12によって撮像された二次元コードの撮像画像である。図12(a)は、被写体距離が350[mm]の二次元コードの撮像画像を示し、図12(b)は、被写体距離が400[mm]の二次元コードの撮像画像を示し、図12(c)は、被写体距離が470[mm]の二次元コードの撮像画像を示す。そして、図12(d)は、二次元コードの理想画像を示す。図12(a)〜(c)に示す二次元コードの撮像画像のうち、図12(b)に示す被写体距離が400[mm]の撮像画像が最も図12(d)に示す理想画像に近く、二次元コードの模様も他の撮像画像に比べると明瞭となっている。この被写体距離400[mm]を、仮に、ベストフォーカス位置とする。ここで、ベストフォーカス位置とは、被写体距離のうち、レンズユニット11の収差の影響が小さく、最も撮像画像が明瞭になる位置であるものとする。   Further, the image of the two-dimensional code shown in FIG. 12 is a picked-up image of the two-dimensional code in which light from the two-dimensional code as a subject that has passed through the lens unit 11 that gives aberration is picked up by the image pickup device 12. 12A shows a captured image of a two-dimensional code with a subject distance of 350 [mm], and FIG. 12B shows a captured image of a two-dimensional code with a subject distance of 400 [mm]. (C) shows a captured image of a two-dimensional code having a subject distance of 470 [mm]. FIG. 12D shows an ideal image of a two-dimensional code. Of the captured images of the two-dimensional code shown in FIGS. 12A to 12C, the captured image with the subject distance of 400 mm shown in FIG. 12B is closest to the ideal image shown in FIG. The pattern of the two-dimensional code is also clearer than other captured images. This subject distance 400 [mm] is assumed to be the best focus position. Here, it is assumed that the best focus position is a position where the influence of the aberration of the lens unit 11 is small and the captured image is clearest in the subject distance.

しかし、いずれにしても図12(a)〜12(c)に示す撮像画像はぼけた画像であり、所定のMTFの値が得られるように補正する必要がある。このような、レンズユニット11によってぼけた撮像画像に対して、ぼけを補正する方法として、点像分布関数(PSF)の逆変換処理を施すことによって、MTFを向上させ、高解像度の画像に補正することができる。逆変換処理は、光学系によってぼけた画像を形成する各画素に対して、逆変換フィルタによるフィルタ処理を施すことにより、収差による画像のぼけを復元することによって実現される。以下、画像処理部14のブロック構成の詳細を説明すると共に、逆変換処理による被写界深度拡張の方法の一例について説明する。   However, in any case, the captured images shown in FIGS. 12A to 12C are blurred images and need to be corrected so as to obtain a predetermined MTF value. As a method of correcting blur for such a blurred image taken by the lens unit 11, MTF is improved by performing inverse transformation processing of the point spread function (PSF) to correct the image to a high resolution. can do. The inverse transformation process is realized by restoring the blur of the image due to the aberration by applying a filter process using an inverse transform filter to each pixel that forms an image blurred by the optical system. Hereinafter, details of the block configuration of the image processing unit 14 will be described, and an example of a method for extending the depth of field by inverse conversion processing will be described.

(画像処理部の構成および動作)
図13は、実施の形態に係る撮像装置の画像処理部のブロック構成の一例を示す図である。図14は、実施の形態に係る撮像装置の撮像素子により撮像される撮像画像の一例を示す図である。図13を参照しながら、本実施の形態の撮像装置1の画像処理部14のブロック構成について説明する。
(Configuration and operation of image processing unit)
FIG. 13 is a diagram illustrating an example of a block configuration of an image processing unit of the imaging apparatus according to the embodiment. FIG. 14 is a diagram illustrating an example of a captured image captured by the imaging device of the imaging apparatus according to the embodiment. A block configuration of the image processing unit 14 of the imaging device 1 according to the present embodiment will be described with reference to FIG.

撮像素子12は、上述のように、レンズユニット11に入射する被写体4(図1参照)からの光を電気信号に変換することにより被写体4を撮像し、画像を生成する固体撮像素子である。以下、撮像素子12は、VGA(Video Graphics Array)の画像を形成して出力するものとして説明する。具体的には、撮像素子12は、図14に示すように、例えば、X方向に640個、Y方向に480個の検出素子によって、640×480のマトリックス状に配列された画素で構成される画像である撮像画像101を撮像する。   As described above, the imaging element 12 is a solid-state imaging element that captures an image of the subject 4 by converting light from the subject 4 (see FIG. 1) incident on the lens unit 11 into an electrical signal and generates an image. In the following description, it is assumed that the image sensor 12 forms and outputs a VGA (Video Graphics Array) image. Specifically, as illustrated in FIG. 14, the imaging device 12 includes pixels arranged in a 640 × 480 matrix by, for example, 640 detection elements in the X direction and 480 detection elements in the Y direction. A captured image 101 that is an image is captured.

なお、撮像素子12が撮像する画像の大きさは640×480のVGAの画像であるものとしたが、これに限定されるものではなく、異なる大きさの画像であってもよい。   Although the size of the image captured by the image sensor 12 is a 640 × 480 VGA image, the image is not limited to this and may be an image of a different size.

図13に示すように、本実施の形態の画像処理部14は、画像バッファ部141と、距離判定部142(距離判定手段)と、記憶部143(記憶手段)と、選択部144(選択手段)と、フィルタ処理部145(逆変換手段)と、を備えている。   As shown in FIG. 13, the image processing unit 14 of the present embodiment includes an image buffer unit 141, a distance determination unit 142 (distance determination unit), a storage unit 143 (storage unit), and a selection unit 144 (selection unit). ) And a filter processing unit 145 (inverse conversion means).

画像バッファ部141は、ラインバッファおよびレジスタ等を備え、撮像素子12から出力される画素を順に入力して、撮像画像をバッファリングする機能部である。画像バッファ部141は、バッファリングした撮像画像を、距離判定部142およびフィルタ処理部145に出力する。   The image buffer unit 141 includes a line buffer, a register, and the like, and is a functional unit that sequentially inputs pixels output from the image sensor 12 and buffers a captured image. The image buffer unit 141 outputs the buffered captured image to the distance determination unit 142 and the filter processing unit 145.

距離判定部142は、撮像画像の輝度値についてのヒストグラムの分散に基づいて、撮像画像における被写体距離を判定する機能部である。距離判定部142の動作については、後述する。   The distance determination unit 142 is a functional unit that determines the subject distance in the captured image based on the variance of the histogram for the luminance value of the captured image. The operation of the distance determination unit 142 will be described later.

記憶部143は、距離判定部142によって判定される被写体距離に対応した逆変換フィルタのデータを予め記憶する記憶装置である。   The storage unit 143 is a storage device that stores data of an inverse transform filter corresponding to the subject distance determined by the distance determination unit 142 in advance.

選択部144は、距離判定部142によって判定された被写体距離に対応した逆変換フィルタを、記憶部143に記憶された逆変換フィルタから選択して、フィルタ処理部145に送る機能部である。   The selection unit 144 is a functional unit that selects an inverse transform filter corresponding to the subject distance determined by the distance determination unit 142 from the inverse transform filters stored in the storage unit 143 and sends the selected inverse transform filter to the filter processing unit 145.

フィルタ処理部145は、画像バッファ部141から出力される画素に対して、選択部144から受け取った逆変換フィルタによって、所定のフィルタ処理(逆変換処理)を行う。本実施の形態においては、フィルタ処理に使用するフィルタとして、位相板LZ4の作用によって点像分布関数(PSF)を与えられたぼけた撮像画像に対して、ぼけを補正(復元)する逆変換処理をするための逆変換フィルタを例に説明する。フィルタ処理部145の具体的な動作については、図16〜18において後述する。   The filter processing unit 145 performs predetermined filter processing (inverse conversion processing) on the pixels output from the image buffer unit 141 using the inverse conversion filter received from the selection unit 144. In the present embodiment, as a filter used for the filter process, an inverse transform process for correcting (restoring) blur for a blurred captured image given a point spread function (PSF) by the action of the phase plate LZ4. An inverse transform filter for performing the above will be described as an example. The specific operation of the filter processing unit 145 will be described later with reference to FIGS.

なお、画像バッファ部141、距離判定部142、記憶部143、選択部144およびフィルタ処理部145は、機能を概念的に示したものであって、このような構成に限定されるものではない。   Note that the image buffer unit 141, the distance determination unit 142, the storage unit 143, the selection unit 144, and the filter processing unit 145 conceptually show functions, and are not limited to such a configuration.

<撮像素子12から出力される画素が画像バッファ部141に入力される動作>
図15は、撮像素子から出力される画素が画像バッファ部に入力される動作を示すタイミングチャートである。図15を参照しながら、撮像素子12によって撮像された画像の出力動作について説明する。
<Operation in which pixels output from the image sensor 12 are input to the image buffer unit 141>
FIG. 15 is a timing chart illustrating an operation in which pixels output from the image sensor are input to the image buffer unit. With reference to FIG. 15, an output operation of an image captured by the image sensor 12 will be described.

撮像素子12は、検出した画素をX方向の1水平ラインずつ走査しながら、その1水平ラインに含まれる画素を出力する。具体的には、撮像素子12は、Y方向の1番目の水平ラインに含まれる画素を、X方向の1番目の画素から640番目の画素まで順に出力する。撮像素子12は、上記の動作を、Y方向の480番目までの水平ラインに含まれる画素の出力をそれぞれ行う。なお、撮像素子12によって撮像される画像の640×480の各画素について、X方向のX番目およびY方向のY番目の画素を(X,Y)の画素というものとする。   The image sensor 12 outputs the pixels included in one horizontal line while scanning the detected pixels one horizontal line in the X direction. Specifically, the imaging device 12 sequentially outputs pixels included in the first horizontal line in the Y direction from the first pixel in the X direction to the 640th pixel. The image sensor 12 outputs the pixels included in the horizontal lines up to the 480th horizontal line in the Y direction, respectively. For each 640 × 480 pixel of the image captured by the image sensor 12, the Xth pixel in the X direction and the Yth pixel in the Y direction are referred to as (X, Y) pixels.

上記の動作を図15に示すタイミングチャートに基づいて説明する。図15に示すように、撮像素子12は、有効フレーム信号がオン状態のとき、1フレーム分、すなわち1画像分の画素を出力する。撮像素子12において、有効フレーム信号がオン状態になってからフレーム開始期間Aを経て、Y方向の1番目の水平ラインの画素の出力許可を示す有効ライン信号L1がオン状態になる。撮像素子12は、有効ライン信号L1がオン状態になっている有効データ期間Tの間に、Y方向の1番目の水平ラインを走査し、その水平ラインに含まれるX方向の1〜640番目の画素((1,1)〜(640,1)の画素)を順に出力する。撮像素子12によってY方向の1番目の水平ラインの画素が出力された後、有効ライン信号L1がオフ状態になる。   The above operation will be described based on the timing chart shown in FIG. As shown in FIG. 15, the imaging device 12 outputs pixels for one frame, that is, one image when the effective frame signal is on. In the image sensor 12, the effective line signal L1 indicating the output permission of the pixels in the first horizontal line in the Y direction is turned on through the frame start period A after the effective frame signal is turned on. The imaging device 12 scans the first horizontal line in the Y direction during the effective data period T in which the effective line signal L1 is on, and the 1st to 640th in the X direction included in the horizontal line. Pixels (pixels (1, 1) to (640, 1)) are output in order. After the image sensor 12 outputs the pixels of the first horizontal line in the Y direction, the effective line signal L1 is turned off.

撮像素子12において、有効ライン信号L1がオフ状態になってから水平ブランキング期間Bを経て、Y方向の2番目の水平ラインの画素の出力許可を示す有効ライン信号L2がオン状態になる。撮像素子12は、有効ライン信号L2がオン状態になっている有効データ期間Tの間に、Y方向の2番目の水平ラインを走査し、その水平ラインに含まれるX方向の1〜640番目の画素((1,2)〜(640,2)の画素)を順に出力する。撮像素子12によってY方向の2番目の水平ラインの画素が出力された後、有効ライン信号L2がオフ状態になる。   In the image sensor 12, after the effective line signal L1 is turned off, the effective line signal L2 indicating the output permission of the pixels in the second horizontal line in the Y direction is turned on after the horizontal blanking period B. The imaging device 12 scans the second horizontal line in the Y direction during the effective data period T in which the effective line signal L2 is in the ON state, and the 1st to 640th in the X direction included in the horizontal line. Pixels (pixels (1, 2) to (640, 2)) are output in order. After the image sensor 12 outputs the pixels of the second horizontal line in the Y direction, the effective line signal L2 is turned off.

撮像素子12は、以上の動作について、有効ライン信号L480がオン状態になっている有効データ期間Tの間に、Y方向の480番目の水平ラインに含まれるX方向の1〜640番目の画素を出力するまで行う。撮像素子12において、有効ライン信号L480がオフ状態になってからフレーム終了期間Cを経て、有効フレーム信号がオフ状態になる。以上の動作によって、撮像素子12による1フレーム分の画素の出力が終了する。また、撮像素子12において、有効フレーム信号がオフ状態になってから垂直ブランキング期間Dを経て、再び有効フレーム信号がオン状態になり、次の1フレーム分の画素の出力が開始される。   With respect to the above operation, the image sensor 12 detects the 1st to 640th pixels in the X direction included in the 480th horizontal line in the Y direction during the effective data period T in which the effective line signal L480 is on. Repeat until output. In the image sensor 12, the effective frame signal is turned off after the frame end period C after the effective line signal L480 is turned off. With the above operation, the output of pixels for one frame by the image sensor 12 is completed. Further, in the image sensor 12, the effective frame signal is turned on again after the vertical blanking period D after the effective frame signal is turned off, and output of pixels for the next one frame is started.

<フィルタ処理部145の動作>
図16は、逆変換フィルタの構成の一例を示す図である。図17は、画像を逆変換フィルタによってフィルタ処理することを説明する図である。図18は、画像において逆変換フィルタのフィルタ処理の対象となる対象部分画像をスキャンする動作を説明する図である。図16〜18を参照しながら、画像処理部14のフィルタ処理部145の逆変換処理について説明する。なお、フィルタ処理部145が用いる逆変換フィルタは、距離判定部142により撮像画像に含まれる被写体の被写体距離が判定され、選択部144によって、距離判定部142により判定された被写体距離に対応するものとして選択された逆変換フィルタであるものとする。
<Operation of Filter Processing Unit 145>
FIG. 16 is a diagram illustrating an example of the configuration of the inverse transform filter. FIG. 17 is a diagram for describing filtering of an image using an inverse transform filter. FIG. 18 is a diagram illustrating an operation of scanning a target partial image that is a target of filter processing of an inverse transform filter in an image. The inverse transformation process of the filter processing unit 145 of the image processing unit 14 will be described with reference to FIGS. Note that the inverse transform filter used by the filter processing unit 145 corresponds to the subject distance determined by the distance determination unit 142 by the distance determination unit 142 and the selection unit 144 determines the subject distance of the subject included in the captured image. It is assumed that the inverse transform filter selected as.

逆変換処理に使用されるフィルタは、例えば、図16に示すように、フィルタ係数a11〜a15、a21〜a25、a31〜a35、a41〜a45およびa51〜a55によって構成されたタップ数が5×5の線形フィルタである逆変換フィルタ121であるものとする。逆変換フィルタ121による逆変換処理の対象となる画像の部分を、図17に示す対象部分画像131であるものとする。対象部分画像131は、画素A11〜A15、A21〜A25、A31〜A35、A41〜A45およびA51〜A55によって構成された5×5の部分画像である。   For example, as shown in FIG. 16, the filter used for the inverse transformation process has a tap number of 5 × 5 configured by filter coefficients a11 to a15, a21 to a25, a31 to a35, a41 to a45, and a51 to a55. It is assumed that the inverse transform filter 121 is a linear filter. It is assumed that the part of the image that is the target of the inverse transform process by the inverse transform filter 121 is the target partial image 131 shown in FIG. The target partial image 131 is a 5 × 5 partial image including pixels A11 to A15, A21 to A25, A31 to A35, A41 to A45, and A51 to A55.

フィルタ処理部145は、図17に示すように、対象部分画像131に対して逆変換フィルタ121によってコンボリューション演算した値、すなわち、図17の式(1)で表される演算値と同一である。コンボリューション演算の演算値は、対象部分画像131の中央に位置する画素である中央データに対して逆変換処理を実行した値となる。すなわち、コンボリューションの演算値は、逆変換処理後の画像において、逆変換処理前の画像の中央データに相当する位置の画素となる。   As shown in FIG. 17, the filter processing unit 145 has the same value as the value obtained by performing the convolution operation on the target partial image 131 by the inverse transform filter 121, that is, the calculated value represented by the equation (1) in FIG. . The calculation value of the convolution calculation is a value obtained by performing an inverse conversion process on the central data that is a pixel located at the center of the target partial image 131. That is, the convolution calculation value is a pixel at a position corresponding to the central data of the image before the inverse transformation process in the image after the inverse transformation process.

次に、フィルタ処理部145の逆変換処理について、図18を参照しながら、画像105においてX方向の水平ラインを走査しながら逆変換処理をする動作の概略を説明する。図18(a)は、フィルタ処理部145が、画像105における(1,1)の画素に対して逆変換フィルタ121によって逆変換処理をする状態を示している。図18(a)に示すように、(1,1)の画素を中央データ135aとしてコンボリューション演算するためには、(1,1)の画素を中央データとする対象部分画像131aと、画像105とが重複している部分の画素が必要になる。すなわち、対象部分画像131aのうち、図17に示す対象部分画像131の画素A33〜A35、A43〜A45およびA53〜A55に相当する画素が必要である。そして、対象部分画像131aにおいて、画像105と重複していない部分の画素は「0」として取り扱うものとする。   Next, with regard to the inverse conversion process of the filter processing unit 145, an outline of an operation of performing the inverse conversion process while scanning the horizontal line in the X direction in the image 105 will be described with reference to FIG. FIG. 18A shows a state in which the filter processing unit 145 performs an inverse transform process on the (1, 1) pixel in the image 105 by the inverse transform filter 121. As shown in FIG. 18A, in order to perform the convolution operation with the pixel (1, 1) as the central data 135a, the target partial image 131a having the pixel (1, 1) as the central data, and the image 105 The pixel of the part which overlaps with is required. That is, among the target partial image 131a, pixels corresponding to the pixels A33 to A35, A43 to A45, and A53 to A55 of the target partial image 131 shown in FIG. 17 are necessary. In the target partial image 131a, the pixel of the portion that does not overlap with the image 105 is handled as “0”.

以上の状態において、フィルタ処理部145は、図17に示したコンボリューション演算と同様に、対象部分画像131aに対して逆変換フィルタ121によってコンボリューション演算を行う。フィルタ処理部145は、画像105の対象部分画像131aの中央データ135aである(1,1)の画素に対してコンボリューション演算した値を、逆変換処理後の画像の(1,1)の画素として出力する。   In the above state, the filter processing unit 145 performs the convolution operation on the target partial image 131a by the inverse transform filter 121, similarly to the convolution operation illustrated in FIG. The filter processing unit 145 performs a convolution operation on the (1, 1) pixel that is the central data 135a of the target partial image 131a of the image 105, and the (1, 1) pixel of the image after the inverse transformation process. Output as.

次に、フィルタ処理部145は、図18(b)に示すように、コンボリューション演算の対象となる画素をX方向にひとつシフトし、対象部分画像131bの中央データ135bである(2,1)の画素に対して逆変換処理をする。そして、フィルタ処理部145は、X方向の水平ラインをシフトしながらコンボリューション演算を繰り返し、図18(c)に示すように、X方向の水平ラインの最後の画素である(640,1)の画素に対して逆変換処理をする。(640,1)の画素は、図18(c)に示すように、対象部分画像131cの中央データ135cである。   Next, as shown in FIG. 18B, the filter processing unit 145 shifts the pixel subject to the convolution operation by one in the X direction, and is the central data 135b of the target partial image 131b (2, 1). The inverse conversion process is performed on the pixels. The filter processing unit 145 repeats the convolution operation while shifting the horizontal line in the X direction, and as shown in FIG. 18C, is the last pixel of the horizontal line in the X direction (640, 1). Inverse conversion processing is performed on the pixel. The pixel (640, 1) is the central data 135c of the target partial image 131c, as shown in FIG.

以上のように、フィルタ処理部145は、X方向の水平ラインをシフトしながらコンボリューション演算を繰り返し、水平ラインの最後の画素に対する逆変換処理が終了すると、Y方向の次の水平ラインに対して同様に逆変換処理を行う。   As described above, the filter processing unit 145 repeats the convolution operation while shifting the horizontal line in the X direction, and when the inverse conversion process for the last pixel in the horizontal line is completed, the filter processing unit 145 applies the next horizontal line in the Y direction. Similarly, reverse conversion processing is performed.

図18(d)〜18(f)は、フィルタ処理部145が、画像105におけるY方向の4番目の水平ラインの画素に対して逆変換処理を行う状態を示している。図18(d)は、フィルタ処理部145が、画像105における(1,4)の画素に対して逆変換フィルタ121によって逆変換処理をする状態を示している。図18(d)に示すように、(1,4)の画素を中央データ135dとしてコンボリューション演算するためには、(1,4)の画素を中央データとする対象部分画像131dと、画像105とが重複している部分の画素が必要になる。そして、対象部分画像131dにおいて、画像105と重複していない部分の画素は、上述と同様に「0」として取り扱うものとする。   FIGS. 18D to 18F show a state in which the filter processing unit 145 performs an inverse conversion process on the pixels in the fourth horizontal line in the Y direction in the image 105. FIG. 18D shows a state in which the filter processing unit 145 performs inverse conversion processing on the (1, 4) pixels in the image 105 by the inverse conversion filter 121. As shown in FIG. 18D, in order to perform the convolution operation with the pixel of (1, 4) as the central data 135d, the target partial image 131d having the pixel of (1, 4) as the central data, and the image 105 The pixel of the part which overlaps with is required. In the target partial image 131d, the pixel in the portion that does not overlap with the image 105 is handled as “0” as described above.

図18(e)は、フィルタ処理部145が、画像105における(5,4)の画素に対して逆変換フィルタ121によって逆変換処理をする状態を示している。図18(e)に示すように、(5,4)の画素を中央データ135eとする対象部分画像131eは全体が画像105と重複しているので、フィルタ処理部145は、対象部分画像131eに含まれる画素をすべて利用した逆変換処理が可能となる。   FIG. 18E shows a state in which the filter processing unit 145 performs an inverse transform process on the pixel (5, 4) in the image 105 by the inverse transform filter 121. As shown in FIG. 18E, since the entire target partial image 131e having the pixel (5, 4) as the central data 135e overlaps with the image 105, the filter processing unit 145 adds the target partial image 131e to the target partial image 131e. Inverse conversion processing using all the included pixels is possible.

そして、フィルタ処理部145は、X方向の水平ラインをシフトしながらコンボリューション演算を繰り返し、図18(f)に示すように、X方向の水平ラインの最後の画素である(640,4)の画素に対して逆変換処理をする。(640,4)の画素は、図18(f)に示すように、対象部分画像131fの中央データ135fである。   Then, the filter processing unit 145 repeats the convolution calculation while shifting the horizontal line in the X direction, and, as shown in FIG. 18 (f), is the last pixel of the horizontal line in the X direction (640, 4). Inverse conversion processing is performed on the pixel. The pixel (640, 4) is the central data 135f of the target partial image 131f as shown in FIG.

以上のように、フィルタ処理部145は、画像105を構成する各画素に対して逆変換フィルタ121によるコンボリューション演算を行って逆変換処理をするので、位相板LZ4によってぼけた画像を復元し、画像の解像度を向上させることができる。   As described above, the filter processing unit 145 performs a convolution operation by the inverse transform filter 121 on each pixel constituting the image 105 and performs an inverse transform process, so that the image blurred by the phase plate LZ4 is restored. The resolution of the image can be improved.

なお、上述のように、画像105における逆変換フィルタ121によるコンボリューション演算の対象となる対象部分画像について、画像105と重複していない部分の画素は「0」としたが、これに限定されるものではない。例えば、対象部分画像の画像105と重複していない部分の画素は、対象部分画像の中央データを基準にして、対象部分画像の画像105と重複している部分の画素を折り返した場合の画素を用いるものとしてもよい。   As described above, in the target partial image that is the target of the convolution operation by the inverse transform filter 121 in the image 105, the pixel of the portion that does not overlap with the image 105 is set to “0”, but is not limited thereto. It is not a thing. For example, the pixel of the portion that does not overlap with the image 105 of the target partial image is the pixel when the pixel of the portion that overlaps with the image 105 of the target partial image is folded with reference to the center data of the target partial image. It may be used.

具体的に、図18(a)の対象部分画像131aを例にして説明する。対象部分画像131aのそれぞれの画素の名称を、仮に図17に示す対象部分画像131の画素の名称と同様とする。この場合、対象部分画像131aの画像105と重複していない部分の画素は、画素A11〜A15、A21〜A25、A31、A32、A41、A42、A51およびA52である。また、対象部分画像131aの画像105と重複している部分の画素は、画素A33〜A35、A43〜A45およびA53〜A55である。   Specifically, the target partial image 131a in FIG. 18A will be described as an example. The names of the pixels of the target partial image 131a are assumed to be the same as the names of the pixels of the target partial image 131 shown in FIG. In this case, the pixel of the part which does not overlap with the image 105 of the object partial image 131a is the pixels A11 to A15, A21 to A25, A31, A32, A41, A42, A51 and A52. In addition, the pixels of the portion overlapping the image 105 of the target partial image 131a are pixels A33 to A35, A43 to A45, and A53 to A55.

このとき、画素A31、A32、A41、A42、A51およびA52は、中央データを基準にして、対象部分画像131aの画像105と重複している部分の画素を折り返し、それぞれ画素A35、A34、A45、A44、A55およびA54の値を用いる。また、画素A13〜A15およびA23〜A25は、中央データを基準にして、対象部分画像131aの画像105と重複している部分の画素を折り返し、それぞれ画素A53〜A55およびA43〜A45の値を用いる。そして、画素A11、A12、A21およびA22は、中央データを基準にして、対象部分画像131aの画像105と重複している部分の画素のうち点対象の位置関係にある画素、すなわち、それぞれA55、A54、A45およびA44の値を用いる。以上のような方法によって、対象部分画像の各画素を決定するものとしてもよい。   At this time, the pixels A31, A32, A41, A42, A51, and A52 fold back the pixels that overlap the image 105 of the target partial image 131a with reference to the central data, and the pixels A35, A34, A45, The values A44, A55 and A54 are used. In addition, the pixels A13 to A15 and A23 to A25 fold back the pixels that overlap the image 105 of the target partial image 131a with reference to the central data, and use the values of the pixels A53 to A55 and A43 to A45, respectively. . Then, the pixels A11, A12, A21, and A22 are pixels in a point target positional relationship among the pixels of the portion overlapping the image 105 of the target partial image 131a with respect to the central data, that is, A55, The values of A54, A45 and A44 are used. Each pixel of the target partial image may be determined by the above method.

また、図17に示すように、フィルタ処理部145が用いる逆変換フィルタ121はタップ数が5×5のフィルタとしているが、これに限定されるものではない。すなわち、フィルタのタップ数は7×7、15×15または21×21等の異なるタップ数としてもよい。この場合、フィルタのタップ数に合わせて、対象部分画像の大きさも一致させる必要がある。また、フィルタによる逆変換処理の対象となる中央データが存在するように、フィルタのタップ数は奇数である必要がある。   Further, as shown in FIG. 17, the inverse transform filter 121 used by the filter processing unit 145 is a filter having 5 × 5 taps, but is not limited thereto. That is, the number of taps of the filter may be a different number of taps such as 7 × 7, 15 × 15, or 21 × 21. In this case, it is necessary to match the size of the target partial image according to the number of taps of the filter. In addition, the number of taps of the filter needs to be an odd number so that there is central data to be subjected to the inverse transformation process by the filter.

また、逆変換フィルタは、例えば15×15以上のタップ数であることが好ましい。逆変換フィルタは、タップ数が多いほど、位相板LZ4によってぼけが加えられた画像に対して、ぼけを補正できる光軸上の幅を大きくすることができる。したがって、タップ数が多い逆変換フィルタを用いることによって、位相板およびレンズの被写界深度についての設計のバリエーションを増やすことができる。   In addition, the inverse transform filter preferably has a tap number of 15 × 15 or more, for example. As the number of taps increases, the inverse transform filter can increase the width on the optical axis where blur can be corrected with respect to an image in which blur is added by the phase plate LZ4. Therefore, by using an inverse transform filter having a large number of taps, it is possible to increase design variations with respect to the depth of field of the phase plate and the lens.

<逆変換フィルタの周波数特性の導出>
次に、上述の逆変換フィルタ(例えば、図17に示す逆変換フィルタ121)の周波数特性を導出する方法について説明する。フォーカス位置(例えば、上述のベストフォーカス位置)において光学系であるレンズユニット11によって拡散されたPSFを一点に集まるように復元する逆変換処理に使用される逆変換フィルタの周波数特性の導出方法について説明する。上述の周波数特性を実現するフィルタとしては、二次元の線形フィルタかつFIR(Finite Impulse Response)フィルタが好適である。
<Derivation of frequency characteristics of inverse transform filter>
Next, a method for deriving the frequency characteristics of the above-described inverse transform filter (for example, the inverse transform filter 121 shown in FIG. 17) will be described. A method for deriving the frequency characteristics of the inverse transform filter used in the inverse transform processing for restoring the PSF diffused by the lens unit 11 as the optical system so as to be gathered at one point at the focus position (for example, the best focus position described above) will be described. To do. As the filter that realizes the above-described frequency characteristic, a two-dimensional linear filter and an FIR (Finite Impulse Response) filter are suitable.

まず、撮像素子12によって撮像された画像への光学系による影響のモデルを以下の式(2)に示す2次元のコンボリューション演算(畳み込み演算)の式によって表す。
First, a model of the influence of the optical system on an image captured by the image sensor 12 is expressed by a two-dimensional convolution calculation (convolution calculation) expression shown in the following expression (2).

ここで、imagecapturedは光学系を通って検出された二次元の撮像画像の画素であり、imageidealは被写体4そのものを示す理想画像の画素であり、hは光学系のPSFを示す。 Here, image captured is a pixel of a two-dimensional captured image detected through the optical system, image ideal is a pixel of an ideal image showing the subject 4 itself, and h is a PSF of the optical system.

以下、画像処理系(撮像素子12および画像処理部14)に加わるノイズの影響を考慮して、逆変換処理後の画像の各画素と、理想画像の各画素との誤差についての平均二乗誤差を最小とする逆変換フィルタの周波数特性の導出を考える。平均二乗誤差は、以下の式(3)によって表される。
Hereinafter, in consideration of the influence of noise applied to the image processing system (the image sensor 12 and the image processing unit 14), the mean square error regarding the error between each pixel of the image after the inverse transformation process and each pixel of the ideal image is calculated. Consider the derivation of the frequency characteristics of the inverse transform filter to be minimized. The mean square error is expressed by the following equation (3).

ここで、E[]は期待値(平均値)を示し、nは画像上の位置を示し、imageprocessed(n)は、imagecaptured(n)に対して逆変換処理をした画素を示す。なお、imagecapturedは、ノイズが含まれていることを考慮する。 Here, E [] indicates an expected value (average value), n indicates a position on the image, and image processed (n) indicates a pixel obtained by performing an inverse conversion process on image captured (n). Note that image captured considers that noise is included.

波形x(n)が持つ全エネルギーのnの全領域についての総和と、波形x(n)のエネルギーのフーリエ変換X(ω)の全周波数成分についての総和とが等しいとするパーセバルの定理より、式(3)は、周波数領域における平均二乗誤差として以下の式(4)で表される。
According to Parseval's theorem that the sum of all the energies of the waveform x (n) for all regions of n and the sum of all the frequency components of the Fourier transform X (ω) of the energy of the waveform x (n) are equal. Expression (3) is expressed by the following expression (4) as a mean square error in the frequency domain.

ここで、IMAGEideal(ω)はimageideal(n)の周波数特性を示し、IMAGEprocessed(ω)はimageprocessed(n)の周波数特性を示し、ωは空間周波数を示す。 Here, IMAGE ideal (ω) represents the frequency characteristic of image ideal (n), IMAGE processed (ω) represents the frequency characteristic of image processed (n), and ω represents the spatial frequency.

ここで、逆変換フィルタの周波数特性をR(ω)とすると、以下の式(5)の最小値を与える周波数特性R(ω)が最適の逆変換フィルタとなる。
Here, if the frequency characteristic of the inverse transform filter is R (ω), the frequency characteristic R (ω) that gives the minimum value of the following equation (5) is the optimum inverse transform filter.

ここで、IMAGEcaptured(ω)は、imagecaptured(n)の周波数特性である。 Here, IMAGE captured (ω) is the frequency characteristic of image captured (n).

式(5)において、IMAGEideal(ω)=S(ω)、およびIMAGEcaptured(ω)=X(ω)とし、式(5)の最小値を求めるため、式(5)をRによって微分すると、下記の式(6)が得られる。
In Equation (5), IMAGE ideal (ω) = S (ω) and IMAGE captured (ω) = X (ω), and in order to find the minimum value of Equation (5), Equation (5) is differentiated by R * Then, the following formula (6) is obtained.

ここで、E[|X(ω)|]は、ノイズを含んだ撮像画像のパワースペクトルの平均値であり、E[S(ω)・X(ω)]は、ノイズを含んだ撮像画像と理想画像との相互パワースペクトルの平均値である。 Here, E [| X (ω) | 2 ] is an average value of the power spectrum of the captured image including noise, and E [S (ω) · X (ω) * ] is an image including noise. It is the average value of the mutual power spectrum between the image and the ideal image.

式(5)の最小値を求めるため式(6)の最右辺を0とすると下記の式(7)が得られる。
In order to obtain the minimum value of the equation (5), when the rightmost side of the equation (6) is 0, the following equation (7) is obtained.

式(7)から下記の式(8)が得られる。
From the equation (7), the following equation (8) is obtained.

この式(8)に示す周波数特性R(ω)に基づく逆変換フィルタが、上述の式(3)に示す平均二乗誤差を最小とする最適のフィルタとなる。   The inverse transform filter based on the frequency characteristic R (ω) shown in the equation (8) is an optimum filter that minimizes the mean square error shown in the equation (3).

ここで、ノイズの周波数特性をW(ω)とし、光学系のPSFであるhの周波数特性をH(ω)として、上述の式(2)を周波数領域で示すと下記の式(9)で示される。
Here, when the frequency characteristic of noise is W (ω), the frequency characteristic of h that is the PSF of the optical system is H (ω), and the above equation (2) is shown in the frequency domain, the following equation (9) is obtained. Indicated.

ノイズの周波数特性W(ω)と、周波数特性S(ω)とが無相関であるとすると、E[S(ω)・W(ω)]=0であるので、上述の式(8)の右辺の分子に、式(9)を代入すると、下記の式(10)が得られる。
Assuming that the noise frequency characteristic W (ω) and the frequency characteristic S (ω) are uncorrelated, E [S (ω) · W (ω) * ] = 0. Substituting equation (9) into the numerator on the right side of the following equation (10) is obtained.

同じくノイズの周波数特性W(ω)と、周波数特性S(ω)とが無相関であるとすると、E[W(ω)・S(ω)]=0およびE[S(ω)・W(ω)]=0であるので、上述の式(8)の右辺の分母に、式(9)を代入すると、下記の式(11)が得られる。
Similarly, if the frequency characteristic W (ω) of noise and the frequency characteristic S (ω) are uncorrelated, E [W (ω) · S (ω) * ] = 0 and E [S (ω) * · Since W (ω)] = 0, substituting equation (9) into the denominator on the right side of equation (8) above yields equation (11) below.

上述の式(8)、(10)および(11)から、下記の式(12)に示す周波数特性R(ω)が得られる。
From the above equations (8), (10) and (11), the frequency characteristic R (ω) shown in the following equation (12) is obtained.

この式(12)に示す周波数特性R(ω)に基づく逆変換フィルタが、画像処理系のノイズを考慮した場合の上述の式(3)に示す平均二乗誤差を最小とする最適なフィルタとなる。ここで、E[|S(ω)|]は理想画像のパワースペクトルの平均値であり、E[|W(ω)|]はノイズのパワースペクトルの平均値であり、|H(ω)|は光学系の周波数特性のパワースペクトルである。 The inverse transform filter based on the frequency characteristic R (ω) shown in the equation (12) is an optimum filter that minimizes the mean square error shown in the above equation (3) when the noise of the image processing system is taken into consideration. . Here, E [| S (ω) | 2 ] is the average value of the power spectrum of the ideal image, E [| W (ω) | 2 ] is the average value of the power spectrum of noise, and | H (ω ) | 2 is the power spectrum of the frequency characteristic of the optical system.

また、上述の式(12)に示す周波数特性R(ω)を適用した場合において、逆変換処理後の画像の各画素と、理想画像の各画素との二乗誤差についての周波数領域における積分を取ると、下記の式(13)が得られる。
Further, when the frequency characteristic R (ω) shown in the above equation (12) is applied, an integration in the frequency domain is performed for the square error between each pixel of the image after the inverse transform process and each pixel of the ideal image. The following formula (13) is obtained.

上記の式(13)の演算においては、上述のように、ノイズの周波数特性W(ω)と、周波数特性S(ω)とが無相関であることを利用している式(13)の最右辺の第1項は、逆変換処理後の画像の復元しきれなかった誤差量を示している。第2項は、ノイズによる誤差量を示している。   In the calculation of the above equation (13), as described above, the maximum of the equation (13) using the fact that the noise frequency characteristic W (ω) and the frequency characteristic S (ω) are uncorrelated. The first term on the right side indicates the amount of error that could not be restored in the image after the inverse transformation process. The second term indicates the amount of error due to noise.

式(13)の積分値が最小となるように、光学系の周波数特性H(ω)を設計することによって、上述の式(5)に示す周波数領域においての平均二乗誤差が最小となる光学系および逆変換フィルタの組み合わせを得ることができる。また、パーセバルの定理より、上述の式(3)に示す実空間における平均二乗誤差が最小となる光学系および逆変換フィルタの組み合わせを得ることができる。したがって、式(12)に示す周波数特性R(ω)に基づいて、例えば、画像処理部14のフィルタ処理部145が用いる逆変換フィルタ121を導出するものとすればよい。   By designing the frequency characteristic H (ω) of the optical system so that the integral value of Expression (13) is minimized, the optical system that minimizes the mean square error in the frequency domain shown in Expression (5) above. And a combination of inverse transform filters. Further, according to Parseval's theorem, it is possible to obtain a combination of an optical system and an inverse transform filter that minimize the mean square error in the real space shown in the above equation (3). Therefore, for example, the inverse transform filter 121 used by the filter processing unit 145 of the image processing unit 14 may be derived based on the frequency characteristic R (ω) shown in Expression (12).

以上のように、フォーカス位置について、式(12)に示す周波数特性R(ω)から最適な逆変換フィルタを求めることができる。これによって、フォーカス位置においてより広い範囲にまでぼけを復元し、被写界深度を拡張することができる。   As described above, an optimum inverse transform filter can be obtained for the focus position from the frequency characteristic R (ω) shown in Expression (12). As a result, the blur can be restored to a wider range at the focus position, and the depth of field can be extended.

図19は、実施の形態の画像処理部のフィルタ処理部の逆変換フィルタを決定するための周波数特性を演算する流れの一例を示すフローチャートである。図19を参照しながら、式(12)に示す周波数特性Rを具体的に演算する流れについて説明する。   FIG. 19 is a flowchart illustrating an example of a flow of calculating a frequency characteristic for determining an inverse transform filter of the filter processing unit of the image processing unit according to the embodiment. A flow for specifically calculating the frequency characteristic R shown in the equation (12) will be described with reference to FIG.

<<ステップS1>>
まず、レンズユニット11における面曲率および面間隔等、ならびに位相板LZ4の特性等の光学系パラメータに基づいて、レンズユニット11に対する光線追跡演算によりPSFを導出する。ここで、複数のデフォーカス位置における光学系パラメータによって光線追跡演算を行い、PSFを導出する。そして、ステップS2へ進む。
<< Step S1 >>
First, the PSF is derived by ray tracing calculation for the lens unit 11 based on the optical system parameters such as the surface curvature and surface interval in the lens unit 11 and the characteristics of the phase plate LZ4. Here, a ray tracing calculation is performed using optical system parameters at a plurality of defocus positions to derive a PSF. Then, the process proceeds to step S2.

<<ステップS2>>
ステップS1で導出したPSFをフーリエ変換することによって、光学系の周波数特性Hを導出する。そして、ステップS5へ進む。
<< Step S2 >>
The frequency characteristic H of the optical system is derived by Fourier transforming the PSF derived in step S1. Then, the process proceeds to step S5.

<<ステップS3>>
画像処理系(撮像素子12および画像処理部14)に加わるノイズ特性を測定する。そして、ノイズ特性をフーリエ変換することによって、ノイズの周波数特性Wを導出する。なお、ノイズ特性の測定が困難である場合は、空間周波数によらず、撮像素子12のS/N比の値を定数としてノイズの周波数特性Wを導出するものとしてもよい。そして、ステップS5へ進む。
<< Step S3 >>
Noise characteristics applied to the image processing system (the image sensor 12 and the image processing unit 14) are measured. Then, the noise frequency characteristic W is derived by Fourier transforming the noise characteristic. If it is difficult to measure the noise characteristic, the noise frequency characteristic W may be derived using the value of the S / N ratio of the image sensor 12 as a constant regardless of the spatial frequency. Then, the process proceeds to step S5.

<<ステップS4>>
撮像装置1により、自然風景またはシンボル等を様々な大きさおよび撮影条件によって撮像された画像を理想画像とする。理想画像を構成する画素の値をフーリエ変換し、空間周波数ωについての平均値を被写体の周波数特性Sとして導出する。なお、被写体の周波数特性Sは、被写体から出る光に収差を与えない光学系を通過した光に基づく撮像画像の画素の周波数特性としてもよい。また、被写体の周波数特性Sは、定数としてもよい。そして、ステップS5へ進む。
<< Step S4 >>
An image obtained by capturing an image of a natural landscape or a symbol with various sizes and photographing conditions by the imaging device 1 is set as an ideal image. The values of the pixels constituting the ideal image are Fourier transformed, and the average value for the spatial frequency ω is derived as the frequency characteristic S of the subject. The frequency characteristic S of the subject may be a frequency characteristic of a pixel of a captured image based on light that has passed through an optical system that does not give aberration to light emitted from the subject. The frequency characteristic S of the subject may be a constant. Then, the process proceeds to step S5.

<<ステップS5>>
ステップS2で導出した光学系の周波数特性H、ステップS3で導出したノイズの周波数特性W、およびステップS4で導出した被写体の周波数特性Sから、上述の式(12)を使用して、逆変換フィルタの周波数特性Rを演算する。
<< Step S5 >>
From the frequency characteristic H of the optical system derived in step S2, the frequency characteristic W of noise derived in step S3, and the frequency characteristic S of the subject derived in step S4, the inverse transformation filter is obtained using the above-described equation (12). Is calculated.

<MTFの空間周波数特性>
図20は、光学系を通過した光による撮像画像の空間周波数特性の一例を示す図である。図21は、逆変換処理が行われた画像の空間周波数特性を示す図である。図22は、ベストフォーカス位置の被写体に対する逆変換フィルタによってフィルタ処理した二次元コードの画像例を示す図である。図20〜22を参照しながら、画像のMTFの空間周波数特性について説明する。
<Spatial frequency characteristics of MTF>
FIG. 20 is a diagram illustrating an example of a spatial frequency characteristic of a captured image by light that has passed through the optical system. FIG. 21 is a diagram illustrating the spatial frequency characteristics of an image that has been subjected to inverse transformation processing. FIG. 22 is a diagram illustrating an example of an image of a two-dimensional code that has been filtered by an inverse transform filter for the subject at the best focus position. The spatial frequency characteristics of the MTF of the image will be described with reference to FIGS.

まず、図20を参照しながら、レンズユニット11(光学系)を通過した光が撮像素子12によって撮像された画像についての空間周波数ωに対するMTFについてさらに説明する。図20に示される目標空間周波数特性201は、被写体の撮像画像のコントラストが完全に再現された場合のMTFの空間周波数ωについての特性(MTF=1)を示す。   First, with reference to FIG. 20, the MTF for the spatial frequency ω for an image in which light that has passed through the lens unit 11 (optical system) is captured by the image sensor 12 will be further described. A target spatial frequency characteristic 201 shown in FIG. 20 indicates a characteristic (MTF = 1) regarding the spatial frequency ω of the MTF when the contrast of the captured image of the subject is completely reproduced.

上述したように、レンズユニット11を通過した光は、収差を与えるレンズおよび位相板LZ4の作用によって点像分布関数(PSF)が拡散される。図20における空間周波数特性202は、レンズユニット11を通過した光に基づいて、撮像素子12によりフォーカス位置において撮像された撮像画像のMTFの空間周波数ωについての特性を示す。図20における空間周波数特性203は、レンズユニット11を通過した光に基づいて撮像素子12によってあるデフォーカス位置において撮像された撮像画像のMTFの空間周波数ωについての特性を示す。レンズユニット11を通過した光はPSFが付加されているので、フォーカス位置における空間周波数特性202、およびデフォーカス位置における空間周波数特性203は、図20に示すように、何れも目標空間周波数特性201よりも低い値となる。この図20に示す空間周波数特性202、203は、上述の図9〜11に示したMTFの特性の実施例を模式的に示したものである。   As described above, the point spread function (PSF) is diffused in the light that has passed through the lens unit 11 by the action of the lens that gives aberration and the phase plate LZ4. A spatial frequency characteristic 202 in FIG. 20 indicates a characteristic with respect to the spatial frequency ω of the MTF of a captured image captured at the focus position by the image sensor 12 based on the light that has passed through the lens unit 11. A spatial frequency characteristic 203 in FIG. 20 indicates a characteristic with respect to the spatial frequency ω of the MTF of a captured image captured at a certain defocus position by the image sensor 12 based on the light that has passed through the lens unit 11. Since PSF is added to the light that has passed through the lens unit 11, the spatial frequency characteristic 202 at the focus position and the spatial frequency characteristic 203 at the defocus position are both from the target spatial frequency characteristic 201 as shown in FIG. Is also a low value. The spatial frequency characteristics 202 and 203 shown in FIG. 20 schematically show examples of the MTF characteristics shown in FIGS. 9 to 11 described above.

次に、図21を参照しながら、フィルタ処理部145がフォーカス位置の被写体の撮像画像に対して逆変換処理するための逆変換フィルタが、上述の式(12)に示す周波数特性Rによって求められた場合を考える。この場合において、撮像素子12によって撮像された画像がフィルタ処理部145によって逆変換処理が行われた画像についての空間周波数ωに対するMTFについて説明する。   Next, referring to FIG. 21, an inverse conversion filter for the filter processing unit 145 to perform inverse conversion processing on the captured image of the subject at the focus position is obtained by the frequency characteristic R shown in the above equation (12). Consider the case. In this case, the MTF for the spatial frequency ω for an image obtained by performing an inverse transform process on the image captured by the image sensor 12 by the filter processing unit 145 will be described.

図21における空間周波数特性202aは、撮像素子12により被写体がフォーカス位置において撮像された撮像画像について、フィルタ処理部145により逆変換処理された画像のMTFの空間周波数ωについての特性を模式的に示したものである。図21における空間周波数特性203aは、撮像素子12によりあるデフォーカス位置において撮像された撮像画像について、フィルタ処理部145により同じ逆変換フィルタで逆変換処理された画像のMTFの空間周波数ωについての特性を示す。上述のように、式(12)は、フォーカス位置の被写体についての、レンズユニット11によってPSFが付加された画像を復元する逆変換フィルタの周波数特性Rを示すので、空間周波数特性202aは、MTF=1となり、目標空間周波数特性201と一致する。しかし、式(12)に示す周波数特性Rから導出された逆変換フィルタは、フォーカス位置におけるPSFとは形の異なるデフォーカス位置には対応していないので、空間周波数特性203aのMTFは、空間周波数特性202aのMTFよりも低くなる。   A spatial frequency characteristic 202a in FIG. 21 schematically shows a characteristic regarding the spatial frequency ω of the MTF of an image obtained by performing inverse transform processing on the captured image in which the subject is captured at the focus position by the image sensor 12. It is a thing. The spatial frequency characteristic 203a in FIG. 21 is a characteristic regarding the spatial frequency ω of the MTF of an image obtained by performing inverse transformation processing with the same inverse transformation filter by the filter processing unit 145 on a captured image taken at a certain defocus position by the imaging element 12. Indicates. As described above, since the equation (12) represents the frequency characteristic R of the inverse transform filter that restores the image to which the PSF is added by the lens unit 11 for the subject at the focus position, the spatial frequency characteristic 202a is MTF = 1 and coincides with the target spatial frequency characteristic 201. However, since the inverse transform filter derived from the frequency characteristic R shown in Expression (12) does not correspond to a defocus position different in shape from the PSF at the focus position, the MTF of the spatial frequency characteristic 203a is the spatial frequency. It becomes lower than the MTF of the characteristic 202a.

このように、フィルタ処理部145は、式(12)に示す周波数特性R(ω)に基づいて求められた逆変換フィルタによる逆変換処理によって、フォーカス位置を含む所定の位置範囲において、レンズユニット11によってPSFが拡散された画像を復元することができる。しがたって、フォーカス位置においてより広い範囲にまで被写界深度を拡張することができる。   As described above, the filter processing unit 145 performs the lens unit 11 in a predetermined position range including the focus position by the inverse transformation process using the inverse transformation filter obtained based on the frequency characteristic R (ω) shown in Expression (12). Thus, an image in which PSF is diffused can be restored. Therefore, the depth of field can be extended to a wider range at the focus position.

この空間周波数特性202a、203aが示す特性を、二次元コードの画像として示したのが図22に示す画像である。図22に示す画像は、フィルタ処理部145が、フォーカス位置(ベストフォーカス位置である被写体距離400[mm])に存在する被写体(二次元バーコード)についての撮像画像のぼけを復元するために、式(12)により求められた逆変換フィルタを用いて、フォーカス位置およびデフォーカス位置に存在する被写体の撮像画像に対して逆変換処理を実行した画像である。このうち、図22(b)に示す画像は、被写体距離が400[mm]のフォーカス位置(ベストフォーカス位置)に存在する二次元コードを被写体として撮像された画像が、フィルタ処理部145により上述の逆変換フィルタにより逆変換処理が実行された画像である。一方、図22(a)および22(c)に示す画像は、それぞれ被写体距離が350[mm]および470[mm]のデフォーカス位置に存在する二次元コードを被写体として撮像された画像が、フィルタ処理部145により上述と同一の逆変換フィルタにより逆変換処理が実行された画像である。図22(b)に示す画像は、フォーカス位置の被写体の撮像画像のぼけを復元するための逆変換フィルタによって逆変換処理がなされているので、図22(a)および22(c)に示す画像よりも、二次元コードの模様が明瞭となっている。これに対し、図22(a)および22(c)に示す画像は、デフォーカス位置の被写体の撮像画像に対して、フォーカス位置の被写体の撮像画像のぼけを復元するための逆変換フィルタによって逆変換処理がなされているため、図22(b)に示す画像よりも、二次元コードの模様が不明瞭となっている。これは、被写体距離が変わることによってPSFの形も変わるため、同一の逆変換フィルタでは対応し切れないためである。ここで、本実施の形態に係る画像処理部14は、デフォーカス位置に存在する被写体の撮像画像に対しても、MTFが改善するように復元する。その動作の詳細を以下に説明する。   The image shown in FIG. 22 shows the characteristics indicated by the spatial frequency characteristics 202a and 203a as a two-dimensional code image. In the image shown in FIG. 22, the filter processing unit 145 restores the blur of the captured image of the subject (two-dimensional barcode) existing at the focus position (subject distance 400 [mm] which is the best focus position). This is an image obtained by performing an inverse transformation process on a captured image of a subject existing at a focus position and a defocus position using an inverse transformation filter obtained by Expression (12). Among these images, the image shown in FIG. 22B is an image obtained by capturing an image of a two-dimensional code existing at a focus position (best focus position) with a subject distance of 400 [mm] by the filter processing unit 145 as described above. It is an image that has been subjected to inverse transformation processing by an inverse transformation filter. On the other hand, the images shown in FIGS. 22 (a) and 22 (c) are obtained by filtering the images obtained by taking the two-dimensional code existing at the defocus positions with the subject distances of 350 [mm] and 470 [mm] as subjects. This is an image that has been subjected to inverse transformation processing by the processing unit 145 using the same inverse transformation filter as described above. Since the image shown in FIG. 22B has been subjected to inverse transformation processing by an inverse transformation filter for restoring the blur of the captured image of the subject at the focus position, the images shown in FIGS. 22A and 22C are used. The pattern of the two-dimensional code is clearer. On the other hand, the images shown in FIGS. 22A and 22C are reversed by the inverse transform filter for restoring the blur of the captured image of the subject at the focus position with respect to the captured image of the subject at the defocus position. Since the conversion process is performed, the pattern of the two-dimensional code is less clear than the image shown in FIG. This is because the PSF shape changes as the subject distance changes, and the same inverse transform filter cannot cope with it. Here, the image processing unit 14 according to the present embodiment restores the captured image of the subject existing at the defocus position so that the MTF is improved. Details of the operation will be described below.

<距離判定部142および選択部144の動作>
図23は、被写体距離が350[mm]および470[mm]の被写体に対して適用する逆変換フィルタの構成の一例を示す図である。図24は、被写体距離に対応した逆変換フィルタによってそれぞれフィルタ処理した二次元コードの画像例を示す図である。図23および24を参照しながら、デフォーカス位置の被写体の撮像画像に対する逆変換処理について説明する。
<Operation of Distance Determination Unit 142 and Selection Unit 144>
FIG. 23 is a diagram illustrating an example of a configuration of an inverse transform filter applied to a subject whose subject distance is 350 [mm] and 470 [mm]. FIG. 24 is a diagram illustrating an example of a two-dimensional code image that has been filtered by an inverse transform filter corresponding to a subject distance. With reference to FIGS. 23 and 24, the inverse conversion process for the captured image of the subject at the defocus position will be described.

上述において、フォーカス位置においてレンズユニット11により拡散されたPSFを一点に集まるように復元する逆変換フィルタを導出するために、式(12)に示す周波数特性R(ω)を導出した。上述のように、フォーカス位置における被写体の撮像画像のぼけに対しては、この周波数特性R(ω)に基づく逆変換フィルタにより逆変換処理が実行されれば、適切に復元することが可能となる。しかし、この逆変換フィルタを、デフォーカス位置における被写体の撮像画像に対して適用しても、適切に復元することはできない。そこで、デフォーカス位置における被写体の撮像画像のぼけを復元するために、式(12)を用いて、デフォーカス位置において拡散されたPSFに対応した逆変換フィルタを導出する。このように導出した逆変換フィルタの構成例を、図23に示す。図23(a)は、デフォーカス位置である被写体距離350[mm]の被写体の撮像画像のぼけを復元するための逆変換フィルタ122(タップ数を7×7としている)を示す。図23(b)は、別のデフォーカス位置である被写体距離470[mm]の被写体の撮像画像のぼけを復元するための逆変換フィルタ123(タップ数を7×7としている)を示す。   In the above description, in order to derive an inverse transform filter that restores the PSF diffused by the lens unit 11 at the focus position so as to be collected at one point, the frequency characteristic R (ω) shown in Expression (12) is derived. As described above, it is possible to appropriately restore the blur of the captured image of the subject at the focus position if the inverse transform process is executed by the inverse transform filter based on the frequency characteristic R (ω). . However, even if this inverse transform filter is applied to the captured image of the subject at the defocus position, it cannot be restored properly. Therefore, in order to restore the blur of the captured image of the subject at the defocus position, an inverse transform filter corresponding to the PSF diffused at the defocus position is derived using Expression (12). FIG. 23 shows a configuration example of the inverse transform filter derived in this way. FIG. 23A shows an inverse transform filter 122 (the number of taps is 7 × 7) for restoring the blur of a captured image of a subject having a subject distance of 350 [mm] as a defocus position. FIG. 23B shows an inverse transform filter 123 (the number of taps is set to 7 × 7) for restoring blur of a captured image of a subject with a subject distance of 470 [mm], which is another defocus position.

図24では、それぞれ異なる被写体距離にある被写体(二次元コード)の撮像画像に対して、その被写体距離に対応した逆変換フィルタにより逆変換処理が実行された画像が示されている。例えば、図24(a)に示す画像は、フィルタ処理部145によって、デフォーカス位置である被写体距離350[mm]の被写体に対応した逆変換フィルタ122で逆変換処理が実行された画像である。また、図24(b)に示す画像は、フィルタ処理部145によって、ベストフォーカス位置である被写体距離400[mm]の被写体に対応した逆変換フィルタで逆変換処理が実行された画像であり、図22(b)に示す画像と同一の画像である。そして、図24(c)に示す画像は、フィルタ処理部145によって、デフォーカス位置である被写体距離450[mm]の被写体に対応した逆変換フィルタ123で逆変換処理が実行された画像である。図24に示すいずれの画像も、被写体(二次元コード)のぼけが復元され、コードの模様が明瞭となっており、MTFが向上した画像となっている。   FIG. 24 shows an image obtained by performing an inverse transform process on captured images of subjects (two-dimensional codes) at different subject distances using an inverse transform filter corresponding to the subject distance. For example, the image shown in FIG. 24A is an image that has been subjected to the inverse transform process by the inverse transform filter 122 corresponding to the subject with the subject distance 350 [mm], which is the defocus position, by the filter processing unit 145. The image shown in FIG. 24B is an image that has been subjected to the inverse transform process by the filter processing unit 145 using the inverse transform filter corresponding to the subject with the subject distance of 400 [mm] that is the best focus position. It is the same image as the image shown in FIG. The image shown in FIG. 24C is an image obtained by performing the inverse transformation process by the inverse transformation filter 123 corresponding to the subject having the subject distance of 450 mm as the defocus position by the filter processing unit 145. In any of the images shown in FIG. 24, the blur of the subject (two-dimensional code) is restored, the code pattern is clear, and the MTF is improved.

このように、例えば、式(12)を用い、かつ、被写体距離に対応した逆変換フィルタを導出し、撮像画像に含まれる被写体の被写体距離を判定し、判定した被写体距離に対応した逆変換フィルタを選択して適用することによって、フォーカス位置にある被写体のみならず、デフォーカス位置にある被写体についても、ぼけが復元された画像が得られる。ここで、上述の距離判定部142による撮像画像に含まれる被写体の被写体距離の判定動作、および、選択部144による被写体距離に応じた逆変換フィルタの選択動作について、以下に説明する。   In this way, for example, an inverse transform filter corresponding to the subject distance is derived using Expression (12), the subject distance of the subject included in the captured image is determined, and the inverse transform filter corresponding to the determined subject distance. By selecting and applying the image, it is possible to obtain an image in which the blur is restored not only for the subject at the focus position but also for the subject at the defocus position. Here, the determination operation of the subject distance of the subject included in the captured image by the distance determination unit 142 and the selection operation of the inverse transform filter according to the subject distance by the selection unit 144 will be described below.

図25は、被写体距離が350[mm]の場合の画像の輝度値についてのヒストグラムの実施例を示す図である。図26は、被写体距離が400[mm]の場合の画像の輝度値についてのヒストグラムの実施例を示す図である。図27は、被写体距離が470[mm]の場合の画像の輝度値についてのヒストグラムの実施例を示す図である。図25〜27を参照しながら、距離判定部142による被写体の被写体距離の判定動作について説明し、さらに、選択部144による被写体距離に応じた逆変換フィルタの選択動作について説明する。   FIG. 25 is a diagram showing an example of a histogram for the luminance value of an image when the subject distance is 350 [mm]. FIG. 26 is a diagram illustrating an example of a histogram regarding the luminance value of an image when the subject distance is 400 [mm]. FIG. 27 is a diagram illustrating an example of a histogram regarding the luminance value of an image when the subject distance is 470 [mm]. The determination operation of the subject distance of the subject by the distance determination unit 142 will be described with reference to FIGS. 25 to 27, and further, the selection operation of the inverse transform filter according to the subject distance by the selection unit 144 will be described.

上述のように、被写体距離に対応した逆変換フィルタを選択して逆変換処理を実行することによって、フォーカス位置またはデフォーカス位置に関わりなく、ぼけが復元された画像を得ることができる。しかし、実際には、撮像素子12により撮像された撮像画像に含まれる被写体の被写体距離については、本実施の形態に係る撮像装置1の構成(図3参照)のようにレンズユニット11および撮像素子12を複数組備えていないので、三角測量の原理により測定することはできない。そこで、本実施の形態に係る撮像装置1の画像処理部14は、被写体距離がそれぞれ異なる被写体の撮像画像についての以下に示す特性に基づいて、被写体距離を判定する。   As described above, by selecting the inverse transform filter corresponding to the subject distance and executing the inverse transform process, it is possible to obtain an image with the blur restored regardless of the focus position or the defocus position. However, actually, the subject distance of the subject included in the captured image captured by the image sensor 12 is the same as the lens unit 11 and the image sensor as in the configuration of the imaging device 1 according to the present embodiment (see FIG. 3). Since a plurality of sets 12 are not provided, measurement cannot be performed by the principle of triangulation. Therefore, the image processing unit 14 of the imaging apparatus 1 according to the present embodiment determines the subject distance based on the following characteristics regarding captured images of subjects with different subject distances.

図25〜27は、それぞれ被写体距離が350、400および470[mm]の被写体の撮像画像における輝度値のヒストグラムである。図25〜27に示すように、被写体距離が大きくなるほど、ヒストグラムの分散が小さく、また、最大輝度値と最小輝度値との差が小さくなっていることがわかる。この性質を利用して、例えば、画像処理部14の距離判定部142は、撮像画像の特性として、撮像画像から輝度値についてのヒストグラムの分散を算出する。そして、距離判定部142は、算出した分散が所定の第1閾値未満である場合、撮像画像の被写体はフォーカス位置より撮像装置1から遠い被写体距離にあると判定する。また、距離判定部142は、分散が所定の第2閾値以上である場合、撮像画像の被写体はフォーカス位置より撮像装置1に近い被写体距離にあると判定する。そして、距離判定部142は、分散が第1閾値以上第2閾値未満である場合、撮像画像の被写体はフォーカス位置近傍の被写体距離にあると判定する。距離判定部142は、判定した被写体距離の情報を、選択部144へ送る。   25 to 27 are histograms of luminance values in captured images of subjects with subject distances of 350, 400, and 470 [mm], respectively. As shown in FIGS. 25 to 27, it can be seen that the greater the subject distance, the smaller the variance of the histogram and the smaller the difference between the maximum luminance value and the minimum luminance value. Using this property, for example, the distance determination unit 142 of the image processing unit 14 calculates the variance of the histogram for the luminance value from the captured image as the characteristic of the captured image. When the calculated variance is less than the predetermined first threshold, the distance determination unit 142 determines that the subject of the captured image is at a subject distance farther from the imaging device 1 than the focus position. In addition, when the variance is equal to or greater than the predetermined second threshold, the distance determination unit 142 determines that the subject of the captured image is at a subject distance closer to the imaging device 1 than the focus position. Then, the distance determination unit 142 determines that the subject of the captured image is at a subject distance near the focus position when the variance is greater than or equal to the first threshold and less than the second threshold. The distance determination unit 142 sends the determined subject distance information to the selection unit 144.

なお、距離判定部142は、撮像画像の輝度値についてのヒストグラムの分散を利用して、被写体距離を判定するものとしたが、これに限定されるものではない。すなわち、距離判定部142は、上述の撮像画像の最大輝度値と最小輝度値との差に基づいて、被写体距離を判定するものとしてもよい。具体的には、距離判定部142は、まず、撮像画像の特性として、撮像画像の最大値輝度値と最小輝度値との差を算出する。距離判定部142は、算出した差が所定の第3閾値未満である場合、撮像画像の被写体はフォーカス位置より撮像装置1から遠い被写体距離にあると判定する。また、距離判定部142は、算出した差が所定の第4閾値以上である場合、撮像画像の被写体はフォーカス位置より撮像装置1に近い被写体距離にあると判定する。そして、距離判定部142は、算出した差が第3閾値以上第4閾値未満である場合、撮像画像の被写体はフォーカス位置近傍の被写体距離にあると判定する。   Note that the distance determination unit 142 determines the subject distance using the variance of the histogram with respect to the luminance value of the captured image, but is not limited to this. That is, the distance determination unit 142 may determine the subject distance based on the difference between the maximum luminance value and the minimum luminance value of the captured image described above. Specifically, the distance determination unit 142 first calculates the difference between the maximum luminance value and the minimum luminance value of the captured image as the characteristic of the captured image. If the calculated difference is less than the predetermined third threshold, the distance determination unit 142 determines that the subject of the captured image is at a subject distance farther from the imaging device 1 than the focus position. In addition, when the calculated difference is equal to or greater than a predetermined fourth threshold, the distance determination unit 142 determines that the subject of the captured image is at a subject distance closer to the imaging device 1 than the focus position. If the calculated difference is greater than or equal to the third threshold value and less than the fourth threshold value, the distance determination unit 142 determines that the subject of the captured image is at a subject distance near the focus position.

また、距離判定部142は、撮像画像の特性として、撮像画像の輝度値のヒストグラムの分散、および撮像画像の最大輝度値と最小輝度値との差の双方を用いて、被写体距離を判定するものとしてもよい。具体的には、距離判定部142は、まず、撮像画像の輝度値のヒストグラムを求め、そのヒストグラムの分散を算出し、かつ、撮像画像の最大輝度値と最小輝度値との差を算出する。距離判定部142は、分散が第1閾値未満、かつ、差が第3閾値未満である場合、撮像画像の被写体はフォーカス位置より撮像装置1から遠い被写体距離にあると判定する。また、距離判定部142は、分散が第2閾値以上、かつ、差が第4閾値以上である場合、撮像画像の被写体はフォーカス位置より撮像装置1に近い被写体距離にあると判定する。そして、距離判定部142は、分散が第1閾値以上第2閾値未満、または、差が第3閾値以上第4閾値未満である場合、撮像画像の被写体はフォーカス位置近傍の被写体距離にあると判定する。   The distance determination unit 142 determines the subject distance using both the variance of the histogram of the brightness value of the captured image and the difference between the maximum brightness value and the minimum brightness value of the captured image as the characteristics of the captured image. It is good. Specifically, the distance determination unit 142 first obtains a histogram of luminance values of the captured image, calculates a variance of the histogram, and calculates a difference between the maximum luminance value and the minimum luminance value of the captured image. When the variance is less than the first threshold and the difference is less than the third threshold, the distance determination unit 142 determines that the subject of the captured image is at a subject distance farther from the imaging device 1 than the focus position. In addition, the distance determination unit 142 determines that the subject of the captured image is closer to the subject distance closer to the imaging device 1 than the focus position when the variance is equal to or greater than the second threshold value and the difference is equal to or greater than the fourth threshold value. Then, the distance determination unit 142 determines that the subject of the captured image is at a subject distance near the focus position when the variance is greater than or equal to the first threshold and less than the second threshold or the difference is greater than or equal to the third threshold and less than the fourth threshold. To do.

また、上述のように、距離判定部142による被写体距離の判定は、3種類の距離領域のいずれに属するかについて判定するものだが、これに限定されるものではなく、2種類または4種類以上の距離領域のいずれに属するか判定するものとしてもよい。   In addition, as described above, the determination of the subject distance by the distance determination unit 142 determines which of the three types of distance regions belongs, but is not limited to this, and there are two types or four or more types. It may be determined which one of the distance regions belongs.

また、距離判定部142は、撮像画像の輝度値についてのヒストグラム、または、最大輝度値と最小輝度値との差に基づいて、被写体距離を判定するものとしたが、これに限定されるものではない。例えば、距離判定部142は、撮像画像の特性としての、撮像画像のコントラスト、すなわち、上述の図9〜11に示すような撮像画像の空間周波数に対するMTFのグラフに基づいて、被写体距離を判定するものとしてもよい。例えば、図9に示すように、フォーカス位置より撮像装置1に近い被写体距離350[mm]のMTFのグラフでは、低周波数側の空間周波数(例えば、10[mm−1])のMTFが高く、高周波数側の空間周波数(例えば、50[mm−1])のMTFが低いという傾向がある。また、図10および11に示すように、フォーカス位置の被写体距離400[mm]のMTFのグラフ、および、フォーカス位置より撮像装置1から遠い被写体距離470[mm]のMTFグラフでは、低周波数側の空間周波数のMTFと、高周波数側の空間周波数のMTFとの差があまり変わらない。しかし、フォーカス位置より撮像装置1から遠い被写体距離470[mm]のMTFグラフの方が、フォーカス位置の被写体距離400[mm]のMTFのグラフよりも、全体としてMTFが低い(例えば、MTFの平均値が低い)という傾向がある。距離判定部142は、このようなそれぞれの被写体距離に対応したMTFのグラフに基づいて、被写体距離を判定することもできる。具体的には、例えば、距離判定部142は、まず、低周波数側の所定の空間周波数のMTFと、高周波数側の所定の空間周波数のMTFとの差を求め、その差が所定の閾値以上である場合、撮像画像の被写体はフォーカス位置より撮像装置1に近い被写体距離にあると判定する。また、距離判定部142は、求めた差が所定の閾値未満である場合、撮像画像の被写体はフォーカス位置近傍の被写体距離、または、フォーカス位置より撮像装置1から遠い被写体距離であると判定する。さらに、距離判定部142は、MTFの平均値が所定の閾値以上である場合、撮像画像の被写体はフォーカス位置近傍の被写体距離にあると判定し、閾値未満である場合、フォーカス位置より撮像装置1から遠い被写体距離にあると判定する。 Further, the distance determination unit 142 determines the subject distance based on the histogram of the luminance value of the captured image or the difference between the maximum luminance value and the minimum luminance value. However, the distance determination unit 142 is not limited to this. Absent. For example, the distance determination unit 142 determines the subject distance based on the contrast of the captured image as the characteristic of the captured image, that is, the MTF graph with respect to the spatial frequency of the captured image as illustrated in FIGS. It may be a thing. For example, as shown in FIG. 9, in the MTF graph of the subject distance 350 [mm] closer to the imaging device 1 than the focus position, the MTF of the spatial frequency on the low frequency side (for example, 10 [mm −1 ]) is high, There is a tendency that the MTF of the spatial frequency on the high frequency side (for example, 50 [mm −1 ]) is low. Also, as shown in FIGS. 10 and 11, in the MTF graph of the subject distance 400 [mm] at the focus position and the MTF graph of the subject distance 470 [mm] far from the imaging device 1 from the focus position, The difference between the MTF of the spatial frequency and the MTF of the spatial frequency on the high frequency side does not change much. However, the MTF graph of the subject distance 470 [mm] farther from the imaging device 1 than the focus position has a lower MTF overall than the MTF graph of the subject distance 400 [mm] at the focus position (for example, the average MTF) Tend to be low). The distance determination unit 142 can also determine the subject distance based on the MTF graph corresponding to each subject distance. Specifically, for example, the distance determination unit 142 first obtains a difference between an MTF having a predetermined spatial frequency on the low frequency side and an MTF having a predetermined spatial frequency on the high frequency side, and the difference is equal to or greater than a predetermined threshold value. If it is, it is determined that the subject of the captured image is at a subject distance closer to the imaging device 1 than the focus position. In addition, when the obtained difference is less than the predetermined threshold, the distance determination unit 142 determines that the subject of the captured image is a subject distance near the focus position or a subject distance farther from the imaging device 1 than the focus position. Further, the distance determination unit 142 determines that the subject of the captured image is at a subject distance near the focus position when the average value of the MTF is equal to or greater than a predetermined threshold value. It is determined that the subject is far from the subject.

また、上述においては、距離判定部142は、撮像画像全体の特性に基づいて、被写体距離を判定するものとしたが、これに限定されるものではない。例えば、距離判定部142は、撮像画像を複数に分割し、分割した部分画像の上述のような特性に基づいて、部分画像ごとに、部分画像に含まれる被写体の被写体距離を判定するものとしてもよい。   In the above description, the distance determination unit 142 determines the subject distance based on the characteristics of the entire captured image. However, the present invention is not limited to this. For example, the distance determination unit 142 may divide the captured image into a plurality of images and determine the subject distance of the subject included in the partial image for each partial image based on the above-described characteristics of the divided partial images. Good.

選択部144は、距離判定部142により判定された被写体距離の情報を受け取り、その被写体距離に対応した逆変換フィルタを、記憶部143に予め記憶された逆変換フィルタから選択して抽出する。選択部144は、選択した逆変換フィルタの情報を、フィルタ処理部145に送る。そして、フィルタ処理部145は、画像バッファ部141から受け取る撮像画像に対して、選択部144から受け取った逆変換フィルタによって逆変換処理を実行する。   The selection unit 144 receives information on the subject distance determined by the distance determination unit 142, and selects and extracts an inverse transform filter corresponding to the subject distance from the inverse transform filters stored in advance in the storage unit 143. The selection unit 144 sends information on the selected inverse transform filter to the filter processing unit 145. Then, the filter processing unit 145 performs an inverse conversion process on the captured image received from the image buffer unit 141 using the inverse conversion filter received from the selection unit 144.

以上のように、距離判定部142が、撮像画像が含む被写体の被写体距離を判定し、選択部144が、判定された被写体距離に対応した逆変換フィルタを選択し、フィルタ処理部145が、選択された逆変換フィルタで撮像画像に対して逆変換処理を実行する。これによって、被写体がどのような被写体距離にあっても、撮像画像のぼけを復元することができる。   As described above, the distance determination unit 142 determines the subject distance of the subject included in the captured image, the selection unit 144 selects the inverse transform filter corresponding to the determined subject distance, and the filter processing unit 145 selects the selection. The inverse transform process is performed on the captured image with the inverse transform filter. This makes it possible to restore the blur of the captured image regardless of the subject distance.

(認識処理部の動作)
認識処理部15は、撮像素子12により撮像された撮像画像に対して、フィルタ処理部145により逆変換処理が実行された画像に含まれるシンボルの認識処理を実行する。具体的には、認識処理部15は、シンボルの認識処理として、逆変換処理後の画像に含まれるシンボルを認識し、認識したシンボルをデコードする。そして、認識処理部15は、通信部16を介して、デコードした情報を外部機器(例えば、図1に示すPC2)に送信する。
(Operation of recognition processing unit)
The recognition processing unit 15 performs recognition processing of symbols included in the image on which the inverse conversion processing is performed by the filter processing unit 145 on the captured image captured by the image sensor 12. Specifically, the recognition processing unit 15 recognizes a symbol included in the image after the inverse conversion process and decodes the recognized symbol as a symbol recognition process. Then, the recognition processing unit 15 transmits the decoded information to an external device (for example, the PC 2 illustrated in FIG. 1) via the communication unit 16.

上述のように、フィルタ処理部145の逆変換処理により解像度が向上した、すなわちぼけが復元された被写体に含まれるシンボルに対して認識処理が実行されるので、シンボルの認識の精度を向上させることができる。   As described above, since the resolution is improved by the inverse conversion process of the filter processing unit 145, that is, the recognition process is performed on the symbol included in the subject whose blur is restored, the accuracy of symbol recognition is improved. Can do.

(撮像装置の動作の全体の流れ)
図28は、実施の形態に係る撮像装置の動作の一例を示すフローチャートである。図28を参照しながら、撮像装置1の全体的な動作の流れについて説明する。
(Overall flow of operation of imaging device)
FIG. 28 is a flowchart illustrating an example of the operation of the imaging apparatus according to the embodiment. The overall operation flow of the imaging apparatus 1 will be described with reference to FIG.

<ステップS11>
レンズユニット11は、被写体からの光を集光し、撮像素子12に対して結像させる。この際、レンズユニット11の位相板LZ4は、レンズユニット11に入射する光に対して収差を与える。その結果、位相板LZ4は、撮像素子12に入射される光に対して点像分布関数(PSF)を拡散し、撮像素子12で撮像される画像がぼけた状態とする代わりに広い深度でそのぼけが一定、すなわちPSFの形が一定となるようにする。撮像素子12は、レンズユニット11に入射する被写体からの光を電気信号に変換することによって被写体を撮像して撮像画像を生成する。撮像素子12は、生成した撮像画像を画像処理部14の画像バッファ部141に出力する。そして、ステップS12へ進む。
<Step S11>
The lens unit 11 collects light from the subject and forms an image on the image sensor 12. At this time, the phase plate LZ4 of the lens unit 11 gives aberration to the light incident on the lens unit 11. As a result, the phase plate LZ4 diffuses the point spread function (PSF) with respect to the light incident on the image sensor 12 so that the image picked up by the image sensor 12 is not in a blurred state. The blur is constant, that is, the shape of the PSF is constant. The image pickup device 12 picks up a subject and generates a picked-up image by converting light from the subject incident on the lens unit 11 into an electrical signal. The image sensor 12 outputs the generated captured image to the image buffer unit 141 of the image processing unit 14. Then, the process proceeds to step S12.

<ステップS12>
画像バッファ部141は、バッファリングした撮像画像を、距離判定部142に送る。距離判定部142は、受け取った撮像画像の特性(輝度値についてのヒストグラムの分散、最大輝度値と最小輝度値との差、または、空間周波数に対するMTFのグラフ等)に基づいて、撮像画像に含まれる被写体の被写体距離を判定する。距離判定部142は、判定した被写体距離の情報を、選択部144に送る。そして、ステップS13へ進む。
<Step S12>
The image buffer unit 141 sends the buffered captured image to the distance determination unit 142. The distance determination unit 142 is included in the captured image on the basis of the characteristics of the received captured image (dispersion of the histogram regarding the brightness value, the difference between the maximum brightness value and the minimum brightness value, or the MTF graph with respect to the spatial frequency). The subject distance of the subject to be determined is determined. The distance determination unit 142 sends information on the determined subject distance to the selection unit 144. Then, the process proceeds to step S13.

<ステップS13>
選択部144は、距離判定部142により判定された被写体距離の情報を受け取り、その被写体距離に対応した逆変換フィルタを、記憶部143に予め記憶された逆変換フィルタから選択して抽出する。選択部144は、選択した逆変換フィルタの情報を、フィルタ処理部145に送る。そして、ステップS14へ進む。
<Step S13>
The selection unit 144 receives information on the subject distance determined by the distance determination unit 142, and selects and extracts an inverse transform filter corresponding to the subject distance from the inverse transform filters stored in advance in the storage unit 143. The selection unit 144 sends information on the selected inverse transform filter to the filter processing unit 145. Then, the process proceeds to step S14.

<ステップS14>
フィルタ処理部145は、画像バッファ部141から撮像画像を受け取り、選択部144から受け取った逆変換フィルタによって、撮像画像に対して逆変換処理を実行する。フィルタ処理部145は、逆変換処理後の画像を認識処理部15に送る。そして、ステップS15へ進む。
<Step S14>
The filter processing unit 145 receives the captured image from the image buffer unit 141, and performs an inverse conversion process on the captured image by the inverse conversion filter received from the selection unit 144. The filter processing unit 145 sends the image after the inverse transformation process to the recognition processing unit 15. Then, the process proceeds to step S15.

<ステップS15>
認識処理部15は、フィルタ処理部145により逆変換処理が実行された画像に対して、被写体におけるシンボルの認識処理を実行する。そして、ステップS16へ進む。
<Step S15>
The recognition processing unit 15 performs symbol recognition processing on the subject on the image on which the inverse conversion processing has been performed by the filter processing unit 145. Then, the process proceeds to step S16.

<ステップS16>
認識処理部15によって、画像処理部14から入力した画像に対してシンボルの認識処理が実行されることにより、シンボルが認識された場合、すなわち、シンボルの候補が発見された場合(ステップS16:Yes)、ステップS17へ進む。一方、シンボルが認識されない場合、すなわち、シンボルの候補が発見されなかった場合(ステップS16:No)、動作を終了する。
<Step S16>
When the recognition processing unit 15 executes symbol recognition processing on the image input from the image processing unit 14 to recognize a symbol, that is, when a symbol candidate is found (step S16: Yes). ), Go to step S17. On the other hand, if the symbol is not recognized, that is, if no symbol candidate is found (step S16: No), the operation is terminated.

<ステップS17>
認識処理部15によって、認識したシンボルに対してデコード処理を実行した結果、デコードが正常に完了した場合(ステップS17:Yes)、ステップS18へ進み、デコードが正常に完了できなかった場合(ステップS17:No)、動作を終了する。
<Step S17>
As a result of executing the decoding process on the recognized symbol by the recognition processing unit 15, when the decoding is normally completed (step S17: Yes), the process proceeds to step S18, and when the decoding is not normally completed (step S17). : No), the operation is terminated.

<ステップS18>
認識処理部15は、画像処理部14から入力した画像に対してシンボルの認識処理を実行することにより、画像に含まれるシンボルを認識して、認識したシンボルをデコードした情報を外部機器(例えば、図1に示すPC2)に送信(出力)する。
<Step S18>
The recognition processing unit 15 performs symbol recognition processing on the image input from the image processing unit 14, thereby recognizing the symbols included in the image, and decoding the recognized symbol information into an external device (for example, It is transmitted (output) to the PC 2) shown in FIG.

以上の流れによって、撮像装置1による被写体距離の判定、逆変換フィルタの選択、逆変換処理、およびシンボルの認識処理が実行される。なお、ステップS11〜S18の動作によって、シンボルの認識処理が正常に完了しなかった場合、正常に完了するまで所定回数繰り返すものとしてもよい。   Through the above flow, the subject distance determination, the inverse transform filter selection, the inverse transform process, and the symbol recognition process by the imaging apparatus 1 are executed. If the symbol recognition process is not normally completed by the operations in steps S11 to S18, it may be repeated a predetermined number of times until it is normally completed.

以上のように、本実施の形態に係る撮像装置1において、レンズユニット11は、入力する光に対してPSFを拡散し、撮像素子12で撮像される画像がぼけた状態とする代わりに広い深度でそのぼけが一定となるようにする。距離判定部142は、撮像素子12により撮像された撮像画像の特性に基づいて、撮像画像が含む被写体の被写体距離を判定し、選択部144は、判定された被写体距離に対応した逆変換フィルタを選択する。そして、フィルタ処理部145は、選択部144により選択された逆変換フィルタで撮像画像に対して逆変換処理を実行するものとしている。これによって、被写体がどのような被写体距離にあっても、その被写体を含む撮像画像のぼけを復元することができる。また、複数の撮像手段を必要とせず、1つの撮像素子12を用いて、撮像画像の特性に基づいて被写体距離を判定するものとしているので、撮像装置1のサイズの拡大を抑制し、コストの増加を抑制することができる。また、被写体がどのような被写体距離にあっても、その被写体を含む撮像画像のぼけを復元することができるので、認識処理部15による被写体が含む二次元コード等のシンボルの認識精度が向上する。   As described above, in the imaging apparatus 1 according to the present embodiment, the lens unit 11 diffuses the PSF with respect to the input light, and the image picked up by the image pickup device 12 is not in a blurred state, but has a wide depth. So that the blur is constant. The distance determination unit 142 determines the subject distance of the subject included in the captured image based on the characteristics of the captured image captured by the imaging element 12, and the selection unit 144 uses an inverse transform filter corresponding to the determined subject distance. select. And the filter process part 145 shall perform an inverse transformation process with respect to a captured image with the inverse transformation filter selected by the selection part 144. FIG. This makes it possible to restore the blur of the captured image including the subject regardless of the subject distance. In addition, since the subject distance is determined based on the characteristics of the captured image using a single imaging element 12 without using a plurality of imaging means, the increase in the size of the imaging device 1 is suppressed, and the cost is reduced. Increase can be suppressed. In addition, since the blur of the captured image including the subject can be restored regardless of the subject distance, the recognition processing unit 15 can improve the recognition accuracy of symbols such as a two-dimensional code included in the subject. .

なお、上述のように、距離判定部142は、撮像画像を複数に分割し、分割した部分画像の上述のような特性に基づいて、部分画像ごとに、部分画像に含まれる被写体の被写体距離を判定することが望ましい。これによって、1つの撮像画像に異なる被写体距離にある被写体が含まれる場合、部分画像ごとに、部分画像が含む被写体の被写体距離に応じた逆変換処理が実行されるので、撮像画像全体としてぼけを復元することが可能となる。   As described above, the distance determination unit 142 divides the captured image into a plurality of images, and determines the subject distance of the subject included in the partial image for each partial image based on the above-described characteristics of the divided partial images. It is desirable to judge. As a result, when a subject at a different subject distance is included in one captured image, an inverse conversion process is executed for each partial image according to the subject distance of the subject included in the partial image. It can be restored.

また、被写界深度拡張のために、上述の式(12)に示す周波数特性Rに基づく逆変換フィルタによる逆変換処理を例に挙げたが、被写界深度拡張の方法はこれに限定されるものではない。すなわち、異なる逆変換フィルタによる逆変換処理、または、異なるその他の処理によって被写界深度の拡張が実現されるものとしてもよい。   In addition, in order to extend the depth of field, an example of the inverse transformation process by the inverse transformation filter based on the frequency characteristic R shown in the above equation (12) is given as an example, but the method of extending the depth of field is limited to this. It is not something. That is, the depth of field may be extended by an inverse transform process using different inverse transform filters, or by another different process.

また、レンズユニット11の位相板LZ4により、広い深度でぼけが一定になるようにし、フィルタ処理部145の逆変換処理を実行することによりそのぼけが復元されることによって被写界深度の拡張を実現するものとしているが、これに限定されるものではない。すなわち、レンズユニット11の収差によってぼけを含む撮像画像に対して、フィルタ処理部145が逆変換処理を実行して復元するという動作であって、特に被写界深度を拡張するものではない場合であっても、上述の距離判定部142による被写体距離の判定、および選択部144による逆変換フィルタの選択動作によって、上述の効果を奏することが可能である。   Further, the phase plate LZ4 of the lens unit 11 makes the blur constant at a wide depth, and the blur is restored by executing the inverse transform process of the filter processing unit 145, thereby extending the depth of field. Although it is to be realized, it is not limited to this. That is, this is an operation in which the filter processing unit 145 restores the captured image including the blur due to the aberration of the lens unit 11 by performing an inverse transformation process, and does not particularly extend the depth of field. Even in this case, the above-described effects can be achieved by the determination of the subject distance by the above-described distance determination unit 142 and the selection operation of the inverse transform filter by the selection unit 144.

1 撮像装置
2 PC
3 通信ケーブル
4 被写体
11 レンズユニット
12 撮像素子
14 画像処理部
15 認識処理部
16 通信部
21 通信部
22 操作部
23 表示部
24 記憶部
25 外部記憶装置
26 制御部
27 バス
101 撮像画像
105 画像
121〜123 逆変換フィルタ
131、131a〜131f 対象部分画像
135a〜135f 中央データ
141 画像バッファ部
142 距離判定部
143 記憶部
144 選択部
145 フィルタ処理部
201 目標空間周波数特性
202、202a 空間周波数特性
203、203a 空間周波数特性
500 撮像システム
A フレーム開始期間
B 水平ブランキング期間
B1、B2_S、B2_T グラフ
C フレーム終了期間
D 垂直ブランキング期間
G1、G2_S、G2_T グラフ
LZ1〜LZ3 レンズ
LZ4 位相板
LZ5〜LZ7 レンズ
R1、R2_S、R2_T グラフ
SB 絞り
T 有効データ期間
1 Imaging device 2 PC
3 Communication Cable 4 Subject 11 Lens Unit 12 Image Sensor 14 Image Processing Unit 15 Recognition Processing Unit 16 Communication Unit 21 Communication Unit 22 Operation Unit 23 Display Unit 24 Storage Unit 25 External Storage Device 26 Control Unit 27 Bus 101 Captured Image 105 Image 121- 123 Inverse transform filter 131, 131a-131f Target partial image 135a-135f Central data 141 Image buffer unit 142 Distance determination unit 143 Storage unit 144 Selection unit 145 Filter processing unit 201 Target spatial frequency characteristic 202, 202a Spatial frequency characteristic 203, 203a Space Frequency characteristics 500 Imaging system A Frame start period B Horizontal blanking period B1, B2_S, B2_T graph C Frame end period D Vertical blanking period G1, G2_S, G2_T graph LZ1 to LZ3 'S LZ4 phase plate LZ5~LZ7 lens R1, R2_S, R2_T graph SB stop T valid data period

特開2013−162369号公報JP 2013-162369 A

Claims (11)

入射した光に収差を与える光学系と、
前記光学系を通過した前記光を画素に変換して被写体の画像を撮像する1つの撮像手段と、
前記撮像手段により撮像された撮像画像の特性に基づいて、前記被写体の被写体距離を判定する距離判定手段と、
前記被写体距離に対応した逆変換フィルタを選択する選択手段と、
前記選択手段により選択された前記逆変換フィルタにより、前記撮像画像における前記収差によるぼけを復元する逆変換処理を実行する逆変換手段と、
を備えた撮像装置。
An optical system that gives aberration to incident light;
One image pickup means for picking up an image of a subject by converting the light passing through the optical system into a pixel;
A distance determination unit that determines a subject distance of the subject based on characteristics of a captured image captured by the imaging unit;
Selecting means for selecting an inverse transform filter corresponding to the subject distance;
Inverse conversion means for executing an inverse conversion process for restoring blur caused by the aberration in the captured image by the inverse conversion filter selected by the selection means;
An imaging apparatus comprising:
前記距離判定手段は、前記撮像画像を複数の部分画像に分割し、前記部分画像ごとに、該部分画像の特性に基づいて、該部分画像が含む被写体の被写体距離を判定し、
前記選択手段は、前記距離判定手段により判定された前記部分画像ごとの前記被写体距離に対応した前記逆変換フィルタを選択する請求項1に記載の撮像装置。
The distance determination unit divides the captured image into a plurality of partial images, determines, for each partial image, a subject distance of a subject included in the partial image based on characteristics of the partial image,
The imaging apparatus according to claim 1, wherein the selection unit selects the inverse transform filter corresponding to the subject distance for each of the partial images determined by the distance determination unit.
前記距離判定手段は、前記撮像画像の特性として、該撮像画像の輝度値についてのヒストグラムの分散を算出し、前記分散に基づいて、前記被写体距離を判定する請求項1または2に記載の撮像装置。   The imaging apparatus according to claim 1, wherein the distance determining unit calculates a variance of a histogram with respect to a luminance value of the captured image as a characteristic of the captured image, and determines the subject distance based on the variance. . 前記距離判定手段は、前記撮像画像の特性として、該撮像画像の最大輝度値と最小輝度値との差を算出し、前記差に基づいて、前記被写体距離を判定する請求項1〜3のいずれか一項に記載の撮像装置。   The distance determination unit calculates a difference between a maximum luminance value and a minimum luminance value of the captured image as a characteristic of the captured image, and determines the subject distance based on the difference. The imaging device according to claim 1. 前記距離判定手段は、前記撮像画像の特性として、該撮像画像のコントラストに基づいて、前記被写体距離を判定する請求項1または2に記載の撮像装置。   The imaging apparatus according to claim 1, wherein the distance determination unit determines the subject distance based on a contrast of the captured image as a characteristic of the captured image. 前記被写体距離に対応した前記逆変換フィルタを記憶する記憶手段を、さらに備えた請求項1〜5のいずれか一項に記載の撮像装置。   The imaging apparatus according to claim 1, further comprising a storage unit that stores the inverse transform filter corresponding to the subject distance. 前記逆変換フィルタは、前記被写体距離に応じた前記被写体の理想画像の画素の周波数特性と、前記逆変換手段により前記逆変換処理が実行された画像の画素の周波数特性との平均二乗誤差を最小にするフィルタである請求項1〜6のいずれか一項に記載の撮像装置。   The inverse transform filter minimizes a mean square error between the frequency characteristic of the pixel of the ideal image of the subject according to the subject distance and the frequency characteristic of the pixel of the image subjected to the inverse transform process by the inverse transform unit. The imaging device according to claim 1, wherein the imaging device is a filter. 前記光学系は、所定の深度で前記ぼけが一定となるような前記収差を与え、
前記逆変換手段は、前記収差による一定の前記ぼけを復元する前記逆変換フィルタにより前記逆変換処理を実行することによって被写界深度を拡張する請求項1〜7のいずれか一項に記載の撮像装置。
The optical system gives the aberration such that the blur is constant at a predetermined depth;
The said inversion means expands a depth of field by performing the said inversion process by the said inversion filter which restore | restores the said constant blurring by the said aberration, The depth of field as described in any one of Claims 1-7. Imaging device.
前記逆変換手段により前記逆変換処理が実行された画像に対して、シンボルを認識する認識処理手段をさらに備えた請求項1〜8のいずれか一項に記載の撮像装置。   The imaging apparatus according to claim 1, further comprising a recognition processing unit that recognizes a symbol with respect to the image on which the inverse conversion process has been performed by the inverse conversion unit. 請求項1〜8のいずれか一項に記載の撮像装置と、
前記逆変換手段により前記逆変換処理が実行された画像に対して、シンボルを認識する認識処理手段と、
を備えた撮像システム。
The imaging device according to any one of claims 1 to 8,
Recognition processing means for recognizing a symbol for the image subjected to the inverse transformation processing by the inverse transformation means;
An imaging system comprising:
光学系により入射した光に収差を与える光学処理ステップと、
1つの撮像手段により前記光学系を通過した前記光を画素に変換して被写体の画像を撮像する撮像ステップと、
撮像した撮像画像の特性に基づいて、前記被写体の被写体距離を判定する距離判定ステップと、
前記被写体距離に対応した逆変換フィルタを選択する選択ステップと、
選択した前記逆変換フィルタにより、前記撮像画像における前記収差によるぼけを復元する逆変換処理を実行する逆変換ステップと、
を有する撮像方法。
An optical processing step for providing aberration to the incident light by the optical system;
An imaging step of capturing an image of a subject by converting the light that has passed through the optical system into a pixel by a single imaging unit;
A distance determination step for determining a subject distance of the subject based on characteristics of the captured image;
A selection step of selecting an inverse transform filter corresponding to the subject distance;
An inverse transformation step of performing an inverse transformation process for restoring blur due to the aberration in the captured image by the selected inverse transformation filter;
An imaging method comprising:
JP2014123502A 2014-06-16 2014-06-16 Imaging apparatus, imaging system, and imaging method Pending JP2016005080A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014123502A JP2016005080A (en) 2014-06-16 2014-06-16 Imaging apparatus, imaging system, and imaging method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014123502A JP2016005080A (en) 2014-06-16 2014-06-16 Imaging apparatus, imaging system, and imaging method

Publications (1)

Publication Number Publication Date
JP2016005080A true JP2016005080A (en) 2016-01-12

Family

ID=55224085

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014123502A Pending JP2016005080A (en) 2014-06-16 2014-06-16 Imaging apparatus, imaging system, and imaging method

Country Status (1)

Country Link
JP (1) JP2016005080A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022190770A1 (en) * 2021-03-10 2022-09-15 ソニーグループ株式会社 Information processing device, information processing method, and program
CN118095315A (en) * 2024-04-18 2024-05-28 泉州职业技术大学 Two-dimensional code identification method and device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022190770A1 (en) * 2021-03-10 2022-09-15 ソニーグループ株式会社 Information processing device, information processing method, and program
CN118095315A (en) * 2024-04-18 2024-05-28 泉州职业技术大学 Two-dimensional code identification method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
JP5933105B2 (en) Image processing apparatus, imaging apparatus, filter generation apparatus, image restoration method, and program
JP5651118B2 (en) Image processing apparatus and image processing method
JP2015165610A (en) Imaging apparatus, imaging system and imaging method
US9829676B2 (en) Imaging device and focusing control method
JP6236908B2 (en) Imaging apparatus, imaging system, and imaging method
US20160353010A1 (en) Imaging device and focusing control method
WO2015174257A1 (en) Image-processing device, image-processing method, imaging device, electronic instrument, and program
JP2013045404A (en) Image processing method, image processor, imaging apparatus and image processing program
JP2015219754A (en) Imaging device and imaging method
US20150161771A1 (en) Image processing method, image processing apparatus, image capturing apparatus and non-transitory computer-readable storage medium
RU2657015C2 (en) Image capturing apparatus, image capturing system and image capturing method
CN109196857B (en) Imaging element and imaging device
JP2016005080A (en) Imaging apparatus, imaging system, and imaging method
US9374568B2 (en) Image processing apparatus, imaging apparatus, and image processing method
JP6314641B2 (en) Imaging apparatus and imaging method
JP2020030569A (en) Image processing method, image processing device, imaging device, lens device, program, and storage medium
JP2015216544A (en) Imaging apparatus and imaging method
JP2015211401A (en) Imaging apparatus and imaging method
JP6291795B2 (en) Imaging system and imaging method
JP2015211357A (en) Imaging apparatus and imaging method
JP2015005881A (en) Image processing apparatus, imaging device, and imaging system
JP2016174263A (en) Image processing function suitable for moving image shooting and imaging device having the same, image processing apparatus, image processing method, image processing program
JP6194793B2 (en) Image correction apparatus, image correction method, and image correction program
JP6221399B2 (en) Imaging system, imaging optical system, and manufacturing method of imaging system