JP2017050700A - Image processor, imaging apparatus and image processing program - Google Patents

Image processor, imaging apparatus and image processing program Download PDF

Info

Publication number
JP2017050700A
JP2017050700A JP2015172482A JP2015172482A JP2017050700A JP 2017050700 A JP2017050700 A JP 2017050700A JP 2015172482 A JP2015172482 A JP 2015172482A JP 2015172482 A JP2015172482 A JP 2015172482A JP 2017050700 A JP2017050700 A JP 2017050700A
Authority
JP
Japan
Prior art keywords
correction
distance
chromatic aberration
correction value
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
JP2015172482A
Other languages
Japanese (ja)
Inventor
雄一 平井
Yuichi Hirai
雄一 平井
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2015172482A priority Critical patent/JP2017050700A/en
Publication of JP2017050700A publication Critical patent/JP2017050700A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To make excellent magnification chromatic aberration corrections while reducing a computational complexity.SOLUTION: An image processor has: processing means 111 of performing correction processing, associated with magnification chromatic aberrations of an optical system, on an input image generated by imaging through the optical system; detection means 116 of detecting magnification chromatic aberration quantities of the optical system; calculation means 117 of calculating a first correction value corresponding to a detection result of the detection means as a correction value to be used for the correction processing; and storage means 117a of holding a second correction value prepared as the correction value without reference to the detection result of the detection means. The processing means divides the input image into a plurality of correction object regions, selects one of the first correction value and second correction value for each of the correction object regions, and performs the correction processing.SELECTED DRAWING: Figure 1

Description

本発明は、撮像により生成された画像に対して画質を向上させるための画像処理を行う技術に関する。   The present invention relates to a technique for performing image processing for improving image quality on an image generated by imaging.

デジタルカメラ等の撮像装置を用いて画像を取得する際には、撮像光学系の諸収差の1つである倍率色収差が、被写体像のエッジ部等に本来の被写体色とは異なる色のフリンジを生じさせ、画質を低下させる。このような倍率色収差の大きさ(量)は、被写体からの光線の光学系への入射角に依存し、特に近距離被写体からの大きな入射角の光線に対する倍率色収差が大きくなる。   When an image is acquired using an imaging device such as a digital camera, the lateral chromatic aberration, which is one of the various aberrations of the imaging optical system, causes a fringe of a color different from the original subject color to the edge portion of the subject image. Cause image quality to deteriorate. The magnitude (amount) of such lateral chromatic aberration depends on the incident angle of the light beam from the subject to the optical system, and in particular, the lateral chromatic aberration for a light beam having a large incident angle from a short-distance subject increases.

特許文献1には、撮像により得られた画像(撮像画像)における倍率色収差の補正を、光学系の設計値に基づく倍率色収差量と撮像画像において検出した倍率色収差量とを用いて決定した補正値を用いて行う方法が開示されている。   In Patent Document 1, correction of lateral chromatic aberration in an image (captured image) obtained by imaging is determined using a lateral chromatic aberration amount based on a design value of the optical system and a lateral chromatic aberration amount detected in the captured image. A method of performing using is disclosed.

特開2012−070053号公報JP 2012-070053 A

特許文献1にて開示された方法では、撮像画像における全ての領域で倍率色収差補正量を検出する。しかしながら、撮像画像における倍率色収差量の検出は画素ごとおよび色ごとの演算を必要とするため、全ての領域で倍率色収差量を検出すると演算量が膨大になり、撮像装置における演算処理部の負担が大きい。演算処理部の負担が大きくなると、撮像装置の連写性能の低下や電力消費量の増大につながる。   In the method disclosed in Patent Document 1, the magnification chromatic aberration correction amount is detected in all regions in the captured image. However, since detection of the amount of chromatic aberration of magnification in a captured image requires calculation for each pixel and color, if the amount of chromatic aberration of magnification is detected in all regions, the amount of calculation becomes enormous, and the calculation processing unit in the imaging apparatus is burdened. large. When the burden on the arithmetic processing unit is increased, the continuous shooting performance of the imaging apparatus is reduced and the power consumption is increased.

本発明では、演算量を低減しつつ良好な倍率色収差補正を行えるようにした画像処理装置、撮像装置および画像処理プログラムを提供する。   The present invention provides an image processing apparatus, an imaging apparatus, and an image processing program that can perform good lateral chromatic aberration correction while reducing the amount of calculation.

本発明の一側面としての画像処理装置は、光学系を通した撮像により生成された入力画像に対して、光学系の倍率色収差に関する補正処理を行う処理手段と、光学系の倍率色収差量を検出する検出手段と、補正処理において用いられる補正値として、検出手段による検出結果に応じた第1の補正値を算出する算出手段と、上記補正値として検出手段による検出結果によらずに用意された第2の補正値を保持する記憶手段とを有する。処理手段は、入力画像を複数の補正対象領域に分割し、該補正対象領域ごとに第1の補正値および第2の補正値のうち一方を選択して補正処理を行うことを特徴とする。   An image processing apparatus according to one aspect of the present invention detects processing for correcting a chromatic aberration of magnification of an optical system, and processing means for performing correction processing on the chromatic aberration of magnification of the optical system for an input image generated by imaging through the optical system. A detection means for calculating, a calculation means for calculating a first correction value corresponding to a detection result by the detection means as a correction value used in the correction process, and a correction value prepared without depending on the detection result by the detection means. Storage means for holding the second correction value. The processing means divides the input image into a plurality of correction target areas, and performs correction processing by selecting one of the first correction value and the second correction value for each correction target area.

なお、撮像を行う撮像手段と、該撮像手段により生成された入力画像に対して画像処理を行う上記画像処理装置とを有する撮像装置も、本発明の他の一側面を構成する。   Note that an imaging apparatus including an imaging unit that performs imaging and the image processing apparatus that performs image processing on an input image generated by the imaging unit also constitutes another aspect of the present invention.

また、本発明の他の一側面としての画像処理プログラムは、光学系を通した撮像により生成された入力画像に対する光学系の倍率色収差に関する補正処理を含む画像処理をコンピュータに行わせるコンピュータプログラムである。画像処理は、光学系の倍率色収差量を検出する検出処理を行い、補正処理において用いられる補正値として、検出処理による検出結果に応じた第1の補正値を演算し、上記補正値として検出処理による検出結果によらない第2の補正値を用意し、入力画像を複数の補正対象領域に分割し、該補正対象領域ごとに第1の補正値および第2の補正値のうち一方を選択して補正処理を行うことを特徴とする。   An image processing program according to another aspect of the present invention is a computer program that causes a computer to perform image processing including correction processing related to lateral chromatic aberration of an optical system with respect to an input image generated by imaging through the optical system. . The image processing performs detection processing for detecting the amount of chromatic aberration of magnification of the optical system, calculates a first correction value corresponding to the detection result by the detection processing as a correction value used in the correction processing, and performs detection processing as the correction value. Preparing a second correction value that does not depend on the detection result of, dividing the input image into a plurality of correction target areas, and selecting one of the first correction value and the second correction value for each correction target area Correction processing is performed.

本発明では、補正対象領域ごとに倍率色収差量の検出結果に応じた第1の補正値と該検出結果によらずに用意された第2の補正値のうち一方を選択して補正処理を行う。これにより、入力画像の全体にわたる複数の補正対象領域の全てにおいて倍率色収差量を検出したり第1の補正値を算出したりする場合に比べて演算量を低減しつつ、倍率色収差が良好に補正された結果画像を得ることができる。   In the present invention, correction processing is performed by selecting one of the first correction value corresponding to the detection result of the magnification chromatic aberration amount and the second correction value prepared without depending on the detection result for each correction target region. . As a result, the chromatic aberration of magnification is corrected well while reducing the amount of calculation compared to the case where the amount of chromatic aberration of magnification is detected or the first correction value is calculated in all of the plurality of correction target areas over the entire input image. Result image can be obtained.

本発明の実施例1である撮像装置の構成を示すブロック図。1 is a block diagram illustrating a configuration of an imaging apparatus that is Embodiment 1 of the present invention. 実施例1における撮像画像に対する処理で得られる処理画像のサイズを示す図。FIG. 6 is a diagram illustrating the size of a processed image obtained by processing a captured image in the first embodiment. 実施例1における領域整合部の構成を示すブロック図。FIG. 3 is a block diagram illustrating a configuration of a region matching unit according to the first embodiment. 実施例1におけるフレーム制御部のロジックを示す図。FIG. 3 is a diagram illustrating logic of a frame control unit according to the first embodiment. 実施例1における領域計数部のロジックを示す図。FIG. 3 is a diagram illustrating a logic of an area counting unit according to the first embodiment. 実施例1における比率計数部のロジックを示す図。FIG. 3 is a diagram illustrating logic of a ratio counting unit according to the first embodiment. 実施例1における第1選択部のロジックを示す図。FIG. 3 is a diagram illustrating logic of a first selection unit according to the first embodiment. 実施例1における第2選択部のロジックを示す図。FIG. 6 is a diagram illustrating logic of a second selection unit in the first embodiment. 実施例1における倍率色収差量を検出する領域の定義を示す図。FIG. 4 is a diagram illustrating a definition of a region for detecting a magnification chromatic aberration amount in the first embodiment. 実施例1における検出実施判定部の構成を示すブロック図。FIG. 3 is a block diagram illustrating a configuration of a detection execution determination unit according to the first embodiment. 実施例1における距離マップデータと検出実施判定結果を示す図。The figure which shows the distance map data in Example 1, and a detection implementation determination result. 実施例1における像高領域ごとの色収差量を示す図。FIG. 3 is a diagram illustrating a chromatic aberration amount for each image height region in the first embodiment. 実施例1における被写体距離とデフォーカス量との関係を示す図。FIG. 6 is a diagram illustrating a relationship between a subject distance and a defocus amount in the first embodiment. 本発明の実施例2である画像処理プログラムを示すフローチャート。9 is a flowchart illustrating an image processing program that is Embodiment 2 of the present invention.

以下、本発明の実施例について図面を参照しながら説明する。   Embodiments of the present invention will be described below with reference to the drawings.

図1には、本発明の実施例1である撮像装置としてのデジタルカメラ(以下、単にカメラという)の構成を示している。撮像光学系(図には光学系と記す)121は、カメラに一体に設けられた又はカメラに対して交換可能なレンズにより構成される。   FIG. 1 shows a configuration of a digital camera (hereinafter simply referred to as a camera) as an image pickup apparatus that is Embodiment 1 of the present invention. An imaging optical system (referred to as an optical system in the figure) 121 is configured by a lens that is provided integrally with the camera or exchangeable with the camera.

撮像系(撮像手段)100は、CMOSセンサ等のイメージセンサ、A/D変換器およびタイミング生成部等を含む。撮像系100は、光学系121により形成された被写体像を、タイミング生成部からのタイミング信号に応じて動作するイメージセンサによって光電変換し、該イメージセンサから出力されるアナログ信号をA/D変換器によりデジタル信号に変換する。これにより、デジタルデータとしての撮像画像(以下、画像データという)を生成する。本実施例では、イメージセンサの画素配列を、R/Gr/Gb/Bからなるベイヤー配列とする。ただし、ベイヤー配列以外の画素配列であってもよい。   The imaging system (imaging means) 100 includes an image sensor such as a CMOS sensor, an A / D converter, a timing generation unit, and the like. The imaging system 100 photoelectrically converts the subject image formed by the optical system 121 by an image sensor that operates according to the timing signal from the timing generation unit, and converts the analog signal output from the image sensor to an A / D converter. Is converted into a digital signal. Thereby, a captured image (hereinafter referred to as image data) as digital data is generated. In this embodiment, the pixel array of the image sensor is a Bayer array composed of R / Gr / Gb / B. However, a pixel array other than the Bayer array may be used.

