translate
Translate structuring element
Syntax
Description
Examples
Read an image into the workspace.
I = imread('cameraman.tif');Create a structuring element and translate it down and to the right by 25 pixels.
se = translate(strel(1), [25 25]);
Dilate the image using the translated structuring element.
J = imdilate(I,se);
Display the original image and the translated image.
figure
imshow(I), title('Original')
figure
imshow(J), title('Translated');
Create an offset structuring element.
SE = offsetstrel('ball', 5, 6.5)SE =
offsetstrel is a ball shaped offset structuring element with properties:
Offset: [11×11 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
-Inf -Inf 0 0.8123 1.6246 2.4369 1.6246 0.8123 0 -Inf -Inf
⋮
Translate the structuring element.
V = [2 2]; SE2 = translate(SE,V)
SE2 =
offsetstrel is a ball shaped offset structuring element with properties:
Offset: [15×15 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
-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 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 0 1.6246 2.4369 3.2492 4.0615 4.0615 4.0615 3.2492 2.4369 1.6246 0
-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 -Inf -Inf 0 0.8123 1.6246 2.4369 1.6246 0.8123 0 -Inf -Inf
⋮
Input Arguments
Structuring element, specified as a strel or offsetstrel object.
Translation offsets, specified as a numeric vector. Each element specifies the amount of desired translation in the corresponding dimension.
Output Arguments
Translated structuring elements, returned as a strel or offsetstrel object.
Version History
Introduced before R2006a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)