JP2013066157A - Image processing apparatus, image processing method, and program - Google Patents

Image processing apparatus, image processing method, and program Download PDF

Info

Publication number
JP2013066157A
JP2013066157A JP2012070537A JP2012070537A JP2013066157A JP 2013066157 A JP2013066157 A JP 2013066157A JP 2012070537 A JP2012070537 A JP 2012070537A JP 2012070537 A JP2012070537 A JP 2012070537A JP 2013066157 A JP2013066157 A JP 2013066157A
Authority
JP
Japan
Prior art keywords
pixel
gradient
pixel value
image
correction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2012070537A
Other languages
Japanese (ja)
Inventor
Hirotaka Shinozaki
裕考 篠崎
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.)
Sony Corp
Original Assignee
Sony 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 Sony Corp filed Critical Sony Corp
Priority to JP2012070537A priority Critical patent/JP2013066157A/en
Priority to BR102012021428-8A priority patent/BR102012021428A2/en
Priority to CN201210306308XA priority patent/CN102970463A/en
Publication of JP2013066157A publication Critical patent/JP2013066157A/en
Priority to US14/529,787 priority patent/US9582863B2/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/77Retouching; Inpainting; Scratch removal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)
  • Color Television Image Signal Generators (AREA)
  • Facsimile Image Signal Circuits (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide an apparatus and method capable of realizing accurate detection and correction of a defect in an image having variously configured pixel arrays.SOLUTION: An apparatus applies plural different methods to a pixel region including a target pixel to obtain plural pieces of gradient detection information. On the basis of weighted addition of the plural pieces of gradient detection information, a minimum gradient direction is detected. Then, the apparatus calculates Laplacian based on a pixel value of a reference pixel located in a detected minimum gradient direction and having the same color as that of the target pixel, and determines the presence or absence of a defect in the target pixel. Then, the apparatus calculates a corrected pixel value by applying the pixel value of the reference pixel located in the direction detected in the direction determination process, to a target pixel from which a defect has been detected.

Description

本開示は、画像処理装置、および画像処理方法、並びにプログラムに関する。特に、画像の補正処理を実行する画像処理装置、および画像処理方法、並びにプログラムに関する。   The present disclosure relates to an image processing device, an image processing method, and a program. In particular, the present invention relates to an image processing apparatus, an image processing method, and a program that execute an image correction process.

デジタルカメラ等の撮像装置に利用される撮像素子には、例えばRGB配列からなるカラーフィルタが装着され、各画素に特定の波長光を入射する構成となっている。
具体的には、例えばベイヤ(Bayer)配列を持つカラーフィルタが多く利用されている。
An image sensor used in an image pickup apparatus such as a digital camera is provided with a color filter made of, for example, an RGB array, and has a configuration in which specific wavelength light is incident on each pixel.
Specifically, for example, a color filter having a Bayer array is often used.

ベイヤ配列の撮像画像は、撮像素子の各画素にRGBいずれかの色に対応する画素値のみが設定されたいわゆるモザイク画像となる。カメラの信号処理部は、このモザイク画像に対して画素値補間などの様々な信号処理を施して各画素にRGBの全画素値を設定するデモザイク処理等を行い、カラー画像を生成して出力する。   The Bayer array captured image is a so-called mosaic image in which only pixel values corresponding to any of RGB colors are set for each pixel of the image sensor. The signal processing unit of the camera performs various signal processing such as pixel value interpolation on the mosaic image, performs demosaic processing for setting all pixel values of RGB for each pixel, and generates and outputs a color image. .

このベイヤ配列に従ったカラーフィルタを備えた撮像画像に対する信号処理については、すでに多くの検討がなされ、ある程度、技術的に確立されていると言える。しかし、ベイヤ配列と異なる配列を持つ画像に対する信号処理については、まだ十分な検討がなされていないというのが現状である。   Many studies have already been made on signal processing for a captured image having a color filter according to this Bayer array, and it can be said that it has been technically established to some extent. However, the current situation is that sufficient studies have not yet been made on signal processing for images having an array different from the Bayer array.

なお、例えば、撮像素子に付属するフィルタとしてRGBの各色に加え、全波長透過型のW(White)画素を備えたRGBW配列を持つフィルタを備えた撮像装置の撮影画像に対する補正処理について、特許文献1(特開2011−55038号公報)などに記載がある。   For example, as a filter attached to an image sensor, correction processing for a captured image of an imaging device including a filter having an RGBW array including all-wavelength transmission type W (White) pixels in addition to RGB colors is disclosed in Patent Literature 1 (Japanese Unexamined Patent Application Publication No. 2011-55038).

特開2011−055038号公報JP 2011-055038 A

本開示は、例えば上記問題点に鑑みてなされたものであり、例えばベイヤ(Bayer)配列と異なる配列を持つカラーフィルタを備えた撮像素子によって撮影された画像に対する画像補正処理を実行する画像処理装置、および画像処理方法、並びにプログラムを提供することを目的とする。   The present disclosure has been made in view of, for example, the above-described problems. For example, an image processing apparatus that performs image correction processing on an image captured by an imaging element including a color filter having an array different from a Bayer array And an image processing method and a program.

本開示の第1の側面は、
画像の補正処理を実行する画像信号補正部を有し、
前記画像信号補正部は、
注目画素を含む画素領域における画素値勾配方向として、最小の画素値勾配を有する方向を検出する方向判定処理と、
前記注目画素に対して、前記方向判定処理において検出した最小勾配方向の参照画素の画素値に基づくラプラシアンを算出して、注目画素の欠陥の有無を判定する欠陥検出処理と、
前記欠陥検出処理において欠陥の検出された注目画素に対して、前記方向判定処理において検出した方向にある参照画素の画素値を適用した補正画素値の算出を実行する欠陥補正処理を実行し、
前記方向判定処理は、複数の異なる勾配検出処理によって算出した複数の勾配情報の重み付き加算結果を適用して実行する画像処理装置にある。
The first aspect of the present disclosure is:
An image signal correction unit that executes image correction processing;
The image signal correction unit
A direction determination process for detecting a direction having a minimum pixel value gradient as a pixel value gradient direction in a pixel region including the target pixel;
A defect detection process for calculating the Laplacian based on the pixel value of the reference pixel in the minimum gradient direction detected in the direction determination process for the target pixel, and determining the presence or absence of a defect in the target pixel;
Executing a defect correction process for calculating a correction pixel value by applying a pixel value of a reference pixel in a direction detected in the direction determination process to a target pixel in which a defect is detected in the defect detection process;
The direction determination process is in an image processing apparatus that executes by applying a weighted addition result of a plurality of pieces of gradient information calculated by a plurality of different gradient detection processes.

さらに、本開示の画像処理装置の一実施態様において、前記画像信号補正部は、前記方向判定処理において、高周波テクスチャ対応の画素値勾配情報と、低周波テクスチャ対応の画素値勾配情報と、輝度信号対応の画素値勾配情報と、を算出し、これらの3種類の勾配情報の重み付き加算結果に基づいて、最小の画素値勾配を有する方向を検出する。   Furthermore, in an embodiment of the image processing device according to the present disclosure, the image signal correction unit includes, in the direction determination process, pixel value gradient information corresponding to high frequency texture, pixel value gradient information corresponding to low frequency texture, and a luminance signal. The corresponding pixel value gradient information is calculated, and the direction having the minimum pixel value gradient is detected based on the weighted addition result of these three types of gradient information.

さらに、本開示の画像処理装置の一実施態様において、前記画像信号補正部は、前記高周波テクスチャ対応の画素値勾配情報を、隣接画素の画素値差分を適用して算出し、前記低周波テクスチャ対応の画素値勾配情報を、非隣接画素の画素値差分を適用して算出する。   Furthermore, in an embodiment of the image processing device according to the present disclosure, the image signal correction unit calculates the pixel value gradient information corresponding to the high frequency texture by applying a pixel value difference between adjacent pixels, and the low frequency texture correspondence Is calculated by applying the pixel value difference of the non-adjacent pixels.

さらに、本開示の画像処理装置の一実施態様において、前記画像信号補正部は、RGB各画素を含む画素領域単位でRGB各画素の画素値に基づいて輝度信号を算出し、算出した領域単位の輝度信号を適用して前記輝度信号対応の画素値勾配情報を算出する。   Furthermore, in an embodiment of the image processing device of the present disclosure, the image signal correction unit calculates a luminance signal based on a pixel value of each RGB pixel in a pixel region unit including each RGB pixel, and calculates the calculated region unit. Pixel value gradient information corresponding to the luminance signal is calculated by applying the luminance signal.

さらに、本開示の画像処理装置の一実施態様において、前記画像信号補正部は、前記3種類の勾配情報の重み付き加算処理において設定する重みを出力画像の解像度に応じて変更する処理を実行し、出力画像が高解像度の場合は、高周波テクスチャ対応の画素値勾配情報に対する重みを他の勾配情報に優先して高く設定し、出力画像が低解像度の場合は、低周波テクスチャ対応の画素値勾配情報に対する重みを他の勾配情報に優先して高く設定する。   Furthermore, in an embodiment of the image processing device according to the present disclosure, the image signal correction unit executes a process of changing a weight set in the weighted addition process of the three types of gradient information according to the resolution of the output image. If the output image has a high resolution, the weight for the pixel value gradient information corresponding to the high frequency texture is set higher than the other gradient information, and if the output image has a low resolution, the pixel value gradient corresponding to the low frequency texture is set. The weight for information is set higher than other gradient information.

さらに、本開示の画像処理装置の一実施態様において、前記画像信号補正部は、前記3種類の勾配情報の重み付き加算処理において設定する重みを処理対象画像である入力画像の周波数帯に応じて変更する処理を実行し、入力画像が高周波数領域を多く含む場合は、高周波テクスチャ対応の画素値勾配情報に対する重みを他の勾配情報に優先して高く設定し、入力画像が低周波数領域を多く含む場合は、低周波テクスチャ対応の画素値勾配情報に対する重みを他の勾配情報に優先して高く設定する。   Furthermore, in an embodiment of the image processing device according to the present disclosure, the image signal correction unit sets a weight set in the weighted addition processing of the three types of gradient information according to a frequency band of an input image that is a processing target image. If the input image contains many high-frequency areas, the weight for the pixel value gradient information corresponding to the high-frequency texture is set higher than other gradient information, and the input image contains many low-frequency areas. If included, the weight for the pixel value gradient information corresponding to the low frequency texture is set higher than other gradient information.

さらに、本開示の画像処理装置の一実施態様において、前記画像信号補正部は、RGB各色が2×2の4画素単位で配列された画像、またはRGBW各色が2×2の4画素単位で配列された画像の画素値補正を実行する。   Furthermore, in an embodiment of the image processing apparatus according to the present disclosure, the image signal correction unit includes an image in which RGB colors are arranged in units of 4 pixels of 2 × 2, or RGBW colors are arranged in units of 4 pixels of 2 × 2. The pixel value correction of the processed image is executed.

さらに、本開示の画像処理装置の一実施態様において、前記画像信号補正部は、前記欠陥検出処理において、欠陥検出対象となる注目画素と同一色の画素を参照画素として前記最小勾配方向から選択し、注目画素と選択画素の異なる組み合わせに基づいて算出した複数のラプラシアンと予め既定した閾値との比較を実行して比較結果に基づいて前記注目画素が欠陥画素であるか否かの判定を行う。   Furthermore, in an embodiment of the image processing device according to the present disclosure, the image signal correction unit selects, from the minimum gradient direction, a pixel having the same color as a target pixel to be detected as a reference pixel in the defect detection process. A comparison is made between a plurality of Laplacians calculated based on different combinations of the target pixel and the selected pixel and a predetermined threshold value, and based on the comparison result, it is determined whether or not the target pixel is a defective pixel.

さらに、本開示の画像処理装置の一実施態様において、前記画像信号補正部は、欠陥検出対象となる注目画素と同一色の画素を参照画素として前記最小勾配方向から4画素選択し、注目画素と2つの選択画素の異なる組み合わせに基づいて算出した3つのラプラシアンと予め既定した閾値との比較を実行し、3つのラプラシアンの全てが前記しきい値より大きい場合に前記注目画素が欠陥画素であると判定する。   Furthermore, in an embodiment of the image processing apparatus of the present disclosure, the image signal correction unit selects four pixels from the minimum gradient direction as pixels of the same color as the target pixel to be detected as a reference pixel, A comparison between three Laplacians calculated based on different combinations of two selected pixels and a predetermined threshold is performed, and when all three Laplacians are larger than the threshold, the target pixel is a defective pixel judge.

さらに、本開示の画像処理装置の一実施態様において、前記画像信号補正部は、前記欠陥検出処理において、欠陥検出対象となる注目画素と同一色の画素が、既定の参照領域内において前記最小勾配方向から4つ選択できない場合、前記最小勾配方向にある注目画素と異なる色の異色画素位置に、該異色画素位置の周囲の注目画素と同一色画素の画素値に基づく画素補間を実行し、該画素補間によって生成した補間画素を参照画素として設定する。   Furthermore, in an embodiment of the image processing device according to the present disclosure, the image signal correction unit is configured such that, in the defect detection process, a pixel having the same color as a target pixel that is a defect detection target is within the predetermined reference area. If it is not possible to select four from the direction, pixel interpolation based on the pixel value of the same color pixel as the target pixel around the different color pixel position is performed on the different color pixel position of the color different from the target pixel in the minimum gradient direction, Interpolated pixels generated by pixel interpolation are set as reference pixels.

さらに、本開示の画像処理装置の一実施態様において、前記画像信号補正部は、前記欠陥補正処理において、前記参照画素の画素値の重み付き加算により前記注目画素の補正画素値を算出する。   Furthermore, in an embodiment of the image processing device according to the present disclosure, the image signal correction unit calculates a corrected pixel value of the target pixel by weighted addition of the pixel values of the reference pixel in the defect correction processing.

さらに、本開示の画像処理装置の一実施態様において、前記画像信号補正部は、前記欠陥補正処理において、前記注目画素を中心とした両側各々にある2つの参照画素間の画素値勾配を算出し、画素値勾配の小さい方向の2画素の画素値の重み付き加算によって前記注目画素の補正画素値を算出する。   Furthermore, in an embodiment of the image processing apparatus according to the present disclosure, the image signal correction unit calculates a pixel value gradient between two reference pixels on both sides around the target pixel in the defect correction process. Then, the corrected pixel value of the target pixel is calculated by weighted addition of the pixel values of the two pixels in the direction in which the pixel value gradient is small.

さらに、本開示の画像処理装置の一実施態様において、前記画像信号補正部は、前記欠陥補正処理において実行した補正処理がハイライト誤補正であるか否かを判定するハイライト誤補正判定処理を実行し、ハイライト誤補正であると判定した場合は、補正前の原画素値を出力し、ハイライト誤補正でないと判定した場合は、補正画素値を出力する。   Furthermore, in an embodiment of the image processing apparatus of the present disclosure, the image signal correction unit performs a highlight error correction determination process that determines whether or not the correction process executed in the defect correction process is a highlight error correction. If it is determined that it is a highlight error correction, the original pixel value before correction is output, and if it is determined that it is not a highlight error correction, a correction pixel value is output.

さらに、本開示の第2の側面は、
画像処理装置において実行する画像処理方法であり、
画像信号補正部が、注目画素を含む画素領域における画素値勾配方向として、最小の画素値勾配を有する方向を検出する方向判定処理と、
前記注目画素に対して、前記方向判定処理において検出した最小勾配方向の参照画素の画素値に基づくラプラシアンを算出して、注目画素の欠陥の有無を判定する欠陥検出処理と、
前記欠陥検出処理において欠陥の検出された注目画素に対して、前記方向判定処理において検出した方向にある参照画素の画素値を適用した補正画素値の算出を実行する欠陥補正処理を実行し、
前記方向判定処理においては、複数の異なる勾配検出処理によって算出した複数の勾配情報の重み付き加算結果を適用した方向判定処理を実行する画像処理方法にある。
Furthermore, the second aspect of the present disclosure is:
An image processing method executed in an image processing apparatus,
A direction determination process in which the image signal correction unit detects a direction having the minimum pixel value gradient as the pixel value gradient direction in the pixel region including the target pixel;
A defect detection process for calculating the Laplacian based on the pixel value of the reference pixel in the minimum gradient direction detected in the direction determination process for the target pixel, and determining the presence or absence of a defect in the target pixel;
Executing a defect correction process for calculating a correction pixel value by applying a pixel value of a reference pixel in a direction detected in the direction determination process to a target pixel in which a defect is detected in the defect detection process;
In the direction determination process, there is an image processing method for executing a direction determination process using a weighted addition result of a plurality of pieces of gradient information calculated by a plurality of different gradient detection processes.

さらに、本開示の第3の側面は、
画像処理装置において画像処理を実行させるプログラムであり、
画像信号補正部に、注目画素を含む画素領域における画素値勾配方向として、最小の画素値勾配を有する方向を検出する方向判定処理と、
前記注目画素に対して、前記方向判定処理において検出した最小勾配方向の参照画素の画素値に基づくラプラシアンを算出して、注目画素の欠陥の有無を判定する欠陥検出処理と、
前記欠陥検出処理において欠陥の検出された注目画素に対して、前記方向判定処理において検出した方向にある参照画素の画素値を適用した補正画素値の算出を実行する欠陥補正処理を実行させ、
前記方向判定処理は、複数の異なる勾配検出処理によって算出した複数の勾配情報の重み付き加算結果を適用した方向判定処理を実行させるプログラムにある。
Furthermore, the third aspect of the present disclosure is:
A program for executing image processing in an image processing apparatus;
A direction determination process for detecting a direction having a minimum pixel value gradient as a pixel value gradient direction in the pixel region including the target pixel in the image signal correction unit;
A defect detection process for calculating the Laplacian based on the pixel value of the reference pixel in the minimum gradient direction detected in the direction determination process for the target pixel, and determining the presence or absence of a defect in the target pixel;
For the target pixel in which a defect is detected in the defect detection process, a defect correction process is executed to calculate a correction pixel value by applying a pixel value of a reference pixel in the direction detected in the direction determination process,
The direction determination process is in a program for executing a direction determination process using a weighted addition result of a plurality of pieces of gradient information calculated by a plurality of different gradient detection processes.

なお、本開示のプログラムは、例えば、様々なプログラム・コードを実行可能な情報処理装置やコンピュータ・システムに対して、コンピュータ可読な形式で提供する記憶媒体、通信媒体によって提供可能なプログラムである。このようなプログラムをコンピュータ可読な形式で提供することにより、情報処理装置やコンピュータ・システム上でプログラムに応じた処理が実現される。   Note that the program of the present disclosure is a program that can be provided by, for example, a storage medium or a communication medium provided in a computer-readable format to an information processing apparatus or a computer system that can execute various program codes. By providing such a program in a computer-readable format, processing corresponding to the program is realized on the information processing apparatus or the computer system.

本開示のさらに他の目的、特徴や利点は、後述する本開示の実施例や添付する図面に基づくより詳細な説明によって明らかになるであろう。なお、本明細書においてシステムとは、複数の装置の論理的集合構成であり、各構成の装置が同一筐体内にあるものには限らない。   Other objects, features, and advantages of the present disclosure will become apparent from a more detailed description based on embodiments of the present disclosure described below and the accompanying drawings. In this specification, the system is a logical set configuration of a plurality of devices, and is not limited to one in which the devices of each configuration are in the same casing.

本開示の一実施例の構成によれば、様々な設定の画素配列を持つ画像に対して、高精度な欠陥検出および補正を実現可能とした装置、方法を提供する。
具体的には、注目画素を含む画素領域に対して複数の異なる手法を適用して複数の勾配検出情報を取得する。さらに、複数の勾配検出情報の重み付き加算に基づいて最小勾配方向を検出する。さらに、検出した最小勾配方向にある注目画素と同一色の参照画素の画素値に基づくラプラシアンを算出して、注目画素の欠陥の有無を判定する。さらに、欠陥の検出された注目画素に対して、方向判定処理において検出した方向にある参照画素の画素値を適用して補正画素値を算出する。
本処理により、様々な設定の画素配列を持つ画像に対して、高精度な欠陥検出および補正を実現可能とした装置、方法が実現される。
According to the configuration of an embodiment of the present disclosure, there is provided an apparatus and a method capable of realizing highly accurate defect detection and correction for an image having a pixel array with various settings.
Specifically, a plurality of gradient detection information is acquired by applying a plurality of different methods to the pixel region including the target pixel. Further, the minimum gradient direction is detected based on the weighted addition of a plurality of gradient detection information. Further, a Laplacian is calculated based on the pixel value of the reference pixel of the same color as the target pixel in the detected minimum gradient direction, and the presence / absence of a defect in the target pixel is determined. Further, the correction pixel value is calculated by applying the pixel value of the reference pixel in the direction detected in the direction determination process to the target pixel in which the defect is detected.
By this processing, an apparatus and a method capable of realizing highly accurate defect detection and correction for an image having a pixel array with various settings are realized.

撮像素子の構成例について説明する図である。It is a figure explaining the structural example of an image pick-up element. 画像処理装置の構成例について説明する図である。It is a figure explaining the structural example of an image processing apparatus. 本開示の画像処理装置の実行する処理について説明するフローチャートを示す図である。It is a figure which shows the flowchart explaining the process which the image processing apparatus of this indication performs. 本開示の画像処理装置の実行する処理について説明するフローチャートを示す図である。It is a figure which shows the flowchart explaining the process which the image processing apparatus of this indication performs. 本開示の画像処理装置の実行する方向判定処理について説明する図である。It is a figure explaining the direction determination process which the image processing apparatus of this indication performs. 本開示の画像処理装置の実行する方向判定処理について説明する図である。It is a figure explaining the direction determination process which the image processing apparatus of this indication performs. 本開示の画像処理装置の実行する方向判定処理について説明する図である。It is a figure explaining the direction determination process which the image processing apparatus of this indication performs. 本開示の画像処理装置の実行するグラジエント重み付き平均値算出処理について説明する図である。It is a figure explaining the average value calculation process with a gradient weight which the image processing apparatus of this indication performs. 本開示の画像処理装置の実行するグラジエント重み付き平均値算出処理における重み決定処理例について説明する図である。It is a figure explaining the example of a weight determination process in the gradient weighted average value calculation process which the image processing apparatus of this indication performs. 本開示の画像処理装置の実行するグラジエント重み付き平均値算出処理における重み決定処理例について説明する図である。It is a figure explaining the example of a weight determination process in the gradient weighted average value calculation process which the image processing apparatus of this indication performs. 本開示の画像処理装置の実行するグラジエント重み付き平均値算出処理における重み決定処理例について説明する図である。It is a figure explaining the example of a weight determination process in the gradient weighted average value calculation process which the image processing apparatus of this indication performs. 本開示の画像処理装置の実行するグラジエント算出処理について説明する図である。It is a figure explaining the gradient calculation process which the image processing apparatus of this indication performs. 本開示の画像処理装置の実行するグラジエント算出処理について説明する図である。It is a figure explaining the gradient calculation process which the image processing apparatus of this indication performs. 本開示の画像処理装置の実行するグラジエント算出処理について説明する図である。It is a figure explaining the gradient calculation process which the image processing apparatus of this indication performs. 本開示の画像処理装置の実行するグラジエント算出処理について説明する図である。It is a figure explaining the gradient calculation process which the image processing apparatus of this indication performs. 本開示の画像処理装置の実行する方向判定処理について説明する図である。It is a figure explaining the direction determination process which the image processing apparatus of this indication performs. 本開示の画像処理装置の実行する欠陥検出処理について説明する図である。It is a figure explaining the defect detection process which the image processing apparatus of this indication performs. 本開示の画像処理装置の実行する画素補間処理について説明する図である。It is a figure explaining the pixel interpolation process which the image processing apparatus of this indication performs. 本開示の画像処理装置の実行する画素補間処理について説明する図である。It is a figure explaining the pixel interpolation process which the image processing apparatus of this indication performs. 本開示の画像処理装置の実行する画素補間処理について説明する図である。It is a figure explaining the pixel interpolation process which the image processing apparatus of this indication performs. 本開示の画像処理装置の実行する画素補間処理について説明する図である。It is a figure explaining the pixel interpolation process which the image processing apparatus of this indication performs. 本開示の画像処理装置の実行するラプラシアン計算処理について説明する図である。It is a figure explaining the Laplacian calculation process which the image processing apparatus of this indication performs. 本開示の画像処理装置の実行するラプラシアン比較処理について説明する図である。It is a figure explaining the Laplacian comparison process which the image processing apparatus of this indication performs. 本開示の画像処理装置の実行する欠陥補正処理について説明する図である。It is a figure explaining the defect correction process which the image processing apparatus of this indication performs. 本開示の画像処理装置の実行する欠陥補正処理について説明する図である。It is a figure explaining the defect correction process which the image processing apparatus of this indication performs. 本開示の画像処理装置の実行する欠陥補正処理の変形例について説明する図である。It is a figure explaining the modification of the defect correction process which the image processing apparatus of this indication performs. 本開示の画像処理装置の実行するハイライト誤補正検出を伴う処理例について説明する図である。It is a figure explaining the example of a process with the highlight erroneous correction detection which the image processing apparatus of this indication performs. 本開示の画像処理装置の実行するハイライト誤補正検出を伴う処理例について説明する図である。It is a figure explaining the example of a process with the highlight erroneous correction detection which the image processing apparatus of this indication performs. 本開示の画像処理装置の実行するハイライト誤補正検出を伴う処理例について説明する図である。It is a figure explaining the example of a process with the highlight erroneous correction detection which the image processing apparatus of this indication performs. 本開示の画像処理装置の実行するハイライト誤補正検出を伴う処理例について説明する図である。It is a figure explaining the example of a process with the highlight erroneous correction detection which the image processing apparatus of this indication performs.

以下、図面を参照しながら本開示の画像処理装置、および画像処理方法、並びにプログラムの詳細について説明する。なお、説明は以下の項目に従って行う。
1.撮像素子の構成例について
2.画像処理装置の構成例について
3.画像処理の具体例について
4.方向判定処理について
5.方向判定処理の変形例について
6.欠陥検出処理について
7.欠陥補正処理について
8.欠陥補正処理の変形列について
9.ハイライト誤補正判定を伴う処理例について
10.本開示の構成のまとめ
The details of the image processing apparatus, the image processing method, and the program of the present disclosure will be described below with reference to the drawings. The description will be made according to the following items.
1. 1. Configuration example of image sensor 2. Configuration example of image processing apparatus 3. Specific examples of image processing 4. Direction determination processing 5. Modification of direction determination process About defect detection processing Defect correction processing 8. Deformation sequence of defect correction processing 10. Example of processing with highlight error correction determination Summary of composition of this disclosure

[1.撮像素子の構成例について]
図1を参照して撮像素子の構成例について説明する。図1には、以下の3つの撮像素子の構成例を示している。
(1)ベイヤ(Bayer)配列
(2)4分割ベイヤ型RGB配列
(3)RGBW型配列
[1. Example of image sensor configuration]
A configuration example of the image sensor will be described with reference to FIG. FIG. 1 shows a configuration example of the following three image sensors.
(1) Bayer array (2) Quadrant Bayer RGB array (3) RGBW array

(1)ベイヤ(Bayer)配列は多くのカメラにおいて採用されている配列であり、このベイヤ配列を持つカラーフィルタを持つ撮像画像に対する信号処理はほぼ確立している。
しかし、(2)4分割ベイヤ型RGB配列や、(3)RGBW型配列については、まだ、これらのフィルタを備えた撮像素子によって撮影された画像に対する信号処理について十分な検討がなされているとは言えないというのが現状である。
なお、(2)4分割ベイヤ型RGB配列は、(1)に示すベイヤ配列の1つのR,G,B各画素を4つの画素として設定した配列に相当する。
(1) The Bayer array is an array adopted in many cameras, and signal processing for a captured image having a color filter having the Bayer array is almost established.
However, with regard to (2) the four-divided Bayer type RGB array and (3) the RGBW type array, it is still considered that signal processing for an image photographed by an image sensor provided with these filters has been sufficiently studied. The current situation is that I can't say that.
Note that (2) the four-divided Bayer type RGB array corresponds to an array in which one R, G, B pixel of the Bayer array shown in (1) is set as four pixels.

以下、この(2)4分割ベイヤ型RGB配列を持つカラーフィルタを備えた撮像素子によって撮影される画像に対する信号処理を実行する画像処理装置について説明する。   Hereinafter, (2) an image processing apparatus that performs signal processing on an image photographed by an imaging device including a color filter having a four-divided Bayer RGB array will be described.

[2.画像処理装置の構成例について]
図2に、本開示の画像処理装置の一構成例である撮像装置100の構成例を示す。
撮像装置100は、図2に示すように、光学レンズ105、撮像素子(イメージセンサ)110、画像処理部120、メモリ130、制御部140を有する。
[2. Configuration example of image processing apparatus]
FIG. 2 illustrates a configuration example of the imaging apparatus 100 that is a configuration example of the image processing apparatus of the present disclosure.
As illustrated in FIG. 2, the imaging apparatus 100 includes an optical lens 105, an imaging element (image sensor) 110, an image processing unit 120, a memory 130, and a control unit 140.

なお、図2に示す撮像装置100は本開示の画像処理装置の一例であり、本開示の画像処理装置には、例えばPCなどの装置も含まれる。PC等の画像処理装置は、図2に示す撮像装置100の光学レンズ105、撮像素子110を持たず、その他の構成要素から構成され、撮像素子100の取得データの入力部、または記憶部を持つ構成となる。   2 is an example of the image processing apparatus according to the present disclosure, and the image processing apparatus according to the present disclosure includes an apparatus such as a PC. The image processing apparatus such as a PC does not include the optical lens 105 and the image sensor 110 of the image capturing apparatus 100 illustrated in FIG. 2, but includes other components, and includes an acquisition data input unit or a storage unit of the image sensor 100. It becomes composition.

以下では、図2に示す撮像装置100を本開示の画像処理装置の代表例として説明する。なお、図2に示す撮像装置100は、例えばスチルカメラ、ビデオカメラなどである。   Hereinafter, the imaging apparatus 100 illustrated in FIG. 2 will be described as a representative example of the image processing apparatus of the present disclosure. 2 is a still camera, a video camera, or the like, for example.

図2に示す撮像装置100の撮像素子(イメージセンサ)110は、図1(2)を参照して説明した4分割ベイヤ型RGB配列からなるカラーフィルタを備えた構成である。
赤色近傍の波長を透過する赤(R)、
緑色近傍の波長を透過する緑(G)、
青色近傍の波長を透過する青(B)、
これら3種類の分光特性を持つフィルタを備えた撮像素子である。
先に説明したように、4分割ベイヤ型RGB配列は、図1(1)に示すベイヤ配列の1つの画素を4つの画素として設定した配列に相当する。
An imaging element (image sensor) 110 of the imaging apparatus 100 shown in FIG. 2 has a configuration including a color filter composed of a four-divided Bayer RGB array described with reference to FIG.
Red (R) that transmits wavelengths near red,
Green (G) that transmits wavelengths in the vicinity of green,
Blue (B) that transmits wavelengths near blue,
It is an image sensor provided with a filter having these three types of spectral characteristics.
As described above, the four-divided Bayer RGB array corresponds to an array in which one pixel of the Bayer array shown in FIG. 1A is set as four pixels.

この4分割ベイヤ型RGB配列181を持つ撮像素子110は、光学レンズ105を介してRGBいずれかの光を各画素単位で受光し、光電変換により受光信号強度に対応する電気信号を生成して出力する。この撮像素子110によってRGB3種類の分光から成るモザイク画像が得られる。   The image sensor 110 having the four-divided Bayer RGB array 181 receives RGB light in units of pixels via the optical lens 105, generates an electrical signal corresponding to the received light signal intensity by photoelectric conversion, and outputs it. To do. With this image sensor 110, a mosaic image composed of three types of RGB spectra is obtained.

撮像素子(イメージセンサ)110の出力信号は画像処理部120の画像信号補正部200に入力される。
画像信号補正部200は、4分割ベイヤ型RGB配列181を持つ画像の補正処理、例えば欠陥画素の補正を行う。
An output signal of the image sensor (image sensor) 110 is input to the image signal correction unit 200 of the image processing unit 120.
The image signal correction unit 200 performs correction processing of an image having a four-divided Bayer RGB array 181, for example, correction of defective pixels.

画像信号補正部200における補正画像が信号処理部250に入力される。信号処理部250は、既存のカメラにおける信号処理部と同様の処理、例えばWB(ホワイトバランス)調整、各画素にRGB各画素値を設定するデモザイク処理等を実行してカラー画像183を生成して出力する。カラー画像183はメモリ130に格納される。   The corrected image in the image signal correction unit 200 is input to the signal processing unit 250. The signal processing unit 250 generates a color image 183 by executing processing similar to that of the signal processing unit in the existing camera, for example, WB (white balance) adjustment, demosaic processing for setting RGB pixel values for each pixel, and the like. Output. The color image 183 is stored in the memory 130.

なお、光学レンズ105、撮像素子110、画像処理部120には制御部140からの制御信号が入力され、撮影処理制御、信号処理制御が実行される。制御部140は、例えばメモリ130に格納されたプログラムに従い、例えば図示しない入力部からのユーザ入力に応じて画像撮影他、各種の処理を実行する。   Note that control signals from the control unit 140 are input to the optical lens 105, the image sensor 110, and the image processing unit 120, and imaging processing control and signal processing control are executed. For example, according to a program stored in the memory 130, the control unit 140 executes various processes in addition to image capturing in accordance with a user input from an input unit (not shown).

[3.画像処理の具体例について]
次に、図2の画像処理部120の画像信号補正部200において実行する処理について、図3以下を参照して説明する。
図3(a)は、画像信号補正部200において実行する処理を示す信号処理全体シーケンスである。
まずステップS101において撮像素子110から入力した撮像画像から処理対象画素(注目画素)を1つ選択し、注目画素近傍の画素領域(例えばN×N画素)を参照して画素値勾配(グラジエント(Gradient))の方向判定を行う。
すなわち、画素値勾配(グラジエント(Gradient))が最小となる方向を方向判定結果として生成する。
[3. Specific examples of image processing]
Next, processing executed in the image signal correction unit 200 of the image processing unit 120 in FIG. 2 will be described with reference to FIG.
FIG. 3A is an entire signal processing sequence showing processing executed in the image signal correction unit 200.
First, in step S101, one pixel to be processed (target pixel) is selected from the captured image input from the image sensor 110, and a pixel value gradient (gradient (Gradient) is referenced with reference to a pixel region (for example, N × N pixels) in the vicinity of the target pixel. )) Direction determination.
That is, the direction in which the pixel value gradient (gradient) is minimized is generated as the direction determination result.

