changeset 472:a888df0a18e6

dilate: bug fixes on octave core (somewhere in filter2) make dilate work correctly with non-symmetric SE. Updating version of dependency
author carandraug
date Mon, 31 Oct 2011 02:31:35 +0000
parents 43f1a457a91c
children fcadda4a368c
files DESCRIPTION inst/dilate.m
diffstat 2 files changed, 3 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -9,7 +9,7 @@
  The package also provides functions for feature extraction, image
  statistics, spatial and geometric transformations, morphological
  operations, linear filtering, and much more.
-Depends: octave (>= 3.2.0)
+Depends: octave (>= 3.4.0)
 Autoload: yes
 License: GPL version 2 or later
 Url: http://octave.sf.net
--- a/inst/dilate.m
+++ b/inst/dilate.m
@@ -68,7 +68,6 @@
   ## Filtering must be done with the reflection of the structuring element (they
   ## are not always symmetrical)
   SE = imrotate(SE, 180);
-
   for i=1:n
     # create result matrix
     BW1=filter2(SE,BW1)>0;
@@ -81,10 +80,7 @@
 %! dilate(eye(5),ones(2,2))
 %! % returns a thick diagonal.
 
-
-
+## tests
 %!assert(dilate(eye(3),[1])==eye(3));                     # using [1] as a mask returns the same value
 %!assert(dilate(eye(3),[1,0,0])==[0,0,0;1,0,0;0,1,0]);    # check if it works with non-symmetric SE
-## TODO the next assertion is commented since we do not know how the right answer for the calculation
-%!##assert(dilate(eye(3),[1,0,0,0])==XXX); # test if center is correctly calculated on even masks
-
+%!assert(dilate(eye(3),[1,0,0,0])==[0,0,0;1,0,0;0,1,0]);  # test if center is correctly calculated on even masks