From: Jordi G. H. <jo...@oc...> - 2012-09-07 15:02:51
|
On 6 September 2012 04:45, Søren Hauberg <so...@ha...> wrote: > > On Sep 5, 2012, at 11:51 PM, Jordi Gutiérrez Hermoso wrote: > >> regionprops does a bunch of things, most of which make sense for >> N-dimensional images. I attach a proposed diff to address this. Can >> anyone give me some review before I commit it? > > > Your changes seem good. A few comments (though not a complete review): I have just committed my changes: http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/main/image/inst/regionprops.m?r1=10977&r2=10976&pathrev=10977 I ended up doing a lot more changes than the really bad diff I showed you originally. I did some Nd indexing tricks there, and I used nthargout, which is a function I wrote for Octave 3.6.x. I hope this is acceptable. > 1) You check if you should use 'bwlabel' or 'bwlabeln'. Shouldn't > this check rather be part of 'bwlabeln', i.e. for 2D inputs, > 'bwlabeln' can just call 'bwlabel' ? In Matlab, bwlabel and bwlabeln use different algorithms. I didn't analyse the bwlabel algorithm too closely, but I suppose it's better suited for 2d images than the bwlabeln algorithm (union-find). > 2) Not all properties are meaningful for ND input. The previous code > checked that the input was 2D and gave an error otherwise. You have > removed this check, which makes sense given that we now support ND > input. But shouldn't there be some input checking for properties > that only work for 2D input? I think most properties make sense for ND input. I warned and refused to return a result for those that seemed to make no sense for ND input. These were only perimeter and orientation. > 3) I guess the documentation needs to be updated as well? Oh, yes. I suppose. I'll do that later. I gotta rush to make this work for some deadline at work. ;-) Since this seemed like a significant overhaul, I added myself to the copyright line. - Jordi G. H. |