From f09e8cc60e0a02319e34f3fad6f54266d8165171 Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Tue, 22 Nov 2016 13:18:54 +0100 Subject: [PATCH] [BV] Benutzung von bwlabel in Aufgabe 3 von Blatt 5 Signed-off-by: Jim Martens --- bv/uebung5.m | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bv/uebung5.m b/bv/uebung5.m index 75c3265..3d054ee 100644 --- a/bv/uebung5.m +++ b/bv/uebung5.m @@ -52,7 +52,7 @@ turkeys_bw = turkeys; % dilate operation was necessary to connect the remaining dots in a way % 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) if turkeys_bw(i) == 48 turkeys_bw(i) = 255; @@ -68,7 +68,6 @@ turkeys_opened = imopen(turkeys_bw, se); t_opened2 = imopen(turkeys_opened, se_4); t_opened3 = imopen(t_opened2, se_3); t_dilated = imdilate(t_opened3, se_2); -cc_turkeys = bwconncomp(t_dilated); -numObjects_turkeys = cc_turkeys.NumObjects; +[labels_turkeys, num_turkeys] = bwlabel(t_dilated); figure (5), imshow(turkeys_bw); figure (6), imshow(t_dilated); \ No newline at end of file