画素値勾配(グラジエント(Gradient))が最小となる方向とは、エッジ方向に相当し、画素値の変化の少ない方向である。一方、エッジ方向に垂直な方向は、画素値勾配(グラジエント(Gradient))が大きくなり、画素値の変化が大きい方向である。   The direction in which the pixel value gradient (gradient) is the minimum corresponds to the edge direction and is the direction in which the pixel value does not change much. On the other hand, the direction perpendicular to the edge direction is a direction in which the pixel value gradient (gradient) increases and the change in pixel value is large.

なお、例えば注目画素に対する処理を行う場合、図3に示すように、注目画素301を中心としたN×N画素の画素領域300を参照して処理を行う。図3に示す例は、N=11とした例である。   For example, when performing processing on the target pixel, as illustrated in FIG. 3, the processing is performed with reference to a pixel region 300 of N × N pixels centering on the target pixel 301. The example shown in FIG. 3 is an example in which N = 11.

次に、ステップS102において、注目画素が欠陥画素であるか否かを判定し、欠陥が含まれる場合は、ステップS103で欠陥補正を行う。
以下、これらの各処理についての詳細を順次説明する。
Next, in step S102, it is determined whether or not the pixel of interest is a defective pixel. If a defect is included, defect correction is performed in step S103.
Details of each of these processes will be sequentially described below.

