Hi I got someone to test this in MatLab for comparison. Those assertions also fail there and the new version of our image package does calculates the dilation like MatLab (except when using odd sized Structuring Elements). With a SE, 4 pixels wide MatLab considers pixel #2 the center while our image package considers pixel #3 the center. I don't know if this a bug of theirs or ours.
Anyway, here's how imdilate behaves in Matlab compared to dilate on octave image package 1.0.13 and 1.0.14 in case someone smarter than me can fix it (or decide there's nothing to fix -- aside the assertion at the end of the function which is clearly wrong). Carnë Draug Matlab: imdilate(logical(eye(3)), [1 0 0]) 0 0 0 1 0 0 0 1 0 imdilate(logical(eye(3)), [1 0 0 0]) 0 0 0 1 0 0 0 1 0 imdilate(logical(eye(5)), [1 0 0 0]) 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 Octave - image 1.0.13: dilate(logical(eye(3)), logical([1 0 0])) 0 1 0 0 0 1 0 0 0 dilate(logical(eye(3)), logical([1 0 0 0])) 0 1 0 0 0 1 0 0 0 dilate(logical(eye(5)), logical([1 0 0 0])) 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 Octave - image 1.0.14: dilate(logical(eye(3)), logical([1 0 0])) 0 0 0 1 0 0 0 1 0 Octave - image 1.0.14: dilate(logical(eye(3)), logical([1 0 0 0])) 0 0 0 0 0 0 1 0 0 Octave - image 1.0.14: dilate(logical(eye(5)), logical([1 0 0 0])) 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 2011/4/13 Carnë Draug <carandraug+...@gmail.com>: > Hey, > > just fixed that. The assert was wrong. The dilation of eye(3) by [ 1 0 > 0] is [ 0 0 0 ; 1 0 0 ; 0 1 0 ] and not [ 0 1 0 ; 0 0 1 ; 0 0 0 ] as > was given to assert as the right answer. > > But for the last assert (which seems to also fail in the new version) > I don't know the right answer. It uses an even sized structuring > element (SE) so I have no idea which pixel would be considered the > origin (it should be the middle one). But the given answer does look > wrong to me. If anyone can fix that would be great. > > Carnë Draug > > > On 13 April 2011 21:49, Thomas Weber <twe...@debian.org> wrote: >> Hi, >> the change in rev 7538 to dilate.m results in failing tests (at least >> with Octave 3.2.4): >> Without the patch: >> octave:1> test dilate >> PASSES 3 out of 3 tests >> >> With the patch: >> octave:1> test dilate >> ***** assert(dilate(eye(3),[1,0,0])==[[0;0],eye(2);0,0,0]); >> !!!!! test failed >> assert (dilate (eye (3), [1, 0, 0]) == [[0; 0], eye(2); 0, 0, 0]) >> >> Thomas >> ------------------------------------------------------------------------------ Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev _______________________________________________ Octave-dev mailing list Octave-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/octave-dev