JP2013066214A - Image processor, image processing method, and image processing program - Google Patents

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

Info

Publication number
JP2013066214A
JP2013066214A JP2012253900A JP2012253900A JP2013066214A JP 2013066214 A JP2013066214 A JP 2013066214A JP 2012253900 A JP2012253900 A JP 2012253900A JP 2012253900 A JP2012253900 A JP 2012253900A JP 2013066214 A JP2013066214 A JP 2013066214A
Authority
JP
Japan
Prior art keywords
plane
pixel
color
image
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2012253900A
Other languages
Japanese (ja)
Other versions
JP5454820B2 (en
Inventor
Yasuhiro Sawada
保宏 沢田
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.)
Silicon Hive BV
Original Assignee
Silicon Hive BV
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 Silicon Hive BV filed Critical Silicon Hive BV
Priority to JP2012253900A priority Critical patent/JP5454820B2/en
Publication of JP2013066214A publication Critical patent/JP2013066214A/en
Application granted granted Critical
Publication of JP5454820B2 publication Critical patent/JP5454820B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

PROBLEM TO BE SOLVED: To suppress zipper artifacts and jaggy when generating color images from mosaic images.SOLUTION: An image processor includes: a color plane decomposition unit for decomposing a color mosaic image into respective R, Gr, Gb and B pixels; an R@B plane generation unit for replacing, at a B pixel position, an interpolation value of an R pixel surrounding the B pixel with a B pixel value and interpolating and generating an R pixel value @B pixel position; a B@R plane generation unit for replacing, at an R pixel position, an interpolation value of a B pixel surrounding the R pixel with an R pixel value and interpolating and generating a B pixel value @R pixel position; sampling means for interpolating and generating pixel values for each of an R plane, a Gr plane, a Gb plane, a B plane, an R@B plane and a B@R plane; and luminance generation means for generating luminance of respective pixels of a color image by combining sampling values of the R plane, the Gr plane, the Gb plane, the B plane, the R@B plane and the B@R plane.

Description

本発明は、R(赤)G(緑)B(青)3色のベイヤー配列のカラーフィルタを有する撮像素子を介して出力された色モザイク画像から、カラー画像を生成する画像処理装置及び画像処理方法に関し、特に、撮像素子を介して出力された出力信号から輝度信号を生成する技術に関する。   The present invention relates to an image processing apparatus and image processing for generating a color image from a color mosaic image output via an image pickup device having a color filter with a Bayer array of three colors of R (red), G (green), and B (blue). More particularly, the present invention relates to a technique for generating a luminance signal from an output signal output via an image sensor.

従来、デジタルカメラなどの撮像系において、レンズを介して撮像素子に被写体像を結像して、この撮像素子によって被写体像を光電変換し、画像信号を生成する画像処理装置及び画像処理方法が知られている。   2. Description of the Related Art Conventionally, in an imaging system such as a digital camera, an image processing apparatus and an image processing method are known in which a subject image is formed on an image sensor via a lens, the subject image is photoelectrically converted by the image sensor, and an image signal is generated. It has been.

そして、単板式の撮像素子として、マトリクス状に複数の光電変換素子を備えると共に、その前面にカラーフィルタを備え、このカラーフィルタを介して出力した各色の画素信号に信号処理を加えて画像データを生成する画像処理装置及び画像処理方法が知られている。   As a single-plate image sensor, a plurality of photoelectric conversion elements are provided in a matrix, and a color filter is provided in front of the image sensor, and image processing is performed by applying signal processing to the pixel signals of each color output via the color filter. An image processing apparatus and an image processing method to be generated are known.

撮像素子を1つだけ用いた、いわゆる単板式の撮像素子においては、撮像素子上の各画素に対応して特定の色フィルタ、たとえば赤(R)、緑(G)、青(B)の色フィルタが設けられている。通常、Rの色フィルタが設けられた画素をR画素(赤画素)、Gの色フィルタが設けられた画素をG画素(緑画素)、Bの色フィルタが設けられた画素をB画素(青画素)と呼ぶ。   In a so-called single-plate image sensor using only one image sensor, specific color filters corresponding to each pixel on the image sensor, such as red (R), green (G), and blue (B) colors, are used. A filter is provided. Usually, a pixel provided with an R color filter is an R pixel (red pixel), a pixel provided with a G color filter is G pixel (green pixel), and a pixel provided with a B color filter is B pixel (blue pixel). Pixel).

また、単板式の撮像素子における代表的な色フィルタとして、原色ベイヤー配列と呼ばれる色フィルタが用いられている。原色ベイヤー配列の色フィルタは、水平方向にRとGが交互に配置された行と水平方向にGとBが交互に配置された行とが垂直方向に交互に配列され、水平方向2画素×垂直方向2画素(2×2画素)を1単位(1ユニット)とする複数の基本ブロックが周期的に配置されている。また、各基本ブロックは、2つの緑画素が一方の対角上に配置され、赤画素と青画素とが他方の対角上に配置された構造となっている。   A color filter called a primary color Bayer array is used as a representative color filter in a single-plate image sensor. The color filter of the primary color Bayer arrangement is such that rows in which R and G are alternately arranged in the horizontal direction and rows in which G and B are alternately arranged in the horizontal direction are alternately arranged in the vertical direction. A plurality of basic blocks each having two vertical pixels (2 × 2 pixels) as one unit (one unit) are periodically arranged. Each basic block has a structure in which two green pixels are arranged on one diagonal and a red pixel and a blue pixel are arranged on the other diagonal.

そして、画像処理装置において、単板式撮像素子を介して出力された画像信号から輝度信号及び色差信号を生成し、これらの信号から、カラー画像の画像信号を生成しているものがある(例えば、特許文献1参照)。   In some image processing apparatuses, a luminance signal and a color difference signal are generated from an image signal output via a single-plate image sensor, and an image signal of a color image is generated from these signals (for example, Patent Document 1).

詳しくは、単板式の撮像素子では各画素が単色の色情報しか持たないが、カラー画像を表示するためには、赤色(R)、緑色(G)、青色(B)の値すべてが各画素で必要である。このため単板式撮像素子を用いた画像処理では、各画素がR、G、B成分のうちの何れかのみを有する色モザイク画像にもとづいて、いわゆるデモザイク処理を行っている。ここで、デモザイク処理とは、色モザイク画像の各画素の単色情報に対してその周辺画素から集めた他の足りない色の輝度情報を用いて補間演算を行うことにより、各画素がそれぞれR、G、B成分の全てを有するカラー画像を生成する処理である(所謂、色補間処理である)。   Specifically, in a single-plate image sensor, each pixel has only single color information, but in order to display a color image, all the values of red (R), green (G), and blue (B) are each pixel. Is necessary. For this reason, in image processing using a single-plate image sensor, so-called demosaic processing is performed based on a color mosaic image in which each pixel has only one of R, G, and B components. Here, the demosaic process is an interpolation operation using the luminance information of other insufficient colors collected from the surrounding pixels for the single color information of each pixel of the color mosaic image, so that each pixel is R, This is processing for generating a color image having all of the G and B components (so-called color interpolation processing).

また、輝度信号を生成する際の簡素な方法としては、撮像素子から出力された色モザイク画像に対して、例えば(式1)に表したローパスフィルタを用いてフィルタリングを直接することで色キャリア成分を除去し、フィルタを介して得られた画素信号を用いて輝度を生成する方法が知られている(例えば、特許文献2参照)。つまり、色モザイク画像に対して一様なローパスフィルタを介して出力された画素信号を輝度信号としている(以下、SwitchY輝度生成法という)。

Figure 2013066214
In addition, as a simple method for generating a luminance signal, a color carrier component is obtained by directly filtering a color mosaic image output from an image sensor using, for example, a low-pass filter represented by (Equation 1). There is known a method of removing luminance and generating luminance using a pixel signal obtained through a filter (see, for example, Patent Document 2). That is, a pixel signal output through a uniform low-pass filter for a color mosaic image is used as a luminance signal (hereinafter referred to as SwitchY luminance generation method).
Figure 2013066214

特開2000−341702号公報JP 2000-341702 A 特開2000−287219号公報JP 2000-287219 A

しかしながら、従来のように注目画素を中心として、所定の画素範囲にローパスフィルタを掛けて輝度を生成する方法によれば、特に斜めの赤画像と青画像との画像境界に沿って、明暗がギザギザ模様のジッパーアーチファクト(Zipper Artifact)が発生し、さらに改善の余地があった。ここで、ジッパーアーチファクトとは、デモザイク処理によって、本来の画像にない明暗が画像境界に沿ってジッパー状(所謂、スライドファスナー状である)に現れる現象をいう。   However, according to the conventional method of generating luminance by applying a low-pass filter to a predetermined pixel range centering on the pixel of interest, light and darkness is jagged, particularly along the image boundary between an oblique red image and a blue image. Pattern zipper artifacts occurred and there was room for further improvement. Here, the zipper artifact refers to a phenomenon in which light and darkness that does not exist in the original image appear in a zipper shape (a so-called slide fastener shape) along the image boundary by demosaic processing.

詳しくは、図9(a)に表したように、画像境界Lを介して、右上領域(図中のRU)に(R,G,B)=(0,0,1)の輝度を持つ青画像が結像し、左下領域(図中のLD)に(R,G,B)=(1,0,0)の輝度を持つ赤画像が結像した際に、色モザイク画像は、図9(b)に表したように、右上領域の画像範囲ではB画素が1、左下領域の画像範囲ではR画素が1となり、他の画素は全て0になる。   Specifically, as shown in FIG. 9A, blue having a luminance of (R, G, B) = (0, 0, 1) in the upper right region (RU in the figure) via the image boundary L. When an image is formed and a red image having a luminance of (R, G, B) = (1, 0, 0) is formed in the lower left region (LD in the figure), the color mosaic image is shown in FIG. As shown in (b), B pixel is 1 in the image range in the upper right region, R pixel is 1 in the image range in the lower left region, and all other pixels are 0.

そして、図9(b)に表した画像信号に対して、色キャリア成分除去のために(式1)のローパスフィルタを掛けると、図9(c)に表したように、境界線Lに沿って好ましくない画素値3/16、5/16が交互に生成され、ジッパーアーチファクトと呼ばれる明暗のパターンが発生する。また、このような画像境界における輝度の不整合は、赤と青との境界に限らず、赤と青の色差が変化する領域で生じ易く、カラー画像にジャギー(jaggies)となって現れる。   Then, when the image signal shown in FIG. 9B is subjected to the low-pass filter of (Equation 1) to remove the color carrier component, as shown in FIG. The pixel values 3/16 and 5/16, which are undesirable, are alternately generated, and a light and dark pattern called a zipper artifact is generated. Further, such a luminance mismatch at the image boundary is not limited to the boundary between red and blue, but easily occurs in an area where the color difference between red and blue changes, and appears as jagged in the color image.

そこで、本発明は、原色ベイヤー配列の単板式撮像装置から出力されたモザイク画像からカラー画像を生成する際に、赤と青との画像境界に沿って発生するジッパーアーチファクトやジャギーを抑制し、高品位なカラー画像を得ることができる画像処理装置及び画像処理方法を提供することを目的とする。   Therefore, the present invention suppresses zipper artifacts and jaggies that occur along the image boundary between red and blue when generating a color image from a mosaic image output from a single-plate imaging device with a primary color Bayer array, An object of the present invention is to provide an image processing apparatus and an image processing method capable of obtaining a quality color image.

かかる目的を達成するためになされた請求項1に記載の発明は、R(赤)、G(緑)、B(青)3色のベイヤー配列のカラーフィルタを有する撮像素子を介して出力されて各画素が単一色の色情報を備えた色モザイク画像から、画素毎に複数の色情報を備えたカラー画像を生成する画像処理装置であって、前記ベイヤー配列において、水平方向に前記Rの隣に配置される前記GをGr、前記Bの隣に配置される前記GをGbとして表した際に、前記色モザイク画像を、R、Gr、Gb、Bの画素毎に分解する色プレーン分解部と、前記Bの画素位置おいて、該B画素を囲むRの画素の補間値をBの画素値に置き換えてR画素値@B画素位置として補間生成するR@Bプレーン生成部と、前記Rの画素位置おいて、該R画素を囲むBの画素の補間値をRの画素値に置き換えてB画素値@R画素位置として補間生成するB@Rプレーン生成部と、前記カラー画像の画素位置に対応付けられたモザイク画像のサンプリング位置において、前記Rプレーン、Grプレーン、Gbプレ−ン、Bプレーン、R@Bプレーン、B@Rプレーンの夫々毎に画素値を補間生成し、プレーン毎のサンプリング値を生成するサンプリング手段と、前記サンプリング手段を介して生成された前記Rプレーン、Grプレーン、Gbプレ−ン、Bプレーン、R@Bプレーン、B@Rプレーンのサンプリング値を合成して前記カラー画像の各画素の輝度を生成する輝度生成手段と、を備えていることを特徴とする。   The invention according to claim 1, which has been made to achieve such an object, is output via an image pickup device having a color filter with a Bayer array of three colors of R (red), G (green), and B (blue). An image processing apparatus for generating a color image having a plurality of color information for each pixel from a color mosaic image in which each pixel has color information of a single color, and in the Bayer array, adjacent to R in the horizontal direction A color plane separation unit that separates the color mosaic image into R, Gr, Gb, and B pixels when the G arranged in G is represented as Gr and the G arranged next to B is represented as Gb. An R @ B plane generation unit that interpolates and generates an R pixel value @ B pixel position by replacing the interpolation value of the R pixel surrounding the B pixel with the B pixel value at the B pixel position; Of the B pixel surrounding the R pixel at the pixel position of A B @ R plane generating unit that interpolates and generates a B pixel value @R pixel position by replacing the value with a R pixel value, and the R plane at the sampling position of the mosaic image associated with the pixel position of the color image, A pixel value is interpolated and generated for each of the Gr plane, Gb plane, B plane, R @ B plane, and B @ R plane, and a sampling means for generating a sampling value for each plane is generated via the sampling means. Luminance generating means for generating a luminance of each pixel of the color image by combining sampling values of the R plane, Gr plane, Gb plane, B plane, R @ B plane, and B @ R plane It is characterized by having.

請求項1に記載の画像処理装置によれば、色モザイク画像を、Bの画素位置おいて、該B画素を囲むRの画素の補間値をBの画素値に置き換えてR画素値@B画素位置として補間生成するR@Bプレーン生成部と、Rの画素位置おいて、R画素を囲むBの画素の補間値をRの画素値に置き換えてB画素値@R画素位置として補間生成するB@Rプレーン生成部と、カラー画像の画素位置に対応付けられたモザイク画像のサンプリング位置において、Rプレーン、Grプレーン、Gbプレ−ン、Bプレーン、R@Bプレーン、B@Rプレーンの夫々毎に画素値を補間生成し、プレーン毎のサンプリング値を生成するサンプリング手段と、サンプリング手段を介して生成された前記Rプレーン、Grプレーン、Gbプレ−ン、Bプレーン、R@Bプレーン、B@Rプレーンのサンプリング値を合成して前記カラー画像の各画素の輝度を生成する輝度生成手段と、を備えているので、赤系画像と青系画像との境界に現れるジッパーアーチファクトを効果的に抑制することができ、さらには、色モザイク画像の画素位置に関らず、任意の画素位置において高品位な輝度を生成できる。   According to the image processing device of claim 1, in the color mosaic image, the interpolation value of the R pixel surrounding the B pixel is replaced with the B pixel value at the B pixel position, and the R pixel value @ B pixel An R @ B plane generation unit that generates an interpolation as a position, and an B that generates an interpolation as a B pixel value @ R pixel position by replacing an interpolation value of a B pixel that surrounds the R pixel with an R pixel value at an R pixel position At the sampling position of the mosaic image associated with the @R plane generation unit and the pixel position of the color image, each of the R plane, the Gr plane, the Gb plane, the B plane, the R @ B plane, and the B @ R plane Sampling means for interpolating pixel values to generate sampling values for each plane, and the R plane, Gr plane, Gb plane, B plane, R @ B generated via the sampling means And a luminance generation means for generating the luminance of each pixel of the color image by synthesizing the sampling values of the lane and the B @ R plane, so that zipper artifacts appearing at the boundary between the red image and the blue image It can be effectively suppressed, and furthermore, high-quality luminance can be generated at any pixel position regardless of the pixel position of the color mosaic image.

