Main Content

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

impyramid

イメージ ピラミッドの縮小と拡張

説明

B = impyramid(A,direction) は、A の 1 レベルによるガウス ピラミッドの縮小または拡張を計算します。directionimpyramid の実行が縮小か拡大かを決定します。

すべて折りたたむ

イメージをワークスペースに読み取ります。

I = imread('cameraman.tif');

縮小を連続して実行します。最初の呼び出しで元のイメージを縮小します。他の impyramid の呼び出しでは、その前に縮小されたイメージを使用します。

I1 = impyramid(I, 'reduce');
I2 = impyramid(I1, 'reduce');
I3 = impyramid(I2, 'reduce');

元のイメージと縮小されたイメージを表示します。

figure, imshow(I)

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

figure, imshow(I1)

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

figure, imshow(I2)

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

figure, imshow(I3)

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

入力引数

すべて折りたたむ

縮小または拡大するイメージ。数値配列または logical 配列として指定します。

データ型: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | logical

縮小または拡大。次のいずれかの値に指定します。

説明
"reduce"元のイメージより小さいイメージを返します。
"expand"元のイメージより大きいイメージを返します。

データ型: char | string

出力引数

すべて折りたたむ

縮小または拡大されたイメージ。A と同じクラスの数値配列または logical 配列として返されます。

アルゴリズム

A が m 行 n 列で、direction"reduce" の場合、B のサイズは ceil(M/2)ceil(N/2) 列になります。direction"expand" の場合、B のサイズは (2*M-1)(2*N-1) 列になります。

縮小と拡張は、最初の 2 次元でのみ行われます。たとえば、A が 100 × 100 × 3 で、direction"reduce" の場合、B は 50 × 50 × 3 になります。

impyramid は、Burt and Adelson の論文の 533 ページで指定されるカーネルを使用します。

w=[14a2,14,a,14,14a2]。ここで、a = 0.375 です。同等の重み付け関数がガウス形状に近くなるように、パラメーター a0.375 に設定されます。また、重みを固定小数点演算を使用して簡単に適用できます。

参照

[1] Burt and Adelson, "The Laplacian Pyramid as a Compact Image Code," IEEE Transactions on Communications, Vol. COM-31, no. 4, April 1983, pp. 532-540.

[2] Burt, "Fast Filter Transforms for Image Processing," Computer Graphics and Image Processing, Vol. 16, 1981, pp. 20-51

拡張機能

バージョン履歴

R2007b で導入

すべて展開する

参考