主要内容

翻译

翻译结构元素

描述

例子

SE2=翻译(SEv翻译结构元素SE在一天的空间。v是一个包含所需平移在每个维度上的偏移量的n元素向量。

例子

全部折叠

将图像读入工作区。

我= imread (“cameraman.tif”);

创建一个结构化元素并将其转换为25像素。

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

使用翻译的结构元素放大图像。

J = imdilate(我,se);

显示原始图像和翻译图像。

图imshow (I)、标题(“原始”

图中包含一个坐标轴。标题为Original的轴包含一个类型为image的对象。

图imshow(j),标题(“翻译”);

图中包含一个坐标轴。标题为“已翻译”的轴包含一个类型为image的对象。

创建偏移结构元素。

SE = offsetstrel (“球”,5,6.5)
SE = offsetstrel是一种球形偏移结构元素,其属性为
SE。抵消
ans =11×11负负0 0.8123 1.6246 2.4369 1.6246 0.8123 0负负负0.8123 1.6246 2.4369 3.2492 3.2492 3.2492 2.4369 1.6246 0.8123负0 0 1.6246 2.4369 3.2492 4.0615 4.0615 4.0615 3.2492 2.4369 1.6246 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.24921.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 0.8123 1.6246 2.4369 3.2492 3.2492 3.2492 2.4369 1.6246 0负3.2492 2.4369 1.6246 0.8123 -Inf⋮

翻译结构元素。

V = [2 2];SE2 =翻译(SE, V)
SE2 = offsetstrel是一种球形偏移结构元素,具有以下属性
SE2。抵消
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 -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.24922.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之前介绍