[4.方向判定処理について]
まず、図3のフローのステップS101における画素値勾配(グラジエント(Gradient))の方向判定処理について説明する。
[4. About direction determination processing]
First, the pixel value gradient (gradient) direction determination process in step S101 of the flow of FIG. 3 will be described.

方向判定処理の詳細フローを図4に示す。
図4に示すように、方向判定処理は、注目画素301を中心としたN×N画素の画素領域300を入力して注目画素301対応の画素値勾配(グラジエント(Gradient))の方向判定結果を順次出力する処理として実行される。
A detailed flow of the direction determination process is shown in FIG.
As shown in FIG. 4, in the direction determination process, an N × N pixel region 300 centered on the target pixel 301 is input, and the direction determination result of the pixel value gradient (gradient) corresponding to the target pixel 301 is obtained. It is executed as a process of outputting sequentially.

具体的には、まず、
ステップS121の高周波テクスチャのグラジエント算出、
ステップS122の低周波テクスチャのグラジエント算出、
ステップS123の輝度信号のグラジエント算出、
これら3態様のグラジエント算出を実行する。
さらに、ステップS124において、
これらの3つのグラジエント算出結果に対して、重み付き平均値を算出、これに基づいてステップS125で方向判定結果を出力する。
以下、これらの各処理の具体例について説明する。
Specifically, first,
Calculating the gradient of the high frequency texture in step S121;
Calculating the gradient of the low-frequency texture in step S122;
Gradient calculation of luminance signal in step S123,
These three modes of gradient calculation are executed.
Further, in step S124,
A weighted average value is calculated for these three gradient calculation results, and based on this, a direction determination result is output in step S125.
Hereinafter, specific examples of these processes will be described.

図5は、ステップS121の高周波テクスチャのグラジエント算出処理例を示す図である。
注目画素301を中心としたN×N画素の画素領域300において、図5に示すように、注目画素301に隣接または近傍のG画素の画素値を利用して以下の各方向のグラジエントを算出する。
水平方向のグラジエント:gradH
垂直方向のグラジエント:gradV
右上方向のグラジエント:gradA
右下方向のグラジエント:gradD
を算出する。
具体的には、以下に示す(式1)に従って高周波テクスチャのグラジエントを算出する。
FIG. 5 is a diagram illustrating an example of the gradient calculation process of the high frequency texture in step S121.
In the pixel area 300 of N × N pixels centering on the target pixel 301, as shown in FIG. 5, gradients in the following directions are calculated using pixel values of G pixels adjacent to or near the target pixel 301. .
Horizontal gradient: gradH
Vertical gradient: gradV
Upper right gradient: gradA
Bottom right gradient: gradD
Is calculated.
Specifically, the gradient of the high frequency texture is calculated according to (Equation 1) shown below.

Figure 2013066157
・・・・・(式1)
Figure 2013066157
... (Formula 1)

なお、Gx,yは、座標位置(x,y)のG画素値を意味する。
Nは、各方向のグラジエントの個数である。
Gx, y means the G pixel value at the coordinate position (x, y).
N is the number of gradients in each direction.

図6は、ステップS122の低周波テクスチャのグラジエント算出処理例を示す図である。
注目画素301を中心としたN×N画素の画素領域300において、図6に示すように、注目画素301に隣接または近傍のG画素の画素値を利用して以下の各方向のグラジエントを算出する。
水平方向のグラジエント:gradH
垂直方向のグラジエント:gradV
右上方向のグラジエント:gradA
右下方向のグラジエント:gradD
を算出する。
具体的には、以下に示す(式2)に従って低周波テクスチャのグラジエントを算出する。
FIG. 6 is a diagram illustrating an example of gradient calculation processing of the low-frequency texture in step S122.
In the pixel area 300 of N × N pixels centered on the pixel of interest 301, as shown in FIG. 6, gradients in the following directions are calculated using pixel values of G pixels adjacent to or near the pixel of interest 301. .
Horizontal gradient: gradH
Vertical gradient: gradV
Upper right gradient: gradA
Bottom right gradient: gradD
Is calculated.
Specifically, the gradient of the low frequency texture is calculated according to (Equation 2) shown below.

Figure 2013066157
・・・・・(式2)
Figure 2013066157
... (Formula 2)

なお、Gx,yは、座標位置(x,y)のG画素値を意味する。
Nは、各方向のグラジエントの個数である。
Gx, y means the G pixel value at the coordinate position (x, y).
N is the number of gradients in each direction.

図7は、ステップS123の輝度信号のグラジエント算出処理例を示す図である。
注目画素301を中心としたN×N画素の画素領域300において、図7に示すように、
まず、2×2画素領域単位のRGGBの4画素を加算平均して輝度信号を算出する。
輝度=(R+G+G+B)/4
である。
FIG. 7 is a diagram illustrating a luminance signal gradient calculation process in step S123.
In the pixel region 300 of N × N pixels centering on the target pixel 301, as shown in FIG.
First, a luminance signal is calculated by averaging four pixels of RGGB in units of 2 × 2 pixel areas.
Luminance = (R + G + G + B) / 4
It is.

次に、これらの加算平均値を利用して、以下の各方向のグラジエントを算出する。
水平方向のグラジエント:gradH
垂直方向のグラジエント:gradV
右上方向のグラジエント:gradA
右下方向のグラジエント:gradD
を算出する。
具体的には、以下に示す(式3)に従って低周波テクスチャのグラジエントを算出する。
Next, the following gradients in each direction are calculated using these average values.
Horizontal gradient: gradH
Vertical gradient: gradV
Upper right gradient: gradA
Bottom right gradient: gradD
Is calculated.
Specifically, the gradient of the low frequency texture is calculated according to (Equation 3) shown below.

Figure 2013066157
・・・・・(式3)
Figure 2013066157
... (Formula 3)

なお、Lx,yは、上記の輝度算出式、
輝度=(R+G+G+B)/4
によって算出した輝度である。
Nは、各方向のグラジエントの個数である。
Note that Lx and y are the above brightness calculation formulas,
Luminance = (R + G + G + B) / 4
Is the luminance calculated by.
N is the number of gradients in each direction.

次に、ステップS124の処理について、図8を参照して説明する。
ステップS124では、
ステップS121で算出した高周波テクスチャのグラジェント、
ステップS122で算出した低周波テクスチャのグラジエント、
ステップS123で算出した輝度信号のグラジエント、
これら3つのグラジエント算出結果に対して、重み付き平均値を算出する。
Next, the process of step S124 will be described with reference to FIG.
In step S124,
The high frequency texture gradient calculated in step S121,
The gradient of the low frequency texture calculated in step S122;
The gradient of the luminance signal calculated in step S123;
A weighted average value is calculated for these three gradient calculation results.

図8に示す例は、水平方向のグラジエントの重み付き平均値gHの算出処理例を示している。
3種類それぞれの方法で求めたグラジエントを任意の重みで重み付き平均をとる。
ステップS121で算出した高周波テクスチャのグラジェント:gradHh、
ステップS122で算出した低周波テクスチャのグラジエント:gradHl、
ステップS123で算出した輝度信号のグラジエント:gradHi、
これらに対して、重みwh,wl,wiを乗算して加算した結果を重み付き平均値gHとして算出する。
The example shown in FIG. 8 shows an example of calculation processing of the weighted average value gH of the gradient in the horizontal direction.
The gradient obtained by each of the three methods is averaged with an arbitrary weight.
The gradient of the high frequency texture calculated in step S121: gradHh,
Gradient of the low frequency texture calculated in step S122: gradH1,
Gradient of the luminance signal calculated in step S123: gradHi,
A result obtained by multiplying and adding the weights wh, wl, and wi is calculated as a weighted average value gH.

すなわち、
gH=wh×gradHh+wl×gradHl+wi×gradHi
上記式に従って、グラジエントの重み付き平均値gHを算出する。
That is,
gH = wh × gradHh + wl × gradHl + wi × gradHi
The gradient weighted average value gH is calculated according to the above formula.

なお、図8に示す例は、水平方向のグラジエントの重み付き平均値gHの算出処理例であるが、垂直方向、右上方向、右下方向についても同様に各方向のグラジエントの重み付き平均値gV,gA,gDを算出する。   The example shown in FIG. 8 is an example of calculation processing of the weighted average value gH of the gradient in the horizontal direction, but the weighted average value gV of the gradient in each direction is similarly applied to the vertical direction, the upper right direction, and the lower right direction. , GA, gD.

なお、重みwh,wl,wiの各々は、以下のグラジエントに対する重みである。
重みwhは、ステップS121で算出した高周波テクスチャのグラジェントに対する重み、
重みwlは、ステップS122で算出した低周波テクスチャのグラジエントに対する重み、
重みwiは、ステップS123で算出した輝度信号のグラジエントに対する重み、
これらの各重みである。
Each of the weights wh, wl, and wi is a weight for the following gradient.
The weight wh is a weight for the gradient of the high frequency texture calculated in step S121.
The weight wl is a weight for the gradient of the low frequency texture calculated in step S122.
The weight w i is a weight for the gradient of the luminance signal calculated in step S123,
Each of these weights.

この重みは、予め設定した値、例えば1:1:1の重みなどの固定値を適用してもよいが、画像特徴に応じた重みを設定する構成としてもよい。
画像特徴に応じた重み設定の例について、図9〜図11を参照して説明する。
As the weight, a preset value, for example, a fixed value such as a weight of 1: 1: 1 may be applied. However, a weight corresponding to the image feature may be set.
An example of weight setting according to image characteristics will be described with reference to FIGS.

まず、図9を参照して出力画像の解像度に応じた重み設定例について説明する。
図9には、
(a)出力画像がフル解像度の場合の重み設定例、
(b)出力画像が1/2解像度の場合の重み設定例、
これら2つの解像度に応じた重み設定例を示している。
First, an example of weight setting according to the resolution of the output image will be described with reference to FIG.
In FIG.
(A) Weight setting example when output image is full resolution,
(B) Weight setting example when output image is 1/2 resolution,
An example of weight setting according to these two resolutions is shown.

フル解像度とは、撮像素子の解像度、すなわち撮像素子の画素構成に応じた画像を出力する場合である。
1/2解像度は、撮像素子の同色4画素ブロックの4つの画素値の加算平均を行って1つの画素値を設定して総画素数を1/4とした画像であり縦横の画素数をそれぞれ1/2とした画像である。
The full resolution is a case where an image corresponding to the resolution of the image sensor, that is, the pixel configuration of the image sensor is output.
The 1/2 resolution is an image in which the four pixel values of the same-color four-pixel block of the image sensor are averaged to set one pixel value and the total number of pixels is ¼. The image is halved.

(a)出力画像がフル解像度の場合の重みは、例えば以下の設定とする。
高周波テクスチャのグラジェントに対する重み:wh=0.6
低周波テクスチャのグラジェントに対する重み:wl=0.1
輝度信号のグラジエントに対する重み:wi=0.3
このような設定とする。
(A) The weight when the output image is full resolution is set as follows, for example.
Weight for high frequency texture gradient: wh = 0.6
Weight for low frequency texture gradient: wl = 0.1
Weight for gradient of luminance signal: wi = 0.3
This is the setting.

一方、
(b)出力画像が1/2解像度の場合の重みは、例えば以下の設定とする。
高周波テクスチャのグラジェントに対する重み:wh=0.1
低周波テクスチャのグラジェントに対する重み:wl=0.6
輝度信号のグラジエントに対する重み:wi=0.3
このような設定とする。
on the other hand,
(B) The weight when the output image is 1/2 resolution is set as follows, for example.
Weight for high frequency texture gradient: wh = 0.1
Weight for low frequency texture gradient: wl = 0.6
Weight for gradient of luminance signal: wi = 0.3
This is the setting.

このようにフル解像度の場合は、高周波のグラジエントの重みを他の重みより大きく設定する。
一方、出力解像度を低下させている場合は、低周波のグラジエントの重みの比重を高めるようにする。
このような重み設定とすることで、出力画像に適したグラジエント方向判定が実現される。
Thus, in the case of full resolution, the weight of the high frequency gradient is set larger than the other weights.
On the other hand, when the output resolution is lowered, the specific gravity of the low-frequency gradient weight is increased.
By setting such weights, gradient direction determination suitable for the output image is realized.

次に、図10を参照して、処理対象となる入力画像の周波数帯に応じて重みを設定する処理例について説明する。
以下に説明する例は、例えばテクスチャの多い画像、すなわち高周波領域の多い画像、あるいは画像領域に対しては高周波のグラジエントの重みを他の重みより大きく設定する。一方、画素値変化の少ない平面的な画像に対しては、低周波のグラジエントの重みを他の重みより大きく設定する処理例である。
Next, with reference to FIG. 10, an example of processing for setting a weight according to the frequency band of the input image to be processed will be described.
In the example described below, for example, an image with many textures, that is, an image with many high-frequency regions, or an image region is set with a high-frequency gradient weight greater than other weights. On the other hand, for a planar image with little change in pixel value, this is a processing example in which the weight of the low frequency gradient is set larger than the other weights.

画像が高周波領域の多い画像であるか、低周波領域の多い画像であるかを判別する手法としては様々な手法が適用可能であるが、以下ではその一例としてフーリエ変換を用いた例について説明する。
図10には、入力画像の周波数帯に応じた重みを設定する処理を行う場合の処理シーケンスと具体的な処理例を示している。
まず、入力画像に対して、ステップS151において2次元フーリエ変換を実行する。
Various methods can be applied to determine whether an image is an image with many high-frequency regions or an image with many low-frequency regions. An example using Fourier transform will be described below as an example. .
FIG. 10 shows a processing sequence and a specific processing example when processing for setting a weight according to the frequency band of the input image is performed.
First, a two-dimensional Fourier transform is executed on the input image in step S151.

フーリエ変換について図11を参照して説明する。
入力画像に対してフーリエ変換を行うと、画像配列と同じ2次元配列のフーリエ係数Fが算出される。
すなわち画像の画素数が横W、縦HであるW×Hの画像のフーリエ変換を行うと、W×Hの構成画素数に応じたW×H個のフーリエ係数F(u,v)が算出される。
フーリエ係数F(u,v)は、以下に示す式に従って算出される。
The Fourier transform will be described with reference to FIG.
When Fourier transform is performed on the input image, Fourier coefficients F having the same two-dimensional array as the image array are calculated.
That is, when a Fourier transform is performed on a W × H image in which the number of pixels of the image is horizontal W and vertical H, W × H Fourier coefficients F (u, v) corresponding to the number of W × H constituent pixels are calculated. Is done.
The Fourier coefficient F (u, v) is calculated according to the following equation.

Figure 2013066157
Figure 2013066157

上記式に従って算出されるフーリエ係数F(u,v)は、図11下段に示すように中央に低周波のパワー(振幅)を含み、周辺に高周波のパワーを格納したものとなる。   The Fourier coefficient F (u, v) calculated according to the above equation includes low-frequency power (amplitude) at the center and stores high-frequency power in the periphery as shown in the lower part of FIG.

図10に示すステップS151では、このように入力画像、すなわち撮像素子の出力画像に対するフーリエ変換によりフーリエ係数を算出する。なお、フーリエ変換は予め設定した周期Nまで算出する。
次に、図10に示すステップS152において、算出したフーリエ係数に応じて重み、すなわち、
高周波テクスチャのグラジェントに対する重み:wh、
低周波テクスチャのグラジェントに対する重み:wl、
輝度信号のグラジエントに対する重み:wi、
これらの重みwh,wl,wiを決定する。
In step S151 shown in FIG. 10, the Fourier coefficient is calculated by Fourier transform on the input image, that is, the output image of the image sensor as described above. The Fourier transform is calculated up to a preset period N.
Next, in step S152 shown in FIG. 10, the weights according to the calculated Fourier coefficients, that is,
Weight for high frequency texture gradient: wh,
Weight for low frequency texture gradient: wl,
Weight for gradient of luminance signal: wi,
These weights wh, wl, and wi are determined.

図10(2)に示すように、算出したフーリエ係数から、周波数帯域の大きさに応じて各重みを決定する。
フーリエ係数F(u,v)の座標軸を図10(2)に示すようにu,vとして設定し、予め3つの矩形領域を設定する。
As shown in FIG. 10 (2), each weight is determined from the calculated Fourier coefficient according to the size of the frequency band.
The coordinate axes of the Fourier coefficients F (u, v) are set as u and v as shown in FIG. 10 (2), and three rectangular areas are set in advance.

すなわち、
(a)u>T1、かつv>T1の外側領域:A
(b)T1≧u>T2、かつT1≧v>T2の領域:B
(c)T2≧―u、かつT2≧vの]中心領域:C
これらの領域を設定する。
領域Aは高周波領域、
領域Cは低周波領域、
領域Bは、中間の周波数領域に対応する。
That is,
(A) Outside area of u> T1 and v> T1: A
(B) Region of T1 ≧ u> T2 and T1 ≧ v> T2: B
(C) T2 ≧ −u and T2 ≧ v] central region: C
Set these areas.
Region A is a high frequency region,
Region C is the low frequency region,
Region B corresponds to an intermediate frequency region.

ステップS151におけるフーリエ変換において算出したフーリエ係数F(u,v)の各々は、上記(a)〜(c)のいずれに含まれることになる。
ステップS152においては、例えば、以下のような設定で、各重みを決定する。
Each of the Fourier coefficients F (u, v) calculated in the Fourier transform in step S151 is included in any of the above (a) to (c).
In step S152, for example, each weight is determined with the following settings.

