Hi

I'm getting some strange results using imdilate. I've been comparing
the output from imdilate with several text-book examples and I haven't
got it right yet (with non-symmetrical structuring elements at least)

code example:

image = [
0 0 0 0 0 0
0 1 0 1 0 0
0 1 1 0 1 0
0 1 1 1 0 0
0 0 0 0 0 0
];

se = [
0 0 0
0 1 0
0 1 1
];

imdilate(image, se)
ans =

  0   1   1   1   1   0   0
  0   1   1   1   1   1   0
  0   1   1   1   1   1   0
  0   0   1   1   1   0   0
  0   0   0   0   0   0   0

However, I should have got
  0   0   0   0   0   0   0
  0   0   1   0   1   0   0
  0   0   1   1   1   1   0
  0   0   1   1   1   1   1
  0   0   1   1   1   1   0

I almost get it right if I calculate dilation through erosion of the
image complement,

!imerode (!image, imrotate(se, 180))
ans =

   1   1   1   1   1   1   1
   1   0   1   0   1   0   0
   1   0   1   1   1   1   0
   1   0   1   1   1   1   1
   1   0   1   1   1   1   0

only the first row and column are wrong because when doing the erosion
the "outside of image" are cosidered zeros and not ones so it's not
really the complement of the image.

Or maybe I'm just completely wrong, I only started working on
morphological processing this week.

Carnë Draug

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Octave-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to