また、請求項1に記載の発明は、請求項2に記載の発明のように、前記輝度生成手段が、前記Rプレーンのサンプリング値とR@Bプレーンのサンプリング値とを略1:2の割合で合成することにより、赤系画像境界に現れるジッパーアーチファクトを効果的に抑制することができる。   Further, according to the first aspect of the present invention, as in the second aspect of the present invention, the luminance generation means uses a ratio of approximately 1: 2 between the sampling value of the R plane and the sampling value of the R @ B plane. By combining with, zipper artifacts appearing at the red image boundary can be effectively suppressed.

また、請求項1に記載の発明は、請求項3に記載の発明のように、前記輝度生成手段が、前記Bプレーンのサンプリング値とB@Rプレーンのサンプリング値とを略1:2の割合で合成することにより、青系画像境界に現れるジッパーアーチファクトを効果的に抑制することができる。   Further, according to the first aspect of the present invention, as in the third aspect of the present invention, the luminance generation means uses a ratio of approximately 1: 2 between the sampling value of the B plane and the sampling value of the B @ R plane. By combining with, zipper artifacts appearing at the blue image boundary can be effectively suppressed.

次に、請求項4に記載の発明は、R(赤)、G(緑)、B(青)3色のベイヤー配列のカラーフィルタを有する撮像素子を介して出力されて各画素が単一色の色情報を備えた色モザイク画像から、画素毎に複数の色情報を備えたカラー画像を生成する画像処理方法であって、前記ベイヤー配列において、水平方向に前記Rの隣に配置される前記GをGr、前記Bの隣に配置される前記GをGbとして表した際に、前記色モザイク画像を、R、Gr、Gb、Bの画素毎に分解する色プレーン分解ステップと、前記Bの画素位置おいて、該B画素を囲むRの画素の補間値をBの画素値に置き換えてR画素値@B画素位置として補間生成するR@Bプレーン生成ステップと、前記Rの画素位置おいて、該R画素を囲むBの画素の補間値をRの画素値に置き換えてB画素値@R画素位置として補間生成するB@Rプレーン生成ステップと、前記カラー画像の画素位置に対応付けられたモザイク画像のサンプリング位置において、前記Rプレーン、Grプレーン、Gbプr−ン、Bプレーン、R@Bプレーン、B@Rプレーンの夫々毎に画素値を補間生成し、プレーン毎のサンプリング値を生成するサンプリングステップと、前記サンプリングステップを介して生成された前記Rプレーン、Grプレーン、Gbプレ−ン、Bプレーン、R@Bプレーン、B@Rプレーンのサンプリング値を合成して前記カラー画像の各画素の輝度を生成する輝度生成ステップと、を用いることを特徴とする。   Next, the invention described in claim 4 is outputted through an image sensor having a Bayer array color filter of R (red), G (green), and B (blue), and each pixel has a single color. An image processing method for generating a color image having a plurality of pieces of color information for each pixel from a color mosaic image having color information, wherein the G is arranged next to the R in a horizontal direction in the Bayer array. A color plane separation step for separating the color mosaic image into R, Gr, Gb, and B pixels, and G pixels arranged as Gr and G as Gb. R @ B plane generating step of interpolating and generating an R pixel value @B pixel position by replacing the interpolation value of the R pixel surrounding the B pixel with the B pixel value at the position, and at the R pixel position, The interpolated value of the B pixel surrounding the R pixel is the R pixel value. At the B @ R plane generation step of interpolating and generating the B pixel value @R pixel position by replacement, and at the sampling position of the mosaic image associated with the pixel position of the color image, the R plane, Gr plane, Gb plane r− A sampling step for interpolating and generating pixel values for each of the B plane, R @ B plane, and B @ R plane, and generating sampling values for each plane, and the R plane generated through the sampling step, A luminance generation step of generating the luminance of each pixel of the color image by combining the sampling values of the Gr plane, the Gb plane, the B plane, the R @ B plane, and the B @ R plane. .

請求項4に記載の画像処理方法によれば、色モザイク画像を、R、Gr、Gb、Bの画素毎に分解する色プレーン分解ステップと、Bの画素位置おいて、該B画素を囲むRの画素の補間値をBの画素値に置き換えてR画素値@B画素位置として補間生成するR@Bプレーン生成ステップと、Rの画素位置おいて、該R画素を囲むBの画素の補間値をRの画素値に置き換えてB画素値@R画素位置として補間生成するB@Rプレーン生成ステップと、カラー画像の画素位置に対応付けられたモザイク画像のサンプリング位置において、Rプレーン、Grプレーン、Gbプr−ン、Bプレーン、R@Bプレーン、B@Rプレーンの夫々毎に画素値を補間生成し、プレーン毎のサンプリング値を生成するサンプリングステップと、サンプリングステップを介して生成されたRプレーン、Grプレーン、Gbプレ−ン、Bプレーン、R@Bプレーン、B@Rプレーンのサンプリング値を合成してカラー画像の各画素の輝度を生成する輝度生成ステップと、を用いていることにより、請求項6に記載の発明と同様に、赤系画像と青系画像との境界に現れるジッパーアーチファクトを効果的に抑制することができ、さらには、色モザイク画像の画素位置に関らず、任意の画素位置において高品位な輝度を生成できる。   According to the image processing method of claim 4, a color plane separation step for separating a color mosaic image into R, Gr, Gb, and B pixels, and an R that surrounds the B pixels at the B pixel positions. An R @ B plane generation step of interpolating and generating an R pixel value @B pixel position by replacing the interpolation value of the B pixel with the B pixel value, and an interpolation value of the B pixel surrounding the R pixel at the R pixel position In the B @ R plane generation step of interpolating and generating the pixel value of R as the B pixel value @R pixel position, and the sampling position of the mosaic image associated with the pixel position of the color image, the R plane, the Gr plane, A sampling step for interpolating and generating pixel values for each of the Gb plane, B plane, R @ B plane, and B @ R plane, and generating a sampling value for each plane, and a sampling step Generating step of generating luminance of each pixel of a color image by synthesizing sampling values of R plane, Gr plane, Gb plane, B plane, R @ B plane, and B @ R plane generated Thus, similarly to the invention according to claim 6, zipper artifacts appearing at the boundary between the red image and the blue image can be effectively suppressed, and further, the color mosaic image Regardless of the pixel position, high-quality luminance can be generated at any pixel position.

次に、請求項4に記載の画像処理方法は、請求項5に記載の発明のように、輝度生成ステップにおいて、Rプレーンのサンプリング値とR@Bプレーンのサンプリング値とを略1:2の割合で合成することにより、請求項2に記載の発明と同様に、赤系画像境界に現れるジッパーアーチファクトを効果的に抑制することができる。   Next, in the image processing method according to claim 4, as in the invention according to claim 5, in the luminance generation step, the sampling value of the R plane and the sampling value of the R @ B plane are approximately 1: 2. By synthesizing at the ratio, the zipper artifact appearing at the red-based image boundary can be effectively suppressed, as in the second aspect of the invention.

また、請求項4に記載の発明は、請求項6に記載の発明のように、前記輝度生成ステップが、前記Bプレーンのサンプリング値とB@Rプレーンのサンプリング値とを略1:2の割合で合成することにより、請求項3に記載の発明と同様に、青系画像境界に現れるジッパーアーチファクトを効果的に抑制することができる。   According to a fourth aspect of the present invention, as in the sixth aspect of the present invention, the luminance generation step uses a ratio of approximately 1: 2 between the sampling value of the B plane and the sampling value of the B @ R plane. In the same manner as in the third aspect of the invention, the zipper artifact appearing at the blue image boundary can be effectively suppressed.

次に、請求項7に記載の発明は、R(赤)、G(緑)、B(青)3色のベイヤー配列のカラーフィルタを有する撮像素子を介して出力されて各画素が単一色の色情報を備えた色モザイク画像から、画素毎に複数の色情報を備えたカラー画像を生成する画像処理プログラムであって、前記ベイヤー配列において、水平方向に前記Rの隣に配置される前記GをGr、前記Bの隣に配置される前記GをGbとして表した際に、前記色モザイク画像を、R、Gr、Gb、Bの画素毎に分解する色プレーン分解ステップと、前記Bの画素位置おいて、該B画素を囲むRの画素の補間値をBの画素値に置き換えてR画素値@B画素位置として補間生成するR@Bプレーン生成ステップと、前記Rの画素位置おいて、該Rの画素を囲むBの画素の補間値をRの画素値に置き換えてB画素値@R画素位置として補間生成するB@Rプレーン生成ステップと、前記カラー画像の画素位置に対応付けられたモザイク画像のサンプリング位置において、前記Rプレーン、Grプレーン、Gbプr−ン、Bプレーン、R@Bプレーン、B@Rプレーンの夫々毎に画素値を補間生成し、プレーン毎のサンプリング値を生成するサンプリングステップと、前記サンプリングステップを介して生成された前記Rプレーン、Grプレーン、Gbプレ−ン、Bプレーン、R@Bプレーン、B@Rプレーンのサンプリング値を合成して前記カラー画像の各画素の輝度を生成する輝度生成ステップと、をコンピュータに実行させることを特徴とする。   Next, according to the seventh aspect of the present invention, each pixel is output through an image sensor having a Bayer array color filter of three colors of R (red), G (green), and B (blue). An image processing program for generating a color image having a plurality of color information for each pixel from a color mosaic image having color information, wherein the G is arranged next to the R in a horizontal direction in the Bayer array. A color plane separation step for separating the color mosaic image into R, Gr, Gb, and B pixels, and G pixels arranged as Gr and G as Gb. R @ B plane generating step of interpolating and generating an R pixel value @B pixel position by replacing the interpolation value of the R pixel surrounding the B pixel with the B pixel value at the position, and at the R pixel position, The interpolated value of the B pixel surrounding the R pixel is R In the B @ R plane generation step of interpolating and generating the B pixel value @R pixel position instead of the pixel value, and at the sampling position of the mosaic image associated with the pixel position of the color image, the R plane, Gr plane, Gb A sampling step for interpolating and generating pixel values for each of the plane, the B plane, the R @ B plane, and the B @ R plane, and generating a sampling value for each plane, and the sampling step generated through the sampling step A luminance generation step of generating the luminance of each pixel of the color image by synthesizing the sampling values of the R plane, Gr plane, Gb plane, B plane, R @ B plane, and B @ R plane. It is characterized by making it.

請求項7に記載の画像処理プログラムによれば、色モザイク画像を、R、Gr、Gb、Bの画素毎に分解する色プレーン分解ステップと、Bの画素位置おいて、B画素を囲むRの画素の補間値をBの画素値に置き換えてR画素値@B画素位置として補間生成するR@Bプレーン生成ステップと、Rの画素位置おいて、Rの画素を囲むBの画素の補間値をRの画素値に置き換えてB画素値@R画素位置として補間生成するB@Rプレーン生成ステップと、カラー画像の画素位置に対応付けられたモザイク画像のサンプリング位置において、Rプレーン、Grプレーン、Gbプr−ン、Bプレーン、R@Bプレーン、B@Rプレーンの夫々毎に画素値を補間生成し、プレーン毎のサンプリング値を生成するサンプリングステップと、サンプリングステップを介して生成されたRプレーン、Grプレーン、Gbプレ−ン、Bプレーン、R@Bプレーン、B@Rプレーンのサンプリング値を合成してカラー画像の各画素の輝度を生成する輝度生成ステップと、をコンピュータに実行させることにより、請求項6に記載の発明と同様に、赤系画像と青系画像との境界に現れるジッパーアーチファクトを効果的に抑制することができ、さらには、色モザイク画像の画素位置に関らず、任意の画素位置において高品位な輝度を生成できる。   According to the image processing program of claim 7, a color plane separation step for separating the color mosaic image into R, Gr, Gb, and B pixels, and R's surrounding the B pixels at the B pixel positions. R @ B plane generation step of interpolating and generating an R pixel value @B pixel position by replacing the pixel interpolation value with the B pixel value, and an interpolation value of the B pixel surrounding the R pixel at the R pixel position At the B @ R plane generation step of interpolating and generating as the B pixel value @ R pixel position by replacing with the R pixel value, and at the sampling position of the mosaic image associated with the pixel position of the color image, the R plane, Gr plane, Gb Sampling step for interpolating and generating pixel values for each plane, B plane, R @ B plane, and B @ R plane, and generating sampling values for each plane, and sampling Luminance generation step of generating luminance of each pixel of a color image by synthesizing sampling values of R plane, Gr plane, Gb plane, B plane, R @ B plane, and B @ R plane generated through the step By causing the computer to execute, similarly to the invention according to claim 6, zipper artifacts appearing at the boundary between the red image and the blue image can be effectively suppressed. Regardless of the pixel position of the image, high-quality luminance can be generated at any pixel position.

また、請求項7に記載の画像処理プログラムは、請求項8に記載の発明のように、輝度生成ステップにおいて、Rプレーンのサンプリング値とR@Bプレーンのサンプリング値とを略1:2の割合で合成することにより、請求項2に記載の発明と同様に、赤系画像境界に現れるジッパーアーチファクトを効果的に抑制することができる。   According to a seventh aspect of the present invention, in the luminance generation step, the R plane sampling value and the R @ B plane sampling value are in a ratio of approximately 1: 2, as in the eighth aspect of the invention. In the same manner as in the second aspect of the invention, the zipper artifact appearing at the red image boundary can be effectively suppressed.

また、請求項7に記載の発明は、請求項9に記載の発明のように、前記輝度生成ステップが、前記Bプレーンのサンプリング値とB@Rプレーンのサンプリング値とを略1:2の割合で合成することにより、請求項3に記載の発明と同様に、青系画像境界に現れるジッパーアーチファクトを効果的に抑制することができる。   Further, according to a seventh aspect of the invention, as in the ninth aspect of the invention, the luminance generation step uses a ratio of approximately 1: 2 between the sampling value of the B plane and the sampling value of the B @ R plane. In the same manner as in the third aspect of the invention, the zipper artifact appearing at the blue image boundary can be effectively suppressed.

本発明の画像処理装置、画像処理方法及び画像処理プログラムは、色モザイク画像を、Bの画素位置おいて、該B画素を囲むRの画素の補間値をBの画素値に置き換えてR画素値@B画素位置として補間生成するR@Bプレーン生成部と、Rの画素位置おいて、R画素を囲むBの画素の補間値をRの画素値に置き換えてB画素値@R画素位置として補間生成するB@Rプレーン生成部と、カラー画像の画素位置に対応付けられたモザイク画像のサンプリング位置において、Rプレーン、Grプレーン、Gbプレ−ン、Bプレーン、R@Bプレーン、B@Rプレーンの夫々毎に画素値を補間生成し、プレーン毎のサンプリング値を生成するサンプリング手段と、サンプリング手段を介して生成された前記Rプレーン、Grプレーン、Gbプレ−ン、Bプレーン、R@Bプレーン、B@Rプレーンのサンプリング値を合成して前記カラー画像の各画素の輝度を生成する輝度生成手段と、を備えているので、赤系画像と青系画像との境界に現れるジッパーアーチファクトを効果的に抑制することができ、さらには、色モザイク画像の画素位置に関らず、任意の画素位置において高品位な輝度を生成できる。   The image processing apparatus, the image processing method, and the image processing program according to the present invention replace the interpolation value of the R pixel that surrounds the B pixel with the B pixel value at the B pixel position in the color mosaic image. An R @ B plane generation unit that generates an interpolation as the @B pixel position, and an interpolation value of the B pixel that surrounds the R pixel is replaced with an R pixel value at the R pixel position, and is interpolated as a B pixel value @R pixel position. At the sampling position of the mosaic image associated with the pixel position of the color image and the B @ R plane generation unit to generate, the R plane, the Gr plane, the Gb plane, the B plane, the R @ B plane, and the B @ R plane The pixel value is interpolated and generated for each of the sampling means for generating the sampling value for each plane, and the R plane, Gr plane, and Gb pre-generated via the sampling means. , B plane, R @ B plane, B @ R plane sampling values are combined to generate luminance of each pixel of the color image, so that the red image and the blue image Zipper artifacts appearing at the border of the image can be effectively suppressed, and high-quality luminance can be generated at any pixel position regardless of the pixel position of the color mosaic image.