領域A(高周波)のフーリエ係数の和を、
高周波テクスチャのグラジェントに対する重み:whとする。
領域B(中周波)のフーリエ係数の和を、
輝度信号のグラジエントに対する重み:wiとする。
領域C(低周波)のフーリエ係数の和を、
低周波テクスチャのグラジェントに対する重み:wlとする。
The sum of the Fourier coefficients of region A (high frequency) is
Weight for high-frequency texture gradient: wh.
The sum of the Fourier coefficients of region B (medium frequency)
The weight for the gradient of the luminance signal is wi.
The sum of the Fourier coefficients of region C (low frequency)
Weight for low frequency texture gradient: wl.

このような処理を実行することで、画像の周波数帯に応じた重みが設定され、グラジエントの方向判定を画像の特徴に応じた最適な処理として実行することが可能となる。なお、上記の処理は、画像単位で実行する構成も可能であり、画像の所定領域単位で実行する構成としてもよい。   By executing such a process, a weight corresponding to the frequency band of the image is set, and the gradient direction determination can be performed as an optimal process corresponding to the feature of the image. Note that the above processing may be executed in units of images, or may be executed in units of predetermined areas of images.

図4に示すステップS124では、このように、
ステップS121で算出した高周波テクスチャのグラジェント、
ステップS122で算出した低周波テクスチャのグラジエント、
ステップS123で算出した輝度信号のグラジエント、
これら3つのグラジエント算出結果に対して、重み付き平均値を算出する。
In step S124 shown in FIG.
The high frequency texture gradient calculated in step S121,
The gradient of the low frequency texture calculated in step S122;
The gradient of the luminance signal calculated in step S123;
A weighted average value is calculated for these three gradient calculation results.

すなわち、
gH=wh×gradHh+wl×gradHl+wi×gradHi
上記式に従って、グラジエントの重み付き平均値gHを算出する。
That is,
gH = wh × gradHh + wl × gradHl + wi × gradHi
The gradient weighted average value gH is calculated according to the above formula.

次に、図4に示すステップS125における方向判定処理について説明する。
ステップS125では、ステップS124において算出した以下の各値、すなわち、
水平方向のグラジエントの重み付き平均値gH、
垂直方向のグラジエントの重み付き平均値gV、
右上方向のグラジエントの重み付き平均値gA、
右下方向のグラジエントの重み付き平均値gD、
これらの4つの値を比較し、最小値を持つ方向を方向判定結果の方向とする。
Next, the direction determination process in step S125 shown in FIG. 4 will be described.
In step S125, the following values calculated in step S124, that is,
Weighted average value gH of the horizontal gradient,
Weighted average value gV of the gradient in the vertical direction,
Gradient weighted average value gA in the upper right direction,
Weighted average value gD of the gradient in the lower right direction,
These four values are compared, and the direction having the minimum value is set as the direction of the direction determination result.

前述したように、画素値勾配(グラジエント(Gradient))が最小となる方向とは、エッジ方向に相当し、画素値の変化の少ない方向である。一方、エッジ方向に垂直な方向は、画素値勾配(グラジエント(Gradient))が大きくなり、画素値の変化が大きい方向である。   As described above, the direction in which the pixel value gradient (gradient) is the minimum corresponds to the edge direction and is a direction in which the pixel value does not change much. On the other hand, the direction perpendicular to the edge direction is a direction in which the pixel value gradient (gradient) increases and the change in pixel value is large.

例えば、撮像素子から出力される画像中に誤った画素値の設定された欠陥画素(エラー画素)が含まれ、欠陥画素を補正する場合に、周囲の画素から選択した参照画素の画素値を利用して補正画素値を算出する処理が実行される。
参照画素の選択においては、画素値勾配(グラジエント(Gradient))が最小となる方向にある画素を選択することで、より自然な画素値補正が可能となる。これは、急激な画素値変化のある方向の画素の画素値を利用することで発生する不自然な画素値設定が防止されるためである。
For example, when a defective pixel (error pixel) with an incorrect pixel value is included in the image output from the image sensor and the defective pixel is corrected, the pixel value of the reference pixel selected from the surrounding pixels is used. Thus, a process for calculating a corrected pixel value is executed.
In selecting a reference pixel, more natural pixel value correction can be performed by selecting a pixel in a direction in which the pixel value gradient (gradient) is minimized. This is because an unnatural pixel value setting that occurs by using the pixel value of a pixel in a direction in which there is a sudden pixel value change is prevented.

ステップS125において得られる方向判定結果は、このような処理のために利用される。
なお、この方向判定結果の利用処理例については、後段で説明する。
The direction determination result obtained in step S125 is used for such processing.
An example of processing for using the direction determination result will be described later.

このように本開示の方向判定処理では、複数種類のグラジエントを使って重み付き平均を行う。複数種類の異なるグラジエントを組み合わせることで、例えば色々な周波数のテクスチャに対応できるというメリットがある。   Thus, in the direction determination process of the present disclosure, a weighted average is performed using a plurality of types of gradients. By combining a plurality of different gradients, for example, there is an advantage that textures of various frequencies can be handled.

特に、図1(2)に示すような4分割ベイヤ型RGB配列は、同色画素のサンプリング間隔が等間隔ではないので、位相によって取得できるテクスチャの周波数が偏るという問題がある。
本開示の構成では、高周波テクスチャと低周波テクスチャの両方とも取得し、これらを組み合わせて、画素値勾配(グラジエント(Gradient))の方向判定処理を実行する。この手法を適用することで精度の高い方向判定が可能となる。
また、輝度信号を用いることで、等間隔にサンプリングされた信号からのグラジエントを取得することも可能となる。
In particular, the four-divided Bayer RGB array as shown in FIG. 1 (2) has a problem that the frequency of the texture that can be acquired by the phase is biased because the sampling intervals of the same color pixels are not equal.
In the configuration of the present disclosure, both the high-frequency texture and the low-frequency texture are acquired, and these are combined to execute the direction determination process of the pixel value gradient (gradient). By applying this method, it is possible to determine the direction with high accuracy.
Further, by using the luminance signal, it is possible to acquire a gradient from a signal sampled at equal intervals.

本開示の画素値勾配(グラジエント(Gradient))の方向判定処理では、このように、
(a)高周波テクスチャのグラジエント、
(b)低周波テクスチャのグラジエント、
(c)輝度信号のグラジエント、
これら3種類の異なるグラジエントを算出して、これらを組み合わせて画素値勾配(グラジエント(Gradient))の方向判定を行う。
この処理により、例えば画素配列の偏り等に起因する誤った画素値勾配(グラジエント(Gradient))の方向判定の発生を抑制した精度の高い方向判定が実現される。
In the pixel value gradient (gradient) direction determination processing of the present disclosure, as described above,
(A) high frequency texture gradient,
(B) a low frequency texture gradient;
(C) the gradient of the luminance signal,
These three different gradients are calculated and combined to determine the direction of the pixel value gradient (gradient).
By this process, for example, a highly accurate direction determination is realized while suppressing the occurrence of an erroneous pixel value gradient (gradient) direction determination caused by, for example, a deviation in pixel arrangement.

なお、従来から、画像のテクスチャ方向を判定し、判定された方向に沿った画素信号を用いて、欠陥の検出・補正を行う手法が提案されており、テクスチャの方向判定には、輝度信号を用いる手法と、ベイヤ配列のG画素など市松状に最も密に配置された画素を用いる手法が知られている。後者の手法の方がより高周波なテクスチャの方向も判別できるため、広く利用されている。   Conventionally, a technique for determining the texture direction of an image and detecting and correcting defects using pixel signals along the determined direction has been proposed. For texture direction determination, a luminance signal is used. There are known a technique to be used and a technique to use pixels that are most densely arranged in a checkered pattern such as a Bayer array G pixel. The latter method is more widely used because it can also determine the direction of higher frequency texture.

しかし、図1(2)に示すような4分割ベイヤ型RGB配列では、G画素が市松状に配置されていないため、取得できるテクスチャの周波数がベイヤ配列に比べて偏る。そのため同じテクスチャであっても、画像位置によって方向判定結果が異なるなど、方向判定の精度が落ちる可能性がある。また、一定間隔にサンプリングされた画素を用いてグラジエントを算出していたため、ある特定の周波数のテクスチャ方向が、うまく判別できないことがあった。
上述した本開示の手法では、これらの問題を解決し、精度の高い方向判定が可能となる。
However, in the four-divided Bayer RGB array as shown in FIG. 1 (2), the G pixels are not arranged in a checkered pattern, so that the frequency of the texture that can be acquired is biased compared to the Bayer array. Therefore, even if the texture is the same, the direction determination accuracy may be reduced, for example, the direction determination result varies depending on the image position. In addition, since the gradient is calculated using pixels sampled at regular intervals, the texture direction of a specific frequency may not be determined well.
The method of the present disclosure described above solves these problems and enables highly accurate direction determination.

[5.方向判定処理の変形例について]
次に、方向判定処理の変形例について説明する。
(方向判定処理の変形例1)
図12に方向判定処理の変形例1の処理例を示す。
図12には、
高周波テクスチャのグラジエントの算出処理例、
低周波テクスチャのグラジエントの算出処理例、
これらを示している。
[5. About modification of direction determination process]
Next, a modified example of the direction determination process will be described.
(Modification 1 of direction determination processing)
FIG. 12 shows a processing example of Modification 1 of the direction determination processing.
In FIG.
High frequency texture gradient calculation processing example,
Example of low frequency texture gradient calculation process,
These are shown.

注目画素を中心としたN×N画素の画素領域300において、図12に示すように、注目画素301に隣接または近傍のG,R,B画素の画素値を利用して以下の各方向のグラジエントを算出する。
水平方向のグラジエント:gradH
垂直方向のグラジエント:gradV
右上方向のグラジエント:gradA
右下方向のグラジエント:gradD
を算出する。
In the pixel area 300 of N × N pixels centered on the target pixel, as shown in FIG. 12, the gradients in the following directions are obtained using the pixel values of G, R, and B pixels adjacent to or near the target pixel 301. Is calculated.
Horizontal gradient: gradH
Vertical gradient: gradV
Upper right gradient: gradA
Bottom right gradient: gradD
Is calculated.

本処理例は、高周波、低周波テクスチャのグラジエントを取得する際に、G画素以外にもR画素やB画素も利用する処理例である。
具体的には、以下に示す(式4)に従って高周波テクスチャのグラジエントを算出する。
This processing example is a processing example that uses R pixels and B pixels in addition to G pixels when acquiring gradients of high-frequency and low-frequency textures.
Specifically, the gradient of the high frequency texture is calculated according to (Equation 4) shown below.

Figure 2013066157
・・・・・(式4)
Figure 2013066157
(Formula 4)

また、以下に示す(式5)に従って低周波テクスチャのグラジエントを算出する。   Further, the gradient of the low frequency texture is calculated according to the following (Equation 5).

Figure 2013066157
・・・・・(式5)
Figure 2013066157
... (Formula 5)

(方向判定処理の変形例2)
図13に方向判定処理の変形例2の処理例を示す。
図13には、
方向判定結果をリモザイク処理に用いる例、
方向判定結果をデモザイク処理に用いる例、
これらを示している。
このように方向判定結果は欠陥画素の補正のみならず、方向判定結果を用いる様々な処理に適用できる。
(Modification 2 of direction determination processing)
FIG. 13 shows a processing example of Modification 2 of the direction determination processing.
In FIG.
An example of using the direction determination result for re-mosaic processing,
An example of using the direction determination result for demosaic processing,
These are shown.
As described above, the direction determination result can be applied not only to the correction of the defective pixel but also to various processes using the direction determination result.

なお、リモザイク処理とは、撮像素子から出力された各画素に設定されたRGB配列を変更して異なる画素配列を生成する処理である。
具体的には、例えば撮像素子からの出力が、図1(2)に示す4分割ベイヤ型RGB配列である場合、この配列を図1に示すベイヤ配列に変更する処理である。
例えば、図2に示す撮像装置100の画像処理部120内の信号処理部250は図1(1)に示すベイヤ配列の画像信号に対する信号処理を行う構成としたものが一般的である。従って、撮像素子110からの出力がベイヤ配列と異なる画素配列である場合は、その画素配列をベイヤ配列に変更するリモザイク処理を実行して信号処理部250に入力することで、信号処理部250は、既存の一般的な信号処理部の構成とすることが可能となる。
Note that the re-mosaic process is a process of generating a different pixel array by changing the RGB array set for each pixel output from the image sensor.
Specifically, for example, when the output from the image sensor is the four-divided Bayer type RGB array shown in FIG. 1B, this is a process of changing this array to the Bayer array shown in FIG.
For example, the signal processing unit 250 in the image processing unit 120 of the imaging apparatus 100 illustrated in FIG. 2 is generally configured to perform signal processing on the Bayer array image signal illustrated in FIG. Therefore, when the output from the image sensor 110 is a pixel array different from the Bayer array, the signal processor 250 executes the re-mosaic process to change the pixel array to the Bayer array and inputs the processed signal to the signal processor 250. It becomes possible to adopt a configuration of an existing general signal processing unit.

デモザイク処理は、各画素にRGBの全画素値を設定する処理である。すなわち、図2の構成では、カラー画像183に相当する画像を生成することに相当する。   The demosaic process is a process for setting all RGB pixel values for each pixel. In other words, the configuration of FIG. 2 corresponds to generating an image corresponding to the color image 183.

リモザイク処理と、デモザイク処理は、いずれも、ある注目画素位置(補間画素位置)にRGBのいずれかの画素値を設定するために、補間画素位置に対する設定色と同一の色の画素を周囲から参照画素として選択し、選択した参照画素の画素値を適用して注目画素位置の画素値を決定する画素値補間処理を行う。
この補間処理において、画素値勾配(グラジエント)の小さい方向を参照画素の選択方向として設定することで、より自然な補間画素値を算出することが可能となる。
In both re-mosaic processing and demosaic processing, in order to set any pixel value of RGB at a certain target pixel position (interpolation pixel position), refer to pixels of the same color as the set color for the interpolation pixel position from the surroundings The pixel value is selected as a pixel, and the pixel value of the selected reference pixel is applied to determine the pixel value at the target pixel position.
In this interpolation processing, it is possible to calculate a more natural interpolation pixel value by setting a direction in which the pixel value gradient (gradient) is small as the reference pixel selection direction.

図13に示す各フローに従った実施理例は、このようなリモザイク処理や、デモザイク処理における参照画素の方向を決定するための情報として画素値勾配(グラジエント)の方向判定結果を利用する実施例である。   The embodiment according to each flow shown in FIG. 13 is an embodiment in which the direction determination result of the pixel value gradient (gradient) is used as information for determining the direction of the reference pixel in such re-mosaic processing or demosaic processing. It is.

(方向判定処理の変形例3)
図14に方向判定処理の変形例3の処理例を示す。
図14に示す例は、先に、図4を参照して説明した方向判定処理のステップS121〜S123に加え、ステップS131として、4画素加算平均のグラジエント算出処理を追加したものである。
(Modification 3 of direction determination processing)
FIG. 14 shows a processing example of Modification 3 of the direction determination processing.
In the example shown in FIG. 14, in addition to steps S <b> 121 to S <b> 123 of the direction determination process described above with reference to FIG. 4, a 4-pixel addition average gradient calculation process is added as step S <b> 131.

具体的には図15に示すように、RGB同一色の4画素ブロック単位で画素値の加算平均を算出し、この加算平均からグラジエントを算出する。   Specifically, as shown in FIG. 15, an average of pixel values is calculated in units of four pixel blocks of the same RGB color, and a gradient is calculated from the average.

すなわち、図15に示す4画素ブロック単位で4画素の画素値の加算平均値を持つ1つの画素を設定し、総画素数を1/4の画素に設定した画像を適用して、水平、垂直、右上、右下各方向のグラジエントを算出する。
なお、これらのグラジエント算出方法は、先に図7を参照して説明した輝度信号のグラジエント算出処理と同様であり、前述の(式3)において、輝度の代わりに画素値(=4画素の加算平均値)を設定することで算出する。
That is, one pixel having an addition average value of pixel values of four pixels is set in units of four pixel blocks shown in FIG. 15, and an image in which the total number of pixels is set to ¼ pixels is applied to apply horizontal and vertical. The gradient in each of the upper right and lower right directions is calculated.
Note that these gradient calculation methods are the same as the luminance signal gradient calculation processing described above with reference to FIG. 7. In the above-described (Equation 3), pixel values (= addition of 4 pixels) are used instead of luminance. It is calculated by setting (average value).

図14のステップS124では、
ステップS121で算出した高周波テクスチャのグラジェント、
ステップS122で算出した低周波テクスチャのグラジエント、
ステップS123で算出した輝度信号のグラジエント、
ステップS131で算出した4画素加算平均のグラジエント、
これら4つのグラジエント算出結果に対して、重み付き平均値を算出する。
このように、重み付き平均値の算出処理対象とするグラジエントの種類を増加、あるいは減少させた様々な設定が可能である。
In step S124 of FIG.
The high frequency texture gradient calculated in step S121,
The gradient of the low frequency texture calculated in step S122;
The gradient of the luminance signal calculated in step S123;
The gradient of the 4-pixel addition average calculated in step S131,
A weighted average value is calculated for these four gradient calculation results.
In this way, various settings can be made by increasing or decreasing the type of gradient that is the processing target of the weighted average value.

(方向判定処理の変形例4)
上述した処理例では、先に図1(2)を参照して説明した4分割ベイヤ型RGB配列に対する処理例として説明したが、その他の配列、例えば、図1(1)に示すベイヤ配列、図1(3)に示すWRGB配列、あるいは図16に示すような4分割WRGB型配列など、さまざまな配列の画素データに対しても上記の本開示の処理が適用可能である。
(Modification 4 of direction determination processing)
The processing example described above has been described as a processing example for the four-divided Bayer type RGB array described above with reference to FIG. 1 (2), but other arrays, for example, the Bayer array shown in FIG. The above-described processing of the present disclosure can also be applied to pixel data of various arrays such as the WRGB array shown in 1 (3) or the 4-split WRGB type array as shown in FIG.