102〜105および109〜120は画像処理装置としてのデジタル信号処理部を構成する構成要素を示している。本実施例におけるデジタル信号処理部は1つのLSIとして構成され、ハードウエアとして後述する画像処理を行う。ただし、デジタル信号処理部を画像処理専用のCPUで構成し、ソフトウエア(コンピュータプログラム)によって画像処理を行ってもよい。106〜108はデジタル信号処理部において生成される処理データを示している。   Reference numerals 102 to 105 and 109 to 120 denote components constituting a digital signal processing unit as an image processing apparatus. The digital signal processing unit in this embodiment is configured as one LSI, and performs image processing, which will be described later, as hardware. However, the digital signal processing unit may be configured by a CPU dedicated to image processing, and image processing may be performed by software (computer program). Reference numerals 106 to 108 denote processing data generated in the digital signal processing unit.

伝送系101は、撮像系100にて生成された画像データを、センサ補正部102に伝送する。センサの画素読出し順序を該センサ補正部102による補正順序に並べ替える手段をここに搭載してもよい。   The transmission system 101 transmits the image data generated by the imaging system 100 to the sensor correction unit 102. A means for rearranging the pixel readout order of the sensor to the correction order by the sensor correction unit 102 may be mounted here.

センサ補正部102は、撮像系100による画像データの生成に際しての撮像系100の構成要素の物理特性に起因する画質低下要因を補正する。例えば、イメージセンサのS/Nを改善したり、画素欠陥や感度欠陥に対する補正を行ったり、イメージセンサから信号を読み出すアンプの個体差に関する補正を行ったりする。センサ補正部102での処理が行われた画像データは、現像前データであるRAWデータ(図にはRAW Imageと記す)107として一時的に記憶されるとともに、WB検出部103および画像縮小処理部104へと送出される。   The sensor correction unit 102 corrects an image quality deterioration factor caused by physical characteristics of components of the imaging system 100 when the imaging system 100 generates image data. For example, the S / N of the image sensor is improved, a pixel defect or a sensitivity defect is corrected, or an individual difference of an amplifier that reads a signal from the image sensor is corrected. The image data that has been processed by the sensor correction unit 102 is temporarily stored as RAW data (denoted as RAW Image in the figure) 107 as pre-development data, as well as a WB detection unit 103 and an image reduction processing unit. It is sent to 104.

WB検出部103は、RAWデータにおけるホワイトバランスを評価するためのブロック積分回路(不図示)を搭載し、その積分結果であるホワイトバランス評価値106を一時的に記憶する。画像縮小処理部104は、RAWデータを距離マップ生成部105の要求処理サイズへとリサイズ(縮小化)する。距離マップ生成部105の要求画像サイズがセンサ補正部102からのRAWデータと等価である場合は、画像縮小処理部104でのリサイズを行わなくてもよい。要求処理サイズ(分解能)は、距離マップ生成部105が生成する後述する距離マップの使途によって決まる。   The WB detection unit 103 is equipped with a block integration circuit (not shown) for evaluating white balance in RAW data, and temporarily stores a white balance evaluation value 106 that is the integration result. The image reduction processing unit 104 resizes (reduces) the RAW data to the requested processing size of the distance map generation unit 105. When the requested image size of the distance map generation unit 105 is equivalent to the RAW data from the sensor correction unit 102, the image reduction processing unit 104 does not need to perform resizing. The required processing size (resolution) is determined by the use of a distance map, which will be described later, generated by the distance map generation unit 105.

距離マップ生成部(距離取得手段)105は、画像縮小処理部104からのリサイズ後のRAWデータを用いて、該RAWデータ中に写っている1または複数の被写体における被写体ごとの距離(被写体距離)を算出し、距離マップ108を生成する。距離マップ108は、被写体距離に関する情報に相当する。距離マップ生成部105は、距離マップ108の生成に、例えばDFD(Depth From Defocus)方式を用いる。DFDは、画像におけるぼけ(デフォーカス量)の情報から被写体距離を推定する方法である。   The distance map generation unit (distance acquisition unit) 105 uses the resized RAW data from the image reduction processing unit 104, and the distance (subject distance) for each subject in one or more subjects shown in the RAW data. And a distance map 108 is generated. The distance map 108 corresponds to information related to the subject distance. The distance map generation unit 105 uses, for example, a DFD (Depth From Defocus) method to generate the distance map 108. DFD is a method for estimating a subject distance from information on blur (defocus amount) in an image.

DFD方式を用いる場合には、距離マップ生成部105は、複数(2つ)のRAWデータに対してバンドパスフィルタ(BPF)をかけて、それらの出力パワーの相関をとる処理を行う。この際、RAWデータのうち低コントラスト被写体が写っている領域では低パワーが得られる一方、高コントラスト被写体(孤立点や画素飽和を生じさせる被写体)が写っている領域では高パワーが得られ、いずれの領域でも推定被写体距離の信頼度が低くなる。このため、距離マップ生成部105に、得られた距離マップ108の領域ごとの算出結果の信頼度(確かさ)を判定する信頼度判定部を設けてもよい。   When the DFD method is used, the distance map generation unit 105 performs a process of applying a band pass filter (BPF) to a plurality (two) of RAW data and correlating their output powers. At this time, in the RAW data, a low power is obtained in a region where a low-contrast subject is captured, while a high power is obtained in a region where a high-contrast subject (a subject causing an isolated point or pixel saturation) is captured. Even in this area, the reliability of the estimated subject distance is low. For this reason, the distance map generation unit 105 may be provided with a reliability determination unit that determines the reliability (certainty) of the calculation result for each region of the obtained distance map 108.

信頼度判定部は、画像縮小処理部104からのRAWデータからコントラストが低い領域と高い領域とを閾値を用いて検出し、検出された低コントラスト領域および高コントラスト領域のそれぞれの推定被写体距離の信頼度を求める。そして、信頼度が所定値より低い領域を無効データ領域(例えば0値で定義される領域)とする。   The reliability determination unit detects a low-contrast region and a high-contrast region from the RAW data from the image reduction processing unit 104 using threshold values, and the reliability of the estimated subject distance of each of the detected low-contrast region and high-contrast region is detected. Find the degree. Then, an area whose reliability is lower than a predetermined value is set as an invalid data area (for example, an area defined by 0 value).

距離マップ生成部105は、生成した距離マップ108のデータを一時的に記憶する。WB評価値106、RAWデータ107および距離マップ108は、DRAM等の記憶装置(不図示)に一旦格納し、後段の処理の開始に合わせて適宜、該記憶装置から読み出せばよい。   The distance map generation unit 105 temporarily stores data of the generated distance map 108. The WB evaluation value 106, the RAW data 107, and the distance map 108 may be temporarily stored in a storage device (not shown) such as a DRAM, and read from the storage device as appropriate at the start of subsequent processing.

ここで、距離マップ108は、撮像により得られた画像データ(本実施例ではRAWデータ)における画像領域ごとの被写体距離を示す数値の集合であり、その使途に適した分解能で生成される。使途としては、測距や被写体追尾の性能向上のための撮像シーン判別や、画像データファイルに添付してカメラ外部での画像処理(Computational Photography)等がある。また、被写体追尾を使途とする場合には、被写体の空間的な前後関係が把握可能な粗い分解能でもよい。   Here, the distance map 108 is a set of numerical values indicating the subject distance for each image area in the image data (RAW data in the present embodiment) obtained by imaging, and is generated with a resolution suitable for its use. Uses include imaging scene determination for improving the performance of distance measurement and subject tracking, image processing (Computational Photography) outside the camera attached to an image data file, and the like. When subject tracking is used, the resolution may be coarse so that the spatial context of the subject can be grasped.

ただし、距離マップの分解能を使途ごとに変更して、様々な分解能の距離マップを取り扱うのは、撮像処理のスループットやリソース負担の観点から適切ではない。このため、本実施例では、領域整合部119を設けている。領域整合部119は、距離マップ108において被写体距離が互いに異なる複数の距離領域と、後述する倍率色収差検出部116により倍率色収差量を検出する複数の色収差検出領域(つまりは倍率色収差を補正する補正対象領域)とを互いに整合(対応)させる。具体的には、距離領域が色収差検出領域に対して一対一で対応するように距離マップ108の再分割、言い換えれば解像度変換を行う。   However, it is not appropriate from the viewpoint of imaging processing throughput and resource burden to change the resolution of the distance map for each use and handle the distance map of various resolutions. For this reason, in this embodiment, a region matching unit 119 is provided. The region matching unit 119 includes a plurality of distance regions having different subject distances in the distance map 108 and a plurality of chromatic aberration detection regions (that is, correction targets for correcting the chromatic aberration of magnification) in which the amount of chromatic aberration of magnification is detected by the magnification chromatic aberration detection unit 116 described later. And (region) are matched (corresponding) to each other. Specifically, the distance map 108 is subdivided, that is, resolution conversion is performed so that the distance area corresponds to the chromatic aberration detection area on a one-to-one basis.

検出実施判定部120は、距離マップ108のうち領域整合部119によって色収差検出領域と対応するように解像度変換された複数の距離領域のうち任意の距離領域の被写体距離に応じて、倍率色収差検出部116による倍率色収差量の検出実施の有無を判定する。倍率色収差量の検出の実施の有無を判定するための閾値は、光学系121の組立て工程において、基準物体(被写体)を被写体距離を変えながら複数回実際に撮像し、被写体距離ごとの色ずれ量を光学系121の個体ごとに測定して決定すればよい。検出実施判定部120は、色収差検出領域ごとの倍率色収差量の検出実施の有無の結果を示すフラグ情報を倍率色収差検出部116に出力する。   The detection execution determination unit 120 is a magnification chromatic aberration detection unit according to the subject distance in an arbitrary distance region among a plurality of distance regions whose resolution is converted to correspond to the chromatic aberration detection region by the region matching unit 119 in the distance map 108. Whether or not the magnification chromatic aberration amount is detected by 116 is determined. The threshold for determining whether or not to detect the amount of chromatic aberration of magnification is the amount of color misregistration for each subject distance by actually imaging the reference object (subject) multiple times while changing the subject distance in the assembly process of the optical system 121. May be determined by measuring each individual optical system 121. The detection execution determination unit 120 outputs flag information indicating the result of whether or not the detection of the magnification chromatic aberration amount for each chromatic aberration detection region is performed to the magnification chromatic aberration detection unit 116.

WB補正部109,114はそれぞれ、センサ補正部102からのRAWデータに対して、WB評価値106に応じたホワイトバランス補正を行う。   Each of the WB correction units 109 and 114 performs white balance correction corresponding to the WB evaluation value 106 on the RAW data from the sensor correction unit 102.

同時化処理部110,115はそれぞれ、WB補正部109,114によってホワイトバランス補正がなされたRAWデータに対するデモザイク処理を行う。すなわち、同時化処理部115は、R,G,Bの3色のデモザイクデータを同時化した3つの画像データ(以下、まとめてRGB画像データともいう)を出力する。   The synchronization processing units 110 and 115 perform demosaic processing on the RAW data that has been subjected to white balance correction by the WB correction units 109 and 114, respectively. That is, the synchronization processing unit 115 outputs three image data (hereinafter, collectively referred to as RGB image data) obtained by synchronizing the demosaic data of the three colors R, G, and B.