また、本発明の画像処理装置、画像処理方法及び画像処理プログラムは、輝度を生成する際に、Rプレーンのサンプリング値とR@Bプレーンのサンプリング値とを略1:2の割合で合成することにより、赤系画像境界に現れるジッパーアーチファクトを効果的に抑制することができ、Bプレーンのサンプリング値とB@Rプレーンのサンプリング値とを略1:2の割合で合成することにより、青系画像境界に現れるジッパーアーチファクトを効果的に抑制することができる。   The image processing apparatus, the image processing method, and the image processing program of the present invention synthesize the sampling value of the R plane and the sampling value of the R @ B plane at a ratio of approximately 1: 2 when generating the luminance. Thus, zipper artifacts appearing at the red image boundary can be effectively suppressed, and the blue image is synthesized by synthesizing the sampling value of the B plane and the sampling value of the B @ R plane at a ratio of approximately 1: 2. Zipper artifacts appearing at the boundary can be effectively suppressed.

本発明が適用された第1の実施形態における、撮像装置の構成を表したブロック図である。1 is a block diagram illustrating a configuration of an imaging apparatus in a first embodiment to which the present invention is applied. ベイヤー配列の構成を表した図である。It is a figure showing the composition of a Bayer arrangement. 同第1の実施形態における、各画素の輝度を生成する説明図であって、(a)がSwitchY生成部で生成された仮の輝度Yを表し、(b)が輝度Yを補正すべく生成された輝度補正値Dを表し、(c)が仮の輝度Yから輝度補正値Dの所定量を減じて補正された輝度Yを表した図である。In the first embodiment, a diagram for generating the luminance of each pixel represents the luminance Y 0 tentative (a) is generated by the SwitchY generator, to correct the luminance Y 0 is (b) FIG. 5C is a diagram showing a luminance correction value D generated accordingly, and FIG. 8C shows a luminance Y 1 corrected by subtracting a predetermined amount of the luminance correction value D from the provisional luminance Y 0 . 同第1の実施形態における、画像処理方法及び画像処理プラグラムの手順を表したフローチャートである。It is a flowchart showing the procedure of the image processing method and image processing program in the said 1st Embodiment. 本発明が適用された第2の実施形態における、撮像装置の構成を表したブロック図である。It is a block diagram showing the structure of the imaging device in 2nd Embodiment to which this invention was applied. 同第2の実施形態における、B@Rプレーン及びR@Bプレーン生成する説明図である。It is explanatory drawing which produces | generates the B @ R plane and R @ B plane in the said 2nd Embodiment. 同第2の実施形態における、サンプリングの説明図である。It is explanatory drawing of sampling in the said 2nd Embodiment. 同第2の実施形態における、画像処理方法及び画像処理プラグラムの手順を表したフローチャートである。It is a flowchart showing the procedure of the image processing method and image processing program in the said 2nd Embodiment. 従来例における、ジッパーアーチファクトの発生原理を説明する図であって、(a)がベイヤー配列における青と赤の画像境界を表した図、(b)が(a)に対応付けて各画素位置に画素値を付与した図、(c)が画素毎に輝度値が生成された図である。In the conventional example, it is a figure explaining the generation principle of a zipper artifact, Comprising: (a) is a figure showing the blue and red image boundary in a Bayer arrangement, (b) is associated with (a) at each pixel position. The figure which gave the pixel value, (c) is the figure by which the luminance value was produced | generated for every pixel.

(第1の実施形態)
次に、本発明の画像処理装置、画像処理方法及び画像処理プログラムの一実施例を図面にもとづいて説明する。
(First embodiment)
Next, an embodiment of an image processing apparatus, an image processing method, and an image processing program according to the present invention will be described with reference to the drawings.

図1は本発明が適用された第1の実施形態における撮像装置の構成を表したブロック図、図2は同実施形態におけるベイヤー配列の色モザイク画像の構成を表した図、図3は同実施形態における輝度生成の説明図であって、(a)がSwitchY生成部で生成された仮の輝度Yを表し、(b)が輝度Yを補正すべく生成された補正値Dを表し、(c)が仮の輝度Yから補正値Dの所定量を減じて補正された輝度Yを表した図である。また、図4は、同実施形態における、画像処理方法及び画像処理プラグラムの手順を表したフローチャートである。 FIG. 1 is a block diagram showing the configuration of an imaging apparatus according to the first embodiment to which the present invention is applied, FIG. 2 is a diagram showing the configuration of a color mosaic image with a Bayer arrangement in the same embodiment, and FIG. a diagram of a luminance generation in the form, (a) represents a luminance Y 0 tentative generated by SwitchY generator represents the correction value D (b) is generated so as to correct the luminance Y 0, (c) is a diagram showing a luminance Y 1 that is corrected by subtracting a predetermined amount of the correction value D from the luminance Y 0 tentative. FIG. 4 is a flowchart showing the procedure of the image processing method and the image processing program in the embodiment.

図1に表したように、撮像装置1は、被写体像を撮像素子5に導いてデジタル画像信号C(モザイク状の画像信号である)として出力する撮像ユニット2と、撮像ユニット2を介して出力されたデジタル画像信号Cに基づいて、画素毎に複数の色情報を備えたカラー画像を生成する画像処理装置100とによって構成されている。   As illustrated in FIG. 1, the imaging apparatus 1 includes an imaging unit 2 that guides a subject image to the imaging element 5 and outputs the image as a digital image signal C (a mosaic image signal), and outputs the image via the imaging unit 2. The image processing apparatus 100 generates a color image having a plurality of pieces of color information for each pixel based on the digital image signal C.

