From: Baylis S. <bsh...@ho...> - 2010-08-29 01:11:53
|
octave-3.2.4:36> bwconncomp([0 1 1 ; 0 1 0]) error: sub2ind: index out of range error: called from: error: /usr/share/octave/3.2.4/m/general/sub2ind.m at line 58, column 8 error: /usr/share/octave/packages/3.2/image-1.0.12/bwconncomp.m at line 61, column 12 The problem seems to be that bwboundaries returns a boundary outside of the image. Is this correct behavior? octave-3.2.4:35> B = bwboundaries([0 1 1 ; 0 1 0], 4) B = { [1,1] = 2 1 2 2 2 1 3 1 2 1 [2,1] = 1 1 1 2 1 1 [3,1] = 2 3 } I'm a little confused as to what the output format is; bwconncomp seems to think that it reverses the x and y coordinates. But in any case, either (3,1) is outside to image, or (2,3) is (because if it's reversed, then 2,3 becomes 3,2). If bwboundaries is supposed to return boundaries outside the image, then bwconncomp should be adjusted. thanks, bayle |