なお、本実施例では、WB補正部109,114と同時化処理部114,115とを別々に構成しているが、これらを同一の回路としてもよい。   In the present embodiment, the WB correction units 109 and 114 and the synchronization processing units 114 and 115 are configured separately, but they may be the same circuit.

倍率色収差検出部(検出手段)116は、同時化処理部115からのRGB画像データのうち、検出実施判定部120からのフラグ情報が倍率色収差量の検出を実施することを示す色収差検出領域において倍率色収差量を検出する。そして、検出した倍率色収差量に応じてこれを補正するための補正量(第1の補正値:以下、算出補正量という)を算出する。ここで、倍率色収差量の検出には、その検出結果を用いた倍率色収差の補正対象と同様の画像データを用いることが望ましい。倍率色収差の補正は、後述する倍率色収差補正部111がWB補正部109にてホワイトバランス補正が行われたRGB画像データに対して行う。このため、倍率色収差検出部116は、WB補正部114によってホワイトバランス補正が行われたRGB画像データに対して倍率色収差量の検出を行う。   The magnification chromatic aberration detection unit (detection means) 116 has a magnification in a chromatic aberration detection region in which the flag information from the detection execution determination unit 120 of the RGB image data from the synchronization processing unit 115 indicates that the amount of magnification chromatic aberration is detected. The amount of chromatic aberration is detected. Then, a correction amount (first correction value: hereinafter referred to as a calculated correction amount) for correcting this is calculated according to the detected amount of lateral chromatic aberration. Here, for the detection of the amount of chromatic aberration of magnification, it is desirable to use the same image data as the correction target of the chromatic aberration of magnification using the detection result. The lateral chromatic aberration is corrected by the lateral chromatic aberration correcting unit 111 (to be described later) on the RGB image data that has been subjected to white balance correction by the WB correcting unit 109. For this reason, the magnification chromatic aberration detection unit 116 detects the amount of magnification chromatic aberration for the RGB image data on which the white balance correction is performed by the WB correction unit 114.

補正係数処理部117(算出手段)では、倍率色収差補正部111で使用する補正係数を準備する。ここでは、倍率色収差検出部116によって得た複数の色収差検出領域における算出補正量から、像高の関数としての代表値(以下、代表算出補正量という)を算出する。倍率色収差検出部116は、検出実施判定部120の結果に従い、算出補正量を持たない領域については光学系121の設計値に基づく補正量とのマージを行う必要がある。このときの光学系121の設計値に基づく補正量(第2の補正値:以下、設計補正量という)の代表値である代表設計補正量は、図1中117aのメモリ(記憶手段)に保持していればよい。   The correction coefficient processing unit 117 (calculation unit) prepares a correction coefficient to be used by the magnification chromatic aberration correction unit 111. Here, a representative value as a function of the image height (hereinafter referred to as a representative calculated correction amount) is calculated from the calculated correction amounts in the plurality of chromatic aberration detection regions obtained by the magnification chromatic aberration detection unit 116. The lateral chromatic aberration detection unit 116 needs to merge the correction amount based on the design value of the optical system 121 in the region that does not have the calculation correction amount, according to the result of the detection execution determination unit 120. A representative design correction amount, which is a representative value of the correction amount based on the design value of the optical system 121 at this time (second correction value: hereinafter referred to as design correction amount), is held in a memory (storage means) 117a in FIG. If you do.

代表設計補正量は、撮像時における光学系121の代表的な光学状態(被写体距離、絞り値およびズーム位置等)での像高の関数として保持(用意)された設計補正量である。この代表設計補正量から、撮影時光学条件下での設計補正量を補間演算によって得るのもこの補正係数処理部117である。   The representative design correction amount is a design correction amount held (prepared) as a function of the image height in a representative optical state (subject distance, aperture value, zoom position, etc.) of the optical system 121 at the time of imaging. It is this correction coefficient processing unit 117 that obtains the design correction amount under the optical conditions at the time of photographing from the representative design correction amount by interpolation calculation.

補正係数処理部117は、検出実施判定部120から出力されたフラグ情報に基づき、倍率色収差量の検出を実施する領域に対しては、算出補正量を選択する。一方、倍率色収差量の検出を実施しない領域に対しては、設計補正量を選択する。本実施例では、任意の像高方向の補正量の切り替えは、後述する色収差量検出領域の分解能と等価とする。よって、任意の像高方向の補正量を生成する際に、各像高において算出補正量と設計補正量の一方を使用補正量として選択し、倍率色収差補正部111で使用する使用補正量を決定する。補正係数処理部117は、使用補正量を図1中の倍率色収差補正部(処理手段)111に対して送出する。   Based on the flag information output from the detection execution determination unit 120, the correction coefficient processing unit 117 selects a calculated correction amount for a region where the magnification chromatic aberration amount is to be detected. On the other hand, a design correction amount is selected for a region where the detection of the magnification chromatic aberration amount is not performed. In this embodiment, switching of the correction amount in an arbitrary image height direction is equivalent to the resolution of a chromatic aberration amount detection area described later. Therefore, when generating a correction amount in an arbitrary image height direction, one of the calculated correction amount and the design correction amount is selected as the use correction amount at each image height, and the use correction amount used by the magnification chromatic aberration correction unit 111 is determined. To do. The correction coefficient processing unit 117 sends the use correction amount to the magnification chromatic aberration correction unit (processing unit) 111 in FIG.

倍率色収差補正部111は、同時化処理部110からのRGB画像データに対して、補正係数処理部117から受け取った使用補正量(算出補正量または設計補正量)を用いて、像高方向の色ずれ(例えば、G画像に対するRおよびB画像のずれ)の補正処理を行う。こうして倍率色収差が補正されたRGB画像データは、単色収差補正部112に送出される。   The lateral chromatic aberration correction unit 111 uses the use correction amount (calculated correction amount or design correction amount) received from the correction coefficient processing unit 117 for the RGB image data from the synchronization processing unit 110 to perform color correction in the image height direction. A correction process for a shift (for example, a shift between the R image and the B image with respect to the G image) is performed. The RGB image data in which the lateral chromatic aberration is corrected in this way is sent to the monochromatic aberration correction unit 112.

単色収差補正部112は、倍率色収差補正後のRGB画像データに対して、歪曲収差等の倍率色収差以外の収差の補正を行う。さらに、偽色抑圧部113は、単色収差補正部112による収差補正後のRGB画像データに対して、高輝度領域や高周波領域に発生する偽色および暗領域または低コントラスト領域に発生する色ノイズを抑圧する処理を行う。そして、処理後のRGB画像データを、現像処理部(記録処理部)や表示処理部に送出する。   The monochromatic aberration correction unit 112 corrects aberrations other than lateral chromatic aberration, such as distortion, on the RGB image data after lateral chromatic aberration correction. Further, the false color suppression unit 113 generates false color generated in the high luminance region and high frequency region and color noise generated in the dark region or low contrast region with respect to the RGB image data after the aberration correction by the monochromatic aberration correction unit 112. Perform suppression processing. Then, the processed RGB image data is sent to a development processing unit (recording processing unit) and a display processing unit.

図2(a),(b)には、本実施例において撮像により生成される画像データと距離マップ生成部105により生成される距離マップとのサイズの関係を示している。図2(a)に示すように、本実施例における画像データのサイズ(画素数)を水平M画素×垂直N画素とする。これに対して、図2(b)に示すように、距離マップ108は、水平m画素×垂直n画素(m<M,n<N)のサイズを有する。本実施例では、距離マップ108として、画像データと同等の解像度(分解能)は不要である。例えば、画像データのサイズが水平6000画素×垂直4000画素(24M画素)あったとしても、被写体距離は該24M画素を複数に分割した色収差検出領域ごとに得られればよいので、水平垂直とも100画素程度のサイズであってもよい。   FIGS. 2A and 2B show the size relationship between the image data generated by imaging and the distance map generated by the distance map generation unit 105 in this embodiment. As shown in FIG. 2A, the size (number of pixels) of the image data in this embodiment is horizontal M pixels × vertical N pixels. On the other hand, as shown in FIG. 2B, the distance map 108 has a size of horizontal m pixels × vertical n pixels (m <M, n <N). In this embodiment, the distance map 108 does not need a resolution (resolution) equivalent to that of the image data. For example, even if the size of the image data is horizontal 6000 pixels × vertical 4000 pixels (24M pixels), the subject distance only needs to be obtained for each chromatic aberration detection region obtained by dividing the 24M pixels into a plurality of pixels, and therefore 100 pixels in both horizontal and vertical directions. The size may be about.

また、図2(c)には、画像データを複数の色収差検出領域に分割した際の分割数を示す。1つの色収差検出領域は、画像データの複数の画素を含む。本実施例では、画像データを水平H領域×垂直V領域の色収差検出領域に分割する。   FIG. 2C shows the number of divisions when the image data is divided into a plurality of chromatic aberration detection areas. One chromatic aberration detection region includes a plurality of pixels of image data. In this embodiment, the image data is divided into chromatic aberration detection areas of horizontal H area × vertical V area.

図9には、本実施例において倍率色収差を検出する方向を示している。倍率色収差は、撮像面における光学系121の光軸位置を中心(起点)とした像高方向での色(波長)ごとの像倍率の違いとなって現れる。このため、特定の色画像に対する他の色画像の像高方向でのエッジ部のずれ量(例えば、G画像中のエッジ部に対するRおよびB画像中のエッジ部のずれ量)を検出することで、倍率色収差量を得ることができる。本実施例では、演算量を低減するため、図9に示すように光軸中心からの放射方向を8つの領域に分割し、それぞれの領域を代表する放射方向である上下(N, S)、左右(E, W)および斜め(NE,SE,SW,NW)を倍率色収差の検出方向とする。このように設定された倍率色収差の検出方向に対して、図2(c)に示す複数の色収差検出領域の配列方向は図9中に細線で示すように水平および垂直方向を向く。このため、本実施例では、各色収差検出領域がどの検出方向の領域に存在するかを判定し、判定した領域での検出方向でその色収差検出領域での倍率色収差の検出を行う。   FIG. 9 shows the direction in which the lateral chromatic aberration is detected in this embodiment. The chromatic aberration of magnification appears as a difference in image magnification for each color (wavelength) in the image height direction with the optical axis position of the optical system 121 on the imaging surface as the center (starting point). Therefore, by detecting the shift amount of the edge portion in the image height direction of another color image with respect to the specific color image (for example, the shift amount of the edge portion in the R and B images with respect to the edge portion in the G image). The amount of lateral chromatic aberration can be obtained. In this embodiment, in order to reduce the amount of calculation, as shown in FIG. 9, the radiation direction from the center of the optical axis is divided into eight regions, and the upper and lower (N, S), which are the radiation directions representing each region, Left and right (E, W) and diagonal (NE, SE, SW, NW) are taken as the detection direction of the lateral chromatic aberration. With respect to the detection direction of the lateral chromatic aberration set in this way, the arrangement direction of the plurality of chromatic aberration detection regions shown in FIG. 2C is directed to the horizontal and vertical directions as indicated by thin lines in FIG. For this reason, in this embodiment, it is determined in which detection direction each chromatic aberration detection region exists, and magnification chromatic aberration is detected in the chromatic aberration detection region in the detected direction in the determined region.