撮像ユニット2には、被写体像Pを撮像素子5に導く撮像レンズ3、受光した撮像光を電気量に変換して出力する撮像素子(例えばCCD:Charge Coupled Devices)5、撮像素子5から出力されるアナログ画像信号をデジタル画像信号Cに変換して出力するAFE(Analog Front End)6、撮像素子5及びAFE6を所定の周期で制御するTG(Timing Generator)13、撮像レンズ3の光軸方向(図3中のZ方向)のスライド駆動を行うレンズ駆動部12、センサ11を介して撮像レンズ3のZ方向のスライド量を検出する検出部10等が備えられている。なお、本発明は、撮像レンズ3、レンズ駆動部12、センサ11、検出部10等の有無に限定されるものではなく、後述のように、RGB3色のベイヤー配列のカラーフィルタを有する撮像素子5を介して出力される色モザイク画像の画像処理に係るものである。   The imaging unit 2 is output from the imaging lens 3 that guides the subject image P to the imaging device 5, the imaging device 5 that converts the received imaging light into an electrical quantity and outputs the same (for example, CCD: Charge Coupled Devices) 5, and the imaging device 5. AFE (Analog Front End) 6 that converts the analog image signal to be converted into a digital image signal C and outputs it, TG (Timing Generator) 13 that controls the image sensor 5 and AFE 6 at a predetermined cycle, and the optical axis direction of the imaging lens 3 ( A lens driving unit 12 that performs slide driving in the Z direction in FIG. 3, a detection unit 10 that detects the sliding amount of the imaging lens 3 in the Z direction via the sensor 11, and the like are provided. Note that the present invention is not limited to the presence or absence of the imaging lens 3, the lens driving unit 12, the sensor 11, the detection unit 10, and the like, and as will be described later, the imaging device 5 having a color filter with an RGB three-color Bayer array. This relates to the image processing of the color mosaic image output via.

撮像素子5は、複数の光電変換素子がマトリクス状に並設されて構成され、夫々の光電変換素子毎に撮像信号を光電変換してアナログ画像信号を出力するように構成されている。   The imaging element 5 is configured by arranging a plurality of photoelectric conversion elements in a matrix, and is configured to photoelectrically convert an imaging signal for each photoelectric conversion element and output an analog image signal.

また、撮像素子5は、光電変換素子に対応付けてR(赤)G(緑)B(青)3色のベイヤー(Bayer)配列からなるカラーフィルタ5aを備え、各色のフィルタ部を通過した光量を電気信号に変換する。   The image sensor 5 includes a color filter 5a having a Bayer array of three colors R (red), G (green), and B (blue) in association with the photoelectric conversion elements, and the amount of light that has passed through the filter portions of the respective colors. Is converted into an electrical signal.

AFE6は、撮像素子5を介して出力されたアナログ画像信号に対してノイズを除去する相関二重サンプリング回路(CDS:Corelated Double Sampling)7、相関二重サンプリング回路7で相関二重サンプリングされた画像信号を増幅する可変利得増幅器(AGC:Automatic Gain Control)8、可変利得増幅器9を介して入力された撮像素子5からのアナログ画像信号をデジタル画像信号に変換するA/D変換器9、等によって構成され、撮像素子5から出力された画像信号を、光電変換素子に対応付けてデジタル画像信号Cに変換して画像処理装置100に出力する。   The AFE 6 is a correlated double sampling circuit (CDS: Correlated Double Sampling) 7 that removes noise from the analog image signal output via the image sensor 5, and an image that has been correlated double sampled by the correlated double sampling circuit 7. A variable gain amplifier (AGC) 8 that amplifies the signal, an A / D converter 9 that converts an analog image signal from the image sensor 5 input through the variable gain amplifier 9 into a digital image signal, and the like The image signal configured and output from the image sensor 5 is converted into a digital image signal C in association with the photoelectric conversion element and output to the image processing apparatus 100.

なお、撮像ユニット2において、撮像素子5、相関二重サンプリング回路7、可変利得増幅器8、A/D変換器9等に代えて、CMOS(Complementary Metal Oxide Semiconductor)センサを用いてもよい。撮像素子5から出力される画素毎の信号が単一色の情報しかもたないので、撮像ユニット2から画像処理装置100に、モザイク状の画像信号が出力される。   In the imaging unit 2, a CMOS (Complementary Metal Oxide Semiconductor) sensor may be used instead of the imaging device 5, the correlated double sampling circuit 7, the variable gain amplifier 8, the A / D converter 9, and the like. Since the signal for each pixel output from the image pickup device 5 has only single color information, a mosaic image signal is output from the image pickup unit 2 to the image processing apparatus 100.

次に、画像処理装置100は、撮像ユニット2から出力されたモザイク画像を、R、Gr、Gb、Bの画素毎に分離する色プレーン分解部21、色プレーン分解部21から出力された画素信号にもとづいてカラー画像の画素位置におけるカラー画像信号としての輝度を生成する輝度生成部25及び色差を生成する色差生成部30を備えている。   Next, the image processing apparatus 100 separates the mosaic image output from the imaging unit 2 for each of R, Gr, Gb, and B pixels, and the pixel signal output from the color plane decomposition unit 21 A luminance generation unit 25 for generating luminance as a color image signal at a pixel position of the color image based on the color difference and a color difference generation unit 30 for generating color difference are provided.

また、画像処理装置100は、輝度生成部25及び色差生成部30から出力されたカラー画像信号に対してカラー画像の見栄えを良くするために公知のガンマ補正や彩度補正、エッジ強調を行う視覚補正部34、視覚補正部34を介して出力されたカラー画像を例えばJPEG等の方法で圧縮する圧縮部35、圧縮部35を介して出力されたカラー画像を例えばフラッシュメモリ等の記録媒体に記憶する記録部36、CPU(Central Processing Unit)18、ROM(Red Only Memory)19等によって構成され、CPU18がROM19に格納された制御用プログラムに従って、当該画像処理装置100及び撮像装置1の各処理を制御する。   The image processing apparatus 100 also performs a known gamma correction, saturation correction, and edge enhancement for improving the appearance of the color image with respect to the color image signals output from the luminance generation unit 25 and the color difference generation unit 30. The color image output through the correction unit 34 and the visual correction unit 34 is compressed by a method such as JPEG, and the color image output through the compression unit 35 is stored in a recording medium such as a flash memory. Recording unit 36, CPU (Central Processing Unit) 18, ROM (Red Only Memory) 19 and the like. The CPU 18 performs each process of the image processing apparatus 100 and the imaging apparatus 1 according to a control program stored in the ROM 19. Control.

色プレーン分解部21は、図2に表したベイヤー配列に対応付けられて、Rの画素信号を記憶するRフィールドメモリ22と、Gr(一方向においてRに隣接するR)の画素信号を記憶するGrフィールドメモリ23aと、Gb(一方向においてBに隣接するR)の画素信号を記憶するGbフィールドメモリ23bと、Bの画素信号を記憶するBフィールドメモリ24と、によって構成され、CPU18からの指令に基づき、これらの画素信号を輝度生成部25及び色差生成部30に出力する。なお、各色フィールドメモリは、仮想的な物であり、実際には各色フィールドが単一のメモリ上で区別可能なように各色フィールドをアドレスによって振り分けてもよい。   The color plane separation unit 21 is associated with the Bayer array illustrated in FIG. 2 and stores an R field memory 22 that stores R pixel signals and a pixel signal of Gr (R adjacent to R in one direction). A Gr field memory 23a, a Gb field memory 23b that stores a pixel signal of Gb (R adjacent to B in one direction), and a B field memory 24 that stores a pixel signal of B. Based on the above, these pixel signals are output to the luminance generation unit 25 and the color difference generation unit 30. Note that each color field memory is a virtual object, and in actuality, each color field may be assigned by address so that each color field can be distinguished on a single memory.

次に、輝度生成部25は、色モザイク画像の配列におけるR、G、B毎に対象点(注目画素)を包含する画素範囲が設定されて、この画素範囲に位置するR、G、Bの画素値にもとづいて対象点の輝度を生成する。   Next, the luminance generation unit 25 sets a pixel range including the target point (target pixel) for each of R, G, and B in the arrangement of the color mosaic images, and sets the R, G, and B positions in this pixel range. The luminance of the target point is generated based on the pixel value.

輝度生成部25は、注目画素及び注目画素の周囲の画素の画素値に所定の係数を掛けて合計し仮の輝度Yを生成するSwitchY生成部26、色モザイク画像からGの画素を除いてR及びBの画素値のみからなるRBプレーンを生成するRBプレーン生成部27、RBプレーンに対して所定の帯域フィルタを掛けて輝度の補正値Dを生成する輝度補正値生成部28、仮の輝度Yから補正値Dに所定の係数を乗じた量を減じて第二の輝度Yを生成する輝度補正部29等によって構成されている。 Luminance generation section 25, SwitchY generator 26 for generating a luminance Y 0 provisional sum multiplied by a predetermined coefficient to the pixel value of the pixels surrounding the target pixel and the target pixel, the color mosaic image except for pixels of G An RB plane generation unit 27 that generates an RB plane consisting only of R and B pixel values, a luminance correction value generation unit 28 that generates a luminance correction value D by applying a predetermined bandpass filter to the RB plane, and provisional luminance A luminance correction unit 29 that generates a second luminance Y 1 by subtracting an amount obtained by multiplying the correction value D by a predetermined coefficient from Y 0 is configured.

詳しくは、SwitchY生成部26において、色モザイク画像における注目画素を中心として3×3の画素範囲内に位置する各画素値に(式1)で表したローパスフィルタを掛けて画素値を合計し、注目画素の仮の輝度Yが求められる。つまり、注目画素を中心としたuv方向3画素を設定して各画素位置に応じた重み付けをし、これらの和を注目画素の仮の輝度Yとしている。なお、本実施例では、図9(a)に表したように、色モザイク画像が、画像境界Lを介して、右上領域に(R,G,B)=(0,0,1)の輝度を持ち、左下領域に(R,G,B)=(1,0,0)の輝度を持つように、青と赤の画像が画成されて結像しているものとし、以下に説明する。 Specifically, in the SwitchY generation unit 26, each pixel value located in the 3 × 3 pixel range centered on the pixel of interest in the color mosaic image is multiplied by the low-pass filter expressed by (Equation 1), and the pixel values are totaled. luminance Y 0 provisional of the pixel of interest is calculated. That is, three pixels in the uv direction centered on the target pixel are set and weighted according to each pixel position, and the sum of these is set as the temporary luminance Y 0 of the target pixel. In this embodiment, as shown in FIG. 9A, the color mosaic image has a luminance of (R, G, B) = (0, 0, 1) in the upper right region via the image boundary L. And a blue and red image are formed so as to have a luminance of (R, G, B) = (1, 0, 0) in the lower left region, and will be described below. .

SwitchY生成部26では、図3(a)に表したように仮の輝度Yが求められる。図3(a)において、各画素位置に記入された画素値の1/16が仮の輝度Y(所謂、本発明における第一の輝度である)である。例えば、図3(a)における(u,v)=(1,1)に位置する画素A11の輝度Yは、Y=(A00×1+A10×2+A20×1+A01×2+A11×4+A21×2+A02×1+A12×2+A22×1)/16の演算式で算出され、図9(b)を参照してこの演算式にA00=0、A10=0、A20=0、A01=0、A11=0、A21=1、A02=0、A12=1、A22=0、を代入すると、Y=4/16が得られる。 In SwitchY generator 26, the luminance Y 0 provisional as shown in FIGS. 3 (a) is determined. In FIG. 3A, 1/16 of the pixel value entered at each pixel position is a provisional luminance Y 0 (so-called first luminance in the present invention). For example, the luminance Y 0 of the pixel A 11 located at (u, v) = (1, 1) in FIG. 3A is Y 0 = (A 00 × 1 + A 10 × 2 + A 20 × 1 + A 01 × 2 + A 11 × 4 + a 21 × 2 + a 02 × 1 + a 12 × 2 + a 22 × 1) / 16 is calculated by the calculation equation, a 00 = 0 on the calculation equation with reference to FIG. 9 (b), a 10 = 0, a 20 = 0 Substituting A 01 = 0, A 11 = 0, A 21 = 1, A 02 = 0, A 12 = 1, and A 22 = 0, Y 0 = 4/16 is obtained.

そして、RBプレーン生成部27では、色モザイク画像におけるGの画素に位置する画素値が0となるので、図9(b)と同じ様に画像境界Lを介して右上領域域のB画素と左下領域のR画素の位置に画素値を有するRBプレーンが生成される。   In the RB plane generation unit 27, since the pixel value located at the G pixel in the color mosaic image is 0, the B pixel in the upper right region and the lower left region are passed through the image boundary L as in FIG. 9B. An RB plane having a pixel value at the position of the R pixel in the region is generated.

次に、輝度補正値生成部28では、RBプレーン生成部27で生成されたRBプレーンにおいて、注目画素を中心として5×5の画素範囲内に位置する各画素値に(式2)で表した帯域フィルタを掛けて画素値を合計し、注目画素における輝度の補正値Dを求める。つまり、注目画素を中心としたuv方向5画素を設定して画素位置に応じた重み付けをし、これらの和を注目画素の補正値Dとしている。

Figure 2013066214
Next, in the luminance correction value generation unit 28, each pixel value located within the 5 × 5 pixel range with the target pixel as the center in the RB plane generated by the RB plane generation unit 27 is expressed by (Expression 2). The pixel values are summed by applying a bandpass filter, and the luminance correction value D at the target pixel is obtained. That is, five pixels in the uv direction centered on the target pixel are set and weighted according to the pixel position, and the sum of these is set as the correction value D of the target pixel.
Figure 2013066214

そして、図3(b)に表したようにBの画素とRの画素に補正値Dが生成される。図3(b)において、各画素位置に記入された数値の1/64が補正値Dである。例えば、図3(a)における(u,v)=(3,2)に位置する画素A32の補正値Dは、D=(A10×(−1)+A20×(−2)+A30×(−2)+A40×(−2)+A50×(−1)+A11×(−2)+A21×(0)+A31×(4)+A41×(0)+A51×(−2)+A12×(−2)+A22×(4)+A32×(12)+A42×(4)+A52×(−2)+A13×(−2)+A23×(0)+A33×(4)+A43×(0)+A53×(−2)+A14×(−1)+A24×(2)+A34×(2)+A44×(−2)+A54×(−1))/64の演算式で算出され、図9(b)を参照してこの演算式にA21、A41、A12、A43、A14、A34の画素位置の画素値を1としてその他の画素位置の画素値を0として代入すると、数値(−5)/64が得られる。 Then, as shown in FIG. 3B, the correction value D is generated for the B pixel and the R pixel. In FIG. 3B, 1/64 of the numerical value entered at each pixel position is the correction value D. For example, the correction value D of the pixel A 32 located at (u, v) = (3, 2) in FIG. 3A is D = (A 10 × (−1) + A 20 × (−2) + A 30 × (−2) + A 40 × (−2) + A 50 × (−1) + A 11 × (−2) + A 21 × (0) + A 31 × (4) + A 41 × (0) + A 51 × (−2 ) + A 12 × (−2) + A 22 × (4) + A 32 × (12) + A 42 × (4) + A 52 × (−2) + A 13 × (−2) + A 23 × (0) + A 33 × ( 4) + A 43 × (0) + A 53 × (−2) + A 14 × (−1) + A 24 × (2) + A 34 × (2) + A 44 × (−2) + A 54 × (−1)) / 64, and the pixel values at the pixel positions A 21 , A 41 , A 12 , A 43 , A 14 , and A 34 are set to 1 with reference to FIG. 9B. If the pixel values at other pixel positions are substituted as 0, a numerical value (−5) / 64 is obtained.

この際、(式2)で表した帯域フィルタは、(式3)に表したように2段階のフィルタに分けて適用しても良い。

Figure 2013066214
At this time, the bandpass filter expressed by (Expression 2) may be applied by being divided into two stages of filters as expressed by (Expression 3).
Figure 2013066214

次に、輝度補正部29では、SwitchY生成部26で生成された仮の輝度Yから補正値に係数k=2/3を乗じた量を減じて、図3(c)に表したように第二の輝度Yを求める。 Next, the brightness correcting unit 29, by subtracting the amount obtained by multiplying the coefficient k = 2/3 in the correction value from the provisional luminance Y 0 generated by SwitchY generator 26, as shown in FIG. 3 (c) second obtaining luminance Y 1.

図3(c)において、各画素位置に記入された数値の1/96が第二の輝度Yである。ここで、SwitchY生成部26で生成された仮の輝度Y(図3(a))と輝度補正部29で補正されて生成された第二の輝度Y(図3(c))とを比較すると、画像境界Lに沿って、仮の輝度Yよりも輝度Yの輝度変化が少なくて、ジッパーアーチファクトが抑制されていることが判る。 In FIG. 3 (c), 1/96 of numbers entered in each pixel position is the second luminance Y 1. Here, the provisional luminance Y 0 (FIG. 3A) generated by the SwitchY generation unit 26 and the second luminance Y 1 corrected by the luminance correction unit 29 (FIG. 3C) are used. By comparison, it can be seen that along the image boundary L, the luminance change of the luminance Y 1 is less than the temporary luminance Y 0 and the zipper artifact is suppressed.

係数kについては、k=2/3がジッパーアーチファクトの抑制のために最適であるが、0<k<(4/3)の範囲であれば、ジッパーアーチファクト抑制の効果を得ることができる。また、数値2/3が、2進数において0.101010…bと表現されるので、kを、1/2(2進数では0.1b)〜3/4(2進数では0.11b)の範囲において、2進数が簡素な数値になるように設定しても良い。   Regarding the coefficient k, k = 2/3 is optimal for suppressing zipper artifacts, but if the range is 0 <k <(4/3), the effect of suppressing zipper artifacts can be obtained. Since the numerical value 2/3 is expressed as 0.101010 ... b in binary number, k is in the range of 1/2 (0.1b in binary number) to 3/4 (0.11b in binary number). In this case, the binary number may be set to a simple numerical value.

また、輝度生成部25では、RBプレーンに対して(式2)を用いて補正値Dを求め、この補正値Dに係数を乗じた量を仮の輝度Yから減じて第二の輝度Yを算出したが、これらの代わりに、色モザイクのGの画素位置に対しては(式4)を用いて第二の輝度Yを算出し、B及びRの画素位置に対しては(式5)を用いて第二の輝度Yを算出してもよい。これにより、輝度補正部29で算出される第二の輝度Yと(式4)及び(式5)で算出される第二の輝度Yが同じ値をもつことになる。

Figure 2013066214
Figure 2013066214
Further, the luminance generation unit 25 obtains the correction value D for the RB plane using (Equation 2), and subtracts the amount obtained by multiplying the correction value D by a coefficient from the temporary luminance Y 0 to obtain the second luminance Y. was calculated 1, these alternative, for the pixel position of the G color mosaic calculates a second luminance Y 1 using (equation 4), to the pixel position of the B and R ( equation 5) second may calculate the luminance Y 1 using. As a result, the second luminance Y 1 calculated by the second luminance Y 1 and calculated by the luminance correction section 29 (Equation 4) and (5) have the same value.
Figure 2013066214
Figure 2013066214

また、(式4)及び(式5)において、左辺の5×5の行列はG画素に位置する値を0にしたものであって、この0の画素を無視すれば、注目画素を中心として周辺3×3の画素内に存在する4または5つのG画素と、周辺5×5画素内に存在する4または9つのR及びB画素が、第二の輝度Yの算出に用いられている。 In (Expression 4) and (Expression 5), the 5 × 5 matrix on the left side is obtained by setting the value located at the G pixel to 0, and if this 0 pixel is ignored, the pixel of interest is the center. Four or five G pixels present in the peripheral 3 × 3 pixels and four or nine R and B pixels present in the peripheral 5 × 5 pixels are used for calculating the second luminance Y 1 . .

また、第二の輝度Yを算出する際に、G画素のみを取り出したGプレーンに(式1)のフィルタを掛け、一方、R及びB画素のみを取り出したRBプレーンに対しては(式6)のフィルタを掛け、両フィルタを介して出力された画素値の和を第二の輝度Yとしてもよい。

Figure 2013066214
Also, when calculating the second brightness Y 1, the G plane obtained by extracting only G pixels multiplied by the filter (Equation 1), whereas, for the RB plane obtained by extracting only the R and B pixel (formula multiplied by the filter 6), may be the sum of the pixel values output through both filters as the second luminance Y 1.
Figure 2013066214

また、(式6)のフィルタは、(式7)に表したように2段階のフィルタで構成してもよい。

Figure 2013066214
Further, the filter of (Expression 6) may be configured by a two-stage filter as expressed in (Expression 7).
Figure 2013066214

次に、色差生成部30は、注目画素を中心とする所定の画素範囲に含まれる各画素値を用いて、注目画素の色成分となる色差C1及び色差C2を生成する。ここで、C1は、Grの画素信号とGbの画素信号との和からRの画素信号とBの画素信号とを減じた値を表し、一方、C2は、Rの画素信号とBの画素信号の差を表す。具体的には、所定の画素範囲において、R:G:B=(−1):2:(−1)の構成比となるようにC1を生成し、一方、R:G:B=2:0:(−2)の構成比となるようにC2を生成する。   Next, the color difference generation unit 30 generates a color difference C1 and a color difference C2 that are color components of the target pixel using each pixel value included in a predetermined pixel range centered on the target pixel. Here, C1 represents a value obtained by subtracting the R pixel signal and the B pixel signal from the sum of the Gr pixel signal and the Gb pixel signal, while C2 represents the R pixel signal and the B pixel signal. Represents the difference between Specifically, in a predetermined pixel range, C1 is generated so that the composition ratio of R: G: B = (− 1): 2: (− 1), while R: G: B = 2: C2 is generated so that the composition ratio is 0: (− 2).

C1、C2の生成の一例として、以下に記載する。まず、注目画素を中心とする画素範囲において、注目画素がG画素の際には色モザイク画像に(式8)のフィルタを施し、注目画像がB、R画素の際には色モザイク画像に(式9)のフィルタを施し、その結果を注目画素位置における色差C1とする。

Figure 2013066214
Figure 2013066214
An example of generation of C1 and C2 is described below. First, in the pixel range centered on the target pixel, the filter of (Equation 8) is applied to the color mosaic image when the target pixel is the G pixel, and to the color mosaic image when the target image is the B and R pixels ( The filter of Expression 9) is applied, and the result is set as the color difference C1 at the target pixel position.
Figure 2013066214
Figure 2013066214

また、注目画素を中心とする画素範囲において、R画素に対しては色モザイク画像に(式10)のフィルタを施し、Gr画素に対しては色モザイク画像に(式11)のフィルタを施し、Gb画素に対しては色モザイク画像に(式12)のフィルタを施し、B画素に対しては色モザイク画像に(式13)のフィルタを施し、その結果を注目画素位置における色差C2とする。なお、本発明は輝度生成に係る発明であって、色差の生成に制限されるものではない。

Figure 2013066214
Figure 2013066214
Figure 2013066214
Figure 2013066214
Further, in the pixel range centered on the target pixel, the filter of (Equation 10) is applied to the color mosaic image for the R pixel, and the filter of (Equation 11) is applied to the color mosaic image for the Gr pixel. For the Gb pixel, the filter of (Equation 12) is applied to the color mosaic image, and for the B pixel, the filter of (Equation 13) is applied to the color mosaic image, and the result is the color difference C2 at the target pixel position. Note that the present invention is an invention relating to luminance generation, and is not limited to generation of color differences.
Figure 2013066214
Figure 2013066214
Figure 2013066214
Figure 2013066214

次に、視覚補正部34は、輝度信号生成部25で得られた輝度信号Y及び色差生成部で得られた色差信号C1、C2に対して所定の処理を加え、これらの色信号からなるカラー画像の見栄えを補正する。例えば、色差信号C1、C2に対して低周波フィルタ処理を施して偽色や色ノイズを低減したり、輝度信号Yに対して高周波強調を行うことで解像感を強調したりする。 Next, vision correcting unit 34 adds a predetermined processing on the luminance signal Y 1 and the color difference signals C1, C2 obtained by the color difference generation unit obtained by the luminance signal generating unit 25, consisting of the color signals Correct the appearance of the color image. For example, reducing the false color or color noise by applying a low-frequency filtering on the color difference signals C1, C2, or emphasize a sense of resolution by performing high frequency enhancement on the luminance signal Y 1.

なお、本発明の実施例によって生成される輝度信号Yは、SwitchY方式で生成あれる輝度信号Yに較べて、白黒被写体におけるfs/4(fsは、サンプリング周波数である)付近の変調度が低減するので、視覚補正部34を介してfs/4付近の変調度を高めるように高周波強調を行うことが望ましい。 Note that the luminance signal Y 1 generated by the embodiment of the present invention has a modulation factor near fs / 4 (fs is a sampling frequency) in a black and white subject, as compared with the luminance signal Y 0 generated by the SwitchY method. Therefore, it is desirable to perform high frequency emphasis so as to increase the degree of modulation near fs / 4 via the visual correction unit 34.

また視覚補正部34は、圧縮部35で画像信号を圧縮する際に、標準的なカラー画像の色空間座標としてYUV色度座標が用いられるので、輝度生成部25で生成された輝度信号Y及び色差生成部35で生成された色差C1、C2をYUV値へ変換する(Yが画素の輝度、Uが輝度Yと青(B)との色差、Vが輝度Yと赤(R)との色差である)。詳しくは、輝度生成部25で生成された輝度信号Y及び色差生成部30で生成された色差C1、C2から(式14)の関係があるため、(式15)を用いてYUV値へ変換を行う。

Figure 2013066214
Figure 2013066214
Further, when the compression unit 35 compresses the image signal, the visual correction unit 34 uses the YUV chromaticity coordinates as the color space coordinates of the standard color image, so the luminance signal Y 0 generated by the luminance generation unit 25 is used. The color differences C1 and C2 generated by the color difference generation unit 35 are converted into YUV values (Y is the luminance of the pixel, U is the color difference between the luminance Y and blue (B), and V is the luminance Y and red (R)). Color difference). For more conversion, because of the relationship between the luminance signal Y 0 and color difference C1 generated by the color difference generation unit 30, C2 which is generated by the luminance generation section 25 (Equation 14), the YUV values using equation (15) I do.
Figure 2013066214
Figure 2013066214

次に、図4を用いて、前記第1の実施形態の、画像処理方法及び画像処理プラグラムの手順を説明する。この手順は、CPU18がROM19に格納されたプログラムにもとづいて、各機能部に指令信号を与えて実行する。また、図4におけるSはステップを表している。   Next, the procedure of the image processing method and the image processing program of the first embodiment will be described with reference to FIG. This procedure is executed by the CPU 18 giving a command signal to each functional unit based on a program stored in the ROM 19. Further, S in FIG. 4 represents a step.

