JP5523213B2 - Imaging apparatus and imaging method - Google Patents

Imaging apparatus and imaging method Download PDF

Info

Publication number
JP5523213B2
JP5523213B2 JP2010141333A JP2010141333A JP5523213B2 JP 5523213 B2 JP5523213 B2 JP 5523213B2 JP 2010141333 A JP2010141333 A JP 2010141333A JP 2010141333 A JP2010141333 A JP 2010141333A JP 5523213 B2 JP5523213 B2 JP 5523213B2
Authority
JP
Japan
Prior art keywords
pixel
value
average
pixels
pixel value
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.)
Expired - Fee Related
Application number
JP2010141333A
Other languages
Japanese (ja)
Other versions
JP2012009919A (en
Inventor
剛幸 味戸
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Olympus Imaging Corp
Original Assignee
Olympus Imaging Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Olympus Imaging Corp filed Critical Olympus Imaging Corp
Priority to JP2010141333A priority Critical patent/JP5523213B2/en
Publication of JP2012009919A publication Critical patent/JP2012009919A/en
Application granted granted Critical
Publication of JP5523213B2 publication Critical patent/JP5523213B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Processing (AREA)
  • Color Television Image Signal Generators (AREA)
  • Facsimile Image Signal Circuits (AREA)

Description

本発明は、ベイヤ配列による固体撮像素子の出力から得られる画像データについて、ゴースト光などにより生じる、Gr画素の画素値とGb画素の画素値との差を補正する技術に関する。   The present invention relates to a technique for correcting a difference between a pixel value of a Gr pixel and a pixel value of a Gb pixel, which is generated by ghost light or the like, with respect to image data obtained from an output of a solid-state imaging device having a Bayer array.

ベイヤ配列の固体撮像素子によって、明るさと色成分が一様な被写体を撮影した場合、R列の緑色フィルタの画素(Gr)の信号であるGr信号と、B列の緑色フィルタの画素(Gb)の信号であるGb信号とは同じになるはずである。しかし、R列の緑色フィルタとB列の緑色フィルタの分光特性の違いや、ゴースト光等の斜入射光の影響により、Gr信号とGb信号との間に信号差(段差)が生じることがある。この信号差を残したままカラー画像を生成すると、一様な被写体の上に格子状のノイズが発生してしまう。   When a subject with uniform brightness and color components is photographed by a Bayer array solid-state imaging device, a Gr signal that is a signal of a green filter pixel (Gr) in the R column and a green filter pixel (Gb) in the B column Should be the same as the Gb signal. However, there may be a signal difference (step) between the Gr signal and the Gb signal due to the difference in spectral characteristics between the green filter of the R row and the green filter of the B row and the influence of oblique incident light such as ghost light. . If a color image is generated while leaving this signal difference, a grid-like noise is generated on a uniform subject.

特許文献1には、周囲の緑色フィルタの画素の信号に基づいて、処理対象である緑色フィルタの画素の信号を補正する技術が開示されている。また、特許文献2には、注目画素がエッジ部分に位置しているか否かに基づいて、Gr信号とGb信号との間の信号差を補正する際の特性を変更する技術が開示されている。さらに、特許文献3には、撮像画像の画素データと基準パターンとを比較することによって、Gr信号とGb信号との間の信号差を検出して、信号差を補正する技術が開示されている。   Patent Document 1 discloses a technique for correcting a signal of a pixel of a green filter that is a processing target based on a signal of a pixel of a surrounding green filter. Patent Document 2 discloses a technique for changing characteristics when correcting a signal difference between a Gr signal and a Gb signal based on whether or not a target pixel is located at an edge portion. . Further, Patent Document 3 discloses a technique for correcting a signal difference by detecting a signal difference between a Gr signal and a Gb signal by comparing pixel data of a captured image with a reference pattern. .

特開2001−218073号公報JP 2001-218073 A 特開2005−311962号公報JP 2005-311962 A 特開2005−333251号公報JP 2005-333251 A

しかしながら、特許文献1に記載されている技術では、一様に緑色フィルタの画素の信号を補正するので、細かいエッジ部分の解像度が低下するという問題が生じる。また、特許文献2に記載されている技術では、ゴースト光などにより生じる強い信号差を、画像上の非常に細かいエッジの被写体により生じる信号差と区別することができない。また、特許文献3に記載されている技術では、画像上の非常に細かいエッジの被写体も、ゴースト光などにより生じる強い信号差と誤判定して、信号値が補正されてしまうという問題が生じる。   However, in the technique described in Patent Document 1, since the signal of the pixel of the green filter is uniformly corrected, there arises a problem that the resolution of the fine edge portion is lowered. Further, with the technique described in Patent Document 2, a strong signal difference caused by ghost light or the like cannot be distinguished from a signal difference caused by a subject with a very fine edge on an image. Further, with the technique described in Patent Document 3, a subject with a very fine edge on an image is erroneously determined as a strong signal difference caused by ghost light or the like, and the signal value is corrected.

本発明は、ゴースト光などにより生じる強い信号差と、非常に細かいエッジの被写体により生じる信号差とを区別して検出して、ゴースト光などにより生じる強い信号差を補正する技術を提供することを目的とする。   It is an object of the present invention to provide a technique for correcting a strong signal difference caused by ghost light or the like by distinguishing and detecting a strong signal difference caused by ghost light or the like and a signal difference caused by a very fine edge subject. And

本発明のある態様に係る撮像装置は、水平方向にR画素およびGr画素が交互に配列されたラインと、水平方向にB画素およびGb画素が交互に配列されたラインとが垂直方向に交互に配置されるベイヤ配列構造の固体撮像素子を有する撮像装置であって、前記固体撮像素子の出力から得られる画像データについて、所定数の画素から構成される画像領域ごとに、前記画像領域に含まれるGr画素の画素値の平均値であるGr平均画素値を求めるとともに、前記画像領域に含まれるGb画素の画素値の平均値であるGb平均画素値を求める平均画素値算出部と、前記Gr平均画素値および前記Gb平均画素値に基づいて、前記Gr画素の画素値および前記Gb画素の画素値の補正を行うか否かを判定する補正判定部と、前記補正判定部によって補正を行うと判定されると、前記Gr画素の画素値および前記Gb画素の画素値を補正する補正部と、を備え、前記補正判定部は、前記画像領域ごとに前記Gr平均画素値と前記Gb平均画素値との差分値を算出し、算出した差分値が第1の閾値以上であれば、前記差分値を累積加算し、前記差分値を累積加算した値が前記第1の閾値よりも大きい第2の閾値以上の場合に、前記Gr画素の画素値および前記Gb画素の画素値の補正を行うと判定する。
また、本発明の別の態様に係る撮像装置は、水平方向にR画素およびGr画素が交互に配列されたラインと、水平方向にB画素およびGb画素が交互に配列されたラインとが垂直方向に交互に配置されるベイヤ配列構造の固体撮像素子を有する撮像装置であって、前記固体撮像素子の出力から得られる画像データについて、所定数の画素から構成される画像領域ごとに、前記画像領域に含まれるGr画素の画素値の平均値であるGr平均画素値を求めるとともに、前記画像領域に含まれるGb画素の画素値の平均値であるGb平均画素値を求める平均画素値算出部と、前記Gr平均画素値および前記Gb平均画素値に基づいて、前記Gr画素の画素値および前記Gb画素の画素値の補正を行うか否かを判定する補正判定部と、前記補正判定部によって補正を行うと判定されると、前記Gr画素の画素値および前記Gb画素の画素値を補正する補正部と、を備え、前記補正部は、処理対象画素であるGr画素の周辺に位置するGb画素の画素値に基づいて、前記処理対象画素であるGr画素の画素値を補正するとともに、処理対象画素であるGb画素の周辺に位置するGr画素の画素値に基づいて、前記処理対象画素であるGb画素の画素値を補正する。
An imaging device according to an aspect of the present invention includes a line in which R pixels and Gr pixels are alternately arranged in the horizontal direction and a line in which B pixels and Gb pixels are alternately arranged in the horizontal direction alternately in the vertical direction. An image pickup apparatus having a solid-state image sensor having a Bayer array structure to be arranged, and image data obtained from an output of the solid-state image sensor is included in the image area for each image area composed of a predetermined number of pixels. An average pixel value calculation unit that calculates a Gr average pixel value that is an average value of pixel values of Gr pixels and calculates a Gb average pixel value that is an average value of pixel values of Gb pixels included in the image region; and the Gr average A correction determination unit that determines whether to correct the pixel value of the Gr pixel and the pixel value of the Gb pixel based on the pixel value and the Gb average pixel value, and the correction determination unit Wherein if it is determined that corrects, and a correcting unit that corrects the pixel value and the pixel value of the Gb pixel of the Gr pixel, the correction determining unit, and the Gr average pixel value for each said image region If the difference value with the Gb average pixel value is calculated and the calculated difference value is equal to or greater than the first threshold value, the difference value is cumulatively added, and the value obtained by cumulatively adding the difference value is greater than the first threshold value. When it is equal to or larger than the second large threshold value, it is determined that the pixel value of the Gr pixel and the pixel value of the Gb pixel are corrected.
The imaging apparatus according to another aspect of the present invention includes a line in which R pixels and Gr pixels are alternately arranged in the horizontal direction and a line in which B pixels and Gb pixels are alternately arranged in the horizontal direction. An image pickup apparatus having a Bayer array structure solid-state image pickup device alternately arranged in each of the image regions obtained from the output of the solid-state image pickup device for each image region composed of a predetermined number of pixels. An average pixel value calculation unit that calculates a Gr average pixel value that is an average value of pixel values of Gr pixels included in the image area, and calculates a Gb average pixel value that is an average value of pixel values of Gb pixels included in the image area; A correction determination unit that determines whether to correct a pixel value of the Gr pixel and a pixel value of the Gb pixel based on the Gr average pixel value and the Gb average pixel value; and the correction determination unit Accordingly, when it is determined that correction is to be performed, the correction unit corrects the pixel value of the Gr pixel and the pixel value of the Gb pixel, and the correction unit is located around the Gr pixel that is the processing target pixel The pixel value of the Gr pixel that is the processing target pixel is corrected based on the pixel value of the Gb pixel, and the processing target pixel is based on the pixel value of the Gr pixel that is located around the Gb pixel that is the processing target pixel. The pixel value of the Gb pixel is corrected.

本発明のさらに別の態様に係る撮像装置は、水平方向にR画素およびGr画素が交互に配列されたラインと、水平方向にB画素およびGb画素が交互に配列されたラインとが垂直方向に交互に配置されるベイヤ配列構造の固体撮像素子を有する撮像装置であって、前記固体撮像素子の出力から得られる画像データについて、所定数の画素から構成される画像領域ごとに、前記画像領域に含まれるGr画素の画素値の平均値であるGr平均画素値を求めるとともに、前記画像領域に含まれるGb画素の画素値の平均値であるGb平均画素値を求める平均画素値算出部と、前記画像領域ごとに、前記Gr平均画素値および前記Gb平均画素値に基づいて、前記Gr画素の画素値および前記Gb画素の画素値を補正するための補正量を算出する補正量算出部と、前記画像領域ごとに、前記補正量算出部で算出された補正量に基づいて、前記画像領域内のGr画素およびGb画素の画素値を補正する補正部と、を備え、前記補正量算出部は、前記画像領域ごとに前記Gr平均画素値と前記Gb平均画素値との差分値を算出し、算出した差分値が第1の所定値より小さい場合には補正量を0とし、前記差分値が前記第1の所定値より大きい第2の所定値以上の場合には補正量を最大補正量とし、前記差分値が前記第1の所定値以上であって、かつ、前記第2の所定値より小さい場合には、前記差分値が大きくなるほど、0から最大補正量までの間で単調増加的に補正量を大きくする。
また、本発明のさらに別の態様に係る撮像装置は、水平方向にR画素およびGr画素が交互に配列されたラインと、水平方向にB画素およびGb画素が交互に配列されたラインとが垂直方向に交互に配置されるベイヤ配列構造の固体撮像素子を有する撮像装置であって、前記固体撮像素子の出力から得られる画像データについて、所定数の画素から構成される画像領域ごとに、前記画像領域に含まれるGr画素の画素値の平均値であるGr平均画素値を求めるとともに、前記画像領域に含まれるGb画素の画素値の平均値であるGb平均画素値を求める平均画素値算出部と、前記画像領域ごとに、前記Gr平均画素値および前記Gb平均画素値に基づいて、前記Gr画素の画素値および前記Gb画素の画素値を補正するための補正量を算出する補正量算出部と、前記画像領域ごとに、前記補正量算出部で算出された補正量に基づいて、前記画像領域内のGr画素およびGb画素の画素値を補正する補正部と、を備え、前記補正量算出部で算出される補正量は、補正係数であって、前記補正部は、処理対象画素がGr画素である場合に、前記Gr画素の画素値および前記Gr画素の周辺に位置するGb画素の画素値を前記補正係数に基づいて加重平均加算するとともに、処理対象画素がGb画素である場合に、前記Gb画素の画素値および前記Gb画素の周辺に位置するGr画素の画素値を前記補正係数に基づいて加重平均加算することによって、前記Gr画素およびGb画素の画素値を補正する。
Imaging device according to still another aspect of the present invention, a line of R pixels and Gr pixels are arranged alternately in the horizontal direction, and a line B pixel and Gb pixel in the horizontal direction are alternately arranged in the vertical direction An image pickup apparatus having a solid-state image pickup device having a Bayer array structure arranged alternately, wherein image data obtained from an output of the solid-state image pickup device is arranged in the image region for each image region composed of a predetermined number of pixels. An average pixel value calculation unit that calculates a Gr average pixel value that is an average value of pixel values of Gr pixels included, and calculates a Gb average pixel value that is an average value of pixel values of Gb pixels included in the image region; Correction for calculating a correction amount for correcting the pixel value of the Gr pixel and the pixel value of the Gb pixel based on the Gr average pixel value and the Gb average pixel value for each image region A calculating unit, for each of the image areas, based on the correction amount calculated in the correction amount calculation unit, and a correcting unit for correcting the pixel value of the Gr pixel and Gb pixel in the image area, the correction The amount calculation unit calculates a difference value between the Gr average pixel value and the Gb average pixel value for each image region, and sets the correction amount to 0 when the calculated difference value is smaller than a first predetermined value, When the difference value is greater than or equal to a second predetermined value greater than the first predetermined value, the correction amount is set as a maximum correction amount, the difference value is greater than or equal to the first predetermined value, and the second When the difference value is smaller than the predetermined value, the correction amount is increased monotonically between 0 and the maximum correction amount as the difference value increases.
In addition, in an imaging device according to still another aspect of the present invention, a line in which R pixels and Gr pixels are alternately arranged in the horizontal direction and a line in which B pixels and Gb pixels are alternately arranged in the horizontal direction are vertical. An image pickup apparatus having a Bayer array structure solid-state image pickup device alternately arranged in a direction, wherein the image data obtained from the output of the solid-state image pickup device for each image region composed of a predetermined number of pixels An average pixel value calculation unit that obtains a Gr average pixel value that is an average value of pixel values of Gr pixels included in the region and calculates a Gb average pixel value that is an average value of pixel values of the Gb pixels included in the image region; For each of the image regions, a correction amount for correcting the pixel value of the Gr pixel and the pixel value of the Gb pixel is calculated based on the Gr average pixel value and the Gb average pixel value. A correction amount calculation unit; and a correction unit that corrects the pixel values of the Gr pixel and the Gb pixel in the image region based on the correction amount calculated by the correction amount calculation unit for each image region, The correction amount calculated by the correction amount calculation unit is a correction coefficient, and the correction unit is located around the pixel value of the Gr pixel and the Gr pixel when the processing target pixel is a Gr pixel. The pixel value of the Gb pixel is subjected to weighted average addition based on the correction coefficient, and when the pixel to be processed is a Gb pixel, the pixel value of the Gb pixel and the pixel value of the Gr pixel located around the Gb pixel are calculated. The pixel values of the Gr pixel and Gb pixel are corrected by performing weighted average addition based on the correction coefficient.

本発明のさらに別の態様に係る撮像方法は、水平方向にR画素およびGr画素が交互に配列されたラインと、水平方向にB画素およびGb画素が交互に配列されたラインとが垂直方向に交互に配置されるベイヤ配列構造の固体撮像素子を有する撮像装置を用いた撮像方法であって、前記固体撮像素子の出力から得られる画像データについて、所定数の画素から構成される画像領域ごとに、前記画像領域に含まれるGr画素の画素値の平均値であるGr平均画素値を求めるとともに、前記画像領域に含まれるGb画素の画素値の平均値であるGb平均画素値を求めるステップと、前記Gr平均画素値および前記Gb平均画素値に基づいて、前記Gr画素の画素値および前記Gb画素の画素値の補正を行うか否かを判定するステップと、前記補正を行うと判定すると、前記Gr画素の画素値および前記Gb画素の画素値を補正するステップと、を備え、前記補正を行うか否かを判定するステップでは、前記画像領域ごとに前記Gr平均画素値と前記Gb平均画素値との差分値を算出し、算出した差分値が第1の閾値以上であれば、前記差分値を累積加算し、前記差分値を累積加算した値が前記第1の閾値よりも大きい第2の閾値以上の場合に、前記Gr画素の画素値および前記Gb画素の画素値の補正を行うと判定する。
また、本発明のさらに別の態様に係る撮像方法は、水平方向にR画素およびGr画素が交互に配列されたラインと、水平方向にB画素およびGb画素が交互に配列されたラインとが垂直方向に交互に配置されるベイヤ配列構造の固体撮像素子を有する撮像装置を用いた撮像方法であって、前記固体撮像素子の出力から得られる画像データについて、所定数の画素から構成される画像領域ごとに、前記画像領域に含まれるGr画素の画素値の平均値であるGr平均画素値を求めるとともに、前記画像領域に含まれるGb画素の画素値の平均値であるGb平均画素値を求めるステップと、前記Gr平均画素値および前記Gb平均画素値に基づいて、前記Gr画素の画素値および前記Gb画素の画素値の補正を行うか否かを判定するステップと、前記補正を行うと判定すると、前記Gr画素の画素値および前記Gb画素の画素値を補正するステップと、を備え、前記補正するステップでは、処理対象画素であるGr画素の周辺に位置するGb画素の画素値に基づいて、前記処理対象画素であるGr画素の画素値を補正するとともに、処理対象画素であるGb画素の周辺に位置するGr画素の画素値に基づいて、前記処理対象画素であるGb画素の画素値を補正する。
In the imaging method according to still another aspect of the present invention, a line in which R pixels and Gr pixels are alternately arranged in the horizontal direction and a line in which B pixels and Gb pixels are alternately arranged in the horizontal direction are arranged in the vertical direction. An imaging method using an imaging device having alternately arranged Bayer array structure solid-state image sensors, wherein the image data obtained from the output of the solid-state image sensor for each image region composed of a predetermined number of pixels Obtaining a Gr average pixel value which is an average value of pixel values of Gr pixels included in the image area, and obtaining a Gb average pixel value which is an average value of pixel values of Gb pixels included in the image area; Determining whether to correct the pixel value of the Gr pixel and the pixel value of the Gb pixel based on the Gr average pixel value and the Gb average pixel value; If it is determined to perform, the includes a step of correcting the pixel value and the pixel value of the Gb pixel of the Gr pixel, the said at determining whether or not to correct, the Gr average pixel value for each said image region And the Gb average pixel value is calculated, and if the calculated difference value is equal to or greater than a first threshold value, the difference value is cumulatively added, and the value obtained by cumulatively adding the difference value is the first threshold value. When the value is equal to or larger than the second threshold value, the pixel value of the Gr pixel and the pixel value of the Gb pixel are determined to be corrected.
In addition, in the imaging method according to another aspect of the present invention, a line in which R pixels and Gr pixels are alternately arranged in the horizontal direction and a line in which B pixels and Gb pixels are alternately arranged in the horizontal direction are vertical. An imaging method using an imaging device having a solid-state imaging device having a Bayer array structure alternately arranged in a direction, and an image region composed of a predetermined number of pixels for image data obtained from the output of the solid-state imaging device For each step, a Gr average pixel value that is an average value of pixel values of Gr pixels included in the image area and a Gb average pixel value that is an average value of pixel values of Gb pixels included in the image area are obtained. Determining whether to correct the pixel value of the Gr pixel and the pixel value of the Gb pixel based on the Gr average pixel value and the Gb average pixel value; If it is determined that correction is to be performed, the pixel value of the Gr pixel and the pixel value of the Gb pixel are corrected. In the correction step, the Gb pixel positioned around the Gr pixel that is the processing target pixel is included. Based on the pixel value, the pixel value of the Gr pixel that is the processing target pixel is corrected, and based on the pixel value of the Gr pixel that is located around the Gb pixel that is the processing target pixel, the processing target pixel Gb The pixel value of the pixel is corrected.

本発明のさらに別の態様に係る撮像方法は、水平方向にR画素およびGr画素が交互に配列されたラインと、水平方向にB画素およびGb画素が交互に配列されたラインとが垂直方向に交互に配置されるベイヤ配列構造の固体撮像素子を有する撮像装置を用いた撮像方法であって、前記固体撮像素子の出力から得られる画像データについて、所定数の画素から構成される画像領域ごとに、前記画像領域に含まれるGr画素の画素値の平均値であるGr平均画素値を求めるとともに、前記画像領域に含まれるGb画素の画素値の平均値であるGb平均画素値を求めるステップと、前記画像領域ごとに、前記Gr平均画素値および前記Gb平均画素値に基づいて、前記Gr画素の画素値および前記Gb画素の画素値を補正するための補正量を算出するステップと、前記画像領域ごとに、前記補正量に基づいて、前記画像領域内のGr画素およびGb画素の画素値を補正するステップと、を備え、前記補正量を算出するステップでは、前記画像領域ごとに前記Gr平均画素値と前記Gb平均画素値との差分値を算出し、算出した差分値が第1の所定値より小さい場合には補正量を0とし、前記差分値が前記第1の所定値より大きい第2の所定値以上の場合には補正量を最大補正量とし、前記差分値が前記第1の所定値以上であって、かつ、前記第2の所定値より小さい場合には、前記差分値が大きくなるほど、0から最大補正量までの間で単調増加的に補正量を大きくする。
また、本発明のさらに別の態様に係る撮像方法は、水平方向にR画素およびGr画素が交互に配列されたラインと、水平方向にB画素およびGb画素が交互に配列されたラインとが垂直方向に交互に配置されるベイヤ配列構造の固体撮像素子を有する撮像装置を用いた撮像方法であって、前記固体撮像素子の出力から得られる画像データについて、所定数の画素から構成される画像領域ごとに、前記画像領域に含まれるGr画素の画素値の平均値であるGr平均画素値を求めるとともに、前記画像領域に含まれるGb画素の画素値の平均値であるGb平均画素値を求めるステップと、前記画像領域ごとに、前記Gr平均画素値および前記Gb平均画素値に基づいて、前記Gr画素の画素値および前記Gb画素の画素値を補正するための補正量を算出するステップと、前記画像領域ごとに、前記補正量に基づいて、前記画像領域内のGr画素およびGb画素の画素値を補正するステップと、を備え、前記補正量は、補正係数であって、前記補正するステップでは、処理対象画素がGr画素である場合に、前記Gr画素の画素値および前記Gr画素の周辺に位置するGb画素の画素値を前記補正係数に基づいて加重平均加算するとともに、処理対象画素がGb画素である場合に、前記Gb画素の画素値および前記Gb画素の周辺に位置するGr画素の画素値を前記補正係数に基づいて加重平均加算することによって、前記Gr画素およびGb画素の画素値を補正する。
In the imaging method according to still another aspect of the present invention, a line in which R pixels and Gr pixels are alternately arranged in the horizontal direction and a line in which B pixels and Gb pixels are alternately arranged in the horizontal direction are arranged in the vertical direction. An imaging method using an imaging device having alternately arranged Bayer array structure solid-state image sensors, wherein the image data obtained from the output of the solid-state image sensor for each image region composed of a predetermined number of pixels Obtaining a Gr average pixel value which is an average value of pixel values of Gr pixels included in the image area, and obtaining a Gb average pixel value which is an average value of pixel values of Gb pixels included in the image area; For each image area, a correction amount for correcting the pixel value of the Gr pixel and the pixel value of the Gb pixel is calculated based on the Gr average pixel value and the Gb average pixel value. A step that, for each of said image regions, on the basis of the correction amount, and a step of correcting the pixel value of the Gr pixel and Gb pixel in the image area, in the step of calculating the correction amount, the image A difference value between the Gr average pixel value and the Gb average pixel value is calculated for each region, and when the calculated difference value is smaller than a first predetermined value, the correction amount is set to 0, and the difference value is the first value. When the second predetermined value is greater than the second predetermined value, the correction amount is set as the maximum correction amount, and the difference value is equal to or larger than the first predetermined value and smaller than the second predetermined value. Increases the correction amount monotonically between 0 and the maximum correction amount as the difference value increases.
In addition, in the imaging method according to another aspect of the present invention, a line in which R pixels and Gr pixels are alternately arranged in the horizontal direction and a line in which B pixels and Gb pixels are alternately arranged in the horizontal direction are vertical. An imaging method using an imaging device having a solid-state imaging device having a Bayer array structure alternately arranged in a direction, and an image region composed of a predetermined number of pixels for image data obtained from the output of the solid-state imaging device For each step, a Gr average pixel value that is an average value of pixel values of Gr pixels included in the image area and a Gb average pixel value that is an average value of pixel values of Gb pixels included in the image area are obtained. And a correction amount for correcting the pixel value of the Gr pixel and the pixel value of the Gb pixel based on the Gr average pixel value and the Gb average pixel value for each image region And a step of correcting pixel values of Gr pixels and Gb pixels in the image region based on the correction amount for each image region, and the correction amount is a correction coefficient, In the correcting step, when the processing target pixel is a Gr pixel, the pixel value of the Gr pixel and the pixel value of a Gb pixel located around the Gr pixel are weighted and averaged based on the correction coefficient. When the pixel to be processed is a Gb pixel, the pixel value of the Gb pixel and the pixel value of the Gr pixel located around the Gb pixel are weighted and averaged based on the correction coefficient, whereby the Gr pixel and The pixel value of the Gb pixel is corrected.

本発明によれば、Gr画素の画素値とGb画素の画素値との間の段差のうち、ゴースト光などにより生じる不要な段差を補正することができる。   According to the present invention, an unnecessary step caused by ghost light or the like among the steps between the pixel value of the Gr pixel and the pixel value of the Gb pixel can be corrected.

第1の実施形態における撮像装置であるデジタルスチルカメラの構成を示すブロック図である。It is a block diagram which shows the structure of the digital still camera which is an imaging device in 1st Embodiment. 画像処理部の詳細な構成を示す図である。It is a figure which shows the detailed structure of an image process part. 画像処理部によって行われる処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the process performed by the image process part. 所定の大きさの領域である40画素×40画素の領域内で、Gr画素の平均化と、Gb画素の平均化を行う方法を説明するための図である。It is a figure for demonstrating the method of averaging the Gr pixel and the average of a Gb pixel within the area | region of 40 pixels x 40 pixels which is an area | region of predetermined magnitude | size. 所定の大きさの領域である40画素×40画素の領域内で、Gr平均化フィルタ処理およびGb平均化フィルタ処理を行って、求めたGr平均画素値およびGb平均画素値を縮小画像メモリに記憶させる処理を示す図である。Gr average filter processing and Gb average filter processing are performed within an area of 40 pixels × 40 pixels that is a predetermined size area, and the obtained Gr average pixel value and Gb average pixel value are stored in the reduced image memory It is a figure which shows the process to be made. 段差検出部1053で行われる段差検出処理の詳細な内容を示すフローチャートである。10 is a flowchart showing detailed contents of a level difference detection process performed by a level difference detection unit 1053. 図7(a)は、処理対象画素であるGb画素の周囲に位置する4つのGr画素の画素値に基づいて、処理対象画素であるGb画素の画素値を補正する方法を説明するための図であり、図7(b)は、処理対象画素であるGr画素の周囲に位置する4つのGb画素の画素値に基づいて、処理対象画素であるGr画素の画素値を補正する方法を説明するための図である。FIG. 7A is a diagram for explaining a method of correcting the pixel value of the Gb pixel that is the processing target pixel based on the pixel values of the four Gr pixels that are located around the Gb pixel that is the processing target pixel. FIG. 7B illustrates a method of correcting the pixel value of the Gr pixel that is the processing target pixel based on the pixel values of the four Gb pixels that are located around the Gr pixel that is the processing target pixel. FIG. ゴースト光が発生した場合のGr信号値およびGb信号値を説明するための図である。It is a figure for demonstrating the Gr signal value and Gb signal value when a ghost light generate | occur | produces. 画像内に非常に細かいエッジが存在する場合のGr信号値およびGb信号値を説明するための図である。It is a figure for demonstrating the Gr signal value and Gb signal value in case a very fine edge exists in an image. 第2の実施形態における撮像装置の画像処理部の詳細な構成を示し図である。It is a figure which shows the detailed structure of the image process part of the imaging device in 2nd Embodiment. 第2の実施形態における画像処理部によって行われる処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the process performed by the image process part in 2nd Embodiment. 補正係数マップを作成する処理の詳細を示すフローチャートである。It is a flowchart which shows the detail of the process which produces a correction coefficient map. 相対差分値Dと補正係数αとの関係を示す図である。It is a figure which shows the relationship between the relative difference value D and the correction coefficient (alpha). 図14(a)は、非常に細かいエッジが存在する被写体と、ゴースト光が存在する画像の一例を示す図であり、図14(b)は、図14(a)に示す画像に基づいて作成された補正係数マップを示す図である。FIG. 14A is a diagram showing an example of an object with very fine edges and an image with ghost light, and FIG. 14B is created based on the image shown in FIG. It is a figure which shows the corrected correction coefficient map.

<第1の実施形態>
図1は、第1の実施形態における撮像装置であるデジタルスチルカメラの構成を示すブロック図である。
<First Embodiment>
FIG. 1 is a block diagram illustrating a configuration of a digital still camera that is an imaging apparatus according to the first embodiment.

レンズ101は、被写体の光学像を撮像素子102に集光させる。レンズ101は、単焦点レンズであってもよいし、ズームレンズであってもよい。   The lens 101 condenses the optical image of the subject on the image sensor 102. The lens 101 may be a single focus lens or a zoom lens.

レンズ駆動制御回路112は、後述するマイクロコンピュータ107によって算出された合焦評価値に基づいて、レンズ101を駆動させる指令をレンズ駆動部111に出す。レンズ駆動部111は、レンズ駆動制御回路112からの指示に基づいて、レンズ101を駆動させて、焦点距離やフォーカス位置の変更を行う。   The lens drive control circuit 112 issues a command to drive the lens 101 to the lens drive unit 111 based on a focus evaluation value calculated by the microcomputer 107 described later. The lens driving unit 111 drives the lens 101 based on an instruction from the lens driving control circuit 112 to change the focal length and the focus position.

撮像素子102は、各画素を構成するフォトダイオードの前面に、ベイヤ配列のカラーフィルタが配置された撮像素子である。ベイヤ配列は、水平方向に赤色フィルタと緑色フィルタが交互に配置されたラインと、緑色フィルタと青色フィルタが交互に配置されたラインとを有し、さらにその2つのラインを垂直方向にも交互に配置することで構成されている。本明細書では、赤色(Red)フィルタの画素をR画素、緑色(Green)フィルタの画素のうち、水平方向にR画素と隣り合う画素をGr画素、青色(Blue)フィルタの画素をB画素、緑色フィルタの画素のうち、水平方向にB画素と隣り合う画素をGb画素と呼ぶ。この撮像素子102は、レンズ101により集光された光を、画素を構成するフォトダイオードで受光して光電変換することで、光の量を電荷量として撮像回路103へ出力する。なお、撮像素子102は、CMOS方式のものでもCCD方式のものでも良い。   The image sensor 102 is an image sensor in which a Bayer array color filter is arranged in front of a photodiode constituting each pixel. The Bayer array has lines in which red and green filters are alternately arranged in the horizontal direction and lines in which green and blue filters are alternately arranged, and the two lines are also alternately arranged in the vertical direction. It is composed by arranging. In this specification, a pixel of a red (Red) filter is an R pixel, a pixel of a green (Green) filter, a pixel adjacent to the R pixel in the horizontal direction is a Gr pixel, a pixel of a blue (Blue) filter is a B pixel, Among the pixels of the green filter, a pixel adjacent to the B pixel in the horizontal direction is referred to as a Gb pixel. The imaging element 102 outputs the amount of light to the imaging circuit 103 as a charge amount by receiving and photoelectrically converting the light collected by the lens 101 by a photodiode constituting the pixel. The image sensor 102 may be a CMOS type or a CCD type.

撮像回路103は、撮像素子102から読み出された電気信号(アナログ画像信号)に対し、リセットノイズ等を低減した上で波形整形を行い、さらに目的の明るさとなるように、ゲインアップを行う。A/D変換部104は、撮像回路103から出力されたアナログ画像信号をデジタル画像信号(以後、画像データという)に変換する。   The imaging circuit 103 performs waveform shaping on the electrical signal (analog image signal) read from the imaging element 102 while reducing reset noise and the like, and further increases the gain so that the target brightness is obtained. The A / D converter 104 converts the analog image signal output from the imaging circuit 103 into a digital image signal (hereinafter referred to as image data).

バス199は、デジタルカメラ内部で発生した各種データをデジタルカメラ内の各部に転送するための転送路である。バス199は、A/D変換部104と、画像処理部105と、JPEG処理部106と、マイクロコンピュータ107と、SDRAM108と、メモリI/F109と、LCDドライバ110に接続されている。   A bus 199 is a transfer path for transferring various data generated in the digital camera to each unit in the digital camera. The bus 199 is connected to the A / D converter 104, the image processor 105, the JPEG processor 106, the microcomputer 107, the SDRAM 108, the memory I / F 109, and the LCD driver 110.

A/D変換部104から出力される画像データは、バス199を介して一旦SDRAM108に記憶される。SDRAM108は、A/D変換部104において得られた画像データや、画像処理部105、JPEG処理部106において処理された画像データ等の各種データが一時的に記憶される記憶部である。   The image data output from the A / D conversion unit 104 is temporarily stored in the SDRAM 108 via the bus 199. The SDRAM 108 is a storage unit that temporarily stores various data such as image data obtained by the A / D conversion unit 104 and image data processed by the image processing unit 105 and the JPEG processing unit 106.

画像処理部105は、SDRAM108から読み出した画像データに対して、オプティカルブラック減算処理、ホワイトバランス補正処理、同時化処理、ガンマ補正処理、および、色再現処理などの様々な画像処理を施す。画像処理部105はまた、Gr画素の信号値およびGb画素の信号値間の不要な信号差(段差)を補正する。   The image processing unit 105 performs various image processing such as optical black subtraction processing, white balance correction processing, synchronization processing, gamma correction processing, and color reproduction processing on the image data read from the SDRAM 108. The image processing unit 105 also corrects an unnecessary signal difference (step) between the signal value of the Gr pixel and the signal value of the Gb pixel.

JPEG処理部106は、画像データの記録時には、SDRAM108から画像データを読み出し、読み出した画像データをJPEG圧縮方式に従って圧縮して、圧縮したJPEG画像データを、SDRAM108に一旦記憶する。マイクロコンピュータ107は、SDRAM108に記憶されたJPEG画像データに対して、JPEGファイルを構成するために必要なJPEGヘッダを付加してJPEGファイルを作成し、作成したJPEGファイルを、メモリI/F109を介して記録媒体115に記録する。記録媒体115は、例えばカメラ本体に着脱可能なメモリカードからなる記録媒体であるが、これに限定されるものではない。   When the image data is recorded, the JPEG processing unit 106 reads the image data from the SDRAM 108, compresses the read image data according to the JPEG compression method, and temporarily stores the compressed JPEG image data in the SDRAM 108. The microcomputer 107 creates a JPEG file by adding a JPEG header necessary for constructing a JPEG file to the JPEG image data stored in the SDRAM 108, and sends the created JPEG file via the memory I / F 109. To the recording medium 115. The recording medium 115 is, for example, a recording medium including a memory card that can be attached to and detached from the camera body, but is not limited thereto.

LCDドライバ110は、LCD116に画像を表示させる。画像の表示には、撮影直後の画像データを短時間だけ表示するレックビュー表示、記録媒体115に記録されたJPEGファイルの再生表示、および、ライブビュー画像(スルー画像とも呼ばれる)等の動画の表示が含まれる。また、記録媒体115に記録されたJPEGファイルを再生する場合、JPEG処理部106は、記録媒体115に記録されているJPEGファイルを読み出して伸張処理を施した上で、伸張した画像データを一旦SDRAM108に記憶させる。LCDドライバ110は、伸張された画像データをSDRAM108から読み出し、読み出した画像データを映像信号へ変換した後でLCD116へ出力して、画像の表示を行う。   The LCD driver 110 displays an image on the LCD 116. For image display, rec view display that displays image data immediately after shooting for a short time, playback display of a JPEG file recorded on the recording medium 115, and display of moving images such as a live view image (also referred to as a through image). Is included. Also, when playing back a JPEG file recorded on the recording medium 115, the JPEG processing unit 106 reads the JPEG file recorded on the recording medium 115 and performs expansion processing, and then temporarily expands the expanded image data to the SDRAM 108. Remember me. The LCD driver 110 reads the decompressed image data from the SDRAM 108, converts the read image data into a video signal, and then outputs it to the LCD 116 to display an image.

制御部としての機能を有するマイクロコンピュータ107は、デジタルカメラ本体の各種シーケンスを統括的に制御する。マイクロコンピュータ107には、レンズ駆動制御回路112、操作部113およびFlashメモリ114が接続されている。   The microcomputer 107 having a function as a control unit comprehensively controls various sequences of the digital camera body. The microcomputer 107 is connected to a lens drive control circuit 112, an operation unit 113, and a flash memory 114.

操作部113は、電源ボタン、レリーズボタン、各種入力キー等の操作部材である。ユーザによって、操作部113の何れかの操作部材が操作されることにより、マイクロコンピュータ107は、ユーザの操作に応じた各種シーケンスを実行する。電源ボタンは、当該デジタルカメラの電源のオン/オフ指示を行うための操作部材である。電源ボタンが押されたときに、マイクロコンピュータ107は、当該デジタルカメラの電源をオン又はオフする。レリーズボタンは、ファーストレリーズスイッチとセカンドレリーズスイッチの2段スイッチを有して構成されている。レリーズボタンが半押しされて、ファーストレリーズスイッチがオンされた場合に、マイクロコンピュータ107は、AE処理やAF処理等の撮影準備シーケンスを行う。また、レリーズボタンが全押しされて、セカンドレリーズスイッチがオンされた場合に、マイクロコンピュータ107は、撮影シーケンスを実行して撮影を行う。   The operation unit 113 is an operation member such as a power button, a release button, and various input keys. When one of the operation members of the operation unit 113 is operated by the user, the microcomputer 107 executes various sequences according to the user's operation. The power button is an operation member for instructing power on / off of the digital camera. When the power button is pressed, the microcomputer 107 turns on or off the power of the digital camera. The release button has a two-stage switch of a first release switch and a second release switch. When the release button is pressed halfway and the first release switch is turned on, the microcomputer 107 performs a shooting preparation sequence such as AE processing and AF processing. When the release button is fully pressed and the second release switch is turned on, the microcomputer 107 performs shooting by executing a shooting sequence.

Flashメモリ114は、ホワイトバランスモードに応じたホワイトバランスゲインやローパスフィルタ係数等のデジタルカメラの動作に必要な各種パラメータなどを記憶している。また、Flashメモリ114は、マイクロコンピュータ107にて実行する各種プログラムも記憶している。マイクロコンピュータ107は、Flashメモリ114に記憶されているプログラムに従い、またFlashメモリ114から各種シーケンスに必要なパラメータを読み込み、各処理を実行する。   The flash memory 114 stores various parameters necessary for the operation of the digital camera such as a white balance gain and a low-pass filter coefficient corresponding to the white balance mode. The flash memory 114 also stores various programs executed by the microcomputer 107. The microcomputer 107 reads parameters necessary for various sequences from the flash memory 114 according to a program stored in the flash memory 114, and executes each process.

図2は、画像処理部105の詳細な構成を示す図である。画像処理部105は、ローパスフィルタ部1051(以下では、LPF部1051と呼ぶ)と、縮小画像メモリ1052と、段差検出部1053と、制御部1054と、段差補正部1055と、合成部1056とを備える。   FIG. 2 is a diagram illustrating a detailed configuration of the image processing unit 105. The image processing unit 105 includes a low-pass filter unit 1051 (hereinafter referred to as an LPF unit 1051), a reduced image memory 1052, a step detection unit 1053, a control unit 1054, a step correction unit 1055, and a synthesis unit 1056. Prepare.

LPF部1051は、SDRAM108から画像データを読み出して、読み出した画像データの所定の大きさの領域ごとに、Gr画素およびGb画素の画素値をそれぞれ平均化する。ここでは、平均化処理によって求められたGr画素およびGb画素の画素値をそれぞれ、Gr平均画素値およびGb平均画素値と呼ぶ。Gr平均画素値およびGb平均画素値は、縮小画像メモリ1052に記憶する。   The LPF unit 1051 reads the image data from the SDRAM 108, and averages the pixel values of the Gr pixel and the Gb pixel for each area of a predetermined size of the read image data. Here, the pixel values of the Gr pixel and the Gb pixel obtained by the averaging process are referred to as a Gr average pixel value and a Gb average pixel value, respectively. The Gr average pixel value and the Gb average pixel value are stored in the reduced image memory 1052.

段差検出部1053は、縮小画像メモリ1052に記録されているGr平均画素値およびGb平均画素値に基づいて、Gr画素の信号(以下、Gr信号と呼ぶ)とGb画素の信号(以下、Gb信号と呼ぶ)との間の段差(信号差)を検出する。   Based on the Gr average pixel value and the Gb average pixel value recorded in the reduced image memory 1052, the level difference detection unit 1053 performs a Gr pixel signal (hereinafter referred to as a Gr signal) and a Gb pixel signal (hereinafter referred to as a Gb signal). The step (signal difference) is detected.

制御部1054は、段差検出部1053による段差検出結果に基づいて、Gr信号とGb信号との間の段差の補正の有無を段差補正部1055に指示する。   The control unit 1054 instructs the step correction unit 1055 whether or not to correct the step between the Gr signal and the Gb signal based on the step detection result by the step detection unit 1053.

段差補正部1055は、制御部1054からの補正指示に基づいて、SDRAM108から読み出した画像データのGr画素およびGb画素の画素値を補正する。ただし、制御部1054から、補正無しの指示を受けると、段差補正部1055は、SDRAM108から読み出した画像データをそのまま合成部1056に出力する。   The level difference correction unit 1055 corrects the pixel values of the Gr pixel and the Gb pixel of the image data read from the SDRAM 108 based on a correction instruction from the control unit 1054. However, when an instruction for no correction is received from the control unit 1054, the step correction unit 1055 outputs the image data read from the SDRAM 108 to the synthesis unit 1056 as it is.

合成部1056は、ベイヤ配列による画像データ(ベイヤ画像データ)から、1画素あたりR、G、Bの情報からなる画像データを生成するデモザイキング処理を行う。   The synthesizing unit 1056 performs a demosaicing process for generating image data including R, G, and B information per pixel from image data (Bayer image data) based on a Bayer array.

図3は、画像処理部105によって行われる処理の流れを示すフローチャートである。ステップS10において、LPF部1051は、A/D変換部104から出力されて、SDRAM108に一時的に格納されている画像データ(ベイヤ画像データ)を、SDRAM108から読み込む。   FIG. 3 is a flowchart showing a flow of processing performed by the image processing unit 105. In step S <b> 10, the LPF unit 1051 reads image data (Bayer image data) output from the A / D conversion unit 104 and temporarily stored in the SDRAM 108 from the SDRAM 108.

ステップS20において、LPF部1051は、SDRAM108から読み出した画像データの所定の大きさの領域ごとに、Gr画素およびGb画素の画素値を平均化して、Gr平均画素値およびGb平均画素値を求め、縮小画像メモリ1052に記憶させる。所定の大きさの領域とは、画像中に現れるゴースト光の大きさを超えない範囲であって、かつ、平均化によって細かいエッジの構造が十分に見えなくなるくらいの大きさであり、例えば、40画素×40画素の領域である。   In step S20, the LPF unit 1051 averages the pixel values of the Gr pixel and the Gb pixel for each region of a predetermined size of the image data read from the SDRAM 108, and obtains the Gr average pixel value and the Gb average pixel value. The image is stored in the reduced image memory 1052. The predetermined size region is a range that does not exceed the size of the ghost light appearing in the image, and is a size that does not sufficiently show the fine edge structure by averaging. This is an area of pixels × 40 pixels.

図4は、所定の大きさの領域である40画素×40画素の領域内で、Gr画素の平均化と、Gb画素の平均化を行う方法を説明するための図である。図4に示すように、40画素×40画素内のGr画素を全て読み出して、読み出した全てのGr画素の画素値の平均を求めるGr平均化フィルタ処理と、40画素×40画素内のGb画素を全て読み出して、読み出した全てのGb画素の画素値の平均を求めるGb平均化フィルタ処理とを行う。   FIG. 4 is a diagram for explaining a method of performing averaging of Gr pixels and averaging of Gb pixels within a region of 40 pixels × 40 pixels that is a region having a predetermined size. As shown in FIG. 4, Gr averaging filter processing for reading all Gr pixels within 40 pixels × 40 pixels and calculating the average of the pixel values of all the read Gr pixels, and Gb pixels within 40 pixels × 40 pixels And Gb averaging filter processing for obtaining the average of the pixel values of all the read Gb pixels.

図5は、所定の大きさの領域である40画素×40画素の領域内で、Gr平均化フィルタ処理およびGb平均化フィルタ処理を行って、求めたGr平均画素値およびGb平均画素値を縮小画像メモリ1052に記憶させる処理を示す図である。Gr平均化フィルタ処理で求められたGr平均画素値およびGb平均化フィルタ処理で求められたGb平均画素値はそれぞれ、縮小画像メモリ1052に記憶される。   FIG. 5 shows that a Gr average filter process and a Gb average filter process are performed in an area of 40 pixels × 40 pixels, which is a predetermined size area, and the obtained Gr average pixel value and Gb average pixel value are reduced. It is a figure which shows the process memorize | stored in the image memory. The Gr average pixel value obtained by the Gr averaging filter process and the Gb average pixel value obtained by the Gb average filter process are respectively stored in the reduced image memory 1052.

ステップS30において、段差検出部1053は、ゴースト光などに起因する、Gr信号とGb信号との間の段差の有無を検出する。段差検出部1053で行われる段差検出処理を、図6に示すフローチャートを用いて説明する。   In step S30, the level difference detection unit 1053 detects the presence or absence of a level difference between the Gr signal and the Gb signal due to ghost light or the like. The step detection process performed by the step detection unit 1053 will be described with reference to the flowchart shown in FIG.

図6に示すフローチャートのステップS100では、縮小画像メモリ1052に記憶されている、所定の大きさの領域ごとのGr平均画素値およびGb平均画素値のうち、最初の領域(最初の処理対象領域)に対応するGr平均画素値およびGb平均画素値を読み出す。   In step S100 of the flowchart shown in FIG. 6, the first region (first processing target region) among the Gr average pixel value and Gb average pixel value for each region of a predetermined size stored in the reduced image memory 1052. The Gr average pixel value and the Gb average pixel value corresponding to are read out.

ステップS110では、次式(1)より、Gr平均画素値およびGb平均画素値に基づいて、相対差分値Dを算出する。次式(1)に示すように、相対差分値Dは、Gr平均画素値とGb平均画素値の差分値を、Gr平均画素値とGb平均画素値の平均値で除算して得られる値である。   In step S110, the relative difference value D is calculated based on the Gr average pixel value and the Gb average pixel value from the following equation (1). As shown in the following equation (1), the relative difference value D is a value obtained by dividing the difference value between the Gr average pixel value and the Gb average pixel value by the average value of the Gr average pixel value and the Gb average pixel value. is there.

D=2×(Gr−Gb)/(Gr+Gb) (1)
ステップS120では、ステップS110で算出した相対差分値Dが第1の閾値D1以上であるか否かを判定する。第1の閾値D1は、ノイズを除去するための閾値である。相対差分値Dが第1の閾値D1以上であると判定するとステップS130に進み、第1の閾値D1未満であると判定すると、ステップS140に進む。
D = 2 × (Gr−Gb) / (Gr + Gb) (1)
In step S120, it is determined whether or not the relative difference value D calculated in step S110 is greater than or equal to the first threshold value D1. The first threshold D1 is a threshold for removing noise. If it is determined that the relative difference value D is greater than or equal to the first threshold value D1, the process proceeds to step S130. If it is determined that the relative difference value D is less than the first threshold value D1, the process proceeds to step S140.

ステップS130では、ステップS110で算出した相対差分値Dを段差カウンタに加算する。なお、段差カウンタは、段差検出部1053の内部に設けられているカウンタであり、図6に示すフローチャートの処理が開始される際に、初期値である0にリセットされる。   In step S130, the relative difference value D calculated in step S110 is added to the step counter. The step counter is a counter provided inside the step detection unit 1053, and is reset to 0, which is an initial value, when the processing of the flowchart shown in FIG. 6 is started.

ステップS140では、画像データの全領域に対して、ステップS110からステップS130までの処理を行ったか否かを判定する。画像データの全領域に対する処理が終了していないと判定すると、ステップS150に進む。   In step S140, it is determined whether or not the processing from step S110 to step S130 has been performed on the entire area of the image data. If it is determined that the processing for all areas of the image data has not been completed, the process proceeds to step S150.

ステップS150では、縮小画像メモリ1052から、次の処理対象領域に対応するGr平均画素値およびGb平均画素値を読み出して、ステップS110に進み、ステップS110からステップS130までの処理を行う。これにより、段差カウンタには、所定の大きさの領域ごとに算出される相対差分値Dの値が累積加算される。   In step S150, the Gr average pixel value and the Gb average pixel value corresponding to the next processing target area are read from the reduced image memory 1052, and the process proceeds to step S110 to perform the processes from step S110 to step S130. Thereby, the value of the relative difference value D calculated for each region having a predetermined size is cumulatively added to the step counter.

一方、ステップS140において、画像データの全領域に対する処理が終了したと判定すると、ステップS160に進む。ステップS160では、段差カウンタに加算された相対差分値Dの累積値(以下では、累積相対差分と呼ぶ)が第2の閾値D2以上であるか否かを判定する。第2の閾値D2は、ゴースト光などに起因するGr信号とGb信号との間の段差が存在するか否かを判定するための閾値であり、第1の閾値D1よりも大きい値である。累積相対差分が第2の閾値D2以上であると判定するとステップS170に進み、第2の閾値D2未満であると判定すると、ステップS180に進む。   On the other hand, if it is determined in step S140 that the processing for all areas of the image data has been completed, the process proceeds to step S160. In step S160, it is determined whether or not the cumulative value of the relative difference value D added to the step counter (hereinafter referred to as the cumulative relative difference) is equal to or greater than the second threshold value D2. The second threshold value D2 is a threshold value for determining whether or not there is a step between the Gr signal and the Gb signal due to ghost light or the like, and is a value larger than the first threshold value D1. If it is determined that the accumulated relative difference is greater than or equal to the second threshold value D2, the process proceeds to step S170, and if it is determined that the cumulative relative difference is less than the second threshold value D2, the process proceeds to step S180.

ステップS170では、ゴースト光などに起因するGr信号とGb信号との間の段差が存在すると判定する。一方、ステップS180では、ゴースト光などに起因するGr信号とGb信号との間の段差は存在しないと判定する。   In step S170, it is determined that there is a step between the Gr signal and the Gb signal due to ghost light or the like. On the other hand, in step S180, it is determined that there is no step between the Gr signal and the Gb signal due to ghost light or the like.

図3に示すフローチャートに戻って説明を続ける。ステップS40において、制御部1054は、段差検出部1053による段差検出処理の結果に基づいて、ゴースト光などに起因するGr信号とGb信号との間の段差があるか否かを判定する。制御部1054は、段差ありと判定すると、補正指示を段差補正部1055に出してステップS50に進み、段差無しと判定すると、補正無しの指示を段差補正部1055に出してステップS60に進む。   Returning to the flowchart shown in FIG. In step S40, the control unit 1054 determines whether or not there is a step between the Gr signal and the Gb signal due to ghost light or the like based on the result of the step detection process by the step detection unit 1053. When determining that there is a step, the control unit 1054 outputs a correction instruction to the step correction unit 1055 and proceeds to step S50. When determining that there is no step, the control unit 1054 outputs an instruction without correction to the step correction unit 1055 and proceeds to step S60.

ステップS50において、段差補正部1055は、制御部1054からの補正指示に基づいて、SDRAM108からベイヤ画像データを読み出して、Gr画素およびGb画素の画素値を補正する。   In step S50, the level difference correction unit 1055 reads Bayer image data from the SDRAM 108 based on a correction instruction from the control unit 1054, and corrects the pixel values of the Gr pixel and the Gb pixel.

図7(a)は、処理対象画素であるGb画素の周囲に位置する4つのGr画素の画素値に基づいて、処理対象画素であるGb画素の画素値を補正する方法を説明するための図である。補正後のGb画素の画素値は、次式(2)により表される。式(2)において、補正後Gbは、補正後のGb画素の画素値を、補正前Gbは、補正前のGb画素の画素値を、周辺Gr1〜Gr4は、処理対象画素であるGb画素の周囲に位置する4つのGr画素の画素値をそれぞれ表している。   FIG. 7A is a diagram for explaining a method of correcting the pixel value of the Gb pixel that is the processing target pixel based on the pixel values of the four Gr pixels that are located around the Gb pixel that is the processing target pixel. It is. The pixel value of the Gb pixel after correction is expressed by the following equation (2). In Equation (2), the corrected Gb is the pixel value of the corrected Gb pixel, the uncorrected Gb is the pixel value of the Gb pixel before correction, and the surrounding Gr1 to Gr4 are the Gb pixels that are the processing target pixels. The pixel values of the four Gr pixels located around are shown.

補正後Gb=補正前Gb×(1/2)+(周辺Gr1+周辺Gr2+周辺Gr3+周辺Gr4)×(1/8) (2)
図7(b)は、処理対象画素であるGr画素の周囲に位置する4つのGb画素の画素値に基づいて、処理対象画素であるGr画素の画素値を補正する方法を説明するための図である。補正後のGr画素の画素値は、次式(3)により表される。式(3)において、補正後Grは、補正後のGr画素の画素値を、補正前Grは、補正前のGr画素の画素値を、周辺Gb1〜Gb4は、処理対象画素であるGr画素の周囲に位置する4つのGb画素の画素値をそれぞれ表している。
Gb after correction = Gb before correction × (1/2) + (peripheral Gr1 + peripheral Gr2 + peripheral Gr3 + peripheral Gr4) × (1/8) (2)
FIG. 7B is a diagram for explaining a method of correcting the pixel value of the Gr pixel that is the processing target pixel based on the pixel values of the four Gb pixels that are located around the Gr pixel that is the processing target pixel. It is. The pixel value of the Gr pixel after correction is expressed by the following equation (3). In equation (3), the corrected Gr is the pixel value of the corrected Gr pixel, the uncorrected Gr is the pixel value of the Gr pixel before correction, and the surrounding Gb1 to Gb4 are the Gr pixels that are the processing target pixels. The pixel values of four Gb pixels located in the periphery are respectively shown.

補正後Gr=補正前Gr×(1/2)+(周辺Gb1+周辺Gb2+周辺Gb3+周辺Gb4)×(1/8) (3)
Gr画素およびGb画素の画素値を補正は、ベイヤ画像データ内の全てのGr画素およびGb画素を対象として行う。
Gr after correction = Gr before correction × (1/2) + (peripheral Gb1 + peripheral Gb2 + peripheral Gb3 + peripheral Gb4) × (1/8) (3)
The pixel values of the Gr pixel and the Gb pixel are corrected for all the Gr pixels and Gb pixels in the Bayer image data.

ステップS60において、合成部1056は、ベイヤ画像データから、1画素あたりR、G、Bの情報からなる画像データを生成するデモザイキング処理を行う。   In step S60, the synthesizing unit 1056 performs a demosaicing process for generating image data including R, G, and B information per pixel from the Bayer image data.

図8は、ゴースト光が発生した場合のGr信号値およびGb信号値を説明するための図である。図8(a)は、画像上でゴースト光が発生している領域80および所定の大きさの領域である40画素×40画素の領域81を示す図である。また、図8(b)は、所定の大きさの領域81内におけるGr信号値(Gr画素の画素値)とGb信号値(Gb画素の画素値)を示す図である。   FIG. 8 is a diagram for explaining the Gr signal value and the Gb signal value when ghost light is generated. FIG. 8A is a diagram showing a region 80 where ghost light is generated on the image and a region 81 of 40 pixels × 40 pixels which is a region of a predetermined size. FIG. 8B is a diagram showing a Gr signal value (pixel value of Gr pixel) and a Gb signal value (pixel value of Gb pixel) in a region 81 having a predetermined size.

図8(b)に示すように、ゴースト光が発生している領域内では、Gr信号値とGb信号値との間に段差が生じる。この場合、Gr平均画素値およびGb平均画素値の差は大きいので、上述した累積相対差分は第2の閾値D2以上となり、ゴースト光などに起因するGr信号とGb信号との間の段差が存在すると判定される。従って、ベイヤ画像データ内の全てのGr画素およびGb画素を対象として、上述した画素値の補正が行われる。   As shown in FIG. 8B, a step is generated between the Gr signal value and the Gb signal value in the region where the ghost light is generated. In this case, since the difference between the Gr average pixel value and the Gb average pixel value is large, the cumulative relative difference described above is equal to or greater than the second threshold D2, and there is a step between the Gr signal and the Gb signal due to ghost light or the like. Then, it is determined. Accordingly, the pixel value correction described above is performed for all Gr pixels and Gb pixels in the Bayer image data.

図9は、画像内に、非常に細かいエッジを有する被写体が存在する場合のGr信号値およびGb信号値を説明するための図である。図9(a)は、所定の大きさの領域である40画素×40画素の領域91内に、非常に細かいエッジを有する被写体92が存在する画像の一例を示す図である。また、図9(b)は、所定の大きさの領域91内におけるGr信号値とGb信号値を示す図である。この場合、エッジの構造によって、Gr信号値がGb信号値より大きい部分と、Gb信号値がGr信号値より大きい部分とが存在するので、Gr平均画素値とGb平均画素値はほぼ等しくなる。従って、上述した累積相対差分は、第2の閾値D2未満となり、ゴースト光などに起因するGr信号とGb信号との間の段差は存在しないと判定される。すなわち、ベイヤ画像データ内のGr画素およびGb画素の画素値の補正は行われない。   FIG. 9 is a diagram for explaining the Gr signal value and the Gb signal value when a subject having very fine edges exists in the image. FIG. 9A is a diagram showing an example of an image in which a subject 92 having a very fine edge exists in a region 91 of 40 pixels × 40 pixels that is a region of a predetermined size. FIG. 9B is a diagram showing Gr signal values and Gb signal values in a region 91 having a predetermined size. In this case, there are a portion where the Gr signal value is larger than the Gb signal value and a portion where the Gb signal value is larger than the Gr signal value depending on the structure of the edge, so that the Gr average pixel value and the Gb average pixel value are substantially equal. Therefore, the cumulative relative difference described above is less than the second threshold value D2, and it is determined that there is no step between the Gr signal and the Gb signal due to ghost light or the like. That is, the correction of the pixel values of the Gr pixel and the Gb pixel in the Bayer image data is not performed.

以上、第1の実施形態における撮像装置によれば、固体撮像素子の出力から得られる画像データについて、所定数の画素から構成される画像領域ごとに、画像領域に含まれるGr画素の画素値の平均値であるGr平均画素値を求めるとともに、画像領域に含まれるGb画素の画素値の平均値であるGb平均画素値を求め、求めたGr平均画素値およびGb平均画素値に基づいて、Gr画素の画素値およびGb画素の画素値の補正を行うか否かを判定する。そして、補正を行うと判定すると、Gr画素の画素値およびGb画素の画素値を補正するので、ゴースト光などにより生じる強い段差と、非常に細かいエッジの被写体により生じる段差とを区別して検出して、ゴースト光などにより生じる強い段差が存在する場合に、段差の補正を行うことができる。すなわち、ゴースト光が発生しておらず、非常に細かいエッジの被写体が存在する画像データに対して、Gr画素およびGb画素の画素値の補正が誤って行われるのを防ぐことができる。   As described above, according to the imaging device in the first embodiment, for the image data obtained from the output of the solid-state imaging device, the pixel value of the Gr pixel included in the image region is determined for each image region composed of a predetermined number of pixels. A Gr average pixel value that is an average value is obtained, a Gb average pixel value that is an average value of pixel values of Gb pixels included in the image region is obtained, and based on the obtained Gr average pixel value and the Gb average pixel value, Gr It is determined whether or not to correct the pixel value of the pixel and the pixel value of the Gb pixel. If it is determined that correction is to be performed, the pixel value of the Gr pixel and the pixel value of the Gb pixel are corrected, so that a strong step caused by ghost light and the like and a step caused by a subject with a very fine edge are distinguished and detected. When there is a strong step caused by ghost light or the like, the step can be corrected. That is, it is possible to prevent erroneous correction of the pixel values of the Gr pixel and the Gb pixel with respect to image data in which ghost light is not generated and a subject with a very fine edge exists.

特に、画像領域ごとにGr平均画素値とGb平均画素値との差分値を算出し、算出した差分値が第1の閾値以上であれば、差分値を累積加算し、差分値を累積加算した値が第1の閾値よりも大きい第2の閾値以上の場合に、Gr画素の画素値およびGb画素の画素値の補正を行うと判定する。これにより、ゴースト光などにより生じる強い段差を、非常に細かいエッジの被写体により生じる段差と確実に区別して検出することができる。   In particular, the difference value between the Gr average pixel value and the Gb average pixel value is calculated for each image area, and if the calculated difference value is equal to or greater than the first threshold value, the difference value is cumulatively added and the difference value is cumulatively added. When the value is equal to or greater than a second threshold value that is greater than the first threshold value, it is determined that the pixel value of the Gr pixel and the pixel value of the Gb pixel are to be corrected. As a result, a strong step caused by ghost light or the like can be detected by reliably distinguishing it from a step caused by a subject with a very fine edge.

また、処理対象画素のGr画素の周辺に位置するGb画素の画素値に基づいて、処理対象画素のGr画素の画素値を補正するとともに、処理対象画素のGb画素の周辺に位置するGr画素の画素値に基づいて、処理対象画素のGb画素の画素値を補正するので、効果的に段差を補正することができる。   Further, based on the pixel value of the Gb pixel located around the Gr pixel of the processing target pixel, the pixel value of the Gr pixel of the processing target pixel is corrected, and the Gr pixel located around the Gb pixel of the processing target pixel is corrected. Since the pixel value of the Gb pixel of the processing target pixel is corrected based on the pixel value, the step can be corrected effectively.

<第2の実施形態>
図10は、第2の実施形態における撮像装置の画像処理部105Aの詳細な構成を示す図である。図10に示す画像処理部105Aの構成のうち、図2に示す画像処理部105の構成と同じ構成については、同じ符号を付して詳しい説明は省略する。
<Second Embodiment>
FIG. 10 is a diagram illustrating a detailed configuration of the image processing unit 105A of the imaging apparatus according to the second embodiment. Of the configuration of the image processing unit 105A illustrated in FIG. 10, the same configuration as the configuration of the image processing unit 105 illustrated in FIG.

第2の実施形態における画像処理部105Aは、第1の実施形態における画像処理部105に対して、制御部1054が削除され、かつ、補正係数マップメモリ1057が追加されている。また、内部で行う処理が第1の実施形態と異なるため、段差検出部および段差補正部の符号をそれぞれ、1053A、1055Aとしている。   In the image processing unit 105A in the second embodiment, the control unit 1054 is deleted and a correction coefficient map memory 1057 is added to the image processing unit 105 in the first embodiment. Further, since the processing performed internally is different from that of the first embodiment, the reference numerals of the step detection unit and the step correction unit are 1053A and 1055A, respectively.

補正係数マップメモリ1057は、所定の大きさの領域ごとに、Gr画素およびGb画素の画素値を補正するための補正係数を記憶する。   The correction coefficient map memory 1057 stores correction coefficients for correcting the pixel values of the Gr pixel and the Gb pixel for each region having a predetermined size.

図11は、第2の実施形態における画像処理部105Aによって行われる処理の流れを示すフローチャートである。図3に示すフローチャートの処理と同一の処理を行うステップについては、同一の符号を付して詳しい説明は省略する。   FIG. 11 is a flowchart showing a flow of processing performed by the image processing unit 105A in the second embodiment. Steps in which the same processing as that in the flowchart shown in FIG. 3 is performed are denoted by the same reference numerals, and detailed description thereof is omitted.

ステップS20に続くステップS1100において、段差検出部1053Aは、補正係数マップを作成する。補正係数マップを作成する処理の詳細を、図12に示すフローチャートを用いて説明する。   In step S1100 following step S20, the level difference detection unit 1053A creates a correction coefficient map. Details of the process of creating the correction coefficient map will be described with reference to the flowchart shown in FIG.

図12に示すフローチャートのステップS1200では、縮小画像メモリ1052に記憶されている、所定の大きさの領域ごとのGr平均画素値およびGb平均画素値のうち、最初の領域(最初の処理対象領域)に対応するGr平均画素値およびGb平均画素値を読み出す。   In step S1200 of the flowchart shown in FIG. 12, among the Gr average pixel value and Gb average pixel value for each area of a predetermined size stored in the reduced image memory 1052, the first area (first processing target area). The Gr average pixel value and the Gb average pixel value corresponding to are read out.

ステップS1210では、上式(1)より、Gr平均画素値およびGb平均画素値に基づいて、相対差分値Dを算出する。   In step S1210, the relative difference value D is calculated from the above equation (1) based on the Gr average pixel value and the Gb average pixel value.

ステップS1220では、ステップS1210で算出した相対差分値Dに基づいて、Gr画素およびGb画素を補正するための補正係数αを算出する。   In step S1220, a correction coefficient α for correcting the Gr pixel and the Gb pixel is calculated based on the relative difference value D calculated in step S1210.

図13は、相対差分値Dと補正係数αとの関係を示す図である。相対差分値Dが閾値D11未満の場合、補正係数αは最小値の0であり、相対差分値Dが閾値D12(D11<D12)以上の場合、補正係数αは最大値の1/8である。また、相対差分値Dが閾値D11以上であって、かつ、閾値D12未満の場合、補正係数αは、図13に示すように、相対差分値Dが大きくなるほど、0から1/8の間で単調増加的に大きくなる値となる。   FIG. 13 is a diagram illustrating the relationship between the relative difference value D and the correction coefficient α. When the relative difference value D is less than the threshold value D11, the correction coefficient α is 0, which is the minimum value. When the relative difference value D is greater than or equal to the threshold value D12 (D11 <D12), the correction coefficient α is 1/8 of the maximum value. . When the relative difference value D is equal to or greater than the threshold value D11 and less than the threshold value D12, the correction coefficient α is between 0 and 1/8 as the relative difference value D increases as shown in FIG. The value becomes monotonically increasing.

段差検出部1053Aは、内部のメモリに、図13に示すような相対差分値Dと補正係数αとの関係を定めたテーブルデータを有しており、ステップS1210で算出した相対差分値Dに基づいて、上記テーブルデータを参照することによって、補正係数αを算出する。   The level difference detection unit 1053A has table data that defines the relationship between the relative difference value D and the correction coefficient α as shown in FIG. 13 in the internal memory, and is based on the relative difference value D calculated in step S1210. The correction coefficient α is calculated by referring to the table data.

ステップS1230では、ステップS1220で算出した補正係数αを補正係数マップメモリ1057に格納する。   In step S1230, the correction coefficient α calculated in step S1220 is stored in the correction coefficient map memory 1057.

ステップS1240では、画像データの全領域に対して、ステップS1210からステップS1230までの処理を行ったか否かを判定する。画像データの全領域に対する処理が終了していないと判定すると、ステップS1250に進む。   In step S1240, it is determined whether or not the processing from step S1210 to step S1230 has been performed on the entire area of the image data. If it is determined that the processing for all areas of the image data has not been completed, the process advances to step S1250.

ステップS1250では、縮小画像メモリ1052から、次の処理対象領域に対応するGr平均画素値およびGb平均画素値を読み出して、ステップS1210に進み、ステップ1210からステップS1230までの処理を行う。これにより、所定の大きさの領域ごとに補正係数αが算出され、算出された補正係数αが補正係数マップメモリ1057に格納される。   In step S1250, the Gr average pixel value and the Gb average pixel value corresponding to the next processing target area are read from the reduced image memory 1052, and the process proceeds to step S1210, where the processes from step 1210 to step S1230 are performed. As a result, the correction coefficient α is calculated for each region having a predetermined size, and the calculated correction coefficient α is stored in the correction coefficient map memory 1057.

一方、ステップS1240において、画像データの全領域に対する処理が終了したと判定すると、図12に示すフローチャートの処理を終了する。なお、以下の説明では、補正係数マップメモリ1057に格納されている複数の補正係数αをまとめて、補正係数マップと呼ぶ。   On the other hand, if it is determined in step S1240 that the processing for all the regions of the image data has been completed, the processing of the flowchart shown in FIG. In the following description, a plurality of correction coefficients α stored in the correction coefficient map memory 1057 are collectively referred to as a correction coefficient map.

図11に示すフローチャートに戻って説明を続ける。ステップS1110において、段差補正部1055Aは、SDRAM108からベイヤ画像データを読み出して、ステップS1100で作成された補正係数マップに基づいて、ベイヤ画像データのGb画素およびGr画素の画素値を補正する。具体的には、次式(4)より、補正後のGb画素の画素値を求めるとともに、次式(5)より、補正後のGr画素の画素値を求める。   Returning to the flowchart shown in FIG. In step S1110, the step correction unit 1055A reads the Bayer image data from the SDRAM 108, and corrects the pixel values of the Gb pixel and the Gr pixel of the Bayer image data based on the correction coefficient map created in step S1100. Specifically, the pixel value of the corrected Gb pixel is obtained from the following equation (4), and the pixel value of the corrected Gr pixel is obtained from the following equation (5).

補正後Gb=補正前Gb×(1−4α)+(周辺Gr1+周辺Gr2+周辺Gr3+周辺Gr4)×α (4)
補正後Gr=補正前Gr×(1−4α)+(周辺Gb1+周辺Gb2+周辺Gb3+周辺Gb4)×α (5)
図14(a)は、非常に細かいエッジが存在する被写体140とゴースト光141が存在する画像の一例を示す図である。図14(a)では、また、所定の大きさの領域142、143も示している。図14(b)は、図14(a)に示す画像に基づいて作成された補正係数マップ145を示す図である。図14(b)では、説明を容易にするために、補正係数αが最小値の0に近くなるほど黒く、また、補正係数αが最大値の1/8に近くなるほど白くなるように表現している。
Gb after correction = Gb before correction × (1−4α) + (peripheral Gr1 + peripheral Gr2 ++ peripheral Gr3 + peripheral Gr4) × α (4)
After correction Gr = Gr before correction × (1−4α) + (peripheral Gb1 + peripheral Gb2 + peripheral Gb3 + peripheral Gb4) × α (5)
FIG. 14A is a diagram illustrating an example of an image in which a subject 140 having very fine edges and ghost light 141 exist. FIG. 14A also shows regions 142 and 143 having a predetermined size. FIG. 14B is a diagram showing a correction coefficient map 145 created based on the image shown in FIG. In FIG. 14B, in order to facilitate the description, the correction coefficient α is expressed as black as the correction coefficient α approaches 0 of the minimum value, and white as the correction coefficient α approaches 1/8 of the maximum value. Yes.

図14(a)および図14(b)から分かるように、画像上でゴースト光141が存在する領域の補正係数αは最大値である1/8、または、1/8に近い値となっている。また、細かいエッジが存在する領域140の補正係数は、最小値である0または0に近い値であることが分かる。   As can be seen from FIGS. 14A and 14B, the correction coefficient α in the region where the ghost light 141 exists on the image is 1/8, which is the maximum value, or a value close to 1/8. Yes. Further, it can be seen that the correction coefficient of the region 140 where the fine edge exists is 0 or a value close to 0 which is the minimum value.

このように、第2の実施形態では、画像の領域ごとに、Gr平均画素値およびGb平均画素値に基づいて補正係数αを定めて、Gr画素およびGb画素の補正を行う。これにより、画像データのうち、ゴースト光が存在する領域のGr画素およびGb画素に対して、信号差を抑制するための補正を行うことができる。従って、図14(a)に示すように、ゴースト光とともに、細かいエッジを有する被写体が存在する場合でも、細かいエッジの先鋭性が失われることはない。   As described above, in the second embodiment, the correction coefficient α is determined for each region of the image based on the Gr average pixel value and the Gb average pixel value, and the Gr pixel and the Gb pixel are corrected. Thereby, the correction for suppressing the signal difference can be performed on the Gr pixel and the Gb pixel in the region where the ghost light exists in the image data. Accordingly, as shown in FIG. 14A, the sharpness of the fine edges is not lost even when there is a subject having fine edges together with the ghost light.

以上、第2の実施形態における撮像装置によれば、固体撮像素子の出力から得られる画像データについて、所定数の画素から構成される画像領域ごとに、Gr画素の画素値の平均値であるGr平均画素値を求めるとともに、Gb画素の画素値の平均値であるGb平均画素値を求め、求めたGr平均画素値およびGb平均画素値に基づいて、画像領域ごとに、Gr画素の画素値およびGb画素の画素値を補正するための補正量を算出する。そして、算出した補正量に基づいて、画像領域ごとに、Gr画素およびGb画素の画素値を補正するので、画像の領域ごとに、Gr画素およびGb画素の信号差を抑制する補正を行うことができる。これにより、ゴースト光が存在する領域に対しては、信号差を抑制するための補正を効果的に行うことができ、また、細かいエッジを有する被写体領域に対しては、信号差を抑制するための補正を行わないので、エッジの先鋭性が失われるのを防ぐことができる。   As described above, according to the imaging device in the second embodiment, the image data obtained from the output of the solid-state imaging element is Gr, which is the average value of the pixel values of the Gr pixels for each image region composed of a predetermined number of pixels. The average pixel value is calculated, the Gb average pixel value, which is the average value of the Gb pixel values, is calculated, and the Gr pixel value and the Gr pixel value are determined for each image area based on the calculated Gr average pixel value and Gb average pixel value A correction amount for correcting the pixel value of the Gb pixel is calculated. Then, since the pixel values of the Gr pixel and the Gb pixel are corrected for each image region based on the calculated correction amount, the correction for suppressing the signal difference between the Gr pixel and the Gb pixel may be performed for each image region. it can. Accordingly, correction for suppressing the signal difference can be effectively performed for the area where the ghost light exists, and the signal difference is suppressed for the subject area having a fine edge. Therefore, it is possible to prevent the sharpness of the edge from being lost.

また、画像領域ごとにGr平均画素値とGb平均画素値との差分値を算出し、算出した差分値が第1の所定値D11より小さい場合には補正量を0とし、差分値が第1の所定値D11より大きい第2の所定値D12以上の場合には補正量を最大補正量とし、差分値が第1の所定値D11以上であって、かつ、第2の所定値D12より小さい場合には、差分値が大きくなるほど、0から最大補正量までの間で単調増加的に補正量を大きくする。これにより、Gr画素およびGb画素の信号差の大きさに応じて、信号差を抑制するための補正を効果的に行うことができる。   Further, a difference value between the Gr average pixel value and the Gb average pixel value is calculated for each image region, and when the calculated difference value is smaller than the first predetermined value D11, the correction amount is set to 0, and the difference value is the first value. When the second predetermined value D12 is greater than or equal to the second predetermined value D11, the correction amount is the maximum correction amount, and the difference value is equal to or greater than the first predetermined value D11 and smaller than the second predetermined value D12. As the difference value increases, the correction amount is increased monotonically between 0 and the maximum correction amount. Thereby, the correction for suppressing the signal difference can be effectively performed according to the magnitude of the signal difference between the Gr pixel and the Gb pixel.

特に、第2の実施形態における撮像装置では、上記補正量は補正係数であって、処理対象画素がGr画素である場合に、Gr画素の画素値およびGr画素の周辺に位置するGb画素の画素値を補正係数を用いて加重平均加算するとともに、処理対象画素がGb画素である場合に、Gb画素の画素値およびGb画素の周辺に位置するGr画素の画素値を補正係数を用いて加重平均加算することによって、Gr画素およびGb画素の画素値を補正する。これにより、画像の先鋭性の低下を抑制しつつ、Gr画素およびGb画素の信号差の大きさに応じて、信号差を抑制するための補正を効果的に行うことができる。   In particular, in the imaging device according to the second embodiment, when the correction amount is a correction coefficient and the processing target pixel is a Gr pixel, the pixel value of the Gr pixel and the pixel of the Gb pixel located around the Gr pixel The weighted average addition is performed using the correction coefficient, and when the pixel to be processed is the Gb pixel, the pixel value of the Gb pixel and the pixel value of the Gr pixel located around the Gb pixel are weighted average using the correction coefficient. By adding, the pixel values of the Gr pixel and the Gb pixel are corrected. Thereby, it is possible to effectively perform correction for suppressing the signal difference according to the magnitude of the signal difference between the Gr pixel and the Gb pixel while suppressing a decrease in the sharpness of the image.

なお、上述した第1〜第2の実施形態の説明では、画像処理部105が行う処理としてハードウェアによる処理を前提としていたが、このような構成に限定される必要はない。例えば、別途ソフトウェアにて処理する構成も可能である。この場合、画像処理部(画像処理装置)は、CPU、RAM等の主記憶装置、上記処理の全て或いは一部を実現させるためのプログラムが記憶されたコンピュータ読み取り可能な記憶媒体を備えている。ここでは、このプログラムを画像処理プログラムと呼ぶ。そして、CPUが上記記憶媒体に記憶されている画像処理プログラムを読み出して、情報の加工・演算処理を実行することにより、上述の画像処理部105と同様の処理を実現させる。   In the description of the first and second embodiments described above, the processing performed by the image processing unit 105 is based on hardware processing, but is not limited to such a configuration. For example, a configuration in which processing is performed separately by software is also possible. In this case, the image processing unit (image processing apparatus) includes a main storage device such as a CPU and a RAM, and a computer-readable storage medium storing a program for realizing all or part of the above processing. Here, this program is called an image processing program. Then, the CPU reads out the image processing program stored in the storage medium and executes information processing / calculation processing, thereby realizing processing similar to that of the image processing unit 105 described above.

ここで、コンピュータ読み取り可能な記録媒体とは、磁気ディスク、光磁気ディスク、CD−ROM、DVD−ROM、半導体メモリ等をいう。また、この画像処理プログラムを通信回線によってコンピュータに配信し、この配信を受けたコンピュータが当該画像処理プログラムを実行するようにしても良い。   Here, the computer-readable recording medium refers to a magnetic disk, a magneto-optical disk, a CD-ROM, a DVD-ROM, a semiconductor memory, and the like. Alternatively, the image processing program may be distributed to a computer via a communication line, and the computer that has received the distribution may execute the image processing program.

本発明は、上述した第1〜第2の実施形態に限定されるものではなく、本発明の要旨を逸脱しない範囲内で様々な変形や応用が可能である。例えば、Gr平均画素値およびGb平均画素値の差分値として、式(1)に示す相対差分値Dを算出したが、これに限定されることはない。   The present invention is not limited to the first and second embodiments described above, and various modifications and applications are possible without departing from the spirit of the present invention. For example, the relative difference value D shown in Expression (1) is calculated as the difference value between the Gr average pixel value and the Gb average pixel value, but the present invention is not limited to this.

また、Gr画素の画素値およびGb画素の画素値を補正する方法は、式(2)および式(3)、または、式(4)および式(5)に示す方法に限定されることはない。   Further, the method for correcting the pixel value of the Gr pixel and the pixel value of the Gb pixel is not limited to the methods shown in the equations (2) and (3), or the equations (4) and (5). .

102…撮像素子
105、105A…画像処理部
108…SDRAM
1051…LPF部
1052…縮小画像メモリ
1053、1053A…段差検出部
1054…制御部
1055、1055A…段差補正部
1056…合成部
1057…補正係数マップメモリ
102 ... Image sensor 105, 105A ... Image processor 108 ... SDRAM
1051... LPF unit 1052. Reduced image memory 1053 and 1053 A. Step detection unit 1054. Control unit 1055 and 1055 A. Step correction unit 1056.

Claims (10)

水平方向にR画素およびGr画素が交互に配列されたラインと、水平方向にB画素およびGb画素が交互に配列されたラインとが垂直方向に交互に配置されるベイヤ配列構造の固体撮像素子を有する撮像装置であって、
前記固体撮像素子の出力から得られる画像データについて、所定数の画素から構成される画像領域ごとに、前記画像領域に含まれるGr画素の画素値の平均値であるGr平均画素値を求めるとともに、前記画像領域に含まれるGb画素の画素値の平均値であるGb平均画素値を求める平均画素値算出部と、
前記Gr平均画素値および前記Gb平均画素値に基づいて、前記Gr画素の画素値および前記Gb画素の画素値の補正を行うか否かを判定する補正判定部と、
前記補正判定部によって補正を行うと判定されると、前記Gr画素の画素値および前記Gb画素の画素値を補正する補正部と、
を備え
前記補正判定部は、前記画像領域ごとに前記Gr平均画素値と前記Gb平均画素値との差分値を算出し、算出した差分値が第1の閾値以上であれば、前記差分値を累積加算し、前記差分値を累積加算した値が前記第1の閾値よりも大きい第2の閾値以上の場合に、前記Gr画素の画素値および前記Gb画素の画素値の補正を行うと判定する、
ことを特徴とする撮像装置。
A solid-state imaging device having a Bayer array structure in which lines in which R pixels and Gr pixels are alternately arranged in the horizontal direction and lines in which B pixels and Gb pixels are alternately arranged in the horizontal direction are alternately arranged in the vertical direction. An imaging device comprising:
For the image data obtained from the output of the solid-state imaging device, for each image region composed of a predetermined number of pixels, a Gr average pixel value that is an average value of the pixel values of the Gr pixels included in the image region is obtained. An average pixel value calculation unit for obtaining a Gb average pixel value that is an average value of pixel values of Gb pixels included in the image region;
A correction determination unit that determines whether to correct the pixel value of the Gr pixel and the pixel value of the Gb pixel based on the Gr average pixel value and the Gb average pixel value;
A correction unit that corrects the pixel value of the Gr pixel and the pixel value of the Gb pixel when the correction determination unit determines that the correction is performed;
Equipped with a,
The correction determination unit calculates a difference value between the Gr average pixel value and the Gb average pixel value for each of the image regions. If the calculated difference value is equal to or greater than a first threshold, the difference value is cumulatively added. And determining that correction of the pixel value of the Gr pixel and the pixel value of the Gb pixel is performed when a value obtained by cumulatively adding the difference values is equal to or greater than a second threshold value that is greater than the first threshold value.
An imaging apparatus characterized by that.
前記差分値は、前記Gr平均画素値と前記Gb平均画素値との差分値を、前記Gr平均画素値および前記Gb平均画素値の平均値で除算して得られる相対差分値である、
ことを特徴とする請求項に記載の撮像装置。
The difference value is a relative difference value obtained by dividing the difference value between the Gr average pixel value and the Gb average pixel value by the average value of the Gr average pixel value and the Gb average pixel value.
The imaging apparatus according to claim 1 .
水平方向にR画素およびGr画素が交互に配列されたラインと、水平方向にB画素およびGb画素が交互に配列されたラインとが垂直方向に交互に配置されるベイヤ配列構造の固体撮像素子を有する撮像装置であって、
前記固体撮像素子の出力から得られる画像データについて、所定数の画素から構成される画像領域ごとに、前記画像領域に含まれるGr画素の画素値の平均値であるGr平均画素値を求めるとともに、前記画像領域に含まれるGb画素の画素値の平均値であるGb平均画素値を求める平均画素値算出部と、
前記Gr平均画素値および前記Gb平均画素値に基づいて、前記Gr画素の画素値および前記Gb画素の画素値の補正を行うか否かを判定する補正判定部と、
前記補正判定部によって補正を行うと判定されると、前記Gr画素の画素値および前記Gb画素の画素値を補正する補正部と、
を備え
前記補正部は、処理対象画素であるGr画素の周辺に位置するGb画素の画素値に基づいて、前記処理対象画素であるGr画素の画素値を補正するとともに、処理対象画素であるGb画素の周辺に位置するGr画素の画素値に基づいて、前記処理対象画素であるGb画素の画素値を補正する、
ことを特徴とする撮像装置。
A solid-state imaging device having a Bayer array structure in which lines in which R pixels and Gr pixels are alternately arranged in the horizontal direction and lines in which B pixels and Gb pixels are alternately arranged in the horizontal direction are alternately arranged in the vertical direction. An imaging device comprising:
For the image data obtained from the output of the solid-state imaging device, for each image region composed of a predetermined number of pixels, a Gr average pixel value that is an average value of the pixel values of the Gr pixels included in the image region is obtained. An average pixel value calculation unit for obtaining a Gb average pixel value that is an average value of pixel values of Gb pixels included in the image region;
A correction determination unit that determines whether to correct the pixel value of the Gr pixel and the pixel value of the Gb pixel based on the Gr average pixel value and the Gb average pixel value;
A correction unit that corrects the pixel value of the Gr pixel and the pixel value of the Gb pixel when the correction determination unit determines that the correction is performed;
Equipped with a,
The correction unit corrects the pixel value of the Gr pixel that is the processing target pixel based on the pixel value of the Gb pixel that is located around the Gr pixel that is the processing target pixel, and the Gb pixel that is the processing target pixel. Correcting the pixel value of the Gb pixel that is the processing target pixel based on the pixel value of the Gr pixel located in the periphery;
An imaging apparatus characterized by that.
水平方向にR画素およびGr画素が交互に配列されたラインと、水平方向にB画素およびGb画素が交互に配列されたラインとが垂直方向に交互に配置されるベイヤ配列構造の固体撮像素子を有する撮像装置であって、
前記固体撮像素子の出力から得られる画像データについて、所定数の画素から構成される画像領域ごとに、前記画像領域に含まれるGr画素の画素値の平均値であるGr平均画素値を求めるとともに、前記画像領域に含まれるGb画素の画素値の平均値であるGb平均画素値を求める平均画素値算出部と、
前記画像領域ごとに、前記Gr平均画素値および前記Gb平均画素値に基づいて、前記Gr画素の画素値および前記Gb画素の画素値を補正するための補正量を算出する補正量算出部と、
前記画像領域ごとに、前記補正量算出部で算出された補正量に基づいて、前記画像領域内のGr画素およびGb画素の画素値を補正する補正部と、
を備え
前記補正量算出部は、前記画像領域ごとに前記Gr平均画素値と前記Gb平均画素値との差分値を算出し、算出した差分値が第1の所定値より小さい場合には補正量を0とし、前記差分値が前記第1の所定値より大きい第2の所定値以上の場合には補正量を最大補正量とし、前記差分値が前記第1の所定値以上であって、かつ、前記第2の所定値より小さい場合には、前記差分値が大きくなるほど、0から最大補正量までの間で単調増加的に補正量を大きくする、
ことを特徴とする撮像装置。
A solid-state imaging device having a Bayer array structure in which lines in which R pixels and Gr pixels are alternately arranged in the horizontal direction and lines in which B pixels and Gb pixels are alternately arranged in the horizontal direction are alternately arranged in the vertical direction. An imaging device comprising:
For the image data obtained from the output of the solid-state imaging device, for each image region composed of a predetermined number of pixels, a Gr average pixel value that is an average value of the pixel values of the Gr pixels included in the image region is obtained. An average pixel value calculation unit for obtaining a Gb average pixel value that is an average value of pixel values of Gb pixels included in the image region;
A correction amount calculation unit that calculates a correction amount for correcting the pixel value of the Gr pixel and the pixel value of the Gb pixel based on the Gr average pixel value and the Gb average pixel value for each image region;
A correction unit that corrects the pixel values of the Gr pixel and the Gb pixel in the image region based on the correction amount calculated by the correction amount calculation unit for each image region;
Equipped with a,
The correction amount calculation unit calculates a difference value between the Gr average pixel value and the Gb average pixel value for each of the image regions, and when the calculated difference value is smaller than a first predetermined value, the correction amount is set to 0. And when the difference value is equal to or greater than a second predetermined value greater than the first predetermined value, a correction amount is set as a maximum correction amount, the difference value is equal to or greater than the first predetermined value, and If the difference value is smaller than the second predetermined value, the correction amount is increased monotonically between 0 and the maximum correction amount as the difference value increases.
An imaging apparatus characterized by that.
前記差分値は、前記Gr平均画素値と前記Gb平均画素値との差分値を、前記Gr平均画素値および前記Gb平均画素値の平均値で除算して得られる相対差分値である、
ことを特徴とする請求項に記載の撮像装置。
The difference value is a relative difference value obtained by dividing the difference value between the Gr average pixel value and the Gb average pixel value by the average value of the Gr average pixel value and the Gb average pixel value.
The imaging apparatus according to claim 4 .
水平方向にR画素およびGr画素が交互に配列されたラインと、水平方向にB画素およびGb画素が交互に配列されたラインとが垂直方向に交互に配置されるベイヤ配列構造の固体撮像素子を有する撮像装置であって、
前記固体撮像素子の出力から得られる画像データについて、所定数の画素から構成される画像領域ごとに、前記画像領域に含まれるGr画素の画素値の平均値であるGr平均画素値を求めるとともに、前記画像領域に含まれるGb画素の画素値の平均値であるGb平均画素値を求める平均画素値算出部と、
前記画像領域ごとに、前記Gr平均画素値および前記Gb平均画素値に基づいて、前記Gr画素の画素値および前記Gb画素の画素値を補正するための補正量を算出する補正量算出部と、
前記画像領域ごとに、前記補正量算出部で算出された補正量に基づいて、前記画像領域内のGr画素およびGb画素の画素値を補正する補正部と、
を備え
前記補正量算出部で算出される補正量は、補正係数であって、
前記補正部は、処理対象画素がGr画素である場合に、前記Gr画素の画素値および前記Gr画素の周辺に位置するGb画素の画素値を前記補正係数に基づいて加重平均加算するとともに、処理対象画素がGb画素である場合に、前記Gb画素の画素値および前記Gb画素の周辺に位置するGr画素の画素値を前記補正係数に基づいて加重平均加算することによって、前記Gr画素およびGb画素の画素値を補正する、
ことを特徴とする撮像装置。
A solid-state imaging device having a Bayer array structure in which lines in which R pixels and Gr pixels are alternately arranged in the horizontal direction and lines in which B pixels and Gb pixels are alternately arranged in the horizontal direction are alternately arranged in the vertical direction. An imaging device comprising:
For the image data obtained from the output of the solid-state imaging device, for each image region composed of a predetermined number of pixels, a Gr average pixel value that is an average value of the pixel values of the Gr pixels included in the image region is obtained. An average pixel value calculation unit for obtaining a Gb average pixel value that is an average value of pixel values of Gb pixels included in the image region;
A correction amount calculation unit that calculates a correction amount for correcting the pixel value of the Gr pixel and the pixel value of the Gb pixel based on the Gr average pixel value and the Gb average pixel value for each image region;
A correction unit that corrects the pixel values of the Gr pixel and the Gb pixel in the image region based on the correction amount calculated by the correction amount calculation unit for each image region;
Equipped with a,
The correction amount calculated by the correction amount calculation unit is a correction coefficient,
When the processing target pixel is a Gr pixel, the correction unit performs a weighted average addition of the pixel value of the Gr pixel and the pixel value of a Gb pixel located around the Gr pixel based on the correction coefficient, and performs processing When the target pixel is a Gb pixel, the Gr pixel and the Gb pixel are obtained by performing a weighted average addition based on the correction coefficient of the pixel value of the Gb pixel and the pixel value of the Gr pixel located around the Gb pixel. Correct the pixel value of
An imaging apparatus characterized by that.
水平方向にR画素およびGr画素が交互に配列されたラインと、水平方向にB画素およびGb画素が交互に配列されたラインとが垂直方向に交互に配置されるベイヤ配列構造の固体撮像素子を有する撮像装置を用いた撮像方法であって、
前記固体撮像素子の出力から得られる画像データについて、所定数の画素から構成される画像領域ごとに、前記画像領域に含まれるGr画素の画素値の平均値であるGr平均画素値を求めるとともに、前記画像領域に含まれるGb画素の画素値の平均値であるGb平均画素値を求めるステップと、
前記Gr平均画素値および前記Gb平均画素値に基づいて、前記Gr画素の画素値および前記Gb画素の画素値の補正を行うか否かを判定するステップと、
前記補正を行うと判定すると、前記Gr画素の画素値および前記Gb画素の画素値を補正するステップと、
を備え
前記補正を行うか否かを判定するステップでは、前記画像領域ごとに前記Gr平均画素値と前記Gb平均画素値との差分値を算出し、算出した差分値が第1の閾値以上であれば、前記差分値を累積加算し、前記差分値を累積加算した値が前記第1の閾値よりも大きい第2の閾値以上の場合に、前記Gr画素の画素値および前記Gb画素の画素値の補正を行うと判定する、
ことを特徴とする撮像方法。
A solid-state imaging device having a Bayer array structure in which lines in which R pixels and Gr pixels are alternately arranged in the horizontal direction and lines in which B pixels and Gb pixels are alternately arranged in the horizontal direction are alternately arranged in the vertical direction. An imaging method using an imaging apparatus having
For the image data obtained from the output of the solid-state imaging device, for each image region composed of a predetermined number of pixels, a Gr average pixel value that is an average value of the pixel values of the Gr pixels included in the image region is obtained. Obtaining a Gb average pixel value which is an average value of pixel values of Gb pixels included in the image region;
Determining whether to correct the pixel value of the Gr pixel and the pixel value of the Gb pixel based on the Gr average pixel value and the Gb average pixel value;
Determining that the correction is to be performed, correcting the pixel value of the Gr pixel and the pixel value of the Gb pixel;
Equipped with a,
In the step of determining whether or not to perform the correction, a difference value between the Gr average pixel value and the Gb average pixel value is calculated for each image region, and if the calculated difference value is equal to or greater than a first threshold value. When the difference value is cumulatively added, and the value obtained by cumulatively adding the difference values is equal to or greater than a second threshold value that is greater than the first threshold value, the pixel value of the Gr pixel and the pixel value of the Gb pixel are corrected. To determine
An imaging method characterized by the above.
水平方向にR画素およびGr画素が交互に配列されたラインと、水平方向にB画素およびGb画素が交互に配列されたラインとが垂直方向に交互に配置されるベイヤ配列構造の固体撮像素子を有する撮像装置を用いた撮像方法であって、  A solid-state imaging device having a Bayer array structure in which lines in which R pixels and Gr pixels are alternately arranged in the horizontal direction and lines in which B pixels and Gb pixels are alternately arranged in the horizontal direction are alternately arranged in the vertical direction. An imaging method using an imaging apparatus having
前記固体撮像素子の出力から得られる画像データについて、所定数の画素から構成される画像領域ごとに、前記画像領域に含まれるGr画素の画素値の平均値であるGr平均画素値を求めるとともに、前記画像領域に含まれるGb画素の画素値の平均値であるGb平均画素値を求めるステップと、  For the image data obtained from the output of the solid-state imaging device, for each image region composed of a predetermined number of pixels, obtain a Gr average pixel value that is an average value of the pixel values of the Gr pixels included in the image region Obtaining a Gb average pixel value which is an average value of pixel values of Gb pixels included in the image region;
前記Gr平均画素値および前記Gb平均画素値に基づいて、前記Gr画素の画素値および前記Gb画素の画素値の補正を行うか否かを判定するステップと、  Determining whether to correct the pixel value of the Gr pixel and the pixel value of the Gb pixel based on the Gr average pixel value and the Gb average pixel value;
前記補正を行うと判定すると、前記Gr画素の画素値および前記Gb画素の画素値を補正するステップと、  Determining that the correction is to be performed, correcting the pixel value of the Gr pixel and the pixel value of the Gb pixel;
を備え、With
前記補正するステップでは、処理対象画素であるGr画素の周辺に位置するGb画素の画素値に基づいて、前記処理対象画素であるGr画素の画素値を補正するとともに、処理対象画素であるGb画素の周辺に位置するGr画素の画素値に基づいて、前記処理対象画素であるGb画素の画素値を補正する、  In the correcting step, the pixel value of the Gr pixel that is the processing target pixel is corrected based on the pixel value of the Gb pixel that is located around the Gr pixel that is the processing target pixel, and the Gb pixel that is the processing target pixel Correcting the pixel value of the Gb pixel as the processing target pixel based on the pixel value of the Gr pixel located in the vicinity of
ことを特徴とする撮像方法。An imaging method characterized by the above.
水平方向にR画素およびGr画素が交互に配列されたラインと、水平方向にB画素およびGb画素が交互に配列されたラインとが垂直方向に交互に配置されるベイヤ配列構造の固体撮像素子を有する撮像装置を用いた撮像方法であって、
前記固体撮像素子の出力から得られる画像データについて、所定数の画素から構成される画像領域ごとに、前記画像領域に含まれるGr画素の画素値の平均値であるGr平均画素値を求めるとともに、前記画像領域に含まれるGb画素の画素値の平均値であるGb平均画素値を求めるステップと、
前記画像領域ごとに、前記Gr平均画素値および前記Gb平均画素値に基づいて、前記Gr画素の画素値および前記Gb画素の画素値を補正するための補正量を算出するステップと、
前記画像領域ごとに、前記補正量に基づいて、前記画像領域内のGr画素およびGb画素の画素値を補正するステップと、
を備え
前記補正量を算出するステップでは、前記画像領域ごとに前記Gr平均画素値と前記Gb平均画素値との差分値を算出し、算出した差分値が第1の所定値より小さい場合には補正量を0とし、前記差分値が前記第1の所定値より大きい第2の所定値以上の場合には補正量を最大補正量とし、前記差分値が前記第1の所定値以上であって、かつ、前記第2の所定値より小さい場合には、前記差分値が大きくなるほど、0から最大補正量までの間で単調増加的に補正量を大きくする、
ことを特徴とする撮像方法。
A solid-state imaging device having a Bayer array structure in which lines in which R pixels and Gr pixels are alternately arranged in the horizontal direction and lines in which B pixels and Gb pixels are alternately arranged in the horizontal direction are alternately arranged in the vertical direction. An imaging method using an imaging apparatus having
For the image data obtained from the output of the solid-state imaging device, for each image region composed of a predetermined number of pixels, a Gr average pixel value that is an average value of the pixel values of the Gr pixels included in the image region is obtained. Obtaining a Gb average pixel value which is an average value of pixel values of Gb pixels included in the image region;
Calculating a correction amount for correcting the pixel value of the Gr pixel and the pixel value of the Gb pixel based on the Gr average pixel value and the Gb average pixel value for each image region;
Correcting the pixel values of Gr pixels and Gb pixels in the image region based on the correction amount for each image region;
Equipped with a,
In the step of calculating the correction amount, a difference value between the Gr average pixel value and the Gb average pixel value is calculated for each of the image regions, and when the calculated difference value is smaller than a first predetermined value, the correction amount Is set to 0, and when the difference value is equal to or larger than a second predetermined value larger than the first predetermined value, a correction amount is set as a maximum correction amount, the difference value is equal to or larger than the first predetermined value, and If the difference value is smaller than the second predetermined value, the correction amount is increased monotonically between 0 and the maximum correction amount as the difference value increases.
An imaging method characterized by the above.
水平方向にR画素およびGr画素が交互に配列されたラインと、水平方向にB画素およびGb画素が交互に配列されたラインとが垂直方向に交互に配置されるベイヤ配列構造の固体撮像素子を有する撮像装置を用いた撮像方法であって、
前記固体撮像素子の出力から得られる画像データについて、所定数の画素から構成される画像領域ごとに、前記画像領域に含まれるGr画素の画素値の平均値であるGr平均画素値を求めるとともに、前記画像領域に含まれるGb画素の画素値の平均値であるGb平均画素値を求めるステップと、
前記画像領域ごとに、前記Gr平均画素値および前記Gb平均画素値に基づいて、前記Gr画素の画素値および前記Gb画素の画素値を補正するための補正量を算出するステップと、
前記画像領域ごとに、前記補正量に基づいて、前記画像領域内のGr画素およびGb画素の画素値を補正するステップと、
を備え、
前記補正量は、補正係数であって、
前記補正するステップでは、処理対象画素がGr画素である場合に、前記Gr画素の画素値および前記Gr画素の周辺に位置するGb画素の画素値を前記補正係数に基づいて加重平均加算するとともに、処理対象画素がGb画素である場合に、前記Gb画素の画素値および前記Gb画素の周辺に位置するGr画素の画素値を前記補正係数に基づいて加重平均加算することによって、前記Gr画素およびGb画素の画素値を補正する、
ことを特徴とする撮像方法。
A solid-state imaging device having a Bayer array structure in which lines in which R pixels and Gr pixels are alternately arranged in the horizontal direction and lines in which B pixels and Gb pixels are alternately arranged in the horizontal direction are alternately arranged in the vertical direction. An imaging method using an imaging apparatus having
For the image data obtained from the output of the solid-state imaging device, for each image region composed of a predetermined number of pixels, a Gr average pixel value that is an average value of the pixel values of the Gr pixels included in the image region is obtained. Obtaining a Gb average pixel value which is an average value of pixel values of Gb pixels included in the image region;
Calculating a correction amount for correcting the pixel value of the Gr pixel and the pixel value of the Gb pixel based on the Gr average pixel value and the Gb average pixel value for each image region;
Correcting the pixel values of Gr pixels and Gb pixels in the image region based on the correction amount for each image region;
With
The correction amount is a correction coefficient,
In the correcting step, when the processing target pixel is a Gr pixel, the pixel value of the Gr pixel and the pixel value of the Gb pixel located around the Gr pixel are weighted and averaged based on the correction coefficient, When the pixel to be processed is a Gb pixel, the Gr pixel and the Gb pixel are obtained by performing a weighted average addition on the basis of the correction coefficient of the pixel value of the Gb pixel and the pixel value of the Gr pixel located around the Gb pixel. Correct the pixel value of the pixel,
An imaging method characterized by the above.
JP2010141333A 2010-06-22 2010-06-22 Imaging apparatus and imaging method Expired - Fee Related JP5523213B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010141333A JP5523213B2 (en) 2010-06-22 2010-06-22 Imaging apparatus and imaging method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010141333A JP5523213B2 (en) 2010-06-22 2010-06-22 Imaging apparatus and imaging method

Publications (2)

Publication Number Publication Date
JP2012009919A JP2012009919A (en) 2012-01-12
JP5523213B2 true JP5523213B2 (en) 2014-06-18

Family

ID=45540008

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010141333A Expired - Fee Related JP5523213B2 (en) 2010-06-22 2010-06-22 Imaging apparatus and imaging method

Country Status (1)

Country Link
JP (1) JP5523213B2 (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104335578B (en) * 2012-06-07 2016-09-28 富士胶片株式会社 Camera head, image processing apparatus and image processing method
CN104904197B (en) 2012-12-05 2016-12-28 富士胶片株式会社 Camera head and abnormal dip incident illumination detection method
WO2014087804A1 (en) * 2012-12-07 2014-06-12 富士フイルム株式会社 Image capture device, image processing method, and program
WO2014087808A1 (en) * 2012-12-07 2014-06-12 富士フイルム株式会社 Image processing device, image processing method and program, and recording medium
JP5802858B2 (en) 2013-03-05 2015-11-04 富士フイルム株式会社 Imaging apparatus, image processing apparatus, image processing method, and program
JP6570122B2 (en) * 2015-11-12 2019-09-04 株式会社日立国際電気 Imaging device
JP2018148526A (en) 2017-03-09 2018-09-20 オリンパス株式会社 Imaging device, image processing device, image processing method, and image processing program
JP2022091591A (en) 2020-12-09 2022-06-21 ブラザー工業株式会社 Computer program, image processing apparatus, and image processing method
JP2022091592A (en) 2020-12-09 2022-06-21 ブラザー工業株式会社 Computer program, image processing apparatus, and image processing method
JP2022093212A (en) 2020-12-12 2022-06-23 ブラザー工業株式会社 Computer program, image processing apparatus, and image processing method

Also Published As

Publication number Publication date
JP2012009919A (en) 2012-01-12

Similar Documents

Publication Publication Date Title
JP5523213B2 (en) Imaging apparatus and imaging method
JP6222514B2 (en) Image processing apparatus, imaging apparatus, and computer program
US20090167917A1 (en) Imaging device
KR20160044945A (en) Image photographing appratus
JP2009005083A (en) Imaging apparatus, control method of imaging apparatus and control program of imaging apparatus
JP2014027526A (en) Image processor, image processing method and program
KR101003681B1 (en) Pixel interpolation circuit, pixel interpolation method, and recording medium
JP5800970B2 (en) Image processing apparatus, imaging apparatus, image processing method, and image processing program
JP5607911B2 (en) Image processing apparatus, imaging apparatus, image processing method, and image processing program
JP5164617B2 (en) Imaging apparatus and image processing method
JP2006287814A (en) Imaging apparatus and method of determining motion vector
JP5847484B2 (en) Imaging apparatus, control method thereof, and program
JP2013225779A (en) Image processing device, imaging device, and image processing program
JP2012133112A (en) Imaging apparatus and imaging method
JP4989243B2 (en) Imaging device and subject detection method thereof
JP4985716B2 (en) Imaging apparatus, method for setting focus evaluation area, and program
JP2010245810A (en) Imaging apparatus
US8154627B2 (en) Imaging device
JP4449692B2 (en) Electronic camera
JP5094686B2 (en) Image processing apparatus, image processing method, and image processing program
KR20110074668A (en) Photoghraphing apparatus and method
JP2009219028A (en) Image recording method and imaging unit
JP6019587B2 (en) Image processing device
JP2004260378A (en) Pixel signal processing circuit
JP5299910B2 (en) Imaging apparatus and imaging method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130419

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20131121

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20131210

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140203

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140408

R151 Written notification of patent or utility model registration

Ref document number: 5523213

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees