On 6 September 2012 04:45, Søren Hauberg <so...@hauberg.org> 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. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Octave-dev mailing list Octave-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/octave-dev