図3には、本実施例における領域整合部119の構成を示す。本実施例では、前述したように、距離マップ108の解像度(分解能)よりも色収差検出領域の解像度(分割数)の方が高いため、領域整合部119は、距離マップ108の解像度変換を行う。距離マップ108のデータはDRAM(不図示)上のマップ記憶部に格納され、DMAコントローラ(以下、DMACという)によって適宜読み出される。   FIG. 3 shows the configuration of the region matching unit 119 in the present embodiment. In the present embodiment, as described above, since the resolution (number of divisions) of the chromatic aberration detection region is higher than the resolution (resolution) of the distance map 108, the region matching unit 119 performs resolution conversion of the distance map 108. The data of the distance map 108 is stored in a map storage unit on a DRAM (not shown) and is appropriately read out by a DMA controller (hereinafter referred to as DMAC).

301〜309は領域整合部119の構成ブロックを示す。301は距離マップ108における距離領域(フレーム)をカウントする領域係数ブロックであり、302は画像データにおける色収差検出領域(フレーム)をカウントする領域係数ブロックである。   Reference numerals 301 to 309 denote constituent blocks of the area matching unit 119. Reference numeral 301 denotes an area coefficient block that counts distance areas (frames) in the distance map 108, and 302 denotes an area coefficient block that counts chromatic aberration detection areas (frames) in the image data.

309はフレーム制御ブロックであり、カメラに搭載された不図示のCPU(以下、カメラCPUという)からの開始イベントの到達に応じて、DMAC300に対してデータ転送要求信号sig_300)を送出する。また、フレーム制御ブロック309は、上記開始イベントによって領域計数ブロック301によるカウント動作が開始されるように、領域計数ブロック301にstatus信号sig_315を送出する。また、領域計数ブロック302にも、そのカウント動作が開始されるようにenable信号sig_313を送出する。   A frame control block 309 sends a data transfer request signal sig_300 to the DMAC 300 in response to the arrival of a start event from a CPU (not shown) mounted on the camera (hereinafter referred to as camera CPU). Also, the frame control block 309 sends a status signal sig_315 to the area counting block 301 so that the counting operation by the area counting block 301 is started by the start event. The enable signal sig_313 is also sent to the area counting block 302 so that the counting operation is started.

データ転送要求信号sig_300を受けたDMAC300は、マップ記憶部から読み出した注目ラインのマップデータsig_302および次期ラインのマップデータsig_301を、データバッファ303に送出する。   Upon receiving the data transfer request signal sig_300, the DMAC 300 sends the map data sig_302 of the attention line and the map data sig_301 of the next line read from the map storage unit to the data buffer 303.

データバッファ303は、注目ラインのマップデータsig_302をFIFO構成のバッファ3030に、また次期ラインのマップデータsig_301をFIFO構成のバッファ3031に順次書き込む。そして、データバッファ303は、これらマップデータを順次読み出して、注目ラインのマップデータsig_304を選択ブロックA306に、次期ラインのマップデータsig_305を選択ブロックA307に送出する。さらに、データバッファ303は、マップデータの送出タイミング(更新タイミング)を示すデータ更新信号sig_303を選択ブロックA306,307およびフレーム制御ブロック309に送出する。   The data buffer 303 sequentially writes the map data sig_302 of the target line into the buffer 3030 having the FIFO structure and the map data sig_301 of the next line into the buffer 3031 having the FIFO structure. The data buffer 303 sequentially reads the map data, and sends the map data sig_304 of the target line to the selection block A306 and the map data sig_305 of the next line to the selection block A307. Further, the data buffer 303 sends a data update signal sig_ 303 indicating the sending timing (update timing) of the map data to the selection blocks A 306 and 307 and the frame control block 309.

データ更新信号sig_303を受信したフレーム制御ブロック309は、領域計数ブロック302および比率計数ブロック304に対して進捗要求status信号sig_314を送出する。進捗要求status信号sig_314は、データ更新信号sig_303の出力時点から比率計数ブロック304への送出完了タイミング信号sig_307の出力時点までの間enableとなる。進捗要求status信号sig_314は、検出実施判定部120にも出力される。   The frame control block 309 that has received the data update signal sig_303 sends a progress request status signal sig_314 to the area counting block 302 and the ratio counting block 304. The progress request status signal sig_314 is enabled from the time when the data update signal sig_303 is output until the time when the transmission completion timing signal sig_307 is output to the ratio counting block 304. The progress request status signal sig_314 is also output to the detection execution determination unit 120.

領域計数ブロック302は、ライン単位のカウント完了ごとに、比率計数ブロック304に対してカウンタリセット信号sig_317を送出する。カウンタリセット信号sig_317は、カウント更新信号として比率計数ブロック305にも送出される。比率計数ブロック304,305は、距離マップ108の上述した解像度変換後の1つの距離領域と1つの色収差量検出領域とを整合(対応)させるために、該1つの距離領域に対応する色収差検出領域の個数の比率を設定する。そして、整合対象である色収差検出領域を切り替える時点で選択信号sig_306,sig_308をそれぞれ選択ブロックA306,307と選択ブロックB308に送出する。   The area counting block 302 sends a counter reset signal sig_317 to the ratio counting block 304 every time the line unit is counted. The counter reset signal sig_317 is also sent to the ratio counting block 305 as a count update signal. The ratio counting blocks 304 and 305 are configured to match (correlate) one distance area after the above-described resolution conversion of the distance map 108 and one chromatic aberration amount detection area, and a chromatic aberration detection area corresponding to the one distance area. Set the ratio of the number of. Then, selection signals sig_306 and sig_308 are sent to selection blocks A306 and 307 and selection block B308, respectively, at the time of switching the chromatic aberration detection area to be matched.

色収差検出領域毎の境界と、距離マップ上の距離領域単位とは境界が異なるので、色収差検出領域のデータ切替え点では、対応する距離マップ上の注目画素データと次期画素データとが混在する状況が発生する。比率計数ブロック304,305は、注目画素切替え点における後段側画素(色収差検出領域と等価の解像度の画素)上の注目画素重心を計算し、比率が0.5であれば注目画素データ(注目距離マップデータ)をそのまま選択する。反対に、そうでなければ次期画素データ(次期距離マップデータ)を選択するように選択信号sig_306,sig_308を出力する。   Since the boundary for each chromatic aberration detection area and the distance area unit on the distance map are different, there is a situation where the pixel data of interest and the next pixel data on the corresponding distance map are mixed at the data switching point of the chromatic aberration detection area. Occur. The ratio counting blocks 304 and 305 calculate the pixel-of-interest center of gravity on the rear-side pixel (pixel having a resolution equivalent to that of the chromatic aberration detection region) at the pixel-of-interest switching point. Select Map Data as it is. On the other hand, if not, the selection signals sig_306 and sig_308 are output so as to select the next pixel data (next distance map data).

選択ブロックA306は距離マップ上の注目ラインデータの水平方向のデータ選択セレクタであり、選択ブロックA307は次期ラインデータの水平方向のデータ選択セレクタである。そして、その結果を示す信号sig_309,sig_310を選択ブロックB308に送出する。選択ブロックBは、選択ブロックA306,307により選択された注目および次期ラインのマップデータに対して垂直方向のデータを選択する、データ選択セレクタである。そして、その選択結果を示す信号sig_311、つまりは解像度変換後の距離マップのデータを検出実施判定部120に出力する。   The selection block A306 is a horizontal data selection selector for the target line data on the distance map, and the selection block A307 is a horizontal data selection selector for the next line data. Then, signals sig_309 and sig_310 indicating the results are sent to the selection block B308. The selection block B is a data selection selector that selects data in the vertical direction with respect to the map data of the attention and next line selected by the selection blocks A 306 and 307. Then, the signal sig_311 indicating the selection result, that is, the distance map data after resolution conversion is output to the detection execution determination unit 120.

図4〜図8には、領域整合部119の上述した各ブロックのロジックを示している。各ロジックは定常状態(一括に順次走査で行われる1フレーム処理)での代表的な動作を示している。また、各構成ブロックの回路は共通の同期クロックに同期して(同相転送が成立するように)動作するものとする。   4 to 8 show the logic of each block described above of the region matching unit 119. FIG. Each logic represents a typical operation in a steady state (one-frame processing performed by batch sequential scanning). In addition, the circuit of each component block operates in synchronization with a common synchronous clock (so that in-phase transfer is established).

図4には、フレーム制御ブロック309のロジックを示している。リセット信号reg_3091は、カメラCPUによって設定され、信号値「1」によって状態保持素子(DFF)を初期状態に戻す。トリガ信号reg_3092は、カメラCPUによって設定され、信号値「1」のときに領域整合部119による整合動作を開始させる。トリガ信号reg_3092のイベント(信号値「1」の設定)は、リセット信号reg_3091の発行とは排他制御とする。   FIG. 4 shows the logic of the frame control block 309. The reset signal reg_3091 is set by the camera CPU, and returns the state holding element (DFF) to the initial state by the signal value “1”. The trigger signal reg — 3092 is set by the camera CPU, and starts the alignment operation by the region alignment unit 119 when the signal value is “1”. The event of trigger signal reg — 3092 (setting of signal value “1”) is controlled exclusively with the issuance of reset signal reg — 3091.

フレーム制御ブロック309は、リセット信号reg_3091の解除時にトリガ信号reg_3092を受信すると、DMAC300に対してデータ転送要求信号sig_300を送出する。トリガ信号reg_3092はパルス信号であり、データ転送要求信号sig_300もパルス信号として出力される。データ転送要求信号sig_300を出力したフレーム制御ブロック309は、領域計数ブロック302に送出するenable信号sig_313を信号値「1」の状態に遷移させ、保持する。   When receiving the trigger signal reg_3092 when the reset signal reg_3091 is released, the frame control block 309 sends a data transfer request signal sig_300 to the DMAC 300. The trigger signal reg_3092 is a pulse signal, and the data transfer request signal sig_300 is also output as a pulse signal. The frame control block 309 that has output the data transfer request signal sig_300 causes the enable signal sig_313 to be transmitted to the area counting block 302 to transition to the state of the signal value “1” and holds it.

また、データ転送要求信号sig_300が送出されると、データバッファ部303はデータ更新信号sig_303をフレーム制御ブロック309に送出する。データ更新信号sig_303)はパルス信号であり、同期クロックの1周期分の幅で出力される。   When the data transfer request signal sig_300 is transmitted, the data buffer unit 303 transmits the data update signal sig_303 to the frame control block 309. The data update signal sig_303) is a pulse signal and is output with a width corresponding to one cycle of the synchronous clock.

データ更新信号sig_303とenable信号sig_313は、AND論理によって進捗要求status信号sig_314を信号値「1」の状態に遷移させて保持する。enable信号sig_313の信号値「1」は、領域計数ブロック302のカウント動作のenable状態を示す。進捗要求status信号sig_314の信号値「1」は、領域計数ブロック302のカウント値の更新および比率計数ブロック304のカウント値の更新を示す。   The data update signal sig_303 and the enable signal sig_313 are changed by holding the progress request status signal sig_314 to the state of the signal value “1” by AND logic. The signal value “1” of the enable signal sig_ 313 indicates the enable state of the count operation of the area counting block 302. The signal value “1” of the progress request status signal sig_314 indicates the update of the count value of the area count block 302 and the update of the count value of the ratio count block 304.