[6.欠陥検出処理について]
次に、図3のフローのステップS102における欠陥検出処理について説明する。
ステップS102の処理は、注目画素が欠陥画素であるか否かを判定する処理であり、欠陥が含まれる場合は、ステップS103で欠陥補正を行う。
[6. About defect detection processing]
Next, the defect detection process in step S102 of the flow of FIG. 3 will be described.
The process in step S102 is a process for determining whether or not the target pixel is a defective pixel. If a defect is included, defect correction is performed in step S103.

図17に欠陥検出処理の詳細フローを示す。
注目画素501を中心としたN×N画素領域500を入力し、さらに、図3のフローのステップS101において検出した方向情報、すなわち、
を入力する。
FIG. 17 shows a detailed flow of the defect detection process.
An N × N pixel region 500 centered on the target pixel 501 is input, and the direction information detected in step S101 in the flow of FIG.
Enter.

欠陥検出処理では、まず、
ステップS201の水平方向画素補間、
ステップS202の垂直方向画素補間、
ステップS203の右上方向画素補間、
ステップS204の右下方向画素補間、
これらのいずれかの処理を選択的に実行する。
In the defect detection process,
Horizontal pixel interpolation in step S201;
Vertical pixel interpolation in step S202;
Pixel interpolation in the upper right direction in step S203,
Lower right pixel interpolation in step S204,
Any one of these processes is selectively executed.

すなわち、図3のフローのステップS101における方向判定結果として得られたグラジエントの最小となる方向に対応する方向を選択して画素補間を行う。
例えばグラジエントの最小となる方向が水平方向である場合は、ステップS201の水平方向画素補間を実行する。
That is, pixel interpolation is performed by selecting a direction corresponding to the direction with the smallest gradient obtained as the direction determination result in step S101 of the flow of FIG.
For example, when the direction in which the gradient is minimum is the horizontal direction, the horizontal pixel interpolation in step S201 is executed.

画素補間処理の具体例について図18以下を参照して説明する。
図18は、注目画素をR画素とした処理例を示している。
図18には、
水平方向の補間処理例(S201に対応)と、
右下方向の補間処理例(S204に対応)を示している。
A specific example of pixel interpolation processing will be described with reference to FIG.
FIG. 18 shows a processing example in which the target pixel is an R pixel.
In FIG.
An example of horizontal interpolation processing (corresponding to S201),
An example of interpolation processing in the lower right direction (corresponding to S204) is shown.

各方向から同一色の画素を選択してこれらを参照画素とした補間処理を実行する。
ただし、図18に示すように、方向に応じて参照画素の数が変化してしまう。
図18に示す水平方向の補間処理例では、中央の注目画素であるR画素と同一色のR画素が水平方向に注目画素自身も含めて6画素あり、これらの6画素を参照画素として取得可能である。
Interpolation processing is executed by selecting pixels of the same color from each direction and using these as reference pixels.
However, as shown in FIG. 18, the number of reference pixels changes depending on the direction.
In the horizontal direction interpolation processing example shown in FIG. 18, there are 6 R pixels of the same color as the R pixel that is the central target pixel in the horizontal direction, including the target pixel itself, and these 6 pixels can be acquired as reference pixels. It is.

しかし、図18に示す右下方向の補間処理例では、中央の注目画素であるR画素と同一色のR画素が右下方向に注目画素自身も含めて3画素しかなく、これらの3画素のみしか参照画素として利用できない。
このような参照方向によって参照可能な画素数が変化してしまう。特に注目画素が、R画素またはB画素の場合、参照方向に応じた参照画素数の減少が顕著になる。
However, in the example of interpolation processing in the lower right direction shown in FIG. 18, there are only three R pixels having the same color as the R pixel that is the central target pixel, including the target pixel in the lower right direction, and only these three pixels. However, it can only be used as a reference pixel.
The number of pixels that can be referred to varies depending on the reference direction. In particular, when the target pixel is an R pixel or a B pixel, the decrease in the number of reference pixels according to the reference direction becomes significant.

このように、ある参照方向において、予め設定したしきい値未満の参照画素しか得られない場合は、図19に示すように、参照方向に対して垂直方向にある同一色の画素を選択し、この選択画素の画素値に基づいて、参照方向に補間画素値を設定する補間処理を実行する。この補間画素を参照画素に設定して参照画素を増加させた後、これらの参照画素に基づいて、注目画素の画素値設定としての補間処理を実行する。   In this way, when only reference pixels less than a preset threshold value can be obtained in a certain reference direction, as shown in FIG. 19, pixels of the same color that are perpendicular to the reference direction are selected, Based on the pixel value of the selected pixel, an interpolation process for setting an interpolation pixel value in the reference direction is executed. After setting this interpolation pixel as a reference pixel and increasing the number of reference pixels, based on these reference pixels, interpolation processing is performed as a pixel value setting for the pixel of interest.

先に図1(2)を参照して説明した4分割ベイヤ型RGB配列のような、サンプリング間隔が一定でない配列では、方向によって画素数が少ない場合があるので、このような補間によって補って参照画素を増加させる。この処理によって、参照画素数を増加させることが可能となり、より精度の高い補正画素値の算出が可能となる。   In an array in which the sampling interval is not constant, such as the four-divided Bayer RGB array described above with reference to FIG. 1 (2), the number of pixels may be small depending on the direction. Increase pixels. By this processing, it is possible to increase the number of reference pixels, and it is possible to calculate a corrected pixel value with higher accuracy.

このように、参照方向に参照画素が少ない場合は、その参照方向に補間画素を設定することで、全ての方向、RGB全ての色で同じ参照画素の数を設定することが可能となる。
この処理によって、注目画素に対する補正画素値を設定する処理において、より精度の高い補正が可能となるばかりでなく、全方向、全色で同じ処理を行えるので、同じ補正回路で処理が可能となり、装置に備える回路規模を削減することも可能となる。
As described above, when the number of reference pixels is small in the reference direction, it is possible to set the same number of reference pixels in all directions and all colors of RGB by setting interpolation pixels in the reference direction.
With this process, in the process of setting the correction pixel value for the target pixel, not only correction with higher accuracy is possible, but the same process can be performed in all directions and in all colors, so that the same correction circuit can be used. It is also possible to reduce the circuit scale provided in the apparatus.

図19を参照して説明した処理は、参照方向に対して垂直方向にある同一色の画素を選択し、この選択画素の画素値に基づいて、参照方向に補間画素値を設定する補間処理例であった。
参照方向に補間画素値を設定する処理としては、このような、参照方向に対して垂直方向にある画素に限定することなく、補間画素位置の任意の方向にある周囲の同一色画素を適用してもよい。
この処理例について図20、図21を参照して説明する。
The process described with reference to FIG. 19 is an example of an interpolation process in which pixels of the same color that are perpendicular to the reference direction are selected and an interpolation pixel value is set in the reference direction based on the pixel value of the selected pixel. Met.
The process for setting the interpolation pixel value in the reference direction is not limited to the pixel in the direction perpendicular to the reference direction, and the same color pixels around the interpolation pixel position in any direction are applied. May be.
This processing example will be described with reference to FIGS.

図20も図19と同様、右下方向に参照画素を設定する場合の処理例をしめしている。
注目画素501は、中央間R画素であり、右下方向に参照画素としてのR画素を設定する処理例である。
図に示す参照画素補間位置521にR画素を設定する場合の処理について説明する。
なお、図20には、画像の水平方向をX、垂直方向をYとして(x,y)=(1,1)〜(11,11)の画像を示している。
注目画素501は、座標位置(x,y)=(6,6)のR画素である。
参照画素補間位置521は、座標位置(8,8)のB画素の位置である。
FIG. 20 shows an example of processing when a reference pixel is set in the lower right direction, as in FIG.
The target pixel 501 is a center R pixel, and is an example of processing for setting an R pixel as a reference pixel in the lower right direction.
Processing when an R pixel is set at the reference pixel interpolation position 521 shown in the drawing will be described.
FIG. 20 shows images of (x, y) = (1, 1) to (11, 11) where X is the horizontal direction and Y is the vertical direction.
The target pixel 501 is an R pixel at the coordinate position (x, y) = (6, 6).
The reference pixel interpolation position 521 is the position of the B pixel at the coordinate position (8, 8).

この座標位置(8,8)のB画素の位置にR画素を補間する。
本例では、参照方向(本例では右下方向)の垂直方向のみならず、すべての方向から同一色画素を選択する。具体的には、例えば参照画素補間位置521から予め設定した距離内にある予め設定した数の同一色画素を選択する。
図20に示す例は、参照画素補間位置521の周囲にある5つのR画素を補間画素値の算出に適用する画素として選択する処理例を示している。図に示す太線枠で囲まれたR画素である。具体的には以下のR画素である。
(1)座標位置(x,y)=(6,7)のR画素、
(2)座標位置(x,y)=(9,7)のR画素、
(3)座標位置(x,y)=(6,10)のR画素、
(4)座標位置(x,y)=(9,10)のR画素、
(5)座標位置(x,y)=(10,10)のR画素、
これら5つのR画素の画素値の加算平均を算出して参照画素補間位置521のR画素の補間画素値として設定する。
The R pixel is interpolated at the position of the B pixel at the coordinate position (8, 8).
In this example, the same color pixels are selected not only from the vertical direction in the reference direction (in this example, the lower right direction) but also from all directions. Specifically, for example, a preset number of the same color pixels within a preset distance from the reference pixel interpolation position 521 are selected.
The example illustrated in FIG. 20 illustrates a processing example in which five R pixels around the reference pixel interpolation position 521 are selected as pixels to be applied to the interpolation pixel value calculation. This is an R pixel surrounded by a bold frame shown in the figure. Specifically, the following R pixels.
(1) R pixel at coordinate position (x, y) = (6, 7),
(2) R pixel at coordinate position (x, y) = (9, 7),
(3) R pixel at coordinate position (x, y) = (6, 10),
(4) R pixel at coordinate position (x, y) = (9, 10),
(5) R pixel at coordinate position (x, y) = (10, 10),
An average of the pixel values of these five R pixels is calculated and set as the interpolation pixel value of the R pixel at the reference pixel interpolation position 521.

すなわち、参照画素補間位置521のR画素の補間画素値Raは、以下の式に従って算出する。   That is, the interpolation pixel value Ra of the R pixel at the reference pixel interpolation position 521 is calculated according to the following equation.

Figure 2013066157
Figure 2013066157

図21を参照して補間処理に適用する画素数を3とした場合の具体的な補間画素値算出処理例について説明する。
図21に示す例は、参照画素補間位置521の周囲にある3つのR画素を補間画素値算出に適用する画素として選択する処理例を示している。図に示す太線枠で囲まれたR画素である。具体的には以下のR画素である。
(1)座標位置(x,y)=(6,7)のR画素、
(2)座標位置(x,y)=(9,7)のR画素、
(3)座標位置(x,y)=(9,10)のR画素、
これら3つのR画素の画素値の加算平均を算出して参照画素補間位置521のR画素の補間画素値として設定する。
A specific example of the interpolation pixel value calculation process when the number of pixels applied to the interpolation process is 3 will be described with reference to FIG.
The example illustrated in FIG. 21 illustrates a processing example in which three R pixels around the reference pixel interpolation position 521 are selected as pixels to be applied to the interpolation pixel value calculation. This is an R pixel surrounded by a bold frame shown in the figure. Specifically, the following R pixels.
(1) R pixel at coordinate position (x, y) = (6, 7),
(2) R pixel at coordinate position (x, y) = (9, 7),
(3) R pixel at coordinate position (x, y) = (9, 10),
An average of the pixel values of these three R pixels is calculated and set as the interpolation pixel value of the R pixel at the reference pixel interpolation position 521.

すなわち、参照画素補間位置521のR画素の補間画素値Raは、以下の式に従って算出する。   That is, the interpolation pixel value Ra of the R pixel at the reference pixel interpolation position 521 is calculated according to the following equation.

Figure 2013066157
Figure 2013066157

このように、参照方向に参照画素を補間する処理としては、
図19を参照して説明した参照方向に垂直な方向にある注目画素と同一色の画素を適用する処理、
図20〜図21を参照して説明した参照方向の補間画素位置の周囲にある注目画素と同一色の画素を適用する処理、
これらの処理のいずれかが適用可能である。
Thus, as a process of interpolating reference pixels in the reference direction,
A process of applying a pixel of the same color as the target pixel in a direction perpendicular to the reference direction described with reference to FIG.
A process of applying a pixel of the same color as the pixel of interest around the interpolation pixel position in the reference direction described with reference to FIGS.
Any of these processes can be applied.

次に、図17のフローのステップS205のラプラシアン計算処理について、図22を参照して説明する。
図22(a)に示すように、前述した補間処理において抽出した注目画素501を含む同色の5画素を選択する。
Next, the Laplacian calculation process in step S205 of the flow of FIG. 17 will be described with reference to FIG.
As shown in FIG. 22A, five pixels of the same color including the target pixel 501 extracted in the interpolation process described above are selected.

さらに、これらの5画素を用いて、図22(b)に示すように画素位置順に一列に並べ、注目画素501を含む画素の3種類の組み合わせ配列を設定する。すなわち、
(b1)注目画素501を右端に設定した3画素配列、
(b2)注目画素501を中央に設定した3画素配列、
(b3)注目画素501を左端に設定した3画素配列、
これらの3つの配列を設定する。
Further, using these five pixels, as shown in FIG. 22B, they are arranged in a line in the order of pixel positions, and three types of combination arrays of pixels including the pixel of interest 501 are set. That is,
(B1) a three-pixel array in which the target pixel 501 is set to the right end;
(B2) a three-pixel array in which the target pixel 501 is set at the center;
(B3) a three-pixel array in which the target pixel 501 is set at the left end;
Set these three arrays.

これら(b1)〜(b3)の3つの3画素配列の各々に基づいて、L1,L2,L3の3種類のラプラシアンを算出する。すなわち、
(L1)上記(b1)の3画素配列に基づくラプラシアンL1、
(L2)上記(b2)の3画素配列に基づくラプラシアンL2、
(L3)上記(b3)の3画素配列に基づくラプラシアンL3、
これらのラプラシアンを算出する。
Based on each of the three three-pixel arrays (b1) to (b3), three types of Laplacians L1, L2, and L3 are calculated. That is,
(L1) Laplacian L1, based on the three-pixel arrangement of (b1) above,
(L2) Laplacian L2 based on the three-pixel arrangement of (b2) above,
(L3) Laplacian L3 based on the three-pixel arrangement of (b3) above,
These Laplacians are calculated.

なお、ラプラシアンは、以下の(式6)に従って算出する。
すなわち、3画素配列の各画素の画素位置を、左からi−1,i,i+1とし、各画素位置の画素値をGi−1、G、Gi+1としたときのラプラシアンLは以下の(式6)に従って算出する。
=Gi−1+Gi+1−2G
・・・・・(式6)
The Laplacian is calculated according to (Equation 6) below.
That is, the Laplacian L i when the pixel position of each pixel in the three-pixel array is i−1, i, i + 1 from the left and the pixel values at each pixel position are G i−1 , G i , G i + 1 is as follows: (Equation 6)
L i = G i-1 + G i + 1 -2G i
... (Formula 6)

次に、図17のフローのステップS206のラプラシアン比較、欠陥検出処理について、図23を参照して説明する。
図23に示すように、欠陥検出は、ステップS205で算出したラプラシアンの比較によって行う。
Next, the Laplacian comparison and defect detection processing in step S206 of the flow of FIG. 17 will be described with reference to FIG.
As shown in FIG. 23, the defect detection is performed by comparing the Laplacians calculated in step S205.

具体的には、
L1>τ、かつ、
L2>τ、かつ、
L3>τ、
この時、注目画素は欠陥画素であると判定する。
なお、τは予め設定したしきい値である。
In particular,
L1> τ and
L2> τ and
L3> τ,
At this time, it is determined that the target pixel is a defective pixel.
Note that τ is a preset threshold value.

例えば、
図23(a)に示す2つの例は、
L1>τ、かつ、
L2>τ、かつ、
L3>τ、
これらの条件を満たしており、注目画素501が欠陥画素であると判定される例である。
For example,
Two examples shown in FIG.
L1> τ and
L2> τ and
L3> τ,
In this example, these conditions are satisfied and the target pixel 501 is determined to be a defective pixel.

一方、図23(b)に示す2つの例は、
L1>τ、かつ、
L2>τ、かつ、
L3>τ、
これらの条件を満たしておらず、注目画素501が欠陥画素でないと判定される例である。
On the other hand, two examples shown in FIG.
L1> τ and
L2> τ and
L3> τ,
In this example, these conditions are not satisfied and it is determined that the target pixel 501 is not a defective pixel.

[7.欠陥補正処理について]
次に、図3のフローのステップS103における欠陥補正処理について説明する。
図24、図25を参照して補正処理の詳細について説明する。
[7. About defect correction processing]
Next, the defect correction process in step S103 of the flow of FIG. 3 will be described.
Details of the correction processing will be described with reference to FIGS.

図24に示すように、補正処理には、欠陥検出に用いた注目画素501を含む同一色の5画素を適用する。この5画素は、図3のフローのステップS101における方向判定処理において、画素値勾配(グラジエント)の小さい方向に並ぶ5画素である。すなわち、図18〜図22を参照して説明した注目画素と、参照画素を含む5画素である。その一部は、図19を参照して説明した補間処理によって生成した画素である場合もある。   As shown in FIG. 24, five pixels of the same color including the target pixel 501 used for defect detection are applied to the correction process. The five pixels are arranged in the direction in which the pixel value gradient (gradient) is small in the direction determination processing in step S101 of the flow of FIG. That is, there are five pixels including the target pixel described with reference to FIGS. 18 to 22 and the reference pixel. Some of the pixels may be pixels generated by the interpolation processing described with reference to FIG.

