Skip to content

Commit

Permalink
robustify code to handle a point outside the image bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
petercorke committed Jul 8, 2018
1 parent df1d178 commit ca07680
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion edgelist.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@
end

P = P(:);
pix0 = im(P(2), P(1)); % color of pixel we start at
try
pix0 = im(P(2), P(1)); % color of pixel we start at
catch
error('MVTB:edgelist', 'specified coordinate is not within image');
end
P0 = [];

% find an adjacent point outside the blob
Expand Down

0 comments on commit ca07680

Please sign in to comment.