changeset 427:e5e2c153eb6b

Commenting code of mmgradm
author carandraug
date Wed, 11 Aug 2010 23:39:52 +0000
parents 414c16496487
children 9f1b5b5136a9
files inst/mmgradm.m
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/inst/mmgradm.m
+++ b/inst/mmgradm.m
@@ -32,18 +32,19 @@
 
 function grad = mmgradm (im, se_dil, se_ero)
 
+  ## sanity checks
   if (nargin == 1)
     error ("Structuring element must be specified");
-  elseif (nargin == 2)
-    se_ero = se_dil;
+  elseif (nargin == 2)              # if only one SE is specified, use it for both erosion and dilation
+    se_ero  = se_dil;
   elseif (nargin == 3)
     # all is good
   else
     print_usage;
   endif
 
-  dilated = imdilate(im, se_dil);
-  eroded  = imerode(im, se_ero);
+  dilated   = imdilate  (im, se_dil);
+  eroded    = imerode   (im, se_ero);
 
-  grad = dilated - eroded;
+  grad      = dilated - eroded;
 endfunction