JP5228929B2 - Image processing apparatus, imaging apparatus, and image processing program - Google Patents
Image processing apparatus, imaging apparatus, and image processing program Download PDFInfo
- Publication number
- JP5228929B2 JP5228929B2 JP2009005886A JP2009005886A JP5228929B2 JP 5228929 B2 JP5228929 B2 JP 5228929B2 JP 2009005886 A JP2009005886 A JP 2009005886A JP 2009005886 A JP2009005886 A JP 2009005886A JP 5228929 B2 JP5228929 B2 JP 5228929B2
- Authority
- JP
- Japan
- Prior art keywords
- pixel
- pixel value
- image processing
- image
- processing apparatus
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000012545 processing Methods 0.000 title claims description 96
- 238000003384 imaging method Methods 0.000 title claims description 35
- 238000012937 correction Methods 0.000 claims description 34
- 230000001629 suppression Effects 0.000 claims description 23
- 238000000034 method Methods 0.000 claims description 14
- 238000006243 chemical reaction Methods 0.000 claims description 10
- 238000001514 detection method Methods 0.000 claims description 9
- 230000008569 process Effects 0.000 claims description 8
- 230000002159 abnormal effect Effects 0.000 claims description 2
- 230000015654 memory Effects 0.000 description 18
- 230000008859 change Effects 0.000 description 17
- 210000001747 pupil Anatomy 0.000 description 6
- 230000014509 gene expression Effects 0.000 description 5
- 230000035945 sensitivity Effects 0.000 description 4
- 230000003595 spectral effect Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 239000004065 semiconductor Substances 0.000 description 3
- 230000004907 flux Effects 0.000 description 2
- 238000013459 approach Methods 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000002950 deficient Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 210000003128 head Anatomy 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000003825 pressing Methods 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Landscapes
- Automatic Focus Adjustment (AREA)
- Image Processing (AREA)
- Transforming Light Signals Into Electric Signals (AREA)
Description
本発明は、画像処理装置、撮像装置及び画像処理プログラムに関する。 The present invention relates to an image processing device, an imaging device, and an image processing program.
従来、撮像素子における欠陥画素や焦点検出用画素の位置における画素値を補正する様々な画像処理の技術が提案されている。そして、提案されている画像処理技術の中には、補正が必要な画素位置における画像の細かな構造を、再現するための工夫が施されているものもある。 Conventionally, various image processing techniques for correcting pixel values at positions of defective pixels and focus detection pixels in an image sensor have been proposed. Some of the proposed image processing techniques are devised to reproduce the fine structure of an image at a pixel position that needs to be corrected.
例えば、特許文献1では、焦点検出用画素の周辺の撮像画素のうち、配置密度の高い撮像画素の画素値に基づいて配置密度の低い撮像画素の画素値を補正し、補正した配置密度の低い撮像画素の画素値に基づいて、焦点検出用画素の位置における画素値を算出する技術が開示されている。
For example, in
しかしながら、従来技術の画像処理の方法では、例えば、特許文献1のような複雑な演算処理をそのままの形で電子カメラ等に実装すると回路規模が増大してしまうという問題がある。
However, the conventional image processing method has a problem in that, for example, if a complicated arithmetic processing as in
上記従来技術が有する問題に鑑み、本発明の目的は、画像データにおける画素値の補正処理を、回路規模を増大させることなく行うことができる技術を提供することにある。 In view of the above-described problems of the conventional technique, an object of the present invention is to provide a technique that can perform pixel value correction processing in image data without increasing the circuit scale.
上記課題を解決するために、本発明の画像処理装置は、原画像データのビット精度よりも低いビット精度の第1の画像データを算出し、第1の画像データの処理対象画素の周辺の画素の画素値を用いて、処理対象画素の第1の画素値を算出する第1の画素値算出部と、原画像データの処理対象画素の周辺の画素の画素値を用いて、処理対象画素の第2の画素値を算出する第2の画素値算出部と、第1の画素値と第2の画素値とから求めた補正値を、第1の画素値に付加するビット誤差抑制部と、を備える。 In order to solve the above problems, an image processing apparatus according to the present invention calculates first image data having a bit accuracy lower than the bit accuracy of original image data, and pixels around a processing target pixel of the first image data. The first pixel value calculation unit that calculates the first pixel value of the processing target pixel using the pixel value of the pixel, and the pixel values of the pixels around the processing target pixel of the original image data, A second pixel value calculation unit that calculates a second pixel value; a bit error suppression unit that adds a correction value obtained from the first pixel value and the second pixel value to the first pixel value; Is provided.
また、本発明において、補正値は、所定範囲内の補正値である。 In the present invention, the correction value is a correction value within a predetermined range.
また、本発明において、所定範囲は、第1の画像データのビット精度に基づいて設定される。 In the present invention, the predetermined range is set based on the bit accuracy of the first image data.
また、本発明において、ビット誤差抑制部は、処理対象画素における第2の画素値と第1の画素値との差を所定範囲内にクリップした値を補正値とする。 In the present invention, the bit error suppression unit uses a value obtained by clipping the difference between the second pixel value and the first pixel value in the processing target pixel within a predetermined range as a correction value.
また、本発明において、ビット誤差抑制部は、処理対象画素における前記第2の画素値と前記第1の画素値との差を求め、前記差が所定範囲内ではない場合には前記補正値を0に設定し、前記差が所定範囲内の場合には前記差を前記補正値とする。 In the present invention, the bit error suppression unit obtains a difference between the second pixel value and the first pixel value in the processing target pixel, and when the difference is not within a predetermined range, the bit error suppression unit calculates the correction value. When the difference is within a predetermined range, the difference is set as the correction value.
また、本発明において、第1の画素値算出部は、第1の画像データを原画像データに対してガンマ変換することによって算出する。 In the present invention, the first pixel value calculation unit calculates the first image data by performing gamma conversion on the original image data.
また、本発明において、第1の画像データに基づいて、処理対象画素の周辺における画素値分布に関する方向を判定する画像方向判定部をさらに備え、第1の画素値算出部及び第2の画素値算出部は、画像方向判定部による方向を参照して、処理対象画素における第1の画素値及び第2の画素値を算出する。 In the present invention, the image processing apparatus further includes an image direction determination unit that determines a direction related to a pixel value distribution around the pixel to be processed based on the first image data, and includes a first pixel value calculation unit and a second pixel value. The calculation unit calculates the first pixel value and the second pixel value in the processing target pixel with reference to the direction by the image direction determination unit.
また、本発明において、処理対象画素は、異常な画素値を出力する撮像画素、又は焦点検出用画素である。 In the present invention, the processing target pixel is an imaging pixel that outputs an abnormal pixel value or a focus detection pixel.
また、本発明において、撮像素子によって撮像された原画像データを受け付ける入力部と、処理対象画素の位置情報を記憶する位置情報記憶部と、をさらに備える。 The present invention further includes an input unit that receives original image data captured by the image sensor and a position information storage unit that stores position information of the processing target pixel.
本発明の撮像装置は、撮像素子と、本発明の画像処理装置と、を備える。 The imaging device of the present invention includes an imaging element and the image processing device of the present invention.
本発明の画像処理プログラムは、本発明の画像処理装置の処理をコンピュータで実現する。 The image processing program of the present invention realizes the processing of the image processing apparatus of the present invention by a computer.
本発明によると、画像データにおける画素値の補正処理を、回路規模を増大させることなく行うことができる。 According to the present invention, pixel value correction processing in image data can be performed without increasing the circuit scale.
以下、図面を用いて本発明の実施形態について説明する。
≪一の実施形態≫
図1は、本発明の一の実施形態に係る電子カメラ10の構成図である。
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
<< One Embodiment >>
FIG. 1 is a configuration diagram of an
電子カメラ10は、撮像レンズ1、撮像素子2、A/D変換部3、バッファメモリ4、CPU5、カードインタフェース(カードI/F)6、操作部材8、記憶部9、表示部11及び画像処理部12から構成される。バッファメモリ4、CPU5、カードI/F6、操作部材8、記憶部9、表示部11及び画像処理部12は、バス13を介して情報伝達可能に接続されている。なお、図1は電子カメラ10の主要部分のみを示す。例えば、図1において、CPU5の指令に従って、撮像素子2及びA/D変換部3に撮影指示のタイミングパルスを発するタイミングジェネレータ等は省略されている。
The
撮像レンズ1は、複数の光学レンズにより構成され、被写体像を撮像素子2の受光面に結像する。
The
撮像素子2は、その受光面上に配置された複数の撮像画素の各々に、R(赤)、G(緑)又はB(青)のいずれかのカラーフィルタがベイヤ配列型に設けられたCCDやCMOSの半導体イメージセンサ等であり、適宜選択して用いることができる。さらに、本実施形態の撮像素子2は、受光面上の一部の領域に、水平走査方向に一次元的に配置された複数の焦点検出画素(AF画素)(処理対象画素)を有する。それらのAF画素は、白色のフィルタが設けられ、且つ撮像レンズ1の光学系の瞳の左側又は右側を通過する光束を受光する。即ち、AF画素の各々は、白色光の輝度に応じた左側又は右側の瞳分割された検出信号を出力する。図2は、撮像素子2によって撮像された画像データのうち、AF画素が配置された領域を中心とした画像データの一部を示す。それぞれのセルが1つの画素を表す。各セルの先頭の記号R、G及びBは、各カラーフィルタを有する撮像画素を示す。一方、記号X及びYは、左側又は右側からの光束に感度を有するAF画素を示し、それらが交互に水平走査方向に一次元的に配列されている。これらの記号に続く2桁の番号は画素の位置を示す。
The
この撮像素子2は、CPU5の指令を受けてタイミングジェネレータ(不図示)が発するタイミングパルスに基づいて動作し、前方に設けられた撮像レンズ1によって結像される被写体像を取得する。撮像素子2から出力された画像信号は、A/D変換部3にてデジタル信号に変換される。デジタルの画像信号は、フレームメモリ(不図示)に一時的に記録された後、バッファメモリ4に記録される。なお、本実施形態におけるA/D変換部3は、撮像素子2の各画素の画素値を14ビット精度のデジタル信号に変換して出力するものとする。また、バッファメモリ4には、半導体メモリのうち、任意の不揮発性メモリを適宜選択して用いることができる。
The
CPU5は、ユーザが操作部材8の電源釦を押すことによって、電子カメラ10の電源が入れられると、記憶部9に記憶されている制御プログラムや画像処理プログラムを読み込んで、電子カメラ10を初期化する。CPU5は、操作部材8を介してユーザからの指示の信号を受け制御プログラムに基づいて、タイミングジェネレータ(不図示)に被写体像の撮像指令を出力したり、画像処理部12に撮像した画像の画像処理をさせたり、カードメモリ7への記録や表示部11への表示を行ったり等の制御を行う。CPU5には、一般的なコンピュータのCPUが使用することができる。
When the
カードI/F6には、カードメモリ7が着脱可能に装着される。バッファメモリ4に記録される画像は、CPU5の指示に基づいて画像処理部12で画像処理された後、JPEG形式やYUV形式等のファイルとしてカードメモリ7に記録される。
A
操作部材8は、ユーザによる部材操作の内容に応じた操作信号をCPU5に出力する。操作部材8には、例えば、電源釦、撮影モード等のモード設定釦及びレリーズ釦等の操作部材を有する。なお、操作部材8は、後述する表示部11の画面に表示されるタッチパネル式の釦であっても良い。
The
記憶部9は、電子カメラ10が撮像した画像データや、CPU5が電子カメラ10を制御するための制御プログラム等の各種プログラム等を記憶する。さらに、記憶部9は、撮像素子2のAF画素の位置情報や画像処理部12の画像処理で用いる補正係数等のデータを記憶する。記憶部9に記憶されるプログラムやデータは、バス13を介して、CPU5から適宜参照することができる。記憶部9は、一般的なハードディスク装置や光磁気ディスク装置、又は半導体メモリ等の記憶装置を適宜選択して用いることができる。
The
表示部11は、スルー画や撮像した画像又はモード設定画面等を表示する。表示部11には、液晶モニタ等を適宜選択して用いることができる。
The
画像処理部12は、CPU5の画像処理に指示に基づいて、輪郭強調処理やホワイトバランス補正等の画像処理とともに、AF画素の画素位置における画素値を周辺の撮像画素の画素値を用いた補間計算を行うディジタルフロントエンド回路である。
The
次に、本実施形態に係る電子カメラ10について、図3のCPU5に基づいた記憶部9と画像処理部12とにおける画像データのフローを示す図とともに、図4の画像処理のフローチャートを参照しながら説明する。
Next, regarding the
ユーザにより操作部材8の電源釦が押されると、CPU5は、電子カメラ10の記憶部9に記憶されている制御プログラムを読み込み、電子カメラ10を初期化する。CPU5は、ユーザからの被写体像の撮像指示が出されるまで待機する。ユーザによって操作部材8のレリーズ釦が押されると、CPU5は、撮像指示が出されたと判断して、ステップS10〜ステップS21の処理を行う。なお、本実施形態において、撮像画素の各々に設置されるカラーフィルタがベイヤ配列のパターンであることから、記号XのAF画素の位置には緑色(G)の画素値が補間され、記号YのAF画素の画素位置には青色(B)の画素値が補間される。
When the user presses the power button of the
ステップS10:CPU5は、タイミングジェネレータ(不図示)に対して撮像指令を出す。タイミングジェネレータ(不図示)は、タイミングパルスを撮像素子2に発し、撮像素子2は撮像レンズ1によって結像された被写体像を撮像する。撮像された画像データは、A/D変換部3によって14ビット精度のデジタルの画像データ(原画像データ)に変換され、バッファメモリ4に記録される。CPU5は、バッファメモリ4に対して、画像データを画像処理部12へ転送する指令を出す。バッファメモリ4は、バス13を介して、画像データを画像処理部12へ転送する。
Step S10: The
ステップS11:画像処理部12の低ビット画像生成部101は、転送されてきた14ビット精度の画像データの各画素値に対して、64の値で割るとともに小数点を切り捨てることにより、8ビット精度にビット精度を低下させた画像データを生成する。生成された8ビット精度の画像データは、画像方向判定部104及び第1の画素値算出部105に転送される。なお、本実施形態では、64で割った際に、小数点以下を切り捨てるが、四捨五入しても良いし、切り上げても良い。また、以下の説明において、14ビット精度の画像データの画素値を表すパラメータには14の添え字を、8ビット精度の画像データの画素値を表すパラメータには8の添え字をそれぞれ付すこととする。
Step S11: The low bit
ステップS12:画像処理部12のAF画素位置設定部102は、ステップS10の低ビット画像生成部101による処理と同時に、記憶部9の位置情報記憶部103からAF画素位置情報を読み込む。ここで、位置情報記憶部102には、AF画素列の垂直走査方向の座標YVと水平走査方向の始点及び終点の座標XH1及びXH2が記憶されている。
Step S12: The AF pixel
ステップS13:画像処理部12の画像方向判定部104は、各AF画素での撮像画素値を補間するために、各AF画素の周辺の撮像画素の画素値を用いて、3方向(本実施形態では、垂直走査方向、水平走査方向に対して斜め45度及び135度の方向)における画素値の変化率である方向変動V1〜V3の値を、AF画素の周辺の同色画素の差分の絶対値を積算して求める。具体的には、画像方向判定部104は、AF画素が左側の瞳分割された光を検出するAF画素Xの場合には次式(1)〜(3)を用い、右側の瞳分割された光を検出するAF画素Yの場合には次式(4)〜(6)を用いてそれぞれ求めて判定する。この理由は、AF画素XとAF画素Yとでその周辺のR、G及びBの配列のパターンが少し異なるからである。なお、各AF画素の座標を(x,y)とし、その位置でのR、G及びBの各成分をR8(x,y)、G8(x,y)及びB8(x,y)とする。
・AF画素Xの場合の垂直走査方向の方向変動V1=
2×(|G8(x−1,y−1)−G8(x−1,y+1)|+|G8(x+1,y−1)−G8(x+1,y+1)|)+|R8(x−2,y−1)−R8(x−2,y+1)|+|R8(x,y−1)−R8(x,y+1)|+|B8(x−1,y−2)−B8(x−1,y+2)|+|B8(x+1,y−2)−B8(x+1,y+2)| …(1)
・AF画素Xの場合の水平走査方向に対して斜め45度の方向変動V2=
2×(|G8(x+2,y−2)−G8(x+1,y−1)|+|G8(x−1,y+1)−G8(x−2,y+2)|)+|R8(x,y−1)−R8(x−2,y+1)|+|R8(x+2,y−1)−R8(x,y+1)|+|B8(x+1,y−2)−B8(x−3,y+2)|+|B8(x+3,y−2)−B8(x−1,y+2)| …(2)
・AF画素Xの場合の水平走査方向に対して斜め135度の方向変動V3=
2×(|G8(x−2,y−2)−G8(x−1,y−1)|+|G8(x+1,y+1)−G8(x+2,y+2)|)+|R8(x−2,y−1)−R8(x,y+1)|+|R8(x,y−1)−R8(x+2,y+1)|+|B8(x−3,y−2)−B8(x+1,y+2)|+|B8(x−1,y−2)−B8(x+3,y+2)| …(3)
・AF画素Yの場合の垂直走査方向の方向変動V1=
2×(|G8(x,y−1)−G8(x,y+1)|+|G8(x−2,y−1)−G8(x−2,y+1)|)+|R8(x−1,y−1)−R8(x−1,y+1)|+|R8(x+1,y−1)−R8(x+1,y+1)|+|B8(x−2,y−2)−B8(x−2,y+2)|+|B8(x,y−2)−B8(x,y+2)| …(4)
・AF画素Yの場合の水平走査方向に対して斜め45度の方向変動V2=
2×(|G8(x+1,y−2)−G8(x,y−1)|+|G8(x,y+1)−G8(x−1,y+2)|)+|R8(x−1,y−1)−R8(x−3,y+1)|+|R8(x+1,y−1)−R8(x−1,y+1)|+|B8(x+2,y−2)−B8(x−2,y+2)|+|B8(x+4,y−2)−B8(x,y+2)| …(5)
・AF画素Yの場合の水平走査方向に対して斜め135度の方向変動V3=
2×(|G8(x−1,y−2)−G8(x,y−1)|+|G8(x,y+1)−G8(x+1,y+2)|)+|R8(x−1,y−1)−R8(x+1,y+1)|+|R8(x+1,y−1)−R8(x+3,y+1)|+|B8(x−2,y−2)−B8(x+2,y+2)|+|B8(x,y−2)−B8(x+4,y+2)| …(6)
画像方向判定部104は、各AF画素において方向変動V1〜V3のうち最も小さい値の方向を画像方向情報として、第1の画素値算出部105及び第2の画素値算出部107に出力する
ステップS14:画像処理部12の第1の画素値算出部105は、8ビット精度の画像データとともに、ステップS12で求めた画像方向判定部104による各AF画素Xにおける画像方向情報に基づいて、各AF画素XにおけるG成分で8ビット精度の第1の画素値G1を求める。そのために、第1の画素値算出部105は、各AF画素Xの近傍におけるR、G及びBの平均値を、画像方向判定部104の画像方向情報に基づいて次式(7)〜(9)のいずれかを用いて算出する。
・最小の方向変動が垂直走査方向の場合
Rave(x,y)=(R8(x,y−1)+R8(x,y+1))/2 …(7)
Gave(x,y)=(G8(x−1,y−1)+G8(x−1,y+1)+G8(x+1,y−1)+G8(x+1,y+1))/4
Bave(x,y)=(B8(x−1,y−2)+B8(x−1,y+2)+B8(x+1,y−2)+B8(x+1,y+2))/4
・最小の方向変動が斜め45度の場合
Rave(x,y)=(R8(x,y−1)+R8(x,y+1)+R8(x−2,y−1)+R8(x+2,y+1))/4 …(8)
Gave(x,y)=(G8(x−1,y−1)+G8(x+1,y+1))/2
Bave(x,y)=(B8(x−1,y−2)+B8(x−3,y−2)+B8(x+1,y+2)+B8(x+3,y+2))/4
・最小の方向変動が斜め135度の場合
Rave(x,y)=(R8(x,y−1)+R8(x,y+1)+R8(x+2,y−1)+R8(x−2,y+1))/4 …(9)
Gave(x,y)=(G8(x+1,y−1)+G8(x−1,y+1))/2
Bave(x,y)=(B8(x+1,y−2)+B8(x+3,y−2)+B8(x−1,y+2)+B8(x−3,y+2))/4
第1の画素値算出部105は、算出されたRave、Gave及びBaveを用いるとともに、記憶部9の補正係数記憶部106から補正係数KR、KG及びKBの値を読み込んで、各AF画素Xにおける平均の白色成分Wave(x,y)を、次式(10)を用いて算出する。
Wave(x,y)=KR×Rave(x,y)+KG×Gave(x,y)+KB×Bave(x,y) …(10)
ここで、補正係数記憶部106に記憶されている補正係数KR、KG及びKBの値は、白色光の輝度に応じた左側と右側との瞳分割されたAF画素の分光感度の和(例えば、AF画素X45とAF画素Y46との画素値の和)が、KR×R画素の分光感度+KG×G画素の分光感度+KB×B画素の分光感度で表される近似式に最も良く成り立つように、開発段階で決められる値である。本実施形態では、0.5〜1.2の1前後の値となる。
Step S13: The image
The direction change V1 in the vertical scanning direction in the case of the AF pixel X =
2 × (| G 8 (x−1, y−1) −G 8 (x−1, y + 1) | + | G 8 (x + 1, y−1) −G 8 (x + 1, y + 1) |) + | R 8 (x−2, y−1) −R 8 (x−2, y + 1) | + | R 8 (x, y−1) −R 8 (x, y + 1) | + | B 8 (x−1, y−2) −B 8 (x−1, y + 2) | + | B 8 (x + 1, y−2) −B 8 (x + 1, y + 2) | (1)
The direction variation V2 = 45 degrees oblique to the horizontal scanning direction in the case of the AF pixel X =
2 × (| G 8 (x + 2, y−2) −G 8 (x + 1, y−1) | + | G 8 (x−1, y + 1) −G 8 (x−2, y + 2) |) + | R 8 (x, y-1) -R 8 (x-2, y + 1) | + | R 8 (x + 2, y-1) -R 8 (x, y + 1) | + | B 8 (x + 1, y-2) −B 8 (x−3, y + 2) | + | B 8 (x + 3, y−2) −B 8 (x−1, y + 2) | (2)
A direction variation V3 = 135 degrees oblique to the horizontal scanning direction in the case of the AF pixel X =
2 × (| G 8 (x−2, y−2) −G 8 (x−1, y−1) | + | G 8 (x + 1, y + 1) −G 8 (x + 2, y + 2) |) + | R 8 (x−2, y−1) −R 8 (x, y + 1) | + | R 8 (x, y−1) −R 8 (x + 2, y + 1) | + | B 8 (x−3, y− 2) −B 8 (x + 1, y + 2) | + | B 8 (x−1, y−2) −B 8 (x + 3, y + 2) | (3)
Direction change V1 in the vertical scanning direction in the case of AF pixel Y =
2 × (| G 8 (x, y−1) −G 8 (x, y + 1) | + | G 8 (x−2, y−1) −G 8 (x−2, y + 1) |) + | R 8 (x-1, y- 1) -R 8 (x-1, y + 1) | + | R 8 (x + 1, y-1) -R 8 (x + 1, y + 1) | + | B 8 (x-2, y-2) -B 8 (x -2, y + 2) | + | B 8 (x, y-2) -B 8 (x, y + 2) | ... (4)
The direction variation V2 = 45 degrees oblique to the horizontal scanning direction in the case of the AF pixel Y =
2 × (| G 8 (x + 1, y−2) −G 8 (x, y−1) | + | G 8 (x, y + 1) −G 8 (x−1, y + 2) |) + | R 8 ( x−1, y−1) −R 8 (x−3, y + 1) | + | R 8 (x + 1, y−1) −R 8 (x−1, y + 1) | + | B 8 (x + 2, y−) 2) -B 8 (x−2, y + 2) | + | B 8 (x + 4, y−2) −B 8 (x, y + 2) | (5)
A direction change V3 = 135 degrees oblique to the horizontal scanning direction in the case of the AF pixel Y =
2 × (| G 8 (x−1, y−2) −G 8 (x, y−1) | + | G 8 (x, y + 1) −G 8 (x + 1, y + 2) |) + | R 8 ( x−1, y−1) −R 8 (x + 1, y + 1) | + | R 8 (x + 1, y−1) −R 8 (x + 3, y + 1) | + | B 8 (x−2, y−2) −B 8 (x + 2, y + 2) | + | B 8 (x, y−2) −B 8 (x + 4, y + 2) | (6)
The image
When the minimum direction change is the vertical scanning direction, R ave (x, y) = (R 8 (x, y−1) + R 8 (x, y + 1)) / 2 (7)
G ave (x, y) = (G 8 (x−1, y−1) + G 8 (x−1, y + 1) + G 8 (x + 1, y−1) + G 8 (x + 1, y + 1)) / 4
B ave (x, y) = (B 8 (x−1, y−2) + B 8 (x−1, y + 2) + B 8 (x + 1, y−2) + B 8 (x + 1, y + 2)) / 4
When the minimum direction change is 45 degrees diagonally, R ave (x, y) = (R 8 (x, y−1) + R 8 (x, y + 1) + R 8 (x−2, y−1) + R 8 ( x + 2, y + 1)) / 4 (8)
G ave (x, y) = (G 8 (x−1, y−1) + G 8 (x + 1, y + 1)) / 2
B ave (x, y) = (B 8 (x−1, y−2) + B 8 (x−3, y−2) + B 8 (x + 1, y + 2) + B 8 (x + 3, y + 2)) / 4
When the minimum direction change is 135 degrees diagonally, R ave (x, y) = (R 8 (x, y−1) + R 8 (x, y + 1) + R 8 (x + 2, y−1) + R 8 (x−) 2, y + 1)) / 4 (9)
G ave (x, y) = (G 8 (x + 1, y−1) + G 8 (x−1, y + 1)) / 2
B ave (x, y) = (B 8 (x + 1, y−2) + B 8 (x + 3, y−2) + B 8 (x−1, y + 2) + B 8 (x−3, y + 2)) / 4
The first pixel
W ave (x, y) = KR × R ave (x, y) + KG × G ave (x, y) + KB × B ave (x, y) (10)
Here, the values of the correction coefficients KR, KG, and KB stored in the correction
一方、第1の画素値算出部105は、同時に、各AF画素X及び各AF画素Yの画素値を用いて、各AF画素Xの位置における白色成分W8(x,y)を、次式(11)を用いて求める。
W8(x,y)=X8(x,y)+(Y8(x−1,y)+Y8(x+1,y))/2 …(11)
以上において求めた値から、第1の画素値算出部105は、各AF画素XにおけるG成分で8ビット精度の第1の画素値G1(x,y)を、
G1(x,y)=Gave(x,y)+W8(x,y)/Wave(x,y) …(12)
の式(12)を用いて算出する。
On the other hand, the first pixel
W 8 (x, y) = X 8 (x, y) + (Y 8 (x−1, y) + Y 8 (x + 1, y)) / 2 (11)
From the values obtained above, the first pixel
G1 (x, y) = G ave (x, y) + W 8 (x, y) / W ave (x, y) (12)
It calculates using the formula (12).
ステップS15:第1の画素値算出部105は、ステップS14の場合と同様にして、各AF画素YにおけるB成分で8ビット精度の第1の画素値B1を求める。そのために、第1の画素値算出部105は、各AF画素Yの近傍におけるR、G及びBの平均値を、画像方向判定部104の画像方向情報に基づいて次式(13)〜(15)のいずれかを用いて算出する。
・最小の方向変動が垂直走査方向の場合
Rave(x,y)=(R8(x−1,y−1)+R8(x−1,y+1)+R8(x+1,y−1)+R8(x+1,y+1))/4 …(13)
Gave(x,y)=(G8(x,y−1)+G8(x,y+1))/2
Bave(x,y)=(B8(x,y−2)+B8(x,y+2))/2
・最小の方向変動が斜め45度の場合
Rave(x,y)=(R8(x−1,y−1)+R8(x+1,y+1))/2 …(14)
Gave(x,y)=(G8(x,y−1)+G8(x−2,y−1)+G8(x,y+1)+G8(x+2,y+1))/4
Bave(x,y)=(B8(x−2,y−2)+B8(x+2,y+2))/2
・最小の方向変動が斜め135度の場合
Rave(x,y)=(R8(x+1,y−1)+R8(x−1,y+1))/2 …(15)
Gave(x,y)=(G8(x,y−1)+G8(x+2,y−1)+G8(x,y+1)+G8(x−2,y+1))/4
Bave(x,y)=(B8(x+2,y−2)+B8(x−2,y+2))/2
第1の画素値算出部105は、算出されたRave、Gave及びBaveを用いて、平均の白色成分Wave(x,y)を、ステップS14と同様に式(7)を用いて算出する。
Step S15: The first pixel
When the minimum direction change is the vertical scanning direction, R ave (x, y) = (R 8 (x−1, y−1) + R 8 (x−1, y + 1) + R 8 (x + 1, y−1) + R 8 (x + 1, y + 1)) / 4 (13)
G ave (x, y) = (G 8 (x, y−1) + G 8 (x, y + 1)) / 2
B ave (x, y) = (B 8 (x, y−2) + B 8 (x, y + 2)) / 2
When the minimum direction change is 45 degrees diagonally, R ave (x, y) = (R 8 (x−1, y−1) + R 8 (x + 1, y + 1)) / 2 (14)
G ave (x, y) = (G 8 (x, y−1) + G 8 (x−2, y−1) + G 8 (x, y + 1) + G 8 (x + 2, y + 1)) / 4
B ave (x, y) = (B 8 (x−2, y−2) + B 8 (x + 2, y + 2)) / 2
When the minimum direction change is 135 degrees diagonally R ave (x, y) = (R 8 (x + 1, y−1) + R 8 (x−1, y + 1)) / 2 (15)
G ave (x, y) = (G 8 (x, y−1) + G 8 (x + 2, y−1) + G 8 (x, y + 1) + G 8 (x−2, y + 1)) / 4
B ave (x, y) = (B 8 (x + 2, y−2) + B 8 (x−2, y + 2)) / 2
The first pixel
一方、第1の画素値算出部105は、同時に、各AF画素X及び各AF画素Yの画素値を用いて、各AF画素Yにおける白色成分W8(x,y)を、次式(16)を用いて求める。
W8(x,y)=Y8(x,y)+(X8(x−1,y)+X8(x+1,y))/2 …(16)
以上において求めた値から、第1の画素値算出部105は、各AF画素YにおけるB成分で8ビット精度の第1の画素値B1(x,y)を、
B1(x,y)=Bave(x,y)+W8(x,y)/Wave(x,y) …(17)
の式(17)を用いて算出する。第1の画素値算出部105は、ステップS14の結果と合わせて、ビット誤差抑制部108へ8ビット精度の第1の画素値G1及びB1を転送する。
On the other hand, the first pixel
W 8 (x, y) = Y 8 (x, y) + (X 8 (x−1, y) + X 8 (x + 1, y)) / 2 (16)
From the values obtained above, the first pixel
B1 (x, y) = B ave (x, y) + W 8 (x, y) / W ave (x, y) (17)
This is calculated using equation (17). The first pixel
ステップS16:画像処理部12の第2の画素値算出部107は、元の14ビット精度の画像データとともに、ステップS13で求めた画像方向判定部104の画像方向情報に基づいて、各AF画素XにおけるG成分で14ビット精度の第2の画素値G2を、次式(18)〜(20)のいずれかを用いて算出する。
・最小の方向変動が垂直走査方向の場合
G2(x,y)=(G14(x−1,y−1)+G14(x−1,y+1)+G14(x+1,y−1)+G14(x+1,y+1))/4 …(18)
・最小の方向変動が斜め45度の場合
G2(x,y)=(G14(x−1,y−1)+G14(x+1,y+1))/2 …(19)
・最小の方向変動が斜め135度の場合
G2(x,y)=(G14(x+1,y−1)+G14(x−1,y+1))/2 …(20)
ステップS17:第2の画素値算出部107は、ステップS16と同様に、元の14ビット精度の画像データとともに、ステップS13で求めた画像方向判定部104の画像方向情報に基づいて、各AF画素YにおけるB成分で14ビット精度の第2の画素値B2を、次式(21)〜(23)のいずれかを用いて算出する。第2の画素値算出部107は、ステップS16の結果と合わせて、ビット誤差抑制部108へ14ビット精度の第2の画素値G2及びB2を転送する。
・最小の方向変動が垂直走査方向の場合
B2(x,y)=(B14(x,y−2)+B14(x,y+2))/2 …(21)
・最小の方向変動が斜め45度の場合
B2(x,y)=(B14(x−2,y−2)+B14(x+2,y+2))/2 …(22)
・最小の方向変動が斜め135度の場合
B2(x,y)=(B14(x+2,y−2)+B14(x−2,y+2))/2 …(23)
ステップS18:画像処理部12のビット誤差抑制部108は、まず各AF画素XにおけるG成分の画素値を、第1の画素値G1と第2の画素値G2とを用いて求める。具体的には、各AF画素Xの第1の画素値G1(x,y)を64倍して、14ビット精度の画素値G1′(x,y)を算出する。ビット誤差抑制部108は、
ΔG14(x,y)=G2(x,y)−G1′(x,y) …(24)
の式(24)を用いて、第2の画素値G2と64倍して14ビット精度の画素値にした第1の画素値G1′との差を求める。ビット誤差抑制部108は、ΔG14(x,y)を0〜63の範囲にクリップする。即ち、ΔG14(x,y)が0以下なら0に、63以上なら63に、及び0〜63の範囲以内ならそのままの値にする。ビット誤差抑制部108は、各AF画素Xの画素位置におけるG成分で14ビット精度の画素値GX(x,y)を、次式(25)のように求める。
GX(x,y)=G1′(x,y)+ΔG14(x,y) …(25)
ステップS19:ビット誤差抑制部108は、次に各AF画素Yにおける画素値を、第1の画素値B1と第2の画素値B2とを用いて求める。ステップS18と同様にして、各AF画素Yの第1の画素値B1(x,y)を64倍して、14ビット精度の画素値B1′(x,y)を算出する。ビット誤差抑制部108は、
ΔB14(x,y)=B2(x,y)−B1′(x,y) …(26)
の式(26)を用いて、第2の画素値B2と64倍して14ビット精度の画素値にした第1の画素値B1′との差を求める。ビット誤差抑制部108は、ΔB14(x,y)を0〜63の範囲にクリップして、各AF画素Yの補正されたB成分で14ビット精度の画素値BY(x,y)を、次式(27)のように求める。
BY(x,y)=B1′(x,y)+ΔB14(x,y) …(27)
ビット誤差抑制部108は、ステップS18の結果と合わせて、代入部109へ各AF画素における14ビット精度の画素値GX及びBYを転送する。
Step S16: The second pixel
When the minimum direction change is the vertical scanning direction, G2 (x, y) = (G 14 (x-1, y-1) + G 14 (x-1, y + 1) + G 14 (x + 1, y-1) + G 14 (X + 1, y + 1)) / 4 (18)
When the minimum direction change is 45 degrees, G2 (x, y) = (G 14 (x−1, y−1) + G 14 (x + 1, y + 1)) / 2 (19)
When the minimum direction change is oblique 135 degrees G2 (x, y) = (G 14 (x + 1, y−1) + G 14 (x−1, y + 1)) / 2 (20)
Step S17: Similar to step S16, the second pixel
When the minimum direction change is the vertical scanning direction B2 (x, y) = (B 14 (x, y−2) + B 14 (x, y + 2)) / 2 (21)
When the minimum direction change is 45 degrees diagonally B2 (x, y) = (B 14 (x−2, y−2) + B 14 (x + 2, y + 2)) / 2 (22)
When the minimum direction change is oblique 135 degrees B2 (x, y) = (B 14 (x + 2, y−2) + B 14 (x−2, y + 2)) / 2 (23)
Step S18: First, the bit
ΔG 14 (x, y) = G 2 (x, y) −
Using the equation (24), the difference between the second pixel value G2 and the first pixel value G1 ′ obtained by multiplying the second pixel value G2 by 64 and obtaining a pixel value with 14-bit accuracy is obtained. The bit
G X (x, y) =
Step S19: Next, the bit
ΔB 14 (x, y) = B 2 (x, y) −
Using the equation (26), the difference between the second pixel value B2 and the first pixel value B1 ′ obtained by multiplying the second pixel value B2 by 64 and obtaining a pixel value with 14-bit accuracy is obtained. The bit
B Y (x, y) = B1 ′ (x, y) + ΔB 14 (x, y) (27)
Bit
ステップS20:画像処理部12の代入部109は、ステップS18及びステップS19で求めた各AF画素における14ビット精度の画素値GX及びBYを、元の14ビット精度の画像データで、各AF画素の位置での画素値として代入して、完全なベイヤ配列の画像に補正された14ビット精度の画像データを生成する。
Step S20: The cash join the
ステップS21:画像処理部12の他の画像処理部110は、ステップS20で補正された14ビット精度の画像データに対して、他の補間処理、輪郭強調処理やホワイトバランス補正等の画像処理を行うとともに、JPEG形式やYUV形式等のファイルにして、バス13とカードI/F6とを介して、カードメモリ7や記憶部9に記録して、一連の作業を終了する。
Step S21: The other
このように本実施形態では、電子カメラ10で撮像された画像データを、低ビット画像生成部101によって、8ビット精度の画像データを生成し、その8ビット精度の画像データに基づいて、補正すべきAF画素における8ビット精度の画素値を算出するとともに、ビット誤差抑制部108において、元の14ビット精度の画像データから算出した画素値との差分に基づいて、8ビット精度の画素値から元の14ビット精度に戻す際に生じるビット誤差を抑制することによって、電子カメラ10の回路規模を抑制することができる。
As described above, in the present embodiment, the low-bit
また、第1の画素値算出部105が、まず、8ビット精度の画像データを用いて、AF画素の周囲の撮像画素の画素値をから、各AF画素におけるG成分又はB成分の画素値を求めているが、細い線構造の被写体の光学像がちょうどAF画素の位置に結像した場合、周囲の画素から求めたG成分とB成分の画素値は、線構造をきちんと解像できない。その問題を解決するため、周囲の撮像画素の画素値を用いて求めた周囲のW成分と、AF画素の画素値を用いて求めたW成分とを用いて、周囲の光量に対するAF画素位置の光量の比率を求め、それを周囲の撮像画素から求めたG成分及びB成分の画素値の平均値にかけることにより(式(12)及び式(17))、AF画素位置の光量が周囲とは異なる場合であっても、その位置のG成分及びB成分の光量を精度良く算出することができる。
Further, the first pixel
また、第2の画素値算出部107は、14ビット精度の画像データを処理して14ビット精度で各AF画素の位置でのG成分又はB成分の画素値を算出するので、従来の画像処理を行うならば、第1の画素値算出部105での処理も14ビット精度で行う必要がある。しかしながら、そのような複雑な演算を全て14ビット精度で行う回路を生産するためにはコストがかかってしまう。そこで、本実施形態では、8ビット精度で行う第1の画素値算出部105による処理を導入することにより、コストを大幅に抑制することが可能となる。
In addition, the second pixel
ただし、低ビット化するときに64で割って小数を切り捨てたことに起因するビット誤差により、第1の画素値B1に64をかけて14ビットの精度に戻した画素値は、適正値よりも0〜63程度小さくなる。そして、画像が平坦な領域ではこの程度のビット誤差でも目立つ場合がある。そこで、本発明ではその不具合を抑制するために、第2の画素値算出部107とビット誤差抑制部108とを追加した。つまり、第2の画素値算出部107は、14ビット精度で演算を行うが、周囲の2画素の平均を求めるだけの単純な演算なので回路規模は小さくて済む。細い線構造がちょうどAF画素位置にある場合には、第2の画素値G2及びB2は正しくないが、画像が平坦な領域では正しい値となる。また、ビット誤差抑制部108は、14ビット精度の第1の画素値G1′及びB1′を0〜63の範囲で第2の画素値G2及びB2に近づくように補正した値を、各AF画素の画素値として出力する。この処理によると、画像が平坦な領域では、第2の画素値に近い値が画素値として出力されるので正しい結果が得られる。一方、細い線構造がAF画素の位置にある場合では、その構造のコントラストが63以内の範囲で失われた値が画素値として算出されるが、この程度の微小なコントラストの消失(全階調の256分の1)はほとんど問題にならない。
However, due to the bit error caused by dividing the decimal by dividing by 64 when the bit is reduced, the pixel value obtained by multiplying the first pixel value B1 by 64 and returning to the 14-bit accuracy is less than the appropriate value. It becomes small about 0-63. In a flat image area, even a bit error of this level may be noticeable. Therefore, in the present invention, a second pixel
なお、画像方向判定部104が求めた画像方向情報に応じて画素値を算出することにより、公知のように画素値を精度良く計算できるが、本実施形態では第2の画素値算出部107の処理において、第1の画素値算出部105で参照した画像方向情報を共通して参照することにより、画像方向情報を有効に活用している。
≪他の実施形態≫
本発明の他の実施形態に係る電子カメラは、一の実施形態に係る電子カメラ10と同じである。したがって、本実施形態における電子カメラとして、図1に示す一の実施形態と同じ電子カメラ10を用い、各構成要素についての詳細な説明は省略する。
Note that, by calculating the pixel value according to the image direction information obtained by the image
<< Other Embodiments >>
An electronic camera according to another embodiment of the present invention is the same as the
また、本実施形態に係る電子カメラ10の画像処理の手順についても、図3のCPU5に基づいた記憶部9と画像処理部12とにおける画像データのフロー、及び図4に示すステップS10〜ステップS21のフローチャートと基本的に同じである。ただし、本実施形態における電子カメラ10が、一の実施形態の場合と異なる点は、以下の通りである。
Also for the image processing procedure of the
1)本実施形態のステップS11における、画像処理部12の低ビット画像生成部101が、14ビット精度の画像データから8ビット精度の画像データを生成するにあたり、8ビット精度の画素値=2×(14ビット精度の画素値)1/2のようにガンマ変換によって行われる。
1) When the low-bit
2)上記ステップS11におけるガンマ変換処理に伴い、ステップS15及びステップS16において、各AF画素におけるG成分及びB成分で8ビット精度の第1の画素値G1及びB1を求めるための式(12)及び式(17)が、それぞれ次式(12)′及び式(17)′に変形される。
G1(x,y)=Gave(x,y)+W8(x,y)−Wave(x,y) …(12)′
B1(x,y)=Bave(x,y)+W8(x,y)−Wave(x,y) …(17)′
即ち、一の実施形態では、掛け算と割り算で行っていた処理を、本実施形態では足し算と引き算になっている。これは、公知のようにガンマ特性を有する画素値の足し算や引き算は、線形特性を有する画素値の掛け算や割り算に対応するからである。なお、本実施形態でも、64で割った際に、小数点以下を切り捨てるが、四捨五入しても良いし、切り上げても良い。
2) Along with the gamma conversion processing in step S11, in steps S15 and S16, the formula (12) for obtaining first pixel values G1 and B1 with 8-bit accuracy with the G component and B component in each AF pixel and Expression (17) is transformed into the following expressions (12) ′ and (17) ′, respectively.
G1 (x, y) = G ave (x, y) + W 8 (x, y) −W ave (x, y) (12) ′
B1 (x, y) = B ave (x, y) + W 8 (x, y) −W ave (x, y) (17) ′
That is, in the present embodiment, the processing performed by multiplication and division is addition and subtraction in this embodiment. This is because, as is well known, addition and subtraction of pixel values having gamma characteristics correspond to multiplication and division of pixel values having linear characteristics. In this embodiment as well, when it is divided by 64, the decimal part is rounded down, but it may be rounded off or rounded up.
3)同じく上記ステップS11におけるガンマ変換処理に伴い、ステップS18及びステップS19において、ビット誤差抑制部108は、各AF画素における画素値を、第1の画素値G1又はB1と第2の画素値G2又はB2とから求めるにあたり、各AF画素の第1の画素値G1及びB1から14ビット精度の画素値G1′(x,y)及びB1′(x,y)を、次式(28)及び次式(29)を用いて算出する。
G1′(x,y)=G1(x,y)×G1(x,y)/4 …(28)
B1′(x,y)=B1(x,y)×B1(x,y)/4 …(29)
これとともに、式(24)にて算出されるΔG14のクリップされる範囲が、0〜G1(x,y)/2に、式(26)にて算出されるΔB14のクリップされる範囲が、0〜B1(x,y)/2にそれぞれ変更される。
3) Similarly, in step S18 and step S19 following the gamma conversion processing in step S11, the bit
G1 ′ (x, y) = G1 (x, y) × G1 (x, y) / 4 (28)
B1 ′ (x, y) = B1 (x, y) × B1 (x, y) / 4 (29)
At the same time, the clipping range of ΔG 14 calculated by Expression (24) is 0 to G1 (x, y) / 2, and the clipping range of ΔB 14 calculated by Expression (26) is the same. , 0 to B1 (x, y) / 2, respectively.
このように本実施形態では、電子カメラ10で撮像された画像データを、低ビット画像生成部101によって、8ビット精度の画像データを生成し、その8ビット精度の画像データに基づいて、補正すべきAF画素における8ビット精度の画素値を算出するとともに、ビット誤差抑制部108において、元の14ビット精度の画像データから算出した画素値との差分に基づいて、8ビット精度の画素値から元の14ビット精度に戻す際に生じるビット誤差を抑制することによって、電子カメラ10の回路規模を抑制することができる。
As described above, in the present embodiment, the low-bit
また、低ビット画像生成部101において、14ビット精度の画像を8ビット精度の画像に変換する際、ガンマ変換を行ってからビット精度を落としている。そうすることにより、暗い(画素値が小さい)画像領域ではビット誤差が小さく、明るい(画素値が大きい)画像領域ではビット誤差が大きくなる。それに対応して、ビット誤差の補正量(クリッピング後のΔGとΔB)は暗い画像領域では小さくなり、コントラストの消失も暗い画像領域では小さくなる。人間の視覚は、暗い画像領域では微小な光量の変化を感知するので、暗い画像領域におけるコントラストの消失を小さく抑えればコントラストの消失を感知しにくくなる。
≪実施形態の補足事項≫
一の実施形態及び他の実施形態では、ビット誤差の補正値を求める処理で、第2の画素値G2又はB2と14ビット精度にした第1の画素値G1′又はB1′との差が所定範囲外(ビット誤差の範囲外)の場合には、0以下の場合には補正量を0に、63、G(x,y)/2又はB(x,y)/2以上の場合には、補正量を63、G(x,y)/2又はB(x,y)/2の値に設定したが、本発明はこれに限定されず、例えば、差が所定範囲外の値の場合には、補正量を全て0に設定し、差が所定範囲内の場合にはその差を補正値としても良い。そうすることによって、補正箇所のコントラストが充分高い場合には、差が所定範囲外になることによってコントラストの消失を避けることができる。
In addition, when converting a 14-bit precision image into an 8-bit precision image in the low bit
≪Supplementary items for the embodiment≫
In one embodiment and another embodiment, the difference between the second pixel value G2 or B2 and the first pixel value G1 ′ or B1 ′ having a 14-bit precision is predetermined in the process of obtaining the bit error correction value. In the case of out of range (out of bit error range), the correction amount is set to 0 when 0 or less, and when 63, G (x, y) / 2 or B (x, y) / 2 or more. The correction amount is set to 63, G (x, y) / 2 or B (x, y) / 2, but the present invention is not limited to this. For example, when the difference is a value outside the predetermined range Alternatively, all the correction amounts may be set to 0, and if the difference is within a predetermined range, the difference may be used as a correction value. By doing so, when the contrast of the correction portion is sufficiently high, the loss of contrast can be avoided by the difference being outside the predetermined range.
なお、一の実施形態及び他の実施形態では、補正係数記憶部106に記憶される補正係数KR、KG及びKBの値は、0.5〜1.2の1前後の値となるとしたが、本発明はこれに限定されず、任意の補正係数の値を状況に応じて適宜用いることができる。
In one embodiment and other embodiments, the values of the correction coefficients KR, KG, and KB stored in the correction
なお、一の実施形態及び他の実施形態では、撮像された画像データは14ビット精度を有し、低ビット画像生成部101によって生成される画像データは8ビット精度を有する場合について説明したが、本発明はこれに限定されない。撮像された画像のビット精度よりも第1の画素値算出部105の処理のビット精度を低くし、第2の画素値算出部107の演算精度を第1の画素値算出部105の処理のビット精度よりも高くすることにより、本発明の効果を得ることができる。
In one embodiment and other embodiments, the case has been described in which captured image data has 14-bit precision and image data generated by the low-bit
なお、一の実施形態及び他の実施形態では、AF画素の位置における画素値を算出する手順について説明したが、本発明はそれに限定されない。画素欠陥の補正や間引き読み出しによる動画のフレーム画像毎の補正など、画像を局所的に補正する処理全般について、本発明を適用することができる。なお、そのような場合において、補正対象の撮像画素の位置情報を、記憶部9の位置情報記憶部103に記憶させるようにすることが好ましい。
In the embodiment and the other embodiments, the procedure for calculating the pixel value at the position of the AF pixel has been described, but the present invention is not limited thereto. The present invention can be applied to all processes for locally correcting an image, such as correction of pixel defects and correction for each frame image of a moving image by thinning readout. In such a case, it is preferable to store the position information of the imaging pixel to be corrected in the position
なお、一の実施形態及び他の実施形態では、AF画素の各々は左側又は右側からの光束を瞳分割する焦点検出用画素としたが、本発明はこれに限定されず、1つのAF画素で左側及び右側からの光束を瞳分割する焦点検出用画素でも良い。 In one embodiment and other embodiments, each AF pixel is a focus detection pixel that divides a light flux from the left side or the right side into pupils. However, the present invention is not limited to this, and one AF pixel is used. Focus detection pixels that divide the light flux from the left side and the right side into pupils may be used.
なお、一の実施形態及び他の実施形態では、電子カメラ10の場合について説明したが、本発明はこれに限定されず、図1において、撮像レンズ1、撮像素子2及びA/D変換部3を除いて、電子カメラ等で撮像された画像を読み込む入力部を設けた画像処理装置に対しても適応可能である。
In one embodiment and another embodiment, the case of the
なお、本発明に係る画像処理装置における処理をコンピュータで実現するためのプログラムに対しても適用可能である。 Note that the present invention can also be applied to a program for realizing the processing in the image processing apparatus according to the present invention by a computer.
本発明は、その精神またはその主要な特徴から逸脱することなく他の様々な形で実施することができる。そのため、上述した実施形態はあらゆる点で単なる例示に過ぎず、限定的に解釈されてはならない。さらに、特許請求の範囲の均等範囲に属する変形や変更は、全て本発明の範囲内である。 The present invention can be implemented in various other forms without departing from the spirit or main features thereof. For this reason, the above-described embodiment is merely an example in all respects and should not be construed in a limited manner. Further, all modifications and changes belonging to the equivalent scope of the claims are within the scope of the present invention.
1 撮像レンズ、2 撮像素子、3 A/D変換部、4 バッファメモリ、5 CPU、6 カードI/F、7 カードメモリ、8 操作部材、9 記憶部、10 電子カメラ、11 表示部、12 画像処理部、13 バス、101 低ビット画像生成部、102 AF画素位置設定部、103 位置情報記憶部、104 画像方向判定部、105 第1の画素値算出部、106 補正係数記憶部、107 第2の画素値算出部、108 ビット誤差抑制部、109 代入部、110 他の画像処理部
DESCRIPTION OF
Claims (11)
前記原画像データの前記処理対象画素の周辺の画素の画素値を用いて、前記処理対象画素の第2の画素値を算出する第2の画素値算出部と、
前記第1の画素値と前記第2の画素値とから求めた補正値を、前記第1の画素値に付加するビット誤差抑制部と、
を備えることを特徴とする画像処理装置。 First image data having a bit accuracy lower than the bit accuracy of the original image data is calculated, and the pixel values of the pixels around the processing target pixel of the first image data are used to calculate the first image data of the processing target pixel. A first pixel value calculation unit for calculating a pixel value;
A second pixel value calculation unit that calculates a second pixel value of the processing target pixel using pixel values of pixels around the processing target pixel of the original image data;
A bit error suppression unit that adds a correction value obtained from the first pixel value and the second pixel value to the first pixel value;
An image processing apparatus comprising:
前記補正値は、所定範囲内の補正値であることを特徴とする画像処理装置。 The image processing apparatus according to claim 1.
The image processing apparatus according to claim 1, wherein the correction value is a correction value within a predetermined range.
前記所定範囲は、前記第1の画像データのビット精度に基づいて設定されることを特徴とする画像処理装置。 The image processing apparatus according to claim 2,
The image processing apparatus according to claim 1, wherein the predetermined range is set based on bit accuracy of the first image data.
前記ビット誤差抑制部は、
前記処理対象画素における前記第2の画素値と前記第1の画素値との差を前記所定範囲内にクリップした値を前記補正値とする
ことを特徴とする画像処理装置。 The image processing apparatus according to any one of claims 2 to 3,
The bit error suppression unit is
An image processing apparatus, wherein a value obtained by clipping a difference between the second pixel value and the first pixel value in the processing target pixel within the predetermined range is used as the correction value.
前記ビット誤差抑制部は、
前記処理対象画素における前記第2の画素値と前記第1の画素値との差を求め、前記差が所定範囲内ではない場合には前記補正値を0に設定し、前記差が所定範囲内の場合には前記差を前記補正値とする
ことを特徴とする画像処理装置。 The image processing apparatus according to any one of claims 2 to 3,
The bit error suppression unit is
A difference between the second pixel value and the first pixel value in the processing target pixel is obtained, and when the difference is not within a predetermined range, the correction value is set to 0, and the difference is within the predetermined range. In the case of the image processing apparatus, the difference is set as the correction value.
前記第1の画素値算出部は、前記第1の画像データを前記原画像データに対してガンマ変換することによって算出することを特徴とする画像処理装置。 The image processing apparatus according to any one of claims 1 to 5,
The image processing apparatus according to claim 1, wherein the first pixel value calculation unit calculates the first image data by performing gamma conversion on the original image data.
前記第1の画像データに基づいて、前記処理対象画素の周辺における画素値分布に関する方向を判定する画像方向判定部をさらに備え、
前記第1の画素値算出部及び前記第2の画素値算出部は、前記画像方向判定部による方向を参照して、前記処理対象画素における前記第1の画素値及び前記第2の画素値を算出する
ことを特徴とする画像処理装置。 The image processing apparatus according to any one of claims 1 to 6,
An image direction determination unit that determines a direction related to a pixel value distribution around the processing target pixel based on the first image data;
The first pixel value calculation unit and the second pixel value calculation unit refer to the direction by the image direction determination unit, and calculate the first pixel value and the second pixel value in the processing target pixel. An image processing apparatus characterized by calculating.
前記処理対象画素は、異常な画素値を出力する撮像画素、又は焦点検出用画素であることを特徴とする画像処理装置。 The image processing apparatus according to any one of claims 1 to 6,
The image processing apparatus, wherein the processing target pixel is an imaging pixel that outputs an abnormal pixel value or a focus detection pixel.
撮像素子によって撮像された前記原画像データを受け付ける入力部と、
前記処理対象画素の位置情報を記憶する位置情報記憶部と、
をさらに備えることを特徴とする画像処理装置。 The image processing apparatus according to any one of claims 1 to 6,
An input unit that receives the original image data captured by the image sensor;
A position information storage unit for storing position information of the processing target pixel;
An image processing apparatus further comprising:
請求項9に記載の画像処理装置と、
を備えることを特徴とする撮像装置。 An image sensor;
An image processing device according to claim 9;
An imaging apparatus comprising:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009005886A JP5228929B2 (en) | 2009-01-14 | 2009-01-14 | Image processing apparatus, imaging apparatus, and image processing program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009005886A JP5228929B2 (en) | 2009-01-14 | 2009-01-14 | Image processing apparatus, imaging apparatus, and image processing program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2010166236A JP2010166236A (en) | 2010-07-29 |
JP5228929B2 true JP5228929B2 (en) | 2013-07-03 |
Family
ID=42582075
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2009005886A Active JP5228929B2 (en) | 2009-01-14 | 2009-01-14 | Image processing apparatus, imaging apparatus, and image processing program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5228929B2 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5818451B2 (en) | 2011-02-09 | 2015-11-18 | キヤノン株式会社 | Imaging apparatus and control method |
JP5740465B2 (en) * | 2011-02-28 | 2015-06-24 | 富士フイルム株式会社 | Imaging apparatus and defective pixel correction method |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3830574B2 (en) * | 1996-04-10 | 2006-10-04 | 松下電器産業株式会社 | Defect correction device and solid-state imaging device using the same |
JP3757484B2 (en) * | 1996-09-03 | 2006-03-22 | 富士ゼロックス株式会社 | Image processing device |
US6876468B1 (en) * | 2000-09-19 | 2005-04-05 | Kabushiki Kaisha Toshiba | Image processing apparatus that performs black coloring, gamma correction and tone processing |
JP5028014B2 (en) * | 2006-02-08 | 2012-09-19 | 株式会社日立ハイテクノロジーズ | Pattern inspection method and apparatus |
JP4935162B2 (en) * | 2006-04-11 | 2012-05-23 | 株式会社ニコン | Imaging apparatus, camera, and image processing method |
-
2009
- 2009-01-14 JP JP2009005886A patent/JP5228929B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2010166236A (en) | 2010-07-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5200955B2 (en) | Image processing apparatus, imaging apparatus, and image processing program | |
JP5298638B2 (en) | Image processing apparatus, imaging apparatus, correction coefficient calculation method, and image processing program | |
CN102870404B (en) | Imaging device and dark current correction method of same | |
JP2003116060A (en) | Correcting device for defective picture element | |
WO2006048962A1 (en) | Pixel signal processor and pixel signal processing method | |
JP4992698B2 (en) | Chromatic aberration correction apparatus, imaging apparatus, chromatic aberration calculation method, and chromatic aberration calculation program | |
TWI387353B (en) | Pixel interpolation circuit, pixel interpolation method, and recording medium | |
JP5359553B2 (en) | Image processing apparatus, imaging apparatus, and image processing program | |
JP2004229055A (en) | Image processor | |
JP5228929B2 (en) | Image processing apparatus, imaging apparatus, and image processing program | |
JP5786355B2 (en) | Defocus amount detection device and electronic camera | |
JP5353945B2 (en) | Image processing apparatus, image processing program, and electronic camera | |
JP5631769B2 (en) | Image processing device | |
JP5309940B2 (en) | Image processing apparatus and imaging apparatus | |
JP5463871B2 (en) | Image processing apparatus and electronic camera | |
JP5412945B2 (en) | Imaging device, image processing apparatus, imaging apparatus, and image processing program | |
JP5159647B2 (en) | Image processing apparatus and image processing method | |
JP2005086764A (en) | Imaging apparatus and color data measuring method used for the imaging apparatus | |
JP5572992B2 (en) | Image processing apparatus, imaging apparatus, and image processing program | |
JP4787403B2 (en) | Automatic exposure apparatus and method | |
JP4769880B2 (en) | Image processing apparatus and method | |
JP2009159404A (en) | Image processing method, image processing device, and image formation device | |
JP2009164779A (en) | Imaging apparatus | |
JP2009239974A (en) | Automatic exposing device and method | |
JP5602825B2 (en) | Image processing apparatus and image processing method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20111227 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20120627 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20130213 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20130219 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20130304 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20160329 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5228929 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |