Skip to content

Commit

Permalink
update error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
petercorke committed Apr 18, 2019
1 parent b89ac0e commit 0b326cb
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions edgelist.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,24 +67,22 @@
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

% 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
Expand Down Expand Up @@ -124,7 +122,6 @@
end
end


% keep going, add P to the edgelist
e = [e P];
end
Expand Down

0 comments on commit 0b326cb

Please sign in to comment.