図24に示すように注目画素501を含む画素値勾配(グラジエント)の小さい方向に並ぶ5画素を利用して、まず、ステップS301において、参照画素間グラジエントを算出する。
この参照画素間グラジエントは、注目画素501の両サイドの2画素間の画素値勾配(グラジエント)である。
図24に示す、
参照画素511と参照画素512の画素値勾配(グラジエント)g1と、
参照画素513と参照画素514の画素値勾配(グラジエント)g2、
これらを算出する。
As shown in FIG. 24, using the five pixels arranged in the direction of small pixel value gradient (gradient) including the target pixel 501, first, in step S301, a reference inter-pixel gradient is calculated.
This reference inter-pixel gradient is a pixel value gradient (gradient) between two pixels on both sides of the target pixel 501.
As shown in FIG.
A pixel value gradient (gradient) g1 of the reference pixel 511 and the reference pixel 512;
Pixel value gradient (gradient) g2 between the reference pixel 513 and the reference pixel 514,
These are calculated.

さらに、ステップS302において、この参照画素間グラジエントを適用して補正値、すなわち注目画素501の補正画素値を算出する。   Further, in step S302, the correction value, that is, the correction pixel value of the target pixel 501 is calculated by applying the reference inter-pixel gradient.

図25を参照して、ステップS301の参照画素間グラジエント算出処理と、ステップS302の補正画素値算出処理の具体例について説明する。   A specific example of the reference inter-pixel gradient calculation process in step S301 and the corrected pixel value calculation process in step S302 will be described with reference to FIG.

図25(a)に示すように、ステップS301における参照画素間グラジエント算出処理は、それぞれ、注目画素を挟む両サイド各々の2つの参照画素間の画素値勾配(グラジエント)でを算出する処理である。   As shown in FIG. 25A, the reference pixel gradient calculation process in step S301 is a process of calculating a pixel value gradient (gradient) between two reference pixels on both sides sandwiching the target pixel. .

図25(a)に示す例はR画素の処理例を示している。R1〜R5は各画素の画素値である。
ステップS301における参照画素間グラジエント算出処理は、以下の式によって算出する。
g1=|R1−R2|
g2=|R4−R5|
ステップS301では、これらの2つの参照画素間グラジエントを算出する。
The example shown in FIG. 25A shows an example of R pixel processing. R1 to R5 are pixel values of each pixel.
The reference pixel gradient calculation process in step S301 is calculated by the following equation.
g1 = | R1-R2 |
g2 = | R4-R5 |
In step S301, the gradient between these two reference pixels is calculated.

次に、ステップS302の処理、すなわち補正画素値算出処理について、図25(b)を参照して説明する。
補正画素値をR3'とする。
補正画素値R3'は、以下の式に従って算出する。
g1≦g2のとき、
R3'=α×R1+(1−α)×R2
g1>g2のとき、
R3'=β×R4+(1−β)×R5
ただし、α、βは、0以上1以下の予め設定したパラメータである。
Next, the process of step S302, that is, the corrected pixel value calculation process will be described with reference to FIG.
Let the correction pixel value be R3 ′.
The corrected pixel value R3 ′ is calculated according to the following formula.
When g1 ≦ g2,
R3 ′ = α × R1 + (1−α) × R2
When g1> g2,
R3 ′ = β × R4 + (1-β) × R5
However, α and β are preset parameters of 0 or more and 1 or less.

これらの処理によって、欠陥画素として判定された注目画素501の補正画素値を算出し、この補正画素値を注目画素の画素値として設定する。
これらの処理は、例えば図2に示す撮像装置100の画像処理部120内の画像信号補正部200において実行される。
補正画素値の設定された補正画像は、信号処理部250に出力され、信号処理部250において、既存のカメラにおける信号処理部と同様の処理、例えばWB(ホワイトバランス)調整、各画素にRGB各画素値を設定するデモザイク処理等が実行されカラー画像183を生成して出力する。
Through these processes, the corrected pixel value of the target pixel 501 determined as a defective pixel is calculated, and this corrected pixel value is set as the pixel value of the target pixel.
These processes are executed, for example, in the image signal correction unit 200 in the image processing unit 120 of the imaging apparatus 100 shown in FIG.
The corrected image in which the correction pixel value is set is output to the signal processing unit 250. In the signal processing unit 250, the same processing as the signal processing unit in the existing camera, for example, WB (white balance) adjustment, RGB for each pixel A demosaic process or the like for setting pixel values is executed to generate and output a color image 183.

上述したように、本開示の処理では、処理対象画素である注目画素を含む画素値勾配(グラジエント)の小さい方向に並ぶ複数の画素を利用して、注目画素が欠陥画素であるか否かの判定を行う際に、その方向上にある同色画素を補間によって補い、予め既定した数以上の参照画素を設定する。
さらに、欠陥画素であると判定された注目画素に対する補正処理に際しても、必要に応じて実行された補間処理によって設定された規定数以上の参照画素の画素値を利用した補正処理を実行する。
As described above, in the processing of the present disclosure, whether or not the target pixel is a defective pixel is determined by using a plurality of pixels arranged in a direction with a small pixel value gradient (gradient) including the target pixel that is the processing target pixel. When the determination is made, the same color pixels in the direction are supplemented by interpolation, and a reference pixel of a predetermined number or more is set.
Furthermore, also in the correction process with respect to the target pixel determined to be a defective pixel, the correction process using the pixel values of the reference pixels exceeding the specified number set by the interpolation process executed as necessary is executed.

このように、本開示の処理では、参照画素の画素数を所定の数以上に設定した処理を実行することで、検出・補正精度を向上させている。また、全ての方向、RGB全ての色で同じ画素数が用意できるので、全方向、全色で同じアルゴリズムに従った処理を実行することが可能となり、同一の処理回路を利用した処理が可能となり、回路規模削減も可能となる。また、画素配列に起因した補正の優劣、すなわち、補正の得意な方向や不得意な方向の差を低減することができる。特にサンプリング間隔の広い画素で効果を発揮する。   Thus, in the processing of the present disclosure, detection / correction accuracy is improved by executing processing in which the number of reference pixels is set to a predetermined number or more. In addition, since the same number of pixels can be prepared in all directions and all colors of RGB, it is possible to execute processing according to the same algorithm in all directions and all colors, and processing using the same processing circuit is possible. Also, the circuit scale can be reduced. In addition, it is possible to reduce the superiority or inferiority of correction caused by the pixel arrangement, that is, the difference between the direction in which the correction is good and the direction in which the correction is not good. This is particularly effective for pixels with a wide sampling interval.

[8.欠陥補正処理の変形列について]
上述した処理例では、先に図1(2)を参照して説明した4分割ベイヤ型RGB配列に対する処理例として説明したが、上述した欠陥の検出、補正処理についても、先の方向判定処理と同様、その他の配列、例えば、図1(1)に示すベイヤ配列、図1(3)に示すWRGB配列、あるいは図26に示すような4分割WRGB型配列など、さまざまな配列の画素データに対しても上記の本開示の処理が適用可能である。
[8. Deformation sequence of defect correction processing]
In the above-described processing example, the processing example for the four-divided Bayer RGB array described above with reference to FIG. 1B has been described. However, the above-described defect detection and correction processing also includes the above-described direction determination processing. Similarly, for other types of pixel data such as a Bayer array shown in FIG. 1 (1), a WRGB array shown in FIG. 1 (3), or a 4-split WRGB type array shown in FIG. However, the processing of the present disclosure can be applied.

また。上述の実施例では、欠陥検出処理に際して画素補間を行う処理例として説明したが、欠陥検出時には画素補間を実行せず、補正処理に際して画素補間を行う構成としてもよい。また、方向判定の際に画素補間を行う構成としてもよい。   Also. In the above-described embodiment, a process example in which pixel interpolation is performed in the defect detection process is described. However, pixel interpolation may be performed in the correction process without performing pixel interpolation in the defect detection. Moreover, it is good also as a structure which performs pixel interpolation in the case of direction determination.

[9.ハイライト誤補正判定を伴う処理例について]
次に、ハイライト誤補正判定を伴う処理例について図27以下を参照して説明する。
例えば星空等を撮影すると、星は暗闇の中に明るい点として撮影される。カメラによる撮影画像では、低輝度画素の中に点々と高輝度画素が設定される状態となり、このような高輝度画素を欠陥画素であると判定してしまう場合がある。欠陥画素として認定されると、本来の星を示す画素が周囲の画素と同様の画素値、すなわち低輝度画素に補正されてしまう。このような誤補正はハイライト誤補正と呼ばれる。
[9. Example of processing with highlight correction correction]
Next, an example of processing accompanied with highlight error correction determination will be described with reference to FIG.
For example, when photographing a starry sky, the star is photographed as a bright spot in the dark. In a photographed image by a camera, high brightness pixels are set in a low brightness pixel, and it may be determined that such a high brightness pixel is a defective pixel. If the pixel is recognized as a defective pixel, the pixel indicating the original star is corrected to the same pixel value as that of the surrounding pixels, that is, a low luminance pixel. Such erroneous correction is called highlight erroneous correction.

以下、欠陥画素の補正として実行された補正がハイライト誤補正でないかについて検証し、ハイライト誤補正であると判定した場合には、補正前の画素値を出力する実施例について説明する。   Hereinafter, a description will be given of an embodiment in which it is verified whether the correction executed as the correction of the defective pixel is a highlight error correction, and when it is determined that the correction is a highlight error correction, a pixel value before correction is output.

図27に本実施例の処理シーケンスを説明するフローチャートを示す。
図27に示すフローに従った処理は、図2の画像処理部120の画像信号補正部200において実行する処理である。
まずステップS401において撮像素子110から入力した撮像画像から処理対象画素(注目画素)を1つ選択し、注目画素近傍の画素領域(例えばN×N画素)を参照して画素値勾配(グラジエント(Gradient))の方向判定を行う。
入力画像は、例えば図27に示す画像600であり、注目画素601を中心としたN×Nの画像である。
FIG. 27 shows a flowchart for explaining the processing sequence of this embodiment.
The process according to the flow shown in FIG. 27 is a process executed in the image signal correction unit 200 of the image processing unit 120 in FIG.
First, in step S401, one pixel to be processed (target pixel) is selected from the captured image input from the image sensor 110, and a pixel value gradient (gradient) is selected with reference to a pixel region (for example, N × N pixels) in the vicinity of the target pixel. )) Direction determination.
The input image is an image 600 shown in FIG. 27, for example, and is an N × N image centered on the pixel of interest 601.

ステップS401の方向判定処理は、先に説明した図3のフローのステップS101の方向判定処理と同様の処理である。すなわち、画素値勾配(グラジエント(Gradient))が最小となる方向を方向判定結果として生成する。
画素値勾配(グラジエント(Gradient))が最小となる方向とは、エッジ方向に相当し、画素値の変化の少ない方向である。一方、エッジ方向に垂直な方向は、画素値勾配(グラジエント(Gradient))が大きくなり、画素値の変化が大きい方向である。
The direction determination process in step S401 is the same process as the direction determination process in step S101 of the flow illustrated in FIG. 3 described above. That is, the direction in which the pixel value gradient (gradient) is minimized is generated as the direction determination result.
The direction in which the pixel value gradient (gradient) is the minimum corresponds to the edge direction and is the direction in which the pixel value does not change much. On the other hand, the direction perpendicular to the edge direction is a direction in which the pixel value gradient (gradient) increases and the change in pixel value is large.

なお、例えば注目画素に対する処理を行う場合、図27に示すように、注目画素601を中心としたN×N画素の画素領域600を参照して処理を行う。図27に示す例は、N=11とした例である。   For example, when performing processing on the target pixel, as illustrated in FIG. 27, the processing is performed with reference to a pixel region 600 of N × N pixels centered on the target pixel 601. The example shown in FIG. 27 is an example in which N = 11.

次に、ステップS402において、注目画素が欠陥画素であるか否かを判定する欠陥検出処理を実行する。
このステップS402の欠陥検出処理は、先に説明した図3のフローのステップS102の欠陥検出処理と同様の処理である。すなわち、先に図17〜図23を参照して説明したラプラシアンの算出による欠陥検出を実行する。
Next, in step S402, a defect detection process for determining whether the target pixel is a defective pixel is executed.
The defect detection process in step S402 is the same process as the defect detection process in step S102 in the flow of FIG. 3 described above. That is, the defect detection by the Laplacian calculation described above with reference to FIGS. 17 to 23 is executed.

次のステップS403は、注目画素が欠陥画素であるか否かの結果に応じた分木ステップである。
欠陥画素でないと判定した場合は、補正処理を実行することなく、ステップS407に進み、補正前の原画素値を出力する。
一方、欠陥画素であると判定した場合は、ステップS404に進み、補正処理を実行する。
The next step S403 is a tree step according to the result of whether or not the target pixel is a defective pixel.
If it is determined that the pixel is not defective, the process proceeds to step S407 without executing the correction process, and the original pixel value before correction is output.
On the other hand, if it is determined that the pixel is a defective pixel, the process proceeds to step S404, and correction processing is executed.

ステップS404の補正処理は、先に説明した図3のフローのステップS103の欠陥検出処理と同様の処理である。すなわち、先に図24〜図25を参照して説明した画素値補正処理を実行する。   The correction process in step S404 is the same process as the defect detection process in step S103 in the flow of FIG. 3 described above. That is, the pixel value correction process described above with reference to FIGS. 24 to 25 is executed.

次に、ステップS405に進み、ステップS404で実行した補正処理がハイライト誤補正でないかの判定処理を行う。
ステップS405〜S408では、テップS404で実行した補正処理がハイライト誤補正でないかの判定結果に応じて以下のように注目画素の出力画素値を決定して出力する。
Next, the process proceeds to step S405, and a determination process is performed to determine whether the correction process executed in step S404 is a highlight error correction.
In steps S405 to S408, the output pixel value of the target pixel is determined and output as follows according to the determination result as to whether the correction process executed in step S404 is a highlight error correction.

すなわち、
ステップS404で実行した補正処理がハイライト誤補正でないと判定した場合は、ステップS408に進み、補正画素値を出力する。
ステップS404で実行した補正処理がハイライト誤補正であると判定した場合は、ステップS407に進み、補正前の原画素値を出力する。
このハイライト誤補正判定処理と出力画素値の決定処理の詳細について、図28〜図30を参照して説明する。
That is,
If it is determined that the correction process executed in step S404 is not highlight error correction, the process proceeds to step S408, and a corrected pixel value is output.
When it is determined that the correction process executed in step S404 is highlight highlight correction, the process proceeds to step S407, and the original pixel value before correction is output.
Details of this highlight error correction determination processing and output pixel value determination processing will be described with reference to FIGS.

図28は、ハイライト誤補正判定処理と出力画素決定処理の詳細処理を説明する図である。
ハイライト誤補正判定処理においては、
処理対象となる注目画素の補正画素値611と、
処理対象となる注目画素の補正前の原画素値612と、
処理対象となる注目画素の近傍領域(例えば注目画素を中心とするN×N画素領域)情報613、
これらを入力する。
FIG. 28 is a diagram for explaining detailed processing of highlight erroneous correction determination processing and output pixel determination processing.
In the highlight error correction determination process,
A corrected pixel value 611 of a target pixel to be processed;
An original pixel value 612 before correction of a target pixel to be processed;
A neighboring region (for example, an N × N pixel region centered on the target pixel) information 613 of the target pixel to be processed;
Enter these.

まず、ステップS501において、注目画素の近傍領域情報613に対するホワイトバランス算出を実行する。
この処理について図29を参照して説明する。
First, in step S501, white balance calculation is performed on the neighboring area information 613 of the target pixel.
This process will be described with reference to FIG.

図29には注目画素601を中心として近傍領域情報としてのN×N画素の画素領域600を示している。
この画素領域600のホワイトバランスを算出する。
ホワイトバランスは、近傍がぞ領域600におけるR,G,B各々の画素値平均:aveR,aveG,aveBを算出し、これら平均値の比として算出する。
具体的には、以下の式に従ってホワイトバランスを算出する。
FIG. 29 shows a pixel region 600 of N × N pixels as neighboring region information centered on the pixel of interest 601.
The white balance of the pixel area 600 is calculated.
The white balance is calculated as a ratio of these average values by calculating an average pixel value: aveR, aveG, and aveB for each of R, G, and B in the vicinity of the region 600.
Specifically, the white balance is calculated according to the following formula.

Figure 2013066157
Figure 2013066157

図28のステップS501では、上記式に従って、注目画素の近傍領域におけるホワイトバランスを算出する。
次に、ステップS502において、異色画素平均値を算出する。異色画素平均値とは、ハイライト誤補正判定対象としての注目画素の色と異なる色の平均値である。
異色画素平均値:Pは図30に示すように、例えば以下の式に従って算出する。
In step S501 in FIG. 28, the white balance in the vicinity region of the target pixel is calculated according to the above formula.
Next, in step S502, a different color pixel average value is calculated. The different color pixel average value is an average value of colors different from the color of the target pixel as the highlight error correction determination target.
As shown in FIG. 30, the different color pixel average value P is calculated according to the following equation, for example.

Figure 2013066157
Figure 2013066157

上記式は、注目画素がG画素の場合の異色画素平均値Pの算出例である。図30に示すように注目画素601の周囲の8画素から、異色画素B1,B2とR1,R2を選択して、これらと、先に算出したホワイトバランス値(aveG/aveR)、(aveG/aveB)を適用して異色画素平均値Pを算出する。   The above formula is an example of calculating the different color pixel average value P when the target pixel is a G pixel. As shown in FIG. 30, different color pixels B1, B2 and R1, R2 are selected from the eight pixels around the target pixel 601, and these are calculated with the previously calculated white balance values (aveG / aveR) and (aveG / aveB). ) To calculate the different color pixel average value P.

なお、上記式は、注目画素がG画素の場合の算出例であるが、その他のB,R画素の場合には、それぞれ注目画素の周囲から、注目画素の異なる色の画素を選択してそそれぞれの画素値を各色単位で加算して、ホワイトバランス調整を行って異色画素平均値Pを算出する。   The above formula is an example of calculation when the target pixel is a G pixel. However, in the case of other B and R pixels, a pixel of a different color from the target pixel is selected from around the target pixel. The respective pixel values are added for each color unit, white balance adjustment is performed, and the different color pixel average value P is calculated.

