Skip to content

Commit

Permalink
fix comments to reflect new mask
Browse files Browse the repository at this point in the history
Use ksobel and iconvolve
  • Loading branch information
petercorke committed Apr 9, 2017
1 parent 80608b6 commit 3622264
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions isobel.m
@@ -1,11 +1,11 @@
%ISOBEL Sobel edge detector
%
% OUT = ISOBEL(IM) is an edge image computed using the Sobel edge operator
% applied to the image IM. This is the norm of the vertical and horizontal
% convolved with the image IM. This is the norm of the vertical and horizontal
% gradients at each pixel. The Sobel horizontal gradient kernel is:
% | -1 0 1|
% | -2 0 2|
% | -1 0 1|
% 1 |1 0 -1|
% --- |2 0 -2|
% 8 |1 0 -1|
%
% and the vertical gradient kernel is the transpose.
%
Expand Down Expand Up @@ -60,9 +60,7 @@
error('MVTB:isobel:badarg', 'not defined for multiplane image');
end
if length(args) == 0
Dx = [ -1 -2 -1
0 0 0
1 2 1];
Dx = ksobel();
else
% use the passed horizontal gradient kernel
Dx = args{1};
Expand All @@ -71,8 +69,8 @@
Dx = kdgauss(opt.smooth);
end

ih = iconv(im, Dx, opt.size);
iv = iconv(im, Dx', opt.size);
ih = iconvolve(im, Dx, opt.size);
iv = iconvolve(im, Dx', opt.size);

% return grandient components or magnitude
if nargout == 1,
Expand Down

0 comments on commit 3622264

Please sign in to comment.