データ更新信号sig_307は、検出実施判定部120に対する1データの送出が完了したことを示すパルス信号である。この送出完了タイミング信号sig_307の到達によって、フレーム制御ブロック309は、進捗要求status信号sig_314を信号値「0」の状態に遷移させて保持する。また、これとともに、フレーム制御ブロック309は、DMAC300に対して距離マップ108における次期処理データを要求するために、データ転送要求信号sig_300を発行する。また、データ更新信号sig_307を受けたフレーム制御ブロック309は、フレーム更新信号sig_316を領域計数ブロック301に送出し、距離マップ108に対するフレームカウントの更新を知らせる。   The data update signal sig_307 is a pulse signal indicating that the transmission of one data to the detection execution determination unit 120 is completed. Upon arrival of the transmission completion timing signal sig_307, the frame control block 309 changes the progress request status signal sig_314 to the signal value “0” state and holds it. At the same time, the frame control block 309 issues a data transfer request signal sig_300 to request the next processing data in the distance map 108 from the DMAC 300. Also, the frame control block 309 that has received the data update signal sig_307 sends a frame update signal sig_316 to the area count block 301 to notify the update of the frame count for the distance map 108.

図5には、領域計数ブロック301,302のロジックを示している。図中の括弧なしの符号は領域計数ブロック301に関する信号または設定値を示し、括弧付きの符号は領域計数ブロック302に関する信号または設定値を示している。領域計数ブロック301は距離マップ108に対する処理の進捗を管理し、領域計数ブロック302は倍率色収差検出領域に対する処理の進捗を管理する。   FIG. 5 shows the logic of the area counting blocks 301 and 302. In the figure, reference numerals without parentheses indicate signals or setting values relating to the area counting block 301, and reference numerals with parentheses indicate signals or setting values relating to the area counting block 302. The area counting block 301 manages the progress of processing for the distance map 108, and the area counting block 302 manages the progress of processing for the magnification chromatic aberration detection area.

領域計数ブロック301において、Hサイズ設定値reg_3011は距離マップ108の水平方向でのサイズ(画素数)を設定し、Vサイズ設定値reg_3012は距離マップ108の垂直方向でのサイズ(画素数)を設定する。   In the area counting block 301, the H size setting value reg_3011 sets the size (number of pixels) in the horizontal direction of the distance map 108, and the V size setting value reg_3012 sets the size (number of pixels) in the vertical direction of the distance map 108. To do.

status信号sig_315が信号値「0」の状態では、領域計数ブロック301は、そのDFF501,502がリセット状態となり、カウント処理は行わない。status信号sig_315が信号値「1」の状態では、領域計数ブロック301はカウント処理を行う。領域計数ブロック301のDFF501は、水平方向での処理画素数をカウントする。フレーム更新信号sig_316が信号値「1」のときに、DFF501のカウント値はインクリメントされる。また、領域計数ブロック301のDFF502は、垂直方向の処理画素数をカウントする。水平および垂直方向の処理画素数のカウント結果がそれぞれ、Hサイズ設定値reg_301およびVサイズ設定値reg_3012に到達すると、領域計数ブロック301はフレーム制御ブロック309に信号値「1」の出力信号sig_312を送出する。   In the state where the status signal sig_315 is a signal value “0”, the DFFs 501 and 502 of the area counting block 301 are in a reset state, and the count process is not performed. When the status signal sig_315 is in the signal value “1”, the area counting block 301 performs a count process. The DFF 501 of the area counting block 301 counts the number of processed pixels in the horizontal direction. When the frame update signal sig_316 is a signal value “1”, the count value of the DFF 501 is incremented. Further, the DFF 502 of the area counting block 301 counts the number of processed pixels in the vertical direction. When the count results of the number of processed pixels in the horizontal and vertical directions reach the H size setting value reg_301 and the V size setting value reg_3012, respectively, the area counting block 301 sends an output signal sig_312 having a signal value “1” to the frame control block 309. To do.

一方、領域計数ブロック302において、H領域設定値reg_3021は倍率色収差検出領域の水平方向での領域数を設定し、V画像数設定値reg_3022は率色収差検出領域の垂直方向での領域数を設定する。enable信号sig_313が信号値「1」の状態であり、かつ進捗要求status信号sig_314が信号値「1」の状態であるとき、DFF501のカウント値はインクリメントされる。DFF501のカウント値がH領域設定値reg_3021と等しくなったときにDFF502はインクリメントされる。水平および垂直方向でのカウント結果がそれぞれ設定値reg_3021,reg_3022に到達したとき、領域計数ブロック301はフレーム制御ブロック309に信号値「1」の出力信号sig_318を送出する。領域計数ブロック302では、水平方向でのカウント値Hが領域設定値reg_3021と等価な値に到達することに応じて、進捗要求status信号sig_314の信号値「1」の到達を示す信号をカウンタリセット信号sig_317として出力する。このカウンタリセット信号sig_317は、比率計数ブロック304,305に対して送出される。   On the other hand, in the area counting block 302, the H area setting value reg_3021 sets the number of areas in the horizontal direction of the magnification chromatic aberration detection area, and the V image number setting value reg_3022 sets the number of areas in the vertical direction of the chromatic aberration detection area. . When the enable signal sig_313 is in the state of the signal value “1” and the progress request status signal sig_314 is in the state of the signal value “1”, the count value of the DFF 501 is incremented. When the count value of the DFF 501 becomes equal to the H region setting value reg_3021, the DFF 502 is incremented. When the count results in the horizontal and vertical directions reach the set values reg_3021, reg_3022, the area counting block 301 sends an output signal sig_318 having a signal value “1” to the frame control block 309. In the area counting block 302, in response to the count value H in the horizontal direction reaching a value equivalent to the area setting value reg_3021, a signal indicating the arrival of the signal value “1” of the progress request status signal sig_314 is output as a counter reset signal. It outputs as sig_317. The counter reset signal sig_317 is sent to the ratio counting blocks 304 and 305.

図6には、比率計数ブロック304,305のロジックを示している。図中の括弧なしの符号は比率計数ブロック304に関する信号または設定値を示し、括弧付きの符号は比率計数ブロック305に関する信号または設定値を示している。   FIG. 6 shows the logic of the ratio counting blocks 304 and 305. In the figure, reference numerals without parentheses indicate signals or setting values relating to the ratio counting block 304, and reference numerals with parentheses indicate signals or setting values relating to the ratio counting block 305.

比率計数ブロック304において、H比率設定値reg_3041は、距離マップ108の水平1画素に対応する画像データの水平方向での画素数の比率を設定する。例えば、水平方向において距離マップ108の1画素が2.4個の画像データ画素数に対応する場合には、H比率設定値reg_3041は2.4に相当する値を設定する。この2.4個相当の画像データ画素数を含む領域が色収差検出領域と等価となる。ハードウエアは固定小数点として実装可能であり、その場合には多ビット中のどこに少数点を設定するかは回路実装時に所望の分解能(2.4相当の数値をどこまで細かく持つか)の要求仕様を鑑みて決定すればよい。   In the ratio counting block 304, the H ratio setting value reg_3041 sets the ratio of the number of pixels in the horizontal direction of the image data corresponding to one horizontal pixel of the distance map 108. For example, when one pixel of the distance map 108 corresponds to the number of image data pixels of 2.4 in the horizontal direction, the H ratio setting value reg_3041 is set to a value corresponding to 2.4. An area including the number of image data pixels corresponding to 2.4 is equivalent to a chromatic aberration detection area. The hardware can be implemented as a fixed point. In that case, where to set the decimal point in many bits, the required specification of the desired resolution (how much the value equivalent to 2.4 is held) at the time of circuit implementation It may be determined in view of the above.

比率計数ブロック304は、進捗要求status信号sig_314の信号値が「1」になるごとに、比率の計算を更新する。DFF601は、1つの色収差検出領域に対する処理が完了するごとに1.0の値を積算する。DFF601は、小数点以下の分解能を持ち、積算値がH比率設定値reg_3041を超えることに応じて、積算値を、現在の積算値からH比率設定値reg_3041を差し引いた結果値に更新する。また、DFF601は、進捗要求status信号sig_314が到達すると、更新された積算値中の0.5の位の信号(1bit)を選択信号sig_306として送出する。さらに、DFF601は、カウンタリセット信号sig_317の信号値「1」が入力されると積算値をリセットする。   The ratio counting block 304 updates the calculation of the ratio every time the signal value of the progress request status signal sig_314 becomes “1”. The DFF 601 accumulates a value of 1.0 each time processing for one chromatic aberration detection region is completed. The DFF 601 has a resolution below the decimal point, and updates the integrated value to a result value obtained by subtracting the H ratio set value reg_3041 from the current integrated value when the integrated value exceeds the H ratio set value reg_3041. In addition, when the progress request status signal sig_314 arrives, the DFF 601 transmits a signal (1 bit) at the place of 0.5 in the updated integrated value as the selection signal sig_306. Furthermore, the DFF 601 resets the integrated value when the signal value “1” of the counter reset signal sig_317 is input.

比率計数ブロック305の動作は、比率計数ブロック305の動作と同様である。V比率設定値reg_3051は、距離マップ108の垂直1画素に対応する色収差検出領域の垂直方向での個数の比率を設定する。このV比率設定値reg_3051は、距離マップ108および画像データの画素が正方格子配列されている場合は、H比率設定値reg_3041と同じ値でよい。ただし、比率計数ブロック305において、DFF601は、積算値の更新をカウンタリセット信号sig_317の入力に応じて行う。また、該DFF601は、積算値のリセットを、出力信号sig_318の入力に応じて行う。   The operation of the ratio counting block 305 is the same as the operation of the ratio counting block 305. The V ratio set value reg_3051 sets the ratio of the number of chromatic aberration detection areas in the vertical direction corresponding to one vertical pixel in the distance map 108. This V ratio set value reg_3051 may be the same value as the H ratio set value reg_3041 when the distance map 108 and the pixels of the image data are arranged in a square lattice. However, in the ratio counting block 305, the DFF 601 updates the integrated value according to the input of the counter reset signal sig_317. The DFF 601 resets the integrated value in response to the input of the output signal sig_318.

図7には、選択ブロックA306,307のロジックを示している。図中の括弧なしの符号は選択ブロックA306に関する信号を示し、括弧付きの符号は選択ブロックA307に関する信号を示している。   FIG. 7 shows the logic of the selection blocks A 306 and 307. In the figure, reference numerals without parentheses indicate signals related to the selection block A306, and reference numerals with parentheses indicate signals regarding the selection block A307.

