From 0b326cb127e0be54dc075ced36e5d6d896f2396c Mon Sep 17 00:00:00 2001 From: Peter Corke Date: Thu, 18 Apr 2019 14:53:10 +1000 Subject: [PATCH] update error messages --- edgelist.m | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/edgelist.m b/edgelist.m index 54d7b96..28f0a1a 100644 --- a/edgelist.m +++ b/edgelist.m @@ -67,16 +67,14 @@ try pix0 = im(P(2), P(1)); % color of pixel we start at catch - error('MVTB:edgelist', 'specified coordinate is not within image'); + error('TBCOMMON:edgelist', 'specified coordinate is not within image'); end P0 = []; % find an adjacent point outside the blob Q = adjacent_point(im, P, pix0); - if isempty(Q) - error('no neighbour outside the blob'); - end + assert(~isempty(Q), 'TBCOMMON:edgelist', 'no neighbour outside the blob'); e = P; % initialize the edge list dir = []; % initialize the direction list @@ -84,7 +82,7 @@ % these are directions of 8-neighbours in a clockwise direction dirs = [-1 0; -1 1; 0 1; 1 1; 1 0; 1 -1; 0 -1; -1 -1]'; - while 1 + while true % find which direction is Q dQ = Q - P; for kq=1:8 @@ -124,7 +122,6 @@ end end - % keep going, add P to the edgelist e = [e P]; end