Main Content

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

translate

構造化要素の平行移動

説明

SE2 = translate(SE,v) は、N 次元空間で構造化要素 SE を平行移動させます。v は各次元における目的の平行移動のオフセットを含む N 要素ベクトルです。

すべて折りたたむ

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

I = imread('cameraman.tif');

構造化要素を作成し、下および右に 25 ピクセル平行移動させます。

se = translate(strel(1), [25 25]);

平行移動した構造化要素を使用してイメージを膨張します。

J = imdilate(I,se);

元のイメージと平行移動したイメージを表示します。

figure
imshow(I), title('Original')

Figure contains an axes object. The axes object with title Original contains an object of type image.

figure
imshow(J), title('Translated');

Figure contains an axes object. The axes object with title Translated contains an object of type image.

オフセット構造化要素を作成します。

SE = offsetstrel('ball', 5, 6.5)
SE = 
offsetstrel is a ball shaped offset structuring element with properties:

            Offset: [11x11 double]
    Dimensionality: 2

SE.Offset
ans = 11×11

      -Inf      -Inf         0    0.8123    1.6246    2.4369    1.6246    0.8123         0      -Inf      -Inf
      -Inf    0.8123    1.6246    2.4369    3.2492    3.2492    3.2492    2.4369    1.6246    0.8123      -Inf
         0    1.6246    2.4369    3.2492    4.0615    4.0615    4.0615    3.2492    2.4369    1.6246         0
    0.8123    2.4369    3.2492    4.0615    4.8738    4.8738    4.8738    4.0615    3.2492    2.4369    0.8123
    1.6246    3.2492    4.0615    4.8738    5.6861    5.6861    5.6861    4.8738    4.0615    3.2492    1.6246
    2.4369    3.2492    4.0615    4.8738    5.6861    6.4984    5.6861    4.8738    4.0615    3.2492    2.4369
    1.6246    3.2492    4.0615    4.8738    5.6861    5.6861    5.6861    4.8738    4.0615    3.2492    1.6246
    0.8123    2.4369    3.2492    4.0615    4.8738    4.8738    4.8738    4.0615    3.2492    2.4369    0.8123
         0    1.6246    2.4369    3.2492    4.0615    4.0615    4.0615    3.2492    2.4369    1.6246         0
      -Inf    0.8123    1.6246    2.4369    3.2492    3.2492    3.2492    2.4369    1.6246    0.8123      -Inf
      ⋮

構造化要素を平行移動させます。

V = [2 2];
SE2 = translate(SE,V)
SE2 = 
offsetstrel is a ball shaped offset structuring element with properties:

            Offset: [15x15 double]
    Dimensionality: 2

SE2.Offset
ans = 15×15

      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf
      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf
      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf
      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf
      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf         0    0.8123    1.6246    2.4369    1.6246    0.8123         0      -Inf      -Inf
      -Inf      -Inf      -Inf      -Inf      -Inf    0.8123    1.6246    2.4369    3.2492    3.2492    3.2492    2.4369    1.6246    0.8123      -Inf
      -Inf      -Inf      -Inf      -Inf         0    1.6246    2.4369    3.2492    4.0615    4.0615    4.0615    3.2492    2.4369    1.6246         0
      -Inf      -Inf      -Inf      -Inf    0.8123    2.4369    3.2492    4.0615    4.8738    4.8738    4.8738    4.0615    3.2492    2.4369    0.8123
      -Inf      -Inf      -Inf      -Inf    1.6246    3.2492    4.0615    4.8738    5.6861    5.6861    5.6861    4.8738    4.0615    3.2492    1.6246
      -Inf      -Inf      -Inf      -Inf    2.4369    3.2492    4.0615    4.8738    5.6861    6.4984    5.6861    4.8738    4.0615    3.2492    2.4369
      ⋮

入力引数

すべて折りたたむ

構造化要素。strel または offsetstrel オブジェクトとして指定します。

平行移動のオフセット。数値ベクトルとして指定します。各要素は、対応する次元内における目的の平行移動の量を指定します。

出力引数

すべて折りたたむ

平行移動した構造化要素。strel または offsetstrel オブジェクトとして返されます。

バージョン履歴

R2006a より前に導入

参考

トピック