前述したように選択ブロックA306は距離マップ108における注目ラインのマップデータに対する処理を行い、選択ブロックA307は距離マップ108における次期ラインのマップデータに対する処理を行う。これら選択ブロックA306,307におけるデータ更新は、データ更新信号sig_303の入力タイミングで行われる。選択ブロックA306において、DFF702には注目ラインのマップデータの注目画素データが保持され、DFF701には該注目ラインのマップデータの次期画素データが保持される。一方、選択ブロックA307において、DFF702には次期ラインのマップデータの注目画素データが保持され、DFF701には該次期ラインのマップデータの次期画素データが保持される。選択ブロックA306,307において、選択信号sig_306が信号値「1」である場合にはDFF701が保持する次期画素データが選択され、選択信号sig_306が信号値「0」である場合にはDFF702が保持する注目画素データが選択される。この選択は、注目する色収差検出領域の対応する距離マップ上距離領域の水平方向の切り替え選択であるので、注目ラインと次期ラインで共通の信号sig_306の指示に従う。   As described above, the selection block A 306 performs processing on the map data of the target line in the distance map 108, and the selection block A 307 performs processing on the map data of the next line in the distance map 108. Data update in these selection blocks A306 and 307 is performed at the input timing of the data update signal sig_303. In the selection block A306, the DFF 702 holds the target pixel data of the map data of the target line, and the DFF 701 stores the next pixel data of the map data of the target line. On the other hand, in the selection block A307, the DFF 702 holds the target pixel data of the map data of the next line, and the DFF 701 holds the next pixel data of the map data of the next line. In the selection blocks A 306 and 307, when the selection signal sig_306 has the signal value “1”, the next pixel data held by the DFF 701 is selected, and when the selection signal sig_306 has the signal value “0”, the DFF 702 holds. The target pixel data is selected. Since this selection is a horizontal switching selection of the distance area on the distance map corresponding to the chromatic aberration detection area of interest, the instruction of the signal sig_306 common to the attention line and the next line is followed.

図8は、選択ブロックB308のロジックを示す。DFF801には、選択ブロックA306の出力信号sig_309として注目ライン上の距離情報が、信号sig_303の入力タイミングで入力される。DFF802には、選択ブロックA307の出力信号sig_310として次期ライン上の距離情報が、信号sig_303の入力タイミングで入力される。DFF801とDFF802の出力の選択は、比率計数ブロック305の出力信号sig_308の状態で選択される。図8中、該信号sig_308が「0」値であれば注目ラインの距離情報を選択し、「1」値であれば次期ラインの距離情報を選択する。   FIG. 8 shows the logic of the selection block B308. The distance information on the target line is input to the DFF 801 as the output signal sig_309 of the selection block A306 at the input timing of the signal sig_303. Distance information on the next line is input to the DFF 802 as the output signal sig_310 of the selection block A307 at the input timing of the signal sig_303. The selection of the outputs of DFF 801 and DFF 802 is selected in the state of the output signal sig_308 of the ratio counting block 305. In FIG. 8, if the signal sig_308 is “0” value, the distance information of the line of interest is selected, and if it is “1” value, the distance information of the next line is selected.

領域整合部119からの出力は、倍率色収差検出部116にて倍率色収差量が検出される色収差検出領域の解像度に整合した分解能を有する距離マップのデータである。図11には、距離マップのデータを色収差検出領域の解像度に整合する過程の例を示している。実際の距離マップは多値情報であり、図11(a)〜(c)は該多値情報を白黒画像データとして示している。これらの図において、被写体距離が近距離であるほど白に近い色で、遠距離であるほど黒に近い色で示している。   The output from the region matching unit 119 is distance map data having a resolution that matches the resolution of the chromatic aberration detection region in which the magnification chromatic aberration amount is detected by the magnification chromatic aberration detection unit 116. FIG. 11 shows an example of the process of matching the distance map data with the resolution of the chromatic aberration detection area. The actual distance map is multi-value information, and FIGS. 11A to 11C show the multi-value information as monochrome image data. In these figures, the closer the subject distance is, the closer the color is to white, and the farther the distance is, the closer the color is to black.

図11(a)には、距離マップ108を示している。この図では、距離マップ108の画素数(解像度)を横10画素×縦7画素としている。ただし、これは理解を容易にするための例であり、実際の距離マップはより多くの画素数を有してもよい。図11(b)には、図11(a)に示した距離マップ108上に、領域整合部119での解像度変換後の距離マップにおける複数の距離領域を重ねて示している。白い枠で囲まれた1つの領域が解像度変換後の1つの距離領域を示している。   FIG. 11A shows a distance map 108. In this figure, the number of pixels (resolution) of the distance map 108 is set to horizontal 10 pixels × vertical 7 pixels. However, this is an example for facilitating understanding, and an actual distance map may have a larger number of pixels. In FIG. 11B, a plurality of distance regions in the distance map after resolution conversion by the region matching unit 119 are superimposed on the distance map shown in FIG. One area surrounded by a white frame represents one distance area after resolution conversion.

図11(c)には、領域整合部119での解像度変換後の距離マップ(図3中の信号sig_311)を画像データとして示している。この距離マップの1つの距離領域は1つの色収差検出領域に対応する。   FIG. 11C shows a distance map (signal sig_311 in FIG. 3) after resolution conversion in the region matching unit 119 as image data. One distance area of this distance map corresponds to one chromatic aberration detection area.

図10は、検出実施判定部120の構成を示す。   FIG. 10 shows the configuration of the detection execution determination unit 120.

図3中信号sig_314は、同図3中信号sig_311が有効であることを示すstatus信号である。検出実施判定部120は、該信号sig_314が「1」値であるときの信号sig_311を取り込む。これらの信号sig_311,sig_314は、図10に示す検出実施判定部120の受信側I/F制御ブロック1201を介して、検出実施判定部120の内部信号として取り込まれる。受信側I/F制御ブロック1201に取り込んだ任意の距離領域での被写体距離(多値データ)と設定値reg_1000との大小比較を、同図10中1206の比較器において実施する。設定値(閾値)reg_1000は、前述したように光学系121の組立て工程において基準物体を被写体距離を変えながら実際に撮像したときの被写体距離ごとの色ずれ量を光学系121の個体ごとに測定して決定した値である。比較器1206は、被写体距離が設定値reg_1000よりも小さい、すなわち近距離であると判定した距離領域(第1の距離領域)に対しては、判定結果(比較結果)として1の値を出力し、これをテンポラリバッファ1204に一時的に記憶させる。本実施例において、テンポラリバッファ1204は、フレーム単位(画像1枚分)の判定結果を保持することが可能な容量を持つ。実際には、後段の倍率色収差検出部116の処理速度を鑑みてフレーム単位よりも小容量に設定してもよい。   A signal sig_314 in FIG. 3 is a status signal indicating that the signal sig_311 in FIG. 3 is valid. The detection execution determination unit 120 takes in the signal sig_311 when the signal sig_314 has a “1” value. These signals sig_311 and sig_314 are taken in as internal signals of the detection execution determination unit 120 via the reception-side I / F control block 1201 of the detection execution determination unit 120 shown in FIG. The comparison of the subject distance (multi-valued data) and the set value reg_1000 in an arbitrary distance area taken into the receiving-side I / F control block 1201 is performed in the comparator 1206 in FIG. The set value (threshold value) reg_1000 measures the amount of color misregistration for each subject distance when the reference object is actually imaged while changing the subject distance in the assembly process of the optical system 121 as described above. This is the value determined. The comparator 1206 outputs a value of 1 as a determination result (comparison result) for a distance area (first distance area) determined that the subject distance is smaller than the set value reg_1000, that is, a short distance. This is temporarily stored in the temporary buffer 1204. In this embodiment, the temporary buffer 1204 has a capacity capable of holding a determination result in units of frames (for one image). Actually, the capacity may be set smaller than the frame unit in consideration of the processing speed of the magnification chromatic aberration detection unit 116 in the subsequent stage.

比較器1206は、被写体距離が設定値reg_1000よりも大きい、すなわち遠距離であると判定した距離領域(第2の距離領域)に対しては、判定結果として0の値を出力し、これをテンポラリバッファ1204に一時的に記憶させる。また、図11(d)には、色収差検出領域ごとの倍率色収差量の検出の実施の有無を二値データとして示している。倍率色収差量の検出を実施する色収差検出領域を白(1値)で示し、倍率色収差量の検出を実施しない色収差検出領域を黒(0値)で示している。この二値データは、検出実施判定部120から出力される。   The comparator 1206 outputs a value of 0 as a determination result for a distance area (second distance area) determined that the subject distance is greater than the set value reg_1000, that is, a long distance, and this is temporarily output. The data is temporarily stored in the buffer 1204. FIG. 11D shows binary data indicating whether or not the magnification chromatic aberration amount is detected for each chromatic aberration detection region. A chromatic aberration detection area where the magnification chromatic aberration amount is detected is indicated by white (1 value), and a chromatic aberration detection area where the magnification chromatic aberration amount is not detected is indicated by black (0 value). This binary data is output from the detection execution determination unit 120.

こうして、領域整合部119からの距離マップのデータ(sig_311)が比較器1206に入力されるごとに、テンポラリバッファ1204に判定結果が一時的に記憶される。検出実施判定部120の後段の倍率色収差検出部116からのデータ転送要求信号sig_1002は、送信側I/F制御部1205を介してアービター1202に入力される。アービター1202は、検出実施判定部120の前段の領域整合部119からのデータの受信と後段の倍率色収差検出部116からのデータ転送要求とが衝突した場合に、前段側からの受信データの書き込みを優先し、後段側からのデータ転送要求を保留(保持)するようアービトレーションを行う。   In this way, each time the distance map data (sig_311) from the region matching unit 119 is input to the comparator 1206, the determination result is temporarily stored in the temporary buffer 1204. A data transfer request signal sig_1002 from the magnification chromatic aberration detection unit 116 at the subsequent stage of the detection execution determination unit 120 is input to the arbiter 1202 via the transmission-side I / F control unit 1205. The arbiter 1202 writes the received data from the previous stage when the reception of data from the previous area matching unit 119 of the detection execution determination unit 120 and the data transfer request from the subsequent magnification chromatic aberration detection unit 116 collide. Prioritize and arbitrate to hold (hold) the data transfer request from the succeeding stage.

また、アービター1202は、受信データのテンポラリバッファ1204への格納およびデータ転送要求に対応する送信データのテンポラリバッファ1204からの読み出しごとに、RAM_I/F制御部1203にデータ処理要求を送出する。   In addition, the arbiter 1202 sends a data processing request to the RAM_I / F control unit 1203 each time the received data is stored in the temporary buffer 1204 and the transmission data corresponding to the data transfer request is read from the temporary buffer 1204.

RAM I/F制御部1203は、データ処理要求を受けて、テンポラリバッファ1204に対するアドレス信号の発行、read/write statusの発行およびenable信号の発行等を行う。これにより、テンポラリバッファ1204に対するデータの送受信の制御を行う。テンポラリバッファ1204から読み出された上記判定結果のデータは、送信側I/F制御部1205を介して、データsig_1000およびデータ有効ステータスsig_1001として後段に送出される。   In response to the data processing request, the RAM I / F control unit 1203 issues an address signal to the temporary buffer 1204, issues a read / write status, issues an enable signal, and the like. Thus, transmission / reception of data to / from the temporary buffer 1204 is controlled. The data of the determination result read from the temporary buffer 1204 is sent to the subsequent stage as data sig_1000 and data valid status sig_1001 via the transmission side I / F control unit 1205.

なお、検出実施判定部120に、処理領域の絶対位置を認識するフレームカウンタを実装して、光軸中心位置の情報と像高閾値情報とを設定してもよい。そして、像高閾値よりも低い像高においては比較器1206の出力を破棄し、倍率色収差量の検出を実施しないように判定結果を出力するように構成してもよい。   It should be noted that a frame counter that recognizes the absolute position of the processing region may be mounted in the detection execution determination unit 120 to set information on the optical axis center position and image height threshold information. Then, at the image height lower than the image height threshold, the output of the comparator 1206 may be discarded and the determination result may be output so as not to detect the magnification chromatic aberration amount.