まず、この手順は、オペレータによって撮像装置1又は画像処理装置100に起動信号が入力された際にスタートする。   First, this procedure starts when an activation signal is input to the imaging apparatus 1 or the image processing apparatus 100 by an operator.

次いで、S100において、撮像ユニット2を介して画像信号(色モザイク画像)を画像処理装置100に読み込み、色プレーン分解部21で、ベイヤー配列に対応付けて、R画素信号、Gr画素信号、Gb画素信号、B画素信号毎に記憶し、その後、S200に移る。   Next, in S100, an image signal (color mosaic image) is read into the image processing apparatus 100 via the imaging unit 2, and the R plane signal, the Gr pixel signal, and the Gb pixel are associated with the Bayer array by the color plane decomposition unit 21. Each signal and B pixel signal is stored, and then the process proceeds to S200.

次いで、S200において、色モザイク画像の画素配列に対応して対象点(注目画素)を設定し、その後、S300に移る。この際、設定される対象点は、色モザイク画像のいずれかの画素であり、ROM19に格納されたプログラムにより決定される。   Next, in S200, a target point (target pixel) is set corresponding to the pixel arrangement of the color mosaic image, and then the process proceeds to S300. At this time, the target point to be set is any pixel of the color mosaic image, and is determined by a program stored in the ROM 19.

次いで、S300において、対象点(注目画素)の輝度を生成する。詳しくは、図4(b)に表したように、S310において、SwitchY生成部26を用い、色モザイク画像における注目画素を中心として3×3の行列に位置する各画素値に(式1)で表したローパスフィルタを掛けて画素値を合計し、注目画素の仮の輝度Yを求め、その後、S340に移る。 Next, in S300, the luminance of the target point (target pixel) is generated. Specifically, as illustrated in FIG. 4B, in S310, the SwitchY generation unit 26 is used, and each pixel value positioned in a 3 × 3 matrix centered on the pixel of interest in the color mosaic image is expressed by (Expression 1). by applying a low-pass filter that represents the sum of the pixel values to obtain the luminance Y 0 of the temporary target pixel, then it goes to S340.

一方、S320において、RBプレーン生成部27を用い、色モザイク画像におけるG画素に位置する画素値を0とし、R及びB画素のみが画素値を有するRBプレーンを生成し、その後、S330に移る。   On the other hand, in S320, the RB plane generating unit 27 is used to generate an RB plane in which the pixel value located at the G pixel in the color mosaic image is 0 and only the R and B pixels have pixel values, and then the process proceeds to S330.

次いで、S330において、輝度補正値生成部28を用い、RBプレーン生成部27で生成されたRBプレーンにおいて、注目画素を中心として5×5の行列に位置する各画素値に(式2)で表した帯域フィルタを掛けて注目画素における補正値Dを生成し、その後、S340に移る。   Next, in S330, the brightness correction value generation unit 28 is used, and in the RB plane generated by the RB plane generation unit 27, each pixel value located in a 5 × 5 matrix with the target pixel as the center is expressed by (Expression 2). The correction value D at the target pixel is generated by applying the bandpass filter, and then the process proceeds to S340.

次いで、S340において、輝度補正部29を用い、S310で生成した仮の輝度YからS330で生成した補正値Dに所定の係数kを乗算した量を減じて輝度Yを求め、その後、図4(a)のS500に移る。 Then, in S340, using the luminance correction unit 29 obtains a luminance Y 1 by subtracting the amount obtained by multiplying a predetermined coefficient k from the luminance Y 0 tentative generated in the correction value D generated at S330 in S310, then, FIG. The process proceeds to S500 of 4 (a).

次いで、S500において、輝度を生成する次の対象点(注目画素)が有るか否かを判定し、次の対象点が有る(Yes)際には、S200〜500を繰り返し、次の対象点(注目画素)が無い(No)となった際に、S600に移る。   Next, in S500, it is determined whether or not there is a next target point (target pixel) for generating luminance. When there is a next target point (Yes), S200 to 500 are repeated, and the next target point ( When there is no (pixel of interest) (No), the process proceeds to S600.

次いで、S600において、視覚補正部34を用い、輝度生成部25及び色差生成部30で生成されたカラー画像信号(輝度Y、色差C1、色差C2)に対して、画像の見栄えを良くするための画像補正、標準的なカラー画像の色空間座標であるYUV色度座標への変換等を行い、その後、S700に移る。 Then, in S600, using a vision correcting unit 34, the color image signal generated by the luminance generation section 25 and a color difference generating section 30 (luminance Y 1, chrominance C1, chrominance C2) with respect to, for improving the appearance of the image Image correction, conversion to YUV chromaticity coordinates, which are color space coordinates of a standard color image, and the like, and then the process proceeds to S700.

次いで、S700において、圧縮部35を用いて、視覚補正部34を介して出力されたカラー画像のデジタル画像信号をJPEG(Joint Photographic Experts Group)等の方法で圧縮し、記録時の画像データのサイズを小さくし、その後、S800に移る。   Next, in S700, the digital image signal of the color image output via the visual correction unit 34 is compressed by a method such as JPEG (Joint Photographic Experts Group) using the compression unit 35, and the size of the image data at the time of recording is recorded. After that, the process proceeds to S800.

次いで、S800において、記録部36を用いて、圧縮されたデジタル画像信号をフラッシュメモリ等の記録媒体に記憶し、その後、本画像処理プログラムを終了する。   In step S800, the compressed digital image signal is stored in a recording medium such as a flash memory using the recording unit 36, and then the image processing program ends.

以上のように、第1の実施形態に記載の画像処理装置100及び画像処理方法及び画像処理プログラムによれば、色モザイク画像から、SwitchY生成部26を用いて仮の輝度Yを生成するとともに、RBプレーン生成部27及び輝度補正値生成部28を用いて補正値Dを生成し、次いで、輝度補正部29を用いて、輝度Yから補正値を減算し、ジッパーアーチファクトを抑制した輝度Yを生成でき、高品位なカラー画像を得ることができる。 As described above, according to the image processing apparatus 100 and the image processing method and image processing program according to the first embodiment, the color mosaic image, and generates a luminance Y 0 provisional using SwitchY generator 26 , using the RB plane generating unit 27 and the luminance correction value generation unit 28 generates the correction value D, then, using the luminance correction unit 29 subtracts the correction value from the luminance Y 0, the luminance Y which suppresses zipper artifact 1 can be generated, and a high-quality color image can be obtained.

(第2の実施形態)
次に、図5〜図8を用いて、本発明の第2の実施形態を説明する。図5は、本発明の画像処理装置及び画像処理方法、画像処理プログラムが適用された一実施例の、撮像装置1Aの構成を表したブロック図である。
(Second Embodiment)
Next, a second embodiment of the present invention will be described with reference to FIGS. FIG. 5 is a block diagram showing the configuration of the imaging apparatus 1A according to an embodiment to which the image processing apparatus, the image processing method, and the image processing program of the present invention are applied.

また、図6は同第2の実施形態におけるB@Rプレーン及びR@Bプレーン生成する説明図、図7は同第2の実施形態における色生成の際のサンプリングの説明図、図8は同第2の実施形態における画像処理方法及び画像処理プラグラムの手順を表したフローチャートである。   FIG. 6 is an explanatory diagram for generating the B @ R plane and the R @ B plane in the second embodiment, FIG. 7 is an explanatory diagram for sampling in the color generation in the second embodiment, and FIG. It is a flowchart showing the procedure of the image processing method and image processing program in 2nd Embodiment.

尚、第2の実施形態における撮像装置1Aは、基本的に第1の実施形態で表した撮像装置1と同じ構成なので、共通と成る構成部分につては同一の符号を付与して詳細な説明を省き、特徴と成る部分について以下に説明する。   Note that the imaging apparatus 1A in the second embodiment is basically the same in configuration as the imaging apparatus 1 shown in the first embodiment, and therefore, the same components are assigned the same reference numerals and detailed description is given. The following is a description of the characteristic features.

本発明における撮像ユニット2Aでは、レンズ駆動部12を介して、撮像レンズ3が光軸方向にスライド自在に構成され、撮像レンズ3の焦点距離や撮像レンズ3から被写体までの被写体距離といったレンズステートを可変可能に構成されている。   In the imaging unit 2A according to the present invention, the imaging lens 3 is configured to be slidable in the optical axis direction via the lens driving unit 12, and the lens state such as the focal length of the imaging lens 3 and the subject distance from the imaging lens 3 to the subject is set. It is configured to be variable.

図5に表したように、撮像ユニット2Aには、当該撮像装置1Aのブレを検知し、そのブレ量に応じた電気信号(以下、ブレ信号という)を出力する角速度センサ(例えば、ジャイロ)15が備えられ、画像処理装置100Aには角速度センサ15を介して撮像装置1Aのブレ量を検出するブレ検出部40が備えられている。   As shown in FIG. 5, an angular velocity sensor (for example, a gyroscope) 15 that detects a shake of the image pickup apparatus 1 </ b> A and outputs an electrical signal (hereinafter referred to as a shake signal) corresponding to the shake amount of the image pickup unit 2 </ b> A. The image processing apparatus 100A is provided with a blur detection unit 40 that detects the blur amount of the imaging apparatus 1A via the angular velocity sensor 15.

また、画像処理装置100Aは、撮像ユニット2Aから出力された入力画像(モザイク画像)を、R、Gr、Gb、Bの画素毎に分離して記憶する色プレーン分解部21、焦点距離や被写体との距離といった撮像レンズ3のレンズステートを検出するレンズステート検出部37、撮像レンズ3のレンズステートに対応付けて歪曲収差係数を記憶した収差係数記憶テーブル38、レンズステート検出部37及び収差係数記録部38からの情報に基づいて歪曲収差のパラメータを設定する収差係数設定部39、ブレ検出部40からの検出値に基づくブレ補正や収差係数設定部39からの設定値に基づく収差補正を行うように、入力画像におけるサンプリング位置を設定するサンプリング座標設定部41等を備えている。   The image processing apparatus 100A also separates the input image (mosaic image) output from the imaging unit 2A for each of R, Gr, Gb, and B pixels, stores the color plane decomposition unit 21, the focal length, and the subject. A lens state detection unit 37 for detecting the lens state of the imaging lens 3 such as a distance, an aberration coefficient storage table 38 storing a distortion aberration coefficient in association with the lens state of the imaging lens 3, a lens state detection unit 37, and an aberration coefficient recording unit. An aberration coefficient setting unit 39 that sets parameters for distortion aberration based on information from 38, blur correction based on detection values from the blur detection unit 40, and aberration correction based on setting values from the aberration coefficient setting unit 39 are performed. A sampling coordinate setting unit 41 for setting a sampling position in the input image is provided.

また、画像処理装置100Aは、Bの画素配置おいて、B画素を囲むRの画素の補間値をBの画素値に置き換えてR画素値@B画素位置(以下、R@Bと記す)として補間生成するR@Bプレーン生成部51、Rの画素位置おいて、R画素を囲むBの画素の補間値をRの画素値に置き換えてB画素値@R画素位置(以下、B@Rと記す)として補間生成するB@Rプレーン生成部52、モザイク画像のサンプリング位置において、Rプレーン、Grプレーン、Gbプレ−ン、Bプレーン、R@Bプレーン、B@Rプレーンの夫々毎に画素値を補間生成し、プレーン毎のサンプリング値を生成するサンプリング部53と、サンプリング部53で生成されたRプレーン、Grプレーン、Gbプレ−ン、Bプレーン、R@Bプレーン、B@Rプレーンのサンプリング値を合成して画素毎に複数の色成分を備えた色情報を生成する色生成部54等を備えている。   Further, the image processing apparatus 100A replaces the interpolation value of the R pixel surrounding the B pixel with the B pixel value in the B pixel arrangement, and sets the R pixel value @B pixel position (hereinafter referred to as R @ B). R @ B plane generation unit 51 for generating the interpolation, the interpolation value of the B pixel surrounding the R pixel is replaced with the R pixel value at the R pixel position, and the B pixel value @R pixel position (hereinafter referred to as B @ R B @ R plane generation unit 52 for generating interpolation as a pixel value at the sampling position of the mosaic image for each of the R plane, Gr plane, Gb plane, B plane, R @ B plane, and B @ R plane. Sampling unit 53 that generates sampling values for each plane, and R plane, Gr plane, Gb plane, B plane, R @ B plane, and B @ R plane generated by sampling unit 53 And a color generation unit 54 generates the color information having a plurality of color component sampling values combined and for each pixel, such as.

色プレーン分解部21は、図7に表したように、(a)のベイヤー配列の色モザイク画像から、R画素のみを取り出したRプレーン(b)、Gr画素のみを取り出したGrプレーン(c)、Gb画素のみを取り出したGbプレーン(d)、B画素のみを取り出したBプレーン(e)の、4つのプレーンに分解する。この際、R画素に対して横方向に並ぶG画素をGrとし、B画素に対して横方向に並ぶG画素をGbとしている。また、ここでは、色モザイク画像が、第1の実施形態において引用したように、画像境界Lを介して、右上領域に(R,G,B)=(0,0,1)の輝度を持ち、左下領域に(R,G,B)=(1,0,0)の輝度を持つように、青と赤の画像が画成されて結像しているものとする。   As shown in FIG. 7, the color plane separation unit 21 extracts an R plane (b) in which only R pixels are extracted from a color mosaic image in the Bayer array in (a), and a Gr plane (c) in which only Gr pixels are extracted. , Gb plane (d) from which only Gb pixels are extracted, and B plane (e) from which only B pixels are extracted. At this time, the G pixel arranged in the horizontal direction with respect to the R pixel is designated as Gr, and the G pixel arranged in the horizontal direction with respect to the B pixel is designated as Gb. Further, here, as cited in the first embodiment, the color mosaic image has a luminance of (R, G, B) = (0, 0, 1) in the upper right region via the image boundary L. Suppose that blue and red images are defined and formed so as to have a luminance of (R, G, B) = (1, 0, 0) in the lower left region.

次に、B@Rプレーン生成部51は、図6(a)〜(c)に表したように、図(a)の色モザイク画像のR画素の位置におけるB画素の値を生成する。詳しくは、B@Rプレーンは、BプレーンをR画素の位置において再サンプリングした輝度信号であり、Bプレーンに対して(式16)のフィルタを施して生成される。

Figure 2013066214
Next, as shown in FIGS. 6A to 6C, the B @ R plane generating unit 51 generates the value of the B pixel at the position of the R pixel in the color mosaic image of FIG. Specifically, the B @ R plane is a luminance signal obtained by re-sampling the B plane at the R pixel position, and is generated by applying the filter of (Equation 16) to the B plane.
Figure 2013066214

例えば、A32の画素位置におけるB@RプレーンのBの輝度信号は、A32の画素を中心とするA21、A41、A23、A43の画素値を用い、(A21×1+A41×1+A23×1+A43×1)/4の演算式で算出され、図6(b)を参照してこの演算式に、A21、A41、A43の画素値を1、A23の画素値を0として代入すると、輝度信号3/4が得られる。 For example, the luminance signal of the B @ R plane at the pixel position of A 32 B uses the pixel values of A 21, A 41, A 23 , A 43 around the pixel of the A 32, (A 21 × 1 + A 41 × 1 + A 23 × 1 + A 43 × 1) / 4, and the pixel values of A 21 , A 41 , and A 43 are set to 1, and the pixel of A 23 is calculated with reference to FIG. 6B. Substituting the value as 0 gives the luminance signal 3/4.

この結果、図6(c)に表したように、B@Rプレーンは、Rの画素位置で値を持ち、Rの画素位置を除く他の画素位置では値が0となる。   As a result, as shown in FIG. 6C, the B @ R plane has a value at the R pixel position, and a value of 0 at other pixel positions excluding the R pixel position.

次に、R@Bプレーン生成部52は、図6(a)、(d)、(e)に表したように、図(a)の色モザイク画像のB画素の位置におけるR画素の値を生成する。詳しくは、R@Bプレーンは、RプレーンをB画素の位置において再サンプリングした輝度信号であり、Rプレーンに対して(式16)のフィルタを施して生成される。   Next, as illustrated in FIGS. 6A, 6D, and 6E, the R @ B plane generation unit 52 calculates the value of the R pixel at the position of the B pixel in the color mosaic image in FIG. Generate. Specifically, the R @ B plane is a luminance signal obtained by re-sampling the R plane at the position of the B pixel, and is generated by applying the filter of (Expression 16) to the R plane.

例えば、A43の画素位置におけるR@BプレーンのRの輝度信号は、A43の画素を中心とするA32、A52、A34、A54の画素値を用い、(A32×1+A52×1+A34×1+A54×1)/4の演算式で算出され、図6(d)を参照してこの演算式に、A32、A52、A54の画素値を0、A34の画素値を1として代入すると、輝度信号1/4が得られる。 For example, the luminance signal of R of R @ B plane, using the pixel values of A 32, A 52, A 34 , A 54 around the pixel of the A 43 at the pixel position of A 43, (A 32 × 1 + A 52 × 1 + A 34 × 1 + A 54 × 1) / 4, and the pixel values of A 32 , A 52 , and A 54 are set to 0 and pixels A 34 with reference to FIG. Substituting the value as 1, the luminance signal 1/4 is obtained.

この結果、図6(e)に表したように、R@Bプレーンは、Bの画素位置で値を持ち、B画素を除く他の画素位置では値が0となる。   As a result, as shown in FIG. 6E, the R @ B plane has a value at the B pixel position, and a value of 0 at other pixel positions excluding the B pixel.

次に、サンプリング座標設定部41は、歪曲収差補正や手ぶれ補正、デジタルズームといった画像変形を考慮し、収差係数設定部39及びブレ検出部40で取得されたパラメータに基づいて、出力するカラー画像の画素位置に対応する色モザイク画像上のサンプリング座標を設定する。   Next, the sampling coordinate setting unit 41 considers image deformation such as distortion correction, camera shake correction, and digital zoom, and outputs the pixel of the color image to be output based on the parameters acquired by the aberration coefficient setting unit 39 and the shake detection unit 40. Set sampling coordinates on the color mosaic image corresponding to the position.

ここでは、色モザイク画像における(式17)に表した画素位置を、(式18)に表した出力画像上の画素位置に変形させるものとする。なお、(式18)において、(u,v)が出力画像の画素位置の座標を表し、fが画像変形の変形関数を表す。

Figure 2013066214
Figure 2013066214
Here, it is assumed that the pixel position represented by (Expression 17) in the color mosaic image is transformed into the pixel position on the output image represented by (Expression 18). In (Equation 18), (u s , v s ) represents the coordinates of the pixel position of the output image, and f represents a deformation function for image deformation.
Figure 2013066214
Figure 2013066214

例えば、出力するカラー画像の画素位置が、ズーム倍率がZ倍であれば(式19)であり、回転角度θの画像変形であれば(式20)である。この際、サンプリング座標設定部41において、(式21)に表した出力画素に対して、変形前のモザイク画像上におけるサンプリング座標(式22)を算出する。なお、画素位置は、(u,v)座標系における整数格子上に設定されているが、(式22)で算出されたサンプリング座標の値は、整数とは限らず実数となる。

Figure 2013066214
Figure 2013066214
Figure 2013066214
Figure 2013066214
For example, the pixel position of the color image to be output is (Equation 19) if the zoom magnification is Z times (Equation 19), and is the image deformation of the rotation angle θ (Equation 20). At this time, the sampling coordinate setting unit 41 calculates the sampling coordinates (formula 22) on the mosaic image before the transformation for the output pixel represented by (formula 21). The pixel position is set on an integer grid in the (u, v) coordinate system, but the value of the sampling coordinate calculated in (Equation 22) is not limited to an integer but a real number.
Figure 2013066214
Figure 2013066214
Figure 2013066214
Figure 2013066214

また、サンプリング座標設定部41において色収差補正を行う際には、変形関数fがR、G、Bの色毎に異なる関数f、f、fとなって、サンプリング座標がR、G、B毎に、(式23)、(式24)、(式25)となる。また、fを(式26)で表した恒等変換とすれば、実施形態1と同じ結果が得られる。

Figure 2013066214
Figure 2013066214
Figure 2013066214
Figure 2013066214
Further, when the chromatic aberration correction is performed in the sampling coordinate setting unit 41, the deformation function f becomes a function f R , f G , f B that is different for each color of R , G , B, and the sampling coordinates are R, G, For each B, (Expression 23), (Expression 24), and (Expression 25). If f is the identity transformation represented by (Equation 26), the same result as in the first embodiment can be obtained.
Figure 2013066214
Figure 2013066214
Figure 2013066214
Figure 2013066214

次に、サンプリング部53は、図7に表したように、色プレーン分解部21で生成された4つの色プレーン(Rプレーン、Grプレーン、Gbプレーン、Bプレーン)と、R@B生成部で生成されたR@Bプレーン、B@R生成部51で生成されたB@Rプレーンに基づいて、サンプリング座標設定部41で設定されたサンプリング位置におけるサンプリング値(サンプリング位置における色毎の画素値である)を算出する。   Next, as shown in FIG. 7, the sampling unit 53 includes four color planes (R plane, Gr plane, Gb plane, and B plane) generated by the color plane decomposition unit 21 and an R @ B generation unit. Based on the generated R @ B plane and the B @ R plane generated by the B @ R generation unit 51, the sampling value at the sampling position set by the sampling coordinate setting unit 41 (the pixel value for each color at the sampling position) Is calculated).

つまり、サンプリング座標として、Rプレーンからは(usR,vsR)、Grプレーンからは(usG,vsG)、Gbプレーンからは(usG,vsG)、Bプレーンからは(usB,vsB)、R@Bプレーンからは(usR,vsR)、B@Rプレーンからは(usB,vsB)が算出される。 In other words, as the sampling coordinates, from R plane (u sR, v sR), from Gr plane (u sG, v sG), from Gb plane (u sG, v sG), from the B plane (u sB, v sB), R @ from the B plane (u sR, v sR), B @ from R plane (u sB, v sB) is calculated.

この際、サンプリング座標(u,v)が整数と限らない(つまり、(u,v)が一つの画素中心に一致するとは限らない)ので、サンプリング値は、(u,v)を囲む4つの有値画素(各色プレーンが元々もっている同一色の画素値)から線形補間して算出する。この補間は、好ましくは、バイリニア補間によって行う。 At this time, since the sampling coordinates (u s , v s ) are not limited to integers (that is, (u s , v s ) does not necessarily match one pixel center), the sampling value is (u s , v s ) is calculated by linear interpolation from four valued pixels (pixel values of the same color that each color plane originally has). This interpolation is preferably performed by bilinear interpolation.

図7(h)に表したように、各色プレーンが縦横の格子点状に4つの有値画素を持つため、サンプリング座標401〜406を囲む4つの有値画素は、当該サンプリング座標が(100.8,101.4)であれば、サンプリング座標を囲んで一辺の長さが2の正方形の頂点に位置する。   As shown in FIG. 7H, since each color plane has four valued pixels in the form of vertical and horizontal grid points, the four valued pixels surrounding the sampling coordinates 401 to 406 have the sampling coordinates of (100. 8, 101.4), it is located at the apex of a square with a side length of 2 surrounding the sampling coordinates.

つまり、例えばRプレーンに対するサンプリング座標(usR,vsR)が(100.8,101.4)であれば、これを囲む4つの有値画素の座標(u,v)が、(100,100)、(100,102)、(102,100)、(102,102)となる。 That is, for example, if the sampling coordinates (u sR , v sR ) for the R plane are (100.8, 101.4), the coordinates (u, v) of the four valued pixels surrounding this are (100, 100). ), (100, 102), (102, 100), (102, 102).

