mirror of
https://github.com/2martens/uni.git
synced 2026-05-06 11:26:25 +02:00
[BV] Benutzung von bwlabel in Aufgabe 3 von Blatt 5
Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
@ -52,7 +52,7 @@ turkeys_bw = turkeys;
|
|||||||
% dilate operation was necessary to connect the remaining dots in a way
|
% dilate operation was necessary to connect the remaining dots in a way
|
||||||
% that represents the turkeys.
|
% that represents the turkeys.
|
||||||
% ---
|
% ---
|
||||||
% The last step is similar to the second exercise.
|
% The last step is to apply bwlabel to the prepared bw image.
|
||||||
for i = 1 : numel(turkeys_bw)
|
for i = 1 : numel(turkeys_bw)
|
||||||
if turkeys_bw(i) == 48
|
if turkeys_bw(i) == 48
|
||||||
turkeys_bw(i) = 255;
|
turkeys_bw(i) = 255;
|
||||||
@ -68,7 +68,6 @@ turkeys_opened = imopen(turkeys_bw, se);
|
|||||||
t_opened2 = imopen(turkeys_opened, se_4);
|
t_opened2 = imopen(turkeys_opened, se_4);
|
||||||
t_opened3 = imopen(t_opened2, se_3);
|
t_opened3 = imopen(t_opened2, se_3);
|
||||||
t_dilated = imdilate(t_opened3, se_2);
|
t_dilated = imdilate(t_opened3, se_2);
|
||||||
cc_turkeys = bwconncomp(t_dilated);
|
[labels_turkeys, num_turkeys] = bwlabel(t_dilated);
|
||||||
numObjects_turkeys = cc_turkeys.NumObjects;
|
|
||||||
figure (5), imshow(turkeys_bw);
|
figure (5), imshow(turkeys_bw);
|
||||||
figure (6), imshow(t_dilated);
|
figure (6), imshow(t_dilated);
|
||||||
Reference in New Issue
Block a user