倍率色収差検出部116は、ホワイトバランス補正を行い、かつ同時化したRGB画像データと検出実施判定部120からの判定結果とを受信し、該判定結果が倍率色収差量の検出の実施を示す色収差検出領域に対してのみ倍率色収差量の検出を行う。そして、検出した倍率色収差量に基づいて前述した算出補正量算出する。倍率色収差検出部116は、算出補正量と検出実施判定部120からの判定結果を補正係数処理部117に送出する。   The lateral chromatic aberration detection unit 116 performs white balance correction and receives the synchronized RGB image data and the determination result from the detection execution determination unit 120, and the determination result indicates detection of the amount of lateral chromatic aberration. The magnification chromatic aberration amount is detected only for the region. Then, the above-described calculation correction amount is calculated based on the detected magnification chromatic aberration amount. The lateral chromatic aberration detection unit 116 sends the calculated correction amount and the determination result from the detection execution determination unit 120 to the correction coefficient processing unit 117.

補正係数処理部117には、算出補正量と、検出実施判定部120からの判定結果と、前述した設計補正量とが入力される。   The correction coefficient processing unit 117 receives the calculated correction amount, the determination result from the detection execution determination unit 120, and the design correction amount described above.

光学系121の設計上の倍率色収差量(以下、設計色収差量ともいう)は、被写体距離、ズーム位置および絞り値等の光学状態に応じて変化するとともに、像高に応じて変化する。図12(a),(b)中のh1〜h8は、任意の光学状態における全像高を8つの像高領域に分割したときの該8つの像高領域の設計色収差量(図12(b)には色ずれ量と記す)の代表値を示している。図12(a)における1200は光軸中心位置を示す。図12(b)では、像高領域ごとの色ずれ量の代表値をスプライン補間等で近似して生成した近似曲線を示している。実際の撮像時には、光学系121の光学状態(光学条件)が決定した後に像高領域ごとの色ずれ量に対する近似曲線を生成し、この近似曲線で表される色ずれ量に対して倍率色収差補正部111が補正を行うようにする。   The amount of lateral chromatic aberration in design of the optical system 121 (hereinafter also referred to as “design chromatic aberration amount”) changes according to the optical state such as the subject distance, zoom position, aperture value, and the like, and also changes according to the image height. In FIGS. 12A and 12B, h1 to h8 denote design chromatic aberration amounts of the eight image height regions (FIG. 12B when the total image height in an arbitrary optical state is divided into eight image height regions. ) Shows the representative value of the color misregistration amount). In FIG. 12A, reference numeral 1200 denotes the optical axis center position. FIG. 12B shows an approximate curve generated by approximating the representative value of the color misregistration amount for each image height region by spline interpolation or the like. At the time of actual imaging, after an optical state (optical condition) of the optical system 121 is determined, an approximate curve for the color shift amount for each image height region is generated, and magnification chromatic aberration correction is performed for the color shift amount represented by this approximate curve. The unit 111 performs correction.

補正係数処理部117は、検出実施判定部120からの判定結果に応じて、算出補正量および設計補正量のうち一方を選択して使用補正量として倍率色収差補正部111に送出する。   The correction coefficient processing unit 117 selects one of the calculated correction amount and the design correction amount according to the determination result from the detection execution determination unit 120 and sends it to the magnification chromatic aberration correction unit 111 as a use correction amount.

以上説明したように、本実施例では、距離マップを生成し、距離マップにおける距離領域を撮像画像(RGB画像データ)における色収差検出領域に整合(対応)させる処理を行う。その上で、色収差検出領域ごとに倍率色収差量の検出(つまりは算出補正量の生成)を行うか否かを判定する。そして、倍率色収差量の検出を行うと判定された色収差検出領域では算出補正量を用いて補正処理を行い、倍率色収差量の検出を行わないと判定された色収差検出領域では設計補正量を用いて補正処理を行う。これにより、撮像画像(入力画像)の全体にわたる複数の色収差検出領域の全てにおいて算出補正量を算出する場合に比べて演算量を低減しつつ、倍率色収差が良好に補正された結果画像を得ることができる。   As described above, in this embodiment, a distance map is generated, and a process of matching (corresponding) the distance area in the distance map to the chromatic aberration detection area in the captured image (RGB image data) is performed. Then, it is determined whether or not to detect the magnification chromatic aberration amount (that is, to generate a calculated correction amount) for each chromatic aberration detection region. Then, the correction processing is performed using the calculated correction amount in the chromatic aberration detection region determined to detect the magnification chromatic aberration amount, and the design correction amount is used in the chromatic aberration detection region determined not to detect the magnification chromatic aberration amount. Perform correction processing. As a result, it is possible to obtain a result image in which the chromatic aberration of magnification is favorably corrected while reducing the calculation amount compared to the case where the calculation correction amount is calculated in all of the plurality of chromatic aberration detection regions over the entire captured image (input image). Can do.

なお、本実施例では、距離マップの生成にDFD方式を用いる場合について説明したが、他の方法を用いて距離マップを生成してもよい。   In this embodiment, the case where the DFD method is used for generating the distance map has been described, but the distance map may be generated using other methods.

撮像部と被写体との距離の関係は、デフォーカス量(像側移動量)として算出される。デフォーカス量を物体距離として扱うには、このデフォーカス量を物体側の距離に変換する処理が必要である。図13には、被写体距離とデフォーカス量との関係を示している。   The relationship between the distance between the imaging unit and the subject is calculated as a defocus amount (image-side movement amount). In order to treat the defocus amount as the object distance, processing for converting the defocus amount into the object side distance is required. FIG. 13 shows the relationship between the subject distance and the defocus amount.

光学系121の横倍率をM(=Y/X)とし、焦点距離をfとし、被写体距離を(A+f)とし、像距離を(B+f)とすると、
M=Y/X
=f/A=B/f (1)
である。(1)式に(fA)を乗じると、
f/A・(fA)=B/f・(fA) (2)
であるので、
=A・B (3)
となる。
また、物体移動量をaとし、これに対応するデフォーカス量をbとすると、
(A+a)(B+b)=f(4)
となる。
そして、(3),(4)式から、
(A+a)=(A・B)/(B+b) (5)
が得られる。このように、被写体距離(A+a)とデフォーカス量bとの関係は(5)式より表される。(5)式の右辺から距離A(前側焦点距離から物体面まで距離)を消去すると、
1+(a/A)=B/(B+b) (6)
となる。(6)式は、被写体距離を距離Aで正規化した値と等価となり、直接の距離を扱うより扱いが容易となる。比率計算(除算)が要されるので、ある程度の遠距離以降は無限遠として扱う等、妥当な演算桁数を設定し、それを超えた場合には値をクリップするような構成を採ってもよい。
When the lateral magnification of the optical system 121 is M (= Y / X), the focal length is f, the subject distance is (A + f), and the image distance is (B + f),
M = Y / X
= F / A = B / f (1)
It is. When (1) is multiplied by (fA),
f / A · (fA) = B / f · (fA) (2)
So
f 2 = A · B (3)
It becomes.
If the object movement amount is a and the corresponding defocus amount is b,
(A + a) (B + b) = f 2 (4)
It becomes.
From the equations (3) and (4),
(A + a) = (A · B) / (B + b) (5)
Is obtained. Thus, the relationship between the subject distance (A + a) and the defocus amount b is expressed by the equation (5). When the distance A (the distance from the front focal length to the object plane) is deleted from the right side of the equation (5),
1+ (a / A) = B / (B + b) (6)
It becomes. Equation (6) is equivalent to a value obtained by normalizing the subject distance by the distance A, and is easier to handle than handling a direct distance. Since ratio calculation (division) is required, even if it is configured to set a reasonable number of arithmetic digits, such as treating it as infinity after a certain distance, clip the value when it exceeds that Good.

なお、光学系121の光軸(図12中1200)を含む光軸付近の所定領域を特定補正対象領域と定義して、その様な領域においては、検出した被写体距離に係わらず設計補正値を選択する様な装置構成としてもよい。   Note that a predetermined region near the optical axis including the optical axis of the optical system 121 (1200 in FIG. 12) is defined as a specific correction target region, and in such a region, the design correction value is set regardless of the detected subject distance. It is good also as an apparatus structure which selects.

実施例1では、画像処理装置(デジタル信号処理部)をハードウエアとして構成した場合について説明したが、本発明の実施例2では、コンピュータ(CPU)がソフトウエア(コンピュータプログラム)によって画像処理を行う場合について説明する。図14には、画像処理プログラムのフローチャートを示している。   In the first embodiment, the case where the image processing apparatus (digital signal processing unit) is configured as hardware has been described. However, in the second embodiment of the present invention, the computer (CPU) performs image processing using software (computer program). The case will be described. FIG. 14 shows a flowchart of the image processing program.

ステップS201では、コンピュータは、撮像により生成(取得)された画像データを複数の色収差検出領域(補正対象領域)に分割する。次に、ステップS202では、コンピュータは、実施例1にて説明したDFD方式等を用いて距離マップを生成する。   In step S201, the computer divides image data generated (acquired) by imaging into a plurality of chromatic aberration detection regions (correction target regions). Next, in step S202, the computer generates a distance map using the DFD method described in the first embodiment.

次に、ステップS203では、コンピュータは、実施例1にて図11(c)を用いて説明したように、距離マップの距離領域と色収差検出領域とを整合(対応)させるために、距離マップの解像度変換を行う。次に、
ステップS204では、コンピュータは、解像変換後の距離マップを、閾値よりも近距離である近距離領域と該閾値より遠距離である遠距離領域とに二値化する。
具体的には、近距離領域に対応する色収差検出領域を倍率色収差量の検出を実施する領域として「1」と判定し、遠距離領域に対応する色収差検出領域を倍率色収差量の検出を実施しない領域として「0」と判定する。これにより、実施例1において図11(d)に示した判定結果(二値データ)が得られる。
Next, in step S203, as described in the first embodiment with reference to FIG. 11C, the computer adjusts (corresponds to) the distance area of the distance map and the chromatic aberration detection area. Perform resolution conversion. next,
In step S204, the computer binarizes the distance map after the resolution conversion into a short-distance region that is closer than the threshold and a long-distance region that is farther than the threshold.
Specifically, the chromatic aberration detection area corresponding to the short distance area is determined as “1” as the area for detecting the chromatic aberration of magnification, and the chromatic aberration detection area corresponding to the long distance area is not detected for the chromatic aberration of magnification. The area is determined to be “0”. As a result, the determination result (binary data) shown in FIG.

次に、ステップS205では、コンピュータは、ステップS204での判定結果に従い倍率色収差量の検出の実施と不実施を切り替える。コンピュータは、ステップS204の結果「1」と判定した色収差検出領域に対しては、ステップS206において倍率色収差量を検出する検出処理を行う。さらに、コンピュータは、ステップS207において、検出した倍率色収差量から、その色収差検出領域に対する使用補正量として、実施例1で説明した算出補正量(第1の補正値)を算出する。この後、ステップS209に進む。   Next, in step S205, the computer switches between performing and not performing detection of the chromatic aberration of magnification according to the determination result in step S204. For the chromatic aberration detection region determined to be “1” as a result of step S204, the computer performs a detection process for detecting the amount of lateral chromatic aberration in step S206. Further, in step S207, the computer calculates the calculated correction amount (first correction value) described in the first embodiment as the use correction amount for the chromatic aberration detection area from the detected magnification chromatic aberration amount. Thereafter, the process proceeds to step S209.