次に、ステップS503において、図27のステップS404で実行した欠陥補正が、ハイライト誤補正でないかを判定し、判定結果に応じて出力画素を補正画素値とするか原画素値とするかを決定する。
この出力画素選択理は、図30に示すように、以下の式に従って実行する。
Next, in step S503, it is determined whether the defect correction executed in step S404 in FIG. 27 is a highlight error correction, and whether the output pixel is set as a correction pixel value or an original pixel value according to the determination result. decide.
This output pixel selection method is executed according to the following equation, as shown in FIG.

Figure 2013066157
Figure 2013066157

上記式において、
Gorg:注目画素の原画素値、
Gcor:注目画素の補正画素値、
P:移植画素平均値、
である。
In the above formula,
Gorg: Original pixel value of the target pixel,
Gcor: correction pixel value of the target pixel,
P: transplanted pixel average value,
It is.

すなわち、補正前と補正後で異色画素平均値Pに近い方を出力する。
補正後の補正画素値と異色画素平均値Pとの差分が、補正前の原画素値と異色画素平均値Pとの差分以上になっている場合は、ハイライト誤補正であると判定し、原画素値を出力する処理を行う。
補正後の補正画素値と異色画素平均値Pとの差分が、補正前の原画素値と異色画素平均値Pとの差分未満である場合は、ハイライト誤補正ではない正しい補正が行われたと判定し、補正画素値を出力する処理を行う。
That is, the one closer to the different color pixel average value P before and after correction is output.
If the difference between the corrected pixel value after correction and the different color pixel average value P is greater than or equal to the difference between the original pixel value before correction and the different color pixel average value P, it is determined that the highlight is erroneously corrected. A process of outputting the original pixel value is performed.
When the difference between the corrected pixel value after correction and the different color pixel average value P is less than the difference between the original pixel value before correction and the different color pixel average value P, correct correction that is not highlight error correction has been performed. A process of determining and outputting a corrected pixel value is performed.

図27のフローのステップS405〜S408の処理は、図28〜図30を参照して説明した処理として実行される。
この処理によって、ハイライト誤補正がなされた場合に、元の画素値に戻して出力することが可能となる。
The process of steps S405 to S408 in the flow of FIG. 27 is executed as the process described with reference to FIGS.
With this process, when highlight error correction is performed, the original pixel value can be restored and output.

[10.本開示の構成のまとめ]
以上、特定の実施例を参照しながら、本開示の実施例について詳解してきた。しかしながら、本開示の要旨を逸脱しない範囲で当業者が実施例の修正や代用を成し得ることは自明である。すなわち、例示という形態で本発明を開示してきたのであり、限定的に解釈されるべきではない。本開示の要旨を判断するためには、特許請求の範囲の欄を参酌すべきである。
[10. Summary of composition of the present disclosure]
As described above, the embodiments of the present disclosure have been described in detail with reference to specific embodiments. However, it is obvious that those skilled in the art can make modifications and substitutions of the embodiments without departing from the gist of the present disclosure. In other words, the present invention has been disclosed in the form of exemplification, and should not be interpreted in a limited manner. In order to determine the gist of the present disclosure, the claims should be taken into consideration.

なお、本明細書において開示した技術は、以下のような構成をとることができる。
(1) 画像の補正処理を実行する画像信号補正部を有し、
前記画像信号補正部は、
注目画素を含む画素領域における画素値勾配方向として、最小の画素値勾配を有する方向を検出する方向判定処理と、
前記注目画素に対して、前記方向判定処理において検出した最小勾配方向の参照画素の画素値に基づくラプラシアンを算出して、注目画素の欠陥の有無を判定する欠陥検出処理と、
前記欠陥検出処理において欠陥の検出された注目画素に対して、前記方向判定処理において検出した方向にある参照画素の画素値を適用した補正画素値の算出を実行する欠陥補正処理を実行し、
前記方向判定処理は、複数の異なる勾配検出処理によって算出した複数の勾配情報の重み付き加算結果を適用して実行する画像処理装置。
The technology disclosed in this specification can take the following configurations.
(1) having an image signal correction unit for executing image correction processing;
The image signal correction unit
A direction determination process for detecting a direction having a minimum pixel value gradient as a pixel value gradient direction in a pixel region including the target pixel;
A defect detection process for calculating the Laplacian based on the pixel value of the reference pixel in the minimum gradient direction detected in the direction determination process for the target pixel, and determining the presence or absence of a defect in the target pixel;
Executing a defect correction process for calculating a correction pixel value by applying a pixel value of a reference pixel in a direction detected in the direction determination process to a target pixel in which a defect is detected in the defect detection process;
The image processing apparatus that executes the direction determination process by applying a weighted addition result of a plurality of pieces of gradient information calculated by a plurality of different gradient detection processes.

(2)前記画像信号補正部は、前記方向判定処理において、高周波テクスチャ対応の画素値勾配情報と、低周波テクスチャ対応の画素値勾配情報と、輝度信号対応の画素値勾配情報と、を算出し、これらの3種類の勾配情報の重み付き加算結果に基づいて、最小の画素値勾配を有する方向を検出する前記(1)に記載の画像処理装置。
(3)前記画像信号補正部は、前記高周波テクスチャ対応の画素値勾配情報を、隣接画素の画素値差分を適用して算出し、前記低周波テクスチャ対応の画素値勾配情報を、非隣接画素の画素値差分を適用して算出する前記(2)に記載の画像処理装置。
(4)前記画像信号補正部は、RGB各画素を含む画素領域単位でRGB各画素の画素値に基づいて輝度信号を算出し、算出した領域単位の輝度信号を適用して前記輝度信号対応の画素値勾配情報を算出する前記(2)または(3)に記載の画像処理装置。
(2) In the direction determination process, the image signal correction unit calculates pixel value gradient information corresponding to a high frequency texture, pixel value gradient information corresponding to a low frequency texture, and pixel value gradient information corresponding to a luminance signal. The image processing apparatus according to (1), wherein a direction having a minimum pixel value gradient is detected based on a weighted addition result of these three types of gradient information.
(3) The image signal correction unit calculates the pixel value gradient information corresponding to the high frequency texture by applying the pixel value difference of the adjacent pixel, and calculates the pixel value gradient information corresponding to the low frequency texture to the non-adjacent pixel. The image processing apparatus according to (2), wherein calculation is performed by applying a pixel value difference.
(4) The image signal correcting unit calculates a luminance signal based on a pixel value of each RGB pixel in a pixel region unit including each RGB pixel, and applies the calculated luminance signal in each region unit to correspond to the luminance signal. The image processing apparatus according to (2) or (3), wherein pixel value gradient information is calculated.

(5)前記画像信号補正部は、前記3種類の勾配情報の重み付き加算処理において設定する重みを出力画像の解像度に応じて変更する処理を実行し、出力画像が高解像度の場合は、高周波テクスチャ対応の画素値勾配情報に対する重みを他の勾配情報に優先して高く設定し、出力画像が低解像度の場合は、低周波テクスチャ対応の画素値勾配情報に対する重みを他の勾配情報に優先して高く設定する前記(1)〜(4)いずれかに記載の画像処理装置。
(6)前記画像信号補正部は、前記3種類の勾配情報の重み付き加算処理において設定する重みを処理対象画像である入力画像の周波数帯に応じて変更する処理を実行し、入力画像が高周波数領域を多く含む場合は、高周波テクスチャ対応の画素値勾配情報に対する重みを他の勾配情報に優先して高く設定し、入力画像が低周波数領域を多く含む場合は、低周波テクスチャ対応の画素値勾配情報に対する重みを他の勾配情報に優先して高く設定する前記(1)〜(5)いずれかに記載の画像処理装置。
(5) The image signal correction unit executes a process of changing a weight set in the weighted addition process of the three types of gradient information according to the resolution of the output image. Set the weight for pixel value gradient information corresponding to texture higher than other gradient information, and if the output image has a low resolution, prioritize the weight for pixel value gradient information corresponding to low frequency texture over other gradient information. The image processing apparatus according to any one of (1) to (4), wherein the image processing apparatus is set to be high.
(6) The image signal correction unit executes a process of changing the weight set in the weighted addition process of the three types of gradient information according to the frequency band of the input image that is the processing target image, and the input image is high If there are many frequency regions, set a higher weight for pixel value gradient information corresponding to high-frequency textures in preference to other gradient information, and if the input image contains many low-frequency regions, pixel values corresponding to low-frequency textures The image processing apparatus according to any one of (1) to (5), wherein a weight for gradient information is set higher than other gradient information.

(7)前記画像信号補正部は、RGB各色が2×2の4画素単位で配列された画像、またはRGBW各色が2×2の4画素単位で配列された画像の画素値補正を実行する前記(1)〜(6)いずれかに記載の画像処理装置。
(8)前記画像信号補正部は、前記欠陥検出処理において、欠陥検出対象となる注目画素と同一色の画素を参照画素として前記最小勾配方向から選択し、注目画素と選択画素の異なる組み合わせに基づいて算出した複数のラプラシアンと予め既定した閾値との比較を実行して比較結果に基づいて前記注目画素が欠陥画素であるか否かの判定を行う前記(1)〜(7)いずれかに記載の画像処理装置。
(7) The image signal correction unit executes pixel value correction of an image in which RGB colors are arranged in units of 2 × 2 pixels or an image in which RGBW colors are arranged in units of 2 pixels of 2 × 2. The image processing apparatus according to any one of (1) to (6).
(8) In the defect detection processing, the image signal correction unit selects, from the minimum gradient direction, a pixel having the same color as the target pixel as a defect detection target as a reference pixel, and based on different combinations of the target pixel and the selected pixel. A comparison between a plurality of Laplacians calculated in advance and a predetermined threshold value is performed, and it is determined whether the target pixel is a defective pixel based on a comparison result. Image processing apparatus.

(9)前記画像信号補正部は、欠陥検出対象となる注目画素と同一色の画素を参照画素として前記最小勾配方向から4画素選択し、注目画素と2つの選択画素の異なる組み合わせに基づいて算出した3つのラプラシアンと予め既定した閾値との比較を実行し、3つのラプラシアンの全てが前記しきい値より大きい場合に前記注目画素が欠陥画素であると判定する前記(8)に記載の画像処理装置。
(10)前記画像信号補正部は、前記欠陥検出処理において、欠陥検出対象となる注目画素と同一色の画素が、既定の参照領域内において前記最小勾配方向から4つ選択できない場合、前記最小勾配方向にある注目画素と異なる色の異色画素位置に、該異色画素位置の周囲の注目画素と同一色画素の画素値に基づく画素補間を実行し、該画素補間によって生成した補間画素を参照画素として設定する前記(8)または(9)に記載の画像処理装置。
(9) The image signal correction unit selects four pixels from the minimum gradient direction using a pixel having the same color as the target pixel as a defect detection target as a reference pixel, and calculates based on different combinations of the target pixel and the two selected pixels. The image processing according to (8), wherein the comparison is performed between the three Laplacians and a predetermined threshold value, and the target pixel is determined to be a defective pixel when all three Laplacians are greater than the threshold value. apparatus.
(10) In the defect detection process, the image signal correcting unit may select the minimum gradient when four pixels having the same color as the target pixel as a defect detection target cannot be selected from the minimum gradient direction within a predetermined reference area. Pixel interpolation based on the pixel value of the same color pixel as the target pixel around the different color pixel position is executed at the different color pixel position of the color different from the target pixel in the direction, and the interpolation pixel generated by the pixel interpolation is used as a reference pixel The image processing device according to (8) or (9) to be set.

(11)前記画像信号補正部は、前記欠陥補正処理において、前記参照画素の画素値の重み付き加算により前記注目画素の補正画素値を算出する前記(8)〜(10)いずれかに記載の画像処理装置。
(12)前記画像信号補正部は、前記欠陥補正処理において、前記注目画素を中心とした両側各々にある2つの参照画素間の画素値勾配を算出し、画素値勾配の小さい方向の2画素の画素値の重み付き加算によって前記注目画素の補正画素値を算出する前記(8)〜(11)いずれかに記載の画像処理装置。
(13)前記画像信号補正部は、前記欠陥補正処理において実行した補正処理がハイライト誤補正であるか否かを判定するハイライト誤補正判定処理を実行し、ハイライト誤補正であると判定した場合は、補正前の原画素値を出力し、ハイライト誤補正でないと判定した場合は、補正画素値を出力する前記(1)〜(12)いずれかに記載の画像処理装置。
(11) The image signal correction unit according to any one of (8) to (10), wherein the image signal correction unit calculates a correction pixel value of the pixel of interest by weighted addition of pixel values of the reference pixel in the defect correction processing. Image processing device.
(12) In the defect correction process, the image signal correction unit calculates a pixel value gradient between two reference pixels on both sides centered on the target pixel, and calculates two pixel values in a direction in which the pixel value gradient is small. The image processing apparatus according to any one of (8) to (11), wherein a corrected pixel value of the target pixel is calculated by weighted addition of pixel values.
(13) The image signal correction unit performs a highlight error correction determination process for determining whether or not the correction process executed in the defect correction process is a highlight error correction, and determines that it is a highlight error correction. In such a case, the original pixel value before correction is output, and when it is determined that the highlight correction is not erroneous, the corrected pixel value is output, according to any one of (1) to (12).

さらに、上記した装置およびシステムにおいて実行する処理の方法や、処理を実行させるプログラムおよびプログラムを記録した記録媒体も本開示の構成に含まれる。   Furthermore, a configuration of the present disclosure includes a method of processing executed in the above-described apparatus and system, a program for executing the processing, and a recording medium on which the program is recorded.

また、明細書中において説明した一連の処理はハードウェア、またはソフトウェア、あるいは両者の複合構成によって実行することが可能である。ソフトウェアによる処理を実行する場合は、処理シーケンスを記録したプログラムを、専用のハードウェアに組み込まれたコンピュータ内のメモリにインストールして実行させるか、あるいは、各種処理が実行可能な汎用コンピュータにプログラムをインストールして実行させることが可能である。例えば、プログラムは記録媒体に予め記録しておくことができる。記録媒体からコンピュータにインストールする他、LAN(Local Area Network)、インターネットといったネットワークを介してプログラムを受信し、内蔵するハードディスク等の記録媒体にインストールすることができる。   The series of processing described in the specification can be executed by hardware, software, or a combined configuration of both. When executing processing by software, the program recording the processing sequence is installed in a memory in a computer incorporated in dedicated hardware and executed, or the program is executed on a general-purpose computer capable of executing various processing. It can be installed and run. For example, the program can be recorded in advance on a recording medium. In addition to being installed on a computer from a recording medium, the program can be received via a network such as a LAN (Local Area Network) or the Internet, and installed on a recording medium such as a built-in hard disk.

なお、明細書に記載された各種の処理は、記載に従って時系列に実行されるのみならず、処理を実行する装置の処理能力あるいは必要に応じて並列的にあるいは個別に実行されてもよい。また、本明細書においてシステムとは、複数の装置の論理的集合構成であり、各構成の装置が同一筐体内にあるものには限らない。   Note that the various processes described in the specification are not only executed in time series according to the description, but may be executed in parallel or individually according to the processing capability of the apparatus that executes the processes or as necessary. Further, in this specification, the system is a logical set configuration of a plurality of devices, and the devices of each configuration are not limited to being in the same casing.

以上、説明したように、本開示の一実施例の構成によれば、様々な設定の画素配列を持つ画像に対して、高精度な欠陥検出および補正を実現可能とした装置、方法を提供する。
具体的には、注目画素を含む画素領域に対して複数の異なる手法を適用して複数の勾配検出情報を取得する。さらに、複数の勾配検出情報の重み付き加算に基づいて最小勾配方向を検出する。さらに、検出した最小勾配方向にある注目画素と同一色の参照画素の画素値に基づくラプラシアンを算出して、注目画素の欠陥の有無を判定する。さらに、欠陥の検出された注目画素に対して、方向判定処理において検出した方向にある参照画素の画素値を適用して補正画素値を算出する。
本処理により、様々な設定の画素配列を持つ画像に対して、高精度な欠陥検出および補正を実現可能とした装置、方法が実現される。
As described above, according to the configuration of an embodiment of the present disclosure, it is possible to provide an apparatus and a method capable of realizing highly accurate defect detection and correction for an image having a pixel array with various settings. .
Specifically, a plurality of gradient detection information is acquired by applying a plurality of different methods to the pixel region including the target pixel. Further, the minimum gradient direction is detected based on the weighted addition of a plurality of gradient detection information. Further, a Laplacian is calculated based on the pixel value of the reference pixel of the same color as the target pixel in the detected minimum gradient direction, and the presence / absence of a defect in the target pixel is determined. Further, the correction pixel value is calculated by applying the pixel value of the reference pixel in the direction detected in the direction determination process to the target pixel in which the defect is detected.
By this processing, an apparatus and a method capable of realizing highly accurate defect detection and correction for an image having a pixel array with various settings are realized.

100 撮像装置
105 光学レンズ
110 撮像素子(イメージセンサ)
120 画像処理部
130 メモリ
140 制御部
181 4分割ベイヤ型RGB配列
183 カラー画像
200 画像信号補正部
250 信号処理部
DESCRIPTION OF SYMBOLS 100 Imaging device 105 Optical lens 110 Imaging element (image sensor)
DESCRIPTION OF SYMBOLS 120 Image processing part 130 Memory 140 Control part 181 4 division | segmentation Bayer type RGB arrangement | sequence 183 Color image 200 Image signal correction | amendment part 250 Signal processing part

Claims (15)