そこで、サンプリング座標を介して対向する有値画素間の距離の比(ここでは、u方向が0.4:0.6、v方向が0.7:0.3である)を求め、4つの有値画素の画素値を用いて、サンプリング位置(100.8,101.4)におけるRの画素値を補間によって算出する。   Therefore, the ratio of the distances between the significant pixels facing each other via the sampling coordinates (here, the u direction is 0.4: 0.6 and the v direction is 0.7: 0.3) is obtained. Using the pixel value of the value pixel, the R pixel value at the sampling position (100.8, 101.4) is calculated by interpolation.

そして、4つの有値画素の画素値をR(100,100)、R(100,102)、R(102,100)、R(102,102)で表し、サンプリング位置(100.8,101.4)のRの画素値をR(100.8,101.4)で表すと、Rプレーン上でのサンプリング座標401の画素値R(100.8,101.4)を、R(100.8,101.4)=0.6*0.3*R(100,100)+0.6*0.7*R(100,102)+0.4*0.3*R(102,100)+0.4*0.7*R(102,102)、の演算式によって算出できる。   The pixel values of the four valued pixels are represented by R (100, 100), R (100, 102), R (102, 100), R (102, 102), and sampling positions (100.8, 101. When the R pixel value of 4) is represented by R (100.8, 101.4), the pixel value R (100.8, 101.4) of the sampling coordinate 401 on the R plane is represented by R (100.8). , 101.4) = 0.6 * 0.3 * R (100,100) + 0.6 * 0.7 * R (100,102) + 0.4 * 0.3 * R (102,100) +0. 4 * 0.7 * R (102, 102).

Grプレーン上でのサンプリング座標402におけるGrの画素値、Gbプレーン上でのサンプリング座標403におけるGbの画素値、Bプレーン上でのサンプリング座標404におけるBの画素値、R@Bプレーン上でのサンプリング座標405におけるRの画素値、B@Rプレーン上でのサンプリング座標におけるBの画素値等も、Rプレーンと同様に、サンプリング座標を囲む4つの有値画素の画素値から補間によって算出できる。   Gr pixel value at sampling coordinate 402 on Gr plane, Gb pixel value at sampling coordinate 403 on Gb plane, B pixel value at sampling coordinate 404 on B plane, Sampling on R @ B plane The R pixel value at the coordinate 405, the B pixel value at the sampling coordinate on the B @ R plane, and the like can be calculated by interpolation from the pixel values of the four valued pixels surrounding the sampling coordinate as in the R plane.

なお、サンプリング座標設定部41では、出力カラー画像における全画素に対応付けてサンプリング座標を設定し、サンプリング部53では、これらの全サンプリング座標におけるサンプリング値を算出する。そして、このサンプリング値を出力カラー画像の対応する画素位置に配置することにより画像信号と見なせる。   The sampling coordinate setting unit 41 sets sampling coordinates in association with all the pixels in the output color image, and the sampling unit 53 calculates sampling values at these all sampling coordinates. Then, this sampling value can be regarded as an image signal by arranging it at the corresponding pixel position of the output color image.

次に、色生成部54は、出力カラー画像の各画素における輝度を生成する輝度生成部54Aと色差を生成する色差生成部54Bと、によって構成されている。なお、本発明の請求項1における輝度生成手段が輝度生成部54Aによってその機能が発現される。   Next, the color generation unit 54 includes a luminance generation unit 54A that generates luminance at each pixel of the output color image and a color difference generation unit 54B that generates color differences. Note that the function of the luminance generating means according to claim 1 of the present invention is expressed by the luminance generating unit 54A.

輝度生成部54Aは、出力カラー画像の各画素において、サンプリング部53で算出されたGr、Gb、R、R@B、B、B@Rの画素値を、1:1:(1−k):k:(1−k):k、の比率で合成するように、輝度信号Yを、Y=Gr+Gb+(1−k)R+kR@B+(1−k)B+kB@R、とする。この際、輝度信号の構成比率は、R:G:B=1:2:1である。   The luminance generation unit 54A calculates the pixel values of Gr, Gb, R, R @ B, B, and B @ R calculated by the sampling unit 53 for each pixel of the output color image 1: 1: (1-k). The luminance signal Y is assumed to be Y = Gr + Gb + (1-k) R + kR @ B + (1-k) B + kB @ R so as to be combined at a ratio of: k: (1-k): k. At this time, the composition ratio of the luminance signal is R: G: B = 1: 2: 1.

輝度Yを求める際に用いた係数kについては、k=2/3がジッパーアーチファクトの抑制のために最適であるが、k=2/3の近傍であればジッパーアーチファクト抑制の効果が得られる。また、数値2/3が、2進数において0.101010…bと表現されるので、kを、1/2(2進数では0.1b)〜3/4(2進数では0.11b)の範囲において、2進数が簡素な数値になるように設定しても良い。   As for the coefficient k used for obtaining the luminance Y, k = 2/3 is optimal for suppressing zipper artifacts, but if k = 2/3, the effect of suppressing zipper artifacts can be obtained. Since the numerical value 2/3 is expressed as 0.101010 ... b in binary number, k is in the range of 1/2 (0.1b in binary number) to 3/4 (0.11b in binary number). In this case, the binary number may be set to a simple numerical value.

また、輝度YにおけるRとR@Bの和Rtotは、Rtot=(1−k)R+kR@Bの演算式で表されるが、R@Bの出自を組み入れて次式のように変形できる。 Further, the sum R tot of R and R @ B at luminance Y is expressed by an arithmetic expression of R tot = (1-k) R + kR @ B, and is transformed into the following expression by incorporating the origin of R @ B. it can.

つまり、RとR@Bの和Rtot(usR,vsR)は、Rtot(usR,vsR)=(1−k)*R(usR,vsR)+k*R@B(usR,vsR)=(1−k)*R(usR,vsR)+(k/4)*R(usR−1,vsR−1)+(k/4)*R(usR−1,vsR+1)+(k/4)*R(usR−1,vsR+1)+(k/4)*R(usR−1,vsR−1)、となる。 That is, the sum R tot (u sR , v sR ) of R and R @ B is R tot (u sR , v sR ) = (1−k) * R (u sR , v sR ) + k * R @ B ( u sR , v sR ) = (1−k) * R (u sR , v sR ) + (k / 4) * R (u sR −1, v sR −1) + (k / 4) * R (u sR− 1, vsR + 1) + (k / 4) * R ( usR− 1, vssR + 1) + (k / 4) * R ( usR− 1, vsR− 1).

