Hi Jordi

My initial impression if your newest bwlabeln implementation seems good! It's 
not so easy to test this exhaustively of course. But for instance this works

tmp=ones(2,2,3);
% add another "blob" somewhere further away
tmp(3:4, 4:6, 2:3)=ones(2,3,2);
res=bwlabeln(tmp~=0);
% we should have found 2 blobs
expectedres=ones(2,2,3);
expectedres(3:4, 4:6, 2:3)=ones(2,3,2)*2;
assert(res, expectedres)

The test above is somewhat problematic, as bwlabeln could just as well have 
found the blobs in different order. I haven't bothered to come up with a better 
test code.

I have only 1 problem. In my matlab code, I normally pass a (double) array with 
0,1 to bwlabeln. This doesn't work for your implementation:

bwlabeln(ones([2,2,3]))
error: bwlabeln: first input argument must be a 'logical' ND-array

I can fix this by converting to bools of course

bwlabeln(ones([2,2,3]~=0))

but for matlab compatibility, ideally bwlabeln would do that itself. The same 
holds for bwlabel by the way.

Thanks for this!

Kris
> -----Original Message-----
> From: jord...@gmail.com [mailto:jord...@gmail.com] On Behalf Of Jordi
> Gutiérrez Hermoso
> Sent: 05 September 2012 21:15
> To: Kris Thielemans
> Cc: Octave Forge List
> Subject: Re: [OctDev] bwlabeln "finished"
> 
> Just a heads up to everyone, I've improved the bwlabeln code a bit to
> make it faster. Please let me know how it works for you.
> 
> TIA,
> - 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

Reply via email to