画像の補正処理を実行する画像信号補正部を有し、
前記画像信号補正部は、
注目画素を含む画素領域における画素値勾配方向として、最小の画素値勾配を有する方向を検出する方向判定処理と、
前記注目画素に対して、前記方向判定処理において検出した最小勾配方向の参照画素の画素値に基づくラプラシアンを算出して、注目画素の欠陥の有無を判定する欠陥検出処理と、
前記欠陥検出処理において欠陥の検出された注目画素に対して、前記方向判定処理において検出した方向にある参照画素の画素値を適用した補正画素値の算出を実行する欠陥補正処理を実行し、
前記方向判定処理は、複数の異なる勾配検出処理によって算出した複数の勾配情報の重み付き加算結果を適用して実行する画像処理装置。
An image signal correction unit that executes image correction processing;
The image signal correction unit
A direction determination process for detecting a direction having a minimum pixel value gradient as a pixel value gradient direction in a pixel region including the target pixel;
A defect detection process for calculating the Laplacian based on the pixel value of the reference pixel in the minimum gradient direction detected in the direction determination process for the target pixel, and determining the presence or absence of a defect in the target pixel;
Executing a defect correction process for calculating a correction pixel value by applying a pixel value of a reference pixel in a direction detected in the direction determination process to a target pixel in which a defect is detected in the defect detection process;
The image processing apparatus that executes the direction determination process by applying a weighted addition result of a plurality of pieces of gradient information calculated by a plurality of different gradient detection processes.
前記画像信号補正部は、
前記方向判定処理において、
高周波テクスチャ対応の画素値勾配情報と、
低周波テクスチャ対応の画素値勾配情報と、
輝度信号対応の画素値勾配情報と、
を算出し、これらの3種類の勾配情報の重み付き加算結果に基づいて、最小の画素値勾配を有する方向を検出する請求項1に記載の画像処理装置。
The image signal correction unit
In the direction determination process,
Pixel value gradient information corresponding to high frequency texture,
Pixel value gradient information corresponding to low frequency texture,
Pixel value gradient information corresponding to the luminance signal,
The image processing apparatus according to claim 1, wherein a direction having a minimum pixel value gradient is detected based on a weighted addition result of the three types of gradient information.
前記画像信号補正部は、
前記高周波テクスチャ対応の画素値勾配情報を、隣接画素の画素値差分を適用して算出し、
前記低周波テクスチャ対応の画素値勾配情報を、非隣接画素の画素値差分を適用して算出する請求項2に記載の画像処理装置。
The image signal correction unit
The pixel value gradient information corresponding to the high frequency texture is calculated by applying a pixel value difference between adjacent pixels,
The image processing apparatus according to claim 2, wherein the pixel value gradient information corresponding to the low frequency texture is calculated by applying a pixel value difference between non-adjacent pixels.
前記画像信号補正部は、
RGB各画素を含む画素領域単位でRGB各画素の画素値に基づいて輝度信号を算出し、算出した領域単位の輝度信号を適用して前記輝度信号対応の画素値勾配情報を算出する請求項2に記載の画像処理装置。
The image signal correction unit
The luminance signal corresponding to the luminance signal is calculated by calculating a luminance signal based on the pixel value of each RGB pixel in a pixel region unit including each RGB pixel and applying the calculated luminance signal in each region unit. An image processing apparatus according to 1.
前記画像信号補正部は、
前記3種類の勾配情報の重み付き加算処理において設定する重みを出力画像の解像度に応じて変更する処理を実行し、
出力画像が高解像度の場合は、高周波テクスチャ対応の画素値勾配情報に対する重みを他の勾配情報に優先して高く設定し、
出力画像が低解像度の場合は、低周波テクスチャ対応の画素値勾配情報に対する重みを他の勾配情報に優先して高く設定する請求項1に記載の画像処理装置。
The image signal correction unit
Executing a process of changing the weight set in the weighted addition process of the three types of gradient information according to the resolution of the output image;
If the output image is high resolution, set the weight for the pixel value gradient information for high-frequency textures higher than other gradient information,
The image processing apparatus according to claim 1, wherein when the output image has a low resolution, the weight for the pixel value gradient information corresponding to the low-frequency texture is set higher with priority over the other gradient information.
前記画像信号補正部は、
前記3種類の勾配情報の重み付き加算処理において設定する重みを処理対象画像である入力画像の周波数帯に応じて変更する処理を実行し、
入力画像が高周波数領域を多く含む場合は、高周波テクスチャ対応の画素値勾配情報に対する重みを他の勾配情報に優先して高く設定し、
入力画像が低周波数領域を多く含む場合は、低周波テクスチャ対応の画素値勾配情報に対する重みを他の勾配情報に優先して高く設定する請求項1に記載の画像処理装置。
The image signal correction unit
Executing a process of changing the weight set in the weighted addition process of the three types of gradient information according to the frequency band of the input image that is the processing target image;
If the input image contains a lot of high frequency areas, set the weight for the pixel value gradient information corresponding to the high frequency texture higher than other gradient information,
The image processing apparatus according to claim 1, wherein when the input image includes many low frequency regions, the weight for the pixel value gradient information corresponding to the low frequency texture is set higher than other gradient information.
前記画像信号補正部は、
RGB各色が2×2の4画素単位で配列された画像、またはRGBW各色が2×2の4画素単位で配列された画像の画素値補正を実行する請求項1に記載の画像処理装置。
The image signal correction unit
The image processing apparatus according to claim 1, wherein pixel value correction is performed on an image in which RGB colors are arranged in units of 2 × 2 pixels or an image in which RGBW colors are arranged in units of 2 × 2 pixels.
前記画像信号補正部は、
前記欠陥検出処理において、
欠陥検出対象となる注目画素と同一色の画素を参照画素として前記最小勾配方向から選択し、注目画素と選択画素の異なる組み合わせに基づいて算出した複数のラプラシアンと予め既定した閾値との比較を実行して比較結果に基づいて前記注目画素が欠陥画素であるか否かの判定を行う請求項1に記載の画像処理装置。
The image signal correction unit
In the defect detection process,
A pixel having the same color as the target pixel to be detected as a defect is selected as a reference pixel from the minimum gradient direction, and a plurality of Laplacians calculated based on different combinations of the target pixel and the selected pixel are compared with a predetermined threshold value. The image processing apparatus according to claim 1, wherein it is determined whether or not the target pixel is a defective pixel based on a comparison result.
前記画像信号補正部は、
欠陥検出対象となる注目画素と同一色の画素を参照画素として前記最小勾配方向から4画素選択し、注目画素と2つの選択画素の異なる組み合わせに基づいて算出した3つのラプラシアンと予め既定した閾値との比較を実行し、3つのラプラシアンの全てが前記しきい値より大きい場合に前記注目画素が欠陥画素であると判定する請求項8に記載の画像処理装置。
The image signal correction unit
Four pixels are selected from the minimum gradient direction using a pixel of the same color as the target pixel as a defect detection target as a reference pixel, three Laplacians calculated based on different combinations of the target pixel and the two selected pixels, and a predetermined threshold value The image processing apparatus according to claim 8, wherein the pixel of interest is determined to be a defective pixel when all three Laplacians are greater than the threshold.
前記画像信号補正部は、
前記欠陥検出処理において、
欠陥検出対象となる注目画素と同一色の画素が、既定の参照領域内において前記最小勾配方向から4つ選択できない場合、
前記最小勾配方向にある注目画素と異なる色の異色画素位置に、該異色画素位置の周囲の注目画素と同一色画素の画素値に基づく画素補間を実行し、該画素補間によって生成した補間画素を参照画素として設定する請求項8に記載の画像処理装置。
The image signal correction unit
In the defect detection process,
In the case where four pixels having the same color as the target pixel as a defect detection target cannot be selected from the minimum gradient direction within the predetermined reference area,
Pixel interpolation based on the pixel value of the same color pixel as the target pixel around the different color pixel position is executed at the different color pixel position of the color different from the target pixel in the minimum gradient direction, and the interpolation pixel generated by the pixel interpolation is The image processing apparatus according to claim 8, wherein the image processing apparatus is set as a reference pixel.
前記画像信号補正部は、
前記欠陥補正処理において、
前記参照画素の画素値の重み付き加算により前記注目画素の補正画素値を算出する請求項8に記載の画像処理装置。
The image signal correction unit
In the defect correction process,
The image processing apparatus according to claim 8, wherein a corrected pixel value of the target pixel is calculated by weighted addition of pixel values of the reference pixels.
前記画像信号補正部は、
前記欠陥補正処理において、
前記注目画素を中心とした両側各々にある2つの参照画素間の画素値勾配を算出し、画素値勾配の小さい方向の2画素の画素値の重み付き加算によって前記注目画素の補正画素値を算出する請求項8に記載の画像処理装置。
The image signal correction unit
In the defect correction process,
Calculate a pixel value gradient between two reference pixels on both sides centered on the target pixel, and calculate a corrected pixel value of the target pixel by weighted addition of two pixel values in a direction in which the pixel value gradient is small The image processing apparatus according to claim 8.
前記画像信号補正部は、
前記欠陥補正処理において実行した補正処理がハイライト誤補正であるか否かを判定するハイライト誤補正判定処理を実行し、
ハイライト誤補正であると判定した場合は、補正前の原画素値を出力し、
ハイライト誤補正でないと判定した場合は、補正画素値を出力する請求項1に記載の画像処理装置。
The image signal correction unit
Executing a highlight error correction determination process for determining whether the correction process performed in the defect correction process is a highlight error correction;
If it is determined that the highlight correction is incorrect, the original pixel value before correction is output.
The image processing apparatus according to claim 1, wherein when it is determined that the highlight correction is not erroneous correction, a corrected pixel value is output.
画像処理装置において実行する画像処理方法であり、
画像信号補正部が、注目画素を含む画素領域における画素値勾配方向として、最小の画素値勾配を有する方向を検出する方向判定処理と、
前記注目画素に対して、前記方向判定処理において検出した最小勾配方向の参照画素の画素値に基づくラプラシアンを算出して、注目画素の欠陥の有無を判定する欠陥検出処理と、
前記欠陥検出処理において欠陥の検出された注目画素に対して、前記方向判定処理において検出した方向にある参照画素の画素値を適用した補正画素値の算出を実行する欠陥補正処理を実行し、
前記方向判定処理においては、複数の異なる勾配検出処理によって算出した複数の勾配情報の重み付き加算結果を適用した方向判定処理を実行する画像処理方法。
An image processing method executed in an image processing apparatus,
A direction determination process in which the image signal correction unit detects a direction having the minimum pixel value gradient as the pixel value gradient direction in the pixel region including the target pixel;
A defect detection process for calculating the Laplacian based on the pixel value of the reference pixel in the minimum gradient direction detected in the direction determination process for the target pixel, and determining the presence or absence of a defect in the target pixel;
Executing a defect correction process for calculating a correction pixel value by applying a pixel value of a reference pixel in a direction detected in the direction determination process to a target pixel in which a defect is detected in the defect detection process;
In the direction determination process, an image processing method for executing a direction determination process using a weighted addition result of a plurality of pieces of gradient information calculated by a plurality of different gradient detection processes.
画像処理装置において画像処理を実行させるプログラムであり、
画像信号補正部に、注目画素を含む画素領域における画素値勾配方向として、最小の画素値勾配を有する方向を検出する方向判定処理と、
前記注目画素に対して、前記方向判定処理において検出した最小勾配方向の参照画素の画素値に基づくラプラシアンを算出して、注目画素の欠陥の有無を判定する欠陥検出処理と、
前記欠陥検出処理において欠陥の検出された注目画素に対して、前記方向判定処理において検出した方向にある参照画素の画素値を適用した補正画素値の算出を実行する欠陥補正処理を実行させ、
前記方向判定処理は、複数の異なる勾配検出処理によって算出した複数の勾配情報の重み付き加算結果を適用した方向判定処理を実行させるプログラム。
A program for executing image processing in an image processing apparatus;
A direction determination process for detecting a direction having a minimum pixel value gradient as a pixel value gradient direction in the pixel region including the target pixel in the image signal correction unit;
A defect detection process for calculating the Laplacian based on the pixel value of the reference pixel in the minimum gradient direction detected in the direction determination process for the target pixel, and determining the presence or absence of a defect in the target pixel;
For the target pixel in which a defect is detected in the defect detection process, a defect correction process is executed to calculate a correction pixel value by applying a pixel value of a reference pixel in the direction detected in the direction determination process,
The direction determination process is a program for executing a direction determination process using a weighted addition result of a plurality of pieces of gradient information calculated by a plurality of different gradient detection processes.
JP2012070537A 2011-08-31 2012-03-27 Image processing apparatus, image processing method, and program Pending JP2013066157A (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP2012070537A JP2013066157A (en) 2011-08-31 2012-03-27 Image processing apparatus, image processing method, and program
BR102012021428-8A BR102012021428A2 (en) 2011-08-31 2012-08-24 IMAGE PROCESSING APPARATUS, IMAGE PROCESSING METHOD AND PROGRAM
CN201210306308XA CN102970463A (en) 2011-08-31 2012-08-24 Image processing device, image processing method and program
US14/529,787 US9582863B2 (en) 2011-08-31 2014-10-31 Image processing apparatus, image processing method, and program

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2011190053 2011-08-31
JP2011190053 2011-08-31
JP2012070537A JP2013066157A (en) 2011-08-31 2012-03-27 Image processing apparatus, image processing method, and program

Publications (1)

Publication Number Publication Date
JP2013066157A true JP2013066157A (en) 2013-04-11

Family

ID=52003473

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012070537A Pending JP2013066157A (en) 2011-08-31 2012-03-27 Image processing apparatus, image processing method, and program

Country Status (3)

Country Link
JP (1) JP2013066157A (en)
CN (1) CN102970463A (en)
BR (1) BR102012021428A2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20180080180A (en) * 2016-11-30 2018-07-11 광동 오포 모바일 텔레커뮤니케이션즈 코포레이션 리미티드 Image dead pixel compensation method, apparatus and non-transitory computer readable storage medium
WO2020050289A1 (en) * 2018-09-07 2020-03-12 ソニーセミコンダクタソリューションズ株式会社 Image processing device, image processing method, and image processing program

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6137936B2 (en) * 2013-05-10 2017-05-31 オリンパス株式会社 Imaging device, image processing apparatus, and image correction method
CN103618858A (en) * 2013-12-09 2014-03-05 Tcl通讯(宁波)有限公司 Color correction method and device for mobile terminal camera
CN107917914B (en) * 2017-11-30 2020-02-11 红云红河烟草(集团)有限责任公司 Method for evaluating mixing uniformity of formula components in formula tobacco shreds in cigarette processing industry
CN109372497B (en) * 2018-08-20 2022-03-29 中国石油天然气集团有限公司 Ultrasonic imaging dynamic equalization processing method
WO2020177123A1 (en) * 2019-03-07 2020-09-10 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Color imaging system
CN111127489B (en) * 2019-12-30 2022-11-29 展讯通信(上海)有限公司 Image frequency division method and device, storage medium and terminal
CN111260581B (en) * 2020-01-17 2023-09-26 北京达佳互联信息技术有限公司 Image processing method, device and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4359773B2 (en) * 2004-06-22 2009-11-04 ソニー株式会社 Image compression processing apparatus, image compression processing method, and image compression processing program
KR100699834B1 (en) * 2005-02-07 2007-03-27 삼성전자주식회사 Method and apparatus for processing bayer-pattern color digital image signal
US8259198B2 (en) * 2009-10-20 2012-09-04 Apple Inc. System and method for detecting and correcting defective pixels in an image sensor
JP5655355B2 (en) * 2009-11-02 2015-01-21 ソニー株式会社 Pixel defect correction device, imaging device, pixel defect correction method, and program

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20180080180A (en) * 2016-11-30 2018-07-11 광동 오포 모바일 텔레커뮤니케이션즈 코포레이션 리미티드 Image dead pixel compensation method, apparatus and non-transitory computer readable storage medium
KR102049681B1 (en) 2016-11-30 2019-11-27 광동 오포 모바일 텔레커뮤니케이션즈 코포레이션 리미티드 Image dead pixel compensation method, apparatus and non-transitory computer readable storage medium
WO2020050289A1 (en) * 2018-09-07 2020-03-12 ソニーセミコンダクタソリューションズ株式会社 Image processing device, image processing method, and image processing program
US11847759B2 (en) 2018-09-07 2023-12-19 Sony Semiconductor Solutions Corporation Image processing device, image processing method, and image processing program

Also Published As

Publication number Publication date
BR102012021428A2 (en) 2014-12-02
CN102970463A (en) 2013-03-13

Similar Documents

Publication Publication Date Title
US8891866B2 (en) Image processing apparatus, image processing method, and program
JP2013066157A (en) Image processing apparatus, image processing method, and program
US9179113B2 (en) Image processing device, and image processing method, and program
JP5326943B2 (en) Image processing apparatus, image processing method, and program
TWI516132B (en) An image processing apparatus, an image processing method, and a program
JP5904213B2 (en) Image processing apparatus, image processing method, and program
US7839437B2 (en) Image pickup apparatus, image processing method, and computer program capable of obtaining high-quality image data by controlling imbalance among sensitivities of light-receiving devices
JP5672776B2 (en) Image processing apparatus, image processing method, and program
US8837853B2 (en) Image processing apparatus, image processing method, information recording medium, and program providing image blur correction
US8131067B2 (en) Image processing apparatus, image processing method, and computer-readable media for attaining image processing
JP2020043435A (en) Image processing apparatus, image processing method, and image processing program
JP2008070853A (en) Compensation method of image array data
US8773556B2 (en) Signal processing device, imaging device, and signal processing method for color interpolation
JP2013055623A (en) Image processing apparatus, image processing method, information recording medium, and program
JP4104495B2 (en) Data processing apparatus, image processing apparatus, and camera
JP5600812B2 (en) Imaging device
JP5631769B2 (en) Image processing device
KR101327790B1 (en) Image interpolation method and apparatus
JP2009095012A (en) Method for determining direction of interpolation, method and apparatus for color interpolation
JP2010178226A (en) Imaging apparatus, chromatic aberration suppressing method, and chromatic aberration suppressing circuit, and program
JP2013055622A (en) Image processing apparatus, image processing method, information recording medium, and program
Tao et al. A novel weighted-direction color interpolation
JP2009296471A (en) Video image signal processing device, imaging device and video signal processing method