例えば、図7に表したように(usR,vsR)=(100.8,101.4)での値を例にすると、Rtot(100.8,101.4)=(1−k)(0.6*0.3*R(100,100)+0.6*0.7*R(100,102)+0.4*0.3*R(102,100)+0.4*0.7*R(102,102)+(k/4)*(0.1*0.8*R(98,100)+0.1*0.2*R(98,102)+0.9*0.8*R(100,100)+0.9*0.2*R(100,102))+(k/4)*(0.1*0.8*R(98,102)+0.1*0.2*R(98,104)+0.9*0.8*R(100,102)+0.9*0.2*R(100,104))+(k/4)*(0.1*0.8*R(100,100)+0.1*0.2*R(100,102)+0.9*0.8*R(102,100)+0.9*0.2*R(102,102))+(k/4)*(0.1*0.8*R(100,102)+0.1*0.2*R(100,104)+0.9*0.8*R(102,102)+0.9*0.2*R(102,104))=0.1*0.8*(k/4)*R(98,100)+0.1*(k/4)*R(98,102)+0.1*0.2*(k/4)*R(98,104)+(0.8*(k/4)+0.6*0.3*(1−k))*R(100,100)+((k/4)+0.6*0.7*(1−k))*R(100,102)+0.2*(k/4)*R(100,104)+(0.9*0.8*(k/4)+0.4*0.3*(1−k))*R(102,100)+(0.9*(k/4)+0.4*0.7*(1−k))*R(102,102)+0.9*0.2*(k/4)*R(102,104)、となる。 For example, as shown in FIG. 7, taking the value at (u sR , v sR ) = (100.8, 101.4) as an example, R tot (100.8, 101.4) = (1−k ) (0.6 * 0.3 * R (100,100) + 0.6 * 0.7 * R (100,102) + 0.4 * 0.3 * R (102,100) + 0.4 * 0. 7 * R (102,102) + (k / 4) * (0.1 * 0.8 * R (98,100) + 0.1 * 0.2 * R (98,102) + 0.9 * 0. 8 * R (100,100) + 0.9 * 0.2 * R (100,102)) + (k / 4) * (0.1 * 0.8 * R (98,102) + 0.1 * 0 .2 * R (98,104) + 0.9 * 0.8 * R (100,102) + 0.9 * 0.2 * R (100,104)) + (k / 4) * (0.1 * 0.8 * R (100, 00) + 0.1 * 0.2 * R (100,102) + 0.9 * 0.8 * R (102,100) + 0.9 * 0.2 * R (102,102)) + (k / 4 ) * (0.1 * 0.8 * R (100,102) + 0.1 * 0.2 * R (100,104) + 0.9 * 0.8 * R (102,102) + 0.9 * 0 .2 * R (102,104)) = 0.1 * 0.8 * (k / 4) * R (98,100) + 0.1 * (k / 4) * R (98,102) +0.1 * 0.2 * (k / 4) * R (98,104) + (0.8 * (k / 4) + 0.6 * 0.3 * (1-k)) * R (100,100) + ((K / 4) + 0.6 * 0.7 * (1-k)) * R (100,102) + 0.2 * (k / 4) * R (100,104) + (0.9 * 0 .8 * (k / 4) + 0.4 * 0.3 * (1-k ) * R (102,100) + (0.9 * (k / 4) + 0.4 * 0.7 * (1-k)) * R (102,102) + 0.9 * 0.2 * (k / 4) * R (102, 104).

これにより、R@Bを演算式に明示しなくても、(usR,vsR)=(100.8,101.4)の周辺5×5画素内の9つのR画素の値からRのサンプリング値を算出できることが分かる。但し、例外的にRのサンプリング座標(usR,vsR)がB画素と同一の水平及び垂直位置にある際には、6つまたは4つのRの画素値からサンプリング値が算出される。 As a result, even if R @ B is not clearly indicated in the arithmetic expression, the value of R in the 5 × 5 pixels around (u sR , v sR ) = (100.8, 101.4) It can be seen that the sampling value can be calculated. However, when the R sampling coordinates (u sR , v sR ) are exceptionally at the same horizontal and vertical positions as the B pixel, the sampling value is calculated from six or four R pixel values.

次に、色差生成部54Bは、サンプリング部53で生成されたR、Gr、Gb,Bの各画素値(サンプリング値)から、2つの色差信号C1、C2を生成する。ここで、C1は、Grの画素信号とGbの画素信号との和からRの画素信号とBの画素信号とを減じた値であって、一方、C2は、Rの画素信号とBの画素信号の差を表す。   Next, the color difference generation unit 54B generates two color difference signals C1 and C2 from the R, Gr, Gb, and B pixel values (sampling values) generated by the sampling unit 53. Here, C1 is a value obtained by subtracting the R pixel signal and the B pixel signal from the sum of the Gr pixel signal and the Gb pixel signal, while C2 is the R pixel signal and the B pixel. Represents the difference in signal.

また、C1の生成の際には、R:G:B=(−1):2:(−1)の構成比となるように、R、Gr、Gb、Bの各画素値を(−1):1:1:(−1)の比で合成し、C1=(−R+Gr+Gb−B)/4を算出する。一方、C2の生成の際には、R:G:B=2:0:(−2)の構成比となるように、R、Gr、Gb、Bの画素値を2:0:0:(−2)の比で合成し、C2=(2R−2B)/4を算出する。   Further, when C1 is generated, the pixel values of R, Gr, Gb, and B are set to (−1 so that the composition ratio of R: G: B = (− 1): 2: (− 1) is obtained. ): 1: 1: (-1), and C1 = (− R + Gr + Gb−B) / 4 is calculated. On the other hand, when C2 is generated, the pixel values of R, Gr, Gb, and B are set to 2: 0: 0 :( so that the composition ratio is R: G: B = 2: 0: (− 2). -2) to calculate C2 = (2R-2B) / 4.

さらに、色差生成部54Bでは、前記のように生成された色差に対して偽色抑制のための補正を行う。偽色抑制の一例として、まず、fs/2(ナイキスト周波数)付近の高周波成分Kを、K=(2Gr−2Gb)/4の演算式で算出する。次いで、下記式を用いてC2の絶対値からK2の絶対値を減じることにより高周波部に発生する赤及び青の偽色を抑制することができる。C2→sign(C2)max(0,abs(C2)−abs(K))   Further, the color difference generation unit 54B performs correction for suppressing false colors on the color difference generated as described above. As an example of false color suppression, first, a high frequency component K in the vicinity of fs / 2 (Nyquist frequency) is calculated by an arithmetic expression of K = (2Gr−2Gb) / 4. Next, by subtracting the absolute value of K2 from the absolute value of C2 using the following formula, it is possible to suppress red and blue false colors generated in the high-frequency part. C2 → sign (C2) max (0, abs (C2) −abs (K))

次に、視覚補正部34は、輝度信号生成部25で得られた輝度信号Y及び色差生成部で得られた色差信号C1、C2に対して所定の処理を加え、これらの色信号からなるカラー画像の見栄えを補正する。例えば、色差信号C1、C2に対して低周波フィルタ処理を施して色ノイズを低減したり、輝度信号Yに対して高周波強調を行うことで解像感を強調したりする。   Next, the visual correction unit 34 performs predetermined processing on the luminance signal Y obtained by the luminance signal generation unit 25 and the color difference signals C1 and C2 obtained by the color difference generation unit, and a color composed of these color signals. Correct the appearance of the image. For example, low-frequency filter processing is performed on the color difference signals C1 and C2 to reduce color noise, or high-frequency enhancement is performed on the luminance signal Y to enhance resolution.

次に、図8を用いて、前記第2の実施形態の、画像処理方法及び画像処理プラグラムの手順を説明する。この手順は、CPU18がROM19に格納されたプログラムにもとづいて、各機能部に指令信号を与えて実行する。また、図8におけるSはステップを表している。   Next, the procedure of the image processing method and the image processing program of the second embodiment will be described with reference to FIG. This procedure is executed by the CPU 18 giving a command signal to each functional unit based on a program stored in the ROM 19. Further, S in FIG. 8 represents a step.

まず、この手順は、オペレータによって撮像装置1A又は画像処理装置100Aに起動信号が入力された際にスタートし、その後、S101及びS102に移る。   First, this procedure starts when an activation signal is input to the imaging apparatus 1A or the image processing apparatus 100A by the operator, and then the process proceeds to S101 and S102.

次いで、S101において、撮像ユニット2Aを介して画像信号(色モザイク画像)を画像処理装置100Aに読み込み、その後、S201に移る。   Next, in S101, an image signal (color mosaic image) is read into the image processing apparatus 100A via the imaging unit 2A, and then the process proceeds to S201.

次いで、S201において、色プレーン分解部21を用いて、ベイヤー配列に対応付けて、Rの画素信号、Gr画素信号、Gb画素信号、B画素信号毎に記憶し、その後、S301に移る。   In step S201, the color plane separation unit 21 is used to store the R pixel signal, the Gr pixel signal, the Gb pixel signal, and the B pixel signal in association with the Bayer array, and then the process proceeds to S301.

次いで、S301において、R@B生成部51及びB@R生成部52を用いて、色モザイク画像のB画素の位置におけるR画素の値を生成する(R@Bプレーンを生成する)と共に、色モザイク画像のR画素の位置におけるB画素の値を生成し(B@Rプレーンを生成し)、その後、S401に移る。   Next, in S301, the R @ B generation unit 51 and the B @ R generation unit 52 are used to generate the value of the R pixel at the position of the B pixel of the color mosaic image (generate an R @ B plane), and The value of the B pixel at the position of the R pixel of the mosaic image is generated (B @ R plane is generated), and then the process proceeds to S401.

一方、S102において、サンプリング座標設定部41を用いて、歪曲収差補正や手ぶれ補正、デジタルズームといった画像変形を考慮し、収差係数設定部39及びブレ検出部40で取得されたパラメータに基づいて、出力するカラー画像の画素位置に対応する色モザイク画像上のサンプリング座標を設定し、その後、S401に移る。   On the other hand, in step S102, the sampling coordinate setting unit 41 is used to consider image deformation such as distortion correction, camera shake correction, and digital zoom, and output based on the parameters acquired by the aberration coefficient setting unit 39 and the shake detection unit 40. Sampling coordinates on the color mosaic image corresponding to the pixel position of the color image are set, and then the process proceeds to S401.

次いで、S401において、サンプリング部53を用いて、色プレーン分解部21で生成された4つの色プレーン(Rプレーン、Grプレーン、Gbプレーン、Bプレーン)と、R@B生成部51で生成されたR@Bプレーン、B@R生成部52で生成されたB@Rプレーンに基づいて、サンプリング座標設定部41で設定されたサンプリング位置におけるサンプリング値(サンプリング位置における色毎の画素値である)を算出し、その後、S501及びS502に移る。   Next, in S401, using the sampling unit 53, the four color planes (R plane, Gr plane, Gb plane, and B plane) generated by the color plane decomposition unit 21 and the R @ B generation unit 51 are generated. Based on the R @ B plane and the B @ R plane generated by the B @ R generation unit 52, the sampling value at the sampling position set by the sampling coordinate setting unit 41 (the pixel value for each color at the sampling position) After that, the process proceeds to S501 and S502.

次いで、S501において、輝度生成部54Aを用いて、サンプリング部53で算出されたGr、Gb、R、R@B、B、B@Rの画素値を、1:1:(1−k):k:(1−k):k、の比率で合成するように、輝度Yを、Y=Gr+Gb+(1−k)R+kR@B+(1−k)B+kB@R、の演算式で算出し、その後、S601に移る。   Next, in S501, using the luminance generation unit 54A, the pixel values of Gr, Gb, R, R @ B, B, and B @ R calculated by the sampling unit 53 are 1: 1: (1-k): Luminance Y is calculated by the following equation: Y = Gr + Gb + (1-k) R + kR @ B + (1-k) B + kB @ R, so that k: (1-k): k is combined. , The process proceeds to S601.

一方、S502において、色差生成部54Bを用いて、サンプリング部53で生成されたR、Gr、Gb,Bの各画素値(サンプリング値)から、2つの色差信号C1、C2を生成し、その後、S601に移る。   On the other hand, in S502, the color difference generation unit 54B is used to generate two color difference signals C1 and C2 from the R, Gr, Gb, and B pixel values (sampling values) generated by the sampling unit 53, and then The process proceeds to S601.

次いで、S601において、輝度Y及び色差C1、C2を生成する次のサンプリング座標が有るか否かを判定し、次の対象点が有る(Yes)際には、S401〜601を繰り返し、次のサンプリング座標が無い(No)となった際に、S701に移る。   Next, in S601, it is determined whether or not there is a next sampling coordinate for generating the luminance Y and the color differences C1 and C2, and when there is a next target point (Yes), S401 to 601 are repeated, and the next sampling is performed. When there is no coordinate (No), the process proceeds to S701.

次いで、S701において、視覚補正部34を用い、輝度生成部54A及び色差生成部54Bで生成されたカラー画像信号(輝度Y、色差C1、色差C2)に対して、画像の見栄えを良くするための画像補正、標準的なカラー画像の色空間座標であるYUV色度座標への変換等を行い、その後、S801に移る。   In step S701, the visual correction unit 34 is used to improve the appearance of the image with respect to the color image signals (luminance Y, color difference C1, and color difference C2) generated by the luminance generation unit 54A and the color difference generation unit 54B. Image correction, conversion to YUV chromaticity coordinates, which are color space coordinates of a standard color image, and the like are performed, and then the process proceeds to S801.

次いで、S801において、圧縮部35を用いて、視覚補正部34を介して出力されたカラー画像のデジタル画像信号をJPEG(Joint Photographic Experts Group)等の方法で圧縮し、記録時の画像データのサイズを小さくし、その後、S901に移る。   In step S801, the compression unit 35 is used to compress the digital image signal of the color image output via the visual correction unit 34 by a method such as JPEG (Joint Photographic Experts Group), and the size of the image data at the time of recording. After that, the process proceeds to S901.

次いで、S901において、記録部36を用いて、圧縮されたデジタル画像信号をフラッシュメモリ等の記録媒体に記憶し、その後、本画像処理プログラムを終了する。   In step S901, the compressed digital image signal is stored in a recording medium such as a flash memory using the recording unit 36, and then the image processing program ends.

以上のように、第2の実施形態に記載の画像処理装置100A及び画像処理方法及び画像処理プログラムによれば、色モザイク画像から、色プレーン分解部21を介して、R、Gr、Gb、Bの画素毎に分解し、次いで、R@Bプレーン生成部51を介して、Bの画素位置おいて該B画素を囲むRの画素の補間値をBの画素値に置き換えてR画素値@B画素位置として補間生成すると共に、B@Rプレーン生成部52を介して、Rの画素位置おいて該R画素を囲むBの画素の補間値をRの画素値に置き換えてB画素値@R画素位置として補間生成し、次いで、サンプリング部53を介して、カラー画像の画素位置に対応付けられたモザイク画像のサンプリング位置において、Rプレーン、Grプレーン、Gbプレ−ン、Bプレーン、R画素値@B画素位置プレーン、B画素値@R画素位置プレーンの夫々毎に画素値を補間生成してプレーン毎のサンプリング値を生成し、次いで、輝度生成部54Aを介して、各色プレーンのサンプリング値を合成してカラー画像の各画素の輝度を生成しているので、赤系画像と青系画像との境界に現れるジッパーアーチファクトを効果的に抑制することができ、さらには、色モザイク画像の画素位置に関らず、任意の画素位置において高品位な輝度を生成できる。   As described above, according to the image processing apparatus 100A, the image processing method, and the image processing program described in the second embodiment, R, Gr, Gb, B from the color mosaic image via the color plane separation unit 21. Then, through the R @ B plane generation unit 51, the interpolation value of the R pixel surrounding the B pixel at the B pixel position is replaced with the B pixel value, and the R pixel value @B Interpolation is generated as the pixel position, and the B pixel value @R pixel is replaced by the R pixel value by replacing the interpolation value of the B pixel surrounding the R pixel at the R pixel position via the B @ R plane generation unit 52. Interpolated as a position, and then, through the sampling unit 53, at the sampling position of the mosaic image associated with the pixel position of the color image, the R plane, Gr plane, Gb plane, B plane, R pixel value Interpolate and generate pixel values for each of the B pixel position plane and B pixel value @ R pixel position plane to generate sampling values for each plane, and then synthesize the sampling values for each color plane via the luminance generation unit 54A Since the luminance of each pixel of the color image is generated, zipper artifacts appearing at the boundary between the red-based image and the blue-based image can be effectively suppressed, and furthermore, the pixel position of the color mosaic image can be suppressed. Regardless, high-quality luminance can be generated at any pixel position.

また、第2の実施形態に記載の画像処理装置100A及び画像処理方法及び画像処理プログラムによれば、ブレ検出部40からの検出値に基づくブレ補正や収差係数設定部39からの設定値に基づく収差補正を行うように、入力画像におけるサンプリング位置を設定するサンプリング座標設定部41等を備えているので、色モザイク画像と出力カラー画像の各画素を1:1に対応させる必要がなく、解像度変換や各種の画像変形を同時に適用できて利便性を向上できる。つまり、本実施形態の輝度信号生成方法を用いた画像処理によれば、ジッパーアーチファクトやジャギーの発生を抑制して高品位な輝度信号を得ることができると共に、所望の画像変形を行うことができ、高品質なカラー画像を生成できる。   In addition, according to the image processing apparatus 100A, the image processing method, and the image processing program described in the second embodiment, based on the blur correction based on the detection value from the blur detection unit 40 and the set value from the aberration coefficient setting unit 39. Since the sampling coordinate setting unit 41 for setting the sampling position in the input image is provided so as to correct the aberration, it is not necessary to correspond each pixel of the color mosaic image and the output color image to 1: 1, and resolution conversion is performed. And various image deformations can be applied at the same time to improve convenience. That is, according to the image processing using the luminance signal generation method of the present embodiment, it is possible to obtain a high-quality luminance signal by suppressing the occurrence of zipper artifacts and jaggies, and to perform desired image deformation. High-quality color images can be generated.

以上、本発明の一実施例について説明したが、本発明は前記実施例に限定されるものではなく、種々の態様を取ることができる。   As mentioned above, although one Example of this invention was described, this invention is not limited to the said Example, It can take a various aspect.

1,1A…撮像装置、2,2A…撮像ユニット、3…撮像レンズ、5…撮像素子、5a…ベイヤー配列のカラーフィルタ、6…AFE(Analog Front End)、7…相関二重サンプリング回路、8…可変利得増幅器(AGC:Automatic Gain Control)、9…A/D変換器、10…検出部、11…センサ、12…レンズ駆動部、13…TG(Timing Generator)、18…CPU(Central Processing Unit)、19…ROM(Read Only Memory)、21…色プレーン分解部、22…Rフィールドメモリ、23a…Grフィールドメモリ、23b…Gbフィールドメモリ、24…Bフィールドメモリ、25…輝度生成部、26…SwitchY生成部、27…RBプレーン生成部、28…輝度補正値生成部、29…輝度補正部、30…色差生成部、31…C1生成部、32…C2生成部、34…視覚補正部、35…圧縮部、36…記録部、37…レンジステート検出部、38…収差係数記憶テーブル、39…収差係数設定部、40…ブレ検出部、41…サンプリング座標設定部、51…R@B生成部、52…B@R生成部、53…サンプリング部、54…色生成部、54A…輝度生成部、54B…色差生成部、100,100A…画像処理装置。 DESCRIPTION OF SYMBOLS 1,1A ... Imaging device, 2, 2A ... Imaging unit, 3 ... Imaging lens, 5 ... Imaging element, 5a ... Bayer arrangement color filter, 6 ... AFE (Analog Front End), 7 ... Correlated double sampling circuit, 8 ... variable gain amplifier (AGC), 9 ... A / D converter, 10 ... detection unit, 11 ... sensor, 12 ... lens driving unit, 13 ... TG (Timing Generator), 18 ... CPU (Central Processing Unit) ), 19... ROM (Read Only Memory), 21... Color plane separation unit, 22... R field memory, 23 a... Gr field memory, 23 b... Gb field memory, 24. SwitchY generator 27 RB plane generation unit, 28 ... luminance correction value generation unit, 29 ... luminance correction unit, 30 ... color difference generation unit, 31 ... C1 generation unit, 32 ... C2 generation unit, 34 ... visual correction unit, 35 ... compression unit, 36 ... Recording unit 37 ... Range state detection unit 38 ... Aberration coefficient storage table 39 ... Aberration coefficient setting unit 40 ... Blur detection unit 41 ... Sampling coordinate setting unit 51 ... R @ B generation unit 52 ... B @ R Generation unit 53... Sampling unit 54. Color generation unit 54 A. Luminance generation unit 54 B Color difference generation unit 100, 100 A Image processing apparatus.

Claims (9)

R(赤)、G(緑)、B(青)3色のベイヤー配列のカラーフィルタを有する撮像素子を介して出力されて各画素が単一色の色情報を備えた色モザイク画像から、画素毎に複数の色情報を備えたカラー画像を生成する画像処理装置であって、
前記ベイヤー配列において、水平方向に前記Rの隣に配置される前記GをGr、前記Bの隣に配置される前記GをGbとして表した際に、
前記色モザイク画像を、R、Gr、Gb、Bの画素毎に分解する色プレーン分解部と、
前記Bの画素位置おいて、該B画素を囲むRの画素の補間値をBの画素値に置き換えてR画素値@B画素位置として補間生成するR@Bプレーン生成部と、
前記Rの画素位置おいて、該R画素を囲むBの画素の補間値をRの画素値に置き換えてB画素値@R画素位置として補間生成するB@Rプレーン生成部と、
前記カラー画像の画素位置に対応付けられたモザイク画像のサンプリング位置において、前記Rプレーン、Grプレーン、Gbプレ−ン、Bプレーン、R@Bプレーン、B@Rプレーンの夫々毎に画素値を補間生成し、プレーン毎のサンプリング値を生成するサンプリング手段と、
前記サンプリング手段を介して生成された前記Rプレーン、Grプレーン、Gbプレ−ン、Bプレーン、R@Bプレーン、B@Rプレーンのサンプリング値を合成して前記カラー画像の各画素の輝度を生成する輝度生成手段と、
を備えていることを特徴とする画像処理装置。
From a color mosaic image that is output through an image sensor having a color filter with a Bayer array of three colors of R (red), G (green), and B (blue), and each pixel has color information of a single color, pixel by pixel An image processing apparatus for generating a color image having a plurality of color information,
In the Bayer array, when the G arranged next to the R in the horizontal direction is represented as Gr, and the G arranged next to the B is represented as Gb,
A color plane separation unit that separates the color mosaic image into R, Gr, Gb, and B pixels;
An R @ B plane generation unit for generating an interpolation as an R pixel value @ B pixel position by replacing the interpolation value of the R pixel surrounding the B pixel with the B pixel value at the B pixel position;
A B @ R plane generating unit for generating an interpolation as a B pixel value @ R pixel position by replacing the interpolation value of the B pixel surrounding the R pixel with the R pixel value at the R pixel position;
Interpolate pixel values for each of the R plane, Gr plane, Gb plane, B plane, R @ B plane, and B @ R plane at the sampling position of the mosaic image associated with the pixel position of the color image Sampling means for generating and generating sampling values for each plane;
The sampling values of the R plane, Gr plane, Gb plane, B plane, R @ B plane, and B @ R plane generated through the sampling means are combined to generate the luminance of each pixel of the color image. Luminance generation means for
An image processing apparatus comprising:
前記輝度生成手段が、
前記Rプレーンのサンプリング値とR@Bプレーンのサンプリング値とを略1:2の割合で合成する、
ことを特徴とする請求項1に記載の画像処理装置。
The luminance generating means;
The sampling value of the R plane and the sampling value of the R @ B plane are combined at a ratio of approximately 1: 2.
The image processing apparatus according to claim 1.
前記輝度生成手段が、
前記Bプレーンのサンプリング値とB@Rプレーンのサンプリング値とを略1:2の割合で合成する、
ことを特徴とする請求項1に記載の画像処理装置。
The luminance generating means;
The sampling value of the B plane and the sampling value of the B @ R plane are combined at a ratio of approximately 1: 2.
The image processing apparatus according to claim 1.
R(赤)、G(緑)、B(青)3色のベイヤー配列のカラーフィルタを有する撮像素子を介して出力されて各画素が単一色の色情報を備えた色モザイク画像から、画素毎に複数の色情報を備えたカラー画像を生成する画像処理方法であって、
前記ベイヤー配列において、水平方向に前記Rの隣に配置される前記GをGr、前記Bの隣に配置される前記GをGbとして表した際に、
前記色モザイク画像を、R、Gr、Gb、Bの画素毎に分解する色プレーン分解ステップと、
前記Bの画素位置おいて、該B画素を囲むRの画素の補間値をBの画素値に置き換えてR画素値@B画素位置として補間生成するR@Bプレーン生成ステップと、
前記Rの画素位置おいて、該R画素を囲むBの画素の補間値をRの画素値に置き換えてB画素値@R画素位置として補間生成するB@Rプレーン生成ステップと、
前記カラー画像の画素位置に対応付けられたモザイク画像のサンプリング位置において、前記Rプレーン、Grプレーン、Gbプr−ン、Bプレーン、R@Bプレーン、B@Rプレーンの夫々毎に画素値を補間生成し、プレーン毎のサンプリング値を生成するサンプリングステップと、
前記サンプリングステップを介して生成された前記Rプレーン、Grプレーン、Gbプレ−ン、Bプレーン、R@Bプレーン、B@Rプレーンのサンプリング値を合成して前記カラー画像の各画素の輝度を生成する輝度生成ステップと、
を用いることを特徴とする画像処理方法。
From a color mosaic image that is output through an image sensor having a color filter with a Bayer array of three colors of R (red), G (green), and B (blue), and each pixel has color information of a single color, pixel by pixel An image processing method for generating a color image having a plurality of color information,
In the Bayer array, when the G arranged next to the R in the horizontal direction is represented as Gr, and the G arranged next to the B is represented as Gb,
A color plane separation step of separating the color mosaic image for each of R, Gr, Gb, and B pixels;
An R @ B plane generation step of interpolating and generating an R pixel value @ B pixel position by replacing the interpolation value of the R pixel surrounding the B pixel with the B pixel value at the B pixel position;
A B @ R plane generating step of interpolating and generating a B pixel value @ R pixel position by replacing the interpolation value of the B pixel surrounding the R pixel with the R pixel value at the R pixel position;
At the sampling position of the mosaic image associated with the pixel position of the color image, a pixel value is set for each of the R plane, Gr plane, Gb plane, B plane, R @ B plane, and B @ R plane. A sampling step for generating an interpolation and generating a sampling value for each plane;
The sampling values of the R plane, Gr plane, Gb plane, B plane, R @ B plane, and B @ R plane generated through the sampling step are combined to generate the brightness of each pixel of the color image. A luminance generation step to
An image processing method using the method.
前記輝度生成ステップにおいて、
前記Rプレーンのサンプリング値とR@Bプレーンのサンプリング値とを略1:2の割合で合成する、
ことを特徴とする請求項4に記載の画像処理方法。
In the luminance generation step,
The sampling value of the R plane and the sampling value of the R @ B plane are combined at a ratio of approximately 1: 2.
The image processing method according to claim 4.
前記輝度生成ステップにおいて、
前記Bプレーンのサンプリング値とB@Rプレーンのサンプリング値とを略1:2の割合で合成する、
ことを特徴とする請求項4に記載の画像処理方法。
In the luminance generation step,
The sampling value of the B plane and the sampling value of the B @ R plane are combined at a ratio of approximately 1: 2.
The image processing method according to claim 4.
R(赤)、G(緑)、B(青)3色のベイヤー配列のカラーフィルタを有する撮像素子を介して出力されて各画素が単一色の色情報を備えた色モザイク画像から、画素毎に複数の色情報を備えたカラー画像を生成する画像処理プログラムであって、
前記ベイヤー配列において、水平方向に前記Rの隣に配置される前記GをGr、前記Bの隣に配置される前記GをGbとして表した際に、
前記色モザイク画像を、R、Gr、Gb、Bの画素毎に分解する色プレーン分解ステップと、
前記Bの画素位置おいて、該B画素を囲むRの画素の補間値をBの画素値に置き換えてR画素値@B画素位置として補間生成するR@Bプレーン生成ステップと、
前記Rの画素位置おいて、該Rの画素を囲むBの画素の補間値をRの画素値に置き換えてB画素値@R画素位置として補間生成するB@Rプレーン生成ステップと、
前記カラー画像の画素位置に対応付けられたモザイク画像のサンプリング位置において、前記Rプレーン、Grプレーン、Gbプr−ン、Bプレーン、R@Bプレーン、B@Rプレーンの夫々毎に画素値を補間生成し、プレーン毎のサンプリング値を生成するサンプリングステップと、
前記サンプリングステップを介して生成された前記Rプレーン、Grプレーン、Gbプレ−ン、Bプレーン、R@Bプレーン、B@Rプレーンのサンプリング値を合成して前記カラー画像の各画素の輝度を生成する輝度生成ステップと、
をコンピュータに実行させることを特徴とする画像処理プログラム。
From a color mosaic image that is output through an image sensor having a color filter with a Bayer array of three colors of R (red), G (green), and B (blue), and each pixel has color information of a single color, pixel by pixel An image processing program for generating a color image having a plurality of color information,
In the Bayer array, when the G arranged next to the R in the horizontal direction is represented as Gr, and the G arranged next to the B is represented as Gb,
A color plane separation step of separating the color mosaic image for each of R, Gr, Gb, and B pixels;
An R @ B plane generation step of interpolating and generating an R pixel value @ B pixel position by replacing the interpolation value of the R pixel surrounding the B pixel with the B pixel value at the B pixel position;
A B @ R plane generation step of interpolating and generating a B pixel value @ R pixel position by replacing the interpolation value of the B pixel surrounding the R pixel with the R pixel value at the R pixel position;
At the sampling position of the mosaic image associated with the pixel position of the color image, a pixel value is set for each of the R plane, Gr plane, Gb plane, B plane, R @ B plane, and B @ R plane. A sampling step for generating an interpolation and generating a sampling value for each plane;
The sampling values of the R plane, Gr plane, Gb plane, B plane, R @ B plane, and B @ R plane generated through the sampling step are combined to generate the brightness of each pixel of the color image. A luminance generation step to
An image processing program for causing a computer to execute.
前記輝度生成ステップにおいて、
前記Rプレーンのサンプリング値とR@Bプレーンのサンプリング値とを略1:2の割合で合成する、
ようにコンピュータに実行させることを特徴とする請求項7に記載の画像処理プログラム。
In the luminance generation step,
The sampling value of the R plane and the sampling value of the R @ B plane are combined at a ratio of approximately 1: 2.
The image processing program according to claim 7, which is executed by a computer as described above.
前記輝度生成ステップにおいて、
前記Bプレーンのサンプリング値とB@Rプレーンのサンプリング値とを略1:2の割合で合成する、
ようにコンピュータに実行させることを特徴とする請求項7に記載の画像処理プログラム。
In the luminance generation step,
The sampling value of the B plane and the sampling value of the B @ R plane are combined at a ratio of approximately 1: 2.
The image processing program according to claim 7, which is executed by a computer as described above.
JP2012253900A 2012-11-20 2012-11-20 Image processing apparatus, image processing method, and image processing program Expired - Fee Related JP5454820B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012253900A JP5454820B2 (en) 2012-11-20 2012-11-20 Image processing apparatus, image processing method, and image processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012253900A JP5454820B2 (en) 2012-11-20 2012-11-20 Image processing apparatus, image processing method, and image processing program

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2007268645A Division JP5268321B2 (en) 2007-10-16 2007-10-16 Image processing apparatus, image processing method, and image processing program

Publications (2)

Publication Number Publication Date
JP2013066214A true JP2013066214A (en) 2013-04-11
JP5454820B2 JP5454820B2 (en) 2014-03-26

Family

ID=48189246

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012253900A Expired - Fee Related JP5454820B2 (en) 2012-11-20 2012-11-20 Image processing apparatus, image processing method, and image processing program

Country Status (1)

Country Link
JP (1) JP5454820B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101568743B1 (en) 2013-09-11 2015-11-13 한국항공대학교산학협력단 Device and method for the joint of color demosaic and lens distortion correction

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101568743B1 (en) 2013-09-11 2015-11-13 한국항공대학교산학협력단 Device and method for the joint of color demosaic and lens distortion correction

Also Published As

Publication number Publication date
JP5454820B2 (en) 2014-03-26

Similar Documents

Publication Publication Date Title
JP4914303B2 (en) Image processing apparatus and imaging apparatus, image processing method and imaging method, and image processing program
JP5128207B2 (en) Image processing apparatus, image processing method, and image processing program
JP5036421B2 (en) Image processing apparatus, image processing method, program, and imaging apparatus
JP5451782B2 (en) Image processing apparatus and image processing method
JP5241823B2 (en) Image processing apparatus, image processing method, program, and storage medium for correcting chromatic aberration
JP4284628B2 (en) IMAGING DEVICE, IMAGE PROCESSING DEVICE, IMAGE PROCESSING METHOD, PROGRAM FOR IMAGE PROCESSING METHOD, AND RECORDING MEDIUM CONTAINING PROGRAM FOR IMAGE PROCESSING METHOD
JP5036482B2 (en) Image processing apparatus, image processing method, and image processing program
KR101391161B1 (en) Image processing device
US8494260B2 (en) Image processing device, image processing method, program, and imaging device
JP2004241991A (en) Imaging apparatus, image processor, and image processing program
JP2002077928A (en) Image processor
JP2009077274A (en) Image processing device, image processing method, and imaging apparatus
JP5268321B2 (en) Image processing apparatus, image processing method, and image processing program
US8934713B2 (en) Image processing device, image processing method, program, and imaging device
JP2011151739A (en) Image processing apparatus
JP5454820B2 (en) Image processing apparatus, image processing method, and image processing program
JP4687454B2 (en) Image processing apparatus and imaging apparatus
JP5036524B2 (en) Image processing apparatus, image processing method, program, and imaging apparatus
JP4962293B2 (en) Image processing apparatus, image processing method, and program
JP5278421B2 (en) Imaging device
WO2016051911A1 (en) Image processing device, imaging device, image processing method, and program
JP4585045B1 (en) Image processing apparatus, image processing method, and image processing program
JP2012227869A (en) Image processing device, image processing method and digital camera
WO2014192412A1 (en) Image processing device, imaging device, image processing method and program
JP2013207542A (en) Image processing system, image processing program, and electronic camera

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20131125

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20131203

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20131224

R150 Certificate of patent or registration of utility model

Ref document number: 5454820

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees