Main Content

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

demosaic

Bayer パターンでエンコードされたイメージをトゥルーカラー イメージに変換

説明

RGB = demosaic(I,sensorAlignment) は、勾配補正された線形内挿を使って、Bayer パターンでエンコードされたイメージ I をトゥルーカラー イメージ RGB に変換します。sensorAlignment は、Bayer パターンを指定します。

Bayer フィルター モザイク (カラー フィルター配列) とは、シングルセンサー デジタル カメラの各センサーが赤、緑または青のデータのみを記録するためのカラー フィルターの配置のことです。Bayer パターンでは、緑のセンサーの数を多くすることで、緑の光に対する人間の目の感度が強いことを模倣しています。関数 demosaic は、2 次元の Bayer エンコード イメージをトゥルーカラー イメージに変換するために内挿を使います。

すべて折りたたむ

'bggr' のセンサー配置を使ったカメラで撮影された Bayer パターン エンコード イメージを変換します。

I = imread("mandi.tif");
J = demosaic(I,"bggr");
imshow(I)

Figure contains an axes object. The axes object contains an object of type image.

imshow(J)

Figure contains an axes object. The axes object contains an object of type image.

入力引数

すべて折りたたむ

Bayer パターンでエンコードされたイメージ。M 行 N 列の数値配列として指定します。I は 5 行以上かつ 5 列以上でなければなりません。

データ型: uint8 | uint16 | uint32

Bayer パターン。次の表のいずれかの値に指定します。各値はイメージの左上隅で 4 つのピクセルを記述することで、赤、緑、および青のセンサーの順序を表しています (左から右、上から下)。

パターン2 行 2 列のセンサー配置
"gbrg"

Top left pixel is green, top right pixel is blue, bottom left pixel is red, and bottom right pixel is green.

"grbg"

Top left pixel is green, top right pixel is red, bottom left pixel is blue, and bottom right pixel is green.

"bggr"

Top left pixel is blue, top right pixel is green, bottom left pixel is green, and bottom right pixel is red.

"rggb"

Top left pixel is red, top right pixel is green, bottom left pixel is green, and bottom right pixel is blue.

データ型: char | string

出力引数

すべて折りたたむ

RGB イメージ。I と同じデータ型の M×N×3 の数値配列として返されます。

参照

[1] Malvar, H.S., L. He, and R. Cutler, High quality linear interpolation for demosaicing of Bayer-patterned color images. ICASPP, Volume 34, Issue 11, pp. 2274-2282, May 2004.

拡張機能

バージョン履歴

R2007b で導入

すべて展開する