一方、ステップS204において「0」と判定した色収差検出領域に対しては、コンピュータは、ステップS208の処理を行う。ステップS208では、その色収差検出領域に対する使用補正量として設計補正量(第2の補正値)を選択し、該設計補正量が保持された不図示のメモリ(記憶手段)から撮像時の光学状態およびその色収差検出領域の像高に応じた設計補正量を読み出す。この後、ステップS209に進む。   On the other hand, for the chromatic aberration detection region determined to be “0” in step S204, the computer performs the process of step S208. In step S208, a design correction amount (second correction value) is selected as a use correction amount for the chromatic aberration detection region, and an optical state at the time of imaging from a memory (storage means) (not shown) in which the design correction amount is held. A design correction amount corresponding to the image height of the chromatic aberration detection area is read out. Thereafter, the process proceeds to step S209.

ステップS209では、コンピュータは、色検出領域ごとに、ステップS207で算出した算出補正量またはステップS208で読み出した設計補正量を使用補正量として用いて画像データに対して倍率色収差の補正を行う。   In step S209, for each color detection region, the computer corrects the chromatic aberration of magnification for the image data using the calculated correction amount calculated in step S207 or the design correction amount read in step S208 as the use correction amount.

本実施例では、撮像装置に搭載されたコンピュータが画像処理(倍率色収差の補正処理)を実行する場合について説明した。しかし、パーソナルコンピュータ等の画像処理装置が、撮像装置から取得した画像データに対して、図14に示した画像処理プログラムに従って画像処理を行うようにしてもよい。
(その他の実施例)
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
In the present embodiment, the case where the computer mounted on the imaging apparatus executes image processing (magnification chromatic aberration correction processing) has been described. However, an image processing apparatus such as a personal computer may perform image processing on the image data acquired from the imaging apparatus according to the image processing program shown in FIG.
(Other examples)
The present invention supplies a program that realizes one or more functions of the above-described embodiments to a system or apparatus via a network or a storage medium, and one or more processors in a computer of the system or apparatus read and execute the program This process can be realized. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.

以上説明した各実施例は代表的な例にすぎず、本発明の実施に際しては、各実施例に対して種々の変形や変更が可能である。   Each embodiment described above is only a representative example, and various modifications and changes can be made to each embodiment in carrying out the present invention.

121 光学系
102〜105,109〜120 デジタル信号処理部(画像処理装置)
116 倍率色収差検出部
111 倍率色収差補正部
117 補正係数取得部
117a メモリ
121 Optical systems 102 to 105, 109 to 120 Digital signal processing unit (image processing apparatus)
116 Chromatic Aberration Detection Unit 111 Chromatic Aberration Correction Unit 117 Correction Coefficient Acquisition Unit 117a Memory

Claims (9)

光学系を通した撮像により生成された入力画像に対して、前記光学系の倍率色収差に関する補正処理を行う処理手段と、
前記光学系の倍率色収差量を検出する検出手段と、
前記補正処理において用いられる補正値として、前記検出手段による検出結果に応じた第1の補正値を算出する算出手段と、
前記補正値として、前記検出手段による検出結果によらずに用意された第2の補正値を保持する記憶手段とを有し、
前記処理手段は、
前記入力画像を複数の補正対象領域に分割し、
該補正対象領域ごとに前記第1の補正値および前記第2の補正値のうち一方を選択して前記補正処理を行うことを特徴とする画像処理装置。
Processing means for performing a correction process on the chromatic aberration of magnification of the optical system for an input image generated by imaging through the optical system;
Detecting means for detecting a chromatic aberration of magnification of the optical system;
Calculation means for calculating a first correction value according to a detection result by the detection means as a correction value used in the correction processing;
Storage means for holding a second correction value prepared as the correction value regardless of the detection result of the detection means;
The processing means includes
Dividing the input image into a plurality of correction target areas;
An image processing apparatus that performs the correction process by selecting one of the first correction value and the second correction value for each correction target region.
前記撮像における被写体ごとの距離に関する情報を取得する距離取得手段を有し、
前記処理手段は、前記距離に関する情報に応じて前記補正対象領域ごとに前記第1および第2の補正値のうち一方を選択することを特徴とする請求項1に記載の画像処理装置。
A distance acquisition means for acquiring information on a distance for each subject in the imaging;
The image processing apparatus according to claim 1, wherein the processing unit selects one of the first correction value and the second correction value for each correction target region according to the information regarding the distance.
前記距離取得手段は、前記入力画像において前記距離が互いに異なる複数の距離領域を示す距離マップを生成し、
前記処理手段は、前記複数の補正対象領域と前記複数の距離領域とを互いに対応させる処理を行ってから、前記補正対象領域ごとに前記第1および第2の補正値のうち一方を選択することを特徴とする請求項2に記載の画像処理装置。
The distance acquisition unit generates a distance map indicating a plurality of distance regions having different distances in the input image,
The processing means performs a process of causing the plurality of correction target areas and the plurality of distance areas to correspond to each other, and then selects one of the first and second correction values for each correction target area. The image processing apparatus according to claim 2.
前記処理手段は、
前記複数の距離領域を、前記距離が第1の距離である第1の距離領域と、前記距離が前記第1の距離よりも遠い第2の距離である第2の距離領域とに分け、
前記第1の距離領域に対応する前記補正対象領域に対して前記第1の補正値を選択し、前記第2の距離領域に対応する前記補正対象領域に対して前記第2の補正値を選択することを特徴とする請求項2または3に記載の画像処理装置。
The processing means includes
Dividing the plurality of distance regions into a first distance region in which the distance is a first distance and a second distance region in which the distance is a second distance farther than the first distance;
The first correction value is selected for the correction target area corresponding to the first distance area, and the second correction value is selected for the correction target area corresponding to the second distance area. The image processing apparatus according to claim 2, wherein the image processing apparatus is an image processing apparatus.
前記処理手段は、
前記距離の信頼度を判定し、
前記補正対象領域における前記距離の信頼度が所定値より低い場合は該補正対象領域に対して前記第2の補正値を選択することを特徴とする請求項2から4のいずれか一項に記載の画像処理装置。
The processing means includes
Determine the reliability of the distance,
5. The second correction value is selected for the correction target region when the reliability of the distance in the correction target region is lower than a predetermined value. 6. Image processing apparatus.
前記処理手段は、前記複数の補正対象領域のうち特定補正対象領域に対しては、前記距離にかかわらず前記第2の補正値を選択することを特徴とする請求項2から5のいずれか一項に記載の画像処理装置。   6. The method according to claim 2, wherein the processing unit selects the second correction value for a specific correction target region among the plurality of correction target regions regardless of the distance. 7. The image processing apparatus according to item. 前記特定補正対象領域は、前記光学系の光軸を含む所定領域であることを特徴とする請求項6に記載の画像処理装置。   The image processing apparatus according to claim 6, wherein the specific correction target area is a predetermined area including an optical axis of the optical system. 前記撮像を行う撮像手段と、
該撮像手段により生成された入力画像に対して画像処理を行う請求項1から7のいずれか一項に記載の画像処理装置とを有することを特徴とする撮像装置。
Imaging means for performing the imaging;
An image processing apparatus comprising: the image processing apparatus according to claim 1 that performs image processing on an input image generated by the image capturing unit.
光学系を通した撮像により生成された入力画像に対する前記光学系の倍率色収差に関する補正処理を含む画像処理をコンピュータに行わせるコンピュータプログラムであって、
前記画像処理は、
前記光学系の倍率色収差量を検出する検出処理を行い、
前記補正処理において用いられる補正値として、前記検出処理による検出結果に応じた第1の補正値を演算し、
前記補正値として、前記検出処理による検出結果によらない第2の補正値を用意し、
前記入力画像を複数の補正対象領域に分割し、
該補正対象領域ごとに前記第1の補正値および前記第2の補正値のうち一方を選択して前記補正処理を行うことを特徴とする画像処理プログラム。
A computer program for causing a computer to perform image processing including correction processing related to lateral chromatic aberration of the optical system with respect to an input image generated by imaging through an optical system,
The image processing is
A detection process for detecting the amount of chromatic aberration of magnification of the optical system is performed,
As a correction value used in the correction process, a first correction value according to a detection result by the detection process is calculated,
As the correction value, a second correction value that does not depend on the detection result of the detection process is prepared,
Dividing the input image into a plurality of correction target areas;
An image processing program that performs the correction process by selecting one of the first correction value and the second correction value for each correction target area.
JP2015172482A 2015-09-02 2015-09-02 Image processor, imaging apparatus and image processing program Pending JP2017050700A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2015172482A JP2017050700A (en) 2015-09-02 2015-09-02 Image processor, imaging apparatus and image processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015172482A JP2017050700A (en) 2015-09-02 2015-09-02 Image processor, imaging apparatus and image processing program

Publications (1)

Publication Number Publication Date
JP2017050700A true JP2017050700A (en) 2017-03-09

Family

ID=58280353

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015172482A Pending JP2017050700A (en) 2015-09-02 2015-09-02 Image processor, imaging apparatus and image processing program

Country Status (1)

Country Link
JP (1) JP2017050700A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022209168A1 (en) * 2021-03-30 2022-10-06 富士フイルム株式会社 Imaging device, imaging method, and program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022209168A1 (en) * 2021-03-30 2022-10-06 富士フイルム株式会社 Imaging device, imaging method, and program

Similar Documents

Publication Publication Date Title
CN107071234B (en) Lens shadow correction method and device
US8682068B2 (en) Image processing apparatus, image processing method, and program
US8792025B2 (en) Image processing apparatus, image processing method, and solid-state imaging apparatus
US10348989B2 (en) Image processing device, image processing method, and image processing system
CN107395991B (en) Image synthesis method, image synthesis device, computer-readable storage medium and computer equipment
JP2015197745A (en) Image processing apparatus, imaging apparatus, image processing method, and program
KR20200031169A (en) Image processing method and device
JP5541205B2 (en) Image processing apparatus, imaging apparatus, image processing program, and image processing method
JP2018041380A (en) Image processing apparatus, image processing method, and program
JP5882789B2 (en) Image processing apparatus, image processing method, and program
JP2012195668A (en) Image processing device, image processing method, and program
JP2014138290A (en) Imaging device and imaging method
US10204400B2 (en) Image processing apparatus, imaging apparatus, image processing method, and recording medium
JP2014027337A (en) Image processing device, image processing method, program, and imaging device
JP6682184B2 (en) Image processing method, image processing program, image processing device, and imaging device
JP2017050700A (en) Image processor, imaging apparatus and image processing program
JP2005311455A (en) Imaging device, noise reduction device, noise reduction method and program
JP7039215B2 (en) Image processing equipment, image processing methods, and programs
JP2017055309A (en) Imaging apparatus and its control method
JP2016119532A (en) Image processing apparatus, imaging apparatus, image processing method, image processing program, and storage medium
JP6579934B2 (en) Image processing apparatus, imaging apparatus, image processing method, program, and storage medium
JP6552248B2 (en) IMAGE PROCESSING APPARATUS AND METHOD, IMAGING APPARATUS, AND PROGRAM
US9648232B2 (en) Image processing apparatus, image capturing apparatus, control method and recording medium
JP2014236226A (en) Image processing device and image processing method
US11838645B2 (en) Image capturing control apparatus, image capturing control method, and storage medium